├── .gitignore ├── CHANGELOG.md ├── README.md ├── metaheuristic_algorithms ├── base_algorithm.py ├── command_line.py ├── firefly_algorithm.py ├── function_wrappers │ ├── abstract_wrapper.py │ ├── easom_function_wrapper.py │ ├── michaelwicz_function_wrapper.py │ ├── nonsmooth_multipeak_function_wrapper.py │ └── rosenbrook_function_wrapper.py ├── genetic_algorithm.py ├── harmony_search.py ├── simplified_particle_swarm_optimization.py ├── simulated_annealing.py └── version.py ├── setup.py ├── tests └── metaheuristic_algorithms │ ├── test_firefly_algorithm.py │ ├── test_genetic_algorithm.py │ ├── test_harmony_search.py │ ├── test_simplified_particle_swarm_optimization.py │ └── test_simulated_annealing.py └── venv ├── .Python ├── bin ├── activate ├── activate.csh ├── activate.fish ├── activate_this.py ├── easy_install ├── easy_install-3.5 ├── pip ├── pip3 ├── pip3.5 ├── python ├── python3 ├── python3.5 └── wheel ├── include └── python3.5m └── lib └── python3.5 ├── __future__.py ├── _bootlocale.py ├── _collections_abc.py ├── _dummy_thread.py ├── _weakrefset.py ├── abc.py ├── base64.py ├── bisect.py ├── codecs.py ├── collections ├── config-3.5m ├── copy.py ├── copyreg.py ├── distutils ├── __init__.py └── distutils.cfg ├── encodings ├── fnmatch.py ├── functools.py ├── genericpath.py ├── hashlib.py ├── heapq.py ├── hmac.py ├── imp.py ├── importlib ├── io.py ├── keyword.py ├── lib-dynload ├── linecache.py ├── locale.py ├── no-global-site-packages.txt ├── ntpath.py ├── operator.py ├── orig-prefix.txt ├── os.py ├── plat-darwin ├── posixpath.py ├── random.py ├── re.py ├── readline.so ├── reprlib.py ├── rlcompleter.py ├── shutil.py ├── site-packages ├── _markerlib │ ├── __init__.py │ └── markers.py ├── easy_install.py ├── pip-7.1.2.dist-info │ ├── DESCRIPTION.rst │ ├── METADATA │ ├── RECORD │ ├── WHEEL │ ├── entry_points.txt │ ├── metadata.json │ ├── pbr.json │ └── top_level.txt ├── pip │ ├── __init__.py │ ├── __main__.py │ ├── _vendor │ │ ├── __init__.py │ │ ├── _markerlib │ │ │ ├── __init__.py │ │ │ └── markers.py │ │ ├── cachecontrol │ │ │ ├── __init__.py │ │ │ ├── adapter.py │ │ │ ├── cache.py │ │ │ ├── caches │ │ │ │ ├── __init__.py │ │ │ │ ├── file_cache.py │ │ │ │ └── redis_cache.py │ │ │ ├── compat.py │ │ │ ├── controller.py │ │ │ ├── filewrapper.py │ │ │ ├── heuristics.py │ │ │ ├── serialize.py │ │ │ └── wrapper.py │ │ ├── colorama │ │ │ ├── __init__.py │ │ │ ├── ansi.py │ │ │ ├── ansitowin32.py │ │ │ ├── initialise.py │ │ │ ├── win32.py │ │ │ └── winterm.py │ │ ├── distlib │ │ │ ├── __init__.py │ │ │ ├── _backport │ │ │ │ ├── __init__.py │ │ │ │ ├── misc.py │ │ │ │ ├── shutil.py │ │ │ │ ├── sysconfig.cfg │ │ │ │ ├── sysconfig.py │ │ │ │ └── tarfile.py │ │ │ ├── compat.py │ │ │ ├── database.py │ │ │ ├── index.py │ │ │ ├── locators.py │ │ │ ├── manifest.py │ │ │ ├── markers.py │ │ │ ├── metadata.py │ │ │ ├── resources.py │ │ │ ├── scripts.py │ │ │ ├── t32.exe │ │ │ ├── t64.exe │ │ │ ├── util.py │ │ │ ├── version.py │ │ │ ├── w32.exe │ │ │ ├── w64.exe │ │ │ └── wheel.py │ │ ├── html5lib │ │ │ ├── __init__.py │ │ │ ├── constants.py │ │ │ ├── filters │ │ │ │ ├── __init__.py │ │ │ │ ├── _base.py │ │ │ │ ├── alphabeticalattributes.py │ │ │ │ ├── inject_meta_charset.py │ │ │ │ ├── lint.py │ │ │ │ ├── optionaltags.py │ │ │ │ ├── sanitizer.py │ │ │ │ └── whitespace.py │ │ │ ├── html5parser.py │ │ │ ├── ihatexml.py │ │ │ ├── inputstream.py │ │ │ ├── sanitizer.py │ │ │ ├── serializer │ │ │ │ ├── __init__.py │ │ │ │ └── htmlserializer.py │ │ │ ├── tokenizer.py │ │ │ ├── treeadapters │ │ │ │ ├── __init__.py │ │ │ │ └── sax.py │ │ │ ├── treebuilders │ │ │ │ ├── __init__.py │ │ │ │ ├── _base.py │ │ │ │ ├── dom.py │ │ │ │ ├── etree.py │ │ │ │ └── etree_lxml.py │ │ │ ├── treewalkers │ │ │ │ ├── __init__.py │ │ │ │ ├── _base.py │ │ │ │ ├── dom.py │ │ │ │ ├── etree.py │ │ │ │ ├── genshistream.py │ │ │ │ ├── lxmletree.py │ │ │ │ └── pulldom.py │ │ │ ├── trie │ │ │ │ ├── __init__.py │ │ │ │ ├── _base.py │ │ │ │ ├── datrie.py │ │ │ │ └── py.py │ │ │ └── utils.py │ │ ├── ipaddress.py │ │ ├── lockfile │ │ │ ├── __init__.py │ │ │ ├── linklockfile.py │ │ │ ├── mkdirlockfile.py │ │ │ ├── pidlockfile.py │ │ │ ├── sqlitelockfile.py │ │ │ └── symlinklockfile.py │ │ ├── packaging │ │ │ ├── __about__.py │ │ │ ├── __init__.py │ │ │ ├── _compat.py │ │ │ ├── _structures.py │ │ │ ├── specifiers.py │ │ │ └── version.py │ │ ├── pkg_resources │ │ │ └── __init__.py │ │ ├── progress │ │ │ ├── __init__.py │ │ │ ├── bar.py │ │ │ ├── counter.py │ │ │ ├── helpers.py │ │ │ └── spinner.py │ │ ├── re-vendor.py │ │ ├── requests │ │ │ ├── __init__.py │ │ │ ├── adapters.py │ │ │ ├── api.py │ │ │ ├── auth.py │ │ │ ├── cacert.pem │ │ │ ├── certs.py │ │ │ ├── compat.py │ │ │ ├── cookies.py │ │ │ ├── exceptions.py │ │ │ ├── hooks.py │ │ │ ├── models.py │ │ │ ├── packages │ │ │ │ ├── __init__.py │ │ │ │ ├── chardet │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── big5freq.py │ │ │ │ │ ├── big5prober.py │ │ │ │ │ ├── chardetect.py │ │ │ │ │ ├── chardistribution.py │ │ │ │ │ ├── charsetgroupprober.py │ │ │ │ │ ├── charsetprober.py │ │ │ │ │ ├── codingstatemachine.py │ │ │ │ │ ├── compat.py │ │ │ │ │ ├── constants.py │ │ │ │ │ ├── cp949prober.py │ │ │ │ │ ├── escprober.py │ │ │ │ │ ├── escsm.py │ │ │ │ │ ├── eucjpprober.py │ │ │ │ │ ├── euckrfreq.py │ │ │ │ │ ├── euckrprober.py │ │ │ │ │ ├── euctwfreq.py │ │ │ │ │ ├── euctwprober.py │ │ │ │ │ ├── gb2312freq.py │ │ │ │ │ ├── gb2312prober.py │ │ │ │ │ ├── hebrewprober.py │ │ │ │ │ ├── jisfreq.py │ │ │ │ │ ├── jpcntx.py │ │ │ │ │ ├── langbulgarianmodel.py │ │ │ │ │ ├── langcyrillicmodel.py │ │ │ │ │ ├── langgreekmodel.py │ │ │ │ │ ├── langhebrewmodel.py │ │ │ │ │ ├── langhungarianmodel.py │ │ │ │ │ ├── langthaimodel.py │ │ │ │ │ ├── latin1prober.py │ │ │ │ │ ├── mbcharsetprober.py │ │ │ │ │ ├── mbcsgroupprober.py │ │ │ │ │ ├── mbcssm.py │ │ │ │ │ ├── sbcharsetprober.py │ │ │ │ │ ├── sbcsgroupprober.py │ │ │ │ │ ├── sjisprober.py │ │ │ │ │ ├── universaldetector.py │ │ │ │ │ └── utf8prober.py │ │ │ │ └── urllib3 │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _collections.py │ │ │ │ │ ├── connection.py │ │ │ │ │ ├── connectionpool.py │ │ │ │ │ ├── contrib │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── ntlmpool.py │ │ │ │ │ └── pyopenssl.py │ │ │ │ │ ├── exceptions.py │ │ │ │ │ ├── fields.py │ │ │ │ │ ├── filepost.py │ │ │ │ │ ├── packages │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── ordered_dict.py │ │ │ │ │ ├── six.py │ │ │ │ │ └── ssl_match_hostname │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── _implementation.py │ │ │ │ │ ├── poolmanager.py │ │ │ │ │ ├── request.py │ │ │ │ │ ├── response.py │ │ │ │ │ └── util │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── connection.py │ │ │ │ │ ├── request.py │ │ │ │ │ ├── response.py │ │ │ │ │ ├── retry.py │ │ │ │ │ ├── ssl_.py │ │ │ │ │ ├── timeout.py │ │ │ │ │ └── url.py │ │ │ ├── sessions.py │ │ │ ├── status_codes.py │ │ │ ├── structures.py │ │ │ └── utils.py │ │ ├── retrying.py │ │ └── six.py │ ├── basecommand.py │ ├── baseparser.py │ ├── cmdoptions.py │ ├── commands │ │ ├── __init__.py │ │ ├── completion.py │ │ ├── freeze.py │ │ ├── help.py │ │ ├── install.py │ │ ├── list.py │ │ ├── search.py │ │ ├── show.py │ │ ├── uninstall.py │ │ └── wheel.py │ ├── compat │ │ ├── __init__.py │ │ └── dictconfig.py │ ├── download.py │ ├── exceptions.py │ ├── index.py │ ├── locations.py │ ├── models │ │ ├── __init__.py │ │ └── index.py │ ├── operations │ │ ├── __init__.py │ │ └── freeze.py │ ├── pep425tags.py │ ├── req │ │ ├── __init__.py │ │ ├── req_file.py │ │ ├── req_install.py │ │ ├── req_set.py │ │ └── req_uninstall.py │ ├── status_codes.py │ ├── utils │ │ ├── __init__.py │ │ ├── appdirs.py │ │ ├── build.py │ │ ├── deprecation.py │ │ ├── filesystem.py │ │ ├── logging.py │ │ ├── outdated.py │ │ └── ui.py │ ├── vcs │ │ ├── __init__.py │ │ ├── bazaar.py │ │ ├── git.py │ │ ├── mercurial.py │ │ └── subversion.py │ └── wheel.py ├── pkg_resources │ ├── __init__.py │ └── _vendor │ │ ├── __init__.py │ │ └── packaging │ │ ├── __about__.py │ │ ├── __init__.py │ │ ├── _compat.py │ │ ├── _structures.py │ │ ├── specifiers.py │ │ └── version.py ├── setuptools-18.2.dist-info │ ├── DESCRIPTION.rst │ ├── METADATA │ ├── RECORD │ ├── WHEEL │ ├── dependency_links.txt │ ├── entry_points.txt │ ├── metadata.json │ ├── top_level.txt │ └── zip-safe ├── setuptools │ ├── __init__.py │ ├── archive_util.py │ ├── cli-32.exe │ ├── cli-64.exe │ ├── cli-arm-32.exe │ ├── cli.exe │ ├── command │ │ ├── __init__.py │ │ ├── alias.py │ │ ├── bdist_egg.py │ │ ├── bdist_rpm.py │ │ ├── bdist_wininst.py │ │ ├── build_ext.py │ │ ├── build_py.py │ │ ├── develop.py │ │ ├── easy_install.py │ │ ├── egg_info.py │ │ ├── install.py │ │ ├── install_egg_info.py │ │ ├── install_lib.py │ │ ├── install_scripts.py │ │ ├── launcher manifest.xml │ │ ├── register.py │ │ ├── rotate.py │ │ ├── saveopts.py │ │ ├── sdist.py │ │ ├── setopt.py │ │ ├── test.py │ │ └── upload_docs.py │ ├── compat.py │ ├── depends.py │ ├── dist.py │ ├── extension.py │ ├── gui-32.exe │ ├── gui-64.exe │ ├── gui-arm-32.exe │ ├── gui.exe │ ├── lib2to3_ex.py │ ├── msvc9_support.py │ ├── package_index.py │ ├── py26compat.py │ ├── py27compat.py │ ├── py31compat.py │ ├── sandbox.py │ ├── script (dev).tmpl │ ├── script.tmpl │ ├── site-patch.py │ ├── ssl_support.py │ ├── unicode_utils.py │ ├── utils.py │ ├── version.py │ └── windows_support.py ├── wheel-0.24.0.dist-info │ ├── DESCRIPTION.rst │ ├── LICENSE.txt │ ├── METADATA │ ├── RECORD │ ├── RECORD.jws │ ├── WHEEL │ ├── entry_points.txt │ ├── metadata.json │ └── top_level.txt └── wheel │ ├── __init__.py │ ├── __main__.py │ ├── archive.py │ ├── bdist_wheel.py │ ├── decorator.py │ ├── egg2wheel.py │ ├── eggnames.txt │ ├── install.py │ ├── metadata.py │ ├── paths.py │ ├── pep425tags.py │ ├── pkginfo.py │ ├── signatures │ ├── __init__.py │ ├── djbec.py │ ├── ed25519py.py │ └── keys.py │ ├── test │ ├── __init__.py │ ├── complex-dist │ │ ├── complexdist │ │ │ └── __init__.py │ │ └── setup.py │ ├── headers.dist │ │ ├── header.h │ │ ├── headersdist.py │ │ └── setup.py │ ├── pydist-schema.json │ ├── simple.dist │ │ ├── setup.py │ │ └── simpledist │ │ │ └── __init__.py │ ├── test-1.0-py2.py3-none-win32.whl │ ├── test_basic.py │ ├── test_install.py │ ├── test_keys.py │ ├── test_paths.py │ ├── test_ranking.py │ ├── test_signatures.py │ ├── test_tagopt.py │ ├── test_tool.py │ └── test_wheelfile.py │ ├── tool │ └── __init__.py │ ├── util.py │ └── wininst2wheel.py ├── site.py ├── sre_compile.py ├── sre_constants.py ├── sre_parse.py ├── stat.py ├── struct.py ├── tarfile.py ├── tempfile.py ├── token.py ├── tokenize.py ├── types.py ├── warnings.py └── weakref.py /.gitignore: -------------------------------------------------------------------------------- 1 | /coverage/ 2 | /doc/ 3 | /tmp/ 4 | .DS_Store 5 | __pycache__/ 6 | dist/ 7 | *.egg-info/ 8 | */build/ 9 | build/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## metaheuristic_algorithms_python 0.1.5 (November 22, 2015) ## 2 | 3 | * Added command line script. 4 | 5 | ## metaheuristic_algorithms_python 0.1.4 (November 21, 2015) ## 6 | 7 | * Fixed packages in setup.py so that metaheuristic_algorithms_python.function_wrappers subpackage is included. 8 | 9 | ## metaheuristic_algorithms_python 0.1.3 (November 12, 2015) ## 10 | 11 | * Added Firefly Algorithm 12 | 13 | ## metaheuristic_algorithms_python 0.1.2 (November 9, 2015) ## 14 | 15 | * Fixed a typo in method name minimum_decision_variable_values in FunctionWrapper's. 16 | 17 | * Added Simulated Annealing 18 | 19 | ## metaheuristic_algorithms_python 0.1.1 (November 3, 2015) ## 20 | 21 | * Added Simplified Particle Swarm Optimization 22 | 23 | ## metaheuristic_algorithms_python 0.1.0 (October 26, 2015) ## 24 | 25 | * Added Harmony Search 26 | -------------------------------------------------------------------------------- /metaheuristic_algorithms/base_algorithm.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | class BaseAlgorithm(object): 4 | 5 | def __init__(self, function_wrapper, number_of_variables = 1, objective = "maximization"): 6 | self.function_wrapper = function_wrapper 7 | self.number_of_variables = number_of_variables 8 | 9 | self.objective = objective 10 | 11 | # if objective == "maximization": 12 | # self.objective_method_name = "max" 13 | # elif objective == "minimization": 14 | # self.objective_method_name = "min" 15 | 16 | # if objective == "maximization": 17 | # self.objective_comparison_operator = ">" 18 | # elif objective == "minimization": 19 | # self.objective_comparison_operator = "<" 20 | 21 | def get_decision_variable_value_by_randomization(self, decision_variable_index): 22 | return self.function_wrapper.minimum_decision_variable_values()[decision_variable_index] + (self.function_wrapper.maximum_decision_variable_values()[decision_variable_index] - self.function_wrapper.minimum_decision_variable_values()[decision_variable_index]) * random.random() 23 | 24 | # max(function_values) or min(function_values) 25 | def best_function_value_from_list(self, function_values): 26 | 27 | if self.objective == "maximization": 28 | best_function_value = max(function_values) 29 | elif self.objective == "minimization": 30 | best_function_value = min(function_values) 31 | 32 | return best_function_value -------------------------------------------------------------------------------- /metaheuristic_algorithms/function_wrappers/abstract_wrapper.py: -------------------------------------------------------------------------------- 1 | # In order to make this class AbstractBaseClass: 2 | from abc import ABCMeta, abstractmethod 3 | 4 | class AbstractWrapper(object): 5 | 6 | # Return value: Array 7 | @abstractmethod 8 | def maximum_decision_variable_values(self): 9 | pass 10 | 11 | # Return value: Array 12 | @abstractmethod 13 | def minimum_decision_variable_values(self): 14 | pass 15 | 16 | # Input value: Array 17 | @abstractmethod 18 | def objective_function_value(self, decision_variable_values): 19 | pass 20 | 21 | # For the algorithm that requires initial estimate that is depending on the particular objective function: 22 | # Return value: Array 23 | @abstractmethod 24 | def initial_decision_variable_value_estimates(self): 25 | pass -------------------------------------------------------------------------------- /metaheuristic_algorithms/function_wrappers/easom_function_wrapper.py: -------------------------------------------------------------------------------- 1 | from metaheuristic_algorithms.function_wrappers.abstract_wrapper import AbstractWrapper 2 | from math import cos, exp, pi 3 | 4 | class EasomFunctionWrapper(AbstractWrapper): 5 | 6 | def maximum_decision_variable_values(self): 7 | return [10] 8 | 9 | def minimum_decision_variable_values(self): 10 | return [-10] 11 | 12 | def objective_function_value(self, decision_variable_values): 13 | return -cos(decision_variable_values[0]) * exp(-(decision_variable_values[0] - pi)**2) 14 | 15 | def initial_decision_variable_value_estimates(self): 16 | pass -------------------------------------------------------------------------------- /metaheuristic_algorithms/function_wrappers/michaelwicz_function_wrapper.py: -------------------------------------------------------------------------------- 1 | from metaheuristic_algorithms.function_wrappers.abstract_wrapper import AbstractWrapper 2 | from math import sin, pi 3 | 4 | class MichaelwiczFunctionWrapper(AbstractWrapper): 5 | 6 | def maximum_decision_variable_values(self): 7 | return [4, 4] 8 | 9 | def minimum_decision_variable_values(self): 10 | return [0, 0] 11 | 12 | def objective_function_value(self, decision_variable_values): 13 | return sin(decision_variable_values[0]) * (sin(decision_variable_values[0]**2 / pi))**20 - \ 14 | sin(decision_variable_values[1]) * (sin(decision_variable_values[1]**2 / pi))**20 15 | 16 | def initial_decision_variable_value_estimates(self): 17 | pass -------------------------------------------------------------------------------- /metaheuristic_algorithms/function_wrappers/nonsmooth_multipeak_function_wrapper.py: -------------------------------------------------------------------------------- 1 | from metaheuristic_algorithms.function_wrappers.abstract_wrapper import AbstractWrapper 2 | from math import exp 3 | 4 | class NonsmoothMultipeakFunctionWrapper(AbstractWrapper): 5 | 6 | def maximum_decision_variable_values(self): 7 | return [5, 5] 8 | 9 | def minimum_decision_variable_values(self): 10 | return [-5, -5] 11 | 12 | def objective_function_value(self, decision_variable_values): 13 | return (abs(decision_variable_values[0]) + abs(decision_variable_values[1])) * exp(-0.0625 * (decision_variable_values[0]**2 + decision_variable_values[1]**2)) 14 | 15 | def initial_decision_variable_value_estimates(self): 16 | pass -------------------------------------------------------------------------------- /metaheuristic_algorithms/function_wrappers/rosenbrook_function_wrapper.py: -------------------------------------------------------------------------------- 1 | from metaheuristic_algorithms.function_wrappers.abstract_wrapper import AbstractWrapper 2 | 3 | class RosenbrookFunctionWrapper(AbstractWrapper): 4 | 5 | def maximum_decision_variable_values(self): 6 | return [5, 5] 7 | 8 | def minimum_decision_variable_values(self): 9 | return [-5, -5] 10 | 11 | def objective_function_value(self, decision_variable_values): 12 | return (1 - decision_variable_values[0])**2 + 100 * (decision_variable_values[1] - decision_variable_values[0]**2)**2 13 | 14 | def initial_decision_variable_value_estimates(self): 15 | return [2, 2] -------------------------------------------------------------------------------- /metaheuristic_algorithms/version.py: -------------------------------------------------------------------------------- 1 | # Based on Semantic Versioning (http://semver.org/) 2 | __version__ = "0.1.6" -------------------------------------------------------------------------------- /tests/metaheuristic_algorithms/test_firefly_algorithm.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from metaheuristic_algorithms.firefly_algorithm import FireflyAlgorithm 3 | from metaheuristic_algorithms.function_wrappers.nonsmooth_multipeak_function_wrapper import NonsmoothMultipeakFunctionWrapper 4 | 5 | class TestFireflyAlgorithm(unittest.TestCase): 6 | 7 | def test_find_glocal_maximum_for_nonsmooth_multipeak_function(self): 8 | 9 | nonsmooth_multipeak_function_wrapper = NonsmoothMultipeakFunctionWrapper() 10 | 11 | number_of_variables = 2 12 | objective = "maximization" 13 | 14 | firefly_algorithm = FireflyAlgorithm(nonsmooth_multipeak_function_wrapper, number_of_variables, objective) 15 | 16 | number_of_fireflies = 10 17 | maximun_generation = 10 18 | randomization_parameter_alpha = 0.2 19 | absorption_coefficient_gamma = 1.0 20 | 21 | result = firefly_algorithm.search(number_of_fireflies = number_of_fireflies, maximun_generation = maximun_generation, 22 | randomization_parameter_alpha = randomization_parameter_alpha, absorption_coefficient_gamma = absorption_coefficient_gamma) 23 | 24 | # TODO: Improve accuracy: 25 | self.assertAlmostEqual(result["best_decision_variable_values"][0], 2.8327, delta = 5) 26 | self.assertAlmostEqual(result["best_decision_variable_values"][1], -0.0038, delta = 5) 27 | self.assertAlmostEqual(result["best_objective_function_value"], 3.4310, delta = 5) 28 | 29 | if __name__ == '__main__': 30 | unittest.main() -------------------------------------------------------------------------------- /tests/metaheuristic_algorithms/test_genetic_algorithm.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from metaheuristic_algorithms.genetic_algorithm import GeneticAlgorithm 3 | from metaheuristic_algorithms.function_wrappers.easom_function_wrapper import EasomFunctionWrapper 4 | 5 | class TestGeneticAlgorithm(unittest.TestCase): 6 | 7 | @unittest.skip("Need to find a way to convert float to binary and vice versa") 8 | def test_find_glocal_minimum_for_easom_function(self): 9 | 10 | easom_function_wrapper = EasomFunctionWrapper() 11 | 12 | number_of_variables = 1 13 | objective = "maximization" 14 | 15 | genetic_algorithm = GeneticAlgorithm(easom_function_wrapper, number_of_variables, objective) 16 | 17 | population_size = 20 18 | maximum_number_of_generations = 100 19 | number_of_mutation_sites = 2 20 | crossover_probability = 0.95 21 | mutation_probability = 0.05 22 | 23 | result = genetic_algorithm.search(population_size = population_size, maximum_number_of_generations = maximum_number_of_generations, 24 | number_of_mutation_sites = number_of_mutation_sites, crossover_probability = crossover_probability, 25 | mutation_probability = mutation_probability) 26 | 27 | self.assertAlmostEqual(result["best_decision_variable_values"][0], 3.1416, delta = 1) 28 | self.assertAlmostEqual(result["best_objective_function_value"], 1.000, delta = 1) 29 | 30 | if __name__ == '__main__': 31 | unittest.main() -------------------------------------------------------------------------------- /tests/metaheuristic_algorithms/test_harmony_search.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from metaheuristic_algorithms.harmony_search import HarmonySearch 3 | from metaheuristic_algorithms.function_wrappers.rosenbrook_function_wrapper import RosenbrookFunctionWrapper 4 | 5 | class TestHarmonySearch(unittest.TestCase): 6 | 7 | def test_find_glocal_minimum_for_rosenbrook_function(self): 8 | 9 | rosenbrook_function_wrapper = RosenbrookFunctionWrapper() 10 | 11 | number_of_variables = 2 12 | objective = "minimization" 13 | 14 | harmony_search = HarmonySearch(rosenbrook_function_wrapper, number_of_variables, objective) 15 | 16 | maximum_attempt = 25000 17 | pitch_adjusting_range = 100 18 | harmony_search_size = 20 19 | harmony_memory_acceping_rate = 0.95 20 | pitch_adjusting_rate = 0.7 21 | 22 | result = harmony_search.search(maximum_attempt = maximum_attempt, pitch_adjusting_range = pitch_adjusting_range, 23 | harmony_search_size = harmony_search_size, harmony_memory_acceping_rate = harmony_memory_acceping_rate, 24 | pitch_adjusting_rate = pitch_adjusting_rate) 25 | 26 | self.assertAlmostEqual(result["best_decision_variable_values"][0], 1.0112, delta = 1) 27 | self.assertAlmostEqual(result["best_decision_variable_values"][1], 0.9988, delta = 1) 28 | self.assertAlmostEqual(result["best_objective_function_value"], 0.0563, delta = 1) 29 | 30 | if __name__ == '__main__': 31 | unittest.main() -------------------------------------------------------------------------------- /tests/metaheuristic_algorithms/test_simplified_particle_swarm_optimization.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from metaheuristic_algorithms.simplified_particle_swarm_optimization import SimplifiedParticleSwarmOptimization 3 | from metaheuristic_algorithms.function_wrappers.michaelwicz_function_wrapper import MichaelwiczFunctionWrapper 4 | 5 | class TestSimplifiedParticleSwarmOptimization(unittest.TestCase): 6 | 7 | def test_find_glocal_minimum_for_michaelwicz_function(self): 8 | 9 | michaelwicz_function_wrapper = MichaelwiczFunctionWrapper() 10 | 11 | number_of_variables = 2 12 | objective = "minimization" 13 | 14 | simplified_particle_swarm_optimization = SimplifiedParticleSwarmOptimization(michaelwicz_function_wrapper, number_of_variables, objective) 15 | 16 | number_of_particiles = 20 17 | number_of_iterations = 15 18 | social_coefficient = 0.5 19 | random_variable_coefficient = 0.2 20 | 21 | result = simplified_particle_swarm_optimization.search(number_of_particiles = number_of_particiles, number_of_iterations = number_of_iterations, 22 | social_coefficient = social_coefficient, random_variable_coefficient = random_variable_coefficient) 23 | 24 | self.assertAlmostEqual(result["best_decision_variable_values"][0], 2.1701, delta = 1) 25 | self.assertAlmostEqual(result["best_decision_variable_values"][1], 1.5703, delta = 1) 26 | self.assertAlmostEqual(result["best_objective_function_value"], -1.7843, delta = 1) 27 | 28 | if __name__ == '__main__': 29 | unittest.main() -------------------------------------------------------------------------------- /tests/metaheuristic_algorithms/test_simulated_annealing.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from metaheuristic_algorithms.simulated_annealing import SimulatedAnnealing 3 | from metaheuristic_algorithms.function_wrappers.rosenbrook_function_wrapper import RosenbrookFunctionWrapper 4 | 5 | class TestSimulatedAnnealing(unittest.TestCase): 6 | 7 | def test_find_glocal_minimum_for_rosenbrook_function(self): 8 | 9 | rosenbrook_function_wrapper = RosenbrookFunctionWrapper() 10 | 11 | number_of_variables = 2 12 | objective = "minimization" 13 | 14 | simulated_annealing = SimulatedAnnealing(rosenbrook_function_wrapper, number_of_variables, objective) 15 | 16 | temperature = 1.0 17 | minimal_temperature = 1e-10 # Final stopping temperature 18 | # minimal_temperature = 1e-1 # Final stopping temperature 19 | maximum_number_of_rejections = 2500 20 | # maximum_number_of_rejections = 1000 21 | maximum_number_of_runs = 500 22 | # maximum_number_of_runs = 100 23 | maximum_number_of_acceptances = 15 24 | bolzmann_constant = 1 25 | cooling_factor = 0.95 26 | energy_norm = 1e-8 27 | # energy_norm = 1e-1 28 | standard_diviation_for_estimation = 1 29 | ratio_of_energy_delta_over_evaluation_delta = 1 30 | 31 | result = simulated_annealing.search(temperature, minimal_temperature, 32 | bolzmann_constant, energy_norm, 33 | maximum_number_of_rejections = maximum_number_of_rejections, 34 | maximum_number_of_runs = maximum_number_of_runs, 35 | maximum_number_of_acceptances = maximum_number_of_acceptances, 36 | cooling_factor = cooling_factor, 37 | standard_diviation_for_estimation = standard_diviation_for_estimation, 38 | ratio_of_energy_delta_over_evaluation_delta = ratio_of_energy_delta_over_evaluation_delta) 39 | 40 | self.assertAlmostEqual(result["best_decision_variable_values"][0], 1.0112, delta = 1) 41 | self.assertAlmostEqual(result["best_decision_variable_values"][1], 0.9988, delta = 1) 42 | self.assertAlmostEqual(result["best_objective_function_value"], 0.0563, delta = 1) 43 | 44 | if __name__ == '__main__': 45 | unittest.main() -------------------------------------------------------------------------------- /venv/.Python: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/Python -------------------------------------------------------------------------------- /venv/bin/activate: -------------------------------------------------------------------------------- 1 | # This file must be used with "source bin/activate" *from bash* 2 | # you cannot run it directly 3 | 4 | deactivate () { 5 | unset pydoc 6 | 7 | # reset old environment variables 8 | if [ -n "${_OLD_VIRTUAL_PATH-}" ] ; then 9 | PATH="$_OLD_VIRTUAL_PATH" 10 | export PATH 11 | unset _OLD_VIRTUAL_PATH 12 | fi 13 | if [ -n "${_OLD_VIRTUAL_PYTHONHOME-}" ] ; then 14 | PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME" 15 | export PYTHONHOME 16 | unset _OLD_VIRTUAL_PYTHONHOME 17 | fi 18 | 19 | # This should detect bash and zsh, which have a hash command that must 20 | # be called to get it to forget past commands. Without forgetting 21 | # past commands the $PATH changes we made may not be respected 22 | if [ -n "${BASH-}" -o -n "${ZSH_VERSION-}" ] ; then 23 | hash -r 2>/dev/null 24 | fi 25 | 26 | if [ -n "${_OLD_VIRTUAL_PS1-}" ] ; then 27 | PS1="$_OLD_VIRTUAL_PS1" 28 | export PS1 29 | unset _OLD_VIRTUAL_PS1 30 | fi 31 | 32 | unset VIRTUAL_ENV 33 | if [ ! "${1-}" = "nondestructive" ] ; then 34 | # Self destruct! 35 | unset -f deactivate 36 | fi 37 | } 38 | 39 | # unset irrelevant variables 40 | deactivate nondestructive 41 | 42 | VIRTUAL_ENV="/Users/tadatoshi/Documents/development/projects/metaheuristic_algorithms_python/venv" 43 | export VIRTUAL_ENV 44 | 45 | _OLD_VIRTUAL_PATH="$PATH" 46 | PATH="$VIRTUAL_ENV/bin:$PATH" 47 | export PATH 48 | 49 | # unset PYTHONHOME if set 50 | # this will fail if PYTHONHOME is set to the empty string (which is bad anyway) 51 | # could use `if (set -u; : $PYTHONHOME) ;` in bash 52 | if [ -n "${PYTHONHOME-}" ] ; then 53 | _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME" 54 | unset PYTHONHOME 55 | fi 56 | 57 | if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then 58 | _OLD_VIRTUAL_PS1="$PS1" 59 | if [ "x" != x ] ; then 60 | PS1="$PS1" 61 | else 62 | if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then 63 | # special case for Aspen magic directories 64 | # see http://www.zetadev.com/software/aspen/ 65 | PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1" 66 | else 67 | PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1" 68 | fi 69 | fi 70 | export PS1 71 | fi 72 | 73 | alias pydoc="python -m pydoc" 74 | 75 | # This should detect bash and zsh, which have a hash command that must 76 | # be called to get it to forget past commands. Without forgetting 77 | # past commands the $PATH changes we made may not be respected 78 | if [ -n "${BASH-}" -o -n "${ZSH_VERSION-}" ] ; then 79 | hash -r 2>/dev/null 80 | fi 81 | -------------------------------------------------------------------------------- /venv/bin/activate.csh: -------------------------------------------------------------------------------- 1 | # This file must be used with "source bin/activate.csh" *from csh*. 2 | # You cannot run it directly. 3 | # Created by Davide Di Blasi . 4 | 5 | alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc' 6 | 7 | # Unset irrelevant variables. 8 | deactivate nondestructive 9 | 10 | setenv VIRTUAL_ENV "/Users/tadatoshi/Documents/development/projects/metaheuristic_algorithms_python/venv" 11 | 12 | set _OLD_VIRTUAL_PATH="$PATH" 13 | setenv PATH "$VIRTUAL_ENV/bin:$PATH" 14 | 15 | 16 | 17 | if ("" != "") then 18 | set env_name = "" 19 | else 20 | if (`basename "$VIRTUAL_ENV"` == "__") then 21 | # special case for Aspen magic directories 22 | # see http://www.zetadev.com/software/aspen/ 23 | set env_name = `basename \`dirname "$VIRTUAL_ENV"\`` 24 | else 25 | set env_name = `basename "$VIRTUAL_ENV"` 26 | endif 27 | endif 28 | 29 | # Could be in a non-interactive environment, 30 | # in which case, $prompt is undefined and we wouldn't 31 | # care about the prompt anyway. 32 | if ( $?prompt ) then 33 | set _OLD_VIRTUAL_PROMPT="$prompt" 34 | set prompt = "[$env_name] $prompt" 35 | endif 36 | 37 | unset env_name 38 | 39 | alias pydoc python -m pydoc 40 | 41 | rehash 42 | 43 | -------------------------------------------------------------------------------- /venv/bin/activate.fish: -------------------------------------------------------------------------------- 1 | # This file must be used with "source bin/activate.fish" *from fish* (http://fishshell.com) 2 | # you cannot run it directly 3 | 4 | function deactivate -d "Exit virtualenv and return to normal shell environment" 5 | # reset old environment variables 6 | if test -n "$_OLD_VIRTUAL_PATH" 7 | set -gx PATH $_OLD_VIRTUAL_PATH 8 | set -e _OLD_VIRTUAL_PATH 9 | end 10 | if test -n "$_OLD_VIRTUAL_PYTHONHOME" 11 | set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME 12 | set -e _OLD_VIRTUAL_PYTHONHOME 13 | end 14 | 15 | if test -n "$_OLD_FISH_PROMPT_OVERRIDE" 16 | # set an empty local fish_function_path, so fish_prompt doesn't automatically reload 17 | set -l fish_function_path 18 | # erase the virtualenv's fish_prompt function, and restore the original 19 | functions -e fish_prompt 20 | functions -c _old_fish_prompt fish_prompt 21 | functions -e _old_fish_prompt 22 | set -e _OLD_FISH_PROMPT_OVERRIDE 23 | end 24 | 25 | set -e VIRTUAL_ENV 26 | if test "$argv[1]" != "nondestructive" 27 | # Self destruct! 28 | functions -e deactivate 29 | end 30 | end 31 | 32 | # unset irrelevant variables 33 | deactivate nondestructive 34 | 35 | set -gx VIRTUAL_ENV "/Users/tadatoshi/Documents/development/projects/metaheuristic_algorithms_python/venv" 36 | 37 | set -gx _OLD_VIRTUAL_PATH $PATH 38 | set -gx PATH "$VIRTUAL_ENV/bin" $PATH 39 | 40 | # unset PYTHONHOME if set 41 | if set -q PYTHONHOME 42 | set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME 43 | set -e PYTHONHOME 44 | end 45 | 46 | if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" 47 | # fish uses a function instead of an env var to generate the prompt. 48 | 49 | # copy the current fish_prompt function as the function _old_fish_prompt 50 | functions -c fish_prompt _old_fish_prompt 51 | 52 | # with the original prompt function copied, we can override with our own. 53 | function fish_prompt 54 | # Prompt override? 55 | if test -n "" 56 | printf "%s%s" "" (set_color normal) 57 | _old_fish_prompt 58 | return 59 | end 60 | # ...Otherwise, prepend env 61 | set -l _checkbase (basename "$VIRTUAL_ENV") 62 | if test $_checkbase = "__" 63 | # special case for Aspen magic directories 64 | # see http://www.zetadev.com/software/aspen/ 65 | printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal) 66 | _old_fish_prompt 67 | else 68 | printf "%s(%s)%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal) 69 | _old_fish_prompt 70 | end 71 | end 72 | 73 | set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" 74 | end 75 | -------------------------------------------------------------------------------- /venv/bin/activate_this.py: -------------------------------------------------------------------------------- 1 | """By using execfile(this_file, dict(__file__=this_file)) you will 2 | activate this virtualenv environment. 3 | 4 | This can be used when you must use an existing Python interpreter, not 5 | the virtualenv bin/python 6 | """ 7 | 8 | try: 9 | __file__ 10 | except NameError: 11 | raise AssertionError( 12 | "You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))") 13 | import sys 14 | import os 15 | 16 | old_os_path = os.environ.get('PATH', '') 17 | os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path 18 | base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 19 | if sys.platform == 'win32': 20 | site_packages = os.path.join(base, 'Lib', 'site-packages') 21 | else: 22 | site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages') 23 | prev_sys_path = list(sys.path) 24 | import site 25 | site.addsitedir(site_packages) 26 | sys.real_prefix = sys.prefix 27 | sys.prefix = base 28 | # Move the added items to the front of the path: 29 | new_sys_path = [] 30 | for item in list(sys.path): 31 | if item not in prev_sys_path: 32 | new_sys_path.append(item) 33 | sys.path.remove(item) 34 | sys.path[:0] = new_sys_path 35 | -------------------------------------------------------------------------------- /venv/bin/easy_install: -------------------------------------------------------------------------------- 1 | #!/Users/tadatoshi/Documents/development/projects/metaheuristic_algorithms_python/venv/bin/python3.5 2 | 3 | # -*- coding: utf-8 -*- 4 | import re 5 | import sys 6 | 7 | from setuptools.command.easy_install import main 8 | 9 | if __name__ == '__main__': 10 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 11 | sys.exit(main()) 12 | -------------------------------------------------------------------------------- /venv/bin/easy_install-3.5: -------------------------------------------------------------------------------- 1 | #!/Users/tadatoshi/Documents/development/projects/metaheuristic_algorithms_python/venv/bin/python3.5 2 | 3 | # -*- coding: utf-8 -*- 4 | import re 5 | import sys 6 | 7 | from setuptools.command.easy_install import main 8 | 9 | if __name__ == '__main__': 10 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 11 | sys.exit(main()) 12 | -------------------------------------------------------------------------------- /venv/bin/pip: -------------------------------------------------------------------------------- 1 | #!/Users/tadatoshi/Documents/development/projects/metaheuristic_algorithms_python/venv/bin/python3.5 2 | 3 | # -*- coding: utf-8 -*- 4 | import re 5 | import sys 6 | 7 | from pip import main 8 | 9 | if __name__ == '__main__': 10 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 11 | sys.exit(main()) 12 | -------------------------------------------------------------------------------- /venv/bin/pip3: -------------------------------------------------------------------------------- 1 | #!/Users/tadatoshi/Documents/development/projects/metaheuristic_algorithms_python/venv/bin/python3.5 2 | 3 | # -*- coding: utf-8 -*- 4 | import re 5 | import sys 6 | 7 | from pip import main 8 | 9 | if __name__ == '__main__': 10 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 11 | sys.exit(main()) 12 | -------------------------------------------------------------------------------- /venv/bin/pip3.5: -------------------------------------------------------------------------------- 1 | #!/Users/tadatoshi/Documents/development/projects/metaheuristic_algorithms_python/venv/bin/python3.5 2 | 3 | # -*- coding: utf-8 -*- 4 | import re 5 | import sys 6 | 7 | from pip import main 8 | 9 | if __name__ == '__main__': 10 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 11 | sys.exit(main()) 12 | -------------------------------------------------------------------------------- /venv/bin/python: -------------------------------------------------------------------------------- 1 | python3.5 -------------------------------------------------------------------------------- /venv/bin/python3: -------------------------------------------------------------------------------- 1 | python3.5 -------------------------------------------------------------------------------- /venv/bin/python3.5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/bin/python3.5 -------------------------------------------------------------------------------- /venv/bin/wheel: -------------------------------------------------------------------------------- 1 | #!/Users/tadatoshi/Documents/development/projects/metaheuristic_algorithms_python/venv/bin/python3.5 2 | 3 | # -*- coding: utf-8 -*- 4 | import re 5 | import sys 6 | 7 | from wheel.tool import main 8 | 9 | if __name__ == '__main__': 10 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) 11 | sys.exit(main()) 12 | -------------------------------------------------------------------------------- /venv/include/python3.5m: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m -------------------------------------------------------------------------------- /venv/lib/python3.5/__future__.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/__future__.py -------------------------------------------------------------------------------- /venv/lib/python3.5/_bootlocale.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/_bootlocale.py -------------------------------------------------------------------------------- /venv/lib/python3.5/_collections_abc.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/_collections_abc.py -------------------------------------------------------------------------------- /venv/lib/python3.5/_dummy_thread.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/_dummy_thread.py -------------------------------------------------------------------------------- /venv/lib/python3.5/_weakrefset.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/_weakrefset.py -------------------------------------------------------------------------------- /venv/lib/python3.5/abc.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/abc.py -------------------------------------------------------------------------------- /venv/lib/python3.5/base64.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/base64.py -------------------------------------------------------------------------------- /venv/lib/python3.5/bisect.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/bisect.py -------------------------------------------------------------------------------- /venv/lib/python3.5/codecs.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/codecs.py -------------------------------------------------------------------------------- /venv/lib/python3.5/collections: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/collections -------------------------------------------------------------------------------- /venv/lib/python3.5/config-3.5m: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/config-3.5m -------------------------------------------------------------------------------- /venv/lib/python3.5/copy.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/copy.py -------------------------------------------------------------------------------- /venv/lib/python3.5/copyreg.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/copyreg.py -------------------------------------------------------------------------------- /venv/lib/python3.5/distutils/distutils.cfg: -------------------------------------------------------------------------------- 1 | # This is a config file local to this virtualenv installation 2 | # You may include options that will be used by all distutils commands, 3 | # and by easy_install. For instance: 4 | # 5 | # [easy_install] 6 | # find_links = http://mylocalsite 7 | -------------------------------------------------------------------------------- /venv/lib/python3.5/encodings: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/encodings -------------------------------------------------------------------------------- /venv/lib/python3.5/fnmatch.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/fnmatch.py -------------------------------------------------------------------------------- /venv/lib/python3.5/functools.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/functools.py -------------------------------------------------------------------------------- /venv/lib/python3.5/genericpath.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/genericpath.py -------------------------------------------------------------------------------- /venv/lib/python3.5/hashlib.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/hashlib.py -------------------------------------------------------------------------------- /venv/lib/python3.5/heapq.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/heapq.py -------------------------------------------------------------------------------- /venv/lib/python3.5/hmac.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/hmac.py -------------------------------------------------------------------------------- /venv/lib/python3.5/imp.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/imp.py -------------------------------------------------------------------------------- /venv/lib/python3.5/importlib: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib -------------------------------------------------------------------------------- /venv/lib/python3.5/io.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/io.py -------------------------------------------------------------------------------- /venv/lib/python3.5/keyword.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/keyword.py -------------------------------------------------------------------------------- /venv/lib/python3.5/lib-dynload: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload -------------------------------------------------------------------------------- /venv/lib/python3.5/linecache.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/linecache.py -------------------------------------------------------------------------------- /venv/lib/python3.5/locale.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/locale.py -------------------------------------------------------------------------------- /venv/lib/python3.5/no-global-site-packages.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/no-global-site-packages.txt -------------------------------------------------------------------------------- /venv/lib/python3.5/ntpath.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ntpath.py -------------------------------------------------------------------------------- /venv/lib/python3.5/operator.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/operator.py -------------------------------------------------------------------------------- /venv/lib/python3.5/orig-prefix.txt: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5 -------------------------------------------------------------------------------- /venv/lib/python3.5/os.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/os.py -------------------------------------------------------------------------------- /venv/lib/python3.5/plat-darwin: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/plat-darwin -------------------------------------------------------------------------------- /venv/lib/python3.5/posixpath.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/posixpath.py -------------------------------------------------------------------------------- /venv/lib/python3.5/random.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/random.py -------------------------------------------------------------------------------- /venv/lib/python3.5/re.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/re.py -------------------------------------------------------------------------------- /venv/lib/python3.5/readline.so: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload/readline.cpython-35m-darwin.so -------------------------------------------------------------------------------- /venv/lib/python3.5/reprlib.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/reprlib.py -------------------------------------------------------------------------------- /venv/lib/python3.5/rlcompleter.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/rlcompleter.py -------------------------------------------------------------------------------- /venv/lib/python3.5/shutil.py: -------------------------------------------------------------------------------- 1 | /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/shutil.py -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/_markerlib/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | import ast 3 | from _markerlib.markers import default_environment, compile, interpret 4 | except ImportError: 5 | if 'ast' in globals(): 6 | raise 7 | def default_environment(): 8 | return {} 9 | def compile(marker): 10 | def marker_fn(environment=None, override=None): 11 | # 'empty markers are True' heuristic won't install extra deps. 12 | return not marker.strip() 13 | marker_fn.__doc__ = marker 14 | return marker_fn 15 | def interpret(marker, environment=None, override=None): 16 | return compile(marker)() 17 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/easy_install.py: -------------------------------------------------------------------------------- 1 | """Run the EasyInstall command""" 2 | 3 | if __name__ == '__main__': 4 | from setuptools.command.easy_install import main 5 | main() 6 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip-7.1.2.dist-info/DESCRIPTION.rst: -------------------------------------------------------------------------------- 1 | pip 2 | === 3 | 4 | The `PyPA recommended 5 | `_ 6 | tool for installing Python packages. 7 | 8 | * `Installation `_ 9 | * `Documentation `_ 10 | * `Changelog `_ 11 | * `Github Page `_ 12 | * `Issue Tracking `_ 13 | * `User mailing list `_ 14 | * `Dev mailing list `_ 15 | * User IRC: #pypa on Freenode. 16 | * Dev IRC: #pypa-dev on Freenode. 17 | 18 | 19 | .. image:: https://pypip.in/v/pip/badge.png 20 | :target: https://pypi.python.org/pypi/pip 21 | 22 | .. image:: https://secure.travis-ci.org/pypa/pip.png?branch=develop 23 | :target: http://travis-ci.org/pypa/pip 24 | 25 | 26 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip-7.1.2.dist-info/METADATA: -------------------------------------------------------------------------------- 1 | Metadata-Version: 2.0 2 | Name: pip 3 | Version: 7.1.2 4 | Summary: The PyPA recommended tool for installing Python packages. 5 | Home-page: https://pip.pypa.io/ 6 | Author: The pip developers 7 | Author-email: python-virtualenv@groups.google.com 8 | License: MIT 9 | Keywords: easy_install distutils setuptools egg virtualenv 10 | Platform: UNKNOWN 11 | Classifier: Development Status :: 5 - Production/Stable 12 | Classifier: Intended Audience :: Developers 13 | Classifier: License :: OSI Approved :: MIT License 14 | Classifier: Topic :: Software Development :: Build Tools 15 | Classifier: Programming Language :: Python :: 2 16 | Classifier: Programming Language :: Python :: 2.6 17 | Classifier: Programming Language :: Python :: 2.7 18 | Classifier: Programming Language :: Python :: 3 19 | Classifier: Programming Language :: Python :: 3.2 20 | Classifier: Programming Language :: Python :: 3.3 21 | Classifier: Programming Language :: Python :: 3.4 22 | Classifier: Programming Language :: Python :: Implementation :: PyPy 23 | Provides-Extra: testing 24 | Requires-Dist: pytest; extra == 'testing' 25 | Requires-Dist: virtualenv (>=1.10); extra == 'testing' 26 | Requires-Dist: scripttest (>=1.3); extra == 'testing' 27 | Requires-Dist: mock; extra == 'testing' 28 | 29 | pip 30 | === 31 | 32 | The `PyPA recommended 33 | `_ 34 | tool for installing Python packages. 35 | 36 | * `Installation `_ 37 | * `Documentation `_ 38 | * `Changelog `_ 39 | * `Github Page `_ 40 | * `Issue Tracking `_ 41 | * `User mailing list `_ 42 | * `Dev mailing list `_ 43 | * User IRC: #pypa on Freenode. 44 | * Dev IRC: #pypa-dev on Freenode. 45 | 46 | 47 | .. image:: https://pypip.in/v/pip/badge.png 48 | :target: https://pypi.python.org/pypi/pip 49 | 50 | .. image:: https://secure.travis-ci.org/pypa/pip.png?branch=develop 51 | :target: http://travis-ci.org/pypa/pip 52 | 53 | 54 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip-7.1.2.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.24.0) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip-7.1.2.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | pip = pip:main 3 | pip3 = pip:main 4 | pip3.4 = pip:main 5 | 6 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip-7.1.2.dist-info/metadata.json: -------------------------------------------------------------------------------- 1 | {"extensions": {"python.details": {"project_urls": {"Home": "https://pip.pypa.io/"}, "contacts": [{"name": "The pip developers", "email": "python-virtualenv@groups.google.com", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}}, "python.commands": {"wrap_console": {"pip3": "pip:main", "pip3.4": "pip:main", "pip": "pip:main"}}, "python.exports": {"console_scripts": {"pip3": "pip:main", "pip3.4": "pip:main", "pip": "pip:main"}}}, "version": "7.1.2", "name": "pip", "license": "MIT", "classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Build Tools", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: PyPy"], "extras": ["testing"], "summary": "The PyPA recommended tool for installing Python packages.", "generator": "bdist_wheel (0.24.0)", "keywords": ["easy_install", "distutils", "setuptools", "egg", "virtualenv"], "metadata_version": "2.0", "run_requires": [{"extra": "testing", "requires": ["pytest", "virtualenv (>=1.10)", "scripttest (>=1.3)", "mock"]}], "test_requires": [{"requires": ["pytest", "virtualenv (>=1.10)", "scripttest (>=1.3)", "mock"]}]} -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip-7.1.2.dist-info/pbr.json: -------------------------------------------------------------------------------- 1 | {"is_release": true, "git_version": "78daccc"} -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip-7.1.2.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/__main__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import os 4 | import sys 5 | 6 | # If we are running from a wheel, add the wheel to sys.path 7 | # This allows the usage python pip-*.whl/pip install pip-*.whl 8 | if __package__ == '': 9 | # __file__ is pip-*.whl/pip/__main__.py 10 | # first dirname call strips of '/__main__.py', second strips off '/pip' 11 | # Resulting path is the name of the wheel itself 12 | # Add that to sys.path so we can import pip 13 | path = os.path.dirname(os.path.dirname(__file__)) 14 | sys.path.insert(0, path) 15 | 16 | import pip # noqa 17 | 18 | if __name__ == '__main__': 19 | sys.exit(pip.main()) 20 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | pip._vendor is for vendoring dependencies of pip to prevent needing pip to 3 | depend on something external. 4 | 5 | Files inside of pip._vendor should be considered immutable and should only be 6 | updated to versions from upstream. 7 | """ 8 | from __future__ import absolute_import 9 | 10 | import glob 11 | import os.path 12 | import sys 13 | 14 | # Downstream redistributors which have debundled our dependencies should also 15 | # patch this value to be true. This will trigger the additional patching 16 | # to cause things like "six" to be available as pip. 17 | DEBUNDLED = False 18 | 19 | # By default, look in this directory for a bunch of .whl files which we will 20 | # add to the beginning of sys.path before attempting to import anything. This 21 | # is done to support downstream re-distributors like Debian and Fedora who 22 | # wish to create their own Wheels for our dependencies to aid in debundling. 23 | WHEEL_DIR = os.path.abspath(os.path.dirname(__file__)) 24 | 25 | 26 | # Define a small helper function to alias our vendored modules to the real ones 27 | # if the vendored ones do not exist. This idea of this was taken from 28 | # https://github.com/kennethreitz/requests/pull/2567. 29 | def vendored(modulename): 30 | vendored_name = "{0}.{1}".format(__name__, modulename) 31 | 32 | try: 33 | __import__(vendored_name, globals(), locals(), level=0) 34 | except ImportError: 35 | __import__(modulename, globals(), locals(), level=0) 36 | sys.modules[vendored_name] = sys.modules[modulename] 37 | base, head = vendored_name.rsplit(".", 1) 38 | setattr(sys.modules[base], head, sys.modules[modulename]) 39 | 40 | 41 | # If we're operating in a debundled setup, then we want to go ahead and trigger 42 | # the aliasing of our vendored libraries as well as looking for wheels to add 43 | # to our sys.path. This will cause all of this code to be a no-op typically 44 | # however downstream redistributors can enable it in a consistent way across 45 | # all platforms. 46 | if DEBUNDLED: 47 | # Actually look inside of WHEEL_DIR to find .whl files and add them to the 48 | # front of our sys.path. 49 | sys.path[:] = glob.glob(os.path.join(WHEEL_DIR, "*.whl")) + sys.path 50 | 51 | # Actually alias all of our vendored dependencies. 52 | vendored("cachecontrol") 53 | vendored("colorama") 54 | vendored("distlib") 55 | vendored("html5lib") 56 | vendored("lockfile") 57 | vendored("six") 58 | vendored("six.moves") 59 | vendored("six.moves.urllib") 60 | vendored("packaging") 61 | vendored("packaging.version") 62 | vendored("packaging.specifiers") 63 | vendored("pkg_resources") 64 | vendored("progress") 65 | vendored("retrying") 66 | vendored("requests") 67 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/_markerlib/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | import ast 3 | from pip._vendor._markerlib.markers import default_environment, compile, interpret 4 | except ImportError: 5 | if 'ast' in globals(): 6 | raise 7 | def default_environment(): 8 | return {} 9 | def compile(marker): 10 | def marker_fn(environment=None, override=None): 11 | # 'empty markers are True' heuristic won't install extra deps. 12 | return not marker.strip() 13 | marker_fn.__doc__ = marker 14 | return marker_fn 15 | def interpret(marker, environment=None, override=None): 16 | return compile(marker)() 17 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/cachecontrol/__init__.py: -------------------------------------------------------------------------------- 1 | """CacheControl import Interface. 2 | 3 | Make it easy to import from cachecontrol without long namespaces. 4 | """ 5 | __author__ = 'Eric Larson' 6 | __email__ = 'eric@ionrock.org' 7 | __version__ = '0.11.5' 8 | 9 | from .wrapper import CacheControl 10 | from .adapter import CacheControlAdapter 11 | from .controller import CacheController 12 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/cachecontrol/cache.py: -------------------------------------------------------------------------------- 1 | """ 2 | The cache object API for implementing caches. The default is a thread 3 | safe in-memory dictionary. 4 | """ 5 | from threading import Lock 6 | 7 | 8 | class BaseCache(object): 9 | 10 | def get(self, key): 11 | raise NotImplemented() 12 | 13 | def set(self, key, value): 14 | raise NotImplemented() 15 | 16 | def delete(self, key): 17 | raise NotImplemented() 18 | 19 | def close(self): 20 | pass 21 | 22 | 23 | class DictCache(BaseCache): 24 | 25 | def __init__(self, init_dict=None): 26 | self.lock = Lock() 27 | self.data = init_dict or {} 28 | 29 | def get(self, key): 30 | return self.data.get(key, None) 31 | 32 | def set(self, key, value): 33 | with self.lock: 34 | self.data.update({key: value}) 35 | 36 | def delete(self, key): 37 | with self.lock: 38 | if key in self.data: 39 | self.data.pop(key) 40 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/__init__.py: -------------------------------------------------------------------------------- 1 | from textwrap import dedent 2 | 3 | try: 4 | from .file_cache import FileCache 5 | except ImportError: 6 | notice = dedent(''' 7 | NOTE: In order to use the FileCache you must have 8 | lockfile installed. You can install it via pip: 9 | pip install lockfile 10 | ''') 11 | print(notice) 12 | 13 | 14 | try: 15 | import redis 16 | from .redis_cache import RedisCache 17 | except ImportError: 18 | pass 19 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py: -------------------------------------------------------------------------------- 1 | from __future__ import division 2 | 3 | from datetime import datetime 4 | 5 | 6 | def total_seconds(td): 7 | """Python 2.6 compatability""" 8 | if hasattr(td, 'total_seconds'): 9 | return td.total_seconds() 10 | 11 | ms = td.microseconds 12 | secs = (td.seconds + td.days * 24 * 3600) 13 | return (ms + secs * 10**6) / 10**6 14 | 15 | 16 | class RedisCache(object): 17 | 18 | def __init__(self, conn): 19 | self.conn = conn 20 | 21 | def get(self, key): 22 | return self.conn.get(key) 23 | 24 | def set(self, key, value, expires=None): 25 | if not expires: 26 | self.conn.set(key, value) 27 | else: 28 | expires = expires - datetime.now() 29 | self.conn.setex(key, total_seconds(expires), value) 30 | 31 | def delete(self, key): 32 | self.conn.delete(key) 33 | 34 | def clear(self): 35 | """Helper for clearing all the keys in a database. Use with 36 | caution!""" 37 | for key in self.conn.keys(): 38 | self.conn.delete(key) 39 | 40 | def close(self): 41 | self.conn.disconnect() 42 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/cachecontrol/compat.py: -------------------------------------------------------------------------------- 1 | try: 2 | from urllib.parse import urljoin 3 | except ImportError: 4 | from urlparse import urljoin 5 | 6 | 7 | try: 8 | import cPickle as pickle 9 | except ImportError: 10 | import pickle 11 | 12 | 13 | from pip._vendor.requests.packages.urllib3.response import HTTPResponse 14 | from pip._vendor.requests.packages.urllib3.util import is_fp_closed 15 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/cachecontrol/filewrapper.py: -------------------------------------------------------------------------------- 1 | from io import BytesIO 2 | 3 | 4 | class CallbackFileWrapper(object): 5 | """ 6 | Small wrapper around a fp object which will tee everything read into a 7 | buffer, and when that file is closed it will execute a callback with the 8 | contents of that buffer. 9 | 10 | All attributes are proxied to the underlying file object. 11 | 12 | This class uses members with a double underscore (__) leading prefix so as 13 | not to accidentally shadow an attribute. 14 | """ 15 | 16 | def __init__(self, fp, callback): 17 | self.__buf = BytesIO() 18 | self.__fp = fp 19 | self.__callback = callback 20 | 21 | def __getattr__(self, name): 22 | # The vaguaries of garbage collection means that self.__fp is 23 | # not always set. By using __getattribute__ and the private 24 | # name[0] allows looking up the attribute value and raising an 25 | # AttributeError when it doesn't exist. This stop thigns from 26 | # infinitely recursing calls to getattr in the case where 27 | # self.__fp hasn't been set. 28 | # 29 | # [0] https://docs.python.org/2/reference/expressions.html#atom-identifiers 30 | fp = self.__getattribute__('_CallbackFileWrapper__fp') 31 | return getattr(fp, name) 32 | 33 | def __is_fp_closed(self): 34 | try: 35 | return self.__fp.fp is None 36 | except AttributeError: 37 | pass 38 | 39 | try: 40 | return self.__fp.closed 41 | except AttributeError: 42 | pass 43 | 44 | # We just don't cache it then. 45 | # TODO: Add some logging here... 46 | return False 47 | 48 | def read(self, amt=None): 49 | data = self.__fp.read(amt) 50 | self.__buf.write(data) 51 | 52 | if self.__is_fp_closed(): 53 | if self.__callback: 54 | self.__callback(self.__buf.getvalue()) 55 | 56 | # We assign this to None here, because otherwise we can get into 57 | # really tricky problems where the CPython interpreter dead locks 58 | # because the callback is holding a reference to something which 59 | # has a __del__ method. Setting this to None breaks the cycle 60 | # and allows the garbage collector to do it's thing normally. 61 | self.__callback = None 62 | 63 | return data 64 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/cachecontrol/wrapper.py: -------------------------------------------------------------------------------- 1 | from .adapter import CacheControlAdapter 2 | from .cache import DictCache 3 | 4 | 5 | def CacheControl(sess, 6 | cache=None, 7 | cache_etags=True, 8 | serializer=None, 9 | heuristic=None): 10 | 11 | cache = cache or DictCache() 12 | adapter = CacheControlAdapter( 13 | cache, 14 | cache_etags=cache_etags, 15 | serializer=serializer, 16 | heuristic=heuristic, 17 | ) 18 | sess.mount('http://', adapter) 19 | sess.mount('https://', adapter) 20 | 21 | return sess 22 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/colorama/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | from .initialise import init, deinit, reinit 3 | from .ansi import Fore, Back, Style, Cursor 4 | from .ansitowin32 import AnsiToWin32 5 | 6 | __version__ = '0.3.3' 7 | 8 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/colorama/initialise.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | import atexit 3 | import sys 4 | 5 | from .ansitowin32 import AnsiToWin32 6 | 7 | 8 | orig_stdout = sys.stdout 9 | orig_stderr = sys.stderr 10 | 11 | wrapped_stdout = sys.stdout 12 | wrapped_stderr = sys.stderr 13 | 14 | atexit_done = False 15 | 16 | 17 | def reset_all(): 18 | AnsiToWin32(orig_stdout).reset_all() 19 | 20 | 21 | def init(autoreset=False, convert=None, strip=None, wrap=True): 22 | 23 | if not wrap and any([autoreset, convert, strip]): 24 | raise ValueError('wrap=False conflicts with any other arg=True') 25 | 26 | global wrapped_stdout, wrapped_stderr 27 | if sys.stdout is None: 28 | wrapped_stdout = None 29 | else: 30 | sys.stdout = wrapped_stdout = \ 31 | wrap_stream(orig_stdout, convert, strip, autoreset, wrap) 32 | if sys.stderr is None: 33 | wrapped_stderr = None 34 | else: 35 | sys.stderr = wrapped_stderr = \ 36 | wrap_stream(orig_stderr, convert, strip, autoreset, wrap) 37 | 38 | global atexit_done 39 | if not atexit_done: 40 | atexit.register(reset_all) 41 | atexit_done = True 42 | 43 | 44 | def deinit(): 45 | if orig_stdout is not None: 46 | sys.stdout = orig_stdout 47 | if orig_stderr is not None: 48 | sys.stderr = orig_stderr 49 | 50 | 51 | def reinit(): 52 | if wrapped_stdout is not None: 53 | sys.stdout = wrapped_stdout 54 | if wrapped_stderr is not None: 55 | sys.stderr = wrapped_stderr 56 | 57 | 58 | def wrap_stream(stream, convert, strip, autoreset, wrap): 59 | if wrap: 60 | wrapper = AnsiToWin32(stream, 61 | convert=convert, strip=strip, autoreset=autoreset) 62 | if wrapper.should_wrap(): 63 | stream = wrapper.stream 64 | return stream 65 | 66 | 67 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/distlib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2012-2014 Vinay Sajip. 4 | # Licensed to the Python Software Foundation under a contributor agreement. 5 | # See LICENSE.txt and CONTRIBUTORS.txt. 6 | # 7 | import logging 8 | 9 | __version__ = '0.2.1' 10 | 11 | class DistlibException(Exception): 12 | pass 13 | 14 | try: 15 | from logging import NullHandler 16 | except ImportError: # pragma: no cover 17 | class NullHandler(logging.Handler): 18 | def handle(self, record): pass 19 | def emit(self, record): pass 20 | def createLock(self): self.lock = None 21 | 22 | logger = logging.getLogger(__name__) 23 | logger.addHandler(NullHandler()) 24 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/distlib/_backport/__init__.py: -------------------------------------------------------------------------------- 1 | """Modules copied from Python 3 standard libraries, for internal use only. 2 | 3 | Individual classes and functions are found in d2._backport.misc. Intended 4 | usage is to always import things missing from 3.1 from that module: the 5 | built-in/stdlib objects will be used if found. 6 | """ 7 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/distlib/_backport/misc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2012 The Python Software Foundation. 4 | # See LICENSE.txt and CONTRIBUTORS.txt. 5 | # 6 | """Backports for individual classes and functions.""" 7 | 8 | import os 9 | import sys 10 | 11 | __all__ = ['cache_from_source', 'callable', 'fsencode'] 12 | 13 | 14 | try: 15 | from imp import cache_from_source 16 | except ImportError: 17 | def cache_from_source(py_file, debug=__debug__): 18 | ext = debug and 'c' or 'o' 19 | return py_file + ext 20 | 21 | 22 | try: 23 | callable = callable 24 | except NameError: 25 | from collections import Callable 26 | 27 | def callable(obj): 28 | return isinstance(obj, Callable) 29 | 30 | 31 | try: 32 | fsencode = os.fsencode 33 | except AttributeError: 34 | def fsencode(filename): 35 | if isinstance(filename, bytes): 36 | return filename 37 | elif isinstance(filename, str): 38 | return filename.encode(sys.getfilesystemencoding()) 39 | else: 40 | raise TypeError("expect bytes or str, not %s" % 41 | type(filename).__name__) 42 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/distlib/t32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/pip/_vendor/distlib/t32.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/distlib/t64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/pip/_vendor/distlib/t64.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/distlib/w32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/pip/_vendor/distlib/w32.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/distlib/w64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/pip/_vendor/distlib/w64.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | HTML parsing library based on the WHATWG "HTML5" 3 | specification. The parser is designed to be compatible with existing 4 | HTML found in the wild and implements well-defined error recovery that 5 | is largely compatible with modern desktop web browsers. 6 | 7 | Example usage: 8 | 9 | import html5lib 10 | f = open("my_document.html") 11 | tree = html5lib.parse(f) 12 | """ 13 | 14 | from __future__ import absolute_import, division, unicode_literals 15 | 16 | from .html5parser import HTMLParser, parse, parseFragment 17 | from .treebuilders import getTreeBuilder 18 | from .treewalkers import getTreeWalker 19 | from .serializer import serialize 20 | 21 | __all__ = ["HTMLParser", "parse", "parseFragment", "getTreeBuilder", 22 | "getTreeWalker", "serialize"] 23 | __version__ = "1.0b5" 24 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/filters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/pip/_vendor/html5lib/filters/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/filters/_base.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | 4 | class Filter(object): 5 | def __init__(self, source): 6 | self.source = source 7 | 8 | def __iter__(self): 9 | return iter(self.source) 10 | 11 | def __getattr__(self, name): 12 | return getattr(self.source, name) 13 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from . import _base 4 | 5 | try: 6 | from collections import OrderedDict 7 | except ImportError: 8 | from ordereddict import OrderedDict 9 | 10 | 11 | class Filter(_base.Filter): 12 | def __iter__(self): 13 | for token in _base.Filter.__iter__(self): 14 | if token["type"] in ("StartTag", "EmptyTag"): 15 | attrs = OrderedDict() 16 | for name, value in sorted(token["data"].items(), 17 | key=lambda x: x[0]): 18 | attrs[name] = value 19 | token["data"] = attrs 20 | yield token 21 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/filters/sanitizer.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from . import _base 4 | from ..sanitizer import HTMLSanitizerMixin 5 | 6 | 7 | class Filter(_base.Filter, HTMLSanitizerMixin): 8 | def __iter__(self): 9 | for token in _base.Filter.__iter__(self): 10 | token = self.sanitize_token(token) 11 | if token: 12 | yield token 13 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/filters/whitespace.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | import re 4 | 5 | from . import _base 6 | from ..constants import rcdataElements, spaceCharacters 7 | spaceCharacters = "".join(spaceCharacters) 8 | 9 | SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) 10 | 11 | 12 | class Filter(_base.Filter): 13 | 14 | spacePreserveElements = frozenset(["pre", "textarea"] + list(rcdataElements)) 15 | 16 | def __iter__(self): 17 | preserve = 0 18 | for token in _base.Filter.__iter__(self): 19 | type = token["type"] 20 | if type == "StartTag" \ 21 | and (preserve or token["name"] in self.spacePreserveElements): 22 | preserve += 1 23 | 24 | elif type == "EndTag" and preserve: 25 | preserve -= 1 26 | 27 | elif not preserve and type == "SpaceCharacters" and token["data"]: 28 | # Test on token["data"] above to not introduce spaces where there were not 29 | token["data"] = " " 30 | 31 | elif not preserve and type == "Characters": 32 | token["data"] = collapse_spaces(token["data"]) 33 | 34 | yield token 35 | 36 | 37 | def collapse_spaces(text): 38 | return SPACES_REGEX.sub(' ', text) 39 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/serializer/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from .. import treewalkers 4 | 5 | from .htmlserializer import HTMLSerializer 6 | 7 | 8 | def serialize(input, tree="etree", format="html", encoding=None, 9 | **serializer_opts): 10 | # XXX: Should we cache this? 11 | walker = treewalkers.getTreeWalker(tree) 12 | if format == "html": 13 | s = HTMLSerializer(**serializer_opts) 14 | else: 15 | raise ValueError("type must be html") 16 | return s.render(walker(input), encoding) 17 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/treeadapters/sax.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from xml.sax.xmlreader import AttributesNSImpl 4 | 5 | from ..constants import adjustForeignAttributes, unadjustForeignAttributes 6 | 7 | prefix_mapping = {} 8 | for prefix, localName, namespace in adjustForeignAttributes.values(): 9 | if prefix is not None: 10 | prefix_mapping[prefix] = namespace 11 | 12 | 13 | def to_sax(walker, handler): 14 | """Call SAX-like content handler based on treewalker walker""" 15 | handler.startDocument() 16 | for prefix, namespace in prefix_mapping.items(): 17 | handler.startPrefixMapping(prefix, namespace) 18 | 19 | for token in walker: 20 | type = token["type"] 21 | if type == "Doctype": 22 | continue 23 | elif type in ("StartTag", "EmptyTag"): 24 | attrs = AttributesNSImpl(token["data"], 25 | unadjustForeignAttributes) 26 | handler.startElementNS((token["namespace"], token["name"]), 27 | token["name"], 28 | attrs) 29 | if type == "EmptyTag": 30 | handler.endElementNS((token["namespace"], token["name"]), 31 | token["name"]) 32 | elif type == "EndTag": 33 | handler.endElementNS((token["namespace"], token["name"]), 34 | token["name"]) 35 | elif type in ("Characters", "SpaceCharacters"): 36 | handler.characters(token["data"]) 37 | elif type == "Comment": 38 | pass 39 | else: 40 | assert False, "Unknown token type" 41 | 42 | for prefix, namespace in prefix_mapping.items(): 43 | handler.endPrefixMapping(prefix) 44 | handler.endDocument() 45 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/dom.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from xml.dom import Node 4 | 5 | from . import _base 6 | 7 | 8 | class TreeWalker(_base.NonRecursiveTreeWalker): 9 | def getNodeDetails(self, node): 10 | if node.nodeType == Node.DOCUMENT_TYPE_NODE: 11 | return _base.DOCTYPE, node.name, node.publicId, node.systemId 12 | 13 | elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE): 14 | return _base.TEXT, node.nodeValue 15 | 16 | elif node.nodeType == Node.ELEMENT_NODE: 17 | attrs = {} 18 | for attr in list(node.attributes.keys()): 19 | attr = node.getAttributeNode(attr) 20 | if attr.namespaceURI: 21 | attrs[(attr.namespaceURI, attr.localName)] = attr.value 22 | else: 23 | attrs[(None, attr.name)] = attr.value 24 | return (_base.ELEMENT, node.namespaceURI, node.nodeName, 25 | attrs, node.hasChildNodes()) 26 | 27 | elif node.nodeType == Node.COMMENT_NODE: 28 | return _base.COMMENT, node.nodeValue 29 | 30 | elif node.nodeType in (Node.DOCUMENT_NODE, Node.DOCUMENT_FRAGMENT_NODE): 31 | return (_base.DOCUMENT,) 32 | 33 | else: 34 | return _base.UNKNOWN, node.nodeType 35 | 36 | def getFirstChild(self, node): 37 | return node.firstChild 38 | 39 | def getNextSibling(self, node): 40 | return node.nextSibling 41 | 42 | def getParentNode(self, node): 43 | return node.parentNode 44 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from genshi.core import QName 4 | from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT 5 | from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT 6 | 7 | from . import _base 8 | 9 | from ..constants import voidElements, namespaces 10 | 11 | 12 | class TreeWalker(_base.TreeWalker): 13 | def __iter__(self): 14 | # Buffer the events so we can pass in the following one 15 | previous = None 16 | for event in self.tree: 17 | if previous is not None: 18 | for token in self.tokens(previous, event): 19 | yield token 20 | previous = event 21 | 22 | # Don't forget the final event! 23 | if previous is not None: 24 | for token in self.tokens(previous, None): 25 | yield token 26 | 27 | def tokens(self, event, next): 28 | kind, data, pos = event 29 | if kind == START: 30 | tag, attribs = data 31 | name = tag.localname 32 | namespace = tag.namespace 33 | converted_attribs = {} 34 | for k, v in attribs: 35 | if isinstance(k, QName): 36 | converted_attribs[(k.namespace, k.localname)] = v 37 | else: 38 | converted_attribs[(None, k)] = v 39 | 40 | if namespace == namespaces["html"] and name in voidElements: 41 | for token in self.emptyTag(namespace, name, converted_attribs, 42 | not next or next[0] != END 43 | or next[1] != tag): 44 | yield token 45 | else: 46 | yield self.startTag(namespace, name, converted_attribs) 47 | 48 | elif kind == END: 49 | name = data.localname 50 | namespace = data.namespace 51 | if name not in voidElements: 52 | yield self.endTag(namespace, name) 53 | 54 | elif kind == COMMENT: 55 | yield self.comment(data) 56 | 57 | elif kind == TEXT: 58 | for token in self.text(data): 59 | yield token 60 | 61 | elif kind == DOCTYPE: 62 | yield self.doctype(*data) 63 | 64 | elif kind in (XML_NAMESPACE, DOCTYPE, START_NS, END_NS, 65 | START_CDATA, END_CDATA, PI): 66 | pass 67 | 68 | else: 69 | yield self.unknown(kind) 70 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ 4 | COMMENT, IGNORABLE_WHITESPACE, CHARACTERS 5 | 6 | from . import _base 7 | 8 | from ..constants import voidElements 9 | 10 | 11 | class TreeWalker(_base.TreeWalker): 12 | def __iter__(self): 13 | ignore_until = None 14 | previous = None 15 | for event in self.tree: 16 | if previous is not None and \ 17 | (ignore_until is None or previous[1] is ignore_until): 18 | if previous[1] is ignore_until: 19 | ignore_until = None 20 | for token in self.tokens(previous, event): 21 | yield token 22 | if token["type"] == "EmptyTag": 23 | ignore_until = previous[1] 24 | previous = event 25 | if ignore_until is None or previous[1] is ignore_until: 26 | for token in self.tokens(previous, None): 27 | yield token 28 | elif ignore_until is not None: 29 | raise ValueError("Illformed DOM event stream: void element without END_ELEMENT") 30 | 31 | def tokens(self, event, next): 32 | type, node = event 33 | if type == START_ELEMENT: 34 | name = node.nodeName 35 | namespace = node.namespaceURI 36 | attrs = {} 37 | for attr in list(node.attributes.keys()): 38 | attr = node.getAttributeNode(attr) 39 | attrs[(attr.namespaceURI, attr.localName)] = attr.value 40 | if name in voidElements: 41 | for token in self.emptyTag(namespace, 42 | name, 43 | attrs, 44 | not next or next[1] is not node): 45 | yield token 46 | else: 47 | yield self.startTag(namespace, name, attrs) 48 | 49 | elif type == END_ELEMENT: 50 | name = node.nodeName 51 | namespace = node.namespaceURI 52 | if name not in voidElements: 53 | yield self.endTag(namespace, name) 54 | 55 | elif type == COMMENT: 56 | yield self.comment(node.nodeValue) 57 | 58 | elif type in (IGNORABLE_WHITESPACE, CHARACTERS): 59 | for token in self.text(node.nodeValue): 60 | yield token 61 | 62 | else: 63 | yield self.unknown(type) 64 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/trie/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from .py import Trie as PyTrie 4 | 5 | Trie = PyTrie 6 | 7 | try: 8 | from .datrie import Trie as DATrie 9 | except ImportError: 10 | pass 11 | else: 12 | Trie = DATrie 13 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/trie/_base.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from collections import Mapping 4 | 5 | 6 | class Trie(Mapping): 7 | """Abstract base class for tries""" 8 | 9 | def keys(self, prefix=None): 10 | keys = super().keys() 11 | 12 | if prefix is None: 13 | return set(keys) 14 | 15 | # Python 2.6: no set comprehensions 16 | return set([x for x in keys if x.startswith(prefix)]) 17 | 18 | def has_keys_with_prefix(self, prefix): 19 | for key in self.keys(): 20 | if key.startswith(prefix): 21 | return True 22 | 23 | return False 24 | 25 | def longest_prefix(self, prefix): 26 | if prefix in self: 27 | return prefix 28 | 29 | for i in range(1, len(prefix) + 1): 30 | if prefix[:-i] in self: 31 | return prefix[:-i] 32 | 33 | raise KeyError(prefix) 34 | 35 | def longest_prefix_item(self, prefix): 36 | lprefix = self.longest_prefix(prefix) 37 | return (lprefix, self[lprefix]) 38 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/trie/datrie.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from datrie import Trie as DATrie 4 | from pip._vendor.six import text_type 5 | 6 | from ._base import Trie as ABCTrie 7 | 8 | 9 | class Trie(ABCTrie): 10 | def __init__(self, data): 11 | chars = set() 12 | for key in data.keys(): 13 | if not isinstance(key, text_type): 14 | raise TypeError("All keys must be strings") 15 | for char in key: 16 | chars.add(char) 17 | 18 | self._data = DATrie("".join(chars)) 19 | for key, value in data.items(): 20 | self._data[key] = value 21 | 22 | def __contains__(self, key): 23 | return key in self._data 24 | 25 | def __len__(self): 26 | return len(self._data) 27 | 28 | def __iter__(self): 29 | raise NotImplementedError() 30 | 31 | def __getitem__(self, key): 32 | return self._data[key] 33 | 34 | def keys(self, prefix=None): 35 | return self._data.keys(prefix) 36 | 37 | def has_keys_with_prefix(self, prefix): 38 | return self._data.has_keys_with_prefix(prefix) 39 | 40 | def longest_prefix(self, prefix): 41 | return self._data.longest_prefix(prefix) 42 | 43 | def longest_prefix_item(self, prefix): 44 | return self._data.longest_prefix_item(prefix) 45 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/html5lib/trie/py.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | from pip._vendor.six import text_type 3 | 4 | from bisect import bisect_left 5 | 6 | from ._base import Trie as ABCTrie 7 | 8 | 9 | class Trie(ABCTrie): 10 | def __init__(self, data): 11 | if not all(isinstance(x, text_type) for x in data.keys()): 12 | raise TypeError("All keys must be strings") 13 | 14 | self._data = data 15 | self._keys = sorted(data.keys()) 16 | self._cachestr = "" 17 | self._cachepoints = (0, len(data)) 18 | 19 | def __contains__(self, key): 20 | return key in self._data 21 | 22 | def __len__(self): 23 | return len(self._data) 24 | 25 | def __iter__(self): 26 | return iter(self._data) 27 | 28 | def __getitem__(self, key): 29 | return self._data[key] 30 | 31 | def keys(self, prefix=None): 32 | if prefix is None or prefix == "" or not self._keys: 33 | return set(self._keys) 34 | 35 | if prefix.startswith(self._cachestr): 36 | lo, hi = self._cachepoints 37 | start = i = bisect_left(self._keys, prefix, lo, hi) 38 | else: 39 | start = i = bisect_left(self._keys, prefix) 40 | 41 | keys = set() 42 | if start == len(self._keys): 43 | return keys 44 | 45 | while self._keys[i].startswith(prefix): 46 | keys.add(self._keys[i]) 47 | i += 1 48 | 49 | self._cachestr = prefix 50 | self._cachepoints = (start, i) 51 | 52 | return keys 53 | 54 | def has_keys_with_prefix(self, prefix): 55 | if prefix in self._data: 56 | return True 57 | 58 | if prefix.startswith(self._cachestr): 59 | lo, hi = self._cachepoints 60 | i = bisect_left(self._keys, prefix, lo, hi) 61 | else: 62 | i = bisect_left(self._keys, prefix) 63 | 64 | if i == len(self._keys): 65 | return False 66 | 67 | return self._keys[i].startswith(prefix) 68 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | __all__ = [ 17 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 18 | "__email__", "__license__", "__copyright__", 19 | ] 20 | 21 | __title__ = "packaging" 22 | __summary__ = "Core utilities for Python packages" 23 | __uri__ = "https://github.com/pypa/packaging" 24 | 25 | __version__ = "15.3" 26 | 27 | __author__ = "Donald Stufft" 28 | __email__ = "donald@stufft.io" 29 | 30 | __license__ = "Apache License, Version 2.0" 31 | __copyright__ = "Copyright 2014 %s" % __author__ 32 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | from .__about__ import ( 17 | __author__, __copyright__, __email__, __license__, __summary__, __title__, 18 | __uri__, __version__ 19 | ) 20 | 21 | __all__ = [ 22 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 23 | "__email__", "__license__", "__copyright__", 24 | ] 25 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | import sys 17 | 18 | 19 | PY2 = sys.version_info[0] == 2 20 | PY3 = sys.version_info[0] == 3 21 | 22 | # flake8: noqa 23 | 24 | if PY3: 25 | string_types = str, 26 | else: 27 | string_types = basestring, 28 | 29 | 30 | def with_metaclass(meta, *bases): 31 | """ 32 | Create a base class with a metaclass. 33 | """ 34 | # This requires a bit of explanation: the basic idea is to make a dummy 35 | # metaclass for one level of class instantiation that replaces itself with 36 | # the actual metaclass. 37 | class metaclass(meta): 38 | def __new__(cls, name, this_bases, d): 39 | return meta(name, bases, d) 40 | return type.__new__(metaclass, 'temporary_class', (), {}) 41 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/packaging/_structures.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | 17 | class Infinity(object): 18 | 19 | def __repr__(self): 20 | return "Infinity" 21 | 22 | def __hash__(self): 23 | return hash(repr(self)) 24 | 25 | def __lt__(self, other): 26 | return False 27 | 28 | def __le__(self, other): 29 | return False 30 | 31 | def __eq__(self, other): 32 | return isinstance(other, self.__class__) 33 | 34 | def __ne__(self, other): 35 | return not isinstance(other, self.__class__) 36 | 37 | def __gt__(self, other): 38 | return True 39 | 40 | def __ge__(self, other): 41 | return True 42 | 43 | def __neg__(self): 44 | return NegativeInfinity 45 | 46 | Infinity = Infinity() 47 | 48 | 49 | class NegativeInfinity(object): 50 | 51 | def __repr__(self): 52 | return "-Infinity" 53 | 54 | def __hash__(self): 55 | return hash(repr(self)) 56 | 57 | def __lt__(self, other): 58 | return True 59 | 60 | def __le__(self, other): 61 | return True 62 | 63 | def __eq__(self, other): 64 | return isinstance(other, self.__class__) 65 | 66 | def __ne__(self, other): 67 | return not isinstance(other, self.__class__) 68 | 69 | def __gt__(self, other): 70 | return False 71 | 72 | def __ge__(self, other): 73 | return False 74 | 75 | def __neg__(self): 76 | return Infinity 77 | 78 | NegativeInfinity = NegativeInfinity() 79 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/progress/counter.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright (c) 2012 Giorgos Verigakis 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | from __future__ import unicode_literals 18 | 19 | from . import Infinite, Progress 20 | from .helpers import WriteMixin 21 | 22 | 23 | class Counter(WriteMixin, Infinite): 24 | message = '' 25 | hide_cursor = True 26 | 27 | def update(self): 28 | self.write(str(self.index)) 29 | 30 | 31 | class Countdown(WriteMixin, Progress): 32 | hide_cursor = True 33 | 34 | def update(self): 35 | self.write(str(self.remaining)) 36 | 37 | 38 | class Stack(WriteMixin, Progress): 39 | phases = (' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') 40 | hide_cursor = True 41 | 42 | def update(self): 43 | nphases = len(self.phases) 44 | i = min(nphases - 1, int(self.progress * nphases)) 45 | self.write(self.phases[i]) 46 | 47 | 48 | class Pie(Stack): 49 | phases = ('○', '◔', '◑', '◕', '●') 50 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/progress/spinner.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright (c) 2012 Giorgos Verigakis 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | from __future__ import unicode_literals 18 | 19 | from . import Infinite 20 | from .helpers import WriteMixin 21 | 22 | 23 | class Spinner(WriteMixin, Infinite): 24 | message = '' 25 | phases = ('-', '\\', '|', '/') 26 | hide_cursor = True 27 | 28 | def update(self): 29 | i = self.index % len(self.phases) 30 | self.write(self.phases[i]) 31 | 32 | 33 | class PieSpinner(Spinner): 34 | phases = ['◷', '◶', '◵', '◴'] 35 | 36 | 37 | class MoonSpinner(Spinner): 38 | phases = ['◑', '◒', '◐', '◓'] 39 | 40 | 41 | class LineSpinner(Spinner): 42 | phases = ['⎺', '⎻', '⎼', '⎽', '⎼', '⎻'] 43 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/re-vendor.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import pip 4 | import glob 5 | import shutil 6 | 7 | here = os.path.abspath(os.path.dirname(__file__)) 8 | 9 | def usage(): 10 | print("Usage: re-vendor.py [clean|vendor]") 11 | sys.exit(1) 12 | 13 | def clean(): 14 | for fn in os.listdir(here): 15 | dirname = os.path.join(here, fn) 16 | if os.path.isdir(dirname): 17 | shutil.rmtree(dirname) 18 | # six is a single file, not a package 19 | os.unlink(os.path.join(here, 'six.py')) 20 | 21 | def vendor(): 22 | pip.main(['install', '-t', here, '-r', 'vendor.txt']) 23 | for dirname in glob.glob('*.egg-info'): 24 | shutil.rmtree(dirname) 25 | 26 | if __name__ == '__main__': 27 | if len(sys.argv) != 2: 28 | usage() 29 | if sys.argv[1] == 'clean': 30 | clean() 31 | elif sys.argv[1] == 'vendor': 32 | vendor() 33 | else: 34 | usage() 35 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # __ 4 | # /__) _ _ _ _ _/ _ 5 | # / ( (- (/ (/ (- _) / _) 6 | # / 7 | 8 | """ 9 | requests HTTP library 10 | ~~~~~~~~~~~~~~~~~~~~~ 11 | 12 | Requests is an HTTP library, written in Python, for human beings. Basic GET 13 | usage: 14 | 15 | >>> import requests 16 | >>> r = requests.get('https://www.python.org') 17 | >>> r.status_code 18 | 200 19 | >>> 'Python is a programming language' in r.content 20 | True 21 | 22 | ... or POST: 23 | 24 | >>> payload = dict(key1='value1', key2='value2') 25 | >>> r = requests.post('http://httpbin.org/post', data=payload) 26 | >>> print(r.text) 27 | { 28 | ... 29 | "form": { 30 | "key2": "value2", 31 | "key1": "value1" 32 | }, 33 | ... 34 | } 35 | 36 | The other HTTP methods are supported - see `requests.api`. Full documentation 37 | is at . 38 | 39 | :copyright: (c) 2015 by Kenneth Reitz. 40 | :license: Apache 2.0, see LICENSE for more details. 41 | 42 | """ 43 | 44 | __title__ = 'requests' 45 | __version__ = '2.7.0' 46 | __build__ = 0x020700 47 | __author__ = 'Kenneth Reitz' 48 | __license__ = 'Apache 2.0' 49 | __copyright__ = 'Copyright 2015 Kenneth Reitz' 50 | 51 | # Attempt to enable urllib3's SNI support, if possible 52 | try: 53 | from .packages.urllib3.contrib import pyopenssl 54 | pyopenssl.inject_into_urllib3() 55 | except ImportError: 56 | pass 57 | 58 | from . import utils 59 | from .models import Request, Response, PreparedRequest 60 | from .api import request, get, head, post, patch, put, delete, options 61 | from .sessions import session, Session 62 | from .status_codes import codes 63 | from .exceptions import ( 64 | RequestException, Timeout, URLRequired, 65 | TooManyRedirects, HTTPError, ConnectionError 66 | ) 67 | 68 | # Set default logging handler to avoid "No handler found" warnings. 69 | import logging 70 | try: # Python 2.7+ 71 | from logging import NullHandler 72 | except ImportError: 73 | class NullHandler(logging.Handler): 74 | def emit(self, record): 75 | pass 76 | 77 | logging.getLogger(__name__).addHandler(NullHandler()) 78 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | certs.py 6 | ~~~~~~~~ 7 | 8 | This module returns the preferred default CA certificate bundle. 9 | 10 | If you are packaging Requests, e.g., for a Linux distribution or a managed 11 | environment, you can change the definition of where() to return a separately 12 | packaged CA bundle. 13 | """ 14 | import os.path 15 | 16 | try: 17 | from certifi import where 18 | except ImportError: 19 | def where(): 20 | """Return the preferred certificate bundle.""" 21 | # vendored bundle inside Requests 22 | return os.path.join(os.path.dirname(__file__), 'cacert.pem') 23 | 24 | if __name__ == '__main__': 25 | print(where()) 26 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | pythoncompat 5 | """ 6 | 7 | from .packages import chardet 8 | 9 | import sys 10 | 11 | # ------- 12 | # Pythons 13 | # ------- 14 | 15 | # Syntax sugar. 16 | _ver = sys.version_info 17 | 18 | #: Python 2.x? 19 | is_py2 = (_ver[0] == 2) 20 | 21 | #: Python 3.x? 22 | is_py3 = (_ver[0] == 3) 23 | 24 | try: 25 | import simplejson as json 26 | except (ImportError, SyntaxError): 27 | # simplejson does not support Python 3.2, it throws a SyntaxError 28 | # because of u'...' Unicode literals. 29 | import json 30 | 31 | # --------- 32 | # Specifics 33 | # --------- 34 | 35 | if is_py2: 36 | from urllib import quote, unquote, quote_plus, unquote_plus, urlencode, getproxies, proxy_bypass 37 | from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag 38 | from urllib2 import parse_http_list 39 | import cookielib 40 | from Cookie import Morsel 41 | from StringIO import StringIO 42 | from .packages.urllib3.packages.ordered_dict import OrderedDict 43 | 44 | builtin_str = str 45 | bytes = str 46 | str = unicode 47 | basestring = basestring 48 | numeric_types = (int, long, float) 49 | 50 | elif is_py3: 51 | from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus, urldefrag 52 | from urllib.request import parse_http_list, getproxies, proxy_bypass 53 | from http import cookiejar as cookielib 54 | from http.cookies import Morsel 55 | from io import StringIO 56 | from collections import OrderedDict 57 | 58 | builtin_str = str 59 | str = str 60 | bytes = bytes 61 | basestring = (str, bytes) 62 | numeric_types = (int, float) 63 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.hooks 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module provides the capabilities for the Requests hooks system. 8 | 9 | Available hooks: 10 | 11 | ``response``: 12 | The response generated from a Request. 13 | 14 | """ 15 | 16 | 17 | HOOKS = ['response'] 18 | 19 | 20 | def default_hooks(): 21 | hooks = {} 22 | for event in HOOKS: 23 | hooks[event] = [] 24 | return hooks 25 | 26 | # TODO: response is the only one 27 | 28 | 29 | def dispatch_hook(key, hooks, hook_data, **kwargs): 30 | """Dispatches a hook dictionary on a given piece of data.""" 31 | 32 | hooks = hooks or dict() 33 | 34 | if key in hooks: 35 | hooks = hooks.get(key) 36 | 37 | if hasattr(hooks, '__call__'): 38 | hooks = [hooks] 39 | 40 | for hook in hooks: 41 | _hook_data = hook(hook_data, **kwargs) 42 | if _hook_data is not None: 43 | hook_data = _hook_data 44 | 45 | return hook_data 46 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import urllib3 4 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/__init__.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # This library is free software; you can redistribute it and/or 3 | # modify it under the terms of the GNU Lesser General Public 4 | # License as published by the Free Software Foundation; either 5 | # version 2.1 of the License, or (at your option) any later version. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 15 | # 02110-1301 USA 16 | ######################### END LICENSE BLOCK ######################### 17 | 18 | __version__ = "2.3.0" 19 | from sys import version_info 20 | 21 | 22 | def detect(aBuf): 23 | if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or 24 | (version_info >= (3, 0) and not isinstance(aBuf, bytes))): 25 | raise ValueError('Expected a bytes object, not a unicode object') 26 | 27 | from . import universaldetector 28 | u = universaldetector.UniversalDetector() 29 | u.reset() 30 | u.feed(aBuf) 31 | u.close() 32 | return u.result 33 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/big5prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Communicator client code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import Big5DistributionAnalysis 31 | from .mbcssm import Big5SMModel 32 | 33 | 34 | class Big5Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(Big5SMModel) 38 | self._mDistributionAnalyzer = Big5DistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "Big5" 43 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | from . import constants 30 | import re 31 | 32 | 33 | class CharSetProber: 34 | def __init__(self): 35 | pass 36 | 37 | def reset(self): 38 | self._mState = constants.eDetecting 39 | 40 | def get_charset_name(self): 41 | return None 42 | 43 | def feed(self, aBuf): 44 | pass 45 | 46 | def get_state(self): 47 | return self._mState 48 | 49 | def get_confidence(self): 50 | return 0.0 51 | 52 | def filter_high_bit_only(self, aBuf): 53 | aBuf = re.sub(b'([\x00-\x7F])+', b' ', aBuf) 54 | return aBuf 55 | 56 | def filter_without_english_letters(self, aBuf): 57 | aBuf = re.sub(b'([A-Za-z])+', b' ', aBuf) 58 | return aBuf 59 | 60 | def filter_with_english_letters(self, aBuf): 61 | # TODO 62 | return aBuf 63 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .constants import eStart 29 | from .compat import wrap_ord 30 | 31 | 32 | class CodingStateMachine: 33 | def __init__(self, sm): 34 | self._mModel = sm 35 | self._mCurrentBytePos = 0 36 | self._mCurrentCharLen = 0 37 | self.reset() 38 | 39 | def reset(self): 40 | self._mCurrentState = eStart 41 | 42 | def next_state(self, c): 43 | # for each byte we get its class 44 | # if it is first byte, we also get byte length 45 | # PY3K: aBuf is a byte stream, so c is an int, not a byte 46 | byteCls = self._mModel['classTable'][wrap_ord(c)] 47 | if self._mCurrentState == eStart: 48 | self._mCurrentBytePos = 0 49 | self._mCurrentCharLen = self._mModel['charLenTable'][byteCls] 50 | # from byte's class and stateTable, we get its next state 51 | curr_state = (self._mCurrentState * self._mModel['classFactor'] 52 | + byteCls) 53 | self._mCurrentState = self._mModel['stateTable'][curr_state] 54 | self._mCurrentBytePos += 1 55 | return self._mCurrentState 56 | 57 | def get_current_charlen(self): 58 | return self._mCurrentCharLen 59 | 60 | def get_coding_state_machine(self): 61 | return self._mModel['name'] 62 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/compat.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # Contributor(s): 3 | # Ian Cordasco - port to Python 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2.1 of the License, or (at your option) any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | # 02110-1301 USA 19 | ######################### END LICENSE BLOCK ######################### 20 | 21 | import sys 22 | 23 | 24 | if sys.version_info < (3, 0): 25 | base_str = (str, unicode) 26 | else: 27 | base_str = (bytes, str) 28 | 29 | 30 | def wrap_ord(a): 31 | if sys.version_info < (3, 0) and isinstance(a, base_str): 32 | return ord(a) 33 | else: 34 | return a 35 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/constants.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | _debug = 0 30 | 31 | eDetecting = 0 32 | eFoundIt = 1 33 | eNotMe = 2 34 | 35 | eStart = 0 36 | eError = 1 37 | eItsMe = 2 38 | 39 | SHORTCUT_THRESHOLD = 0.95 40 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import CP949SMModel 32 | 33 | 34 | class CP949Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(CP949SMModel) 38 | # NOTE: CP949 is a superset of EUC-KR, so the distribution should be 39 | # not different. 40 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 41 | self.reset() 42 | 43 | def get_charset_name(self): 44 | return "CP949" 45 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import EUCKRSMModel 32 | 33 | 34 | class EUCKRProber(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(EUCKRSMModel) 38 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "EUC-KR" 43 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCTWDistributionAnalysis 31 | from .mbcssm import EUCTWSMModel 32 | 33 | class EUCTWProber(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(EUCTWSMModel) 37 | self._mDistributionAnalyzer = EUCTWDistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "EUC-TW" 42 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import GB2312DistributionAnalysis 31 | from .mbcssm import GB2312SMModel 32 | 33 | class GB2312Prober(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(GB2312SMModel) 37 | self._mDistributionAnalyzer = GB2312DistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "GB2312" 42 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # Proofpoint, Inc. 13 | # 14 | # This library is free software; you can redistribute it and/or 15 | # modify it under the terms of the GNU Lesser General Public 16 | # License as published by the Free Software Foundation; either 17 | # version 2.1 of the License, or (at your option) any later version. 18 | # 19 | # This library is distributed in the hope that it will be useful, 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 | # Lesser General Public License for more details. 23 | # 24 | # You should have received a copy of the GNU Lesser General Public 25 | # License along with this library; if not, write to the Free Software 26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 27 | # 02110-1301 USA 28 | ######################### END LICENSE BLOCK ######################### 29 | 30 | from .charsetgroupprober import CharSetGroupProber 31 | from .utf8prober import UTF8Prober 32 | from .sjisprober import SJISProber 33 | from .eucjpprober import EUCJPProber 34 | from .gb2312prober import GB2312Prober 35 | from .euckrprober import EUCKRProber 36 | from .cp949prober import CP949Prober 37 | from .big5prober import Big5Prober 38 | from .euctwprober import EUCTWProber 39 | 40 | 41 | class MBCSGroupProber(CharSetGroupProber): 42 | def __init__(self): 43 | CharSetGroupProber.__init__(self) 44 | self._mProbers = [ 45 | UTF8Prober(), 46 | SJISProber(), 47 | EUCJPProber(), 48 | GB2312Prober(), 49 | EUCKRProber(), 50 | CP949Prober(), 51 | Big5Prober(), 52 | EUCTWProber() 53 | ] 54 | self.reset() 55 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | urllib3 - Thread-safe connection pooling and re-using. 3 | """ 4 | 5 | __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' 6 | __license__ = 'MIT' 7 | __version__ = '1.10.4' 8 | 9 | 10 | from .connectionpool import ( 11 | HTTPConnectionPool, 12 | HTTPSConnectionPool, 13 | connection_from_url 14 | ) 15 | 16 | from . import exceptions 17 | from .filepost import encode_multipart_formdata 18 | from .poolmanager import PoolManager, ProxyManager, proxy_from_url 19 | from .response import HTTPResponse 20 | from .util.request import make_headers 21 | from .util.url import get_host 22 | from .util.timeout import Timeout 23 | from .util.retry import Retry 24 | 25 | 26 | # Set default logging handler to avoid "No handler found" warnings. 27 | import logging 28 | try: # Python 2.7+ 29 | from logging import NullHandler 30 | except ImportError: 31 | class NullHandler(logging.Handler): 32 | def emit(self, record): 33 | pass 34 | 35 | logging.getLogger(__name__).addHandler(NullHandler()) 36 | 37 | def add_stderr_logger(level=logging.DEBUG): 38 | """ 39 | Helper for quickly adding a StreamHandler to the logger. Useful for 40 | debugging. 41 | 42 | Returns the handler after adding it. 43 | """ 44 | # This method needs to be in this __init__.py to get the __name__ correct 45 | # even if urllib3 is vendored within another package. 46 | logger = logging.getLogger(__name__) 47 | handler = logging.StreamHandler() 48 | handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) 49 | logger.addHandler(handler) 50 | logger.setLevel(level) 51 | logger.debug('Added a stderr logging handler to logger: %s' % __name__) 52 | return handler 53 | 54 | # ... Clean up. 55 | del NullHandler 56 | 57 | 58 | import warnings 59 | # SecurityWarning's always go off by default. 60 | warnings.simplefilter('always', exceptions.SecurityWarning, append=True) 61 | # InsecurePlatformWarning's don't vary between requests, so we keep it default. 62 | warnings.simplefilter('default', exceptions.InsecurePlatformWarning, 63 | append=True) 64 | 65 | def disable_warnings(category=exceptions.HTTPWarning): 66 | """ 67 | Helper for quickly disabling all urllib3 warnings. 68 | """ 69 | warnings.simplefilter('ignore', category) 70 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/contrib/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | 3 | from uuid import uuid4 4 | from io import BytesIO 5 | 6 | from .packages import six 7 | from .packages.six import b 8 | from .fields import RequestField 9 | 10 | writer = codecs.lookup('utf-8')[3] 11 | 12 | 13 | def choose_boundary(): 14 | """ 15 | Our embarassingly-simple replacement for mimetools.choose_boundary. 16 | """ 17 | return uuid4().hex 18 | 19 | 20 | def iter_field_objects(fields): 21 | """ 22 | Iterate over fields. 23 | 24 | Supports list of (k, v) tuples and dicts, and lists of 25 | :class:`~urllib3.fields.RequestField`. 26 | 27 | """ 28 | if isinstance(fields, dict): 29 | i = six.iteritems(fields) 30 | else: 31 | i = iter(fields) 32 | 33 | for field in i: 34 | if isinstance(field, RequestField): 35 | yield field 36 | else: 37 | yield RequestField.from_tuples(*field) 38 | 39 | 40 | def iter_fields(fields): 41 | """ 42 | .. deprecated:: 1.6 43 | 44 | Iterate over fields. 45 | 46 | The addition of :class:`~urllib3.fields.RequestField` makes this function 47 | obsolete. Instead, use :func:`iter_field_objects`, which returns 48 | :class:`~urllib3.fields.RequestField` objects. 49 | 50 | Supports list of (k, v) tuples and dicts. 51 | """ 52 | if isinstance(fields, dict): 53 | return ((k, v) for k, v in six.iteritems(fields)) 54 | 55 | return ((k, v) for k, v in fields) 56 | 57 | 58 | def encode_multipart_formdata(fields, boundary=None): 59 | """ 60 | Encode a dictionary of ``fields`` using the multipart/form-data MIME format. 61 | 62 | :param fields: 63 | Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`). 64 | 65 | :param boundary: 66 | If not specified, then a random boundary will be generated using 67 | :func:`mimetools.choose_boundary`. 68 | """ 69 | body = BytesIO() 70 | if boundary is None: 71 | boundary = choose_boundary() 72 | 73 | for field in iter_field_objects(fields): 74 | body.write(b('--%s\r\n' % (boundary))) 75 | 76 | writer(body).write(field.render_headers()) 77 | data = field.data 78 | 79 | if isinstance(data, int): 80 | data = str(data) # Backwards compatibility 81 | 82 | if isinstance(data, six.text_type): 83 | writer(body).write(data) 84 | else: 85 | body.write(data) 86 | 87 | body.write(b'\r\n') 88 | 89 | body.write(b('--%s--\r\n' % (boundary))) 90 | 91 | content_type = str('multipart/form-data; boundary=%s' % boundary) 92 | 93 | return body.getvalue(), content_type 94 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | # Python 3.2+ 3 | from ssl import CertificateError, match_hostname 4 | except ImportError: 5 | try: 6 | # Backport of the function from a pypi module 7 | from backports.ssl_match_hostname import CertificateError, match_hostname 8 | except ImportError: 9 | # Our vendored copy 10 | from ._implementation import CertificateError, match_hostname 11 | 12 | # Not needed, but documenting what we provide. 13 | __all__ = ('CertificateError', 'match_hostname') 14 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py: -------------------------------------------------------------------------------- 1 | # For backwards compatibility, provide imports that used to be here. 2 | from .connection import is_connection_dropped 3 | from .request import make_headers 4 | from .response import is_fp_closed 5 | from .ssl_ import ( 6 | SSLContext, 7 | HAS_SNI, 8 | assert_fingerprint, 9 | resolve_cert_reqs, 10 | resolve_ssl_version, 11 | ssl_wrap_socket, 12 | ) 13 | from .timeout import ( 14 | current_time, 15 | Timeout, 16 | ) 17 | 18 | from .retry import Retry 19 | from .url import ( 20 | get_host, 21 | parse_url, 22 | split_first, 23 | Url, 24 | ) 25 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py: -------------------------------------------------------------------------------- 1 | from base64 import b64encode 2 | 3 | from ..packages.six import b 4 | 5 | ACCEPT_ENCODING = 'gzip,deflate' 6 | 7 | 8 | def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, 9 | basic_auth=None, proxy_basic_auth=None, disable_cache=None): 10 | """ 11 | Shortcuts for generating request headers. 12 | 13 | :param keep_alive: 14 | If ``True``, adds 'connection: keep-alive' header. 15 | 16 | :param accept_encoding: 17 | Can be a boolean, list, or string. 18 | ``True`` translates to 'gzip,deflate'. 19 | List will get joined by comma. 20 | String will be used as provided. 21 | 22 | :param user_agent: 23 | String representing the user-agent you want, such as 24 | "python-urllib3/0.6" 25 | 26 | :param basic_auth: 27 | Colon-separated username:password string for 'authorization: basic ...' 28 | auth header. 29 | 30 | :param proxy_basic_auth: 31 | Colon-separated username:password string for 'proxy-authorization: basic ...' 32 | auth header. 33 | 34 | :param disable_cache: 35 | If ``True``, adds 'cache-control: no-cache' header. 36 | 37 | Example:: 38 | 39 | >>> make_headers(keep_alive=True, user_agent="Batman/1.0") 40 | {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'} 41 | >>> make_headers(accept_encoding=True) 42 | {'accept-encoding': 'gzip,deflate'} 43 | """ 44 | headers = {} 45 | if accept_encoding: 46 | if isinstance(accept_encoding, str): 47 | pass 48 | elif isinstance(accept_encoding, list): 49 | accept_encoding = ','.join(accept_encoding) 50 | else: 51 | accept_encoding = ACCEPT_ENCODING 52 | headers['accept-encoding'] = accept_encoding 53 | 54 | if user_agent: 55 | headers['user-agent'] = user_agent 56 | 57 | if keep_alive: 58 | headers['connection'] = 'keep-alive' 59 | 60 | if basic_auth: 61 | headers['authorization'] = 'Basic ' + \ 62 | b64encode(b(basic_auth)).decode('utf-8') 63 | 64 | if proxy_basic_auth: 65 | headers['proxy-authorization'] = 'Basic ' + \ 66 | b64encode(b(proxy_basic_auth)).decode('utf-8') 67 | 68 | if disable_cache: 69 | headers['cache-control'] = 'no-cache' 70 | 71 | return headers 72 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py: -------------------------------------------------------------------------------- 1 | def is_fp_closed(obj): 2 | """ 3 | Checks whether a given file-like object is closed. 4 | 5 | :param obj: 6 | The file-like object to check. 7 | """ 8 | 9 | try: 10 | # Check via the official file-like-object way. 11 | return obj.closed 12 | except AttributeError: 13 | pass 14 | 15 | try: 16 | # Check if the object is a container for another file-like object that 17 | # gets released on exhaustion (e.g. HTTPResponse). 18 | return obj.fp is None 19 | except AttributeError: 20 | pass 21 | 22 | raise ValueError("Unable to determine whether fp is closed.") 23 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/commands/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Package containing all pip commands 3 | """ 4 | from __future__ import absolute_import 5 | 6 | from pip.commands.completion import CompletionCommand 7 | from pip.commands.freeze import FreezeCommand 8 | from pip.commands.help import HelpCommand 9 | from pip.commands.list import ListCommand 10 | from pip.commands.search import SearchCommand 11 | from pip.commands.show import ShowCommand 12 | from pip.commands.install import InstallCommand 13 | from pip.commands.uninstall import UninstallCommand 14 | from pip.commands.wheel import WheelCommand 15 | 16 | 17 | commands_dict = { 18 | CompletionCommand.name: CompletionCommand, 19 | FreezeCommand.name: FreezeCommand, 20 | HelpCommand.name: HelpCommand, 21 | SearchCommand.name: SearchCommand, 22 | ShowCommand.name: ShowCommand, 23 | InstallCommand.name: InstallCommand, 24 | UninstallCommand.name: UninstallCommand, 25 | ListCommand.name: ListCommand, 26 | WheelCommand.name: WheelCommand, 27 | } 28 | 29 | 30 | commands_order = [ 31 | InstallCommand, 32 | UninstallCommand, 33 | FreezeCommand, 34 | ListCommand, 35 | ShowCommand, 36 | SearchCommand, 37 | WheelCommand, 38 | HelpCommand, 39 | ] 40 | 41 | 42 | def get_summaries(ignore_hidden=True, ordered=True): 43 | """Yields sorted (command name, command summary) tuples.""" 44 | 45 | if ordered: 46 | cmditems = _sort_commands(commands_dict, commands_order) 47 | else: 48 | cmditems = commands_dict.items() 49 | 50 | for name, command_class in cmditems: 51 | if ignore_hidden and command_class.hidden: 52 | continue 53 | 54 | yield (name, command_class.summary) 55 | 56 | 57 | def get_similar_commands(name): 58 | """Command name auto-correct.""" 59 | from difflib import get_close_matches 60 | 61 | name = name.lower() 62 | 63 | close_commands = get_close_matches(name, commands_dict.keys()) 64 | 65 | if close_commands: 66 | return close_commands[0] 67 | else: 68 | return False 69 | 70 | 71 | def _sort_commands(cmddict, order): 72 | def keyfn(key): 73 | try: 74 | return order.index(key[1]) 75 | except ValueError: 76 | # unordered items should come last 77 | return 0xff 78 | 79 | return sorted(cmddict.items(), key=keyfn) 80 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/commands/completion.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import sys 4 | from pip.basecommand import Command 5 | 6 | BASE_COMPLETION = """ 7 | # pip %(shell)s completion start%(script)s# pip %(shell)s completion end 8 | """ 9 | 10 | COMPLETION_SCRIPTS = { 11 | 'bash': """ 12 | _pip_completion() 13 | { 14 | COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ 15 | COMP_CWORD=$COMP_CWORD \\ 16 | PIP_AUTO_COMPLETE=1 $1 ) ) 17 | } 18 | complete -o default -F _pip_completion pip 19 | """, 'zsh': """ 20 | function _pip_completion { 21 | local words cword 22 | read -Ac words 23 | read -cn cword 24 | reply=( $( COMP_WORDS="$words[*]" \\ 25 | COMP_CWORD=$(( cword-1 )) \\ 26 | PIP_AUTO_COMPLETE=1 $words[1] ) ) 27 | } 28 | compctl -K _pip_completion pip 29 | """} 30 | 31 | 32 | class CompletionCommand(Command): 33 | """A helper command to be used for command completion.""" 34 | name = 'completion' 35 | summary = 'A helper command to be used for command completion' 36 | hidden = True 37 | 38 | def __init__(self, *args, **kw): 39 | super(CompletionCommand, self).__init__(*args, **kw) 40 | 41 | cmd_opts = self.cmd_opts 42 | 43 | cmd_opts.add_option( 44 | '--bash', '-b', 45 | action='store_const', 46 | const='bash', 47 | dest='shell', 48 | help='Emit completion code for bash') 49 | cmd_opts.add_option( 50 | '--zsh', '-z', 51 | action='store_const', 52 | const='zsh', 53 | dest='shell', 54 | help='Emit completion code for zsh') 55 | 56 | self.parser.insert_option_group(0, cmd_opts) 57 | 58 | def run(self, options, args): 59 | """Prints the completion code of the given shell""" 60 | shells = COMPLETION_SCRIPTS.keys() 61 | shell_options = ['--' + shell for shell in sorted(shells)] 62 | if options.shell in shells: 63 | script = COMPLETION_SCRIPTS.get(options.shell, '') 64 | print(BASE_COMPLETION % {'script': script, 'shell': options.shell}) 65 | else: 66 | sys.stderr.write( 67 | 'ERROR: You must pass %s\n' % ' or '.join(shell_options) 68 | ) 69 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/commands/freeze.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import sys 4 | 5 | import pip 6 | from pip.basecommand import Command 7 | from pip.operations.freeze import freeze 8 | from pip.wheel import WheelCache 9 | 10 | 11 | class FreezeCommand(Command): 12 | """ 13 | Output installed packages in requirements format. 14 | 15 | packages are listed in a case-insensitive sorted order. 16 | """ 17 | name = 'freeze' 18 | usage = """ 19 | %prog [options]""" 20 | summary = 'Output installed packages in requirements format.' 21 | log_streams = ("ext://sys.stderr", "ext://sys.stderr") 22 | 23 | def __init__(self, *args, **kw): 24 | super(FreezeCommand, self).__init__(*args, **kw) 25 | 26 | self.cmd_opts.add_option( 27 | '-r', '--requirement', 28 | dest='requirement', 29 | action='store', 30 | default=None, 31 | metavar='file', 32 | help="Use the order in the given requirements file and its " 33 | "comments when generating output.") 34 | self.cmd_opts.add_option( 35 | '-f', '--find-links', 36 | dest='find_links', 37 | action='append', 38 | default=[], 39 | metavar='URL', 40 | help='URL for finding packages, which will be added to the ' 41 | 'output.') 42 | self.cmd_opts.add_option( 43 | '-l', '--local', 44 | dest='local', 45 | action='store_true', 46 | default=False, 47 | help='If in a virtualenv that has global access, do not output ' 48 | 'globally-installed packages.') 49 | self.cmd_opts.add_option( 50 | '--user', 51 | dest='user', 52 | action='store_true', 53 | default=False, 54 | help='Only output packages installed in user-site.') 55 | 56 | self.parser.insert_option_group(0, self.cmd_opts) 57 | 58 | def run(self, options, args): 59 | format_control = pip.index.FormatControl(set(), set()) 60 | wheel_cache = WheelCache(options.cache_dir, format_control) 61 | freeze_kwargs = dict( 62 | requirement=options.requirement, 63 | find_links=options.find_links, 64 | local_only=options.local, 65 | user_only=options.user, 66 | skip_regex=options.skip_requirements_regex, 67 | isolated=options.isolated_mode, 68 | wheel_cache=wheel_cache) 69 | 70 | for line in freeze(**freeze_kwargs): 71 | sys.stdout.write(line + '\n') 72 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/commands/help.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from pip.basecommand import Command, SUCCESS 4 | from pip.exceptions import CommandError 5 | 6 | 7 | class HelpCommand(Command): 8 | """Show help for commands""" 9 | name = 'help' 10 | usage = """ 11 | %prog """ 12 | summary = 'Show help for commands.' 13 | 14 | def run(self, options, args): 15 | from pip.commands import commands_dict, get_similar_commands 16 | 17 | try: 18 | # 'pip help' with no args is handled by pip.__init__.parseopt() 19 | cmd_name = args[0] # the command we need help for 20 | except IndexError: 21 | return SUCCESS 22 | 23 | if cmd_name not in commands_dict: 24 | guess = get_similar_commands(cmd_name) 25 | 26 | msg = ['unknown command "%s"' % cmd_name] 27 | if guess: 28 | msg.append('maybe you meant "%s"' % guess) 29 | 30 | raise CommandError(' - '.join(msg)) 31 | 32 | command = commands_dict[cmd_name]() 33 | command.parser.print_help() 34 | 35 | return SUCCESS 36 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/exceptions.py: -------------------------------------------------------------------------------- 1 | """Exceptions used throughout package""" 2 | from __future__ import absolute_import 3 | 4 | 5 | class PipError(Exception): 6 | """Base pip exception""" 7 | 8 | 9 | class InstallationError(PipError): 10 | """General exception during installation""" 11 | 12 | 13 | class UninstallationError(PipError): 14 | """General exception during uninstallation""" 15 | 16 | 17 | class DistributionNotFound(InstallationError): 18 | """Raised when a distribution cannot be found to satisfy a requirement""" 19 | 20 | 21 | class RequirementsFileParseError(InstallationError): 22 | """Raised when a general error occurs parsing a requirements file line.""" 23 | 24 | 25 | class BestVersionAlreadyInstalled(PipError): 26 | """Raised when the most up-to-date version of a package is already 27 | installed.""" 28 | 29 | 30 | class BadCommand(PipError): 31 | """Raised when virtualenv or a command is not found""" 32 | 33 | 34 | class CommandError(PipError): 35 | """Raised when there is an error in command-line arguments""" 36 | 37 | 38 | class PreviousBuildDirError(PipError): 39 | """Raised when there's a previous conflicting build directory""" 40 | 41 | 42 | class HashMismatch(InstallationError): 43 | """Distribution file hash values don't match.""" 44 | 45 | 46 | class InvalidWheelFilename(InstallationError): 47 | """Invalid wheel filename.""" 48 | 49 | 50 | class UnsupportedWheel(InstallationError): 51 | """Unsupported wheel.""" 52 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/models/__init__.py: -------------------------------------------------------------------------------- 1 | from pip.models.index import Index, PyPI 2 | 3 | 4 | __all__ = ["Index", "PyPI"] 5 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/models/index.py: -------------------------------------------------------------------------------- 1 | from pip._vendor.six.moves.urllib import parse as urllib_parse 2 | 3 | 4 | class Index(object): 5 | def __init__(self, url): 6 | self.url = url 7 | self.netloc = urllib_parse.urlsplit(url).netloc 8 | self.simple_url = self.url_to_path('simple') 9 | self.pypi_url = self.url_to_path('pypi') 10 | self.pip_json_url = self.url_to_path('pypi/pip/json') 11 | 12 | def url_to_path(self, path): 13 | return urllib_parse.urljoin(self.url, path) 14 | 15 | 16 | PyPI = Index('https://pypi.python.org/') 17 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/operations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/pip/operations/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/req/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from .req_install import InstallRequirement 4 | from .req_set import RequirementSet, Requirements 5 | from .req_file import parse_requirements 6 | 7 | __all__ = [ 8 | "RequirementSet", "Requirements", "InstallRequirement", 9 | "parse_requirements", 10 | ] 11 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/status_codes.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | SUCCESS = 0 4 | ERROR = 1 5 | UNKNOWN_ERROR = 2 6 | VIRTUALENV_NOT_FOUND = 3 7 | PREVIOUS_BUILD_DIR_ERROR = 4 8 | NO_MATCHES_FOUND = 23 9 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/utils/build.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import os.path 4 | import tempfile 5 | 6 | from pip.utils import rmtree 7 | 8 | 9 | class BuildDirectory(object): 10 | 11 | def __init__(self, name=None, delete=None): 12 | # If we were not given an explicit directory, and we were not given an 13 | # explicit delete option, then we'll default to deleting. 14 | if name is None and delete is None: 15 | delete = True 16 | 17 | if name is None: 18 | # We realpath here because some systems have their default tmpdir 19 | # symlinked to another directory. This tends to confuse build 20 | # scripts, so we canonicalize the path by traversing potential 21 | # symlinks here. 22 | name = os.path.realpath(tempfile.mkdtemp(prefix="pip-build-")) 23 | # If we were not given an explicit directory, and we were not given 24 | # an explicit delete option, then we'll default to deleting. 25 | if delete is None: 26 | delete = True 27 | 28 | self.name = name 29 | self.delete = delete 30 | 31 | def __repr__(self): 32 | return "<{} {!r}>".format(self.__class__.__name__, self.name) 33 | 34 | def __enter__(self): 35 | return self.name 36 | 37 | def __exit__(self, exc, value, tb): 38 | self.cleanup() 39 | 40 | def cleanup(self): 41 | if self.delete: 42 | rmtree(self.name) 43 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/utils/deprecation.py: -------------------------------------------------------------------------------- 1 | """ 2 | A module that implments tooling to enable easy warnings about deprecations. 3 | """ 4 | from __future__ import absolute_import 5 | 6 | import logging 7 | import warnings 8 | 9 | 10 | class PipDeprecationWarning(Warning): 11 | pass 12 | 13 | 14 | class RemovedInPip8Warning(PipDeprecationWarning, PendingDeprecationWarning): 15 | pass 16 | 17 | 18 | class RemovedInPip9Warning(PipDeprecationWarning, PendingDeprecationWarning): 19 | pass 20 | 21 | 22 | DEPRECATIONS = [RemovedInPip8Warning, RemovedInPip9Warning] 23 | 24 | 25 | # Warnings <-> Logging Integration 26 | 27 | 28 | _warnings_showwarning = None 29 | 30 | 31 | def _showwarning(message, category, filename, lineno, file=None, line=None): 32 | if file is not None: 33 | if _warnings_showwarning is not None: 34 | _warnings_showwarning( 35 | message, category, filename, lineno, file, line, 36 | ) 37 | else: 38 | if issubclass(category, PipDeprecationWarning): 39 | # We use a specially named logger which will handle all of the 40 | # deprecation messages for pip. 41 | logger = logging.getLogger("pip.deprecations") 42 | 43 | # This is purposely using the % formatter here instead of letting 44 | # the logging module handle the interpolation. This is because we 45 | # want it to appear as if someone typed this entire message out. 46 | log_message = "DEPRECATION: %s" % message 47 | 48 | # Things that are DeprecationWarnings will be removed in the very 49 | # next version of pip. We want these to be more obvious so we 50 | # use the ERROR logging level while the PendingDeprecationWarnings 51 | # are still have at least 2 versions to go until they are removed 52 | # so they can just be warnings. 53 | if issubclass(category, DeprecationWarning): 54 | logger.error(log_message) 55 | else: 56 | logger.warning(log_message) 57 | else: 58 | _warnings_showwarning( 59 | message, category, filename, lineno, file, line, 60 | ) 61 | 62 | 63 | def install_warning_logger(): 64 | global _warnings_showwarning 65 | 66 | if _warnings_showwarning is None: 67 | _warnings_showwarning = warnings.showwarning 68 | warnings.showwarning = _showwarning 69 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pip/utils/filesystem.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os.path 3 | 4 | from pip.compat import get_path_uid 5 | 6 | 7 | def check_path_owner(path): 8 | # If we don't have a way to check the effective uid of this process, then 9 | # we'll just assume that we own the directory. 10 | if not hasattr(os, "geteuid"): 11 | return True 12 | 13 | previous = None 14 | while path != previous: 15 | if os.path.lexists(path): 16 | # Check if path is writable by current user. 17 | if os.geteuid() == 0: 18 | # Special handling for root user in order to handle properly 19 | # cases where users use sudo without -H flag. 20 | try: 21 | path_uid = get_path_uid(path) 22 | except OSError: 23 | return False 24 | return path_uid == 0 25 | else: 26 | return os.access(path, os.W_OK) 27 | else: 28 | previous, path = path, os.path.dirname(path) 29 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pkg_resources/_vendor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/pkg_resources/_vendor/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pkg_resources/_vendor/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | __all__ = [ 17 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 18 | "__email__", "__license__", "__copyright__", 19 | ] 20 | 21 | __title__ = "packaging" 22 | __summary__ = "Core utilities for Python packages" 23 | __uri__ = "https://github.com/pypa/packaging" 24 | 25 | __version__ = "15.3" 26 | 27 | __author__ = "Donald Stufft" 28 | __email__ = "donald@stufft.io" 29 | 30 | __license__ = "Apache License, Version 2.0" 31 | __copyright__ = "Copyright 2014 %s" % __author__ 32 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pkg_resources/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | from .__about__ import ( 17 | __author__, __copyright__, __email__, __license__, __summary__, __title__, 18 | __uri__, __version__ 19 | ) 20 | 21 | __all__ = [ 22 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 23 | "__email__", "__license__", "__copyright__", 24 | ] 25 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pkg_resources/_vendor/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | import sys 17 | 18 | 19 | PY2 = sys.version_info[0] == 2 20 | PY3 = sys.version_info[0] == 3 21 | 22 | # flake8: noqa 23 | 24 | if PY3: 25 | string_types = str, 26 | else: 27 | string_types = basestring, 28 | 29 | 30 | def with_metaclass(meta, *bases): 31 | """ 32 | Create a base class with a metaclass. 33 | """ 34 | # This requires a bit of explanation: the basic idea is to make a dummy 35 | # metaclass for one level of class instantiation that replaces itself with 36 | # the actual metaclass. 37 | class metaclass(meta): 38 | def __new__(cls, name, this_bases, d): 39 | return meta(name, bases, d) 40 | return type.__new__(metaclass, 'temporary_class', (), {}) 41 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/pkg_resources/_vendor/packaging/_structures.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | 17 | class Infinity(object): 18 | 19 | def __repr__(self): 20 | return "Infinity" 21 | 22 | def __hash__(self): 23 | return hash(repr(self)) 24 | 25 | def __lt__(self, other): 26 | return False 27 | 28 | def __le__(self, other): 29 | return False 30 | 31 | def __eq__(self, other): 32 | return isinstance(other, self.__class__) 33 | 34 | def __ne__(self, other): 35 | return not isinstance(other, self.__class__) 36 | 37 | def __gt__(self, other): 38 | return True 39 | 40 | def __ge__(self, other): 41 | return True 42 | 43 | def __neg__(self): 44 | return NegativeInfinity 45 | 46 | Infinity = Infinity() 47 | 48 | 49 | class NegativeInfinity(object): 50 | 51 | def __repr__(self): 52 | return "-Infinity" 53 | 54 | def __hash__(self): 55 | return hash(repr(self)) 56 | 57 | def __lt__(self, other): 58 | return True 59 | 60 | def __le__(self, other): 61 | return True 62 | 63 | def __eq__(self, other): 64 | return isinstance(other, self.__class__) 65 | 66 | def __ne__(self, other): 67 | return not isinstance(other, self.__class__) 68 | 69 | def __gt__(self, other): 70 | return False 71 | 72 | def __ge__(self, other): 73 | return False 74 | 75 | def __neg__(self): 76 | return Infinity 77 | 78 | NegativeInfinity = NegativeInfinity() 79 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools-18.2.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.24.0) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools-18.2.dist-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | https://pypi.python.org/packages/source/c/certifi/certifi-1.0.1.tar.gz#md5=45f5cb94b8af9e1df0f9450a8f61b790 2 | https://pypi.python.org/packages/source/w/wincertstore/wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2 3 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools-18.2.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | _markerlib 2 | easy_install 3 | pkg_resources 4 | setuptools 5 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools-18.2.dist-info/zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/cli-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/setuptools/cli-32.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/cli-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/setuptools/cli-64.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/cli-arm-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/setuptools/cli-arm-32.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/cli.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/setuptools/cli.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/command/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop', 3 | 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts', 4 | 'sdist', 'setopt', 'test', 'install_egg_info', 'install_scripts', 5 | 'register', 'bdist_wininst', 'upload_docs', 6 | ] 7 | 8 | from distutils.command.bdist import bdist 9 | import sys 10 | 11 | from setuptools.command import install_scripts 12 | 13 | 14 | if 'egg' not in bdist.format_commands: 15 | bdist.format_command['egg'] = ('bdist_egg', "Python .egg file") 16 | bdist.format_commands.append('egg') 17 | 18 | del bdist, sys 19 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/command/alias.py: -------------------------------------------------------------------------------- 1 | from distutils.errors import DistutilsOptionError 2 | 3 | from setuptools.command.setopt import edit_config, option_base, config_file 4 | 5 | 6 | def shquote(arg): 7 | """Quote an argument for later parsing by shlex.split()""" 8 | for c in '"', "'", "\\", "#": 9 | if c in arg: 10 | return repr(arg) 11 | if arg.split() != [arg]: 12 | return repr(arg) 13 | return arg 14 | 15 | 16 | class alias(option_base): 17 | """Define a shortcut that invokes one or more commands""" 18 | 19 | description = "define a shortcut to invoke one or more commands" 20 | command_consumes_arguments = True 21 | 22 | user_options = [ 23 | ('remove', 'r', 'remove (unset) the alias'), 24 | ] + option_base.user_options 25 | 26 | boolean_options = option_base.boolean_options + ['remove'] 27 | 28 | def initialize_options(self): 29 | option_base.initialize_options(self) 30 | self.args = None 31 | self.remove = None 32 | 33 | def finalize_options(self): 34 | option_base.finalize_options(self) 35 | if self.remove and len(self.args) != 1: 36 | raise DistutilsOptionError( 37 | "Must specify exactly one argument (the alias name) when " 38 | "using --remove" 39 | ) 40 | 41 | def run(self): 42 | aliases = self.distribution.get_option_dict('aliases') 43 | 44 | if not self.args: 45 | print("Command Aliases") 46 | print("---------------") 47 | for alias in aliases: 48 | print("setup.py alias", format_alias(alias, aliases)) 49 | return 50 | 51 | elif len(self.args) == 1: 52 | alias, = self.args 53 | if self.remove: 54 | command = None 55 | elif alias in aliases: 56 | print("setup.py alias", format_alias(alias, aliases)) 57 | return 58 | else: 59 | print("No alias definition found for %r" % alias) 60 | return 61 | else: 62 | alias = self.args[0] 63 | command = ' '.join(map(shquote, self.args[1:])) 64 | 65 | edit_config(self.filename, {'aliases': {alias: command}}, self.dry_run) 66 | 67 | 68 | def format_alias(name, aliases): 69 | source, command = aliases[name] 70 | if source == config_file('global'): 71 | source = '--global-config ' 72 | elif source == config_file('user'): 73 | source = '--user-config ' 74 | elif source == config_file('local'): 75 | source = '' 76 | else: 77 | source = '--filename=%r' % source 78 | return source + name + ' ' + command 79 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/command/bdist_rpm.py: -------------------------------------------------------------------------------- 1 | import distutils.command.bdist_rpm as orig 2 | 3 | 4 | class bdist_rpm(orig.bdist_rpm): 5 | """ 6 | Override the default bdist_rpm behavior to do the following: 7 | 8 | 1. Run egg_info to ensure the name and version are properly calculated. 9 | 2. Always run 'install' using --single-version-externally-managed to 10 | disable eggs in RPM distributions. 11 | 3. Replace dash with underscore in the version numbers for better RPM 12 | compatibility. 13 | """ 14 | 15 | def run(self): 16 | # ensure distro name is up-to-date 17 | self.run_command('egg_info') 18 | 19 | orig.bdist_rpm.run(self) 20 | 21 | def _make_spec_file(self): 22 | version = self.distribution.get_version() 23 | rpmversion = version.replace('-', '_') 24 | spec = orig.bdist_rpm._make_spec_file(self) 25 | line23 = '%define version ' + version 26 | line24 = '%define version ' + rpmversion 27 | spec = [ 28 | line.replace( 29 | "Source0: %{name}-%{version}.tar", 30 | "Source0: %{name}-%{unmangled_version}.tar" 31 | ).replace( 32 | "setup.py install ", 33 | "setup.py install --single-version-externally-managed " 34 | ).replace( 35 | "%setup", 36 | "%setup -n %{name}-%{unmangled_version}" 37 | ).replace(line23, line24) 38 | for line in spec 39 | ] 40 | insert_loc = spec.index(line24) + 1 41 | unmangled_version = "%define unmangled_version " + version 42 | spec.insert(insert_loc, unmangled_version) 43 | return spec 44 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/command/bdist_wininst.py: -------------------------------------------------------------------------------- 1 | import distutils.command.bdist_wininst as orig 2 | 3 | 4 | class bdist_wininst(orig.bdist_wininst): 5 | def reinitialize_command(self, command, reinit_subcommands=0): 6 | """ 7 | Supplement reinitialize_command to work around 8 | http://bugs.python.org/issue20819 9 | """ 10 | cmd = self.distribution.reinitialize_command( 11 | command, reinit_subcommands) 12 | if command in ('install', 'install_lib'): 13 | cmd.install_lib = None 14 | return cmd 15 | 16 | def run(self): 17 | self._is_running = True 18 | try: 19 | orig.bdist_wininst.run(self) 20 | finally: 21 | self._is_running = False 22 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/command/install_scripts.py: -------------------------------------------------------------------------------- 1 | from distutils import log 2 | import distutils.command.install_scripts as orig 3 | import os 4 | 5 | from pkg_resources import Distribution, PathMetadata, ensure_directory 6 | 7 | 8 | class install_scripts(orig.install_scripts): 9 | """Do normal script install, plus any egg_info wrapper scripts""" 10 | 11 | def initialize_options(self): 12 | orig.install_scripts.initialize_options(self) 13 | self.no_ep = False 14 | 15 | def run(self): 16 | import setuptools.command.easy_install as ei 17 | 18 | self.run_command("egg_info") 19 | if self.distribution.scripts: 20 | orig.install_scripts.run(self) # run first to set up self.outfiles 21 | else: 22 | self.outfiles = [] 23 | if self.no_ep: 24 | # don't install entry point scripts into .egg file! 25 | return 26 | 27 | ei_cmd = self.get_finalized_command("egg_info") 28 | dist = Distribution( 29 | ei_cmd.egg_base, PathMetadata(ei_cmd.egg_base, ei_cmd.egg_info), 30 | ei_cmd.egg_name, ei_cmd.egg_version, 31 | ) 32 | bs_cmd = self.get_finalized_command('build_scripts') 33 | exec_param = getattr(bs_cmd, 'executable', None) 34 | bw_cmd = self.get_finalized_command("bdist_wininst") 35 | is_wininst = getattr(bw_cmd, '_is_running', False) 36 | writer = ei.ScriptWriter 37 | if is_wininst: 38 | exec_param = "python.exe" 39 | writer = ei.WindowsScriptWriter 40 | # resolve the writer to the environment 41 | writer = writer.best() 42 | cmd = writer.command_spec_class.best().from_param(exec_param) 43 | for args in writer.get_args(dist, cmd.as_header()): 44 | self.write_script(*args) 45 | 46 | def write_script(self, script_name, contents, mode="t", *ignored): 47 | """Write an executable file to the scripts directory""" 48 | from setuptools.command.easy_install import chmod, current_umask 49 | 50 | log.info("Installing %s script to %s", script_name, self.install_dir) 51 | target = os.path.join(self.install_dir, script_name) 52 | self.outfiles.append(target) 53 | 54 | mask = current_umask() 55 | if not self.dry_run: 56 | ensure_directory(target) 57 | f = open(target, "w" + mode) 58 | f.write(contents) 59 | f.close() 60 | chmod(target, 0o777 - mask) 61 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/command/launcher manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/command/register.py: -------------------------------------------------------------------------------- 1 | import distutils.command.register as orig 2 | 3 | 4 | class register(orig.register): 5 | __doc__ = orig.register.__doc__ 6 | 7 | def run(self): 8 | # Make sure that we are using valid current name/version info 9 | self.run_command('egg_info') 10 | orig.register.run(self) 11 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/command/rotate.py: -------------------------------------------------------------------------------- 1 | from distutils.util import convert_path 2 | from distutils import log 3 | from distutils.errors import DistutilsOptionError 4 | import os 5 | 6 | from setuptools import Command 7 | from setuptools.compat import basestring 8 | 9 | 10 | class rotate(Command): 11 | """Delete older distributions""" 12 | 13 | description = "delete older distributions, keeping N newest files" 14 | user_options = [ 15 | ('match=', 'm', "patterns to match (required)"), 16 | ('dist-dir=', 'd', "directory where the distributions are"), 17 | ('keep=', 'k', "number of matching distributions to keep"), 18 | ] 19 | 20 | boolean_options = [] 21 | 22 | def initialize_options(self): 23 | self.match = None 24 | self.dist_dir = None 25 | self.keep = None 26 | 27 | def finalize_options(self): 28 | if self.match is None: 29 | raise DistutilsOptionError( 30 | "Must specify one or more (comma-separated) match patterns " 31 | "(e.g. '.zip' or '.egg')" 32 | ) 33 | if self.keep is None: 34 | raise DistutilsOptionError("Must specify number of files to keep") 35 | try: 36 | self.keep = int(self.keep) 37 | except ValueError: 38 | raise DistutilsOptionError("--keep must be an integer") 39 | if isinstance(self.match, basestring): 40 | self.match = [ 41 | convert_path(p.strip()) for p in self.match.split(',') 42 | ] 43 | self.set_undefined_options('bdist', ('dist_dir', 'dist_dir')) 44 | 45 | def run(self): 46 | self.run_command("egg_info") 47 | from glob import glob 48 | 49 | for pattern in self.match: 50 | pattern = self.distribution.get_name() + '*' + pattern 51 | files = glob(os.path.join(self.dist_dir, pattern)) 52 | files = [(os.path.getmtime(f), f) for f in files] 53 | files.sort() 54 | files.reverse() 55 | 56 | log.info("%d file(s) matching %s", len(files), pattern) 57 | files = files[self.keep:] 58 | for (t, f) in files: 59 | log.info("Deleting %s", f) 60 | if not self.dry_run: 61 | os.unlink(f) 62 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/command/saveopts.py: -------------------------------------------------------------------------------- 1 | from setuptools.command.setopt import edit_config, option_base 2 | 3 | 4 | class saveopts(option_base): 5 | """Save command-line options to a file""" 6 | 7 | description = "save supplied options to setup.cfg or other config file" 8 | 9 | def run(self): 10 | dist = self.distribution 11 | settings = {} 12 | 13 | for cmd in dist.command_options: 14 | 15 | if cmd == 'saveopts': 16 | continue # don't save our own options! 17 | 18 | for opt, (src, val) in dist.get_option_dict(cmd).items(): 19 | if src == "command line": 20 | settings.setdefault(cmd, {})[opt] = val 21 | 22 | edit_config(self.filename, settings, self.dry_run) 23 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import itertools 3 | 4 | PY3 = sys.version_info >= (3,) 5 | PY2 = not PY3 6 | 7 | if PY2: 8 | basestring = basestring 9 | import __builtin__ as builtins 10 | import ConfigParser 11 | from StringIO import StringIO 12 | BytesIO = StringIO 13 | func_code = lambda o: o.func_code 14 | func_globals = lambda o: o.func_globals 15 | im_func = lambda o: o.im_func 16 | from htmlentitydefs import name2codepoint 17 | import httplib 18 | from BaseHTTPServer import HTTPServer 19 | from SimpleHTTPServer import SimpleHTTPRequestHandler 20 | from BaseHTTPServer import BaseHTTPRequestHandler 21 | iteritems = lambda o: o.iteritems() 22 | long_type = long 23 | maxsize = sys.maxint 24 | unichr = unichr 25 | unicode = unicode 26 | bytes = str 27 | from urllib import url2pathname, splittag, pathname2url 28 | import urllib2 29 | from urllib2 import urlopen, HTTPError, URLError, unquote, splituser 30 | from urlparse import urlparse, urlunparse, urljoin, urlsplit, urlunsplit 31 | filterfalse = itertools.ifilterfalse 32 | 33 | exec("""def reraise(tp, value, tb=None): 34 | raise tp, value, tb""") 35 | 36 | if PY3: 37 | basestring = str 38 | import builtins 39 | import configparser as ConfigParser 40 | from io import StringIO, BytesIO 41 | func_code = lambda o: o.__code__ 42 | func_globals = lambda o: o.__globals__ 43 | im_func = lambda o: o.__func__ 44 | from html.entities import name2codepoint 45 | import http.client as httplib 46 | from http.server import HTTPServer, SimpleHTTPRequestHandler 47 | from http.server import BaseHTTPRequestHandler 48 | iteritems = lambda o: o.items() 49 | long_type = int 50 | maxsize = sys.maxsize 51 | unichr = chr 52 | unicode = str 53 | bytes = bytes 54 | from urllib.error import HTTPError, URLError 55 | import urllib.request as urllib2 56 | from urllib.request import urlopen, url2pathname, pathname2url 57 | from urllib.parse import ( 58 | urlparse, urlunparse, unquote, splituser, urljoin, urlsplit, 59 | urlunsplit, splittag, 60 | ) 61 | filterfalse = itertools.filterfalse 62 | 63 | def reraise(tp, value, tb=None): 64 | if value.__traceback__ is not tb: 65 | raise value.with_traceback(tb) 66 | raise value 67 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/extension.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import re 3 | import functools 4 | import distutils.core 5 | import distutils.errors 6 | import distutils.extension 7 | 8 | from .dist import _get_unpatched 9 | from . import msvc9_support 10 | 11 | _Extension = _get_unpatched(distutils.core.Extension) 12 | 13 | msvc9_support.patch_for_specialized_compiler() 14 | 15 | def _have_cython(): 16 | """ 17 | Return True if Cython can be imported. 18 | """ 19 | cython_impl = 'Cython.Distutils.build_ext', 20 | try: 21 | # from (cython_impl) import build_ext 22 | __import__(cython_impl, fromlist=['build_ext']).build_ext 23 | return True 24 | except Exception: 25 | pass 26 | return False 27 | 28 | # for compatibility 29 | have_pyrex = _have_cython 30 | 31 | 32 | class Extension(_Extension): 33 | """Extension that uses '.c' files in place of '.pyx' files""" 34 | 35 | def _convert_pyx_sources_to_lang(self): 36 | """ 37 | Replace sources with .pyx extensions to sources with the target 38 | language extension. This mechanism allows language authors to supply 39 | pre-converted sources but to prefer the .pyx sources. 40 | """ 41 | if _have_cython(): 42 | # the build has Cython, so allow it to compile the .pyx files 43 | return 44 | lang = self.language or '' 45 | target_ext = '.cpp' if lang.lower() == 'c++' else '.c' 46 | sub = functools.partial(re.sub, '.pyx$', target_ext) 47 | self.sources = list(map(sub, self.sources)) 48 | 49 | class Library(Extension): 50 | """Just like a regular Extension, but built as a library instead""" 51 | 52 | distutils.core.Extension = Extension 53 | distutils.extension.Extension = Extension 54 | if 'distutils.command.build_ext' in sys.modules: 55 | sys.modules['distutils.command.build_ext'].Extension = Extension 56 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/gui-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/setuptools/gui-32.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/gui-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/setuptools/gui-64.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/gui-arm-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/setuptools/gui-arm-32.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/gui.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/setuptools/gui.exe -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/lib2to3_ex.py: -------------------------------------------------------------------------------- 1 | """ 2 | Customized Mixin2to3 support: 3 | 4 | - adds support for converting doctests 5 | 6 | 7 | This module raises an ImportError on Python 2. 8 | """ 9 | 10 | from distutils.util import Mixin2to3 as _Mixin2to3 11 | from distutils import log 12 | from lib2to3.refactor import RefactoringTool, get_fixers_from_package 13 | import setuptools 14 | 15 | class DistutilsRefactoringTool(RefactoringTool): 16 | def log_error(self, msg, *args, **kw): 17 | log.error(msg, *args) 18 | 19 | def log_message(self, msg, *args): 20 | log.info(msg, *args) 21 | 22 | def log_debug(self, msg, *args): 23 | log.debug(msg, *args) 24 | 25 | class Mixin2to3(_Mixin2to3): 26 | def run_2to3(self, files, doctests = False): 27 | # See of the distribution option has been set, otherwise check the 28 | # setuptools default. 29 | if self.distribution.use_2to3 is not True: 30 | return 31 | if not files: 32 | return 33 | log.info("Fixing "+" ".join(files)) 34 | self.__build_fixer_names() 35 | self.__exclude_fixers() 36 | if doctests: 37 | if setuptools.run_2to3_on_doctests: 38 | r = DistutilsRefactoringTool(self.fixer_names) 39 | r.refactor(files, write=True, doctests_only=True) 40 | else: 41 | _Mixin2to3.run_2to3(self, files) 42 | 43 | def __build_fixer_names(self): 44 | if self.fixer_names: return 45 | self.fixer_names = [] 46 | for p in setuptools.lib2to3_fixer_packages: 47 | self.fixer_names.extend(get_fixers_from_package(p)) 48 | if self.distribution.use_2to3_fixers is not None: 49 | for p in self.distribution.use_2to3_fixers: 50 | self.fixer_names.extend(get_fixers_from_package(p)) 51 | 52 | def __exclude_fixers(self): 53 | excluded_fixers = getattr(self, 'exclude_fixers', []) 54 | if self.distribution.use_2to3_exclude_fixers is not None: 55 | excluded_fixers.extend(self.distribution.use_2to3_exclude_fixers) 56 | for fixer_name in excluded_fixers: 57 | if fixer_name in self.fixer_names: 58 | self.fixer_names.remove(fixer_name) 59 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/msvc9_support.py: -------------------------------------------------------------------------------- 1 | try: 2 | import distutils.msvc9compiler 3 | except ImportError: 4 | pass 5 | 6 | unpatched = dict() 7 | 8 | def patch_for_specialized_compiler(): 9 | """ 10 | Patch functions in distutils.msvc9compiler to use the standalone compiler 11 | build for Python (Windows only). Fall back to original behavior when the 12 | standalone compiler is not available. 13 | """ 14 | if 'distutils' not in globals(): 15 | # The module isn't available to be patched 16 | return 17 | 18 | if unpatched: 19 | # Already patched 20 | return 21 | 22 | unpatched.update(vars(distutils.msvc9compiler)) 23 | 24 | distutils.msvc9compiler.find_vcvarsall = find_vcvarsall 25 | distutils.msvc9compiler.query_vcvarsall = query_vcvarsall 26 | 27 | def find_vcvarsall(version): 28 | Reg = distutils.msvc9compiler.Reg 29 | VC_BASE = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' 30 | key = VC_BASE % ('', version) 31 | try: 32 | # Per-user installs register the compiler path here 33 | productdir = Reg.get_value(key, "installdir") 34 | except KeyError: 35 | try: 36 | # All-user installs on a 64-bit system register here 37 | key = VC_BASE % ('Wow6432Node\\', version) 38 | productdir = Reg.get_value(key, "installdir") 39 | except KeyError: 40 | productdir = None 41 | 42 | if productdir: 43 | import os 44 | vcvarsall = os.path.join(productdir, "vcvarsall.bat") 45 | if os.path.isfile(vcvarsall): 46 | return vcvarsall 47 | 48 | return unpatched['find_vcvarsall'](version) 49 | 50 | def query_vcvarsall(version, *args, **kwargs): 51 | try: 52 | return unpatched['query_vcvarsall'](version, *args, **kwargs) 53 | except distutils.errors.DistutilsPlatformError as exc: 54 | if exc and "vcvarsall.bat" in exc.args[0]: 55 | message = 'Microsoft Visual C++ %0.1f is required (%s).' % (version, exc.args[0]) 56 | if int(version) == 9: 57 | # This redirection link is maintained by Microsoft. 58 | # Contact vspython@microsoft.com if it needs updating. 59 | raise distutils.errors.DistutilsPlatformError( 60 | message + ' Get it from http://aka.ms/vcpython27' 61 | ) 62 | raise distutils.errors.DistutilsPlatformError(message) 63 | raise 64 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/py26compat.py: -------------------------------------------------------------------------------- 1 | """ 2 | Compatibility Support for Python 2.6 and earlier 3 | """ 4 | 5 | import sys 6 | 7 | from setuptools.compat import splittag 8 | 9 | def strip_fragment(url): 10 | """ 11 | In `Python 8280 `_, Python 2.7 and 12 | later was patched to disregard the fragment when making URL requests. 13 | Do the same for Python 2.6 and earlier. 14 | """ 15 | url, fragment = splittag(url) 16 | return url 17 | 18 | if sys.version_info >= (2,7): 19 | strip_fragment = lambda x: x 20 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/py27compat.py: -------------------------------------------------------------------------------- 1 | """ 2 | Compatibility Support for Python 2.7 and earlier 3 | """ 4 | 5 | import sys 6 | 7 | def get_all_headers(message, key): 8 | """ 9 | Given an HTTPMessage, return all headers matching a given key. 10 | """ 11 | return message.get_all(key) 12 | 13 | if sys.version_info < (3,): 14 | def get_all_headers(message, key): 15 | return message.getheaders(key) 16 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/py31compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import unittest 3 | 4 | __all__ = ['get_config_vars', 'get_path'] 5 | 6 | try: 7 | # Python 2.7 or >=3.2 8 | from sysconfig import get_config_vars, get_path 9 | except ImportError: 10 | from distutils.sysconfig import get_config_vars, get_python_lib 11 | def get_path(name): 12 | if name not in ('platlib', 'purelib'): 13 | raise ValueError("Name must be purelib or platlib") 14 | return get_python_lib(name=='platlib') 15 | 16 | try: 17 | # Python >=3.2 18 | from tempfile import TemporaryDirectory 19 | except ImportError: 20 | import shutil 21 | import tempfile 22 | class TemporaryDirectory(object): 23 | """" 24 | Very simple temporary directory context manager. 25 | Will try to delete afterward, but will also ignore OS and similar 26 | errors on deletion. 27 | """ 28 | def __init__(self): 29 | self.name = None # Handle mkdtemp raising an exception 30 | self.name = tempfile.mkdtemp() 31 | 32 | def __enter__(self): 33 | return self.name 34 | 35 | def __exit__(self, exctype, excvalue, exctrace): 36 | try: 37 | shutil.rmtree(self.name, True) 38 | except OSError: #removal errors are not the only possible 39 | pass 40 | self.name = None 41 | 42 | 43 | unittest_main = unittest.main 44 | 45 | _PY31 = (3, 1) <= sys.version_info[:2] < (3, 2) 46 | if _PY31: 47 | # on Python 3.1, translate testRunner==None to TextTestRunner 48 | # for compatibility with Python 2.6, 2.7, and 3.2+ 49 | def unittest_main(*args, **kwargs): 50 | if 'testRunner' in kwargs and kwargs['testRunner'] is None: 51 | kwargs['testRunner'] = unittest.TextTestRunner 52 | return unittest.main(*args, **kwargs) 53 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/script (dev).tmpl: -------------------------------------------------------------------------------- 1 | # EASY-INSTALL-DEV-SCRIPT: %(spec)r,%(script_name)r 2 | __requires__ = %(spec)r 3 | __import__('pkg_resources').require(%(spec)r) 4 | __file__ = %(dev_path)r 5 | exec(compile(open(__file__).read(), __file__, 'exec')) 6 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/script.tmpl: -------------------------------------------------------------------------------- 1 | # EASY-INSTALL-SCRIPT: %(spec)r,%(script_name)r 2 | __requires__ = %(spec)r 3 | __import__('pkg_resources').run_script(%(spec)r, %(script_name)r) 4 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/site-patch.py: -------------------------------------------------------------------------------- 1 | def __boot(): 2 | import sys 3 | import os 4 | PYTHONPATH = os.environ.get('PYTHONPATH') 5 | if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): 6 | PYTHONPATH = [] 7 | else: 8 | PYTHONPATH = PYTHONPATH.split(os.pathsep) 9 | 10 | pic = getattr(sys,'path_importer_cache',{}) 11 | stdpath = sys.path[len(PYTHONPATH):] 12 | mydir = os.path.dirname(__file__) 13 | #print "searching",stdpath,sys.path 14 | 15 | for item in stdpath: 16 | if item==mydir or not item: 17 | continue # skip if current dir. on Windows, or my own directory 18 | importer = pic.get(item) 19 | if importer is not None: 20 | loader = importer.find_module('site') 21 | if loader is not None: 22 | # This should actually reload the current module 23 | loader.load_module('site') 24 | break 25 | else: 26 | try: 27 | import imp # Avoid import loop in Python >= 3.3 28 | stream, path, descr = imp.find_module('site',[item]) 29 | except ImportError: 30 | continue 31 | if stream is None: 32 | continue 33 | try: 34 | # This should actually reload the current module 35 | imp.load_module('site',stream,path,descr) 36 | finally: 37 | stream.close() 38 | break 39 | else: 40 | raise ImportError("Couldn't find the real 'site' module") 41 | 42 | #print "loaded", __file__ 43 | 44 | known_paths = dict([(makepath(item)[1],1) for item in sys.path]) # 2.2 comp 45 | 46 | oldpos = getattr(sys,'__egginsert',0) # save old insertion position 47 | sys.__egginsert = 0 # and reset the current one 48 | 49 | for item in PYTHONPATH: 50 | addsitedir(item) 51 | 52 | sys.__egginsert += oldpos # restore effective old position 53 | 54 | d, nd = makepath(stdpath[0]) 55 | insert_at = None 56 | new_path = [] 57 | 58 | for item in sys.path: 59 | p, np = makepath(item) 60 | 61 | if np==nd and insert_at is None: 62 | # We've hit the first 'system' path entry, so added entries go here 63 | insert_at = len(new_path) 64 | 65 | if np in known_paths or insert_at is None: 66 | new_path.append(item) 67 | else: 68 | # new path after the insert point, back-insert it 69 | new_path.insert(insert_at, item) 70 | insert_at += 1 71 | 72 | sys.path[:] = new_path 73 | 74 | if __name__=='site': 75 | __boot() 76 | del __boot 77 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/unicode_utils.py: -------------------------------------------------------------------------------- 1 | import unicodedata 2 | import sys 3 | from setuptools.compat import unicode as decoded_string 4 | 5 | 6 | # HFS Plus uses decomposed UTF-8 7 | def decompose(path): 8 | if isinstance(path, decoded_string): 9 | return unicodedata.normalize('NFD', path) 10 | try: 11 | path = path.decode('utf-8') 12 | path = unicodedata.normalize('NFD', path) 13 | path = path.encode('utf-8') 14 | except UnicodeError: 15 | pass # Not UTF-8 16 | return path 17 | 18 | 19 | def filesys_decode(path): 20 | """ 21 | Ensure that the given path is decoded, 22 | NONE when no expected encoding works 23 | """ 24 | 25 | fs_enc = sys.getfilesystemencoding() 26 | if isinstance(path, decoded_string): 27 | return path 28 | 29 | for enc in (fs_enc, "utf-8"): 30 | try: 31 | return path.decode(enc) 32 | except UnicodeDecodeError: 33 | continue 34 | 35 | 36 | def try_encode(string, enc): 37 | "turn unicode encoding into a functional routine" 38 | try: 39 | return string.encode(enc) 40 | except UnicodeEncodeError: 41 | return None 42 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os.path 3 | 4 | 5 | def cs_path_exists(fspath): 6 | if not os.path.exists(fspath): 7 | return False 8 | # make absolute so we always have a directory 9 | abspath = os.path.abspath(fspath) 10 | directory, filename = os.path.split(abspath) 11 | return filename in os.listdir(directory) -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '18.2' 2 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/setuptools/windows_support.py: -------------------------------------------------------------------------------- 1 | import platform 2 | import ctypes 3 | 4 | 5 | def windows_only(func): 6 | if platform.system() != 'Windows': 7 | return lambda *args, **kwargs: None 8 | return func 9 | 10 | 11 | @windows_only 12 | def hide_file(path): 13 | """ 14 | Set the hidden attribute on a file or directory. 15 | 16 | From http://stackoverflow.com/questions/19622133/ 17 | 18 | `path` must be text. 19 | """ 20 | __import__('ctypes.wintypes') 21 | SetFileAttributes = ctypes.windll.kernel32.SetFileAttributesW 22 | SetFileAttributes.argtypes = ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD 23 | SetFileAttributes.restype = ctypes.wintypes.BOOL 24 | 25 | FILE_ATTRIBUTE_HIDDEN = 0x02 26 | 27 | ret = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN) 28 | if not ret: 29 | raise ctypes.WinError() 30 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel-0.24.0.dist-info/LICENSE.txt: -------------------------------------------------------------------------------- 1 | "wheel" copyright (c) 2012-2014 Daniel Holth and 2 | contributors. 3 | 4 | The MIT License 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a 7 | copy of this software and associated documentation files (the "Software"), 8 | to deal in the Software without restriction, including without limitation 9 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | and/or sell copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel-0.24.0.dist-info/RECORD.jws: -------------------------------------------------------------------------------- 1 | {"payload": "eyJoYXNoIjogInNoYTI1Nj1uVjFXeHk3SF9ma1pJNGhRQ0FnRk9pNk13Z1RlV2toZy1pLXJ6ZWJfOE84In0", "recipients": [{"header": "eyJhbGciOiAiRWQyNTUxOSIsICJqd2siOiB7Imt0eSI6ICJFZDI1NTE5IiwgInZrIjogInRtQVlDclNmajhndEoxMHYzVmt2VzdqT25kS21RSVlFMTJoZ25GdTNjdmsifX0", "signature": "u8FI49_qMGO7rBsRcdRFrcjHCdXvtdw-sFpqI0dCyzNBPCqUxHFNy-8SZPAYJs56PAvnOnCF79H2iqtV5c8yAw"}]} -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel-0.24.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.24.0) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel-0.24.0.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | wheel = wheel.tool:main 3 | 4 | [distutils.commands] 5 | bdist_wheel = wheel.bdist_wheel:bdist_wheel -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel-0.24.0.dist-info/metadata.json: -------------------------------------------------------------------------------- 1 | {"license": "MIT", "name": "wheel", "metadata_version": "2.0", "generator": "bdist_wheel (0.24.0)", "test_requires": [{"requires": ["jsonschema", "pytest", "coverage", "pytest-cov"]}], "summary": "A built-package format for Python.", "run_requires": [{"requires": ["ed25519ll"], "extra": "faster-signatures"}, {"requires": ["keyring"], "extra": "signatures"}, {"environment": "python_version==\"2.6\"", "requires": ["argparse"]}, {"environment": "sys_platform!=\"win32\"", "requires": ["pyxdg"], "extra": "signatures"}], "version": "0.24.0", "extensions": {"python.details": {"project_urls": {"Home": "http://bitbucket.org/pypa/wheel/"}, "document_names": {"description": "DESCRIPTION.rst", "license": "LICENSE.txt"}, "contacts": [{"role": "author", "email": "dholth@fastmail.fm", "name": "Daniel Holth"}]}, "python.commands": {"wrap_console": {"wheel": "wheel.tool:main"}}, "python.exports": {"console_scripts": {"wheel": "wheel.tool:main"}, "distutils.commands": {"bdist_wheel": "wheel.bdist_wheel:bdist_wheel"}}}, "keywords": ["wheel", "packaging"], "classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4"], "extras": ["faster-signatures", "signatures", "tool"]} -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel-0.24.0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | wheel 2 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/__init__.py: -------------------------------------------------------------------------------- 1 | # __variables__ with double-quoted values will be available in setup.py: 2 | __version__ = "0.24.0" 3 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/__main__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Wheel command line tool (enable python -m wheel syntax) 3 | """ 4 | 5 | import sys 6 | 7 | def main(): # needed for console script 8 | if __package__ == '': 9 | # To be able to run 'python wheel-0.9.whl/wheel': 10 | import os.path 11 | path = os.path.dirname(os.path.dirname(__file__)) 12 | sys.path[0:0] = [path] 13 | import wheel.tool 14 | sys.exit(wheel.tool.main()) 15 | 16 | if __name__ == "__main__": 17 | sys.exit(main()) 18 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/archive.py: -------------------------------------------------------------------------------- 1 | """ 2 | Archive tools for wheel. 3 | """ 4 | 5 | import logging 6 | import os.path 7 | import zipfile 8 | 9 | log = logging.getLogger("wheel") 10 | 11 | 12 | def archive_wheelfile(base_name, base_dir): 13 | '''Archive all files under `base_dir` in a whl file and name it like 14 | `base_name`. 15 | ''' 16 | olddir = os.path.abspath(os.curdir) 17 | base_name = os.path.abspath(base_name) 18 | try: 19 | os.chdir(base_dir) 20 | return make_wheelfile_inner(base_name) 21 | finally: 22 | os.chdir(olddir) 23 | 24 | 25 | def make_wheelfile_inner(base_name, base_dir='.'): 26 | """Create a whl file from all the files under 'base_dir'. 27 | 28 | Places .dist-info at the end of the archive.""" 29 | 30 | zip_filename = base_name + ".whl" 31 | 32 | log.info("creating '%s' and adding '%s' to it", zip_filename, base_dir) 33 | 34 | # XXX support bz2, xz when available 35 | zip = zipfile.ZipFile(open(zip_filename, "wb+"), "w", 36 | compression=zipfile.ZIP_DEFLATED) 37 | 38 | score = {'WHEEL': 1, 'METADATA': 2, 'RECORD': 3} 39 | deferred = [] 40 | 41 | def writefile(path): 42 | zip.write(path, path) 43 | log.info("adding '%s'" % path) 44 | 45 | for dirpath, dirnames, filenames in os.walk(base_dir): 46 | for name in filenames: 47 | path = os.path.normpath(os.path.join(dirpath, name)) 48 | 49 | if os.path.isfile(path): 50 | if dirpath.endswith('.dist-info'): 51 | deferred.append((score.get(name, 0), path)) 52 | else: 53 | writefile(path) 54 | 55 | deferred.sort() 56 | for score, path in deferred: 57 | writefile(path) 58 | 59 | zip.close() 60 | 61 | return zip_filename 62 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/decorator.py: -------------------------------------------------------------------------------- 1 | # from Pyramid 2 | 3 | 4 | class reify(object): 5 | """Put the result of a method which uses this (non-data) 6 | descriptor decorator in the instance dict after the first call, 7 | effectively replacing the decorator with an instance variable. 8 | """ 9 | 10 | def __init__(self, wrapped): 11 | self.wrapped = wrapped 12 | self.__doc__ = wrapped.__doc__ 13 | 14 | def __get__(self, inst, objtype=None): 15 | if inst is None: 16 | return self 17 | val = self.wrapped(inst) 18 | setattr(inst, self.wrapped.__name__, val) 19 | return val 20 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/paths.py: -------------------------------------------------------------------------------- 1 | """ 2 | Installation paths. 3 | 4 | Map the .data/ subdirectory names to install paths. 5 | """ 6 | 7 | import os.path 8 | import sys 9 | import distutils.dist as dist 10 | import distutils.command.install as install 11 | 12 | def get_install_command(name): 13 | # late binding due to potential monkeypatching 14 | d = dist.Distribution({'name':name}) 15 | i = install.install(d) 16 | i.finalize_options() 17 | return i 18 | 19 | def get_install_paths(name): 20 | """ 21 | Return the (distutils) install paths for the named dist. 22 | 23 | A dict with ('purelib', 'platlib', 'headers', 'scripts', 'data') keys. 24 | """ 25 | paths = {} 26 | 27 | i = get_install_command(name) 28 | 29 | for key in install.SCHEME_KEYS: 30 | paths[key] = getattr(i, 'install_' + key) 31 | 32 | # pip uses a similar path as an alternative to the system's (read-only) 33 | # include directory: 34 | if hasattr(sys, 'real_prefix'): # virtualenv 35 | paths['headers'] = os.path.join(sys.prefix, 36 | 'include', 37 | 'site', 38 | 'python' + sys.version[:3], 39 | name) 40 | 41 | return paths 42 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/pkginfo.py: -------------------------------------------------------------------------------- 1 | """Tools for reading and writing PKG-INFO / METADATA without caring 2 | about the encoding.""" 3 | 4 | from email.parser import Parser 5 | 6 | try: 7 | unicode 8 | _PY3 = False 9 | except NameError: 10 | _PY3 = True 11 | 12 | if not _PY3: 13 | from email.generator import Generator 14 | 15 | def read_pkg_info_bytes(bytestr): 16 | return Parser().parsestr(bytestr) 17 | 18 | def read_pkg_info(path): 19 | with open(path, "r") as headers: 20 | message = Parser().parse(headers) 21 | return message 22 | 23 | def write_pkg_info(path, message): 24 | with open(path, 'w') as metadata: 25 | Generator(metadata, maxheaderlen=0).flatten(message) 26 | 27 | else: 28 | from email.generator import BytesGenerator 29 | def read_pkg_info_bytes(bytestr): 30 | headers = bytestr.decode(encoding="ascii", errors="surrogateescape") 31 | message = Parser().parsestr(headers) 32 | return message 33 | 34 | def read_pkg_info(path): 35 | with open(path, "r", 36 | encoding="ascii", 37 | errors="surrogateescape") as headers: 38 | message = Parser().parse(headers) 39 | return message 40 | 41 | def write_pkg_info(path, message): 42 | with open(path, "wb") as out: 43 | BytesGenerator(out, maxheaderlen=0).flatten(message) 44 | 45 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/signatures/ed25519py.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import warnings 4 | import os 5 | 6 | from collections import namedtuple 7 | from . import djbec 8 | 9 | __all__ = ['crypto_sign', 'crypto_sign_open', 'crypto_sign_keypair', 'Keypair', 10 | 'PUBLICKEYBYTES', 'SECRETKEYBYTES', 'SIGNATUREBYTES'] 11 | 12 | PUBLICKEYBYTES=32 13 | SECRETKEYBYTES=64 14 | SIGNATUREBYTES=64 15 | 16 | Keypair = namedtuple('Keypair', ('vk', 'sk')) # verifying key, secret key 17 | 18 | def crypto_sign_keypair(seed=None): 19 | """Return (verifying, secret) key from a given seed, or os.urandom(32)""" 20 | if seed is None: 21 | seed = os.urandom(PUBLICKEYBYTES) 22 | else: 23 | warnings.warn("ed25519ll should choose random seed.", 24 | RuntimeWarning) 25 | if len(seed) != 32: 26 | raise ValueError("seed must be 32 random bytes or None.") 27 | skbytes = seed 28 | vkbytes = djbec.publickey(skbytes) 29 | return Keypair(vkbytes, skbytes+vkbytes) 30 | 31 | 32 | def crypto_sign(msg, sk): 33 | """Return signature+message given message and secret key. 34 | The signature is the first SIGNATUREBYTES bytes of the return value. 35 | A copy of msg is in the remainder.""" 36 | if len(sk) != SECRETKEYBYTES: 37 | raise ValueError("Bad signing key length %d" % len(sk)) 38 | vkbytes = sk[PUBLICKEYBYTES:] 39 | skbytes = sk[:PUBLICKEYBYTES] 40 | sig = djbec.signature(msg, skbytes, vkbytes) 41 | return sig + msg 42 | 43 | 44 | def crypto_sign_open(signed, vk): 45 | """Return message given signature+message and the verifying key.""" 46 | if len(vk) != PUBLICKEYBYTES: 47 | raise ValueError("Bad verifying key length %d" % len(vk)) 48 | rc = djbec.checkvalid(signed[:SIGNATUREBYTES], signed[SIGNATUREBYTES:], vk) 49 | if not rc: 50 | raise ValueError("rc != True", rc) 51 | return signed[SIGNATUREBYTES:] 52 | 53 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/__init__.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/complex-dist/complexdist/__init__.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | return 3 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/complex-dist/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | try: 4 | unicode 5 | def u8(s): 6 | return s.decode('unicode-escape') 7 | except NameError: 8 | def u8(s): 9 | return s 10 | 11 | setup(name='complex-dist', 12 | version='0.1', 13 | description=u8('Another testing distribution \N{SNOWMAN}'), 14 | long_description=u8('Another testing distribution \N{SNOWMAN}'), 15 | author="Illustrious Author", 16 | author_email="illustrious@example.org", 17 | url="http://example.org/exemplary", 18 | packages=['complexdist'], 19 | setup_requires=["wheel", "setuptools"], 20 | install_requires=["quux", "splort"], 21 | extras_require={'simple':['simple.dist']}, 22 | tests_require=["foo", "bar>=10.0.0"], 23 | entry_points={'console_scripts':['complex-dist=complexdist:main']} 24 | ) 25 | 26 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/headers.dist/header.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/wheel/test/headers.dist/header.h -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/headers.dist/headersdist.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/wheel/test/headers.dist/headersdist.py -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/headers.dist/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | try: 4 | unicode 5 | def u8(s): 6 | return s.decode('unicode-escape').encode('utf-8') 7 | except NameError: 8 | def u8(s): 9 | return s.encode('utf-8') 10 | 11 | setup(name='headers.dist', 12 | version='0.1', 13 | description=u8('A distribution with headers'), 14 | headers=['header.h'] 15 | ) 16 | 17 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/simple.dist/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | try: 4 | unicode 5 | def u8(s): 6 | return s.decode('unicode-escape').encode('utf-8') 7 | except NameError: 8 | def u8(s): 9 | return s.encode('utf-8') 10 | 11 | setup(name='simple.dist', 12 | version='0.1', 13 | description=u8('A testing distribution \N{SNOWMAN}'), 14 | packages=['simpledist'], 15 | extras_require={'voting': ['beaglevote']}, 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/simple.dist/simpledist/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/wheel/test/simple.dist/simpledist/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/test-1.0-py2.py3-none-win32.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tadatoshi/metaheuristic_algorithms_python/d9162ba3af9228ff4a5e7d457eaf834b28ecf610/venv/lib/python3.5/site-packages/wheel/test/test-1.0-py2.py3-none-win32.whl -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/test_install.py: -------------------------------------------------------------------------------- 1 | # Test wheel. 2 | # The file has the following contents: 3 | # hello.pyd 4 | # hello/hello.py 5 | # hello/__init__.py 6 | # test-1.0.data/data/hello.dat 7 | # test-1.0.data/headers/hello.dat 8 | # test-1.0.data/scripts/hello.sh 9 | # test-1.0.dist-info/WHEEL 10 | # test-1.0.dist-info/METADATA 11 | # test-1.0.dist-info/RECORD 12 | # The root is PLATLIB 13 | # So, some in PLATLIB, and one in each of DATA, HEADERS and SCRIPTS. 14 | 15 | import wheel.tool 16 | import wheel.pep425tags 17 | from wheel.install import WheelFile 18 | from tempfile import mkdtemp 19 | import shutil 20 | import os 21 | 22 | THISDIR = os.path.dirname(__file__) 23 | TESTWHEEL = os.path.join(THISDIR, 'test-1.0-py2.py3-none-win32.whl') 24 | 25 | def check(*path): 26 | return os.path.exists(os.path.join(*path)) 27 | 28 | def test_install(): 29 | tempdir = mkdtemp() 30 | def get_supported(): 31 | return list(wheel.pep425tags.get_supported()) + [('py3', 'none', 'win32')] 32 | whl = WheelFile(TESTWHEEL, context=get_supported) 33 | assert whl.supports_current_python(get_supported) 34 | try: 35 | locs = {} 36 | for key in ('purelib', 'platlib', 'scripts', 'headers', 'data'): 37 | locs[key] = os.path.join(tempdir, key) 38 | os.mkdir(locs[key]) 39 | whl.install(overrides=locs) 40 | assert len(os.listdir(locs['purelib'])) == 0 41 | assert check(locs['platlib'], 'hello.pyd') 42 | assert check(locs['platlib'], 'hello', 'hello.py') 43 | assert check(locs['platlib'], 'hello', '__init__.py') 44 | assert check(locs['data'], 'hello.dat') 45 | assert check(locs['headers'], 'hello.dat') 46 | assert check(locs['scripts'], 'hello.sh') 47 | assert check(locs['platlib'], 'test-1.0.dist-info', 'RECORD') 48 | finally: 49 | shutil.rmtree(tempdir) 50 | 51 | def test_install_tool(): 52 | """Slightly improve coverage of wheel.install""" 53 | wheel.tool.install([TESTWHEEL], force=True, dry_run=True) 54 | 55 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/test_paths.py: -------------------------------------------------------------------------------- 1 | import wheel.paths 2 | from distutils.command.install import SCHEME_KEYS 3 | 4 | def test_path(): 5 | d = wheel.paths.get_install_paths('wheel') 6 | assert len(d) == len(SCHEME_KEYS) 7 | -------------------------------------------------------------------------------- /venv/lib/python3.5/site-packages/wheel/test/test_ranking.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from wheel.pep425tags import get_supported 4 | from wheel.install import WheelFile 5 | 6 | WHEELPAT = "%(name)s-%(ver)s-%(pyver)s-%(abi)s-%(arch)s.whl" 7 | def make_wheel(name, ver, pyver, abi, arch): 8 | name = WHEELPAT % dict(name=name, ver=ver, pyver=pyver, abi=abi, 9 | arch=arch) 10 | return WheelFile(name) 11 | 12 | # This relies on the fact that generate_supported will always return the 13 | # exact pyver, abi, and architecture for its first (best) match. 14 | sup = get_supported() 15 | pyver, abi, arch = sup[0] 16 | genver = 'py' + pyver[2:] 17 | majver = genver[:3] 18 | 19 | COMBINATIONS = ( 20 | ('bar', '0.9', 'py2.py3', 'none', 'any'), 21 | ('bar', '0.9', majver, 'none', 'any'), 22 | ('bar', '0.9', genver, 'none', 'any'), 23 | ('bar', '0.9', pyver, abi, arch), 24 | ('bar', '1.3.2', majver, 'none', 'any'), 25 | ('bar', '3.1', genver, 'none', 'any'), 26 | ('bar', '3.1', pyver, abi, arch), 27 | ('foo', '1.0', majver, 'none', 'any'), 28 | ('foo', '1.1', pyver, abi, arch), 29 | ('foo', '2.1', majver + '0', 'none', 'any'), 30 | # This will not be compatible for Python x.0. Beware when we hit Python 31 | # 4.0, and don't test with 3.0!!! 32 | ('foo', '2.1', majver + '1', 'none', 'any'), 33 | ('foo', '2.1', pyver , 'none', 'any'), 34 | ('foo', '2.1', pyver , abi, arch), 35 | ) 36 | 37 | WHEELS = [ make_wheel(*args) for args in COMBINATIONS ] 38 | 39 | class TestRanking(unittest.TestCase): 40 | def test_comparison(self): 41 | for i in range(len(WHEELS)-1): 42 | for j in range(i): 43 | self.assertTrue(WHEELS[j]