This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import constraint as cst | |
| problem = cst.Problem() | |
| problem.addVariable("a", [1,2,3,4,5]) | |
| problem.addVariable("b", [4,5,6]) | |
| problem.addConstraint(cst.FunctionConstraint(lambda a, b: a > b + 10), ["a", "b"]) | |
| print(problem.getSolution()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import urllib | |
| import datetime | |
| _DATA_INDEX = ['USDJPY', 'EURJPY', 'EURUSD', | |
| 'GBPJPY', 'AUDJPY', 'NZDJPY', | |
| 'ZARJPY', 'CADJPY', 'CHFJPY', | |
| 'GBPUSD', 'AUDUSD', 'HKDJPY', | |
| 'SGDJPY', 'NZDUSD', 'USDCHF', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import numpy as np | |
| import networkx as nx | |
| import matplotlib.pyplot as plt | |
| EPS = 1.0e-9 | |
| def add_cross_edge(gp, shape): | |
| """ |