partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
test | Library.contains_tracks | Check if one or more tracks is already saved in the current Spotify user’s ‘Your Music’ library.
Parameters
----------
tracks : Union[Track, str]
A sequence of track objects or spotify IDs | spotify/models/library.py | async def contains_tracks(self, *tracks: Sequence[Union[str, Track]]) -> List[bool]:
"""Check if one or more tracks is already saved in the current Spotify user’s ‘Your Music’ library.
Parameters
----------
tracks : Union[Track, str]
A sequence of track objects or spotify ID... | async def contains_tracks(self, *tracks: Sequence[Union[str, Track]]) -> List[bool]:
"""Check if one or more tracks is already saved in the current Spotify user’s ‘Your Music’ library.
Parameters
----------
tracks : Union[Track, str]
A sequence of track objects or spotify ID... | [
"Check",
"if",
"one",
"or",
"more",
"tracks",
"is",
"already",
"saved",
"in",
"the",
"current",
"Spotify",
"user’s",
"‘Your",
"Music’",
"library",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/library.py#L40-L49 | [
"async",
"def",
"contains_tracks",
"(",
"self",
",",
"*",
"tracks",
":",
"Sequence",
"[",
"Union",
"[",
"str",
",",
"Track",
"]",
"]",
")",
"->",
"List",
"[",
"bool",
"]",
":",
"_tracks",
"=",
"[",
"(",
"obj",
"if",
"isinstance",
"(",
"obj",
",",
... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Library.get_tracks | Get a list of the songs saved in the current Spotify user’s ‘Your Music’ library.
Parameters
----------
limit : Optional[int]
The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
offset : Optional[int]
The index of the first item to return... | spotify/models/library.py | async def get_tracks(self, *, limit=20, offset=0) -> List[Track]:
"""Get a list of the songs saved in the current Spotify user’s ‘Your Music’ library.
Parameters
----------
limit : Optional[int]
The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
... | async def get_tracks(self, *, limit=20, offset=0) -> List[Track]:
"""Get a list of the songs saved in the current Spotify user’s ‘Your Music’ library.
Parameters
----------
limit : Optional[int]
The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
... | [
"Get",
"a",
"list",
"of",
"the",
"songs",
"saved",
"in",
"the",
"current",
"Spotify",
"user’s",
"‘Your",
"Music’",
"library",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/library.py#L51-L63 | [
"async",
"def",
"get_tracks",
"(",
"self",
",",
"*",
",",
"limit",
"=",
"20",
",",
"offset",
"=",
"0",
")",
"->",
"List",
"[",
"Track",
"]",
":",
"data",
"=",
"await",
"self",
".",
"user",
".",
"http",
".",
"saved_tracks",
"(",
"limit",
"=",
"lim... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Library.get_albums | Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library.
Parameters
----------
limit : Optional[int]
The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
offset : Optional[int]
The index of the first item to retur... | spotify/models/library.py | async def get_albums(self, *, limit=20, offset=0) -> List[Album]:
"""Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library.
Parameters
----------
limit : Optional[int]
The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
... | async def get_albums(self, *, limit=20, offset=0) -> List[Album]:
"""Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library.
Parameters
----------
limit : Optional[int]
The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
... | [
"Get",
"a",
"list",
"of",
"the",
"albums",
"saved",
"in",
"the",
"current",
"Spotify",
"user’s",
"‘Your",
"Music’",
"library",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/library.py#L65-L77 | [
"async",
"def",
"get_albums",
"(",
"self",
",",
"*",
",",
"limit",
"=",
"20",
",",
"offset",
"=",
"0",
")",
"->",
"List",
"[",
"Album",
"]",
":",
"data",
"=",
"await",
"self",
".",
"user",
".",
"http",
".",
"saved_albums",
"(",
"limit",
"=",
"lim... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Library.remove_albums | Remove one or more albums from the current user’s ‘Your Music’ library.
Parameters
----------
albums : Sequence[Union[Album, str]]
A sequence of artist objects or spotify IDs | spotify/models/library.py | async def remove_albums(self, *albums):
"""Remove one or more albums from the current user’s ‘Your Music’ library.
Parameters
----------
albums : Sequence[Union[Album, str]]
A sequence of artist objects or spotify IDs
"""
_albums = [(obj if isinstance(obj, st... | async def remove_albums(self, *albums):
"""Remove one or more albums from the current user’s ‘Your Music’ library.
Parameters
----------
albums : Sequence[Union[Album, str]]
A sequence of artist objects or spotify IDs
"""
_albums = [(obj if isinstance(obj, st... | [
"Remove",
"one",
"or",
"more",
"albums",
"from",
"the",
"current",
"user’s",
"‘Your",
"Music’",
"library",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/library.py#L79-L88 | [
"async",
"def",
"remove_albums",
"(",
"self",
",",
"*",
"albums",
")",
":",
"_albums",
"=",
"[",
"(",
"obj",
"if",
"isinstance",
"(",
"obj",
",",
"str",
")",
"else",
"obj",
".",
"id",
")",
"for",
"obj",
"in",
"albums",
"]",
"await",
"self",
".",
... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Library.remove_tracks | Remove one or more tracks from the current user’s ‘Your Music’ library.
Parameters
----------
tracks : Sequence[Union[Track, str]]
A sequence of track objects or spotify IDs | spotify/models/library.py | async def remove_tracks(self, *tracks):
"""Remove one or more tracks from the current user’s ‘Your Music’ library.
Parameters
----------
tracks : Sequence[Union[Track, str]]
A sequence of track objects or spotify IDs
"""
_tracks = [(obj if isinstance(obj, str... | async def remove_tracks(self, *tracks):
"""Remove one or more tracks from the current user’s ‘Your Music’ library.
Parameters
----------
tracks : Sequence[Union[Track, str]]
A sequence of track objects or spotify IDs
"""
_tracks = [(obj if isinstance(obj, str... | [
"Remove",
"one",
"or",
"more",
"tracks",
"from",
"the",
"current",
"user’s",
"‘Your",
"Music’",
"library",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/library.py#L90-L99 | [
"async",
"def",
"remove_tracks",
"(",
"self",
",",
"*",
"tracks",
")",
":",
"_tracks",
"=",
"[",
"(",
"obj",
"if",
"isinstance",
"(",
"obj",
",",
"str",
")",
"else",
"obj",
".",
"id",
")",
"for",
"obj",
"in",
"tracks",
"]",
"await",
"self",
".",
... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Library.save_albums | Save one or more albums to the current user’s ‘Your Music’ library.
Parameters
----------
albums : Sequence[Union[Album, str]]
A sequence of artist objects or spotify IDs | spotify/models/library.py | async def save_albums(self, *albums):
"""Save one or more albums to the current user’s ‘Your Music’ library.
Parameters
----------
albums : Sequence[Union[Album, str]]
A sequence of artist objects or spotify IDs
"""
_albums = [(obj if isinstance(obj, str) els... | async def save_albums(self, *albums):
"""Save one or more albums to the current user’s ‘Your Music’ library.
Parameters
----------
albums : Sequence[Union[Album, str]]
A sequence of artist objects or spotify IDs
"""
_albums = [(obj if isinstance(obj, str) els... | [
"Save",
"one",
"or",
"more",
"albums",
"to",
"the",
"current",
"user’s",
"‘Your",
"Music’",
"library",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/library.py#L101-L110 | [
"async",
"def",
"save_albums",
"(",
"self",
",",
"*",
"albums",
")",
":",
"_albums",
"=",
"[",
"(",
"obj",
"if",
"isinstance",
"(",
"obj",
",",
"str",
")",
"else",
"obj",
".",
"id",
")",
"for",
"obj",
"in",
"albums",
"]",
"await",
"self",
".",
"u... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Library.save_tracks | Save one or more tracks to the current user’s ‘Your Music’ library.
Parameters
----------
tracks : Sequence[Union[Track, str]]
A sequence of track objects or spotify IDs | spotify/models/library.py | async def save_tracks(self, *tracks):
"""Save one or more tracks to the current user’s ‘Your Music’ library.
Parameters
----------
tracks : Sequence[Union[Track, str]]
A sequence of track objects or spotify IDs
"""
_tracks = [(obj if isinstance(obj, str) else... | async def save_tracks(self, *tracks):
"""Save one or more tracks to the current user’s ‘Your Music’ library.
Parameters
----------
tracks : Sequence[Union[Track, str]]
A sequence of track objects or spotify IDs
"""
_tracks = [(obj if isinstance(obj, str) else... | [
"Save",
"one",
"or",
"more",
"tracks",
"to",
"the",
"current",
"user’s",
"‘Your",
"Music’",
"library",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/library.py#L112-L121 | [
"async",
"def",
"save_tracks",
"(",
"self",
",",
"*",
"tracks",
")",
":",
"_tracks",
"=",
"[",
"(",
"obj",
"if",
"isinstance",
"(",
"obj",
",",
"str",
")",
"else",
"obj",
".",
"id",
")",
"for",
"obj",
"in",
"tracks",
"]",
"await",
"self",
".",
"u... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | to_id | Get a spotify ID from a URI or open.spotify URL.
Paramters
---------
string : str
The string to operate on.
Returns
-------
id : str
The Spotify ID from the string. | spotify/utils.py | def to_id(string: str) -> str:
"""Get a spotify ID from a URI or open.spotify URL.
Paramters
---------
string : str
The string to operate on.
Returns
-------
id : str
The Spotify ID from the string.
"""
string = string.strip()
match = _URI_RE.match(string)
... | def to_id(string: str) -> str:
"""Get a spotify ID from a URI or open.spotify URL.
Paramters
---------
string : str
The string to operate on.
Returns
-------
id : str
The Spotify ID from the string.
"""
string = string.strip()
match = _URI_RE.match(string)
... | [
"Get",
"a",
"spotify",
"ID",
"from",
"a",
"URI",
"or",
"open",
".",
"spotify",
"URL",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/utils.py#L21-L46 | [
"def",
"to_id",
"(",
"string",
":",
"str",
")",
"->",
"str",
":",
"string",
"=",
"string",
".",
"strip",
"(",
")",
"match",
"=",
"_URI_RE",
".",
"match",
"(",
"string",
")",
"if",
"match",
"is",
"None",
":",
"match",
"=",
"_OPEN_RE",
".",
"match",
... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | assert_hasattr | decorator to assert an object has an attribute when run. | spotify/utils.py | def assert_hasattr(attr: str, msg: str, tp: BaseException = SpotifyException) -> Callable:
"""decorator to assert an object has an attribute when run."""
def decorator(func: Callable) -> Callable:
@functools.wraps(func)
def decorated(self, *args, **kwargs):
if not hasattr(self, attr)... | def assert_hasattr(attr: str, msg: str, tp: BaseException = SpotifyException) -> Callable:
"""decorator to assert an object has an attribute when run."""
def decorator(func: Callable) -> Callable:
@functools.wraps(func)
def decorated(self, *args, **kwargs):
if not hasattr(self, attr)... | [
"decorator",
"to",
"assert",
"an",
"object",
"has",
"an",
"attribute",
"when",
"run",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/utils.py#L49-L64 | [
"def",
"assert_hasattr",
"(",
"attr",
":",
"str",
",",
"msg",
":",
"str",
",",
"tp",
":",
"BaseException",
"=",
"SpotifyException",
")",
"->",
"Callable",
":",
"def",
"decorator",
"(",
"func",
":",
"Callable",
")",
"->",
"Callable",
":",
"@",
"functools"... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | OAuth2.from_client | Construct a OAuth2 object from a `spotify.Client`. | spotify/utils.py | def from_client(cls, client, *args, **kwargs):
"""Construct a OAuth2 object from a `spotify.Client`."""
return cls(client.http.client_id, *args, **kwargs) | def from_client(cls, client, *args, **kwargs):
"""Construct a OAuth2 object from a `spotify.Client`."""
return cls(client.http.client_id, *args, **kwargs) | [
"Construct",
"a",
"OAuth2",
"object",
"from",
"a",
"spotify",
".",
"Client",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/utils.py#L106-L108 | [
"def",
"from_client",
"(",
"cls",
",",
"client",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"cls",
"(",
"client",
".",
"http",
".",
"client_id",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | bb296cac7c3dd289908906b7069bd80f43950515 |
test | OAuth2.url_ | Construct a OAuth2 URL instead of an OAuth2 object. | spotify/utils.py | def url_(client_id: str, redirect_uri: str, *, scope: str = None, state: str = None, secure: bool = True) -> str:
"""Construct a OAuth2 URL instead of an OAuth2 object."""
attrs = {
'client_id': client_id,
'redirect_uri': quote(redirect_uri)
}
if scope is not Non... | def url_(client_id: str, redirect_uri: str, *, scope: str = None, state: str = None, secure: bool = True) -> str:
"""Construct a OAuth2 URL instead of an OAuth2 object."""
attrs = {
'client_id': client_id,
'redirect_uri': quote(redirect_uri)
}
if scope is not Non... | [
"Construct",
"a",
"OAuth2",
"URL",
"instead",
"of",
"an",
"OAuth2",
"object",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/utils.py#L111-L126 | [
"def",
"url_",
"(",
"client_id",
":",
"str",
",",
"redirect_uri",
":",
"str",
",",
"*",
",",
"scope",
":",
"str",
"=",
"None",
",",
"state",
":",
"str",
"=",
"None",
",",
"secure",
":",
"bool",
"=",
"True",
")",
"->",
"str",
":",
"attrs",
"=",
... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | OAuth2.attrs | Attributes used when constructing url parameters. | spotify/utils.py | def attrs(self):
"""Attributes used when constructing url parameters."""
data = {
'client_id': self.client_id,
'redirect_uri': quote(self.redirect_uri),
}
if self.scope is not None:
data['scope'] = quote(self.scope)
if self.state is not None:... | def attrs(self):
"""Attributes used when constructing url parameters."""
data = {
'client_id': self.client_id,
'redirect_uri': quote(self.redirect_uri),
}
if self.scope is not None:
data['scope'] = quote(self.scope)
if self.state is not None:... | [
"Attributes",
"used",
"when",
"constructing",
"url",
"parameters",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/utils.py#L134-L147 | [
"def",
"attrs",
"(",
"self",
")",
":",
"data",
"=",
"{",
"'client_id'",
":",
"self",
".",
"client_id",
",",
"'redirect_uri'",
":",
"quote",
"(",
"self",
".",
"redirect_uri",
")",
",",
"}",
"if",
"self",
".",
"scope",
"is",
"not",
"None",
":",
"data",... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | OAuth2.parameters | URL parameters used. | spotify/utils.py | def parameters(self) -> str:
"""URL parameters used."""
return '&'.join('{0}={1}'.format(*item) for item in self.attrs.items()) | def parameters(self) -> str:
"""URL parameters used."""
return '&'.join('{0}={1}'.format(*item) for item in self.attrs.items()) | [
"URL",
"parameters",
"used",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/utils.py#L150-L152 | [
"def",
"parameters",
"(",
"self",
")",
"->",
"str",
":",
"return",
"'&'",
".",
"join",
"(",
"'{0}={1}'",
".",
"format",
"(",
"*",
"item",
")",
"for",
"item",
"in",
"self",
".",
"attrs",
".",
"items",
"(",
")",
")"
] | bb296cac7c3dd289908906b7069bd80f43950515 |
test | PartialTracks.build | get the track object for each link in the partial tracks data
Returns
-------
tracks : List[Track]
The tracks | spotify/models/playlist.py | async def build(self):
"""get the track object for each link in the partial tracks data
Returns
-------
tracks : List[Track]
The tracks
"""
data = await self.__func()
return list(PlaylistTrack(self.__client, track) for track in data['items']) | async def build(self):
"""get the track object for each link in the partial tracks data
Returns
-------
tracks : List[Track]
The tracks
"""
data = await self.__func()
return list(PlaylistTrack(self.__client, track) for track in data['items']) | [
"get",
"the",
"track",
"object",
"for",
"each",
"link",
"in",
"the",
"partial",
"tracks",
"data"
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/playlist.py#L40-L49 | [
"async",
"def",
"build",
"(",
"self",
")",
":",
"data",
"=",
"await",
"self",
".",
"__func",
"(",
")",
"return",
"list",
"(",
"PlaylistTrack",
"(",
"self",
".",
"__client",
",",
"track",
")",
"for",
"track",
"in",
"data",
"[",
"'items'",
"]",
")"
] | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Playlist.get_all_tracks | Get all playlist tracks from the playlist.
Returns
-------
tracks : List[PlaylistTrack]
The playlists tracks. | spotify/models/playlist.py | async def get_all_tracks(self) -> List[PlaylistTrack]:
"""Get all playlist tracks from the playlist.
Returns
-------
tracks : List[PlaylistTrack]
The playlists tracks.
"""
if isinstance(self._tracks, PartialTracks):
return await self._tracks.build... | async def get_all_tracks(self) -> List[PlaylistTrack]:
"""Get all playlist tracks from the playlist.
Returns
-------
tracks : List[PlaylistTrack]
The playlists tracks.
"""
if isinstance(self._tracks, PartialTracks):
return await self._tracks.build... | [
"Get",
"all",
"playlist",
"tracks",
"from",
"the",
"playlist",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/playlist.py#L114-L134 | [
"async",
"def",
"get_all_tracks",
"(",
"self",
")",
"->",
"List",
"[",
"PlaylistTrack",
"]",
":",
"if",
"isinstance",
"(",
"self",
".",
"_tracks",
",",
"PartialTracks",
")",
":",
"return",
"await",
"self",
".",
"_tracks",
".",
"build",
"(",
")",
"_tracks... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.pause | Pause playback on the user’s account.
Parameters
----------
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the user’s currently active device is the target. | spotify/models/player.py | async def pause(self, *, device: Optional[SomeDevice] = None):
"""Pause playback on the user’s account.
Parameters
----------
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the user’s current... | async def pause(self, *, device: Optional[SomeDevice] = None):
"""Pause playback on the user’s account.
Parameters
----------
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the user’s current... | [
"Pause",
"playback",
"on",
"the",
"user’s",
"account",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L74-L83 | [
"async",
"def",
"pause",
"(",
"self",
",",
"*",
",",
"device",
":",
"Optional",
"[",
"SomeDevice",
"]",
"=",
"None",
")",
":",
"await",
"self",
".",
"_user",
".",
"http",
".",
"pause_playback",
"(",
"device_id",
"=",
"str",
"(",
"device",
")",
")"
] | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.resume | Resume playback on the user's account.
Parameters
----------
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the user’s currently active device is the target. | spotify/models/player.py | async def resume(self, *, device: Optional[SomeDevice] = None):
"""Resume playback on the user's account.
Parameters
----------
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the user’s curre... | async def resume(self, *, device: Optional[SomeDevice] = None):
"""Resume playback on the user's account.
Parameters
----------
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the user’s curre... | [
"Resume",
"playback",
"on",
"the",
"user",
"s",
"account",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L85-L94 | [
"async",
"def",
"resume",
"(",
"self",
",",
"*",
",",
"device",
":",
"Optional",
"[",
"SomeDevice",
"]",
"=",
"None",
")",
":",
"await",
"self",
".",
"_user",
".",
"http",
".",
"play_playback",
"(",
"None",
",",
"device_id",
"=",
"str",
"(",
"device"... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.seek | Seeks to the given position in the user’s currently playing track.
Parameters
----------
pos : int
The position in milliseconds to seek to.
Must be a positive number.
Passing in a position that is greater than the length of the track will cause the player to ... | spotify/models/player.py | async def seek(self, pos, *, device: Optional[SomeDevice] = None):
"""Seeks to the given position in the user’s currently playing track.
Parameters
----------
pos : int
The position in milliseconds to seek to.
Must be a positive number.
Passing in a p... | async def seek(self, pos, *, device: Optional[SomeDevice] = None):
"""Seeks to the given position in the user’s currently playing track.
Parameters
----------
pos : int
The position in milliseconds to seek to.
Must be a positive number.
Passing in a p... | [
"Seeks",
"to",
"the",
"given",
"position",
"in",
"the",
"user’s",
"currently",
"playing",
"track",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L96-L109 | [
"async",
"def",
"seek",
"(",
"self",
",",
"pos",
",",
"*",
",",
"device",
":",
"Optional",
"[",
"SomeDevice",
"]",
"=",
"None",
")",
":",
"await",
"self",
".",
"_user",
".",
"http",
".",
"seek_playback",
"(",
"pos",
",",
"device_id",
"=",
"str",
"(... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.set_repeat | Set the repeat mode for the user’s playback.
Parameters
----------
state : str
Options are repeat-track, repeat-context, and off
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the... | spotify/models/player.py | async def set_repeat(self, state, *, device: Optional[SomeDevice] = None):
"""Set the repeat mode for the user’s playback.
Parameters
----------
state : str
Options are repeat-track, repeat-context, and off
device : Optional[:obj:`SomeDevice`]
The Device ... | async def set_repeat(self, state, *, device: Optional[SomeDevice] = None):
"""Set the repeat mode for the user’s playback.
Parameters
----------
state : str
Options are repeat-track, repeat-context, and off
device : Optional[:obj:`SomeDevice`]
The Device ... | [
"Set",
"the",
"repeat",
"mode",
"for",
"the",
"user’s",
"playback",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L111-L122 | [
"async",
"def",
"set_repeat",
"(",
"self",
",",
"state",
",",
"*",
",",
"device",
":",
"Optional",
"[",
"SomeDevice",
"]",
"=",
"None",
")",
":",
"await",
"self",
".",
"_user",
".",
"http",
".",
"repeat_playback",
"(",
"state",
",",
"device_id",
"=",
... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.set_volume | Set the volume for the user’s current playback device.
Parameters
----------
volume : int
The volume to set. Must be a value from 0 to 100 inclusive.
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
... | spotify/models/player.py | async def set_volume(self, volume: int, *, device: Optional[SomeDevice] = None):
"""Set the volume for the user’s current playback device.
Parameters
----------
volume : int
The volume to set. Must be a value from 0 to 100 inclusive.
device : Optional[:obj:`SomeDevic... | async def set_volume(self, volume: int, *, device: Optional[SomeDevice] = None):
"""Set the volume for the user’s current playback device.
Parameters
----------
volume : int
The volume to set. Must be a value from 0 to 100 inclusive.
device : Optional[:obj:`SomeDevic... | [
"Set",
"the",
"volume",
"for",
"the",
"user’s",
"current",
"playback",
"device",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L124-L135 | [
"async",
"def",
"set_volume",
"(",
"self",
",",
"volume",
":",
"int",
",",
"*",
",",
"device",
":",
"Optional",
"[",
"SomeDevice",
"]",
"=",
"None",
")",
":",
"await",
"self",
".",
"_user",
".",
"http",
".",
"set_playback_volume",
"(",
"volume",
",",
... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.next | Skips to next track in the user’s queue.
Parameters
----------
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the user’s currently active device is the target. | spotify/models/player.py | async def next(self, *, device: Optional[SomeDevice] = None):
"""Skips to next track in the user’s queue.
Parameters
----------
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the user’s curre... | async def next(self, *, device: Optional[SomeDevice] = None):
"""Skips to next track in the user’s queue.
Parameters
----------
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this command is targeting.
If not supplied, the user’s curre... | [
"Skips",
"to",
"next",
"track",
"in",
"the",
"user’s",
"queue",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L137-L146 | [
"async",
"def",
"next",
"(",
"self",
",",
"*",
",",
"device",
":",
"Optional",
"[",
"SomeDevice",
"]",
"=",
"None",
")",
":",
"await",
"self",
".",
"_user",
".",
"http",
".",
"skip_next",
"(",
"device_id",
"=",
"str",
"(",
"device",
")",
")"
] | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.previous | Skips to previous track in the user’s queue.
Note that this will ALWAYS skip to the previous track, regardless of the current track’s progress.
Returning to the start of the current track should be performed using :meth:`seek`
Parameters
----------
device : Optional[:obj:`SomeD... | spotify/models/player.py | async def previous(self, *, device: Optional[SomeDevice] = None):
"""Skips to previous track in the user’s queue.
Note that this will ALWAYS skip to the previous track, regardless of the current track’s progress.
Returning to the start of the current track should be performed using :meth:`seek`... | async def previous(self, *, device: Optional[SomeDevice] = None):
"""Skips to previous track in the user’s queue.
Note that this will ALWAYS skip to the previous track, regardless of the current track’s progress.
Returning to the start of the current track should be performed using :meth:`seek`... | [
"Skips",
"to",
"previous",
"track",
"in",
"the",
"user’s",
"queue",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L148-L160 | [
"async",
"def",
"previous",
"(",
"self",
",",
"*",
",",
"device",
":",
"Optional",
"[",
"SomeDevice",
"]",
"=",
"None",
")",
":",
"return",
"await",
"self",
".",
"_user",
".",
"http",
".",
"skip_previous",
"(",
"device_id",
"=",
"str",
"(",
"device",
... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.play | Start a new context or resume current playback on the user’s active device.
The method treats a single argument as a Spotify context, such as a Artist, Album and playlist objects/URI.
When called with multiple positional arguments they are interpreted as a array of Spotify Track objects/URIs.
... | spotify/models/player.py | async def play(self, *uris: SomeURIs, offset: Optional[Offset] = 0, device: Optional[SomeDevice] = None):
"""Start a new context or resume current playback on the user’s active device.
The method treats a single argument as a Spotify context, such as a Artist, Album and playlist objects/URI.
Wh... | async def play(self, *uris: SomeURIs, offset: Optional[Offset] = 0, device: Optional[SomeDevice] = None):
"""Start a new context or resume current playback on the user’s active device.
The method treats a single argument as a Spotify context, such as a Artist, Album and playlist objects/URI.
Wh... | [
"Start",
"a",
"new",
"context",
"or",
"resume",
"current",
"playback",
"on",
"the",
"user’s",
"active",
"device",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L162-L197 | [
"async",
"def",
"play",
"(",
"self",
",",
"*",
"uris",
":",
"SomeURIs",
",",
"offset",
":",
"Optional",
"[",
"Offset",
"]",
"=",
"0",
",",
"device",
":",
"Optional",
"[",
"SomeDevice",
"]",
"=",
"None",
")",
":",
"if",
"len",
"(",
"uris",
")",
">... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.shuffle | shuffle on or off for user’s playback.
Parameters
----------
state : Optional[bool]
if `True` then Shuffle user’s playback.
else if `False` do not shuffle user’s playback.
device : Optional[:obj:`SomeDevice`]
The Device object or id of the device this... | spotify/models/player.py | async def shuffle(self, state: Optional[bool] = None, *, device: Optional[SomeDevice] = None):
"""shuffle on or off for user’s playback.
Parameters
----------
state : Optional[bool]
if `True` then Shuffle user’s playback.
else if `False` do not shuffle user’s pla... | async def shuffle(self, state: Optional[bool] = None, *, device: Optional[SomeDevice] = None):
"""shuffle on or off for user’s playback.
Parameters
----------
state : Optional[bool]
if `True` then Shuffle user’s playback.
else if `False` do not shuffle user’s pla... | [
"shuffle",
"on",
"or",
"off",
"for",
"user’s",
"playback",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L199-L211 | [
"async",
"def",
"shuffle",
"(",
"self",
",",
"state",
":",
"Optional",
"[",
"bool",
"]",
"=",
"None",
",",
"*",
",",
"device",
":",
"Optional",
"[",
"SomeDevice",
"]",
"=",
"None",
")",
":",
"await",
"self",
".",
"__user",
".",
"http",
".",
"shuffl... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | Player.transfer | Transfer playback to a new device and determine if it should start playing.
Parameters
----------
device : :obj:`SomeDevice`
The device on which playback should be started/transferred.
ensure_playback : bool
if `True` ensure playback happens on new device.
... | spotify/models/player.py | async def transfer(self, device: SomeDevice, ensure_playback: bool = False):
"""Transfer playback to a new device and determine if it should start playing.
Parameters
----------
device : :obj:`SomeDevice`
The device on which playback should be started/transferred.
en... | async def transfer(self, device: SomeDevice, ensure_playback: bool = False):
"""Transfer playback to a new device and determine if it should start playing.
Parameters
----------
device : :obj:`SomeDevice`
The device on which playback should be started/transferred.
en... | [
"Transfer",
"playback",
"to",
"a",
"new",
"device",
"and",
"determine",
"if",
"it",
"should",
"start",
"playing",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/player.py#L213-L224 | [
"async",
"def",
"transfer",
"(",
"self",
",",
"device",
":",
"SomeDevice",
",",
"ensure_playback",
":",
"bool",
"=",
"False",
")",
":",
"await",
"self",
".",
"_user",
".",
"http",
".",
"transfer_player",
"(",
"str",
"(",
"device",
")",
",",
"play",
"="... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | SpotifyBase.from_href | Get the full object from spotify with a `href` attribute. | spotify/models/base.py | async def from_href(self):
"""Get the full object from spotify with a `href` attribute."""
if not hasattr(self, 'href'):
raise TypeError('Spotify object has no `href` attribute, therefore cannot be retrived')
elif hasattr(self, 'http'):
return await self.http.request(('G... | async def from_href(self):
"""Get the full object from spotify with a `href` attribute."""
if not hasattr(self, 'href'):
raise TypeError('Spotify object has no `href` attribute, therefore cannot be retrived')
elif hasattr(self, 'http'):
return await self.http.request(('G... | [
"Get",
"the",
"full",
"object",
"from",
"spotify",
"with",
"a",
"href",
"attribute",
"."
] | mental32/spotify.py | python | https://github.com/mental32/spotify.py/blob/bb296cac7c3dd289908906b7069bd80f43950515/spotify/models/base.py#L16-L36 | [
"async",
"def",
"from_href",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'href'",
")",
":",
"raise",
"TypeError",
"(",
"'Spotify object has no `href` attribute, therefore cannot be retrived'",
")",
"elif",
"hasattr",
"(",
"self",
",",
"'http'... | bb296cac7c3dd289908906b7069bd80f43950515 |
test | ExpirationDate.get | Execute the logic behind the meaning of ExpirationDate + return the matched status.
:return:
The status of the tested domain.
Can be one of the official status.
:rtype: str | PyFunceble/expiration_date.py | def get(self): # pragma: no cover
"""
Execute the logic behind the meaning of ExpirationDate + return the matched status.
:return:
The status of the tested domain.
Can be one of the official status.
:rtype: str
"""
# We get the status of the dom... | def get(self): # pragma: no cover
"""
Execute the logic behind the meaning of ExpirationDate + return the matched status.
:return:
The status of the tested domain.
Can be one of the official status.
:rtype: str
"""
# We get the status of the dom... | [
"Execute",
"the",
"logic",
"behind",
"the",
"meaning",
"of",
"ExpirationDate",
"+",
"return",
"the",
"matched",
"status",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/expiration_date.py#L94-L191 | [
"def",
"get",
"(",
"self",
")",
":",
"# pragma: no cover",
"# We get the status of the domain validation.",
"domain_validation",
"=",
"self",
".",
"checker",
".",
"is_domain_valid",
"(",
")",
"# We get the status of the IPv4 validation.",
"ip_validation",
"=",
"self",
".",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | ExpirationDate._convert_or_shorten_month | Convert a given month into our unified format.
:param data: The month to convert or shorten.
:type data: str
:return: The unified month name.
:rtype: str | PyFunceble/expiration_date.py | def _convert_or_shorten_month(cls, data):
"""
Convert a given month into our unified format.
:param data: The month to convert or shorten.
:type data: str
:return: The unified month name.
:rtype: str
"""
# We map the different month and their possible r... | def _convert_or_shorten_month(cls, data):
"""
Convert a given month into our unified format.
:param data: The month to convert or shorten.
:type data: str
:return: The unified month name.
:rtype: str
"""
# We map the different month and their possible r... | [
"Convert",
"a",
"given",
"month",
"into",
"our",
"unified",
"format",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/expiration_date.py#L208-L248 | [
"def",
"_convert_or_shorten_month",
"(",
"cls",
",",
"data",
")",
":",
"# We map the different month and their possible representation.",
"short_month",
"=",
"{",
"\"jan\"",
":",
"[",
"str",
"(",
"1",
")",
",",
"\"01\"",
",",
"\"Jan\"",
",",
"\"January\"",
"]",
",... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | ExpirationDate._cases_management | A little internal helper of self.format. (Avoiding of nested loops)
.. note::
Please note that the second value of the case represent the groups
in order :code:`[day,month,year]`.
This means that a :code:`[2,1,0]` will be for example for a date
in format :code:`... | PyFunceble/expiration_date.py | def _cases_management(self, regex_number, matched_result):
"""
A little internal helper of self.format. (Avoiding of nested loops)
.. note::
Please note that the second value of the case represent the groups
in order :code:`[day,month,year]`.
This means that... | def _cases_management(self, regex_number, matched_result):
"""
A little internal helper of self.format. (Avoiding of nested loops)
.. note::
Please note that the second value of the case represent the groups
in order :code:`[day,month,year]`.
This means that... | [
"A",
"little",
"internal",
"helper",
"of",
"self",
".",
"format",
".",
"(",
"Avoiding",
"of",
"nested",
"loops",
")"
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/expiration_date.py#L250-L307 | [
"def",
"_cases_management",
"(",
"self",
",",
"regex_number",
",",
"matched_result",
")",
":",
"# We map our regex numbers with with the right group order.",
"# Note: please report to the method note for more information about the mapping.",
"cases",
"=",
"{",
"\"first\"",
":",
"["... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | ExpirationDate._format | Format the expiration date into an unified format (01-jan-1970).
:param date_to_convert:
The date to convert. In other words, the extracted date.
:type date_to_convert: str
:return: The formatted expiration date.
:rtype: str | PyFunceble/expiration_date.py | def _format(self, date_to_convert=None):
"""
Format the expiration date into an unified format (01-jan-1970).
:param date_to_convert:
The date to convert. In other words, the extracted date.
:type date_to_convert: str
:return: The formatted expiration date.
... | def _format(self, date_to_convert=None):
"""
Format the expiration date into an unified format (01-jan-1970).
:param date_to_convert:
The date to convert. In other words, the extracted date.
:type date_to_convert: str
:return: The formatted expiration date.
... | [
"Format",
"the",
"expiration",
"date",
"into",
"an",
"unified",
"format",
"(",
"01",
"-",
"jan",
"-",
"1970",
")",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/expiration_date.py#L309-L432 | [
"def",
"_format",
"(",
"self",
",",
"date_to_convert",
"=",
"None",
")",
":",
"if",
"not",
"date_to_convert",
":",
"# pragma: no cover",
"# The date to conver is given.",
"# We initiate the date we are working with.",
"date_to_convert",
"=",
"self",
".",
"expiration_date",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | ExpirationDate._extract | Extract the expiration date from the whois record.
:return: The status of the domain.
:rtype: str | PyFunceble/expiration_date.py | def _extract(self): # pragma: no cover
"""
Extract the expiration date from the whois record.
:return: The status of the domain.
:rtype: str
"""
# We try to get the expiration date from the database.
expiration_date_from_database = Whois().get_expiration_date()... | def _extract(self): # pragma: no cover
"""
Extract the expiration date from the whois record.
:return: The status of the domain.
:rtype: str
"""
# We try to get the expiration date from the database.
expiration_date_from_database = Whois().get_expiration_date()... | [
"Extract",
"the",
"expiration",
"date",
"from",
"the",
"whois",
"record",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/expiration_date.py#L434-L593 | [
"def",
"_extract",
"(",
"self",
")",
":",
"# pragma: no cover",
"# We try to get the expiration date from the database.",
"expiration_date_from_database",
"=",
"Whois",
"(",
")",
".",
"get_expiration_date",
"(",
")",
"if",
"expiration_date_from_database",
":",
"# The hash of ... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Production._update_code_urls | Read the code and update all links. | PyFunceble/production.py | def _update_code_urls(self):
"""
Read the code and update all links.
"""
to_ignore = [".gitignore", ".keep"]
for root, _, files in PyFunceble.walk(
PyFunceble.CURRENT_DIRECTORY
+ PyFunceble.directory_separator
+ "PyFunceble"
+ PyF... | def _update_code_urls(self):
"""
Read the code and update all links.
"""
to_ignore = [".gitignore", ".keep"]
for root, _, files in PyFunceble.walk(
PyFunceble.CURRENT_DIRECTORY
+ PyFunceble.directory_separator
+ "PyFunceble"
+ PyF... | [
"Read",
"the",
"code",
"and",
"update",
"all",
"links",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/production.py#L248-L308 | [
"def",
"_update_code_urls",
"(",
"self",
")",
":",
"to_ignore",
"=",
"[",
"\".gitignore\"",
",",
"\".keep\"",
"]",
"for",
"root",
",",
"_",
",",
"files",
"in",
"PyFunceble",
".",
"walk",
"(",
"PyFunceble",
".",
"CURRENT_DIRECTORY",
"+",
"PyFunceble",
".",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Production._is_version_greater | Check if the current version is greater as the older older one. | PyFunceble/production.py | def _is_version_greater(self):
"""
Check if the current version is greater as the older older one.
"""
# we compare the 2 versions.
checked = Version(True).check_versions(
self.current_version[0], self.version_yaml
)
if checked is not None and not ch... | def _is_version_greater(self):
"""
Check if the current version is greater as the older older one.
"""
# we compare the 2 versions.
checked = Version(True).check_versions(
self.current_version[0], self.version_yaml
)
if checked is not None and not ch... | [
"Check",
"if",
"the",
"current",
"version",
"is",
"greater",
"as",
"the",
"older",
"older",
"one",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/production.py#L320-L337 | [
"def",
"_is_version_greater",
"(",
"self",
")",
":",
"# we compare the 2 versions.",
"checked",
"=",
"Version",
"(",
"True",
")",
".",
"check_versions",
"(",
"self",
".",
"current_version",
"[",
"0",
"]",
",",
"self",
".",
"version_yaml",
")",
"if",
"checked",... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Production.is_dev_version | Check if the current branch is `dev`. | PyFunceble/production.py | def is_dev_version(cls):
"""
Check if the current branch is `dev`.
"""
# We initiate the command we have to run in order to
# get the branch we are currently working with.
command = "git branch"
# We execute and get the command output.
command_result = C... | def is_dev_version(cls):
"""
Check if the current branch is `dev`.
"""
# We initiate the command we have to run in order to
# get the branch we are currently working with.
command = "git branch"
# We execute and get the command output.
command_result = C... | [
"Check",
"if",
"the",
"current",
"branch",
"is",
"dev",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/production.py#L340-L364 | [
"def",
"is_dev_version",
"(",
"cls",
")",
":",
"# We initiate the command we have to run in order to",
"# get the branch we are currently working with.",
"command",
"=",
"\"git branch\"",
"# We execute and get the command output.",
"command_result",
"=",
"Command",
"(",
"command",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Production._does_require_deprecation | Check if we have to put the previous version into the deprecated list. | PyFunceble/production.py | def _does_require_deprecation(self):
"""
Check if we have to put the previous version into the deprecated list.
"""
for index, version_number in enumerate(self.current_version[0][:2]):
# We loop through the 2 last elements of the version.
if version_number > sel... | def _does_require_deprecation(self):
"""
Check if we have to put the previous version into the deprecated list.
"""
for index, version_number in enumerate(self.current_version[0][:2]):
# We loop through the 2 last elements of the version.
if version_number > sel... | [
"Check",
"if",
"we",
"have",
"to",
"put",
"the",
"previous",
"version",
"into",
"the",
"deprecated",
"list",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/production.py#L393-L409 | [
"def",
"_does_require_deprecation",
"(",
"self",
")",
":",
"for",
"index",
",",
"version_number",
"in",
"enumerate",
"(",
"self",
".",
"current_version",
"[",
"0",
"]",
"[",
":",
"2",
"]",
")",
":",
"# We loop through the 2 last elements of the version.",
"if",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Production._update_docs | Update the given documentation file or :code:`README.rst` so that
it always gives branch related URL and informations.
.. note::
This only apply to :code:`dev` and :code:`master` branch.
:param file_to_update: The file to update.
:type file_to_update: str | PyFunceble/production.py | def _update_docs(self, file_to_update):
"""
Update the given documentation file or :code:`README.rst` so that
it always gives branch related URL and informations.
.. note::
This only apply to :code:`dev` and :code:`master` branch.
:param file_to_update: The file to ... | def _update_docs(self, file_to_update):
"""
Update the given documentation file or :code:`README.rst` so that
it always gives branch related URL and informations.
.. note::
This only apply to :code:`dev` and :code:`master` branch.
:param file_to_update: The file to ... | [
"Update",
"the",
"given",
"documentation",
"file",
"or",
":",
"code",
":",
"README",
".",
"rst",
"so",
"that",
"it",
"always",
"gives",
"branch",
"related",
"URL",
"and",
"informations",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/production.py#L428-L475 | [
"def",
"_update_docs",
"(",
"self",
",",
"file_to_update",
")",
":",
"if",
"self",
".",
"is_dev_version",
"(",
")",
":",
"# The current version is the dev version.",
"# We map what we have to replace.",
"# Format: {match:replacement}",
"regexes",
"=",
"{",
"\"/%s/\"",
"%"... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Production._update_setup_py | Update :code:`setup.py` so that it always have the right name. | PyFunceble/production.py | def _update_setup_py(self):
"""
Update :code:`setup.py` so that it always have the right name.
"""
# We initiate the path to the file we have to filter.
setup_py_path = PyFunceble.CURRENT_DIRECTORY + "setup.py"
if self.is_dev_version():
# The current version... | def _update_setup_py(self):
"""
Update :code:`setup.py` so that it always have the right name.
"""
# We initiate the path to the file we have to filter.
setup_py_path = PyFunceble.CURRENT_DIRECTORY + "setup.py"
if self.is_dev_version():
# The current version... | [
"Update",
":",
"code",
":",
"setup",
".",
"py",
"so",
"that",
"it",
"always",
"have",
"the",
"right",
"name",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/production.py#L477-L520 | [
"def",
"_update_setup_py",
"(",
"self",
")",
":",
"# We initiate the path to the file we have to filter.",
"setup_py_path",
"=",
"PyFunceble",
".",
"CURRENT_DIRECTORY",
"+",
"\"setup.py\"",
"if",
"self",
".",
"is_dev_version",
"(",
")",
":",
"# The current version is the `d... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Production._update_travis_yml | Update :code:`.travis.yml` according to current branch. | PyFunceble/production.py | def _update_travis_yml(self):
"""
Update :code:`.travis.yml` according to current branch.
"""
# We initiate the file we have to filter/update.
travis_yml_path = PyFunceble.CURRENT_DIRECTORY + ".travis.yml"
if self.is_dev_version():
# The current version is t... | def _update_travis_yml(self):
"""
Update :code:`.travis.yml` according to current branch.
"""
# We initiate the file we have to filter/update.
travis_yml_path = PyFunceble.CURRENT_DIRECTORY + ".travis.yml"
if self.is_dev_version():
# The current version is t... | [
"Update",
":",
"code",
":",
".",
"travis",
".",
"yml",
"according",
"to",
"current",
"branch",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/production.py#L522-L564 | [
"def",
"_update_travis_yml",
"(",
"self",
")",
":",
"# We initiate the file we have to filter/update.",
"travis_yml_path",
"=",
"PyFunceble",
".",
"CURRENT_DIRECTORY",
"+",
"\".travis.yml\"",
"if",
"self",
".",
"is_dev_version",
"(",
")",
":",
"# The current version is the ... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | AutoContinue.backup | Backup the current execution state. | PyFunceble/auto_continue.py | def backup(self):
"""
Backup the current execution state.
"""
if PyFunceble.CONFIGURATION["auto_continue"]:
# The auto_continue subsystem is activated.
# We initiate the location where we are going to save the data to backup.
data_to_backup = {}
... | def backup(self):
"""
Backup the current execution state.
"""
if PyFunceble.CONFIGURATION["auto_continue"]:
# The auto_continue subsystem is activated.
# We initiate the location where we are going to save the data to backup.
data_to_backup = {}
... | [
"Backup",
"the",
"current",
"execution",
"state",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/auto_continue.py#L105-L141 | [
"def",
"backup",
"(",
"self",
")",
":",
"if",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"auto_continue\"",
"]",
":",
"# The auto_continue subsystem is activated.",
"# We initiate the location where we are going to save the data to backup.",
"data_to_backup",
"=",
"{",
"}",
"... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | AutoContinue.restore | Restore data from the given path. | PyFunceble/auto_continue.py | def restore(self):
"""
Restore data from the given path.
"""
if PyFunceble.CONFIGURATION["auto_continue"] and self.backup_content:
# The auto_continue subsystem is activated and the backup_content
# is not empty.
# We get the file we have to restore.... | def restore(self):
"""
Restore data from the given path.
"""
if PyFunceble.CONFIGURATION["auto_continue"] and self.backup_content:
# The auto_continue subsystem is activated and the backup_content
# is not empty.
# We get the file we have to restore.... | [
"Restore",
"data",
"from",
"the",
"given",
"path",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/auto_continue.py#L143-L188 | [
"def",
"restore",
"(",
"self",
")",
":",
"if",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"auto_continue\"",
"]",
"and",
"self",
".",
"backup_content",
":",
"# The auto_continue subsystem is activated and the backup_content",
"# is not empty.",
"# We get the file we have to r... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | AdBlock._is_to_ignore | Check if we have to ignore the given line.
:param line: The line from the file.
:type line: str | PyFunceble/adblock.py | def _is_to_ignore(cls, line):
"""
Check if we have to ignore the given line.
:param line: The line from the file.
:type line: str
"""
# We set the list of regex to match to be
# considered as ignored.
to_ignore = [r"(^!|^@@|^\/|^\[|^\.|^-|^_|^\?|^&)"] #... | def _is_to_ignore(cls, line):
"""
Check if we have to ignore the given line.
:param line: The line from the file.
:type line: str
"""
# We set the list of regex to match to be
# considered as ignored.
to_ignore = [r"(^!|^@@|^\/|^\[|^\.|^-|^_|^\?|^&)"] #... | [
"Check",
"if",
"we",
"have",
"to",
"ignore",
"the",
"given",
"line",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/adblock.py#L106-L129 | [
"def",
"_is_to_ignore",
"(",
"cls",
",",
"line",
")",
":",
"# We set the list of regex to match to be",
"# considered as ignored.",
"to_ignore",
"=",
"[",
"r\"(^!|^@@|^\\/|^\\[|^\\.|^-|^_|^\\?|^&)\"",
"]",
"# , r\"(\\$|,)(image)\"]",
"for",
"element",
"in",
"to_ignore",
":",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | AdBlock._handle_options | Handle the data from the options.
:param options: The list of options from the rule.
:type options: list
:return: The list of domains to return globally.
:rtype: list | PyFunceble/adblock.py | def _handle_options(self, options):
"""
Handle the data from the options.
:param options: The list of options from the rule.
:type options: list
:return: The list of domains to return globally.
:rtype: list
"""
# We initiate a variable which will save o... | def _handle_options(self, options):
"""
Handle the data from the options.
:param options: The list of options from the rule.
:type options: list
:return: The list of domains to return globally.
:rtype: list
"""
# We initiate a variable which will save o... | [
"Handle",
"the",
"data",
"from",
"the",
"options",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/adblock.py#L131-L176 | [
"def",
"_handle_options",
"(",
"self",
",",
"options",
")",
":",
"# We initiate a variable which will save our result",
"result",
"=",
"[",
"]",
"# We initiate the regex which will be used to extract the domain listed",
"# under the option domain=",
"regex_domain_option",
"=",
"r\"... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | AdBlock._extract_base | Extract the base of the given element.
.. example:
given "hello/world?world=beautiful" return "hello"
:param element: The element we are working with.
:type element: str|list | PyFunceble/adblock.py | def _extract_base(self, element):
"""
Extract the base of the given element.
.. example:
given "hello/world?world=beautiful" return "hello"
:param element: The element we are working with.
:type element: str|list
"""
if isinstance(element, list):
... | def _extract_base(self, element):
"""
Extract the base of the given element.
.. example:
given "hello/world?world=beautiful" return "hello"
:param element: The element we are working with.
:type element: str|list
"""
if isinstance(element, list):
... | [
"Extract",
"the",
"base",
"of",
"the",
"given",
"element",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/adblock.py#L178-L214 | [
"def",
"_extract_base",
"(",
"self",
",",
"element",
")",
":",
"if",
"isinstance",
"(",
"element",
",",
"list",
")",
":",
"# The given element is a list.",
"# We get the base of each element of the list.",
"return",
"[",
"self",
".",
"_extract_base",
"(",
"x",
")",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | AdBlock.decode | Decode/extract the domains to test from the adblock formated file.
:return: The list of domains to test.
:rtype: list | PyFunceble/adblock.py | def decode(self):
"""
Decode/extract the domains to test from the adblock formated file.
:return: The list of domains to test.
:rtype: list
"""
# We initiate a variable which will save what we are going to return.
result = []
# We initiate the first reg... | def decode(self):
"""
Decode/extract the domains to test from the adblock formated file.
:return: The list of domains to test.
:rtype: list
"""
# We initiate a variable which will save what we are going to return.
result = []
# We initiate the first reg... | [
"Decode",
"/",
"extract",
"the",
"domains",
"to",
"test",
"from",
"the",
"adblock",
"formated",
"file",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/adblock.py#L216-L307 | [
"def",
"decode",
"(",
"self",
")",
":",
"# We initiate a variable which will save what we are going to return.",
"result",
"=",
"[",
"]",
"# We initiate the first regex we are going to use to get",
"# the element to format.",
"regex",
"=",
"r\"^(?:.*\\|\\|)([^\\/\\$\\^]{1,}).*$\"",
"... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | AdBlock._format_decoded | Format the exctracted adblock line before passing it to the system.
:param to_format: The extracted line from the file.
:type to_format: str
:param result: A list of the result of this method.
:type result: list
:return: The list of domains or IP to test.
:rtype: list | PyFunceble/adblock.py | def _format_decoded(self, to_format, result=None): # pragma: no cover
"""
Format the exctracted adblock line before passing it to the system.
:param to_format: The extracted line from the file.
:type to_format: str
:param result: A list of the result of this method.
:t... | def _format_decoded(self, to_format, result=None): # pragma: no cover
"""
Format the exctracted adblock line before passing it to the system.
:param to_format: The extracted line from the file.
:type to_format: str
:param result: A list of the result of this method.
:t... | [
"Format",
"the",
"exctracted",
"adblock",
"line",
"before",
"passing",
"it",
"to",
"the",
"system",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/adblock.py#L309-L402 | [
"def",
"_format_decoded",
"(",
"self",
",",
"to_format",
",",
"result",
"=",
"None",
")",
":",
"# pragma: no cover",
"if",
"not",
"result",
":",
"# The result is not given.",
"# We set the result as an empty list.",
"result",
"=",
"[",
"]",
"for",
"data",
"in",
"L... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | HTTPCode._access | Get the HTTP code status.
:return: The matched HTTP status code.
:rtype: int|None | PyFunceble/http_code.py | def _access(self): # pragma: no cover
"""
Get the HTTP code status.
:return: The matched HTTP status code.
:rtype: int|None
"""
try:
# We try to get the HTTP status code.
if PyFunceble.INTERN["to_test_type"] == "url":
# We are g... | def _access(self): # pragma: no cover
"""
Get the HTTP code status.
:return: The matched HTTP status code.
:rtype: int|None
"""
try:
# We try to get the HTTP status code.
if PyFunceble.INTERN["to_test_type"] == "url":
# We are g... | [
"Get",
"the",
"HTTP",
"code",
"status",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/http_code.py#L109-L155 | [
"def",
"_access",
"(",
"self",
")",
":",
"# pragma: no cover",
"try",
":",
"# We try to get the HTTP status code.",
"if",
"PyFunceble",
".",
"INTERN",
"[",
"\"to_test_type\"",
"]",
"==",
"\"url\"",
":",
"# We are globally testing a URL.",
"# We get the head of the URL.",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | HTTPCode.get | Return the HTTP code status.
:return: The matched and formatted status code.
:rtype: str|int|None | PyFunceble/http_code.py | def get(self):
"""
Return the HTTP code status.
:return: The matched and formatted status code.
:rtype: str|int|None
"""
if PyFunceble.HTTP_CODE["active"]:
# The http status code extraction is activated.
# We get the http status code.
... | def get(self):
"""
Return the HTTP code status.
:return: The matched and formatted status code.
:rtype: str|int|None
"""
if PyFunceble.HTTP_CODE["active"]:
# The http status code extraction is activated.
# We get the http status code.
... | [
"Return",
"the",
"HTTP",
"code",
"status",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/http_code.py#L157-L204 | [
"def",
"get",
"(",
"self",
")",
":",
"if",
"PyFunceble",
".",
"HTTP_CODE",
"[",
"\"active\"",
"]",
":",
"# The http status code extraction is activated.",
"# We get the http status code.",
"http_code",
"=",
"self",
".",
"_access",
"(",
")",
"# We initiate a variable whi... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | syntax_check | Check the syntax of the given domain.
:param domain: The domain to check the syntax for.
:type domain: str
:return: The syntax validity.
:rtype: bool
.. warning::
If an empty or a non-string :code:`domain` is given, we return :code:`None`. | PyFunceble/__init__.py | def syntax_check(domain): # pragma: no cover
"""
Check the syntax of the given domain.
:param domain: The domain to check the syntax for.
:type domain: str
:return: The syntax validity.
:rtype: bool
.. warning::
If an empty or a non-string :code:`domain` is given, we return :code... | def syntax_check(domain): # pragma: no cover
"""
Check the syntax of the given domain.
:param domain: The domain to check the syntax for.
:type domain: str
:return: The syntax validity.
:rtype: bool
.. warning::
If an empty or a non-string :code:`domain` is given, we return :code... | [
"Check",
"the",
"syntax",
"of",
"the",
"given",
"domain",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/__init__.py#L284-L309 | [
"def",
"syntax_check",
"(",
"domain",
")",
":",
"# pragma: no cover",
"if",
"domain",
"and",
"isinstance",
"(",
"domain",
",",
"str",
")",
":",
"# * The given domain is not empty nor None.",
"# and",
"# * The given domain is a string.",
"# We silently load the configuration."... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | is_subdomain | Check if the given domain is a subdomain.
:param domain: The domain we are checking.
:type domain: str
:return: The subdomain state.
:rtype: bool
.. warning::
If an empty or a non-string :code:`domain` is given, we return :code:`None`. | PyFunceble/__init__.py | def is_subdomain(domain): # pragma: no cover
"""
Check if the given domain is a subdomain.
:param domain: The domain we are checking.
:type domain: str
:return: The subdomain state.
:rtype: bool
.. warning::
If an empty or a non-string :code:`domain` is given, we return :code:`No... | def is_subdomain(domain): # pragma: no cover
"""
Check if the given domain is a subdomain.
:param domain: The domain we are checking.
:type domain: str
:return: The subdomain state.
:rtype: bool
.. warning::
If an empty or a non-string :code:`domain` is given, we return :code:`No... | [
"Check",
"if",
"the",
"given",
"domain",
"is",
"a",
"subdomain",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/__init__.py#L312-L337 | [
"def",
"is_subdomain",
"(",
"domain",
")",
":",
"# pragma: no cover",
"if",
"domain",
"and",
"isinstance",
"(",
"domain",
",",
"str",
")",
":",
"# * The given domain is not empty nor None.",
"# and",
"# * The given domain is a string.",
"# We silently load the configuration."... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | ipv4_syntax_check | Check the syntax of the given IPv4.
:param ip: The IPv4 to check the syntax for.
:type ip: str
:return: The syntax validity.
:rtype: bool
.. warning::
If an empty or a non-string :code:`ip` is given, we return :code:`None`. | PyFunceble/__init__.py | def ipv4_syntax_check(ip): # pragma: no cover
"""
Check the syntax of the given IPv4.
:param ip: The IPv4 to check the syntax for.
:type ip: str
:return: The syntax validity.
:rtype: bool
.. warning::
If an empty or a non-string :code:`ip` is given, we return :code:`None`.
""... | def ipv4_syntax_check(ip): # pragma: no cover
"""
Check the syntax of the given IPv4.
:param ip: The IPv4 to check the syntax for.
:type ip: str
:return: The syntax validity.
:rtype: bool
.. warning::
If an empty or a non-string :code:`ip` is given, we return :code:`None`.
""... | [
"Check",
"the",
"syntax",
"of",
"the",
"given",
"IPv4",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/__init__.py#L340-L365 | [
"def",
"ipv4_syntax_check",
"(",
"ip",
")",
":",
"# pragma: no cover",
"if",
"ip",
"and",
"isinstance",
"(",
"ip",
",",
"str",
")",
":",
"# The given IP is not empty nor None.",
"# and",
"# * The given IP is a string.",
"# We silently load the configuration.",
"load_config"... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | is_ipv4_range | Check if the given IP is an IP range.
:param ip: The IP we are checking.
:type ip: str
:return: The IPv4 range state.
:rtype: bool
.. warning::
If an empty or a non-string :code:`ip` is given, we return :code:`None`. | PyFunceble/__init__.py | def is_ipv4_range(ip): # pragma: no cover
"""
Check if the given IP is an IP range.
:param ip: The IP we are checking.
:type ip: str
:return: The IPv4 range state.
:rtype: bool
.. warning::
If an empty or a non-string :code:`ip` is given, we return :code:`None`.
"""
if i... | def is_ipv4_range(ip): # pragma: no cover
"""
Check if the given IP is an IP range.
:param ip: The IP we are checking.
:type ip: str
:return: The IPv4 range state.
:rtype: bool
.. warning::
If an empty or a non-string :code:`ip` is given, we return :code:`None`.
"""
if i... | [
"Check",
"if",
"the",
"given",
"IP",
"is",
"an",
"IP",
"range",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/__init__.py#L368-L393 | [
"def",
"is_ipv4_range",
"(",
"ip",
")",
":",
"# pragma: no cover",
"if",
"ip",
"and",
"isinstance",
"(",
"ip",
",",
"str",
")",
":",
"# The given IP is not empty nor None.",
"# and",
"# * The given IP is a string.",
"# We silently load the configuration.",
"load_config",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | url_syntax_check | Check the syntax of the given URL.
:param url: The URL to check the syntax for.
:type url: str
:return: The syntax validity.
:rtype: bool
.. warning::
If an empty or a non-string :code:`url` is given, we return :code:`None`. | PyFunceble/__init__.py | def url_syntax_check(url): # pragma: no cover
"""
Check the syntax of the given URL.
:param url: The URL to check the syntax for.
:type url: str
:return: The syntax validity.
:rtype: bool
.. warning::
If an empty or a non-string :code:`url` is given, we return :code:`None`.
"... | def url_syntax_check(url): # pragma: no cover
"""
Check the syntax of the given URL.
:param url: The URL to check the syntax for.
:type url: str
:return: The syntax validity.
:rtype: bool
.. warning::
If an empty or a non-string :code:`url` is given, we return :code:`None`.
"... | [
"Check",
"the",
"syntax",
"of",
"the",
"given",
"URL",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/__init__.py#L396-L421 | [
"def",
"url_syntax_check",
"(",
"url",
")",
":",
"# pragma: no cover",
"if",
"url",
"and",
"isinstance",
"(",
"url",
",",
"str",
")",
":",
"# The given URL is not empty nor None.",
"# and",
"# * The given URL is a string.",
"# We silently load the configuration.",
"load_con... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | load_config | Load the configuration.
:param under_test:
Tell us if we only have to load the configuration file (True)
or load the configuration file and initate the output directory
if it does not exist (False).
:type under_test: bool
:param custom:
A dict with the configuration index (... | PyFunceble/__init__.py | def load_config(under_test=False, custom=None): # pragma: no cover
"""
Load the configuration.
:param under_test:
Tell us if we only have to load the configuration file (True)
or load the configuration file and initate the output directory
if it does not exist (False).
:type un... | def load_config(under_test=False, custom=None): # pragma: no cover
"""
Load the configuration.
:param under_test:
Tell us if we only have to load the configuration file (True)
or load the configuration file and initate the output directory
if it does not exist (False).
:type un... | [
"Load",
"the",
"configuration",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/__init__.py#L475-L515 | [
"def",
"load_config",
"(",
"under_test",
"=",
"False",
",",
"custom",
"=",
"None",
")",
":",
"# pragma: no cover",
"if",
"\"config_loaded\"",
"not",
"in",
"INTERN",
":",
"# The configuration was not already loaded.",
"# We load and download the different configuration file if... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | stay_safe | Print a friendly message. | PyFunceble/__init__.py | def stay_safe(): # pragma: no cover
"""
Print a friendly message.
"""
random = int(choice(str(int(time()))))
if not CONFIGURATION["quiet"] and random % 3 == 0:
print("\n" + Fore.GREEN + Style.BRIGHT + "Thanks for using PyFunceble!")
print(
Fore.YELLOW
+ Sty... | def stay_safe(): # pragma: no cover
"""
Print a friendly message.
"""
random = int(choice(str(int(time()))))
if not CONFIGURATION["quiet"] and random % 3 == 0:
print("\n" + Fore.GREEN + Style.BRIGHT + "Thanks for using PyFunceble!")
print(
Fore.YELLOW
+ Sty... | [
"Print",
"a",
"friendly",
"message",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/__init__.py#L518-L553 | [
"def",
"stay_safe",
"(",
")",
":",
"# pragma: no cover",
"random",
"=",
"int",
"(",
"choice",
"(",
"str",
"(",
"int",
"(",
"time",
"(",
")",
")",
")",
")",
")",
"if",
"not",
"CONFIGURATION",
"[",
"\"quiet\"",
"]",
"and",
"random",
"%",
"3",
"==",
"... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | _command_line | Provide the command line interface. | PyFunceble/__init__.py | def _command_line(): # pragma: no cover pylint: disable=too-many-branches,too-many-statements
"""
Provide the command line interface.
"""
if __name__ == "PyFunceble":
# We initiate the end of the coloration at the end of each line.
initiate(autoreset=True)
# We load the config... | def _command_line(): # pragma: no cover pylint: disable=too-many-branches,too-many-statements
"""
Provide the command line interface.
"""
if __name__ == "PyFunceble":
# We initiate the end of the coloration at the end of each line.
initiate(autoreset=True)
# We load the config... | [
"Provide",
"the",
"command",
"line",
"interface",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/__init__.py#L556-L1339 | [
"def",
"_command_line",
"(",
")",
":",
"# pragma: no cover pylint: disable=too-many-branches,too-many-statements",
"if",
"__name__",
"==",
"\"PyFunceble\"",
":",
"# We initiate the end of the coloration at the end of each line.",
"initiate",
"(",
"autoreset",
"=",
"True",
")",
"#... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core._entry_management_url_download | Check if the given information is a URL.
If it is the case, it download and update the location of file to test.
:param passed: The url passed to the system.
:type passed: str
:return: The state of the check.
:rtype: bool | PyFunceble/core.py | def _entry_management_url_download(self, passed):
"""
Check if the given information is a URL.
If it is the case, it download and update the location of file to test.
:param passed: The url passed to the system.
:type passed: str
:return: The state of the check.
... | def _entry_management_url_download(self, passed):
"""
Check if the given information is a URL.
If it is the case, it download and update the location of file to test.
:param passed: The url passed to the system.
:type passed: str
:return: The state of the check.
... | [
"Check",
"if",
"the",
"given",
"information",
"is",
"a",
"URL",
".",
"If",
"it",
"is",
"the",
"case",
"it",
"download",
"and",
"update",
"the",
"location",
"of",
"file",
"to",
"test",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L156-L197 | [
"def",
"_entry_management_url_download",
"(",
"self",
",",
"passed",
")",
":",
"if",
"passed",
"and",
"self",
".",
"checker",
".",
"is_url_valid",
"(",
"passed",
")",
":",
"# The passed string is an URL.",
"# We get the file name based on the URL.",
"# We actually just ge... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core._entry_management_url | Manage the loading of the url system. | PyFunceble/core.py | def _entry_management_url(self):
"""
Manage the loading of the url system.
"""
if (
self.url_file # pylint: disable=no-member
and not self._entry_management_url_download(
self.url_file # pylint: disable=no-member
)
): # pyli... | def _entry_management_url(self):
"""
Manage the loading of the url system.
"""
if (
self.url_file # pylint: disable=no-member
and not self._entry_management_url_download(
self.url_file # pylint: disable=no-member
)
): # pyli... | [
"Manage",
"the",
"loading",
"of",
"the",
"url",
"system",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L199-L215 | [
"def",
"_entry_management_url",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"url_file",
"# pylint: disable=no-member",
"and",
"not",
"self",
".",
"_entry_management_url_download",
"(",
"self",
".",
"url_file",
"# pylint: disable=no-member",
")",
")",
":",
"# pyli... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core._entry_management | Avoid to have 1 millions line into self.__init__() | PyFunceble/core.py | def _entry_management(self): # pylint: disable=too-many-branches
"""
Avoid to have 1 millions line into self.__init__()
"""
if not self.modulo_test: # pylint: disable=no-member
# We are not in a module usage.
# We set the file_path as the file we have to test.... | def _entry_management(self): # pylint: disable=too-many-branches
"""
Avoid to have 1 millions line into self.__init__()
"""
if not self.modulo_test: # pylint: disable=no-member
# We are not in a module usage.
# We set the file_path as the file we have to test.... | [
"Avoid",
"to",
"have",
"1",
"millions",
"line",
"into",
"self",
".",
"__init__",
"()"
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L217-L414 | [
"def",
"_entry_management",
"(",
"self",
")",
":",
"# pylint: disable=too-many-branches",
"if",
"not",
"self",
".",
"modulo_test",
":",
"# pylint: disable=no-member",
"# We are not in a module usage.",
"# We set the file_path as the file we have to test.",
"PyFunceble",
".",
"INT... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core.bypass | Exit the script if :code:`[PyFunceble skip]` is matched into the latest
commit message. | PyFunceble/core.py | def bypass(cls):
"""
Exit the script if :code:`[PyFunceble skip]` is matched into the latest
commit message.
"""
# We set the regex to match in order to bypass the execution of
# PyFunceble.
regex_bypass = r"\[PyFunceble\sskip\]"
if (
PyFunce... | def bypass(cls):
"""
Exit the script if :code:`[PyFunceble skip]` is matched into the latest
commit message.
"""
# We set the regex to match in order to bypass the execution of
# PyFunceble.
regex_bypass = r"\[PyFunceble\sskip\]"
if (
PyFunce... | [
"Exit",
"the",
"script",
"if",
":",
"code",
":",
"[",
"PyFunceble",
"skip",
"]",
"is",
"matched",
"into",
"the",
"latest",
"commit",
"message",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L561-L582 | [
"def",
"bypass",
"(",
"cls",
")",
":",
"# We set the regex to match in order to bypass the execution of",
"# PyFunceble.",
"regex_bypass",
"=",
"r\"\\[PyFunceble\\sskip\\]\"",
"if",
"(",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"travis\"",
"]",
"and",
"Regex",
"(",
"Com... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core._print_header | Decide if we print or not the header. | PyFunceble/core.py | def _print_header(cls):
"""
Decide if we print or not the header.
"""
if (
not PyFunceble.CONFIGURATION["quiet"]
and not PyFunceble.CONFIGURATION["header_printed"]
):
# * The quiet mode is not activated.
# and
# * The h... | def _print_header(cls):
"""
Decide if we print or not the header.
"""
if (
not PyFunceble.CONFIGURATION["quiet"]
and not PyFunceble.CONFIGURATION["header_printed"]
):
# * The quiet mode is not activated.
# and
# * The h... | [
"Decide",
"if",
"we",
"print",
"or",
"not",
"the",
"header",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L585-L615 | [
"def",
"_print_header",
"(",
"cls",
")",
":",
"if",
"(",
"not",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"quiet\"",
"]",
"and",
"not",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"header_printed\"",
"]",
")",
":",
"# * The quiet mode is not activated.",
"# and",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core._file_decision | Manage the database, autosave and autocontinue systems for the case that we are reading
a file.
:param current: The currently tested element.
:type current: str
:param last: The last element of the list.
:type last: str
:param status: The status of the currently tested... | PyFunceble/core.py | def _file_decision(self, current, last, status=None):
"""
Manage the database, autosave and autocontinue systems for the case that we are reading
a file.
:param current: The currently tested element.
:type current: str
:param last: The last element of the list.
... | def _file_decision(self, current, last, status=None):
"""
Manage the database, autosave and autocontinue systems for the case that we are reading
a file.
:param current: The currently tested element.
:type current: str
:param last: The last element of the list.
... | [
"Manage",
"the",
"database",
"autosave",
"and",
"autocontinue",
"systems",
"for",
"the",
"case",
"that",
"we",
"are",
"reading",
"a",
"file",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L617-L717 | [
"def",
"_file_decision",
"(",
"self",
",",
"current",
",",
"last",
",",
"status",
"=",
"None",
")",
":",
"if",
"(",
"status",
"and",
"not",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"simple\"",
"]",
"and",
"PyFunceble",
".",
"INTERN",
"[",
"\"file_to_test... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core.domain | Manage the case that we want to test only a domain.
:param domain: The domain or IP to test.
:type domain: str
:param last_domain:
The last domain to test if we are testing a file.
:type last_domain: str
:param return_status: Tell us if we need to return the status... | PyFunceble/core.py | def domain(self, domain=None, last_domain=None):
"""
Manage the case that we want to test only a domain.
:param domain: The domain or IP to test.
:type domain: str
:param last_domain:
The last domain to test if we are testing a file.
:type last_domain: str
... | def domain(self, domain=None, last_domain=None):
"""
Manage the case that we want to test only a domain.
:param domain: The domain or IP to test.
:type domain: str
:param last_domain:
The last domain to test if we are testing a file.
:type last_domain: str
... | [
"Manage",
"the",
"case",
"that",
"we",
"want",
"to",
"test",
"only",
"a",
"domain",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L719-L773 | [
"def",
"domain",
"(",
"self",
",",
"domain",
"=",
"None",
",",
"last_domain",
"=",
"None",
")",
":",
"# We print the header.",
"self",
".",
"_print_header",
"(",
")",
"if",
"domain",
":",
"# A domain is given.",
"# We format and set the domain we are testing and treat... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core.url | Manage the case that we want to test only a given url.
:param url_to_test: The url to test.
:type url_to_test: str
:param last_url:
The last url of the file we are testing
(if exist)
:type last_url: str | PyFunceble/core.py | def url(self, url_to_test=None, last_url=None):
"""
Manage the case that we want to test only a given url.
:param url_to_test: The url to test.
:type url_to_test: str
:param last_url:
The last url of the file we are testing
(if exist)
:type last_... | def url(self, url_to_test=None, last_url=None):
"""
Manage the case that we want to test only a given url.
:param url_to_test: The url to test.
:type url_to_test: str
:param last_url:
The last url of the file we are testing
(if exist)
:type last_... | [
"Manage",
"the",
"case",
"that",
"we",
"want",
"to",
"test",
"only",
"a",
"given",
"url",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L775-L829 | [
"def",
"url",
"(",
"self",
",",
"url_to_test",
"=",
"None",
",",
"last_url",
"=",
"None",
")",
":",
"# We print the header.",
"self",
".",
"_print_header",
"(",
")",
"if",
"url_to_test",
":",
"# An url to test is given.",
"# We set the url we are going to test.",
"P... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core.colorify_logo | Print the colored logo based on global results.
:param home: Tell us if we have to print the initial coloration.
:type home: bool | PyFunceble/core.py | def colorify_logo(cls, home=False):
"""
Print the colored logo based on global results.
:param home: Tell us if we have to print the initial coloration.
:type home: bool
"""
if not PyFunceble.CONFIGURATION["quiet"]:
# The quiet mode is not activated.
... | def colorify_logo(cls, home=False):
"""
Print the colored logo based on global results.
:param home: Tell us if we have to print the initial coloration.
:type home: bool
"""
if not PyFunceble.CONFIGURATION["quiet"]:
# The quiet mode is not activated.
... | [
"Print",
"the",
"colored",
"logo",
"based",
"on",
"global",
"results",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L844-L893 | [
"def",
"colorify_logo",
"(",
"cls",
",",
"home",
"=",
"False",
")",
":",
"if",
"not",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"quiet\"",
"]",
":",
"# The quiet mode is not activated.",
"to_print",
"=",
"[",
"]",
"if",
"home",
":",
"# We have to print the init... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core._format_domain | Format the extracted domain before passing it to the system.
:param extracted_domain: The extracted domain.
:type extracted_domain: str
:return: The formatted domain or IP to test.
:rtype: str
.. note:
Understand by formating the fact that we get rid
of... | PyFunceble/core.py | def _format_domain(cls, extracted_domain):
"""
Format the extracted domain before passing it to the system.
:param extracted_domain: The extracted domain.
:type extracted_domain: str
:return: The formatted domain or IP to test.
:rtype: str
.. note:
... | def _format_domain(cls, extracted_domain):
"""
Format the extracted domain before passing it to the system.
:param extracted_domain: The extracted domain.
:type extracted_domain: str
:return: The formatted domain or IP to test.
:rtype: str
.. note:
... | [
"Format",
"the",
"extracted",
"domain",
"before",
"passing",
"it",
"to",
"the",
"system",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L896-L958 | [
"def",
"_format_domain",
"(",
"cls",
",",
"extracted_domain",
")",
":",
"if",
"not",
"extracted_domain",
".",
"startswith",
"(",
"\"#\"",
")",
":",
"# The line is not a commented line.",
"if",
"\"#\"",
"in",
"extracted_domain",
":",
"# There is a comment at the end of t... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core._extract_domain_from_file | Extract all non commented lines from the file we are testing.
:return: The elements to test.
:rtype: list | PyFunceble/core.py | def _extract_domain_from_file(cls):
"""
Extract all non commented lines from the file we are testing.
:return: The elements to test.
:rtype: list
"""
# We initiate the variable which will save what we are going to return.
result = []
if PyFunceble.path.... | def _extract_domain_from_file(cls):
"""
Extract all non commented lines from the file we are testing.
:return: The elements to test.
:rtype: list
"""
# We initiate the variable which will save what we are going to return.
result = []
if PyFunceble.path.... | [
"Extract",
"all",
"non",
"commented",
"lines",
"from",
"the",
"file",
"we",
"are",
"testing",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L961-L1007 | [
"def",
"_extract_domain_from_file",
"(",
"cls",
")",
":",
"# We initiate the variable which will save what we are going to return.",
"result",
"=",
"[",
"]",
"if",
"PyFunceble",
".",
"path",
".",
"isfile",
"(",
"PyFunceble",
".",
"INTERN",
"[",
"\"file_to_test\"",
"]",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core.file | Manage the case that need to test each domain of a given file path.
.. note::
1 domain per line. | PyFunceble/core.py | def file(self):
"""
Manage the case that need to test each domain of a given file path.
.. note::
1 domain per line.
"""
# We get, format, filter, clean the list to test.
list_to_test = self._file_list_to_test_filtering()
if PyFunceble.CONFIGURATION... | def file(self):
"""
Manage the case that need to test each domain of a given file path.
.. note::
1 domain per line.
"""
# We get, format, filter, clean the list to test.
list_to_test = self._file_list_to_test_filtering()
if PyFunceble.CONFIGURATION... | [
"Manage",
"the",
"case",
"that",
"need",
"to",
"test",
"each",
"domain",
"of",
"a",
"given",
"file",
"path",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L1111-L1174 | [
"def",
"file",
"(",
"self",
")",
":",
"# We get, format, filter, clean the list to test.",
"list_to_test",
"=",
"self",
".",
"_file_list_to_test_filtering",
"(",
")",
"if",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"idna_conversion\"",
"]",
":",
"# We have to convert dom... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core.file_url | Manage the case that we have to test a file
.. note::
1 URL per line. | PyFunceble/core.py | def file_url(self):
"""
Manage the case that we have to test a file
.. note::
1 URL per line.
"""
# We get, format, clean the list of URL to test.
list_to_test = self._file_list_to_test_filtering()
# We initiate a local variable which will save the ... | def file_url(self):
"""
Manage the case that we have to test a file
.. note::
1 URL per line.
"""
# We get, format, clean the list of URL to test.
list_to_test = self._file_list_to_test_filtering()
# We initiate a local variable which will save the ... | [
"Manage",
"the",
"case",
"that",
"we",
"have",
"to",
"test",
"a",
"file"
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L1176-L1222 | [
"def",
"file_url",
"(",
"self",
")",
":",
"# We get, format, clean the list of URL to test.",
"list_to_test",
"=",
"self",
".",
"_file_list_to_test_filtering",
"(",
")",
"# We initiate a local variable which will save the current state of the list.",
"not_filtered",
"=",
"list_to_t... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Core.switch | Switch PyFunceble.CONFIGURATION variables to their opposite.
:param variable:
The variable name to switch.
The variable should be an index our configuration system.
If we want to switch a bool variable, we should parse
it here.
:type variable: str|bool
... | PyFunceble/core.py | def switch(
cls, variable, custom=False
): # pylint: disable=inconsistent-return-statements
"""
Switch PyFunceble.CONFIGURATION variables to their opposite.
:param variable:
The variable name to switch.
The variable should be an index our configuration syste... | def switch(
cls, variable, custom=False
): # pylint: disable=inconsistent-return-statements
"""
Switch PyFunceble.CONFIGURATION variables to their opposite.
:param variable:
The variable name to switch.
The variable should be an index our configuration syste... | [
"Switch",
"PyFunceble",
".",
"CONFIGURATION",
"variables",
"to",
"their",
"opposite",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/core.py#L1225-L1286 | [
"def",
"switch",
"(",
"cls",
",",
"variable",
",",
"custom",
"=",
"False",
")",
":",
"# pylint: disable=inconsistent-return-statements",
"if",
"not",
"custom",
":",
"# We are not working with custom variable which is not into",
"# the configuration.",
"# We get the current stat... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Status.get | Get the status while testing for an IP or domain.
.. note::
We consider that the domain or IP we are currently testing
is into :code:`PyFunceble.INTERN["to_test"]`. | PyFunceble/status.py | def get(cls):
"""
Get the status while testing for an IP or domain.
.. note::
We consider that the domain or IP we are currently testing
is into :code:`PyFunceble.INTERN["to_test"]`.
"""
if "to_test" in PyFunceble.INTERN and PyFunceble.INTERN["to_test"]:... | def get(cls):
"""
Get the status while testing for an IP or domain.
.. note::
We consider that the domain or IP we are currently testing
is into :code:`PyFunceble.INTERN["to_test"]`.
"""
if "to_test" in PyFunceble.INTERN and PyFunceble.INTERN["to_test"]:... | [
"Get",
"the",
"status",
"while",
"testing",
"for",
"an",
"IP",
"or",
"domain",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/status.py#L89-L109 | [
"def",
"get",
"(",
"cls",
")",
":",
"if",
"\"to_test\"",
"in",
"PyFunceble",
".",
"INTERN",
"and",
"PyFunceble",
".",
"INTERN",
"[",
"\"to_test\"",
"]",
":",
"expiration_date",
"=",
"ExpirationDate",
"(",
")",
".",
"get",
"(",
")",
"if",
"expiration_date",... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Status.handle | Handle the lack of WHOIS and expiration date. :smile_cat:
:param matched_status: The status that we have to handle.
:type status: str
:param invalid_source:
The source to set when we handle INVALID element.
:type invalid_source: str
:return:
The strus o... | PyFunceble/status.py | def handle(cls, status, invalid_source="IANA"):
"""
Handle the lack of WHOIS and expiration date. :smile_cat:
:param matched_status: The status that we have to handle.
:type status: str
:param invalid_source:
The source to set when we handle INVALID element.
... | def handle(cls, status, invalid_source="IANA"):
"""
Handle the lack of WHOIS and expiration date. :smile_cat:
:param matched_status: The status that we have to handle.
:type status: str
:param invalid_source:
The source to set when we handle INVALID element.
... | [
"Handle",
"the",
"lack",
"of",
"WHOIS",
"and",
"expiration",
"date",
".",
":",
"smile_cat",
":"
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/status.py#L112-L173 | [
"def",
"handle",
"(",
"cls",
",",
"status",
",",
"invalid_source",
"=",
"\"IANA\"",
")",
":",
"if",
"status",
".",
"lower",
"(",
")",
"not",
"in",
"PyFunceble",
".",
"STATUS",
"[",
"\"list\"",
"]",
"[",
"\"invalid\"",
"]",
":",
"# The matched status is not... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | URLStatus.handle | Handle the backend of the given status. | PyFunceble/status.py | def handle(self):
"""
Handle the backend of the given status.
"""
# We initiate the source we are going to parse to the Generate class.
source = "URL"
if self.catched.lower() not in PyFunceble.STATUS["list"]["invalid"]:
# The parsed status is not in the list... | def handle(self):
"""
Handle the backend of the given status.
"""
# We initiate the source we are going to parse to the Generate class.
source = "URL"
if self.catched.lower() not in PyFunceble.STATUS["list"]["invalid"]:
# The parsed status is not in the list... | [
"Handle",
"the",
"backend",
"of",
"the",
"given",
"status",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/status.py#L603-L623 | [
"def",
"handle",
"(",
"self",
")",
":",
"# We initiate the source we are going to parse to the Generate class.",
"source",
"=",
"\"URL\"",
"if",
"self",
".",
"catched",
".",
"lower",
"(",
")",
"not",
"in",
"PyFunceble",
".",
"STATUS",
"[",
"\"list\"",
"]",
"[",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | DirectoryStructure.backup | Backup the developer state of `output/` in order to make it restorable
and portable for user. | PyFunceble/directory_structure.py | def backup(self):
"""
Backup the developer state of `output/` in order to make it restorable
and portable for user.
"""
# We set the current output directory path.
output_path = self.base + PyFunceble.OUTPUTS["parent_directory"]
# We initiate the structure b... | def backup(self):
"""
Backup the developer state of `output/` in order to make it restorable
and portable for user.
"""
# We set the current output directory path.
output_path = self.base + PyFunceble.OUTPUTS["parent_directory"]
# We initiate the structure b... | [
"Backup",
"the",
"developer",
"state",
"of",
"output",
"/",
"in",
"order",
"to",
"make",
"it",
"restorable",
"and",
"portable",
"for",
"user",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/directory_structure.py#L109-L154 | [
"def",
"backup",
"(",
"self",
")",
":",
"# We set the current output directory path.",
"output_path",
"=",
"self",
".",
"base",
"+",
"PyFunceble",
".",
"OUTPUTS",
"[",
"\"parent_directory\"",
"]",
"# We initiate the structure base.",
"result",
"=",
"{",
"PyFunceble",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | DirectoryStructure._restore_replace | Check if we need to replace ".gitignore" to ".keep".
:return: The replacement status.
:rtype: bool | PyFunceble/directory_structure.py | def _restore_replace(self):
"""
Check if we need to replace ".gitignore" to ".keep".
:return: The replacement status.
:rtype: bool
"""
if PyFunceble.path.isdir(self.base + ".git"):
# The `.git` directory exist.
if "PyFunceble" not in Command("gi... | def _restore_replace(self):
"""
Check if we need to replace ".gitignore" to ".keep".
:return: The replacement status.
:rtype: bool
"""
if PyFunceble.path.isdir(self.base + ".git"):
# The `.git` directory exist.
if "PyFunceble" not in Command("gi... | [
"Check",
"if",
"we",
"need",
"to",
"replace",
".",
"gitignore",
"to",
".",
"keep",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/directory_structure.py#L156-L179 | [
"def",
"_restore_replace",
"(",
"self",
")",
":",
"if",
"PyFunceble",
".",
"path",
".",
"isdir",
"(",
"self",
".",
"base",
"+",
"\".git\"",
")",
":",
"# The `.git` directory exist.",
"if",
"\"PyFunceble\"",
"not",
"in",
"Command",
"(",
"\"git remote show origin\... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | DirectoryStructure._update_structure_from_config | Update the paths according to configs.
:param structure: The read structure.
:type structure: dict | PyFunceble/directory_structure.py | def _update_structure_from_config(self, structure):
"""
Update the paths according to configs.
:param structure: The read structure.
:type structure: dict
"""
# We initiate a variable which will map what we have to replace `ouput` to.
# Indeed, as we allow the u... | def _update_structure_from_config(self, structure):
"""
Update the paths according to configs.
:param structure: The read structure.
:type structure: dict
"""
# We initiate a variable which will map what we have to replace `ouput` to.
# Indeed, as we allow the u... | [
"Update",
"the",
"paths",
"according",
"to",
"configs",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/directory_structure.py#L181-L363 | [
"def",
"_update_structure_from_config",
"(",
"self",
",",
"structure",
")",
":",
"# We initiate a variable which will map what we have to replace `ouput` to.",
"# Indeed, as we allow the user to change directory names directly from the",
"# configuration, here we initiate what we have to replace... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | DirectoryStructure._get_structure | Get the structure we are going to work with.
:return: The structure we have to work with.
:rtype: dict | PyFunceble/directory_structure.py | def _get_structure(self):
"""
Get the structure we are going to work with.
:return: The structure we have to work with.
:rtype: dict
"""
# We initiate an empty variable which is going to save the location of
# file we are going to download.
structure_fil... | def _get_structure(self):
"""
Get the structure we are going to work with.
:return: The structure we have to work with.
:rtype: dict
"""
# We initiate an empty variable which is going to save the location of
# file we are going to download.
structure_fil... | [
"Get",
"the",
"structure",
"we",
"are",
"going",
"to",
"work",
"with",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/directory_structure.py#L365-L436 | [
"def",
"_get_structure",
"(",
"self",
")",
":",
"# We initiate an empty variable which is going to save the location of",
"# file we are going to download.",
"structure_file",
"=",
"\"\"",
"# We initiate the variable which will save the request instance.",
"req",
"=",
"\"\"",
"if",
"... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | DirectoryStructure._create_directory | Creates the given directory if it does not exists.
:param directory: The directory to create.
:type directory: str
:param loop: Tell us if we are in the creation loop or not.
:type loop: bool | PyFunceble/directory_structure.py | def _create_directory(cls, directory, loop=False):
"""
Creates the given directory if it does not exists.
:param directory: The directory to create.
:type directory: str
:param loop: Tell us if we are in the creation loop or not.
:type loop: bool
"""
if... | def _create_directory(cls, directory, loop=False):
"""
Creates the given directory if it does not exists.
:param directory: The directory to create.
:type directory: str
:param loop: Tell us if we are in the creation loop or not.
:type loop: bool
"""
if... | [
"Creates",
"the",
"given",
"directory",
"if",
"it",
"does",
"not",
"exists",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/directory_structure.py#L439-L482 | [
"def",
"_create_directory",
"(",
"cls",
",",
"directory",
",",
"loop",
"=",
"False",
")",
":",
"if",
"not",
"loop",
"and",
"PyFunceble",
".",
"directory_separator",
"in",
"directory",
":",
"# * We are not in the loop.",
"# and",
"# * The directory separator in the giv... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | DirectoryStructure.restore | Restore the 'output/' directory structure based on the `dir_structure.json` file. | PyFunceble/directory_structure.py | def restore(self):
"""
Restore the 'output/' directory structure based on the `dir_structure.json` file.
"""
# We get the structure we have to create/apply.
structure = self._get_structure()
# We get the list of key which is implicitly the list of directory to recreate.... | def restore(self):
"""
Restore the 'output/' directory structure based on the `dir_structure.json` file.
"""
# We get the structure we have to create/apply.
structure = self._get_structure()
# We get the list of key which is implicitly the list of directory to recreate.... | [
"Restore",
"the",
"output",
"/",
"directory",
"structure",
"based",
"on",
"the",
"dir_structure",
".",
"json",
"file",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/directory_structure.py#L484-L607 | [
"def",
"restore",
"(",
"self",
")",
":",
"# We get the structure we have to create/apply.",
"structure",
"=",
"self",
".",
"_get_structure",
"(",
")",
"# We get the list of key which is implicitly the list of directory to recreate.",
"list_of_key",
"=",
"list",
"(",
"structure"... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | DirectoryStructure.delete_uneeded | Delete the directory which are not registered into our structure. | PyFunceble/directory_structure.py | def delete_uneeded(self):
"""
Delete the directory which are not registered into our structure.
"""
# We get the structure we have to apply.
structure = self._get_structure()
# We get the list of key which is implicitly the list of directory we do not bave to delete.
... | def delete_uneeded(self):
"""
Delete the directory which are not registered into our structure.
"""
# We get the structure we have to apply.
structure = self._get_structure()
# We get the list of key which is implicitly the list of directory we do not bave to delete.
... | [
"Delete",
"the",
"directory",
"which",
"are",
"not",
"registered",
"into",
"our",
"structure",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/directory_structure.py#L609-L641 | [
"def",
"delete_uneeded",
"(",
"self",
")",
":",
"# We get the structure we have to apply.",
"structure",
"=",
"self",
".",
"_get_structure",
"(",
")",
"# We get the list of key which is implicitly the list of directory we do not bave to delete.",
"list_of_key",
"=",
"list",
"(",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Load._set_path_to_configs | Set the paths to the configuration files.
:param path_to_config: The possible path to the config to load.
:type path_to_config: str
:return:
The path to the config to read (0), the path to the default
configuration to read as fallback.(1)
:rtype: tuple | PyFunceble/config.py | def _set_path_to_configs(cls, path_to_config):
"""
Set the paths to the configuration files.
:param path_to_config: The possible path to the config to load.
:type path_to_config: str
:return:
The path to the config to read (0), the path to the default
co... | def _set_path_to_configs(cls, path_to_config):
"""
Set the paths to the configuration files.
:param path_to_config: The possible path to the config to load.
:type path_to_config: str
:return:
The path to the config to read (0), the path to the default
co... | [
"Set",
"the",
"paths",
"to",
"the",
"configuration",
"files",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L195-L225 | [
"def",
"_set_path_to_configs",
"(",
"cls",
",",
"path_to_config",
")",
":",
"if",
"not",
"path_to_config",
".",
"endswith",
"(",
"PyFunceble",
".",
"directory_separator",
")",
":",
"# The path to the config does not ends with the directory separator.",
"# We initiate the defa... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Load._load_config_file | Load .PyFunceble.yaml into the system. | PyFunceble/config.py | def _load_config_file(self):
"""
Load .PyFunceble.yaml into the system.
"""
try:
# We try to load the configuration file.
PyFunceble.CONFIGURATION.update(
Dict.from_yaml(File(self.path_to_config).read())
)
# We install th... | def _load_config_file(self):
"""
Load .PyFunceble.yaml into the system.
"""
try:
# We try to load the configuration file.
PyFunceble.CONFIGURATION.update(
Dict.from_yaml(File(self.path_to_config).read())
)
# We install th... | [
"Load",
".",
"PyFunceble",
".",
"yaml",
"into",
"the",
"system",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L227-L262 | [
"def",
"_load_config_file",
"(",
"self",
")",
":",
"try",
":",
"# We try to load the configuration file.",
"PyFunceble",
".",
"CONFIGURATION",
".",
"update",
"(",
"Dict",
".",
"from_yaml",
"(",
"File",
"(",
"self",
".",
"path_to_config",
")",
".",
"read",
"(",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Load._install_production_config | Download the production configuration and install it in the
current directory. | PyFunceble/config.py | def _install_production_config(self):
"""
Download the production configuration and install it in the
current directory.
"""
# We initiate the link to the production configuration.
# It is not hard coded because this method is called only if we
# are sure that th... | def _install_production_config(self):
"""
Download the production configuration and install it in the
current directory.
"""
# We initiate the link to the production configuration.
# It is not hard coded because this method is called only if we
# are sure that th... | [
"Download",
"the",
"production",
"configuration",
"and",
"install",
"it",
"in",
"the",
"current",
"directory",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L264-L290 | [
"def",
"_install_production_config",
"(",
"self",
")",
":",
"# We initiate the link to the production configuration.",
"# It is not hard coded because this method is called only if we",
"# are sure that the configuration file exist.",
"production_config_link",
"=",
"\"https://raw.githubusercon... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Load._install_iana_config | Download `iana-domains-db.json` if not present. | PyFunceble/config.py | def _install_iana_config(cls):
"""
Download `iana-domains-db.json` if not present.
"""
# We initiate the link to the iana configuration.
# It is not hard coded because this method is called only if we
# are sure that the configuration file exist.
iana_link = PyFu... | def _install_iana_config(cls):
"""
Download `iana-domains-db.json` if not present.
"""
# We initiate the link to the iana configuration.
# It is not hard coded because this method is called only if we
# are sure that the configuration file exist.
iana_link = PyFu... | [
"Download",
"iana",
"-",
"domains",
"-",
"db",
".",
"json",
"if",
"not",
"present",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L293-L318 | [
"def",
"_install_iana_config",
"(",
"cls",
")",
":",
"# We initiate the link to the iana configuration.",
"# It is not hard coded because this method is called only if we",
"# are sure that the configuration file exist.",
"iana_link",
"=",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"li... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Load._install_psl_config | Download `public-suffix.json` if not present. | PyFunceble/config.py | def _install_psl_config(cls):
"""
Download `public-suffix.json` if not present.
"""
# We initiate the link to the public suffix configuration.
# It is not hard coded because this method is called only if we
# are sure that the configuration file exist.
psl_link =... | def _install_psl_config(cls):
"""
Download `public-suffix.json` if not present.
"""
# We initiate the link to the public suffix configuration.
# It is not hard coded because this method is called only if we
# are sure that the configuration file exist.
psl_link =... | [
"Download",
"public",
"-",
"suffix",
".",
"json",
"if",
"not",
"present",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L321-L349 | [
"def",
"_install_psl_config",
"(",
"cls",
")",
":",
"# We initiate the link to the public suffix configuration.",
"# It is not hard coded because this method is called only if we",
"# are sure that the configuration file exist.",
"psl_link",
"=",
"PyFunceble",
".",
"CONFIGURATION",
"[",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Load._install_directory_structure_file | Download the latest version of `dir_structure_production.json`. | PyFunceble/config.py | def _install_directory_structure_file(cls):
"""
Download the latest version of `dir_structure_production.json`.
"""
# We initiate the link to the public suffix configuration.
# It is not hard coded because this method is called only if we
# are sure that the configuratio... | def _install_directory_structure_file(cls):
"""
Download the latest version of `dir_structure_production.json`.
"""
# We initiate the link to the public suffix configuration.
# It is not hard coded because this method is called only if we
# are sure that the configuratio... | [
"Download",
"the",
"latest",
"version",
"of",
"dir_structure_production",
".",
"json",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L352-L383 | [
"def",
"_install_directory_structure_file",
"(",
"cls",
")",
":",
"# We initiate the link to the public suffix configuration.",
"# It is not hard coded because this method is called only if we",
"# are sure that the configuration file exist.",
"dir_structure_link",
"=",
"PyFunceble",
".",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Merge._merge_values | Simply merge the older into the new one. | PyFunceble/config.py | def _merge_values(self):
"""
Simply merge the older into the new one.
"""
to_remove = []
self.new_config = Dict(
Dict(self.upstream_config).merge(PyFunceble.CONFIGURATION)
).remove_key(to_remove) | def _merge_values(self):
"""
Simply merge the older into the new one.
"""
to_remove = []
self.new_config = Dict(
Dict(self.upstream_config).merge(PyFunceble.CONFIGURATION)
).remove_key(to_remove) | [
"Simply",
"merge",
"the",
"older",
"into",
"the",
"new",
"one",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L415-L424 | [
"def",
"_merge_values",
"(",
"self",
")",
":",
"to_remove",
"=",
"[",
"]",
"self",
".",
"new_config",
"=",
"Dict",
"(",
"Dict",
"(",
"self",
".",
"upstream_config",
")",
".",
"merge",
"(",
"PyFunceble",
".",
"CONFIGURATION",
")",
")",
".",
"remove_key",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Merge._load | Execute the logic behind the merging. | PyFunceble/config.py | def _load(self):
"""
Execute the logic behind the merging.
"""
if "PYFUNCEBLE_AUTO_CONFIGURATION" not in PyFunceble.environ:
# The auto configuration environment variable is not set.
while True:
# We infinitly loop until we get a reponse which is... | def _load(self):
"""
Execute the logic behind the merging.
"""
if "PYFUNCEBLE_AUTO_CONFIGURATION" not in PyFunceble.environ:
# The auto configuration environment variable is not set.
while True:
# We infinitly loop until we get a reponse which is... | [
"Execute",
"the",
"logic",
"behind",
"the",
"merging",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L433-L491 | [
"def",
"_load",
"(",
"self",
")",
":",
"if",
"\"PYFUNCEBLE_AUTO_CONFIGURATION\"",
"not",
"in",
"PyFunceble",
".",
"environ",
":",
"# The auto configuration environment variable is not set.",
"while",
"True",
":",
"# We infinitly loop until we get a reponse which is `y|Y` or `n|N`... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Version.split_versions | Convert the versions to a shorter one.
:param version: The version to split.
:type version: str
:param return_non_digits:
Activate the return of the non-digits parts of the splitted
version.
:type return_non_digits: bool
:return: The splitted version na... | PyFunceble/config.py | def split_versions(cls, version, return_non_digits=False):
"""
Convert the versions to a shorter one.
:param version: The version to split.
:type version: str
:param return_non_digits:
Activate the return of the non-digits parts of the splitted
version.
... | def split_versions(cls, version, return_non_digits=False):
"""
Convert the versions to a shorter one.
:param version: The version to split.
:type version: str
:param return_non_digits:
Activate the return of the non-digits parts of the splitted
version.
... | [
"Convert",
"the",
"versions",
"to",
"a",
"shorter",
"one",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L528-L562 | [
"def",
"split_versions",
"(",
"cls",
",",
"version",
",",
"return_non_digits",
"=",
"False",
")",
":",
"# We split the version.",
"splited_version",
"=",
"version",
".",
"split",
"(",
"\".\"",
")",
"# We split the parsed version and keep the digits.",
"digits",
"=",
"... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Version.check_versions | Compare the given versions.
:param local: The local version converted by split_versions().
:type local: list
:param upstream: The upstream version converted by split_versions().
:type upstream: list
:return:
- True: local < upstream
- None: local == ups... | PyFunceble/config.py | def check_versions(cls, local, upstream):
"""
Compare the given versions.
:param local: The local version converted by split_versions().
:type local: list
:param upstream: The upstream version converted by split_versions().
:type upstream: list
:return:
... | def check_versions(cls, local, upstream):
"""
Compare the given versions.
:param local: The local version converted by split_versions().
:type local: list
:param upstream: The upstream version converted by split_versions().
:type upstream: list
:return:
... | [
"Compare",
"the",
"given",
"versions",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L584-L640 | [
"def",
"check_versions",
"(",
"cls",
",",
"local",
",",
"upstream",
")",
":",
"# A version should be in format [1,2,3] which is actually the version `1.2.3`",
"# So as we only have 3 elements in the versioning,",
"# we initiate the following variable in order to get the status of each parts.... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Version.compare | Compare the current version with the upstream saved version. | PyFunceble/config.py | def compare(self):
"""
Compare the current version with the upstream saved version.
"""
if self.upstream_data["force_update"]["status"]:
# The force_update status is set to True.
for minimal in self.upstream_data["force_update"]["minimal_version"]:
... | def compare(self):
"""
Compare the current version with the upstream saved version.
"""
if self.upstream_data["force_update"]["status"]:
# The force_update status is set to True.
for minimal in self.upstream_data["force_update"]["minimal_version"]:
... | [
"Compare",
"the",
"current",
"version",
"with",
"the",
"upstream",
"saved",
"version",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L642-L819 | [
"def",
"compare",
"(",
"self",
")",
":",
"if",
"self",
".",
"upstream_data",
"[",
"\"force_update\"",
"]",
"[",
"\"status\"",
"]",
":",
"# The force_update status is set to True.",
"for",
"minimal",
"in",
"self",
".",
"upstream_data",
"[",
"\"force_update\"",
"]",... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Version.is_cloned | Let us know if we are currently in the cloned version of
PyFunceble which implicitly mean that we are in developement mode. | PyFunceble/config.py | def is_cloned(cls):
"""
Let us know if we are currently in the cloned version of
PyFunceble which implicitly mean that we are in developement mode.
"""
if not PyFunceble.path.isdir(".git"):
# The git directory does not exist.
# We return False, the curre... | def is_cloned(cls):
"""
Let us know if we are currently in the cloned version of
PyFunceble which implicitly mean that we are in developement mode.
"""
if not PyFunceble.path.isdir(".git"):
# The git directory does not exist.
# We return False, the curre... | [
"Let",
"us",
"know",
"if",
"we",
"are",
"currently",
"in",
"the",
"cloned",
"version",
"of",
"PyFunceble",
"which",
"implicitly",
"mean",
"that",
"we",
"are",
"in",
"developement",
"mode",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/config.py#L822-L878 | [
"def",
"is_cloned",
"(",
"cls",
")",
":",
"if",
"not",
"PyFunceble",
".",
"path",
".",
"isdir",
"(",
"\".git\"",
")",
":",
"# The git directory does not exist.",
"# We return False, the current version is not the cloned version.",
"return",
"False",
"# We list the list of f... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Generate._handle_non_existant_index | Handle and check that some configuration index exists. | PyFunceble/generate.py | def _handle_non_existant_index(cls):
"""
Handle and check that some configuration index exists.
"""
try:
# We try to call the http code.
PyFunceble.INTERN["http_code"]
except KeyError:
# If it is not found.
# We initiate an empty ... | def _handle_non_existant_index(cls):
"""
Handle and check that some configuration index exists.
"""
try:
# We try to call the http code.
PyFunceble.INTERN["http_code"]
except KeyError:
# If it is not found.
# We initiate an empty ... | [
"Handle",
"and",
"check",
"that",
"some",
"configuration",
"index",
"exists",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/generate.py#L130-L151 | [
"def",
"_handle_non_existant_index",
"(",
"cls",
")",
":",
"try",
":",
"# We try to call the http code.",
"PyFunceble",
".",
"INTERN",
"[",
"\"http_code\"",
"]",
"except",
"KeyError",
":",
"# If it is not found.",
"# We initiate an empty http code.",
"PyFunceble",
".",
"I... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Generate._analytic_host_file_directory | Return the analytic directory to write depending of the matched
status. | PyFunceble/generate.py | def _analytic_host_file_directory(self):
"""
Return the analytic directory to write depending of the matched
status.
"""
# We construct the path to the analytic directory.
output_dir = (
self.output_parent_dir
+ PyFunceble.OUTPUTS["analytic"]["dir... | def _analytic_host_file_directory(self):
"""
Return the analytic directory to write depending of the matched
status.
"""
# We construct the path to the analytic directory.
output_dir = (
self.output_parent_dir
+ PyFunceble.OUTPUTS["analytic"]["dir... | [
"Return",
"the",
"analytic",
"directory",
"to",
"write",
"depending",
"of",
"the",
"matched",
"status",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/generate.py#L153-L192 | [
"def",
"_analytic_host_file_directory",
"(",
"self",
")",
":",
"# We construct the path to the analytic directory.",
"output_dir",
"=",
"(",
"self",
".",
"output_parent_dir",
"+",
"PyFunceble",
".",
"OUTPUTS",
"[",
"\"analytic\"",
"]",
"[",
"\"directories\"",
"]",
"[",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Generate.info_files | Generate the hosts file, the plain list and the splitted lists. | PyFunceble/generate.py | def info_files(self): # pylint: disable=inconsistent-return-statements
"""
Generate the hosts file, the plain list and the splitted lists.
"""
if self._do_not_produce_file():
# We do not have to produce file.
# We return false.
return False
... | def info_files(self): # pylint: disable=inconsistent-return-statements
"""
Generate the hosts file, the plain list and the splitted lists.
"""
if self._do_not_produce_file():
# We do not have to produce file.
# We return false.
return False
... | [
"Generate",
"the",
"hosts",
"file",
"the",
"plain",
"list",
"and",
"the",
"splitted",
"lists",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/generate.py#L194-L376 | [
"def",
"info_files",
"(",
"self",
")",
":",
"# pylint: disable=inconsistent-return-statements",
"if",
"self",
".",
"_do_not_produce_file",
"(",
")",
":",
"# We do not have to produce file.",
"# We return false.",
"return",
"False",
"if",
"(",
"\"file_to_test\"",
"in",
"Py... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Generate.unified_file | Generate unified file. Understand by that that we use an unified table
instead of a separate table for each status which could result into a
misunderstanding. | PyFunceble/generate.py | def unified_file(self):
"""
Generate unified file. Understand by that that we use an unified table
instead of a separate table for each status which could result into a
misunderstanding.
"""
if (
"file_to_test" in PyFunceble.INTERN
and PyFunceble.... | def unified_file(self):
"""
Generate unified file. Understand by that that we use an unified table
instead of a separate table for each status which could result into a
misunderstanding.
"""
if (
"file_to_test" in PyFunceble.INTERN
and PyFunceble.... | [
"Generate",
"unified",
"file",
".",
"Understand",
"by",
"that",
"that",
"we",
"use",
"an",
"unified",
"table",
"instead",
"of",
"a",
"separate",
"table",
"for",
"each",
"status",
"which",
"could",
"result",
"into",
"a",
"misunderstanding",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/generate.py#L378-L433 | [
"def",
"unified_file",
"(",
"self",
")",
":",
"if",
"(",
"\"file_to_test\"",
"in",
"PyFunceble",
".",
"INTERN",
"and",
"PyFunceble",
".",
"INTERN",
"[",
"\"file_to_test\"",
"]",
"and",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"unified\"",
"]",
")",
":",
"#... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Generate.analytic_file | Generate :code:`Analytic/*` files based on the given old and
new statuses.
:param new_status: The new status of the domain.
:type new_status: str
:param old_status: The old status of the domain.
:type old_status: str | PyFunceble/generate.py | def analytic_file(self, new_status, old_status=None):
"""
Generate :code:`Analytic/*` files based on the given old and
new statuses.
:param new_status: The new status of the domain.
:type new_status: str
:param old_status: The old status of the domain.
:type old... | def analytic_file(self, new_status, old_status=None):
"""
Generate :code:`Analytic/*` files based on the given old and
new statuses.
:param new_status: The new status of the domain.
:type new_status: str
:param old_status: The old status of the domain.
:type old... | [
"Generate",
":",
"code",
":",
"Analytic",
"/",
"*",
"files",
"based",
"on",
"the",
"given",
"old",
"and",
"new",
"statuses",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/generate.py#L435-L519 | [
"def",
"analytic_file",
"(",
"self",
",",
"new_status",
",",
"old_status",
"=",
"None",
")",
":",
"if",
"not",
"old_status",
":",
"# The old status is not given.",
"# We set the old status as the one given globally.",
"old_status",
"=",
"self",
".",
"domain_status",
"if... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Generate._prints_status_file | Logic behind the printing (in file) when generating status file. | PyFunceble/generate.py | def _prints_status_file(self): # pylint: disable=too-many-branches
"""
Logic behind the printing (in file) when generating status file.
"""
if PyFunceble.INTERN["file_to_test"]:
# We are testing a file.
output = (
self.output_parent_dir
... | def _prints_status_file(self): # pylint: disable=too-many-branches
"""
Logic behind the printing (in file) when generating status file.
"""
if PyFunceble.INTERN["file_to_test"]:
# We are testing a file.
output = (
self.output_parent_dir
... | [
"Logic",
"behind",
"the",
"printing",
"(",
"in",
"file",
")",
"when",
"generating",
"status",
"file",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/generate.py#L521-L650 | [
"def",
"_prints_status_file",
"(",
"self",
")",
":",
"# pylint: disable=too-many-branches",
"if",
"PyFunceble",
".",
"INTERN",
"[",
"\"file_to_test\"",
"]",
":",
"# We are testing a file.",
"output",
"=",
"(",
"self",
".",
"output_parent_dir",
"+",
"PyFunceble",
".",
... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Generate._prints_status_screen | Logic behind the printing (on screen) when generating status file. | PyFunceble/generate.py | def _prints_status_screen(self):
"""
Logic behind the printing (on screen) when generating status file.
"""
if not PyFunceble.CONFIGURATION["quiet"]:
# The quiet mode is not activated.
if PyFunceble.CONFIGURATION["less"]:
# We have to print less ... | def _prints_status_screen(self):
"""
Logic behind the printing (on screen) when generating status file.
"""
if not PyFunceble.CONFIGURATION["quiet"]:
# The quiet mode is not activated.
if PyFunceble.CONFIGURATION["less"]:
# We have to print less ... | [
"Logic",
"behind",
"the",
"printing",
"(",
"on",
"screen",
")",
"when",
"generating",
"status",
"file",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/generate.py#L652-L706 | [
"def",
"_prints_status_screen",
"(",
"self",
")",
":",
"if",
"not",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"quiet\"",
"]",
":",
"# The quiet mode is not activated.",
"if",
"PyFunceble",
".",
"CONFIGURATION",
"[",
"\"less\"",
"]",
":",
"# We have to print less info... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Generate.status_file | Generate a file according to the domain status. | PyFunceble/generate.py | def status_file(self): # pylint: disable=inconsistent-return-statements
"""
Generate a file according to the domain status.
"""
if "file_to_test" in PyFunceble.INTERN:
# We are not testing as an imported module.
# We generate the hosts file.
Generat... | def status_file(self): # pylint: disable=inconsistent-return-statements
"""
Generate a file according to the domain status.
"""
if "file_to_test" in PyFunceble.INTERN:
# We are not testing as an imported module.
# We generate the hosts file.
Generat... | [
"Generate",
"a",
"file",
"according",
"to",
"the",
"domain",
"status",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/generate.py#L708-L746 | [
"def",
"status_file",
"(",
"self",
")",
":",
"# pylint: disable=inconsistent-return-statements",
"if",
"\"file_to_test\"",
"in",
"PyFunceble",
".",
"INTERN",
":",
"# We are not testing as an imported module.",
"# We generate the hosts file.",
"Generate",
"(",
"self",
".",
"do... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
test | Generate._do_not_produce_file | Check if we are allowed to produce a file based from the given
information.
:return:
The state of the production.
True: We do not produce file.
False: We do produce file.
:rtype: bool | PyFunceble/generate.py | def _do_not_produce_file(self):
"""
Check if we are allowed to produce a file based from the given
information.
:return:
The state of the production.
True: We do not produce file.
False: We do produce file.
:rtype: bool
"""
if... | def _do_not_produce_file(self):
"""
Check if we are allowed to produce a file based from the given
information.
:return:
The state of the production.
True: We do not produce file.
False: We do produce file.
:rtype: bool
"""
if... | [
"Check",
"if",
"we",
"are",
"allowed",
"to",
"produce",
"a",
"file",
"based",
"from",
"the",
"given",
"information",
"."
] | funilrys/PyFunceble | python | https://github.com/funilrys/PyFunceble/blob/cdf69cbde120199171f7158e1c33635753e6e2f5/PyFunceble/generate.py#L748-L771 | [
"def",
"_do_not_produce_file",
"(",
"self",
")",
":",
"if",
"(",
"Inactive",
"(",
")",
".",
"is_present",
"(",
")",
"and",
"self",
".",
"domain_status",
"in",
"[",
"PyFunceble",
".",
"STATUS",
"[",
"\"official\"",
"]",
"[",
"\"down\"",
"]",
",",
"PyFunce... | cdf69cbde120199171f7158e1c33635753e6e2f5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.