repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
DLR-RM/stable-baselines3 | import collections
import functools
import itertools
import multiprocessing
import os
import warnings
import gymnasium as gym
import numpy as np
import pytest
from gymnasium import spaces
from stable_baselines3 import PPO
from stable_baselines3.common.env_util import make_vec_env
from stable_baselines3.common.monitor... | 0 | assert | numeric_literal | tests/test_vec_envs.py | test_render | 640 | null | |
DLR-RM/stable-baselines3 | import importlib.util
import os
import sys
import time
from collections.abc import Sequence
from io import TextIOBase
from unittest import mock
import gymnasium as gym
import numpy as np
import pytest
import torch as th
from gymnasium import spaces
from matplotlib import pyplot as plt
from pandas.errors import EmptyDa... | 36 | assert | numeric_literal | tests/test_logger.py | test_key_length | 376 | null | |
DLR-RM/stable-baselines3 | import types
import warnings
import gymnasium as gym
import numpy as np
import pytest
from gymnasium import spaces
from stable_baselines3.common.env_checker import check_env
from stable_baselines3.common.envs import (
BitFlippingEnv,
FakeImageEnv,
IdentityEnv,
IdentityEnvBox,
IdentityEnvMultiBinar... | ValueError) | pytest.raises | variable | tests/test_envs.py | test_non_default_action_spaces | 203 | null | |
pimutils/khal | import datetime as dt
import icalendar
from khal.ui.editor import RecurrenceEditor, StartEndEditor
from tests.utils import BERLIN, LOCALE_BERLIN
from .canvas_render import CanvasTranslator
CONF = {'locale': LOCALE_BERLIN, 'keybindings': {}, 'view': {'monthdisplay': 'firstday'}}
START = BERLIN.localize(dt.datetime(... | False | assert | bool_literal | tests/ui/test_editor.py | test_editor | 89 | null | |
pimutils/khal | import datetime as dt
import os.path
import pytest
from tzlocal import get_localzone as _get_localzone
from khal.settings import get_config
from khal.settings.exceptions import CannotParseConfigFileError, InvalidSettingsError
from khal.settings.utils import (
config_checks,
get_all_vdirs,
get_color_from_v... | 'red' | assert | string_literal | tests/settings_test.py | test_is_color | 313 | null | |
pimutils/khal | import datetime as dt
import random
import textwrap
import icalendar
from freezegun import freeze_time
from khal.icalendar import new_vevent, split_ics
from .utils import LOCALE_BERLIN, _get_text, _replace_uid, normalize_component
def _get_TZIDs(lines):
"""from a list of strings, get all unique strings that sta... | sorted(part1) | assert | func_call | tests/icalendar_test.py | test_split_ics | 67 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | 'foobar' | assert | string_literal | tests/controller_test.py | test_import | TestImport | 114 | null |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | khal_list(coll, [], conf, agenda_format=event_format, day_format="") | assert | func_call | tests/controller_test.py | test_new_event | TestGetAgenda | 45 | null |
pimutils/khal | import datetime as dt
from operator import itemgetter
import icalendar
import pytest
from khal.khalendar import backend
from khal.khalendar.exceptions import OutdatedDbVersionError, UpdateFailed
from .utils import BERLIN, LOCALE_BERLIN, _get_text
calname = 'home'
def test_event_recuid_no_master():
"""
test... | 1 | assert | numeric_literal | tests/backend_test.py | test_event_recuid_no_master | 151 | null | |
pimutils/khal | import datetime as dt
import icalendar
from khal.ui.editor import RecurrenceEditor, StartEndEditor
from tests.utils import BERLIN, LOCALE_BERLIN
from .canvas_render import CanvasTranslator
CONF = {'locale': LOCALE_BERLIN, 'keybindings': {}, 'view': {'monthdisplay': 'firstday'}}
START = BERLIN.localize(dt.datetime(... | True | assert | bool_literal | tests/ui/test_editor.py | test_convert_to_date | 131 | null | |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | testList1 | assert | variable | tests/cal_display_test.py | test_get_color_list | 75 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | start_end_from_daterange([], utils.LOCALE_BERLIN) | assert | func_call | tests/controller_test.py | test_start_end_empty | 171 | null | |
pimutils/khal | from khal.terminal import colored, merge_columns
def test_colored():
assert colored('test', 'light cyan') == '\33[1;36mtest\x1b[0m'
assert colored('täst', 'white') == '\33[37mtäst\x1b[0m'
assert colored('täst', 'white', 'dark green') == '\x1b[37m\x1b[42mtäst\x1b[0m'
assert colored('täst', 'light magent... | '\x1b[95m\x1b[102mtäst\x1b[0m' | assert | string_literal | tests/terminal_test.py | test_colored | 11 | null | |
pimutils/khal | import datetime as dt
from collections import OrderedDict
import pytest
from freezegun import freeze_time
from khal.exceptions import DateTimeParseError, FatalError
from khal.icalendar import new_vevent
from khal.parse_datetime import (
construct_daynames,
eventinfofstr,
guessdatetimefstr,
guessrangef... | '-10m' | assert | string_literal | tests/parse_datetime_test.py | test_negative | TestTimeDelta2Str | 82 | null |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | example_de | assert | variable | tests/cal_display_test.py | test_vertical_month_unicode | 357 | null | |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | 'light green' | assert | string_literal | tests/cal_display_test.py | test_get_calendar_color | 59 | null | |
pimutils/khal | import datetime as dt
from collections import OrderedDict
import pytest
from freezegun import freeze_time
from khal.exceptions import DateTimeParseError, FatalError
from khal.icalendar import new_vevent
from khal.parse_datetime import (
construct_daynames,
eventinfofstr,
guessdatetimefstr,
guessrangef... | vevent | assert | variable | tests/parse_datetime_test.py | test__construct_event_format_us | 442 | null | |
pimutils/khal | import datetime as dt
import os.path
import pytest
from tzlocal import get_localzone as _get_localzone
from khal.settings import get_config
from khal.settings.exceptions import CannotParseConfigFileError, InvalidSettingsError
from khal.settings.utils import (
config_checks,
get_all_vdirs,
get_color_from_v... | None | assert | none_literal | tests/settings_test.py | test_broken_color | 179 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | utils.BERLIN.localize(dt.datetime(2015, 6, 2, 16, 0)) | assert | func_call | tests/controller_test.py | test_mix_datetime_types | TestImport | 142 | null |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | 2 | assert | numeric_literal | tests/cal_display_test.py | test_get_color_list | 86 | null | |
pimutils/khal | import datetime as dt
import os.path
import pytest
from tzlocal import get_localzone as _get_localzone
from khal.settings import get_config
from khal.settings.exceptions import CannotParseConfigFileError, InvalidSettingsError
from khal.settings.utils import (
config_checks,
get_all_vdirs,
get_color_from_v... | 'dark blue' | assert | string_literal | tests/settings_test.py | test_is_color | 309 | null | |
pimutils/khal | import datetime as dt
import pytest
import pytz
from freezegun import freeze_time
from hypothesis import event, given
from hypothesis.strategies import datetimes
from icalendar import Parameters, vCalAddress, vRecur, vText
from packaging import version
from khal.controllers import human_formatter
from khal.khalendar.... | [] | assert | collection | tests/event_test.py | test_event_alarm | 536 | null | |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_color_wrap():
text = (
"Lorem ipsum \x1b[31mdolor sit amet, consetetur sadipscing "
"elitr, sed diam nonumy\x1b[0m eirmod tempor"
)
expected = [
"Lorem ipsum \x1b[31mdol... | expected | assert | variable | tests/utils_test.py | test_color_wrap | 61 | null | |
pimutils/khal | import datetime as dt
import os.path
import pytest
from tzlocal import get_localzone as _get_localzone
from khal.settings import get_config
from khal.settings.exceptions import CannotParseConfigFileError, InvalidSettingsError
from khal.settings.utils import (
config_checks,
get_all_vdirs,
get_color_from_v... | '#123456' | assert | string_literal | tests/settings_test.py | test_is_color | 310 | null | |
pimutils/khal | import datetime as dt
import os.path
import pytest
from tzlocal import get_localzone as _get_localzone
from khal.settings import get_config
from khal.settings.exceptions import CannotParseConfigFileError, InvalidSettingsError
from khal.settings.utils import (
config_checks,
get_all_vdirs,
get_color_from_v... | {vdir[len(path):] for vdir in get_all_vdirs(path + '/**/*')} | assert | collection | tests/settings_test.py | test_discover | 193 | null | |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_find_unmatched_sgr():
assert utils.find_unmatched_sgr(weekheader) is None
assert utils.find_unmatched_sgr(today_line) is None
assert utils.find_unmatched_sgr(calendarline) is None
assert ut... | '\x1b[32m' | assert | string_literal | tests/utils_test.py | test_find_unmatched_sgr | 45 | null | |
pimutils/khal | from khal.terminal import colored, merge_columns
def test_colored():
assert colored('test', 'light cyan') == | '\33[1;36mtest\x1b[0m' | assert | string_literal | tests/terminal_test.py | test_colored | 5 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | [ev.start_local for ev in events] | assert | collection | tests/controller_test.py | test_import | TestImport | 116 | null |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | utils.BERLIN.localize(dt.datetime(2015, 5, 30, 16, 0)) | assert | func_call | tests/controller_test.py | test_mix_datetime_types | TestImport | 138 | null |
pimutils/khal | import os
from time import sleep
from khal.khalendar import vdir
def test_get_href_from_uid():
# Test UID with unsafe characters
uid = "V042MJ8B3SJNFXQOJL6P53OFMHJE8Z3VZWÈÉ@pimutils.org"
first_href = vdir._generate_href(uid)
second_href = vdir._generate_href(uid)
assert first_href == second_href
... | None | assert | none_literal | tests/vdir_test.py | test_get_href_from_uid | 79 | null | |
pimutils/khal | import datetime as dt
import icalendar
import pytz
from khal import icalendar as icalendar_helpers
from khal import utils
from .utils import _get_text, _get_vevent_file
BERLIN = pytz.timezone('Europe/Berlin')
BOGOTA = pytz.timezone('America/Bogota')
event_dt = """BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
BEGI... | 18 | assert | numeric_literal | tests/khalendar_utils_test.py | test_count | TestSpecial | 587 | null |
pimutils/khal | import datetime as dt
import os.path
import pytest
from tzlocal import get_localzone as _get_localzone
from khal.settings import get_config
from khal.settings.exceptions import CannotParseConfigFileError, InvalidSettingsError
from khal.settings.utils import (
config_checks,
get_all_vdirs,
get_color_from_v... | sorted([ 'my private calendar', 'my calendar', 'public', 'home', 'public1', 'work', 'cfgcolor', 'cfgcolor_again', 'cfgcolor_once_more', 'dircolor', 'singlecollection', ]) | assert | func_call | tests/settings_test.py | test_get_unique_name | 202 | null | |
pimutils/khal | import datetime as dt
import json
import os
import re
import sys
import traceback
import pytest
from click.testing import CliRunner
from freezegun import freeze_time
from khal.cli import main_ikhal, main_khal
from khal.utils import CONTENT_ATTRIBUTES
from .utils import _get_ics_filepath, _get_text
def runner(tmpdir... | 0 | assert | numeric_literal | tests/cli_test.py | test_configure_command | 713 | null | |
pimutils/khal | import datetime as dt
from freezegun import freeze_time
from khal.ui import DayWalker, DListBox, StaticDayWalker
from tests.utils import LOCALE_BERLIN
from .canvas_render import CanvasTranslator
CONF = {'locale': LOCALE_BERLIN, 'keybindings': {},
'view': {'monthdisplay': 'firstday'},
'default': {'ti... | """\x1b[34mToday (Wednesday, 07.06.2017)\x1b[0m \x1b[32mTomorrow (Thursday, 08.06.2017)\x1b[0m \x1b[32mFriday, 09.06.2017 (2 days from now)\x1b[0m """ | assert | string_literal | tests/ui/test_walker.py | test_staticdaywalker | 59 | null | |
pimutils/khal | import datetime as dt
import icalendar
import pytz
from khal import icalendar as icalendar_helpers
from khal import utils
from .utils import _get_text, _get_vevent_file
BERLIN = pytz.timezone('Europe/Berlin')
BOGOTA = pytz.timezone('America/Bogota')
event_dt = """BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
BEGI... | 1 | assert | numeric_literal | tests/khalendar_utils_test.py | test_recurrence_id_with_timezone | TestSpecial | 618 | null |
pimutils/khal | from khal.terminal import colored, merge_columns
def test_colored():
assert colored('test', 'light cyan') == '\33[1;36mtest\x1b[0m'
assert colored('täst', 'white') == ' | '\33[37mtäst\x1b[0m' | assert | string_literal | tests/terminal_test.py | test_colored | 6 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | start_end_from_daterange(('today',), locale=utils.LOCALE_BERLIN) | assert | func_call | tests/controller_test.py | test_start_end | 150 | null | |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | '\n'.join(example_gr) | assert | string_literal | tests/cal_display_test.py | test_vertical_month_unicode_weekdeays_gr | 412 | null | |
pimutils/khal | import datetime as dt
import random
import textwrap
import icalendar
from freezegun import freeze_time
from khal.icalendar import new_vevent, split_ics
from .utils import LOCALE_BERLIN, _get_text, _replace_uid, normalize_component
def _get_TZIDs(lines):
"""from a list of strings, get all unique strings that sta... | 'DRF0RGCY89VVDKIV9VPKA1FYEAU2GCFJIBS1' | assert | string_literal | tests/icalendar_test.py | test_split_ics_random_uid | 80 | null | |
pimutils/khal | import datetime as dt
import icalendar
import pytz
from khal import icalendar as icalendar_helpers
from khal import utils
from .utils import _get_text, _get_vevent_file
BERLIN = pytz.timezone('Europe/Berlin')
BOGOTA = pytz.timezone('America/Bogota')
event_dt = """BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
BEGI... | 4 | assert | numeric_literal | tests/khalendar_utils_test.py | test_simple_rdate | TestRDate | 728 | null |
pimutils/khal | import os
from time import sleep
from khal.khalendar import vdir
def test_get_href_from_uid():
# Test UID with unsafe characters
uid = "V042MJ8B3SJNFXQOJL6P53OFMHJE8Z3VZWÈÉ@pimutils.org"
first_href = vdir._generate_href(uid)
second_href = vdir._generate_href(uid)
assert first_href == | second_href | assert | variable | tests/vdir_test.py | test_get_href_from_uid | 71 | null | |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | example1 | assert | variable | tests/cal_display_test.py | test_vertical_month | 316 | null | |
pimutils/khal | import datetime as dt
import pytz
from packaging import version
from khal.khalendar.event import create_timezone
berlin = pytz.timezone('Europe/Berlin')
bogota = pytz.timezone('America/Bogota')
atime = dt.datetime(2014, 10, 28, 10, 10)
btime = dt.datetime(2016, 10, 28, 10, 10)
def test_bogota():
vbogota = [b'B... | vbogota | assert | variable | tests/vtimezone_test.py | test_bogota | 83 | null | |
pimutils/khal | import datetime as dt
import icalendar
from khal.ui.editor import RecurrenceEditor, StartEndEditor
from tests.utils import BERLIN, LOCALE_BERLIN
from .canvas_render import CanvasTranslator
CONF = {'locale': LOCALE_BERLIN, 'keybindings': {}, 'view': {'monthdisplay': 'firstday'}}
START = BERLIN.localize(dt.datetime(... | BERLIN.localize(dt.datetime(2017, 10, 4, 18)) | assert | func_call | tests/ui/test_editor.py | test_editor | 88 | null | |
pimutils/khal | import datetime as dt
from collections import OrderedDict
import pytest
from freezegun import freeze_time
from khal.exceptions import DateTimeParseError, FatalError
from khal.icalendar import new_vevent
from khal.parse_datetime import (
construct_daynames,
eventinfofstr,
guessdatetimefstr,
guessrangef... | DateTimeParseError) | pytest.raises | variable | tests/parse_datetime_test.py | test_leap_year | 490 | null | |
pimutils/khal | import datetime as dt
import pytest
import pytz
from freezegun import freeze_time
from hypothesis import event, given
from hypothesis.strategies import datetimes
from icalendar import Parameters, vCalAddress, vRecur, vText
from packaging import version
from khal.controllers import human_formatter
from khal.khalendar.... | 0 | assert | numeric_literal | tests/event_test.py | test_update_sequence | 165 | null | |
pimutils/khal | import datetime as dt
import json
import os
import re
import sys
import traceback
import pytest
from click.testing import CliRunner
from freezegun import freeze_time
from khal.cli import main_ikhal, main_khal
from khal.utils import CONTENT_ATTRIBUTES
from .utils import _get_ics_filepath, _get_text
def runner(tmpdir... | 2 | assert | numeric_literal | tests/cli_test.py | test_default_command_empty | 313 | null | |
pimutils/khal | import click
import pytest
from khal.configwizard import get_collection_names_from_vdirs, validate_int
def test_validate_int():
assert validate_int('3', 0, 3) == 3
with pytest.raises( | click.UsageError) | pytest.raises | complex_expr | tests/configwizard_test.py | test_validate_int | 9 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | utils.BERLIN.localize(dt.datetime(2015, 6, 2, 12, 0)) | assert | func_call | tests/controller_test.py | test_mix_datetime_types | TestImport | 140 | null |
pimutils/khal | from khal.terminal import colored, merge_columns
class TestMergeColumns:
def test_longer_right(self):
left = ['uiae', 'nrtd']
right = ['123456', '234567', '345678']
out = ['uiae 123456',
'nrtd 234567',
' 345678']
assert merge_columns(left... | out | assert | variable | tests/terminal_test.py | test_longer_right | TestMergeColumns | 25 | null |
pimutils/khal | import datetime as dt
from collections import OrderedDict
import pytest
from freezegun import freeze_time
from khal.exceptions import DateTimeParseError, FatalError
from khal.icalendar import new_vevent
from khal.parse_datetime import (
construct_daynames,
eventinfofstr,
guessdatetimefstr,
guessrangef... | weekdayno | assert | variable | tests/parse_datetime_test.py | test_weekdaypstr | 103 | null | |
pimutils/khal | import datetime as dt
from freezegun import freeze_time
from khal.ui.calendarwidget import CalendarWidget
on_press: dict = {}
keybindings = {
'today': ['T'],
'left': ['left', 'h', 'backspace'],
'up': ['up', 'k'],
'right': ['right', 'l', ' '],
'down': ['down', 'j'],
}
def test_initial_focus_toda... | today | assert | variable | tests/ui/test_calendarwidget.py | test_initial_focus_today | 24 | null | |
pimutils/khal | import datetime as dt
import random
import textwrap
import icalendar
from freezegun import freeze_time
from khal.icalendar import new_vevent, split_ics
from .utils import LOCALE_BERLIN, _get_text, _replace_uid, normalize_component
def _get_TZIDs(lines):
"""from a list of strings, get all unique strings that sta... | caplog.text | assert | complex_expr | tests/icalendar_test.py | test_windows_timezone | 106 | null | |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_last_reset():
assert utils.find_last_reset(weekheader) == (31, 35, '\x1b[0m')
assert utils.find_last_reset(today_line) == (13, 17, '\x1b[0m')
assert utils.find_last_reset(calendarline) == (99, ... | (-2, -1, '') | assert | collection | tests/utils_test.py | test_last_reset | 30 | null | |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_relative_timedelta_str():
with freeze_time('2016-9-19'):
assert utils.relative_timedelta_str(dt.date(2016, 9, 24)) == | '5 days from now' | assert | string_literal | tests/utils_test.py | test_relative_timedelta_str | 12 | null | |
pimutils/khal | import datetime as dt
import pytest
import pytz
from freezegun import freeze_time
from hypothesis import event, given
from hypothesis.strategies import datetimes
from icalendar import Parameters, vCalAddress, vRecur, vText
from packaging import version
from khal.controllers import human_formatter
from khal.khalendar.... | None | assert | none_literal | tests/event_test.py | test_event_attendees | 572 | null | |
pimutils/khal | import datetime as dt
from operator import itemgetter
import icalendar
import pytest
from khal.khalendar import backend
from khal.khalendar.exceptions import OutdatedDbVersionError, UpdateFailed
from .utils import BERLIN, LOCALE_BERLIN, _get_text
calname = 'home'
def test_two_calendars_same_uid():
home = 'home... | 8 | assert | numeric_literal | tests/backend_test.py | test_two_calendars_same_uid | 529 | null | |
pimutils/khal | import datetime as dt
import icalendar
import pytz
from khal import icalendar as icalendar_helpers
from khal import utils
from .utils import _get_text, _get_vevent_file
BERLIN = pytz.timezone('Europe/Berlin')
BOGOTA = pytz.timezone('America/Bogota')
event_dt = """BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
BEGI... | 5 | assert | numeric_literal | tests/khalendar_utils_test.py | test_expand_rrule_exdate_z | TestExpandNoRR | 452 | null |
pimutils/khal | import datetime as dt
import os.path
import pytest
from tzlocal import get_localzone as _get_localzone
from khal.settings import get_config
from khal.settings.exceptions import CannotParseConfigFileError, InvalidSettingsError
from khal.settings.utils import (
config_checks,
get_all_vdirs,
get_color_from_v... | test_config | assert | variable | tests/settings_test.py | test_config_checks | 305 | null | |
pimutils/khal | import datetime as dt
import icalendar
from khal.ui.editor import RecurrenceEditor, StartEndEditor
from tests.utils import BERLIN, LOCALE_BERLIN
from .canvas_render import CanvasTranslator
CONF = {'locale': LOCALE_BERLIN, 'keybindings': {}, 'view': {'monthdisplay': 'firstday'}}
START = BERLIN.localize(dt.datetime(... | dt.date(2015, 4, 27) | assert | func_call | tests/ui/test_editor.py | test_popup | 41 | null | |
pimutils/khal | import datetime as dt
import pytest
import pytz
from freezegun import freeze_time
from hypothesis import event, given
from hypothesis.strategies import datetimes
from icalendar import Parameters, vCalAddress, vRecur, vText
from packaging import version
from khal.controllers import human_formatter
from khal.khalendar.... | 1 | assert | numeric_literal | tests/event_test.py | test_update_sequence | 167 | null | |
pimutils/khal | import datetime as dt
from freezegun import freeze_time
from khal.ui.calendarwidget import CalendarWidget
on_press: dict = {}
keybindings = {
'today': ['T'],
'left': ['left', 'h', 'backspace'],
'up': ['up', 'k'],
'right': ['right', 'l', ' '],
'down': ['down', 'j'],
}
def test_set_focus_date():
... | day | assert | variable | tests/ui/test_calendarwidget.py | test_set_focus_date | 36 | null | |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_get_weekday_occurrence():
assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 1)) == (2, 1)
assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 2)) == (3, 1)
assert utils.get_weekday_... | (6, 1) | assert | collection | tests/utils_test.py | test_get_weekday_occurrence | 109 | null | |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_relative_timedelta_str():
with freeze_time('2016-9-19'):
assert utils.relative_timedelta_str(dt.date(2016, 9, 24)) == '5 days from now'
assert utils.relative_timedelta_str(dt.date(2016,... | '~7 weeks ago' | assert | string_literal | tests/utils_test.py | test_relative_timedelta_str | 15 | null | |
pimutils/khal | import datetime as dt
from collections import OrderedDict
import pytest
from freezegun import freeze_time
from khal.exceptions import DateTimeParseError, FatalError
from khal.icalendar import new_vevent
from khal.parse_datetime import (
construct_daynames,
eventinfofstr,
guessdatetimefstr,
guessrangef... | 'Tomorrow' | assert | string_literal | tests/parse_datetime_test.py | test_construct_daynames | 114 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | start_end_from_daterange(('today', '2d'), utils.LOCALE_BERLIN) | assert | func_call | tests/controller_test.py | test_start_end_delta | 164 | null | |
pimutils/khal | import datetime as dt
import os.path
import pytest
from tzlocal import get_localzone as _get_localzone
from khal.settings import get_config
from khal.settings.exceptions import CannotParseConfigFileError, InvalidSettingsError
from khal.settings.utils import (
config_checks,
get_all_vdirs,
get_color_from_v... | test_config['calendars'] | assert | complex_expr | tests/settings_test.py | test_config_checks | 304 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | start_end_from_daterange(('today',), utils.LOCALE_BERLIN) | assert | func_call | tests/controller_test.py | test_start_end_default_delta | 157 | null | |
pimutils/khal | import datetime as dt
import icalendar
import pytz
from khal import icalendar as icalendar_helpers
from khal import utils
from .utils import _get_text, _get_vevent_file
BERLIN = pytz.timezone('Europe/Berlin')
BOGOTA = pytz.timezone('America/Bogota')
event_dt = """BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
BEGI... | 73 | assert | numeric_literal | tests/khalendar_utils_test.py | test_rrule_past | TestRDate | 739 | null |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | example_weno | assert | variable | tests/cal_display_test.py | test_vertical_month | 326 | null | |
pimutils/khal | import datetime as dt
import pytest
import pytz
from freezegun import freeze_time
from hypothesis import event, given
from hypothesis.strategies import datetimes
from icalendar import Parameters, vCalAddress, vRecur, vText
from packaging import version
from khal.controllers import human_formatter
from khal.khalendar.... | 2 | assert | numeric_literal | tests/event_test.py | test_remove_instance_from_two_rdate | 488 | null | |
pimutils/khal | import datetime as dt
from freezegun import freeze_time
from khal.ui.calendarwidget import CalendarWidget
on_press: dict = {}
keybindings = {
'today': ['T'],
'left': ['left', 'h', 'backspace'],
'up': ['up', 'k'],
'right': ['right', 'l', ' '],
'down': ['down', 'j'],
}
def test_set_focus_far_futu... | future_date | assert | variable | tests/ui/test_calendarwidget.py | test_set_focus_far_future | 73 | null | |
pimutils/khal | import datetime as dt
import json
import os
import re
import sys
import traceback
import pytest
from click.testing import CliRunner
from freezegun import freeze_time
from khal.cli import main_ikhal, main_khal
from khal.utils import CONTENT_ATTRIBUTES
from .utils import _get_ics_filepath, _get_text
def runner(tmpdir... | 1 | assert | numeric_literal | tests/cli_test.py | test_import_from_stdin | 602 | null | |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | example_de_freebsd | assert | variable | tests/cal_display_test.py | test_vertical_month_unicode | 353 | null | |
pimutils/khal | import datetime as dt
import os.path
import pytest
from tzlocal import get_localzone as _get_localzone
from khal.settings import get_config
from khal.settings.exceptions import CannotParseConfigFileError, InvalidSettingsError
from khal.settings.utils import (
config_checks,
get_all_vdirs,
get_color_from_v... | '123' | assert | string_literal | tests/settings_test.py | test_is_color | 311 | null | |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | 50 | assert | numeric_literal | tests/cal_display_test.py | test_getweeknumber | 22 | null | |
pimutils/khal | import datetime as dt
import icalendar
from khal.ui.editor import RecurrenceEditor, StartEndEditor
from tests.utils import BERLIN, LOCALE_BERLIN
from .canvas_render import CanvasTranslator
CONF = {'locale': LOCALE_BERLIN, 'keybindings': {}, 'view': {'monthdisplay': 'firstday'}}
START = BERLIN.localize(dt.datetime(... | BERLIN.localize(dt.datetime(2017, 10, 2, 13)) | assert | func_call | tests/ui/test_editor.py | test_editor | 87 | null | |
pimutils/khal | import datetime as dt
from collections import OrderedDict
import pytest
from freezegun import freeze_time
from khal.exceptions import DateTimeParseError, FatalError
from khal.icalendar import new_vevent
from khal.parse_datetime import (
construct_daynames,
eventinfofstr,
guessdatetimefstr,
guessrangef... | 'Today' | assert | string_literal | tests/parse_datetime_test.py | test_construct_daynames | 113 | null | |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_find_unmatched_sgr():
assert utils.find_unmatched_sgr(weekheader) is | None | assert | none_literal | tests/utils_test.py | test_find_unmatched_sgr | 41 | null | |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | example2 | assert | variable | tests/cal_display_test.py | test_vertical_month | 321 | null | |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_find_unmatched_sgr():
assert utils.find_unmatched_sgr(weekheader) is None
assert utils.find_unmatched_sgr(today_line) is None
assert utils.find_unmatched_sgr(calendarline) is None
assert u... | '\x1b[31m' | assert | string_literal | tests/utils_test.py | test_find_unmatched_sgr | 44 | null | |
pimutils/khal | import datetime as dt
import random
import textwrap
import icalendar
from freezegun import freeze_time
from khal.icalendar import new_vevent, split_ics
from .utils import LOCALE_BERLIN, _get_text, _replace_uid, normalize_component
def _get_TZIDs(lines):
"""from a list of strings, get all unique strings that sta... | _get_TZIDs(part0) | assert | func_call | tests/icalendar_test.py | test_split_ics | 63 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | '' | assert | string_literal | tests/controller_test.py | test_empty_recurrence | TestGetAgenda | 91 | null |
pimutils/khal | from khal.terminal import colored, merge_columns
def test_colored():
assert colored('test', 'light cyan') == '\33[1;36mtest\x1b[0m'
assert colored('täst', 'white') == '\33[37mtäst\x1b[0m'
assert colored('täst', 'white', 'dark green') == ' | '\x1b[37m\x1b[42mtäst\x1b[0m' | assert | string_literal | tests/terminal_test.py | test_colored | 7 | null | |
pimutils/khal | import datetime as dt
import icalendar
from khal.ui.editor import RecurrenceEditor, StartEndEditor
from tests.utils import BERLIN, LOCALE_BERLIN
from .canvas_render import CanvasTranslator
CONF = {'locale': LOCALE_BERLIN, 'keybindings': {}, 'view': {'monthdisplay': 'firstday'}}
START = BERLIN.localize(dt.datetime(... | dt.date(2017, 10, 2) | assert | func_call | tests/ui/test_editor.py | test_convert_to_date | 133 | null | |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | example_we_start_su | assert | variable | tests/cal_display_test.py | test_vertical_month | 332 | null | |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_get_weekday_occurrence():
assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 1)) == | (2, 1) | assert | collection | tests/utils_test.py | test_get_weekday_occurrence | 105 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | [ev.start for ev in events] | assert | collection | tests/controller_test.py | test_import | TestImport | 107 | null |
pimutils/khal | import datetime as dt
from operator import itemgetter
import icalendar
import pytest
from khal.khalendar import backend
from khal.khalendar.exceptions import OutdatedDbVersionError, UpdateFailed
from .utils import BERLIN, LOCALE_BERLIN, _get_text
calname = 'home'
def test_event_delete():
dbi = backend.SQLiteDb... | 0 | assert | numeric_literal | tests/backend_test.py | test_event_delete | 207 | null | |
pimutils/khal | import datetime as dt
from freezegun import freeze_time
from khal.ui import DayWalker, DListBox, StaticDayWalker
from tests.utils import LOCALE_BERLIN
from .canvas_render import CanvasTranslator
CONF = {'locale': LOCALE_BERLIN, 'keybindings': {},
'view': {'monthdisplay': 'firstday'},
'default': {'ti... | '\x1b[34mToday (Wednesday, 07.06.2017)\x1b[0m\n\n\n\n\n\n\n\n\n\n' | assert | string_literal | tests/ui/test_walker.py | test_staticdaywalker_3 | 89 | null | |
pimutils/khal | import datetime as dt
from collections import OrderedDict
import pytest
from freezegun import freeze_time
from khal.exceptions import DateTimeParseError, FatalError
from khal.icalendar import new_vevent
from khal.parse_datetime import (
construct_daynames,
eventinfofstr,
guessdatetimefstr,
guessrangef... | FatalError) | pytest.raises | variable | tests/parse_datetime_test.py | test_start_allday_and_delta_datetime | TestGuessRangefstr | 299 | null |
pimutils/khal | import datetime as dt
from operator import itemgetter
import icalendar
import pytest
from khal.khalendar import backend
from khal.khalendar.exceptions import OutdatedDbVersionError, UpdateFailed
from .utils import BERLIN, LOCALE_BERLIN, _get_text
calname = 'home'
def test_event_rrule_recurrence_id():
dbi = bac... | 6 | assert | numeric_literal | tests/backend_test.py | test_event_rrule_recurrence_id | 37 | null | |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | 'dark red' | assert | string_literal | tests/cal_display_test.py | test_get_calendar_color | 58 | null | |
pimutils/khal | import datetime as dt
import pytest
import pytz
from freezegun import freeze_time
from hypothesis import event, given
from hypothesis.strategies import datetimes
from icalendar import Parameters, vCalAddress, vRecur, vText
from packaging import version
from khal.controllers import human_formatter
from khal.khalendar.... | '' | assert | string_literal | tests/event_test.py | test_raw_dt | 65 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | 6 | assert | numeric_literal | tests/controller_test.py | test_import | TestImport | 104 | null |
pimutils/khal | import datetime as dt
import locale
import platform
import unicodedata
import pytest
from khal.calendar_display import (
get_calendar_color,
get_color_list,
getweeknumber,
str_week,
vertical_month,
)
today = dt.date.today()
yesterday = today - dt.timedelta(days=1)
tomorrow = today + dt.timedelta(... | 52 | assert | numeric_literal | tests/cal_display_test.py | test_getweeknumber | 23 | null | |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | utils.BERLIN.localize(dt.datetime(2015, 5, 30, 12, 0)) | assert | func_call | tests/controller_test.py | test_mix_datetime_types | TestImport | 136 | null |
pimutils/khal | import datetime as dt
from click import style
from freezegun import freeze_time
from khal import utils
def test_get_weekday_occurrence():
assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 1)) == (2, 1)
assert utils.get_weekday_occurrence(dt.datetime(2017, 3, 2)) == | (3, 1) | assert | collection | tests/utils_test.py | test_get_weekday_occurrence | 106 | null | |
pimutils/khal | import datetime as dt
import icalendar
import pytz
from khal import icalendar as icalendar_helpers
from khal import utils
from .utils import _get_text, _get_vevent_file
BERLIN = pytz.timezone('Europe/Berlin')
BOGOTA = pytz.timezone('America/Bogota')
event_dt = """BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
BEGI... | None | assert | none_literal | tests/khalendar_utils_test.py | test_event_dt_rrule_until_before_start | TestSpecial | 693 | null |
pimutils/khal | import datetime as dt
from textwrap import dedent
import pytest
from freezegun import freeze_time
from khal import exceptions
from khal.controllers import import_ics, khal_list, start_end_from_daterange
from khal.khalendar.vdir import Item
from . import utils
from .utils import _get_text
today = dt.date.today()
yes... | 5 | assert | numeric_literal | tests/controller_test.py | test_import | TestImport | 115 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.