<commit_before>import os

from homely._errors import HelperError
from homely._engine2 import Helper, Cleaner, getengine, Engine
from homely._utils import haveexecutable, isnecessarypath
from homely._ui import note, allowinteractive, allowpull, system


def installpkg(name=None, wantcmd=None, **methods):
    for key in methods:
        assert key in InstallPackage.METHODS

    # FIXME: make sure the user specifies at least one way to install the thing
    getengine().run(InstallPackage(name, methods, wantcmd))


class InstallFromSource(Helper):
    _title = None
    _source_repo = None
    _clone_to = None
    _real_clone_to = None
    _branch = None
    _tag = None
    _compile = None

    def __init__(self, source_repo, clone_to):
        super(InstallFromSource, self).__init__()
        self._title = 'Install %s into %s' % (source_repo, clone_to)
        self._source_repo = source_repo
        self._clone_to = clone_to
        self._real_clone_to = os.path.expanduser(clone_to)
        self._symlinks = []

    def select_branch(self, branch_name):
        assert self._tag is None<commit_msg>homely.install: installpkg() now requires a name<commit_after>import os

from homely._errors import HelperError
from homely._engine2 import Helper, Cleaner, getengine, Engine
from homely._utils import haveexecutable, isnecessarypath
from homely._ui import note, allowinteractive, allowpull, system


def installpkg(name, wantcmd=None, **methods):
    for key in methods:
        assert key in InstallPackage.METHODS

    # FIXME: make sure the user specifies at least one way to install the thing
    getengine().run(InstallPackage(name, methods, wantcmd))


class InstallFromSource(Helper):
    _title = None
    _source_repo = None
    _clone_to = None
    _real_clone_to = None
    _branch = None
    _tag = None
    _compile = None

    def __init__(self, source_repo, clone_to):
        super(InstallFromSource, self).__init__()
        self._title = 'Install %s into %s' % (source_repo, clone_to)
        self._source_repo = source_repo
        self._clone_to = clone_to
        self._real_clone_to = os.path.expanduser(clone_to)
        self._symlinks = []

    def select_branch(self, branch_name):
        assert self._tag is None
{'fraction_non_alphanumeric': 0.07784697508896797, 'fraction_numerical': 0.0008896797153024911, 'mean_word_length': 3.5070140280561124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1729242', 'n_tokens_mistral': 672, 'n_tokens_neox': 661, 'n_words': 198}