# Buggy code
def get_lockfile_meta(self):
    from .vendor.plette.lockfiles import PIPFILE_SPEC_CURRENT

    if self.lockfile_exists:
        sources = self.lockfile_content.get("_meta", {}).get("sources", [])
    else:
        sources = [dict(source) for source in self.parsed_pipfile["source"]]
    if not isinstance(sources, list):
        sources = [
            sources,
        ]
    return {
        "hash": {"sha256": self.calculate_pipfile_hash()},
        "pipfile-spec": PIPFILE_SPEC_CURRENT,
        "sources": sources,
        "requires": self.parsed_pipfile.get("requires", {}),
    }


# Traceback (plette.models.base.ValidationError)
Installing dependencies from Pipfile…
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/bin/pipenv", line 11, in <module>
load_entry_point('pipenv==2018.11.26', 'console_scripts', 'pipenv')()
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/cli/command.py", line 254, in install
editable_packages=state.installstate.editables,
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/core.py", line 1874, in do_install
keep_outdated=keep_outdated
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/core.py", line 1253, in do_init
pypi_mirror=pypi_mirror,
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/core.py", line 795, in do_install_dependencies
lockfile = project.get_or_create_lockfile(from_pipfile=True)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/project.py", line 756, in get_or_create_lockfile
path=self.lockfile_location, data=lockfile_dict, meta_from_project=False
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 209, in from_data
lockfile = plette.lockfiles.Lockfile(data)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/plette/models/base.py", line 37, in __init__
self.validate(data)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/plette/lockfiles.py", line 80, in validate
klass.validate(data[key])
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/plette/models/sections.py", line 70, in validate
klass.validate(data[key])
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/plette/models/base.py", line 132, in validate
cls.item_class.validate(d)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/plette/models/base.py", line 67, in validate
return validate(cls, data)
File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/pipfile.py", line 59, in validate
raise plette.models.base.ValidationError(data, v)
plette.models.base.ValidationError: {'url': 'https://pypi.python.org/simple', 'verify_ssl': True}

# Fixed code
def get_lockfile_meta(self):
    from .vendor.plette.lockfiles import PIPFILE_SPEC_CURRENT

    if self.lockfile_exists:
        sources = self.lockfile_content.get("_meta", {}).get("sources", [])
    else:
        sources = [dict(source) for source in self.parsed_pipfile["source"]]
    if not isinstance(sources, list):
        sources = [
            sources,
        ]
    return {
        "hash": {"sha256": self.calculate_pipfile_hash()},
        "pipfile-spec": PIPFILE_SPEC_CURRENT,
        "sources": [self.populate_source(s) for s in sources],
        "requires": self.parsed_pipfile.get("requires", {}),
    }