index int64 0 50.7k | project_path stringclasses 279
values | completion_path stringlengths 57 199 | signature_postion stringlengths 3 11 | class_position stringlengths 3 11 | function_name stringlengths 1 62 | class_name stringlengths 0 55 | body_position stringlengths 3 11 | body_position_with_comments stringlengths 3 11 | masked_class stringlengths 14 8.32k | masked_class_with_comment stringlengths 14 8.32k | func_body stringlengths 9 6.72k | func_body_with_comment stringlengths 9 6.72k | len_func_body int64 1 643 | len_input int64 10 2.02k | len_output int64 4 1.9k | total int64 20 2.05k | file_code stringlengths 14 442k | file_code_with_comment stringlengths 14 442k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
49,364 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 527,528 | 524,552 | editField | EditFieldMixin | 544,552 | 528,552 | class EditFieldMixin:
""" Mixin for editing Plex object fields. """
def editField(self, field, value, locked=True, **kwargs):
FILL_FUNC_BODY | class EditFieldMixin:
""" Mixin for editing Plex object fields. """
def editField(self, field, value, locked=True, **kwargs):
""" Edit the field of a Plex object. All field editing methods can be chained together.
Also see :func:`~plexapi.base.PlexPartialObject.batchEdits` for batch editing... | edits = {
f'{field}.value': value or '',
f'{field}.locked': 1 if locked else 0
}
edits.update(kwargs)
return self._edit(**edits)
| """ Edit the field of a Plex object. All field editing methods can be chained together.
Also see :func:`~plexapi.base.PlexPartialObject.batchEdits` for batch editing fields.
Parameters:
field (str): The name of the field to edit.
value (str): The value to... | 17 | 217 | 68 | 285 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,365 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 767,768 | 760,840 | editTags | EditTagsMixin | 785,797 | 768,797 | class EditTagsMixin:
""" Mixin for editing Plex object tags. """
@deprecated('use "editTags" instead')
def _edit_tags(self, tag, items, locked=True, remove=False):
return self.editTags(tag, items, locked, remove)
def editTags(self, tag, items, locked=True, remove=False, **kwargs):
FILL_FUNC_BO... | class EditTagsMixin:
""" Mixin for editing Plex object tags. """
@deprecated('use "editTags" instead')
def _edit_tags(self, tag, items, locked=True, remove=False):
return self.editTags(tag, items, locked, remove)
def editTags(self, tag, items, locked=True, remove=False, **kwargs):
""" ... | if not isinstance(items, list):
items = [items]
if not remove:
tags = getattr(self, self._tagPlural(tag), [])
if isinstance(tags, list):
items = tags + items
edits = self._tagHelper(self._tagSingular(tag), items, locked, remove)
edits... | """ Edit the tags of a Plex object. All tag editing methods can be chained together.
Also see :func:`~plexapi.base.PlexPartialObject.batchEdits` for batch editing tags.
Parameters:
tag (str): Name of the tag to edit.
items (List<str> or List<:class:`~plex... | 32 | 645 | 119 | 764 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,366 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 586,587 | 583,596 | editEditionTitle | EditionTitleMixin | 593,596 | 587,596 | class EditionTitleMixin(EditFieldMixin):
""" Mixin for Plex objects that can have an edition title. """
def editEditionTitle(self, editionTitle, locked=True):
FILL_FUNC_BODY | class EditionTitleMixin(EditFieldMixin):
""" Mixin for Plex objects that can have an edition title. """
def editEditionTitle(self, editionTitle, locked=True):
""" Edit the edition title. Plex Pass is required to edit this field.
Parameters:
editionTitle (str): The new value... | return self.editField('editionTitle', editionTitle, locked=locked)
| """ Edit the edition title. Plex Pass is required to edit this field.
Parameters:
editionTitle (str): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('editionTitle', editionTitle, lo... | 4 | 116 | 25 | 141 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,367 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 278,279 | 275,285 | extras | ExtrasMixin | 280,285 | 279,285 | class ExtrasMixin:
""" Mixin for Plex objects that can have extras. """
def extras(self):
FILL_FUNC_BODY | class ExtrasMixin:
""" Mixin for Plex objects that can have extras. """
def extras(self):
""" Returns a list of :class:`~plexapi.video.Extra` objects. """
FILL_FUNC_BODY | from plexapi.video import Extra
data = self._server.query(self._details_key)
return self.findItems(data, Extra, rtag='Extras')
| """ Returns a list of :class:`~plexapi.video.Extra` objects. """
from plexapi.video import Extra
data = self._server.query(self._details_key)
return self.findItems(data, Extra, rtag='Extras')
| 11 | 64 | 52 | 116 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,368 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 918,919 | 906,928 | removeGenre | GenreMixin | 925,928 | 919,928 | class GenreMixin(EditTagsMixin):
""" Mixin for Plex objects that can have genres. """
def addGenre(self, genres, locked=True):
""" Add a genre tag(s).
Parameters:
genres (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True... | class GenreMixin(EditTagsMixin):
""" Mixin for Plex objects that can have genres. """
def addGenre(self, genres, locked=True):
""" Add a genre tag(s).
Parameters:
genres (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True... | return self.editTags('genre', genres, locked=locked, remove=True)
| """ Remove a genre tag(s).
Parameters:
genres (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editTags('genre', genres, locked=locked, rem... | 5 | 233 | 28 | 261 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,369 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 288,289 | 285,296 | hubs | HubsMixin | 290,296 | 289,296 | class HubsMixin:
""" Mixin for Plex objects that can have related hubs. """
def hubs(self):
FILL_FUNC_BODY | class HubsMixin:
""" Mixin for Plex objects that can have related hubs. """
def hubs(self):
""" Returns a list of :class:`~plexapi.library.Hub` objects. """
FILL_FUNC_BODY | from plexapi.library import Hub
key = f'{self.key}/related'
data = self._server.query(key)
return self.findItems(data, Hub)
| """ Returns a list of :class:`~plexapi.library.Hub` objects. """
from plexapi.library import Hub
key = f'{self.key}/related'
data = self._server.query(key)
return self.findItems(data, Hub)
| 13 | 65 | 55 | 120 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,370 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 931,932 | 928,950 | addLabel | LabelMixin | 938,940 | 932,940 | class LabelMixin(EditTagsMixin):
""" Mixin for Plex objects that can have labels. """
def addLabel(self, labels, locked=True):
FILL_FUNC_BODY def removeLabel(self, labels, locked=True):
""" Remove a label tag(s).
Parameters:
labels (List<str> or List<:class:`~plexapi.med... | class LabelMixin(EditTagsMixin):
""" Mixin for Plex objects that can have labels. """
def addLabel(self, labels, locked=True):
""" Add a label tag(s).
Parameters:
labels (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True... | return self.editTags('label', labels, locked=locked)
| """ Add a label tag(s).
Parameters:
labels (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editTags('label', labels, locked=locked)
| 4 | 228 | 20 | 248 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,371 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 962,963 | 950,972 | removeMood | MoodMixin | 969,972 | 963,972 | class MoodMixin(EditTagsMixin):
""" Mixin for Plex objects that can have moods. """
def addMood(self, moods, locked=True):
""" Add a mood tag(s).
Parameters:
moods (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (defa... | class MoodMixin(EditTagsMixin):
""" Mixin for Plex objects that can have moods. """
def addMood(self, moods, locked=True):
""" Add a mood tag(s).
Parameters:
moods (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (defa... | return self.editTags('mood', moods, locked=locked, remove=True)
| """ Remove a mood tag(s).
Parameters:
moods (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editTags('mood', moods, locked=locked, remove=... | 5 | 233 | 28 | 261 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,372 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 614,615 | 611,624 | editOriginalTitle | OriginalTitleMixin | 621,624 | 615,624 | class OriginalTitleMixin(EditFieldMixin):
""" Mixin for Plex objects that can have an original title. """
def editOriginalTitle(self, originalTitle, locked=True):
FILL_FUNC_BODY | class OriginalTitleMixin(EditFieldMixin):
""" Mixin for Plex objects that can have an original title. """
def editOriginalTitle(self, originalTitle, locked=True):
""" Edit the original title.
Parameters:
originalTitle (str): The new value.
locked (bool): Tru... | return self.editField('originalTitle', originalTitle, locked=locked)
| """ Edit the original title.
Parameters:
originalTitle (str): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('originalTitle', originalTitle, locked=locked)
| 4 | 105 | 24 | 129 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,373 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 599,600 | 596,611 | editOriginallyAvailable | OriginallyAvailableMixin | 606,611 | 600,611 | class OriginallyAvailableMixin(EditFieldMixin):
""" Mixin for Plex objects that can have an originally available date. """
def editOriginallyAvailable(self, originallyAvailable, locked=True):
FILL_FUNC_BODY | class OriginallyAvailableMixin(EditFieldMixin):
""" Mixin for Plex objects that can have an originally available date. """
def editOriginallyAvailable(self, originallyAvailable, locked=True):
""" Edit the originally available date.
Parameters:
originallyAvailable (str or da... | if isinstance(originallyAvailable, datetime):
originallyAvailable = originallyAvailable.strftime('%Y-%m-%d')
return self.editField('originallyAvailableAt', originallyAvailable, locked=locked)
| """ Edit the originally available date.
Parameters:
originallyAvailable (str or datetime): The new value "YYYY-MM-DD (str) or datetime object.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
if isinstance(originallyAvai... | 10 | 124 | 61 | 185 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,374 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 735,736 | 732,747 | editCapturedTime | PhotoCapturedTimeMixin | 742,747 | 736,747 | class PhotoCapturedTimeMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a captured time. """
def editCapturedTime(self, capturedTime, locked=True):
FILL_FUNC_BODY | class PhotoCapturedTimeMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a captured time. """
def editCapturedTime(self, capturedTime, locked=True):
""" Edit the photo captured time.
Parameters:
capturedTime (str or datetime): The new value "YYYY-MM-DD hh:mm:s... | if isinstance(capturedTime, datetime):
capturedTime = capturedTime.strftime('%Y-%m-%d %H:%M:%S')
return self.editField('originallyAvailableAt', capturedTime, locked=locked)
| """ Edit the photo captured time.
Parameters:
capturedTime (str or datetime): The new value "YYYY-MM-DD hh:mm:ss" (str) or datetime object.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
if isinstance(capturedTime, dat... | 11 | 133 | 69 | 202 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,375 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 299,301 | 296,332 | isPlayed | PlayedUnplayedMixin | 302,304 | 301,304 | class PlayedUnplayedMixin:
""" Mixin for Plex objects that can be marked played and unplayed. """
@property
def isPlayed(self):
FILL_FUNC_BODY def markPlayed(self):
""" Mark the Plex object as played. """
key = '/:/scrobble'
params = {'key': self.ratingKey, 'identifier': 'com.ple... | class PlayedUnplayedMixin:
""" Mixin for Plex objects that can be marked played and unplayed. """
@property
def isPlayed(self):
""" Returns True if this video is played. """
FILL_FUNC_BODY def markPlayed(self):
""" Mark the Plex object as played. """
key = '/:/scrobble'
p... | return bool(self.viewCount > 0) if self.viewCount else False
| """ Returns True if this video is played. """
return bool(self.viewCount > 0) if self.viewCount else False
| 8 | 359 | 22 | 381 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,376 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 430,431 | 423,435 | unlockPoster | PosterLockMixin | 432,435 | 431,435 | class PosterLockMixin:
""" Mixin for Plex objects that can have a locked poster. """
def lockPoster(self):
""" Lock the poster for a Plex object. """
return self._edit(**{'thumb.locked': 1})
def unlockPoster(self):
FILL_FUNC_BODY | class PosterLockMixin:
""" Mixin for Plex objects that can have a locked poster. """
def lockPoster(self):
""" Lock the poster for a Plex object. """
return self._edit(**{'thumb.locked': 1})
def unlockPoster(self):
""" Unlock the poster for a Plex object. """
FILL_FUNC_BODY | return self._edit(**{'thumb.locked': 0})
| """ Unlock the poster for a Plex object. """
return self._edit(**{'thumb.locked': 0})
| 3 | 99 | 22 | 121 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,377 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 442,443 | 435,468 | uploadPoster | PosterMixin | 449,458 | 443,458 | class PosterMixin(PosterUrlMixin, PosterLockMixin):
""" Mixin for Plex objects that can have posters. """
def posters(self):
""" Returns list of available :class:`~plexapi.media.Poster` objects. """
return self.fetchItems(f'/library/metadata/{self.ratingKey}/posters', cls=media.Poster)
def... | class PosterMixin(PosterUrlMixin, PosterLockMixin):
""" Mixin for Plex objects that can have posters. """
def posters(self):
""" Returns list of available :class:`~plexapi.media.Poster` objects. """
return self.fetchItems(f'/library/metadata/{self.ratingKey}/posters', cls=media.Poster)
def... | if url:
key = f'/library/metadata/{self.ratingKey}/posters?url={quote_plus(url)}'
self._server.query(key, method=self._server._session.post)
elif filepath:
key = f'/library/metadata/{self.ratingKey}/posters'
data = openOrRead(filepath)
self._se... | """ Upload a poster from a url or filepath.
Parameters:
url (str): The full URL to the image to upload.
filepath (str): The full file path the the image to upload or file-like object.
"""
if url:
key = f'/library/metadata/{self.ratingKey}/... | 20 | 254 | 126 | 380 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,378 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 411,413 | 408,423 | thumbUrl | PosterUrlMixin | 414,417 | 413,417 | class PosterUrlMixin:
""" Mixin for Plex objects that can have a poster url. """
@property
def thumbUrl(self):
FILL_FUNC_BODY @property
def posterUrl(self):
""" Alias to self.thumbUrl. """
return self.thumbUrl
| class PosterUrlMixin:
""" Mixin for Plex objects that can have a poster url. """
@property
def thumbUrl(self):
""" Return the thumb url for the Plex object. """
FILL_FUNC_BODY @property
def posterUrl(self):
""" Alias to self.thumbUrl. """
return self.thumbUrl
| thumb = self.firstAttr('thumb', 'parentThumb', 'grandparentThumb')
return self._server.url(thumb, includeToken=True) if thumb else None
| """ Return the thumb url for the Plex object. """
thumb = self.firstAttr('thumb', 'parentThumb', 'grandparentThumb')
return self._server.url(thumb, includeToken=True) if thumb else None
| 12 | 95 | 46 | 141 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,379 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 975,976 | 972,994 | addProducer | ProducerMixin | 982,984 | 976,984 | class ProducerMixin(EditTagsMixin):
""" Mixin for Plex objects that can have producers. """
def addProducer(self, producers, locked=True):
FILL_FUNC_BODY def removeProducer(self, producers, locked=True):
""" Remove a producer tag(s).
Parameters:
producers (List<str> or L... | class ProducerMixin(EditTagsMixin):
""" Mixin for Plex objects that can have producers. """
def addProducer(self, producers, locked=True):
""" Add a producer tag(s).
Parameters:
producers (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
l... | return self.editTags('producer', producers, locked=locked)
| """ Add a producer tag(s).
Parameters:
producers (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editTags('producer', producers, locked=lo... | 4 | 232 | 21 | 253 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,380 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 335,336 | 332,353 | rate | RatingMixin | 344,353 | 336,353 | class RatingMixin:
""" Mixin for Plex objects that can have user star ratings. """
def rate(self, rating=None):
FILL_FUNC_BODY | class RatingMixin:
""" Mixin for Plex objects that can have user star ratings. """
def rate(self, rating=None):
""" Rate the Plex object. Note: Plex ratings are displayed out of 5 stars (e.g. rating 7.0 = 3.5 stars).
Parameters:
rating (float, optional): Rating from 0 to 10... | if rating is None:
rating = -1
elif not isinstance(rating, (int, float)) or rating < 0 or rating > 10:
raise BadRequest('Rating must be between 0 to 10.')
key = f'/:/rate?key={self.ratingKey}&identifier=com.plexapp.plugins.library&rating={rating}'
self._server.que... | """ Rate the Plex object. Note: Plex ratings are displayed out of 5 stars (e.g. rating 7.0 = 3.5 stars).
Parameters:
rating (float, optional): Rating from 0 to 10. Exclude to reset the rating.
Raises:
:exc:`~plexapi.exceptions.BadRequest`: If the rating ... | 35 | 146 | 124 | 270 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,381 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 1006,1007 | 994,1016 | removeSimilarArtist | SimilarArtistMixin | 1013,1016 | 1007,1016 | class SimilarArtistMixin(EditTagsMixin):
""" Mixin for Plex objects that can have similar artists. """
def addSimilarArtist(self, artists, locked=True):
""" Add a similar artist tag(s).
Parameters:
artists (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.... | class SimilarArtistMixin(EditTagsMixin):
""" Mixin for Plex objects that can have similar artists. """
def addSimilarArtist(self, artists, locked=True):
""" Add a similar artist tag(s).
Parameters:
artists (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.... | return self.editTags('similar', artists, locked=locked, remove=True)
| """ Remove a similar artist tag(s).
Parameters:
artists (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editTags('similar', artists, locke... | 5 | 232 | 26 | 258 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,382 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 68,69 | 65,158 | _parseFilterGroups | SmartFilterMixin | 70,112 | 69,112 | class SmartFilterMixin:
""" Mixin for Plex objects that can have smart filters. """
def _parseFilterGroups(self, feed: Deque[Tuple[str, str]], returnOn: Union[Set[str], None] = None) -> dict:
FILL_FUNC_BODY def _parseQueryFeed(self, feed: "deque[Tuple[str, str]]") -> dict:
""" Parse the query string... | class SmartFilterMixin:
""" Mixin for Plex objects that can have smart filters. """
def _parseFilterGroups(self, feed: Deque[Tuple[str, str]], returnOn: Union[Set[str], None] = None) -> dict:
""" Parse filter groups from input lines between push and pop. """
FILL_FUNC_BODY def _parseQueryFeed(self, ... | currentFiltersStack: list[dict] = []
operatorForStack = None
if returnOn is None:
returnOn = set("pop")
else:
returnOn.add("pop")
allowedLogicalOperators = ["and", "or"] # first is the default
while feed:
key, value = feed.popleft() ... | """ Parse filter groups from input lines between push and pop. """
currentFiltersStack: list[dict] = []
operatorForStack = None
if returnOn is None:
returnOn = set("pop")
else:
returnOn.add("pop")
allowedLogicalOperators = ["and", "or"] # first is... | 148 | 556 | 402 | 958 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,383 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 627,628 | 624,637 | editSortTitle | SortTitleMixin | 634,637 | 628,637 | class SortTitleMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a sort title. """
def editSortTitle(self, sortTitle, locked=True):
FILL_FUNC_BODY | class SortTitleMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a sort title. """
def editSortTitle(self, sortTitle, locked=True):
""" Edit the sort title.
Parameters:
sortTitle (str): The new value.
locked (bool): True (default) to lock the f... | return self.editField('titleSort', sortTitle, locked=locked)
| """ Edit the sort title.
Parameters:
sortTitle (str): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('titleSort', sortTitle, locked=locked)
| 4 | 105 | 24 | 129 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,384 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 167,168 | 158,181 | merge | SplitMergeMixin | 173,181 | 168,181 | class SplitMergeMixin:
""" Mixin for Plex objects that can be split and merged. """
def split(self):
""" Split duplicated Plex object into separate objects. """
key = f'{self.key}/split'
self._server.query(key, method=self._server._session.put)
return self
def merge(self, r... | class SplitMergeMixin:
""" Mixin for Plex objects that can be split and merged. """
def split(self):
""" Split duplicated Plex object into separate objects. """
key = f'{self.key}/split'
self._server.query(key, method=self._server._session.put)
return self
def merge(self, r... | if not isinstance(ratingKeys, list):
ratingKeys = str(ratingKeys).split(',')
key = f"{self.key}/merge?ids={','.join(str(r) for r in ratingKeys)}"
self._server.query(key, method=self._server._session.put)
return self
| """ Merge other Plex objects into the current object.
Parameters:
ratingKeys (list): A list of rating keys to merge.
"""
if not isinstance(ratingKeys, list):
ratingKeys = str(ratingKeys).split(',')
key = f"{self.key}/merge?ids={','.join(str(r) fo... | 18 | 145 | 92 | 237 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,385 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 640,641 | 637,650 | editStudio | StudioMixin | 647,650 | 641,650 | class StudioMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a studio. """
def editStudio(self, studio, locked=True):
FILL_FUNC_BODY | class StudioMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a studio. """
def editStudio(self, studio, locked=True):
""" Edit the studio.
Parameters:
studio (str): The new value.
locked (bool): True (default) to lock the field, False to unloc... | return self.editField('studio', studio, locked=locked)
| """ Edit the studio.
Parameters:
studio (str): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('studio', studio, locked=locked)
| 4 | 100 | 23 | 123 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,386 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 1019,1020 | 1016,1038 | addStyle | StyleMixin | 1026,1028 | 1020,1028 | class StyleMixin(EditTagsMixin):
""" Mixin for Plex objects that can have styles. """
def addStyle(self, styles, locked=True):
FILL_FUNC_BODY def removeStyle(self, styles, locked=True):
""" Remove a style tag(s).
Parameters:
styles (List<str> or List<:class:`~plexapi.med... | class StyleMixin(EditTagsMixin):
""" Mixin for Plex objects that can have styles. """
def addStyle(self, styles, locked=True):
""" Add a style tag(s).
Parameters:
styles (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True... | return self.editTags('style', styles, locked=locked)
| """ Add a style tag(s).
Parameters:
styles (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editTags('style', styles, locked=locked)
| 4 | 228 | 20 | 248 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,387 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 653,654 | 650,663 | editSummary | SummaryMixin | 660,663 | 654,663 | class SummaryMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a summary. """
def editSummary(self, summary, locked=True):
FILL_FUNC_BODY | class SummaryMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a summary. """
def editSummary(self, summary, locked=True):
""" Edit the summary.
Parameters:
summary (str): The new value.
locked (bool): True (default) to lock the field, False to... | return self.editField('summary', summary, locked=locked)
| """ Edit the summary.
Parameters:
summary (str): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('summary', summary, locked=locked)
| 4 | 99 | 22 | 121 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,388 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 1041,1042 | 1038,1060 | addTag | TagMixin | 1048,1050 | 1042,1050 | class TagMixin(EditTagsMixin):
""" Mixin for Plex objects that can have tags. """
def addTag(self, tags, locked=True):
FILL_FUNC_BODY def removeTag(self, tags, locked=True):
""" Remove a tag(s).
Parameters:
tags (List<str> or List<:class:`~plexapi.media.MediaTag`>): List... | class TagMixin(EditTagsMixin):
""" Mixin for Plex objects that can have tags. """
def addTag(self, tags, locked=True):
""" Add a tag(s).
Parameters:
tags (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (default) to lo... | return self.editTags('tag', tags, locked=locked)
| """ Add a tag(s).
Parameters:
tags (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editTags('tag', tags, locked=locked)
| 4 | 226 | 20 | 246 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,389 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 666,667 | 663,676 | editTagline | TaglineMixin | 673,676 | 667,676 | class TaglineMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a tagline. """
def editTagline(self, tagline, locked=True):
FILL_FUNC_BODY | class TaglineMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a tagline. """
def editTagline(self, tagline, locked=True):
""" Edit the tagline.
Parameters:
tagline (str): The new value.
locked (bool): True (default) to lock the field, False to... | return self.editField('tagline', tagline, locked=locked)
| """ Edit the tagline.
Parameters:
tagline (str): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('tagline', tagline, locked=locked)
| 4 | 105 | 24 | 129 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,390 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 485,486 | 478,490 | unlockTheme | ThemeLockMixin | 487,490 | 486,490 | class ThemeLockMixin:
""" Mixin for Plex objects that can have a locked theme. """
def lockTheme(self):
""" Lock the theme for a Plex object. """
return self._edit(**{'theme.locked': 1})
def unlockTheme(self):
FILL_FUNC_BODY | class ThemeLockMixin:
""" Mixin for Plex objects that can have a locked theme. """
def lockTheme(self):
""" Lock the theme for a Plex object. """
return self._edit(**{'theme.locked': 1})
def unlockTheme(self):
""" Unlock the theme for a Plex object. """
FILL_FUNC_BODY | return self._edit(**{'theme.locked': 0})
| """ Unlock the theme for a Plex object. """
return self._edit(**{'theme.locked': 0})
| 3 | 97 | 22 | 119 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,391 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 493,494 | 490,524 | themes | ThemeMixin | 495,497 | 494,497 | class ThemeMixin(ThemeUrlMixin, ThemeLockMixin):
""" Mixin for Plex objects that can have themes. """
def themes(self):
FILL_FUNC_BODY def uploadTheme(self, url=None, filepath=None, timeout=None):
""" Upload a theme from url or filepath.
Warning: Themes cannot be deleted using PlexAPI!
... | class ThemeMixin(ThemeUrlMixin, ThemeLockMixin):
""" Mixin for Plex objects that can have themes. """
def themes(self):
""" Returns list of available :class:`~plexapi.media.Theme` objects. """
FILL_FUNC_BODY def uploadTheme(self, url=None, filepath=None, timeout=None):
""" Upload a theme fro... | return self.fetchItems(f'/library/metadata/{self.ratingKey}/themes', cls=media.Theme)
| """ Returns list of available :class:`~plexapi.media.Theme` objects. """
return self.fetchItems(f'/library/metadata/{self.ratingKey}/themes', cls=media.Theme)
| 3 | 381 | 32 | 413 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,392 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 471,473 | 468,478 | themeUrl | ThemeUrlMixin | 474,478 | 473,478 | class ThemeUrlMixin:
""" Mixin for Plex objects that can have a theme url. """
@property
def themeUrl(self):
FILL_FUNC_BODY | class ThemeUrlMixin:
""" Mixin for Plex objects that can have a theme url. """
@property
def themeUrl(self):
""" Return the theme url for the Plex object. """
FILL_FUNC_BODY | theme = self.firstAttr('theme', 'parentTheme', 'grandparentTheme')
return self._server.url(theme, includeToken=True) if theme else None
| """ Return the theme url for the Plex object. """
theme = self.firstAttr('theme', 'parentTheme', 'grandparentTheme')
return self._server.url(theme, includeToken=True) if theme else None
| 12 | 62 | 46 | 108 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,393 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 679,680 | 676,693 | editTitle | TitleMixin | 686,693 | 680,693 | class TitleMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a title. """
def editTitle(self, title, locked=True):
FILL_FUNC_BODY | class TitleMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a title. """
def editTitle(self, title, locked=True):
""" Edit the title.
Parameters:
title (str): The new value.
locked (bool): True (default) to lock the field, False to unlock the ... | kwargs = {}
if self.TYPE == 'album':
# Editing album title also requires the artist ratingKey
kwargs['artist.id.value'] = self.parentRatingKey
return self.editField('title', title, locked=locked, **kwargs)
| """ Edit the title.
Parameters:
title (str): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
kwargs = {}
if self.TYPE == 'album':
# Editing album title also requires the artist ratingK... | 24 | 99 | 80 | 179 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,394 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 696,697 | 693,706 | editTrackArtist | TrackArtistMixin | 703,706 | 697,706 | class TrackArtistMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a track artist. """
def editTrackArtist(self, trackArtist, locked=True):
FILL_FUNC_BODY | class TrackArtistMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a track artist. """
def editTrackArtist(self, trackArtist, locked=True):
""" Edit the track artist.
Parameters:
trackArtist (str): The new value.
locked (bool): True (default) t... | return self.editField('originalTitle', trackArtist, locked=locked)
| """ Edit the track artist.
Parameters:
trackArtist (str): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('originalTitle', trackArtist, locked=locked)
| 4 | 109 | 25 | 134 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,395 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 722,723 | 719,732 | editDiscNumber | TrackDiscNumberMixin | 729,732 | 723,732 | class TrackDiscNumberMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a track disc number. """
def editDiscNumber(self, discNumber, locked=True):
FILL_FUNC_BODY | class TrackDiscNumberMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a track disc number. """
def editDiscNumber(self, discNumber, locked=True):
""" Edit the track disc number.
Parameters:
discNumber (int): The new value.
locked (bool): True ... | return self.editField('parentIndex', discNumber, locked=locked)
| """ Edit the track disc number.
Parameters:
discNumber (int): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('parentIndex', discNumber, locked=locked)
| 4 | 108 | 24 | 132 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,396 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 709,710 | 706,719 | editTrackNumber | TrackNumberMixin | 716,719 | 710,719 | class TrackNumberMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a track number. """
def editTrackNumber(self, trackNumber, locked=True):
FILL_FUNC_BODY | class TrackNumberMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a track number. """
def editTrackNumber(self, trackNumber, locked=True):
""" Edit the track number.
Parameters:
trackNumber (int): The new value.
locked (bool): True (default) t... | return self.editField('index', trackNumber, locked=locked)
| """ Edit the track number.
Parameters:
trackNumber (int): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('index', trackNumber, locked=locked)
| 4 | 105 | 23 | 128 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,397 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 189,190 | 181,275 | matches | UnmatchMatchMixin | 217,246 | 190,246 | class UnmatchMatchMixin:
""" Mixin for Plex objects that can be unmatched and matched. """
def unmatch(self):
""" Unmatches metadata match from object. """
key = f'{self.key}/unmatch'
self._server.query(key, method=self._server._session.put)
def matches(self, agent=None, title=None... | class UnmatchMatchMixin:
""" Mixin for Plex objects that can be unmatched and matched. """
def unmatch(self):
""" Unmatches metadata match from object. """
key = f'{self.key}/unmatch'
self._server.query(key, method=self._server._session.put)
def matches(self, agent=None, title=None... | key = f'{self.key}/matches'
params = {'manual': 1}
if agent and not any([title, year, language]):
params['language'] = self.section().language
params['agent'] = utils.getAgentIdentifier(self.section(), agent)
else:
if any(x is not None for x in [agent... | """ Return list of (:class:`~plexapi.media.SearchResult`) metadata matches.
Parameters:
agent (str): Agent name to be used (imdb, thetvdb, themoviedb, etc.)
title (str): Title of item to search for
year (str): Year of item to search in
... | 89 | 751 | 306 | 1,057 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,398 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 750,751 | 747,760 | editUserRating | UserRatingMixin | 757,760 | 751,760 | class UserRatingMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a user rating. """
def editUserRating(self, userRating, locked=True):
FILL_FUNC_BODY | class UserRatingMixin(EditFieldMixin):
""" Mixin for Plex objects that can have a user rating. """
def editUserRating(self, userRating, locked=True):
""" Edit the user rating.
Parameters:
userRating (int): The new value.
locked (bool): True (default) to lock... | return self.editField('userRating', userRating, locked=locked)
| """ Edit the user rating.
Parameters:
userRating (int): The new value.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editField('userRating', userRating, locked=locked)
| 4 | 109 | 26 | 135 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,399 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 1099,1100 | 1082,1146 | addToWatchlist | WatchlistMixin | 1107,1114 | 1100,1114 | class WatchlistMixin:
""" Mixin for Plex objects that can be added to a user's watchlist. """
def onWatchlist(self, account=None):
""" Returns True if the item is on the user's watchlist.
Also see :func:`~plexapi.myplex.MyPlexAccount.onWatchlist`.
Parameters:
ac... | class WatchlistMixin:
""" Mixin for Plex objects that can be added to a user's watchlist. """
def onWatchlist(self, account=None):
""" Returns True if the item is on the user's watchlist.
Also see :func:`~plexapi.myplex.MyPlexAccount.onWatchlist`.
Parameters:
ac... | try:
account = account or self._server.myPlexAccount()
except AttributeError:
account = self._server
account.addToWatchlist(self)
return self
| """ Add this item to the specified user's watchlist.
Also see :func:`~plexapi.myplex.MyPlexAccount.addToWatchlist`.
Parameters:
account (:class:`~plexapi.myplex.MyPlexAccount`, optional): Account to add item to the watchlist.
Note: This is required if ... | 14 | 690 | 56 | 746 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,400 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/mixins.py | 1072,1073 | 1060,1082 | removeWriter | WriterMixin | 1079,1082 | 1073,1082 | class WriterMixin(EditTagsMixin):
""" Mixin for Plex objects that can have writers. """
def addWriter(self, writers, locked=True):
""" Add a writer tag(s).
Parameters:
writers (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool)... | class WriterMixin(EditTagsMixin):
""" Mixin for Plex objects that can have writers. """
def addWriter(self, writers, locked=True):
""" Add a writer tag(s).
Parameters:
writers (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool)... | return self.editTags('writer', writers, locked=locked, remove=True)
| """ Remove a writer tag(s).
Parameters:
writers (List<str> or List<:class:`~plexapi.media.MediaTag`>): List of tags.
locked (bool): True (default) to lock the field, False to unlock the field.
"""
return self.editTags('writer', writers, locked=locked,... | 5 | 224 | 26 | 250 | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... | # -*- coding: utf-8 -*-
from collections import deque
from datetime import datetime
from typing import Deque, Set, Tuple, Union
from urllib.parse import parse_qsl, quote, quote_plus, unquote, urlencode, urlsplit
from plexapi import media, settings, utils
from plexapi.exceptions import BadRequest, NotFound
from plexapi... |
49,402 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/myplex.py | 1941,1942 | 1925,1976 | _updateOptOut | AccountOptOut | 1950,1957 | 1942,1957 | class AccountOptOut(PlexObject):
""" Represents a single AccountOptOut
'https://plex.tv/api/v2/user/{userUUID}/settings/opt_outs'
Attributes:
TAG (str): optOut
key (str): Online Media Source key
value (str): Online Media Source opt_in, opt_out, or opt_out_managed... | class AccountOptOut(PlexObject):
""" Represents a single AccountOptOut
'https://plex.tv/api/v2/user/{userUUID}/settings/opt_outs'
Attributes:
TAG (str): optOut
key (str): Online Media Source key
value (str): Online Media Source opt_in, opt_out, or opt_out_managed... | if option not in self.CHOICES:
raise NotFound(f'{option} not found in available choices: {self.CHOICES}')
url = self._server.OPTOUTS.format(userUUID=self._server.uuid)
params = {'key': self.key, 'value': option}
self._server.query(url, method=self._server._session.post, param... | """ Sets the Online Media Sources option.
Parameters:
option (str): see CHOICES
Raises:
:exc:`~plexapi.exceptions.NotFound`: ``option`` str not found in CHOICES.
"""
if option not in self.CHOICES:
raise NotFound(f'{option} not... | 38 | 449 | 129 | 578 | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... |
49,403 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/myplex.py | 2024,2025 | 2006,2043 | _loadData | GeoLocation | 2025,2043 | 2025,2043 | class GeoLocation(PlexObject):
""" Represents a signle IP address geolocation
Attributes:
TAG (str): location
city (str): City name
code (str): Country code
continentCode (str): Continent code
coordinates (Tuple<float>): Latitude and longitude
... | class GeoLocation(PlexObject):
""" Represents a signle IP address geolocation
Attributes:
TAG (str): location
city (str): City name
code (str): Country code
continentCode (str): Continent code
coordinates (Tuple<float>): Latitude and longitude
... | self._data = data
self.city = data.attrib.get('city')
self.code = data.attrib.get('code')
self.continentCode = data.attrib.get('continent_code')
self.coordinates = tuple(
utils.cast(float, coord) for coord in (data.attrib.get('coordinates') or ',').split(','))
... | self._data = data
self.city = data.attrib.get('city')
self.code = data.attrib.get('code')
self.continentCode = data.attrib.get('continent_code')
self.coordinates = tuple(
utils.cast(float, coord) for coord in (data.attrib.get('coordinates') or ',').split(','))
... | 63 | 189 | 323 | 512 | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... |
49,405 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/myplex.py | 1596,1597 | 1565,1650 | _loadData | MyPlexDevice | 1597,1618 | 1597,1618 | class MyPlexDevice(PlexObject):
""" This object represents resources connected to your Plex server that provide
playback ability from your Plex Server, iPhone or Android clients, Plex Web,
this API, etc. The raw xml for the data presented here can be found at:
https://plex.tv/devices.xml
... | class MyPlexDevice(PlexObject):
""" This object represents resources connected to your Plex server that provide
playback ability from your Plex Server, iPhone or Android clients, Plex Web,
this API, etc. The raw xml for the data presented here can be found at:
https://plex.tv/devices.xml
... | self._data = data
self.name = data.attrib.get('name')
self.publicAddress = data.attrib.get('publicAddress')
self.product = data.attrib.get('product')
self.productVersion = data.attrib.get('productVersion')
self.platform = data.attrib.get('platform')
self.platformV... | self._data = data
self.name = data.attrib.get('name')
self.publicAddress = data.attrib.get('publicAddress')
self.product = data.attrib.get('product')
self.productVersion = data.attrib.get('productVersion')
self.platform = data.attrib.get('platform')
self.platformV... | 62 | 901 | 370 | 1,271 | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... |
49,406 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/myplex.py | 1280,1281 | 1260,1297 | _loadData | MyPlexInvite | 1282,1297 | 1281,1297 | class MyPlexInvite(PlexObject):
""" This object represents pending friend invites.
Attributes:
TAG (str): 'Invite'
createdAt (datetime): Datetime the user was invited.
email (str): User's email address (user@gmail.com).
friend (bool): True or False if the use... | class MyPlexInvite(PlexObject):
""" This object represents pending friend invites.
Attributes:
TAG (str): 'Invite'
createdAt (datetime): Datetime the user was invited.
email (str): User's email address (user@gmail.com).
friend (bool): True or False if the use... | self._data = data
self.createdAt = utils.toDatetime(data.attrib.get('createdAt'))
self.email = data.attrib.get('email')
self.friend = utils.cast(bool, data.attrib.get('friend'))
self.friendlyName = data.attrib.get('friendlyName')
self.home = utils.cast(bool, data.attrib.g... | """ Load attribute values from Plex XML response. """
self._data = data
self.createdAt = utils.toDatetime(data.attrib.get('createdAt'))
self.email = data.attrib.get('email')
self.friend = utils.cast(bool, data.attrib.get('friend'))
self.friendlyName = data.attrib.get('fri... | 46 | 303 | 238 | 541 | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... |
49,409 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/myplex.py | 1350,1351 | 1333,1393 | _loadData | MyPlexServerShare | 1352,1364 | 1351,1364 | class MyPlexServerShare(PlexObject):
""" Represents a single user's server reference. Used for library sharing.
Attributes:
id (int): id for this share
serverId (str): what id plex uses for this.
machineIdentifier (str): The servers machineIdentifier
name (st... | class MyPlexServerShare(PlexObject):
""" Represents a single user's server reference. Used for library sharing.
Attributes:
id (int): id for this share
serverId (str): what id plex uses for this.
machineIdentifier (str): The servers machineIdentifier
name (st... | self._data = data
self.id = utils.cast(int, data.attrib.get('id'))
self.accountID = utils.cast(int, data.attrib.get('accountID'))
self.serverId = utils.cast(int, data.attrib.get('serverId'))
self.machineIdentifier = data.attrib.get('machineIdentifier')
self.name = data.at... | """ Load attribute values from Plex XML response. """
self._data = data
self.id = utils.cast(int, data.attrib.get('id'))
self.accountID = utils.cast(int, data.attrib.get('accountID'))
self.serverId = utils.cast(int, data.attrib.get('serverId'))
self.machineIdentifier = da... | 40 | 528 | 246 | 774 | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... |
49,410 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/myplex.py | 1248,1249 | 1172,1260 | history | MyPlexUser | 1254,1260 | 1249,1260 | class MyPlexUser(PlexObject):
""" This object represents non-signed in users such as friends and linked
accounts. NOTE: This should not be confused with the :class:`~plexapi.myplex.MyPlexAccount`
which is your specific account. The raw xml for the data presented here
can be found at: https:/... | class MyPlexUser(PlexObject):
""" This object represents non-signed in users such as friends and linked
accounts. NOTE: This should not be confused with the :class:`~plexapi.myplex.MyPlexAccount`
which is your specific account. The raw xml for the data presented here
can be found at: https:/... | hist = []
for server in self.servers:
hist.extend(server.history(maxresults=maxresults, mindate=mindate))
return hist
| """ Get all Play History for a user in all shared servers.
Parameters:
maxresults (int): Only return the specified number of results (optional).
mindate (datetime): Min datetime to return results from.
"""
hist = []
for server in self.servers:
... | 11 | 1,116 | 48 | 1,164 | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... |
49,411 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/myplex.py | 1553,1554 | 1536,1565 | _loadData | ResourceConnection | 1554,1565 | 1554,1565 | class ResourceConnection(PlexObject):
""" Represents a Resource Connection object found within the
:class:`~plexapi.myplex.MyPlexResource` objects.
Attributes:
TAG (str): 'Connection'
address (str): The connection IP address
httpuri (str): Full HTTP URL
... | class ResourceConnection(PlexObject):
""" Represents a Resource Connection object found within the
:class:`~plexapi.myplex.MyPlexResource` objects.
Attributes:
TAG (str): 'Connection'
address (str): The connection IP address
httpuri (str): Full HTTP URL
... | self._data = data
self.address = data.attrib.get('address')
self.ipv6 = utils.cast(bool, data.attrib.get('IPv6'))
self.local = utils.cast(bool, data.attrib.get('local'))
self.port = utils.cast(int, data.attrib.get('port'))
self.protocol = data.attrib.get('protocol')
... | self._data = data
self.address = data.attrib.get('address')
self.ipv6 = utils.cast(bool, data.attrib.get('IPv6'))
self.local = utils.cast(bool, data.attrib.get('local'))
self.port = utils.cast(int, data.attrib.get('port'))
self.protocol = data.attrib.get('protocol')
... | 31 | 184 | 180 | 364 | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... |
49,412 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/myplex.py | 1312,1313 | 1297,1333 | _loadData | Section | 1313,1322 | 1313,1322 | class Section(PlexObject):
""" This refers to a shared section. The raw xml for the data presented here
can be found at: https://plex.tv/api/servers/{machineId}/shared_servers
Attributes:
TAG (str): section
id (int): The shared section ID
key (int): The shared li... | class Section(PlexObject):
""" This refers to a shared section. The raw xml for the data presented here
can be found at: https://plex.tv/api/servers/{machineId}/shared_servers
Attributes:
TAG (str): section
id (int): The shared section ID
key (int): The shared li... | self._data = data
self.id = utils.cast(int, data.attrib.get('id'))
self.key = utils.cast(int, data.attrib.get('key'))
self.shared = utils.cast(bool, data.attrib.get('shared', '0'))
self.title = data.attrib.get('title')
self.type = data.attrib.get('type')
self.sect... | self._data = data
self.id = utils.cast(int, data.attrib.get('id'))
self.key = utils.cast(int, data.attrib.get('key'))
self.shared = utils.cast(bool, data.attrib.get('shared', '0'))
self.title = data.attrib.get('title')
self.type = data.attrib.get('type')
self.sect... | 36 | 290 | 146 | 436 | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... |
49,413 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/myplex.py | 1995,1996 | 1976,2006 | _loadData | UserState | 1996,2006 | 1996,2006 | class UserState(PlexObject):
""" Represents a single UserState
Attributes:
TAG (str): UserState
lastViewedAt (datetime): Datetime the item was last played.
ratingKey (str): Unique key identifying the item.
type (str): The media type of the item.
v... | class UserState(PlexObject):
""" Represents a single UserState
Attributes:
TAG (str): UserState
lastViewedAt (datetime): Datetime the item was last played.
ratingKey (str): Unique key identifying the item.
type (str): The media type of the item.
v... | self.lastViewedAt = utils.toDatetime(data.attrib.get('lastViewedAt'))
self.ratingKey = data.attrib.get('ratingKey')
self.type = data.attrib.get('type')
self.viewCount = utils.cast(int, data.attrib.get('viewCount', 0))
self.viewedLeafCount = utils.cast(int, data.attrib.get('viewed... | self.lastViewedAt = utils.toDatetime(data.attrib.get('lastViewedAt'))
self.ratingKey = data.attrib.get('ratingKey')
self.type = data.attrib.get('type')
self.viewCount = utils.cast(int, data.attrib.get('viewCount', 0))
self.viewedLeafCount = utils.cast(int, data.attrib.get('viewed... | 32 | 235 | 206 | 441 | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... | # -*- coding: utf-8 -*-
import copy
import html
import threading
import time
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER,
log... |
49,415 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/photo.py | 317,318 | 310,321 | _loadData | PhotoSession | 319,321 | 318,321 | @utils.registerPlexObject
class PhotoSession(PlexSession, Photo):
""" Represents a single Photo session
loaded from :func:`~plexapi.server.PlexServer.sessions`.
"""
_SESSIONTYPE = True
def _loadData(self, data):
FILL_FUNC_BODY | @utils.registerPlexObject
class PhotoSession(PlexSession, Photo):
""" Represents a single Photo session
loaded from :func:`~plexapi.server.PlexServer.sessions`.
"""
_SESSIONTYPE = True
def _loadData(self, data):
""" Load attribute values from Plex XML response. """
FILL_FUNC_BODY | Photo._loadData(self, data)
PlexSession._loadData(self, data)
| """ Load attribute values from Plex XML response. """
Photo._loadData(self, data)
PlexSession._loadData(self, data)
| 4 | 95 | 26 | 121 | # -*- coding: utf-8 -*-
import os
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils, video
from plexapi.base import Playable, PlexPartialObject, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
RatingMixin,
ArtUrlMixin, ArtMixin, Pos... | # -*- coding: utf-8 -*-
import os
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils, video
from plexapi.base import Playable, PlexPartialObject, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
RatingMixin,
ArtUrlMixin, ArtMixin, Pos... |
49,416 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/photo.py | 99,100 | 16,150 | photos | Photoalbum | 101,104 | 100,104 | @utils.registerPlexObject
class Photoalbum(
PlexPartialObject,
RatingMixin,
ArtMixin, PosterMixin,
PhotoalbumEditMixins
):
""" Represents a single Photoalbum (collection of photos).
Attributes:
TAG (str): 'Directory'
TYPE (str): 'photo'
addedAt (datetime)... | @utils.registerPlexObject
class Photoalbum(
PlexPartialObject,
RatingMixin,
ArtMixin, PosterMixin,
PhotoalbumEditMixins
):
""" Represents a single Photoalbum (collection of photos).
Attributes:
TAG (str): 'Directory'
TYPE (str): 'photo'
addedAt (datetime)... | key = f'{self.key}/children'
return self.fetchItems(key, Photo, **kwargs)
| """ Returns a list of :class:`~plexapi.photo.Photo` objects in the album. """
key = f'{self.key}/children'
return self.fetchItems(key, Photo, **kwargs)
| 7 | 1,838 | 32 | 1,870 | # -*- coding: utf-8 -*-
import os
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils, video
from plexapi.base import Playable, PlexPartialObject, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
RatingMixin,
ArtUrlMixin, ArtMixin, Pos... | # -*- coding: utf-8 -*-
import os
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils, video
from plexapi.base import Playable, PlexPartialObject, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
RatingMixin,
ArtUrlMixin, ArtMixin, Pos... |
49,419 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/server.py | 1094,1095 | 1063,1111 | _loadData | Account | 1095,1111 | 1095,1111 | class Account(PlexObject):
""" Contains the locally cached MyPlex account information. The properties provided don't
match the :class:`~plexapi.myplex.MyPlexAccount` object very well. I believe this exists
because access to myplex is not required to get basic plex information. I can't imagine
... | class Account(PlexObject):
""" Contains the locally cached MyPlex account information. The properties provided don't
match the :class:`~plexapi.myplex.MyPlexAccount` object very well. I believe this exists
because access to myplex is not required to get basic plex information. I can't imagine
... | self._data = data
self.authToken = data.attrib.get('authToken')
self.username = data.attrib.get('username')
self.mappingState = data.attrib.get('mappingState')
self.mappingError = data.attrib.get('mappingError')
self.mappingErrorMessage = data.attrib.get('mappingErrorMess... | self._data = data
self.authToken = data.attrib.get('authToken')
self.username = data.attrib.get('username')
self.mappingState = data.attrib.get('mappingState')
self.mappingError = data.attrib.get('mappingError')
self.mappingErrorMessage = data.attrib.get('mappingErrorMess... | 43 | 468 | 267 | 735 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... |
49,420 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/server.py | 1115,1116 | 1111,1125 | _loadData | Activity | 1116,1125 | 1116,1125 | class Activity(PlexObject):
"""A currently running activity on the PlexServer."""
key = '/activities'
def _loadData(self, data):
FILL_FUNC_BODY | class Activity(PlexObject):
"""A currently running activity on the PlexServer."""
key = '/activities'
def _loadData(self, data):
FILL_FUNC_BODY | self._data = data
self.cancellable = utils.cast(bool, data.attrib.get('cancellable'))
self.progress = utils.cast(int, data.attrib.get('progress'))
self.title = data.attrib.get('title')
self.subtitle = data.attrib.get('subtitle')
self.type = data.attrib.get('type')
... | self._data = data
self.cancellable = utils.cast(bool, data.attrib.get('cancellable'))
self.progress = utils.cast(int, data.attrib.get('progress'))
self.title = data.attrib.get('title')
self.subtitle = data.attrib.get('subtitle')
self.type = data.attrib.get('type')
... | 23 | 51 | 128 | 179 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... |
49,421 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/server.py | 1280,1281 | 1265,1290 | _loadData | ButlerTask | 1281,1290 | 1281,1290 | @utils.registerPlexObject
class ButlerTask(PlexObject):
""" Represents a single scheduled butler task.
Attributes:
TAG (str): 'ButlerTask'
description (str): The description of the task.
enabled (bool): Whether the task is enabled.
interval (int): The interva... | @utils.registerPlexObject
class ButlerTask(PlexObject):
""" Represents a single scheduled butler task.
Attributes:
TAG (str): 'ButlerTask'
description (str): The description of the task.
enabled (bool): Whether the task is enabled.
interval (int): The interva... | self._data = data
self.description = data.attrib.get('description')
self.enabled = utils.cast(bool, data.attrib.get('enabled'))
self.interval = utils.cast(int, data.attrib.get('interval'))
self.name = data.attrib.get('name')
self.scheduleRandomized = utils.cast(bool, data... | self._data = data
self.description = data.attrib.get('description')
self.enabled = utils.cast(bool, data.attrib.get('enabled'))
self.interval = utils.cast(int, data.attrib.get('interval'))
self.name = data.attrib.get('name')
self.scheduleRandomized = utils.cast(bool, data... | 24 | 162 | 135 | 297 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... |
49,422 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/server.py | 1302,1303 | 1290,1307 | _loadData | Identity | 1303,1307 | 1303,1307 | class Identity(PlexObject):
""" Represents a server identity.
Attributes:
claimed (bool): True or False if the server is claimed.
machineIdentifier (str): The Plex server machine identifier.
version (str): The Plex server version.
"""
def __repr__(self):
... | class Identity(PlexObject):
""" Represents a server identity.
Attributes:
claimed (bool): True or False if the server is claimed.
machineIdentifier (str): The Plex server machine identifier.
version (str): The Plex server version.
"""
def __repr__(self):
... | self._data = data
self.claimed = utils.cast(bool, data.attrib.get('claimed'))
self.machineIdentifier = data.attrib.get('machineIdentifier')
self.version = data.attrib.get('version')
| self._data = data
self.claimed = utils.cast(bool, data.attrib.get('claimed'))
self.machineIdentifier = data.attrib.get('machineIdentifier')
self.version = data.attrib.get('version')
| 13 | 123 | 65 | 188 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... |
49,424 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/server.py | 1130,1131 | 1125,1139 | _loadData | Release | 1131,1139 | 1131,1139 | @utils.registerPlexObject
class Release(PlexObject):
TAG = 'Release'
key = '/updater/status'
def _loadData(self, data):
FILL_FUNC_BODY | @utils.registerPlexObject
class Release(PlexObject):
TAG = 'Release'
key = '/updater/status'
def _loadData(self, data):
FILL_FUNC_BODY | self.download_key = data.attrib.get('key')
self.version = data.attrib.get('version')
self.added = data.attrib.get('added')
self.fixed = data.attrib.get('fixed')
self.downloadURL = data.attrib.get('downloadURL')
self.state = data.attrib.get('state')
| self.download_key = data.attrib.get('key')
self.version = data.attrib.get('version')
self.added = data.attrib.get('added')
self.fixed = data.attrib.get('fixed')
self.downloadURL = data.attrib.get('downloadURL')
self.state = data.attrib.get('state')
| 18 | 57 | 104 | 161 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... |
49,425 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/server.py | 1210,1211 | 1194,1238 | _loadData | StatisticsBandwidth | 1211,1219 | 1211,1219 | class StatisticsBandwidth(PlexObject):
""" Represents a single statistics bandwidth data.
Attributes:
TAG (str): 'StatisticsBandwidth'
accountID (int): The associated :class:`~plexapi.server.SystemAccount` ID.
at (datetime): Datetime of the bandwidth data.
by... | class StatisticsBandwidth(PlexObject):
""" Represents a single statistics bandwidth data.
Attributes:
TAG (str): 'StatisticsBandwidth'
accountID (int): The associated :class:`~plexapi.server.SystemAccount` ID.
at (datetime): Datetime of the bandwidth data.
by... | self._data = data
self.accountID = utils.cast(int, data.attrib.get('accountID'))
self.at = utils.toDatetime(data.attrib.get('at'))
self.bytes = utils.cast(int, data.attrib.get('bytes'))
self.deviceID = utils.cast(int, data.attrib.get('deviceID'))
self.lan = utils.cast(boo... | self._data = data
self.accountID = utils.cast(int, data.attrib.get('accountID'))
self.at = utils.toDatetime(data.attrib.get('at'))
self.bytes = utils.cast(int, data.attrib.get('bytes'))
self.deviceID = utils.cast(int, data.attrib.get('deviceID'))
self.lan = utils.cast(boo... | 26 | 400 | 154 | 554 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... |
49,426 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/server.py | 1252,1253 | 1238,1265 | _loadData | StatisticsResources | 1253,1261 | 1253,1261 | class StatisticsResources(PlexObject):
""" Represents a single statistics resources data.
Attributes:
TAG (str): 'StatisticsResources'
at (datetime): Datetime of the resource data.
hostCpuUtilization (float): The system CPU usage %.
hostMemoryUtilization (flo... | class StatisticsResources(PlexObject):
""" Represents a single statistics resources data.
Attributes:
TAG (str): 'StatisticsResources'
at (datetime): Datetime of the resource data.
hostCpuUtilization (float): The system CPU usage %.
hostMemoryUtilization (flo... | self._data = data
self.at = utils.toDatetime(data.attrib.get('at'))
self.hostCpuUtilization = utils.cast(float, data.attrib.get('hostCpuUtilization'))
self.hostMemoryUtilization = utils.cast(float, data.attrib.get('hostMemoryUtilization'))
self.processCpuUtilization = utils.cast(... | self._data = data
self.at = utils.toDatetime(data.attrib.get('at'))
self.hostCpuUtilization = utils.cast(float, data.attrib.get('hostCpuUtilization'))
self.hostMemoryUtilization = utils.cast(float, data.attrib.get('hostMemoryUtilization'))
self.processCpuUtilization = utils.cast(... | 26 | 228 | 178 | 406 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... |
49,427 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/server.py | 1155,1156 | 1139,1170 | _loadData | SystemAccount | 1156,1170 | 1156,1170 | class SystemAccount(PlexObject):
""" Represents a single system account.
Attributes:
TAG (str): 'Account'
autoSelectAudio (bool): True or False if the account has automatic audio language enabled.
defaultAudioLanguage (str): The default audio language code for the accoun... | class SystemAccount(PlexObject):
""" Represents a single system account.
Attributes:
TAG (str): 'Account'
autoSelectAudio (bool): True or False if the account has automatic audio language enabled.
defaultAudioLanguage (str): The default audio language code for the accoun... | self._data = data
self.autoSelectAudio = utils.cast(bool, data.attrib.get('autoSelectAudio'))
self.defaultAudioLanguage = data.attrib.get('defaultAudioLanguage')
self.defaultSubtitleLanguage = data.attrib.get('defaultSubtitleLanguage')
self.id = utils.cast(int, data.attrib.get('i... | self._data = data
self.autoSelectAudio = utils.cast(bool, data.attrib.get('autoSelectAudio'))
self.defaultAudioLanguage = data.attrib.get('defaultAudioLanguage')
self.defaultSubtitleLanguage = data.attrib.get('defaultSubtitleLanguage')
self.id = utils.cast(int, data.attrib.get('i... | 40 | 193 | 208 | 401 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... |
49,428 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/server.py | 1184,1185 | 1170,1194 | _loadData | SystemDevice | 1185,1194 | 1185,1194 | class SystemDevice(PlexObject):
""" Represents a single system device.
Attributes:
TAG (str): 'Device'
clientIdentifier (str): The unique identifier for the device.
createdAt (datetime): Datetime the device was created.
id (int): The ID of the device (not the... | class SystemDevice(PlexObject):
""" Represents a single system device.
Attributes:
TAG (str): 'Device'
clientIdentifier (str): The unique identifier for the device.
createdAt (datetime): Datetime the device was created.
id (int): The ID of the device (not the... | self._data = data
self.clientIdentifier = data.attrib.get('clientIdentifier')
self.createdAt = utils.toDatetime(data.attrib.get('createdAt'))
self.id = utils.cast(int, data.attrib.get('id'))
self.key = f'/devices/{self.id}'
self.name = data.attrib.get('name')
self... | self._data = data
self.clientIdentifier = data.attrib.get('clientIdentifier')
self.createdAt = utils.toDatetime(data.attrib.get('createdAt'))
self.id = utils.cast(int, data.attrib.get('id'))
self.key = f'/devices/{self.id}'
self.name = data.attrib.get('name')
self... | 22 | 177 | 125 | 302 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.base import Plex... |
49,429 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/sonos.py | 70,71 | 10,116 | playMedia | PlexSonosClient | 71,116 | 71,116 | class PlexSonosClient(PlexClient):
""" Class for interacting with a Sonos speaker via the Plex API. This class
makes requests to an external Plex API which then forwards the
Sonos-specific commands back to your Plex server & Sonos speakers. Use
of this feature requires an active Plex Pass su... | class PlexSonosClient(PlexClient):
""" Class for interacting with a Sonos speaker via the Plex API. This class
makes requests to an external Plex API which then forwards the
Sonos-specific commands back to your Plex server & Sonos speakers. Use
of this feature requires an active Plex Pass su... |
if hasattr(media, "playlistType"):
mediatype = media.playlistType
else:
if isinstance(media, PlayQueue):
mediatype = media.items[0].listType
else:
mediatype = media.listType
if mediatype == "audio":
mediatype = "mu... |
if hasattr(media, "playlistType"):
mediatype = media.playlistType
else:
if isinstance(media, PlayQueue):
mediatype = media.items[0].listType
else:
mediatype = media.listType
if mediatype == "audio":
mediatype = "mu... | 90 | 828 | 468 | 1,296 | # -*- coding: utf-8 -*-
import requests
from plexapi import CONFIG, X_PLEX_IDENTIFIER
from plexapi.client import PlexClient
from plexapi.exceptions import BadRequest
from plexapi.playqueue import PlayQueue
class PlexSonosClient(PlexClient):
""" Class for interacting with a Sonos speaker via the Plex API. This cl... | # -*- coding: utf-8 -*-
import requests
from plexapi import CONFIG, X_PLEX_IDENTIFIER
from plexapi.client import PlexClient
from plexapi.exceptions import BadRequest
from plexapi.playqueue import PlayQueue
class PlexSonosClient(PlexClient):
""" Class for interacting with a Sonos speaker via the Plex API. This cl... |
49,430 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/sync.py | 225,227 | 171,242 | createPhoto | MediaSettings | 236,242 | 227,242 | class MediaSettings:
""" Transcoding settings used for all media within :class:`~plexapi.sync.SyncItem`.
Attributes:
audioBoost (int): unknown.
maxVideoBitrate (int|str): maximum bitrate for video, may be empty string.
musicBitrate (int|str): maximum bitrate for music, m... | class MediaSettings:
""" Transcoding settings used for all media within :class:`~plexapi.sync.SyncItem`.
Attributes:
audioBoost (int): unknown.
maxVideoBitrate (int|str): maximum bitrate for video, may be empty string.
musicBitrate (int|str): maximum bitrate for music, m... | if resolution in PHOTO_QUALITIES:
return MediaSettings(photoQuality=PHOTO_QUALITIES[resolution], photoResolution=resolution)
else:
raise BadRequest('Unexpected photo quality')
| """ Returns a :class:`~plexapi.sync.MediaSettings` object, based on provided photo quality value.
Parameters:
resolution (str): maximum allowed resolution for synchronized photos, see PHOTO_QUALITY_* values in the
module.
Raises:
... | 12 | 977 | 65 | 1,042 | # -*- coding: utf-8 -*-
"""
You can work with Mobile Sync on other devices straight away, but if you'd like to use your app as a `sync-target` (when
you can set items to be synced to your app) you need to init some variables.
.. code-block:: python
def init_sync():
import plexapi
plexapi.X_PLEX_PR... | # -*- coding: utf-8 -*-
"""
You can work with Mobile Sync on other devices straight away, but if you'd like to use your app as a `sync-target` (when
you can set items to be synced to your app) you need to init some variables.
.. code-block:: python
def init_sync():
import plexapi
plexapi.X_PLEX_PR... |
49,431 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/sync.py | 256,258 | 242,277 | create | Policy | 268,277 | 258,277 | class Policy:
""" Policy of syncing the media (how many items to sync and process watched media or not).
Attributes:
scope (str): type of limitation policy, can be `count` or `all`.
value (int): amount of media to sync, valid only when `scope=count`.
unwatched (bool): Tr... | class Policy:
""" Policy of syncing the media (how many items to sync and process watched media or not).
Attributes:
scope (str): type of limitation policy, can be `count` or `all`.
value (int): amount of media to sync, valid only when `scope=count`.
unwatched (bool): Tr... | scope = 'all'
if limit is None:
limit = 0
else:
scope = 'count'
return Policy(scope, unwatched, limit)
| """ Creates a :class:`~plexapi.sync.Policy` object for provided options and automatically sets proper `scope`
value.
Parameters:
limit (int): limit items by count.
unwatched (bool): if True then watched items wouldn't be synced.
Returns:
... | 18 | 284 | 55 | 339 | # -*- coding: utf-8 -*-
"""
You can work with Mobile Sync on other devices straight away, but if you'd like to use your app as a `sync-target` (when
you can set items to be synced to your app) you need to init some variables.
.. code-block:: python
def init_sync():
import plexapi
plexapi.X_PLEX_PR... | # -*- coding: utf-8 -*-
"""
You can work with Mobile Sync on other devices straight away, but if you'd like to use your app as a `sync-target` (when
you can set items to be synced to your app) you need to init some variables.
.. code-block:: python
def init_sync():
import plexapi
plexapi.X_PLEX_PR... |
49,432 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/sync.py | 79,80 | 33,109 | server | SyncItem | 81,86 | 80,86 | class SyncItem(PlexObject):
"""
Represents single sync item, for specified server and client. When you saying in the UI to sync "this" to "that"
you're basically creating a sync item.
Attributes:
id (int): unique id of the item.
clientIdentifier (str): an identifier of Plex Client devic... | class SyncItem(PlexObject):
"""
Represents single sync item, for specified server and client. When you saying in the UI to sync "this" to "that"
you're basically creating a sync item.
Attributes:
id (int): unique id of the item.
clientIdentifier (str): an identifier of Plex Client devic... | server = [s for s in self._server.resources() if s.clientIdentifier == self.machineIdentifier]
if len(server) == 0:
raise NotFound(f'Unable to find server with uuid {self.machineIdentifier}')
return server[0]
| """ Returns :class:`~plexapi.myplex.MyPlexResource` with server of current item. """
server = [s for s in self._server.resources() if s.clientIdentifier == self.machineIdentifier]
if len(server) == 0:
raise NotFound(f'Unable to find server with uuid {self.machineIdentifier}')
... | 25 | 1,022 | 72 | 1,094 | # -*- coding: utf-8 -*-
"""
You can work with Mobile Sync on other devices straight away, but if you'd like to use your app as a `sync-target` (when
you can set items to be synced to your app) you need to init some variables.
.. code-block:: python
def init_sync():
import plexapi
plexapi.X_PLEX_PR... | # -*- coding: utf-8 -*-
"""
You can work with Mobile Sync on other devices straight away, but if you'd like to use your app as a `sync-target` (when
you can set items to be synced to your app) you need to init some variables.
.. code-block:: python
def init_sync():
import plexapi
plexapi.X_PLEX_PR... |
49,433 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/sync.py | 120,121 | 109,132 | _loadData | SyncList | 121,132 | 121,132 | class SyncList(PlexObject):
""" Represents a Mobile Sync state, specific for single client, within one SyncList may be presented
items from different servers.
Attributes:
clientId (str): an identifier of the client.
items (List<:class:`~plexapi.sync.SyncItem`>): list of regi... | class SyncList(PlexObject):
""" Represents a Mobile Sync state, specific for single client, within one SyncList may be presented
items from different servers.
Attributes:
clientId (str): an identifier of the client.
items (List<:class:`~plexapi.sync.SyncItem`>): list of regi... | self._data = data
self.clientId = data.attrib.get('clientIdentifier')
self.items = []
syncItems = data.find('SyncItems')
if syncItems:
for sync_item in syncItems.iter('SyncItem'):
item = SyncItem(self._server, sync_item, clientIdentifier=self.clientId... | self._data = data
self.clientId = data.attrib.get('clientIdentifier')
self.items = []
syncItems = data.find('SyncItems')
if syncItems:
for sync_item in syncItems.iter('SyncItem'):
item = SyncItem(self._server, sync_item, clientIdentifier=self.clientId... | 24 | 142 | 113 | 255 | # -*- coding: utf-8 -*-
"""
You can work with Mobile Sync on other devices straight away, but if you'd like to use your app as a `sync-target` (when
you can set items to be synced to your app) you need to init some variables.
.. code-block:: python
def init_sync():
import plexapi
plexapi.X_PLEX_PR... | # -*- coding: utf-8 -*-
"""
You can work with Mobile Sync on other devices straight away, but if you'd like to use your app as a `sync-target` (when
you can set items to be synced to your app) you need to init some variables.
.. code-block:: python
def init_sync():
import plexapi
plexapi.X_PLEX_PR... |
49,434 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/video.py | 1156,1158 | 1099,1163 | metadataDirectory | Clip | 1159,1163 | 1158,1163 | @utils.registerPlexObject
class Clip(
Video, Playable,
ArtUrlMixin, PosterUrlMixin
):
""" Represents a single Clip.
Attributes:
TAG (str): 'Video'
TYPE (str): 'clip'
duration (int): Duration of the clip in milliseconds.
extraType (int): Unknown.
... | @utils.registerPlexObject
class Clip(
Video, Playable,
ArtUrlMixin, PosterUrlMixin
):
""" Represents a single Clip.
Attributes:
TAG (str): 'Video'
TYPE (str): 'clip'
duration (int): Duration of the clip in milliseconds.
extraType (int): Unknown.
... | guid_hash = utils.sha1hash(self.guid)
return str(Path('Metadata') / 'Movies' / guid_hash[0] / f'{guid_hash[1:]}.bundle')
| """ Returns the Plex Media Server data directory where the metadata is stored. """
guid_hash = utils.sha1hash(self.guid)
return str(Path('Metadata') / 'Movies' / guid_hash[0] / f'{guid_hash[1:]}.bundle')
| 11 | 727 | 59 | 786 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... |
49,435 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/video.py | 1251,1252 | 1244,1255 | _loadData | ClipHistory | 1253,1255 | 1252,1255 | @utils.registerPlexObject
class ClipHistory(PlexHistory, Clip):
""" Represents a single Clip history entry
loaded from :func:`~plexapi.server.PlexServer.history`.
"""
_HISTORYTYPE = True
def _loadData(self, data):
FILL_FUNC_BODY | @utils.registerPlexObject
class ClipHistory(PlexHistory, Clip):
""" Represents a single Clip history entry
loaded from :func:`~plexapi.server.PlexServer.history`.
"""
_HISTORYTYPE = True
def _loadData(self, data):
""" Load attribute values from Plex XML response. """
FILL_FUNC_BODY | Clip._loadData(self, data)
PlexHistory._loadData(self, data)
| """ Load attribute values from Plex XML response. """
Clip._loadData(self, data)
PlexHistory._loadData(self, data)
| 4 | 100 | 27 | 127 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... |
49,436 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/video.py | 1212,1213 | 1205,1218 | _loadData | ClipSession | 1214,1218 | 1213,1218 | @utils.registerPlexObject
class ClipSession(PlexSession, Clip):
""" Represents a single Clip session
loaded from :func:`~plexapi.server.PlexServer.sessions`.
"""
_SESSIONTYPE = True
def _loadData(self, data):
FILL_FUNC_BODY | @utils.registerPlexObject
class ClipSession(PlexSession, Clip):
""" Represents a single Clip session
loaded from :func:`~plexapi.server.PlexServer.sessions`.
"""
_SESSIONTYPE = True
def _loadData(self, data):
""" Load attribute values from Plex XML response. """
FILL_FUNC_BODY | Clip._loadData(self, data)
PlexSession._loadData(self, data)
| """ Load attribute values from Plex XML response. """
Clip._loadData(self, data)
PlexSession._loadData(self, data)
| 4 | 98 | 31 | 129 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... |
49,438 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/video.py | 1238,1239 | 1231,1244 | _loadData | EpisodeHistory | 1240,1244 | 1239,1244 | @utils.registerPlexObject
class EpisodeHistory(PlexHistory, Episode):
""" Represents a single Episode history entry
loaded from :func:`~plexapi.server.PlexServer.history`.
"""
_HISTORYTYPE = True
def _loadData(self, data):
FILL_FUNC_BODY | @utils.registerPlexObject
class EpisodeHistory(PlexHistory, Episode):
""" Represents a single Episode history entry
loaded from :func:`~plexapi.server.PlexServer.history`.
"""
_HISTORYTYPE = True
def _loadData(self, data):
""" Load attribute values from Plex XML response. """
FILL_FUNC_... | Episode._loadData(self, data)
PlexHistory._loadData(self, data)
| """ Load attribute values from Plex XML response. """
Episode._loadData(self, data)
PlexHistory._loadData(self, data)
| 4 | 100 | 31 | 131 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... |
49,439 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/video.py | 1199,1200 | 1192,1205 | _loadData | EpisodeSession | 1201,1205 | 1200,1205 | @utils.registerPlexObject
class EpisodeSession(PlexSession, Episode):
""" Represents a single Episode session
loaded from :func:`~plexapi.server.PlexServer.sessions`.
"""
_SESSIONTYPE = True
def _loadData(self, data):
FILL_FUNC_BODY | @utils.registerPlexObject
class EpisodeSession(PlexSession, Episode):
""" Represents a single Episode session
loaded from :func:`~plexapi.server.PlexServer.sessions`.
"""
_SESSIONTYPE = True
def _loadData(self, data):
""" Load attribute values from Plex XML response. """
FILL_FUNC_BODY | Episode._loadData(self, data)
PlexSession._loadData(self, data)
| """ Load attribute values from Plex XML response. """
Episode._loadData(self, data)
PlexSession._loadData(self, data)
| 4 | 98 | 31 | 129 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... |
49,440 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/video.py | 1166,1167 | 1163,1179 | _loadData | Extra | 1168,1174 | 1167,1174 | class Extra(Clip):
""" Represents a single Extra (trailer, behindTheScenes, etc). """
def _loadData(self, data):
FILL_FUNC_BODY def _prettyfilename(self):
""" Returns a filename for use in download. """
return f'{self.title} ({self.subtype})'
| class Extra(Clip):
""" Represents a single Extra (trailer, behindTheScenes, etc). """
def _loadData(self, data):
""" Load attribute values from Plex XML response. """
FILL_FUNC_BODY def _prettyfilename(self):
""" Returns a filename for use in download. """
return f'{self.title} ({sel... | super(Extra, self)._loadData(data)
parent = self._parent()
self.librarySectionID = parent.librarySectionID
self.librarySectionKey = parent.librarySectionKey
self.librarySectionTitle = parent.librarySectionTitle
| """ Load attribute values from Plex XML response. """
super(Extra, self)._loadData(data)
parent = self._parent()
self.librarySectionID = parent.librarySectionID
self.librarySectionKey = parent.librarySectionKey
self.librarySectionTitle = parent.librarySectionTitle
| 14 | 103 | 68 | 171 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... |
49,442 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/video.py | 1225,1226 | 1218,1231 | _loadData | MovieHistory | 1227,1231 | 1226,1231 | @utils.registerPlexObject
class MovieHistory(PlexHistory, Movie):
""" Represents a single Movie history entry
loaded from :func:`~plexapi.server.PlexServer.history`.
"""
_HISTORYTYPE = True
def _loadData(self, data):
FILL_FUNC_BODY | @utils.registerPlexObject
class MovieHistory(PlexHistory, Movie):
""" Represents a single Movie history entry
loaded from :func:`~plexapi.server.PlexServer.history`.
"""
_HISTORYTYPE = True
def _loadData(self, data):
""" Load attribute values from Plex XML response. """
FILL_FUNC_BODY | Movie._loadData(self, data)
PlexHistory._loadData(self, data)
| """ Load attribute values from Plex XML response. """
Movie._loadData(self, data)
PlexHistory._loadData(self, data)
| 4 | 97 | 30 | 127 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... |
49,443 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/plexapi/video.py | 1186,1187 | 1179,1192 | _loadData | MovieSession | 1188,1192 | 1187,1192 | @utils.registerPlexObject
class MovieSession(PlexSession, Movie):
""" Represents a single Movie session
loaded from :func:`~plexapi.server.PlexServer.sessions`.
"""
_SESSIONTYPE = True
def _loadData(self, data):
FILL_FUNC_BODY | @utils.registerPlexObject
class MovieSession(PlexSession, Movie):
""" Represents a single Movie session
loaded from :func:`~plexapi.server.PlexServer.sessions`.
"""
_SESSIONTYPE = True
def _loadData(self, data):
""" Load attribute values from Plex XML response. """
FILL_FUNC_BODY | Movie._loadData(self, data)
PlexSession._loadData(self, data)
| """ Load attribute values from Plex XML response. """
Movie._loadData(self, data)
PlexSession._loadData(self, data)
| 4 | 95 | 30 | 125 | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... | # -*- coding: utf-8 -*-
import os
from functools import cached_property
from pathlib import Path
from urllib.parse import quote_plus
from plexapi import media, utils
from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession
from plexapi.exceptions import BadRequest
from plexapi.mixins import (
... |
49,447 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/tools/plex-autodelete.py | 24,25 | 1,78 | delete_episode | 25,39 | 25,39 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-AutoDelete is a useful to delete all but the last X episodes of a show.
This comes in handy when you have a show you keep downloaded, but do not
religiously keep every single episode that is downloaded.
Usage:
Intended usage is to add one of the tags keep5, keep1... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-AutoDelete is a useful to delete all but the last X episodes of a show.
This comes in handy when you have a show you keep downloaded, but do not
religiously keep every single episode that is downloaded.
Usage:
Intended usage is to add one of the tags keep5, keep1... | for media in episode.media:
for mediapart in media.parts:
try:
filepath = mediapart.file
print('%s Deleting %s.' % (datestr(), filepath))
os.unlink(filepath)
dirname = os.path.dirname(filepath)
if not os.listdir(dirn... | for media in episode.media:
for mediapart in media.parts:
try:
filepath = mediapart.file
print('%s Deleting %s.' % (datestr(), filepath))
os.unlink(filepath)
dirname = os.path.dirname(filepath)
if not os.listdir(dirn... | 47 | 663 | 172 | 835 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-AutoDelete is a useful to delete all but the last X episodes of a show.
This comes in handy when you have a show you keep downloaded, but do not
religiously keep every single episode that is downloaded.
Usage:
Intended usage is to add one of the tags keep5, keep1... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-AutoDelete is a useful to delete all but the last X episodes of a show.
This comes in handy when you have a show you keep downloaded, but do not
religiously keep every single episode that is downloaded.
Usage:
Intended usage is to add one of the tags keep5, keep1... | |
49,448 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/tools/plex-backupwatched.py | 14,15 | 1,105 | _find_server | 16,27 | 15,27 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Backup and restore the watched status of Plex libraries to a json file.
"""
import argparse
from collections import defaultdict
import json
from plexapi import utils
SECTIONS = ('movie', 'show')
def _find_server(account, servername=None):
FILL_FUNC_BODYdef _item_key... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Backup and restore the watched status of Plex libraries to a json file.
"""
import argparse
from collections import defaultdict
import json
from plexapi import utils
SECTIONS = ('movie', 'show')
def _find_server(account, servername=None):
""" Find and return a P... | servers = servers = [s for s in account.resources() if 'server' in s.provides]
# If servername specified find and return it
if servername is not None:
for server in servers:
if server.name == servername:
return server.connect()
raise SystemExit('Unknown server nam... | """ Find and return a PlexServer object. """
servers = servers = [s for s in account.resources() if 'server' in s.provides]
# If servername specified find and return it
if servername is not None:
for server in servers:
if server.name == servername:
return server.conne... | 58 | 1,165 | 131 | 1,296 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Backup and restore the watched status of Plex libraries to a json file.
"""
import argparse
from collections import defaultdict
import json
from plexapi import utils
SECTIONS = ('movie', 'show')
def _find_server(account, servername=None):
FILL_FUNC_BODYdef _item_key... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Backup and restore the watched status of Plex libraries to a json file.
"""
import argparse
from collections import defaultdict
import json
from plexapi import utils
SECTIONS = ('movie', 'show')
def _find_server(account, servername=None):
""" Find and return a P... | |
49,451 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/tools/plex-listdocattrs.py | 11,12 | 1,52 | type_finder | 12,19 | 12,19 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListDocAttrs is used during development of PlexAPI.
Example usage: AttDS(dict or object).write()
"""
import re
from collections import OrderedDict
def type_finder(s):
FILL_FUNC_BODYclass AttDS:
""" Helper that prints docstring attrs. """
def __init__(se... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListDocAttrs is used during development of PlexAPI.
Example usage: AttDS(dict or object).write()
"""
import re
from collections import OrderedDict
def type_finder(s):
FILL_FUNC_BODYclass AttDS:
""" Helper that prints docstring attrs. """
def __init__(se... | type_string = str(type(s))
x = re.search("'(.+)'", type_string)
if x:
return x.group(1)
return ''
| type_string = str(type(s))
x = re.search("'(.+)'", type_string)
if x:
return x.group(1)
return ''
| 13 | 410 | 56 | 466 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListDocAttrs is used during development of PlexAPI.
Example usage: AttDS(dict or object).write()
"""
import re
from collections import OrderedDict
def type_finder(s):
FILL_FUNC_BODYclass AttDS:
""" Helper that prints docstring attrs. """
def __init__(se... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListDocAttrs is used during development of PlexAPI.
Example usage: AttDS(dict or object).write()
"""
import re
from collections import OrderedDict
def type_finder(s):
FILL_FUNC_BODYclass AttDS:
""" Helper that prints docstring attrs. """
def __init__(se... | |
49,452 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/tools/plex-listdocattrs.py | 39,40 | 19,52 | parse | AttDS | 40,49 | 40,49 | class AttDS:
""" Helper that prints docstring attrs. """
def __init__(self, o, keys=None, style='google'):
self.__o = o
if not isinstance(o, dict):
self.o = o.__dict__.items()
self._as_dict = o.__dict__
else:
self.o = o.items()
self._as_di... | class AttDS:
""" Helper that prints docstring attrs. """
def __init__(self, o, keys=None, style='google'):
self.__o = o
if not isinstance(o, dict):
self.o = o.__dict__.items()
self._as_dict = o.__dict__
else:
self.o = o.items()
self._as_di... | for k, v in sorted(self.o, key=lambda k: k[0]):
if self.keys:
ds = ''
for key in self.keys:
ds += '%s=%s ' % (key, self._as_dict.get(key, ''))
else:
ds = ''
self.res_dict[k] = self.template % (k, type_finder(... | for k, v in sorted(self.o, key=lambda k: k[0]):
if self.keys:
ds = ''
for key in self.keys:
ds += '%s=%s ' % (key, self._as_dict.get(key, ''))
else:
ds = ''
self.res_dict[k] = self.template % (k, type_finder(... | 36 | 225 | 116 | 341 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListDocAttrs is used during development of PlexAPI.
Example usage: AttDS(dict or object).write()
"""
import re
from collections import OrderedDict
def type_finder(s):
type_string = str(type(s))
x = re.search("'(.+)'", type_string)
if x:
retur... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListDocAttrs is used during development of PlexAPI.
Example usage: AttDS(dict or object).write()
"""
import re
from collections import OrderedDict
def type_finder(s):
type_string = str(type(s))
x = re.search("'(.+)'", type_string)
if x:
retur... |
49,453 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/tools/plex-listsettings.py | 56,57 | 1,76 | list_settings | 57,73 | 57,73 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListSettings is used during development of PlexAPI and loops through available
setting items and separates them by group as well as display the variable type. The
resulting list is used for the creation of docs/settingslist.rst.
"""
from collections import default... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListSettings is used during development of PlexAPI and loops through available
setting items and separates them by group as well as display the variable type. The
resulting list is used for the creation of docs/settingslist.rst.
"""
from collections import default... | # Place settings into groups..
plex = PlexServer()
groups = defaultdict(list)
for setting in plex.settings.all():
group = _setting_group(setting)
groups[group].append(setting)
# Build the rst output file
special_groups = ('general', 'misc', 'undocumented')
with open(OUTPUT, '... | # Place settings into groups..
plex = PlexServer()
groups = defaultdict(list)
for setting in plex.settings.all():
group = _setting_group(setting)
groups[group].append(setting)
# Build the rst output file
special_groups = ('general', 'misc', 'undocumented')
with open(OUTPUT, '... | 60 | 797 | 200 | 997 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListSettings is used during development of PlexAPI and loops through available
setting items and separates them by group as well as display the variable type. The
resulting list is used for the creation of docs/settingslist.rst.
"""
from collections import default... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListSettings is used during development of PlexAPI and loops through available
setting items and separates them by group as well as display the variable type. The
resulting list is used for the creation of docs/settingslist.rst.
"""
from collections import default... | |
49,454 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/tools/plex-listtokens.py | 21,22 | 1,92 | _list_resources | 22,36 | 22,36 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListTokens is a simple utility to fetch and list all known Plex
Server tokens your plex.tv account has access to. Because this information
comes from the plex.tv website, we need to ask for your username
and password. Alternatively, if you do not wish to enter you... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListTokens is a simple utility to fetch and list all known Plex
Server tokens your plex.tv account has access to. Because this information
comes from the plex.tv website, we need to ask for your username
and password. Alternatively, if you do not wish to enter you... | items = []
print('Finding Plex resources..')
resources = account.resources()
for r in [r for r in resources if r.accessToken]:
for connection in r.connections:
local = 'Local' if connection.local else 'Remote'
extras = [r.provides]
items.append(FORMAT % ('Reso... | items = []
print('Finding Plex resources..')
resources = account.resources()
for r in [r for r in resources if r.accessToken]:
for connection in r.connections:
local = 'Local' if connection.local else 'Remote'
extras = [r.provides]
items.append(FORMAT % ('Reso... | 59 | 872 | 201 | 1,073 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListTokens is a simple utility to fetch and list all known Plex
Server tokens your plex.tv account has access to. Because this information
comes from the plex.tv website, we need to ask for your username
and password. Alternatively, if you do not wish to enter you... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-ListTokens is a simple utility to fetch and list all known Plex
Server tokens your plex.tv account has access to. Because this information
comes from the plex.tv website, we need to ask for your username
and password. Alternatively, if you do not wish to enter you... | |
49,455 | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi | /home/hieuvd/dung_repo/raw/stars_03/pkkid_python-plexapi/python-plexapi/tools/plex-markwatched.py | 27,28 | 1,58 | _get_title | 28,33 | 28,33 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-MarkWatched is a useful to always mark a show as watched. This comes in
handy when you have a show you keep downloaded, but do not religiously watch
every single episode that is downloaded. By marking everything watched, it
will keep the show out of your OnDeck li... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-MarkWatched is a useful to always mark a show as watched. This comes in
handy when you have a show you keep downloaded, but do not religiously watch
every single episode that is downloaded. By marking everything watched, it
will keep the show out of your OnDeck li... | if item.type == 'episode':
return '{title} {episode}'.format(title=item.grandparentTitle, episode=item.seasonEpisode)
return item.title
| if item.type == 'episode':
return '{title} {episode}'.format(title=item.grandparentTitle, episode=item.seasonEpisode)
return item.title
| 10 | 635 | 54 | 689 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-MarkWatched is a useful to always mark a show as watched. This comes in
handy when you have a show you keep downloaded, but do not religiously watch
every single episode that is downloaded. By marking everything watched, it
will keep the show out of your OnDeck li... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Plex-MarkWatched is a useful to always mark a show as watched. This comes in
handy when you have a show you keep downloaded, but do not religiously watch
every single episode that is downloaded. By marking everything watched, it
will keep the show out of your OnDeck li... | |
49,456 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/pgoapi/auth.py | 113,114 | 32,134 | check_access_token | Auth | 118,134 | 114,134 | class Auth:
def __init__(self):
self.log = logging.getLogger(__name__)
self._auth_provider = None
self._login = False
"""
oauth2 uses refresh tokens (which basically never expires)
to get an access_token which is only valid for a certain time)
"""
... | class Auth:
def __init__(self):
self.log = logging.getLogger(__name__)
self._auth_provider = None
self._login = False
"""
oauth2 uses refresh tokens (which basically never expires)
to get an access_token which is only valid for a certain time)
"""
... | now_s = get_time() + 120
if self._access_token is not None:
if self._access_token_expiry == 0:
self.log.debug('No Access Token Expiry found - assuming it is still valid!')
return True
elif self._access_token_expiry > now_s:
h, m, s... | """
Add few seconds to now so the token get refreshed
before it invalidates in the middle of the request
"""
now_s = get_time() + 120
if self._access_token is not None:
if self._access_token_expiry == 0:
self.log.debug('No Access Token Expiry... | 69 | 822 | 237 | 1,059 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... |
49,457 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/pgoapi/auth_google.py | 52,53 | 35,110 | user_login | AuthGoogle | 53,78 | 53,78 | class AuthGoogle(Auth):
GOOGLE_LOGIN_ANDROID_ID = '9774d56d682e549c'
GOOGLE_LOGIN_SERVICE= 'audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com'
GOOGLE_LOGIN_APP = 'com.nianticlabs.pokemongo'
GOOGLE_LOGIN_CLIENT_SIG = '321187995bc7cdc2b5fc91b11a96e2baa8602... | class AuthGoogle(Auth):
GOOGLE_LOGIN_ANDROID_ID = '9774d56d682e549c'
GOOGLE_LOGIN_SERVICE= 'audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com'
GOOGLE_LOGIN_APP = 'com.nianticlabs.pokemongo'
GOOGLE_LOGIN_CLIENT_SIG = '321187995bc7cdc2b5fc91b11a96e2baa8602... | self.log.info('Google User Login for: {}'.format(username))
if not isinstance(username, string_types) or not isinstance(password, string_types):
raise InvalidCredentialsException("Username/password not correctly specified")
user_login = perform_master_login(username, password, self... | self.log.info('Google User Login for: {}'.format(username))
if not isinstance(username, string_types) or not isinstance(password, string_types):
raise InvalidCredentialsException("Username/password not correctly specified")
user_login = perform_master_login(username, password, self... | 71 | 694 | 299 | 993 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... |
49,458 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/pgoapi/auth_ptc.py | 59,60 | 41,173 | set_proxy | AuthPtc | 60,62 | 60,62 | class AuthPtc(Auth):
PTC_LOGIN_URL1 = 'https://sso.pokemon.com/sso/oauth2.0/authorize?client_id=mobile-app_pokemon-go&redirect_uri=https%3A%2F%2Fwww.nianticlabs.com%2Fpokemongo%2Ferror'
PTC_LOGIN_URL2 = 'https://sso.pokemon.com/sso/login?service=http%3A%2F%2Fsso.pokemon.com%2Fsso%2Foauth2.0%2FcallbackAuthorize... | class AuthPtc(Auth):
PTC_LOGIN_URL1 = 'https://sso.pokemon.com/sso/oauth2.0/authorize?client_id=mobile-app_pokemon-go&redirect_uri=https%3A%2F%2Fwww.nianticlabs.com%2Fpokemongo%2Ferror'
PTC_LOGIN_URL2 = 'https://sso.pokemon.com/sso/login?service=http%3A%2F%2Fsso.pokemon.com%2Fsso%2Foauth2.0%2FcallbackAuthorize... | self._session.proxies = proxy_config
| self._session.proxies = proxy_config
| 3 | 1,725 | 16 | 1,741 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... |
49,459 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/pgoapi/exceptions.py | 147,148 | 142,152 | get_redirected_endpoint | ServerApiEndpointRedirectException | 148,150 | 148,150 | class ServerApiEndpointRedirectException(PgoapiError):
"""Raised when the API redirects you to another endpoint"""
def __init__(self):
self._api_endpoint = None
def get_redirected_endpoint(self):
FILL_FUNC_BODY def set_redirected_endpoint(self, api_endpoint):
self._api_endpoint = api_end... | class ServerApiEndpointRedirectException(PgoapiError):
"""Raised when the API redirects you to another endpoint"""
def __init__(self):
self._api_endpoint = None
def get_redirected_endpoint(self):
FILL_FUNC_BODY def set_redirected_endpoint(self, api_endpoint):
self._api_endpoint = api_end... | return self._api_endpoint
| return self._api_endpoint
| 2 | 104 | 12 | 116 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... |
49,460 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/pgoapi/hash_engine.py | 14,15 | 1,16 | get_request_hashes | HashEngine | 15,16 | 15,16 | class HashEngine:
def __init__(self):
self.location_hash = None
self.location_auth_hash = None
self.request_hashes = []
def hash(self, timestamp, latitude, longitude, altitude, authticket, sessiondata, requests):
raise NotImplementedError()
def get_location_hash(self):
... | class HashEngine:
def __init__(self):
self.location_hash = None
self.location_auth_hash = None
self.request_hashes = []
def hash(self, timestamp, latitude, longitude, altitude, authticket, sessiondata, requests):
raise NotImplementedError()
def get_location_hash(self):
... | return self.request_hashes
| return self.request_hashes
| 2 | 145 | 10 | 155 | class HashEngine:
def __init__(self):
self.location_hash = None
self.location_auth_hash = None
self.request_hashes = []
def hash(self, timestamp, latitude, longitude, altitude, authticket, sessiondata, requests):
raise NotImplementedError()
def get_location_hash(self):
... | class HashEngine:
def __init__(self):
self.location_hash = None
self.location_auth_hash = None
self.request_hashes = []
def hash(self, timestamp, latitude, longitude, altitude, authticket, sessiondata, requests):
raise NotImplementedError()
def get_location_hash(self):
... |
49,461 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/pgoapi/hash_server.py | 26,27 | 12,85 | hash | HashServer | 27,85 | 27,85 | class HashServer(HashEngine):
_session = requests.session()
_adapter = requests.adapters.HTTPAdapter(pool_maxsize=150, pool_block=True)
_session.mount('https://', _adapter)
_session.verify = True
_session.headers.update({'User-Agent': 'Python pgoapi @pogodev'})
endpoint = "https://pokehash.buddy... | class HashServer(HashEngine):
_session = requests.session()
_adapter = requests.adapters.HTTPAdapter(pool_maxsize=150, pool_block=True)
_session.mount('https://', _adapter)
_session.verify = True
_session.headers.update({'User-Agent': 'Python pgoapi @pogodev'})
endpoint = "https://pokehash.buddy... | self.location_hash = None
self.location_auth_hash = None
self.request_hashes = []
payload = {
'Timestamp': timestamp,
'Latitude64': unpack('<q', pack('<d', latitude))[0],
'Longitude64': unpack('<q', pack('<d', longitude))[0],
'Accuracy64':... | self.location_hash = None
self.location_auth_hash = None
self.request_hashes = []
payload = {
'Timestamp': timestamp,
'Latitude64': unpack('<q', pack('<d', latitude))[0],
'Longitude64': unpack('<q', pack('<d', longitude))[0],
'Accuracy64':... | 187 | 241 | 883 | 1,124 | from __future__ import absolute_import
import ctypes
import base64
import requests
from struct import pack, unpack
from pgoapi.hash_engine import HashEngine
from pgoapi.exceptions import BadHashRequestException, HashingOfflineException, HashingQuotaExceededException, HashingTimeoutException, MalformedHashResponseExc... | from __future__ import absolute_import
import ctypes
import base64
import requests
from struct import pack, unpack
from pgoapi.hash_engine import HashEngine
from pgoapi.exceptions import BadHashRequestException, HashingOfflineException, HashingQuotaExceededException, HashingTimeoutException, MalformedHashResponseExc... |
49,462 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/pgoapi/utilities.py | 79,80 | 1,116 | get_cell_ids | 80,93 | 80,93 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... | # Max values allowed by server according to this comment:
# https://github.com/AeonLucid/POGOProtos/issues/83#issuecomment-235612285
if radius > 1500:
radius = 1500 # radius = 1500 is max allowed by the server
region = Cap.from_axis_angle(LatLng.from_degrees(lat, long).to_point(), Angle.from_de... | # Max values allowed by server according to this comment:
# https://github.com/AeonLucid/POGOProtos/issues/83#issuecomment-235612285
if radius > 1500:
radius = 1500 # radius = 1500 is max allowed by the server
region = Cap.from_axis_angle(LatLng.from_degrees(lat, long).to_point(), Angle.from_de... | 65 | 1,092 | 247 | 1,339 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... | |
49,463 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/pgoapi/utilities.py | 63,64 | 62,67 | default | JSONByteEncoder | 64,67 | 64,67 | class JSONByteEncoder(JSONEncoder):
def default(self, o):
FILL_FUNC_BODY | class JSONByteEncoder(JSONEncoder):
def default(self, o):
FILL_FUNC_BODY | return o.decode('utf-8')
| return o.decode('utf-8')
| 2 | 30 | 16 | 46 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... |
49,464 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/scripts/accept-tos.py | 14,15 | 1,30 | accept_tos | 15,25 | 15,25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""accept-tos.py: Example script to accept in-game Terms of Service"""
from pgoapi import PGoApi
from pgoapi.utilities import f2i
from pgoapi import utilities as util
from pgoapi.exceptions import AuthException
import pprint
import time
import threading
def accept_tos(userna... | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""accept-tos.py: Example script to accept in-game Terms of Service"""
from pgoapi import PGoApi
from pgoapi.utilities import f2i
from pgoapi import utilities as util
from pgoapi.exceptions import AuthException
import pprint
import time
import threading
def accept_tos(userna... | api = PGoApi()
api.set_position(lat, lon, alt)
api.login(auth, username, password)
time.sleep(2)
req = api.create_request()
req.mark_tutorial_complete(tutorials_completed = 0, send_marketing_emails = False, send_push_notifications = False)
response = req.call()
print('Accepted Terms of Service for {}'.format(us... | api = PGoApi()
api.set_position(lat, lon, alt)
api.login(auth, username, password)
time.sleep(2)
req = api.create_request()
req.mark_tutorial_complete(tutorials_completed = 0, send_marketing_emails = False, send_push_notifications = False)
response = req.call()
print('Accepted Terms of Service for {}'.format(us... | 34 | 264 | 159 | 423 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""accept-tos.py: Example script to accept in-game Terms of Service"""
from pgoapi import PGoApi
from pgoapi.utilities import f2i
from pgoapi import utilities as util
from pgoapi.exceptions import AuthException
import pprint
import time
import threading
def accept_tos(userna... | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""accept-tos.py: Example script to accept in-game Terms of Service"""
from pgoapi import PGoApi
from pgoapi.utilities import f2i
from pgoapi import utilities as util
from pgoapi.exceptions import AuthException
import pprint
import time
import threading
def accept_tos(userna... | |
49,465 | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi | /home/hieuvd/dung_repo/raw/stars_03/pogodevorg_pgoapi/pgoapi/scripts/pokecli.py | 46,47 | 1,137 | init_config | 47,85 | 47,85 | #!/usr/bin/env python
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limita... | #!/usr/bin/env python
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limita... | parser = argparse.ArgumentParser()
config_file = "config.json"
# If config file exists, load variables from json
load = {}
if os.path.isfile(config_file):
with open(config_file) as data:
load.update(json.load(data))
# Read passed in Arguments
required = lambda x: not ... | parser = argparse.ArgumentParser()
config_file = "config.json"
# If config file exists, load variables from json
load = {}
if os.path.isfile(config_file):
with open(config_file) as data:
load.update(json.load(data))
# Read passed in Arguments
required = lambda x: not ... | 139 | 1,087 | 526 | 1,613 | #!/usr/bin/env python
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limita... | #!/usr/bin/env python
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limita... | |
49,469 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/base.py | 43,45 | 15,56 | init_base | PolychromaticBase | 48,52 | 45,52 | class PolychromaticBase(object):
"""
Essential variables/functions for minimum functionality of the application.
"""
# Should the process restart later
exec_path = ""
exec_args = []
# Localization
i18n = Locales()
_ = i18n.init()
# Storage
paths = Paths()
# TODO: Refac... | class PolychromaticBase(object):
"""
Essential variables/functions for minimum functionality of the application.
"""
# Should the process restart later
exec_path = ""
exec_args = []
# Localization
i18n = Locales()
_ = i18n.init()
# Storage
paths = Paths()
# TODO: Refac... | PolychromaticBase.exec_path = path
PolychromaticBase.exec_args = args
PolychromaticBase.middleman._base = self
| """
Finish populating variables. Run this after initializing the class.
"""
PolychromaticBase.exec_path = path
PolychromaticBase.exec_args = args
PolychromaticBase.middleman._base = self
| 9 | 283 | 45 | 328 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2021-2024 Luke Horwell <code@horwell.me>
"""
Variables and functions for essential operation of the application.
All interfaces and most classes will inherit these.
"""
from . import common as common_class
from . import preferences as preferences_class
from ... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2021-2024 Luke Horwell <code@horwell.me>
"""
Variables and functions for essential operation of the application.
All interfaces and most classes will inherit these.
"""
from . import common as common_class
from . import preferences as preferences_class
from ... |
49,470 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/bulkapply.py | 82,83 | 62,170 | refresh | BulkApplyOptions | 86,104 | 83,104 | class BulkApplyOptions(object):
"""
Assembles and processes "Apply to All" options for applying a brightness,
effect or colour to all devices at once. The Controller and tray applet
interfaces will interpret this data.
"""
def __init__(self, middleman=mn.Middleman):
self.middleman = midd... | class BulkApplyOptions(object):
"""
Assembles and processes "Apply to All" options for applying a brightness,
effect or colour to all devices at once. The Controller and tray applet
interfaces will interpret this data.
"""
def __init__(self, middleman=mn.Middleman):
self.middleman = midd... | brightness = []
effects = []
has_colours = False
for device in self.devices:
for zone in device.zones:
for option in zone.options:
if option.uid == "brightness":
brightness.append(option)
elif is... | """
Analyze devices and populate the bulk objects.
"""
brightness = []
effects = []
has_colours = False
for device in self.devices:
for zone in device.zones:
for option in zone.options:
if option.uid == "brightness"... | 40 | 864 | 178 | 1,042 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... |
49,471 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/bulkapply.py | 23,24 | 12,27 | apply | BulkOption | 24,27 | 24,27 | class BulkOption(object):
"""
An object representing a selectable 'apply to all' button.
"""
def __init__(self, options=[], middleman=mn.Middleman, label="", icon="", value=None):
self.options = options
self.middleman = middleman
self.label = label
self.icon = icon
... | class BulkOption(object):
"""
An object representing a selectable 'apply to all' button.
"""
def __init__(self, options=[], middleman=mn.Middleman, label="", icon="", value=None):
self.options = options
self.middleman = middleman
self.label = label
self.icon = icon
... | raise NotImplementedError
| raise NotImplementedError
| 2 | 117 | 13 | 130 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... |
49,472 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/bulkapply.py | 28,29 | 27,37 | apply | _BulkBrightness | 29,37 | 29,37 | class _BulkBrightness(BulkOption):
def apply(self, a=None):
FILL_FUNC_BODY | class _BulkBrightness(BulkOption):
def apply(self, a=None):
FILL_FUNC_BODY | # 'a' is an object passed from Tray Applet. Unnecessary.
for option in self.options:
if isinstance(option, Backend.SliderOption):
option.apply(self.value)
elif isinstance(option, Backend.ToggleOption):
option.apply(True if self.value > 0 else False... | # 'a' is an object passed from Tray Applet. Unnecessary.
for option in self.options:
if isinstance(option, Backend.SliderOption):
option.apply(self.value)
elif isinstance(option, Backend.ToggleOption):
option.apply(True if self.value > 0 else False... | 28 | 34 | 94 | 128 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... |
49,473 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/bulkapply.py | 51,52 | 50,62 | apply | _BulkColour | 52,62 | 52,62 | class _BulkColour(BulkOption):
def apply(self, a=None):
FILL_FUNC_BODY | class _BulkColour(BulkOption):
def apply(self, a=None):
FILL_FUNC_BODY | # 'a' is an object passed from Tray Applet. Unnecessary.
for device in self.options:
device.refresh()
try:
self.middleman.set_colour_for_active_effect_device(device, self.value)
except IndexError:
# Not supported for this effect
... | # 'a' is an object passed from Tray Applet. Unnecessary.
for device in self.options:
device.refresh()
try:
self.middleman.set_colour_for_active_effect_device(device, self.value)
except IndexError:
# Not supported for this effect
... | 27 | 33 | 94 | 127 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... |
49,474 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/bulkapply.py | 38,39 | 37,50 | apply | _BulkEffect | 39,50 | 39,50 | class _BulkEffect(BulkOption):
def apply(self, a=None):
FILL_FUNC_BODY | class _BulkEffect(BulkOption):
def apply(self, a=None):
FILL_FUNC_BODY | # 'a' is an object passed from Tray Applet. Unnecessary.
for option in self.options:
if not option.uid == self.value:
continue
if option.parameters:
default_param = self.middleman.get_default_parameter(option)
option.apply(default_p... | # 'a' is an object passed from Tray Applet. Unnecessary.
for option in self.options:
if not option.uid == self.value:
continue
if option.parameters:
default_param = self.middleman.get_default_parameter(option)
option.apply(default_p... | 28 | 32 | 104 | 136 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2022 Luke Horwell <code@horwell.me>
"""
Handles the bulk "Apply to All" options to apply settings to all devices at once.
"""
from . import common
from . import middleman as mn
from . import preferences
from .backends._backend import Backend
class BulkOptio... |
49,475 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/effects.py | 323,324 | 240,362 | get_svg_grid | DeviceMapGraphics | 327,362 | 324,362 | class DeviceMapGraphics(object):
"""
Responsible for populating the list of device graphics and generating SVG
graphics of a grid if a specific device is unavailable (or by request).
"""
def __init__(self, appdata):
self.appdata = appdata
self.map_index = os.path.join(common.paths.da... | class DeviceMapGraphics(object):
"""
Responsible for populating the list of device graphics and generating SVG
graphics of a grid if a specific device is unavailable (or by request).
"""
def __init__(self, appdata):
self.appdata = appdata
self.map_index = os.path.join(common.paths.da... | svg = []
# How large is each grid?
square_px = 50
margin_px = 1
fill_colour = "#00ff00"
stroke_colour = "#008000"
stroke_width = 1
total_X_blocks = cols
total_Y_blocks = rows
svg.append('<svg width="{width}px" height="{height}px"> version... | """
Returns the SVG of the device's matrix represented as a 'pretty' graphic.
"""
svg = []
# How large is each grid?
square_px = 50
margin_px = 1
fill_colour = "#00ff00"
stroke_colour = "#008000"
stroke_width = 1
total_X_blocks = c... | 128 | 889 | 551 | 1,440 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2020-2024 Luke Horwell <code@horwell.me>
"""
Handles the processing of custom software effects and device mapping.
"""
import importlib
import json
import os
import platform
import shutil
from . import common, fileman
# Effect Types
TYPE_LAYERED = 1
TYPE_S... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2020-2024 Luke Horwell <code@horwell.me>
"""
Handles the processing of custom software effects and device mapping.
"""
import importlib
import json
import os
import platform
import shutil
from . import common, fileman
# Effect Types
TYPE_LAYERED = 1
TYPE_S... |
49,477 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/effects.py | 507,508 | 362,560 | get_parameters | ScriptedEffectHandler | 514,560 | 508,560 | class ScriptedEffectHandler(object):
"""
Parses scripted effects to verify dependencies, the environment and parse parameters.
"""
def __init__(self, fileman, path):
self.fileman = fileman
self.path = path
self.script_path = self.path.replace(".json", ".py")
self.data = f... | class ScriptedEffectHandler(object):
"""
Parses scripted effects to verify dependencies, the environment and parse parameters.
"""
def __init__(self, fileman, path):
self.fileman = fileman
self.path = path
self.script_path = self.path.replace(".json", ".py")
self.data = f... | parameters = {}
for param in self.data["parameters"]:
key = param["var"]
value = param["default"]
param_type = param["type"]
# Value already saved?
if "value" in param.keys():
value = param["value"]
# Use default ... | """
Returns a dictionary of processed parameters for use with this effect.
To ensure the effect has a value, invalid or missing parameters will be
replaced by its default value.
"""
parameters = {}
for param in self.data["parameters"]:
key = param["v... | 128 | 1,108 | 371 | 1,479 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2020-2024 Luke Horwell <code@horwell.me>
"""
Handles the processing of custom software effects and device mapping.
"""
import importlib
import json
import os
import platform
import shutil
from . import common, fileman
# Effect Types
TYPE_LAYERED = 1
TYPE_S... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2020-2024 Luke Horwell <code@horwell.me>
"""
Handles the processing of custom software effects and device mapping.
"""
import importlib
import json
import os
import platform
import shutil
from . import common, fileman
# Effect Types
TYPE_LAYERED = 1
TYPE_S... |
49,479 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/locales.py | 46,47 | 10,55 | get_current_locale | Locales | 50,55 | 47,55 | class Locales(object):
"""
Supports localisation throughout the application by utilising gettext.
The "_" object is used for processing strings.
"""
def __init__(self, force_locale=""):
self.force_locale = force_locale
self.locale = force_locale
self.translation = None
... | class Locales(object):
"""
Supports localisation throughout the application by utilising gettext.
The "_" object is used for processing strings.
"""
def __init__(self, force_locale=""):
self.force_locale = force_locale
self.locale = force_locale
self.translation = None
... | if self.translation and "language" in self.translation.info():
return self.translation.info()["language"]
# Fallback to default
return "en_GB"
| """
Returns a string describing the current locale. E.g. "de" or "en_US".
"""
if self.translation and "language" in self.translation.info():
return self.translation.info()["language"]
# Fallback to default
return "en_GB"
| 14 | 453 | 50 | 503 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2017-2024 Luke Horwell <code@horwell.me>
"""
Contains the UI localization for Polychromatic. Powered by GNU's gettext.
"""
import gettext
import os
class Locales(object):
"""
Supports localisation throughout the application by utilising gettext.
... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2017-2024 Luke Horwell <code@horwell.me>
"""
Contains the UI localization for Polychromatic. Powered by GNU's gettext.
"""
import gettext
import os
class Locales(object):
"""
Supports localisation throughout the application by utilising gettext.
... |
49,481 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/paths.py | 57,58 | 10,117 | set_dev_mode | Paths | 61,70 | 58,70 | class Paths():
"""
Reference file/folder paths for data files, configuration and cache directories.
"""
def __init__(self):
# System-wide data
self.data_dir = self.get_data_path()
# Local data
self.config = self.get_config_path()
self.cache = self.get_cache_path(... | class Paths():
"""
Reference file/folder paths for data files, configuration and cache directories.
"""
def __init__(self):
# System-wide data
self.data_dir = self.get_data_path()
# Local data
self.config = self.get_config_path()
self.cache = self.get_cache_path(... | try:
if os.environ["POLYCHROMATIC_DEV_CFG"] == "true":
# __file__ = polychromatic/base.py
self.cache = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "savedatadev", "cache"))
self.config = os.path.realpath(os.path.join(os.path.dirname(_... | """
When developing within the repository, change the paths accordingly.
"""
try:
if os.environ["POLYCHROMATIC_DEV_CFG"] == "true":
# __file__ = polychromatic/base.py
self.cache = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "... | 27 | 1,139 | 153 | 1,292 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2016-2024 Luke Horwell <code@horwell.me>
"""
Module for determining where files are located.
"""
import os
import sys
class Paths():
"""
Reference file/folder paths for data files, configuration and cache directories.
"""
def __init__(self):... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2016-2024 Luke Horwell <code@horwell.me>
"""
Module for determining where files are located.
"""
import os
import sys
class Paths():
"""
Reference file/folder paths for data files, configuration and cache directories.
"""
def __init__(self):... |
49,482 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/polychromatic/procpid.py | 296,297 | 249,370 | get_preset | DeviceSoftwareState | 303,312 | 297,312 | class DeviceSoftwareState(object):
"""
Tracks the active custom software effect or preset for a specified device,
such as when a custom effect is currently being played and/or a preset is
currently in use.
This is metadata presented to the user and internally to know the last
effect or preset (... | class DeviceSoftwareState(object):
"""
Tracks the active custom software effect or preset for a specified device,
such as when a custom effect is currently being played and/or a preset is
currently in use.
This is metadata presented to the user and internally to know the last
effect or preset (... | try:
return {
"name": self.state["preset"]["name"],
"icon": self.state["preset"]["icon"],
"path": self.state["preset"]["path"]
}
except KeyError:
return None
| """
Returns the metadata of the preset that is currently representing this
device's current status.
If no preset is set, this will return None.
"""
try:
return {
"name": self.state["preset"]["name"],
"icon": self.state["preset"... | 14 | 954 | 76 | 1,030 | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2020-2024 Luke Horwell <code@horwell.me>
"""
This module is responsible for managing other Polychromatic processes.
"""
import glob
import json
import os
import shutil
import signal
import subprocess
from . import common
class ProcessManager():
"""
... | # Polychromatic is licensed under the GPLv3.
# Copyright (C) 2020-2024 Luke Horwell <code@horwell.me>
"""
This module is responsible for managing other Polychromatic processes.
"""
import glob
import json
import os
import shutil
import signal
import subprocess
from . import common
class ProcessManager():
"""
... |
49,484 | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic | /home/hieuvd/dung_repo/raw/stars_03/polychromatic_polychromatic/polychromatic/scripts/packaging/generate-debian-changelog.py | 21,22 | 1,59 | run_command | 22,27 | 22,27 | #!/usr/bin/python3
#
# This script is used by the CI system to produce changelogs for automated
# Debian/Ubuntu builds.
#
# Parameters: <release> <codename>
# E.g. "20.04" "focal"
#
import datetime
import os
import subprocess
import sys
UBUNTU_RELEASE = sys.argv[1]
UBUNTU_CODENAME = sys.argv[2]
CHANGELOG = os.... | #!/usr/bin/python3
#
# This script is used by the CI system to produce changelogs for automated
# Debian/Ubuntu builds.
#
# Parameters: <release> <codename>
# E.g. "20.04" "focal"
#
import datetime
import os
import subprocess
import sys
UBUNTU_RELEASE = sys.argv[1]
UBUNTU_CODENAME = sys.argv[2]
CHANGELOG = os.... | cmd = cmd.split(" ")
return str(subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].decode("UTF-8")).strip()
# Determine package version
| cmd = cmd.split(" ")
return str(subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].decode("UTF-8")).strip()
# Determine package version
| 11 | 643 | 59 | 702 | #!/usr/bin/python3
#
# This script is used by the CI system to produce changelogs for automated
# Debian/Ubuntu builds.
#
# Parameters: <release> <codename>
# E.g. "20.04" "focal"
#
import datetime
import os
import subprocess
import sys
UBUNTU_RELEASE = sys.argv[1]
UBUNTU_CODENAME = sys.argv[2]
CHANGELOG = os.... | #!/usr/bin/python3
#
# This script is used by the CI system to produce changelogs for automated
# Debian/Ubuntu builds.
#
# Parameters: <release> <codename>
# E.g. "20.04" "focal"
#
import datetime
import os
import subprocess
import sys
UBUNTU_RELEASE = sys.argv[1]
UBUNTU_CODENAME = sys.argv[2]
CHANGELOG = os.... | |
49,485 | /home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch | /home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch/probtorch/objectives/importance.py | 5,7 | 1,60 | elbo | 7,60 | 7,60 | from numbers import Number
from probtorch.util import log_mean_exp
def elbo(q, p, sample_dim=None, batch_dim=None, alpha=0.1,
size_average=True, reduce=True):
FILL_FUNC_BODY | from numbers import Number
from probtorch.util import log_mean_exp
def elbo(q, p, sample_dim=None, batch_dim=None, alpha=0.1,
size_average=True, reduce=True):
FILL_FUNC_BODY | r"""Calculates an importance weighted Monte Carlo estimate of the
semi-supervised evidence lower bound (ELBO)
.. math:: \frac{1}{B} \sum_{b=1}^B
\log \left[
\frac{1}{S} \sum_{s=1}^S
\frac{p(x^{(b)}, y^{(b)}, z^{(s,b)})}
{q(z^{(s,b)} | x^{(b... | r"""Calculates an importance weighted Monte Carlo estimate of the
semi-supervised evidence lower bound (ELBO)
.. math:: \frac{1}{B} \sum_{b=1}^B
\log \left[
\frac{1}{S} \sum_{s=1}^S
\frac{p(x^{(b)}, y^{(b)}, z^{(s,b)})}
{q(z^{(s,b)} | x^{(b... | 255 | 70 | 794 | 864 | from numbers import Number
from probtorch.util import log_mean_exp
def elbo(q, p, sample_dim=None, batch_dim=None, alpha=0.1,
size_average=True, reduce=True):
FILL_FUNC_BODY | from numbers import Number
from probtorch.util import log_mean_exp
def elbo(q, p, sample_dim=None, batch_dim=None, alpha=0.1,
size_average=True, reduce=True):
FILL_FUNC_BODY |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.