body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def get(iterable: Iterable[T], **attrs: Any) -> Optional[T]:
"A helper that returns the first element in the iterable that meets\n all the traits passed in ``attrs``. This is an alternative for\n :func:`~discord.utils.find`.\n\n When multiple attributes are specified, they are checked using\n logical AN... | 277,057,969,456,913,730 | A helper that returns the first element in the iterable that meets
all the traits passed in ``attrs``. This is an alternative for
:func:`~discord.utils.find`.
When multiple attributes are specified, they are checked using
logical AND, not logical OR. Meaning they have to meet every
attribute passed in and not one of t... | discord/utils.py | get | Astrea49/enhanced-discord.py | python | def get(iterable: Iterable[T], **attrs: Any) -> Optional[T]:
"A helper that returns the first element in the iterable that meets\n all the traits passed in ``attrs``. This is an alternative for\n :func:`~discord.utils.find`.\n\n When multiple attributes are specified, they are checked using\n logical AN... |
async def sleep_until(when: datetime.datetime, result: Optional[T]=None) -> Optional[T]:
'|coro|\n\n Sleep until a specified time.\n\n If the time supplied is in the past this function will yield instantly.\n\n .. versionadded:: 1.3\n\n Parameters\n -----------\n when: :class:`datetime.datetime`\n... | 4,609,430,239,901,095,400 | |coro|
Sleep until a specified time.
If the time supplied is in the past this function will yield instantly.
.. versionadded:: 1.3
Parameters
-----------
when: :class:`datetime.datetime`
The timestamp in which to sleep until. If the datetime is naive then
it is assumed to be local time.
result: Any
If p... | discord/utils.py | sleep_until | Astrea49/enhanced-discord.py | python | async def sleep_until(when: datetime.datetime, result: Optional[T]=None) -> Optional[T]:
'|coro|\n\n Sleep until a specified time.\n\n If the time supplied is in the past this function will yield instantly.\n\n .. versionadded:: 1.3\n\n Parameters\n -----------\n when: :class:`datetime.datetime`\n... |
def utcnow() -> datetime.datetime:
'A helper function to return an aware UTC datetime representing the current time.\n\n This should be preferred to :meth:`datetime.datetime.utcnow` since it is an aware\n datetime, compared to the naive datetime in the standard library.\n\n .. versionadded:: 2.0\n\n Ret... | -7,392,825,032,410,449,000 | A helper function to return an aware UTC datetime representing the current time.
This should be preferred to :meth:`datetime.datetime.utcnow` since it is an aware
datetime, compared to the naive datetime in the standard library.
.. versionadded:: 2.0
Returns
--------
:class:`datetime.datetime`
The current aware ... | discord/utils.py | utcnow | Astrea49/enhanced-discord.py | python | def utcnow() -> datetime.datetime:
'A helper function to return an aware UTC datetime representing the current time.\n\n This should be preferred to :meth:`datetime.datetime.utcnow` since it is an aware\n datetime, compared to the naive datetime in the standard library.\n\n .. versionadded:: 2.0\n\n Ret... |
def valid_icon_size(size: int) -> bool:
'Icons must be power of 2 within [16, 4096].'
return ((not (size & (size - 1))) and (4096 >= size >= 16)) | 8,354,134,979,157,664,000 | Icons must be power of 2 within [16, 4096]. | discord/utils.py | valid_icon_size | Astrea49/enhanced-discord.py | python | def valid_icon_size(size: int) -> bool:
return ((not (size & (size - 1))) and (4096 >= size >= 16)) |
def _string_width(string: str, *, _IS_ASCII=_IS_ASCII) -> int:
"Returns string's width."
match = _IS_ASCII.match(string)
if match:
return match.endpos
UNICODE_WIDE_CHAR_TYPE = 'WFA'
func = unicodedata.east_asian_width
return sum(((2 if (func(char) in UNICODE_WIDE_CHAR_TYPE) else 1) for c... | 8,570,024,438,440,873,000 | Returns string's width. | discord/utils.py | _string_width | Astrea49/enhanced-discord.py | python | def _string_width(string: str, *, _IS_ASCII=_IS_ASCII) -> int:
match = _IS_ASCII.match(string)
if match:
return match.endpos
UNICODE_WIDE_CHAR_TYPE = 'WFA'
func = unicodedata.east_asian_width
return sum(((2 if (func(char) in UNICODE_WIDE_CHAR_TYPE) else 1) for char in string)) |
def resolve_invite(invite: Union[(Invite, str)]) -> str:
'\n Resolves an invite from a :class:`~discord.Invite`, URL or code.\n\n Parameters\n -----------\n invite: Union[:class:`~discord.Invite`, :class:`str`]\n The invite.\n\n Returns\n --------\n :class:`str`\n The invite code.... | -6,593,978,646,863,497,000 | Resolves an invite from a :class:`~discord.Invite`, URL or code.
Parameters
-----------
invite: Union[:class:`~discord.Invite`, :class:`str`]
The invite.
Returns
--------
:class:`str`
The invite code. | discord/utils.py | resolve_invite | Astrea49/enhanced-discord.py | python | def resolve_invite(invite: Union[(Invite, str)]) -> str:
'\n Resolves an invite from a :class:`~discord.Invite`, URL or code.\n\n Parameters\n -----------\n invite: Union[:class:`~discord.Invite`, :class:`str`]\n The invite.\n\n Returns\n --------\n :class:`str`\n The invite code.... |
def resolve_template(code: Union[(Template, str)]) -> str:
'\n Resolves a template code from a :class:`~discord.Template`, URL or code.\n\n .. versionadded:: 1.4\n\n Parameters\n -----------\n code: Union[:class:`~discord.Template`, :class:`str`]\n The code.\n\n Returns\n --------\n :... | 7,340,644,970,982,626,000 | Resolves a template code from a :class:`~discord.Template`, URL or code.
.. versionadded:: 1.4
Parameters
-----------
code: Union[:class:`~discord.Template`, :class:`str`]
The code.
Returns
--------
:class:`str`
The template code. | discord/utils.py | resolve_template | Astrea49/enhanced-discord.py | python | def resolve_template(code: Union[(Template, str)]) -> str:
'\n Resolves a template code from a :class:`~discord.Template`, URL or code.\n\n .. versionadded:: 1.4\n\n Parameters\n -----------\n code: Union[:class:`~discord.Template`, :class:`str`]\n The code.\n\n Returns\n --------\n :... |
def remove_markdown(text: str, *, ignore_links: bool=True) -> str:
'A helper function that removes markdown characters.\n\n .. versionadded:: 1.7\n\n .. note::\n This function is not markdown aware and may remove meaning from the original text. For example,\n if the input contains ``10 *... | -8,926,758,432,552,786,000 | A helper function that removes markdown characters.
.. versionadded:: 1.7
.. note::
This function is not markdown aware and may remove meaning from the original text. For example,
if the input contains ``10 * 5`` then it will be converted into ``10 5``.
Parameters
-----------
text: :class:`str`
... | discord/utils.py | remove_markdown | Astrea49/enhanced-discord.py | python | def remove_markdown(text: str, *, ignore_links: bool=True) -> str:
'A helper function that removes markdown characters.\n\n .. versionadded:: 1.7\n\n .. note::\n This function is not markdown aware and may remove meaning from the original text. For example,\n if the input contains ``10 *... |
def escape_markdown(text: str, *, as_needed: bool=False, ignore_links: bool=True) -> str:
"A helper function that escapes Discord's markdown.\n\n Parameters\n -----------\n text: :class:`str`\n The text to escape markdown from.\n as_needed: :class:`bool`\n Whether to escape the markdown ch... | 7,610,843,465,327,333,000 | A helper function that escapes Discord's markdown.
Parameters
-----------
text: :class:`str`
The text to escape markdown from.
as_needed: :class:`bool`
Whether to escape the markdown characters as needed. This
means that it does not escape extraneous characters if it's
not necessary, e.g. ``**hello**``... | discord/utils.py | escape_markdown | Astrea49/enhanced-discord.py | python | def escape_markdown(text: str, *, as_needed: bool=False, ignore_links: bool=True) -> str:
"A helper function that escapes Discord's markdown.\n\n Parameters\n -----------\n text: :class:`str`\n The text to escape markdown from.\n as_needed: :class:`bool`\n Whether to escape the markdown ch... |
def escape_mentions(text: str) -> str:
'A helper function that escapes everyone, here, role, and user mentions.\n\n .. note::\n\n This does not include channel mentions.\n\n .. note::\n\n For more granular control over what mentions should be escaped\n within messages, refer to the :class... | 7,038,716,603,072,212,000 | A helper function that escapes everyone, here, role, and user mentions.
.. note::
This does not include channel mentions.
.. note::
For more granular control over what mentions should be escaped
within messages, refer to the :class:`~discord.AllowedMentions`
class.
Parameters
-----------
text: :cla... | discord/utils.py | escape_mentions | Astrea49/enhanced-discord.py | python | def escape_mentions(text: str) -> str:
'A helper function that escapes everyone, here, role, and user mentions.\n\n .. note::\n\n This does not include channel mentions.\n\n .. note::\n\n For more granular control over what mentions should be escaped\n within messages, refer to the :class... |
def as_chunks(iterator: _Iter[T], max_size: int) -> _Iter[List[T]]:
'A helper function that collects an iterator into chunks of a given size.\n\n .. versionadded:: 2.0\n\n Parameters\n ----------\n iterator: Union[:class:`collections.abc.Iterator`, :class:`collections.abc.AsyncIterator`]\n The it... | 6,781,882,996,010,155,000 | A helper function that collects an iterator into chunks of a given size.
.. versionadded:: 2.0
Parameters
----------
iterator: Union[:class:`collections.abc.Iterator`, :class:`collections.abc.AsyncIterator`]
The iterator to chunk, can be sync or async.
max_size: :class:`int`
The maximum chunk size.
.. warni... | discord/utils.py | as_chunks | Astrea49/enhanced-discord.py | python | def as_chunks(iterator: _Iter[T], max_size: int) -> _Iter[List[T]]:
'A helper function that collects an iterator into chunks of a given size.\n\n .. versionadded:: 2.0\n\n Parameters\n ----------\n iterator: Union[:class:`collections.abc.Iterator`, :class:`collections.abc.AsyncIterator`]\n The it... |
def format_dt(dt: datetime.datetime, /, style: Optional[TimestampStyle]=None) -> str:
"A helper function to format a :class:`datetime.datetime` for presentation within Discord.\n\n This allows for a locale-independent way of presenting data using Discord specific Markdown.\n\n +-------------+-----------------... | 4,399,302,417,089,593,300 | A helper function to format a :class:`datetime.datetime` for presentation within Discord.
This allows for a locale-independent way of presenting data using Discord specific Markdown.
+-------------+----------------------------+-----------------+
| Style | Example Output | Description |
+========... | discord/utils.py | format_dt | Astrea49/enhanced-discord.py | python | def format_dt(dt: datetime.datetime, /, style: Optional[TimestampStyle]=None) -> str:
"A helper function to format a :class:`datetime.datetime` for presentation within Discord.\n\n This allows for a locale-independent way of presenting data using Discord specific Markdown.\n\n +-------------+-----------------... |
def __init__(self, rule_file_path=None, rule_ref=None, trigger_instance_file_path=None, trigger_instance_id=None):
'\n :param rule_file_path: Path to the file containing rule definition.\n :type rule_file_path: ``str``\n\n :param trigger_instance_file_path: Path to the file containg trigger ins... | 5,441,461,311,905,855,000 | :param rule_file_path: Path to the file containing rule definition.
:type rule_file_path: ``str``
:param trigger_instance_file_path: Path to the file containg trigger instance definition.
:type trigger_instance_file_path: ``str`` | st2reactor/st2reactor/rules/tester.py | __init__ | Horizon-95/st2 | python | def __init__(self, rule_file_path=None, rule_ref=None, trigger_instance_file_path=None, trigger_instance_id=None):
'\n :param rule_file_path: Path to the file containing rule definition.\n :type rule_file_path: ``str``\n\n :param trigger_instance_file_path: Path to the file containg trigger ins... |
def evaluate(self):
'\n Evaluate trigger instance against the rule.\n\n :return: ``True`` if the rule matches, ``False`` otherwise.\n :rtype: ``boolean``\n '
rule_db = self._get_rule_db()
(trigger_instance_db, trigger_db) = self._get_trigger_instance_db()
if (rule_db.trigger ... | 6,243,851,178,808,306,000 | Evaluate trigger instance against the rule.
:return: ``True`` if the rule matches, ``False`` otherwise.
:rtype: ``boolean`` | st2reactor/st2reactor/rules/tester.py | evaluate | Horizon-95/st2 | python | def evaluate(self):
'\n Evaluate trigger instance against the rule.\n\n :return: ``True`` if the rule matches, ``False`` otherwise.\n :rtype: ``boolean``\n '
rule_db = self._get_rule_db()
(trigger_instance_db, trigger_db) = self._get_trigger_instance_db()
if (rule_db.trigger ... |
def setup_platform(hass, config, add_entities, discovery_info=None):
'Set up the Dyson 360 Eye robot vacuum platform.'
from libpurecoollink.dyson_360_eye import Dyson360Eye
_LOGGER.debug('Creating new Dyson 360 Eye robot vacuum')
if (DYSON_360_EYE_DEVICES not in hass.data):
hass.data[DYSON_360_E... | 1,680,145,101,689,338,000 | Set up the Dyson 360 Eye robot vacuum platform. | homeassistant/components/dyson/vacuum.py | setup_platform | FlorianLudwig/home-assistant | python | def setup_platform(hass, config, add_entities, discovery_info=None):
from libpurecoollink.dyson_360_eye import Dyson360Eye
_LOGGER.debug('Creating new Dyson 360 Eye robot vacuum')
if (DYSON_360_EYE_DEVICES not in hass.data):
hass.data[DYSON_360_EYE_DEVICES] = []
for device in [d for d in ha... |
def __init__(self, device):
'Dyson 360 Eye robot vacuum device.'
_LOGGER.debug('Creating device %s', device.name)
self._device = device | -7,126,531,234,313,695,000 | Dyson 360 Eye robot vacuum device. | homeassistant/components/dyson/vacuum.py | __init__ | FlorianLudwig/home-assistant | python | def __init__(self, device):
_LOGGER.debug('Creating device %s', device.name)
self._device = device |
async def async_added_to_hass(self):
'Call when entity is added to hass.'
self.hass.async_add_job(self._device.add_message_listener, self.on_message) | -7,591,945,232,566,411,000 | Call when entity is added to hass. | homeassistant/components/dyson/vacuum.py | async_added_to_hass | FlorianLudwig/home-assistant | python | async def async_added_to_hass(self):
self.hass.async_add_job(self._device.add_message_listener, self.on_message) |
def on_message(self, message):
'Handle a new messages that was received from the vacuum.'
_LOGGER.debug('Message received for %s device: %s', self.name, message)
self.schedule_update_ha_state() | -953,463,388,233,144,800 | Handle a new messages that was received from the vacuum. | homeassistant/components/dyson/vacuum.py | on_message | FlorianLudwig/home-assistant | python | def on_message(self, message):
_LOGGER.debug('Message received for %s device: %s', self.name, message)
self.schedule_update_ha_state() |
@property
def should_poll(self) -> bool:
'Return True if entity has to be polled for state.\n\n False if entity pushes its state to HA.\n '
return False | 9,137,668,176,441,036,000 | Return True if entity has to be polled for state.
False if entity pushes its state to HA. | homeassistant/components/dyson/vacuum.py | should_poll | FlorianLudwig/home-assistant | python | @property
def should_poll(self) -> bool:
'Return True if entity has to be polled for state.\n\n False if entity pushes its state to HA.\n '
return False |
@property
def name(self):
'Return the name of the device.'
return self._device.name | 2,513,907,752,780,827,000 | Return the name of the device. | homeassistant/components/dyson/vacuum.py | name | FlorianLudwig/home-assistant | python | @property
def name(self):
return self._device.name |
@property
def status(self):
'Return the status of the vacuum cleaner.'
from libpurecoollink.const import Dyson360EyeMode
dyson_labels = {Dyson360EyeMode.INACTIVE_CHARGING: 'Stopped - Charging', Dyson360EyeMode.INACTIVE_CHARGED: 'Stopped - Charged', Dyson360EyeMode.FULL_CLEAN_PAUSED: 'Paused', Dyson360EyeMod... | -6,246,395,718,633,716,000 | Return the status of the vacuum cleaner. | homeassistant/components/dyson/vacuum.py | status | FlorianLudwig/home-assistant | python | @property
def status(self):
from libpurecoollink.const import Dyson360EyeMode
dyson_labels = {Dyson360EyeMode.INACTIVE_CHARGING: 'Stopped - Charging', Dyson360EyeMode.INACTIVE_CHARGED: 'Stopped - Charged', Dyson360EyeMode.FULL_CLEAN_PAUSED: 'Paused', Dyson360EyeMode.FULL_CLEAN_RUNNING: 'Cleaning', Dyson360... |
@property
def battery_level(self):
'Return the battery level of the vacuum cleaner.'
return self._device.state.battery_level | -1,717,471,583,728,855,800 | Return the battery level of the vacuum cleaner. | homeassistant/components/dyson/vacuum.py | battery_level | FlorianLudwig/home-assistant | python | @property
def battery_level(self):
return self._device.state.battery_level |
@property
def fan_speed(self):
'Return the fan speed of the vacuum cleaner.'
from libpurecoollink.const import PowerMode
speed_labels = {PowerMode.MAX: 'Max', PowerMode.QUIET: 'Quiet'}
return speed_labels[self._device.state.power_mode] | 258,221,379,467,744,350 | Return the fan speed of the vacuum cleaner. | homeassistant/components/dyson/vacuum.py | fan_speed | FlorianLudwig/home-assistant | python | @property
def fan_speed(self):
from libpurecoollink.const import PowerMode
speed_labels = {PowerMode.MAX: 'Max', PowerMode.QUIET: 'Quiet'}
return speed_labels[self._device.state.power_mode] |
@property
def fan_speed_list(self):
'Get the list of available fan speed steps of the vacuum cleaner.'
return ['Quiet', 'Max'] | 1,026,950,633,880,453,800 | Get the list of available fan speed steps of the vacuum cleaner. | homeassistant/components/dyson/vacuum.py | fan_speed_list | FlorianLudwig/home-assistant | python | @property
def fan_speed_list(self):
return ['Quiet', 'Max'] |
@property
def device_state_attributes(self):
'Return the specific state attributes of this vacuum cleaner.'
return {ATTR_POSITION: str(self._device.state.position)} | 3,477,451,807,515,275,000 | Return the specific state attributes of this vacuum cleaner. | homeassistant/components/dyson/vacuum.py | device_state_attributes | FlorianLudwig/home-assistant | python | @property
def device_state_attributes(self):
return {ATTR_POSITION: str(self._device.state.position)} |
@property
def is_on(self) -> bool:
'Return True if entity is on.'
from libpurecoollink.const import Dyson360EyeMode
return (self._device.state.state in [Dyson360EyeMode.FULL_CLEAN_INITIATED, Dyson360EyeMode.FULL_CLEAN_ABORTED, Dyson360EyeMode.FULL_CLEAN_RUNNING]) | -8,088,883,491,669,138,000 | Return True if entity is on. | homeassistant/components/dyson/vacuum.py | is_on | FlorianLudwig/home-assistant | python | @property
def is_on(self) -> bool:
from libpurecoollink.const import Dyson360EyeMode
return (self._device.state.state in [Dyson360EyeMode.FULL_CLEAN_INITIATED, Dyson360EyeMode.FULL_CLEAN_ABORTED, Dyson360EyeMode.FULL_CLEAN_RUNNING]) |
@property
def available(self) -> bool:
'Return True if entity is available.'
return True | -3,548,180,598,612,628,500 | Return True if entity is available. | homeassistant/components/dyson/vacuum.py | available | FlorianLudwig/home-assistant | python | @property
def available(self) -> bool:
return True |
@property
def supported_features(self):
'Flag vacuum cleaner robot features that are supported.'
return SUPPORT_DYSON | 8,696,468,197,100,955,000 | Flag vacuum cleaner robot features that are supported. | homeassistant/components/dyson/vacuum.py | supported_features | FlorianLudwig/home-assistant | python | @property
def supported_features(self):
return SUPPORT_DYSON |
@property
def battery_icon(self):
'Return the battery icon for the vacuum cleaner.'
from libpurecoollink.const import Dyson360EyeMode
charging = (self._device.state.state in [Dyson360EyeMode.INACTIVE_CHARGING])
return icon_for_battery_level(battery_level=self.battery_level, charging=charging) | 7,973,860,692,923,932,000 | Return the battery icon for the vacuum cleaner. | homeassistant/components/dyson/vacuum.py | battery_icon | FlorianLudwig/home-assistant | python | @property
def battery_icon(self):
from libpurecoollink.const import Dyson360EyeMode
charging = (self._device.state.state in [Dyson360EyeMode.INACTIVE_CHARGING])
return icon_for_battery_level(battery_level=self.battery_level, charging=charging) |
def turn_on(self, **kwargs):
'Turn the vacuum on.'
from libpurecoollink.const import Dyson360EyeMode
_LOGGER.debug('Turn on device %s', self.name)
if (self._device.state.state in [Dyson360EyeMode.FULL_CLEAN_PAUSED]):
self._device.resume()
else:
self._device.start() | -4,007,245,549,949,464,000 | Turn the vacuum on. | homeassistant/components/dyson/vacuum.py | turn_on | FlorianLudwig/home-assistant | python | def turn_on(self, **kwargs):
from libpurecoollink.const import Dyson360EyeMode
_LOGGER.debug('Turn on device %s', self.name)
if (self._device.state.state in [Dyson360EyeMode.FULL_CLEAN_PAUSED]):
self._device.resume()
else:
self._device.start() |
def turn_off(self, **kwargs):
'Turn the vacuum off and return to home.'
_LOGGER.debug('Turn off device %s', self.name)
self._device.pause() | -9,075,945,135,207,410,000 | Turn the vacuum off and return to home. | homeassistant/components/dyson/vacuum.py | turn_off | FlorianLudwig/home-assistant | python | def turn_off(self, **kwargs):
_LOGGER.debug('Turn off device %s', self.name)
self._device.pause() |
def stop(self, **kwargs):
'Stop the vacuum cleaner.'
_LOGGER.debug('Stop device %s', self.name)
self._device.pause() | -1,359,305,905,265,330,200 | Stop the vacuum cleaner. | homeassistant/components/dyson/vacuum.py | stop | FlorianLudwig/home-assistant | python | def stop(self, **kwargs):
_LOGGER.debug('Stop device %s', self.name)
self._device.pause() |
def set_fan_speed(self, fan_speed, **kwargs):
'Set fan speed.'
from libpurecoollink.const import PowerMode
_LOGGER.debug('Set fan speed %s on device %s', fan_speed, self.name)
power_modes = {'Quiet': PowerMode.QUIET, 'Max': PowerMode.MAX}
self._device.set_power_mode(power_modes[fan_speed]) | -9,020,456,243,668,777,000 | Set fan speed. | homeassistant/components/dyson/vacuum.py | set_fan_speed | FlorianLudwig/home-assistant | python | def set_fan_speed(self, fan_speed, **kwargs):
from libpurecoollink.const import PowerMode
_LOGGER.debug('Set fan speed %s on device %s', fan_speed, self.name)
power_modes = {'Quiet': PowerMode.QUIET, 'Max': PowerMode.MAX}
self._device.set_power_mode(power_modes[fan_speed]) |
def start_pause(self, **kwargs):
'Start, pause or resume the cleaning task.'
from libpurecoollink.const import Dyson360EyeMode
if (self._device.state.state in [Dyson360EyeMode.FULL_CLEAN_PAUSED]):
_LOGGER.debug('Resume device %s', self.name)
self._device.resume()
elif (self._device.state... | -1,182,193,037,062,809,300 | Start, pause or resume the cleaning task. | homeassistant/components/dyson/vacuum.py | start_pause | FlorianLudwig/home-assistant | python | def start_pause(self, **kwargs):
from libpurecoollink.const import Dyson360EyeMode
if (self._device.state.state in [Dyson360EyeMode.FULL_CLEAN_PAUSED]):
_LOGGER.debug('Resume device %s', self.name)
self._device.resume()
elif (self._device.state.state in [Dyson360EyeMode.INACTIVE_CHARGED... |
def return_to_base(self, **kwargs):
'Set the vacuum cleaner to return to the dock.'
_LOGGER.debug('Return to base device %s', self.name)
self._device.abort() | -7,344,116,717,420,590,000 | Set the vacuum cleaner to return to the dock. | homeassistant/components/dyson/vacuum.py | return_to_base | FlorianLudwig/home-assistant | python | def return_to_base(self, **kwargs):
_LOGGER.debug('Return to base device %s', self.name)
self._device.abort() |
def _get_trigger(trigger, filename=None, lines=None, return_lines=True):
'\n Find the lines where a specific trigger appears.\n\n Args:\n trigger (str): string pattern to search for\n lines (list/None): list of lines\n filename (str/None): file to read lines from\n\n Returns:\n ... | 2,337,207,938,337,832,000 | Find the lines where a specific trigger appears.
Args:
trigger (str): string pattern to search for
lines (list/None): list of lines
filename (str/None): file to read lines from
Returns:
list: indicies of the lines where the trigger string was found and list of lines | pyiron_atomistics/vasp/outcar.py | _get_trigger | pyiron/pyiron_atomistic | python | def _get_trigger(trigger, filename=None, lines=None, return_lines=True):
'\n Find the lines where a specific trigger appears.\n\n Args:\n trigger (str): string pattern to search for\n lines (list/None): list of lines\n filename (str/None): file to read lines from\n\n Returns:\n ... |
def _get_lines_from_file(filename, lines=None):
'\n If lines is None read the lines from the file with the filename filename.\n\n Args:\n filename (str): file to read lines from\n lines (list/ None): list of lines\n\n Returns:\n list: list of lines\n '
if (lines is None):
... | 1,785,496,538,491,603,200 | If lines is None read the lines from the file with the filename filename.
Args:
filename (str): file to read lines from
lines (list/ None): list of lines
Returns:
list: list of lines | pyiron_atomistics/vasp/outcar.py | _get_lines_from_file | pyiron/pyiron_atomistic | python | def _get_lines_from_file(filename, lines=None):
'\n If lines is None read the lines from the file with the filename filename.\n\n Args:\n filename (str): file to read lines from\n lines (list/ None): list of lines\n\n Returns:\n list: list of lines\n '
if (lines is None):
... |
def from_file(self, filename='OUTCAR'):
'\n Parse and store relevant quantities from the OUTCAR file into parse_dict.\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n\n '
with open(filename, 'r') as f:
lines = f.readlines()
energies = self.get_total_... | 2,331,835,258,319,286,300 | Parse and store relevant quantities from the OUTCAR file into parse_dict.
Args:
filename (str): Filename of the OUTCAR file to parse | pyiron_atomistics/vasp/outcar.py | from_file | pyiron/pyiron_atomistic | python | def from_file(self, filename='OUTCAR'):
'\n Parse and store relevant quantities from the OUTCAR file into parse_dict.\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n\n '
with open(filename, 'r') as f:
lines = f.readlines()
energies = self.get_total_... |
def to_hdf(self, hdf, group_name='outcar'):
'\n Store output in an HDF5 file\n\n Args:\n hdf (pyiron_base.generic.hdfio.FileHDFio): HDF5 group or file\n group_name (str): Name of the HDF5 group\n '
with hdf.open(group_name) as hdf5_output:
for key in self.parse... | 2,061,548,751,776,756,500 | Store output in an HDF5 file
Args:
hdf (pyiron_base.generic.hdfio.FileHDFio): HDF5 group or file
group_name (str): Name of the HDF5 group | pyiron_atomistics/vasp/outcar.py | to_hdf | pyiron/pyiron_atomistic | python | def to_hdf(self, hdf, group_name='outcar'):
'\n Store output in an HDF5 file\n\n Args:\n hdf (pyiron_base.generic.hdfio.FileHDFio): HDF5 group or file\n group_name (str): Name of the HDF5 group\n '
with hdf.open(group_name) as hdf5_output:
for key in self.parse... |
def to_hdf_minimal(self, hdf, group_name='outcar'):
'\n Store minimal output in an HDF5 file (output unique to OUTCAR)\n\n Args:\n hdf (pyiron_base.generic.hdfio.FileHDFio): HDF5 group or file\n group_name (str): Name of the HDF5 group\n '
unique_quantities = ['kin_ene... | -1,055,857,124,896,554,000 | Store minimal output in an HDF5 file (output unique to OUTCAR)
Args:
hdf (pyiron_base.generic.hdfio.FileHDFio): HDF5 group or file
group_name (str): Name of the HDF5 group | pyiron_atomistics/vasp/outcar.py | to_hdf_minimal | pyiron/pyiron_atomistic | python | def to_hdf_minimal(self, hdf, group_name='outcar'):
'\n Store minimal output in an HDF5 file (output unique to OUTCAR)\n\n Args:\n hdf (pyiron_base.generic.hdfio.FileHDFio): HDF5 group or file\n group_name (str): Name of the HDF5 group\n '
unique_quantities = ['kin_ene... |
def from_hdf(self, hdf, group_name='outcar'):
'\n Load output from an HDF5 file\n\n Args:\n hdf (pyiron_base.generic.hdfio.FileHDFio): HDF5 group or file\n group_name (str): Name of the HDF5 group\n '
with hdf.open(group_name) as hdf5_output:
for key in hdf5_ou... | 1,578,328,730,927,588,600 | Load output from an HDF5 file
Args:
hdf (pyiron_base.generic.hdfio.FileHDFio): HDF5 group or file
group_name (str): Name of the HDF5 group | pyiron_atomistics/vasp/outcar.py | from_hdf | pyiron/pyiron_atomistic | python | def from_hdf(self, hdf, group_name='outcar'):
'\n Load output from an HDF5 file\n\n Args:\n hdf (pyiron_base.generic.hdfio.FileHDFio): HDF5 group or file\n group_name (str): Name of the HDF5 group\n '
with hdf.open(group_name) as hdf5_output:
for key in hdf5_ou... |
def get_positions_and_forces(self, filename='OUTCAR', lines=None, n_atoms=None):
'\n Gets the forces and positions for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n ... | -3,221,029,323,817,749,000 | Gets the forces and positions for every ionic step from the OUTCAR file
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
n_atoms (int/None): number of ions in OUTCAR
Returns:
[positions, forces] (sequence)
numpy.ndarray: A Nx3xM array of positi... | pyiron_atomistics/vasp/outcar.py | get_positions_and_forces | pyiron/pyiron_atomistic | python | def get_positions_and_forces(self, filename='OUTCAR', lines=None, n_atoms=None):
'\n Gets the forces and positions for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n ... |
def get_positions(self, filename='OUTCAR', lines=None, n_atoms=None):
'\n Gets the positions for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n n_atoms (int/None): n... | 4,963,498,154,091,084,000 | Gets the positions for every ionic step from the OUTCAR file
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
n_atoms (int/None): number of ions in OUTCAR
Returns:
numpy.ndarray: A Nx3xM array of positions in $\AA$
where N is the number of ato... | pyiron_atomistics/vasp/outcar.py | get_positions | pyiron/pyiron_atomistic | python | def get_positions(self, filename='OUTCAR', lines=None, n_atoms=None):
'\n Gets the positions for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n n_atoms (int/None): n... |
def get_forces(self, filename='OUTCAR', lines=None, n_atoms=None):
'\n Gets the forces for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n n_atoms (int/None): number ... | -8,477,871,776,164,714,000 | Gets the forces for every ionic step from the OUTCAR file
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
n_atoms (int/None): number of ions in OUTCAR
Returns:
numpy.ndarray: A Nx3xM array of forces in $eV / \AA$
where N is the number of ato... | pyiron_atomistics/vasp/outcar.py | get_forces | pyiron/pyiron_atomistic | python | def get_forces(self, filename='OUTCAR', lines=None, n_atoms=None):
'\n Gets the forces for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n n_atoms (int/None): number ... |
def get_cells(self, filename='OUTCAR', lines=None):
'\n Gets the cell size and shape for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n numpy.nda... | 9,096,097,438,204,182,000 | Gets the cell size and shape for every ionic step from the OUTCAR file
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
numpy.ndarray: A 3x3xM array of the cell shape in $\AA$
where M is the number of time steps | pyiron_atomistics/vasp/outcar.py | get_cells | pyiron/pyiron_atomistic | python | def get_cells(self, filename='OUTCAR', lines=None):
'\n Gets the cell size and shape for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n numpy.nda... |
@staticmethod
def get_stresses(filename='OUTCAR', lines=None, si_unit=True):
'\n\n Args:\n filename (str): Input filename\n lines (list/None): lines read from the file\n si_unit (bool): True SI units are used\n\n Returns:\n numpy.ndarray: An array of stress ... | 3,243,403,515,257,189,000 | Args:
filename (str): Input filename
lines (list/None): lines read from the file
si_unit (bool): True SI units are used
Returns:
numpy.ndarray: An array of stress values | pyiron_atomistics/vasp/outcar.py | get_stresses | pyiron/pyiron_atomistic | python | @staticmethod
def get_stresses(filename='OUTCAR', lines=None, si_unit=True):
'\n\n Args:\n filename (str): Input filename\n lines (list/None): lines read from the file\n si_unit (bool): True SI units are used\n\n Returns:\n numpy.ndarray: An array of stress ... |
@staticmethod
def get_irreducible_kpoints(filename='OUTCAR', reciprocal=True, weight=True, planewaves=True, lines=None):
'\n Function to extract the irreducible kpoints from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n reciprocal (bool): Get ... | 8,054,148,439,433,988,000 | Function to extract the irreducible kpoints from the OUTCAR file
Args:
filename (str): Filename of the OUTCAR file to parse
reciprocal (bool): Get either the reciprocal or the cartesian coordinates
weight (bool): Get the weight assigned to the irreducible kpoints
planewaves (bool): Get the planewaves a... | pyiron_atomistics/vasp/outcar.py | get_irreducible_kpoints | pyiron/pyiron_atomistic | python | @staticmethod
def get_irreducible_kpoints(filename='OUTCAR', reciprocal=True, weight=True, planewaves=True, lines=None):
'\n Function to extract the irreducible kpoints from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n reciprocal (bool): Get ... |
@staticmethod
def get_total_energies(filename='OUTCAR', lines=None):
'\n Gets the total energy for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n ... | -2,156,645,816,712,065,000 | Gets the total energy for every ionic step from the OUTCAR file
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
numpy.ndarray: A 1xM array of the total energies in $eV$
where M is the number of time steps | pyiron_atomistics/vasp/outcar.py | get_total_energies | pyiron/pyiron_atomistic | python | @staticmethod
def get_total_energies(filename='OUTCAR', lines=None):
'\n Gets the total energy for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n ... |
@staticmethod
def get_energy_without_entropy(filename='OUTCAR', lines=None):
'\n Gets the total energy for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n ... | 6,844,802,103,660,939,000 | Gets the total energy for every ionic step from the OUTCAR file
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
numpy.ndarray: A 1xM array of the total energies in $eV$
where M is the number of time steps | pyiron_atomistics/vasp/outcar.py | get_energy_without_entropy | pyiron/pyiron_atomistic | python | @staticmethod
def get_energy_without_entropy(filename='OUTCAR', lines=None):
'\n Gets the total energy for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n ... |
@staticmethod
def get_energy_sigma_0(filename='OUTCAR', lines=None):
'\n Gets the total energy for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n ... | 7,513,835,992,246,647,000 | Gets the total energy for every ionic step from the OUTCAR file
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
numpy.ndarray: A 1xM array of the total energies in $eV$
where M is the number of time steps | pyiron_atomistics/vasp/outcar.py | get_energy_sigma_0 | pyiron/pyiron_atomistic | python | @staticmethod
def get_energy_sigma_0(filename='OUTCAR', lines=None):
'\n Gets the total energy for every ionic step from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n ... |
@staticmethod
def get_all_total_energies(filename='OUTCAR', lines=None):
'\n Gets the energy at every electronic step\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n list: A list of en... | 938,323,484,795,355,100 | Gets the energy at every electronic step
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
list: A list of energie for every electronic step at every ionic step | pyiron_atomistics/vasp/outcar.py | get_all_total_energies | pyiron/pyiron_atomistic | python | @staticmethod
def get_all_total_energies(filename='OUTCAR', lines=None):
'\n Gets the energy at every electronic step\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n list: A list of en... |
@staticmethod
def get_magnetization(filename='OUTCAR', lines=None):
'\n Gets the magnetization\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n list: A list with the mgnetization values... | 2,437,539,680,318,981,000 | Gets the magnetization
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
list: A list with the mgnetization values | pyiron_atomistics/vasp/outcar.py | get_magnetization | pyiron/pyiron_atomistic | python | @staticmethod
def get_magnetization(filename='OUTCAR', lines=None):
'\n Gets the magnetization\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n list: A list with the mgnetization values... |
@staticmethod
def get_broyden_mixing_mesh(filename='OUTCAR', lines=None):
'\n Gets the Broyden mixing mesh size\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n int: Mesh size\n ... | -5,583,057,983,312,634,000 | Gets the Broyden mixing mesh size
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
int: Mesh size | pyiron_atomistics/vasp/outcar.py | get_broyden_mixing_mesh | pyiron/pyiron_atomistic | python | @staticmethod
def get_broyden_mixing_mesh(filename='OUTCAR', lines=None):
'\n Gets the Broyden mixing mesh size\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n int: Mesh size\n ... |
@staticmethod
def get_temperatures(filename='OUTCAR', lines=None):
'\n Gets the temperature at each ionic step (applicable for MD)\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n numpy... | 7,192,756,473,802,071,000 | Gets the temperature at each ionic step (applicable for MD)
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
numpy.ndarray: An array of temperatures in Kelvin | pyiron_atomistics/vasp/outcar.py | get_temperatures | pyiron/pyiron_atomistic | python | @staticmethod
def get_temperatures(filename='OUTCAR', lines=None):
'\n Gets the temperature at each ionic step (applicable for MD)\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n numpy... |
@staticmethod
def get_steps(filename='OUTCAR', lines=None):
'\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n numpy.ndarray: Steps during the simulation\n '
nblock_trigger = 'NBLOC... | 5,047,558,663,425,873,000 | Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
numpy.ndarray: Steps during the simulation | pyiron_atomistics/vasp/outcar.py | get_steps | pyiron/pyiron_atomistic | python | @staticmethod
def get_steps(filename='OUTCAR', lines=None):
'\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n numpy.ndarray: Steps during the simulation\n '
nblock_trigger = 'NBLOC... |
def get_time(self, filename='OUTCAR', lines=None):
'\n Time after each simulation step (for MD)\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n numpy.ndarray: An array of time values i... | 7,670,659,648,015,844,000 | Time after each simulation step (for MD)
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
numpy.ndarray: An array of time values in fs | pyiron_atomistics/vasp/outcar.py | get_time | pyiron/pyiron_atomistic | python | def get_time(self, filename='OUTCAR', lines=None):
'\n Time after each simulation step (for MD)\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n numpy.ndarray: An array of time values i... |
@staticmethod
def get_kinetic_energy_error(filename='OUTCAR', lines=None):
'\n Get the kinetic energy error\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n float: The kinetic energy er... | 8,818,304,231,474,694,000 | Get the kinetic energy error
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
float: The kinetic energy error in eV | pyiron_atomistics/vasp/outcar.py | get_kinetic_energy_error | pyiron/pyiron_atomistic | python | @staticmethod
def get_kinetic_energy_error(filename='OUTCAR', lines=None):
'\n Get the kinetic energy error\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n float: The kinetic energy er... |
@staticmethod
def get_fermi_level(filename='OUTCAR', lines=None):
'\n Getting the Fermi-level (Kohn_Sham) from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n float: Th... | -2,384,256,268,820,492,000 | Getting the Fermi-level (Kohn_Sham) from the OUTCAR file
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
float: The Kohn-Sham Fermi level in eV | pyiron_atomistics/vasp/outcar.py | get_fermi_level | pyiron/pyiron_atomistic | python | @staticmethod
def get_fermi_level(filename='OUTCAR', lines=None):
'\n Getting the Fermi-level (Kohn_Sham) from the OUTCAR file\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n float: Th... |
@staticmethod
def get_dipole_moments(filename='OUTCAR', lines=None):
'\n Get the electric dipole moment at every electronic step\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n list: A... | 4,424,285,629,045,084,700 | Get the electric dipole moment at every electronic step
Args:
filename (str): Filename of the OUTCAR file to parse
lines (list/None): lines read from the file
Returns:
list: A list of dipole moments in (eA) for each electronic step | pyiron_atomistics/vasp/outcar.py | get_dipole_moments | pyiron/pyiron_atomistic | python | @staticmethod
def get_dipole_moments(filename='OUTCAR', lines=None):
'\n Get the electric dipole moment at every electronic step\n\n Args:\n filename (str): Filename of the OUTCAR file to parse\n lines (list/None): lines read from the file\n\n Returns:\n list: A... |
@staticmethod
def get_nelect(filename='OUTCAR', lines=None):
'\n Returns the number of electrons in the simulation\n\n Args:\n filename (str): OUTCAR filename\n lines (list/None): lines read from the file\n\n Returns:\n float: The number of electrons in the simu... | -6,875,787,904,357,671,000 | Returns the number of electrons in the simulation
Args:
filename (str): OUTCAR filename
lines (list/None): lines read from the file
Returns:
float: The number of electrons in the simulation | pyiron_atomistics/vasp/outcar.py | get_nelect | pyiron/pyiron_atomistic | python | @staticmethod
def get_nelect(filename='OUTCAR', lines=None):
'\n Returns the number of electrons in the simulation\n\n Args:\n filename (str): OUTCAR filename\n lines (list/None): lines read from the file\n\n Returns:\n float: The number of electrons in the simu... |
@staticmethod
def get_number_of_atoms(filename='OUTCAR', lines=None):
'\n Returns the number of ions in the simulation\n\n Args:\n filename (str): OUTCAR filename\n lines (list/None): lines read from the file\n\n Returns:\n int: The number of ions in the simulat... | 922,051,548,595,736,700 | Returns the number of ions in the simulation
Args:
filename (str): OUTCAR filename
lines (list/None): lines read from the file
Returns:
int: The number of ions in the simulation | pyiron_atomistics/vasp/outcar.py | get_number_of_atoms | pyiron/pyiron_atomistic | python | @staticmethod
def get_number_of_atoms(filename='OUTCAR', lines=None):
'\n Returns the number of ions in the simulation\n\n Args:\n filename (str): OUTCAR filename\n lines (list/None): lines read from the file\n\n Returns:\n int: The number of ions in the simulat... |
@staticmethod
def _get_positions_and_forces_parser(lines, trigger_indices, n_atoms, pos_flag=True, force_flag=True):
'\n Parser to get the forces and or positions for every ionic step from the OUTCAR file\n\n Args:\n lines (list): lines read from the file\n trigger_indices (list)... | -2,625,770,188,972,833,300 | Parser to get the forces and or positions for every ionic step from the OUTCAR file
Args:
lines (list): lines read from the file
trigger_indices (list): list of line indices where the trigger was found.
n_atoms (int): number of atoms
pos_flag (bool): parse position
force_flag (bool): parse forces
... | pyiron_atomistics/vasp/outcar.py | _get_positions_and_forces_parser | pyiron/pyiron_atomistic | python | @staticmethod
def _get_positions_and_forces_parser(lines, trigger_indices, n_atoms, pos_flag=True, force_flag=True):
'\n Parser to get the forces and or positions for every ionic step from the OUTCAR file\n\n Args:\n lines (list): lines read from the file\n trigger_indices (list)... |
@staticmethod
def _get_cells_praser(lines, trigger_indices):
'\n Parser to get the cell size and shape for every ionic step from the OUTCAR file\n\n Args:\n lines (list): lines read from the file\n trigger_indices (list): list of line indices where the trigger was found.\n ... | -4,564,041,709,904,208,000 | Parser to get the cell size and shape for every ionic step from the OUTCAR file
Args:
lines (list): lines read from the file
trigger_indices (list): list of line indices where the trigger was found.
n_atoms (int): number of atoms
Returns:
numpy.ndarray: A 3x3xM array of the cell shape in $\AA$
wh... | pyiron_atomistics/vasp/outcar.py | _get_cells_praser | pyiron/pyiron_atomistic | python | @staticmethod
def _get_cells_praser(lines, trigger_indices):
'\n Parser to get the cell size and shape for every ionic step from the OUTCAR file\n\n Args:\n lines (list): lines read from the file\n trigger_indices (list): list of line indices where the trigger was found.\n ... |
@property
def content(self):
'Return a string or a Troposphere CFN Function object'
if self.content_file:
return self.content_file
elif self.content_cfn_file:
return self.content_cfn_file
return self._content | -5,168,335,891,709,782,000 | Return a string or a Troposphere CFN Function object | src/paco/models/cfn_init.py | content | waterbear-cloud/aim.models | python | @property
def content(self):
if self.content_file:
return self.content_file
elif self.content_cfn_file:
return self.content_cfn_file
return self._content |
def data_collector(item_list=None, data_processing_chain=None, meta_processing_chain=None, target_format='single_target_per_sequence', channel_dimension='channels_last', verbose=True, print_indent=2):
"Data collector\n\n Collects data and meta into matrices while processing them through processing chains.\n\n ... | 8,201,264,136,872,432,000 | Data collector
Collects data and meta into matrices while processing them through processing chains.
Parameters
----------
item_list : list or dict
Items in the data sequence. List containing multi-level dictionary with first level key
'data' and 'meta'. Second level should contain parameters for process meth... | venv/Lib/site-packages/dcase_util/keras/data.py | data_collector | AlexBruBuxo/TFG--ASC-Deep-Learning | python | def data_collector(item_list=None, data_processing_chain=None, meta_processing_chain=None, target_format='single_target_per_sequence', channel_dimension='channels_last', verbose=True, print_indent=2):
"Data collector\n\n Collects data and meta into matrices while processing them through processing chains.\n\n ... |
def __init__(self, item_list=None, batch_size=64, buffer_size=None, data_processing_chain=None, meta_processing_chain=None, data_processing_chain_callback_on_epoch_end=None, meta_processing_chain_callback_on_epoch_end=None, transformer_callbacks=None, refresh_buffer_on_epoch=False, data_format='channels_last', target_f... | -436,798,435,833,156,350 | Constructor
Parameters
----------
item_list : list or dict
Items in the data sequence. List containing multi-level dictionary with first level key
'data' and 'meta'. Second level should contain parameters for process method in the processing chain.
Default value None
batch_size : int
Batch size (item ... | venv/Lib/site-packages/dcase_util/keras/data.py | __init__ | AlexBruBuxo/TFG--ASC-Deep-Learning | python | def __init__(self, item_list=None, batch_size=64, buffer_size=None, data_processing_chain=None, meta_processing_chain=None, data_processing_chain_callback_on_epoch_end=None, meta_processing_chain_callback_on_epoch_end=None, transformer_callbacks=None, refresh_buffer_on_epoch=False, data_format='channels_last', target_f... |
def main(json_dir, out_dir):
' Script to convert all .json files in json_dir into corresponding .mat\n files in out_dir\n\n .mat files have the same basename as the .json files\n\n This script is meant for data files that contain data from\n OpenSauce / VoiceSauce variables.\n '
json_files = ... | 6,966,082,690,874,818,000 | Script to convert all .json files in json_dir into corresponding .mat
files in out_dir
.mat files have the same basename as the .json files
This script is meant for data files that contain data from
OpenSauce / VoiceSauce variables. | tools/convert_json_to_mat.py | main | CobiELF/opensauce-python | python | def main(json_dir, out_dir):
' Script to convert all .json files in json_dir into corresponding .mat\n files in out_dir\n\n .mat files have the same basename as the .json files\n\n This script is meant for data files that contain data from\n OpenSauce / VoiceSauce variables.\n '
json_files = ... |
def __str__(self):
'Print function displays username.'
return self.title | -8,196,650,801,646,137,000 | Print function displays username. | imagersite/imager_images/models.py | __str__ | Loaye/django-imager-group | python | def __str__(self):
return self.title |
def __str__(self):
'Print function displays username.'
return self.title | -8,196,650,801,646,137,000 | Print function displays username. | imagersite/imager_images/models.py | __str__ | Loaye/django-imager-group | python | def __str__(self):
return self.title |
async def fetch_time(self, params={}):
'\n fetches the current integer timestamp in milliseconds from the exchange server\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns int: the current integer timestamp in milliseconds from the exchange server\n '... | 4,727,720,431,297,713,000 | fetches the current integer timestamp in milliseconds from the exchange server
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns int: the current integer timestamp in milliseconds from the exchange server | python/ccxt/async_support/bitvavo.py | fetch_time | DoctorSlimm/ccxt | python | async def fetch_time(self, params={}):
'\n fetches the current integer timestamp in milliseconds from the exchange server\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns int: the current integer timestamp in milliseconds from the exchange server\n '... |
async def fetch_markets(self, params={}):
'\n retrieves data on all markets for bitvavo\n :param dict params: extra parameters specific to the exchange api endpoint\n :returns [dict]: an array of objects representing market data\n '
response = (await self.publicGetMarkets(params))
... | -8,583,666,571,276,738,000 | retrieves data on all markets for bitvavo
:param dict params: extra parameters specific to the exchange api endpoint
:returns [dict]: an array of objects representing market data | python/ccxt/async_support/bitvavo.py | fetch_markets | DoctorSlimm/ccxt | python | async def fetch_markets(self, params={}):
'\n retrieves data on all markets for bitvavo\n :param dict params: extra parameters specific to the exchange api endpoint\n :returns [dict]: an array of objects representing market data\n '
response = (await self.publicGetMarkets(params))
... |
async def fetch_currencies(self, params={}):
'\n fetches all available currencies on an exchange\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: an associative dictionary of currencies\n '
response = (await self.fetch_currencies_from_cache... | 3,034,382,448,980,844,000 | fetches all available currencies on an exchange
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns dict: an associative dictionary of currencies | python/ccxt/async_support/bitvavo.py | fetch_currencies | DoctorSlimm/ccxt | python | async def fetch_currencies(self, params={}):
'\n fetches all available currencies on an exchange\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: an associative dictionary of currencies\n '
response = (await self.fetch_currencies_from_cache... |
async def fetch_ticker(self, symbol, params={}):
'\n fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market\n :param str symbol: unified symbol of the market to fetch the ticker for\n :param dict params: extra parameters sp... | -6,137,170,768,951,819,000 | fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
:param str symbol: unified symbol of the market to fetch the ticker for
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns dict: a `ticker structure <https://doc... | python/ccxt/async_support/bitvavo.py | fetch_ticker | DoctorSlimm/ccxt | python | async def fetch_ticker(self, symbol, params={}):
'\n fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market\n :param str symbol: unified symbol of the market to fetch the ticker for\n :param dict params: extra parameters sp... |
async def fetch_tickers(self, symbols=None, params={}):
'\n fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market\n :param [str]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers ar... | -7,503,686,667,502,880,000 | fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
:param [str]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
:param dict params: extra parameters specific to the ... | python/ccxt/async_support/bitvavo.py | fetch_tickers | DoctorSlimm/ccxt | python | async def fetch_tickers(self, symbols=None, params={}):
'\n fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market\n :param [str]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers ar... |
async def fetch_trades(self, symbol, since=None, limit=None, params={}):
'\n get the list of most recent trades for a particular symbol\n :param str symbol: unified symbol of the market to fetch trades for\n :param int|None since: timestamp in ms of the earliest trade to fetch\n :param i... | -6,750,279,957,478,437,000 | get the list of most recent trades for a particular symbol
:param str symbol: unified symbol of the market to fetch trades for
:param int|None since: timestamp in ms of the earliest trade to fetch
:param int|None limit: the maximum amount of trades to fetch
:param dict params: extra parameters specific to the bitvavo a... | python/ccxt/async_support/bitvavo.py | fetch_trades | DoctorSlimm/ccxt | python | async def fetch_trades(self, symbol, since=None, limit=None, params={}):
'\n get the list of most recent trades for a particular symbol\n :param str symbol: unified symbol of the market to fetch trades for\n :param int|None since: timestamp in ms of the earliest trade to fetch\n :param i... |
async def fetch_trading_fees(self, params={}):
'\n fetch the trading fees for multiple markets\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/en/latest/manual.html#fee-structure>` indexed by mar... | -2,611,278,846,379,126,000 | fetch the trading fees for multiple markets
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/en/latest/manual.html#fee-structure>` indexed by market symbols | python/ccxt/async_support/bitvavo.py | fetch_trading_fees | DoctorSlimm/ccxt | python | async def fetch_trading_fees(self, params={}):
'\n fetch the trading fees for multiple markets\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/en/latest/manual.html#fee-structure>` indexed by mar... |
async def fetch_order_book(self, symbol, limit=None, params={}):
'\n fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data\n :param str symbol: unified symbol of the market to fetch the order book for\n :param int|None limit: the maximum amount of order b... | -6,137,599,076,384,609,000 | fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
:param str symbol: unified symbol of the market to fetch the order book for
:param int|None limit: the maximum amount of order book entries to return
:param dict params: extra parameters specific to the bitvavo api endpoint
:r... | python/ccxt/async_support/bitvavo.py | fetch_order_book | DoctorSlimm/ccxt | python | async def fetch_order_book(self, symbol, limit=None, params={}):
'\n fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data\n :param str symbol: unified symbol of the market to fetch the order book for\n :param int|None limit: the maximum amount of order b... |
async def fetch_ohlcv(self, symbol, timeframe='1m', since=None, limit=None, params={}):
'\n fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market\n :param str symbol: unified symbol of the market to fetch OHLCV data for\n :param str time... | -4,359,227,001,451,613,700 | fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
:param str symbol: unified symbol of the market to fetch OHLCV data for
:param str timeframe: the length of time each candle represents
:param int|None since: timestamp in ms of the earliest candle to fetch
:... | python/ccxt/async_support/bitvavo.py | fetch_ohlcv | DoctorSlimm/ccxt | python | async def fetch_ohlcv(self, symbol, timeframe='1m', since=None, limit=None, params={}):
'\n fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market\n :param str symbol: unified symbol of the market to fetch OHLCV data for\n :param str time... |
async def fetch_balance(self, params={}):
'\n query for balance and get the amount of funds available for trading or funds locked in orders\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: a `balance structure <https://docs.ccxt.com/en/latest/manual.h... | -4,888,217,278,312,201,000 | query for balance and get the amount of funds available for trading or funds locked in orders
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns dict: a `balance structure <https://docs.ccxt.com/en/latest/manual.html?#balance-structure>` | python/ccxt/async_support/bitvavo.py | fetch_balance | DoctorSlimm/ccxt | python | async def fetch_balance(self, params={}):
'\n query for balance and get the amount of funds available for trading or funds locked in orders\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: a `balance structure <https://docs.ccxt.com/en/latest/manual.h... |
async def fetch_deposit_address(self, code, params={}):
'\n fetch the deposit address for a currency associated with self account\n :param str code: unified currency code\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: an `address structure <h... | -7,805,161,392,912,422,000 | fetch the deposit address for a currency associated with self account
:param str code: unified currency code
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns dict: an `address structure <https://docs.ccxt.com/en/latest/manual.html#address-structure>` | python/ccxt/async_support/bitvavo.py | fetch_deposit_address | DoctorSlimm/ccxt | python | async def fetch_deposit_address(self, code, params={}):
'\n fetch the deposit address for a currency associated with self account\n :param str code: unified currency code\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: an `address structure <h... |
async def create_order(self, symbol, type, side, amount, price=None, params={}):
"\n create a trade order\n :param str symbol: unified symbol of the market to create an order in\n :param str type: 'market' or 'limit'\n :param str side: 'buy' or 'sell'\n :param float amount: how mu... | -3,071,188,071,810,781,700 | create a trade order
:param str symbol: unified symbol of the market to create an order in
:param str type: 'market' or 'limit'
:param str side: 'buy' or 'sell'
:param float amount: how much of currency you want to trade in units of base currency
:param float price: the price at which the order is to be fullfilled, in ... | python/ccxt/async_support/bitvavo.py | create_order | DoctorSlimm/ccxt | python | async def create_order(self, symbol, type, side, amount, price=None, params={}):
"\n create a trade order\n :param str symbol: unified symbol of the market to create an order in\n :param str type: 'market' or 'limit'\n :param str side: 'buy' or 'sell'\n :param float amount: how mu... |
async def cancel_order(self, id, symbol=None, params={}):
'\n cancels an open order\n :param str id: order id\n :param str symbol: unified symbol of the market the order was made in\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: An `or... | -4,035,625,816,908,149,000 | cancels an open order
:param str id: order id
:param str symbol: unified symbol of the market the order was made in
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns dict: An `order structure <https://docs.ccxt.com/en/latest/manual.html#order-structure>` | python/ccxt/async_support/bitvavo.py | cancel_order | DoctorSlimm/ccxt | python | async def cancel_order(self, id, symbol=None, params={}):
'\n cancels an open order\n :param str id: order id\n :param str symbol: unified symbol of the market the order was made in\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: An `or... |
async def cancel_all_orders(self, symbol=None, params={}):
'\n cancel all open orders\n :param str|None symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None\n :param dict params: extra parameters specific to the bitvavo api endpoint\n ... | -1,090,313,933,898,150,700 | cancel all open orders
:param str|None symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns [dict]: a list of `order structures <https://docs.ccxt.com/en/latest/manual.html#order-s... | python/ccxt/async_support/bitvavo.py | cancel_all_orders | DoctorSlimm/ccxt | python | async def cancel_all_orders(self, symbol=None, params={}):
'\n cancel all open orders\n :param str|None symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None\n :param dict params: extra parameters specific to the bitvavo api endpoint\n ... |
async def fetch_order(self, id, symbol=None, params={}):
'\n fetches information on an order made by the user\n :param str symbol: unified symbol of the market the order was made in\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: An `order str... | 6,079,850,510,680,083,000 | fetches information on an order made by the user
:param str symbol: unified symbol of the market the order was made in
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns dict: An `order structure <https://docs.ccxt.com/en/latest/manual.html#order-structure>` | python/ccxt/async_support/bitvavo.py | fetch_order | DoctorSlimm/ccxt | python | async def fetch_order(self, id, symbol=None, params={}):
'\n fetches information on an order made by the user\n :param str symbol: unified symbol of the market the order was made in\n :param dict params: extra parameters specific to the bitvavo api endpoint\n :returns dict: An `order str... |
async def fetch_open_orders(self, symbol=None, since=None, limit=None, params={}):
'\n fetch all unfilled currently open orders\n :param str|None symbol: unified market symbol\n :param int|None since: the earliest time in ms to fetch open orders for\n :param int|None limit: the maximum n... | -8,882,759,450,574,307,000 | fetch all unfilled currently open orders
:param str|None symbol: unified market symbol
:param int|None since: the earliest time in ms to fetch open orders for
:param int|None limit: the maximum number of open orders structures to retrieve
:param dict params: extra parameters specific to the bitvavo api endpoint
:retur... | python/ccxt/async_support/bitvavo.py | fetch_open_orders | DoctorSlimm/ccxt | python | async def fetch_open_orders(self, symbol=None, since=None, limit=None, params={}):
'\n fetch all unfilled currently open orders\n :param str|None symbol: unified market symbol\n :param int|None since: the earliest time in ms to fetch open orders for\n :param int|None limit: the maximum n... |
async def fetch_my_trades(self, symbol=None, since=None, limit=None, params={}):
'\n fetch all trades made by the user\n :param str|None symbol: unified market symbol\n :param int|None since: the earliest time in ms to fetch trades for\n :param int|None limit: the maximum number of trade... | 5,100,821,919,391,181,000 | fetch all trades made by the user
:param str|None symbol: unified market symbol
:param int|None since: the earliest time in ms to fetch trades for
:param int|None limit: the maximum number of trades structures to retrieve
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns [dict]: a list ... | python/ccxt/async_support/bitvavo.py | fetch_my_trades | DoctorSlimm/ccxt | python | async def fetch_my_trades(self, symbol=None, since=None, limit=None, params={}):
'\n fetch all trades made by the user\n :param str|None symbol: unified market symbol\n :param int|None since: the earliest time in ms to fetch trades for\n :param int|None limit: the maximum number of trade... |
async def withdraw(self, code, amount, address, tag=None, params={}):
'\n make a withdrawal\n :param str code: unified currency code\n :param float amount: the amount to withdraw\n :param str address: the address to withdraw to\n :param str|None tag:\n :param dict params: e... | 4,381,774,155,091,937,300 | make a withdrawal
:param str code: unified currency code
:param float amount: the amount to withdraw
:param str address: the address to withdraw to
:param str|None tag:
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns dict: a `transaction structure <https://docs.ccxt.com/en/latest/manu... | python/ccxt/async_support/bitvavo.py | withdraw | DoctorSlimm/ccxt | python | async def withdraw(self, code, amount, address, tag=None, params={}):
'\n make a withdrawal\n :param str code: unified currency code\n :param float amount: the amount to withdraw\n :param str address: the address to withdraw to\n :param str|None tag:\n :param dict params: e... |
async def fetch_withdrawals(self, code=None, since=None, limit=None, params={}):
'\n fetch all withdrawals made from an account\n :param str|None code: unified currency code\n :param int|None since: the earliest time in ms to fetch withdrawals for\n :param int|None limit: the maximum num... | 2,784,951,726,627,947,500 | fetch all withdrawals made from an account
:param str|None code: unified currency code
:param int|None since: the earliest time in ms to fetch withdrawals for
:param int|None limit: the maximum number of withdrawals structures to retrieve
:param dict params: extra parameters specific to the bitvavo api endpoint
:return... | python/ccxt/async_support/bitvavo.py | fetch_withdrawals | DoctorSlimm/ccxt | python | async def fetch_withdrawals(self, code=None, since=None, limit=None, params={}):
'\n fetch all withdrawals made from an account\n :param str|None code: unified currency code\n :param int|None since: the earliest time in ms to fetch withdrawals for\n :param int|None limit: the maximum num... |
async def fetch_deposits(self, code=None, since=None, limit=None, params={}):
'\n fetch all deposits made to an account\n :param str|None code: unified currency code\n :param int|None since: the earliest time in ms to fetch deposits for\n :param int|None limit: the maximum number of depo... | 6,673,181,452,946,335,000 | fetch all deposits made to an account
:param str|None code: unified currency code
:param int|None since: the earliest time in ms to fetch deposits for
:param int|None limit: the maximum number of deposits structures to retrieve
:param dict params: extra parameters specific to the bitvavo api endpoint
:returns [dict]: a... | python/ccxt/async_support/bitvavo.py | fetch_deposits | DoctorSlimm/ccxt | python | async def fetch_deposits(self, code=None, since=None, limit=None, params={}):
'\n fetch all deposits made to an account\n :param str|None code: unified currency code\n :param int|None since: the earliest time in ms to fetch deposits for\n :param int|None limit: the maximum number of depo... |
def _IsInstallationCorruption(err):
'Determines if the error may be from installation corruption.\n\n Args:\n err: Exception err.\n\n Returns:\n bool, True if installation error, False otherwise\n '
return (isinstance(err, backend.CommandLoadFailure) and isinstance(err.root_exception, ImportError)) | 3,970,820,307,311,172,000 | Determines if the error may be from installation corruption.
Args:
err: Exception err.
Returns:
bool, True if installation error, False otherwise | google-cloud-sdk/lib/googlecloudsdk/command_lib/crash_handling.py | _IsInstallationCorruption | bopopescu/searchparty | python | def _IsInstallationCorruption(err):
'Determines if the error may be from installation corruption.\n\n Args:\n err: Exception err.\n\n Returns:\n bool, True if installation error, False otherwise\n '
return (isinstance(err, backend.CommandLoadFailure) and isinstance(err.root_exception, ImportError)) |
def _PrintInstallationAction(err, err_string):
'Prompts installation error action.\n\n Args:\n err: Exception err.\n err_string: Exception err string.\n '
log.error('gcloud failed to load ({0}): {1}\n\nThis usually indicates corruption in your gcloud installation or problems with your Python interpreter... | 8,228,267,783,591,513,000 | Prompts installation error action.
Args:
err: Exception err.
err_string: Exception err string. | google-cloud-sdk/lib/googlecloudsdk/command_lib/crash_handling.py | _PrintInstallationAction | bopopescu/searchparty | python | def _PrintInstallationAction(err, err_string):
'Prompts installation error action.\n\n Args:\n err: Exception err.\n err_string: Exception err string.\n '
log.error('gcloud failed to load ({0}): {1}\n\nThis usually indicates corruption in your gcloud installation or problems with your Python interpreter... |
def _GetReportingClient():
'Returns a client that uses an API key for Cloud SDK crash reports.\n\n Returns:\n An error reporting client that uses an API key for Cloud SDK crash reports.\n '
client_class = core_apis.GetClientClass(util.API_NAME, util.API_VERSION)
client_instance = client_class(get_crede... | -8,993,715,344,848,936,000 | Returns a client that uses an API key for Cloud SDK crash reports.
Returns:
An error reporting client that uses an API key for Cloud SDK crash reports. | google-cloud-sdk/lib/googlecloudsdk/command_lib/crash_handling.py | _GetReportingClient | bopopescu/searchparty | python | def _GetReportingClient():
'Returns a client that uses an API key for Cloud SDK crash reports.\n\n Returns:\n An error reporting client that uses an API key for Cloud SDK crash reports.\n '
client_class = core_apis.GetClientClass(util.API_NAME, util.API_VERSION)
client_instance = client_class(get_crede... |
def ReportError(err, is_crash):
'Report the anonymous crash information to the Error Reporting service.\n\n Args:\n err: Exception, the error that caused the crash.\n is_crash: bool, True if this is a crash, False if it is a user error.\n '
if properties.VALUES.core.disable_usage_reporting.GetBool():
... | 2,386,250,183,612,762,000 | Report the anonymous crash information to the Error Reporting service.
Args:
err: Exception, the error that caused the crash.
is_crash: bool, True if this is a crash, False if it is a user error. | google-cloud-sdk/lib/googlecloudsdk/command_lib/crash_handling.py | ReportError | bopopescu/searchparty | python | def ReportError(err, is_crash):
'Report the anonymous crash information to the Error Reporting service.\n\n Args:\n err: Exception, the error that caused the crash.\n is_crash: bool, True if this is a crash, False if it is a user error.\n '
if properties.VALUES.core.disable_usage_reporting.GetBool():
... |
def HandleGcloudCrash(err):
'Checks if installation error occurred, then proceeds with Error Reporting.\n\n Args:\n err: Exception err.\n '
err_string = console_attr.EncodeForConsole(err)
log.file_only_logger.exception('BEGIN CRASH STACKTRACE')
if _IsInstallationCorruption(err):
_PrintInsta... | -6,910,200,027,604,990,000 | Checks if installation error occurred, then proceeds with Error Reporting.
Args:
err: Exception err. | google-cloud-sdk/lib/googlecloudsdk/command_lib/crash_handling.py | HandleGcloudCrash | bopopescu/searchparty | python | def HandleGcloudCrash(err):
'Checks if installation error occurred, then proceeds with Error Reporting.\n\n Args:\n err: Exception err.\n '
err_string = console_attr.EncodeForConsole(err)
log.file_only_logger.exception('BEGIN CRASH STACKTRACE')
if _IsInstallationCorruption(err):
_PrintInsta... |
def test_multiple_patterns(self, testdir):
'Test support for multiple --doctest-glob arguments (#1255).\n '
testdir.maketxtfile(xdoc='\n >>> 1\n 1\n ')
testdir.makefile('.foo', test='\n >>> 1\n 1\n ')
testdir.maketxtfile(test_normal='\n ... | 938,271,015,983,329,000 | Test support for multiple --doctest-glob arguments (#1255). | testing/test_doctest.py | test_multiple_patterns | NNRepos/pytest | python | def test_multiple_patterns(self, testdir):
'\n '
testdir.maketxtfile(xdoc='\n >>> 1\n 1\n ')
testdir.makefile('.foo', test='\n >>> 1\n 1\n ')
testdir.maketxtfile(test_normal='\n >>> 1\n 1\n ')
expected = {'... |
@pytest.mark.parametrize(' test_string, encoding', [('foo', 'ascii'), ('öäü', 'latin1'), ('öäü', 'utf-8')])
def test_encoding(self, testdir, test_string, encoding):
'Test support for doctest_encoding ini option.\n '
testdir.makeini('\n [pytest]\n doctest_encoding={}\n '.... | 1,949,234,291,330,208,500 | Test support for doctest_encoding ini option. | testing/test_doctest.py | test_encoding | NNRepos/pytest | python | @pytest.mark.parametrize(' test_string, encoding', [('foo', 'ascii'), ('öäü', 'latin1'), ('öäü', 'utf-8')])
def test_encoding(self, testdir, test_string, encoding):
'\n '
testdir.makeini('\n [pytest]\n doctest_encoding={}\n '.format(encoding))
doctest = '\n ... |
def test_docstring_partial_context_around_error(self, testdir):
'Test that we show some context before the actual line of a failing\n doctest.\n '
testdir.makepyfile('\n def foo():\n """\n text-line-1\n text-line-2\n text-line-... | -3,960,056,223,615,673,300 | Test that we show some context before the actual line of a failing
doctest. | testing/test_doctest.py | test_docstring_partial_context_around_error | NNRepos/pytest | python | def test_docstring_partial_context_around_error(self, testdir):
'Test that we show some context before the actual line of a failing\n doctest.\n '
testdir.makepyfile('\n def foo():\n "\n text-line-1\n text-line-2\n text-line-3\... |
def test_docstring_full_context_around_error(self, testdir):
'Test that we show the whole context before the actual line of a failing\n doctest, provided that the context is up to 10 lines long.\n '
testdir.makepyfile('\n def foo():\n """\n text-line-1\n ... | -7,155,863,544,981,086,000 | Test that we show the whole context before the actual line of a failing
doctest, provided that the context is up to 10 lines long. | testing/test_doctest.py | test_docstring_full_context_around_error | NNRepos/pytest | python | def test_docstring_full_context_around_error(self, testdir):
'Test that we show the whole context before the actual line of a failing\n doctest, provided that the context is up to 10 lines long.\n '
testdir.makepyfile('\n def foo():\n "\n text-line-1\n ... |
def test_contains_unicode(self, testdir):
'Fix internal error with docstrings containing non-ascii characters.\n '
testdir.makepyfile(' def foo():\n """\n >>> name = \'с\' # not letter \'c\' but instead Cyrillic \'s\'.\n \'anything\'\n ... | -3,770,004,817,608,001,500 | Fix internal error with docstrings containing non-ascii characters. | testing/test_doctest.py | test_contains_unicode | NNRepos/pytest | python | def test_contains_unicode(self, testdir):
'\n '
testdir.makepyfile(' def foo():\n "\n >>> name = \'с\' # not letter \'c\' but instead Cyrillic \'s\'.\n \'anything\'\n "\n ')
result = testdir.runpytest('--doctest-modules... |
def test_junit_report_for_doctest(self, testdir):
'\n #713: Fix --junit-xml option when used with --doctest-modules.\n '
p = testdir.makepyfile("\n def foo():\n '''\n >>> 1 + 1\n 3\n '''\n pass\n ")
re... | 1,620,717,561,939,104,800 | #713: Fix --junit-xml option when used with --doctest-modules. | testing/test_doctest.py | test_junit_report_for_doctest | NNRepos/pytest | python | def test_junit_report_for_doctest(self, testdir):
'\n \n '
p = testdir.makepyfile("\n def foo():\n '\n >>> 1 + 1\n 3\n '\n pass\n ")
reprec = testdir.inline_run(p, '--doctest-modules', '--junit-xml=jun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.