id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
44,200 | benhoff/pluginmanager | pluginmanager/file_manager.py | FileManager.set_blacklisted_filepaths | def set_blacklisted_filepaths(self, filepaths, remove_from_stored=True):
"""
Sets internal blacklisted filepaths to filepaths.
If `remove_from_stored` is `True`, any `filepaths` in
`self.plugin_filepaths` will be automatically removed.
Recommend passing in absolute filepaths but... | python | def set_blacklisted_filepaths(self, filepaths, remove_from_stored=True):
"""
Sets internal blacklisted filepaths to filepaths.
If `remove_from_stored` is `True`, any `filepaths` in
`self.plugin_filepaths` will be automatically removed.
Recommend passing in absolute filepaths but... | [
"def",
"set_blacklisted_filepaths",
"(",
"self",
",",
"filepaths",
",",
"remove_from_stored",
"=",
"True",
")",
":",
"filepaths",
"=",
"util",
".",
"to_absolute_paths",
"(",
"filepaths",
")",
"self",
".",
"blacklisted_filepaths",
"=",
"filepaths",
"if",
"remove_fr... | Sets internal blacklisted filepaths to filepaths.
If `remove_from_stored` is `True`, any `filepaths` in
`self.plugin_filepaths` will be automatically removed.
Recommend passing in absolute filepaths but method will attempt
to convert to absolute filepaths based on current working direct... | [
"Sets",
"internal",
"blacklisted",
"filepaths",
"to",
"filepaths",
".",
"If",
"remove_from_stored",
"is",
"True",
"any",
"filepaths",
"in",
"self",
".",
"plugin_filepaths",
"will",
"be",
"automatically",
"removed",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/file_manager.py#L179-L192 |
44,201 | benhoff/pluginmanager | pluginmanager/file_manager.py | FileManager.remove_blacklisted_filepaths | def remove_blacklisted_filepaths(self, filepaths):
"""
Removes `filepaths` from blacklisted filepaths
Recommend passing in absolute filepaths but method will attempt
to convert to absolute filepaths based on current working directory.
"""
filepaths = util.to_absolute_pat... | python | def remove_blacklisted_filepaths(self, filepaths):
"""
Removes `filepaths` from blacklisted filepaths
Recommend passing in absolute filepaths but method will attempt
to convert to absolute filepaths based on current working directory.
"""
filepaths = util.to_absolute_pat... | [
"def",
"remove_blacklisted_filepaths",
"(",
"self",
",",
"filepaths",
")",
":",
"filepaths",
"=",
"util",
".",
"to_absolute_paths",
"(",
"filepaths",
")",
"black_paths",
"=",
"self",
".",
"blacklisted_filepaths",
"black_paths",
"=",
"util",
".",
"remove_from_set",
... | Removes `filepaths` from blacklisted filepaths
Recommend passing in absolute filepaths but method will attempt
to convert to absolute filepaths based on current working directory. | [
"Removes",
"filepaths",
"from",
"blacklisted",
"filepaths"
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/file_manager.py#L194-L203 |
44,202 | benhoff/pluginmanager | pluginmanager/file_manager.py | FileManager._remove_blacklisted | def _remove_blacklisted(self, filepaths):
"""
internal helper method to remove the blacklisted filepaths
from `filepaths`.
"""
filepaths = util.remove_from_set(filepaths, self.blacklisted_filepaths)
return filepaths | python | def _remove_blacklisted(self, filepaths):
"""
internal helper method to remove the blacklisted filepaths
from `filepaths`.
"""
filepaths = util.remove_from_set(filepaths, self.blacklisted_filepaths)
return filepaths | [
"def",
"_remove_blacklisted",
"(",
"self",
",",
"filepaths",
")",
":",
"filepaths",
"=",
"util",
".",
"remove_from_set",
"(",
"filepaths",
",",
"self",
".",
"blacklisted_filepaths",
")",
"return",
"filepaths"
] | internal helper method to remove the blacklisted filepaths
from `filepaths`. | [
"internal",
"helper",
"method",
"to",
"remove",
"the",
"blacklisted",
"filepaths",
"from",
"filepaths",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/file_manager.py#L211-L217 |
44,203 | benhoff/pluginmanager | pluginmanager/file_manager.py | FileManager._filter_filepaths | def _filter_filepaths(self, filepaths):
"""
helps iterate through all the file parsers
each filter is applied individually to the
same set of `filepaths`
"""
if self.file_filters:
plugin_filepaths = set()
for file_filter in self.file_filters:
... | python | def _filter_filepaths(self, filepaths):
"""
helps iterate through all the file parsers
each filter is applied individually to the
same set of `filepaths`
"""
if self.file_filters:
plugin_filepaths = set()
for file_filter in self.file_filters:
... | [
"def",
"_filter_filepaths",
"(",
"self",
",",
"filepaths",
")",
":",
"if",
"self",
".",
"file_filters",
":",
"plugin_filepaths",
"=",
"set",
"(",
")",
"for",
"file_filter",
"in",
"self",
".",
"file_filters",
":",
"plugin_paths",
"=",
"file_filter",
"(",
"fil... | helps iterate through all the file parsers
each filter is applied individually to the
same set of `filepaths` | [
"helps",
"iterate",
"through",
"all",
"the",
"file",
"parsers",
"each",
"filter",
"is",
"applied",
"individually",
"to",
"the",
"same",
"set",
"of",
"filepaths"
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/file_manager.py#L219-L233 |
44,204 | newville/wxmplot | wxmplot/colors.py | rgb | def rgb(color,default=(0,0,0)):
""" return rgb tuple for named color in rgb.txt or a hex color """
c = color.lower()
if c[0:1] == '#' and len(c)==7:
r,g,b = c[1:3], c[3:5], c[5:]
r,g,b = [int(n, 16) for n in (r, g, b)]
return (r,g,b)
if c.find(' ')>-1: c = c.replace(' ','')
... | python | def rgb(color,default=(0,0,0)):
""" return rgb tuple for named color in rgb.txt or a hex color """
c = color.lower()
if c[0:1] == '#' and len(c)==7:
r,g,b = c[1:3], c[3:5], c[5:]
r,g,b = [int(n, 16) for n in (r, g, b)]
return (r,g,b)
if c.find(' ')>-1: c = c.replace(' ','')
... | [
"def",
"rgb",
"(",
"color",
",",
"default",
"=",
"(",
"0",
",",
"0",
",",
"0",
")",
")",
":",
"c",
"=",
"color",
".",
"lower",
"(",
")",
"if",
"c",
"[",
"0",
":",
"1",
"]",
"==",
"'#'",
"and",
"len",
"(",
"c",
")",
"==",
"7",
":",
"r",
... | return rgb tuple for named color in rgb.txt or a hex color | [
"return",
"rgb",
"tuple",
"for",
"named",
"color",
"in",
"rgb",
".",
"txt",
"or",
"a",
"hex",
"color"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/colors.py#L294-L305 |
44,205 | newville/wxmplot | wxmplot/colors.py | hexcolor | def hexcolor(color):
" returns hex color given a tuple, wx.Color, or X11 named color"
# first, if this is a hex color already, return!
# Python 3: needs rewrite for str/unicode change
if isinstance(color, six.string_types):
if color[0] == '#' and len(color)==7:
return color.lower()
... | python | def hexcolor(color):
" returns hex color given a tuple, wx.Color, or X11 named color"
# first, if this is a hex color already, return!
# Python 3: needs rewrite for str/unicode change
if isinstance(color, six.string_types):
if color[0] == '#' and len(color)==7:
return color.lower()
... | [
"def",
"hexcolor",
"(",
"color",
")",
":",
"# first, if this is a hex color already, return!",
"# Python 3: needs rewrite for str/unicode change",
"if",
"isinstance",
"(",
"color",
",",
"six",
".",
"string_types",
")",
":",
"if",
"color",
"[",
"0",
"]",
"==",
"'#'",
... | returns hex color given a tuple, wx.Color, or X11 named color | [
"returns",
"hex",
"color",
"given",
"a",
"tuple",
"wx",
".",
"Color",
"or",
"X11",
"named",
"color"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/colors.py#L327-L355 |
44,206 | newville/wxmplot | wxmplot/colors.py | register_custom_colormaps | def register_custom_colormaps():
"""
registers custom color maps
"""
if not HAS_MPL:
return ()
makemap = LinearSegmentedColormap.from_list
for name, val in custom_colormap_data.items():
cm1 = np.array(val).transpose().astype('f8')/256.0
cm2 = cm1[::-1]
nam1 = name... | python | def register_custom_colormaps():
"""
registers custom color maps
"""
if not HAS_MPL:
return ()
makemap = LinearSegmentedColormap.from_list
for name, val in custom_colormap_data.items():
cm1 = np.array(val).transpose().astype('f8')/256.0
cm2 = cm1[::-1]
nam1 = name... | [
"def",
"register_custom_colormaps",
"(",
")",
":",
"if",
"not",
"HAS_MPL",
":",
"return",
"(",
")",
"makemap",
"=",
"LinearSegmentedColormap",
".",
"from_list",
"for",
"name",
",",
"val",
"in",
"custom_colormap_data",
".",
"items",
"(",
")",
":",
"cm1",
"=",... | registers custom color maps | [
"registers",
"custom",
"color",
"maps"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/colors.py#L419-L435 |
44,207 | newville/wxmplot | wxmplot/imageframe.py | ImageFrame.onCMapSave | def onCMapSave(self, event=None, col='int'):
"""save color table image"""
file_choices = 'PNG (*.png)|*.png'
ofile = 'Colormap.png'
dlg = wx.FileDialog(self, message='Save Colormap as...',
defaultDir=os.getcwd(),
defaultFile=ofile,
... | python | def onCMapSave(self, event=None, col='int'):
"""save color table image"""
file_choices = 'PNG (*.png)|*.png'
ofile = 'Colormap.png'
dlg = wx.FileDialog(self, message='Save Colormap as...',
defaultDir=os.getcwd(),
defaultFile=ofile,
... | [
"def",
"onCMapSave",
"(",
"self",
",",
"event",
"=",
"None",
",",
"col",
"=",
"'int'",
")",
":",
"file_choices",
"=",
"'PNG (*.png)|*.png'",
"ofile",
"=",
"'Colormap.png'",
"dlg",
"=",
"wx",
".",
"FileDialog",
"(",
"self",
",",
"message",
"=",
"'Save Color... | save color table image | [
"save",
"color",
"table",
"image"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/imageframe.py#L860-L871 |
44,208 | benhoff/pluginmanager | pluginmanager/file_filters/matching_regex.py | MatchingRegexFileFilter.plugin_valid | def plugin_valid(self, filename):
"""
Checks if the given filename is a valid plugin for this Strategy
"""
filename = os.path.basename(filename)
for regex in self.regex_expressions:
if regex.match(filename):
return True
return False | python | def plugin_valid(self, filename):
"""
Checks if the given filename is a valid plugin for this Strategy
"""
filename = os.path.basename(filename)
for regex in self.regex_expressions:
if regex.match(filename):
return True
return False | [
"def",
"plugin_valid",
"(",
"self",
",",
"filename",
")",
":",
"filename",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"filename",
")",
"for",
"regex",
"in",
"self",
".",
"regex_expressions",
":",
"if",
"regex",
".",
"match",
"(",
"filename",
")",
":... | Checks if the given filename is a valid plugin for this Strategy | [
"Checks",
"if",
"the",
"given",
"filename",
"is",
"a",
"valid",
"plugin",
"for",
"this",
"Strategy"
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/file_filters/matching_regex.py#L35-L43 |
44,209 | JensAstrup/pyOutlook | pyOutlook/core/main.py | OutlookAccount.get_message | def get_message(self, message_id):
"""Gets message matching provided id.
the Outlook email matching the provided message_id.
Args:
message_id: A string for the intended message, provided by Outlook
Returns:
:class:`Message <pyOutlook.core.message.Message>`
... | python | def get_message(self, message_id):
"""Gets message matching provided id.
the Outlook email matching the provided message_id.
Args:
message_id: A string for the intended message, provided by Outlook
Returns:
:class:`Message <pyOutlook.core.message.Message>`
... | [
"def",
"get_message",
"(",
"self",
",",
"message_id",
")",
":",
"r",
"=",
"requests",
".",
"get",
"(",
"'https://outlook.office.com/api/v2.0/me/messages/'",
"+",
"message_id",
",",
"headers",
"=",
"self",
".",
"_headers",
")",
"check_response",
"(",
"r",
")",
... | Gets message matching provided id.
the Outlook email matching the provided message_id.
Args:
message_id: A string for the intended message, provided by Outlook
Returns:
:class:`Message <pyOutlook.core.message.Message>` | [
"Gets",
"message",
"matching",
"provided",
"id",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/main.py#L128-L142 |
44,210 | JensAstrup/pyOutlook | pyOutlook/core/main.py | OutlookAccount.get_messages | def get_messages(self, page=0):
"""Get first 10 messages in account, across all folders.
Keyword Args:
page (int): Integer representing the 'page' of results to fetch
Returns:
List[:class:`Message <pyOutlook.core.message.Message>`]
"""
endpoint = 'https... | python | def get_messages(self, page=0):
"""Get first 10 messages in account, across all folders.
Keyword Args:
page (int): Integer representing the 'page' of results to fetch
Returns:
List[:class:`Message <pyOutlook.core.message.Message>`]
"""
endpoint = 'https... | [
"def",
"get_messages",
"(",
"self",
",",
"page",
"=",
"0",
")",
":",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/messages'",
"if",
"page",
">",
"0",
":",
"endpoint",
"=",
"endpoint",
"+",
"'/?%24skip='",
"+",
"str",
"(",
"page",
")",
"+",
"'0'"... | Get first 10 messages in account, across all folders.
Keyword Args:
page (int): Integer representing the 'page' of results to fetch
Returns:
List[:class:`Message <pyOutlook.core.message.Message>`] | [
"Get",
"first",
"10",
"messages",
"in",
"account",
"across",
"all",
"folders",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/main.py#L144-L164 |
44,211 | JensAstrup/pyOutlook | pyOutlook/core/main.py | OutlookAccount.get_folders | def get_folders(self):
""" Returns a list of all folders for this account
Returns:
List[:class:`Folder <pyOutlook.core.folder.Folder>`]
"""
endpoint = 'https://outlook.office.com/api/v2.0/me/MailFolders/'
r = requests.get(endpoint, headers=self._headers)
... | python | def get_folders(self):
""" Returns a list of all folders for this account
Returns:
List[:class:`Folder <pyOutlook.core.folder.Folder>`]
"""
endpoint = 'https://outlook.office.com/api/v2.0/me/MailFolders/'
r = requests.get(endpoint, headers=self._headers)
... | [
"def",
"get_folders",
"(",
"self",
")",
":",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/MailFolders/'",
"r",
"=",
"requests",
".",
"get",
"(",
"endpoint",
",",
"headers",
"=",
"self",
".",
"_headers",
")",
"if",
"check_response",
"(",
"r",
")",
... | Returns a list of all folders for this account
Returns:
List[:class:`Folder <pyOutlook.core.folder.Folder>`] | [
"Returns",
"a",
"list",
"of",
"all",
"folders",
"for",
"this",
"account"
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/main.py#L243-L254 |
44,212 | JensAstrup/pyOutlook | pyOutlook/core/main.py | OutlookAccount.get_folder_by_id | def get_folder_by_id(self, folder_id):
""" Retrieve a Folder by its Outlook ID
Args:
folder_id: The ID of the :class:`Folder <pyOutlook.core.folder.Folder>` to retrieve
Returns: :class:`Folder <pyOutlook.core.folder.Folder>`
"""
endpoint = 'https://outlook.office.c... | python | def get_folder_by_id(self, folder_id):
""" Retrieve a Folder by its Outlook ID
Args:
folder_id: The ID of the :class:`Folder <pyOutlook.core.folder.Folder>` to retrieve
Returns: :class:`Folder <pyOutlook.core.folder.Folder>`
"""
endpoint = 'https://outlook.office.c... | [
"def",
"get_folder_by_id",
"(",
"self",
",",
"folder_id",
")",
":",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/MailFolders/'",
"+",
"folder_id",
"r",
"=",
"requests",
".",
"get",
"(",
"endpoint",
",",
"headers",
"=",
"self",
".",
"_headers",
")",
... | Retrieve a Folder by its Outlook ID
Args:
folder_id: The ID of the :class:`Folder <pyOutlook.core.folder.Folder>` to retrieve
Returns: :class:`Folder <pyOutlook.core.folder.Folder>` | [
"Retrieve",
"a",
"Folder",
"by",
"its",
"Outlook",
"ID"
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/main.py#L256-L271 |
44,213 | JensAstrup/pyOutlook | pyOutlook/core/main.py | OutlookAccount._get_messages_from_folder_name | def _get_messages_from_folder_name(self, folder_name):
""" Retrieves all messages from a folder, specified by its name. This only works with "Well Known" folders,
such as 'Inbox' or 'Drafts'.
Args:
folder_name (str): The name of the folder to retrieve
Returns: List[:class:`... | python | def _get_messages_from_folder_name(self, folder_name):
""" Retrieves all messages from a folder, specified by its name. This only works with "Well Known" folders,
such as 'Inbox' or 'Drafts'.
Args:
folder_name (str): The name of the folder to retrieve
Returns: List[:class:`... | [
"def",
"_get_messages_from_folder_name",
"(",
"self",
",",
"folder_name",
")",
":",
"r",
"=",
"requests",
".",
"get",
"(",
"'https://outlook.office.com/api/v2.0/me/MailFolders/'",
"+",
"folder_name",
"+",
"'/messages'",
",",
"headers",
"=",
"self",
".",
"_headers",
... | Retrieves all messages from a folder, specified by its name. This only works with "Well Known" folders,
such as 'Inbox' or 'Drafts'.
Args:
folder_name (str): The name of the folder to retrieve
Returns: List[:class:`Message <pyOutlook.core.message.Message>` ] | [
"Retrieves",
"all",
"messages",
"from",
"a",
"folder",
"specified",
"by",
"its",
"name",
".",
"This",
"only",
"works",
"with",
"Well",
"Known",
"folders",
"such",
"as",
"Inbox",
"or",
"Drafts",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/main.py#L273-L286 |
44,214 | JensAstrup/pyOutlook | pyOutlook/core/message.py | Message.api_representation | def api_representation(self, content_type):
""" Returns the JSON representation of this message required for making requests to the API.
Args:
content_type (str): Either 'HTML' or 'Text'
"""
payload = dict(Subject=self.subject, Body=dict(ContentType=content_type, Content=sel... | python | def api_representation(self, content_type):
""" Returns the JSON representation of this message required for making requests to the API.
Args:
content_type (str): Either 'HTML' or 'Text'
"""
payload = dict(Subject=self.subject, Body=dict(ContentType=content_type, Content=sel... | [
"def",
"api_representation",
"(",
"self",
",",
"content_type",
")",
":",
"payload",
"=",
"dict",
"(",
"Subject",
"=",
"self",
".",
"subject",
",",
"Body",
"=",
"dict",
"(",
"ContentType",
"=",
"content_type",
",",
"Content",
"=",
"self",
".",
"body",
")"... | Returns the JSON representation of this message required for making requests to the API.
Args:
content_type (str): Either 'HTML' or 'Text' | [
"Returns",
"the",
"JSON",
"representation",
"of",
"this",
"message",
"required",
"for",
"making",
"requests",
"to",
"the",
"API",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/message.py#L219-L260 |
44,215 | JensAstrup/pyOutlook | pyOutlook/core/message.py | Message.send | def send(self, content_type='HTML'):
""" Takes the recipients, body, and attachments of the Message and sends.
Args:
content_type: Can either be 'HTML' or 'Text', defaults to HTML.
"""
payload = self.api_representation(content_type)
endpoint = 'https://outlook.off... | python | def send(self, content_type='HTML'):
""" Takes the recipients, body, and attachments of the Message and sends.
Args:
content_type: Can either be 'HTML' or 'Text', defaults to HTML.
"""
payload = self.api_representation(content_type)
endpoint = 'https://outlook.off... | [
"def",
"send",
"(",
"self",
",",
"content_type",
"=",
"'HTML'",
")",
":",
"payload",
"=",
"self",
".",
"api_representation",
"(",
"content_type",
")",
"endpoint",
"=",
"'https://outlook.office.com/api/v1.0/me/sendmail'",
"self",
".",
"_make_api_call",
"(",
"'post'",... | Takes the recipients, body, and attachments of the Message and sends.
Args:
content_type: Can either be 'HTML' or 'Text', defaults to HTML. | [
"Takes",
"the",
"recipients",
"body",
"and",
"attachments",
"of",
"the",
"Message",
"and",
"sends",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/message.py#L297-L308 |
44,216 | JensAstrup/pyOutlook | pyOutlook/core/message.py | Message.forward | def forward(self, to_recipients, forward_comment=None):
# type: (Union[List[Contact], List[str]], str) -> None
"""Forward Message to recipients with an optional comment.
Args:
to_recipients: A list of :class:`Contacts <pyOutlook.core.contact.Contact>` to send the email to.
... | python | def forward(self, to_recipients, forward_comment=None):
# type: (Union[List[Contact], List[str]], str) -> None
"""Forward Message to recipients with an optional comment.
Args:
to_recipients: A list of :class:`Contacts <pyOutlook.core.contact.Contact>` to send the email to.
... | [
"def",
"forward",
"(",
"self",
",",
"to_recipients",
",",
"forward_comment",
"=",
"None",
")",
":",
"# type: (Union[List[Contact], List[str]], str) -> None",
"payload",
"=",
"dict",
"(",
")",
"if",
"forward_comment",
"is",
"not",
"None",
":",
"payload",
".",
"upda... | Forward Message to recipients with an optional comment.
Args:
to_recipients: A list of :class:`Contacts <pyOutlook.core.contact.Contact>` to send the email to.
forward_comment: String comment to append to forwarded email.
Examples:
>>> john = Contact('john.doe@domai... | [
"Forward",
"Message",
"to",
"recipients",
"with",
"an",
"optional",
"comment",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/message.py#L310-L341 |
44,217 | JensAstrup/pyOutlook | pyOutlook/core/message.py | Message.reply | def reply(self, reply_comment):
"""Reply to the Message.
Notes:
HTML can be inserted in the string and will be interpreted properly by Outlook.
Args:
reply_comment: String message to send with email.
"""
payload = '{ "Comment": "' + reply_comment + '"}'... | python | def reply(self, reply_comment):
"""Reply to the Message.
Notes:
HTML can be inserted in the string and will be interpreted properly by Outlook.
Args:
reply_comment: String message to send with email.
"""
payload = '{ "Comment": "' + reply_comment + '"}'... | [
"def",
"reply",
"(",
"self",
",",
"reply_comment",
")",
":",
"payload",
"=",
"'{ \"Comment\": \"'",
"+",
"reply_comment",
"+",
"'\"}'",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/messages/'",
"+",
"self",
".",
"message_id",
"+",
"'/reply'",
"self",
".... | Reply to the Message.
Notes:
HTML can be inserted in the string and will be interpreted properly by Outlook.
Args:
reply_comment: String message to send with email. | [
"Reply",
"to",
"the",
"Message",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/message.py#L343-L356 |
44,218 | JensAstrup/pyOutlook | pyOutlook/core/message.py | Message.reply_all | def reply_all(self, reply_comment):
"""Replies to everyone on the email, including those on the CC line.
With great power, comes great responsibility.
Args:
reply_comment: The string comment to send to everyone on the email.
"""
payload = '{ "Comment": "' + reply_c... | python | def reply_all(self, reply_comment):
"""Replies to everyone on the email, including those on the CC line.
With great power, comes great responsibility.
Args:
reply_comment: The string comment to send to everyone on the email.
"""
payload = '{ "Comment": "' + reply_c... | [
"def",
"reply_all",
"(",
"self",
",",
"reply_comment",
")",
":",
"payload",
"=",
"'{ \"Comment\": \"'",
"+",
"reply_comment",
"+",
"'\"}'",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/messages/{}/replyall'",
".",
"format",
"(",
"self",
".",
"message_id",
... | Replies to everyone on the email, including those on the CC line.
With great power, comes great responsibility.
Args:
reply_comment: The string comment to send to everyone on the email. | [
"Replies",
"to",
"everyone",
"on",
"the",
"email",
"including",
"those",
"on",
"the",
"CC",
"line",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/message.py#L358-L370 |
44,219 | JensAstrup/pyOutlook | pyOutlook/core/message.py | Message.move_to | def move_to(self, folder):
"""Moves the email to the folder specified by the folder parameter.
Args:
folder: A string containing the folder ID the message should be moved to, or a Folder instance
"""
if isinstance(folder, Folder):
self.move_to(folder.id)
... | python | def move_to(self, folder):
"""Moves the email to the folder specified by the folder parameter.
Args:
folder: A string containing the folder ID the message should be moved to, or a Folder instance
"""
if isinstance(folder, Folder):
self.move_to(folder.id)
... | [
"def",
"move_to",
"(",
"self",
",",
"folder",
")",
":",
"if",
"isinstance",
"(",
"folder",
",",
"Folder",
")",
":",
"self",
".",
"move_to",
"(",
"folder",
".",
"id",
")",
"else",
":",
"self",
".",
"_move_to",
"(",
"folder",
")"
] | Moves the email to the folder specified by the folder parameter.
Args:
folder: A string containing the folder ID the message should be moved to, or a Folder instance | [
"Moves",
"the",
"email",
"to",
"the",
"folder",
"specified",
"by",
"the",
"folder",
"parameter",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/message.py#L397-L407 |
44,220 | newville/wxmplot | wxmplot/imageconf.py | ImageConfig.rgb2cmy | def rgb2cmy(self, img, whitebg=False):
"""transforms image from RGB to CMY"""
tmp = img*1.0
if whitebg:
tmp = (1.0 - (img - img.min())/(img.max() - img.min()))
out = tmp*0.0
out[:,:,0] = (tmp[:,:,1] + tmp[:,:,2])/2.0
out[:,:,1] = (tmp[:,:,0] + tmp[:,:,2])/2.0
... | python | def rgb2cmy(self, img, whitebg=False):
"""transforms image from RGB to CMY"""
tmp = img*1.0
if whitebg:
tmp = (1.0 - (img - img.min())/(img.max() - img.min()))
out = tmp*0.0
out[:,:,0] = (tmp[:,:,1] + tmp[:,:,2])/2.0
out[:,:,1] = (tmp[:,:,0] + tmp[:,:,2])/2.0
... | [
"def",
"rgb2cmy",
"(",
"self",
",",
"img",
",",
"whitebg",
"=",
"False",
")",
":",
"tmp",
"=",
"img",
"*",
"1.0",
"if",
"whitebg",
":",
"tmp",
"=",
"(",
"1.0",
"-",
"(",
"img",
"-",
"img",
".",
"min",
"(",
")",
")",
"/",
"(",
"img",
".",
"m... | transforms image from RGB to CMY | [
"transforms",
"image",
"from",
"RGB",
"to",
"CMY"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/imageconf.py#L105-L114 |
44,221 | benhoff/pluginmanager | pluginmanager/file_filters/with_info_file.py | WithInfoFileFilter.plugin_valid | def plugin_valid(self, filepath):
"""
checks to see if plugin ends with one of the
approved extensions
"""
plugin_valid = False
for extension in self.extensions:
if filepath.endswith(".{}".format(extension)):
plugin_valid = True
... | python | def plugin_valid(self, filepath):
"""
checks to see if plugin ends with one of the
approved extensions
"""
plugin_valid = False
for extension in self.extensions:
if filepath.endswith(".{}".format(extension)):
plugin_valid = True
... | [
"def",
"plugin_valid",
"(",
"self",
",",
"filepath",
")",
":",
"plugin_valid",
"=",
"False",
"for",
"extension",
"in",
"self",
".",
"extensions",
":",
"if",
"filepath",
".",
"endswith",
"(",
"\".{}\"",
".",
"format",
"(",
"extension",
")",
")",
":",
"plu... | checks to see if plugin ends with one of the
approved extensions | [
"checks",
"to",
"see",
"if",
"plugin",
"ends",
"with",
"one",
"of",
"the",
"approved",
"extensions"
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/file_filters/with_info_file.py#L47-L57 |
44,222 | JensAstrup/pyOutlook | pyOutlook/core/contact.py | Contact.api_representation | def api_representation(self):
""" Returns the JSON formatting required by Outlook's API for contacts """
return dict(EmailAddress=dict(Name=self.name, Address=self.email)) | python | def api_representation(self):
""" Returns the JSON formatting required by Outlook's API for contacts """
return dict(EmailAddress=dict(Name=self.name, Address=self.email)) | [
"def",
"api_representation",
"(",
"self",
")",
":",
"return",
"dict",
"(",
"EmailAddress",
"=",
"dict",
"(",
"Name",
"=",
"self",
".",
"name",
",",
"Address",
"=",
"self",
".",
"email",
")",
")"
] | Returns the JSON formatting required by Outlook's API for contacts | [
"Returns",
"the",
"JSON",
"formatting",
"required",
"by",
"Outlook",
"s",
"API",
"for",
"contacts"
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/contact.py#L82-L84 |
44,223 | JensAstrup/pyOutlook | pyOutlook/core/contact.py | Contact.set_focused | def set_focused(self, account, is_focused):
# type: (OutlookAccount, bool) -> bool
""" Emails from this contact will either always be put in the Focused inbox, or always put in Other, based on
the value of is_focused.
Args:
account (OutlookAccount): The :class:`OutlookAccoun... | python | def set_focused(self, account, is_focused):
# type: (OutlookAccount, bool) -> bool
""" Emails from this contact will either always be put in the Focused inbox, or always put in Other, based on
the value of is_focused.
Args:
account (OutlookAccount): The :class:`OutlookAccoun... | [
"def",
"set_focused",
"(",
"self",
",",
"account",
",",
"is_focused",
")",
":",
"# type: (OutlookAccount, bool) -> bool",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/InferenceClassification/Overrides'",
"if",
"is_focused",
":",
"classification",
"=",
"'Focused'",
... | Emails from this contact will either always be put in the Focused inbox, or always put in Other, based on
the value of is_focused.
Args:
account (OutlookAccount): The :class:`OutlookAccount <pyOutlook.core.main.OutlookAccount>`
the override should be set for
is_f... | [
"Emails",
"from",
"this",
"contact",
"will",
"either",
"always",
"be",
"put",
"in",
"the",
"Focused",
"inbox",
"or",
"always",
"put",
"in",
"Other",
"based",
"on",
"the",
"value",
"of",
"is_focused",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/contact.py#L86-L115 |
44,224 | newville/wxmplot | wxmplot/imagematrixframe.py | image2wxbitmap | def image2wxbitmap(img):
"PIL image 2 wx bitmap"
if is_wxPhoenix:
wximg = wx.Image(*img.size)
else:
wximg = wx.EmptyImage(*img.size)
wximg.SetData(img.tobytes())
return wximg.ConvertToBitmap() | python | def image2wxbitmap(img):
"PIL image 2 wx bitmap"
if is_wxPhoenix:
wximg = wx.Image(*img.size)
else:
wximg = wx.EmptyImage(*img.size)
wximg.SetData(img.tobytes())
return wximg.ConvertToBitmap() | [
"def",
"image2wxbitmap",
"(",
"img",
")",
":",
"if",
"is_wxPhoenix",
":",
"wximg",
"=",
"wx",
".",
"Image",
"(",
"*",
"img",
".",
"size",
")",
"else",
":",
"wximg",
"=",
"wx",
".",
"EmptyImage",
"(",
"*",
"img",
".",
"size",
")",
"wximg",
".",
"S... | PIL image 2 wx bitmap | [
"PIL",
"image",
"2",
"wx",
"bitmap"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/imagematrixframe.py#L48-L55 |
44,225 | JensAstrup/pyOutlook | pyOutlook/internal/utils.py | check_response | def check_response(response):
""" Checks that a response is successful, raising the appropriate Exceptions otherwise. """
status_code = response.status_code
if 100 < status_code < 299:
return True
elif status_code == 401 or status_code == 403:
message = get_response_data(response)
... | python | def check_response(response):
""" Checks that a response is successful, raising the appropriate Exceptions otherwise. """
status_code = response.status_code
if 100 < status_code < 299:
return True
elif status_code == 401 or status_code == 403:
message = get_response_data(response)
... | [
"def",
"check_response",
"(",
"response",
")",
":",
"status_code",
"=",
"response",
".",
"status_code",
"if",
"100",
"<",
"status_code",
"<",
"299",
":",
"return",
"True",
"elif",
"status_code",
"==",
"401",
"or",
"status_code",
"==",
"403",
":",
"message",
... | Checks that a response is successful, raising the appropriate Exceptions otherwise. | [
"Checks",
"that",
"a",
"response",
"is",
"successful",
"raising",
"the",
"appropriate",
"Exceptions",
"otherwise",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/internal/utils.py#L30-L48 |
44,226 | benhoff/pluginmanager | pluginmanager/plugin_manager.py | PluginManager.get_plugins | def get_plugins(self, filter_function=None):
"""
Gets out the plugins from the internal state. Returns a list object.
If the optional filter_function is supplied, applies the filter
function to the arguments before returning them. Filters should
be callable and take a list argume... | python | def get_plugins(self, filter_function=None):
"""
Gets out the plugins from the internal state. Returns a list object.
If the optional filter_function is supplied, applies the filter
function to the arguments before returning them. Filters should
be callable and take a list argume... | [
"def",
"get_plugins",
"(",
"self",
",",
"filter_function",
"=",
"None",
")",
":",
"plugins",
"=",
"self",
".",
"plugins",
"if",
"filter_function",
"is",
"not",
"None",
":",
"plugins",
"=",
"filter_function",
"(",
"plugins",
")",
"return",
"plugins"
] | Gets out the plugins from the internal state. Returns a list object.
If the optional filter_function is supplied, applies the filter
function to the arguments before returning them. Filters should
be callable and take a list argument of plugins. | [
"Gets",
"out",
"the",
"plugins",
"from",
"the",
"internal",
"state",
".",
"Returns",
"a",
"list",
"object",
".",
"If",
"the",
"optional",
"filter_function",
"is",
"supplied",
"applies",
"the",
"filter",
"function",
"to",
"the",
"arguments",
"before",
"returnin... | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/plugin_manager.py#L37-L47 |
44,227 | benhoff/pluginmanager | pluginmanager/plugin_manager.py | PluginManager._get_instance | def _get_instance(self, klasses):
"""
internal method that gets every instance of the klasses
out of the internal plugin state.
"""
return [x for x in self.plugins if isinstance(x, klasses)] | python | def _get_instance(self, klasses):
"""
internal method that gets every instance of the klasses
out of the internal plugin state.
"""
return [x for x in self.plugins if isinstance(x, klasses)] | [
"def",
"_get_instance",
"(",
"self",
",",
"klasses",
")",
":",
"return",
"[",
"x",
"for",
"x",
"in",
"self",
".",
"plugins",
"if",
"isinstance",
"(",
"x",
",",
"klasses",
")",
"]"
] | internal method that gets every instance of the klasses
out of the internal plugin state. | [
"internal",
"method",
"that",
"gets",
"every",
"instance",
"of",
"the",
"klasses",
"out",
"of",
"the",
"internal",
"plugin",
"state",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/plugin_manager.py#L95-L100 |
44,228 | benhoff/pluginmanager | pluginmanager/plugin_manager.py | PluginManager.get_instances | def get_instances(self, filter_function=IPlugin):
"""
Gets instances out of the internal state using
the default filter supplied in filter_function.
By default, it is the class IPlugin.
Can optionally pass in a list or tuple of classes
in for `filter_function` which will... | python | def get_instances(self, filter_function=IPlugin):
"""
Gets instances out of the internal state using
the default filter supplied in filter_function.
By default, it is the class IPlugin.
Can optionally pass in a list or tuple of classes
in for `filter_function` which will... | [
"def",
"get_instances",
"(",
"self",
",",
"filter_function",
"=",
"IPlugin",
")",
":",
"if",
"isinstance",
"(",
"filter_function",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"return",
"self",
".",
"_get_instance",
"(",
"filter_function",
")",
"elif",
"... | Gets instances out of the internal state using
the default filter supplied in filter_function.
By default, it is the class IPlugin.
Can optionally pass in a list or tuple of classes
in for `filter_function` which will accomplish
the same goal.
lastly, a callable can be ... | [
"Gets",
"instances",
"out",
"of",
"the",
"internal",
"state",
"using",
"the",
"default",
"filter",
"supplied",
"in",
"filter_function",
".",
"By",
"default",
"it",
"is",
"the",
"class",
"IPlugin",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/plugin_manager.py#L102-L123 |
44,229 | benhoff/pluginmanager | pluginmanager/plugin_manager.py | PluginManager.register_classes | def register_classes(self, classes):
"""
Register classes as plugins that are not subclassed from
IPlugin.
`classes` may be a single object or an iterable.
"""
classes = util.return_list(classes)
for klass in classes:
IPlugin.register(klass) | python | def register_classes(self, classes):
"""
Register classes as plugins that are not subclassed from
IPlugin.
`classes` may be a single object or an iterable.
"""
classes = util.return_list(classes)
for klass in classes:
IPlugin.register(klass) | [
"def",
"register_classes",
"(",
"self",
",",
"classes",
")",
":",
"classes",
"=",
"util",
".",
"return_list",
"(",
"classes",
")",
"for",
"klass",
"in",
"classes",
":",
"IPlugin",
".",
"register",
"(",
"klass",
")"
] | Register classes as plugins that are not subclassed from
IPlugin.
`classes` may be a single object or an iterable. | [
"Register",
"classes",
"as",
"plugins",
"that",
"are",
"not",
"subclassed",
"from",
"IPlugin",
".",
"classes",
"may",
"be",
"a",
"single",
"object",
"or",
"an",
"iterable",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/plugin_manager.py#L125-L133 |
44,230 | benhoff/pluginmanager | pluginmanager/plugin_manager.py | PluginManager._instance_parser | def _instance_parser(self, plugins):
"""
internal method to parse instances of plugins.
Determines if each class is a class instance or
object instance and calls the appropiate handler
method.
"""
plugins = util.return_list(plugins)
for instance in plugin... | python | def _instance_parser(self, plugins):
"""
internal method to parse instances of plugins.
Determines if each class is a class instance or
object instance and calls the appropiate handler
method.
"""
plugins = util.return_list(plugins)
for instance in plugin... | [
"def",
"_instance_parser",
"(",
"self",
",",
"plugins",
")",
":",
"plugins",
"=",
"util",
".",
"return_list",
"(",
"plugins",
")",
"for",
"instance",
"in",
"plugins",
":",
"if",
"inspect",
".",
"isclass",
"(",
"instance",
")",
":",
"self",
".",
"_handle_... | internal method to parse instances of plugins.
Determines if each class is a class instance or
object instance and calls the appropiate handler
method. | [
"internal",
"method",
"to",
"parse",
"instances",
"of",
"plugins",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/plugin_manager.py#L135-L148 |
44,231 | benhoff/pluginmanager | pluginmanager/plugin_manager.py | PluginManager._handle_class_instance | def _handle_class_instance(self, klass):
"""
handles class instances. If a class is blacklisted, returns.
If uniuqe_instances is True and the class is unique, instantiates
the class and adds the new object to plugins.
If not unique_instances, creates and adds new instance to plu... | python | def _handle_class_instance(self, klass):
"""
handles class instances. If a class is blacklisted, returns.
If uniuqe_instances is True and the class is unique, instantiates
the class and adds the new object to plugins.
If not unique_instances, creates and adds new instance to plu... | [
"def",
"_handle_class_instance",
"(",
"self",
",",
"klass",
")",
":",
"if",
"(",
"klass",
"in",
"self",
".",
"blacklisted_plugins",
"or",
"not",
"self",
".",
"instantiate_classes",
"or",
"klass",
"==",
"IPlugin",
")",
":",
"return",
"elif",
"self",
".",
"u... | handles class instances. If a class is blacklisted, returns.
If uniuqe_instances is True and the class is unique, instantiates
the class and adds the new object to plugins.
If not unique_instances, creates and adds new instance to plugin
state | [
"handles",
"class",
"instances",
".",
"If",
"a",
"class",
"is",
"blacklisted",
"returns",
".",
"If",
"uniuqe_instances",
"is",
"True",
"and",
"the",
"class",
"is",
"unique",
"instantiates",
"the",
"class",
"and",
"adds",
"the",
"new",
"object",
"to",
"plugin... | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/plugin_manager.py#L150-L166 |
44,232 | benhoff/pluginmanager | pluginmanager/plugin_manager.py | PluginManager._unique_class | def _unique_class(self, cls):
"""
internal method to check if any of the plugins are instances
of a given cls
"""
return not any(isinstance(obj, cls) for obj in self.plugins) | python | def _unique_class(self, cls):
"""
internal method to check if any of the plugins are instances
of a given cls
"""
return not any(isinstance(obj, cls) for obj in self.plugins) | [
"def",
"_unique_class",
"(",
"self",
",",
"cls",
")",
":",
"return",
"not",
"any",
"(",
"isinstance",
"(",
"obj",
",",
"cls",
")",
"for",
"obj",
"in",
"self",
".",
"plugins",
")"
] | internal method to check if any of the plugins are instances
of a given cls | [
"internal",
"method",
"to",
"check",
"if",
"any",
"of",
"the",
"plugins",
"are",
"instances",
"of",
"a",
"given",
"cls"
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/plugin_manager.py#L201-L206 |
44,233 | benhoff/pluginmanager | pluginmanager/plugin_manager.py | PluginManager.add_blacklisted_plugins | def add_blacklisted_plugins(self, plugins):
"""
add blacklisted plugins.
`plugins` may be a single object or iterable.
"""
plugins = util.return_list(plugins)
self.blacklisted_plugins.extend(plugins) | python | def add_blacklisted_plugins(self, plugins):
"""
add blacklisted plugins.
`plugins` may be a single object or iterable.
"""
plugins = util.return_list(plugins)
self.blacklisted_plugins.extend(plugins) | [
"def",
"add_blacklisted_plugins",
"(",
"self",
",",
"plugins",
")",
":",
"plugins",
"=",
"util",
".",
"return_list",
"(",
"plugins",
")",
"self",
".",
"blacklisted_plugins",
".",
"extend",
"(",
"plugins",
")"
] | add blacklisted plugins.
`plugins` may be a single object or iterable. | [
"add",
"blacklisted",
"plugins",
".",
"plugins",
"may",
"be",
"a",
"single",
"object",
"or",
"iterable",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/plugin_manager.py#L208-L214 |
44,234 | benhoff/pluginmanager | pluginmanager/plugin_manager.py | PluginManager.set_blacklisted_plugins | def set_blacklisted_plugins(self, plugins):
"""
sets blacklisted plugins.
`plugins` may be a single object or iterable.
"""
plugins = util.return_list(plugins)
self.blacklisted_plugins = plugins | python | def set_blacklisted_plugins(self, plugins):
"""
sets blacklisted plugins.
`plugins` may be a single object or iterable.
"""
plugins = util.return_list(plugins)
self.blacklisted_plugins = plugins | [
"def",
"set_blacklisted_plugins",
"(",
"self",
",",
"plugins",
")",
":",
"plugins",
"=",
"util",
".",
"return_list",
"(",
"plugins",
")",
"self",
".",
"blacklisted_plugins",
"=",
"plugins"
] | sets blacklisted plugins.
`plugins` may be a single object or iterable. | [
"sets",
"blacklisted",
"plugins",
".",
"plugins",
"may",
"be",
"a",
"single",
"object",
"or",
"iterable",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/plugin_manager.py#L216-L222 |
44,235 | benhoff/pluginmanager | pluginmanager/module_manager.py | ModuleManager.collect_plugins | def collect_plugins(self, modules=None):
"""
Collects all the plugins from `modules`.
If modules is None, collects the plugins from the loaded modules.
All plugins are passed through the module filters, if any are any,
and returned as a list.
"""
if modules is No... | python | def collect_plugins(self, modules=None):
"""
Collects all the plugins from `modules`.
If modules is None, collects the plugins from the loaded modules.
All plugins are passed through the module filters, if any are any,
and returned as a list.
"""
if modules is No... | [
"def",
"collect_plugins",
"(",
"self",
",",
"modules",
"=",
"None",
")",
":",
"if",
"modules",
"is",
"None",
":",
"modules",
"=",
"self",
".",
"get_loaded_modules",
"(",
")",
"else",
":",
"modules",
"=",
"util",
".",
"return_list",
"(",
"modules",
")",
... | Collects all the plugins from `modules`.
If modules is None, collects the plugins from the loaded modules.
All plugins are passed through the module filters, if any are any,
and returned as a list. | [
"Collects",
"all",
"the",
"plugins",
"from",
"modules",
".",
"If",
"modules",
"is",
"None",
"collects",
"the",
"plugins",
"from",
"the",
"loaded",
"modules",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/module_manager.py#L86-L109 |
44,236 | benhoff/pluginmanager | pluginmanager/module_manager.py | ModuleManager.set_module_plugin_filters | def set_module_plugin_filters(self, module_plugin_filters):
"""
Sets the internal module filters to `module_plugin_filters`
`module_plugin_filters` may be a single object or an iterable.
Every module filters must be a callable and take in
a list of plugins and their associated n... | python | def set_module_plugin_filters(self, module_plugin_filters):
"""
Sets the internal module filters to `module_plugin_filters`
`module_plugin_filters` may be a single object or an iterable.
Every module filters must be a callable and take in
a list of plugins and their associated n... | [
"def",
"set_module_plugin_filters",
"(",
"self",
",",
"module_plugin_filters",
")",
":",
"module_plugin_filters",
"=",
"util",
".",
"return_list",
"(",
"module_plugin_filters",
")",
"self",
".",
"module_plugin_filters",
"=",
"module_plugin_filters"
] | Sets the internal module filters to `module_plugin_filters`
`module_plugin_filters` may be a single object or an iterable.
Every module filters must be a callable and take in
a list of plugins and their associated names. | [
"Sets",
"the",
"internal",
"module",
"filters",
"to",
"module_plugin_filters",
"module_plugin_filters",
"may",
"be",
"a",
"single",
"object",
"or",
"an",
"iterable",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/module_manager.py#L111-L120 |
44,237 | benhoff/pluginmanager | pluginmanager/module_manager.py | ModuleManager.add_module_plugin_filters | def add_module_plugin_filters(self, module_plugin_filters):
"""
Adds `module_plugin_filters` to the internal module filters.
May be a single object or an iterable.
Every module filters must be a callable and take in
a list of plugins and their associated names.
"""
... | python | def add_module_plugin_filters(self, module_plugin_filters):
"""
Adds `module_plugin_filters` to the internal module filters.
May be a single object or an iterable.
Every module filters must be a callable and take in
a list of plugins and their associated names.
"""
... | [
"def",
"add_module_plugin_filters",
"(",
"self",
",",
"module_plugin_filters",
")",
":",
"module_plugin_filters",
"=",
"util",
".",
"return_list",
"(",
"module_plugin_filters",
")",
"self",
".",
"module_plugin_filters",
".",
"extend",
"(",
"module_plugin_filters",
")"
] | Adds `module_plugin_filters` to the internal module filters.
May be a single object or an iterable.
Every module filters must be a callable and take in
a list of plugins and their associated names. | [
"Adds",
"module_plugin_filters",
"to",
"the",
"internal",
"module",
"filters",
".",
"May",
"be",
"a",
"single",
"object",
"or",
"an",
"iterable",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/module_manager.py#L122-L131 |
44,238 | benhoff/pluginmanager | pluginmanager/module_manager.py | ModuleManager._get_modules | def _get_modules(self, names):
"""
An internal method that gets the `names` from sys.modules and returns
them as a list
"""
loaded_modules = []
for name in names:
loaded_modules.append(sys.modules[name])
return loaded_modules | python | def _get_modules(self, names):
"""
An internal method that gets the `names` from sys.modules and returns
them as a list
"""
loaded_modules = []
for name in names:
loaded_modules.append(sys.modules[name])
return loaded_modules | [
"def",
"_get_modules",
"(",
"self",
",",
"names",
")",
":",
"loaded_modules",
"=",
"[",
"]",
"for",
"name",
"in",
"names",
":",
"loaded_modules",
".",
"append",
"(",
"sys",
".",
"modules",
"[",
"name",
"]",
")",
"return",
"loaded_modules"
] | An internal method that gets the `names` from sys.modules and returns
them as a list | [
"An",
"internal",
"method",
"that",
"gets",
"the",
"names",
"from",
"sys",
".",
"modules",
"and",
"returns",
"them",
"as",
"a",
"list"
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/module_manager.py#L157-L165 |
44,239 | benhoff/pluginmanager | pluginmanager/module_manager.py | ModuleManager.add_to_loaded_modules | def add_to_loaded_modules(self, modules):
"""
Manually add in `modules` to be tracked by the module manager.
`modules` may be a single object or an iterable.
"""
modules = util.return_set(modules)
for module in modules:
if not isinstance(module, str):
... | python | def add_to_loaded_modules(self, modules):
"""
Manually add in `modules` to be tracked by the module manager.
`modules` may be a single object or an iterable.
"""
modules = util.return_set(modules)
for module in modules:
if not isinstance(module, str):
... | [
"def",
"add_to_loaded_modules",
"(",
"self",
",",
"modules",
")",
":",
"modules",
"=",
"util",
".",
"return_set",
"(",
"modules",
")",
"for",
"module",
"in",
"modules",
":",
"if",
"not",
"isinstance",
"(",
"module",
",",
"str",
")",
":",
"module",
"=",
... | Manually add in `modules` to be tracked by the module manager.
`modules` may be a single object or an iterable. | [
"Manually",
"add",
"in",
"modules",
"to",
"be",
"tracked",
"by",
"the",
"module",
"manager",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/module_manager.py#L167-L177 |
44,240 | benhoff/pluginmanager | pluginmanager/module_manager.py | ModuleManager._filter_modules | def _filter_modules(self, plugins, names):
"""
Internal helper method to parse all of the plugins and names
through each of the module filters
"""
if self.module_plugin_filters:
# check to make sure the number of plugins isn't changing
original_length_plug... | python | def _filter_modules(self, plugins, names):
"""
Internal helper method to parse all of the plugins and names
through each of the module filters
"""
if self.module_plugin_filters:
# check to make sure the number of plugins isn't changing
original_length_plug... | [
"def",
"_filter_modules",
"(",
"self",
",",
"plugins",
",",
"names",
")",
":",
"if",
"self",
".",
"module_plugin_filters",
":",
"# check to make sure the number of plugins isn't changing",
"original_length_plugins",
"=",
"len",
"(",
"plugins",
")",
"module_plugins",
"="... | Internal helper method to parse all of the plugins and names
through each of the module filters | [
"Internal",
"helper",
"method",
"to",
"parse",
"all",
"of",
"the",
"plugins",
"and",
"names",
"through",
"each",
"of",
"the",
"module",
"filters"
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/module_manager.py#L185-L206 |
44,241 | benhoff/pluginmanager | pluginmanager/module_manager.py | ModuleManager._clean_filepath | def _clean_filepath(self, filepath):
"""
processes the filepath by checking if it is a directory or not
and adding `.py` if not present.
"""
if (os.path.isdir(filepath) and
os.path.isfile(os.path.join(filepath, '__init__.py'))):
filepath = os.path.joi... | python | def _clean_filepath(self, filepath):
"""
processes the filepath by checking if it is a directory or not
and adding `.py` if not present.
"""
if (os.path.isdir(filepath) and
os.path.isfile(os.path.join(filepath, '__init__.py'))):
filepath = os.path.joi... | [
"def",
"_clean_filepath",
"(",
"self",
",",
"filepath",
")",
":",
"if",
"(",
"os",
".",
"path",
".",
"isdir",
"(",
"filepath",
")",
"and",
"os",
".",
"path",
".",
"isfile",
"(",
"os",
".",
"path",
".",
"join",
"(",
"filepath",
",",
"'__init__.py'",
... | processes the filepath by checking if it is a directory or not
and adding `.py` if not present. | [
"processes",
"the",
"filepath",
"by",
"checking",
"if",
"it",
"is",
"a",
"directory",
"or",
"not",
"and",
"adding",
".",
"py",
"if",
"not",
"present",
"."
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/module_manager.py#L208-L221 |
44,242 | benhoff/pluginmanager | pluginmanager/module_manager.py | ModuleManager._processed_filepath | def _processed_filepath(self, filepath):
"""
checks to see if the filepath has already been processed
"""
processed = False
if filepath in self.processed_filepaths.values():
processed = True
return processed | python | def _processed_filepath(self, filepath):
"""
checks to see if the filepath has already been processed
"""
processed = False
if filepath in self.processed_filepaths.values():
processed = True
return processed | [
"def",
"_processed_filepath",
"(",
"self",
",",
"filepath",
")",
":",
"processed",
"=",
"False",
"if",
"filepath",
"in",
"self",
".",
"processed_filepaths",
".",
"values",
"(",
")",
":",
"processed",
"=",
"True",
"return",
"processed"
] | checks to see if the filepath has already been processed | [
"checks",
"to",
"see",
"if",
"the",
"filepath",
"has",
"already",
"been",
"processed"
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/module_manager.py#L223-L231 |
44,243 | benhoff/pluginmanager | pluginmanager/module_manager.py | ModuleManager._update_loaded_modules | def _update_loaded_modules(self):
"""
Updates the loaded modules by checking if they are still in sys.modules
"""
system_modules = sys.modules.keys()
for module in list(self.loaded_modules):
if module not in system_modules:
self.processed_filepaths.pop... | python | def _update_loaded_modules(self):
"""
Updates the loaded modules by checking if they are still in sys.modules
"""
system_modules = sys.modules.keys()
for module in list(self.loaded_modules):
if module not in system_modules:
self.processed_filepaths.pop... | [
"def",
"_update_loaded_modules",
"(",
"self",
")",
":",
"system_modules",
"=",
"sys",
".",
"modules",
".",
"keys",
"(",
")",
"for",
"module",
"in",
"list",
"(",
"self",
".",
"loaded_modules",
")",
":",
"if",
"module",
"not",
"in",
"system_modules",
":",
... | Updates the loaded modules by checking if they are still in sys.modules | [
"Updates",
"the",
"loaded",
"modules",
"by",
"checking",
"if",
"they",
"are",
"still",
"in",
"sys",
".",
"modules"
] | a8a184f9ebfbb521703492cb88c1dbda4cd04c06 | https://github.com/benhoff/pluginmanager/blob/a8a184f9ebfbb521703492cb88c1dbda4cd04c06/pluginmanager/module_manager.py#L233-L241 |
44,244 | newville/wxmplot | wxmplot/basepanel.py | BasePanel.get_right_axes | def get_right_axes(self):
"create, if needed, and return right-hand y axes"
if len(self.fig.get_axes()) < 2:
ax = self.axes.twinx()
return self.fig.get_axes()[1] | python | def get_right_axes(self):
"create, if needed, and return right-hand y axes"
if len(self.fig.get_axes()) < 2:
ax = self.axes.twinx()
return self.fig.get_axes()[1] | [
"def",
"get_right_axes",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"fig",
".",
"get_axes",
"(",
")",
")",
"<",
"2",
":",
"ax",
"=",
"self",
".",
"axes",
".",
"twinx",
"(",
")",
"return",
"self",
".",
"fig",
".",
"get_axes",
"(",
")"... | create, if needed, and return right-hand y axes | [
"create",
"if",
"needed",
"and",
"return",
"right",
"-",
"hand",
"y",
"axes"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/basepanel.py#L138-L143 |
44,245 | newville/wxmplot | wxmplot/basepanel.py | BasePanel.onLeftUp | def onLeftUp(self, event=None):
""" left button up"""
if event is None:
return
self.cursor_mode_action('leftup', event=event)
self.canvas.draw_idle()
self.canvas.draw()
self.ForwardEvent(event=event.guiEvent) | python | def onLeftUp(self, event=None):
""" left button up"""
if event is None:
return
self.cursor_mode_action('leftup', event=event)
self.canvas.draw_idle()
self.canvas.draw()
self.ForwardEvent(event=event.guiEvent) | [
"def",
"onLeftUp",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"event",
"is",
"None",
":",
"return",
"self",
".",
"cursor_mode_action",
"(",
"'leftup'",
",",
"event",
"=",
"event",
")",
"self",
".",
"canvas",
".",
"draw_idle",
"(",
")",
"... | left button up | [
"left",
"button",
"up"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/basepanel.py#L268-L275 |
44,246 | newville/wxmplot | wxmplot/basepanel.py | BasePanel.ForwardEvent | def ForwardEvent(self, event=None):
"""finish wx event, forward it to other wx objects"""
if event is not None:
event.Skip()
if self.HasCapture():
try:
self.ReleaseMouse()
except:
pass | python | def ForwardEvent(self, event=None):
"""finish wx event, forward it to other wx objects"""
if event is not None:
event.Skip()
if self.HasCapture():
try:
self.ReleaseMouse()
except:
pass | [
"def",
"ForwardEvent",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"event",
"is",
"not",
"None",
":",
"event",
".",
"Skip",
"(",
")",
"if",
"self",
".",
"HasCapture",
"(",
")",
":",
"try",
":",
"self",
".",
"ReleaseMouse",
"(",
")",
"... | finish wx event, forward it to other wx objects | [
"finish",
"wx",
"event",
"forward",
"it",
"to",
"other",
"wx",
"objects"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/basepanel.py#L277-L285 |
44,247 | newville/wxmplot | wxmplot/basepanel.py | BasePanel.__date_format | def __date_format(self, x):
""" formatter for date x-data. primitive, and probably needs
improvement, following matplotlib's date methods.
"""
if x < 1: x = 1
span = self.axes.xaxis.get_view_interval()
tmin = max(1.0, span[0])
tmax = max(2.0, span[1])
tm... | python | def __date_format(self, x):
""" formatter for date x-data. primitive, and probably needs
improvement, following matplotlib's date methods.
"""
if x < 1: x = 1
span = self.axes.xaxis.get_view_interval()
tmin = max(1.0, span[0])
tmax = max(2.0, span[1])
tm... | [
"def",
"__date_format",
"(",
"self",
",",
"x",
")",
":",
"if",
"x",
"<",
"1",
":",
"x",
"=",
"1",
"span",
"=",
"self",
".",
"axes",
".",
"xaxis",
".",
"get_view_interval",
"(",
")",
"tmin",
"=",
"max",
"(",
"1.0",
",",
"span",
"[",
"0",
"]",
... | formatter for date x-data. primitive, and probably needs
improvement, following matplotlib's date methods. | [
"formatter",
"for",
"date",
"x",
"-",
"data",
".",
"primitive",
"and",
"probably",
"needs",
"improvement",
"following",
"matplotlib",
"s",
"date",
"methods",
"."
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/basepanel.py#L312-L335 |
44,248 | newville/wxmplot | wxmplot/basepanel.py | BasePanel.xformatter | def xformatter(self, x, pos):
" x-axis formatter "
if self.use_dates:
return self.__date_format(x)
else:
return self.__format(x, type='x') | python | def xformatter(self, x, pos):
" x-axis formatter "
if self.use_dates:
return self.__date_format(x)
else:
return self.__format(x, type='x') | [
"def",
"xformatter",
"(",
"self",
",",
"x",
",",
"pos",
")",
":",
"if",
"self",
".",
"use_dates",
":",
"return",
"self",
".",
"__date_format",
"(",
"x",
")",
"else",
":",
"return",
"self",
".",
"__format",
"(",
"x",
",",
"type",
"=",
"'x'",
")"
] | x-axis formatter | [
"x",
"-",
"axis",
"formatter"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/basepanel.py#L337-L342 |
44,249 | newville/wxmplot | wxmplot/basepanel.py | BasePanel.__onKeyEvent | def __onKeyEvent(self, event=None):
""" handles key events on canvas
"""
if event is None:
return
key = event.guiEvent.GetKeyCode()
if (key < wx.WXK_SPACE or key > 255):
return
ckey = chr(key)
mod = event.guiEvent.ControlDown()
if... | python | def __onKeyEvent(self, event=None):
""" handles key events on canvas
"""
if event is None:
return
key = event.guiEvent.GetKeyCode()
if (key < wx.WXK_SPACE or key > 255):
return
ckey = chr(key)
mod = event.guiEvent.ControlDown()
if... | [
"def",
"__onKeyEvent",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"event",
"is",
"None",
":",
"return",
"key",
"=",
"event",
".",
"guiEvent",
".",
"GetKeyCode",
"(",
")",
"if",
"(",
"key",
"<",
"wx",
".",
"WXK_SPACE",
"or",
"key",
">",... | handles key events on canvas | [
"handles",
"key",
"events",
"on",
"canvas"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/basepanel.py#L406-L428 |
44,250 | newville/wxmplot | wxmplot/basepanel.py | BasePanel.zoom_motion | def zoom_motion(self, event=None):
"""motion event handler for zoom mode"""
try:
x, y = event.x, event.y
except:
return
self.report_motion(event=event)
if self.zoom_ini is None:
return
ini_x, ini_y, ini_xd, ini_yd = self.zoom_ini
... | python | def zoom_motion(self, event=None):
"""motion event handler for zoom mode"""
try:
x, y = event.x, event.y
except:
return
self.report_motion(event=event)
if self.zoom_ini is None:
return
ini_x, ini_y, ini_xd, ini_yd = self.zoom_ini
... | [
"def",
"zoom_motion",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"try",
":",
"x",
",",
"y",
"=",
"event",
".",
"x",
",",
"event",
".",
"y",
"except",
":",
"return",
"self",
".",
"report_motion",
"(",
"event",
"=",
"event",
")",
"if",
"self... | motion event handler for zoom mode | [
"motion",
"event",
"handler",
"for",
"zoom",
"mode"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/basepanel.py#L458-L492 |
44,251 | newville/wxmplot | wxmplot/basepanel.py | BasePanel.zoom_leftdown | def zoom_leftdown(self, event=None):
"""leftdown event handler for zoom mode"""
self.x_lastmove, self.y_lastmove = None, None
self.zoom_ini = (event.x, event.y, event.xdata, event.ydata)
self.report_leftdown(event=event) | python | def zoom_leftdown(self, event=None):
"""leftdown event handler for zoom mode"""
self.x_lastmove, self.y_lastmove = None, None
self.zoom_ini = (event.x, event.y, event.xdata, event.ydata)
self.report_leftdown(event=event) | [
"def",
"zoom_leftdown",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"self",
".",
"x_lastmove",
",",
"self",
".",
"y_lastmove",
"=",
"None",
",",
"None",
"self",
".",
"zoom_ini",
"=",
"(",
"event",
".",
"x",
",",
"event",
".",
"y",
",",
"event... | leftdown event handler for zoom mode | [
"leftdown",
"event",
"handler",
"for",
"zoom",
"mode"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/basepanel.py#L494-L498 |
44,252 | newville/wxmplot | wxmplot/basepanel.py | BasePanel.lasso_leftdown | def lasso_leftdown(self, event=None):
"""leftdown event handler for lasso mode"""
try:
self.report_leftdown(event=event)
except:
return
if event.inaxes:
# set lasso color
color='goldenrod'
cmap = getattr(self.conf, 'cmap', None... | python | def lasso_leftdown(self, event=None):
"""leftdown event handler for lasso mode"""
try:
self.report_leftdown(event=event)
except:
return
if event.inaxes:
# set lasso color
color='goldenrod'
cmap = getattr(self.conf, 'cmap', None... | [
"def",
"lasso_leftdown",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"try",
":",
"self",
".",
"report_leftdown",
"(",
"event",
"=",
"event",
")",
"except",
":",
"return",
"if",
"event",
".",
"inaxes",
":",
"# set lasso color",
"color",
"=",
"'golde... | leftdown event handler for lasso mode | [
"leftdown",
"event",
"handler",
"for",
"lasso",
"mode"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/basepanel.py#L549-L570 |
44,253 | JensAstrup/pyOutlook | pyOutlook/core/folder.py | Folder.rename | def rename(self, new_folder_name):
"""Renames the Folder to the provided name.
Args:
new_folder_name: A string of the replacement name.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token.
Returns:
... | python | def rename(self, new_folder_name):
"""Renames the Folder to the provided name.
Args:
new_folder_name: A string of the replacement name.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token.
Returns:
... | [
"def",
"rename",
"(",
"self",
",",
"new_folder_name",
")",
":",
"headers",
"=",
"self",
".",
"headers",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/MailFolders/'",
"+",
"self",
".",
"id",
"payload",
"=",
"'{ \"DisplayName\": \"'",
"+",
"new_folder_name",... | Renames the Folder to the provided name.
Args:
new_folder_name: A string of the replacement name.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token.
Returns:
A new Folder representing the folder with ... | [
"Renames",
"the",
"Folder",
"to",
"the",
"provided",
"name",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/folder.py#L50-L71 |
44,254 | JensAstrup/pyOutlook | pyOutlook/core/folder.py | Folder.get_subfolders | def get_subfolders(self):
"""Retrieve all child Folders inside of this Folder.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token.
Returns:
List[:class:`Folder <pyOutlook.core.folder.Folder>`]
"""
h... | python | def get_subfolders(self):
"""Retrieve all child Folders inside of this Folder.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token.
Returns:
List[:class:`Folder <pyOutlook.core.folder.Folder>`]
"""
h... | [
"def",
"get_subfolders",
"(",
"self",
")",
":",
"headers",
"=",
"self",
".",
"headers",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/MailFolders/'",
"+",
"self",
".",
"id",
"+",
"'/childfolders'",
"r",
"=",
"requests",
".",
"get",
"(",
"endpoint",
"... | Retrieve all child Folders inside of this Folder.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token.
Returns:
List[:class:`Folder <pyOutlook.core.folder.Folder>`] | [
"Retrieve",
"all",
"child",
"Folders",
"inside",
"of",
"this",
"Folder",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/folder.py#L73-L88 |
44,255 | JensAstrup/pyOutlook | pyOutlook/core/folder.py | Folder.delete | def delete(self):
"""Deletes this Folder.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token.
"""
headers = self.headers
endpoint = 'https://outlook.office.com/api/v2.0/me/MailFolders/' + self.id
r = r... | python | def delete(self):
"""Deletes this Folder.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token.
"""
headers = self.headers
endpoint = 'https://outlook.office.com/api/v2.0/me/MailFolders/' + self.id
r = r... | [
"def",
"delete",
"(",
"self",
")",
":",
"headers",
"=",
"self",
".",
"headers",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/MailFolders/'",
"+",
"self",
".",
"id",
"r",
"=",
"requests",
".",
"delete",
"(",
"endpoint",
",",
"headers",
"=",
"header... | Deletes this Folder.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token. | [
"Deletes",
"this",
"Folder",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/folder.py#L90-L102 |
44,256 | JensAstrup/pyOutlook | pyOutlook/core/folder.py | Folder.move_into | def move_into(self, destination_folder):
# type: (Folder) -> None
"""Move the Folder into a different folder.
This makes the Folder provided a child folder of the destination_folder.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expir... | python | def move_into(self, destination_folder):
# type: (Folder) -> None
"""Move the Folder into a different folder.
This makes the Folder provided a child folder of the destination_folder.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expir... | [
"def",
"move_into",
"(",
"self",
",",
"destination_folder",
")",
":",
"# type: (Folder) -> None",
"headers",
"=",
"self",
".",
"headers",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/MailFolders/'",
"+",
"self",
".",
"id",
"+",
"'/move'",
"payload",
"=",
... | Move the Folder into a different folder.
This makes the Folder provided a child folder of the destination_folder.
Raises:
AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token.
Args:
destination_folder: A :class:`Folder <pyO... | [
"Move",
"the",
"Folder",
"into",
"a",
"different",
"folder",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/folder.py#L104-L129 |
44,257 | JensAstrup/pyOutlook | pyOutlook/core/folder.py | Folder.create_child_folder | def create_child_folder(self, folder_name):
"""Creates a child folder within the Folder it is called from and returns the new Folder object.
Args:
folder_name: The name of the folder to create
Returns: :class:`Folder <pyOutlook.core.folder.Folder>`
"""
headers = sel... | python | def create_child_folder(self, folder_name):
"""Creates a child folder within the Folder it is called from and returns the new Folder object.
Args:
folder_name: The name of the folder to create
Returns: :class:`Folder <pyOutlook.core.folder.Folder>`
"""
headers = sel... | [
"def",
"create_child_folder",
"(",
"self",
",",
"folder_name",
")",
":",
"headers",
"=",
"self",
".",
"headers",
"endpoint",
"=",
"'https://outlook.office.com/api/v2.0/me/MailFolders/'",
"+",
"self",
".",
"id",
"+",
"'/childfolders'",
"payload",
"=",
"'{ \"DisplayName... | Creates a child folder within the Folder it is called from and returns the new Folder object.
Args:
folder_name: The name of the folder to create
Returns: :class:`Folder <pyOutlook.core.folder.Folder>` | [
"Creates",
"a",
"child",
"folder",
"within",
"the",
"Folder",
"it",
"is",
"called",
"from",
"and",
"returns",
"the",
"new",
"Folder",
"object",
"."
] | f4ca9d4a8629c0a41f78102ce84fab702a841167 | https://github.com/JensAstrup/pyOutlook/blob/f4ca9d4a8629c0a41f78102ce84fab702a841167/pyOutlook/core/folder.py#L155-L171 |
44,258 | newville/wxmplot | wxmplot/utils.py | gformat | def gformat(val, length=11):
"""Format a number with '%g'-like format, except that
a) the length of the output string will be the requested length.
b) positive numbers will have a leading blank.
b) the precision will be as high as possible.
c) trailing zeros will not be trimmed.
... | python | def gformat(val, length=11):
"""Format a number with '%g'-like format, except that
a) the length of the output string will be the requested length.
b) positive numbers will have a leading blank.
b) the precision will be as high as possible.
c) trailing zeros will not be trimmed.
... | [
"def",
"gformat",
"(",
"val",
",",
"length",
"=",
"11",
")",
":",
"try",
":",
"expon",
"=",
"int",
"(",
"log10",
"(",
"abs",
"(",
"val",
")",
")",
")",
"except",
"(",
"OverflowError",
",",
"ValueError",
")",
":",
"expon",
"=",
"0",
"length",
"=",... | Format a number with '%g'-like format, except that
a) the length of the output string will be the requested length.
b) positive numbers will have a leading blank.
b) the precision will be as high as possible.
c) trailing zeros will not be trimmed.
The precision will typically be le... | [
"Format",
"a",
"number",
"with",
"%g",
"-",
"like",
"format",
"except",
"that"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/utils.py#L26-L66 |
44,259 | newville/wxmplot | wxmplot/utils.py | pack | def pack(window, sizer, expand=1.1):
"simple wxPython pack function"
tsize = window.GetSize()
msize = window.GetMinSize()
window.SetSizer(sizer)
sizer.Fit(window)
nsize = (10*int(expand*(max(msize[0], tsize[0])/10)),
10*int(expand*(max(msize[1], tsize[1])/10.)))
window.SetSize... | python | def pack(window, sizer, expand=1.1):
"simple wxPython pack function"
tsize = window.GetSize()
msize = window.GetMinSize()
window.SetSizer(sizer)
sizer.Fit(window)
nsize = (10*int(expand*(max(msize[0], tsize[0])/10)),
10*int(expand*(max(msize[1], tsize[1])/10.)))
window.SetSize... | [
"def",
"pack",
"(",
"window",
",",
"sizer",
",",
"expand",
"=",
"1.1",
")",
":",
"tsize",
"=",
"window",
".",
"GetSize",
"(",
")",
"msize",
"=",
"window",
".",
"GetMinSize",
"(",
")",
"window",
".",
"SetSizer",
"(",
"sizer",
")",
"sizer",
".",
"Fit... | simple wxPython pack function | [
"simple",
"wxPython",
"pack",
"function"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/utils.py#L68-L76 |
44,260 | newville/wxmplot | wxmplot/utils.py | Printer.Setup | def Setup(self, event=None):
"""set up figure for printing. Using the standard wx Printer
Setup Dialog. """
if hasattr(self, 'printerData'):
data = wx.PageSetupDialogData()
data.SetPrintData(self.printerData)
else:
data = wx.PageSetupDialogData()
... | python | def Setup(self, event=None):
"""set up figure for printing. Using the standard wx Printer
Setup Dialog. """
if hasattr(self, 'printerData'):
data = wx.PageSetupDialogData()
data.SetPrintData(self.printerData)
else:
data = wx.PageSetupDialogData()
... | [
"def",
"Setup",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'printerData'",
")",
":",
"data",
"=",
"wx",
".",
"PageSetupDialogData",
"(",
")",
"data",
".",
"SetPrintData",
"(",
"self",
".",
"printerData",
")",
... | set up figure for printing. Using the standard wx Printer
Setup Dialog. | [
"set",
"up",
"figure",
"for",
"printing",
".",
"Using",
"the",
"standard",
"wx",
"Printer",
"Setup",
"Dialog",
"."
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/utils.py#L250-L269 |
44,261 | newville/wxmplot | wxmplot/utils.py | Printer.Preview | def Preview(self, title=None, event=None):
""" generate Print Preview with wx Print mechanism"""
if title is None:
title = self.title
if self.canvas is None:
self.canvas = self.parent.canvas
po1 = PrintoutWx(self.parent.canvas, title=title,
... | python | def Preview(self, title=None, event=None):
""" generate Print Preview with wx Print mechanism"""
if title is None:
title = self.title
if self.canvas is None:
self.canvas = self.parent.canvas
po1 = PrintoutWx(self.parent.canvas, title=title,
... | [
"def",
"Preview",
"(",
"self",
",",
"title",
"=",
"None",
",",
"event",
"=",
"None",
")",
":",
"if",
"title",
"is",
"None",
":",
"title",
"=",
"self",
".",
"title",
"if",
"self",
".",
"canvas",
"is",
"None",
":",
"self",
".",
"canvas",
"=",
"self... | generate Print Preview with wx Print mechanism | [
"generate",
"Print",
"Preview",
"with",
"wx",
"Print",
"mechanism"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/utils.py#L271-L294 |
44,262 | newville/wxmplot | examples/floatcontrol.py | set_float | def set_float(val):
""" utility to set a floating value,
useful for converting from strings """
out = None
if not val in (None, ''):
try:
out = float(val)
except ValueError:
return None
if numpy.isnan(out):
out = default
return out | python | def set_float(val):
""" utility to set a floating value,
useful for converting from strings """
out = None
if not val in (None, ''):
try:
out = float(val)
except ValueError:
return None
if numpy.isnan(out):
out = default
return out | [
"def",
"set_float",
"(",
"val",
")",
":",
"out",
"=",
"None",
"if",
"not",
"val",
"in",
"(",
"None",
",",
"''",
")",
":",
"try",
":",
"out",
"=",
"float",
"(",
"val",
")",
"except",
"ValueError",
":",
"return",
"None",
"if",
"numpy",
".",
"isnan"... | utility to set a floating value,
useful for converting from strings | [
"utility",
"to",
"set",
"a",
"floating",
"value",
"useful",
"for",
"converting",
"from",
"strings"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/examples/floatcontrol.py#L14-L25 |
44,263 | newville/wxmplot | examples/floatcontrol.py | FloatCtrl.SetAction | def SetAction(self, action, **kws):
"set callback action"
if hasattr(action,'__call__'):
self.__action = Closure(action, **kws) | python | def SetAction(self, action, **kws):
"set callback action"
if hasattr(action,'__call__'):
self.__action = Closure(action, **kws) | [
"def",
"SetAction",
"(",
"self",
",",
"action",
",",
"*",
"*",
"kws",
")",
":",
"if",
"hasattr",
"(",
"action",
",",
"'__call__'",
")",
":",
"self",
".",
"__action",
"=",
"Closure",
"(",
"action",
",",
"*",
"*",
"kws",
")"
] | set callback action | [
"set",
"callback",
"action"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/examples/floatcontrol.py#L111-L114 |
44,264 | newville/wxmplot | examples/floatcontrol.py | FloatCtrl.__GetMark | def __GetMark(self):
" keep track of cursor position within text"
try:
self.__mark = min(wx.TextCtrl.GetSelection(self)[0],
len(wx.TextCtrl.GetValue(self).strip()))
except:
self.__mark = 0 | python | def __GetMark(self):
" keep track of cursor position within text"
try:
self.__mark = min(wx.TextCtrl.GetSelection(self)[0],
len(wx.TextCtrl.GetValue(self).strip()))
except:
self.__mark = 0 | [
"def",
"__GetMark",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"__mark",
"=",
"min",
"(",
"wx",
".",
"TextCtrl",
".",
"GetSelection",
"(",
"self",
")",
"[",
"0",
"]",
",",
"len",
"(",
"wx",
".",
"TextCtrl",
".",
"GetValue",
"(",
"self",
")",... | keep track of cursor position within text | [
"keep",
"track",
"of",
"cursor",
"position",
"within",
"text"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/examples/floatcontrol.py#L121-L127 |
44,265 | newville/wxmplot | examples/floatcontrol.py | FloatCtrl.__SetMark | def __SetMark(self, mark=None):
"set mark for later"
if mark is None:
mark = self.__mark
self.SetSelection(mark, mark) | python | def __SetMark(self, mark=None):
"set mark for later"
if mark is None:
mark = self.__mark
self.SetSelection(mark, mark) | [
"def",
"__SetMark",
"(",
"self",
",",
"mark",
"=",
"None",
")",
":",
"if",
"mark",
"is",
"None",
":",
"mark",
"=",
"self",
".",
"__mark",
"self",
".",
"SetSelection",
"(",
"mark",
",",
"mark",
")"
] | set mark for later | [
"set",
"mark",
"for",
"later"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/examples/floatcontrol.py#L129-L133 |
44,266 | newville/wxmplot | examples/floatcontrol.py | FloatCtrl.SetValue | def SetValue(self, value=None, act=True):
" main method to set value "
if value is None:
value = wx.TextCtrl.GetValue(self).strip()
self.__CheckValid(value)
self.__GetMark()
if value is not None:
wx.TextCtrl.SetValue(self, self.format % set_float(value))
... | python | def SetValue(self, value=None, act=True):
" main method to set value "
if value is None:
value = wx.TextCtrl.GetValue(self).strip()
self.__CheckValid(value)
self.__GetMark()
if value is not None:
wx.TextCtrl.SetValue(self, self.format % set_float(value))
... | [
"def",
"SetValue",
"(",
"self",
",",
"value",
"=",
"None",
",",
"act",
"=",
"True",
")",
":",
"if",
"value",
"is",
"None",
":",
"value",
"=",
"wx",
".",
"TextCtrl",
".",
"GetValue",
"(",
"self",
")",
".",
"strip",
"(",
")",
"self",
".",
"__CheckV... | main method to set value | [
"main",
"method",
"to",
"set",
"value"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/examples/floatcontrol.py#L135-L149 |
44,267 | newville/wxmplot | examples/floatcontrol.py | FloatCtrl.OnChar | def OnChar(self, event):
""" on Character event"""
key = event.GetKeyCode()
entry = wx.TextCtrl.GetValue(self).strip()
pos = wx.TextCtrl.GetSelection(self)
# really, the order here is important:
# 1. return sends to ValidateEntry
if key == wx.WXK_RETURN:
... | python | def OnChar(self, event):
""" on Character event"""
key = event.GetKeyCode()
entry = wx.TextCtrl.GetValue(self).strip()
pos = wx.TextCtrl.GetSelection(self)
# really, the order here is important:
# 1. return sends to ValidateEntry
if key == wx.WXK_RETURN:
... | [
"def",
"OnChar",
"(",
"self",
",",
"event",
")",
":",
"key",
"=",
"event",
".",
"GetKeyCode",
"(",
")",
"entry",
"=",
"wx",
".",
"TextCtrl",
".",
"GetValue",
"(",
"self",
")",
".",
"strip",
"(",
")",
"pos",
"=",
"wx",
".",
"TextCtrl",
".",
"GetSe... | on Character event | [
"on",
"Character",
"event"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/examples/floatcontrol.py#L161-L191 |
44,268 | newville/wxmplot | examples/floatcontrol.py | FloatCtrl.__CheckValid | def __CheckValid(self, value):
"check for validity of value"
val = self.__val
self.is_valid = True
try:
val = set_float(value)
if self.__min is not None and (val < self.__min):
self.is_valid = False
val = self.__min
if s... | python | def __CheckValid(self, value):
"check for validity of value"
val = self.__val
self.is_valid = True
try:
val = set_float(value)
if self.__min is not None and (val < self.__min):
self.is_valid = False
val = self.__min
if s... | [
"def",
"__CheckValid",
"(",
"self",
",",
"value",
")",
":",
"val",
"=",
"self",
".",
"__val",
"self",
".",
"is_valid",
"=",
"True",
"try",
":",
"val",
"=",
"set_float",
"(",
"value",
")",
"if",
"self",
".",
"__min",
"is",
"not",
"None",
"and",
"(",... | check for validity of value | [
"check",
"for",
"validity",
"of",
"value"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/examples/floatcontrol.py#L226-L247 |
44,269 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel.add_text | def add_text(self, text, x, y, side='left', size=None,
rotation=None, ha='left', va='center',
family=None, **kws):
"""add text at supplied x, y position"""
axes = self.axes
if side == 'right':
axes = self.get_right_axes()
dynamic_size = False... | python | def add_text(self, text, x, y, side='left', size=None,
rotation=None, ha='left', va='center',
family=None, **kws):
"""add text at supplied x, y position"""
axes = self.axes
if side == 'right':
axes = self.get_right_axes()
dynamic_size = False... | [
"def",
"add_text",
"(",
"self",
",",
"text",
",",
"x",
",",
"y",
",",
"side",
"=",
"'left'",
",",
"size",
"=",
"None",
",",
"rotation",
"=",
"None",
",",
"ha",
"=",
"'left'",
",",
"va",
"=",
"'center'",
",",
"family",
"=",
"None",
",",
"*",
"*"... | add text at supplied x, y position | [
"add",
"text",
"at",
"supplied",
"x",
"y",
"position"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L323-L337 |
44,270 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel.add_arrow | def add_arrow(self, x1, y1, x2, y2, side='left',
shape='full', color='black',
width=0.01, head_width=0.03, overhang=0, **kws):
"""add arrow supplied x, y position"""
dx, dy = x2-x1, y2-y1
axes = self.axes
if side == 'right':
axes = self.g... | python | def add_arrow(self, x1, y1, x2, y2, side='left',
shape='full', color='black',
width=0.01, head_width=0.03, overhang=0, **kws):
"""add arrow supplied x, y position"""
dx, dy = x2-x1, y2-y1
axes = self.axes
if side == 'right':
axes = self.g... | [
"def",
"add_arrow",
"(",
"self",
",",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
",",
"side",
"=",
"'left'",
",",
"shape",
"=",
"'full'",
",",
"color",
"=",
"'black'",
",",
"width",
"=",
"0.01",
",",
"head_width",
"=",
"0.03",
",",
"overhang",
"=",
"... | add arrow supplied x, y position | [
"add",
"arrow",
"supplied",
"x",
"y",
"position"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L339-L353 |
44,271 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel.set_xylims | def set_xylims(self, limits, axes=None, side='left'):
"set user-defined limits and apply them"
if axes is None:
axes = self.axes
if side == 'right':
axes = self.get_right_axes()
self.conf.user_limits[axes] = limits
self.unzoom_all() | python | def set_xylims(self, limits, axes=None, side='left'):
"set user-defined limits and apply them"
if axes is None:
axes = self.axes
if side == 'right':
axes = self.get_right_axes()
self.conf.user_limits[axes] = limits
self.unzoom_all() | [
"def",
"set_xylims",
"(",
"self",
",",
"limits",
",",
"axes",
"=",
"None",
",",
"side",
"=",
"'left'",
")",
":",
"if",
"axes",
"is",
"None",
":",
"axes",
"=",
"self",
".",
"axes",
"if",
"side",
"==",
"'right'",
":",
"axes",
"=",
"self",
".",
"get... | set user-defined limits and apply them | [
"set",
"user",
"-",
"defined",
"limits",
"and",
"apply",
"them"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L459-L466 |
44,272 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel.toggle_deriv | def toggle_deriv(self, evt=None, value=None):
"toggle derivative of data"
if value is None:
self.conf.data_deriv = not self.conf.data_deriv
expr = self.conf.data_expr or ''
if self.conf.data_deriv:
expr = "deriv(%s)" % expr
self.write_mess... | python | def toggle_deriv(self, evt=None, value=None):
"toggle derivative of data"
if value is None:
self.conf.data_deriv = not self.conf.data_deriv
expr = self.conf.data_expr or ''
if self.conf.data_deriv:
expr = "deriv(%s)" % expr
self.write_mess... | [
"def",
"toggle_deriv",
"(",
"self",
",",
"evt",
"=",
"None",
",",
"value",
"=",
"None",
")",
":",
"if",
"value",
"is",
"None",
":",
"self",
".",
"conf",
".",
"data_deriv",
"=",
"not",
"self",
".",
"conf",
".",
"data_deriv",
"expr",
"=",
"self",
"."... | toggle derivative of data | [
"toggle",
"derivative",
"of",
"data"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L517-L527 |
44,273 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel.toggle_legend | def toggle_legend(self, evt=None, show=None):
"toggle legend display"
if show is None:
show = not self.conf.show_legend
self.conf.show_legend = show
self.conf.draw_legend() | python | def toggle_legend(self, evt=None, show=None):
"toggle legend display"
if show is None:
show = not self.conf.show_legend
self.conf.show_legend = show
self.conf.draw_legend() | [
"def",
"toggle_legend",
"(",
"self",
",",
"evt",
"=",
"None",
",",
"show",
"=",
"None",
")",
":",
"if",
"show",
"is",
"None",
":",
"show",
"=",
"not",
"self",
".",
"conf",
".",
"show_legend",
"self",
".",
"conf",
".",
"show_legend",
"=",
"show",
"s... | toggle legend display | [
"toggle",
"legend",
"display"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L535-L540 |
44,274 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel.toggle_grid | def toggle_grid(self, evt=None, show=None):
"toggle grid display"
if show is None:
show = not self.conf.show_grid
self.conf.enable_grid(show) | python | def toggle_grid(self, evt=None, show=None):
"toggle grid display"
if show is None:
show = not self.conf.show_grid
self.conf.enable_grid(show) | [
"def",
"toggle_grid",
"(",
"self",
",",
"evt",
"=",
"None",
",",
"show",
"=",
"None",
")",
":",
"if",
"show",
"is",
"None",
":",
"show",
"=",
"not",
"self",
".",
"conf",
".",
"show_grid",
"self",
".",
"conf",
".",
"enable_grid",
"(",
"show",
")"
] | toggle grid display | [
"toggle",
"grid",
"display"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L542-L546 |
44,275 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel.configure | def configure(self, event=None):
"""show configuration frame"""
if self.win_config is not None:
try:
self.win_config.Raise()
except:
self.win_config = None
if self.win_config is None:
self.win_config = PlotConfigFrame(parent=se... | python | def configure(self, event=None):
"""show configuration frame"""
if self.win_config is not None:
try:
self.win_config.Raise()
except:
self.win_config = None
if self.win_config is None:
self.win_config = PlotConfigFrame(parent=se... | [
"def",
"configure",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"self",
".",
"win_config",
"is",
"not",
"None",
":",
"try",
":",
"self",
".",
"win_config",
".",
"Raise",
"(",
")",
"except",
":",
"self",
".",
"win_config",
"=",
"None",
"... | show configuration frame | [
"show",
"configuration",
"frame"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L548-L560 |
44,276 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel._updateCanvasDraw | def _updateCanvasDraw(self):
""" Overload of the draw function that update
axes position before each draw"""
fn = self.canvas.draw
def draw2(*a,**k):
self._updateGridSpec()
return fn(*a,**k)
self.canvas.draw = draw2 | python | def _updateCanvasDraw(self):
""" Overload of the draw function that update
axes position before each draw"""
fn = self.canvas.draw
def draw2(*a,**k):
self._updateGridSpec()
return fn(*a,**k)
self.canvas.draw = draw2 | [
"def",
"_updateCanvasDraw",
"(",
"self",
")",
":",
"fn",
"=",
"self",
".",
"canvas",
".",
"draw",
"def",
"draw2",
"(",
"*",
"a",
",",
"*",
"*",
"k",
")",
":",
"self",
".",
"_updateGridSpec",
"(",
")",
"return",
"fn",
"(",
"*",
"a",
",",
"*",
"*... | Overload of the draw function that update
axes position before each draw | [
"Overload",
"of",
"the",
"draw",
"function",
"that",
"update",
"axes",
"position",
"before",
"each",
"draw"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L603-L610 |
44,277 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel.get_default_margins | def get_default_margins(self):
"""get default margins"""
trans = self.fig.transFigure.inverted().transform
# Static margins
l, t, r, b = self.axesmargins
(l, b), (r, t) = trans(((l, b), (r, t)))
# Extent
dl, dt, dr, db = 0, 0, 0, 0
for i, ax in enumerate... | python | def get_default_margins(self):
"""get default margins"""
trans = self.fig.transFigure.inverted().transform
# Static margins
l, t, r, b = self.axesmargins
(l, b), (r, t) = trans(((l, b), (r, t)))
# Extent
dl, dt, dr, db = 0, 0, 0, 0
for i, ax in enumerate... | [
"def",
"get_default_margins",
"(",
"self",
")",
":",
"trans",
"=",
"self",
".",
"fig",
".",
"transFigure",
".",
"inverted",
"(",
")",
".",
"transform",
"# Static margins",
"l",
",",
"t",
",",
"r",
",",
"b",
"=",
"self",
".",
"axesmargins",
"(",
"l",
... | get default margins | [
"get",
"default",
"margins"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L612-L634 |
44,278 | newville/wxmplot | wxmplot/plotpanel.py | PlotPanel.update_line | def update_line(self, trace, xdata, ydata, side='left', draw=False,
update_limits=True):
""" update a single trace, for faster redraw """
x = self.conf.get_mpl_line(trace)
x.set_data(xdata, ydata)
datarange = [xdata.min(), xdata.max(), ydata.min(), ydata.max()]
... | python | def update_line(self, trace, xdata, ydata, side='left', draw=False,
update_limits=True):
""" update a single trace, for faster redraw """
x = self.conf.get_mpl_line(trace)
x.set_data(xdata, ydata)
datarange = [xdata.min(), xdata.max(), ydata.min(), ydata.max()]
... | [
"def",
"update_line",
"(",
"self",
",",
"trace",
",",
"xdata",
",",
"ydata",
",",
"side",
"=",
"'left'",
",",
"draw",
"=",
"False",
",",
"update_limits",
"=",
"True",
")",
":",
"x",
"=",
"self",
".",
"conf",
".",
"get_mpl_line",
"(",
"trace",
")",
... | update a single trace, for faster redraw | [
"update",
"a",
"single",
"trace",
"for",
"faster",
"redraw"
] | 8e0dc037453e5cdf18c968dc5a3d29efd761edee | https://github.com/newville/wxmplot/blob/8e0dc037453e5cdf18c968dc5a3d29efd761edee/wxmplot/plotpanel.py#L662-L677 |
44,279 | symphonyoss/python-symphony | symphony/Pod/users.py | Users.get_userid_by_email | def get_userid_by_email(self, email):
''' get userid by email '''
response, status_code = self.__pod__.Users.get_v2_user(
sessionToken=self.__session__,
email=email
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_code, respon... | python | def get_userid_by_email(self, email):
''' get userid by email '''
response, status_code = self.__pod__.Users.get_v2_user(
sessionToken=self.__session__,
email=email
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_code, respon... | [
"def",
"get_userid_by_email",
"(",
"self",
",",
"email",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"Users",
".",
"get_v2_user",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
",",
"email",
"=",
"email",
")",
".",
... | get userid by email | [
"get",
"userid",
"by",
"email"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/users.py#L19-L26 |
44,280 | symphonyoss/python-symphony | symphony/Pod/users.py | Users.get_user_id_by_user | def get_user_id_by_user(self, username):
''' get user id by username '''
response, status_code = self.__pod__.Users.get_v2_user(
sessionToken=self.__session__,
username=username
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status... | python | def get_user_id_by_user(self, username):
''' get user id by username '''
response, status_code = self.__pod__.Users.get_v2_user(
sessionToken=self.__session__,
username=username
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status... | [
"def",
"get_user_id_by_user",
"(",
"self",
",",
"username",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"Users",
".",
"get_v2_user",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
",",
"username",
"=",
"username",
")",
... | get user id by username | [
"get",
"user",
"id",
"by",
"username"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/users.py#L28-L35 |
44,281 | symphonyoss/python-symphony | symphony/Pod/users.py | Users.get_user_by_userid | def get_user_by_userid(self, userid):
''' get user by user id '''
response, status_code = self.__pod__.Users.get_v2_user(
sessionToken=self.__session__,
uid=userid
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_code, respons... | python | def get_user_by_userid(self, userid):
''' get user by user id '''
response, status_code = self.__pod__.Users.get_v2_user(
sessionToken=self.__session__,
uid=userid
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_code, respons... | [
"def",
"get_user_by_userid",
"(",
"self",
",",
"userid",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"Users",
".",
"get_v2_user",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
",",
"uid",
"=",
"userid",
")",
".",
"... | get user by user id | [
"get",
"user",
"by",
"user",
"id"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/users.py#L37-L44 |
44,282 | symphonyoss/python-symphony | symphony/Pod/users.py | Users.get_user_presence | def get_user_presence(self, userid):
''' check on presence of a user '''
response, status_code = self.__pod__.Presence.get_v2_user_uid_presence(
sessionToken=self.__session__,
uid=userid
).result()
self.logger.debug('%s: %s' % (status_code, response))
retu... | python | def get_user_presence(self, userid):
''' check on presence of a user '''
response, status_code = self.__pod__.Presence.get_v2_user_uid_presence(
sessionToken=self.__session__,
uid=userid
).result()
self.logger.debug('%s: %s' % (status_code, response))
retu... | [
"def",
"get_user_presence",
"(",
"self",
",",
"userid",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"Presence",
".",
"get_v2_user_uid_presence",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
",",
"uid",
"=",
"userid",
... | check on presence of a user | [
"check",
"on",
"presence",
"of",
"a",
"user"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/users.py#L46-L53 |
44,283 | symphonyoss/python-symphony | symphony/Pod/users.py | Users.set_user_presence | def set_user_presence(self, userid, presence):
''' set presence of user '''
response, status_code = self.__pod__.Presence.post_v2_user_uid_presence(
sessionToken=self.__session__,
uid=userid,
presence=presence
).result()
self.logger.debug('%s: %s' % (s... | python | def set_user_presence(self, userid, presence):
''' set presence of user '''
response, status_code = self.__pod__.Presence.post_v2_user_uid_presence(
sessionToken=self.__session__,
uid=userid,
presence=presence
).result()
self.logger.debug('%s: %s' % (s... | [
"def",
"set_user_presence",
"(",
"self",
",",
"userid",
",",
"presence",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"Presence",
".",
"post_v2_user_uid_presence",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
",",
"uid",... | set presence of user | [
"set",
"presence",
"of",
"user"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/users.py#L55-L63 |
44,284 | symphonyoss/python-symphony | symphony/Pod/admin.py | Admin.list_features | def list_features(self):
''' list features the pod supports '''
response, status_code = self.__pod__.System.get_v1_admin_system_features_list(
sessionToken=self.__session__
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_code, response | python | def list_features(self):
''' list features the pod supports '''
response, status_code = self.__pod__.System.get_v1_admin_system_features_list(
sessionToken=self.__session__
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_code, response | [
"def",
"list_features",
"(",
"self",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"System",
".",
"get_v1_admin_system_features_list",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
")",
".",
"result",
"(",
")",
"self",
"... | list features the pod supports | [
"list",
"features",
"the",
"pod",
"supports"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/admin.py#L19-L25 |
44,285 | symphonyoss/python-symphony | symphony/Pod/admin.py | Admin.user_feature_update | def user_feature_update(self, userid, payload):
''' update features by user id '''
response, status_code = self.__pod__.User.post_v1_admin_user_uid_features_update(
sessionToken=self.__session__,
uid=userid,
payload=payload
).result()
self.logger.debug... | python | def user_feature_update(self, userid, payload):
''' update features by user id '''
response, status_code = self.__pod__.User.post_v1_admin_user_uid_features_update(
sessionToken=self.__session__,
uid=userid,
payload=payload
).result()
self.logger.debug... | [
"def",
"user_feature_update",
"(",
"self",
",",
"userid",
",",
"payload",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"User",
".",
"post_v1_admin_user_uid_features_update",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
","... | update features by user id | [
"update",
"features",
"by",
"user",
"id"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/admin.py#L27-L35 |
44,286 | symphonyoss/python-symphony | symphony/Pod/admin.py | Admin.get_user_avatar | def get_user_avatar(self, userid):
''' get avatar by user id '''
response, status_code = self.__pod__.User.get_v1_admin_user_uid_avatar(
sessionToken=self.__session,
uid=userid
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_... | python | def get_user_avatar(self, userid):
''' get avatar by user id '''
response, status_code = self.__pod__.User.get_v1_admin_user_uid_avatar(
sessionToken=self.__session,
uid=userid
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_... | [
"def",
"get_user_avatar",
"(",
"self",
",",
"userid",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"User",
".",
"get_v1_admin_user_uid_avatar",
"(",
"sessionToken",
"=",
"self",
".",
"__session",
",",
"uid",
"=",
"userid",
")",... | get avatar by user id | [
"get",
"avatar",
"by",
"user",
"id"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/admin.py#L37-L44 |
44,287 | symphonyoss/python-symphony | symphony/Pod/admin.py | Admin.user_avatar_update | def user_avatar_update(self, userid, payload):
''' updated avatar by userid '''
response, status_code = self.__pod__.User.post_v1_admin_user_uid_avatar_update(
sessionToken=self.__session,
uid=userid,
payload=payload
).result()
self.logger.debug('%s: %... | python | def user_avatar_update(self, userid, payload):
''' updated avatar by userid '''
response, status_code = self.__pod__.User.post_v1_admin_user_uid_avatar_update(
sessionToken=self.__session,
uid=userid,
payload=payload
).result()
self.logger.debug('%s: %... | [
"def",
"user_avatar_update",
"(",
"self",
",",
"userid",
",",
"payload",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"User",
".",
"post_v1_admin_user_uid_avatar_update",
"(",
"sessionToken",
"=",
"self",
".",
"__session",
",",
"... | updated avatar by userid | [
"updated",
"avatar",
"by",
"userid"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/admin.py#L46-L54 |
44,288 | symphonyoss/python-symphony | symphony/Pod/admin.py | Admin.stream_members | def stream_members(self, stream_id):
''' get stream members '''
response, status_code = self.__pod__.Streams.get_v1_admin_stream_id_membership_list(
sessionToken=self.__session__,
id=stream_id
).result()
self.logger.debug('%s: %s' % (status_code, response))
... | python | def stream_members(self, stream_id):
''' get stream members '''
response, status_code = self.__pod__.Streams.get_v1_admin_stream_id_membership_list(
sessionToken=self.__session__,
id=stream_id
).result()
self.logger.debug('%s: %s' % (status_code, response))
... | [
"def",
"stream_members",
"(",
"self",
",",
"stream_id",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"Streams",
".",
"get_v1_admin_stream_id_membership_list",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
",",
"id",
"=",
... | get stream members | [
"get",
"stream",
"members"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/admin.py#L64-L71 |
44,289 | symphonyoss/python-symphony | symphony/Pod/connections.py | Connections.connection_status | def connection_status(self, userid):
''' get connection status '''
response, status_code = self.__pod__.Connection.get_v1_connection_user_userId_info(
sessionToken=self.__session__,
userId=userid
).result()
self.logger.debug('%s: %s' % (status_code, response))
... | python | def connection_status(self, userid):
''' get connection status '''
response, status_code = self.__pod__.Connection.get_v1_connection_user_userId_info(
sessionToken=self.__session__,
userId=userid
).result()
self.logger.debug('%s: %s' % (status_code, response))
... | [
"def",
"connection_status",
"(",
"self",
",",
"userid",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"Connection",
".",
"get_v1_connection_user_userId_info",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
",",
"userId",
"=",... | get connection status | [
"get",
"connection",
"status"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/connections.py#L38-L45 |
44,290 | symphonyoss/python-symphony | symphony/Pod/groups.py | Groups.ib_group_member_list | def ib_group_member_list(self, group_id):
''' ib group member list '''
req_hook = 'pod/v1/admin/group/' + group_id + '/membership/list'
req_args = None
status_code, response = self.__rest__.GET_query(req_hook, req_args)
self.logger.debug('%s: %s' % (status_code, response))
... | python | def ib_group_member_list(self, group_id):
''' ib group member list '''
req_hook = 'pod/v1/admin/group/' + group_id + '/membership/list'
req_args = None
status_code, response = self.__rest__.GET_query(req_hook, req_args)
self.logger.debug('%s: %s' % (status_code, response))
... | [
"def",
"ib_group_member_list",
"(",
"self",
",",
"group_id",
")",
":",
"req_hook",
"=",
"'pod/v1/admin/group/'",
"+",
"group_id",
"+",
"'/membership/list'",
"req_args",
"=",
"None",
"status_code",
",",
"response",
"=",
"self",
".",
"__rest__",
".",
"GET_query",
... | ib group member list | [
"ib",
"group",
"member",
"list"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/groups.py#L29-L35 |
44,291 | symphonyoss/python-symphony | symphony/Pod/groups.py | Groups.ib_group_member_add | def ib_group_member_add(self, group_id, userids):
''' ib group member add '''
req_hook = 'pod/v1/admin/group/' + group_id + '/membership/add'
req_args = {'usersListId': userids}
req_args = json.dumps(req_args)
status_code, response = self.__rest__.POST_query(req_hook, req_args)
... | python | def ib_group_member_add(self, group_id, userids):
''' ib group member add '''
req_hook = 'pod/v1/admin/group/' + group_id + '/membership/add'
req_args = {'usersListId': userids}
req_args = json.dumps(req_args)
status_code, response = self.__rest__.POST_query(req_hook, req_args)
... | [
"def",
"ib_group_member_add",
"(",
"self",
",",
"group_id",
",",
"userids",
")",
":",
"req_hook",
"=",
"'pod/v1/admin/group/'",
"+",
"group_id",
"+",
"'/membership/add'",
"req_args",
"=",
"{",
"'usersListId'",
":",
"userids",
"}",
"req_args",
"=",
"json",
".",
... | ib group member add | [
"ib",
"group",
"member",
"add"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/groups.py#L37-L44 |
44,292 | symphonyoss/python-symphony | symphony/Pod/groups.py | Groups.ib_group_policy_list | def ib_group_policy_list(self):
''' ib group policy list '''
req_hook = 'pod/v1/admin/policy/list'
req_args = None
status_code, response = self.__rest__.GET_query(req_hook, req_args)
self.logger.debug('%s: %s' % (status_code, response))
return status_code, response | python | def ib_group_policy_list(self):
''' ib group policy list '''
req_hook = 'pod/v1/admin/policy/list'
req_args = None
status_code, response = self.__rest__.GET_query(req_hook, req_args)
self.logger.debug('%s: %s' % (status_code, response))
return status_code, response | [
"def",
"ib_group_policy_list",
"(",
"self",
")",
":",
"req_hook",
"=",
"'pod/v1/admin/policy/list'",
"req_args",
"=",
"None",
"status_code",
",",
"response",
"=",
"self",
".",
"__rest__",
".",
"GET_query",
"(",
"req_hook",
",",
"req_args",
")",
"self",
".",
"l... | ib group policy list | [
"ib",
"group",
"policy",
"list"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/groups.py#L46-L52 |
44,293 | it-geeks-club/pyspectator | pyspectator/monitoring.py | AbcMonitor.start_monitoring | def start_monitoring(self):
"""Enable periodically monitoring.
"""
if self.__monitoring is False:
self.__monitoring = True
self.__monitoring_action() | python | def start_monitoring(self):
"""Enable periodically monitoring.
"""
if self.__monitoring is False:
self.__monitoring = True
self.__monitoring_action() | [
"def",
"start_monitoring",
"(",
"self",
")",
":",
"if",
"self",
".",
"__monitoring",
"is",
"False",
":",
"self",
".",
"__monitoring",
"=",
"True",
"self",
".",
"__monitoring_action",
"(",
")"
] | Enable periodically monitoring. | [
"Enable",
"periodically",
"monitoring",
"."
] | 356a808b1b29575fd47a85a2611fe50f1afeea8a | https://github.com/it-geeks-club/pyspectator/blob/356a808b1b29575fd47a85a2611fe50f1afeea8a/pyspectator/monitoring.py#L31-L36 |
44,294 | symphonyoss/python-symphony | symphony/Mml/__init__.py | Mml.parse_MML | def parse_MML(self, mml):
''' parse the MML structure '''
hashes_c = []
mentions_c = []
soup = BeautifulSoup(mml, "lxml")
hashes = soup.find_all('hash', {"tag": True})
for hashe in hashes:
hashes_c.append(hashe['tag'])
mentions = soup.find_all('mention... | python | def parse_MML(self, mml):
''' parse the MML structure '''
hashes_c = []
mentions_c = []
soup = BeautifulSoup(mml, "lxml")
hashes = soup.find_all('hash', {"tag": True})
for hashe in hashes:
hashes_c.append(hashe['tag'])
mentions = soup.find_all('mention... | [
"def",
"parse_MML",
"(",
"self",
",",
"mml",
")",
":",
"hashes_c",
"=",
"[",
"]",
"mentions_c",
"=",
"[",
"]",
"soup",
"=",
"BeautifulSoup",
"(",
"mml",
",",
"\"lxml\"",
")",
"hashes",
"=",
"soup",
".",
"find_all",
"(",
"'hash'",
",",
"{",
"\"tag\"",... | parse the MML structure | [
"parse",
"the",
"MML",
"structure"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Mml/__init__.py#L23-L36 |
44,295 | symphonyoss/python-symphony | symphony/Pod/streams.py | Streams.create_room | def create_room(self, payload):
''' create a stream in a non-inclusive manner '''
response, status_code = self.__pod__.Streams.post_v2_room_create(
# V2RoomAttributes
payload=payload
).result()
self.logger.debug('%s: %s' % (status_code, response))
return s... | python | def create_room(self, payload):
''' create a stream in a non-inclusive manner '''
response, status_code = self.__pod__.Streams.post_v2_room_create(
# V2RoomAttributes
payload=payload
).result()
self.logger.debug('%s: %s' % (status_code, response))
return s... | [
"def",
"create_room",
"(",
"self",
",",
"payload",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"Streams",
".",
"post_v2_room_create",
"(",
"# V2RoomAttributes",
"payload",
"=",
"payload",
")",
".",
"result",
"(",
")",
"self",
... | create a stream in a non-inclusive manner | [
"create",
"a",
"stream",
"in",
"a",
"non",
"-",
"inclusive",
"manner"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/streams.py#L37-L44 |
44,296 | symphonyoss/python-symphony | symphony/Pod/streams.py | Streams.stream_info | def stream_info(self, stream_id):
''' get stream info '''
response, status_code = self.__pod__.Streams.get_v2_room_id_info(
sessionToken=self.__session__,
id=stream_id
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_code, res... | python | def stream_info(self, stream_id):
''' get stream info '''
response, status_code = self.__pod__.Streams.get_v2_room_id_info(
sessionToken=self.__session__,
id=stream_id
).result()
self.logger.debug('%s: %s' % (status_code, response))
return status_code, res... | [
"def",
"stream_info",
"(",
"self",
",",
"stream_id",
")",
":",
"response",
",",
"status_code",
"=",
"self",
".",
"__pod__",
".",
"Streams",
".",
"get_v2_room_id_info",
"(",
"sessionToken",
"=",
"self",
".",
"__session__",
",",
"id",
"=",
"stream_id",
")",
... | get stream info | [
"get",
"stream",
"info"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/streams.py#L46-L53 |
44,297 | symphonyoss/python-symphony | symphony/Pod/streams.py | Streams.create_stream | def create_stream(self, uidList=[]):
''' create a stream '''
req_hook = 'pod/v1/im/create'
req_args = json.dumps(uidList)
status_code, response = self.__rest__.POST_query(req_hook, req_args)
self.logger.debug('%s: %s' % (status_code, response))
return status_code, respons... | python | def create_stream(self, uidList=[]):
''' create a stream '''
req_hook = 'pod/v1/im/create'
req_args = json.dumps(uidList)
status_code, response = self.__rest__.POST_query(req_hook, req_args)
self.logger.debug('%s: %s' % (status_code, response))
return status_code, respons... | [
"def",
"create_stream",
"(",
"self",
",",
"uidList",
"=",
"[",
"]",
")",
":",
"req_hook",
"=",
"'pod/v1/im/create'",
"req_args",
"=",
"json",
".",
"dumps",
"(",
"uidList",
")",
"status_code",
",",
"response",
"=",
"self",
".",
"__rest__",
".",
"POST_query"... | create a stream | [
"create",
"a",
"stream"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/streams.py#L55-L61 |
44,298 | symphonyoss/python-symphony | symphony/Pod/streams.py | Streams.update_room | def update_room(self, stream_id, room_definition):
''' update a room definition '''
req_hook = 'pod/v2/room/' + str(stream_id) + '/update'
req_args = json.dumps(room_definition)
status_code, response = self.__rest__.POST_query(req_hook, req_args)
self.logger.debug('%s: %s' % (sta... | python | def update_room(self, stream_id, room_definition):
''' update a room definition '''
req_hook = 'pod/v2/room/' + str(stream_id) + '/update'
req_args = json.dumps(room_definition)
status_code, response = self.__rest__.POST_query(req_hook, req_args)
self.logger.debug('%s: %s' % (sta... | [
"def",
"update_room",
"(",
"self",
",",
"stream_id",
",",
"room_definition",
")",
":",
"req_hook",
"=",
"'pod/v2/room/'",
"+",
"str",
"(",
"stream_id",
")",
"+",
"'/update'",
"req_args",
"=",
"json",
".",
"dumps",
"(",
"room_definition",
")",
"status_code",
... | update a room definition | [
"update",
"a",
"room",
"definition"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/streams.py#L63-L69 |
44,299 | symphonyoss/python-symphony | symphony/Pod/streams.py | Streams.room_members | def room_members(self, stream_id):
''' get list of room members '''
req_hook = 'pod/v2/room/' + str(stream_id) + '/membership/list'
req_args = None
status_code, response = self.__rest__.GET_query(req_hook, req_args)
self.logger.debug('%s: %s' % (status_code, response))
re... | python | def room_members(self, stream_id):
''' get list of room members '''
req_hook = 'pod/v2/room/' + str(stream_id) + '/membership/list'
req_args = None
status_code, response = self.__rest__.GET_query(req_hook, req_args)
self.logger.debug('%s: %s' % (status_code, response))
re... | [
"def",
"room_members",
"(",
"self",
",",
"stream_id",
")",
":",
"req_hook",
"=",
"'pod/v2/room/'",
"+",
"str",
"(",
"stream_id",
")",
"+",
"'/membership/list'",
"req_args",
"=",
"None",
"status_code",
",",
"response",
"=",
"self",
".",
"__rest__",
".",
"GET_... | get list of room members | [
"get",
"list",
"of",
"room",
"members"
] | b939f35fbda461183ec0c01790c754f89a295be0 | https://github.com/symphonyoss/python-symphony/blob/b939f35fbda461183ec0c01790c754f89a295be0/symphony/Pod/streams.py#L79-L85 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.