partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
AuthenticatedReddit.select_flair
Select user flair or link flair on subreddits. This can only be used for assigning your own name flair or link flair on your own submissions. For assigning other's flairs using moderator access, see :meth:`~praw.__init__.ModFlairMixin.set_flair`. :param item: A string, Subreddit object...
rtv/packages/praw/__init__.py
def select_flair(self, item, flair_template_id='', flair_text=''): """Select user flair or link flair on subreddits. This can only be used for assigning your own name flair or link flair on your own submissions. For assigning other's flairs using moderator access, see :meth:`~praw.__ini...
def select_flair(self, item, flair_template_id='', flair_text=''): """Select user flair or link flair on subreddits. This can only be used for assigning your own name flair or link flair on your own submissions. For assigning other's flairs using moderator access, see :meth:`~praw.__ini...
[ "Select", "user", "flair", "or", "link", "flair", "on", "subreddits", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1542-L1576
[ "def", "select_flair", "(", "self", ",", "item", ",", "flair_template_id", "=", "''", ",", "flair_text", "=", "''", ")", ":", "data", "=", "{", "'flair_template_id'", ":", "flair_template_id", "or", "''", ",", "'text'", ":", "flair_text", "or", "''", "}", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
AuthenticatedReddit.set_access_credentials
Set the credentials used for OAuth2 authentication. Calling this function will overwrite any currently existing access credentials. :param scope: A set of reddit scopes the tokens provide access to :param access_token: the access token of the authentication :param refresh_token...
rtv/packages/praw/__init__.py
def set_access_credentials(self, scope, access_token, refresh_token=None, update_user=True): """Set the credentials used for OAuth2 authentication. Calling this function will overwrite any currently existing access credentials. :param scope: A set of redd...
def set_access_credentials(self, scope, access_token, refresh_token=None, update_user=True): """Set the credentials used for OAuth2 authentication. Calling this function will overwrite any currently existing access credentials. :param scope: A set of redd...
[ "Set", "the", "credentials", "used", "for", "OAuth2", "authentication", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1579-L1606
[ "def", "set_access_credentials", "(", "self", ",", "scope", ",", "access_token", ",", "refresh_token", "=", "None", ",", "update_user", "=", "True", ")", ":", "if", "isinstance", "(", "scope", ",", "(", "list", ",", "tuple", ")", ")", ":", "scope", "=", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModConfigMixin.create_subreddit
Create a new subreddit. :returns: The json response from the server. This function may result in a captcha challenge. PRAW will automatically prompt you for a response. See :ref:`handling-captchas` if you want to manually handle captchas.
rtv/packages/praw/__init__.py
def create_subreddit(self, name, title, description='', language='en', subreddit_type='public', content_options='any', over_18=False, default_set=True, show_media=False, domain='', wikimode='disabled', captcha=None, **kw...
def create_subreddit(self, name, title, description='', language='en', subreddit_type='public', content_options='any', over_18=False, default_set=True, show_media=False, domain='', wikimode='disabled', captcha=None, **kw...
[ "Create", "a", "new", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1619-L1646
[ "def", "create_subreddit", "(", "self", ",", "name", ",", "title", ",", "description", "=", "''", ",", "language", "=", "'en'", ",", "subreddit_type", "=", "'public'", ",", "content_options", "=", "'any'", ",", "over_18", "=", "False", ",", "default_set", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModConfigMixin.delete_image
Delete an image from the subreddit. :param name: The name of the image if removing a CSS image. :param header: When true, delete the subreddit header. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def delete_image(self, subreddit, name=None, header=False): """Delete an image from the subreddit. :param name: The name of the image if removing a CSS image. :param header: When true, delete the subreddit header. :returns: The json response from the server. """ subredd...
def delete_image(self, subreddit, name=None, header=False): """Delete an image from the subreddit. :param name: The name of the image if removing a CSS image. :param header: When true, delete the subreddit header. :returns: The json response from the server. """ subredd...
[ "Delete", "an", "image", "from", "the", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1649-L1668
[ "def", "delete_image", "(", "self", ",", "subreddit", ",", "name", "=", "None", ",", "header", "=", "False", ")", ":", "subreddit", "=", "six", ".", "text_type", "(", "subreddit", ")", "if", "name", "and", "header", ":", "raise", "TypeError", "(", "'Bo...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModConfigMixin.set_settings
Set the settings for the given subreddit. :param subreddit: Must be a subreddit object. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def set_settings(self, subreddit, title, public_description='', description='', language='en', subreddit_type='public', content_options='any', over_18=False, default_set=True, show_media=False, domain='', domain_css=False, domain_sideba...
def set_settings(self, subreddit, title, public_description='', description='', language='en', subreddit_type='public', content_options='any', over_18=False, default_set=True, show_media=False, domain='', domain_css=False, domain_sideba...
[ "Set", "the", "settings", "for", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1678-L1737
[ "def", "set_settings", "(", "self", ",", "subreddit", ",", "title", ",", "public_description", "=", "''", ",", "description", "=", "''", ",", "language", "=", "'en'", ",", "subreddit_type", "=", "'public'", ",", "content_options", "=", "'any'", ",", "over_18...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModConfigMixin.set_stylesheet
Set stylesheet for the given subreddit. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def set_stylesheet(self, subreddit, stylesheet): """Set stylesheet for the given subreddit. :returns: The json response from the server. """ subreddit = six.text_type(subreddit) data = {'r': subreddit, 'stylesheet_contents': stylesheet, 'op': 'sa...
def set_stylesheet(self, subreddit, stylesheet): """Set stylesheet for the given subreddit. :returns: The json response from the server. """ subreddit = six.text_type(subreddit) data = {'r': subreddit, 'stylesheet_contents': stylesheet, 'op': 'sa...
[ "Set", "stylesheet", "for", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1740-L1751
[ "def", "set_stylesheet", "(", "self", ",", "subreddit", ",", "stylesheet", ")", ":", "subreddit", "=", "six", ".", "text_type", "(", "subreddit", ")", "data", "=", "{", "'r'", ":", "subreddit", ",", "'stylesheet_contents'", ":", "stylesheet", ",", "'op'", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModConfigMixin.upload_image
Upload an image to the subreddit. :param image_path: A path to the jpg or png image you want to upload. :param name: The name to provide the image. When None the name will be filename less any extension. :param header: When True, upload the image as the subreddit header. :pa...
rtv/packages/praw/__init__.py
def upload_image(self, subreddit, image_path, name=None, header=False, upload_as=None): """Upload an image to the subreddit. :param image_path: A path to the jpg or png image you want to upload. :param name: The name to provide the image. When None the name will be ...
def upload_image(self, subreddit, image_path, name=None, header=False, upload_as=None): """Upload an image to the subreddit. :param image_path: A path to the jpg or png image you want to upload. :param name: The name to provide the image. When None the name will be ...
[ "Upload", "an", "image", "to", "the", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1754-L1790
[ "def", "upload_image", "(", "self", ",", "subreddit", ",", "image_path", ",", "name", "=", "None", ",", "header", "=", "False", ",", "upload_as", "=", "None", ")", ":", "if", "name", "and", "header", ":", "raise", "TypeError", "(", "'Both name and header c...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModConfigMixin.update_settings
Update only the given settings for the given subreddit. The settings to update must be given by keyword and match one of the parameter names in `set_settings`. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def update_settings(self, subreddit, **kwargs): """Update only the given settings for the given subreddit. The settings to update must be given by keyword and match one of the parameter names in `set_settings`. :returns: The json response from the server. """ settings ...
def update_settings(self, subreddit, **kwargs): """Update only the given settings for the given subreddit. The settings to update must be given by keyword and match one of the parameter names in `set_settings`. :returns: The json response from the server. """ settings ...
[ "Update", "only", "the", "given", "settings", "for", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1792-L1804
[ "def", "update_settings", "(", "self", ",", "subreddit", ",", "*", "*", "kwargs", ")", ":", "settings", "=", "self", ".", "get_settings", "(", "subreddit", ")", "settings", ".", "update", "(", "kwargs", ")", "del", "settings", "[", "'subreddit_id'", "]", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModFlairMixin.add_flair_template
Add a flair template to the given subreddit. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def add_flair_template(self, subreddit, text='', css_class='', text_editable=False, is_link=False): """Add a flair template to the given subreddit. :returns: The json response from the server. """ data = {'r': six.text_type(subreddit), 'text':...
def add_flair_template(self, subreddit, text='', css_class='', text_editable=False, is_link=False): """Add a flair template to the given subreddit. :returns: The json response from the server. """ data = {'r': six.text_type(subreddit), 'text':...
[ "Add", "a", "flair", "template", "to", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1816-L1828
[ "def", "add_flair_template", "(", "self", ",", "subreddit", ",", "text", "=", "''", ",", "css_class", "=", "''", ",", "text_editable", "=", "False", ",", "is_link", "=", "False", ")", ":", "data", "=", "{", "'r'", ":", "six", ".", "text_type", "(", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModFlairMixin.clear_flair_templates
Clear flair templates for the given subreddit. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def clear_flair_templates(self, subreddit, is_link=False): """Clear flair templates for the given subreddit. :returns: The json response from the server. """ data = {'r': six.text_type(subreddit), 'flair_type': 'LINK_FLAIR' if is_link else 'USER_FLAIR'} return s...
def clear_flair_templates(self, subreddit, is_link=False): """Clear flair templates for the given subreddit. :returns: The json response from the server. """ data = {'r': six.text_type(subreddit), 'flair_type': 'LINK_FLAIR' if is_link else 'USER_FLAIR'} return s...
[ "Clear", "flair", "templates", "for", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1831-L1839
[ "def", "clear_flair_templates", "(", "self", ",", "subreddit", ",", "is_link", "=", "False", ")", ":", "data", "=", "{", "'r'", ":", "six", ".", "text_type", "(", "subreddit", ")", ",", "'flair_type'", ":", "'LINK_FLAIR'", "if", "is_link", "else", "'USER_F...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModFlairMixin.configure_flair
Configure the flair setting for the given subreddit. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def configure_flair(self, subreddit, flair_enabled=False, flair_position='right', flair_self_assign=False, link_flair_enabled=False, link_flair_position='left', link_flair_self_assign=False): ...
def configure_flair(self, subreddit, flair_enabled=False, flair_position='right', flair_self_assign=False, link_flair_enabled=False, link_flair_position='left', link_flair_self_assign=False): ...
[ "Configure", "the", "flair", "setting", "for", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1842-L1864
[ "def", "configure_flair", "(", "self", ",", "subreddit", ",", "flair_enabled", "=", "False", ",", "flair_position", "=", "'right'", ",", "flair_self_assign", "=", "False", ",", "link_flair_enabled", "=", "False", ",", "link_flair_position", "=", "'left'", ",", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModFlairMixin.delete_flair
Delete the flair for the given user on the given subreddit. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def delete_flair(self, subreddit, user): """Delete the flair for the given user on the given subreddit. :returns: The json response from the server. """ data = {'r': six.text_type(subreddit), 'name': six.text_type(user)} return self.request_json(self.config['del...
def delete_flair(self, subreddit, user): """Delete the flair for the given user on the given subreddit. :returns: The json response from the server. """ data = {'r': six.text_type(subreddit), 'name': six.text_type(user)} return self.request_json(self.config['del...
[ "Delete", "the", "flair", "for", "the", "given", "user", "on", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1867-L1875
[ "def", "delete_flair", "(", "self", ",", "subreddit", ",", "user", ")", ":", "data", "=", "{", "'r'", ":", "six", ".", "text_type", "(", "subreddit", ")", ",", "'name'", ":", "six", ".", "text_type", "(", "user", ")", "}", "return", "self", ".", "r...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModFlairMixin.get_flair_list
Return a get_content generator of flair mappings. :param subreddit: Either a Subreddit object or the name of the subreddit to return the flair list for. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url`, `root_field`, `thing_field`, and ...
rtv/packages/praw/__init__.py
def get_flair_list(self, subreddit, *args, **kwargs): """Return a get_content generator of flair mappings. :param subreddit: Either a Subreddit object or the name of the subreddit to return the flair list for. The additional parameters are passed directly into :meth:`.get_c...
def get_flair_list(self, subreddit, *args, **kwargs): """Return a get_content generator of flair mappings. :param subreddit: Either a Subreddit object or the name of the subreddit to return the flair list for. The additional parameters are passed directly into :meth:`.get_c...
[ "Return", "a", "get_content", "generator", "of", "flair", "mappings", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1878-L1893
[ "def", "get_flair_list", "(", "self", ",", "subreddit", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "url", "=", "self", ".", "config", "[", "'flairlist'", "]", ".", "format", "(", "subreddit", "=", "six", ".", "text_type", "(", "subreddit", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModFlairMixin.set_flair
Set flair for the user in the given subreddit. `item` can be a string, Redditor object, or Submission object. If `item` is a string it will be treated as the name of a Redditor. This method can only be called by a subreddit moderator with flair permissions. To set flair on yourself or ...
rtv/packages/praw/__init__.py
def set_flair(self, subreddit, item, flair_text='', flair_css_class=''): """Set flair for the user in the given subreddit. `item` can be a string, Redditor object, or Submission object. If `item` is a string it will be treated as the name of a Redditor. This method can only be called b...
def set_flair(self, subreddit, item, flair_text='', flair_css_class=''): """Set flair for the user in the given subreddit. `item` can be a string, Redditor object, or Submission object. If `item` is a string it will be treated as the name of a Redditor. This method can only be called b...
[ "Set", "flair", "for", "the", "user", "in", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1896-L1921
[ "def", "set_flair", "(", "self", ",", "subreddit", ",", "item", ",", "flair_text", "=", "''", ",", "flair_css_class", "=", "''", ")", ":", "data", "=", "{", "'r'", ":", "six", ".", "text_type", "(", "subreddit", ")", ",", "'text'", ":", "flair_text", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModFlairMixin.set_flair_csv
Set flair for a group of users in the given subreddit. flair_mapping should be a list of dictionaries with the following keys: `user`: the user name, `flair_text`: the flair text for the user (optional), `flair_css_class`: the flair css class for the user (optional) :retu...
rtv/packages/praw/__init__.py
def set_flair_csv(self, subreddit, flair_mapping): """Set flair for a group of users in the given subreddit. flair_mapping should be a list of dictionaries with the following keys: `user`: the user name, `flair_text`: the flair text for the user (optional), `flair_css_clas...
def set_flair_csv(self, subreddit, flair_mapping): """Set flair for a group of users in the given subreddit. flair_mapping should be a list of dictionaries with the following keys: `user`: the user name, `flair_text`: the flair text for the user (optional), `flair_css_clas...
[ "Set", "flair", "for", "a", "group", "of", "users", "in", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1924-L1954
[ "def", "set_flair_csv", "(", "self", ",", "subreddit", ",", "flair_mapping", ")", ":", "if", "not", "flair_mapping", ":", "raise", "errors", ".", "ClientException", "(", "'flair_mapping must be set'", ")", "item_order", "=", "[", "'user'", ",", "'flair_text'", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModLogMixin.get_mod_log
Return a get_content generator for moderation log items. :param subreddit: Either a Subreddit object or the name of the subreddit to return the modlog for. :param mod: If given, only return the actions made by this moderator. Both a moderator name or Redditor object can be used ...
rtv/packages/praw/__init__.py
def get_mod_log(self, subreddit, mod=None, action=None, *args, **kwargs): """Return a get_content generator for moderation log items. :param subreddit: Either a Subreddit object or the name of the subreddit to return the modlog for. :param mod: If given, only return the actions made...
def get_mod_log(self, subreddit, mod=None, action=None, *args, **kwargs): """Return a get_content generator for moderation log items. :param subreddit: Either a Subreddit object or the name of the subreddit to return the modlog for. :param mod: If given, only return the actions made...
[ "Return", "a", "get_content", "generator", "for", "moderation", "log", "items", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L1966-L1985
[ "def", "get_mod_log", "(", "self", ",", "subreddit", ",", "mod", "=", "None", ",", "action", "=", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "params", "=", "kwargs", ".", "setdefault", "(", "'params'", ",", "{", "}", ")", "if", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModOnlyMixin.get_banned
Return a get_content generator of banned users for the subreddit. :param subreddit: The subreddit to get the banned user list for. :param user_only: When False, the generator yields a dictionary of data associated with the server response for that user. In such cases, the Reddit...
rtv/packages/praw/__init__.py
def get_banned(self, subreddit, user_only=True, *args, **kwargs): """Return a get_content generator of banned users for the subreddit. :param subreddit: The subreddit to get the banned user list for. :param user_only: When False, the generator yields a dictionary of data associated ...
def get_banned(self, subreddit, user_only=True, *args, **kwargs): """Return a get_content generator of banned users for the subreddit. :param subreddit: The subreddit to get the banned user list for. :param user_only: When False, the generator yields a dictionary of data associated ...
[ "Return", "a", "get_content", "generator", "of", "banned", "users", "for", "the", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2008-L2018
[ "def", "get_banned", "(", "self", ",", "subreddit", ",", "user_only", "=", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "url", "=", "self", ".", "config", "[", "'banned'", "]", ".", "format", "(", "subreddit", "=", "six", ".", "text...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModOnlyMixin.get_contributors
Return a get_content generator of contributors for the given subreddit. If it's a public subreddit, then authentication as a moderator of the subreddit is required. For protected/private subreddits only access is required. See issue #246.
rtv/packages/praw/__init__.py
def get_contributors(self, subreddit, *args, **kwargs): """ Return a get_content generator of contributors for the given subreddit. If it's a public subreddit, then authentication as a moderator of the subreddit is required. For protected/private subreddits only access is requir...
def get_contributors(self, subreddit, *args, **kwargs): """ Return a get_content generator of contributors for the given subreddit. If it's a public subreddit, then authentication as a moderator of the subreddit is required. For protected/private subreddits only access is requir...
[ "Return", "a", "get_content", "generator", "of", "contributors", "for", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2020-L2044
[ "def", "get_contributors", "(", "self", ",", "subreddit", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=W0613", "def", "get_contributors_helper", "(", "self", ",", "subreddit", ")", ":", "# It is necessary to have the 'self' argument as it's ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModOnlyMixin.get_edited
Return a get_content generator of edited items. :param subreddit: Either a Subreddit object or the name of the subreddit to return the edited items for. Defaults to `mod` which includes items for all the subreddits you moderate. The additional parameters are passed directly int...
rtv/packages/praw/__init__.py
def get_edited(self, subreddit='mod', *args, **kwargs): """Return a get_content generator of edited items. :param subreddit: Either a Subreddit object or the name of the subreddit to return the edited items for. Defaults to `mod` which includes items for all the subreddits you m...
def get_edited(self, subreddit='mod', *args, **kwargs): """Return a get_content generator of edited items. :param subreddit: Either a Subreddit object or the name of the subreddit to return the edited items for. Defaults to `mod` which includes items for all the subreddits you m...
[ "Return", "a", "get_content", "generator", "of", "edited", "items", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2047-L2059
[ "def", "get_edited", "(", "self", ",", "subreddit", "=", "'mod'", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "url", "=", "self", ".", "config", "[", "'edited'", "]", ".", "format", "(", "subreddit", "=", "six", ".", "text_type", "(", "sub...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModOnlyMixin.get_stylesheet
Return the stylesheet and images for the given subreddit.
rtv/packages/praw/__init__.py
def get_stylesheet(self, subreddit, **params): """Return the stylesheet and images for the given subreddit.""" url = self.config['stylesheet'].format( subreddit=six.text_type(subreddit)) return self.request_json(url, params=params)['data']
def get_stylesheet(self, subreddit, **params): """Return the stylesheet and images for the given subreddit.""" url = self.config['stylesheet'].format( subreddit=six.text_type(subreddit)) return self.request_json(url, params=params)['data']
[ "Return", "the", "stylesheet", "and", "images", "for", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2138-L2142
[ "def", "get_stylesheet", "(", "self", ",", "subreddit", ",", "*", "*", "params", ")", ":", "url", "=", "self", ".", "config", "[", "'stylesheet'", "]", ".", "format", "(", "subreddit", "=", "six", ".", "text_type", "(", "subreddit", ")", ")", "return",...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModSelfMixin.leave_moderator
Abdicate moderator status in a subreddit. Use with care. :param subreddit: The name of the subreddit to leave `status` from. :returns: the json response from the server.
rtv/packages/praw/__init__.py
def leave_moderator(self, subreddit): """Abdicate moderator status in a subreddit. Use with care. :param subreddit: The name of the subreddit to leave `status` from. :returns: the json response from the server. """ self.evict(self.config['my_mod_subreddits']) return sel...
def leave_moderator(self, subreddit): """Abdicate moderator status in a subreddit. Use with care. :param subreddit: The name of the subreddit to leave `status` from. :returns: the json response from the server. """ self.evict(self.config['my_mod_subreddits']) return sel...
[ "Abdicate", "moderator", "status", "in", "a", "subreddit", ".", "Use", "with", "care", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2199-L2207
[ "def", "leave_moderator", "(", "self", ",", "subreddit", ")", ":", "self", ".", "evict", "(", "self", ".", "config", "[", "'my_mod_subreddits'", "]", ")", "return", "self", ".", "_leave_status", "(", "subreddit", ",", "self", ".", "config", "[", "'leavemod...
ccef2af042566ad384977028cf0bde01bc524dda
train
ModSelfMixin._leave_status
Abdicate status in a subreddit. :param subreddit: The name of the subreddit to leave `status` from. :param statusurl: The API URL which will be used in the leave request. Please use :meth:`leave_contributor` or :meth:`leave_moderator` rather than setting this directly. ...
rtv/packages/praw/__init__.py
def _leave_status(self, subreddit, statusurl): """Abdicate status in a subreddit. :param subreddit: The name of the subreddit to leave `status` from. :param statusurl: The API URL which will be used in the leave request. Please use :meth:`leave_contributor` or :meth:`leave_moderator...
def _leave_status(self, subreddit, statusurl): """Abdicate status in a subreddit. :param subreddit: The name of the subreddit to leave `status` from. :param statusurl: The API URL which will be used in the leave request. Please use :meth:`leave_contributor` or :meth:`leave_moderator...
[ "Abdicate", "status", "in", "a", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2210-L2224
[ "def", "_leave_status", "(", "self", ",", "subreddit", ",", "statusurl", ")", ":", "if", "isinstance", "(", "subreddit", ",", "six", ".", "string_types", ")", ":", "subreddit", "=", "self", ".", "get_subreddit", "(", "subreddit", ")", "data", "=", "{", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
MultiredditMixin.copy_multireddit
Copy a multireddit. :param from_redditor: The username or Redditor object for the user who owns the original multireddit :param from_name: The name of the multireddit, belonging to from_redditor :param to_name: The name to copy the multireddit as. If None, uses ...
rtv/packages/praw/__init__.py
def copy_multireddit(self, from_redditor, from_name, to_name=None, *args, **kwargs): """Copy a multireddit. :param from_redditor: The username or Redditor object for the user who owns the original multireddit :param from_name: The name of the multireddit, be...
def copy_multireddit(self, from_redditor, from_name, to_name=None, *args, **kwargs): """Copy a multireddit. :param from_redditor: The username or Redditor object for the user who owns the original multireddit :param from_name: The name of the multireddit, be...
[ "Copy", "a", "multireddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2238-L2262
[ "def", "copy_multireddit", "(", "self", ",", "from_redditor", ",", "from_name", ",", "to_name", "=", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "to_name", "is", "None", ":", "to_name", "=", "from_name", "from_multipath", "=", "sel...
ccef2af042566ad384977028cf0bde01bc524dda
train
MultiredditMixin.create_multireddit
Create a new multireddit. :param name: The name of the new multireddit. :param description_md: Optional description for the multireddit, formatted in markdown. :param icon_name: Optional, choose an icon name from this list: ``art and design``, ``ask``, ``books``, ``busin...
rtv/packages/praw/__init__.py
def create_multireddit(self, name, description_md=None, icon_name=None, key_color=None, subreddits=None, visibility=None, weighting_scheme=None, overwrite=False, *args, **kwargs): # pylint: disable=W0613 """Create a new multireddi...
def create_multireddit(self, name, description_md=None, icon_name=None, key_color=None, subreddits=None, visibility=None, weighting_scheme=None, overwrite=False, *args, **kwargs): # pylint: disable=W0613 """Create a new multireddi...
[ "Create", "a", "new", "multireddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2265-L2316
[ "def", "create_multireddit", "(", "self", ",", "name", ",", "description_md", "=", "None", ",", "icon_name", "=", "None", ",", "key_color", "=", "None", ",", "subreddits", "=", "None", ",", "visibility", "=", "None", ",", "weighting_scheme", "=", "None", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
MultiredditMixin.delete_multireddit
Delete a Multireddit. Any additional parameters are passed directly into :meth:`~praw.__init__.BaseReddit.request`
rtv/packages/praw/__init__.py
def delete_multireddit(self, name, *args, **kwargs): """Delete a Multireddit. Any additional parameters are passed directly into :meth:`~praw.__init__.BaseReddit.request` """ url = self.config['multireddit_about'].format(user=self.user.name, ...
def delete_multireddit(self, name, *args, **kwargs): """Delete a Multireddit. Any additional parameters are passed directly into :meth:`~praw.__init__.BaseReddit.request` """ url = self.config['multireddit_about'].format(user=self.user.name, ...
[ "Delete", "a", "Multireddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2319-L2337
[ "def", "delete_multireddit", "(", "self", ",", "name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "url", "=", "self", ".", "config", "[", "'multireddit_about'", "]", ".", "format", "(", "user", "=", "self", ".", "user", ".", "name", ",", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
MultiredditMixin.edit_multireddit
Edit a multireddit, or create one if it doesn't already exist. See :meth:`create_multireddit` for accepted parameters.
rtv/packages/praw/__init__.py
def edit_multireddit(self, *args, **kwargs): """Edit a multireddit, or create one if it doesn't already exist. See :meth:`create_multireddit` for accepted parameters. """ return self.create_multireddit(*args, overwrite=True, **kwargs)
def edit_multireddit(self, *args, **kwargs): """Edit a multireddit, or create one if it doesn't already exist. See :meth:`create_multireddit` for accepted parameters. """ return self.create_multireddit(*args, overwrite=True, **kwargs)
[ "Edit", "a", "multireddit", "or", "create", "one", "if", "it", "doesn", "t", "already", "exist", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2339-L2345
[ "def", "edit_multireddit", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "create_multireddit", "(", "*", "args", ",", "overwrite", "=", "True", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
MultiredditMixin.get_multireddit
Return a Multireddit object for the author and name specified. :param redditor: The username or Redditor object of the user who owns the multireddit. :param multi: The name of the multireddit to fetch. The additional parameters are passed directly into the :class:`.Multired...
rtv/packages/praw/__init__.py
def get_multireddit(self, redditor, multi, *args, **kwargs): """Return a Multireddit object for the author and name specified. :param redditor: The username or Redditor object of the user who owns the multireddit. :param multi: The name of the multireddit to fetch. The addi...
def get_multireddit(self, redditor, multi, *args, **kwargs): """Return a Multireddit object for the author and name specified. :param redditor: The username or Redditor object of the user who owns the multireddit. :param multi: The name of the multireddit to fetch. The addi...
[ "Return", "a", "Multireddit", "object", "for", "the", "author", "and", "name", "specified", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2347-L2359
[ "def", "get_multireddit", "(", "self", ",", "redditor", ",", "multi", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "objects", ".", "Multireddit", "(", "self", ",", "six", ".", "text_type", "(", "redditor", ")", ",", "multi", ",", "*...
ccef2af042566ad384977028cf0bde01bc524dda
train
MultiredditMixin.get_multireddits
Return a list of multireddits belonging to a redditor. :param redditor: The username or Redditor object to find multireddits from. :returns: The json response from the server The additional parameters are passed directly into :meth:`~praw.__init__.BaseReddit.request_json` ...
rtv/packages/praw/__init__.py
def get_multireddits(self, redditor, *args, **kwargs): """Return a list of multireddits belonging to a redditor. :param redditor: The username or Redditor object to find multireddits from. :returns: The json response from the server The additional parameters are passed dire...
def get_multireddits(self, redditor, *args, **kwargs): """Return a list of multireddits belonging to a redditor. :param redditor: The username or Redditor object to find multireddits from. :returns: The json response from the server The additional parameters are passed dire...
[ "Return", "a", "list", "of", "multireddits", "belonging", "to", "a", "redditor", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2361-L2377
[ "def", "get_multireddits", "(", "self", ",", "redditor", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "redditor", "=", "six", ".", "text_type", "(", "redditor", ")", "url", "=", "self", ".", "config", "[", "'multireddit_user'", "]", ".", "forma...
ccef2af042566ad384977028cf0bde01bc524dda
train
MultiredditMixin.rename_multireddit
Rename a Multireddit. :param current_name: The name of the multireddit to rename :param new_name: The new name to assign to this multireddit The additional parameters are passed directly into :meth:`~praw.__init__.BaseReddit.request_json`
rtv/packages/praw/__init__.py
def rename_multireddit(self, current_name, new_name, *args, **kwargs): """Rename a Multireddit. :param current_name: The name of the multireddit to rename :param new_name: The new name to assign to this multireddit The additional parameters are passed directly into :meth:`~praw...
def rename_multireddit(self, current_name, new_name, *args, **kwargs): """Rename a Multireddit. :param current_name: The name of the multireddit to rename :param new_name: The new name to assign to this multireddit The additional parameters are passed directly into :meth:`~praw...
[ "Rename", "a", "Multireddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2380-L2395
[ "def", "rename_multireddit", "(", "self", ",", "current_name", ",", "new_name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "current_path", "=", "self", ".", "MULTI_PATH", ".", "format", "(", "self", ".", "user", ".", "name", ",", "current_name"...
ccef2af042566ad384977028cf0bde01bc524dda
train
MySubredditsMixin.get_my_contributions
Return a get_content generator of subreddits. The Subreddits generated are those where the session's user is a contributor. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered.
rtv/packages/praw/__init__.py
def get_my_contributions(self, *args, **kwargs): """Return a get_content generator of subreddits. The Subreddits generated are those where the session's user is a contributor. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter can...
def get_my_contributions(self, *args, **kwargs): """Return a get_content generator of subreddits. The Subreddits generated are those where the session's user is a contributor. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter can...
[ "Return", "a", "get_content", "generator", "of", "subreddits", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2407-L2418
[ "def", "get_my_contributions", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "get_content", "(", "self", ".", "config", "[", "'my_con_subreddits'", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
MySubredditsMixin.get_my_moderation
Return a get_content generator of subreddits. The Subreddits generated are those where the session's user is a moderator. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered.
rtv/packages/praw/__init__.py
def get_my_moderation(self, *args, **kwargs): """Return a get_content generator of subreddits. The Subreddits generated are those where the session's user is a moderator. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot b...
def get_my_moderation(self, *args, **kwargs): """Return a get_content generator of subreddits. The Subreddits generated are those where the session's user is a moderator. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot b...
[ "Return", "a", "get_content", "generator", "of", "subreddits", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2421-L2432
[ "def", "get_my_moderation", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "get_content", "(", "self", ".", "config", "[", "'my_mod_subreddits'", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
MySubredditsMixin.get_my_subreddits
Return a get_content generator of subreddits. The subreddits generated are those that hat the session's user is subscribed to. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered.
rtv/packages/praw/__init__.py
def get_my_subreddits(self, *args, **kwargs): """Return a get_content generator of subreddits. The subreddits generated are those that hat the session's user is subscribed to. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter can...
def get_my_subreddits(self, *args, **kwargs): """Return a get_content generator of subreddits. The subreddits generated are those that hat the session's user is subscribed to. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter can...
[ "Return", "a", "get_content", "generator", "of", "subreddits", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2442-L2452
[ "def", "get_my_subreddits", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "get_content", "(", "self", ".", "config", "[", "'my_subreddits'", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin._mark_as_read
Mark each of the supplied thing_ids as (un)read. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def _mark_as_read(self, thing_ids, unread=False): """Mark each of the supplied thing_ids as (un)read. :returns: The json response from the server. """ data = {'id': ','.join(thing_ids)} key = 'unread_message' if unread else 'read_message' response = self.request_json(se...
def _mark_as_read(self, thing_ids, unread=False): """Mark each of the supplied thing_ids as (un)read. :returns: The json response from the server. """ data = {'id': ','.join(thing_ids)} key = 'unread_message' if unread else 'read_message' response = self.request_json(se...
[ "Mark", "each", "of", "the", "supplied", "thing_ids", "as", "(", "un", ")", "read", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2464-L2475
[ "def", "_mark_as_read", "(", "self", ",", "thing_ids", ",", "unread", "=", "False", ")", ":", "data", "=", "{", "'id'", ":", "','", ".", "join", "(", "thing_ids", ")", "}", "key", "=", "'unread_message'", "if", "unread", "else", "'read_message'", "respon...
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin.get_comment_replies
Return a get_content generator for inboxed comment replies. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered.
rtv/packages/praw/__init__.py
def get_comment_replies(self, *args, **kwargs): """Return a get_content generator for inboxed comment replies. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['comment_...
def get_comment_replies(self, *args, **kwargs): """Return a get_content generator for inboxed comment replies. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['comment_...
[ "Return", "a", "get_content", "generator", "for", "inboxed", "comment", "replies", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2478-L2486
[ "def", "get_comment_replies", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "get_content", "(", "self", ".", "config", "[", "'comment_replies'", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin.get_inbox
Return a get_content generator for inbox (messages and comments). The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered.
rtv/packages/praw/__init__.py
def get_inbox(self, *args, **kwargs): """Return a get_content generator for inbox (messages and comments). The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['inbox'], *ar...
def get_inbox(self, *args, **kwargs): """Return a get_content generator for inbox (messages and comments). The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['inbox'], *ar...
[ "Return", "a", "get_content", "generator", "for", "inbox", "(", "messages", "and", "comments", ")", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2489-L2496
[ "def", "get_inbox", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "get_content", "(", "self", ".", "config", "[", "'inbox'", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin.get_message
Return a Message object corresponding to the given ID. :param message_id: The ID or Fullname for a Message The additional parameters are passed directly into :meth:`~praw.objects.Message.from_id` of Message, and subsequently into :meth:`.request_json`.
rtv/packages/praw/__init__.py
def get_message(self, message_id, *args, **kwargs): """Return a Message object corresponding to the given ID. :param message_id: The ID or Fullname for a Message The additional parameters are passed directly into :meth:`~praw.objects.Message.from_id` of Message, and subsequently into ...
def get_message(self, message_id, *args, **kwargs): """Return a Message object corresponding to the given ID. :param message_id: The ID or Fullname for a Message The additional parameters are passed directly into :meth:`~praw.objects.Message.from_id` of Message, and subsequently into ...
[ "Return", "a", "Message", "object", "corresponding", "to", "the", "given", "ID", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2498-L2508
[ "def", "get_message", "(", "self", ",", "message_id", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "objects", ".", "Message", ".", "from_id", "(", "self", ",", "message_id", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin.get_messages
Return a get_content generator for inbox (messages only). The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered.
rtv/packages/praw/__init__.py
def get_messages(self, *args, **kwargs): """Return a get_content generator for inbox (messages only). The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['messages'], *args...
def get_messages(self, *args, **kwargs): """Return a get_content generator for inbox (messages only). The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['messages'], *args...
[ "Return", "a", "get_content", "generator", "for", "inbox", "(", "messages", "only", ")", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2511-L2518
[ "def", "get_messages", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "get_content", "(", "self", ".", "config", "[", "'messages'", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin.get_post_replies
Return a get_content generator for inboxed submission replies. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered.
rtv/packages/praw/__init__.py
def get_post_replies(self, *args, **kwargs): """Return a get_content generator for inboxed submission replies. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['post_rep...
def get_post_replies(self, *args, **kwargs): """Return a get_content generator for inboxed submission replies. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['post_rep...
[ "Return", "a", "get_content", "generator", "for", "inboxed", "submission", "replies", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2521-L2528
[ "def", "get_post_replies", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "get_content", "(", "self", ".", "config", "[", "'post_replies'", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin.get_sent
Return a get_content generator for sent messages. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered.
rtv/packages/praw/__init__.py
def get_sent(self, *args, **kwargs): """Return a get_content generator for sent messages. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['sent'], *args, **kwargs)
def get_sent(self, *args, **kwargs): """Return a get_content generator for sent messages. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['sent'], *args, **kwargs)
[ "Return", "a", "get_content", "generator", "for", "sent", "messages", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2531-L2538
[ "def", "get_sent", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "get_content", "(", "self", ".", "config", "[", "'sent'", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin.get_unread
Return a get_content generator for unread messages. :param unset_has_mail: When True, clear the has_mail flag (orangered) for the user. :param update_user: If both `unset_has_mail` and `update user` is True, set the `has_mail` attribute of the logged-in user to False. T...
rtv/packages/praw/__init__.py
def get_unread(self, unset_has_mail=False, update_user=False, *args, **kwargs): """Return a get_content generator for unread messages. :param unset_has_mail: When True, clear the has_mail flag (orangered) for the user. :param update_user: If both `unset_has_mail` ...
def get_unread(self, unset_has_mail=False, update_user=False, *args, **kwargs): """Return a get_content generator for unread messages. :param unset_has_mail: When True, clear the has_mail flag (orangered) for the user. :param update_user: If both `unset_has_mail` ...
[ "Return", "a", "get_content", "generator", "for", "unread", "messages", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2541-L2560
[ "def", "get_unread", "(", "self", ",", "unset_has_mail", "=", "False", ",", "update_user", "=", "False", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "params", "=", "kwargs", ".", "setdefault", "(", "'params'", ",", "{", "}", ")", "if", "unse...
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin.get_mentions
Return a get_content generator for username mentions. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered.
rtv/packages/praw/__init__.py
def get_mentions(self, *args, **kwargs): """Return a get_content generator for username mentions. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['mentions'], *args, **...
def get_mentions(self, *args, **kwargs): """Return a get_content generator for username mentions. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot be altered. """ return self.get_content(self.config['mentions'], *args, **...
[ "Return", "a", "get_content", "generator", "for", "username", "mentions", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2563-L2570
[ "def", "get_mentions", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "get_content", "(", "self", ".", "config", "[", "'mentions'", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
PrivateMessagesMixin.send_message
Send a message to a redditor or a subreddit's moderators (mod mail). :param recipient: A Redditor or Subreddit instance to send a message to. A string can also be used in which case the string is treated as a redditor unless it is prefixed with either '/r/' or '#', in which ...
rtv/packages/praw/__init__.py
def send_message(self, recipient, subject, message, from_sr=None, captcha=None, **kwargs): """Send a message to a redditor or a subreddit's moderators (mod mail). :param recipient: A Redditor or Subreddit instance to send a message to. A string can also be used in which...
def send_message(self, recipient, subject, message, from_sr=None, captcha=None, **kwargs): """Send a message to a redditor or a subreddit's moderators (mod mail). :param recipient: A Redditor or Subreddit instance to send a message to. A string can also be used in which...
[ "Send", "a", "message", "to", "a", "redditor", "or", "a", "subreddit", "s", "moderators", "(", "mod", "mail", ")", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2574-L2611
[ "def", "send_message", "(", "self", ",", "recipient", ",", "subject", ",", "message", ",", "from_sr", "=", "None", ",", "captcha", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "recipient", ",", "objects", ".", "Subreddit", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
ReportMixin.hide
Hide one or multiple objects in the context of the logged in user. :param thing_id: A single fullname or list of fullnames, representing objects which will be hidden. :param _unhide: If True, unhide the object(s) instead. Use :meth:`~praw.__init__.ReportMixin.unhide` rather than...
rtv/packages/praw/__init__.py
def hide(self, thing_id, _unhide=False): """Hide one or multiple objects in the context of the logged in user. :param thing_id: A single fullname or list of fullnames, representing objects which will be hidden. :param _unhide: If True, unhide the object(s) instead. Use :...
def hide(self, thing_id, _unhide=False): """Hide one or multiple objects in the context of the logged in user. :param thing_id: A single fullname or list of fullnames, representing objects which will be hidden. :param _unhide: If True, unhide the object(s) instead. Use :...
[ "Hide", "one", "or", "multiple", "objects", "in", "the", "context", "of", "the", "logged", "in", "user", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2623-L2668
[ "def", "hide", "(", "self", ",", "thing_id", ",", "_unhide", "=", "False", ")", ":", "if", "isinstance", "(", "thing_id", ",", "six", ".", "string_types", ")", ":", "thing_id", "=", "[", "thing_id", "]", "else", ":", "# Guarantee a subscriptable type.", "t...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubmitMixin._add_comment
Comment on the given thing with the given text. :returns: A Comment object for the newly created comment.
rtv/packages/praw/__init__.py
def _add_comment(self, thing_id, text): """Comment on the given thing with the given text. :returns: A Comment object for the newly created comment. """ def add_comment_helper(self, thing_id, text): data = {'thing_id': thing_id, 'text': text} ...
def _add_comment(self, thing_id, text): """Comment on the given thing with the given text. :returns: A Comment object for the newly created comment. """ def add_comment_helper(self, thing_id, text): data = {'thing_id': thing_id, 'text': text} ...
[ "Comment", "on", "the", "given", "thing", "with", "the", "given", "text", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2690-L2709
[ "def", "_add_comment", "(", "self", ",", "thing_id", ",", "text", ")", ":", "def", "add_comment_helper", "(", "self", ",", "thing_id", ",", "text", ")", ":", "data", "=", "{", "'thing_id'", ":", "thing_id", ",", "'text'", ":", "text", "}", "retval", "=...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubmitMixin.submit
Submit a new link to the given subreddit. Accepts either a Subreddit object or a str containing the subreddit's display name. :param resubmit: If True, submit the link even if it has already been submitted. :param save: If True the new Submission will be saved after creatio...
rtv/packages/praw/__init__.py
def submit(self, subreddit, title, text=None, url=None, captcha=None, save=None, send_replies=None, resubmit=None, **kwargs): """Submit a new link to the given subreddit. Accepts either a Subreddit object or a str containing the subreddit's display name. :param resubmit:...
def submit(self, subreddit, title, text=None, url=None, captcha=None, save=None, send_replies=None, resubmit=None, **kwargs): """Submit a new link to the given subreddit. Accepts either a Subreddit object or a str containing the subreddit's display name. :param resubmit:...
[ "Submit", "a", "new", "link", "to", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2713-L2766
[ "def", "submit", "(", "self", ",", "subreddit", ",", "title", ",", "text", "=", "None", ",", "url", "=", "None", ",", "captcha", "=", "None", ",", "save", "=", "None", ",", "send_replies", "=", "None", ",", "resubmit", "=", "None", ",", "*", "*", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubscribeMixin.subscribe
Subscribe to the given subreddit. :param subreddit: Either the subreddit name or a subreddit object. :param unsubscribe: When True, unsubscribe. :returns: The json response from the server.
rtv/packages/praw/__init__.py
def subscribe(self, subreddit, unsubscribe=False): """Subscribe to the given subreddit. :param subreddit: Either the subreddit name or a subreddit object. :param unsubscribe: When True, unsubscribe. :returns: The json response from the server. """ data = {'action': 'uns...
def subscribe(self, subreddit, unsubscribe=False): """Subscribe to the given subreddit. :param subreddit: Either the subreddit name or a subreddit object. :param unsubscribe: When True, unsubscribe. :returns: The json response from the server. """ data = {'action': 'uns...
[ "Subscribe", "to", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/__init__.py#L2778-L2790
[ "def", "subscribe", "(", "self", ",", "subreddit", ",", "unsubscribe", "=", "False", ")", ":", "data", "=", "{", "'action'", ":", "'unsub'", "if", "unsubscribe", "else", "'sub'", ",", "'sr_name'", ":", "six", ".", "text_type", "(", "subreddit", ")", "}",...
ccef2af042566ad384977028cf0bde01bc524dda
train
patch_webbrowser
Some custom patches on top of the python webbrowser module to fix user reported bugs and limitations of the module.
rtv/objects.py
def patch_webbrowser(): """ Some custom patches on top of the python webbrowser module to fix user reported bugs and limitations of the module. """ # https://bugs.python.org/issue31014 # https://github.com/michael-lazar/rtv/issues/588 def register_patch(name, klass, instance=None, update_tr...
def patch_webbrowser(): """ Some custom patches on top of the python webbrowser module to fix user reported bugs and limitations of the module. """ # https://bugs.python.org/issue31014 # https://github.com/michael-lazar/rtv/issues/588 def register_patch(name, klass, instance=None, update_tr...
[ "Some", "custom", "patches", "on", "top", "of", "the", "python", "webbrowser", "module", "to", "fix", "user", "reported", "bugs", "and", "limitations", "of", "the", "module", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/objects.py#L28-L72
[ "def", "patch_webbrowser", "(", ")", ":", "# https://bugs.python.org/issue31014", "# https://github.com/michael-lazar/rtv/issues/588", "def", "register_patch", "(", "name", ",", "klass", ",", "instance", "=", "None", ",", "update_tryorder", "=", "None", ",", "preferred", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
curses_session
Setup terminal and initialize curses. Most of this copied from curses.wrapper in order to convert the wrapper into a context manager.
rtv/objects.py
def curses_session(): """ Setup terminal and initialize curses. Most of this copied from curses.wrapper in order to convert the wrapper into a context manager. """ try: # Curses must wait for some time after the Escape key is pressed to # check if it is the beginning of an escape se...
def curses_session(): """ Setup terminal and initialize curses. Most of this copied from curses.wrapper in order to convert the wrapper into a context manager. """ try: # Curses must wait for some time after the Escape key is pressed to # check if it is the beginning of an escape se...
[ "Setup", "terminal", "and", "initialize", "curses", ".", "Most", "of", "this", "copied", "from", "curses", ".", "wrapper", "in", "order", "to", "convert", "the", "wrapper", "into", "a", "context", "manager", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/objects.py#L76-L125
[ "def", "curses_session", "(", ")", ":", "try", ":", "# Curses must wait for some time after the Escape key is pressed to", "# check if it is the beginning of an escape sequence indicating a", "# special key. The default wait time is 1 second, which means that", "# http://stackoverflow.com/questi...
ccef2af042566ad384977028cf0bde01bc524dda
train
Navigator.move
Move the cursor up or down by the given increment. Params: direction (int): `1` will move the cursor down one item and `-1` will move the cursor up one item. n_windows (int): The number of items that are currently being drawn on the screen. Retur...
rtv/objects.py
def move(self, direction, n_windows): """ Move the cursor up or down by the given increment. Params: direction (int): `1` will move the cursor down one item and `-1` will move the cursor up one item. n_windows (int): The number of items that are currently...
def move(self, direction, n_windows): """ Move the cursor up or down by the given increment. Params: direction (int): `1` will move the cursor down one item and `-1` will move the cursor up one item. n_windows (int): The number of items that are currently...
[ "Move", "the", "cursor", "up", "or", "down", "by", "the", "given", "increment", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/objects.py#L377-L439
[ "def", "move", "(", "self", ",", "direction", ",", "n_windows", ")", ":", "assert", "direction", "in", "(", "-", "1", ",", "1", ")", "valid", ",", "redraw", "=", "True", ",", "False", "forward", "=", "(", "(", "direction", "*", "self", ".", "step",...
ccef2af042566ad384977028cf0bde01bc524dda
train
Navigator.move_page
Move the page down (positive direction) or up (negative direction). Paging down: The post on the bottom of the page becomes the post at the top of the page and the cursor is moved to the top. Paging up: The post at the top of the page becomes the post at the bottom o...
rtv/objects.py
def move_page(self, direction, n_windows): """ Move the page down (positive direction) or up (negative direction). Paging down: The post on the bottom of the page becomes the post at the top of the page and the cursor is moved to the top. Paging up: T...
def move_page(self, direction, n_windows): """ Move the page down (positive direction) or up (negative direction). Paging down: The post on the bottom of the page becomes the post at the top of the page and the cursor is moved to the top. Paging up: T...
[ "Move", "the", "page", "down", "(", "positive", "direction", ")", "or", "up", "(", "negative", "direction", ")", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/objects.py#L441-L496
[ "def", "move_page", "(", "self", ",", "direction", ",", "n_windows", ")", ":", "assert", "direction", "in", "(", "-", "1", ",", "1", ")", "assert", "n_windows", ">=", "0", "# top of subreddit/submission page or only one", "# submission/reply on the screen: act as norm...
ccef2af042566ad384977028cf0bde01bc524dda
train
Navigator.flip
Flip the orientation of the page.
rtv/objects.py
def flip(self, n_windows): """ Flip the orientation of the page. """ assert n_windows >= 0 self.page_index += (self.step * n_windows) self.cursor_index = n_windows self.inverted = not self.inverted self.top_item_height = None
def flip(self, n_windows): """ Flip the orientation of the page. """ assert n_windows >= 0 self.page_index += (self.step * n_windows) self.cursor_index = n_windows self.inverted = not self.inverted self.top_item_height = None
[ "Flip", "the", "orientation", "of", "the", "page", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/objects.py#L498-L507
[ "def", "flip", "(", "self", ",", "n_windows", ")", ":", "assert", "n_windows", ">=", "0", "self", ".", "page_index", "+=", "(", "self", ".", "step", "*", "n_windows", ")", "self", ".", "cursor_index", "=", "n_windows", "self", ".", "inverted", "=", "no...
ccef2af042566ad384977028cf0bde01bc524dda
train
KeyMap.parse
Parse a key represented by a string and return its character code.
rtv/objects.py
def parse(cls, key): """ Parse a key represented by a string and return its character code. """ try: if isinstance(key, int): return key elif re.match('[<]KEY_.*[>]', key): # Curses control character return getattr(...
def parse(cls, key): """ Parse a key represented by a string and return its character code. """ try: if isinstance(key, int): return key elif re.match('[<]KEY_.*[>]', key): # Curses control character return getattr(...
[ "Parse", "a", "key", "represented", "by", "a", "string", "and", "return", "its", "character", "code", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/objects.py#L677-L709
[ "def", "parse", "(", "cls", ",", "key", ")", ":", "try", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "key", "elif", "re", ".", "match", "(", "'[<]KEY_.*[>]'", ",", "key", ")", ":", "# Curses control character", "return", "getat...
ccef2af042566ad384977028cf0bde01bc524dda
train
BaseMIMEParser.get_mimetype
Guess based on the file extension. Args: url (text): Web url that was linked to by a reddit submission. Returns: modified_url (text): The url (or filename) that will be used when constructing the command to run. content_type (text): The mime-type tha...
rtv/mime_parsers.py
def get_mimetype(url): """ Guess based on the file extension. Args: url (text): Web url that was linked to by a reddit submission. Returns: modified_url (text): The url (or filename) that will be used when constructing the command to run. ...
def get_mimetype(url): """ Guess based on the file extension. Args: url (text): Web url that was linked to by a reddit submission. Returns: modified_url (text): The url (or filename) that will be used when constructing the command to run. ...
[ "Guess", "based", "on", "the", "file", "extension", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/mime_parsers.py#L19-L37
[ "def", "get_mimetype", "(", "url", ")", ":", "filename", "=", "url", ".", "split", "(", "'?'", ")", "[", "0", "]", "filename", "=", "filename", ".", "split", "(", "'#'", ")", "[", "0", "]", "content_type", ",", "_", "=", "mimetypes", ".", "guess_ty...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubredditPage.refresh_content
Re-download all submissions and reset the page index
rtv/subreddit_page.py
def refresh_content(self, order=None, name=None): """ Re-download all submissions and reset the page index """ order = order or self.content.order # Preserve the query if staying on the current page if name is None: query = self.content.query else: ...
def refresh_content(self, order=None, name=None): """ Re-download all submissions and reset the page index """ order = order or self.content.order # Preserve the query if staying on the current page if name is None: query = self.content.query else: ...
[ "Re", "-", "download", "all", "submissions", "and", "reset", "the", "page", "index" ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/subreddit_page.py#L50-L73
[ "def", "refresh_content", "(", "self", ",", "order", "=", "None", ",", "name", "=", "None", ")", ":", "order", "=", "order", "or", "self", ".", "content", ".", "order", "# Preserve the query if staying on the current page", "if", "name", "is", "None", ":", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubredditPage.search_subreddit
Open a prompt to search the given subreddit
rtv/subreddit_page.py
def search_subreddit(self, name=None): """ Open a prompt to search the given subreddit """ name = name or self.content.name query = self.term.prompt_input('Search {0}: '.format(name)) if not query: return with self.term.loader('Searching'): ...
def search_subreddit(self, name=None): """ Open a prompt to search the given subreddit """ name = name or self.content.name query = self.term.prompt_input('Search {0}: '.format(name)) if not query: return with self.term.loader('Searching'): ...
[ "Open", "a", "prompt", "to", "search", "the", "given", "subreddit" ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/subreddit_page.py#L124-L138
[ "def", "search_subreddit", "(", "self", ",", "name", "=", "None", ")", ":", "name", "=", "name", "or", "self", ".", "content", ".", "name", "query", "=", "self", ".", "term", ".", "prompt_input", "(", "'Search {0}: '", ".", "format", "(", "name", ")", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubredditPage.show_frontpage
If on a subreddit, remember it and head back to the front page. If this was pressed on the front page, go back to the last subreddit.
rtv/subreddit_page.py
def show_frontpage(self): """ If on a subreddit, remember it and head back to the front page. If this was pressed on the front page, go back to the last subreddit. """ if self.content.name != '/r/front': target = '/r/front' self.toggled_subreddit = self.c...
def show_frontpage(self): """ If on a subreddit, remember it and head back to the front page. If this was pressed on the front page, go back to the last subreddit. """ if self.content.name != '/r/front': target = '/r/front' self.toggled_subreddit = self.c...
[ "If", "on", "a", "subreddit", "remember", "it", "and", "head", "back", "to", "the", "front", "page", ".", "If", "this", "was", "pressed", "on", "the", "front", "page", "go", "back", "to", "the", "last", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/subreddit_page.py#L141-L155
[ "def", "show_frontpage", "(", "self", ")", ":", "if", "self", ".", "content", ".", "name", "!=", "'/r/front'", ":", "target", "=", "'/r/front'", "self", ".", "toggled_subreddit", "=", "self", ".", "content", ".", "name", "else", ":", "target", "=", "self...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubredditPage.open_submission
Select the current submission to view posts.
rtv/subreddit_page.py
def open_submission(self, url=None): """ Select the current submission to view posts. """ if url is None: data = self.get_selected_item() url = data['permalink'] if data.get('url_type') == 'selfpost': self.config.history.add(data['url_f...
def open_submission(self, url=None): """ Select the current submission to view posts. """ if url is None: data = self.get_selected_item() url = data['permalink'] if data.get('url_type') == 'selfpost': self.config.history.add(data['url_f...
[ "Select", "the", "current", "submission", "to", "view", "posts", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/subreddit_page.py#L158-L168
[ "def", "open_submission", "(", "self", ",", "url", "=", "None", ")", ":", "if", "url", "is", "None", ":", "data", "=", "self", ".", "get_selected_item", "(", ")", "url", "=", "data", "[", "'permalink'", "]", "if", "data", ".", "get", "(", "'url_type'...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubredditPage.open_link
Open a link with the webbrowser
rtv/subreddit_page.py
def open_link(self): """ Open a link with the webbrowser """ data = self.get_selected_item() if data['url_type'] == 'selfpost': self.open_submission() elif data['url_type'] == 'x-post subreddit': self.refresh_content(order='ignore', name=data['xpo...
def open_link(self): """ Open a link with the webbrowser """ data = self.get_selected_item() if data['url_type'] == 'selfpost': self.open_submission() elif data['url_type'] == 'x-post subreddit': self.refresh_content(order='ignore', name=data['xpo...
[ "Open", "a", "link", "with", "the", "webbrowser" ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/subreddit_page.py#L171-L186
[ "def", "open_link", "(", "self", ")", ":", "data", "=", "self", ".", "get_selected_item", "(", ")", "if", "data", "[", "'url_type'", "]", "==", "'selfpost'", ":", "self", ".", "open_submission", "(", ")", "elif", "data", "[", "'url_type'", "]", "==", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubredditPage.post_submission
Post a new submission to the given subreddit.
rtv/subreddit_page.py
def post_submission(self): """ Post a new submission to the given subreddit. """ # Check that the subreddit can be submitted to name = self.content.name if '+' in name or name in ('/r/all', '/r/front', '/r/me', '/u/saved'): self.term.show_notification("Can't p...
def post_submission(self): """ Post a new submission to the given subreddit. """ # Check that the subreddit can be submitted to name = self.content.name if '+' in name or name in ('/r/all', '/r/front', '/r/me', '/u/saved'): self.term.show_notification("Can't p...
[ "Post", "a", "new", "submission", "to", "the", "given", "subreddit", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/subreddit_page.py#L190-L220
[ "def", "post_submission", "(", "self", ")", ":", "# Check that the subreddit can be submitted to", "name", "=", "self", ".", "content", ".", "name", "if", "'+'", "in", "name", "or", "name", "in", "(", "'/r/all'", ",", "'/r/front'", ",", "'/r/me'", ",", "'/u/sa...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubmissionPage.refresh_content
Re-download comments and reset the page index
rtv/submission_page.py
def refresh_content(self, order=None, name=None): """ Re-download comments and reset the page index """ order = order or self.content.order url = name or self.content.name # Hack to allow an order specified in the name by prompt_subreddit() to # override the curr...
def refresh_content(self, order=None, name=None): """ Re-download comments and reset the page index """ order = order or self.content.order url = name or self.content.name # Hack to allow an order specified in the name by prompt_subreddit() to # override the curr...
[ "Re", "-", "download", "comments", "and", "reset", "the", "page", "index" ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/submission_page.py#L53-L70
[ "def", "refresh_content", "(", "self", ",", "order", "=", "None", ",", "name", "=", "None", ")", ":", "order", "=", "order", "or", "self", ".", "content", ".", "order", "url", "=", "name", "or", "self", ".", "content", ".", "name", "# Hack to allow an ...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubmissionPage.toggle_comment
Toggle the selected comment tree between visible and hidden
rtv/submission_page.py
def toggle_comment(self): """ Toggle the selected comment tree between visible and hidden """ current_index = self.nav.absolute_index self.content.toggle(current_index) # This logic handles a display edge case after a comment toggle. We # want to make sure that w...
def toggle_comment(self): """ Toggle the selected comment tree between visible and hidden """ current_index = self.nav.absolute_index self.content.toggle(current_index) # This logic handles a display edge case after a comment toggle. We # want to make sure that w...
[ "Toggle", "the", "selected", "comment", "tree", "between", "visible", "and", "hidden" ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/submission_page.py#L93-L111
[ "def", "toggle_comment", "(", "self", ")", ":", "current_index", "=", "self", ".", "nav", ".", "absolute_index", "self", ".", "content", ".", "toggle", "(", "current_index", ")", "# This logic handles a display edge case after a comment toggle. We", "# want to make sure t...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubmissionPage.open_link
Open the link contained in the selected item. If there is more than one link contained in the item, prompt the user to choose which link to open.
rtv/submission_page.py
def open_link(self): """ Open the link contained in the selected item. If there is more than one link contained in the item, prompt the user to choose which link to open. """ data = self.get_selected_item() if data['type'] == 'Submission': link = self...
def open_link(self): """ Open the link contained in the selected item. If there is more than one link contained in the item, prompt the user to choose which link to open. """ data = self.get_selected_item() if data['type'] == 'Submission': link = self...
[ "Open", "the", "link", "contained", "in", "the", "selected", "item", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/submission_page.py#L121-L139
[ "def", "open_link", "(", "self", ")", ":", "data", "=", "self", ".", "get_selected_item", "(", ")", "if", "data", "[", "'type'", "]", "==", "'Submission'", ":", "link", "=", "self", ".", "prompt_and_select_link", "(", ")", "if", "link", ":", "self", "....
ccef2af042566ad384977028cf0bde01bc524dda
train
SubmissionPage.open_pager
Open the selected item with the system's pager
rtv/submission_page.py
def open_pager(self): """ Open the selected item with the system's pager """ n_rows, n_cols = self.term.stdscr.getmaxyx() if self.config['max_pager_cols'] is not None: n_cols = min(n_cols, self.config['max_pager_cols']) data = self.get_selected_item() ...
def open_pager(self): """ Open the selected item with the system's pager """ n_rows, n_cols = self.term.stdscr.getmaxyx() if self.config['max_pager_cols'] is not None: n_cols = min(n_cols, self.config['max_pager_cols']) data = self.get_selected_item() ...
[ "Open", "the", "selected", "item", "with", "the", "system", "s", "pager" ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/submission_page.py#L142-L159
[ "def", "open_pager", "(", "self", ")", ":", "n_rows", ",", "n_cols", "=", "self", ".", "term", ".", "stdscr", ".", "getmaxyx", "(", ")", "if", "self", ".", "config", "[", "'max_pager_cols'", "]", "is", "not", "None", ":", "n_cols", "=", "min", "(", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubmissionPage.comment_urlview
Open the selected comment with the URL viewer
rtv/submission_page.py
def comment_urlview(self): """ Open the selected comment with the URL viewer """ data = self.get_selected_item() comment = data.get('body') or data.get('text') or data.get('url_full') if comment: self.term.open_urlview(comment) else: self.t...
def comment_urlview(self): """ Open the selected comment with the URL viewer """ data = self.get_selected_item() comment = data.get('body') or data.get('text') or data.get('url_full') if comment: self.term.open_urlview(comment) else: self.t...
[ "Open", "the", "selected", "comment", "with", "the", "URL", "viewer" ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/submission_page.py#L181-L190
[ "def", "comment_urlview", "(", "self", ")", ":", "data", "=", "self", ".", "get_selected_item", "(", ")", "comment", "=", "data", ".", "get", "(", "'body'", ")", "or", "data", ".", "get", "(", "'text'", ")", "or", "data", ".", "get", "(", "'url_full'...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubmissionPage.move_parent_up
Move the cursor up to the comment's parent. If the comment is top-level, jump to the previous top-level comment.
rtv/submission_page.py
def move_parent_up(self): """ Move the cursor up to the comment's parent. If the comment is top-level, jump to the previous top-level comment. """ cursor = self.nav.absolute_index if cursor > 0: level = max(self.content.get(cursor)['level'], 1) whi...
def move_parent_up(self): """ Move the cursor up to the comment's parent. If the comment is top-level, jump to the previous top-level comment. """ cursor = self.nav.absolute_index if cursor > 0: level = max(self.content.get(cursor)['level'], 1) whi...
[ "Move", "the", "cursor", "up", "to", "the", "comment", "s", "parent", ".", "If", "the", "comment", "is", "top", "-", "level", "jump", "to", "the", "previous", "top", "-", "level", "comment", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/submission_page.py#L193-L208
[ "def", "move_parent_up", "(", "self", ")", ":", "cursor", "=", "self", ".", "nav", ".", "absolute_index", "if", "cursor", ">", "0", ":", "level", "=", "max", "(", "self", ".", "content", ".", "get", "(", "cursor", ")", "[", "'level'", "]", ",", "1"...
ccef2af042566ad384977028cf0bde01bc524dda
train
SubmissionPage.move_sibling_next
Jump to the next comment that's at the same level as the selected comment and shares the same parent.
rtv/submission_page.py
def move_sibling_next(self): """ Jump to the next comment that's at the same level as the selected comment and shares the same parent. """ cursor = self.nav.absolute_index if cursor >= 0: level = self.content.get(cursor)['level'] try: ...
def move_sibling_next(self): """ Jump to the next comment that's at the same level as the selected comment and shares the same parent. """ cursor = self.nav.absolute_index if cursor >= 0: level = self.content.get(cursor)['level'] try: ...
[ "Jump", "to", "the", "next", "comment", "that", "s", "at", "the", "same", "level", "as", "the", "selected", "comment", "and", "shares", "the", "same", "parent", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/submission_page.py#L211-L234
[ "def", "move_sibling_next", "(", "self", ")", ":", "cursor", "=", "self", ".", "nav", ".", "absolute_index", "if", "cursor", ">=", "0", ":", "level", "=", "self", ".", "content", ".", "get", "(", "cursor", ")", "[", "'level'", "]", "try", ":", "move"...
ccef2af042566ad384977028cf0bde01bc524dda
train
_get_redditor_listing
Return function to generate Redditor listings.
rtv/packages/praw/internal.py
def _get_redditor_listing(subpath=''): """Return function to generate Redditor listings.""" def _listing(self, sort='new', time='all', *args, **kwargs): """Return a get_content generator for some RedditContentObject type. :param sort: Specify the sort order of the results if applicable ...
def _get_redditor_listing(subpath=''): """Return function to generate Redditor listings.""" def _listing(self, sort='new', time='all', *args, **kwargs): """Return a get_content generator for some RedditContentObject type. :param sort: Specify the sort order of the results if applicable ...
[ "Return", "function", "to", "generate", "Redditor", "listings", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/internal.py#L49-L69
[ "def", "_get_redditor_listing", "(", "subpath", "=", "''", ")", ":", "def", "_listing", "(", "self", ",", "sort", "=", "'new'", ",", "time", "=", "'all'", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"Return a get_content generator for some Red...
ccef2af042566ad384977028cf0bde01bc524dda
train
_get_sorter
Return function to generate specific subreddit Submission listings.
rtv/packages/praw/internal.py
def _get_sorter(subpath='', **defaults): """Return function to generate specific subreddit Submission listings.""" @restrict_access(scope='read') def _sorted(self, *args, **kwargs): """Return a get_content generator for some RedditContentObject type. The additional parameters are passed dir...
def _get_sorter(subpath='', **defaults): """Return function to generate specific subreddit Submission listings.""" @restrict_access(scope='read') def _sorted(self, *args, **kwargs): """Return a get_content generator for some RedditContentObject type. The additional parameters are passed dir...
[ "Return", "function", "to", "generate", "specific", "subreddit", "Submission", "listings", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/internal.py#L72-L88
[ "def", "_get_sorter", "(", "subpath", "=", "''", ",", "*", "*", "defaults", ")", ":", "@", "restrict_access", "(", "scope", "=", "'read'", ")", "def", "_sorted", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"Return a get_cont...
ccef2af042566ad384977028cf0bde01bc524dda
train
_modify_relationship
Return a function for relationship modification. Used to support friending (user-to-user), as well as moderating, contributor creating, and banning (user-to-subreddit).
rtv/packages/praw/internal.py
def _modify_relationship(relationship, unlink=False, is_sub=False): """Return a function for relationship modification. Used to support friending (user-to-user), as well as moderating, contributor creating, and banning (user-to-subreddit). """ # The API uses friend and unfriend to manage all of th...
def _modify_relationship(relationship, unlink=False, is_sub=False): """Return a function for relationship modification. Used to support friending (user-to-user), as well as moderating, contributor creating, and banning (user-to-subreddit). """ # The API uses friend and unfriend to manage all of th...
[ "Return", "a", "function", "for", "relationship", "modification", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/internal.py#L109-L146
[ "def", "_modify_relationship", "(", "relationship", ",", "unlink", "=", "False", ",", "is_sub", "=", "False", ")", ":", "# The API uses friend and unfriend to manage all of these relationships.", "url_key", "=", "'unfriend'", "if", "unlink", "else", "'friend'", "if", "r...
ccef2af042566ad384977028cf0bde01bc524dda
train
_prepare_request
Return a requests Request object that can be "prepared".
rtv/packages/praw/internal.py
def _prepare_request(reddit_session, url, params, data, auth, files, method=None): """Return a requests Request object that can be "prepared".""" # Requests using OAuth for authorization must switch to using the oauth # domain. if getattr(reddit_session, '_use_oauth', False): ...
def _prepare_request(reddit_session, url, params, data, auth, files, method=None): """Return a requests Request object that can be "prepared".""" # Requests using OAuth for authorization must switch to using the oauth # domain. if getattr(reddit_session, '_use_oauth', False): ...
[ "Return", "a", "requests", "Request", "object", "that", "can", "be", "prepared", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/internal.py#L149-L206
[ "def", "_prepare_request", "(", "reddit_session", ",", "url", ",", "params", ",", "data", ",", "auth", ",", "files", ",", "method", "=", "None", ")", ":", "# Requests using OAuth for authorization must switch to using the oauth", "# domain.", "if", "getattr", "(", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
_raise_redirect_exceptions
Return the new url or None if there are no redirects. Raise exceptions if appropriate.
rtv/packages/praw/internal.py
def _raise_redirect_exceptions(response): """Return the new url or None if there are no redirects. Raise exceptions if appropriate. """ if response.status_code not in [301, 302, 307]: return None new_url = urljoin(response.url, response.headers['location']) if 'reddits/search' in new_u...
def _raise_redirect_exceptions(response): """Return the new url or None if there are no redirects. Raise exceptions if appropriate. """ if response.status_code not in [301, 302, 307]: return None new_url = urljoin(response.url, response.headers['location']) if 'reddits/search' in new_u...
[ "Return", "the", "new", "url", "or", "None", "if", "there", "are", "no", "redirects", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/internal.py#L209-L224
[ "def", "_raise_redirect_exceptions", "(", "response", ")", ":", "if", "response", ".", "status_code", "not", "in", "[", "301", ",", "302", ",", "307", "]", ":", "return", "None", "new_url", "=", "urljoin", "(", "response", ".", "url", ",", "response", "....
ccef2af042566ad384977028cf0bde01bc524dda
train
_raise_response_exceptions
Raise specific errors on some status codes.
rtv/packages/praw/internal.py
def _raise_response_exceptions(response): """Raise specific errors on some status codes.""" if not response.ok and 'www-authenticate' in response.headers: msg = response.headers['www-authenticate'] if 'insufficient_scope' in msg: raise OAuthInsufficientScope('insufficient_scope', res...
def _raise_response_exceptions(response): """Raise specific errors on some status codes.""" if not response.ok and 'www-authenticate' in response.headers: msg = response.headers['www-authenticate'] if 'insufficient_scope' in msg: raise OAuthInsufficientScope('insufficient_scope', res...
[ "Raise", "specific", "errors", "on", "some", "status", "codes", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/internal.py#L227-L246
[ "def", "_raise_response_exceptions", "(", "response", ")", ":", "if", "not", "response", ".", "ok", "and", "'www-authenticate'", "in", "response", ".", "headers", ":", "msg", "=", "response", ".", "headers", "[", "'www-authenticate'", "]", "if", "'insufficient_s...
ccef2af042566ad384977028cf0bde01bc524dda
train
_to_reddit_list
Return an argument converted to a reddit-formatted list. The returned format is a comma deliminated list. Each element is a string representation of an object. Either given as a string or as an object that is then converted to its string representation.
rtv/packages/praw/internal.py
def _to_reddit_list(arg): """Return an argument converted to a reddit-formatted list. The returned format is a comma deliminated list. Each element is a string representation of an object. Either given as a string or as an object that is then converted to its string representation. """ if (isin...
def _to_reddit_list(arg): """Return an argument converted to a reddit-formatted list. The returned format is a comma deliminated list. Each element is a string representation of an object. Either given as a string or as an object that is then converted to its string representation. """ if (isin...
[ "Return", "an", "argument", "converted", "to", "a", "reddit", "-", "formatted", "list", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/internal.py#L249-L260
[ "def", "_to_reddit_list", "(", "arg", ")", ":", "if", "(", "isinstance", "(", "arg", ",", "six", ".", "string_types", ")", "or", "not", "(", "hasattr", "(", "arg", ",", "\"__getitem__\"", ")", "or", "hasattr", "(", "arg", ",", "\"__iter__\"", ")", ")",...
ccef2af042566ad384977028cf0bde01bc524dda
train
_get_captcha
Prompt user for captcha solution and return a prepared result.
rtv/packages/praw/decorator_helpers.py
def _get_captcha(reddit_session, captcha_id): """Prompt user for captcha solution and return a prepared result.""" url = urljoin(reddit_session.config['captcha'], captcha_id + '.png') sys.stdout.write('Captcha URL: {0}\nCaptcha: '.format(url)) sys.stdout.flush() raw = sys.stdin.rea...
def _get_captcha(reddit_session, captcha_id): """Prompt user for captcha solution and return a prepared result.""" url = urljoin(reddit_session.config['captcha'], captcha_id + '.png') sys.stdout.write('Captcha URL: {0}\nCaptcha: '.format(url)) sys.stdout.flush() raw = sys.stdin.rea...
[ "Prompt", "user", "for", "captcha", "solution", "and", "return", "a", "prepared", "result", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/decorator_helpers.py#L8-L20
[ "def", "_get_captcha", "(", "reddit_session", ",", "captcha_id", ")", ":", "url", "=", "urljoin", "(", "reddit_session", ".", "config", "[", "'captcha'", "]", ",", "captcha_id", "+", "'.png'", ")", "sys", ".", "stdout", ".", "write", "(", "'Captcha URL: {0}\...
ccef2af042566ad384977028cf0bde01bc524dda
train
RateLimitHandler.rate_limit
Return a decorator that enforces API request limit guidelines. We are allowed to make a API request every api_request_delay seconds as specified in praw.ini. This value may differ from reddit to reddit. For reddit.com it is 2. Any function decorated with this will be forced to delay _ra...
rtv/packages/praw/handlers.py
def rate_limit(function): """Return a decorator that enforces API request limit guidelines. We are allowed to make a API request every api_request_delay seconds as specified in praw.ini. This value may differ from reddit to reddit. For reddit.com it is 2. Any function decorated with thi...
def rate_limit(function): """Return a decorator that enforces API request limit guidelines. We are allowed to make a API request every api_request_delay seconds as specified in praw.ini. This value may differ from reddit to reddit. For reddit.com it is 2. Any function decorated with thi...
[ "Return", "a", "decorator", "that", "enforces", "API", "request", "limit", "guidelines", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/handlers.py#L30-L57
[ "def", "rate_limit", "(", "function", ")", ":", "@", "wraps", "(", "function", ")", "def", "wrapped", "(", "cls", ",", "_rate_domain", ",", "_rate_delay", ",", "*", "*", "kwargs", ")", ":", "cls", ".", "rl_lock", ".", "acquire", "(", ")", "lock_last", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
RateLimitHandler.request
Responsible for dispatching the request and returning the result. Network level exceptions should be raised and only ``requests.Response`` should be returned. :param request: A ``requests.PreparedRequest`` object containing all the data necessary to perform the request. :pa...
rtv/packages/praw/handlers.py
def request(self, request, proxies, timeout, verify, **_): """Responsible for dispatching the request and returning the result. Network level exceptions should be raised and only ``requests.Response`` should be returned. :param request: A ``requests.PreparedRequest`` object containing ...
def request(self, request, proxies, timeout, verify, **_): """Responsible for dispatching the request and returning the result. Network level exceptions should be raised and only ``requests.Response`` should be returned. :param request: A ``requests.PreparedRequest`` object containing ...
[ "Responsible", "for", "dispatching", "the", "request", "and", "returning", "the", "result", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/handlers.py#L83-L105
[ "def", "request", "(", "self", ",", "request", ",", "proxies", ",", "timeout", ",", "verify", ",", "*", "*", "_", ")", ":", "settings", "=", "self", ".", "http", ".", "merge_environment_settings", "(", "request", ".", "url", ",", "proxies", ",", "False...
ccef2af042566ad384977028cf0bde01bc524dda
train
DefaultHandler.with_cache
Return a decorator that interacts with a handler's cache. This decorator must be applied to a DefaultHandler class method or instance method as it assumes `cache`, `ca_lock` and `timeouts` are available.
rtv/packages/praw/handlers.py
def with_cache(function): """Return a decorator that interacts with a handler's cache. This decorator must be applied to a DefaultHandler class method or instance method as it assumes `cache`, `ca_lock` and `timeouts` are available. """ @wraps(function) def wrap...
def with_cache(function): """Return a decorator that interacts with a handler's cache. This decorator must be applied to a DefaultHandler class method or instance method as it assumes `cache`, `ca_lock` and `timeouts` are available. """ @wraps(function) def wrap...
[ "Return", "a", "decorator", "that", "interacts", "with", "a", "handler", "s", "cache", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/handlers.py#L120-L160
[ "def", "with_cache", "(", "function", ")", ":", "@", "wraps", "(", "function", ")", "def", "wrapped", "(", "cls", ",", "_cache_key", ",", "_cache_ignore", ",", "_cache_timeout", ",", "*", "*", "kwargs", ")", ":", "def", "clear_timeouts", "(", ")", ":", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
DefaultHandler.evict
Remove items from cache matching URLs. Return the number of items removed.
rtv/packages/praw/handlers.py
def evict(cls, urls): """Remove items from cache matching URLs. Return the number of items removed. """ if isinstance(urls, text_type): urls = [urls] urls = set(normalize_url(url) for url in urls) retval = 0 with cls.ca_lock: for key in l...
def evict(cls, urls): """Remove items from cache matching URLs. Return the number of items removed. """ if isinstance(urls, text_type): urls = [urls] urls = set(normalize_url(url) for url in urls) retval = 0 with cls.ca_lock: for key in l...
[ "Remove", "items", "from", "cache", "matching", "URLs", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/handlers.py#L170-L186
[ "def", "evict", "(", "cls", ",", "urls", ")", ":", "if", "isinstance", "(", "urls", ",", "text_type", ")", ":", "urls", "=", "[", "urls", "]", "urls", "=", "set", "(", "normalize_url", "(", "url", ")", "for", "url", "in", "urls", ")", "retval", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
MultiprocessHandler._relay
Send the request through the server and return the HTTP response.
rtv/packages/praw/handlers.py
def _relay(self, **kwargs): """Send the request through the server and return the HTTP response.""" retval = None delay_time = 2 # For connection retries read_attempts = 0 # For reading from socket while retval is None: # Evict can return False sock = socket.socket...
def _relay(self, **kwargs): """Send the request through the server and return the HTTP response.""" retval = None delay_time = 2 # For connection retries read_attempts = 0 # For reading from socket while retval is None: # Evict can return False sock = socket.socket...
[ "Send", "the", "request", "through", "the", "server", "and", "return", "the", "HTTP", "response", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/handlers.py#L198-L235
[ "def", "_relay", "(", "self", ",", "*", "*", "kwargs", ")", ":", "retval", "=", "None", "delay_time", "=", "2", "# For connection retries", "read_attempts", "=", "0", "# For reading from socket", "while", "retval", "is", "None", ":", "# Evict can return False", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
_load_configuration
Attempt to load settings from various praw.ini files.
rtv/packages/praw/settings.py
def _load_configuration(): """Attempt to load settings from various praw.ini files.""" config = configparser.RawConfigParser() module_dir = os.path.dirname(sys.modules[__name__].__file__) if 'APPDATA' in os.environ: # Windows os_config_path = os.environ['APPDATA'] elif 'XDG_CONFIG_HOME' in ...
def _load_configuration(): """Attempt to load settings from various praw.ini files.""" config = configparser.RawConfigParser() module_dir = os.path.dirname(sys.modules[__name__].__file__) if 'APPDATA' in os.environ: # Windows os_config_path = os.environ['APPDATA'] elif 'XDG_CONFIG_HOME' in ...
[ "Attempt", "to", "load", "settings", "from", "various", "praw", ".", "ini", "files", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/settings.py#L25-L43
[ "def", "_load_configuration", "(", ")", ":", "config", "=", "configparser", ".", "RawConfigParser", "(", ")", "module_dir", "=", "os", ".", "path", ".", "dirname", "(", "sys", ".", "modules", "[", "__name__", "]", ".", "__file__", ")", "if", "'APPDATA'", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
Theme.bind_curses
Bind the theme's colors to curses's internal color pair map. This method must be called once (after curses has been initialized) before any element attributes can be accessed. Color codes and other special attributes will be mixed bitwise into a single value that can be passed into curs...
rtv/theme.py
def bind_curses(self): """ Bind the theme's colors to curses's internal color pair map. This method must be called once (after curses has been initialized) before any element attributes can be accessed. Color codes and other special attributes will be mixed bitwise into a single...
def bind_curses(self): """ Bind the theme's colors to curses's internal color pair map. This method must be called once (after curses has been initialized) before any element attributes can be accessed. Color codes and other special attributes will be mixed bitwise into a single...
[ "Bind", "the", "theme", "s", "colors", "to", "curses", "s", "internal", "color", "pair", "map", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L225-L252
[ "def", "bind_curses", "(", "self", ")", ":", "self", ".", "_color_pair_map", "=", "{", "}", "self", ".", "_attribute_map", "=", "{", "}", "for", "element", ",", "item", "in", "self", ".", "elements", ".", "items", "(", ")", ":", "fg", ",", "bg", ",...
ccef2af042566ad384977028cf0bde01bc524dda
train
Theme.get
Returns the curses attribute code for the given element.
rtv/theme.py
def get(self, element, selected=False): """ Returns the curses attribute code for the given element. """ if self._attribute_map is None: raise RuntimeError('Attempted to access theme attribute before ' 'calling initialize_curses_theme()') ...
def get(self, element, selected=False): """ Returns the curses attribute code for the given element. """ if self._attribute_map is None: raise RuntimeError('Attempted to access theme attribute before ' 'calling initialize_curses_theme()') ...
[ "Returns", "the", "curses", "attribute", "code", "for", "the", "given", "element", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L254-L265
[ "def", "get", "(", "self", ",", "element", ",", "selected", "=", "False", ")", ":", "if", "self", ".", "_attribute_map", "is", "None", ":", "raise", "RuntimeError", "(", "'Attempted to access theme attribute before '", "'calling initialize_curses_theme()'", ")", "if...
ccef2af042566ad384977028cf0bde01bc524dda
train
Theme.list_themes
Compile all of the themes configuration files in the search path.
rtv/theme.py
def list_themes(cls, path=THEMES): """ Compile all of the themes configuration files in the search path. """ themes, errors = [], OrderedDict() def load_themes(path, source): """ Load all themes in the given path. """ if os.path.is...
def list_themes(cls, path=THEMES): """ Compile all of the themes configuration files in the search path. """ themes, errors = [], OrderedDict() def load_themes(path, source): """ Load all themes in the given path. """ if os.path.is...
[ "Compile", "all", "of", "the", "themes", "configuration", "files", "in", "the", "search", "path", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L293-L322
[ "def", "list_themes", "(", "cls", ",", "path", "=", "THEMES", ")", ":", "themes", ",", "errors", "=", "[", "]", ",", "OrderedDict", "(", ")", "def", "load_themes", "(", "path", ",", "source", ")", ":", "\"\"\"\n Load all themes in the given path.\n ...
ccef2af042566ad384977028cf0bde01bc524dda
train
Theme.print_themes
Prints a human-readable summary of the installed themes to stdout. This is intended to be used as a command-line utility, outside of the main curses display loop.
rtv/theme.py
def print_themes(cls, path=THEMES): """ Prints a human-readable summary of the installed themes to stdout. This is intended to be used as a command-line utility, outside of the main curses display loop. """ themes, errors = cls.list_themes(path=path + '/') print...
def print_themes(cls, path=THEMES): """ Prints a human-readable summary of the installed themes to stdout. This is intended to be used as a command-line utility, outside of the main curses display loop. """ themes, errors = cls.list_themes(path=path + '/') print...
[ "Prints", "a", "human", "-", "readable", "summary", "of", "the", "installed", "themes", "to", "stdout", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L325-L363
[ "def", "print_themes", "(", "cls", ",", "path", "=", "THEMES", ")", ":", "themes", ",", "errors", "=", "cls", ".", "list_themes", "(", "path", "=", "path", "+", "'/'", ")", "print", "(", "'\\nInstalled ({0}):'", ".", "format", "(", "path", ")", ")", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
Theme.from_name
Search for the given theme on the filesystem and attempt to load it. Directories will be checked in a pre-determined order. If the name is provided as an absolute file path, it will be loaded directly.
rtv/theme.py
def from_name(cls, name, path=THEMES): """ Search for the given theme on the filesystem and attempt to load it. Directories will be checked in a pre-determined order. If the name is provided as an absolute file path, it will be loaded directly. """ if os.path.isfile(nam...
def from_name(cls, name, path=THEMES): """ Search for the given theme on the filesystem and attempt to load it. Directories will be checked in a pre-determined order. If the name is provided as an absolute file path, it will be loaded directly. """ if os.path.isfile(nam...
[ "Search", "for", "the", "given", "theme", "on", "the", "filesystem", "and", "attempt", "to", "load", "it", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L366-L385
[ "def", "from_name", "(", "cls", ",", "name", ",", "path", "=", "THEMES", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", "name", ")", ":", "return", "cls", ".", "from_file", "(", "name", ",", "'custom'", ")", "filename", "=", "os", ".", "p...
ccef2af042566ad384977028cf0bde01bc524dda
train
Theme.from_file
Load a theme from the specified configuration file. Parameters: filename: The name of the filename to load. source: A description of where the theme was loaded from.
rtv/theme.py
def from_file(cls, filename, source): """ Load a theme from the specified configuration file. Parameters: filename: The name of the filename to load. source: A description of where the theme was loaded from. """ _logger.info('Loading theme %s', filename) ...
def from_file(cls, filename, source): """ Load a theme from the specified configuration file. Parameters: filename: The name of the filename to load. source: A description of where the theme was loaded from. """ _logger.info('Loading theme %s', filename) ...
[ "Load", "a", "theme", "from", "the", "specified", "configuration", "file", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L388-L423
[ "def", "from_file", "(", "cls", ",", "filename", ",", "source", ")", ":", "_logger", ".", "info", "(", "'Loading theme %s'", ",", "filename", ")", "try", ":", "config", "=", "configparser", ".", "ConfigParser", "(", ")", "config", ".", "optionxform", "=", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
Theme._parse_line
Parse a single line from a theme file. Format: <element>: <foreground> <background> <attributes>
rtv/theme.py
def _parse_line(cls, element, line, filename=None): """ Parse a single line from a theme file. Format: <element>: <foreground> <background> <attributes> """ items = line.split() if len(items) == 2: fg, bg, attrs = items[0], items[1], '' e...
def _parse_line(cls, element, line, filename=None): """ Parse a single line from a theme file. Format: <element>: <foreground> <background> <attributes> """ items = line.split() if len(items) == 2: fg, bg, attrs = items[0], items[1], '' e...
[ "Parse", "a", "single", "line", "from", "a", "theme", "file", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L426-L474
[ "def", "_parse_line", "(", "cls", ",", "element", ",", "line", ",", "filename", "=", "None", ")", ":", "items", "=", "line", ".", "split", "(", ")", "if", "len", "(", "items", ")", "==", "2", ":", "fg", ",", "bg", ",", "attrs", "=", "items", "[...
ccef2af042566ad384977028cf0bde01bc524dda
train
Theme._set_fallback
Helper function used to set the fallback attributes of an element when they are defined by the configuration as "None" or "-".
rtv/theme.py
def _set_fallback(elements, src_field, fallback, dest_field=None): """ Helper function used to set the fallback attributes of an element when they are defined by the configuration as "None" or "-". """ if dest_field is None: dest_field = src_field if isinstan...
def _set_fallback(elements, src_field, fallback, dest_field=None): """ Helper function used to set the fallback attributes of an element when they are defined by the configuration as "None" or "-". """ if dest_field is None: dest_field = src_field if isinstan...
[ "Helper", "function", "used", "to", "set", "the", "fallback", "attributes", "of", "an", "element", "when", "they", "are", "defined", "by", "the", "configuration", "as", "None", "or", "-", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L477-L492
[ "def", "_set_fallback", "(", "elements", ",", "src_field", ",", "fallback", ",", "dest_field", "=", "None", ")", ":", "if", "dest_field", "is", "None", ":", "dest_field", "=", "src_field", "if", "isinstance", "(", "fallback", ",", "six", ".", "string_types",...
ccef2af042566ad384977028cf0bde01bc524dda
train
Theme.rgb_to_ansi
Converts hex RGB to the 6x6x6 xterm color space Args: color (str): RGB color string in the format "#RRGGBB" Returns: str: ansi color string in the format "ansi_n", where n is between 16 and 230 Reference: https://github.com/chadj2/bash-ui/bl...
rtv/theme.py
def rgb_to_ansi(color): """ Converts hex RGB to the 6x6x6 xterm color space Args: color (str): RGB color string in the format "#RRGGBB" Returns: str: ansi color string in the format "ansi_n", where n is between 16 and 230 Reference: ...
def rgb_to_ansi(color): """ Converts hex RGB to the 6x6x6 xterm color space Args: color (str): RGB color string in the format "#RRGGBB" Returns: str: ansi color string in the format "ansi_n", where n is between 16 and 230 Reference: ...
[ "Converts", "hex", "RGB", "to", "the", "6x6x6", "xterm", "color", "space" ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L495-L520
[ "def", "rgb_to_ansi", "(", "color", ")", ":", "if", "color", "[", "0", "]", "!=", "'#'", "or", "len", "(", "color", ")", "!=", "7", ":", "return", "None", "try", ":", "r", "=", "round", "(", "int", "(", "color", "[", "1", ":", "3", "]", ",", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ThemeList._step
Traverse the list in the given direction and return the next theme
rtv/theme.py
def _step(self, theme, direction): """ Traverse the list in the given direction and return the next theme """ if not self.themes: self.reload() # Try to find the starting index key = (theme.source, theme.name) for i, val in enumerate(self.themes): ...
def _step(self, theme, direction): """ Traverse the list in the given direction and return the next theme """ if not self.themes: self.reload() # Try to find the starting index key = (theme.source, theme.name) for i, val in enumerate(self.themes): ...
[ "Traverse", "the", "list", "in", "the", "given", "direction", "and", "return", "the", "next", "theme" ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/theme.py#L540-L561
[ "def", "_step", "(", "self", ",", "theme", ",", "direction", ")", ":", "if", "not", "self", ".", "themes", ":", "self", ".", "reload", "(", ")", "# Try to find the starting index", "key", "=", "(", "theme", ".", "source", ",", "theme", ".", "name", ")"...
ccef2af042566ad384977028cf0bde01bc524dda
train
run
The entry point from the praw-multiprocess utility.
rtv/packages/praw/multiprocess.py
def run(): """The entry point from the praw-multiprocess utility.""" parser = OptionParser(version='%prog {0}'.format(__version__)) parser.add_option('-a', '--addr', default='localhost', help=('The address or host to listen on. Specify -a ' '0.0.0.0 to liste...
def run(): """The entry point from the praw-multiprocess utility.""" parser = OptionParser(version='%prog {0}'.format(__version__)) parser.add_option('-a', '--addr', default='localhost', help=('The address or host to listen on. Specify -a ' '0.0.0.0 to liste...
[ "The", "entry", "point", "from", "the", "praw", "-", "multiprocess", "utility", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/multiprocess.py#L79-L102
[ "def", "run", "(", ")", ":", "parser", "=", "OptionParser", "(", "version", "=", "'%prog {0}'", ".", "format", "(", "__version__", ")", ")", "parser", ".", "add_option", "(", "'-a'", ",", "'--addr'", ",", "default", "=", "'localhost'", ",", "help", "=", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
ThreadingTCPServer.handle_error
Mute tracebacks of common errors.
rtv/packages/praw/multiprocess.py
def handle_error(_, client_addr): """Mute tracebacks of common errors.""" exc_type, exc_value, _ = sys.exc_info() if exc_type is socket.error and exc_value[0] == 32: pass elif exc_type is cPickle.UnpicklingError: sys.stderr.write('Invalid connection from {0}\n' ...
def handle_error(_, client_addr): """Mute tracebacks of common errors.""" exc_type, exc_value, _ = sys.exc_info() if exc_type is socket.error and exc_value[0] == 32: pass elif exc_type is cPickle.UnpicklingError: sys.stderr.write('Invalid connection from {0}\n' ...
[ "Mute", "tracebacks", "of", "common", "errors", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/multiprocess.py#L22-L31
[ "def", "handle_error", "(", "_", ",", "client_addr", ")", ":", "exc_type", ",", "exc_value", ",", "_", "=", "sys", ".", "exc_info", "(", ")", "if", "exc_type", "is", "socket", ".", "error", "and", "exc_value", "[", "0", "]", "==", "32", ":", "pass", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
RequestHandler.do_request
Dispatch the actual request and return the result.
rtv/packages/praw/multiprocess.py
def do_request(self, request, proxies, timeout, **_): """Dispatch the actual request and return the result.""" print('{0} {1}'.format(request.method, request.url)) response = self.http.send(request, proxies=proxies, timeout=timeout, allow_redirects=False) ...
def do_request(self, request, proxies, timeout, **_): """Dispatch the actual request and return the result.""" print('{0} {1}'.format(request.method, request.url)) response = self.http.send(request, proxies=proxies, timeout=timeout, allow_redirects=False) ...
[ "Dispatch", "the", "actual", "request", "and", "return", "the", "result", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/multiprocess.py#L58-L64
[ "def", "do_request", "(", "self", ",", "request", ",", "proxies", ",", "timeout", ",", "*", "*", "_", ")", ":", "print", "(", "'{0} {1}'", ".", "format", "(", "request", ".", "method", ",", "request", ".", "url", ")", ")", "response", "=", "self", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
RequestHandler.handle
Parse the RPC, make the call, and pickle up the return value.
rtv/packages/praw/multiprocess.py
def handle(self): """Parse the RPC, make the call, and pickle up the return value.""" data = cPickle.load(self.rfile) # pylint: disable=E1101 method = data.pop('method') try: retval = getattr(self, 'do_{0}'.format(method))(**data) except Exception as e: #...
def handle(self): """Parse the RPC, make the call, and pickle up the return value.""" data = cPickle.load(self.rfile) # pylint: disable=E1101 method = data.pop('method') try: retval = getattr(self, 'do_{0}'.format(method))(**data) except Exception as e: #...
[ "Parse", "the", "RPC", "make", "the", "call", "and", "pickle", "up", "the", "return", "value", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/packages/praw/multiprocess.py#L66-L76
[ "def", "handle", "(", "self", ")", ":", "data", "=", "cPickle", ".", "load", "(", "self", ".", "rfile", ")", "# pylint: disable=E1101", "method", "=", "data", ".", "pop", "(", "'method'", ")", "try", ":", "retval", "=", "getattr", "(", "self", ",", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
_copy_settings_file
Copy a file from the repo to the user's home directory.
rtv/config.py
def _copy_settings_file(source, destination, name): """ Copy a file from the repo to the user's home directory. """ if os.path.exists(destination): try: ch = six.moves.input( 'File %s already exists, overwrite? y/[n]):' % destination) if ch not in ('Y', '...
def _copy_settings_file(source, destination, name): """ Copy a file from the repo to the user's home directory. """ if os.path.exists(destination): try: ch = six.moves.input( 'File %s already exists, overwrite? y/[n]):' % destination) if ch not in ('Y', '...
[ "Copy", "a", "file", "from", "the", "repo", "to", "the", "user", "s", "home", "directory", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/config.py#L107-L127
[ "def", "_copy_settings_file", "(", "source", ",", "destination", ",", "name", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "destination", ")", ":", "try", ":", "ch", "=", "six", ".", "moves", ".", "input", "(", "'File %s already exists, overwrite...
ccef2af042566ad384977028cf0bde01bc524dda
train
Config.get_args
Load settings from the command line.
rtv/config.py
def get_args(): """ Load settings from the command line. """ parser = build_parser() args = vars(parser.parse_args()) # Overwrite the deprecated "-l" option into the link variable if args['link_deprecated'] and args['link'] is None: args['link'] = ar...
def get_args(): """ Load settings from the command line. """ parser = build_parser() args = vars(parser.parse_args()) # Overwrite the deprecated "-l" option into the link variable if args['link_deprecated'] and args['link'] is None: args['link'] = ar...
[ "Load", "settings", "from", "the", "command", "line", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/config.py#L225-L239
[ "def", "get_args", "(", ")", ":", "parser", "=", "build_parser", "(", ")", "args", "=", "vars", "(", "parser", ".", "parse_args", "(", ")", ")", "# Overwrite the deprecated \"-l\" option into the link variable", "if", "args", "[", "'link_deprecated'", "]", "and", ...
ccef2af042566ad384977028cf0bde01bc524dda
train
Config.get_file
Load settings from an rtv configuration file.
rtv/config.py
def get_file(cls, filename=None): """ Load settings from an rtv configuration file. """ if filename is None: filename = CONFIG config = configparser.ConfigParser() if os.path.exists(filename): with codecs.open(filename, encoding='utf-8') as fp: ...
def get_file(cls, filename=None): """ Load settings from an rtv configuration file. """ if filename is None: filename = CONFIG config = configparser.ConfigParser() if os.path.exists(filename): with codecs.open(filename, encoding='utf-8') as fp: ...
[ "Load", "settings", "from", "an", "rtv", "configuration", "file", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/config.py#L242-L255
[ "def", "get_file", "(", "cls", ",", "filename", "=", "None", ")", ":", "if", "filename", "is", "None", ":", "filename", "=", "CONFIG", "config", "=", "configparser", ".", "ConfigParser", "(", ")", "if", "os", ".", "path", ".", "exists", "(", "filename"...
ccef2af042566ad384977028cf0bde01bc524dda
train
Config._ensure_filepath
Ensure that the directory exists before trying to write to the file.
rtv/config.py
def _ensure_filepath(filename): """ Ensure that the directory exists before trying to write to the file. """ filepath = os.path.dirname(filename) if not os.path.exists(filepath): os.makedirs(filepath)
def _ensure_filepath(filename): """ Ensure that the directory exists before trying to write to the file. """ filepath = os.path.dirname(filename) if not os.path.exists(filepath): os.makedirs(filepath)
[ "Ensure", "that", "the", "directory", "exists", "before", "trying", "to", "write", "to", "the", "file", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/config.py#L296-L303
[ "def", "_ensure_filepath", "(", "filename", ")", ":", "filepath", "=", "os", ".", "path", ".", "dirname", "(", "filename", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "filepath", ")", ":", "os", ".", "makedirs", "(", "filepath", ")" ]
ccef2af042566ad384977028cf0bde01bc524dda
train
InboxPage.handle_selected_page
Open the subscription and submission pages subwindows, but close the current page if any other type of page is selected.
rtv/inbox_page.py
def handle_selected_page(self): """ Open the subscription and submission pages subwindows, but close the current page if any other type of page is selected. """ if not self.selected_page: pass if self.selected_page.name in ('subscription', 'submission'): ...
def handle_selected_page(self): """ Open the subscription and submission pages subwindows, but close the current page if any other type of page is selected. """ if not self.selected_page: pass if self.selected_page.name in ('subscription', 'submission'): ...
[ "Open", "the", "subscription", "and", "submission", "pages", "subwindows", "but", "close", "the", "current", "page", "if", "any", "other", "type", "of", "page", "is", "selected", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/inbox_page.py#L28-L42
[ "def", "handle_selected_page", "(", "self", ")", ":", "if", "not", "self", ".", "selected_page", ":", "pass", "if", "self", ".", "selected_page", ".", "name", "in", "(", "'subscription'", ",", "'submission'", ")", ":", "# Launch page in a subwindow", "self", "...
ccef2af042566ad384977028cf0bde01bc524dda
train
InboxPage.mark_seen
Mark the selected message or comment as seen.
rtv/inbox_page.py
def mark_seen(self): """ Mark the selected message or comment as seen. """ data = self.get_selected_item() if data['is_new']: with self.term.loader('Marking as read'): data['object'].mark_as_read() if not self.term.loader.exception: ...
def mark_seen(self): """ Mark the selected message or comment as seen. """ data = self.get_selected_item() if data['is_new']: with self.term.loader('Marking as read'): data['object'].mark_as_read() if not self.term.loader.exception: ...
[ "Mark", "the", "selected", "message", "or", "comment", "as", "seen", "." ]
michael-lazar/rtv
python
https://github.com/michael-lazar/rtv/blob/ccef2af042566ad384977028cf0bde01bc524dda/rtv/inbox_page.py#L87-L101
[ "def", "mark_seen", "(", "self", ")", ":", "data", "=", "self", ".", "get_selected_item", "(", ")", "if", "data", "[", "'is_new'", "]", ":", "with", "self", ".", "term", ".", "loader", "(", "'Marking as read'", ")", ":", "data", "[", "'object'", "]", ...
ccef2af042566ad384977028cf0bde01bc524dda