repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.prj_remove_user | def prj_remove_user(self, *args, **kwargs):
"""Remove the, in the user table view selected, user.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_user_tablev.currentIndex()
item = i.internalPointer()
... | python | def prj_remove_user(self, *args, **kwargs):
"""Remove the, in the user table view selected, user.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_user_tablev.currentIndex()
item = i.internalPointer()
... | [
"def",
"prj_remove_user",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"i",
"=",
"self",
".",
"prj_user_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalP... | Remove the, in the user table view selected, user.
:returns: None
:rtype: None
:raises: None | [
"Remove",
"the",
"in",
"the",
"user",
"table",
"view",
"selected",
"user",
"."
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1395-L1410 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.prj_create_user | def prj_create_user(self, *args, **kwargs):
"""Create a new project
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
user = self.create_user(projects=[self.cur_prj])
if user:
userdata = djitemdata.UserItemD... | python | def prj_create_user(self, *args, **kwargs):
"""Create a new project
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
user = self.create_user(projects=[self.cur_prj])
if user:
userdata = djitemdata.UserItemD... | [
"def",
"prj_create_user",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"user",
"=",
"self",
".",
"create_user",
"(",
"projects",
"=",
"[",
"self",
".",
"cur_prj",
"]",
")",
"i... | Create a new project
:returns: None
:rtype: None
:raises: None | [
"Create",
"a",
"new",
"project"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1412-L1424 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.create_user | def create_user(self, projects=None, tasks=None):
"""Create and return a new user
:param projects: the projects for the user
:type projects: list of :class:`jukeboxcore.djadapter.models.Project`
:param tasks: the tasks for the user
:type tasks: list of :class:`jukeboxcore.djadap... | python | def create_user(self, projects=None, tasks=None):
"""Create and return a new user
:param projects: the projects for the user
:type projects: list of :class:`jukeboxcore.djadapter.models.Project`
:param tasks: the tasks for the user
:type tasks: list of :class:`jukeboxcore.djadap... | [
"def",
"create_user",
"(",
"self",
",",
"projects",
"=",
"None",
",",
"tasks",
"=",
"None",
")",
":",
"projects",
"=",
"projects",
"or",
"[",
"]",
"tasks",
"=",
"tasks",
"or",
"[",
"]",
"dialog",
"=",
"UserCreatorDialog",
"(",
"projects",
"=",
"project... | Create and return a new user
:param projects: the projects for the user
:type projects: list of :class:`jukeboxcore.djadapter.models.Project`
:param tasks: the tasks for the user
:type tasks: list of :class:`jukeboxcore.djadapter.models.Task`
:returns: The created user or None
... | [
"Create",
"and",
"return",
"a",
"new",
"user"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1426-L1445 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.view_user | def view_user(self, user):
"""View the given user on the user page
:param user: the user to view
:type user: :class:`jukeboxcore.djadapter.models.User`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing user %s', user.username)
self.... | python | def view_user(self, user):
"""View the given user on the user page
:param user: the user to view
:type user: :class:`jukeboxcore.djadapter.models.User`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing user %s', user.username)
self.... | [
"def",
"view_user",
"(",
"self",
",",
"user",
")",
":",
"log",
".",
"debug",
"(",
"'Viewing user %s'",
",",
"user",
".",
"username",
")",
"self",
".",
"cur_user",
"=",
"None",
"self",
".",
"pages_tabw",
".",
"setCurrentIndex",
"(",
"9",
")",
"self",
".... | View the given user on the user page
:param user: the user to view
:type user: :class:`jukeboxcore.djadapter.models.User`
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"given",
"user",
"on",
"the",
"user",
"page"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1447-L1532 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.prj_show_path | def prj_show_path(self, ):
"""Show the dir in the a filebrowser of the project
:returns: None
:rtype: None
:raises: None
"""
f = self.prj_path_le.text()
osinter = ostool.get_interface()
osinter.open_path(f) | python | def prj_show_path(self, ):
"""Show the dir in the a filebrowser of the project
:returns: None
:rtype: None
:raises: None
"""
f = self.prj_path_le.text()
osinter = ostool.get_interface()
osinter.open_path(f) | [
"def",
"prj_show_path",
"(",
"self",
",",
")",
":",
"f",
"=",
"self",
".",
"prj_path_le",
".",
"text",
"(",
")",
"osinter",
"=",
"ostool",
".",
"get_interface",
"(",
")",
"osinter",
".",
"open_path",
"(",
"f",
")"
] | Show the dir in the a filebrowser of the project
:returns: None
:rtype: None
:raises: None | [
"Show",
"the",
"dir",
"in",
"the",
"a",
"filebrowser",
"of",
"the",
"project"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1534-L1543 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.prj_save | def prj_save(self):
"""Save the current project
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
desc = self.prj_desc_pte.toPlainText()
semester = self.prj_semester_le.text()
fps = self.prj_fps_dsb.value()
... | python | def prj_save(self):
"""Save the current project
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
desc = self.prj_desc_pte.toPlainText()
semester = self.prj_semester_le.text()
fps = self.prj_fps_dsb.value()
... | [
"def",
"prj_save",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"desc",
"=",
"self",
".",
"prj_desc_pte",
".",
"toPlainText",
"(",
")",
"semester",
"=",
"self",
".",
"prj_semester_le",
".",
"text",
"(",
")",
"fps",
"=",
... | Save the current project
:returns: None
:rtype: None
:raises: None | [
"Save",
"the",
"current",
"project"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1545-L1567 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.seq_save | def seq_save(self):
"""Save the current sequence
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_seq:
return
desc = self.seq_desc_pte.toPlainText()
self.cur_seq.description = desc
self.cur_seq.save() | python | def seq_save(self):
"""Save the current sequence
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_seq:
return
desc = self.seq_desc_pte.toPlainText()
self.cur_seq.description = desc
self.cur_seq.save() | [
"def",
"seq_save",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"cur_seq",
":",
"return",
"desc",
"=",
"self",
".",
"seq_desc_pte",
".",
"toPlainText",
"(",
")",
"self",
".",
"cur_seq",
".",
"description",
"=",
"desc",
"self",
".",
"cur_seq",
".",
... | Save the current sequence
:returns: None
:rtype: None
:raises: None | [
"Save",
"the",
"current",
"sequence"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1569-L1581 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.seq_view_shot | def seq_view_shot(self, ):
"""View the shot that is selected in the table view of the sequence page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_seq:
return
i = self.seq_shot_tablev.currentIndex()
item = i.internalPointer()
... | python | def seq_view_shot(self, ):
"""View the shot that is selected in the table view of the sequence page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_seq:
return
i = self.seq_shot_tablev.currentIndex()
item = i.internalPointer()
... | [
"def",
"seq_view_shot",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_seq",
":",
"return",
"i",
"=",
"self",
".",
"seq_shot_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"s... | View the shot that is selected in the table view of the sequence page
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"shot",
"that",
"is",
"selected",
"in",
"the",
"table",
"view",
"of",
"the",
"sequence",
"page"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1594-L1607 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.seq_create_shot | def seq_create_shot(self, *args, **kwargs):
"""Create a new shot
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_seq:
return
shot = self.create_shot(sequence=self.cur_seq)
if shot:
shotdata = djitemdata.ShotItemData(s... | python | def seq_create_shot(self, *args, **kwargs):
"""Create a new shot
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_seq:
return
shot = self.create_shot(sequence=self.cur_seq)
if shot:
shotdata = djitemdata.ShotItemData(s... | [
"def",
"seq_create_shot",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_seq",
":",
"return",
"shot",
"=",
"self",
".",
"create_shot",
"(",
"sequence",
"=",
"self",
".",
"cur_seq",
")",
"if",
"shot",
... | Create a new shot
:returns: None
:rtype: None
:raises: None | [
"Create",
"a",
"new",
"shot"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1609-L1621 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.view_shot | def view_shot(self, shot):
"""View the given shot
:param shot: the shot to view
:type shot: :class:`jukeboxcore.djadapter.models.Shot`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing shot %s', shot.name)
self.cur_shot = None
... | python | def view_shot(self, shot):
"""View the given shot
:param shot: the shot to view
:type shot: :class:`jukeboxcore.djadapter.models.Shot`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing shot %s', shot.name)
self.cur_shot = None
... | [
"def",
"view_shot",
"(",
"self",
",",
"shot",
")",
":",
"log",
".",
"debug",
"(",
"'Viewing shot %s'",
",",
"shot",
".",
"name",
")",
"self",
".",
"cur_shot",
"=",
"None",
"self",
".",
"pages_tabw",
".",
"setCurrentIndex",
"(",
"3",
")",
"self",
".",
... | View the given shot
:param shot: the shot to view
:type shot: :class:`jukeboxcore.djadapter.models.Shot`
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"given",
"shot"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1623-L1668 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.create_shot | def create_shot(self, sequence):
"""Create and return a new shot
:param sequence: the sequence for the shot
:type sequence: :class:`jukeboxcore.djadapter.models.Sequence`
:returns: The created shot or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Shot`
:raises... | python | def create_shot(self, sequence):
"""Create and return a new shot
:param sequence: the sequence for the shot
:type sequence: :class:`jukeboxcore.djadapter.models.Sequence`
:returns: The created shot or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Shot`
:raises... | [
"def",
"create_shot",
"(",
"self",
",",
"sequence",
")",
":",
"dialog",
"=",
"ShotCreatorDialog",
"(",
"sequence",
"=",
"sequence",
",",
"parent",
"=",
"self",
")",
"dialog",
".",
"exec_",
"(",
")",
"shot",
"=",
"dialog",
".",
"shot",
"return",
"shot"
] | Create and return a new shot
:param sequence: the sequence for the shot
:type sequence: :class:`jukeboxcore.djadapter.models.Sequence`
:returns: The created shot or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Shot`
:raises: None | [
"Create",
"and",
"return",
"a",
"new",
"shot"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1670-L1682 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.shot_view_task | def shot_view_task(self, ):
"""View the task that is currently selected on the shot page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
i = self.shot_task_tablev.currentIndex()
item = i.internalPointer()
if... | python | def shot_view_task(self, ):
"""View the task that is currently selected on the shot page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
i = self.shot_task_tablev.currentIndex()
item = i.internalPointer()
if... | [
"def",
"shot_view_task",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_shot",
":",
"return",
"i",
"=",
"self",
".",
"shot_task_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
... | View the task that is currently selected on the shot page
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"task",
"that",
"is",
"currently",
"selected",
"on",
"the",
"shot",
"page"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1708-L1722 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.shot_view_asset | def shot_view_asset(self, ):
"""View the task that is currently selected on the shot page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
i = self.shot_asset_treev.currentIndex()
item = i.internalPointer()
i... | python | def shot_view_asset(self, ):
"""View the task that is currently selected on the shot page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
i = self.shot_asset_treev.currentIndex()
item = i.internalPointer()
i... | [
"def",
"shot_view_asset",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_shot",
":",
"return",
"i",
"=",
"self",
".",
"shot_asset_treev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
... | View the task that is currently selected on the shot page
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"task",
"that",
"is",
"currently",
"selected",
"on",
"the",
"shot",
"page"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1724-L1739 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.shot_create_task | def shot_create_task(self, *args, **kwargs):
"""Create a new task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
task = self.create_task(element=self.cur_shot)
if task:
taskdata = djitemdata.TaskItemData... | python | def shot_create_task(self, *args, **kwargs):
"""Create a new task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
task = self.create_task(element=self.cur_shot)
if task:
taskdata = djitemdata.TaskItemData... | [
"def",
"shot_create_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_shot",
":",
"return",
"task",
"=",
"self",
".",
"create_task",
"(",
"element",
"=",
"self",
".",
"cur_shot",
")",
"if",
"task"... | Create a new task
:returns: None
:rtype: None
:raises: None | [
"Create",
"a",
"new",
"task"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1741-L1753 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.create_task | def create_task(self, element):
"""Create a new task for the given element
:param element: the element for the task
:type element: :class:`jukeboxcore.djadapter.models.Shot` | :class:`jukeboxcore.djadapter.models.Asset`
:returns: None
:rtype: None
:raises: None
"... | python | def create_task(self, element):
"""Create a new task for the given element
:param element: the element for the task
:type element: :class:`jukeboxcore.djadapter.models.Shot` | :class:`jukeboxcore.djadapter.models.Asset`
:returns: None
:rtype: None
:raises: None
"... | [
"def",
"create_task",
"(",
"self",
",",
"element",
")",
":",
"dialog",
"=",
"TaskCreatorDialog",
"(",
"element",
"=",
"element",
",",
"parent",
"=",
"self",
")",
"dialog",
".",
"exec_",
"(",
")",
"task",
"=",
"dialog",
".",
"task",
"return",
"task"
] | Create a new task for the given element
:param element: the element for the task
:type element: :class:`jukeboxcore.djadapter.models.Shot` | :class:`jukeboxcore.djadapter.models.Asset`
:returns: None
:rtype: None
:raises: None | [
"Create",
"a",
"new",
"task",
"for",
"the",
"given",
"element"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1755-L1767 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.view_asset | def view_asset(self, asset):
"""View the given asset
:param asset: the asset to view
:type asset: :class:`jukeboxcore.djadapter.models.Asset`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing asset %s', asset.name)
self.cur_asset = ... | python | def view_asset(self, asset):
"""View the given asset
:param asset: the asset to view
:type asset: :class:`jukeboxcore.djadapter.models.Asset`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing asset %s', asset.name)
self.cur_asset = ... | [
"def",
"view_asset",
"(",
"self",
",",
"asset",
")",
":",
"log",
".",
"debug",
"(",
"'Viewing asset %s'",
",",
"asset",
".",
"name",
")",
"self",
".",
"cur_asset",
"=",
"None",
"self",
".",
"pages_tabw",
".",
"setCurrentIndex",
"(",
"5",
")",
"name",
"... | View the given asset
:param asset: the asset to view
:type asset: :class:`jukeboxcore.djadapter.models.Asset`
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"given",
"asset"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1769-L1816 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.shot_add_asset | def shot_add_asset(self, *args, **kwargs):
"""Add more assets to the shot.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
dialog = AssetAdderDialog(shot=self.cur_shot)
dialog.exec_()
assets = dialog.assets
... | python | def shot_add_asset(self, *args, **kwargs):
"""Add more assets to the shot.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
dialog = AssetAdderDialog(shot=self.cur_shot)
dialog.exec_()
assets = dialog.assets
... | [
"def",
"shot_add_asset",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_shot",
":",
"return",
"dialog",
"=",
"AssetAdderDialog",
"(",
"shot",
"=",
"self",
".",
"cur_shot",
")",
"dialog",
".",
"exec_",
... | Add more assets to the shot.
:returns: None
:rtype: None
:raises: None | [
"Add",
"more",
"assets",
"to",
"the",
"shot",
"."
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1818-L1841 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.shot_remove_asset | def shot_remove_asset(self, *args, **kwargs):
"""Remove the, in the asset table view selected, asset.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
i = self.shot_asset_treev.currentIndex()
item = i.internalPointer(... | python | def shot_remove_asset(self, *args, **kwargs):
"""Remove the, in the asset table view selected, asset.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
i = self.shot_asset_treev.currentIndex()
item = i.internalPointer(... | [
"def",
"shot_remove_asset",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_shot",
":",
"return",
"i",
"=",
"self",
".",
"shot_asset_treev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"inter... | Remove the, in the asset table view selected, asset.
:returns: None
:rtype: None
:raises: None | [
"Remove",
"the",
"in",
"the",
"asset",
"table",
"view",
"selected",
"asset",
"."
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1843-L1860 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.shot_create_asset | def shot_create_asset(self, *args, **kwargs):
"""Create a new shot
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
asset = self.create_asset(project=self.cur_shot.project, shot=self.cur_shot)
if not asset:
... | python | def shot_create_asset(self, *args, **kwargs):
"""Create a new shot
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
asset = self.create_asset(project=self.cur_shot.project, shot=self.cur_shot)
if not asset:
... | [
"def",
"shot_create_asset",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_shot",
":",
"return",
"asset",
"=",
"self",
".",
"create_asset",
"(",
"project",
"=",
"self",
".",
"cur_shot",
".",
"project",
... | Create a new shot
:returns: None
:rtype: None
:raises: None | [
"Create",
"a",
"new",
"shot"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1862-L1883 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.create_asset | def create_asset(self, project, atype=None, shot=None, asset=None):
"""Create and return a new asset
:param project: the project for the asset
:type project: :class:`jukeboxcore.djadapter.models.Project`
:param atype: the assettype of the asset
:type atype: :class:`jukeboxcore.d... | python | def create_asset(self, project, atype=None, shot=None, asset=None):
"""Create and return a new asset
:param project: the project for the asset
:type project: :class:`jukeboxcore.djadapter.models.Project`
:param atype: the assettype of the asset
:type atype: :class:`jukeboxcore.d... | [
"def",
"create_asset",
"(",
"self",
",",
"project",
",",
"atype",
"=",
"None",
",",
"shot",
"=",
"None",
",",
"asset",
"=",
"None",
")",
":",
"element",
"=",
"shot",
"or",
"asset",
"dialog",
"=",
"AssetCreatorDialog",
"(",
"project",
"=",
"project",
",... | Create and return a new asset
:param project: the project for the asset
:type project: :class:`jukeboxcore.djadapter.models.Project`
:param atype: the assettype of the asset
:type atype: :class:`jukeboxcore.djadapter.models.Atype`
:param shot: the shot to add the asset to
... | [
"Create",
"and",
"return",
"a",
"new",
"asset"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1885-L1906 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.view_task | def view_task(self, task):
"""View the given task
:param task: the task to view
:type task: :class:`jukeboxcore.djadapter.models.Task`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing task %s', task.name)
self.cur_task = None
... | python | def view_task(self, task):
"""View the given task
:param task: the task to view
:type task: :class:`jukeboxcore.djadapter.models.Task`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing task %s', task.name)
self.cur_task = None
... | [
"def",
"view_task",
"(",
"self",
",",
"task",
")",
":",
"log",
".",
"debug",
"(",
"'Viewing task %s'",
",",
"task",
".",
"name",
")",
"self",
".",
"cur_task",
"=",
"None",
"self",
".",
"pages_tabw",
".",
"setCurrentIndex",
"(",
"7",
")",
"self",
".",
... | View the given task
:param task: the task to view
:type task: :class:`jukeboxcore.djadapter.models.Task`
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"given",
"task"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1908-L1937 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.shot_save | def shot_save(self, ):
"""Save the current shot
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
desc = self.shot_desc_pte.toPlainText()
start = self.shot_start_sb.value()
end = self.shot_end_sb.value()
... | python | def shot_save(self, ):
"""Save the current shot
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_shot:
return
desc = self.shot_desc_pte.toPlainText()
start = self.shot_start_sb.value()
end = self.shot_end_sb.value()
... | [
"def",
"shot_save",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_shot",
":",
"return",
"desc",
"=",
"self",
".",
"shot_desc_pte",
".",
"toPlainText",
"(",
")",
"start",
"=",
"self",
".",
"shot_start_sb",
".",
"value",
"(",
")",
"end",
"... | Save the current shot
:returns: None
:rtype: None
:raises: None | [
"Save",
"the",
"current",
"shot"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1939-L1957 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.asset_view_prj | def asset_view_prj(self, ):
"""View the project of the current asset
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
prj = self.cur_asset.project
self.view_prj(prj) | python | def asset_view_prj(self, ):
"""View the project of the current asset
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
prj = self.cur_asset.project
self.view_prj(prj) | [
"def",
"asset_view_prj",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_asset",
":",
"return",
"prj",
"=",
"self",
".",
"cur_asset",
".",
"project",
"self",
".",
"view_prj",
"(",
"prj",
")"
] | View the project of the current asset
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"project",
"of",
"the",
"current",
"asset"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1959-L1970 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.asset_view_atype | def asset_view_atype(self, ):
"""View the project of the current atype
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
atype = self.cur_asset.atype
self.view_atype(atype) | python | def asset_view_atype(self, ):
"""View the project of the current atype
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
atype = self.cur_asset.atype
self.view_atype(atype) | [
"def",
"asset_view_atype",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_asset",
":",
"return",
"atype",
"=",
"self",
".",
"cur_asset",
".",
"atype",
"self",
".",
"view_atype",
"(",
"atype",
")"
] | View the project of the current atype
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"project",
"of",
"the",
"current",
"atype"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1972-L1983 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.atype_view_asset | def atype_view_asset(self, ):
"""View the project of the current assettype
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_atype:
return
i = self.atype_asset_treev.currentIndex()
item = i.internalPointer()
if item:
... | python | def atype_view_asset(self, ):
"""View the project of the current assettype
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_atype:
return
i = self.atype_asset_treev.currentIndex()
item = i.internalPointer()
if item:
... | [
"def",
"atype_view_asset",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_atype",
":",
"return",
"i",
"=",
"self",
".",
"atype_asset_treev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":... | View the project of the current assettype
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"project",
"of",
"the",
"current",
"assettype"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1985-L2000 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.atype_create_asset | def atype_create_asset(self, ):
"""Create a new asset
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_atype:
return
asset = self.create_asset(project=self.cur_prj, atype=self.cur_atype)
if not asset:
return
... | python | def atype_create_asset(self, ):
"""Create a new asset
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_atype:
return
asset = self.create_asset(project=self.cur_prj, atype=self.cur_atype)
if not asset:
return
... | [
"def",
"atype_create_asset",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_atype",
":",
"return",
"asset",
"=",
"self",
".",
"create_asset",
"(",
"project",
"=",
"self",
".",
"cur_prj",
",",
"atype",
"=",
"self",
".",
"cur_atype",
")",
"if... | Create a new asset
:returns: None
:rtype: None
:raises: None | [
"Create",
"a",
"new",
"asset"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2002-L2017 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.atype_save | def atype_save(self):
"""Save the current atype
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_atype:
return
desc = self.atype_desc_pte.toPlainText()
self.cur_atype.description = desc
self.cur_atype.save() | python | def atype_save(self):
"""Save the current atype
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_atype:
return
desc = self.atype_desc_pte.toPlainText()
self.cur_atype.description = desc
self.cur_atype.save() | [
"def",
"atype_save",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"cur_atype",
":",
"return",
"desc",
"=",
"self",
".",
"atype_desc_pte",
".",
"toPlainText",
"(",
")",
"self",
".",
"cur_atype",
".",
"description",
"=",
"desc",
"self",
".",
"cur_atype... | Save the current atype
:returns: None
:rtype: None
:raises: None | [
"Save",
"the",
"current",
"atype"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2019-L2031 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.asset_view_asset | def asset_view_asset(self, ):
"""View the task that is currently selected on the asset page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
i = self.asset_asset_treev.currentIndex()
item = i.internalPointer()
... | python | def asset_view_asset(self, ):
"""View the task that is currently selected on the asset page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
i = self.asset_asset_treev.currentIndex()
item = i.internalPointer()
... | [
"def",
"asset_view_asset",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_asset",
":",
"return",
"i",
"=",
"self",
".",
"asset_asset_treev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":... | View the task that is currently selected on the asset page
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"task",
"that",
"is",
"currently",
"selected",
"on",
"the",
"asset",
"page"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2033-L2048 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.asset_add_asset | def asset_add_asset(self, *args, **kwargs):
"""Add more assets to the asset.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
dialog = AssetAdderDialog(asset=self.cur_asset)
dialog.exec_()
assets = dialog.ass... | python | def asset_add_asset(self, *args, **kwargs):
"""Add more assets to the asset.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
dialog = AssetAdderDialog(asset=self.cur_asset)
dialog.exec_()
assets = dialog.ass... | [
"def",
"asset_add_asset",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_asset",
":",
"return",
"dialog",
"=",
"AssetAdderDialog",
"(",
"asset",
"=",
"self",
".",
"cur_asset",
")",
"dialog",
".",
"exec_... | Add more assets to the asset.
:returns: None
:rtype: None
:raises: None | [
"Add",
"more",
"assets",
"to",
"the",
"asset",
"."
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2050-L2073 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.asset_remove_asset | def asset_remove_asset(self, *args, **kwargs):
"""Remove the, in the asset table view selected, asset.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
i = self.asset_asset_treev.currentIndex()
item = i.internalPoint... | python | def asset_remove_asset(self, *args, **kwargs):
"""Remove the, in the asset table view selected, asset.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
i = self.asset_asset_treev.currentIndex()
item = i.internalPoint... | [
"def",
"asset_remove_asset",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_asset",
":",
"return",
"i",
"=",
"self",
".",
"asset_asset_treev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"in... | Remove the, in the asset table view selected, asset.
:returns: None
:rtype: None
:raises: None | [
"Remove",
"the",
"in",
"the",
"asset",
"table",
"view",
"selected",
"asset",
"."
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2075-L2092 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.asset_create_asset | def asset_create_asset(self, *args, **kwargs):
"""Create a new asset
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
asset = self.create_asset(project=self.cur_asset.project, asset=self.cur_asset)
if not asset:
... | python | def asset_create_asset(self, *args, **kwargs):
"""Create a new asset
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
asset = self.create_asset(project=self.cur_asset.project, asset=self.cur_asset)
if not asset:
... | [
"def",
"asset_create_asset",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_asset",
":",
"return",
"asset",
"=",
"self",
".",
"create_asset",
"(",
"project",
"=",
"self",
".",
"cur_asset",
".",
"project... | Create a new asset
:returns: None
:rtype: None
:raises: None | [
"Create",
"a",
"new",
"asset"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2094-L2115 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.asset_view_task | def asset_view_task(self, ):
"""View the task that is currently selected on the asset page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
i = self.asset_task_tablev.currentIndex()
item = i.internalPointer()
... | python | def asset_view_task(self, ):
"""View the task that is currently selected on the asset page
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
i = self.asset_task_tablev.currentIndex()
item = i.internalPointer()
... | [
"def",
"asset_view_task",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_asset",
":",
"return",
"i",
"=",
"self",
".",
"asset_task_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":"... | View the task that is currently selected on the asset page
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"task",
"that",
"is",
"currently",
"selected",
"on",
"the",
"asset",
"page"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2117-L2131 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.asset_create_task | def asset_create_task(self, *args, **kwargs):
"""Create a new task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
task = self.create_task(element=self.cur_asset)
if task:
taskdata = djitemdata.TaskItemD... | python | def asset_create_task(self, *args, **kwargs):
"""Create a new task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
task = self.create_task(element=self.cur_asset)
if task:
taskdata = djitemdata.TaskItemD... | [
"def",
"asset_create_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_asset",
":",
"return",
"task",
"=",
"self",
".",
"create_task",
"(",
"element",
"=",
"self",
".",
"cur_asset",
")",
"if",
"ta... | Create a new task
:returns: None
:rtype: None
:raises: None | [
"Create",
"a",
"new",
"task"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2133-L2145 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.asset_save | def asset_save(self):
"""Save the current asset
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
desc = self.asset_desc_pte.toPlainText()
self.cur_asset.description = desc
self.cur_asset.save() | python | def asset_save(self):
"""Save the current asset
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_asset:
return
desc = self.asset_desc_pte.toPlainText()
self.cur_asset.description = desc
self.cur_asset.save() | [
"def",
"asset_save",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"cur_asset",
":",
"return",
"desc",
"=",
"self",
".",
"asset_desc_pte",
".",
"toPlainText",
"(",
")",
"self",
".",
"cur_asset",
".",
"description",
"=",
"desc",
"self",
".",
"cur_asset... | Save the current asset
:returns: None
:rtype: None
:raises: None | [
"Save",
"the",
"current",
"asset"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2147-L2159 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.dep_view_prj | def dep_view_prj(self, ):
"""View the project that is currently selected
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_dep:
return
i = self.dep_prj_tablev.currentIndex()
item = i.internalPointer()
if item:
p... | python | def dep_view_prj(self, ):
"""View the project that is currently selected
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_dep:
return
i = self.dep_prj_tablev.currentIndex()
item = i.internalPointer()
if item:
p... | [
"def",
"dep_view_prj",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_dep",
":",
"return",
"i",
"=",
"self",
".",
"dep_prj_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"prj... | View the project that is currently selected
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"project",
"that",
"is",
"currently",
"selected"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2161-L2174 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.dep_add_prj | def dep_add_prj(self, *args, **kwargs):
"""Add projects to the current department
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_dep:
return
dialog = ProjectAdderDialog(department=self.cur_dep)
dialog.exec_()
prjs = dia... | python | def dep_add_prj(self, *args, **kwargs):
"""Add projects to the current department
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_dep:
return
dialog = ProjectAdderDialog(department=self.cur_dep)
dialog.exec_()
prjs = dia... | [
"def",
"dep_add_prj",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_dep",
":",
"return",
"dialog",
"=",
"ProjectAdderDialog",
"(",
"department",
"=",
"self",
".",
"cur_dep",
")",
"dialog",
".",
"exec_"... | Add projects to the current department
:returns: None
:rtype: None
:raises: None | [
"Add",
"projects",
"to",
"the",
"current",
"department"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2176-L2191 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.dep_remove_prj | def dep_remove_prj(self, *args, **kwargs):
"""Remove the selected project from the department
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_dep:
return
i = self.dep_prj_tablev.currentIndex()
item = i.internalPointer()
i... | python | def dep_remove_prj(self, *args, **kwargs):
"""Remove the selected project from the department
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_dep:
return
i = self.dep_prj_tablev.currentIndex()
item = i.internalPointer()
i... | [
"def",
"dep_remove_prj",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_dep",
":",
"return",
"i",
"=",
"self",
".",
"dep_prj_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPoi... | Remove the selected project from the department
:returns: None
:rtype: None
:raises: None | [
"Remove",
"the",
"selected",
"project",
"from",
"the",
"department"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2193-L2207 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.dep_save | def dep_save(self, ):
"""Save the current department
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_dep:
return
ordervalue = self.dep_ordervalue_sb.value()
desc = self.dep_desc_pte.toPlainText()
self.cur_dep.ordervalue =... | python | def dep_save(self, ):
"""Save the current department
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_dep:
return
ordervalue = self.dep_ordervalue_sb.value()
desc = self.dep_desc_pte.toPlainText()
self.cur_dep.ordervalue =... | [
"def",
"dep_save",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_dep",
":",
"return",
"ordervalue",
"=",
"self",
".",
"dep_ordervalue_sb",
".",
"value",
"(",
")",
"desc",
"=",
"self",
".",
"dep_desc_pte",
".",
"toPlainText",
"(",
")",
"sel... | Save the current department
:returns: None
:rtype: None
:raises: None | [
"Save",
"the",
"current",
"department"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2209-L2222 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.task_view_user | def task_view_user(self, ):
"""View the user that is currently selected
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
i = self.task_user_tablev.currentIndex()
item = i.internalPointer()
if item:
... | python | def task_view_user(self, ):
"""View the user that is currently selected
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
i = self.task_user_tablev.currentIndex()
item = i.internalPointer()
if item:
... | [
"def",
"task_view_user",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_task",
":",
"return",
"i",
"=",
"self",
".",
"task_user_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
... | View the user that is currently selected
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"user",
"that",
"is",
"currently",
"selected"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2224-L2237 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.task_add_user | def task_add_user(self, *args, **kwargs):
"""Add users to the current task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
dialog = UserAdderDialog(task=self.cur_task)
dialog.exec_()
users = dialog.users
... | python | def task_add_user(self, *args, **kwargs):
"""Add users to the current task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
dialog = UserAdderDialog(task=self.cur_task)
dialog.exec_()
users = dialog.users
... | [
"def",
"task_add_user",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_task",
":",
"return",
"dialog",
"=",
"UserAdderDialog",
"(",
"task",
"=",
"self",
".",
"cur_task",
")",
"dialog",
".",
"exec_",
"... | Add users to the current task
:returns: None
:rtype: None
:raises: None | [
"Add",
"users",
"to",
"the",
"current",
"task"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2239-L2254 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.task_remove_user | def task_remove_user(self, *args, **kwargs):
"""Remove the selected user from the task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
i = self.task_user_tablev.currentIndex()
item = i.internalPointer()
if it... | python | def task_remove_user(self, *args, **kwargs):
"""Remove the selected user from the task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
i = self.task_user_tablev.currentIndex()
item = i.internalPointer()
if it... | [
"def",
"task_remove_user",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_task",
":",
"return",
"i",
"=",
"self",
".",
"task_user_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"intern... | Remove the selected user from the task
:returns: None
:rtype: None
:raises: None | [
"Remove",
"the",
"selected",
"user",
"from",
"the",
"task"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2256-L2270 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.task_view_link | def task_view_link(self, ):
"""View the link of the current task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
e = self.cur_task.element
if isinstance(e, djadapter.models.Asset):
self.view_asset(e)
... | python | def task_view_link(self, ):
"""View the link of the current task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
e = self.cur_task.element
if isinstance(e, djadapter.models.Asset):
self.view_asset(e)
... | [
"def",
"task_view_link",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_task",
":",
"return",
"e",
"=",
"self",
".",
"cur_task",
".",
"element",
"if",
"isinstance",
"(",
"e",
",",
"djadapter",
".",
"models",
".",
"Asset",
")",
":",
"self"... | View the link of the current task
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"link",
"of",
"the",
"current",
"task"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2283-L2296 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.task_save | def task_save(self, ):
"""Save the current task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
deadline = self.task_deadline_de.dateTime().toPython()
status = self.task_status_cb.currentText()
self.cur_task.... | python | def task_save(self, ):
"""Save the current task
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_task:
return
deadline = self.task_deadline_de.dateTime().toPython()
status = self.task_status_cb.currentText()
self.cur_task.... | [
"def",
"task_save",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_task",
":",
"return",
"deadline",
"=",
"self",
".",
"task_deadline_de",
".",
"dateTime",
"(",
")",
".",
"toPython",
"(",
")",
"status",
"=",
"self",
".",
"task_status_cb",
"... | Save the current task
:returns: None
:rtype: None
:raises: None | [
"Save",
"the",
"current",
"task"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2298-L2311 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.users_view_user | def users_view_user(self, ):
"""View the user that is currently selected
:returns: None
:rtype: None
:raises: None
"""
i = self.users_tablev.currentIndex()
item = i.internalPointer()
if item:
user = item.internal_data()
self.view_u... | python | def users_view_user(self, ):
"""View the user that is currently selected
:returns: None
:rtype: None
:raises: None
"""
i = self.users_tablev.currentIndex()
item = i.internalPointer()
if item:
user = item.internal_data()
self.view_u... | [
"def",
"users_view_user",
"(",
"self",
",",
")",
":",
"i",
"=",
"self",
".",
"users_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"user",
"=",
"item",
".",
"internal_data",
"(",
")",
"s... | View the user that is currently selected
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"user",
"that",
"is",
"currently",
"selected"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2313-L2324 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.user_view_task | def user_view_task(self, ):
"""View the task that is selected
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_user:
return
i = self.user_task_treev.currentIndex()
item = i.internalPointer()
if item:
task = ite... | python | def user_view_task(self, ):
"""View the task that is selected
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_user:
return
i = self.user_task_treev.currentIndex()
item = i.internalPointer()
if item:
task = ite... | [
"def",
"user_view_task",
"(",
"self",
",",
")",
":",
"if",
"not",
"self",
".",
"cur_user",
":",
"return",
"i",
"=",
"self",
".",
"user_task_treev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
... | View the task that is selected
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"task",
"that",
"is",
"selected"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2326-L2340 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.user_view_prj | def user_view_prj(self, ):
"""View the project that is currently selected
:returns: None
:rtype: None
:raises: None
"""
i = self.user_prj_tablev.currentIndex()
item = i.internalPointer()
if item:
prj = item.internal_data()
self.vie... | python | def user_view_prj(self, ):
"""View the project that is currently selected
:returns: None
:rtype: None
:raises: None
"""
i = self.user_prj_tablev.currentIndex()
item = i.internalPointer()
if item:
prj = item.internal_data()
self.vie... | [
"def",
"user_view_prj",
"(",
"self",
",",
")",
":",
"i",
"=",
"self",
".",
"user_prj_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"prj",
"=",
"item",
".",
"internal_data",
"(",
")",
"s... | View the project that is currently selected
:returns: None
:rtype: None
:raises: None | [
"View",
"the",
"project",
"that",
"is",
"currently",
"selected"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2342-L2353 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.user_add_prj | def user_add_prj(self, *args, **kwargs):
"""Add projects to the current user
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_user:
return
dialog = ProjectAdderDialog(user=self.cur_user)
dialog.exec_()
prjs = dialog.proje... | python | def user_add_prj(self, *args, **kwargs):
"""Add projects to the current user
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_user:
return
dialog = ProjectAdderDialog(user=self.cur_user)
dialog.exec_()
prjs = dialog.proje... | [
"def",
"user_add_prj",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_user",
":",
"return",
"dialog",
"=",
"ProjectAdderDialog",
"(",
"user",
"=",
"self",
".",
"cur_user",
")",
"dialog",
".",
"exec_",
... | Add projects to the current user
:returns: None
:rtype: None
:raises: None | [
"Add",
"projects",
"to",
"the",
"current",
"user"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2355-L2370 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.user_remove_prj | def user_remove_prj(self, *args, **kwargs):
"""Remove the selected project from the user
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_user:
return
i = self.user_prj_tablev.currentIndex()
item = i.internalPointer()
if i... | python | def user_remove_prj(self, *args, **kwargs):
"""Remove the selected project from the user
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_user:
return
i = self.user_prj_tablev.currentIndex()
item = i.internalPointer()
if i... | [
"def",
"user_remove_prj",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_user",
":",
"return",
"i",
"=",
"self",
".",
"user_prj_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internal... | Remove the selected project from the user
:returns: None
:rtype: None
:raises: None | [
"Remove",
"the",
"selected",
"project",
"from",
"the",
"user"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2372-L2386 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMTWin.user_save | def user_save(self):
"""Save the current user
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_user:
return
username = self.user_username_le.text()
first = self.user_first_le.text()
last = self.user_last_le.text()
... | python | def user_save(self):
"""Save the current user
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_user:
return
username = self.user_username_le.text()
first = self.user_first_le.text()
last = self.user_last_le.text()
... | [
"def",
"user_save",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"cur_user",
":",
"return",
"username",
"=",
"self",
".",
"user_username_le",
".",
"text",
"(",
")",
"first",
"=",
"self",
".",
"user_first_le",
".",
"text",
"(",
")",
"last",
"=",
"... | Save the current user
:returns: None
:rtype: None
:raises: None | [
"Save",
"the",
"current",
"user"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2388-L2406 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/addons/guerilla/guerillamgmt.py | GuerillaMGMT.run | def run(self, parent=None):
"""Start the configeditor
:returns: None
:rtype: None
:raises: None
"""
self.gw = GuerillaMGMTWin(parent=parent)
self.gw.show() | python | def run(self, parent=None):
"""Start the configeditor
:returns: None
:rtype: None
:raises: None
"""
self.gw = GuerillaMGMTWin(parent=parent)
self.gw.show() | [
"def",
"run",
"(",
"self",
",",
"parent",
"=",
"None",
")",
":",
"self",
".",
"gw",
"=",
"GuerillaMGMTWin",
"(",
"parent",
"=",
"parent",
")",
"self",
".",
"gw",
".",
"show",
"(",
")"
] | Start the configeditor
:returns: None
:rtype: None
:raises: None | [
"Start",
"the",
"configeditor"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L2441-L2449 |
theSage21/lanchat | lanchat/chat.py | notice | def notice(txt, color=False):
"print notice"
if color:
txt = config.Col.WARNING + txt + config.Col.ENDC
print(txt) | python | def notice(txt, color=False):
"print notice"
if color:
txt = config.Col.WARNING + txt + config.Col.ENDC
print(txt) | [
"def",
"notice",
"(",
"txt",
",",
"color",
"=",
"False",
")",
":",
"if",
"color",
":",
"txt",
"=",
"config",
".",
"Col",
".",
"WARNING",
"+",
"txt",
"+",
"config",
".",
"Col",
".",
"ENDC",
"print",
"(",
"txt",
")"
] | print notice | [
"print",
"notice"
] | train | https://github.com/theSage21/lanchat/blob/66f5dcead67fef815347b956b1d3e149a7e13b29/lanchat/chat.py#L9-L13 |
theSage21/lanchat | lanchat/chat.py | stats | def stats(txt, color=False):
"Print stats"
if color:
txt = config.Col.OKBLUE + txt + config.Col.ENDC
print(txt) | python | def stats(txt, color=False):
"Print stats"
if color:
txt = config.Col.OKBLUE + txt + config.Col.ENDC
print(txt) | [
"def",
"stats",
"(",
"txt",
",",
"color",
"=",
"False",
")",
":",
"if",
"color",
":",
"txt",
"=",
"config",
".",
"Col",
".",
"OKBLUE",
"+",
"txt",
"+",
"config",
".",
"Col",
".",
"ENDC",
"print",
"(",
"txt",
")"
] | Print stats | [
"Print",
"stats"
] | train | https://github.com/theSage21/lanchat/blob/66f5dcead67fef815347b956b1d3e149a7e13b29/lanchat/chat.py#L16-L20 |
theSage21/lanchat | lanchat/chat.py | Node.run | def run(self):
"""Run self on provided screen"""
notice('Starting output thread', self.color)
o = Thread(target=self.__output_thread, name='output')
o.start()
self.threads.append(o)
try:
notice('Starting input thread', self.color)
self.__input_thre... | python | def run(self):
"""Run self on provided screen"""
notice('Starting output thread', self.color)
o = Thread(target=self.__output_thread, name='output')
o.start()
self.threads.append(o)
try:
notice('Starting input thread', self.color)
self.__input_thre... | [
"def",
"run",
"(",
"self",
")",
":",
"notice",
"(",
"'Starting output thread'",
",",
"self",
".",
"color",
")",
"o",
"=",
"Thread",
"(",
"target",
"=",
"self",
".",
"__output_thread",
",",
"name",
"=",
"'output'",
")",
"o",
".",
"start",
"(",
")",
"s... | Run self on provided screen | [
"Run",
"self",
"on",
"provided",
"screen"
] | train | https://github.com/theSage21/lanchat/blob/66f5dcead67fef815347b956b1d3e149a7e13b29/lanchat/chat.py#L40-L50 |
theSage21/lanchat | lanchat/chat.py | Node.__get_instructions | def __get_instructions(self):
"Get info from sockets"
if self.mode == 'c':
c, m = utils.recv(self.__s)
inst = [(c, m, self.__s)]
else:
inst = []
with self.__client_list_lock:
for com in self.clients:
c, m = utils... | python | def __get_instructions(self):
"Get info from sockets"
if self.mode == 'c':
c, m = utils.recv(self.__s)
inst = [(c, m, self.__s)]
else:
inst = []
with self.__client_list_lock:
for com in self.clients:
c, m = utils... | [
"def",
"__get_instructions",
"(",
"self",
")",
":",
"if",
"self",
".",
"mode",
"==",
"'c'",
":",
"c",
",",
"m",
"=",
"utils",
".",
"recv",
"(",
"self",
".",
"__s",
")",
"inst",
"=",
"[",
"(",
"c",
",",
"m",
",",
"self",
".",
"__s",
")",
"]",
... | Get info from sockets | [
"Get",
"info",
"from",
"sockets"
] | train | https://github.com/theSage21/lanchat/blob/66f5dcead67fef815347b956b1d3e149a7e13b29/lanchat/chat.py#L95-L107 |
theSage21/lanchat | lanchat/chat.py | Node.__process_instructions | def __process_instructions(self, inst):
"Act on instructions recieved"
to_send = []
for cmd, msg, com in inst:
if cmd not in config.CMDS: # ignore if it is not legal
continue
if cmd == 'MSG':
if self.mode == 's':
to_sen... | python | def __process_instructions(self, inst):
"Act on instructions recieved"
to_send = []
for cmd, msg, com in inst:
if cmd not in config.CMDS: # ignore if it is not legal
continue
if cmd == 'MSG':
if self.mode == 's':
to_sen... | [
"def",
"__process_instructions",
"(",
"self",
",",
"inst",
")",
":",
"to_send",
"=",
"[",
"]",
"for",
"cmd",
",",
"msg",
",",
"com",
"in",
"inst",
":",
"if",
"cmd",
"not",
"in",
"config",
".",
"CMDS",
":",
"# ignore if it is not legal",
"continue",
"if",... | Act on instructions recieved | [
"Act",
"on",
"instructions",
"recieved"
] | train | https://github.com/theSage21/lanchat/blob/66f5dcead67fef815347b956b1d3e149a7e13b29/lanchat/chat.py#L109-L145 |
theSage21/lanchat | lanchat/chat.py | Node.__output_thread | def __output_thread(self):
"Output thread"
while self.alive:
instructions = self.__get_instructions()
self.__process_instructions(instructions) | python | def __output_thread(self):
"Output thread"
while self.alive:
instructions = self.__get_instructions()
self.__process_instructions(instructions) | [
"def",
"__output_thread",
"(",
"self",
")",
":",
"while",
"self",
".",
"alive",
":",
"instructions",
"=",
"self",
".",
"__get_instructions",
"(",
")",
"self",
".",
"__process_instructions",
"(",
"instructions",
")"
] | Output thread | [
"Output",
"thread"
] | train | https://github.com/theSage21/lanchat/blob/66f5dcead67fef815347b956b1d3e149a7e13b29/lanchat/chat.py#L155-L159 |
theSage21/lanchat | lanchat/chat.py | Node.__input_thread | def __input_thread(self):
"Input thread"
last_input = time.time()
while self.alive:
x = input(config.prompt)
self.issue_alert = (time.time() - last_input) > 10
last_input = time.time()
msg = self.name + ': ' + x
if self.mode == 'c': # ... | python | def __input_thread(self):
"Input thread"
last_input = time.time()
while self.alive:
x = input(config.prompt)
self.issue_alert = (time.time() - last_input) > 10
last_input = time.time()
msg = self.name + ': ' + x
if self.mode == 'c': # ... | [
"def",
"__input_thread",
"(",
"self",
")",
":",
"last_input",
"=",
"time",
".",
"time",
"(",
")",
"while",
"self",
".",
"alive",
":",
"x",
"=",
"input",
"(",
"config",
".",
"prompt",
")",
"self",
".",
"issue_alert",
"=",
"(",
"time",
".",
"time",
"... | Input thread | [
"Input",
"thread"
] | train | https://github.com/theSage21/lanchat/blob/66f5dcead67fef815347b956b1d3e149a7e13b29/lanchat/chat.py#L161-L174 |
theSage21/lanchat | lanchat/chat.py | Node.__make_server | def __make_server(self):
"Make this node a server"
notice('Making server, getting listening socket', self.color)
self.mode = 's'
sock = utils.get_server_sock()
self.__s = sock
with self.__client_list_lock:
self.clients = deque()
self.threads = deque()
... | python | def __make_server(self):
"Make this node a server"
notice('Making server, getting listening socket', self.color)
self.mode = 's'
sock = utils.get_server_sock()
self.__s = sock
with self.__client_list_lock:
self.clients = deque()
self.threads = deque()
... | [
"def",
"__make_server",
"(",
"self",
")",
":",
"notice",
"(",
"'Making server, getting listening socket'",
",",
"self",
".",
"color",
")",
"self",
".",
"mode",
"=",
"'s'",
"sock",
"=",
"utils",
".",
"get_server_sock",
"(",
")",
"self",
".",
"__s",
"=",
"so... | Make this node a server | [
"Make",
"this",
"node",
"a",
"server"
] | train | https://github.com/theSage21/lanchat/blob/66f5dcead67fef815347b956b1d3e149a7e13b29/lanchat/chat.py#L176-L192 |
theSage21/lanchat | lanchat/chat.py | Node.__make_client | def __make_client(self):
"Make this node a client"
notice('Making client, getting server connection', self.color)
self.mode = 'c'
addr = utils.get_existing_server_addr()
sock = utils.get_client_sock(addr)
self.__s = sock
with self.__client_list_lock:
s... | python | def __make_client(self):
"Make this node a client"
notice('Making client, getting server connection', self.color)
self.mode = 'c'
addr = utils.get_existing_server_addr()
sock = utils.get_client_sock(addr)
self.__s = sock
with self.__client_list_lock:
s... | [
"def",
"__make_client",
"(",
"self",
")",
":",
"notice",
"(",
"'Making client, getting server connection'",
",",
"self",
".",
"color",
")",
"self",
".",
"mode",
"=",
"'c'",
"addr",
"=",
"utils",
".",
"get_existing_server_addr",
"(",
")",
"sock",
"=",
"utils",
... | Make this node a client | [
"Make",
"this",
"node",
"a",
"client"
] | train | https://github.com/theSage21/lanchat/blob/66f5dcead67fef815347b956b1d3e149a7e13b29/lanchat/chat.py#L194-L203 |
thespacedoctor/astrocalc | astrocalc/coords/coordinates_to_array.py | coordinates_to_array | def coordinates_to_array(
log,
ra,
dec):
"""*Convert a single value RA, DEC or list of RA and DEC to numpy arrays*
**Key Arguments:**
- ``ra`` -- list, numpy array or single ra value
- ``dec`` --list, numpy array or single dec value
- ``log`` -- logger
**Ret... | python | def coordinates_to_array(
log,
ra,
dec):
"""*Convert a single value RA, DEC or list of RA and DEC to numpy arrays*
**Key Arguments:**
- ``ra`` -- list, numpy array or single ra value
- ``dec`` --list, numpy array or single dec value
- ``log`` -- logger
**Ret... | [
"def",
"coordinates_to_array",
"(",
"log",
",",
"ra",
",",
"dec",
")",
":",
"log",
".",
"info",
"(",
"'starting the ``coordinates_to_array`` function'",
")",
"if",
"isinstance",
"(",
"ra",
",",
"np",
".",
"ndarray",
")",
"and",
"isinstance",
"(",
"dec",
",",... | *Convert a single value RA, DEC or list of RA and DEC to numpy arrays*
**Key Arguments:**
- ``ra`` -- list, numpy array or single ra value
- ``dec`` --list, numpy array or single dec value
- ``log`` -- logger
**Return:**
- ``raArray`` -- input RAs as a numpy array of decimal de... | [
"*",
"Convert",
"a",
"single",
"value",
"RA",
"DEC",
"or",
"list",
"of",
"RA",
"and",
"DEC",
"to",
"numpy",
"arrays",
"*"
] | train | https://github.com/thespacedoctor/astrocalc/blob/dfbebf9b86d7b2d2110c48a6a4f4194bf8885b86/astrocalc/coords/coordinates_to_array.py#L21-L95 |
dwwkelly/note | note/client.py | Note_Client.Send | def Send(self, msg):
"""
Add a note to the database on the server
:param msg: The text of the note.
:type msg: str
:param tags: A list of tags to associate with the note.
:type tags: list
:returns: The message from the server
:rtype: str
"""
... | python | def Send(self, msg):
"""
Add a note to the database on the server
:param msg: The text of the note.
:type msg: str
:param tags: A list of tags to associate with the note.
:type tags: list
:returns: The message from the server
:rtype: str
"""
... | [
"def",
"Send",
"(",
"self",
",",
"msg",
")",
":",
"if",
"'type'",
"not",
"in",
"msg",
":",
"return",
"self",
".",
"sock",
".",
"send",
"(",
"json",
".",
"dumps",
"(",
"msg",
")",
")",
"msg",
"=",
"self",
".",
"sock",
".",
"recv",
"(",
")",
"r... | Add a note to the database on the server
:param msg: The text of the note.
:type msg: str
:param tags: A list of tags to associate with the note.
:type tags: list
:returns: The message from the server
:rtype: str | [
"Add",
"a",
"note",
"to",
"the",
"database",
"on",
"the",
"server",
":",
"param",
"msg",
":",
"The",
"text",
"of",
"the",
"note",
".",
":",
"type",
"msg",
":",
"str",
":",
"param",
"tags",
":",
"A",
"list",
"of",
"tags",
"to",
"associate",
"with",
... | train | https://github.com/dwwkelly/note/blob/b41d5fe1e4a3b67b50285168dd58f903bf219e6c/note/client.py#L26-L41 |
adsabs/adsutils | adsutils/Unicode.py | UnicodeHandler.cleanall | def cleanall(self,str,cleanslash=0):
"""Deals with things like:
1./ accents with a slashes and converts them to entities.
Example: \', \`,\^
2./ Some 'missed' incomplete entities or ´ ( floating apostroph )
and the like.
Example: Milosˇevic --> Miloševic
Marti�b4;nez --> Mart&... | python | def cleanall(self,str,cleanslash=0):
"""Deals with things like:
1./ accents with a slashes and converts them to entities.
Example: \', \`,\^
2./ Some 'missed' incomplete entities or ´ ( floating apostroph )
and the like.
Example: Milosˇevic --> Miloševic
Marti�b4;nez --> Mart&... | [
"def",
"cleanall",
"(",
"self",
",",
"str",
",",
"cleanslash",
"=",
"0",
")",
":",
"retstr",
"=",
"self",
".",
"re_accent",
".",
"sub",
"(",
"self",
".",
"__sub_accent",
",",
"str",
")",
"retstr",
"=",
"self",
".",
"re_missent",
".",
"sub",
"(",
"s... | Deals with things like:
1./ accents with a slashes and converts them to entities.
Example: \', \`,\^
2./ Some 'missed' incomplete entities or ´ ( floating apostroph )
and the like.
Example: Milosˇevic --> Miloševic
Marti�b4;nez --> Martínez
3./ Get rid of remaining numeric ent... | [
"Deals",
"with",
"things",
"like",
":",
"1",
".",
"/",
"accents",
"with",
"a",
"slashes",
"and",
"converts",
"them",
"to",
"entities",
".",
"Example",
":",
"\\",
"\\",
"\\",
"^"
] | train | https://github.com/adsabs/adsutils/blob/fb9d6b4f6ed5e6ca19c552efc3cdd6466c587fdb/adsutils/Unicode.py#L166-L193 |
jkwill87/teletype | teletype/io/common.py | erase_lines | def erase_lines(n=1):
""" Erases n lines from the screen and moves the cursor up to follow
"""
for _ in range(n):
print(codes.cursor["up"], end="")
print(codes.cursor["eol"], end="") | python | def erase_lines(n=1):
""" Erases n lines from the screen and moves the cursor up to follow
"""
for _ in range(n):
print(codes.cursor["up"], end="")
print(codes.cursor["eol"], end="") | [
"def",
"erase_lines",
"(",
"n",
"=",
"1",
")",
":",
"for",
"_",
"in",
"range",
"(",
"n",
")",
":",
"print",
"(",
"codes",
".",
"cursor",
"[",
"\"up\"",
"]",
",",
"end",
"=",
"\"\"",
")",
"print",
"(",
"codes",
".",
"cursor",
"[",
"\"eol\"",
"]"... | Erases n lines from the screen and moves the cursor up to follow | [
"Erases",
"n",
"lines",
"from",
"the",
"screen",
"and",
"moves",
"the",
"cursor",
"up",
"to",
"follow"
] | train | https://github.com/jkwill87/teletype/blob/8ba95c56dcb5e4d7f6ae155eb6cdabfdfaf346cf/teletype/io/common.py#L8-L13 |
jkwill87/teletype | teletype/io/common.py | move_cursor | def move_cursor(cols=0, rows=0):
""" Moves the cursor the given number of columns and rows
The cursor is moved right when cols is positive and left when negative.
The cursor is moved down when rows is positive and down when negative.
"""
if cols == 0 and rows == 0:
return
commands =... | python | def move_cursor(cols=0, rows=0):
""" Moves the cursor the given number of columns and rows
The cursor is moved right when cols is positive and left when negative.
The cursor is moved down when rows is positive and down when negative.
"""
if cols == 0 and rows == 0:
return
commands =... | [
"def",
"move_cursor",
"(",
"cols",
"=",
"0",
",",
"rows",
"=",
"0",
")",
":",
"if",
"cols",
"==",
"0",
"and",
"rows",
"==",
"0",
":",
"return",
"commands",
"=",
"\"\"",
"commands",
"+=",
"codes",
".",
"cursor",
"[",
"\"up\"",
"if",
"rows",
"<",
"... | Moves the cursor the given number of columns and rows
The cursor is moved right when cols is positive and left when negative.
The cursor is moved down when rows is positive and down when negative. | [
"Moves",
"the",
"cursor",
"the",
"given",
"number",
"of",
"columns",
"and",
"rows",
"The",
"cursor",
"is",
"moved",
"right",
"when",
"cols",
"is",
"positive",
"and",
"left",
"when",
"negative",
".",
"The",
"cursor",
"is",
"moved",
"down",
"when",
"rows",
... | train | https://github.com/jkwill87/teletype/blob/8ba95c56dcb5e4d7f6ae155eb6cdabfdfaf346cf/teletype/io/common.py#L22-L35 |
jkwill87/teletype | teletype/io/common.py | style_format | def style_format(text, style):
""" Wraps texts in terminal control sequences
Style can be passed as either a collection or space delimited string.
Valid styles can be found in the codes module. Invalid or unsuported styles
will just be ignored.
"""
if not style:
return text
if isins... | python | def style_format(text, style):
""" Wraps texts in terminal control sequences
Style can be passed as either a collection or space delimited string.
Valid styles can be found in the codes module. Invalid or unsuported styles
will just be ignored.
"""
if not style:
return text
if isins... | [
"def",
"style_format",
"(",
"text",
",",
"style",
")",
":",
"if",
"not",
"style",
":",
"return",
"text",
"if",
"isinstance",
"(",
"style",
",",
"str",
")",
":",
"style",
"=",
"style",
".",
"split",
"(",
"\" \"",
")",
"prefix",
"=",
"\"\"",
"for",
"... | Wraps texts in terminal control sequences
Style can be passed as either a collection or space delimited string.
Valid styles can be found in the codes module. Invalid or unsuported styles
will just be ignored. | [
"Wraps",
"texts",
"in",
"terminal",
"control",
"sequences"
] | train | https://github.com/jkwill87/teletype/blob/8ba95c56dcb5e4d7f6ae155eb6cdabfdfaf346cf/teletype/io/common.py#L56-L72 |
jkwill87/teletype | teletype/io/common.py | style_print | def style_print(*values, **kwargs):
""" A convenience function that applies style_format to text before printing
"""
style = kwargs.pop("style", None)
values = [style_format(value, style) for value in values]
print(*values, **kwargs) | python | def style_print(*values, **kwargs):
""" A convenience function that applies style_format to text before printing
"""
style = kwargs.pop("style", None)
values = [style_format(value, style) for value in values]
print(*values, **kwargs) | [
"def",
"style_print",
"(",
"*",
"values",
",",
"*",
"*",
"kwargs",
")",
":",
"style",
"=",
"kwargs",
".",
"pop",
"(",
"\"style\"",
",",
"None",
")",
"values",
"=",
"[",
"style_format",
"(",
"value",
",",
"style",
")",
"for",
"value",
"in",
"values",
... | A convenience function that applies style_format to text before printing | [
"A",
"convenience",
"function",
"that",
"applies",
"style_format",
"to",
"text",
"before",
"printing"
] | train | https://github.com/jkwill87/teletype/blob/8ba95c56dcb5e4d7f6ae155eb6cdabfdfaf346cf/teletype/io/common.py#L75-L80 |
ahmontero/django-twitter | twitter/toauth.py | Twitter.get_authentication_tokens | def get_authentication_tokens(self):
"""
get_auth_url(self)
Returns an authorization URL for a user to hit.
"""
callback_url = self.callback_url or 'oob'
request_args = {}
if OAUTH_LIB_SUPPORTS_CALLBACK:
request_args['callback_url'] = callback... | python | def get_authentication_tokens(self):
"""
get_auth_url(self)
Returns an authorization URL for a user to hit.
"""
callback_url = self.callback_url or 'oob'
request_args = {}
if OAUTH_LIB_SUPPORTS_CALLBACK:
request_args['callback_url'] = callback... | [
"def",
"get_authentication_tokens",
"(",
"self",
")",
":",
"callback_url",
"=",
"self",
".",
"callback_url",
"or",
"'oob'",
"request_args",
"=",
"{",
"}",
"if",
"OAUTH_LIB_SUPPORTS_CALLBACK",
":",
"request_args",
"[",
"'callback_url'",
"]",
"=",
"callback_url",
"r... | get_auth_url(self)
Returns an authorization URL for a user to hit. | [
"get_auth_url",
"(",
"self",
")"
] | train | https://github.com/ahmontero/django-twitter/blob/3da06115bb88a3409f0bb00dba6a618f7cd4d817/twitter/toauth.py#L73-L112 |
ahmontero/django-twitter | twitter/toauth.py | Twitter.get_authorized_tokens | def get_authorized_tokens(self):
"""
get_authorized_tokens
Returns authorized tokens after they go through the auth_url phase.
"""
resp, content = self.client.request(self.access_token_url, "GET")
return dict(urlparse.parse_qsl(content)) | python | def get_authorized_tokens(self):
"""
get_authorized_tokens
Returns authorized tokens after they go through the auth_url phase.
"""
resp, content = self.client.request(self.access_token_url, "GET")
return dict(urlparse.parse_qsl(content)) | [
"def",
"get_authorized_tokens",
"(",
"self",
")",
":",
"resp",
",",
"content",
"=",
"self",
".",
"client",
".",
"request",
"(",
"self",
".",
"access_token_url",
",",
"\"GET\"",
")",
"return",
"dict",
"(",
"urlparse",
".",
"parse_qsl",
"(",
"content",
")",
... | get_authorized_tokens
Returns authorized tokens after they go through the auth_url phase. | [
"get_authorized_tokens"
] | train | https://github.com/ahmontero/django-twitter/blob/3da06115bb88a3409f0bb00dba6a618f7cd4d817/twitter/toauth.py#L114-L121 |
guysv/txkernel | txkernel/connection.py | ConnectionFile.generate | def generate(cls, partial_props=None):
"""
Generate new connection file props from
defaults
"""
partial_props = partial_props or {}
props = partial_props.copy()
props.update(cls.DEFAULT_PROPERTIES)
return cls(props) | python | def generate(cls, partial_props=None):
"""
Generate new connection file props from
defaults
"""
partial_props = partial_props or {}
props = partial_props.copy()
props.update(cls.DEFAULT_PROPERTIES)
return cls(props) | [
"def",
"generate",
"(",
"cls",
",",
"partial_props",
"=",
"None",
")",
":",
"partial_props",
"=",
"partial_props",
"or",
"{",
"}",
"props",
"=",
"partial_props",
".",
"copy",
"(",
")",
"props",
".",
"update",
"(",
"cls",
".",
"DEFAULT_PROPERTIES",
")",
"... | Generate new connection file props from
defaults | [
"Generate",
"new",
"connection",
"file",
"props",
"from",
"defaults"
] | train | https://github.com/guysv/txkernel/blob/a0aa1591df347732264f594bb13bc10d8aaf0f23/txkernel/connection.py#L42-L50 |
guysv/txkernel | txkernel/connection.py | ConnectionFile.write_file | def write_file(self):
"""
Write a new connection file to disk. and
return its path
"""
name = "kernel-{pid}.json".format(pid=os.getpid())
path = os.path.join(jupyter_runtime_dir(), name)
# indentation, because why not.
connection_json = json.dumps(self.co... | python | def write_file(self):
"""
Write a new connection file to disk. and
return its path
"""
name = "kernel-{pid}.json".format(pid=os.getpid())
path = os.path.join(jupyter_runtime_dir(), name)
# indentation, because why not.
connection_json = json.dumps(self.co... | [
"def",
"write_file",
"(",
"self",
")",
":",
"name",
"=",
"\"kernel-{pid}.json\"",
".",
"format",
"(",
"pid",
"=",
"os",
".",
"getpid",
"(",
")",
")",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"jupyter_runtime_dir",
"(",
")",
",",
"name",
")",... | Write a new connection file to disk. and
return its path | [
"Write",
"a",
"new",
"connection",
"file",
"to",
"disk",
".",
"and",
"return",
"its",
"path"
] | train | https://github.com/guysv/txkernel/blob/a0aa1591df347732264f594bb13bc10d8aaf0f23/txkernel/connection.py#L57-L71 |
sbarham/dsrt | dsrt/models/Decoder.py | Decoder.build | def build(self):
"""
The decoder computational graph consists of three components:
(1) the input node `decoder_input`
(2) the embedding node `decoder_embed`
(3) the recurrent (RNN) part `decoder_rnn`
(4) the output of th... | python | def build(self):
"""
The decoder computational graph consists of three components:
(1) the input node `decoder_input`
(2) the embedding node `decoder_embed`
(3) the recurrent (RNN) part `decoder_rnn`
(4) the output of th... | [
"def",
"build",
"(",
"self",
")",
":",
"# Grab hyperparameters from self.config:",
"hidden_dim",
"=",
"self",
".",
"config",
"[",
"'encoding-layer-width'",
"]",
"recurrent_unit",
"=",
"self",
".",
"config",
"[",
"'recurrent-unit-type'",
"]",
"bidirectional",
"=",
"F... | The decoder computational graph consists of three components:
(1) the input node `decoder_input`
(2) the embedding node `decoder_embed`
(3) the recurrent (RNN) part `decoder_rnn`
(4) the output of the decoder RNN `decoder_output`... | [
"The",
"decoder",
"computational",
"graph",
"consists",
"of",
"three",
"components",
":",
"(",
"1",
")",
"the",
"input",
"node",
"decoder_input",
"(",
"2",
")",
"the",
"embedding",
"node",
"decoder_embed",
"(",
"3",
")",
"the",
"recurrent",
"(",
"RNN",
")"... | train | https://github.com/sbarham/dsrt/blob/bc664739f2f52839461d3e72773b71146fd56a9a/dsrt/models/Decoder.py#L34-L81 |
pbrisk/mathtoolspy | mathtoolspy/solver/minimize_algorithm_1dim_brent.py | minimize_algorithm_1dim_brent | def minimize_algorithm_1dim_brent(fct, _a, _b, _c, tolerance=DOUBLE_TOL):
'''
Finds the minimum of the given function f. The arguments are the given function f, and given a bracketing triplet of abscissas A, B, C
(such that B is between A and C, and f(B) is less than both f(A) and f(C)) and the Tolerance.
... | python | def minimize_algorithm_1dim_brent(fct, _a, _b, _c, tolerance=DOUBLE_TOL):
'''
Finds the minimum of the given function f. The arguments are the given function f, and given a bracketing triplet of abscissas A, B, C
(such that B is between A and C, and f(B) is less than both f(A) and f(C)) and the Tolerance.
... | [
"def",
"minimize_algorithm_1dim_brent",
"(",
"fct",
",",
"_a",
",",
"_b",
",",
"_c",
",",
"tolerance",
"=",
"DOUBLE_TOL",
")",
":",
"''' ZEPS is a small number that protects against trying to achieve fractional accuracy\n for a minimum that happens to be exactly zero. '''",
"ZEP... | Finds the minimum of the given function f. The arguments are the given function f, and given a bracketing triplet of abscissas A, B, C
(such that B is between A and C, and f(B) is less than both f(A) and f(C)) and the Tolerance.
This routine isolates the minimum to a fractional precision of about tol using
... | [
"Finds",
"the",
"minimum",
"of",
"the",
"given",
"function",
"f",
".",
"The",
"arguments",
"are",
"the",
"given",
"function",
"f",
"and",
"given",
"a",
"bracketing",
"triplet",
"of",
"abscissas",
"A",
"B",
"C",
"(",
"such",
"that",
"B",
"is",
"between",
... | train | https://github.com/pbrisk/mathtoolspy/blob/d0d35b45d20f346ba8a755e53ed0aa182fab43dd/mathtoolspy/solver/minimize_algorithm_1dim_brent.py#L25-L102 |
Brazelton-Lab/bio_utils | bio_utils/verifiers/gff3.py | gff3_verifier | def gff3_verifier(entries, line=None):
"""Raises error if invalid GFF3 format detected
Args:
entries (list): A list of GFF3Entry instances
line (int): Line number of first entry
Raises:
FormatError: Error when GFF3 format incorrect with descriptive message
"""
regex = r'^... | python | def gff3_verifier(entries, line=None):
"""Raises error if invalid GFF3 format detected
Args:
entries (list): A list of GFF3Entry instances
line (int): Line number of first entry
Raises:
FormatError: Error when GFF3 format incorrect with descriptive message
"""
regex = r'^... | [
"def",
"gff3_verifier",
"(",
"entries",
",",
"line",
"=",
"None",
")",
":",
"regex",
"=",
"r'^[a-zA-Z0-9.:^*$@!+_?-|]+\\t.+\\t.+\\t\\d+\\t\\d+\\t'",
"+",
"r'\\d*\\.?\\d*\\t[+-.]\\t[.0-2]\\t.+{0}$'",
".",
"format",
"(",
"os",
".",
"linesep",
")",
"delimiter",
"=",
"r'\... | Raises error if invalid GFF3 format detected
Args:
entries (list): A list of GFF3Entry instances
line (int): Line number of first entry
Raises:
FormatError: Error when GFF3 format incorrect with descriptive message | [
"Raises",
"error",
"if",
"invalid",
"GFF3",
"format",
"detected"
] | train | https://github.com/Brazelton-Lab/bio_utils/blob/5a7ddf13ee0bf4baaaeb6b2b99e01bf74aa132b7/bio_utils/verifiers/gff3.py#L46-L100 |
utgwkk/py-timeparser | timeparser.py | parse | def parse(s, return_type=int):
'''
Parse time string and return seconds.
You can specify the type of return value both int or datetime.timedelta
with 'return_type' argument.
'''
RE_DAY = r'([0-9]+)d(ay)?'
RE_HOUR = r'([0-9]+)h(our)?'
RE_MINUTE = r'([0-9]+)m(in(ute)?)?'
RE_SECOND = r'... | python | def parse(s, return_type=int):
'''
Parse time string and return seconds.
You can specify the type of return value both int or datetime.timedelta
with 'return_type' argument.
'''
RE_DAY = r'([0-9]+)d(ay)?'
RE_HOUR = r'([0-9]+)h(our)?'
RE_MINUTE = r'([0-9]+)m(in(ute)?)?'
RE_SECOND = r'... | [
"def",
"parse",
"(",
"s",
",",
"return_type",
"=",
"int",
")",
":",
"RE_DAY",
"=",
"r'([0-9]+)d(ay)?'",
"RE_HOUR",
"=",
"r'([0-9]+)h(our)?'",
"RE_MINUTE",
"=",
"r'([0-9]+)m(in(ute)?)?'",
"RE_SECOND",
"=",
"r'([0-9]+)(s(ec(ond)?)?)?'",
"def",
"_parse_time_with_unit",
"... | Parse time string and return seconds.
You can specify the type of return value both int or datetime.timedelta
with 'return_type' argument. | [
"Parse",
"time",
"string",
"and",
"return",
"seconds",
".",
"You",
"can",
"specify",
"the",
"type",
"of",
"return",
"value",
"both",
"int",
"or",
"datetime",
".",
"timedelta",
"with",
"return_type",
"argument",
"."
] | train | https://github.com/utgwkk/py-timeparser/blob/968668f58e5658936f214247c749e69ceeb2a66e/timeparser.py#L11-L60 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.path | def path(string):
"""
Define the 'path' data type that can be used by apps.
"""
if not os.path.exists(string):
msg = "Path %s not found!" % string
raise ArgumentTypeError(msg)
return string | python | def path(string):
"""
Define the 'path' data type that can be used by apps.
"""
if not os.path.exists(string):
msg = "Path %s not found!" % string
raise ArgumentTypeError(msg)
return string | [
"def",
"path",
"(",
"string",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"string",
")",
":",
"msg",
"=",
"\"Path %s not found!\"",
"%",
"string",
"raise",
"ArgumentTypeError",
"(",
"msg",
")",
"return",
"string"
] | Define the 'path' data type that can be used by apps. | [
"Define",
"the",
"path",
"data",
"type",
"that",
"can",
"be",
"used",
"by",
"apps",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L183-L190 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.add_argument | def add_argument(self, *args, **kwargs):
"""
Add a parameter to this app.
"""
if not (('action' in kwargs) and (kwargs['action'] == 'help')):
# make sure required parameter options were defined
try:
name = kwargs['dest']
param_type ... | python | def add_argument(self, *args, **kwargs):
"""
Add a parameter to this app.
"""
if not (('action' in kwargs) and (kwargs['action'] == 'help')):
# make sure required parameter options were defined
try:
name = kwargs['dest']
param_type ... | [
"def",
"add_argument",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"(",
"(",
"'action'",
"in",
"kwargs",
")",
"and",
"(",
"kwargs",
"[",
"'action'",
"]",
"==",
"'help'",
")",
")",
":",
"# make sure required parameter ... | Add a parameter to this app. | [
"Add",
"a",
"parameter",
"to",
"this",
"app",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L210-L253 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.get_json_representation | def get_json_representation(self):
"""
Return a JSON object with a representation of this app (type and parameters).
"""
repres = {}
repres['type'] = self.TYPE
repres['parameters'] = self._parameters
repres['icon'] = self.ICON
repres['authors'] = self.AUTH... | python | def get_json_representation(self):
"""
Return a JSON object with a representation of this app (type and parameters).
"""
repres = {}
repres['type'] = self.TYPE
repres['parameters'] = self._parameters
repres['icon'] = self.ICON
repres['authors'] = self.AUTH... | [
"def",
"get_json_representation",
"(",
"self",
")",
":",
"repres",
"=",
"{",
"}",
"repres",
"[",
"'type'",
"]",
"=",
"self",
".",
"TYPE",
"repres",
"[",
"'parameters'",
"]",
"=",
"self",
".",
"_parameters",
"repres",
"[",
"'icon'",
"]",
"=",
"self",
".... | Return a JSON object with a representation of this app (type and parameters). | [
"Return",
"a",
"JSON",
"object",
"with",
"a",
"representation",
"of",
"this",
"app",
"(",
"type",
"and",
"parameters",
")",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L255-L281 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.save_json_representation | def save_json_representation(self, dir_path):
"""
Save the app's JSON representation object to a JSON file.
"""
file_name = self.__class__.__name__+ '.json'
file_path = os.path.join(dir_path, file_name)
with open(file_path, 'w') as outfile:
json.dump(self.get_... | python | def save_json_representation(self, dir_path):
"""
Save the app's JSON representation object to a JSON file.
"""
file_name = self.__class__.__name__+ '.json'
file_path = os.path.join(dir_path, file_name)
with open(file_path, 'w') as outfile:
json.dump(self.get_... | [
"def",
"save_json_representation",
"(",
"self",
",",
"dir_path",
")",
":",
"file_name",
"=",
"self",
".",
"__class__",
".",
"__name__",
"+",
"'.json'",
"file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"dir_path",
",",
"file_name",
")",
"with",
"open"... | Save the app's JSON representation object to a JSON file. | [
"Save",
"the",
"app",
"s",
"JSON",
"representation",
"object",
"to",
"a",
"JSON",
"file",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L283-L290 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.launch | def launch(self, args=None):
"""
This method triggers the parsing of arguments.
"""
self.options = self.parse_args(args)
if self.options.saveinputmeta:
# save original input options
self.save_input_meta()
if self.options.inputmeta:
# re... | python | def launch(self, args=None):
"""
This method triggers the parsing of arguments.
"""
self.options = self.parse_args(args)
if self.options.saveinputmeta:
# save original input options
self.save_input_meta()
if self.options.inputmeta:
# re... | [
"def",
"launch",
"(",
"self",
",",
"args",
"=",
"None",
")",
":",
"self",
".",
"options",
"=",
"self",
".",
"parse_args",
"(",
"args",
")",
"if",
"self",
".",
"options",
".",
"saveinputmeta",
":",
"# save original input options",
"self",
".",
"save_input_m... | This method triggers the parsing of arguments. | [
"This",
"method",
"triggers",
"the",
"parsing",
"of",
"arguments",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L292-L306 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.get_options_from_file | def get_options_from_file(self, file_path):
"""
Return the options parsed from a JSON file.
"""
# read options JSON file
with open(file_path) as options_file:
options_dict = json.load(options_file)
options = []
for opt_name in options_dict:
... | python | def get_options_from_file(self, file_path):
"""
Return the options parsed from a JSON file.
"""
# read options JSON file
with open(file_path) as options_file:
options_dict = json.load(options_file)
options = []
for opt_name in options_dict:
... | [
"def",
"get_options_from_file",
"(",
"self",
",",
"file_path",
")",
":",
"# read options JSON file",
"with",
"open",
"(",
"file_path",
")",
"as",
"options_file",
":",
"options_dict",
"=",
"json",
".",
"load",
"(",
"options_file",
")",
"options",
"=",
"[",
"]",... | Return the options parsed from a JSON file. | [
"Return",
"the",
"options",
"parsed",
"from",
"a",
"JSON",
"file",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L308-L319 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.save_input_meta | def save_input_meta(self):
"""
Save the input meta data (options passed to the app) to a JSON file.
"""
options = self.options
file_path = os.path.join(options.outputdir, 'input.meta.json')
with open(file_path, 'w') as outfile:
json.dump(vars(options), outfile... | python | def save_input_meta(self):
"""
Save the input meta data (options passed to the app) to a JSON file.
"""
options = self.options
file_path = os.path.join(options.outputdir, 'input.meta.json')
with open(file_path, 'w') as outfile:
json.dump(vars(options), outfile... | [
"def",
"save_input_meta",
"(",
"self",
")",
":",
"options",
"=",
"self",
".",
"options",
"file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"options",
".",
"outputdir",
",",
"'input.meta.json'",
")",
"with",
"open",
"(",
"file_path",
",",
"'w'",
")",... | Save the input meta data (options passed to the app) to a JSON file. | [
"Save",
"the",
"input",
"meta",
"data",
"(",
"options",
"passed",
"to",
"the",
"app",
")",
"to",
"a",
"JSON",
"file",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L321-L328 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.save_output_meta | def save_output_meta(self):
"""
Save descriptive output meta data to a JSON file.
"""
options = self.options
file_path = os.path.join(options.outputdir, 'output.meta.json')
with open(file_path, 'w') as outfile:
json.dump(self.OUTPUT_META_DICT, outfile) | python | def save_output_meta(self):
"""
Save descriptive output meta data to a JSON file.
"""
options = self.options
file_path = os.path.join(options.outputdir, 'output.meta.json')
with open(file_path, 'w') as outfile:
json.dump(self.OUTPUT_META_DICT, outfile) | [
"def",
"save_output_meta",
"(",
"self",
")",
":",
"options",
"=",
"self",
".",
"options",
"file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"options",
".",
"outputdir",
",",
"'output.meta.json'",
")",
"with",
"open",
"(",
"file_path",
",",
"'w'",
")... | Save descriptive output meta data to a JSON file. | [
"Save",
"descriptive",
"output",
"meta",
"data",
"to",
"a",
"JSON",
"file",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L330-L337 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.load_output_meta | def load_output_meta(self):
"""
Load descriptive output meta data from a JSON file in the input directory.
"""
options = self.options
file_path = os.path.join(options.inputdir, 'output.meta.json')
with open(file_path) as infile:
return json.load(infile) | python | def load_output_meta(self):
"""
Load descriptive output meta data from a JSON file in the input directory.
"""
options = self.options
file_path = os.path.join(options.inputdir, 'output.meta.json')
with open(file_path) as infile:
return json.load(infile) | [
"def",
"load_output_meta",
"(",
"self",
")",
":",
"options",
"=",
"self",
".",
"options",
"file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"options",
".",
"inputdir",
",",
"'output.meta.json'",
")",
"with",
"open",
"(",
"file_path",
")",
"as",
"inf... | Load descriptive output meta data from a JSON file in the input directory. | [
"Load",
"descriptive",
"output",
"meta",
"data",
"from",
"a",
"JSON",
"file",
"in",
"the",
"input",
"directory",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L339-L346 |
FNNDSC/chrisapp | chrisapp/base.py | ChrisApp.print_app_meta_data | def print_app_meta_data(self):
"""
Print the app's meta data.
"""
l_metaData = dir(self)
l_classVar = [x for x in l_metaData if x.isupper() ]
for str_var in l_classVar:
str_val = getattr(self, str_var)
print("%20s: %s" % (str_var, str_val)) | python | def print_app_meta_data(self):
"""
Print the app's meta data.
"""
l_metaData = dir(self)
l_classVar = [x for x in l_metaData if x.isupper() ]
for str_var in l_classVar:
str_val = getattr(self, str_var)
print("%20s: %s" % (str_var, str_val)) | [
"def",
"print_app_meta_data",
"(",
"self",
")",
":",
"l_metaData",
"=",
"dir",
"(",
"self",
")",
"l_classVar",
"=",
"[",
"x",
"for",
"x",
"in",
"l_metaData",
"if",
"x",
".",
"isupper",
"(",
")",
"]",
"for",
"str_var",
"in",
"l_classVar",
":",
"str_val"... | Print the app's meta data. | [
"Print",
"the",
"app",
"s",
"meta",
"data",
"."
] | train | https://github.com/FNNDSC/chrisapp/blob/b176655f97206240fe173dfe86736f82f0d85bc4/chrisapp/base.py#L354-L362 |
appstore-zencore/appserver | src/appserver.py | start | def start(context):
"""Start application server.
"""
config = context.obj["config"]
daemon = select(config, "application.daemon", False)
workspace = select(config, "application.workspace", None)
pidfile = select(config, "application.pidfile", DEFAULT_PIDFILE)
daemon_start(partial(main, confi... | python | def start(context):
"""Start application server.
"""
config = context.obj["config"]
daemon = select(config, "application.daemon", False)
workspace = select(config, "application.workspace", None)
pidfile = select(config, "application.pidfile", DEFAULT_PIDFILE)
daemon_start(partial(main, confi... | [
"def",
"start",
"(",
"context",
")",
":",
"config",
"=",
"context",
".",
"obj",
"[",
"\"config\"",
"]",
"daemon",
"=",
"select",
"(",
"config",
",",
"\"application.daemon\"",
",",
"False",
")",
"workspace",
"=",
"select",
"(",
"config",
",",
"\"application... | Start application server. | [
"Start",
"application",
"server",
"."
] | train | https://github.com/appstore-zencore/appserver/blob/5b8a5193f0e52bcc29dad73586b16294277a8bdc/src/appserver.py#L72-L79 |
appstore-zencore/appserver | src/appserver.py | stop | def stop(context):
"""Stop application server.
"""
config = context.obj["config"]
pidfile = select(config, "application.pidfile", DEFAULT_PIDFILE)
daemon_stop(pidfile) | python | def stop(context):
"""Stop application server.
"""
config = context.obj["config"]
pidfile = select(config, "application.pidfile", DEFAULT_PIDFILE)
daemon_stop(pidfile) | [
"def",
"stop",
"(",
"context",
")",
":",
"config",
"=",
"context",
".",
"obj",
"[",
"\"config\"",
"]",
"pidfile",
"=",
"select",
"(",
"config",
",",
"\"application.pidfile\"",
",",
"DEFAULT_PIDFILE",
")",
"daemon_stop",
"(",
"pidfile",
")"
] | Stop application server. | [
"Stop",
"application",
"server",
"."
] | train | https://github.com/appstore-zencore/appserver/blob/5b8a5193f0e52bcc29dad73586b16294277a8bdc/src/appserver.py#L84-L89 |
roboogle/gtkmvc3 | gtkmvco/examples/converter/src/controllers/currency.py | CurrencyCtrl.register_view | def register_view(self, view):
"""Creates treeview columns, and connect missing signals"""
Controller.register_view(self, view)
# connects additional signals
self.view['tv_notes'].get_buffer().connect("changed",
self.on_notes_changed)
#... | python | def register_view(self, view):
"""Creates treeview columns, and connect missing signals"""
Controller.register_view(self, view)
# connects additional signals
self.view['tv_notes'].get_buffer().connect("changed",
self.on_notes_changed)
#... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"Controller",
".",
"register_view",
"(",
"self",
",",
"view",
")",
"# connects additional signals",
"self",
".",
"view",
"[",
"'tv_notes'",
"]",
".",
"get_buffer",
"(",
")",
".",
"connect",
"(",
"... | Creates treeview columns, and connect missing signals | [
"Creates",
"treeview",
"columns",
"and",
"connect",
"missing",
"signals"
] | train | https://github.com/roboogle/gtkmvc3/blob/63405fd8d2056be26af49103b13a8d5e57fe4dff/gtkmvco/examples/converter/src/controllers/currency.py#L39-L52 |
roboogle/gtkmvc3 | gtkmvco/examples/tutorial/step1/ctrl_glade.py | MyController.register_view | def register_view(self, view):
"""This method is called by the view, that calls it when it is
ready to register itself. Here we connect the 'pressed' signal
of the button with a controller's method. Signal 'destroy'
for the main window is handled as well."""
# connects the signa... | python | def register_view(self, view):
"""This method is called by the view, that calls it when it is
ready to register itself. Here we connect the 'pressed' signal
of the button with a controller's method. Signal 'destroy'
for the main window is handled as well."""
# connects the signa... | [
"def",
"register_view",
"(",
"self",
",",
"view",
")",
":",
"# connects the signals:",
"self",
".",
"view",
"[",
"'main_window'",
"]",
".",
"connect",
"(",
"'destroy'",
",",
"gtk",
".",
"main_quit",
")",
"# initializes the text of label:",
"self",
".",
"view",
... | This method is called by the view, that calls it when it is
ready to register itself. Here we connect the 'pressed' signal
of the button with a controller's method. Signal 'destroy'
for the main window is handled as well. | [
"This",
"method",
"is",
"called",
"by",
"the",
"view",
"that",
"calls",
"it",
"when",
"it",
"is",
"ready",
"to",
"register",
"itself",
".",
"Here",
"we",
"connect",
"the",
"pressed",
"signal",
"of",
"the",
"button",
"with",
"a",
"controller",
"s",
"metho... | train | https://github.com/roboogle/gtkmvc3/blob/63405fd8d2056be26af49103b13a8d5e57fe4dff/gtkmvco/examples/tutorial/step1/ctrl_glade.py#L27-L38 |
robcharlwood/django-mothertongue | mothertongue/__init__.py | get_version | def get_version(svn=False, limit=3):
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:limit]])
if svn and limit >= 3:
from django.utils.version import get_svn_revision
import os
svn_rev = get_svn_revision(os.path.dirname(__file__))
if svn... | python | def get_version(svn=False, limit=3):
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:limit]])
if svn and limit >= 3:
from django.utils.version import get_svn_revision
import os
svn_rev = get_svn_revision(os.path.dirname(__file__))
if svn... | [
"def",
"get_version",
"(",
"svn",
"=",
"False",
",",
"limit",
"=",
"3",
")",
":",
"v",
"=",
"'.'",
".",
"join",
"(",
"[",
"str",
"(",
"i",
")",
"for",
"i",
"in",
"VERSION",
"[",
":",
"limit",
"]",
"]",
")",
"if",
"svn",
"and",
"limit",
">=",
... | Returns the version as a human-format string. | [
"Returns",
"the",
"version",
"as",
"a",
"human",
"-",
"format",
"string",
"."
] | train | https://github.com/robcharlwood/django-mothertongue/blob/eeb1ec0057c8395bba58615870ab4bcda06c93d0/mothertongue/__init__.py#L6-L15 |
gestaolivre/brazil-types | brazil_types/types.py | CNPJ.format | def format(self, format_spec='f'):
u"""
Formata o CNPJ.
Códigos de formatação:
r -> raw
f -> formatado
>>> cnpj = CNPJ(58414462000135)
>>> cnpj.format('r')
'58414462000135'
>>> cnpj.format('f')
'58.414.462/0001-35'
"""
if ... | python | def format(self, format_spec='f'):
u"""
Formata o CNPJ.
Códigos de formatação:
r -> raw
f -> formatado
>>> cnpj = CNPJ(58414462000135)
>>> cnpj.format('r')
'58414462000135'
>>> cnpj.format('f')
'58.414.462/0001-35'
"""
if ... | [
"def",
"format",
"(",
"self",
",",
"format_spec",
"=",
"'f'",
")",
":",
"if",
"format_spec",
"==",
"''",
"or",
"format_spec",
"==",
"'f'",
":",
"cnpj",
"=",
"CNPJ",
".",
"clean",
"(",
"self",
".",
"_cnpj",
")",
"return",
"'{0}.{1}.{2}/{3}-{4}'",
".",
"... | u"""
Formata o CNPJ.
Códigos de formatação:
r -> raw
f -> formatado
>>> cnpj = CNPJ(58414462000135)
>>> cnpj.format('r')
'58414462000135'
>>> cnpj.format('f')
'58.414.462/0001-35' | [
"u",
"Formata",
"o",
"CNPJ",
"."
] | train | https://github.com/gestaolivre/brazil-types/blob/13db32c17d66d85166a2459f6b3d6fcff2c2b954/brazil_types/types.py#L108-L128 |
gestaolivre/brazil-types | brazil_types/types.py | CNPJ.clean | def clean(cls, cnpj):
u"""
Retorna apenas os dígitos do CNPJ.
>>> CNPJ.clean('58.414.462/0001-35')
'58414462000135'
"""
if isinstance(cnpj, six.string_types):
cnpj = int(re.sub('[^0-9]', '', cnpj))
return '{0:014d}'.format(cnpj) | python | def clean(cls, cnpj):
u"""
Retorna apenas os dígitos do CNPJ.
>>> CNPJ.clean('58.414.462/0001-35')
'58414462000135'
"""
if isinstance(cnpj, six.string_types):
cnpj = int(re.sub('[^0-9]', '', cnpj))
return '{0:014d}'.format(cnpj) | [
"def",
"clean",
"(",
"cls",
",",
"cnpj",
")",
":",
"if",
"isinstance",
"(",
"cnpj",
",",
"six",
".",
"string_types",
")",
":",
"cnpj",
"=",
"int",
"(",
"re",
".",
"sub",
"(",
"'[^0-9]'",
",",
"''",
",",
"cnpj",
")",
")",
"return",
"'{0:014d}'",
"... | u"""
Retorna apenas os dígitos do CNPJ.
>>> CNPJ.clean('58.414.462/0001-35')
'58414462000135' | [
"u",
"Retorna",
"apenas",
"os",
"dígitos",
"do",
"CNPJ",
"."
] | train | https://github.com/gestaolivre/brazil-types/blob/13db32c17d66d85166a2459f6b3d6fcff2c2b954/brazil_types/types.py#L131-L141 |
gestaolivre/brazil-types | brazil_types/types.py | CNPJ.validate | def validate(cls, cnpj):
u"""
Válida o CNPJ.
>>> CNPJ.validate(58414462000135)
True
>>> CNPJ.validate(58414462000136)
False
>>> CNPJ.validate('58414462000135')
True
>>> CNPJ.validate('58.414.462/0001-35')
True
"""
if cnpj i... | python | def validate(cls, cnpj):
u"""
Válida o CNPJ.
>>> CNPJ.validate(58414462000135)
True
>>> CNPJ.validate(58414462000136)
False
>>> CNPJ.validate('58414462000135')
True
>>> CNPJ.validate('58.414.462/0001-35')
True
"""
if cnpj i... | [
"def",
"validate",
"(",
"cls",
",",
"cnpj",
")",
":",
"if",
"cnpj",
"is",
"None",
":",
"return",
"False",
"digitos_validacao",
"=",
"[",
"6",
",",
"5",
",",
"4",
",",
"3",
",",
"2",
",",
"9",
",",
"8",
",",
"7",
",",
"6",
",",
"5",
",",
"4"... | u"""
Válida o CNPJ.
>>> CNPJ.validate(58414462000135)
True
>>> CNPJ.validate(58414462000136)
False
>>> CNPJ.validate('58414462000135')
True
>>> CNPJ.validate('58.414.462/0001-35')
True | [
"u",
"Válida",
"o",
"CNPJ",
"."
] | train | https://github.com/gestaolivre/brazil-types/blob/13db32c17d66d85166a2459f6b3d6fcff2c2b954/brazil_types/types.py#L144-L171 |
gestaolivre/brazil-types | brazil_types/types.py | CPF.format | def format(self, format_spec='f'):
u"""
Formata o CPF.
Códigos de formatação:
r -> raw
f -> formatado
>>> cpf = CPF(58119443659)
>>> cpf.format('r')
'58119443659'
>>> cpf.format('f')
'581.194.436-59'
"""
if format_spec == ... | python | def format(self, format_spec='f'):
u"""
Formata o CPF.
Códigos de formatação:
r -> raw
f -> formatado
>>> cpf = CPF(58119443659)
>>> cpf.format('r')
'58119443659'
>>> cpf.format('f')
'581.194.436-59'
"""
if format_spec == ... | [
"def",
"format",
"(",
"self",
",",
"format_spec",
"=",
"'f'",
")",
":",
"if",
"format_spec",
"==",
"''",
"or",
"format_spec",
"==",
"'f'",
":",
"cpf",
"=",
"CPF",
".",
"clean",
"(",
"self",
".",
"_cpf",
")",
"return",
"'{0}.{1}.{2}-{3}'",
".",
"format"... | u"""
Formata o CPF.
Códigos de formatação:
r -> raw
f -> formatado
>>> cpf = CPF(58119443659)
>>> cpf.format('r')
'58119443659'
>>> cpf.format('f')
'581.194.436-59' | [
"u",
"Formata",
"o",
"CPF",
"."
] | train | https://github.com/gestaolivre/brazil-types/blob/13db32c17d66d85166a2459f6b3d6fcff2c2b954/brazil_types/types.py#L254-L274 |
gestaolivre/brazil-types | brazil_types/types.py | CPF.clean | def clean(cls, cpf):
u"""
Retorna apenas os dígitos do CPF.
>>> CPF.clean('581.194.436-59')
'58119443659'
"""
if isinstance(cpf, six.string_types):
cpf = int(re.sub('[^0-9]', '', cpf))
return '{0:011d}'.format(cpf) | python | def clean(cls, cpf):
u"""
Retorna apenas os dígitos do CPF.
>>> CPF.clean('581.194.436-59')
'58119443659'
"""
if isinstance(cpf, six.string_types):
cpf = int(re.sub('[^0-9]', '', cpf))
return '{0:011d}'.format(cpf) | [
"def",
"clean",
"(",
"cls",
",",
"cpf",
")",
":",
"if",
"isinstance",
"(",
"cpf",
",",
"six",
".",
"string_types",
")",
":",
"cpf",
"=",
"int",
"(",
"re",
".",
"sub",
"(",
"'[^0-9]'",
",",
"''",
",",
"cpf",
")",
")",
"return",
"'{0:011d}'",
".",
... | u"""
Retorna apenas os dígitos do CPF.
>>> CPF.clean('581.194.436-59')
'58119443659' | [
"u",
"Retorna",
"apenas",
"os",
"dígitos",
"do",
"CPF",
"."
] | train | https://github.com/gestaolivre/brazil-types/blob/13db32c17d66d85166a2459f6b3d6fcff2c2b954/brazil_types/types.py#L277-L287 |
gestaolivre/brazil-types | brazil_types/types.py | CPF.validate | def validate(cls, cpf):
u"""
Válida o CPF.
>>> CPF.validate(58119443659)
True
>>> CPF.validate(58119443650)
False
>>> CPF.validate('58119443659')
True
>>> CPF.validate('581.194.436-59')
True
"""
if cpf is None:
... | python | def validate(cls, cpf):
u"""
Válida o CPF.
>>> CPF.validate(58119443659)
True
>>> CPF.validate(58119443650)
False
>>> CPF.validate('58119443659')
True
>>> CPF.validate('581.194.436-59')
True
"""
if cpf is None:
... | [
"def",
"validate",
"(",
"cls",
",",
"cpf",
")",
":",
"if",
"cpf",
"is",
"None",
":",
"return",
"False",
"cpf",
"=",
"CPF",
".",
"clean",
"(",
"cpf",
")",
"def",
"mod11",
"(",
"value",
")",
":",
"return",
"(",
"value",
"%",
"11",
")",
"%",
"10",... | u"""
Válida o CPF.
>>> CPF.validate(58119443659)
True
>>> CPF.validate(58119443650)
False
>>> CPF.validate('58119443659')
True
>>> CPF.validate('581.194.436-59')
True | [
"u",
"Válida",
"o",
"CPF",
"."
] | train | https://github.com/gestaolivre/brazil-types/blob/13db32c17d66d85166a2459f6b3d6fcff2c2b954/brazil_types/types.py#L290-L314 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/gui/widgets/releasewin.py | ReleaseWin.setup_ui | def setup_ui(self, ):
"""Create the browsers and all necessary ui elements for the tool
:returns: None
:rtype: None
:raises: None
"""
w = QtGui.QWidget(self)
w.setLayout(self.central_vbox)
self.setCentralWidget(w)
releasetypes = [djadapter.RELEASE... | python | def setup_ui(self, ):
"""Create the browsers and all necessary ui elements for the tool
:returns: None
:rtype: None
:raises: None
"""
w = QtGui.QWidget(self)
w.setLayout(self.central_vbox)
self.setCentralWidget(w)
releasetypes = [djadapter.RELEASE... | [
"def",
"setup_ui",
"(",
"self",
",",
")",
":",
"w",
"=",
"QtGui",
".",
"QWidget",
"(",
"self",
")",
"w",
".",
"setLayout",
"(",
"self",
".",
"central_vbox",
")",
"self",
".",
"setCentralWidget",
"(",
"w",
")",
"releasetypes",
"=",
"[",
"djadapter",
"... | Create the browsers and all necessary ui elements for the tool
:returns: None
:rtype: None
:raises: None | [
"Create",
"the",
"browsers",
"and",
"all",
"necessary",
"ui",
"elements",
"for",
"the",
"tool"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/widgets/releasewin.py#L36-L54 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/gui/widgets/releasewin.py | ReleaseWin.setup_icons | def setup_icons(self, ):
"""Set all icons on buttons
:returns: None
:rtype: None
:raises: None
"""
floppy_icon = get_icon('glyphicons_446_floppy_save.png', asicon=True)
self.release_pb.setIcon(floppy_icon) | python | def setup_icons(self, ):
"""Set all icons on buttons
:returns: None
:rtype: None
:raises: None
"""
floppy_icon = get_icon('glyphicons_446_floppy_save.png', asicon=True)
self.release_pb.setIcon(floppy_icon) | [
"def",
"setup_icons",
"(",
"self",
",",
")",
":",
"floppy_icon",
"=",
"get_icon",
"(",
"'glyphicons_446_floppy_save.png'",
",",
"asicon",
"=",
"True",
")",
"self",
".",
"release_pb",
".",
"setIcon",
"(",
"floppy_icon",
")"
] | Set all icons on buttons
:returns: None
:rtype: None
:raises: None | [
"Set",
"all",
"icons",
"on",
"buttons"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/widgets/releasewin.py#L56-L64 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/gui/widgets/releasewin.py | ReleaseWin.create_comment_edit | def create_comment_edit(self, ):
"""Create a text edit for comments
:returns: the created text edit
:rtype: :class:`jukeboxcore.gui.widgets.textedit.JB_PlainTextEdit`
:raises: None
"""
pte = JB_PlainTextEdit(parent=self)
pte.set_placeholder("Enter a comment befor... | python | def create_comment_edit(self, ):
"""Create a text edit for comments
:returns: the created text edit
:rtype: :class:`jukeboxcore.gui.widgets.textedit.JB_PlainTextEdit`
:raises: None
"""
pte = JB_PlainTextEdit(parent=self)
pte.set_placeholder("Enter a comment befor... | [
"def",
"create_comment_edit",
"(",
"self",
",",
")",
":",
"pte",
"=",
"JB_PlainTextEdit",
"(",
"parent",
"=",
"self",
")",
"pte",
".",
"set_placeholder",
"(",
"\"Enter a comment before saving...\"",
")",
"pte",
".",
"setMaximumHeight",
"(",
"120",
")",
"return",... | Create a text edit for comments
:returns: the created text edit
:rtype: :class:`jukeboxcore.gui.widgets.textedit.JB_PlainTextEdit`
:raises: None | [
"Create",
"a",
"text",
"edit",
"for",
"comments"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/widgets/releasewin.py#L75-L85 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/gui/widgets/releasewin.py | ReleaseWin.release_callback | def release_callback(self, *args, **kwargs):
"""Create a new release
:returns: None
:rtype: None
:raises: None
"""
tf = self.browser.get_current_selection()
if not tf:
self.statusbar.showMessage("Select a file to release, please!")
return
... | python | def release_callback(self, *args, **kwargs):
"""Create a new release
:returns: None
:rtype: None
:raises: None
"""
tf = self.browser.get_current_selection()
if not tf:
self.statusbar.showMessage("Select a file to release, please!")
return
... | [
"def",
"release_callback",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"tf",
"=",
"self",
".",
"browser",
".",
"get_current_selection",
"(",
")",
"if",
"not",
"tf",
":",
"self",
".",
"statusbar",
".",
"showMessage",
"(",
"\"Select... | Create a new release
:returns: None
:rtype: None
:raises: None | [
"Create",
"a",
"new",
"release"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/widgets/releasewin.py#L87-L115 |
JukeboxPipeline/jukebox-core | src/jukeboxcore/gui/widgets/releasewin.py | ReleaseWin.set_release_actions | def set_release_actions(self, actions):
"""Set the widget that gives users options about the release, e.g. importing references
:param actions: Release actions that define the sanity checks and cleanup actions
:type actions: :class:`jukeboxcore.release.ReleaseActions`
:returns: None
... | python | def set_release_actions(self, actions):
"""Set the widget that gives users options about the release, e.g. importing references
:param actions: Release actions that define the sanity checks and cleanup actions
:type actions: :class:`jukeboxcore.release.ReleaseActions`
:returns: None
... | [
"def",
"set_release_actions",
"(",
"self",
",",
"actions",
")",
":",
"self",
".",
"release_actions",
"=",
"actions",
"self",
".",
"option_widget",
"=",
"self",
".",
"release_actions",
".",
"option_widget",
"(",
")",
"if",
"self",
".",
"option_widget",
":",
"... | Set the widget that gives users options about the release, e.g. importing references
:param actions: Release actions that define the sanity checks and cleanup actions
:type actions: :class:`jukeboxcore.release.ReleaseActions`
:returns: None
:rtype: None
:raises: None | [
"Set",
"the",
"widget",
"that",
"gives",
"users",
"options",
"about",
"the",
"release",
"e",
".",
"g",
".",
"importing",
"references"
] | train | https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/widgets/releasewin.py#L117-L130 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.