partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
PosixTimeInMilliseconds._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/posix_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/posix_time.py#L138-L153
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "self", ".", "_timestamp", "is", "not", "None", ":", "self", ".", "_normalized_timestamp", "=", "(", "decimal", ".", "Decimal", "(",...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
PosixTimeInMilliseconds.CopyFromDateTimeString
Copies a POSIX timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The time of day, seconds ...
dfdatetime/posix_time.py
def CopyFromDateTimeString(self, time_string): """Copies a POSIX timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can...
def CopyFromDateTimeString(self, time_string): """Copies a POSIX timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can...
[ "Copies", "a", "POSIX", "timestamp", "from", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/posix_time.py#L155-L187
[ "def", "CopyFromDateTimeString", "(", "self", ",", "time_string", ")", ":", "date_time_values", "=", "self", ".", "_CopyDateTimeFromString", "(", "time_string", ")", "year", "=", "date_time_values", ".", "get", "(", "'year'", ",", "0", ")", "month", "=", "date...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
PosixTimeInMicroseconds._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/posix_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/posix_time.py#L236-L251
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "self", ".", "_timestamp", "is", "not", "None", ":", "self", ".", "_normalized_timestamp", "=", "(", "decimal", ".", "Decimal", "(",...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
PosixTimeInNanoseconds._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/posix_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/posix_time.py#L330-L345
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "self", ".", "_timestamp", "is", "not", "None", ":", "self", ".", "_normalized_timestamp", "=", "(", "decimal", ".", "Decimal", "(",...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
PosixTimeInNanoseconds._CopyFromDateTimeString
Copies a POSIX timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The time of day, seconds ...
dfdatetime/posix_time.py
def _CopyFromDateTimeString(self, time_string): """Copies a POSIX timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction ca...
def _CopyFromDateTimeString(self, time_string): """Copies a POSIX timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction ca...
[ "Copies", "a", "POSIX", "timestamp", "from", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/posix_time.py#L347-L378
[ "def", "_CopyFromDateTimeString", "(", "self", ",", "time_string", ")", ":", "date_time_values", "=", "self", ".", "_CopyDateTimeFromString", "(", "time_string", ")", "year", "=", "date_time_values", ".", "get", "(", "'year'", ",", "0", ")", "month", "=", "dat...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
PosixTimeInNanoseconds._CopyToDateTimeString
Copies the POSIX timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#########" or None if the timestamp is missing or invalid.
dfdatetime/posix_time.py
def _CopyToDateTimeString(self): """Copies the POSIX timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#########" or None if the timestamp is missing or invalid. """ if self._timestamp is None: return None timestamp, nan...
def _CopyToDateTimeString(self): """Copies the POSIX timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#########" or None if the timestamp is missing or invalid. """ if self._timestamp is None: return None timestamp, nan...
[ "Copies", "the", "POSIX", "timestamp", "to", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/posix_time.py#L394-L412
[ "def", "_CopyToDateTimeString", "(", "self", ")", ":", "if", "self", ".", "_timestamp", "is", "None", ":", "return", "None", "timestamp", ",", "nanoseconds", "=", "divmod", "(", "self", ".", "_timestamp", ",", "definitions", ".", "NANOSECONDS_PER_SECOND", ")",...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DelphiDateTime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/delphi_date_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/delphi_date_time.py#L56-L71
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "self", ".", "_timestamp", "is", "not", "None", ":", "self", ".", "_normalized_timestamp", "=", "(", "decimal", ".", "Decimal", "(",...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DelphiDateTime.CopyFromDateTimeString
Copies a Delphi TDateTime timestamp from a string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The time of day, seconds ...
dfdatetime/delphi_date_time.py
def CopyFromDateTimeString(self, time_string): """Copies a Delphi TDateTime timestamp from a string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be...
def CopyFromDateTimeString(self, time_string): """Copies a Delphi TDateTime timestamp from a string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be...
[ "Copies", "a", "Delphi", "TDateTime", "timestamp", "from", "a", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/delphi_date_time.py#L73-L111
[ "def", "CopyFromDateTimeString", "(", "self", ",", "time_string", ")", ":", "date_time_values", "=", "self", ".", "_CopyDateTimeFromString", "(", "time_string", ")", "year", "=", "date_time_values", ".", "get", "(", "'year'", ",", "0", ")", "month", "=", "date...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
WebKitTime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: float: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/webkit_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: float: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be dete...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: float: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be dete...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/webkit_time.py#L50-L66
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "(", "self", ".", "_timestamp", "is", "not", "None", "and", "self", ".", "_timestamp", ">=", "self", ".", "_INT64_MIN", "and", "se...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._AdjustForTimeZoneOffset
Adjusts the date and time values for a time zone offset. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. day_of_month (int): day of the month, where 1 represents the first day. hours (int): hours. minutes (int): minutes. time_zone_offset (int): ...
dfdatetime/interface.py
def _AdjustForTimeZoneOffset( self, year, month, day_of_month, hours, minutes, time_zone_offset): """Adjusts the date and time values for a time zone offset. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. day_of_month (int): day of the month, where 1 r...
def _AdjustForTimeZoneOffset( self, year, month, day_of_month, hours, minutes, time_zone_offset): """Adjusts the date and time values for a time zone offset. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. day_of_month (int): day of the month, where 1 r...
[ "Adjusts", "the", "date", "and", "time", "values", "for", "a", "time", "zone", "offset", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L235-L288
[ "def", "_AdjustForTimeZoneOffset", "(", "self", ",", "year", ",", "month", ",", "day_of_month", ",", "hours", ",", "minutes", ",", "time_zone_offset", ")", ":", "hours_from_utc", ",", "minutes_from_utc", "=", "divmod", "(", "time_zone_offset", ",", "60", ")", ...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._CopyDateFromString
Copies a date from a string. Args: date_string (str): date value formatted as: YYYY-MM-DD Returns: tuple[int, int, int]: year, month, day of month. Raises: ValueError: if the date string is invalid or not supported.
dfdatetime/interface.py
def _CopyDateFromString(self, date_string): """Copies a date from a string. Args: date_string (str): date value formatted as: YYYY-MM-DD Returns: tuple[int, int, int]: year, month, day of month. Raises: ValueError: if the date string is invalid or not supported. """ date_str...
def _CopyDateFromString(self, date_string): """Copies a date from a string. Args: date_string (str): date value formatted as: YYYY-MM-DD Returns: tuple[int, int, int]: year, month, day of month. Raises: ValueError: if the date string is invalid or not supported. """ date_str...
[ "Copies", "a", "date", "from", "a", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L290-L330
[ "def", "_CopyDateFromString", "(", "self", ",", "date_string", ")", ":", "date_string_length", "=", "len", "(", "date_string", ")", "# The date string should at least contain 'YYYY-MM-DD'.", "if", "date_string_length", "<", "10", ":", "raise", "ValueError", "(", "'Date ...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._CopyTimeFromString
Copies a time from a string. Args: time_string (str): time value formatted as: hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The seconds fraction and time zone offset are optional. Re...
dfdatetime/interface.py
def _CopyTimeFromString(self, time_string): """Copies a time from a string. Args: time_string (str): time value formatted as: hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The seconds fraction a...
def _CopyTimeFromString(self, time_string): """Copies a time from a string. Args: time_string (str): time value formatted as: hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The seconds fraction a...
[ "Copies", "a", "time", "from", "a", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L389-L503
[ "def", "_CopyTimeFromString", "(", "self", ",", "time_string", ")", ":", "time_string_length", "=", "len", "(", "time_string", ")", "# The time string should at least contain 'hh:mm:ss'.", "if", "time_string_length", "<", "8", ":", "raise", "ValueError", "(", "'Time str...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._GetDateValues
Determines date values. Args: number_of_days (int): number of days since epoch. epoch_year (int): year that is the start of the epoch e.g. 1970. epoch_month (int): month that is the start of the epoch, where 1 represents January. epoch_day_of_month (int): day of month that is the ...
dfdatetime/interface.py
def _GetDateValues( self, number_of_days, epoch_year, epoch_month, epoch_day_of_month): """Determines date values. Args: number_of_days (int): number of days since epoch. epoch_year (int): year that is the start of the epoch e.g. 1970. epoch_month (int): month that is the start of the e...
def _GetDateValues( self, number_of_days, epoch_year, epoch_month, epoch_day_of_month): """Determines date values. Args: number_of_days (int): number of days since epoch. epoch_year (int): year that is the start of the epoch e.g. 1970. epoch_month (int): month that is the start of the e...
[ "Determines", "date", "values", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L505-L628
[ "def", "_GetDateValues", "(", "self", ",", "number_of_days", ",", "epoch_year", ",", "epoch_month", ",", "epoch_day_of_month", ")", ":", "if", "epoch_year", "<", "0", ":", "raise", "ValueError", "(", "'Epoch year value: {0:d} out of bounds.'", ".", "format", "(", ...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._GetDateValuesWithEpoch
Determines date values. Args: number_of_days (int): number of days since epoch. date_time_epoch (DateTimeEpoch): date and time of the epoch. Returns: tuple[int, int, int]: year, month, day of month.
dfdatetime/interface.py
def _GetDateValuesWithEpoch(self, number_of_days, date_time_epoch): """Determines date values. Args: number_of_days (int): number of days since epoch. date_time_epoch (DateTimeEpoch): date and time of the epoch. Returns: tuple[int, int, int]: year, month, day of month. """ retur...
def _GetDateValuesWithEpoch(self, number_of_days, date_time_epoch): """Determines date values. Args: number_of_days (int): number of days since epoch. date_time_epoch (DateTimeEpoch): date and time of the epoch. Returns: tuple[int, int, int]: year, month, day of month. """ retur...
[ "Determines", "date", "values", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L630-L642
[ "def", "_GetDateValuesWithEpoch", "(", "self", ",", "number_of_days", ",", "date_time_epoch", ")", ":", "return", "self", ".", "_GetDateValues", "(", "number_of_days", ",", "date_time_epoch", ".", "year", ",", "date_time_epoch", ".", "month", ",", "date_time_epoch",...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._GetDayOfYear
Retrieves the day of the year for a specific day of a month in a year. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. day_of_month (int): day of the month, where 1 represents the first day. Returns: int: day of year. Raises: ValueError: if ...
dfdatetime/interface.py
def _GetDayOfYear(self, year, month, day_of_month): """Retrieves the day of the year for a specific day of a month in a year. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. day_of_month (int): day of the month, where 1 represents the first day. Returns:...
def _GetDayOfYear(self, year, month, day_of_month): """Retrieves the day of the year for a specific day of a month in a year. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. day_of_month (int): day of the month, where 1 represents the first day. Returns:...
[ "Retrieves", "the", "day", "of", "the", "year", "for", "a", "specific", "day", "of", "a", "month", "in", "a", "year", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L644-L669
[ "def", "_GetDayOfYear", "(", "self", ",", "year", ",", "month", ",", "day_of_month", ")", ":", "if", "month", "not", "in", "range", "(", "1", ",", "13", ")", ":", "raise", "ValueError", "(", "'Month value out of bounds.'", ")", "days_per_month", "=", "self...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._GetDaysPerMonth
Retrieves the number of days in a month of a specific year. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. Returns: int: number of days in the month. Raises: ValueError: if the month value is out of bounds.
dfdatetime/interface.py
def _GetDaysPerMonth(self, year, month): """Retrieves the number of days in a month of a specific year. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. Returns: int: number of days in the month. Raises: ValueError: if the month value is out of...
def _GetDaysPerMonth(self, year, month): """Retrieves the number of days in a month of a specific year. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. Returns: int: number of days in the month. Raises: ValueError: if the month value is out of...
[ "Retrieves", "the", "number", "of", "days", "in", "a", "month", "of", "a", "specific", "year", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L671-L691
[ "def", "_GetDaysPerMonth", "(", "self", ",", "year", ",", "month", ")", ":", "if", "month", "not", "in", "range", "(", "1", ",", "13", ")", ":", "raise", "ValueError", "(", "'Month value out of bounds.'", ")", "days_per_month", "=", "self", ".", "_DAYS_PER...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._GetNumberOfDaysInCentury
Retrieves the number of days in a century. Args: year (int): year in the century e.g. 1970. Returns: int: number of (remaining) days in the century. Raises: ValueError: if the year value is out of bounds.
dfdatetime/interface.py
def _GetNumberOfDaysInCentury(self, year): """Retrieves the number of days in a century. Args: year (int): year in the century e.g. 1970. Returns: int: number of (remaining) days in the century. Raises: ValueError: if the year value is out of bounds. """ if year < 0: r...
def _GetNumberOfDaysInCentury(self, year): """Retrieves the number of days in a century. Args: year (int): year in the century e.g. 1970. Returns: int: number of (remaining) days in the century. Raises: ValueError: if the year value is out of bounds. """ if year < 0: r...
[ "Retrieves", "the", "number", "of", "days", "in", "a", "century", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L704-L723
[ "def", "_GetNumberOfDaysInCentury", "(", "self", ",", "year", ")", ":", "if", "year", "<", "0", ":", "raise", "ValueError", "(", "'Year value out of bounds.'", ")", "year", ",", "_", "=", "divmod", "(", "year", ",", "100", ")", "if", "self", ".", "_IsLea...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._GetNumberOfSecondsFromElements
Retrieves the number of seconds from the date and time elements. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. day_of_month (int): day of the month, where 1 represents the first day. hours (int): hours. minutes (int): minutes. seconds (int): s...
dfdatetime/interface.py
def _GetNumberOfSecondsFromElements( self, year, month, day_of_month, hours, minutes, seconds): """Retrieves the number of seconds from the date and time elements. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. day_of_month (int): day of the month, whe...
def _GetNumberOfSecondsFromElements( self, year, month, day_of_month, hours, minutes, seconds): """Retrieves the number of seconds from the date and time elements. Args: year (int): year e.g. 1970. month (int): month, where 1 represents January. day_of_month (int): day of the month, whe...
[ "Retrieves", "the", "number", "of", "seconds", "from", "the", "date", "and", "time", "elements", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L738-L788
[ "def", "_GetNumberOfSecondsFromElements", "(", "self", ",", "year", ",", "month", ",", "day_of_month", ",", "hours", ",", "minutes", ",", "seconds", ")", ":", "if", "not", "year", "or", "not", "month", "or", "not", "day_of_month", ":", "return", "None", "#...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues._GetTimeValues
Determines time values. Args: number_of_seconds (int|decimal.Decimal): number of seconds. Returns: tuple[int, int, int, int]: days, hours, minutes, seconds.
dfdatetime/interface.py
def _GetTimeValues(self, number_of_seconds): """Determines time values. Args: number_of_seconds (int|decimal.Decimal): number of seconds. Returns: tuple[int, int, int, int]: days, hours, minutes, seconds. """ number_of_seconds = int(number_of_seconds) number_of_minutes, seconds = ...
def _GetTimeValues(self, number_of_seconds): """Determines time values. Args: number_of_seconds (int|decimal.Decimal): number of seconds. Returns: tuple[int, int, int, int]: days, hours, minutes, seconds. """ number_of_seconds = int(number_of_seconds) number_of_minutes, seconds = ...
[ "Determines", "time", "values", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L790-L803
[ "def", "_GetTimeValues", "(", "self", ",", "number_of_seconds", ")", ":", "number_of_seconds", "=", "int", "(", "number_of_seconds", ")", "number_of_minutes", ",", "seconds", "=", "divmod", "(", "number_of_seconds", ",", "60", ")", "number_of_hours", ",", "minutes...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues.CopyToStatTimeTuple
Copies the date time value to a stat timestamp tuple. Returns: tuple[int, int]: a POSIX timestamp in seconds and the remainder in 100 nano seconds or (None, None) on error.
dfdatetime/interface.py
def CopyToStatTimeTuple(self): """Copies the date time value to a stat timestamp tuple. Returns: tuple[int, int]: a POSIX timestamp in seconds and the remainder in 100 nano seconds or (None, None) on error. """ normalized_timestamp = self._GetNormalizedTimestamp() if normalized_time...
def CopyToStatTimeTuple(self): """Copies the date time value to a stat timestamp tuple. Returns: tuple[int, int]: a POSIX timestamp in seconds and the remainder in 100 nano seconds or (None, None) on error. """ normalized_timestamp = self._GetNormalizedTimestamp() if normalized_time...
[ "Copies", "the", "date", "time", "value", "to", "a", "stat", "timestamp", "tuple", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L865-L886
[ "def", "CopyToStatTimeTuple", "(", "self", ")", ":", "normalized_timestamp", "=", "self", ".", "_GetNormalizedTimestamp", "(", ")", "if", "normalized_timestamp", "is", "None", ":", "return", "None", ",", "None", "if", "self", ".", "_precision", "in", "(", "def...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues.CopyToDateTimeStringISO8601
Copies the date time value to an ISO 8601 date and time string. Returns: str: date and time value formatted as an ISO 8601 date and time string or None if the timestamp cannot be copied to a date and time string.
dfdatetime/interface.py
def CopyToDateTimeStringISO8601(self): """Copies the date time value to an ISO 8601 date and time string. Returns: str: date and time value formatted as an ISO 8601 date and time string or None if the timestamp cannot be copied to a date and time string. """ date_time_string = self.Copy...
def CopyToDateTimeStringISO8601(self): """Copies the date time value to an ISO 8601 date and time string. Returns: str: date and time value formatted as an ISO 8601 date and time string or None if the timestamp cannot be copied to a date and time string. """ date_time_string = self.Copy...
[ "Copies", "the", "date", "time", "value", "to", "an", "ISO", "8601", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L897-L908
[ "def", "CopyToDateTimeStringISO8601", "(", "self", ")", ":", "date_time_string", "=", "self", ".", "CopyToDateTimeString", "(", ")", "if", "date_time_string", ":", "date_time_string", "=", "date_time_string", ".", "replace", "(", "' '", ",", "'T'", ")", "date_time...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues.GetDate
Retrieves the date represented by the date and time values. Returns: tuple[int, int, int]: year, month, day of month or (None, None, None) if the date and time values do not represent a date.
dfdatetime/interface.py
def GetDate(self): """Retrieves the date represented by the date and time values. Returns: tuple[int, int, int]: year, month, day of month or (None, None, None) if the date and time values do not represent a date. """ normalized_timestamp = self._GetNormalizedTimestamp() if normal...
def GetDate(self): """Retrieves the date represented by the date and time values. Returns: tuple[int, int, int]: year, month, day of month or (None, None, None) if the date and time values do not represent a date. """ normalized_timestamp = self._GetNormalizedTimestamp() if normal...
[ "Retrieves", "the", "date", "represented", "by", "the", "date", "and", "time", "values", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L910-L928
[ "def", "GetDate", "(", "self", ")", ":", "normalized_timestamp", "=", "self", ".", "_GetNormalizedTimestamp", "(", ")", "if", "normalized_timestamp", "is", "None", ":", "return", "None", ",", "None", ",", "None", "number_of_days", ",", "_", ",", "_", ",", ...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues.GetPlasoTimestamp
Retrieves a timestamp that is compatible with plaso. Returns: int: a POSIX timestamp in microseconds or None if no timestamp is available.
dfdatetime/interface.py
def GetPlasoTimestamp(self): """Retrieves a timestamp that is compatible with plaso. Returns: int: a POSIX timestamp in microseconds or None if no timestamp is available. """ normalized_timestamp = self._GetNormalizedTimestamp() if normalized_timestamp is None: return None ...
def GetPlasoTimestamp(self): """Retrieves a timestamp that is compatible with plaso. Returns: int: a POSIX timestamp in microseconds or None if no timestamp is available. """ normalized_timestamp = self._GetNormalizedTimestamp() if normalized_timestamp is None: return None ...
[ "Retrieves", "a", "timestamp", "that", "is", "compatible", "with", "plaso", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L931-L945
[ "def", "GetPlasoTimestamp", "(", "self", ")", ":", "normalized_timestamp", "=", "self", ".", "_GetNormalizedTimestamp", "(", ")", "if", "normalized_timestamp", "is", "None", ":", "return", "None", "normalized_timestamp", "*=", "definitions", ".", "MICROSECONDS_PER_SEC...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
DateTimeValues.GetTimeOfDay
Retrieves the time of day represented by the date and time values. Returns: tuple[int, int, int]: hours, minutes, seconds or (None, None, None) if the date and time values do not represent a time of day.
dfdatetime/interface.py
def GetTimeOfDay(self): """Retrieves the time of day represented by the date and time values. Returns: tuple[int, int, int]: hours, minutes, seconds or (None, None, None) if the date and time values do not represent a time of day. """ normalized_timestamp = self._GetNormalizedTimestam...
def GetTimeOfDay(self): """Retrieves the time of day represented by the date and time values. Returns: tuple[int, int, int]: hours, minutes, seconds or (None, None, None) if the date and time values do not represent a time of day. """ normalized_timestamp = self._GetNormalizedTimestam...
[ "Retrieves", "the", "time", "of", "day", "represented", "by", "the", "date", "and", "time", "values", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/interface.py#L947-L959
[ "def", "GetTimeOfDay", "(", "self", ")", ":", "normalized_timestamp", "=", "self", ".", "_GetNormalizedTimestamp", "(", ")", "if", "normalized_timestamp", "is", "None", ":", "return", "None", ",", "None", ",", "None", "_", ",", "hours", ",", "minutes", ",", ...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
HFSTime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/hfs_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/hfs_time.py#L50-L65
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "(", "self", ".", "_timestamp", "is", "not", "None", "and", "self", ".", "_timestamp", ">=", "0", "and", "self", ".", "_timestamp"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
FakeTime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/fake_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/fake_time.py#L37-L53
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "self", ".", "_number_of_seconds", "is", "not", "None", ":", "self", ".", "_normalized_timestamp", "=", "(", "decimal", ".", "Decimal"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
FakeTime.CopyFromDateTimeString
Copies a fake timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The time of day, seconds ...
dfdatetime/fake_time.py
def CopyFromDateTimeString(self, time_string): """Copies a fake timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can ...
def CopyFromDateTimeString(self, time_string): """Copies a fake timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can ...
[ "Copies", "a", "fake", "timestamp", "from", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/fake_time.py#L55-L81
[ "def", "CopyFromDateTimeString", "(", "self", ",", "time_string", ")", ":", "date_time_values", "=", "self", ".", "_CopyDateTimeFromString", "(", "time_string", ")", "year", "=", "date_time_values", ".", "get", "(", "'year'", ",", "0", ")", "month", "=", "date...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
RFC2579DateTime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/rfc2579_date_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/rfc2579_date_time.py#L131-L147
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "self", ".", "_number_of_seconds", "is", "not", "None", ":", "self", ".", "_normalized_timestamp", "=", "(", "decimal", ".", "Decimal"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
RFC2579DateTime.CopyToDateTimeString
Copies the RFC2579 date-time to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#" or None if the number of seconds is missing.
dfdatetime/rfc2579_date_time.py
def CopyToDateTimeString(self): """Copies the RFC2579 date-time to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#" or None if the number of seconds is missing. """ if self._number_of_seconds is None: return None return '{0:04d}-...
def CopyToDateTimeString(self): """Copies the RFC2579 date-time to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#" or None if the number of seconds is missing. """ if self._number_of_seconds is None: return None return '{0:04d}-...
[ "Copies", "the", "RFC2579", "date", "-", "time", "to", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/rfc2579_date_time.py#L194-L206
[ "def", "CopyToDateTimeString", "(", "self", ")", ":", "if", "self", ".", "_number_of_seconds", "is", "None", ":", "return", "None", "return", "'{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}.{6:01d}'", ".", "format", "(", "self", ".", "year", ",", "self", ".", "m...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
SMSBackend.open
Ensures we have a connection to the SMS gateway. Returns whether or not a new connection was required (True or False).
smsish/sms/backends/twilio.py
def open(self): """ Ensures we have a connection to the SMS gateway. Returns whether or not a new connection was required (True or False). """ if self.connection: # Nothing to do if the connection is already open. return False self.connection = self._get_twilio_client() return True
def open(self): """ Ensures we have a connection to the SMS gateway. Returns whether or not a new connection was required (True or False). """ if self.connection: # Nothing to do if the connection is already open. return False self.connection = self._get_twilio_client() return True
[ "Ensures", "we", "have", "a", "connection", "to", "the", "SMS", "gateway", ".", "Returns", "whether", "or", "not", "a", "new", "connection", "was", "required", "(", "True", "or", "False", ")", "." ]
RyanBalfanz/django-smsish
python
https://github.com/RyanBalfanz/django-smsish/blob/4d450e3d217cea9e373f16c5e4f0beb3218bd5c9/smsish/sms/backends/twilio.py#L12-L21
[ "def", "open", "(", "self", ")", ":", "if", "self", ".", "connection", ":", "# Nothing to do if the connection is already open.", "return", "False", "self", ".", "connection", "=", "self", ".", "_get_twilio_client", "(", ")", "return", "True" ]
4d450e3d217cea9e373f16c5e4f0beb3218bd5c9
train
SMSBackend._send
A helper method that does the actual sending.
smsish/sms/backends/twilio.py
def _send(self, email_message): """A helper method that does the actual sending.""" if not email_message.recipients(): return False from_email = email_message.from_email recipients = email_message.recipients() try: self.connection.messages.create( to=recipients, from_=from_email, body=email_...
def _send(self, email_message): """A helper method that does the actual sending.""" if not email_message.recipients(): return False from_email = email_message.from_email recipients = email_message.recipients() try: self.connection.messages.create( to=recipients, from_=from_email, body=email_...
[ "A", "helper", "method", "that", "does", "the", "actual", "sending", "." ]
RyanBalfanz/django-smsish
python
https://github.com/RyanBalfanz/django-smsish/blob/4d450e3d217cea9e373f16c5e4f0beb3218bd5c9/smsish/sms/backends/twilio.py#L47-L63
[ "def", "_send", "(", "self", ",", "email_message", ")", ":", "if", "not", "email_message", ".", "recipients", "(", ")", ":", "return", "False", "from_email", "=", "email_message", ".", "from_email", "recipients", "=", "email_message", ".", "recipients", "(", ...
4d450e3d217cea9e373f16c5e4f0beb3218bd5c9
train
FATDateTime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/fat_date_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/fat_date_time.py#L61-L76
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "self", ".", "_number_of_seconds", "is", "not", "None", "and", "self", ".", "_number_of_seconds", ">=", "0", ":", "self", ".", "_nor...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
FATDateTime._GetNumberOfSeconds
Retrieves the number of seconds from a FAT date time. Args: fat_date_time (int): FAT date time. Returns: int: number of seconds since January 1, 1980 00:00:00. Raises: ValueError: if the month, day of month, hours, minutes or seconds value is out of bounds.
dfdatetime/fat_date_time.py
def _GetNumberOfSeconds(self, fat_date_time): """Retrieves the number of seconds from a FAT date time. Args: fat_date_time (int): FAT date time. Returns: int: number of seconds since January 1, 1980 00:00:00. Raises: ValueError: if the month, day of month, hours, minutes or seconds ...
def _GetNumberOfSeconds(self, fat_date_time): """Retrieves the number of seconds from a FAT date time. Args: fat_date_time (int): FAT date time. Returns: int: number of seconds since January 1, 1980 00:00:00. Raises: ValueError: if the month, day of month, hours, minutes or seconds ...
[ "Retrieves", "the", "number", "of", "seconds", "from", "a", "FAT", "date", "time", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/fat_date_time.py#L78-L121
[ "def", "_GetNumberOfSeconds", "(", "self", ",", "fat_date_time", ")", ":", "day_of_month", "=", "(", "fat_date_time", "&", "0x1f", ")", "month", "=", "(", "(", "fat_date_time", ">>", "5", ")", "&", "0x0f", ")", "year", "=", "(", "fat_date_time", ">>", "9...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
get_sms_connection
Load an sms backend and return an instance of it. If backend is None (default) settings.SMS_BACKEND is used. Both fail_silently and other keyword arguments are used in the constructor of the backend. https://github.com/django/django/blob/master/django/core/mail/__init__.py#L28
smsish/sms/__init__.py
def get_sms_connection(backend=None, fail_silently=False, **kwds): """Load an sms backend and return an instance of it. If backend is None (default) settings.SMS_BACKEND is used. Both fail_silently and other keyword arguments are used in the constructor of the backend. https://github.com/django/django/blob/mast...
def get_sms_connection(backend=None, fail_silently=False, **kwds): """Load an sms backend and return an instance of it. If backend is None (default) settings.SMS_BACKEND is used. Both fail_silently and other keyword arguments are used in the constructor of the backend. https://github.com/django/django/blob/mast...
[ "Load", "an", "sms", "backend", "and", "return", "an", "instance", "of", "it", "." ]
RyanBalfanz/django-smsish
python
https://github.com/RyanBalfanz/django-smsish/blob/4d450e3d217cea9e373f16c5e4f0beb3218bd5c9/smsish/sms/__init__.py#L20-L31
[ "def", "get_sms_connection", "(", "backend", "=", "None", ",", "fail_silently", "=", "False", ",", "*", "*", "kwds", ")", ":", "klass", "=", "import_string", "(", "backend", "or", "settings", ".", "SMS_BACKEND", ")", "return", "klass", "(", "fail_silently", ...
4d450e3d217cea9e373f16c5e4f0beb3218bd5c9
train
send_sms
Easy wrapper for sending a single message to a recipient list. All members of the recipient list will see the other recipients in the 'To' field. If auth_user is None, the EMAIL_HOST_USER setting is used. If auth_password is None, the EMAIL_HOST_PASSWORD setting is used. Note: The API for this method is frozen. N...
smsish/sms/__init__.py
def send_sms(message, from_number, recipient_list, fail_silently=False, auth_user=None, auth_password=None, connection=None): """ Easy wrapper for sending a single message to a recipient list. All members of the recipient list will see the other recipients in the 'To' field. If auth_user is None, the EMAIL_HOST_US...
def send_sms(message, from_number, recipient_list, fail_silently=False, auth_user=None, auth_password=None, connection=None): """ Easy wrapper for sending a single message to a recipient list. All members of the recipient list will see the other recipients in the 'To' field. If auth_user is None, the EMAIL_HOST_US...
[ "Easy", "wrapper", "for", "sending", "a", "single", "message", "to", "a", "recipient", "list", ".", "All", "members", "of", "the", "recipient", "list", "will", "see", "the", "other", "recipients", "in", "the", "To", "field", "." ]
RyanBalfanz/django-smsish
python
https://github.com/RyanBalfanz/django-smsish/blob/4d450e3d217cea9e373f16c5e4f0beb3218bd5c9/smsish/sms/__init__.py#L34-L50
[ "def", "send_sms", "(", "message", ",", "from_number", ",", "recipient_list", ",", "fail_silently", "=", "False", ",", "auth_user", "=", "None", ",", "auth_password", "=", "None", ",", "connection", "=", "None", ")", ":", "connection", "=", "connection", "or...
4d450e3d217cea9e373f16c5e4f0beb3218bd5c9
train
send_mass_sms
Given a datatuple of (subject, message, from_email, recipient_list), sends each message to each recipient list. Returns the number of emails sent. If from_email is None, the DEFAULT_FROM_EMAIL setting is used. If auth_user and auth_password are set, they're used to log in. If auth_user is None, the EMAIL_HOST_USER...
smsish/sms/__init__.py
def send_mass_sms(datatuple, fail_silently=False, auth_user=None, auth_password=None, connection=None): """ Given a datatuple of (subject, message, from_email, recipient_list), sends each message to each recipient list. Returns the number of emails sent. If from_email is None, the DEFAULT_FROM_EMAIL setting is use...
def send_mass_sms(datatuple, fail_silently=False, auth_user=None, auth_password=None, connection=None): """ Given a datatuple of (subject, message, from_email, recipient_list), sends each message to each recipient list. Returns the number of emails sent. If from_email is None, the DEFAULT_FROM_EMAIL setting is use...
[ "Given", "a", "datatuple", "of", "(", "subject", "message", "from_email", "recipient_list", ")", "sends", "each", "message", "to", "each", "recipient", "list", ".", "Returns", "the", "number", "of", "emails", "sent", "." ]
RyanBalfanz/django-smsish
python
https://github.com/RyanBalfanz/django-smsish/blob/4d450e3d217cea9e373f16c5e4f0beb3218bd5c9/smsish/sms/__init__.py#L53-L73
[ "def", "send_mass_sms", "(", "datatuple", ",", "fail_silently", "=", "False", ",", "auth_user", "=", "None", ",", "auth_password", "=", "None", ",", "connection", "=", "None", ")", ":", "import", "smsish", ".", "sms", ".", "backends", ".", "rq", "if", "i...
4d450e3d217cea9e373f16c5e4f0beb3218bd5c9
train
Filetime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/filetime.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/filetime.py#L53-L69
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "(", "self", ".", "_timestamp", "is", "not", "None", "and", "self", ".", "_timestamp", ">=", "0", "and", "self", ".", "_timestamp"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
Filetime.CopyToDateTimeString
Copies the FILETIME timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#######" or None if the timestamp is missing or invalid.
dfdatetime/filetime.py
def CopyToDateTimeString(self): """Copies the FILETIME timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#######" or None if the timestamp is missing or invalid. """ if (self._timestamp is None or self._timestamp < 0 or sel...
def CopyToDateTimeString(self): """Copies the FILETIME timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#######" or None if the timestamp is missing or invalid. """ if (self._timestamp is None or self._timestamp < 0 or sel...
[ "Copies", "the", "FILETIME", "timestamp", "to", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/filetime.py#L109-L127
[ "def", "CopyToDateTimeString", "(", "self", ")", ":", "if", "(", "self", ".", "_timestamp", "is", "None", "or", "self", ".", "_timestamp", "<", "0", "or", "self", ".", "_timestamp", ">", "self", ".", "_UINT64_MAX", ")", ":", "return", "None", "timestamp"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
UUIDTime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/uuid_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp ...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp ...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/uuid_time.py#L58-L74
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "(", "self", ".", "_timestamp", "is", "not", "None", "and", "self", ".", "_timestamp", ">=", "0", "and", "self", ".", "_timestamp"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
SecondsPrecisionHelper.CopyToDateTimeString
Copies the time elements and fraction of second to a string. Args: time_elements_tuple (tuple[int, int, int, int, int, int]): time elements, contains year, month, day of month, hours, minutes and seconds. fraction_of_second (decimal.Decimal): fraction of second, which must be a ...
dfdatetime/precisions.py
def CopyToDateTimeString(cls, time_elements_tuple, fraction_of_second): """Copies the time elements and fraction of second to a string. Args: time_elements_tuple (tuple[int, int, int, int, int, int]): time elements, contains year, month, day of month, hours, minutes and seconds. ...
def CopyToDateTimeString(cls, time_elements_tuple, fraction_of_second): """Copies the time elements and fraction of second to a string. Args: time_elements_tuple (tuple[int, int, int, int, int, int]): time elements, contains year, month, day of month, hours, minutes and seconds. ...
[ "Copies", "the", "time", "elements", "and", "fraction", "of", "second", "to", "a", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/precisions.py#L78-L101
[ "def", "CopyToDateTimeString", "(", "cls", ",", "time_elements_tuple", ",", "fraction_of_second", ")", ":", "if", "fraction_of_second", "<", "0.0", "or", "fraction_of_second", ">=", "1.0", ":", "raise", "ValueError", "(", "'Fraction of second value: {0:f} out of bounds.'"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
MillisecondsPrecisionHelper.CopyMicrosecondsToFractionOfSecond
Copies the number of microseconds to a fraction of second value. Args: microseconds (int): number of microseconds. Returns: decimal.Decimal: fraction of second, which must be a value between 0.0 and 1.0. Raises: ValueError: if the number of microseconds is out of bounds.
dfdatetime/precisions.py
def CopyMicrosecondsToFractionOfSecond(cls, microseconds): """Copies the number of microseconds to a fraction of second value. Args: microseconds (int): number of microseconds. Returns: decimal.Decimal: fraction of second, which must be a value between 0.0 and 1.0. Raises: ...
def CopyMicrosecondsToFractionOfSecond(cls, microseconds): """Copies the number of microseconds to a fraction of second value. Args: microseconds (int): number of microseconds. Returns: decimal.Decimal: fraction of second, which must be a value between 0.0 and 1.0. Raises: ...
[ "Copies", "the", "number", "of", "microseconds", "to", "a", "fraction", "of", "second", "value", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/precisions.py#L108-L128
[ "def", "CopyMicrosecondsToFractionOfSecond", "(", "cls", ",", "microseconds", ")", ":", "if", "microseconds", "<", "0", "or", "microseconds", ">=", "definitions", ".", "MICROSECONDS_PER_SECOND", ":", "raise", "ValueError", "(", "'Number of microseconds value: {0:d} out of...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
MillisecondsPrecisionHelper.CopyToDateTimeString
Copies the time elements and fraction of second to a string. Args: time_elements_tuple (tuple[int, int, int, int, int, int]): time elements, contains year, month, day of month, hours, minutes and seconds. fraction_of_second (decimal.Decimal): fraction of second, which must be a ...
dfdatetime/precisions.py
def CopyToDateTimeString(cls, time_elements_tuple, fraction_of_second): """Copies the time elements and fraction of second to a string. Args: time_elements_tuple (tuple[int, int, int, int, int, int]): time elements, contains year, month, day of month, hours, minutes and seconds. ...
def CopyToDateTimeString(cls, time_elements_tuple, fraction_of_second): """Copies the time elements and fraction of second to a string. Args: time_elements_tuple (tuple[int, int, int, int, int, int]): time elements, contains year, month, day of month, hours, minutes and seconds. ...
[ "Copies", "the", "time", "elements", "and", "fraction", "of", "second", "to", "a", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/precisions.py#L131-L157
[ "def", "CopyToDateTimeString", "(", "cls", ",", "time_elements_tuple", ",", "fraction_of_second", ")", ":", "if", "fraction_of_second", "<", "0.0", "or", "fraction_of_second", ">=", "1.0", ":", "raise", "ValueError", "(", "'Fraction of second value: {0:f} out of bounds.'"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
MicrosecondsPrecisionHelper.CopyMicrosecondsToFractionOfSecond
Copies the number of microseconds to a fraction of second value. Args: microseconds (int): number of microseconds. Returns: decimal.Decimal: fraction of second, which must be a value between 0.0 and 1.0. Raises: ValueError: if the number of microseconds is out of bounds.
dfdatetime/precisions.py
def CopyMicrosecondsToFractionOfSecond(cls, microseconds): """Copies the number of microseconds to a fraction of second value. Args: microseconds (int): number of microseconds. Returns: decimal.Decimal: fraction of second, which must be a value between 0.0 and 1.0. Raises: ...
def CopyMicrosecondsToFractionOfSecond(cls, microseconds): """Copies the number of microseconds to a fraction of second value. Args: microseconds (int): number of microseconds. Returns: decimal.Decimal: fraction of second, which must be a value between 0.0 and 1.0. Raises: ...
[ "Copies", "the", "number", "of", "microseconds", "to", "a", "fraction", "of", "second", "value", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/precisions.py#L164-L182
[ "def", "CopyMicrosecondsToFractionOfSecond", "(", "cls", ",", "microseconds", ")", ":", "if", "microseconds", "<", "0", "or", "microseconds", ">=", "definitions", ".", "MICROSECONDS_PER_SECOND", ":", "raise", "ValueError", "(", "'Number of microseconds value: {0:d} out of...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
MicrosecondsPrecisionHelper.CopyToDateTimeString
Copies the time elements and fraction of second to a string. Args: time_elements_tuple (tuple[int, int, int, int, int, int]): time elements, contains year, month, day of month, hours, minutes and seconds. fraction_of_second (decimal.Decimal): fraction of second, which must be a ...
dfdatetime/precisions.py
def CopyToDateTimeString(cls, time_elements_tuple, fraction_of_second): """Copies the time elements and fraction of second to a string. Args: time_elements_tuple (tuple[int, int, int, int, int, int]): time elements, contains year, month, day of month, hours, minutes and seconds. ...
def CopyToDateTimeString(cls, time_elements_tuple, fraction_of_second): """Copies the time elements and fraction of second to a string. Args: time_elements_tuple (tuple[int, int, int, int, int, int]): time elements, contains year, month, day of month, hours, minutes and seconds. ...
[ "Copies", "the", "time", "elements", "and", "fraction", "of", "second", "to", "a", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/precisions.py#L185-L211
[ "def", "CopyToDateTimeString", "(", "cls", ",", "time_elements_tuple", ",", "fraction_of_second", ")", ":", "if", "fraction_of_second", "<", "0.0", "or", "fraction_of_second", ">=", "1.0", ":", "raise", "ValueError", "(", "'Fraction of second value: {0:f} out of bounds.'"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
PrecisionHelperFactory.CreatePrecisionHelper
Creates a precision helper. Args: precision (str): precision of the date and time value, which should be one of the PRECISION_VALUES in definitions. Returns: class: date time precision helper class. Raises: ValueError: if the precision value is unsupported.
dfdatetime/precisions.py
def CreatePrecisionHelper(cls, precision): """Creates a precision helper. Args: precision (str): precision of the date and time value, which should be one of the PRECISION_VALUES in definitions. Returns: class: date time precision helper class. Raises: ValueError: if the p...
def CreatePrecisionHelper(cls, precision): """Creates a precision helper. Args: precision (str): precision of the date and time value, which should be one of the PRECISION_VALUES in definitions. Returns: class: date time precision helper class. Raises: ValueError: if the p...
[ "Creates", "a", "precision", "helper", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/precisions.py#L224-L241
[ "def", "CreatePrecisionHelper", "(", "cls", ",", "precision", ")", ":", "precision_helper_class", "=", "cls", ".", "_PRECISION_CLASSES", ".", "get", "(", "precision", ",", "None", ")", "if", "not", "precision_helper_class", ":", "raise", "ValueError", "(", "'Uns...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
APFSTime.CopyFromDateTimeString
Copies a APFS timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The time of day, seconds ...
dfdatetime/apfs_time.py
def CopyFromDateTimeString(self, time_string): """Copies a APFS timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can ...
def CopyFromDateTimeString(self, time_string): """Copies a APFS timestamp from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can ...
[ "Copies", "a", "APFS", "timestamp", "from", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/apfs_time.py#L40-L59
[ "def", "CopyFromDateTimeString", "(", "self", ",", "time_string", ")", ":", "super", "(", "APFSTime", ",", "self", ")", ".", "_CopyFromDateTimeString", "(", "time_string", ")", "if", "(", "self", ".", "_timestamp", "is", "None", "or", "self", ".", "_timestam...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
APFSTime.CopyToDateTimeString
Copies the APFS timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#########" or None if the timestamp is missing or invalid.
dfdatetime/apfs_time.py
def CopyToDateTimeString(self): """Copies the APFS timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#########" or None if the timestamp is missing or invalid. """ if (self._timestamp is None or self._timestamp < self._INT64_MIN or...
def CopyToDateTimeString(self): """Copies the APFS timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#########" or None if the timestamp is missing or invalid. """ if (self._timestamp is None or self._timestamp < self._INT64_MIN or...
[ "Copies", "the", "APFS", "timestamp", "to", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/apfs_time.py#L61-L72
[ "def", "CopyToDateTimeString", "(", "self", ")", ":", "if", "(", "self", ".", "_timestamp", "is", "None", "or", "self", ".", "_timestamp", "<", "self", ".", "_INT64_MIN", "or", "self", ".", "_timestamp", ">", "self", ".", "_INT64_MAX", ")", ":", "return"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
CocoaTime.CopyToDateTimeString
Copies the Cocoa timestamp to a date and time string. Returns: str: date and time value formatted as: YYYY-MM-DD hh:mm:ss.###### or None if the timestamp cannot be copied to a date and time string.
dfdatetime/cocoa_time.py
def CopyToDateTimeString(self): """Copies the Cocoa timestamp to a date and time string. Returns: str: date and time value formatted as: YYYY-MM-DD hh:mm:ss.###### or None if the timestamp cannot be copied to a date and time string. """ if self._timestamp is None: return None ...
def CopyToDateTimeString(self): """Copies the Cocoa timestamp to a date and time string. Returns: str: date and time value formatted as: YYYY-MM-DD hh:mm:ss.###### or None if the timestamp cannot be copied to a date and time string. """ if self._timestamp is None: return None ...
[ "Copies", "the", "Cocoa", "timestamp", "to", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/cocoa_time.py#L106-L126
[ "def", "CopyToDateTimeString", "(", "self", ")", ":", "if", "self", ".", "_timestamp", "is", "None", ":", "return", "None", "number_of_days", ",", "hours", ",", "minutes", ",", "seconds", "=", "self", ".", "_GetTimeValues", "(", "int", "(", "self", ".", ...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
send_sms_message
Send an SMSMessage instance using a connection given by the specified `backend`.
smsish/sms/backends/rq.py
def send_sms_message(sms_message, backend=None, fail_silently=False): """ Send an SMSMessage instance using a connection given by the specified `backend`. """ with get_sms_connection(backend=backend, fail_silently=fail_silently) as connection: result = connection.send_messages([sms_message]) return result
def send_sms_message(sms_message, backend=None, fail_silently=False): """ Send an SMSMessage instance using a connection given by the specified `backend`. """ with get_sms_connection(backend=backend, fail_silently=fail_silently) as connection: result = connection.send_messages([sms_message]) return result
[ "Send", "an", "SMSMessage", "instance", "using", "a", "connection", "given", "by", "the", "specified", "backend", "." ]
RyanBalfanz/django-smsish
python
https://github.com/RyanBalfanz/django-smsish/blob/4d450e3d217cea9e373f16c5e4f0beb3218bd5c9/smsish/sms/backends/rq.py#L45-L51
[ "def", "send_sms_message", "(", "sms_message", ",", "backend", "=", "None", ",", "fail_silently", "=", "False", ")", ":", "with", "get_sms_connection", "(", "backend", "=", "backend", ",", "fail_silently", "=", "fail_silently", ")", "as", "connection", ":", "r...
4d450e3d217cea9e373f16c5e4f0beb3218bd5c9
train
SMSBackend.send_messages
Receives a list of SMSMessage instances and returns a list of RQ `Job` instances.
smsish/sms/backends/rq.py
def send_messages(self, sms_messages): """ Receives a list of SMSMessage instances and returns a list of RQ `Job` instances. """ results = [] for message in sms_messages: try: assert message.connection is None except AssertionError: if not self.fail_silently: raise backend = self.backend...
def send_messages(self, sms_messages): """ Receives a list of SMSMessage instances and returns a list of RQ `Job` instances. """ results = [] for message in sms_messages: try: assert message.connection is None except AssertionError: if not self.fail_silently: raise backend = self.backend...
[ "Receives", "a", "list", "of", "SMSMessage", "instances", "and", "returns", "a", "list", "of", "RQ", "Job", "instances", "." ]
RyanBalfanz/django-smsish
python
https://github.com/RyanBalfanz/django-smsish/blob/4d450e3d217cea9e373f16c5e4f0beb3218bd5c9/smsish/sms/backends/rq.py#L24-L39
[ "def", "send_messages", "(", "self", ",", "sms_messages", ")", ":", "results", "=", "[", "]", "for", "message", "in", "sms_messages", ":", "try", ":", "assert", "message", ".", "connection", "is", "None", "except", "AssertionError", ":", "if", "not", "self...
4d450e3d217cea9e373f16c5e4f0beb3218bd5c9
train
JavaTime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/java_time.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/java_time.py#L26-L42
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "(", "self", ".", "_timestamp", "is", "not", "None", "and", "self", ".", "_timestamp", ">=", "self", ".", "_INT64_MIN", "and", "se...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
JavaTime.CopyToDateTimeString
Copies the POSIX timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.######" or None if the timestamp is missing.
dfdatetime/java_time.py
def CopyToDateTimeString(self): """Copies the POSIX timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.######" or None if the timestamp is missing. """ if (self._timestamp is None or self._timestamp < self._INT64_MIN or self...
def CopyToDateTimeString(self): """Copies the POSIX timestamp to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.######" or None if the timestamp is missing. """ if (self._timestamp is None or self._timestamp < self._INT64_MIN or self...
[ "Copies", "the", "POSIX", "timestamp", "to", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/java_time.py#L44-L55
[ "def", "CopyToDateTimeString", "(", "self", ")", ":", "if", "(", "self", ".", "_timestamp", "is", "None", "or", "self", ".", "_timestamp", "<", "self", ".", "_INT64_MIN", "or", "self", ".", "_timestamp", ">", "self", ".", "_INT64_MAX", ")", ":", "return"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
Image
Inspired by: - https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailimages/rich_text.py - https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailimages/shortcuts.py - https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailimages/formats.py
wagtaildraftail/decorators.py
def Image(props): """ Inspired by: - https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailimages/rich_text.py - https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailimages/shortcuts.py - https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailimages/formats.py """ ...
def Image(props): """ Inspired by: - https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailimages/rich_text.py - https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailimages/shortcuts.py - https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailimages/formats.py """ ...
[ "Inspired", "by", ":", "-", "https", ":", "//", "github", ".", "com", "/", "torchbox", "/", "wagtail", "/", "blob", "/", "master", "/", "wagtail", "/", "wagtailimages", "/", "rich_text", ".", "py", "-", "https", ":", "//", "github", ".", "com", "/", ...
springload/wagtaildraftail
python
https://github.com/springload/wagtaildraftail/blob/87f1ae3ade493c00daff021394051aa656136c10/wagtaildraftail/decorators.py#L53-L76
[ "def", "Image", "(", "props", ")", ":", "image_model", "=", "get_image_model", "(", ")", "alignment", "=", "props", ".", "get", "(", "'alignment'", ",", "'left'", ")", "alt_text", "=", "props", ".", "get", "(", "'altText'", ",", "''", ")", "try", ":", ...
87f1ae3ade493c00daff021394051aa656136c10
train
TimeElements._CopyDateTimeFromStringISO8601
Copies a date and time from an ISO 8601 date and time string. Args: time_string (str): time value formatted as: hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The fraction of second and tim...
dfdatetime/time_elements.py
def _CopyDateTimeFromStringISO8601(self, time_string): """Copies a date and time from an ISO 8601 date and time string. Args: time_string (str): time value formatted as: hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be ...
def _CopyDateTimeFromStringISO8601(self, time_string): """Copies a date and time from an ISO 8601 date and time string. Args: time_string (str): time value formatted as: hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be ...
[ "Copies", "a", "date", "and", "time", "from", "an", "ISO", "8601", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L63-L117
[ "def", "_CopyDateTimeFromStringISO8601", "(", "self", ",", "time_string", ")", ":", "if", "not", "time_string", ":", "raise", "ValueError", "(", "'Invalid time string.'", ")", "time_string_length", "=", "len", "(", "time_string", ")", "year", ",", "month", ",", ...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElements._CopyFromDateTimeValues
Copies time elements from date and time values. Args: date_time_values (dict[str, int]): date and time values, such as year, month, day of month, hours, minutes, seconds, microseconds.
dfdatetime/time_elements.py
def _CopyFromDateTimeValues(self, date_time_values): """Copies time elements from date and time values. Args: date_time_values (dict[str, int]): date and time values, such as year, month, day of month, hours, minutes, seconds, microseconds. """ year = date_time_values.get('year', 0) ...
def _CopyFromDateTimeValues(self, date_time_values): """Copies time elements from date and time values. Args: date_time_values (dict[str, int]): date and time values, such as year, month, day of month, hours, minutes, seconds, microseconds. """ year = date_time_values.get('year', 0) ...
[ "Copies", "time", "elements", "from", "date", "and", "time", "values", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L119-L139
[ "def", "_CopyFromDateTimeValues", "(", "self", ",", "date_time_values", ")", ":", "year", "=", "date_time_values", ".", "get", "(", "'year'", ",", "0", ")", "month", "=", "date_time_values", ".", "get", "(", "'month'", ",", "0", ")", "day_of_month", "=", "...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElements._CopyTimeFromStringISO8601
Copies a time from an ISO 8601 date and time string. Args: time_string (str): time value formatted as: hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The faction of second and time zone off...
dfdatetime/time_elements.py
def _CopyTimeFromStringISO8601(self, time_string): """Copies a time from an ISO 8601 date and time string. Args: time_string (str): time value formatted as: hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6...
def _CopyTimeFromStringISO8601(self, time_string): """Copies a time from an ISO 8601 date and time string. Args: time_string (str): time value formatted as: hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6...
[ "Copies", "a", "time", "from", "an", "ISO", "8601", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L141-L296
[ "def", "_CopyTimeFromStringISO8601", "(", "self", ",", "time_string", ")", ":", "if", "time_string", ".", "endswith", "(", "'Z'", ")", ":", "time_string", "=", "time_string", "[", ":", "-", "1", "]", "time_string_length", "=", "len", "(", "time_string", ")",...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElements.CopyFromDateTimeString
Copies time elements from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The time of day, seconds ...
dfdatetime/time_elements.py
def CopyFromDateTimeString(self, time_string): """Copies time elements from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be ...
def CopyFromDateTimeString(self, time_string): """Copies time elements from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be ...
[ "Copies", "time", "elements", "from", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L298-L312
[ "def", "CopyFromDateTimeString", "(", "self", ",", "time_string", ")", ":", "date_time_values", "=", "self", ".", "_CopyDateTimeFromString", "(", "time_string", ")", "self", ".", "_CopyFromDateTimeValues", "(", "date_time_values", ")" ]
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElements.CopyFromStringISO8601
Copies time elements from an ISO 8601 date and time string. Currently not supported: * Duration notation: "P..." * Week notation "2016-W33" * Date with week number notation "2016-W33-3" * Date without year notation "--08-17" * Ordinal date notation "2016-230" Args: time_string (str):...
dfdatetime/time_elements.py
def CopyFromStringISO8601(self, time_string): """Copies time elements from an ISO 8601 date and time string. Currently not supported: * Duration notation: "P..." * Week notation "2016-W33" * Date with week number notation "2016-W33-3" * Date without year notation "--08-17" * Ordinal date no...
def CopyFromStringISO8601(self, time_string): """Copies time elements from an ISO 8601 date and time string. Currently not supported: * Duration notation: "P..." * Week notation "2016-W33" * Date with week number notation "2016-W33-3" * Date without year notation "--08-17" * Ordinal date no...
[ "Copies", "time", "elements", "from", "an", "ISO", "8601", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L314-L338
[ "def", "CopyFromStringISO8601", "(", "self", ",", "time_string", ")", ":", "date_time_values", "=", "self", ".", "_CopyDateTimeFromStringISO8601", "(", "time_string", ")", "self", ".", "_CopyFromDateTimeValues", "(", "date_time_values", ")" ]
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElements.CopyFromStringTuple
Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes and seconds. Raises: ValueError: if the time elements tuple is invalid.
dfdatetime/time_elements.py
def CopyFromStringTuple(self, time_elements_tuple): """Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes and seconds. Raises: ...
def CopyFromStringTuple(self, time_elements_tuple): """Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes and seconds. Raises: ...
[ "Copies", "time", "elements", "from", "string", "-", "based", "time", "elements", "tuple", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L340-L396
[ "def", "CopyFromStringTuple", "(", "self", ",", "time_elements_tuple", ")", ":", "if", "len", "(", "time_elements_tuple", ")", "<", "6", ":", "raise", "ValueError", "(", "(", "'Invalid time elements tuple at least 6 elements required,'", "'got: {0:d}'", ")", ".", "for...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElements.CopyToDateTimeString
Copies the time elements to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss" or None if time elements are missing.
dfdatetime/time_elements.py
def CopyToDateTimeString(self): """Copies the time elements to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss" or None if time elements are missing. """ if self._number_of_seconds is None: return None return '{0:04d}-{1:02d}-{2:02...
def CopyToDateTimeString(self): """Copies the time elements to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss" or None if time elements are missing. """ if self._number_of_seconds is None: return None return '{0:04d}-{1:02d}-{2:02...
[ "Copies", "the", "time", "elements", "to", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L398-L411
[ "def", "CopyToDateTimeString", "(", "self", ")", ":", "if", "self", ".", "_number_of_seconds", "is", "None", ":", "return", "None", "return", "'{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}'", ".", "format", "(", "self", ".", "_time_elements_tuple", "[", "0", "]",...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElementsWithFractionOfSecond._CopyFromDateTimeValues
Copies time elements from date and time values. Args: date_time_values (dict[str, int]): date and time values, such as year, month, day of month, hours, minutes, seconds, microseconds. Raises: ValueError: if no helper can be created for the current precision.
dfdatetime/time_elements.py
def _CopyFromDateTimeValues(self, date_time_values): """Copies time elements from date and time values. Args: date_time_values (dict[str, int]): date and time values, such as year, month, day of month, hours, minutes, seconds, microseconds. Raises: ValueError: if no helper can be cr...
def _CopyFromDateTimeValues(self, date_time_values): """Copies time elements from date and time values. Args: date_time_values (dict[str, int]): date and time values, such as year, month, day of month, hours, minutes, seconds, microseconds. Raises: ValueError: if no helper can be cr...
[ "Copies", "time", "elements", "from", "date", "and", "time", "values", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L465-L495
[ "def", "_CopyFromDateTimeValues", "(", "self", ",", "date_time_values", ")", ":", "year", "=", "date_time_values", ".", "get", "(", "'year'", ",", "0", ")", "month", "=", "date_time_values", ".", "get", "(", "'month'", ",", "0", ")", "day_of_month", "=", "...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElementsWithFractionOfSecond.CopyFromStringTuple
Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes, seconds and fraction of seconds. Raises: ValueError: if the time elemen...
dfdatetime/time_elements.py
def CopyFromStringTuple(self, time_elements_tuple): """Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes, seconds and fraction of...
def CopyFromStringTuple(self, time_elements_tuple): """Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes, seconds and fraction of...
[ "Copies", "time", "elements", "from", "string", "-", "based", "time", "elements", "tuple", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L497-L526
[ "def", "CopyFromStringTuple", "(", "self", ",", "time_elements_tuple", ")", ":", "if", "len", "(", "time_elements_tuple", ")", "<", "7", ":", "raise", "ValueError", "(", "(", "'Invalid time elements tuple at least 7 elements required,'", "'got: {0:d}'", ")", ".", "for...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElementsWithFractionOfSecond.CopyToDateTimeString
Copies the time elements to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss" or "YYYY-MM-DD hh:mm:ss.######" or None if time elements are missing. Raises: ValueError: if the precision value is unsupported.
dfdatetime/time_elements.py
def CopyToDateTimeString(self): """Copies the time elements to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss" or "YYYY-MM-DD hh:mm:ss.######" or None if time elements are missing. Raises: ValueError: if the precision value is unsupported...
def CopyToDateTimeString(self): """Copies the time elements to a date and time string. Returns: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss" or "YYYY-MM-DD hh:mm:ss.######" or None if time elements are missing. Raises: ValueError: if the precision value is unsupported...
[ "Copies", "the", "time", "elements", "to", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L528-L545
[ "def", "CopyToDateTimeString", "(", "self", ")", ":", "if", "self", ".", "_number_of_seconds", "is", "None", "or", "self", ".", "fraction_of_second", "is", "None", ":", "return", "None", "precision_helper", "=", "precisions", ".", "PrecisionHelperFactory", ".", ...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElementsInMilliseconds.CopyFromStringTuple
Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes, seconds and milliseconds. Raises: ValueError: if the time elements tupl...
dfdatetime/time_elements.py
def CopyFromStringTuple(self, time_elements_tuple): """Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes, seconds and millisecond...
def CopyFromStringTuple(self, time_elements_tuple): """Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes, seconds and millisecond...
[ "Copies", "time", "elements", "from", "string", "-", "based", "time", "elements", "tuple", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L597-L632
[ "def", "CopyFromStringTuple", "(", "self", ",", "time_elements_tuple", ")", ":", "if", "len", "(", "time_elements_tuple", ")", "<", "7", ":", "raise", "ValueError", "(", "(", "'Invalid time elements tuple at least 7 elements required,'", "'got: {0:d}'", ")", ".", "for...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
TimeElementsInMicroseconds.CopyFromStringTuple
Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes, seconds and microseconds. Raises: ValueError: if the time elements tupl...
dfdatetime/time_elements.py
def CopyFromStringTuple(self, time_elements_tuple): """Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes, seconds and microsecond...
def CopyFromStringTuple(self, time_elements_tuple): """Copies time elements from string-based time elements tuple. Args: time_elements_tuple (Optional[tuple[str, str, str, str, str, str, str]]): time elements, contains year, month, day of month, hours, minutes, seconds and microsecond...
[ "Copies", "time", "elements", "from", "string", "-", "based", "time", "elements", "tuple", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/time_elements.py#L684-L719
[ "def", "CopyFromStringTuple", "(", "self", ",", "time_elements_tuple", ")", ":", "if", "len", "(", "time_elements_tuple", ")", "<", "7", ":", "raise", "ValueError", "(", "(", "'Invalid time elements tuple at least 7 elements required,'", "'got: {0:d}'", ")", ".", "for...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
Systemtime._GetNormalizedTimestamp
Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cannot be determined.
dfdatetime/systemtime.py
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
def _GetNormalizedTimestamp(self): """Retrieves the normalized timestamp. Returns: decimal.Decimal: normalized timestamp, which contains the number of seconds since January 1, 1970 00:00:00 and a fraction of second used for increased precision, or None if the normalized timestamp cann...
[ "Retrieves", "the", "normalized", "timestamp", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/systemtime.py#L109-L125
[ "def", "_GetNormalizedTimestamp", "(", "self", ")", ":", "if", "self", ".", "_normalized_timestamp", "is", "None", ":", "if", "self", ".", "_number_of_seconds", "is", "not", "None", ":", "self", ".", "_normalized_timestamp", "=", "(", "decimal", ".", "Decimal"...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
Systemtime.CopyFromDateTimeString
Copies a SYSTEMTIME structure from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fraction can be either 3 or 6 digits. The time of day, second...
dfdatetime/systemtime.py
def CopyFromDateTimeString(self, time_string): """Copies a SYSTEMTIME structure from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fractio...
def CopyFromDateTimeString(self, time_string): """Copies a SYSTEMTIME structure from a date and time string. Args: time_string (str): date and time value formatted as: YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds fractio...
[ "Copies", "a", "SYSTEMTIME", "structure", "from", "a", "date", "and", "time", "string", "." ]
log2timeline/dfdatetime
python
https://github.com/log2timeline/dfdatetime/blob/141ca4ef1eff3d354b5deaac3d81cb08506f98d6/dfdatetime/systemtime.py#L127-L172
[ "def", "CopyFromDateTimeString", "(", "self", ",", "time_string", ")", ":", "date_time_values", "=", "self", ".", "_CopyDateTimeFromString", "(", "time_string", ")", "year", "=", "date_time_values", ".", "get", "(", "'year'", ",", "0", ")", "month", "=", "date...
141ca4ef1eff3d354b5deaac3d81cb08506f98d6
train
SMSBackend.send_messages
Redirect messages to the dummy outbox
smsish/sms/backends/locmem.py
def send_messages(self, messages): """Redirect messages to the dummy outbox""" msg_count = 0 for message in messages: # .message() triggers header validation message.message() msg_count += 1 mail.outbox.extend(messages) return msg_count
def send_messages(self, messages): """Redirect messages to the dummy outbox""" msg_count = 0 for message in messages: # .message() triggers header validation message.message() msg_count += 1 mail.outbox.extend(messages) return msg_count
[ "Redirect", "messages", "to", "the", "dummy", "outbox" ]
RyanBalfanz/django-smsish
python
https://github.com/RyanBalfanz/django-smsish/blob/4d450e3d217cea9e373f16c5e4f0beb3218bd5c9/smsish/sms/backends/locmem.py#L20-L27
[ "def", "send_messages", "(", "self", ",", "messages", ")", ":", "msg_count", "=", "0", "for", "message", "in", "messages", ":", "# .message() triggers header validation", "message", ".", "message", "(", ")", "msg_count", "+=", "1", "mail", ".", "outbox", ".", ...
4d450e3d217cea9e373f16c5e4f0beb3218bd5c9
train
MultiLangTemplateField._prepare_template
This is a copy of CharField.prepare_template, except that it adds a fake request to the context, which is mainly needed to render CMS placeholders
cms_search/search_helpers/fields.py
def _prepare_template(self, obj, needs_request=False): """ This is a copy of CharField.prepare_template, except that it adds a fake request to the context, which is mainly needed to render CMS placeholders """ if self.instance_name is None and self.template_name is None: ...
def _prepare_template(self, obj, needs_request=False): """ This is a copy of CharField.prepare_template, except that it adds a fake request to the context, which is mainly needed to render CMS placeholders """ if self.instance_name is None and self.template_name is None: ...
[ "This", "is", "a", "copy", "of", "CharField", ".", "prepare_template", "except", "that", "it", "adds", "a", "fake", "request", "to", "the", "context", "which", "is", "mainly", "needed", "to", "render", "CMS", "placeholders" ]
beniwohli/django-cms-search
python
https://github.com/beniwohli/django-cms-search/blob/57a1508fabd2285252b8f7e8ff778f2b7c2f3656/cms_search/search_helpers/fields.py#L31-L53
[ "def", "_prepare_template", "(", "self", ",", "obj", ",", "needs_request", "=", "False", ")", ":", "if", "self", ".", "instance_name", "is", "None", "and", "self", ".", "template_name", "is", "None", ":", "raise", "SearchFieldError", "(", "\"This field require...
57a1508fabd2285252b8f7e8ff778f2b7c2f3656
train
GetTransFieldTag.get_value
gets the translated value of field name. If `FALLBACK`evaluates to `True` and the field has no translation for the current language, it tries to find a fallback value, using the languages defined in `settings.LANGUAGES`.
cms_search/search_helpers/templatetags/cms_search_tags.py
def get_value(self, context, obj, field_name): """ gets the translated value of field name. If `FALLBACK`evaluates to `True` and the field has no translation for the current language, it tries to find a fallback value, using the languages defined in `settings.LANGUAGES`. """ ...
def get_value(self, context, obj, field_name): """ gets the translated value of field name. If `FALLBACK`evaluates to `True` and the field has no translation for the current language, it tries to find a fallback value, using the languages defined in `settings.LANGUAGES`. """ ...
[ "gets", "the", "translated", "value", "of", "field", "name", ".", "If", "FALLBACK", "evaluates", "to", "True", "and", "the", "field", "has", "no", "translation", "for", "the", "current", "language", "it", "tries", "to", "find", "a", "fallback", "value", "u...
beniwohli/django-cms-search
python
https://github.com/beniwohli/django-cms-search/blob/57a1508fabd2285252b8f7e8ff778f2b7c2f3656/cms_search/search_helpers/templatetags/cms_search_tags.py#L29-L57
[ "def", "get_value", "(", "self", ",", "context", ",", "obj", ",", "field_name", ")", ":", "try", ":", "language", "=", "get_language", "(", ")", "value", "=", "self", ".", "get_translated_value", "(", "obj", ",", "field_name", ",", "language", ")", "if",...
57a1508fabd2285252b8f7e8ff778f2b7c2f3656
train
customWalker
A convenience function to ease debugging. It will print the node structure that's returned from CommonMark The usage would be something like: >>> content = Parser().parse('Some big text block\n===================\n\nwith content\n') >>> customWalker(content) document heading text S...
sphinxarg/markdown.py
def customWalker(node, space=''): """ A convenience function to ease debugging. It will print the node structure that's returned from CommonMark The usage would be something like: >>> content = Parser().parse('Some big text block\n===================\n\nwith content\n') >>> customWalker(content) ...
def customWalker(node, space=''): """ A convenience function to ease debugging. It will print the node structure that's returned from CommonMark The usage would be something like: >>> content = Parser().parse('Some big text block\n===================\n\nwith content\n') >>> customWalker(content) ...
[ "A", "convenience", "function", "to", "ease", "debugging", ".", "It", "will", "print", "the", "node", "structure", "that", "s", "returned", "from", "CommonMark" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L13-L44
[ "def", "customWalker", "(", "node", ",", "space", "=", "''", ")", ":", "txt", "=", "''", "try", ":", "txt", "=", "node", ".", "literal", "except", ":", "pass", "if", "txt", "is", "None", "or", "txt", "==", "''", ":", "print", "(", "'{}{}'", ".", ...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
paragraph
Process a paragraph, which includes all content under it
sphinxarg/markdown.py
def paragraph(node): """ Process a paragraph, which includes all content under it """ text = '' if node.string_content is not None: text = node.string_content o = nodes.paragraph('', ' '.join(text)) o.line = node.sourcepos[0][0] for n in MarkDown(node): o.append(n) r...
def paragraph(node): """ Process a paragraph, which includes all content under it """ text = '' if node.string_content is not None: text = node.string_content o = nodes.paragraph('', ' '.join(text)) o.line = node.sourcepos[0][0] for n in MarkDown(node): o.append(n) r...
[ "Process", "a", "paragraph", "which", "includes", "all", "content", "under", "it" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L47-L59
[ "def", "paragraph", "(", "node", ")", ":", "text", "=", "''", "if", "node", ".", "string_content", "is", "not", "None", ":", "text", "=", "node", ".", "string_content", "o", "=", "nodes", ".", "paragraph", "(", "''", ",", "' '", ".", "join", "(", "...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
reference
A hyperlink. Note that alt text doesn't work, since there's no apparent way to do that in docutils
sphinxarg/markdown.py
def reference(node): """ A hyperlink. Note that alt text doesn't work, since there's no apparent way to do that in docutils """ o = nodes.reference() o['refuri'] = node.destination if node.title: o['name'] = node.title for n in MarkDown(node): o += n return o
def reference(node): """ A hyperlink. Note that alt text doesn't work, since there's no apparent way to do that in docutils """ o = nodes.reference() o['refuri'] = node.destination if node.title: o['name'] = node.title for n in MarkDown(node): o += n return o
[ "A", "hyperlink", ".", "Note", "that", "alt", "text", "doesn", "t", "work", "since", "there", "s", "no", "apparent", "way", "to", "do", "that", "in", "docutils" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L83-L93
[ "def", "reference", "(", "node", ")", ":", "o", "=", "nodes", ".", "reference", "(", ")", "o", "[", "'refuri'", "]", "=", "node", ".", "destination", "if", "node", ".", "title", ":", "o", "[", "'name'", "]", "=", "node", ".", "title", "for", "n",...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
emphasis
An italicized section
sphinxarg/markdown.py
def emphasis(node): """ An italicized section """ o = nodes.emphasis() for n in MarkDown(node): o += n return o
def emphasis(node): """ An italicized section """ o = nodes.emphasis() for n in MarkDown(node): o += n return o
[ "An", "italicized", "section" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L96-L103
[ "def", "emphasis", "(", "node", ")", ":", "o", "=", "nodes", ".", "emphasis", "(", ")", "for", "n", "in", "MarkDown", "(", "node", ")", ":", "o", "+=", "n", "return", "o" ]
178672cd5c846440ff7ecd695e3708feea13e4b4
train
strong
A bolded section
sphinxarg/markdown.py
def strong(node): """ A bolded section """ o = nodes.strong() for n in MarkDown(node): o += n return o
def strong(node): """ A bolded section """ o = nodes.strong() for n in MarkDown(node): o += n return o
[ "A", "bolded", "section" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L106-L113
[ "def", "strong", "(", "node", ")", ":", "o", "=", "nodes", ".", "strong", "(", ")", "for", "n", "in", "MarkDown", "(", "node", ")", ":", "o", "+=", "n", "return", "o" ]
178672cd5c846440ff7ecd695e3708feea13e4b4
train
literal
Inline code
sphinxarg/markdown.py
def literal(node): """ Inline code """ rendered = [] try: if node.info is not None: l = Lexer(node.literal, node.info, tokennames="long") for _ in l: rendered.append(node.inline(classes=_[0], text=_[1])) except: pass classes = ['code']...
def literal(node): """ Inline code """ rendered = [] try: if node.info is not None: l = Lexer(node.literal, node.info, tokennames="long") for _ in l: rendered.append(node.inline(classes=_[0], text=_[1])) except: pass classes = ['code']...
[ "Inline", "code" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L116-L141
[ "def", "literal", "(", "node", ")", ":", "rendered", "=", "[", "]", "try", ":", "if", "node", ".", "info", "is", "not", "None", ":", "l", "=", "Lexer", "(", "node", ".", "literal", ",", "node", ".", "info", ",", "tokennames", "=", "\"long\"", ")"...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
raw
Add some raw html (possibly as a block)
sphinxarg/markdown.py
def raw(node): """ Add some raw html (possibly as a block) """ o = nodes.raw(node.literal, node.literal, format='html') if node.sourcepos is not None: o.line = node.sourcepos[0][0] for n in MarkDown(node): o += n return o
def raw(node): """ Add some raw html (possibly as a block) """ o = nodes.raw(node.literal, node.literal, format='html') if node.sourcepos is not None: o.line = node.sourcepos[0][0] for n in MarkDown(node): o += n return o
[ "Add", "some", "raw", "html", "(", "possibly", "as", "a", "block", ")" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L173-L182
[ "def", "raw", "(", "node", ")", ":", "o", "=", "nodes", ".", "raw", "(", "node", ".", "literal", ",", "node", ".", "literal", ",", "format", "=", "'html'", ")", "if", "node", ".", "sourcepos", "is", "not", "None", ":", "o", ".", "line", "=", "n...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
title
A title node. It has no children
sphinxarg/markdown.py
def title(node): """ A title node. It has no children """ return nodes.title(node.first_child.literal, node.first_child.literal)
def title(node): """ A title node. It has no children """ return nodes.title(node.first_child.literal, node.first_child.literal)
[ "A", "title", "node", ".", "It", "has", "no", "children" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L192-L196
[ "def", "title", "(", "node", ")", ":", "return", "nodes", ".", "title", "(", "node", ".", "first_child", ".", "literal", ",", "node", ".", "first_child", ".", "literal", ")" ]
178672cd5c846440ff7ecd695e3708feea13e4b4
train
section
A section in reStructuredText, which needs a title (the first child) This is a custom type
sphinxarg/markdown.py
def section(node): """ A section in reStructuredText, which needs a title (the first child) This is a custom type """ title = '' # All sections need an id if node.first_child is not None: if node.first_child.t == u'heading': title = node.first_child.first_child.literal o...
def section(node): """ A section in reStructuredText, which needs a title (the first child) This is a custom type """ title = '' # All sections need an id if node.first_child is not None: if node.first_child.t == u'heading': title = node.first_child.first_child.literal o...
[ "A", "section", "in", "reStructuredText", "which", "needs", "a", "title", "(", "the", "first", "child", ")", "This", "is", "a", "custom", "type" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L199-L211
[ "def", "section", "(", "node", ")", ":", "title", "=", "''", "# All sections need an id", "if", "node", ".", "first_child", "is", "not", "None", ":", "if", "node", ".", "first_child", ".", "t", "==", "u'heading'", ":", "title", "=", "node", ".", "first_c...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
block_quote
A block quote
sphinxarg/markdown.py
def block_quote(node): """ A block quote """ o = nodes.block_quote() o.line = node.sourcepos[0][0] for n in MarkDown(node): o += n return o
def block_quote(node): """ A block quote """ o = nodes.block_quote() o.line = node.sourcepos[0][0] for n in MarkDown(node): o += n return o
[ "A", "block", "quote" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L214-L222
[ "def", "block_quote", "(", "node", ")", ":", "o", "=", "nodes", ".", "block_quote", "(", ")", "o", ".", "line", "=", "node", ".", "sourcepos", "[", "0", "]", "[", "0", "]", "for", "n", "in", "MarkDown", "(", "node", ")", ":", "o", "+=", "n", ...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
image
An image element The first child is the alt text. reStructuredText can't handle titles
sphinxarg/markdown.py
def image(node): """ An image element The first child is the alt text. reStructuredText can't handle titles """ o = nodes.image(uri=node.destination) if node.first_child is not None: o['alt'] = node.first_child.literal return o
def image(node): """ An image element The first child is the alt text. reStructuredText can't handle titles """ o = nodes.image(uri=node.destination) if node.first_child is not None: o['alt'] = node.first_child.literal return o
[ "An", "image", "element" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L225-L234
[ "def", "image", "(", "node", ")", ":", "o", "=", "nodes", ".", "image", "(", "uri", "=", "node", ".", "destination", ")", "if", "node", ".", "first_child", "is", "not", "None", ":", "o", "[", "'alt'", "]", "=", "node", ".", "first_child", ".", "l...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
listItem
An item in a list
sphinxarg/markdown.py
def listItem(node): """ An item in a list """ o = nodes.list_item() for n in MarkDown(node): o += n return o
def listItem(node): """ An item in a list """ o = nodes.list_item() for n in MarkDown(node): o += n return o
[ "An", "item", "in", "a", "list" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L237-L244
[ "def", "listItem", "(", "node", ")", ":", "o", "=", "nodes", ".", "list_item", "(", ")", "for", "n", "in", "MarkDown", "(", "node", ")", ":", "o", "+=", "n", "return", "o" ]
178672cd5c846440ff7ecd695e3708feea13e4b4
train
listNode
A list (numbered or not) For numbered lists, the suffix is only rendered as . in html
sphinxarg/markdown.py
def listNode(node): """ A list (numbered or not) For numbered lists, the suffix is only rendered as . in html """ if node.list_data['type'] == u'bullet': o = nodes.bullet_list(bullet=node.list_data['bullet_char']) else: o = nodes.enumerated_list(suffix=node.list_data['delimiter']...
def listNode(node): """ A list (numbered or not) For numbered lists, the suffix is only rendered as . in html """ if node.list_data['type'] == u'bullet': o = nodes.bullet_list(bullet=node.list_data['bullet_char']) else: o = nodes.enumerated_list(suffix=node.list_data['delimiter']...
[ "A", "list", "(", "numbered", "or", "not", ")", "For", "numbered", "lists", "the", "suffix", "is", "only", "rendered", "as", ".", "in", "html" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L247-L258
[ "def", "listNode", "(", "node", ")", ":", "if", "node", ".", "list_data", "[", "'type'", "]", "==", "u'bullet'", ":", "o", "=", "nodes", ".", "bullet_list", "(", "bullet", "=", "node", ".", "list_data", "[", "'bullet_char'", "]", ")", "else", ":", "o...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
MarkDown
Returns a list of nodes, containing CommonMark nodes converted to docutils nodes
sphinxarg/markdown.py
def MarkDown(node): """ Returns a list of nodes, containing CommonMark nodes converted to docutils nodes """ cur = node.first_child # Go into each child, in turn output = [] while cur is not None: t = cur.t if t == 'paragraph': output.append(paragraph(cur)) ...
def MarkDown(node): """ Returns a list of nodes, containing CommonMark nodes converted to docutils nodes """ cur = node.first_child # Go into each child, in turn output = [] while cur is not None: t = cur.t if t == 'paragraph': output.append(paragraph(cur)) ...
[ "Returns", "a", "list", "of", "nodes", "containing", "CommonMark", "nodes", "converted", "to", "docutils", "nodes" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L261-L311
[ "def", "MarkDown", "(", "node", ")", ":", "cur", "=", "node", ".", "first_child", "# Go into each child, in turn", "output", "=", "[", "]", "while", "cur", "is", "not", "None", ":", "t", "=", "cur", ".", "t", "if", "t", "==", "'paragraph'", ":", "outpu...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
finalizeSection
Correct the nxt and parent for each child
sphinxarg/markdown.py
def finalizeSection(section): """ Correct the nxt and parent for each child """ cur = section.first_child last = section.last_child if last is not None: last.nxt = None while cur is not None: cur.parent = section cur = cur.nxt
def finalizeSection(section): """ Correct the nxt and parent for each child """ cur = section.first_child last = section.last_child if last is not None: last.nxt = None while cur is not None: cur.parent = section cur = cur.nxt
[ "Correct", "the", "nxt", "and", "parent", "for", "each", "child" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L314-L325
[ "def", "finalizeSection", "(", "section", ")", ":", "cur", "=", "section", ".", "first_child", "last", "=", "section", ".", "last_child", "if", "last", "is", "not", "None", ":", "last", ".", "nxt", "=", "None", "while", "cur", "is", "not", "None", ":",...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
nestSections
Sections aren't handled by CommonMark at the moment. This function adds sections to a block of nodes. 'title' nodes with an assigned level below 'level' will be put in a child section. If there are no child nodes with titles of level 'level' then nothing is done
sphinxarg/markdown.py
def nestSections(block, level=1): """ Sections aren't handled by CommonMark at the moment. This function adds sections to a block of nodes. 'title' nodes with an assigned level below 'level' will be put in a child section. If there are no child nodes with titles of level 'level' then nothing is done...
def nestSections(block, level=1): """ Sections aren't handled by CommonMark at the moment. This function adds sections to a block of nodes. 'title' nodes with an assigned level below 'level' will be put in a child section. If there are no child nodes with titles of level 'level' then nothing is done...
[ "Sections", "aren", "t", "handled", "by", "CommonMark", "at", "the", "moment", ".", "This", "function", "adds", "sections", "to", "a", "block", "of", "nodes", ".", "title", "nodes", "with", "an", "assigned", "level", "below", "level", "will", "be", "put", ...
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L328-L390
[ "def", "nestSections", "(", "block", ",", "level", "=", "1", ")", ":", "cur", "=", "block", ".", "first_child", "if", "cur", "is", "not", "None", ":", "children", "=", "[", "]", "# Do we need to do anything?", "nest", "=", "False", "while", "cur", "is", ...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
parseMarkDownBlock
Parses a block of text, returning a list of docutils nodes >>> parseMarkdownBlock("Some\n====\n\nblock of text\n\nHeader\n======\n\nblah\n") []
sphinxarg/markdown.py
def parseMarkDownBlock(text): """ Parses a block of text, returning a list of docutils nodes >>> parseMarkdownBlock("Some\n====\n\nblock of text\n\nHeader\n======\n\nblah\n") [] """ block = Parser().parse(text) # CommonMark can't nest sections, so do it manually nestSections(block) ...
def parseMarkDownBlock(text): """ Parses a block of text, returning a list of docutils nodes >>> parseMarkdownBlock("Some\n====\n\nblock of text\n\nHeader\n======\n\nblah\n") [] """ block = Parser().parse(text) # CommonMark can't nest sections, so do it manually nestSections(block) ...
[ "Parses", "a", "block", "of", "text", "returning", "a", "list", "of", "docutils", "nodes" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/markdown.py#L393-L404
[ "def", "parseMarkDownBlock", "(", "text", ")", ":", "block", "=", "Parser", "(", ")", ".", "parse", "(", "text", ")", "# CommonMark can't nest sections, so do it manually", "nestSections", "(", "block", ")", "return", "MarkDown", "(", "block", ")" ]
178672cd5c846440ff7ecd695e3708feea13e4b4
train
renderList
Given a list of reStructuredText or MarkDown sections, return a docutils node list
sphinxarg/ext.py
def renderList(l, markDownHelp, settings=None): """ Given a list of reStructuredText or MarkDown sections, return a docutils node list """ if len(l) == 0: return [] if markDownHelp: from sphinxarg.markdown import parseMarkDownBlock return parseMarkDownBlock('\n\n'.join(l) + '...
def renderList(l, markDownHelp, settings=None): """ Given a list of reStructuredText or MarkDown sections, return a docutils node list """ if len(l) == 0: return [] if markDownHelp: from sphinxarg.markdown import parseMarkDownBlock return parseMarkDownBlock('\n\n'.join(l) + '...
[ "Given", "a", "list", "of", "reStructuredText", "or", "MarkDown", "sections", "return", "a", "docutils", "node", "list" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/ext.py#L54-L75
[ "def", "renderList", "(", "l", ",", "markDownHelp", ",", "settings", "=", "None", ")", ":", "if", "len", "(", "l", ")", "==", "0", ":", "return", "[", "]", "if", "markDownHelp", ":", "from", "sphinxarg", ".", "markdown", "import", "parseMarkDownBlock", ...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
print_action_groups
Process all 'action groups', which are also include 'Options' and 'Required arguments'. A list of nodes is returned.
sphinxarg/ext.py
def print_action_groups(data, nested_content, markDownHelp=False, settings=None): """ Process all 'action groups', which are also include 'Options' and 'Required arguments'. A list of nodes is returned. """ definitions = map_nested_definitions(nested_content) nodes_list = [] if 'action_group...
def print_action_groups(data, nested_content, markDownHelp=False, settings=None): """ Process all 'action groups', which are also include 'Options' and 'Required arguments'. A list of nodes is returned. """ definitions = map_nested_definitions(nested_content) nodes_list = [] if 'action_group...
[ "Process", "all", "action", "groups", "which", "are", "also", "include", "Options", "and", "Required", "arguments", ".", "A", "list", "of", "nodes", "is", "returned", "." ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/ext.py#L78-L162
[ "def", "print_action_groups", "(", "data", ",", "nested_content", ",", "markDownHelp", "=", "False", ",", "settings", "=", "None", ")", ":", "definitions", "=", "map_nested_definitions", "(", "nested_content", ")", "nodes_list", "=", "[", "]", "if", "'action_gro...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
print_subcommands
Each subcommand is a dictionary with the following keys: ['usage', 'action_groups', 'bare_usage', 'name', 'help'] In essence, this is all tossed in a new section with the title 'name'. Apparently there can also be a 'description' entry.
sphinxarg/ext.py
def print_subcommands(data, nested_content, markDownHelp=False, settings=None): """ Each subcommand is a dictionary with the following keys: ['usage', 'action_groups', 'bare_usage', 'name', 'help'] In essence, this is all tossed in a new section with the title 'name'. Apparently there can also be ...
def print_subcommands(data, nested_content, markDownHelp=False, settings=None): """ Each subcommand is a dictionary with the following keys: ['usage', 'action_groups', 'bare_usage', 'name', 'help'] In essence, this is all tossed in a new section with the title 'name'. Apparently there can also be ...
[ "Each", "subcommand", "is", "a", "dictionary", "with", "the", "following", "keys", ":" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/ext.py#L165-L221
[ "def", "print_subcommands", "(", "data", ",", "nested_content", ",", "markDownHelp", "=", "False", ",", "settings", "=", "None", ")", ":", "definitions", "=", "map_nested_definitions", "(", "nested_content", ")", "items", "=", "[", "]", "if", "'children'", "in...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
ensureUniqueIDs
If action groups are repeated, then links in the table of contents will just go to the first of the repeats. This may not be desirable, particularly in the case of subcommands where the option groups have different members. This function updates the title IDs by adding _repeatX, where X is a number so t...
sphinxarg/ext.py
def ensureUniqueIDs(items): """ If action groups are repeated, then links in the table of contents will just go to the first of the repeats. This may not be desirable, particularly in the case of subcommands where the option groups have different members. This function updates the title IDs by addin...
def ensureUniqueIDs(items): """ If action groups are repeated, then links in the table of contents will just go to the first of the repeats. This may not be desirable, particularly in the case of subcommands where the option groups have different members. This function updates the title IDs by addin...
[ "If", "action", "groups", "are", "repeated", "then", "links", "in", "the", "table", "of", "contents", "will", "just", "go", "to", "the", "first", "of", "the", "repeats", ".", "This", "may", "not", "be", "desirable", "particularly", "in", "the", "case", "...
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/ext.py#L224-L246
[ "def", "ensureUniqueIDs", "(", "items", ")", ":", "s", "=", "set", "(", ")", "for", "item", "in", "items", ":", "for", "n", "in", "item", ".", "traverse", "(", "descend", "=", "True", ",", "siblings", "=", "True", ",", "ascend", "=", "False", ")", ...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
ArgParseDirective._construct_manpage_specific_structure
Construct a typical man page consisting of the following elements: NAME (automatically generated, out of our control) SYNOPSIS DESCRIPTION OPTIONS FILES SEE ALSO BUGS
sphinxarg/ext.py
def _construct_manpage_specific_structure(self, parser_info): """ Construct a typical man page consisting of the following elements: NAME (automatically generated, out of our control) SYNOPSIS DESCRIPTION OPTIONS FILES SEE ALSO ...
def _construct_manpage_specific_structure(self, parser_info): """ Construct a typical man page consisting of the following elements: NAME (automatically generated, out of our control) SYNOPSIS DESCRIPTION OPTIONS FILES SEE ALSO ...
[ "Construct", "a", "typical", "man", "page", "consisting", "of", "the", "following", "elements", ":", "NAME", "(", "automatically", "generated", "out", "of", "our", "control", ")", "SYNOPSIS", "DESCRIPTION", "OPTIONS", "FILES", "SEE", "ALSO", "BUGS" ]
ribozz/sphinx-argparse
python
https://github.com/ribozz/sphinx-argparse/blob/178672cd5c846440ff7ecd695e3708feea13e4b4/sphinxarg/ext.py#L258-L343
[ "def", "_construct_manpage_specific_structure", "(", "self", ",", "parser_info", ")", ":", "items", "=", "[", "]", "# SYNOPSIS section", "synopsis_section", "=", "nodes", ".", "section", "(", "''", ",", "nodes", ".", "title", "(", "text", "=", "'Synopsis'", ")...
178672cd5c846440ff7ecd695e3708feea13e4b4
train
FocusSelector.select
Select an arbitrary item, by possition or by reference.
GUI/vracabulous.py
def select(self, item): """Select an arbitrary item, by possition or by reference.""" self._on_unselect[self._selected]() self.selected().unfocus() if isinstance(item, int): self._selected = item % len(self) else: self._selected = self.items.index(item) ...
def select(self, item): """Select an arbitrary item, by possition or by reference.""" self._on_unselect[self._selected]() self.selected().unfocus() if isinstance(item, int): self._selected = item % len(self) else: self._selected = self.items.index(item) ...
[ "Select", "an", "arbitrary", "item", "by", "possition", "or", "by", "reference", "." ]
ddorn/GUI
python
https://github.com/ddorn/GUI/blob/e1fcb5286d24e0995f280d5180222e51895c368c/GUI/vracabulous.py#L71-L82
[ "def", "select", "(", "self", ",", "item", ")", ":", "self", ".", "_on_unselect", "[", "self", ".", "_selected", "]", "(", ")", "self", ".", "selected", "(", ")", ".", "unfocus", "(", ")", "if", "isinstance", "(", "item", ",", "int", ")", ":", "s...
e1fcb5286d24e0995f280d5180222e51895c368c
train
FocusSelector.on_select
Add an action to make when an object is selected. Only one action can be stored this way.
GUI/vracabulous.py
def on_select(self, item, action): """ Add an action to make when an object is selected. Only one action can be stored this way. """ if not isinstance(item, int): item = self.items.index(item) self._on_select[item] = action
def on_select(self, item, action): """ Add an action to make when an object is selected. Only one action can be stored this way. """ if not isinstance(item, int): item = self.items.index(item) self._on_select[item] = action
[ "Add", "an", "action", "to", "make", "when", "an", "object", "is", "selected", ".", "Only", "one", "action", "can", "be", "stored", "this", "way", "." ]
ddorn/GUI
python
https://github.com/ddorn/GUI/blob/e1fcb5286d24e0995f280d5180222e51895c368c/GUI/vracabulous.py#L96-L105
[ "def", "on_select", "(", "self", ",", "item", ",", "action", ")", ":", "if", "not", "isinstance", "(", "item", ",", "int", ")", ":", "item", "=", "self", ".", "items", ".", "index", "(", "item", ")", "self", ".", "_on_select", "[", "item", "]", "...
e1fcb5286d24e0995f280d5180222e51895c368c
train
FocusSelector.on_unselect
Add an action to make when an object is unfocused.
GUI/vracabulous.py
def on_unselect(self, item, action): """Add an action to make when an object is unfocused.""" if not isinstance(item, int): item = self.items.index(item) self._on_unselect[item] = action
def on_unselect(self, item, action): """Add an action to make when an object is unfocused.""" if not isinstance(item, int): item = self.items.index(item) self._on_unselect[item] = action
[ "Add", "an", "action", "to", "make", "when", "an", "object", "is", "unfocused", "." ]
ddorn/GUI
python
https://github.com/ddorn/GUI/blob/e1fcb5286d24e0995f280d5180222e51895c368c/GUI/vracabulous.py#L107-L112
[ "def", "on_unselect", "(", "self", ",", "item", ",", "action", ")", ":", "if", "not", "isinstance", "(", "item", ",", "int", ")", ":", "item", "=", "self", ".", "items", ".", "index", "(", "item", ")", "self", ".", "_on_unselect", "[", "item", "]",...
e1fcb5286d24e0995f280d5180222e51895c368c
train
Window.add
Add a widget to the widows. The widget will auto render. You can use the function like that if you want to keep the widget accecible : self.my_widget = self.add(my_widget)
GUI/vracabulous.py
def add(self, widget, condition=lambda: 42): """ Add a widget to the widows. The widget will auto render. You can use the function like that if you want to keep the widget accecible : self.my_widget = self.add(my_widget) """ assert callable(condition) assert...
def add(self, widget, condition=lambda: 42): """ Add a widget to the widows. The widget will auto render. You can use the function like that if you want to keep the widget accecible : self.my_widget = self.add(my_widget) """ assert callable(condition) assert...
[ "Add", "a", "widget", "to", "the", "widows", "." ]
ddorn/GUI
python
https://github.com/ddorn/GUI/blob/e1fcb5286d24e0995f280d5180222e51895c368c/GUI/vracabulous.py#L228-L240
[ "def", "add", "(", "self", ",", "widget", ",", "condition", "=", "lambda", ":", "42", ")", ":", "assert", "callable", "(", "condition", ")", "assert", "isinstance", "(", "widget", ",", "BaseWidget", ")", "self", ".", "_widgets", ".", "append", "(", "("...
e1fcb5286d24e0995f280d5180222e51895c368c
train
Window.remove
Remove a widget from the window.
GUI/vracabulous.py
def remove(self, widget): """Remove a widget from the window.""" for i, (wid, _) in enumerate(self._widgets): if widget is wid: del self._widgets[i] return True raise ValueError('Widget not in list')
def remove(self, widget): """Remove a widget from the window.""" for i, (wid, _) in enumerate(self._widgets): if widget is wid: del self._widgets[i] return True raise ValueError('Widget not in list')
[ "Remove", "a", "widget", "from", "the", "window", "." ]
ddorn/GUI
python
https://github.com/ddorn/GUI/blob/e1fcb5286d24e0995f280d5180222e51895c368c/GUI/vracabulous.py#L242-L249
[ "def", "remove", "(", "self", ",", "widget", ")", ":", "for", "i", ",", "(", "wid", ",", "_", ")", "in", "enumerate", "(", "self", ".", "_widgets", ")", ":", "if", "widget", "is", "wid", ":", "del", "self", ".", "_widgets", "[", "i", "]", "retu...
e1fcb5286d24e0995f280d5180222e51895c368c
train
Window.update_on_event
Process a single event.
GUI/vracabulous.py
def update_on_event(self, e): """Process a single event.""" if e.type == QUIT: self.running = False elif e.type == KEYDOWN: if e.key == K_ESCAPE: self.running = False elif e.key == K_F4 and e.mod & KMOD_ALT: # Alt+F4 --> quits ...
def update_on_event(self, e): """Process a single event.""" if e.type == QUIT: self.running = False elif e.type == KEYDOWN: if e.key == K_ESCAPE: self.running = False elif e.key == K_F4 and e.mod & KMOD_ALT: # Alt+F4 --> quits ...
[ "Process", "a", "single", "event", "." ]
ddorn/GUI
python
https://github.com/ddorn/GUI/blob/e1fcb5286d24e0995f280d5180222e51895c368c/GUI/vracabulous.py#L251-L265
[ "def", "update_on_event", "(", "self", ",", "e", ")", ":", "if", "e", ".", "type", "==", "QUIT", ":", "self", ".", "running", "=", "False", "elif", "e", ".", "type", "==", "KEYDOWN", ":", "if", "e", ".", "key", "==", "K_ESCAPE", ":", "self", ".",...
e1fcb5286d24e0995f280d5180222e51895c368c
train
Window.update
Get all events and process them by calling update_on_event()
GUI/vracabulous.py
def update(self): """Get all events and process them by calling update_on_event()""" events = pygame.event.get() for e in events: self.update_on_event(e) for wid, cond in self._widgets: if cond(): wid.update(events)
def update(self): """Get all events and process them by calling update_on_event()""" events = pygame.event.get() for e in events: self.update_on_event(e) for wid, cond in self._widgets: if cond(): wid.update(events)
[ "Get", "all", "events", "and", "process", "them", "by", "calling", "update_on_event", "()" ]
ddorn/GUI
python
https://github.com/ddorn/GUI/blob/e1fcb5286d24e0995f280d5180222e51895c368c/GUI/vracabulous.py#L267-L275
[ "def", "update", "(", "self", ")", ":", "events", "=", "pygame", ".", "event", ".", "get", "(", ")", "for", "e", "in", "events", ":", "self", ".", "update_on_event", "(", "e", ")", "for", "wid", ",", "cond", "in", "self", ".", "_widgets", ":", "i...
e1fcb5286d24e0995f280d5180222e51895c368c
train
Window.render
Render the screen. Here you must draw everything.
GUI/vracabulous.py
def render(self): """Render the screen. Here you must draw everything.""" self.screen.fill(self.BACKGROUND_COLOR) for wid, cond in self._widgets: if cond(): wid.render(self.screen) if self.BORDER_COLOR is not None: pygame.draw.rect(self.screen, s...
def render(self): """Render the screen. Here you must draw everything.""" self.screen.fill(self.BACKGROUND_COLOR) for wid, cond in self._widgets: if cond(): wid.render(self.screen) if self.BORDER_COLOR is not None: pygame.draw.rect(self.screen, s...
[ "Render", "the", "screen", ".", "Here", "you", "must", "draw", "everything", "." ]
ddorn/GUI
python
https://github.com/ddorn/GUI/blob/e1fcb5286d24e0995f280d5180222e51895c368c/GUI/vracabulous.py#L277-L289
[ "def", "render", "(", "self", ")", ":", "self", ".", "screen", ".", "fill", "(", "self", ".", "BACKGROUND_COLOR", ")", "for", "wid", ",", "cond", "in", "self", ".", "_widgets", ":", "if", "cond", "(", ")", ":", "wid", ".", "render", "(", "self", ...
e1fcb5286d24e0995f280d5180222e51895c368c