content
stringlengths 7
928k
| avg_line_length
float64 3.5
33.8k
| max_line_length
int64 6
139k
| alphanum_fraction
float64 0.08
0.96
| licenses
sequence | repository_name
stringlengths 7
104
| path
stringlengths 4
230
| size
int64 7
928k
| lang
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|
import re
import types
import logging
from banal import ensure_list
from normality import stringify
from balkhash.utils import safe_fragment
from email.utils import parsedate_to_datetime, getaddresses
from normality import safe_filename, ascii_text
from followthemoney.types import registry
from ingestors.support.html import HTMLSupport
from ingestors.support.cache import CacheSupport
from ingestors.support.temp import TempFileSupport
log = logging.getLogger(__name__)
class EmailIdentity(object):
def __init__(self, manager, name, email):
self.email = ascii_text(stringify(email))
self.name = stringify(name)
if not registry.email.validate(self.email):
self.email = None
if registry.email.validate(self.name):
self.email = self.email or ascii_text(self.name)
self.name = None
# This should be using formataddr, but I cannot figure out how
# to use that without encoding the name.
self.label = None
if self.name is not None and self.email is not None:
self.label = '%s <%s>' % (self.name, self.email)
elif self.name is None and self.email is not None:
self.label = self.email
elif self.email is None and self.name is not None:
self.label = self.name
self.entity = None
if self.email is not None:
key = self.email.lower().strip()
fragment = safe_fragment(self.label)
self.entity = manager.make_entity('LegalEntity')
self.entity.make_id(key)
self.entity.add('name', self.name)
self.entity.add('email', self.email)
manager.emit_entity(self.entity, fragment=fragment)
class EmailSupport(TempFileSupport, HTMLSupport, CacheSupport):
"""Extract metadata from email messages."""
MID_RE = re.compile(r'<([^>]*)>')
def ingest_attachment(self, entity, name, mime_type, body):
has_body = body is not None and len(body)
if stringify(name) is None and not has_body:
# Hello, Outlook.
return
file_name = safe_filename(name, default='attachment')
file_path = self.make_work_file(file_name)
with open(file_path, 'wb') as fh:
if isinstance(body, str):
body = body.encode('utf-8')
if body is not None:
fh.write(body)
checksum = self.manager.store(file_path, mime_type=mime_type)
file_path.unlink()
child = self.manager.make_entity('Document', parent=entity)
child.make_id(name, checksum)
child.add('contentHash', checksum)
child.add('fileName', name)
child.add('mimeType', mime_type)
self.manager.queue_entity(child)
def get_header(self, msg, *headers):
values = []
for header in headers:
try:
for value in ensure_list(msg.get_all(header)):
values.append(value)
except (TypeError, IndexError, AttributeError, ValueError) as exc:
log.warning("Failed to parse [%s]: %s", header, exc)
return values
def get_dates(self, msg, *headers):
dates = []
for value in self.get_header(msg, *headers):
try:
dates.append(parsedate_to_datetime(value))
except Exception:
log.warning("Failed to parse: %s", value)
return dates
def get_identities(self, values):
values = [v for v in ensure_list(values) if v is not None]
for (name, email) in getaddresses(values):
yield EmailIdentity(self.manager, name, email)
def get_header_identities(self, msg, *headers):
yield from self.get_identities(self.get_header(msg, *headers))
def apply_identities(self, entity, identities, eprop=None, lprop=None):
if isinstance(identities, types.GeneratorType):
identities = list(identities)
for identity in ensure_list(identities):
if eprop is not None:
entity.add(eprop, identity.entity)
if lprop is not None:
entity.add(lprop, identity.label)
entity.add('namesMentioned', identity.name)
entity.add('emailMentioned', identity.email)
def parse_message_ids(self, values):
message_ids = []
for value in ensure_list(values):
value = stringify(value)
if value is None:
continue
for message_id in self.MID_RE.findall(value):
message_id = message_id.strip()
if len(message_id) <= 4:
continue
message_ids.append(message_id)
return message_ids
def parse_references(self, references, in_reply_to):
references = self.parse_message_ids(references)
if len(references):
return references[-1]
in_reply_to = self.parse_message_ids(in_reply_to)
if len(in_reply_to):
return in_reply_to[0]
def resolve_message_ids(self, entity):
# https://cr.yp.to/immhf/thread.html
ctx = self.manager.stage.job.dataset.name
for message_id in entity.get('messageId'):
key = self.cache_key('mid-ent', ctx, message_id)
self.add_cache_set(key, entity.id)
rev_key = self.cache_key('ent-mid', ctx, message_id)
for response_id in self.get_cache_set(rev_key):
if response_id == entity.id:
continue
email = self.manager.make_entity('Email')
email.id = response_id
email.add('inReplyToEmail', entity.id)
fragment = safe_fragment(message_id)
self.manager.emit_entity(email, fragment=fragment)
for message_id in entity.get('inReplyTo'):
# forward linking: from message ID to entity ID
key = self.cache_key('mid-ent', ctx, message_id)
for email_id in self.get_cache_set(key):
if email_id != entity.id:
entity.add('inReplyToEmail', email_id)
# backward linking: prepare entity ID for message to come
rev_key = self.cache_key('ent-mid', ctx, message_id)
self.add_cache_set(rev_key, entity.id)
def extract_msg_headers(self, entity, msg):
"""Parse E-Mail headers into FtM properties."""
try:
entity.add('indexText', msg.values())
except Exception as ex:
log.warning("Cannot parse all headers: %r", ex)
entity.add('subject', self.get_header(msg, 'Subject'))
entity.add('date', self.get_dates(msg, 'Date'))
entity.add('mimeType', self.get_header(msg, 'Content-Type'))
entity.add('threadTopic', self.get_header(msg, 'Thread-Topic'))
entity.add('generator', self.get_header(msg, 'X-Mailer'))
entity.add('language', self.get_header(msg, 'Content-Language'))
entity.add('keywords', self.get_header(msg, 'Keywords'))
entity.add('summary', self.get_header(msg, 'Comments'))
message_id = self.get_header(msg, 'Message-ID')
entity.add('messageId', self.parse_message_ids(message_id))
references = self.get_header(msg, 'References')
in_reply_to = self.get_header(msg, 'In-Reply-To')
entity.add('inReplyTo', self.parse_references(references, in_reply_to))
return_path = self.get_header_identities(msg, 'Return-Path')
self.apply_identities(entity, return_path)
reply_to = self.get_header_identities(msg, 'Reply-To')
self.apply_identities(entity, reply_to)
sender = self.get_header_identities(msg, 'Sender', 'X-Sender')
self.apply_identities(entity, sender, 'emitters', 'sender')
froms = self.get_header_identities(msg, 'From', 'X-From')
self.apply_identities(entity, froms, 'emitters', 'from')
tos = self.get_header_identities(msg, 'To', 'Resent-To')
self.apply_identities(entity, tos, 'recipients', 'to')
ccs = self.get_header_identities(msg, 'CC', 'Cc', 'Resent-Cc')
self.apply_identities(entity, ccs, 'recipients', 'cc')
bccs = self.get_header_identities(msg, 'Bcc', 'BCC', 'Resent-Bcc')
self.apply_identities(entity, bccs, 'recipients', 'bcc')
| 40.543689 | 79 | 0.622605 | [
"MIT"
] | adikadashrieq/aleph | services/ingest-file/ingestors/support/email.py | 8,352 | Python |
import setuptools
with open("../README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="cog",
version="0.0.1",
author_email="[email protected]",
description="Containers for machine learning",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/replicate/cog",
license="Apache License 2.0",
python_requires=">=3.6.0",
install_requires=[
# intionally loose. perhaps these should be vendored to not collide with user code?
"flask>=2,<3",
"redis>=3,<4",
"requests>=2,<3",
"PyYAML",
],
packages=setuptools.find_packages(),
)
| 27.269231 | 91 | 0.643159 | [
"Apache-2.0"
] | VictorXLR/cog | python/setup.py | 709 | Python |
from handlers.kbeServer.Editor.Interface import interface_workmark
from methods.DBManager import DBManager
#点赞
def Transactions_Code_2008( self_uid , self_username , json_data):
# 回调json
json_back = {
"code": 0,
"msg": "",
"pam": ""
}
# json_data 结构
uid = int(json_data["uid"])
wid = int(json_data["wid"])
lid = int(json_data["lid"])
siscid = json_data["siscid"]
tid = int(json_data["tid"])
dian = int(json_data["dian"])
ctype = int(json_data["ctype"])
#uid ,wid ,lid ,siscid ,tid ,dian ,ctype
# 获取下db的句柄,如果需要操作数据库的话
DB = DBManager()
json_back["code"] = interface_workmark.DoMsg_Dianzan(DB,self_uid,uid,wid,lid ,siscid ,tid ,dian ,ctype)
DB.destroy()
return json_back
#评分/评论
def Transactions_Code_2009( self_uid , self_username , json_data):
# 回调json
json_back = {
"code": 0,
"msg": "",
"pam": ""
}
# json_data 结构
uid = int(json_data["uid"])
s_wid = int(json_data["s_wid"])
s_lid = int(json_data["s_lid"])
log = json_data["log"]
score = int(json_data["score"])
P_UID = int(json_data["P_UID"])
ctype = int(json_data["ctype"])
#uid ,wid ,lid ,siscid ,tid ,dian ,ctype
# 获取下db的句柄,如果需要操作数据库的话
DB = DBManager()
json_back["code"] = interface_workmark.DoWorkMark(DB,self_uid,s_wid,s_lid,uid,score,log,P_UID,ctype)
DB.destroy()
return json_back
#获取评分数据
def Transactions_Code_2010( self_uid , self_username , json_data):
# 回调json
json_back = {
"code": 0,
"msg": "",
"pam": ""
}
# json_data 结构
uid = int(json_data["uid"])
wid = int(json_data["wid"])
lid = int(json_data["lid"])
sis_cid = json_data["sis_cid"]
ctype = int(json_data["ctype"])
#uid ,wid ,lid ,siscid ,tid ,dian ,ctype
# 获取下db的句柄,如果需要操作数据库的话
DB = DBManager()
json_back["code"] = 1
json_back["pam"] = interface_workmark.DoWorkScoreData(DB,self_uid,wid,lid,uid,sis_cid,ctype)
DB.destroy()
return json_back
#获取评论数据
def Transactions_Code_2011( self_uid , self_username , json_data):
# 回调json
json_back = {
"code": 0,
"msg": "",
"pam": ""
}
# json_data 结构
uid = int(json_data["uid"])
wid = int(json_data["wid"])
lid = int(json_data["lid"])
sis_cid = json_data["sis_cid"]
ctype = int(json_data["ctype"])
PID = int(json_data["PID"])
ipage = int(json_data["ipage"])
ilenght = int(json_data["ilenght"])
# 获取下db的句柄,如果需要操作数据库的话
DB = DBManager()
json_back["code"] = 1
json_back["pam"] = interface_workmark.DoWorkLogData(DB,self_uid,wid,lid, uid, sis_cid, PID , ipage , ilenght,ctype)
DB.destroy()
return json_back | 24.927273 | 119 | 0.611233 | [
"MIT"
] | iamjing66/tornaodo_sdk | handlers/kbeServer/Editor/response/response_workmark.py | 2,954 | Python |
# Copyright 2019-2021 Wingify Software Pvt. Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from ...enums.file_name_enum import FileNameEnum
from .operand_evaluator import OperandEvaluator
from ...enums.segments import OperandTypes, OperatorTypes
from ...helpers.generic_util import get_key_value
FILE = FileNameEnum.Services.SegmentEvaluator
class SegmentEvaluator:
""" Class to evaluate segments defined in VWO app """
def __init__(self):
""" Initializes this class with VWOLogger and OperandEvaluator """
self.operand_evaluator = OperandEvaluator()
def evaluate(self, segments, custom_variables):
"""A parser which recursively evaluates the custom_variables passed against
the expression tree represented by segments, and returns the result.
Args:
segments(dict): The segments representing the expression tree
custom_variables(dict): Key/value pair of variables
Returns:
bool(result): True or False
"""
operator, sub_segments = get_key_value(segments)
if operator == OperatorTypes.NOT:
return not self.evaluate(sub_segments, custom_variables)
elif operator == OperatorTypes.AND:
return all(self.evaluate(y, custom_variables) for y in sub_segments)
elif operator == OperatorTypes.OR:
return any(self.evaluate(y, custom_variables) for y in sub_segments)
elif operator == OperandTypes.CUSTOM_VARIABLE:
return self.operand_evaluator.evaluate_custom_variable(sub_segments, custom_variables)
elif operator == OperandTypes.USER:
return self.operand_evaluator.evaluate_user(sub_segments, custom_variables)
| 41.203704 | 98 | 0.725843 | [
"Apache-2.0"
] | MDAkramSiddiqui/vwo-python-sdk | vwo/services/segmentor/segment_evaluator.py | 2,225 | Python |
"""
Given an array nums and a value val, remove all instances of that value in-place and return the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
The order of elements can be changed. It doesn't matter what you leave beyond the new length.
Ex_1:
Given nums = [3,2,2,3], val = 3,
Your function should return length = 2, with the first two elements of nums being 2.
It doesn't matter what you leave beyond the returned length.
Ex_2:
Given nums = [0,1,2,2,3,0,4,2], val = 2,
Your function should return length = 5, with the first five elements of nums containing 0, 1, 3, 0, and 4.
Note that the order of those five elements can be arbitrary.
It doesn't matter what values are set beyond the returned length.
Clarification:
Confused why the returned value is an integer but your answer is an array?
Note that the input array is passed in by reference, which means modification to the input array will be known to the caller as well.
Internally you can think of this:
// nums is passed in by reference. (i.e., without making a copy)
int len = removeElement(nums, val);
// any modification to nums in your function would be known by the caller.
// using the length returned by your function, it prints the first len elements.
for (int i = 0; i < len; i++) {
print(nums[i]);
}
"""
class Solution(object):
def removeElement(self, nums, val):
"""
:type nums: List[int]
:type val: int
:rtype: int
"""
#My code starts here
j=0
for i in range(len(nums)):
if nums[i]!=val:
nums[j]=nums[i]
j+=1
return j
"""
My thinking: Use two pointers.
"""
| 38.844444 | 133 | 0.680778 | [
"MIT"
] | ChenhaoJiang/LeetCode-Solution | 1-50/27_remove-element.py | 1,748 | Python |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'uofthacksemergencyfunds.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
| 29.521739 | 87 | 0.686303 | [
"MIT"
] | donmin062501/Savings.io | manage.py | 679 | Python |
from tatau_core.models import TaskDeclaration
from tatau_core.models.task import ListEstimationAssignments
from tatau_core.utils.ipfs import Directory
class Estimator:
@staticmethod
def get_data_for_estimate(task_declaration):
dataset = task_declaration.dataset
ipfs_dir = Directory(dataset.train_dir_ipfs)
dirs, files = ipfs_dir.ls()
return {
'chunk_ipfs': dirs[0].multihash,
'model_code_ipfs': task_declaration.train_model.code_ipfs,
}
@staticmethod
def estimate(task_declaration: TaskDeclaration, finished_assignments: ListEstimationAssignments):
failed = False
assert len(finished_assignments)
sum_tflops = 0.0
for estimation_assignment in finished_assignments:
sum_tflops += estimation_assignment.estimation_result.tflops
if estimation_assignment.estimation_result.error is not None:
failed = True
return 0.0, failed
av_tflops = sum_tflops / len(finished_assignments)
ipfs_dir = Directory(task_declaration.dataset.train_dir_ipfs)
dirs, files = ipfs_dir.ls()
chunks_count = len(dirs)
return av_tflops * chunks_count * task_declaration.epochs, failed
| 34.324324 | 101 | 0.697638 | [
"Apache-2.0"
] | makar21/core | tatau_core/node/producer/estimator.py | 1,270 | Python |
# MINLP written by GAMS Convert at 08/20/20 01:30:53
#
# Equation counts
# Total E G L N X C B
# 3360 1353 785 1222 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 1537 1453 84 0 0 0 0 0
# FX 0 0 0 0 0 0 0 0
#
# Nonzero counts
# Total const NL DLL
# 15691 13339 2352 0
#
# Reformulation has removed 1 variable and 1 equation
from pyomo.environ import *
model = m = ConcreteModel()
m.b2 = Var(within=Binary,bounds=(0,1))
m.b3 = Var(within=Binary,bounds=(0,1))
m.b4 = Var(within=Binary,bounds=(0,1))
m.b5 = Var(within=Binary,bounds=(0,1))
m.b6 = Var(within=Binary,bounds=(0,1))
m.b7 = Var(within=Binary,bounds=(0,1))
m.b8 = Var(within=Binary,bounds=(0,1))
m.b9 = Var(within=Binary,bounds=(0,1))
m.b10 = Var(within=Binary,bounds=(0,1))
m.b11 = Var(within=Binary,bounds=(0,1))
m.b12 = Var(within=Binary,bounds=(0,1))
m.b13 = Var(within=Binary,bounds=(0,1))
m.b14 = Var(within=Binary,bounds=(0,1))
m.b15 = Var(within=Binary,bounds=(0,1))
m.b16 = Var(within=Binary,bounds=(0,1))
m.b17 = Var(within=Binary,bounds=(0,1))
m.b18 = Var(within=Binary,bounds=(0,1))
m.b19 = Var(within=Binary,bounds=(0,1))
m.b20 = Var(within=Binary,bounds=(0,1))
m.b21 = Var(within=Binary,bounds=(0,1))
m.b22 = Var(within=Binary,bounds=(0,1))
m.b23 = Var(within=Binary,bounds=(0,1))
m.b24 = Var(within=Binary,bounds=(0,1))
m.b25 = Var(within=Binary,bounds=(0,1))
m.b26 = Var(within=Binary,bounds=(0,1))
m.b27 = Var(within=Binary,bounds=(0,1))
m.b28 = Var(within=Binary,bounds=(0,1))
m.b29 = Var(within=Binary,bounds=(0,1))
m.b30 = Var(within=Binary,bounds=(0,1))
m.b31 = Var(within=Binary,bounds=(0,1))
m.b32 = Var(within=Binary,bounds=(0,1))
m.b33 = Var(within=Binary,bounds=(0,1))
m.b34 = Var(within=Binary,bounds=(0,1))
m.b35 = Var(within=Binary,bounds=(0,1))
m.b36 = Var(within=Binary,bounds=(0,1))
m.b37 = Var(within=Binary,bounds=(0,1))
m.b38 = Var(within=Binary,bounds=(0,1))
m.b39 = Var(within=Binary,bounds=(0,1))
m.b40 = Var(within=Binary,bounds=(0,1))
m.b41 = Var(within=Binary,bounds=(0,1))
m.b42 = Var(within=Binary,bounds=(0,1))
m.b43 = Var(within=Binary,bounds=(0,1))
m.b44 = Var(within=Binary,bounds=(0,1))
m.b45 = Var(within=Binary,bounds=(0,1))
m.b46 = Var(within=Binary,bounds=(0,1))
m.b47 = Var(within=Binary,bounds=(0,1))
m.b48 = Var(within=Binary,bounds=(0,1))
m.b49 = Var(within=Binary,bounds=(0,1))
m.b50 = Var(within=Binary,bounds=(0,1))
m.b51 = Var(within=Binary,bounds=(0,1))
m.b52 = Var(within=Binary,bounds=(0,1))
m.b53 = Var(within=Binary,bounds=(0,1))
m.b54 = Var(within=Binary,bounds=(0,1))
m.b55 = Var(within=Binary,bounds=(0,1))
m.b56 = Var(within=Binary,bounds=(0,1))
m.b57 = Var(within=Binary,bounds=(0,1))
m.b58 = Var(within=Binary,bounds=(0,1))
m.b59 = Var(within=Binary,bounds=(0,1))
m.b60 = Var(within=Binary,bounds=(0,1))
m.b61 = Var(within=Binary,bounds=(0,1))
m.b62 = Var(within=Binary,bounds=(0,1))
m.b63 = Var(within=Binary,bounds=(0,1))
m.b64 = Var(within=Binary,bounds=(0,1))
m.b65 = Var(within=Binary,bounds=(0,1))
m.b66 = Var(within=Binary,bounds=(0,1))
m.b67 = Var(within=Binary,bounds=(0,1))
m.b68 = Var(within=Binary,bounds=(0,1))
m.b69 = Var(within=Binary,bounds=(0,1))
m.b70 = Var(within=Binary,bounds=(0,1))
m.b71 = Var(within=Binary,bounds=(0,1))
m.b72 = Var(within=Binary,bounds=(0,1))
m.b73 = Var(within=Binary,bounds=(0,1))
m.b74 = Var(within=Binary,bounds=(0,1))
m.b75 = Var(within=Binary,bounds=(0,1))
m.b76 = Var(within=Binary,bounds=(0,1))
m.b77 = Var(within=Binary,bounds=(0,1))
m.b78 = Var(within=Binary,bounds=(0,1))
m.b79 = Var(within=Binary,bounds=(0,1))
m.b80 = Var(within=Binary,bounds=(0,1))
m.b81 = Var(within=Binary,bounds=(0,1))
m.b82 = Var(within=Binary,bounds=(0,1))
m.b83 = Var(within=Binary,bounds=(0,1))
m.b84 = Var(within=Binary,bounds=(0,1))
m.b85 = Var(within=Binary,bounds=(0,1))
m.x86 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x87 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x88 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x89 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x90 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x91 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x92 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x93 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x94 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x95 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x96 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x97 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x98 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x99 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x100 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x101 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x102 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x103 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x104 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x105 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x106 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x107 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x108 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x109 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x110 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x111 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x112 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x113 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x114 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x115 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x116 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x117 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x118 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x119 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x120 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x121 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x122 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x123 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x124 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x125 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x126 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x127 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x128 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x129 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x130 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x131 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x132 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x133 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x134 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x135 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x136 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x137 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x138 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x139 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x140 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x141 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x142 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x143 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x144 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x145 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x146 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x147 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x148 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x149 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x150 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x151 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x152 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x153 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x154 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x155 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x156 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x157 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x158 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x159 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x160 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x161 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x162 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x163 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x164 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x165 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x166 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x167 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x168 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x169 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x170 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x171 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x172 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x173 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x174 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x175 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x176 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x177 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x178 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x179 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x180 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x181 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x182 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x183 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x184 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x185 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x186 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x187 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x188 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x189 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x190 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x191 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x192 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x193 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x194 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x195 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x196 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x197 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x198 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x199 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x200 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x201 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x202 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x203 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x204 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x205 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x206 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x207 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x208 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x209 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x210 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x211 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x212 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x213 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x214 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x215 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x216 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x217 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x218 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x219 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x220 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x221 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x222 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x223 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x224 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x225 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x226 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x227 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x228 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x229 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x230 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x231 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x232 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x233 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x234 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x235 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x236 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x237 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x238 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x239 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x240 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x241 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x242 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x243 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x244 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x245 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x246 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x247 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x248 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x249 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x250 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x251 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x252 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x253 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x254 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x255 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x256 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x257 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x258 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x259 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x260 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x261 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x262 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x263 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x264 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x265 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x266 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x267 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x268 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x269 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x270 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x271 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x272 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x273 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x274 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x275 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x276 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x277 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x278 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x279 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x280 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x281 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x282 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x283 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x284 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x285 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x286 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x287 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x288 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x289 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x290 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x291 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x292 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x293 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x294 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x295 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x296 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x297 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x298 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x299 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x300 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x301 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x302 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x303 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x304 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x305 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x306 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x307 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x308 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x309 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x310 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x311 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x312 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x313 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x314 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x315 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x316 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x317 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x318 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x319 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x320 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x321 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x322 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x323 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x324 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x325 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x326 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x327 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x328 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x329 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x330 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x331 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x332 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x333 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x334 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x335 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x336 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x337 = Var(within=Reals,bounds=(0,None),initialize=4)
m.x338 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x339 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x340 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x341 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x342 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x343 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x344 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x345 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x346 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x347 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x348 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x349 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x350 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x351 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x352 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x353 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x354 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x355 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x356 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x357 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x358 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x359 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x360 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x361 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x362 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x363 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x364 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x365 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x366 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x367 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x368 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x369 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x370 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x371 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x372 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x373 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x374 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x375 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x376 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x377 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x378 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x379 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x380 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x381 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x382 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x383 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x384 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x385 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x386 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x387 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x388 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x389 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x390 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x391 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x392 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x393 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x394 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x395 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x396 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x397 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x398 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x399 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x400 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x401 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x402 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x403 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x404 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x405 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x406 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x407 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x408 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x409 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x410 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x411 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x412 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x413 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x414 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x415 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x416 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x417 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x418 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x419 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x420 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x421 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x422 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x423 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x424 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x425 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x426 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x427 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x428 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x429 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x430 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x431 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x432 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x433 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x434 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x435 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x436 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x437 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x438 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x439 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x440 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x441 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x442 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x443 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x444 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x445 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x446 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x447 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x448 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x449 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x450 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x451 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x452 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x453 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x454 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x455 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x456 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x457 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x458 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x459 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x460 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x461 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x462 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x463 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x464 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x465 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x466 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x467 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x468 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x469 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x470 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x471 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x472 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x473 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x474 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x475 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x476 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x477 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x478 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x479 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x480 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x481 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x482 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x483 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x484 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x485 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x486 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x487 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x488 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x489 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x490 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x491 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x492 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x493 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x494 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x495 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x496 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x497 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x498 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x499 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x500 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x501 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x502 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x503 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x504 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x505 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x506 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x507 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x508 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x509 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x510 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x511 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x512 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x513 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x514 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x515 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x516 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x517 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x518 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x519 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x520 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x521 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x522 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x523 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x524 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x525 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x526 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x527 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x528 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x529 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x530 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x531 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x532 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x533 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x534 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x535 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x536 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x537 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x538 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x539 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x540 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x541 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x542 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x543 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x544 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x545 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x546 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x547 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x548 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x549 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x550 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x551 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x552 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x553 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x554 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x555 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x556 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x557 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x558 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x559 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x560 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x561 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x562 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x563 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x564 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x565 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x566 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x567 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x568 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x569 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x570 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x571 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x572 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x573 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x574 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x575 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x576 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x577 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x578 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x579 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x580 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x581 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x582 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x583 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x584 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x585 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x586 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x587 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x588 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x589 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x590 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x591 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x592 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x593 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x594 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x595 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x596 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x597 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x598 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x599 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x600 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x601 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x602 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x603 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x604 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x605 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x606 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x607 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x608 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x609 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x610 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x611 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x612 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x613 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x614 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x615 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x616 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x617 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x618 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x619 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x620 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x621 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x622 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x623 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x624 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x625 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x626 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x627 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x628 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x629 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x630 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x631 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x632 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x633 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x634 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x635 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x636 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x637 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x638 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x639 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x640 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x641 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x642 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x643 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x644 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x645 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x646 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x647 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x648 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x649 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x650 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x651 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x652 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x653 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x654 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x655 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x656 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x657 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x658 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x659 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x660 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x661 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x662 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x663 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x664 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x665 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x666 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x667 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x668 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x669 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x670 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x671 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x672 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x673 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x674 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x675 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x676 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x677 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x678 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x679 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x680 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x681 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x682 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x683 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x684 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x685 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x686 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x687 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x688 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x689 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x690 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x691 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x692 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x693 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x694 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x695 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x696 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x697 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x698 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x699 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x700 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x701 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x702 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x703 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x704 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x705 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x706 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x707 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x708 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x709 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x710 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x711 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x712 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x713 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x714 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x715 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x716 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x717 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x718 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x719 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x720 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x721 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x722 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x723 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x724 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x725 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x726 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x727 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x728 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x729 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x730 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x731 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x732 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x733 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x734 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x735 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x736 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x737 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x738 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x739 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x740 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x741 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x742 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x743 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x744 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x745 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x746 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x747 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x748 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x749 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x750 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x751 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x752 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x753 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x754 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x755 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x756 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x757 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x758 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x759 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x760 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x761 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x762 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x763 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x764 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x765 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x766 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x767 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x768 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x769 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x770 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x771 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x772 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x773 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x774 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x775 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x776 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x777 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x778 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x779 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x780 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x781 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x782 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x783 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x784 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x785 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x786 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x787 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x788 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x789 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x790 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x791 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x792 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x793 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x794 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x795 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x796 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x797 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x798 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x799 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x800 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x801 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x802 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x803 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x804 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x805 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x806 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x807 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x808 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x809 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x810 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x811 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x812 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x813 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x814 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x815 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x816 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x817 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x818 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x819 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x820 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x821 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x822 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x823 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x824 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x825 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x826 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x827 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x828 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x829 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x830 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x831 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x832 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x833 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x834 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x835 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x836 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x837 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x838 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x839 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x840 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x841 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x842 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x843 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x844 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x845 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x846 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x847 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x848 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x849 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x850 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x851 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x852 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x853 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x854 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x855 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x856 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x857 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x858 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x859 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x860 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x861 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x862 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x863 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x864 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x865 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x866 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x867 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x868 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x869 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x870 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x871 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x872 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x873 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x874 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x875 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x876 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x877 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x878 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x879 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x880 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x881 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x882 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x883 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x884 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x885 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x886 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x887 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x888 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x889 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x890 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x891 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x892 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x893 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x894 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x895 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x896 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x897 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x898 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x899 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x900 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x901 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x902 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x903 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x904 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x905 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x906 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x907 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x908 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x909 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x910 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x911 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x912 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x913 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x914 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x915 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x916 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x917 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x918 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x919 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x920 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x921 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x922 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x923 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x924 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x925 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x926 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x927 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x928 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x929 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x930 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x931 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x932 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x933 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x934 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x935 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x936 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x937 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x938 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x939 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x940 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x941 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x942 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x943 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x944 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x945 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x946 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x947 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x948 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x949 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x950 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x951 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x952 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x953 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x954 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x955 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x956 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x957 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x958 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x959 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x960 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x961 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x962 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x963 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x964 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x965 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x966 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x967 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x968 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x969 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x970 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x971 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x972 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x973 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x974 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x975 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x976 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x977 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x978 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x979 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x980 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x981 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x982 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x983 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x984 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x985 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x986 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x987 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x988 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x989 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x990 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x991 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x992 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x993 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x994 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x995 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x996 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x997 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x998 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x999 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1000 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1001 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1002 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1003 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1004 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1005 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1006 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1007 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1008 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1009 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1010 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1011 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1012 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1013 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1014 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1015 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1016 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1017 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1018 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1019 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1020 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1021 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1022 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1023 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1024 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1025 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1026 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1027 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1028 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1029 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1030 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1031 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1032 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1033 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1034 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1035 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1036 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1037 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1038 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1039 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1040 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1041 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1042 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1043 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1044 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1045 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1046 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1047 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1048 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1049 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1050 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1051 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1052 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1053 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1054 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1055 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1056 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1057 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1058 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1059 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1060 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1061 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1062 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1063 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1064 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1065 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1066 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1067 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1068 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1069 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1070 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1071 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1072 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1073 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1074 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1075 = Var(within=Reals,bounds=(0,None),initialize=10)
m.x1076 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1077 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1078 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1079 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1080 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1081 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1082 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1083 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1084 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1085 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1086 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1087 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1088 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1089 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1090 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1091 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1092 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1093 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1094 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1095 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1096 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1097 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1098 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1099 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1100 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1101 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1102 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1103 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1104 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1105 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1106 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1107 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1108 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1109 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1110 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1111 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1112 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1113 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1114 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1115 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1116 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1117 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1118 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1119 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1120 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1121 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1122 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1123 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1124 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1125 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1126 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1127 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1128 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1129 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1130 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1131 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1132 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1133 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1134 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1135 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1136 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1137 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1138 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1139 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1140 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1141 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1142 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1143 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1144 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1145 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1146 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1147 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1148 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1149 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1150 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1151 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1152 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1153 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1154 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1155 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1156 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1157 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1158 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1159 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1160 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1161 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1162 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1163 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1164 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1165 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1166 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1167 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1168 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1169 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1170 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1171 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1172 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1173 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1174 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1175 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1176 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1177 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1178 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1179 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1180 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1181 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1182 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1183 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1184 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1185 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1186 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1187 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1188 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1189 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1190 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1191 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1192 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1193 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1194 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1195 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1196 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1197 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1198 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1199 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1200 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1201 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1202 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1203 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1204 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1205 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1206 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1207 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1208 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1209 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1210 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1211 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1212 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1213 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1214 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1215 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1216 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1217 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1218 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1219 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1220 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1221 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1222 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1223 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1224 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1225 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1226 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1227 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1228 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1229 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1230 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1231 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1232 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1233 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1234 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1235 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1236 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1237 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1238 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1239 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1240 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1241 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1242 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1243 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1244 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1245 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1246 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1247 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1248 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1249 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1250 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1251 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1252 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1253 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1254 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1255 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1256 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1257 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1258 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1259 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1260 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1261 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1262 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1263 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1264 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1265 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1266 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1267 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1268 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1269 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1270 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1271 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1272 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1273 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1274 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1275 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1276 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1277 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1278 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1279 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1280 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1281 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1282 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1283 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1284 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1285 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1286 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1287 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1288 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1289 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1290 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1291 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1292 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1293 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1294 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1295 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1296 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1297 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1298 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1299 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1300 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1301 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1302 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1303 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1304 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1305 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1306 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1307 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1308 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1309 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1310 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1311 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1312 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1313 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1314 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1315 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1316 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1317 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1318 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1319 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1320 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1321 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1322 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1323 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1324 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1325 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1326 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1327 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1328 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1329 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1330 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1331 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1332 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1333 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1334 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1335 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1336 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1337 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1338 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1339 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1340 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1341 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1342 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1343 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1344 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1345 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1346 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1347 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1348 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1349 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1350 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1351 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1352 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1353 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1354 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1355 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1356 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1357 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1358 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1359 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1360 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1361 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1362 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1363 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1364 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1365 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1366 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1367 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1368 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1369 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1370 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1371 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1372 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1373 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1374 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1375 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1376 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1377 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1378 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1379 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1380 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1381 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1382 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1383 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1384 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1385 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1386 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1387 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1388 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1389 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1390 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1391 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1392 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1393 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1394 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1395 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1396 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1397 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1398 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1399 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1400 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1401 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1402 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1403 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1404 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1405 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1406 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1407 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1408 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1409 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1410 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1411 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1412 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1413 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1414 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1415 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1416 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1417 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1418 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1419 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1420 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1421 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1422 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1423 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1424 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1425 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1426 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1427 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1428 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1429 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1430 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1431 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1432 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1433 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1434 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1435 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1436 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1437 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1438 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1439 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1440 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1441 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1442 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1443 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1444 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1445 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1446 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1447 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1448 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1449 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1450 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1451 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1452 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1453 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1454 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1455 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1456 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1457 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1458 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1459 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1460 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1461 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1462 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1463 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1464 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1465 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1466 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1467 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1468 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1469 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1470 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1471 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1472 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1473 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1474 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1475 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1476 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1477 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1478 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1479 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1480 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1481 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1482 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1483 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1484 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1485 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1486 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1487 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1488 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1489 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1490 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1491 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1492 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1493 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1494 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1495 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1496 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1497 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1498 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1499 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1500 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1501 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1502 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1503 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1504 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1505 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1506 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1507 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1508 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1509 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1510 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1511 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1512 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1513 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1514 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1515 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1516 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1517 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1518 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1519 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1520 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1521 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1522 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1523 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1524 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1525 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1526 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1527 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1528 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1529 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1530 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1531 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1532 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1533 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1534 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1535 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1536 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.x1537 = Var(within=Reals,bounds=(0,None),initialize=1.42857142857143)
m.obj = Objective(expr= 0.1*m.x492 + 0.6*m.x493 + 0.85*m.x494 + 0.2*m.x495 + 0.5*m.x496 + 0.8*m.x497 + 0.3*m.x498
+ 0.1*m.x499 + 0.6*m.x500 + 0.85*m.x501 + 0.2*m.x502 + 0.5*m.x503 + 0.8*m.x504 + 0.3*m.x505
+ 0.1*m.x506 + 0.6*m.x507 + 0.85*m.x508 + 0.2*m.x509 + 0.5*m.x510 + 0.8*m.x511 + 0.3*m.x512
+ 0.1*m.x513 + 0.6*m.x514 + 0.85*m.x515 + 0.2*m.x516 + 0.5*m.x517 + 0.8*m.x518 + 0.3*m.x519
+ 0.1*m.x590 + 0.6*m.x591 + 0.85*m.x592 + 0.2*m.x593 + 0.5*m.x594 + 0.8*m.x595 + 0.3*m.x596
+ 0.1*m.x597 + 0.6*m.x598 + 0.85*m.x599 + 0.2*m.x600 + 0.5*m.x601 + 0.8*m.x602 + 0.3*m.x603
+ 0.1*m.x604 + 0.6*m.x605 + 0.85*m.x606 + 0.2*m.x607 + 0.5*m.x608 + 0.8*m.x609 + 0.3*m.x610
+ 0.1*m.x611 + 0.6*m.x612 + 0.85*m.x613 + 0.2*m.x614 + 0.5*m.x615 + 0.8*m.x616 + 0.3*m.x617
+ 0.1*m.x688 + 0.6*m.x689 + 0.85*m.x690 + 0.2*m.x691 + 0.5*m.x692 + 0.8*m.x693 + 0.3*m.x694
+ 0.1*m.x695 + 0.6*m.x696 + 0.85*m.x697 + 0.2*m.x698 + 0.5*m.x699 + 0.8*m.x700 + 0.3*m.x701
+ 0.1*m.x702 + 0.6*m.x703 + 0.85*m.x704 + 0.2*m.x705 + 0.5*m.x706 + 0.8*m.x707 + 0.3*m.x708
+ 0.1*m.x709 + 0.6*m.x710 + 0.85*m.x711 + 0.2*m.x712 + 0.5*m.x713 + 0.8*m.x714 + 0.3*m.x715
+ 0.1*m.x786 + 0.6*m.x787 + 0.85*m.x788 + 0.2*m.x789 + 0.5*m.x790 + 0.8*m.x791 + 0.3*m.x792
+ 0.1*m.x793 + 0.6*m.x794 + 0.85*m.x795 + 0.2*m.x796 + 0.5*m.x797 + 0.8*m.x798 + 0.3*m.x799
+ 0.1*m.x800 + 0.6*m.x801 + 0.85*m.x802 + 0.2*m.x803 + 0.5*m.x804 + 0.8*m.x805 + 0.3*m.x806
+ 0.1*m.x807 + 0.6*m.x808 + 0.85*m.x809 + 0.2*m.x810 + 0.5*m.x811 + 0.8*m.x812 + 0.3*m.x813
+ 0.1*m.x884 + 0.6*m.x885 + 0.85*m.x886 + 0.2*m.x887 + 0.5*m.x888 + 0.8*m.x889 + 0.3*m.x890
+ 0.1*m.x891 + 0.6*m.x892 + 0.85*m.x893 + 0.2*m.x894 + 0.5*m.x895 + 0.8*m.x896 + 0.3*m.x897
+ 0.1*m.x898 + 0.6*m.x899 + 0.85*m.x900 + 0.2*m.x901 + 0.5*m.x902 + 0.8*m.x903 + 0.3*m.x904
+ 0.1*m.x905 + 0.6*m.x906 + 0.85*m.x907 + 0.2*m.x908 + 0.5*m.x909 + 0.8*m.x910 + 0.3*m.x911
+ 0.1*m.x982 + 0.6*m.x983 + 0.85*m.x984 + 0.2*m.x985 + 0.5*m.x986 + 0.8*m.x987 + 0.3*m.x988
+ 0.1*m.x989 + 0.6*m.x990 + 0.85*m.x991 + 0.2*m.x992 + 0.5*m.x993 + 0.8*m.x994 + 0.3*m.x995
+ 0.1*m.x996 + 0.6*m.x997 + 0.85*m.x998 + 0.2*m.x999 + 0.5*m.x1000 + 0.8*m.x1001 + 0.3*m.x1002
+ 0.1*m.x1003 + 0.6*m.x1004 + 0.85*m.x1005 + 0.2*m.x1006 + 0.5*m.x1007 + 0.8*m.x1008
+ 0.3*m.x1009, sense=maximize)
m.c2 = Constraint(expr= m.b2 + m.b5 <= 1)
m.c3 = Constraint(expr= m.b2 + m.b6 <= 1)
m.c4 = Constraint(expr= m.b3 + m.b7 <= 1)
m.c5 = Constraint(expr= m.b3 + m.b8 <= 1)
m.c6 = Constraint(expr= m.b3 + m.b9 <= 1)
m.c7 = Constraint(expr= m.b4 + m.b10 <= 1)
m.c8 = Constraint(expr= m.b4 + m.b11 <= 1)
m.c9 = Constraint(expr= m.b5 + m.b12 <= 1)
m.c10 = Constraint(expr= m.b7 + m.b12 <= 1)
m.c11 = Constraint(expr= m.b9 + m.b15 <= 1)
m.c12 = Constraint(expr= m.b11 + m.b15 <= 1)
m.c13 = Constraint(expr= m.b12 + m.b13 <= 1)
m.c14 = Constraint(expr= m.b14 + m.b15 <= 1)
m.c15 = Constraint(expr= m.b2 + m.b3 + m.b4 <= 1)
m.c16 = Constraint(expr= m.b6 + m.b13 + m.b14 <= 1)
m.c17 = Constraint(expr= m.b8 + m.b13 + m.b14 <= 1)
m.c18 = Constraint(expr= m.b10 + m.b13 + m.b14 <= 1)
m.c19 = Constraint(expr= m.b16 + m.b19 <= 1)
m.c20 = Constraint(expr= m.b16 + m.b20 <= 1)
m.c21 = Constraint(expr= m.b17 + m.b21 <= 1)
m.c22 = Constraint(expr= m.b17 + m.b22 <= 1)
m.c23 = Constraint(expr= m.b17 + m.b23 <= 1)
m.c24 = Constraint(expr= m.b18 + m.b24 <= 1)
m.c25 = Constraint(expr= m.b18 + m.b25 <= 1)
m.c26 = Constraint(expr= m.b19 + m.b26 <= 1)
m.c27 = Constraint(expr= m.b21 + m.b26 <= 1)
m.c28 = Constraint(expr= m.b23 + m.b29 <= 1)
m.c29 = Constraint(expr= m.b25 + m.b29 <= 1)
m.c30 = Constraint(expr= m.b26 + m.b27 <= 1)
m.c31 = Constraint(expr= m.b28 + m.b29 <= 1)
m.c32 = Constraint(expr= m.b16 + m.b17 + m.b18 <= 1)
m.c33 = Constraint(expr= m.b20 + m.b27 + m.b28 <= 1)
m.c34 = Constraint(expr= m.b22 + m.b27 + m.b28 <= 1)
m.c35 = Constraint(expr= m.b24 + m.b27 + m.b28 <= 1)
m.c36 = Constraint(expr= m.b30 + m.b33 <= 1)
m.c37 = Constraint(expr= m.b30 + m.b34 <= 1)
m.c38 = Constraint(expr= m.b31 + m.b35 <= 1)
m.c39 = Constraint(expr= m.b31 + m.b36 <= 1)
m.c40 = Constraint(expr= m.b31 + m.b37 <= 1)
m.c41 = Constraint(expr= m.b32 + m.b38 <= 1)
m.c42 = Constraint(expr= m.b32 + m.b39 <= 1)
m.c43 = Constraint(expr= m.b33 + m.b40 <= 1)
m.c44 = Constraint(expr= m.b35 + m.b40 <= 1)
m.c45 = Constraint(expr= m.b37 + m.b43 <= 1)
m.c46 = Constraint(expr= m.b39 + m.b43 <= 1)
m.c47 = Constraint(expr= m.b40 + m.b41 <= 1)
m.c48 = Constraint(expr= m.b42 + m.b43 <= 1)
m.c49 = Constraint(expr= m.b30 + m.b31 + m.b32 <= 1)
m.c50 = Constraint(expr= m.b34 + m.b41 + m.b42 <= 1)
m.c51 = Constraint(expr= m.b36 + m.b41 + m.b42 <= 1)
m.c52 = Constraint(expr= m.b38 + m.b41 + m.b42 <= 1)
m.c53 = Constraint(expr= m.b44 + m.b47 <= 1)
m.c54 = Constraint(expr= m.b44 + m.b48 <= 1)
m.c55 = Constraint(expr= m.b45 + m.b49 <= 1)
m.c56 = Constraint(expr= m.b45 + m.b50 <= 1)
m.c57 = Constraint(expr= m.b45 + m.b51 <= 1)
m.c58 = Constraint(expr= m.b46 + m.b52 <= 1)
m.c59 = Constraint(expr= m.b46 + m.b53 <= 1)
m.c60 = Constraint(expr= m.b47 + m.b54 <= 1)
m.c61 = Constraint(expr= m.b49 + m.b54 <= 1)
m.c62 = Constraint(expr= m.b51 + m.b57 <= 1)
m.c63 = Constraint(expr= m.b53 + m.b57 <= 1)
m.c64 = Constraint(expr= m.b54 + m.b55 <= 1)
m.c65 = Constraint(expr= m.b56 + m.b57 <= 1)
m.c66 = Constraint(expr= m.b44 + m.b45 + m.b46 <= 1)
m.c67 = Constraint(expr= m.b48 + m.b55 + m.b56 <= 1)
m.c68 = Constraint(expr= m.b50 + m.b55 + m.b56 <= 1)
m.c69 = Constraint(expr= m.b52 + m.b55 + m.b56 <= 1)
m.c70 = Constraint(expr= m.b58 + m.b61 <= 1)
m.c71 = Constraint(expr= m.b58 + m.b62 <= 1)
m.c72 = Constraint(expr= m.b59 + m.b63 <= 1)
m.c73 = Constraint(expr= m.b59 + m.b64 <= 1)
m.c74 = Constraint(expr= m.b59 + m.b65 <= 1)
m.c75 = Constraint(expr= m.b60 + m.b66 <= 1)
m.c76 = Constraint(expr= m.b60 + m.b67 <= 1)
m.c77 = Constraint(expr= m.b61 + m.b68 <= 1)
m.c78 = Constraint(expr= m.b63 + m.b68 <= 1)
m.c79 = Constraint(expr= m.b65 + m.b71 <= 1)
m.c80 = Constraint(expr= m.b67 + m.b71 <= 1)
m.c81 = Constraint(expr= m.b68 + m.b69 <= 1)
m.c82 = Constraint(expr= m.b70 + m.b71 <= 1)
m.c83 = Constraint(expr= m.b58 + m.b59 + m.b60 <= 1)
m.c84 = Constraint(expr= m.b62 + m.b69 + m.b70 <= 1)
m.c85 = Constraint(expr= m.b64 + m.b69 + m.b70 <= 1)
m.c86 = Constraint(expr= m.b66 + m.b69 + m.b70 <= 1)
m.c87 = Constraint(expr= m.b72 + m.b75 <= 1)
m.c88 = Constraint(expr= m.b72 + m.b76 <= 1)
m.c89 = Constraint(expr= m.b73 + m.b77 <= 1)
m.c90 = Constraint(expr= m.b73 + m.b78 <= 1)
m.c91 = Constraint(expr= m.b73 + m.b79 <= 1)
m.c92 = Constraint(expr= m.b74 + m.b80 <= 1)
m.c93 = Constraint(expr= m.b74 + m.b81 <= 1)
m.c94 = Constraint(expr= m.b75 + m.b82 <= 1)
m.c95 = Constraint(expr= m.b77 + m.b82 <= 1)
m.c96 = Constraint(expr= m.b79 + m.b85 <= 1)
m.c97 = Constraint(expr= m.b81 + m.b85 <= 1)
m.c98 = Constraint(expr= m.b82 + m.b83 <= 1)
m.c99 = Constraint(expr= m.b84 + m.b85 <= 1)
m.c100 = Constraint(expr= m.b72 + m.b73 + m.b74 <= 1)
m.c101 = Constraint(expr= m.b76 + m.b83 + m.b84 <= 1)
m.c102 = Constraint(expr= m.b78 + m.b83 + m.b84 <= 1)
m.c103 = Constraint(expr= m.b80 + m.b83 + m.b84 <= 1)
m.c104 = Constraint(expr= m.b2 + m.b16 + m.b30 + m.b44 + m.b58 + m.b72 >= 1)
m.c105 = Constraint(expr= m.b3 + m.b17 + m.b31 + m.b45 + m.b59 + m.b73 >= 1)
m.c106 = Constraint(expr= m.b4 + m.b18 + m.b32 + m.b46 + m.b60 + m.b74 >= 1)
m.c107 = Constraint(expr= m.b12 + m.b26 + m.b40 + m.b54 + m.b68 + m.b82 >= 1)
m.c108 = Constraint(expr= m.b13 + m.b27 + m.b41 + m.b55 + m.b69 + m.b83 >= 1)
m.c109 = Constraint(expr= m.b14 + m.b28 + m.b42 + m.b56 + m.b70 + m.b84 >= 1)
m.c110 = Constraint(expr= m.b15 + m.b29 + m.b43 + m.b57 + m.b71 + m.b85 >= 1)
m.c111 = Constraint(expr= m.b12 + m.b13 + m.b14 + m.b15 + m.b26 + m.b27 + m.b28 + m.b29 + m.b40 + m.b41 + m.b42
+ m.b43 + m.b54 + m.b55 + m.b56 + m.b57 + m.b68 + m.b69 + m.b70 + m.b71 + m.b82 + m.b83
+ m.b84 + m.b85 >= 5)
m.c112 = Constraint(expr= m.b2 + m.b16 + m.b30 + m.b44 + m.b58 + m.b72 <= 1)
m.c113 = Constraint(expr= m.b3 + m.b17 + m.b31 + m.b45 + m.b59 + m.b73 <= 1)
m.c114 = Constraint(expr= m.b4 + m.b18 + m.b32 + m.b46 + m.b60 + m.b74 <= 1)
m.c115 = Constraint(expr= m.b12 + m.b26 + m.b40 + m.b54 + m.b68 + m.b82 <= 2)
m.c116 = Constraint(expr= m.b13 + m.b27 + m.b41 + m.b55 + m.b69 + m.b83 <= 1)
m.c117 = Constraint(expr= m.b14 + m.b28 + m.b42 + m.b56 + m.b70 + m.b84 <= 1)
m.c118 = Constraint(expr= m.b15 + m.b29 + m.b43 + m.b57 + m.b71 + m.b85 <= 2)
m.c119 = Constraint(expr= m.b12 + m.b13 + m.b14 + m.b15 + m.b26 + m.b27 + m.b28 + m.b29 + m.b40 + m.b41 + m.b42
+ m.b43 + m.b54 + m.b55 + m.b56 + m.b57 + m.b68 + m.b69 + m.b70 + m.b71 + m.b82 + m.b83
+ m.b84 + m.b85 <= 5)
m.c120 = Constraint(expr= m.b12 + m.b13 >= 1)
m.c121 = Constraint(expr= m.b14 + m.b15 >= 1)
m.c122 = Constraint(expr= m.b12 + m.b13 <= 1)
m.c123 = Constraint(expr= m.b14 + m.b15 <= 1)
m.c124 = Constraint(expr= - m.x87 - m.x101 - m.x115 - m.x129 - m.x143 - m.x157 + m.x254 + m.x268 + m.x282 + m.x296
+ m.x310 + m.x324 <= 0)
m.c125 = Constraint(expr= - m.x88 - m.x102 - m.x116 - m.x130 - m.x144 - m.x158 + m.x255 + m.x269 + m.x283 + m.x297
+ m.x311 + m.x325 <= 0)
m.c126 = Constraint(expr= - m.b3 >= 0)
m.c127 = Constraint(expr= - m.b4 >= 0)
m.c128 = Constraint(expr= m.b2 - m.b3 - m.b17 >= 0)
m.c129 = Constraint(expr= m.b3 - m.b4 - m.b18 >= 0)
m.c130 = Constraint(expr= m.b2 - m.b3 + m.b16 - m.b17 - m.b31 >= 0)
m.c131 = Constraint(expr= m.b3 - m.b4 + m.b17 - m.b18 - m.b32 >= 0)
m.c132 = Constraint(expr= m.b2 - m.b3 + m.b16 - m.b17 + m.b30 - m.b31 - m.b45 >= 0)
m.c133 = Constraint(expr= m.b3 - m.b4 + m.b17 - m.b18 + m.b31 - m.b32 - m.b46 >= 0)
m.c134 = Constraint(expr= m.b2 - m.b3 + m.b16 - m.b17 + m.b30 - m.b31 + m.b44 - m.b45 - m.b59 >= 0)
m.c135 = Constraint(expr= m.b3 - m.b4 + m.b17 - m.b18 + m.b31 - m.b32 + m.b45 - m.b46 - m.b60 >= 0)
m.c136 = Constraint(expr= m.b2 - m.b3 + m.b16 - m.b17 + m.b30 - m.b31 + m.b44 - m.b45 + m.b58 - m.b59 - m.b73 >= 0)
m.c137 = Constraint(expr= m.b3 - m.b4 + m.b17 - m.b18 + m.b31 - m.b32 + m.b45 - m.b46 + m.b59 - m.b60 - m.b74 >= 0)
m.c138 = Constraint(expr= - m.x86 - m.x170 + m.x254 == 0)
m.c139 = Constraint(expr= - m.x87 - m.x171 + m.x255 == 0)
m.c140 = Constraint(expr= - m.x88 - m.x172 + m.x256 == 0)
m.c141 = Constraint(expr= - m.x89 - m.x173 + m.x257 == 0)
m.c142 = Constraint(expr= - m.x90 - m.x174 + m.x258 == 0)
m.c143 = Constraint(expr= - m.x91 - m.x175 + m.x259 == 0)
m.c144 = Constraint(expr= - m.x92 - m.x176 + m.x260 == 0)
m.c145 = Constraint(expr= - m.x93 - m.x177 + m.x261 == 0)
m.c146 = Constraint(expr= - m.x94 - m.x178 + m.x262 == 0)
m.c147 = Constraint(expr= - m.x95 - m.x179 + m.x263 == 0)
m.c148 = Constraint(expr= - m.x96 - m.x180 + m.x264 == 0)
m.c149 = Constraint(expr= - m.x97 - m.x181 + m.x265 == 0)
m.c150 = Constraint(expr= - m.x98 - m.x182 + m.x266 == 0)
m.c151 = Constraint(expr= - m.x99 - m.x183 + m.x267 == 0)
m.c152 = Constraint(expr= - m.x100 - m.x184 + m.x268 == 0)
m.c153 = Constraint(expr= - m.x101 - m.x185 + m.x269 == 0)
m.c154 = Constraint(expr= - m.x102 - m.x186 + m.x270 == 0)
m.c155 = Constraint(expr= - m.x103 - m.x187 + m.x271 == 0)
m.c156 = Constraint(expr= - m.x104 - m.x188 + m.x272 == 0)
m.c157 = Constraint(expr= - m.x105 - m.x189 + m.x273 == 0)
m.c158 = Constraint(expr= - m.x106 - m.x190 + m.x274 == 0)
m.c159 = Constraint(expr= - m.x107 - m.x191 + m.x275 == 0)
m.c160 = Constraint(expr= - m.x108 - m.x192 + m.x276 == 0)
m.c161 = Constraint(expr= - m.x109 - m.x193 + m.x277 == 0)
m.c162 = Constraint(expr= - m.x110 - m.x194 + m.x278 == 0)
m.c163 = Constraint(expr= - m.x111 - m.x195 + m.x279 == 0)
m.c164 = Constraint(expr= - m.x112 - m.x196 + m.x280 == 0)
m.c165 = Constraint(expr= - m.x113 - m.x197 + m.x281 == 0)
m.c166 = Constraint(expr= - m.x114 - m.x198 + m.x282 == 0)
m.c167 = Constraint(expr= - m.x115 - m.x199 + m.x283 == 0)
m.c168 = Constraint(expr= - m.x116 - m.x200 + m.x284 == 0)
m.c169 = Constraint(expr= - m.x117 - m.x201 + m.x285 == 0)
m.c170 = Constraint(expr= - m.x118 - m.x202 + m.x286 == 0)
m.c171 = Constraint(expr= - m.x119 - m.x203 + m.x287 == 0)
m.c172 = Constraint(expr= - m.x120 - m.x204 + m.x288 == 0)
m.c173 = Constraint(expr= - m.x121 - m.x205 + m.x289 == 0)
m.c174 = Constraint(expr= - m.x122 - m.x206 + m.x290 == 0)
m.c175 = Constraint(expr= - m.x123 - m.x207 + m.x291 == 0)
m.c176 = Constraint(expr= - m.x124 - m.x208 + m.x292 == 0)
m.c177 = Constraint(expr= - m.x125 - m.x209 + m.x293 == 0)
m.c178 = Constraint(expr= - m.x126 - m.x210 + m.x294 == 0)
m.c179 = Constraint(expr= - m.x127 - m.x211 + m.x295 == 0)
m.c180 = Constraint(expr= - m.x128 - m.x212 + m.x296 == 0)
m.c181 = Constraint(expr= - m.x129 - m.x213 + m.x297 == 0)
m.c182 = Constraint(expr= - m.x130 - m.x214 + m.x298 == 0)
m.c183 = Constraint(expr= - m.x131 - m.x215 + m.x299 == 0)
m.c184 = Constraint(expr= - m.x132 - m.x216 + m.x300 == 0)
m.c185 = Constraint(expr= - m.x133 - m.x217 + m.x301 == 0)
m.c186 = Constraint(expr= - m.x134 - m.x218 + m.x302 == 0)
m.c187 = Constraint(expr= - m.x135 - m.x219 + m.x303 == 0)
m.c188 = Constraint(expr= - m.x136 - m.x220 + m.x304 == 0)
m.c189 = Constraint(expr= - m.x137 - m.x221 + m.x305 == 0)
m.c190 = Constraint(expr= - m.x138 - m.x222 + m.x306 == 0)
m.c191 = Constraint(expr= - m.x139 - m.x223 + m.x307 == 0)
m.c192 = Constraint(expr= - m.x140 - m.x224 + m.x308 == 0)
m.c193 = Constraint(expr= - m.x141 - m.x225 + m.x309 == 0)
m.c194 = Constraint(expr= - m.x142 - m.x226 + m.x310 == 0)
m.c195 = Constraint(expr= - m.x143 - m.x227 + m.x311 == 0)
m.c196 = Constraint(expr= - m.x144 - m.x228 + m.x312 == 0)
m.c197 = Constraint(expr= - m.x145 - m.x229 + m.x313 == 0)
m.c198 = Constraint(expr= - m.x146 - m.x230 + m.x314 == 0)
m.c199 = Constraint(expr= - m.x147 - m.x231 + m.x315 == 0)
m.c200 = Constraint(expr= - m.x148 - m.x232 + m.x316 == 0)
m.c201 = Constraint(expr= - m.x149 - m.x233 + m.x317 == 0)
m.c202 = Constraint(expr= - m.x150 - m.x234 + m.x318 == 0)
m.c203 = Constraint(expr= - m.x151 - m.x235 + m.x319 == 0)
m.c204 = Constraint(expr= - m.x152 - m.x236 + m.x320 == 0)
m.c205 = Constraint(expr= - m.x153 - m.x237 + m.x321 == 0)
m.c206 = Constraint(expr= - m.x154 - m.x238 + m.x322 == 0)
m.c207 = Constraint(expr= - m.x155 - m.x239 + m.x323 == 0)
m.c208 = Constraint(expr= - m.x156 - m.x240 + m.x324 == 0)
m.c209 = Constraint(expr= - m.x157 - m.x241 + m.x325 == 0)
m.c210 = Constraint(expr= - m.x158 - m.x242 + m.x326 == 0)
m.c211 = Constraint(expr= - m.x159 - m.x243 + m.x327 == 0)
m.c212 = Constraint(expr= - m.x160 - m.x244 + m.x328 == 0)
m.c213 = Constraint(expr= - m.x161 - m.x245 + m.x329 == 0)
m.c214 = Constraint(expr= - m.x162 - m.x246 + m.x330 == 0)
m.c215 = Constraint(expr= - m.x163 - m.x247 + m.x331 == 0)
m.c216 = Constraint(expr= - m.x164 - m.x248 + m.x332 == 0)
m.c217 = Constraint(expr= - m.x165 - m.x249 + m.x333 == 0)
m.c218 = Constraint(expr= - m.x166 - m.x250 + m.x334 == 0)
m.c219 = Constraint(expr= - m.x167 - m.x251 + m.x335 == 0)
m.c220 = Constraint(expr= - m.x168 - m.x252 + m.x336 == 0)
m.c221 = Constraint(expr= - m.x169 - m.x253 + m.x337 == 0)
m.c222 = Constraint(expr= - 0.001*m.b2 + m.x86 >= 0)
m.c223 = Constraint(expr= - 4.001*m.b3 + m.x87 >= 0)
m.c224 = Constraint(expr= - 8.001*m.b4 + m.x88 >= 0)
m.c225 = Constraint(expr= m.x89 >= 0)
m.c226 = Constraint(expr= m.x90 >= 0)
m.c227 = Constraint(expr= m.x91 >= 0)
m.c228 = Constraint(expr= m.x92 >= 0)
m.c229 = Constraint(expr= m.x93 >= 0)
m.c230 = Constraint(expr= m.x94 >= 0)
m.c231 = Constraint(expr= m.x95 >= 0)
m.c232 = Constraint(expr= m.x96 >= 0)
m.c233 = Constraint(expr= m.x97 >= 0)
m.c234 = Constraint(expr= m.x98 >= 0)
m.c235 = Constraint(expr= m.x99 >= 0)
m.c236 = Constraint(expr= - 0.001*m.b16 + m.x100 >= 0)
m.c237 = Constraint(expr= - 4.001*m.b17 + m.x101 >= 0)
m.c238 = Constraint(expr= - 8.001*m.b18 + m.x102 >= 0)
m.c239 = Constraint(expr= m.x103 >= 0)
m.c240 = Constraint(expr= m.x104 >= 0)
m.c241 = Constraint(expr= m.x105 >= 0)
m.c242 = Constraint(expr= m.x106 >= 0)
m.c243 = Constraint(expr= m.x107 >= 0)
m.c244 = Constraint(expr= m.x108 >= 0)
m.c245 = Constraint(expr= m.x109 >= 0)
m.c246 = Constraint(expr= m.x110 >= 0)
m.c247 = Constraint(expr= m.x111 >= 0)
m.c248 = Constraint(expr= m.x112 >= 0)
m.c249 = Constraint(expr= m.x113 >= 0)
m.c250 = Constraint(expr= - 0.001*m.b30 + m.x114 >= 0)
m.c251 = Constraint(expr= - 4.001*m.b31 + m.x115 >= 0)
m.c252 = Constraint(expr= - 8.001*m.b32 + m.x116 >= 0)
m.c253 = Constraint(expr= m.x117 >= 0)
m.c254 = Constraint(expr= m.x118 >= 0)
m.c255 = Constraint(expr= m.x119 >= 0)
m.c256 = Constraint(expr= m.x120 >= 0)
m.c257 = Constraint(expr= m.x121 >= 0)
m.c258 = Constraint(expr= m.x122 >= 0)
m.c259 = Constraint(expr= m.x123 >= 0)
m.c260 = Constraint(expr= m.x124 >= 0)
m.c261 = Constraint(expr= m.x125 >= 0)
m.c262 = Constraint(expr= m.x126 >= 0)
m.c263 = Constraint(expr= m.x127 >= 0)
m.c264 = Constraint(expr= - 0.001*m.b44 + m.x128 >= 0)
m.c265 = Constraint(expr= - 4.001*m.b45 + m.x129 >= 0)
m.c266 = Constraint(expr= - 8.001*m.b46 + m.x130 >= 0)
m.c267 = Constraint(expr= m.x131 >= 0)
m.c268 = Constraint(expr= m.x132 >= 0)
m.c269 = Constraint(expr= m.x133 >= 0)
m.c270 = Constraint(expr= m.x134 >= 0)
m.c271 = Constraint(expr= m.x135 >= 0)
m.c272 = Constraint(expr= m.x136 >= 0)
m.c273 = Constraint(expr= m.x137 >= 0)
m.c274 = Constraint(expr= m.x138 >= 0)
m.c275 = Constraint(expr= m.x139 >= 0)
m.c276 = Constraint(expr= m.x140 >= 0)
m.c277 = Constraint(expr= m.x141 >= 0)
m.c278 = Constraint(expr= - 0.001*m.b58 + m.x142 >= 0)
m.c279 = Constraint(expr= - 4.001*m.b59 + m.x143 >= 0)
m.c280 = Constraint(expr= - 8.001*m.b60 + m.x144 >= 0)
m.c281 = Constraint(expr= m.x145 >= 0)
m.c282 = Constraint(expr= m.x146 >= 0)
m.c283 = Constraint(expr= m.x147 >= 0)
m.c284 = Constraint(expr= m.x148 >= 0)
m.c285 = Constraint(expr= m.x149 >= 0)
m.c286 = Constraint(expr= m.x150 >= 0)
m.c287 = Constraint(expr= m.x151 >= 0)
m.c288 = Constraint(expr= m.x152 >= 0)
m.c289 = Constraint(expr= m.x153 >= 0)
m.c290 = Constraint(expr= m.x154 >= 0)
m.c291 = Constraint(expr= m.x155 >= 0)
m.c292 = Constraint(expr= - 0.001*m.b72 + m.x156 >= 0)
m.c293 = Constraint(expr= - 4.001*m.b73 + m.x157 >= 0)
m.c294 = Constraint(expr= - 8.001*m.b74 + m.x158 >= 0)
m.c295 = Constraint(expr= m.x159 >= 0)
m.c296 = Constraint(expr= m.x160 >= 0)
m.c297 = Constraint(expr= m.x161 >= 0)
m.c298 = Constraint(expr= m.x162 >= 0)
m.c299 = Constraint(expr= m.x163 >= 0)
m.c300 = Constraint(expr= m.x164 >= 0)
m.c301 = Constraint(expr= m.x165 >= 0)
m.c302 = Constraint(expr= m.x166 >= 0)
m.c303 = Constraint(expr= m.x167 >= 0)
m.c304 = Constraint(expr= m.x168 >= 0)
m.c305 = Constraint(expr= m.x169 >= 0)
m.c306 = Constraint(expr= - 12*m.b2 + m.x254 <= 0)
m.c307 = Constraint(expr= - 12*m.b3 + m.x255 <= 0)
m.c308 = Constraint(expr= - 12*m.b4 + m.x256 <= 0)
m.c309 = Constraint(expr= - 12*m.b5 + m.x257 <= 0)
m.c310 = Constraint(expr= - 12*m.b6 + m.x258 <= 0)
m.c311 = Constraint(expr= - 12*m.b7 + m.x259 <= 0)
m.c312 = Constraint(expr= - 12*m.b8 + m.x260 <= 0)
m.c313 = Constraint(expr= - 12*m.b9 + m.x261 <= 0)
m.c314 = Constraint(expr= - 12*m.b10 + m.x262 <= 0)
m.c315 = Constraint(expr= - 12*m.b11 + m.x263 <= 0)
m.c316 = Constraint(expr= - 12*m.b12 + m.x264 <= 0)
m.c317 = Constraint(expr= - 12*m.b13 + m.x265 <= 0)
m.c318 = Constraint(expr= - 12*m.b14 + m.x266 <= 0)
m.c319 = Constraint(expr= - 12*m.b15 + m.x267 <= 0)
m.c320 = Constraint(expr= - 12*m.b16 + m.x268 <= 0)
m.c321 = Constraint(expr= - 12*m.b17 + m.x269 <= 0)
m.c322 = Constraint(expr= - 12*m.b18 + m.x270 <= 0)
m.c323 = Constraint(expr= - 12*m.b19 + m.x271 <= 0)
m.c324 = Constraint(expr= - 12*m.b20 + m.x272 <= 0)
m.c325 = Constraint(expr= - 12*m.b21 + m.x273 <= 0)
m.c326 = Constraint(expr= - 12*m.b22 + m.x274 <= 0)
m.c327 = Constraint(expr= - 12*m.b23 + m.x275 <= 0)
m.c328 = Constraint(expr= - 12*m.b24 + m.x276 <= 0)
m.c329 = Constraint(expr= - 12*m.b25 + m.x277 <= 0)
m.c330 = Constraint(expr= - 12*m.b26 + m.x278 <= 0)
m.c331 = Constraint(expr= - 12*m.b27 + m.x279 <= 0)
m.c332 = Constraint(expr= - 12*m.b28 + m.x280 <= 0)
m.c333 = Constraint(expr= - 12*m.b29 + m.x281 <= 0)
m.c334 = Constraint(expr= - 12*m.b30 + m.x282 <= 0)
m.c335 = Constraint(expr= - 12*m.b31 + m.x283 <= 0)
m.c336 = Constraint(expr= - 12*m.b32 + m.x284 <= 0)
m.c337 = Constraint(expr= - 12*m.b33 + m.x285 <= 0)
m.c338 = Constraint(expr= - 12*m.b34 + m.x286 <= 0)
m.c339 = Constraint(expr= - 12*m.b35 + m.x287 <= 0)
m.c340 = Constraint(expr= - 12*m.b36 + m.x288 <= 0)
m.c341 = Constraint(expr= - 12*m.b37 + m.x289 <= 0)
m.c342 = Constraint(expr= - 12*m.b38 + m.x290 <= 0)
m.c343 = Constraint(expr= - 12*m.b39 + m.x291 <= 0)
m.c344 = Constraint(expr= - 12*m.b40 + m.x292 <= 0)
m.c345 = Constraint(expr= - 12*m.b41 + m.x293 <= 0)
m.c346 = Constraint(expr= - 12*m.b42 + m.x294 <= 0)
m.c347 = Constraint(expr= - 12*m.b43 + m.x295 <= 0)
m.c348 = Constraint(expr= - 12*m.b44 + m.x296 <= 0)
m.c349 = Constraint(expr= - 12*m.b45 + m.x297 <= 0)
m.c350 = Constraint(expr= - 12*m.b46 + m.x298 <= 0)
m.c351 = Constraint(expr= - 12*m.b47 + m.x299 <= 0)
m.c352 = Constraint(expr= - 12*m.b48 + m.x300 <= 0)
m.c353 = Constraint(expr= - 12*m.b49 + m.x301 <= 0)
m.c354 = Constraint(expr= - 12*m.b50 + m.x302 <= 0)
m.c355 = Constraint(expr= - 12*m.b51 + m.x303 <= 0)
m.c356 = Constraint(expr= - 12*m.b52 + m.x304 <= 0)
m.c357 = Constraint(expr= - 12*m.b53 + m.x305 <= 0)
m.c358 = Constraint(expr= - 12*m.b54 + m.x306 <= 0)
m.c359 = Constraint(expr= - 12*m.b55 + m.x307 <= 0)
m.c360 = Constraint(expr= - 12*m.b56 + m.x308 <= 0)
m.c361 = Constraint(expr= - 12*m.b57 + m.x309 <= 0)
m.c362 = Constraint(expr= - 12*m.b58 + m.x310 <= 0)
m.c363 = Constraint(expr= - 12*m.b59 + m.x311 <= 0)
m.c364 = Constraint(expr= - 12*m.b60 + m.x312 <= 0)
m.c365 = Constraint(expr= - 12*m.b61 + m.x313 <= 0)
m.c366 = Constraint(expr= - 12*m.b62 + m.x314 <= 0)
m.c367 = Constraint(expr= - 12*m.b63 + m.x315 <= 0)
m.c368 = Constraint(expr= - 12*m.b64 + m.x316 <= 0)
m.c369 = Constraint(expr= - 12*m.b65 + m.x317 <= 0)
m.c370 = Constraint(expr= - 12*m.b66 + m.x318 <= 0)
m.c371 = Constraint(expr= - 12*m.b67 + m.x319 <= 0)
m.c372 = Constraint(expr= - 12*m.b68 + m.x320 <= 0)
m.c373 = Constraint(expr= - 12*m.b69 + m.x321 <= 0)
m.c374 = Constraint(expr= - 12*m.b70 + m.x322 <= 0)
m.c375 = Constraint(expr= - 12*m.b71 + m.x323 <= 0)
m.c376 = Constraint(expr= - 12*m.b72 + m.x324 <= 0)
m.c377 = Constraint(expr= - 12*m.b73 + m.x325 <= 0)
m.c378 = Constraint(expr= - 12*m.b74 + m.x326 <= 0)
m.c379 = Constraint(expr= - 12*m.b75 + m.x327 <= 0)
m.c380 = Constraint(expr= - 12*m.b76 + m.x328 <= 0)
m.c381 = Constraint(expr= - 12*m.b77 + m.x329 <= 0)
m.c382 = Constraint(expr= - 12*m.b78 + m.x330 <= 0)
m.c383 = Constraint(expr= - 12*m.b79 + m.x331 <= 0)
m.c384 = Constraint(expr= - 12*m.b80 + m.x332 <= 0)
m.c385 = Constraint(expr= - 12*m.b81 + m.x333 <= 0)
m.c386 = Constraint(expr= - 12*m.b82 + m.x334 <= 0)
m.c387 = Constraint(expr= - 12*m.b83 + m.x335 <= 0)
m.c388 = Constraint(expr= - 12*m.b84 + m.x336 <= 0)
m.c389 = Constraint(expr= - 12*m.b85 + m.x337 <= 0)
m.c390 = Constraint(expr= - 50*m.b2 + m.x338 >= 0)
m.c391 = Constraint(expr= - 50*m.b3 + m.x339 >= 0)
m.c392 = Constraint(expr= - 50*m.b4 + m.x340 >= 0)
m.c393 = Constraint(expr= - 50*m.b16 + m.x352 >= 0)
m.c394 = Constraint(expr= - 50*m.b17 + m.x353 >= 0)
m.c395 = Constraint(expr= - 50*m.b18 + m.x354 >= 0)
m.c396 = Constraint(expr= - 50*m.b30 + m.x366 >= 0)
m.c397 = Constraint(expr= - 50*m.b31 + m.x367 >= 0)
m.c398 = Constraint(expr= - 50*m.b32 + m.x368 >= 0)
m.c399 = Constraint(expr= - 50*m.b44 + m.x380 >= 0)
m.c400 = Constraint(expr= - 50*m.b45 + m.x381 >= 0)
m.c401 = Constraint(expr= - 50*m.b46 + m.x382 >= 0)
m.c402 = Constraint(expr= - 50*m.b58 + m.x394 >= 0)
m.c403 = Constraint(expr= - 50*m.b59 + m.x395 >= 0)
m.c404 = Constraint(expr= - 50*m.b60 + m.x396 >= 0)
m.c405 = Constraint(expr= - 50*m.b72 + m.x408 >= 0)
m.c406 = Constraint(expr= - 50*m.b73 + m.x409 >= 0)
m.c407 = Constraint(expr= - 50*m.b74 + m.x410 >= 0)
m.c408 = Constraint(expr= - 50*m.b2 + m.x338 <= 0)
m.c409 = Constraint(expr= - 50*m.b3 + m.x339 <= 0)
m.c410 = Constraint(expr= - 50*m.b4 + m.x340 <= 0)
m.c411 = Constraint(expr= - 100*m.b5 + m.x341 <= 0)
m.c412 = Constraint(expr= - 100*m.b6 + m.x342 <= 0)
m.c413 = Constraint(expr= - 100*m.b7 + m.x343 <= 0)
m.c414 = Constraint(expr= - 100*m.b8 + m.x344 <= 0)
m.c415 = Constraint(expr= - 100*m.b9 + m.x345 <= 0)
m.c416 = Constraint(expr= - 100*m.b10 + m.x346 <= 0)
m.c417 = Constraint(expr= - 100*m.b11 + m.x347 <= 0)
m.c418 = Constraint(expr= - 50*m.b12 + m.x348 <= 0)
m.c419 = Constraint(expr= - 50*m.b13 + m.x349 <= 0)
m.c420 = Constraint(expr= - 50*m.b14 + m.x350 <= 0)
m.c421 = Constraint(expr= - 50*m.b15 + m.x351 <= 0)
m.c422 = Constraint(expr= - 50*m.b16 + m.x352 <= 0)
m.c423 = Constraint(expr= - 50*m.b17 + m.x353 <= 0)
m.c424 = Constraint(expr= - 50*m.b18 + m.x354 <= 0)
m.c425 = Constraint(expr= - 100*m.b19 + m.x355 <= 0)
m.c426 = Constraint(expr= - 100*m.b20 + m.x356 <= 0)
m.c427 = Constraint(expr= - 100*m.b21 + m.x357 <= 0)
m.c428 = Constraint(expr= - 100*m.b22 + m.x358 <= 0)
m.c429 = Constraint(expr= - 100*m.b23 + m.x359 <= 0)
m.c430 = Constraint(expr= - 100*m.b24 + m.x360 <= 0)
m.c431 = Constraint(expr= - 100*m.b25 + m.x361 <= 0)
m.c432 = Constraint(expr= - 50*m.b26 + m.x362 <= 0)
m.c433 = Constraint(expr= - 50*m.b27 + m.x363 <= 0)
m.c434 = Constraint(expr= - 50*m.b28 + m.x364 <= 0)
m.c435 = Constraint(expr= - 50*m.b29 + m.x365 <= 0)
m.c436 = Constraint(expr= - 50*m.b30 + m.x366 <= 0)
m.c437 = Constraint(expr= - 50*m.b31 + m.x367 <= 0)
m.c438 = Constraint(expr= - 50*m.b32 + m.x368 <= 0)
m.c439 = Constraint(expr= - 100*m.b33 + m.x369 <= 0)
m.c440 = Constraint(expr= - 100*m.b34 + m.x370 <= 0)
m.c441 = Constraint(expr= - 100*m.b35 + m.x371 <= 0)
m.c442 = Constraint(expr= - 100*m.b36 + m.x372 <= 0)
m.c443 = Constraint(expr= - 100*m.b37 + m.x373 <= 0)
m.c444 = Constraint(expr= - 100*m.b38 + m.x374 <= 0)
m.c445 = Constraint(expr= - 100*m.b39 + m.x375 <= 0)
m.c446 = Constraint(expr= - 50*m.b40 + m.x376 <= 0)
m.c447 = Constraint(expr= - 50*m.b41 + m.x377 <= 0)
m.c448 = Constraint(expr= - 50*m.b42 + m.x378 <= 0)
m.c449 = Constraint(expr= - 50*m.b43 + m.x379 <= 0)
m.c450 = Constraint(expr= - 50*m.b44 + m.x380 <= 0)
m.c451 = Constraint(expr= - 50*m.b45 + m.x381 <= 0)
m.c452 = Constraint(expr= - 50*m.b46 + m.x382 <= 0)
m.c453 = Constraint(expr= - 100*m.b47 + m.x383 <= 0)
m.c454 = Constraint(expr= - 100*m.b48 + m.x384 <= 0)
m.c455 = Constraint(expr= - 100*m.b49 + m.x385 <= 0)
m.c456 = Constraint(expr= - 100*m.b50 + m.x386 <= 0)
m.c457 = Constraint(expr= - 100*m.b51 + m.x387 <= 0)
m.c458 = Constraint(expr= - 100*m.b52 + m.x388 <= 0)
m.c459 = Constraint(expr= - 100*m.b53 + m.x389 <= 0)
m.c460 = Constraint(expr= - 50*m.b54 + m.x390 <= 0)
m.c461 = Constraint(expr= - 50*m.b55 + m.x391 <= 0)
m.c462 = Constraint(expr= - 50*m.b56 + m.x392 <= 0)
m.c463 = Constraint(expr= - 50*m.b57 + m.x393 <= 0)
m.c464 = Constraint(expr= - 50*m.b58 + m.x394 <= 0)
m.c465 = Constraint(expr= - 50*m.b59 + m.x395 <= 0)
m.c466 = Constraint(expr= - 50*m.b60 + m.x396 <= 0)
m.c467 = Constraint(expr= - 100*m.b61 + m.x397 <= 0)
m.c468 = Constraint(expr= - 100*m.b62 + m.x398 <= 0)
m.c469 = Constraint(expr= - 100*m.b63 + m.x399 <= 0)
m.c470 = Constraint(expr= - 100*m.b64 + m.x400 <= 0)
m.c471 = Constraint(expr= - 100*m.b65 + m.x401 <= 0)
m.c472 = Constraint(expr= - 100*m.b66 + m.x402 <= 0)
m.c473 = Constraint(expr= - 100*m.b67 + m.x403 <= 0)
m.c474 = Constraint(expr= - 50*m.b68 + m.x404 <= 0)
m.c475 = Constraint(expr= - 50*m.b69 + m.x405 <= 0)
m.c476 = Constraint(expr= - 50*m.b70 + m.x406 <= 0)
m.c477 = Constraint(expr= - 50*m.b71 + m.x407 <= 0)
m.c478 = Constraint(expr= - 50*m.b72 + m.x408 <= 0)
m.c479 = Constraint(expr= - 50*m.b73 + m.x409 <= 0)
m.c480 = Constraint(expr= - 50*m.b74 + m.x410 <= 0)
m.c481 = Constraint(expr= - 100*m.b75 + m.x411 <= 0)
m.c482 = Constraint(expr= - 100*m.b76 + m.x412 <= 0)
m.c483 = Constraint(expr= - 100*m.b77 + m.x413 <= 0)
m.c484 = Constraint(expr= - 100*m.b78 + m.x414 <= 0)
m.c485 = Constraint(expr= - 100*m.b79 + m.x415 <= 0)
m.c486 = Constraint(expr= - 100*m.b80 + m.x416 <= 0)
m.c487 = Constraint(expr= - 100*m.b81 + m.x417 <= 0)
m.c488 = Constraint(expr= - 50*m.b82 + m.x418 <= 0)
m.c489 = Constraint(expr= - 50*m.b83 + m.x419 <= 0)
m.c490 = Constraint(expr= - 50*m.b84 + m.x420 <= 0)
m.c491 = Constraint(expr= - 50*m.b85 + m.x421 <= 0)
m.c492 = Constraint(expr= m.x338 - m.x422 - m.x423 - m.x424 - m.x425 - m.x426 - m.x427 - m.x428 == 0)
m.c493 = Constraint(expr= m.x339 - m.x429 - m.x430 - m.x431 - m.x432 - m.x433 - m.x434 - m.x435 == 0)
m.c494 = Constraint(expr= m.x340 - m.x436 - m.x437 - m.x438 - m.x439 - m.x440 - m.x441 - m.x442 == 0)
m.c495 = Constraint(expr= m.x341 - m.x443 - m.x444 - m.x445 - m.x446 - m.x447 - m.x448 - m.x449 == 0)
m.c496 = Constraint(expr= m.x342 - m.x450 - m.x451 - m.x452 - m.x453 - m.x454 - m.x455 - m.x456 == 0)
m.c497 = Constraint(expr= m.x343 - m.x457 - m.x458 - m.x459 - m.x460 - m.x461 - m.x462 - m.x463 == 0)
m.c498 = Constraint(expr= m.x344 - m.x464 - m.x465 - m.x466 - m.x467 - m.x468 - m.x469 - m.x470 == 0)
m.c499 = Constraint(expr= m.x345 - m.x471 - m.x472 - m.x473 - m.x474 - m.x475 - m.x476 - m.x477 == 0)
m.c500 = Constraint(expr= m.x346 - m.x478 - m.x479 - m.x480 - m.x481 - m.x482 - m.x483 - m.x484 == 0)
m.c501 = Constraint(expr= m.x347 - m.x485 - m.x486 - m.x487 - m.x488 - m.x489 - m.x490 - m.x491 == 0)
m.c502 = Constraint(expr= m.x348 - m.x492 - m.x493 - m.x494 - m.x495 - m.x496 - m.x497 - m.x498 == 0)
m.c503 = Constraint(expr= m.x349 - m.x499 - m.x500 - m.x501 - m.x502 - m.x503 - m.x504 - m.x505 == 0)
m.c504 = Constraint(expr= m.x350 - m.x506 - m.x507 - m.x508 - m.x509 - m.x510 - m.x511 - m.x512 == 0)
m.c505 = Constraint(expr= m.x351 - m.x513 - m.x514 - m.x515 - m.x516 - m.x517 - m.x518 - m.x519 == 0)
m.c506 = Constraint(expr= m.x352 - m.x520 - m.x521 - m.x522 - m.x523 - m.x524 - m.x525 - m.x526 == 0)
m.c507 = Constraint(expr= m.x353 - m.x527 - m.x528 - m.x529 - m.x530 - m.x531 - m.x532 - m.x533 == 0)
m.c508 = Constraint(expr= m.x354 - m.x534 - m.x535 - m.x536 - m.x537 - m.x538 - m.x539 - m.x540 == 0)
m.c509 = Constraint(expr= m.x355 - m.x541 - m.x542 - m.x543 - m.x544 - m.x545 - m.x546 - m.x547 == 0)
m.c510 = Constraint(expr= m.x356 - m.x548 - m.x549 - m.x550 - m.x551 - m.x552 - m.x553 - m.x554 == 0)
m.c511 = Constraint(expr= m.x357 - m.x555 - m.x556 - m.x557 - m.x558 - m.x559 - m.x560 - m.x561 == 0)
m.c512 = Constraint(expr= m.x358 - m.x562 - m.x563 - m.x564 - m.x565 - m.x566 - m.x567 - m.x568 == 0)
m.c513 = Constraint(expr= m.x359 - m.x569 - m.x570 - m.x571 - m.x572 - m.x573 - m.x574 - m.x575 == 0)
m.c514 = Constraint(expr= m.x360 - m.x576 - m.x577 - m.x578 - m.x579 - m.x580 - m.x581 - m.x582 == 0)
m.c515 = Constraint(expr= m.x361 - m.x583 - m.x584 - m.x585 - m.x586 - m.x587 - m.x588 - m.x589 == 0)
m.c516 = Constraint(expr= m.x362 - m.x590 - m.x591 - m.x592 - m.x593 - m.x594 - m.x595 - m.x596 == 0)
m.c517 = Constraint(expr= m.x363 - m.x597 - m.x598 - m.x599 - m.x600 - m.x601 - m.x602 - m.x603 == 0)
m.c518 = Constraint(expr= m.x364 - m.x604 - m.x605 - m.x606 - m.x607 - m.x608 - m.x609 - m.x610 == 0)
m.c519 = Constraint(expr= m.x365 - m.x611 - m.x612 - m.x613 - m.x614 - m.x615 - m.x616 - m.x617 == 0)
m.c520 = Constraint(expr= m.x366 - m.x618 - m.x619 - m.x620 - m.x621 - m.x622 - m.x623 - m.x624 == 0)
m.c521 = Constraint(expr= m.x367 - m.x625 - m.x626 - m.x627 - m.x628 - m.x629 - m.x630 - m.x631 == 0)
m.c522 = Constraint(expr= m.x368 - m.x632 - m.x633 - m.x634 - m.x635 - m.x636 - m.x637 - m.x638 == 0)
m.c523 = Constraint(expr= m.x369 - m.x639 - m.x640 - m.x641 - m.x642 - m.x643 - m.x644 - m.x645 == 0)
m.c524 = Constraint(expr= m.x370 - m.x646 - m.x647 - m.x648 - m.x649 - m.x650 - m.x651 - m.x652 == 0)
m.c525 = Constraint(expr= m.x371 - m.x653 - m.x654 - m.x655 - m.x656 - m.x657 - m.x658 - m.x659 == 0)
m.c526 = Constraint(expr= m.x372 - m.x660 - m.x661 - m.x662 - m.x663 - m.x664 - m.x665 - m.x666 == 0)
m.c527 = Constraint(expr= m.x373 - m.x667 - m.x668 - m.x669 - m.x670 - m.x671 - m.x672 - m.x673 == 0)
m.c528 = Constraint(expr= m.x374 - m.x674 - m.x675 - m.x676 - m.x677 - m.x678 - m.x679 - m.x680 == 0)
m.c529 = Constraint(expr= m.x375 - m.x681 - m.x682 - m.x683 - m.x684 - m.x685 - m.x686 - m.x687 == 0)
m.c530 = Constraint(expr= m.x376 - m.x688 - m.x689 - m.x690 - m.x691 - m.x692 - m.x693 - m.x694 == 0)
m.c531 = Constraint(expr= m.x377 - m.x695 - m.x696 - m.x697 - m.x698 - m.x699 - m.x700 - m.x701 == 0)
m.c532 = Constraint(expr= m.x378 - m.x702 - m.x703 - m.x704 - m.x705 - m.x706 - m.x707 - m.x708 == 0)
m.c533 = Constraint(expr= m.x379 - m.x709 - m.x710 - m.x711 - m.x712 - m.x713 - m.x714 - m.x715 == 0)
m.c534 = Constraint(expr= m.x380 - m.x716 - m.x717 - m.x718 - m.x719 - m.x720 - m.x721 - m.x722 == 0)
m.c535 = Constraint(expr= m.x381 - m.x723 - m.x724 - m.x725 - m.x726 - m.x727 - m.x728 - m.x729 == 0)
m.c536 = Constraint(expr= m.x382 - m.x730 - m.x731 - m.x732 - m.x733 - m.x734 - m.x735 - m.x736 == 0)
m.c537 = Constraint(expr= m.x383 - m.x737 - m.x738 - m.x739 - m.x740 - m.x741 - m.x742 - m.x743 == 0)
m.c538 = Constraint(expr= m.x384 - m.x744 - m.x745 - m.x746 - m.x747 - m.x748 - m.x749 - m.x750 == 0)
m.c539 = Constraint(expr= m.x385 - m.x751 - m.x752 - m.x753 - m.x754 - m.x755 - m.x756 - m.x757 == 0)
m.c540 = Constraint(expr= m.x386 - m.x758 - m.x759 - m.x760 - m.x761 - m.x762 - m.x763 - m.x764 == 0)
m.c541 = Constraint(expr= m.x387 - m.x765 - m.x766 - m.x767 - m.x768 - m.x769 - m.x770 - m.x771 == 0)
m.c542 = Constraint(expr= m.x388 - m.x772 - m.x773 - m.x774 - m.x775 - m.x776 - m.x777 - m.x778 == 0)
m.c543 = Constraint(expr= m.x389 - m.x779 - m.x780 - m.x781 - m.x782 - m.x783 - m.x784 - m.x785 == 0)
m.c544 = Constraint(expr= m.x390 - m.x786 - m.x787 - m.x788 - m.x789 - m.x790 - m.x791 - m.x792 == 0)
m.c545 = Constraint(expr= m.x391 - m.x793 - m.x794 - m.x795 - m.x796 - m.x797 - m.x798 - m.x799 == 0)
m.c546 = Constraint(expr= m.x392 - m.x800 - m.x801 - m.x802 - m.x803 - m.x804 - m.x805 - m.x806 == 0)
m.c547 = Constraint(expr= m.x393 - m.x807 - m.x808 - m.x809 - m.x810 - m.x811 - m.x812 - m.x813 == 0)
m.c548 = Constraint(expr= m.x394 - m.x814 - m.x815 - m.x816 - m.x817 - m.x818 - m.x819 - m.x820 == 0)
m.c549 = Constraint(expr= m.x395 - m.x821 - m.x822 - m.x823 - m.x824 - m.x825 - m.x826 - m.x827 == 0)
m.c550 = Constraint(expr= m.x396 - m.x828 - m.x829 - m.x830 - m.x831 - m.x832 - m.x833 - m.x834 == 0)
m.c551 = Constraint(expr= m.x397 - m.x835 - m.x836 - m.x837 - m.x838 - m.x839 - m.x840 - m.x841 == 0)
m.c552 = Constraint(expr= m.x398 - m.x842 - m.x843 - m.x844 - m.x845 - m.x846 - m.x847 - m.x848 == 0)
m.c553 = Constraint(expr= m.x399 - m.x849 - m.x850 - m.x851 - m.x852 - m.x853 - m.x854 - m.x855 == 0)
m.c554 = Constraint(expr= m.x400 - m.x856 - m.x857 - m.x858 - m.x859 - m.x860 - m.x861 - m.x862 == 0)
m.c555 = Constraint(expr= m.x401 - m.x863 - m.x864 - m.x865 - m.x866 - m.x867 - m.x868 - m.x869 == 0)
m.c556 = Constraint(expr= m.x402 - m.x870 - m.x871 - m.x872 - m.x873 - m.x874 - m.x875 - m.x876 == 0)
m.c557 = Constraint(expr= m.x403 - m.x877 - m.x878 - m.x879 - m.x880 - m.x881 - m.x882 - m.x883 == 0)
m.c558 = Constraint(expr= m.x404 - m.x884 - m.x885 - m.x886 - m.x887 - m.x888 - m.x889 - m.x890 == 0)
m.c559 = Constraint(expr= m.x405 - m.x891 - m.x892 - m.x893 - m.x894 - m.x895 - m.x896 - m.x897 == 0)
m.c560 = Constraint(expr= m.x406 - m.x898 - m.x899 - m.x900 - m.x901 - m.x902 - m.x903 - m.x904 == 0)
m.c561 = Constraint(expr= m.x407 - m.x905 - m.x906 - m.x907 - m.x908 - m.x909 - m.x910 - m.x911 == 0)
m.c562 = Constraint(expr= m.x408 - m.x912 - m.x913 - m.x914 - m.x915 - m.x916 - m.x917 - m.x918 == 0)
m.c563 = Constraint(expr= m.x409 - m.x919 - m.x920 - m.x921 - m.x922 - m.x923 - m.x924 - m.x925 == 0)
m.c564 = Constraint(expr= m.x410 - m.x926 - m.x927 - m.x928 - m.x929 - m.x930 - m.x931 - m.x932 == 0)
m.c565 = Constraint(expr= m.x411 - m.x933 - m.x934 - m.x935 - m.x936 - m.x937 - m.x938 - m.x939 == 0)
m.c566 = Constraint(expr= m.x412 - m.x940 - m.x941 - m.x942 - m.x943 - m.x944 - m.x945 - m.x946 == 0)
m.c567 = Constraint(expr= m.x413 - m.x947 - m.x948 - m.x949 - m.x950 - m.x951 - m.x952 - m.x953 == 0)
m.c568 = Constraint(expr= m.x414 - m.x954 - m.x955 - m.x956 - m.x957 - m.x958 - m.x959 - m.x960 == 0)
m.c569 = Constraint(expr= m.x415 - m.x961 - m.x962 - m.x963 - m.x964 - m.x965 - m.x966 - m.x967 == 0)
m.c570 = Constraint(expr= m.x416 - m.x968 - m.x969 - m.x970 - m.x971 - m.x972 - m.x973 - m.x974 == 0)
m.c571 = Constraint(expr= m.x417 - m.x975 - m.x976 - m.x977 - m.x978 - m.x979 - m.x980 - m.x981 == 0)
m.c572 = Constraint(expr= m.x418 - m.x982 - m.x983 - m.x984 - m.x985 - m.x986 - m.x987 - m.x988 == 0)
m.c573 = Constraint(expr= m.x419 - m.x989 - m.x990 - m.x991 - m.x992 - m.x993 - m.x994 - m.x995 == 0)
m.c574 = Constraint(expr= m.x420 - m.x996 - m.x997 - m.x998 - m.x999 - m.x1000 - m.x1001 - m.x1002 == 0)
m.c575 = Constraint(expr= m.x421 - m.x1003 - m.x1004 - m.x1005 - m.x1006 - m.x1007 - m.x1008 - m.x1009 == 0)
m.c576 = Constraint(expr= m.x1010 <= 50)
m.c577 = Constraint(expr= m.x1011 <= 50)
m.c578 = Constraint(expr= m.x1012 <= 50)
m.c579 = Constraint(expr= m.x1013 <= 100)
m.c580 = Constraint(expr= m.x1014 <= 100)
m.c581 = Constraint(expr= m.x1015 <= 100)
m.c582 = Constraint(expr= m.x1016 <= 100)
m.c583 = Constraint(expr= m.x1017 <= 100)
m.c584 = Constraint(expr= m.x1018 <= 100)
m.c585 = Constraint(expr= m.x1021 <= 50)
m.c586 = Constraint(expr= m.x1022 <= 50)
m.c587 = Constraint(expr= m.x1023 <= 50)
m.c588 = Constraint(expr= m.x1024 <= 100)
m.c589 = Constraint(expr= m.x1025 <= 100)
m.c590 = Constraint(expr= m.x1026 <= 100)
m.c591 = Constraint(expr= m.x1027 <= 100)
m.c592 = Constraint(expr= m.x1028 <= 100)
m.c593 = Constraint(expr= m.x1029 <= 100)
m.c594 = Constraint(expr= m.x1032 <= 50)
m.c595 = Constraint(expr= m.x1033 <= 50)
m.c596 = Constraint(expr= m.x1034 <= 50)
m.c597 = Constraint(expr= m.x1035 <= 100)
m.c598 = Constraint(expr= m.x1036 <= 100)
m.c599 = Constraint(expr= m.x1037 <= 100)
m.c600 = Constraint(expr= m.x1038 <= 100)
m.c601 = Constraint(expr= m.x1039 <= 100)
m.c602 = Constraint(expr= m.x1040 <= 100)
m.c603 = Constraint(expr= m.x1043 <= 50)
m.c604 = Constraint(expr= m.x1044 <= 50)
m.c605 = Constraint(expr= m.x1045 <= 50)
m.c606 = Constraint(expr= m.x1046 <= 100)
m.c607 = Constraint(expr= m.x1047 <= 100)
m.c608 = Constraint(expr= m.x1048 <= 100)
m.c609 = Constraint(expr= m.x1049 <= 100)
m.c610 = Constraint(expr= m.x1050 <= 100)
m.c611 = Constraint(expr= m.x1051 <= 100)
m.c612 = Constraint(expr= m.x1054 <= 50)
m.c613 = Constraint(expr= m.x1055 <= 50)
m.c614 = Constraint(expr= m.x1056 <= 50)
m.c615 = Constraint(expr= m.x1057 <= 100)
m.c616 = Constraint(expr= m.x1058 <= 100)
m.c617 = Constraint(expr= m.x1059 <= 100)
m.c618 = Constraint(expr= m.x1060 <= 100)
m.c619 = Constraint(expr= m.x1061 <= 100)
m.c620 = Constraint(expr= m.x1062 <= 100)
m.c621 = Constraint(expr= m.x1065 <= 50)
m.c622 = Constraint(expr= m.x1066 <= 50)
m.c623 = Constraint(expr= m.x1067 <= 50)
m.c624 = Constraint(expr= m.x1068 <= 100)
m.c625 = Constraint(expr= m.x1069 <= 100)
m.c626 = Constraint(expr= m.x1070 <= 100)
m.c627 = Constraint(expr= m.x1071 <= 100)
m.c628 = Constraint(expr= m.x1072 <= 100)
m.c629 = Constraint(expr= m.x1073 <= 100)
m.c630 = Constraint(expr= m.x1076 >= 0)
m.c631 = Constraint(expr= m.x1077 >= 0)
m.c632 = Constraint(expr= m.x1078 >= 0)
m.c633 = Constraint(expr= m.x1079 >= 0)
m.c634 = Constraint(expr= m.x1080 >= 0)
m.c635 = Constraint(expr= m.x1081 >= 0)
m.c636 = Constraint(expr= m.x1082 >= 0)
m.c637 = Constraint(expr= m.x1083 >= 0)
m.c638 = Constraint(expr= m.x1084 >= 0)
m.c639 = Constraint(expr= m.x1085 >= 0)
m.c640 = Constraint(expr= m.x1086 >= 0)
m.c641 = Constraint(expr= m.x1087 >= 0)
m.c642 = Constraint(expr= m.x1088 >= 0)
m.c643 = Constraint(expr= m.x1089 >= 0)
m.c644 = Constraint(expr= m.x1090 >= 0)
m.c645 = Constraint(expr= m.x1091 >= 0)
m.c646 = Constraint(expr= m.x1092 >= 0)
m.c647 = Constraint(expr= m.x1093 >= 0)
m.c648 = Constraint(expr= m.x1094 >= 0)
m.c649 = Constraint(expr= m.x1095 >= 0)
m.c650 = Constraint(expr= m.x1096 >= 0)
m.c651 = Constraint(expr= m.x1097 >= 0)
m.c652 = Constraint(expr= m.x1098 >= 0)
m.c653 = Constraint(expr= m.x1099 >= 0)
m.c654 = Constraint(expr= m.x1100 >= 0)
m.c655 = Constraint(expr= m.x1101 >= 0)
m.c656 = Constraint(expr= m.x1102 >= 0)
m.c657 = Constraint(expr= m.x1103 >= 0)
m.c658 = Constraint(expr= m.x1104 >= 0)
m.c659 = Constraint(expr= m.x1105 >= 0)
m.c660 = Constraint(expr= m.x1106 >= 0)
m.c661 = Constraint(expr= m.x1107 >= 0)
m.c662 = Constraint(expr= m.x1108 >= 0)
m.c663 = Constraint(expr= m.x1109 >= 0)
m.c664 = Constraint(expr= m.x1110 >= 0)
m.c665 = Constraint(expr= m.x1111 >= 0)
m.c666 = Constraint(expr= m.x1112 >= 0)
m.c667 = Constraint(expr= m.x1113 >= 0)
m.c668 = Constraint(expr= m.x1114 >= 0)
m.c669 = Constraint(expr= m.x1115 >= 0)
m.c670 = Constraint(expr= m.x1116 >= 0)
m.c671 = Constraint(expr= m.x1117 >= 0)
m.c672 = Constraint(expr= m.x1118 >= 0)
m.c673 = Constraint(expr= m.x1119 >= 0)
m.c674 = Constraint(expr= m.x1120 >= 0)
m.c675 = Constraint(expr= m.x1121 >= 0)
m.c676 = Constraint(expr= m.x1122 >= 0)
m.c677 = Constraint(expr= m.x1123 >= 0)
m.c678 = Constraint(expr= m.x1124 >= 0)
m.c679 = Constraint(expr= m.x1125 >= 0)
m.c680 = Constraint(expr= m.x1126 >= 0)
m.c681 = Constraint(expr= m.x1127 >= 0)
m.c682 = Constraint(expr= m.x1128 >= 0)
m.c683 = Constraint(expr= m.x1129 >= 0)
m.c684 = Constraint(expr= m.x1130 >= 0)
m.c685 = Constraint(expr= m.x1131 >= 0)
m.c686 = Constraint(expr= m.x1132 >= 0)
m.c687 = Constraint(expr= m.x1133 >= 0)
m.c688 = Constraint(expr= m.x1134 >= 0)
m.c689 = Constraint(expr= m.x1135 >= 0)
m.c690 = Constraint(expr= m.x1136 >= 0)
m.c691 = Constraint(expr= m.x1137 >= 0)
m.c692 = Constraint(expr= m.x1138 >= 0)
m.c693 = Constraint(expr= m.x1139 >= 0)
m.c694 = Constraint(expr= m.x1140 >= 0)
m.c695 = Constraint(expr= m.x1141 >= 0)
m.c696 = Constraint(expr= m.x1142 >= 0)
m.c697 = Constraint(expr= m.x1143 >= 0)
m.c698 = Constraint(expr= m.x1144 >= 0)
m.c699 = Constraint(expr= m.x1145 >= 0)
m.c700 = Constraint(expr= m.x1146 >= 0)
m.c701 = Constraint(expr= m.x1147 >= 0)
m.c702 = Constraint(expr= m.x1148 >= 0)
m.c703 = Constraint(expr= m.x1149 >= 0)
m.c704 = Constraint(expr= m.x1150 >= 0)
m.c705 = Constraint(expr= m.x1151 >= 0)
m.c706 = Constraint(expr= m.x1152 >= 0)
m.c707 = Constraint(expr= m.x1153 >= 0)
m.c708 = Constraint(expr= m.x1154 >= 0)
m.c709 = Constraint(expr= m.x1155 >= 0)
m.c710 = Constraint(expr= m.x1156 >= 0)
m.c711 = Constraint(expr= m.x1157 >= 0)
m.c712 = Constraint(expr= m.x1158 >= 0)
m.c713 = Constraint(expr= m.x1159 >= 0)
m.c714 = Constraint(expr= m.x1160 >= 0)
m.c715 = Constraint(expr= m.x1161 >= 0)
m.c716 = Constraint(expr= m.x1162 >= 0)
m.c717 = Constraint(expr= m.x1163 >= 0)
m.c718 = Constraint(expr= m.x1164 >= 0)
m.c719 = Constraint(expr= m.x1165 >= 0)
m.c720 = Constraint(expr= m.x1166 >= 0)
m.c721 = Constraint(expr= m.x1167 >= 0)
m.c722 = Constraint(expr= m.x1168 >= 0)
m.c723 = Constraint(expr= m.x1169 >= 0)
m.c724 = Constraint(expr= m.x1170 >= 0)
m.c725 = Constraint(expr= m.x1171 >= 0)
m.c726 = Constraint(expr= m.x1172 >= 0)
m.c727 = Constraint(expr= m.x1173 >= 0)
m.c728 = Constraint(expr= m.x1174 >= 0)
m.c729 = Constraint(expr= m.x1175 >= 0)
m.c730 = Constraint(expr= m.x1176 >= 0)
m.c731 = Constraint(expr= m.x1177 >= 0)
m.c732 = Constraint(expr= m.x1178 >= 0)
m.c733 = Constraint(expr= m.x1179 >= 0)
m.c734 = Constraint(expr= m.x1180 >= 0)
m.c735 = Constraint(expr= m.x1181 >= 0)
m.c736 = Constraint(expr= m.x1182 >= 0)
m.c737 = Constraint(expr= m.x1183 >= 0)
m.c738 = Constraint(expr= m.x1184 >= 0)
m.c739 = Constraint(expr= m.x1185 >= 0)
m.c740 = Constraint(expr= m.x1186 >= 0)
m.c741 = Constraint(expr= m.x1187 >= 0)
m.c742 = Constraint(expr= m.x1188 >= 0)
m.c743 = Constraint(expr= m.x1189 >= 0)
m.c744 = Constraint(expr= m.x1190 >= 0)
m.c745 = Constraint(expr= m.x1191 >= 0)
m.c746 = Constraint(expr= m.x1192 >= 0)
m.c747 = Constraint(expr= m.x1193 >= 0)
m.c748 = Constraint(expr= m.x1194 >= 0)
m.c749 = Constraint(expr= m.x1195 >= 0)
m.c750 = Constraint(expr= m.x1196 >= 0)
m.c751 = Constraint(expr= m.x1197 >= 0)
m.c752 = Constraint(expr= m.x1198 >= 0)
m.c753 = Constraint(expr= m.x1199 >= 0)
m.c754 = Constraint(expr= m.x1200 >= 0)
m.c755 = Constraint(expr= m.x1201 >= 0)
m.c756 = Constraint(expr= m.x1202 >= 0)
m.c757 = Constraint(expr= m.x1203 >= 0)
m.c758 = Constraint(expr= m.x1204 >= 0)
m.c759 = Constraint(expr= m.x1205 >= 0)
m.c760 = Constraint(expr= m.x1206 >= 0)
m.c761 = Constraint(expr= m.x1207 >= 0)
m.c762 = Constraint(expr= m.x1208 >= 0)
m.c763 = Constraint(expr= m.x1209 >= 0)
m.c764 = Constraint(expr= m.x1210 >= 0)
m.c765 = Constraint(expr= m.x1211 >= 0)
m.c766 = Constraint(expr= m.x1212 >= 0)
m.c767 = Constraint(expr= m.x1213 >= 0)
m.c768 = Constraint(expr= m.x1214 >= 0)
m.c769 = Constraint(expr= m.x1215 >= 0)
m.c770 = Constraint(expr= m.x1216 >= 0)
m.c771 = Constraint(expr= m.x1217 >= 0)
m.c772 = Constraint(expr= m.x1218 >= 0)
m.c773 = Constraint(expr= m.x1219 >= 0)
m.c774 = Constraint(expr= m.x1220 >= 0)
m.c775 = Constraint(expr= m.x1221 >= 0)
m.c776 = Constraint(expr= m.x1222 >= 0)
m.c777 = Constraint(expr= m.x1223 >= 0)
m.c778 = Constraint(expr= m.x1224 >= 0)
m.c779 = Constraint(expr= m.x1225 >= 0)
m.c780 = Constraint(expr= m.x1226 >= 0)
m.c781 = Constraint(expr= m.x1227 >= 0)
m.c782 = Constraint(expr= m.x1228 >= 0)
m.c783 = Constraint(expr= m.x1229 >= 0)
m.c784 = Constraint(expr= m.x1230 >= 0)
m.c785 = Constraint(expr= m.x1231 >= 0)
m.c786 = Constraint(expr= m.x1232 >= 0)
m.c787 = Constraint(expr= m.x1233 >= 0)
m.c788 = Constraint(expr= m.x1234 >= 0)
m.c789 = Constraint(expr= m.x1235 >= 0)
m.c790 = Constraint(expr= m.x1236 >= 0)
m.c791 = Constraint(expr= m.x1237 >= 0)
m.c792 = Constraint(expr= m.x1238 >= 0)
m.c793 = Constraint(expr= m.x1239 >= 0)
m.c794 = Constraint(expr= m.x1240 >= 0)
m.c795 = Constraint(expr= m.x1241 >= 0)
m.c796 = Constraint(expr= m.x1242 >= 0)
m.c797 = Constraint(expr= m.x1243 >= 0)
m.c798 = Constraint(expr= m.x1244 >= 0)
m.c799 = Constraint(expr= m.x1245 >= 0)
m.c800 = Constraint(expr= m.x1246 >= 0)
m.c801 = Constraint(expr= m.x1247 >= 0)
m.c802 = Constraint(expr= m.x1248 >= 0)
m.c803 = Constraint(expr= m.x1249 >= 0)
m.c804 = Constraint(expr= m.x1250 >= 0)
m.c805 = Constraint(expr= m.x1251 >= 0)
m.c806 = Constraint(expr= m.x1252 >= 0)
m.c807 = Constraint(expr= m.x1253 >= 0)
m.c808 = Constraint(expr= m.x1254 >= 0)
m.c809 = Constraint(expr= m.x1255 >= 0)
m.c810 = Constraint(expr= m.x1256 >= 0)
m.c811 = Constraint(expr= m.x1257 >= 0)
m.c812 = Constraint(expr= m.x1258 >= 0)
m.c813 = Constraint(expr= m.x1259 >= 0)
m.c814 = Constraint(expr= m.x1260 >= 0)
m.c815 = Constraint(expr= m.x1261 >= 0)
m.c816 = Constraint(expr= m.x1262 >= 0)
m.c817 = Constraint(expr= m.x1263 >= 0)
m.c818 = Constraint(expr= m.x1264 >= 0)
m.c819 = Constraint(expr= m.x1265 >= 0)
m.c820 = Constraint(expr= m.x1266 >= 0)
m.c821 = Constraint(expr= m.x1267 >= 0)
m.c822 = Constraint(expr= m.x1268 >= 0)
m.c823 = Constraint(expr= m.x1269 >= 0)
m.c824 = Constraint(expr= m.x1270 >= 0)
m.c825 = Constraint(expr= m.x1271 >= 0)
m.c826 = Constraint(expr= m.x1272 >= 0)
m.c827 = Constraint(expr= m.x1273 >= 0)
m.c828 = Constraint(expr= m.x1274 >= 0)
m.c829 = Constraint(expr= m.x1275 >= 0)
m.c830 = Constraint(expr= m.x1276 >= 0)
m.c831 = Constraint(expr= m.x1277 >= 0)
m.c832 = Constraint(expr= m.x1278 >= 0)
m.c833 = Constraint(expr= m.x1279 >= 0)
m.c834 = Constraint(expr= m.x1280 >= 0)
m.c835 = Constraint(expr= m.x1281 >= 0)
m.c836 = Constraint(expr= m.x1282 >= 0)
m.c837 = Constraint(expr= m.x1283 >= 0)
m.c838 = Constraint(expr= m.x1284 >= 0)
m.c839 = Constraint(expr= m.x1285 >= 0)
m.c840 = Constraint(expr= m.x1286 >= 0)
m.c841 = Constraint(expr= m.x1287 >= 0)
m.c842 = Constraint(expr= m.x1288 >= 0)
m.c843 = Constraint(expr= m.x1289 >= 0)
m.c844 = Constraint(expr= m.x1290 >= 0)
m.c845 = Constraint(expr= m.x1291 >= 0)
m.c846 = Constraint(expr= m.x1292 >= 0)
m.c847 = Constraint(expr= m.x1293 >= 0)
m.c848 = Constraint(expr= m.x1294 >= 0)
m.c849 = Constraint(expr= m.x1295 >= 0)
m.c850 = Constraint(expr= m.x1296 >= 0)
m.c851 = Constraint(expr= m.x1297 >= 0)
m.c852 = Constraint(expr= m.x1298 >= 0)
m.c853 = Constraint(expr= m.x1299 >= 0)
m.c854 = Constraint(expr= m.x1300 >= 0)
m.c855 = Constraint(expr= m.x1301 >= 0)
m.c856 = Constraint(expr= m.x1302 >= 0)
m.c857 = Constraint(expr= m.x1303 >= 0)
m.c858 = Constraint(expr= m.x1304 >= 0)
m.c859 = Constraint(expr= m.x1305 >= 0)
m.c860 = Constraint(expr= m.x1306 >= 0)
m.c861 = Constraint(expr= m.x1307 >= 0)
m.c862 = Constraint(expr= m.x1308 >= 0)
m.c863 = Constraint(expr= m.x1309 >= 0)
m.c864 = Constraint(expr= m.x1310 >= 0)
m.c865 = Constraint(expr= m.x1311 >= 0)
m.c866 = Constraint(expr= m.x1312 >= 0)
m.c867 = Constraint(expr= m.x1313 >= 0)
m.c868 = Constraint(expr= m.x1314 >= 0)
m.c869 = Constraint(expr= m.x1315 >= 0)
m.c870 = Constraint(expr= m.x1316 >= 0)
m.c871 = Constraint(expr= m.x1317 >= 0)
m.c872 = Constraint(expr= m.x1318 >= 0)
m.c873 = Constraint(expr= m.x1319 >= 0)
m.c874 = Constraint(expr= m.x1320 >= 0)
m.c875 = Constraint(expr= m.x1321 >= 0)
m.c876 = Constraint(expr= m.x1322 >= 0)
m.c877 = Constraint(expr= m.x1323 >= 0)
m.c878 = Constraint(expr= m.x1324 >= 0)
m.c879 = Constraint(expr= m.x1325 >= 0)
m.c880 = Constraint(expr= m.x1326 >= 0)
m.c881 = Constraint(expr= m.x1327 >= 0)
m.c882 = Constraint(expr= m.x1328 >= 0)
m.c883 = Constraint(expr= m.x1329 >= 0)
m.c884 = Constraint(expr= m.x1330 >= 0)
m.c885 = Constraint(expr= m.x1331 >= 0)
m.c886 = Constraint(expr= m.x1332 >= 0)
m.c887 = Constraint(expr= m.x1333 >= 0)
m.c888 = Constraint(expr= m.x1334 >= 0)
m.c889 = Constraint(expr= m.x1335 >= 0)
m.c890 = Constraint(expr= m.x1336 >= 0)
m.c891 = Constraint(expr= m.x1337 >= 0)
m.c892 = Constraint(expr= m.x1338 >= 0)
m.c893 = Constraint(expr= m.x1339 >= 0)
m.c894 = Constraint(expr= m.x1340 >= 0)
m.c895 = Constraint(expr= m.x1341 >= 0)
m.c896 = Constraint(expr= m.x1342 >= 0)
m.c897 = Constraint(expr= m.x1343 >= 0)
m.c898 = Constraint(expr= m.x1344 >= 0)
m.c899 = Constraint(expr= m.x1345 >= 0)
m.c900 = Constraint(expr= m.x1346 >= 0)
m.c901 = Constraint(expr= m.x1347 >= 0)
m.c902 = Constraint(expr= m.x1348 >= 0)
m.c903 = Constraint(expr= m.x1349 >= 0)
m.c904 = Constraint(expr= m.x1350 >= 0)
m.c905 = Constraint(expr= m.x1351 >= 0)
m.c906 = Constraint(expr= m.x1352 >= 0)
m.c907 = Constraint(expr= m.x1353 >= 0)
m.c908 = Constraint(expr= m.x1354 >= 0)
m.c909 = Constraint(expr= m.x1355 >= 0)
m.c910 = Constraint(expr= m.x1356 >= 0)
m.c911 = Constraint(expr= m.x1357 >= 0)
m.c912 = Constraint(expr= m.x1358 >= 0)
m.c913 = Constraint(expr= m.x1359 >= 0)
m.c914 = Constraint(expr= m.x1360 >= 0)
m.c915 = Constraint(expr= m.x1361 >= 0)
m.c916 = Constraint(expr= m.x1362 >= 0)
m.c917 = Constraint(expr= m.x1363 >= 0)
m.c918 = Constraint(expr= m.x1364 >= 0)
m.c919 = Constraint(expr= m.x1365 >= 0)
m.c920 = Constraint(expr= m.x1366 >= 0)
m.c921 = Constraint(expr= m.x1367 >= 0)
m.c922 = Constraint(expr= m.x1368 >= 0)
m.c923 = Constraint(expr= m.x1369 >= 0)
m.c924 = Constraint(expr= m.x1370 >= 0)
m.c925 = Constraint(expr= m.x1371 >= 0)
m.c926 = Constraint(expr= m.x1372 >= 0)
m.c927 = Constraint(expr= m.x1373 >= 0)
m.c928 = Constraint(expr= m.x1374 >= 0)
m.c929 = Constraint(expr= m.x1375 >= 0)
m.c930 = Constraint(expr= m.x1376 >= 0)
m.c931 = Constraint(expr= m.x1377 >= 0)
m.c932 = Constraint(expr= m.x1378 >= 0)
m.c933 = Constraint(expr= m.x1379 >= 0)
m.c934 = Constraint(expr= m.x1380 >= 0)
m.c935 = Constraint(expr= m.x1381 >= 0)
m.c936 = Constraint(expr= m.x1382 >= 0)
m.c937 = Constraint(expr= m.x1383 >= 0)
m.c938 = Constraint(expr= m.x1384 >= 0)
m.c939 = Constraint(expr= m.x1385 >= 0)
m.c940 = Constraint(expr= m.x1386 >= 0)
m.c941 = Constraint(expr= m.x1387 >= 0)
m.c942 = Constraint(expr= m.x1388 >= 0)
m.c943 = Constraint(expr= m.x1389 >= 0)
m.c944 = Constraint(expr= m.x1390 >= 0)
m.c945 = Constraint(expr= m.x1391 >= 0)
m.c946 = Constraint(expr= m.x1392 >= 0)
m.c947 = Constraint(expr= m.x1393 >= 0)
m.c948 = Constraint(expr= m.x1394 >= 0)
m.c949 = Constraint(expr= m.x1395 >= 0)
m.c950 = Constraint(expr= m.x1396 >= 0)
m.c951 = Constraint(expr= m.x1397 >= 0)
m.c952 = Constraint(expr= m.x1398 >= 0)
m.c953 = Constraint(expr= m.x1399 >= 0)
m.c954 = Constraint(expr= m.x1400 >= 0)
m.c955 = Constraint(expr= m.x1401 >= 0)
m.c956 = Constraint(expr= m.x1402 >= 0)
m.c957 = Constraint(expr= m.x1403 >= 0)
m.c958 = Constraint(expr= m.x1404 >= 0)
m.c959 = Constraint(expr= m.x1405 >= 0)
m.c960 = Constraint(expr= m.x1406 >= 0)
m.c961 = Constraint(expr= m.x1407 >= 0)
m.c962 = Constraint(expr= m.x1408 >= 0)
m.c963 = Constraint(expr= m.x1409 >= 0)
m.c964 = Constraint(expr= m.x1410 >= 0)
m.c965 = Constraint(expr= m.x1411 >= 0)
m.c966 = Constraint(expr= m.x1412 >= 0)
m.c967 = Constraint(expr= m.x1413 >= 0)
m.c968 = Constraint(expr= m.x1414 >= 0)
m.c969 = Constraint(expr= m.x1415 >= 0)
m.c970 = Constraint(expr= m.x1416 >= 0)
m.c971 = Constraint(expr= m.x1417 >= 0)
m.c972 = Constraint(expr= m.x1418 >= 0)
m.c973 = Constraint(expr= m.x1419 >= 0)
m.c974 = Constraint(expr= m.x1420 >= 0)
m.c975 = Constraint(expr= m.x1421 >= 0)
m.c976 = Constraint(expr= m.x1422 >= 0)
m.c977 = Constraint(expr= m.x1423 >= 0)
m.c978 = Constraint(expr= m.x1424 >= 0)
m.c979 = Constraint(expr= m.x1425 >= 0)
m.c980 = Constraint(expr= m.x1426 >= 0)
m.c981 = Constraint(expr= m.x1427 >= 0)
m.c982 = Constraint(expr= m.x1428 >= 0)
m.c983 = Constraint(expr= m.x1429 >= 0)
m.c984 = Constraint(expr= m.x1430 >= 0)
m.c985 = Constraint(expr= m.x1431 >= 0)
m.c986 = Constraint(expr= m.x1432 >= 0)
m.c987 = Constraint(expr= m.x1433 >= 0)
m.c988 = Constraint(expr= m.x1434 >= 0)
m.c989 = Constraint(expr= m.x1435 >= 0)
m.c990 = Constraint(expr= m.x1436 >= 0)
m.c991 = Constraint(expr= m.x1437 >= 0)
m.c992 = Constraint(expr= m.x1438 >= 0)
m.c993 = Constraint(expr= m.x1439 >= 0)
m.c994 = Constraint(expr= m.x1440 >= 0)
m.c995 = Constraint(expr= m.x1441 >= 0)
m.c996 = Constraint(expr= m.x1442 >= 0)
m.c997 = Constraint(expr= m.x1443 >= 0)
m.c998 = Constraint(expr= m.x1444 >= 0)
m.c999 = Constraint(expr= m.x1445 >= 0)
m.c1000 = Constraint(expr= m.x1446 >= 0)
m.c1001 = Constraint(expr= m.x1447 >= 0)
m.c1002 = Constraint(expr= m.x1448 >= 0)
m.c1003 = Constraint(expr= m.x1449 >= 0)
m.c1004 = Constraint(expr= m.x1450 >= 0)
m.c1005 = Constraint(expr= m.x1451 >= 0)
m.c1006 = Constraint(expr= m.x1452 >= 0)
m.c1007 = Constraint(expr= m.x1453 >= 0)
m.c1008 = Constraint(expr= m.x1454 >= 0)
m.c1009 = Constraint(expr= m.x1455 >= 0)
m.c1010 = Constraint(expr= m.x1456 >= 0)
m.c1011 = Constraint(expr= m.x1457 >= 0)
m.c1012 = Constraint(expr= m.x1458 >= 0)
m.c1013 = Constraint(expr= m.x1459 >= 0)
m.c1014 = Constraint(expr= m.x1460 >= 0)
m.c1015 = Constraint(expr= m.x1461 >= 0)
m.c1016 = Constraint(expr= m.x1462 >= 0)
m.c1017 = Constraint(expr= m.x1463 >= 0)
m.c1018 = Constraint(expr= m.x1464 >= 0)
m.c1019 = Constraint(expr= m.x1465 >= 0)
m.c1020 = Constraint(expr= m.x1466 >= 0)
m.c1021 = Constraint(expr= m.x1467 >= 0)
m.c1022 = Constraint(expr= m.x1468 >= 0)
m.c1023 = Constraint(expr= m.x1469 >= 0)
m.c1024 = Constraint(expr= m.x1470 >= 0)
m.c1025 = Constraint(expr= m.x1471 >= 0)
m.c1026 = Constraint(expr= m.x1472 >= 0)
m.c1027 = Constraint(expr= m.x1473 >= 0)
m.c1028 = Constraint(expr= m.x1474 >= 0)
m.c1029 = Constraint(expr= m.x1475 >= 0)
m.c1030 = Constraint(expr= m.x1476 >= 0)
m.c1031 = Constraint(expr= m.x1477 >= 0)
m.c1032 = Constraint(expr= m.x1478 >= 0)
m.c1033 = Constraint(expr= m.x1479 >= 0)
m.c1034 = Constraint(expr= m.x1480 >= 0)
m.c1035 = Constraint(expr= m.x1481 >= 0)
m.c1036 = Constraint(expr= m.x1482 >= 0)
m.c1037 = Constraint(expr= m.x1483 >= 0)
m.c1038 = Constraint(expr= m.x1484 >= 0)
m.c1039 = Constraint(expr= m.x1485 >= 0)
m.c1040 = Constraint(expr= m.x1486 >= 0)
m.c1041 = Constraint(expr= m.x1487 >= 0)
m.c1042 = Constraint(expr= m.x1488 >= 0)
m.c1043 = Constraint(expr= m.x1489 >= 0)
m.c1044 = Constraint(expr= m.x1490 >= 0)
m.c1045 = Constraint(expr= m.x1491 >= 0)
m.c1046 = Constraint(expr= m.x1492 >= 0)
m.c1047 = Constraint(expr= m.x1493 >= 0)
m.c1048 = Constraint(expr= m.x1494 >= 0)
m.c1049 = Constraint(expr= m.x1495 >= 0)
m.c1050 = Constraint(expr= m.x1496 >= 0)
m.c1051 = Constraint(expr= m.x1497 >= 0)
m.c1052 = Constraint(expr= m.x1498 >= 0)
m.c1053 = Constraint(expr= m.x1499 >= 0)
m.c1054 = Constraint(expr= m.x1500 >= 0)
m.c1055 = Constraint(expr= m.x1501 >= 0)
m.c1056 = Constraint(expr= m.x1502 >= 0)
m.c1057 = Constraint(expr= m.x1503 >= 0)
m.c1058 = Constraint(expr= m.x1504 >= 0)
m.c1059 = Constraint(expr= m.x1505 >= 0)
m.c1060 = Constraint(expr= m.x1506 >= 0)
m.c1061 = Constraint(expr= m.x1507 >= 0)
m.c1062 = Constraint(expr= m.x1508 >= 0)
m.c1063 = Constraint(expr= m.x1509 >= 0)
m.c1064 = Constraint(expr= m.x1510 >= 0)
m.c1065 = Constraint(expr= m.x1511 >= 0)
m.c1066 = Constraint(expr= m.x1512 >= 0)
m.c1067 = Constraint(expr= m.x1513 >= 0)
m.c1068 = Constraint(expr= m.x1514 >= 0)
m.c1069 = Constraint(expr= m.x1515 >= 0)
m.c1070 = Constraint(expr= m.x1516 >= 0)
m.c1071 = Constraint(expr= m.x1517 >= 0)
m.c1072 = Constraint(expr= m.x1518 >= 0)
m.c1073 = Constraint(expr= m.x1519 >= 0)
m.c1074 = Constraint(expr= m.x1520 >= 0)
m.c1075 = Constraint(expr= m.x1521 >= 0)
m.c1076 = Constraint(expr= m.x1522 >= 0)
m.c1077 = Constraint(expr= m.x1523 >= 0)
m.c1078 = Constraint(expr= m.x1524 >= 0)
m.c1079 = Constraint(expr= m.x1525 >= 0)
m.c1080 = Constraint(expr= m.x1526 >= 0)
m.c1081 = Constraint(expr= m.x1527 >= 0)
m.c1082 = Constraint(expr= m.x1528 >= 0)
m.c1083 = Constraint(expr= m.x1529 >= 0)
m.c1084 = Constraint(expr= m.x1530 >= 0)
m.c1085 = Constraint(expr= m.x1531 >= 0)
m.c1086 = Constraint(expr= m.x1532 >= 0)
m.c1087 = Constraint(expr= m.x1533 >= 0)
m.c1088 = Constraint(expr= m.x1534 >= 0)
m.c1089 = Constraint(expr= m.x1535 >= 0)
m.c1090 = Constraint(expr= m.x1536 >= 0)
m.c1091 = Constraint(expr= m.x1537 >= 0)
m.c1092 = Constraint(expr= m.x1076 <= 50)
m.c1093 = Constraint(expr= m.x1077 <= 50)
m.c1094 = Constraint(expr= m.x1078 <= 50)
m.c1095 = Constraint(expr= m.x1079 <= 50)
m.c1096 = Constraint(expr= m.x1080 <= 50)
m.c1097 = Constraint(expr= m.x1081 <= 50)
m.c1098 = Constraint(expr= m.x1082 <= 50)
m.c1099 = Constraint(expr= m.x1083 <= 50)
m.c1100 = Constraint(expr= m.x1084 <= 50)
m.c1101 = Constraint(expr= m.x1085 <= 50)
m.c1102 = Constraint(expr= m.x1086 <= 50)
m.c1103 = Constraint(expr= m.x1087 <= 50)
m.c1104 = Constraint(expr= m.x1088 <= 50)
m.c1105 = Constraint(expr= m.x1089 <= 50)
m.c1106 = Constraint(expr= m.x1090 <= 50)
m.c1107 = Constraint(expr= m.x1091 <= 50)
m.c1108 = Constraint(expr= m.x1092 <= 50)
m.c1109 = Constraint(expr= m.x1093 <= 50)
m.c1110 = Constraint(expr= m.x1094 <= 50)
m.c1111 = Constraint(expr= m.x1095 <= 50)
m.c1112 = Constraint(expr= m.x1096 <= 50)
m.c1113 = Constraint(expr= m.x1097 <= 100)
m.c1114 = Constraint(expr= m.x1098 <= 100)
m.c1115 = Constraint(expr= m.x1099 <= 100)
m.c1116 = Constraint(expr= m.x1100 <= 100)
m.c1117 = Constraint(expr= m.x1101 <= 100)
m.c1118 = Constraint(expr= m.x1102 <= 100)
m.c1119 = Constraint(expr= m.x1103 <= 100)
m.c1120 = Constraint(expr= m.x1104 <= 100)
m.c1121 = Constraint(expr= m.x1105 <= 100)
m.c1122 = Constraint(expr= m.x1106 <= 100)
m.c1123 = Constraint(expr= m.x1107 <= 100)
m.c1124 = Constraint(expr= m.x1108 <= 100)
m.c1125 = Constraint(expr= m.x1109 <= 100)
m.c1126 = Constraint(expr= m.x1110 <= 100)
m.c1127 = Constraint(expr= m.x1111 <= 100)
m.c1128 = Constraint(expr= m.x1112 <= 100)
m.c1129 = Constraint(expr= m.x1113 <= 100)
m.c1130 = Constraint(expr= m.x1114 <= 100)
m.c1131 = Constraint(expr= m.x1115 <= 100)
m.c1132 = Constraint(expr= m.x1116 <= 100)
m.c1133 = Constraint(expr= m.x1117 <= 100)
m.c1134 = Constraint(expr= m.x1118 <= 100)
m.c1135 = Constraint(expr= m.x1119 <= 100)
m.c1136 = Constraint(expr= m.x1120 <= 100)
m.c1137 = Constraint(expr= m.x1121 <= 100)
m.c1138 = Constraint(expr= m.x1122 <= 100)
m.c1139 = Constraint(expr= m.x1123 <= 100)
m.c1140 = Constraint(expr= m.x1124 <= 100)
m.c1141 = Constraint(expr= m.x1125 <= 100)
m.c1142 = Constraint(expr= m.x1126 <= 100)
m.c1143 = Constraint(expr= m.x1127 <= 100)
m.c1144 = Constraint(expr= m.x1128 <= 100)
m.c1145 = Constraint(expr= m.x1129 <= 100)
m.c1146 = Constraint(expr= m.x1130 <= 100)
m.c1147 = Constraint(expr= m.x1131 <= 100)
m.c1148 = Constraint(expr= m.x1132 <= 100)
m.c1149 = Constraint(expr= m.x1133 <= 100)
m.c1150 = Constraint(expr= m.x1134 <= 100)
m.c1151 = Constraint(expr= m.x1135 <= 100)
m.c1152 = Constraint(expr= m.x1136 <= 100)
m.c1153 = Constraint(expr= m.x1137 <= 100)
m.c1154 = Constraint(expr= m.x1138 <= 100)
m.c1155 = Constraint(expr= m.x1153 <= 50)
m.c1156 = Constraint(expr= m.x1154 <= 50)
m.c1157 = Constraint(expr= m.x1155 <= 50)
m.c1158 = Constraint(expr= m.x1156 <= 50)
m.c1159 = Constraint(expr= m.x1157 <= 50)
m.c1160 = Constraint(expr= m.x1158 <= 50)
m.c1161 = Constraint(expr= m.x1159 <= 50)
m.c1162 = Constraint(expr= m.x1160 <= 50)
m.c1163 = Constraint(expr= m.x1161 <= 50)
m.c1164 = Constraint(expr= m.x1162 <= 50)
m.c1165 = Constraint(expr= m.x1163 <= 50)
m.c1166 = Constraint(expr= m.x1164 <= 50)
m.c1167 = Constraint(expr= m.x1165 <= 50)
m.c1168 = Constraint(expr= m.x1166 <= 50)
m.c1169 = Constraint(expr= m.x1167 <= 50)
m.c1170 = Constraint(expr= m.x1168 <= 50)
m.c1171 = Constraint(expr= m.x1169 <= 50)
m.c1172 = Constraint(expr= m.x1170 <= 50)
m.c1173 = Constraint(expr= m.x1171 <= 50)
m.c1174 = Constraint(expr= m.x1172 <= 50)
m.c1175 = Constraint(expr= m.x1173 <= 50)
m.c1176 = Constraint(expr= m.x1174 <= 100)
m.c1177 = Constraint(expr= m.x1175 <= 100)
m.c1178 = Constraint(expr= m.x1176 <= 100)
m.c1179 = Constraint(expr= m.x1177 <= 100)
m.c1180 = Constraint(expr= m.x1178 <= 100)
m.c1181 = Constraint(expr= m.x1179 <= 100)
m.c1182 = Constraint(expr= m.x1180 <= 100)
m.c1183 = Constraint(expr= m.x1181 <= 100)
m.c1184 = Constraint(expr= m.x1182 <= 100)
m.c1185 = Constraint(expr= m.x1183 <= 100)
m.c1186 = Constraint(expr= m.x1184 <= 100)
m.c1187 = Constraint(expr= m.x1185 <= 100)
m.c1188 = Constraint(expr= m.x1186 <= 100)
m.c1189 = Constraint(expr= m.x1187 <= 100)
m.c1190 = Constraint(expr= m.x1188 <= 100)
m.c1191 = Constraint(expr= m.x1189 <= 100)
m.c1192 = Constraint(expr= m.x1190 <= 100)
m.c1193 = Constraint(expr= m.x1191 <= 100)
m.c1194 = Constraint(expr= m.x1192 <= 100)
m.c1195 = Constraint(expr= m.x1193 <= 100)
m.c1196 = Constraint(expr= m.x1194 <= 100)
m.c1197 = Constraint(expr= m.x1195 <= 100)
m.c1198 = Constraint(expr= m.x1196 <= 100)
m.c1199 = Constraint(expr= m.x1197 <= 100)
m.c1200 = Constraint(expr= m.x1198 <= 100)
m.c1201 = Constraint(expr= m.x1199 <= 100)
m.c1202 = Constraint(expr= m.x1200 <= 100)
m.c1203 = Constraint(expr= m.x1201 <= 100)
m.c1204 = Constraint(expr= m.x1202 <= 100)
m.c1205 = Constraint(expr= m.x1203 <= 100)
m.c1206 = Constraint(expr= m.x1204 <= 100)
m.c1207 = Constraint(expr= m.x1205 <= 100)
m.c1208 = Constraint(expr= m.x1206 <= 100)
m.c1209 = Constraint(expr= m.x1207 <= 100)
m.c1210 = Constraint(expr= m.x1208 <= 100)
m.c1211 = Constraint(expr= m.x1209 <= 100)
m.c1212 = Constraint(expr= m.x1210 <= 100)
m.c1213 = Constraint(expr= m.x1211 <= 100)
m.c1214 = Constraint(expr= m.x1212 <= 100)
m.c1215 = Constraint(expr= m.x1213 <= 100)
m.c1216 = Constraint(expr= m.x1214 <= 100)
m.c1217 = Constraint(expr= m.x1215 <= 100)
m.c1218 = Constraint(expr= m.x1230 <= 50)
m.c1219 = Constraint(expr= m.x1231 <= 50)
m.c1220 = Constraint(expr= m.x1232 <= 50)
m.c1221 = Constraint(expr= m.x1233 <= 50)
m.c1222 = Constraint(expr= m.x1234 <= 50)
m.c1223 = Constraint(expr= m.x1235 <= 50)
m.c1224 = Constraint(expr= m.x1236 <= 50)
m.c1225 = Constraint(expr= m.x1237 <= 50)
m.c1226 = Constraint(expr= m.x1238 <= 50)
m.c1227 = Constraint(expr= m.x1239 <= 50)
m.c1228 = Constraint(expr= m.x1240 <= 50)
m.c1229 = Constraint(expr= m.x1241 <= 50)
m.c1230 = Constraint(expr= m.x1242 <= 50)
m.c1231 = Constraint(expr= m.x1243 <= 50)
m.c1232 = Constraint(expr= m.x1244 <= 50)
m.c1233 = Constraint(expr= m.x1245 <= 50)
m.c1234 = Constraint(expr= m.x1246 <= 50)
m.c1235 = Constraint(expr= m.x1247 <= 50)
m.c1236 = Constraint(expr= m.x1248 <= 50)
m.c1237 = Constraint(expr= m.x1249 <= 50)
m.c1238 = Constraint(expr= m.x1250 <= 50)
m.c1239 = Constraint(expr= m.x1251 <= 100)
m.c1240 = Constraint(expr= m.x1252 <= 100)
m.c1241 = Constraint(expr= m.x1253 <= 100)
m.c1242 = Constraint(expr= m.x1254 <= 100)
m.c1243 = Constraint(expr= m.x1255 <= 100)
m.c1244 = Constraint(expr= m.x1256 <= 100)
m.c1245 = Constraint(expr= m.x1257 <= 100)
m.c1246 = Constraint(expr= m.x1258 <= 100)
m.c1247 = Constraint(expr= m.x1259 <= 100)
m.c1248 = Constraint(expr= m.x1260 <= 100)
m.c1249 = Constraint(expr= m.x1261 <= 100)
m.c1250 = Constraint(expr= m.x1262 <= 100)
m.c1251 = Constraint(expr= m.x1263 <= 100)
m.c1252 = Constraint(expr= m.x1264 <= 100)
m.c1253 = Constraint(expr= m.x1265 <= 100)
m.c1254 = Constraint(expr= m.x1266 <= 100)
m.c1255 = Constraint(expr= m.x1267 <= 100)
m.c1256 = Constraint(expr= m.x1268 <= 100)
m.c1257 = Constraint(expr= m.x1269 <= 100)
m.c1258 = Constraint(expr= m.x1270 <= 100)
m.c1259 = Constraint(expr= m.x1271 <= 100)
m.c1260 = Constraint(expr= m.x1272 <= 100)
m.c1261 = Constraint(expr= m.x1273 <= 100)
m.c1262 = Constraint(expr= m.x1274 <= 100)
m.c1263 = Constraint(expr= m.x1275 <= 100)
m.c1264 = Constraint(expr= m.x1276 <= 100)
m.c1265 = Constraint(expr= m.x1277 <= 100)
m.c1266 = Constraint(expr= m.x1278 <= 100)
m.c1267 = Constraint(expr= m.x1279 <= 100)
m.c1268 = Constraint(expr= m.x1280 <= 100)
m.c1269 = Constraint(expr= m.x1281 <= 100)
m.c1270 = Constraint(expr= m.x1282 <= 100)
m.c1271 = Constraint(expr= m.x1283 <= 100)
m.c1272 = Constraint(expr= m.x1284 <= 100)
m.c1273 = Constraint(expr= m.x1285 <= 100)
m.c1274 = Constraint(expr= m.x1286 <= 100)
m.c1275 = Constraint(expr= m.x1287 <= 100)
m.c1276 = Constraint(expr= m.x1288 <= 100)
m.c1277 = Constraint(expr= m.x1289 <= 100)
m.c1278 = Constraint(expr= m.x1290 <= 100)
m.c1279 = Constraint(expr= m.x1291 <= 100)
m.c1280 = Constraint(expr= m.x1292 <= 100)
m.c1281 = Constraint(expr= m.x1307 <= 50)
m.c1282 = Constraint(expr= m.x1308 <= 50)
m.c1283 = Constraint(expr= m.x1309 <= 50)
m.c1284 = Constraint(expr= m.x1310 <= 50)
m.c1285 = Constraint(expr= m.x1311 <= 50)
m.c1286 = Constraint(expr= m.x1312 <= 50)
m.c1287 = Constraint(expr= m.x1313 <= 50)
m.c1288 = Constraint(expr= m.x1314 <= 50)
m.c1289 = Constraint(expr= m.x1315 <= 50)
m.c1290 = Constraint(expr= m.x1316 <= 50)
m.c1291 = Constraint(expr= m.x1317 <= 50)
m.c1292 = Constraint(expr= m.x1318 <= 50)
m.c1293 = Constraint(expr= m.x1319 <= 50)
m.c1294 = Constraint(expr= m.x1320 <= 50)
m.c1295 = Constraint(expr= m.x1321 <= 50)
m.c1296 = Constraint(expr= m.x1322 <= 50)
m.c1297 = Constraint(expr= m.x1323 <= 50)
m.c1298 = Constraint(expr= m.x1324 <= 50)
m.c1299 = Constraint(expr= m.x1325 <= 50)
m.c1300 = Constraint(expr= m.x1326 <= 50)
m.c1301 = Constraint(expr= m.x1327 <= 50)
m.c1302 = Constraint(expr= m.x1328 <= 100)
m.c1303 = Constraint(expr= m.x1329 <= 100)
m.c1304 = Constraint(expr= m.x1330 <= 100)
m.c1305 = Constraint(expr= m.x1331 <= 100)
m.c1306 = Constraint(expr= m.x1332 <= 100)
m.c1307 = Constraint(expr= m.x1333 <= 100)
m.c1308 = Constraint(expr= m.x1334 <= 100)
m.c1309 = Constraint(expr= m.x1335 <= 100)
m.c1310 = Constraint(expr= m.x1336 <= 100)
m.c1311 = Constraint(expr= m.x1337 <= 100)
m.c1312 = Constraint(expr= m.x1338 <= 100)
m.c1313 = Constraint(expr= m.x1339 <= 100)
m.c1314 = Constraint(expr= m.x1340 <= 100)
m.c1315 = Constraint(expr= m.x1341 <= 100)
m.c1316 = Constraint(expr= m.x1342 <= 100)
m.c1317 = Constraint(expr= m.x1343 <= 100)
m.c1318 = Constraint(expr= m.x1344 <= 100)
m.c1319 = Constraint(expr= m.x1345 <= 100)
m.c1320 = Constraint(expr= m.x1346 <= 100)
m.c1321 = Constraint(expr= m.x1347 <= 100)
m.c1322 = Constraint(expr= m.x1348 <= 100)
m.c1323 = Constraint(expr= m.x1349 <= 100)
m.c1324 = Constraint(expr= m.x1350 <= 100)
m.c1325 = Constraint(expr= m.x1351 <= 100)
m.c1326 = Constraint(expr= m.x1352 <= 100)
m.c1327 = Constraint(expr= m.x1353 <= 100)
m.c1328 = Constraint(expr= m.x1354 <= 100)
m.c1329 = Constraint(expr= m.x1355 <= 100)
m.c1330 = Constraint(expr= m.x1356 <= 100)
m.c1331 = Constraint(expr= m.x1357 <= 100)
m.c1332 = Constraint(expr= m.x1358 <= 100)
m.c1333 = Constraint(expr= m.x1359 <= 100)
m.c1334 = Constraint(expr= m.x1360 <= 100)
m.c1335 = Constraint(expr= m.x1361 <= 100)
m.c1336 = Constraint(expr= m.x1362 <= 100)
m.c1337 = Constraint(expr= m.x1363 <= 100)
m.c1338 = Constraint(expr= m.x1364 <= 100)
m.c1339 = Constraint(expr= m.x1365 <= 100)
m.c1340 = Constraint(expr= m.x1366 <= 100)
m.c1341 = Constraint(expr= m.x1367 <= 100)
m.c1342 = Constraint(expr= m.x1368 <= 100)
m.c1343 = Constraint(expr= m.x1369 <= 100)
m.c1344 = Constraint(expr= m.x1384 <= 50)
m.c1345 = Constraint(expr= m.x1385 <= 50)
m.c1346 = Constraint(expr= m.x1386 <= 50)
m.c1347 = Constraint(expr= m.x1387 <= 50)
m.c1348 = Constraint(expr= m.x1388 <= 50)
m.c1349 = Constraint(expr= m.x1389 <= 50)
m.c1350 = Constraint(expr= m.x1390 <= 50)
m.c1351 = Constraint(expr= m.x1391 <= 50)
m.c1352 = Constraint(expr= m.x1392 <= 50)
m.c1353 = Constraint(expr= m.x1393 <= 50)
m.c1354 = Constraint(expr= m.x1394 <= 50)
m.c1355 = Constraint(expr= m.x1395 <= 50)
m.c1356 = Constraint(expr= m.x1396 <= 50)
m.c1357 = Constraint(expr= m.x1397 <= 50)
m.c1358 = Constraint(expr= m.x1398 <= 50)
m.c1359 = Constraint(expr= m.x1399 <= 50)
m.c1360 = Constraint(expr= m.x1400 <= 50)
m.c1361 = Constraint(expr= m.x1401 <= 50)
m.c1362 = Constraint(expr= m.x1402 <= 50)
m.c1363 = Constraint(expr= m.x1403 <= 50)
m.c1364 = Constraint(expr= m.x1404 <= 50)
m.c1365 = Constraint(expr= m.x1405 <= 100)
m.c1366 = Constraint(expr= m.x1406 <= 100)
m.c1367 = Constraint(expr= m.x1407 <= 100)
m.c1368 = Constraint(expr= m.x1408 <= 100)
m.c1369 = Constraint(expr= m.x1409 <= 100)
m.c1370 = Constraint(expr= m.x1410 <= 100)
m.c1371 = Constraint(expr= m.x1411 <= 100)
m.c1372 = Constraint(expr= m.x1412 <= 100)
m.c1373 = Constraint(expr= m.x1413 <= 100)
m.c1374 = Constraint(expr= m.x1414 <= 100)
m.c1375 = Constraint(expr= m.x1415 <= 100)
m.c1376 = Constraint(expr= m.x1416 <= 100)
m.c1377 = Constraint(expr= m.x1417 <= 100)
m.c1378 = Constraint(expr= m.x1418 <= 100)
m.c1379 = Constraint(expr= m.x1419 <= 100)
m.c1380 = Constraint(expr= m.x1420 <= 100)
m.c1381 = Constraint(expr= m.x1421 <= 100)
m.c1382 = Constraint(expr= m.x1422 <= 100)
m.c1383 = Constraint(expr= m.x1423 <= 100)
m.c1384 = Constraint(expr= m.x1424 <= 100)
m.c1385 = Constraint(expr= m.x1425 <= 100)
m.c1386 = Constraint(expr= m.x1426 <= 100)
m.c1387 = Constraint(expr= m.x1427 <= 100)
m.c1388 = Constraint(expr= m.x1428 <= 100)
m.c1389 = Constraint(expr= m.x1429 <= 100)
m.c1390 = Constraint(expr= m.x1430 <= 100)
m.c1391 = Constraint(expr= m.x1431 <= 100)
m.c1392 = Constraint(expr= m.x1432 <= 100)
m.c1393 = Constraint(expr= m.x1433 <= 100)
m.c1394 = Constraint(expr= m.x1434 <= 100)
m.c1395 = Constraint(expr= m.x1435 <= 100)
m.c1396 = Constraint(expr= m.x1436 <= 100)
m.c1397 = Constraint(expr= m.x1437 <= 100)
m.c1398 = Constraint(expr= m.x1438 <= 100)
m.c1399 = Constraint(expr= m.x1439 <= 100)
m.c1400 = Constraint(expr= m.x1440 <= 100)
m.c1401 = Constraint(expr= m.x1441 <= 100)
m.c1402 = Constraint(expr= m.x1442 <= 100)
m.c1403 = Constraint(expr= m.x1443 <= 100)
m.c1404 = Constraint(expr= m.x1444 <= 100)
m.c1405 = Constraint(expr= m.x1445 <= 100)
m.c1406 = Constraint(expr= m.x1446 <= 100)
m.c1407 = Constraint(expr= m.x1461 <= 50)
m.c1408 = Constraint(expr= m.x1462 <= 50)
m.c1409 = Constraint(expr= m.x1463 <= 50)
m.c1410 = Constraint(expr= m.x1464 <= 50)
m.c1411 = Constraint(expr= m.x1465 <= 50)
m.c1412 = Constraint(expr= m.x1466 <= 50)
m.c1413 = Constraint(expr= m.x1467 <= 50)
m.c1414 = Constraint(expr= m.x1468 <= 50)
m.c1415 = Constraint(expr= m.x1469 <= 50)
m.c1416 = Constraint(expr= m.x1470 <= 50)
m.c1417 = Constraint(expr= m.x1471 <= 50)
m.c1418 = Constraint(expr= m.x1472 <= 50)
m.c1419 = Constraint(expr= m.x1473 <= 50)
m.c1420 = Constraint(expr= m.x1474 <= 50)
m.c1421 = Constraint(expr= m.x1475 <= 50)
m.c1422 = Constraint(expr= m.x1476 <= 50)
m.c1423 = Constraint(expr= m.x1477 <= 50)
m.c1424 = Constraint(expr= m.x1478 <= 50)
m.c1425 = Constraint(expr= m.x1479 <= 50)
m.c1426 = Constraint(expr= m.x1480 <= 50)
m.c1427 = Constraint(expr= m.x1481 <= 50)
m.c1428 = Constraint(expr= m.x1482 <= 100)
m.c1429 = Constraint(expr= m.x1483 <= 100)
m.c1430 = Constraint(expr= m.x1484 <= 100)
m.c1431 = Constraint(expr= m.x1485 <= 100)
m.c1432 = Constraint(expr= m.x1486 <= 100)
m.c1433 = Constraint(expr= m.x1487 <= 100)
m.c1434 = Constraint(expr= m.x1488 <= 100)
m.c1435 = Constraint(expr= m.x1489 <= 100)
m.c1436 = Constraint(expr= m.x1490 <= 100)
m.c1437 = Constraint(expr= m.x1491 <= 100)
m.c1438 = Constraint(expr= m.x1492 <= 100)
m.c1439 = Constraint(expr= m.x1493 <= 100)
m.c1440 = Constraint(expr= m.x1494 <= 100)
m.c1441 = Constraint(expr= m.x1495 <= 100)
m.c1442 = Constraint(expr= m.x1496 <= 100)
m.c1443 = Constraint(expr= m.x1497 <= 100)
m.c1444 = Constraint(expr= m.x1498 <= 100)
m.c1445 = Constraint(expr= m.x1499 <= 100)
m.c1446 = Constraint(expr= m.x1500 <= 100)
m.c1447 = Constraint(expr= m.x1501 <= 100)
m.c1448 = Constraint(expr= m.x1502 <= 100)
m.c1449 = Constraint(expr= m.x1503 <= 100)
m.c1450 = Constraint(expr= m.x1504 <= 100)
m.c1451 = Constraint(expr= m.x1505 <= 100)
m.c1452 = Constraint(expr= m.x1506 <= 100)
m.c1453 = Constraint(expr= m.x1507 <= 100)
m.c1454 = Constraint(expr= m.x1508 <= 100)
m.c1455 = Constraint(expr= m.x1509 <= 100)
m.c1456 = Constraint(expr= m.x1510 <= 100)
m.c1457 = Constraint(expr= m.x1511 <= 100)
m.c1458 = Constraint(expr= m.x1512 <= 100)
m.c1459 = Constraint(expr= m.x1513 <= 100)
m.c1460 = Constraint(expr= m.x1514 <= 100)
m.c1461 = Constraint(expr= m.x1515 <= 100)
m.c1462 = Constraint(expr= m.x1516 <= 100)
m.c1463 = Constraint(expr= m.x1517 <= 100)
m.c1464 = Constraint(expr= m.x1518 <= 100)
m.c1465 = Constraint(expr= m.x1519 <= 100)
m.c1466 = Constraint(expr= m.x1520 <= 100)
m.c1467 = Constraint(expr= m.x1521 <= 100)
m.c1468 = Constraint(expr= m.x1522 <= 100)
m.c1469 = Constraint(expr= m.x1523 <= 100)
m.c1470 = Constraint(expr= m.x1010 - m.x1076 - m.x1077 - m.x1078 - m.x1079 - m.x1080 - m.x1081 - m.x1082 == 0)
m.c1471 = Constraint(expr= m.x1011 - m.x1083 - m.x1084 - m.x1085 - m.x1086 - m.x1087 - m.x1088 - m.x1089 == 0)
m.c1472 = Constraint(expr= m.x1012 - m.x1090 - m.x1091 - m.x1092 - m.x1093 - m.x1094 - m.x1095 - m.x1096 == 0)
m.c1473 = Constraint(expr= m.x1013 - m.x1097 - m.x1098 - m.x1099 - m.x1100 - m.x1101 - m.x1102 - m.x1103 == 0)
m.c1474 = Constraint(expr= m.x1014 - m.x1104 - m.x1105 - m.x1106 - m.x1107 - m.x1108 - m.x1109 - m.x1110 == 0)
m.c1475 = Constraint(expr= m.x1015 - m.x1111 - m.x1112 - m.x1113 - m.x1114 - m.x1115 - m.x1116 - m.x1117 == 0)
m.c1476 = Constraint(expr= m.x1016 - m.x1118 - m.x1119 - m.x1120 - m.x1121 - m.x1122 - m.x1123 - m.x1124 == 0)
m.c1477 = Constraint(expr= m.x1017 - m.x1125 - m.x1126 - m.x1127 - m.x1128 - m.x1129 - m.x1130 - m.x1131 == 0)
m.c1478 = Constraint(expr= m.x1018 - m.x1132 - m.x1133 - m.x1134 - m.x1135 - m.x1136 - m.x1137 - m.x1138 == 0)
m.c1479 = Constraint(expr= m.x1019 - m.x1139 - m.x1140 - m.x1141 - m.x1142 - m.x1143 - m.x1144 - m.x1145 == 0)
m.c1480 = Constraint(expr= m.x1020 - m.x1146 - m.x1147 - m.x1148 - m.x1149 - m.x1150 - m.x1151 - m.x1152 == 0)
m.c1481 = Constraint(expr= m.x1021 - m.x1153 - m.x1154 - m.x1155 - m.x1156 - m.x1157 - m.x1158 - m.x1159 == 0)
m.c1482 = Constraint(expr= m.x1022 - m.x1160 - m.x1161 - m.x1162 - m.x1163 - m.x1164 - m.x1165 - m.x1166 == 0)
m.c1483 = Constraint(expr= m.x1023 - m.x1167 - m.x1168 - m.x1169 - m.x1170 - m.x1171 - m.x1172 - m.x1173 == 0)
m.c1484 = Constraint(expr= m.x1024 - m.x1174 - m.x1175 - m.x1176 - m.x1177 - m.x1178 - m.x1179 - m.x1180 == 0)
m.c1485 = Constraint(expr= m.x1025 - m.x1181 - m.x1182 - m.x1183 - m.x1184 - m.x1185 - m.x1186 - m.x1187 == 0)
m.c1486 = Constraint(expr= m.x1026 - m.x1188 - m.x1189 - m.x1190 - m.x1191 - m.x1192 - m.x1193 - m.x1194 == 0)
m.c1487 = Constraint(expr= m.x1027 - m.x1195 - m.x1196 - m.x1197 - m.x1198 - m.x1199 - m.x1200 - m.x1201 == 0)
m.c1488 = Constraint(expr= m.x1028 - m.x1202 - m.x1203 - m.x1204 - m.x1205 - m.x1206 - m.x1207 - m.x1208 == 0)
m.c1489 = Constraint(expr= m.x1029 - m.x1209 - m.x1210 - m.x1211 - m.x1212 - m.x1213 - m.x1214 - m.x1215 == 0)
m.c1490 = Constraint(expr= m.x1030 - m.x1216 - m.x1217 - m.x1218 - m.x1219 - m.x1220 - m.x1221 - m.x1222 == 0)
m.c1491 = Constraint(expr= m.x1031 - m.x1223 - m.x1224 - m.x1225 - m.x1226 - m.x1227 - m.x1228 - m.x1229 == 0)
m.c1492 = Constraint(expr= m.x1032 - m.x1230 - m.x1231 - m.x1232 - m.x1233 - m.x1234 - m.x1235 - m.x1236 == 0)
m.c1493 = Constraint(expr= m.x1033 - m.x1237 - m.x1238 - m.x1239 - m.x1240 - m.x1241 - m.x1242 - m.x1243 == 0)
m.c1494 = Constraint(expr= m.x1034 - m.x1244 - m.x1245 - m.x1246 - m.x1247 - m.x1248 - m.x1249 - m.x1250 == 0)
m.c1495 = Constraint(expr= m.x1035 - m.x1251 - m.x1252 - m.x1253 - m.x1254 - m.x1255 - m.x1256 - m.x1257 == 0)
m.c1496 = Constraint(expr= m.x1036 - m.x1258 - m.x1259 - m.x1260 - m.x1261 - m.x1262 - m.x1263 - m.x1264 == 0)
m.c1497 = Constraint(expr= m.x1037 - m.x1265 - m.x1266 - m.x1267 - m.x1268 - m.x1269 - m.x1270 - m.x1271 == 0)
m.c1498 = Constraint(expr= m.x1038 - m.x1272 - m.x1273 - m.x1274 - m.x1275 - m.x1276 - m.x1277 - m.x1278 == 0)
m.c1499 = Constraint(expr= m.x1039 - m.x1279 - m.x1280 - m.x1281 - m.x1282 - m.x1283 - m.x1284 - m.x1285 == 0)
m.c1500 = Constraint(expr= m.x1040 - m.x1286 - m.x1287 - m.x1288 - m.x1289 - m.x1290 - m.x1291 - m.x1292 == 0)
m.c1501 = Constraint(expr= m.x1041 - m.x1293 - m.x1294 - m.x1295 - m.x1296 - m.x1297 - m.x1298 - m.x1299 == 0)
m.c1502 = Constraint(expr= m.x1042 - m.x1300 - m.x1301 - m.x1302 - m.x1303 - m.x1304 - m.x1305 - m.x1306 == 0)
m.c1503 = Constraint(expr= m.x1043 - m.x1307 - m.x1308 - m.x1309 - m.x1310 - m.x1311 - m.x1312 - m.x1313 == 0)
m.c1504 = Constraint(expr= m.x1044 - m.x1314 - m.x1315 - m.x1316 - m.x1317 - m.x1318 - m.x1319 - m.x1320 == 0)
m.c1505 = Constraint(expr= m.x1045 - m.x1321 - m.x1322 - m.x1323 - m.x1324 - m.x1325 - m.x1326 - m.x1327 == 0)
m.c1506 = Constraint(expr= m.x1046 - m.x1328 - m.x1329 - m.x1330 - m.x1331 - m.x1332 - m.x1333 - m.x1334 == 0)
m.c1507 = Constraint(expr= m.x1047 - m.x1335 - m.x1336 - m.x1337 - m.x1338 - m.x1339 - m.x1340 - m.x1341 == 0)
m.c1508 = Constraint(expr= m.x1048 - m.x1342 - m.x1343 - m.x1344 - m.x1345 - m.x1346 - m.x1347 - m.x1348 == 0)
m.c1509 = Constraint(expr= m.x1049 - m.x1349 - m.x1350 - m.x1351 - m.x1352 - m.x1353 - m.x1354 - m.x1355 == 0)
m.c1510 = Constraint(expr= m.x1050 - m.x1356 - m.x1357 - m.x1358 - m.x1359 - m.x1360 - m.x1361 - m.x1362 == 0)
m.c1511 = Constraint(expr= m.x1051 - m.x1363 - m.x1364 - m.x1365 - m.x1366 - m.x1367 - m.x1368 - m.x1369 == 0)
m.c1512 = Constraint(expr= m.x1052 - m.x1370 - m.x1371 - m.x1372 - m.x1373 - m.x1374 - m.x1375 - m.x1376 == 0)
m.c1513 = Constraint(expr= m.x1053 - m.x1377 - m.x1378 - m.x1379 - m.x1380 - m.x1381 - m.x1382 - m.x1383 == 0)
m.c1514 = Constraint(expr= m.x1054 - m.x1384 - m.x1385 - m.x1386 - m.x1387 - m.x1388 - m.x1389 - m.x1390 == 0)
m.c1515 = Constraint(expr= m.x1055 - m.x1391 - m.x1392 - m.x1393 - m.x1394 - m.x1395 - m.x1396 - m.x1397 == 0)
m.c1516 = Constraint(expr= m.x1056 - m.x1398 - m.x1399 - m.x1400 - m.x1401 - m.x1402 - m.x1403 - m.x1404 == 0)
m.c1517 = Constraint(expr= m.x1057 - m.x1405 - m.x1406 - m.x1407 - m.x1408 - m.x1409 - m.x1410 - m.x1411 == 0)
m.c1518 = Constraint(expr= m.x1058 - m.x1412 - m.x1413 - m.x1414 - m.x1415 - m.x1416 - m.x1417 - m.x1418 == 0)
m.c1519 = Constraint(expr= m.x1059 - m.x1419 - m.x1420 - m.x1421 - m.x1422 - m.x1423 - m.x1424 - m.x1425 == 0)
m.c1520 = Constraint(expr= m.x1060 - m.x1426 - m.x1427 - m.x1428 - m.x1429 - m.x1430 - m.x1431 - m.x1432 == 0)
m.c1521 = Constraint(expr= m.x1061 - m.x1433 - m.x1434 - m.x1435 - m.x1436 - m.x1437 - m.x1438 - m.x1439 == 0)
m.c1522 = Constraint(expr= m.x1062 - m.x1440 - m.x1441 - m.x1442 - m.x1443 - m.x1444 - m.x1445 - m.x1446 == 0)
m.c1523 = Constraint(expr= m.x1063 - m.x1447 - m.x1448 - m.x1449 - m.x1450 - m.x1451 - m.x1452 - m.x1453 == 0)
m.c1524 = Constraint(expr= m.x1064 - m.x1454 - m.x1455 - m.x1456 - m.x1457 - m.x1458 - m.x1459 - m.x1460 == 0)
m.c1525 = Constraint(expr= m.x1065 - m.x1461 - m.x1462 - m.x1463 - m.x1464 - m.x1465 - m.x1466 - m.x1467 == 0)
m.c1526 = Constraint(expr= m.x1066 - m.x1468 - m.x1469 - m.x1470 - m.x1471 - m.x1472 - m.x1473 - m.x1474 == 0)
m.c1527 = Constraint(expr= m.x1067 - m.x1475 - m.x1476 - m.x1477 - m.x1478 - m.x1479 - m.x1480 - m.x1481 == 0)
m.c1528 = Constraint(expr= m.x1068 - m.x1482 - m.x1483 - m.x1484 - m.x1485 - m.x1486 - m.x1487 - m.x1488 == 0)
m.c1529 = Constraint(expr= m.x1069 - m.x1489 - m.x1490 - m.x1491 - m.x1492 - m.x1493 - m.x1494 - m.x1495 == 0)
m.c1530 = Constraint(expr= m.x1070 - m.x1496 - m.x1497 - m.x1498 - m.x1499 - m.x1500 - m.x1501 - m.x1502 == 0)
m.c1531 = Constraint(expr= m.x1071 - m.x1503 - m.x1504 - m.x1505 - m.x1506 - m.x1507 - m.x1508 - m.x1509 == 0)
m.c1532 = Constraint(expr= m.x1072 - m.x1510 - m.x1511 - m.x1512 - m.x1513 - m.x1514 - m.x1515 - m.x1516 == 0)
m.c1533 = Constraint(expr= m.x1073 - m.x1517 - m.x1518 - m.x1519 - m.x1520 - m.x1521 - m.x1522 - m.x1523 == 0)
m.c1534 = Constraint(expr= m.x1074 - m.x1524 - m.x1525 - m.x1526 - m.x1527 - m.x1528 - m.x1529 - m.x1530 == 0)
m.c1535 = Constraint(expr= m.x1075 - m.x1531 - m.x1532 - m.x1533 - m.x1534 - m.x1535 - m.x1536 - m.x1537 == 0)
m.c1536 = Constraint(expr= m.x1010 == 50)
m.c1537 = Constraint(expr= m.x1011 == 50)
m.c1538 = Constraint(expr= m.x1012 == 50)
m.c1539 = Constraint(expr= m.x1013 == 20)
m.c1540 = Constraint(expr= m.x1014 == 20)
m.c1541 = Constraint(expr= m.x1015 == 20)
m.c1542 = Constraint(expr= m.x1016 == 30)
m.c1543 = Constraint(expr= m.x1017 == 50)
m.c1544 = Constraint(expr= m.x1018 == 30)
m.c1545 = Constraint(expr= m.x1019 == 0)
m.c1546 = Constraint(expr= m.x1020 == 0)
m.c1547 = Constraint(expr= m.x338 + m.x1021 == 50)
m.c1548 = Constraint(expr= m.x339 + m.x1022 == 50)
m.c1549 = Constraint(expr= m.x340 + m.x1023 == 50)
m.c1550 = Constraint(expr= - m.x338 + m.x341 + m.x342 + m.x1024 == 20)
m.c1551 = Constraint(expr= - m.x339 + m.x343 + m.x344 + m.x345 + m.x1025 == 20)
m.c1552 = Constraint(expr= - m.x340 + m.x346 + m.x347 + m.x1026 == 20)
m.c1553 = Constraint(expr= - m.x341 - m.x343 + m.x348 + m.x1027 == 30)
m.c1554 = Constraint(expr= - m.x342 - m.x344 - m.x346 + m.x349 + m.x350 + m.x1028 == 50)
m.c1555 = Constraint(expr= - m.x345 - m.x347 + m.x351 + m.x1029 == 30)
m.c1556 = Constraint(expr= - m.x348 - m.x349 + m.x1030 == 0)
m.c1557 = Constraint(expr= - m.x350 - m.x351 + m.x1031 == 0)
m.c1558 = Constraint(expr= m.x338 + m.x352 + m.x1032 == 50)
m.c1559 = Constraint(expr= m.x339 + m.x353 + m.x1033 == 50)
m.c1560 = Constraint(expr= m.x340 + m.x354 + m.x1034 == 50)
m.c1561 = Constraint(expr= - m.x338 + m.x341 + m.x342 - m.x352 + m.x355 + m.x356 + m.x1035 == 20)
m.c1562 = Constraint(expr= - m.x339 + m.x343 + m.x344 + m.x345 - m.x353 + m.x357 + m.x358 + m.x359 + m.x1036 == 20)
m.c1563 = Constraint(expr= - m.x340 + m.x346 + m.x347 - m.x354 + m.x360 + m.x361 + m.x1037 == 20)
m.c1564 = Constraint(expr= - m.x341 - m.x343 + m.x348 - m.x355 - m.x357 + m.x362 + m.x1038 == 30)
m.c1565 = Constraint(expr= - m.x342 - m.x344 - m.x346 + m.x349 + m.x350 - m.x356 - m.x358 - m.x360 + m.x363 + m.x364
+ m.x1039 == 50)
m.c1566 = Constraint(expr= - m.x345 - m.x347 + m.x351 - m.x359 - m.x361 + m.x365 + m.x1040 == 30)
m.c1567 = Constraint(expr= - m.x348 - m.x349 - m.x362 - m.x363 + m.x1041 == 0)
m.c1568 = Constraint(expr= - m.x350 - m.x351 - m.x364 - m.x365 + m.x1042 == 0)
m.c1569 = Constraint(expr= m.x338 + m.x352 + m.x366 + m.x1043 == 50)
m.c1570 = Constraint(expr= m.x339 + m.x353 + m.x367 + m.x1044 == 50)
m.c1571 = Constraint(expr= m.x340 + m.x354 + m.x368 + m.x1045 == 50)
m.c1572 = Constraint(expr= - m.x338 + m.x341 + m.x342 - m.x352 + m.x355 + m.x356 - m.x366 + m.x369 + m.x370 + m.x1046
== 20)
m.c1573 = Constraint(expr= - m.x339 + m.x343 + m.x344 + m.x345 - m.x353 + m.x357 + m.x358 + m.x359 - m.x367 + m.x371
+ m.x372 + m.x373 + m.x1047 == 20)
m.c1574 = Constraint(expr= - m.x340 + m.x346 + m.x347 - m.x354 + m.x360 + m.x361 - m.x368 + m.x374 + m.x375 + m.x1048
== 20)
m.c1575 = Constraint(expr= - m.x341 - m.x343 + m.x348 - m.x355 - m.x357 + m.x362 - m.x369 - m.x371 + m.x376 + m.x1049
== 30)
m.c1576 = Constraint(expr= - m.x342 - m.x344 - m.x346 + m.x349 + m.x350 - m.x356 - m.x358 - m.x360 + m.x363 + m.x364
- m.x370 - m.x372 - m.x374 + m.x377 + m.x378 + m.x1050 == 50)
m.c1577 = Constraint(expr= - m.x345 - m.x347 + m.x351 - m.x359 - m.x361 + m.x365 - m.x373 - m.x375 + m.x379 + m.x1051
== 30)
m.c1578 = Constraint(expr= - m.x348 - m.x349 - m.x362 - m.x363 - m.x376 - m.x377 + m.x1052 == 0)
m.c1579 = Constraint(expr= - m.x350 - m.x351 - m.x364 - m.x365 - m.x378 - m.x379 + m.x1053 == 0)
m.c1580 = Constraint(expr= m.x338 + m.x352 + m.x366 + m.x380 + m.x1054 == 50)
m.c1581 = Constraint(expr= m.x339 + m.x353 + m.x367 + m.x381 + m.x1055 == 50)
m.c1582 = Constraint(expr= m.x340 + m.x354 + m.x368 + m.x382 + m.x1056 == 50)
m.c1583 = Constraint(expr= - m.x338 + m.x341 + m.x342 - m.x352 + m.x355 + m.x356 - m.x366 + m.x369 + m.x370 - m.x380
+ m.x383 + m.x384 + m.x1057 == 20)
m.c1584 = Constraint(expr= - m.x339 + m.x343 + m.x344 + m.x345 - m.x353 + m.x357 + m.x358 + m.x359 - m.x367 + m.x371
+ m.x372 + m.x373 - m.x381 + m.x385 + m.x386 + m.x387 + m.x1058 == 20)
m.c1585 = Constraint(expr= - m.x340 + m.x346 + m.x347 - m.x354 + m.x360 + m.x361 - m.x368 + m.x374 + m.x375 - m.x382
+ m.x388 + m.x389 + m.x1059 == 20)
m.c1586 = Constraint(expr= - m.x341 - m.x343 + m.x348 - m.x355 - m.x357 + m.x362 - m.x369 - m.x371 + m.x376 - m.x383
- m.x385 + m.x390 + m.x1060 == 30)
m.c1587 = Constraint(expr= - m.x342 - m.x344 - m.x346 + m.x349 + m.x350 - m.x356 - m.x358 - m.x360 + m.x363 + m.x364
- m.x370 - m.x372 - m.x374 + m.x377 + m.x378 - m.x384 - m.x386 - m.x388 + m.x391 + m.x392
+ m.x1061 == 50)
m.c1588 = Constraint(expr= - m.x345 - m.x347 + m.x351 - m.x359 - m.x361 + m.x365 - m.x373 - m.x375 + m.x379 - m.x387
- m.x389 + m.x393 + m.x1062 == 30)
m.c1589 = Constraint(expr= - m.x348 - m.x349 - m.x362 - m.x363 - m.x376 - m.x377 - m.x390 - m.x391 + m.x1063 == 0)
m.c1590 = Constraint(expr= - m.x350 - m.x351 - m.x364 - m.x365 - m.x378 - m.x379 - m.x392 - m.x393 + m.x1064 == 0)
m.c1591 = Constraint(expr= m.x338 + m.x352 + m.x366 + m.x380 + m.x394 + m.x1065 == 50)
m.c1592 = Constraint(expr= m.x339 + m.x353 + m.x367 + m.x381 + m.x395 + m.x1066 == 50)
m.c1593 = Constraint(expr= m.x340 + m.x354 + m.x368 + m.x382 + m.x396 + m.x1067 == 50)
m.c1594 = Constraint(expr= - m.x338 + m.x341 + m.x342 - m.x352 + m.x355 + m.x356 - m.x366 + m.x369 + m.x370 - m.x380
+ m.x383 + m.x384 - m.x394 + m.x397 + m.x398 + m.x1068 == 20)
m.c1595 = Constraint(expr= - m.x339 + m.x343 + m.x344 + m.x345 - m.x353 + m.x357 + m.x358 + m.x359 - m.x367 + m.x371
+ m.x372 + m.x373 - m.x381 + m.x385 + m.x386 + m.x387 - m.x395 + m.x399 + m.x400 + m.x401
+ m.x1069 == 20)
m.c1596 = Constraint(expr= - m.x340 + m.x346 + m.x347 - m.x354 + m.x360 + m.x361 - m.x368 + m.x374 + m.x375 - m.x382
+ m.x388 + m.x389 - m.x396 + m.x402 + m.x403 + m.x1070 == 20)
m.c1597 = Constraint(expr= - m.x341 - m.x343 + m.x348 - m.x355 - m.x357 + m.x362 - m.x369 - m.x371 + m.x376 - m.x383
- m.x385 + m.x390 - m.x397 - m.x399 + m.x404 + m.x1071 == 30)
m.c1598 = Constraint(expr= - m.x342 - m.x344 - m.x346 + m.x349 + m.x350 - m.x356 - m.x358 - m.x360 + m.x363 + m.x364
- m.x370 - m.x372 - m.x374 + m.x377 + m.x378 - m.x384 - m.x386 - m.x388 + m.x391 + m.x392
- m.x398 - m.x400 - m.x402 + m.x405 + m.x406 + m.x1072 == 50)
m.c1599 = Constraint(expr= - m.x345 - m.x347 + m.x351 - m.x359 - m.x361 + m.x365 - m.x373 - m.x375 + m.x379 - m.x387
- m.x389 + m.x393 - m.x401 - m.x403 + m.x407 + m.x1073 == 30)
m.c1600 = Constraint(expr= - m.x348 - m.x349 - m.x362 - m.x363 - m.x376 - m.x377 - m.x390 - m.x391 - m.x404 - m.x405
+ m.x1074 == 0)
m.c1601 = Constraint(expr= - m.x350 - m.x351 - m.x364 - m.x365 - m.x378 - m.x379 - m.x392 - m.x393 - m.x406 - m.x407
+ m.x1075 == 0)
m.c1602 = Constraint(expr= m.x1076 == 50)
m.c1603 = Constraint(expr= m.x1077 == 0)
m.c1604 = Constraint(expr= m.x1078 == 0)
m.c1605 = Constraint(expr= m.x1079 == 0)
m.c1606 = Constraint(expr= m.x1080 == 0)
m.c1607 = Constraint(expr= m.x1081 == 0)
m.c1608 = Constraint(expr= m.x1082 == 0)
m.c1609 = Constraint(expr= m.x1083 == 0)
m.c1610 = Constraint(expr= m.x1084 == 50)
m.c1611 = Constraint(expr= m.x1085 == 0)
m.c1612 = Constraint(expr= m.x1086 == 0)
m.c1613 = Constraint(expr= m.x1087 == 0)
m.c1614 = Constraint(expr= m.x1088 == 0)
m.c1615 = Constraint(expr= m.x1089 == 0)
m.c1616 = Constraint(expr= m.x1090 == 0)
m.c1617 = Constraint(expr= m.x1091 == 0)
m.c1618 = Constraint(expr= m.x1092 == 50)
m.c1619 = Constraint(expr= m.x1093 == 0)
m.c1620 = Constraint(expr= m.x1094 == 0)
m.c1621 = Constraint(expr= m.x1095 == 0)
m.c1622 = Constraint(expr= m.x1096 == 0)
m.c1623 = Constraint(expr= m.x1097 == 0)
m.c1624 = Constraint(expr= m.x1098 == 0)
m.c1625 = Constraint(expr= m.x1099 == 0)
m.c1626 = Constraint(expr= m.x1100 == 20)
m.c1627 = Constraint(expr= m.x1101 == 0)
m.c1628 = Constraint(expr= m.x1102 == 0)
m.c1629 = Constraint(expr= m.x1103 == 0)
m.c1630 = Constraint(expr= m.x1104 == 0)
m.c1631 = Constraint(expr= m.x1105 == 0)
m.c1632 = Constraint(expr= m.x1106 == 0)
m.c1633 = Constraint(expr= m.x1107 == 0)
m.c1634 = Constraint(expr= m.x1108 == 20)
m.c1635 = Constraint(expr= m.x1109 == 0)
m.c1636 = Constraint(expr= m.x1110 == 0)
m.c1637 = Constraint(expr= m.x1111 == 0)
m.c1638 = Constraint(expr= m.x1112 == 0)
m.c1639 = Constraint(expr= m.x1113 == 0)
m.c1640 = Constraint(expr= m.x1114 == 0)
m.c1641 = Constraint(expr= m.x1115 == 0)
m.c1642 = Constraint(expr= m.x1116 == 20)
m.c1643 = Constraint(expr= m.x1117 == 0)
m.c1644 = Constraint(expr= m.x1118 == 0)
m.c1645 = Constraint(expr= m.x1119 == 0)
m.c1646 = Constraint(expr= m.x1120 == 0)
m.c1647 = Constraint(expr= m.x1121 == 0)
m.c1648 = Constraint(expr= m.x1122 == 0)
m.c1649 = Constraint(expr= m.x1123 == 0)
m.c1650 = Constraint(expr= m.x1124 == 30)
m.c1651 = Constraint(expr= m.x1125 == 0)
m.c1652 = Constraint(expr= m.x1126 == 0)
m.c1653 = Constraint(expr= m.x1127 == 0)
m.c1654 = Constraint(expr= m.x1128 == 0)
m.c1655 = Constraint(expr= m.x1129 == 50)
m.c1656 = Constraint(expr= m.x1130 == 0)
m.c1657 = Constraint(expr= m.x1131 == 0)
m.c1658 = Constraint(expr= m.x1132 == 0)
m.c1659 = Constraint(expr= m.x1133 == 0)
m.c1660 = Constraint(expr= m.x1134 == 0)
m.c1661 = Constraint(expr= m.x1135 == 0)
m.c1662 = Constraint(expr= m.x1136 == 0)
m.c1663 = Constraint(expr= m.x1137 == 30)
m.c1664 = Constraint(expr= m.x1138 == 0)
m.c1665 = Constraint(expr= m.x1139 == 0)
m.c1666 = Constraint(expr= m.x1140 == 0)
m.c1667 = Constraint(expr= m.x1141 == 0)
m.c1668 = Constraint(expr= m.x1142 == 0)
m.c1669 = Constraint(expr= m.x1143 == 0)
m.c1670 = Constraint(expr= m.x1144 == 0)
m.c1671 = Constraint(expr= m.x1145 == 0)
m.c1672 = Constraint(expr= m.x1146 == 0)
m.c1673 = Constraint(expr= m.x1147 == 0)
m.c1674 = Constraint(expr= m.x1148 == 0)
m.c1675 = Constraint(expr= m.x1149 == 0)
m.c1676 = Constraint(expr= m.x1150 == 0)
m.c1677 = Constraint(expr= m.x1151 == 0)
m.c1678 = Constraint(expr= m.x1152 == 0)
m.c1679 = Constraint(expr= m.x422 + m.x1153 == 50)
m.c1680 = Constraint(expr= m.x423 + m.x1154 == 0)
m.c1681 = Constraint(expr= m.x424 + m.x1155 == 0)
m.c1682 = Constraint(expr= m.x425 + m.x1156 == 0)
m.c1683 = Constraint(expr= m.x426 + m.x1157 == 0)
m.c1684 = Constraint(expr= m.x427 + m.x1158 == 0)
m.c1685 = Constraint(expr= m.x428 + m.x1159 == 0)
m.c1686 = Constraint(expr= m.x429 + m.x1160 == 0)
m.c1687 = Constraint(expr= m.x430 + m.x1161 == 50)
m.c1688 = Constraint(expr= m.x431 + m.x1162 == 0)
m.c1689 = Constraint(expr= m.x432 + m.x1163 == 0)
m.c1690 = Constraint(expr= m.x433 + m.x1164 == 0)
m.c1691 = Constraint(expr= m.x434 + m.x1165 == 0)
m.c1692 = Constraint(expr= m.x435 + m.x1166 == 0)
m.c1693 = Constraint(expr= m.x436 + m.x1167 == 0)
m.c1694 = Constraint(expr= m.x437 + m.x1168 == 0)
m.c1695 = Constraint(expr= m.x438 + m.x1169 == 50)
m.c1696 = Constraint(expr= m.x439 + m.x1170 == 0)
m.c1697 = Constraint(expr= m.x440 + m.x1171 == 0)
m.c1698 = Constraint(expr= m.x441 + m.x1172 == 0)
m.c1699 = Constraint(expr= m.x442 + m.x1173 == 0)
m.c1700 = Constraint(expr= - m.x422 + m.x443 + m.x450 + m.x1174 == 0)
m.c1701 = Constraint(expr= - m.x423 + m.x444 + m.x451 + m.x1175 == 0)
m.c1702 = Constraint(expr= - m.x424 + m.x445 + m.x452 + m.x1176 == 0)
m.c1703 = Constraint(expr= - m.x425 + m.x446 + m.x453 + m.x1177 == 20)
m.c1704 = Constraint(expr= - m.x426 + m.x447 + m.x454 + m.x1178 == 0)
m.c1705 = Constraint(expr= - m.x427 + m.x448 + m.x455 + m.x1179 == 0)
m.c1706 = Constraint(expr= - m.x428 + m.x449 + m.x456 + m.x1180 == 0)
m.c1707 = Constraint(expr= - m.x429 + m.x457 + m.x464 + m.x471 + m.x1181 == 0)
m.c1708 = Constraint(expr= - m.x430 + m.x458 + m.x465 + m.x472 + m.x1182 == 0)
m.c1709 = Constraint(expr= - m.x431 + m.x459 + m.x466 + m.x473 + m.x1183 == 0)
m.c1710 = Constraint(expr= - m.x432 + m.x460 + m.x467 + m.x474 + m.x1184 == 0)
m.c1711 = Constraint(expr= - m.x433 + m.x461 + m.x468 + m.x475 + m.x1185 == 20)
m.c1712 = Constraint(expr= - m.x434 + m.x462 + m.x469 + m.x476 + m.x1186 == 0)
m.c1713 = Constraint(expr= - m.x435 + m.x463 + m.x470 + m.x477 + m.x1187 == 0)
m.c1714 = Constraint(expr= - m.x436 + m.x478 + m.x485 + m.x1188 == 0)
m.c1715 = Constraint(expr= - m.x437 + m.x479 + m.x486 + m.x1189 == 0)
m.c1716 = Constraint(expr= - m.x438 + m.x480 + m.x487 + m.x1190 == 0)
m.c1717 = Constraint(expr= - m.x439 + m.x481 + m.x488 + m.x1191 == 0)
m.c1718 = Constraint(expr= - m.x440 + m.x482 + m.x489 + m.x1192 == 0)
m.c1719 = Constraint(expr= - m.x441 + m.x483 + m.x490 + m.x1193 == 20)
m.c1720 = Constraint(expr= - m.x442 + m.x484 + m.x491 + m.x1194 == 0)
m.c1721 = Constraint(expr= - m.x443 - m.x457 + m.x492 + m.x1195 == 0)
m.c1722 = Constraint(expr= - m.x444 - m.x458 + m.x493 + m.x1196 == 0)
m.c1723 = Constraint(expr= - m.x445 - m.x459 + m.x494 + m.x1197 == 0)
m.c1724 = Constraint(expr= - m.x446 - m.x460 + m.x495 + m.x1198 == 0)
m.c1725 = Constraint(expr= - m.x447 - m.x461 + m.x496 + m.x1199 == 0)
m.c1726 = Constraint(expr= - m.x448 - m.x462 + m.x497 + m.x1200 == 0)
m.c1727 = Constraint(expr= - m.x449 - m.x463 + m.x498 + m.x1201 == 30)
m.c1728 = Constraint(expr= - m.x450 - m.x464 - m.x478 + m.x499 + m.x506 + m.x1202 == 0)
m.c1729 = Constraint(expr= - m.x451 - m.x465 - m.x479 + m.x500 + m.x507 + m.x1203 == 0)
m.c1730 = Constraint(expr= - m.x452 - m.x466 - m.x480 + m.x501 + m.x508 + m.x1204 == 0)
m.c1731 = Constraint(expr= - m.x453 - m.x467 - m.x481 + m.x502 + m.x509 + m.x1205 == 0)
m.c1732 = Constraint(expr= - m.x454 - m.x468 - m.x482 + m.x503 + m.x510 + m.x1206 == 50)
m.c1733 = Constraint(expr= - m.x455 - m.x469 - m.x483 + m.x504 + m.x511 + m.x1207 == 0)
m.c1734 = Constraint(expr= - m.x456 - m.x470 - m.x484 + m.x505 + m.x512 + m.x1208 == 0)
m.c1735 = Constraint(expr= - m.x471 - m.x485 + m.x513 + m.x1209 == 0)
m.c1736 = Constraint(expr= - m.x472 - m.x486 + m.x514 + m.x1210 == 0)
m.c1737 = Constraint(expr= - m.x473 - m.x487 + m.x515 + m.x1211 == 0)
m.c1738 = Constraint(expr= - m.x474 - m.x488 + m.x516 + m.x1212 == 0)
m.c1739 = Constraint(expr= - m.x475 - m.x489 + m.x517 + m.x1213 == 0)
m.c1740 = Constraint(expr= - m.x476 - m.x490 + m.x518 + m.x1214 == 30)
m.c1741 = Constraint(expr= - m.x477 - m.x491 + m.x519 + m.x1215 == 0)
m.c1742 = Constraint(expr= - m.x492 - m.x499 + m.x1216 == 0)
m.c1743 = Constraint(expr= - m.x493 - m.x500 + m.x1217 == 0)
m.c1744 = Constraint(expr= - m.x494 - m.x501 + m.x1218 == 0)
m.c1745 = Constraint(expr= - m.x495 - m.x502 + m.x1219 == 0)
m.c1746 = Constraint(expr= - m.x496 - m.x503 + m.x1220 == 0)
m.c1747 = Constraint(expr= - m.x497 - m.x504 + m.x1221 == 0)
m.c1748 = Constraint(expr= - m.x498 - m.x505 + m.x1222 == 0)
m.c1749 = Constraint(expr= - m.x506 - m.x513 + m.x1223 == 0)
m.c1750 = Constraint(expr= - m.x507 - m.x514 + m.x1224 == 0)
m.c1751 = Constraint(expr= - m.x508 - m.x515 + m.x1225 == 0)
m.c1752 = Constraint(expr= - m.x509 - m.x516 + m.x1226 == 0)
m.c1753 = Constraint(expr= - m.x510 - m.x517 + m.x1227 == 0)
m.c1754 = Constraint(expr= - m.x511 - m.x518 + m.x1228 == 0)
m.c1755 = Constraint(expr= - m.x512 - m.x519 + m.x1229 == 0)
m.c1756 = Constraint(expr= m.x422 + m.x520 + m.x1230 == 50)
m.c1757 = Constraint(expr= m.x423 + m.x521 + m.x1231 == 0)
m.c1758 = Constraint(expr= m.x424 + m.x522 + m.x1232 == 0)
m.c1759 = Constraint(expr= m.x425 + m.x523 + m.x1233 == 0)
m.c1760 = Constraint(expr= m.x426 + m.x524 + m.x1234 == 0)
m.c1761 = Constraint(expr= m.x427 + m.x525 + m.x1235 == 0)
m.c1762 = Constraint(expr= m.x428 + m.x526 + m.x1236 == 0)
m.c1763 = Constraint(expr= m.x429 + m.x527 + m.x1237 == 0)
m.c1764 = Constraint(expr= m.x430 + m.x528 + m.x1238 == 50)
m.c1765 = Constraint(expr= m.x431 + m.x529 + m.x1239 == 0)
m.c1766 = Constraint(expr= m.x432 + m.x530 + m.x1240 == 0)
m.c1767 = Constraint(expr= m.x433 + m.x531 + m.x1241 == 0)
m.c1768 = Constraint(expr= m.x434 + m.x532 + m.x1242 == 0)
m.c1769 = Constraint(expr= m.x435 + m.x533 + m.x1243 == 0)
m.c1770 = Constraint(expr= m.x436 + m.x534 + m.x1244 == 0)
m.c1771 = Constraint(expr= m.x437 + m.x535 + m.x1245 == 0)
m.c1772 = Constraint(expr= m.x438 + m.x536 + m.x1246 == 50)
m.c1773 = Constraint(expr= m.x439 + m.x537 + m.x1247 == 0)
m.c1774 = Constraint(expr= m.x440 + m.x538 + m.x1248 == 0)
m.c1775 = Constraint(expr= m.x441 + m.x539 + m.x1249 == 0)
m.c1776 = Constraint(expr= m.x442 + m.x540 + m.x1250 == 0)
m.c1777 = Constraint(expr= - m.x422 + m.x443 + m.x450 - m.x520 + m.x541 + m.x548 + m.x1251 == 0)
m.c1778 = Constraint(expr= - m.x423 + m.x444 + m.x451 - m.x521 + m.x542 + m.x549 + m.x1252 == 0)
m.c1779 = Constraint(expr= - m.x424 + m.x445 + m.x452 - m.x522 + m.x543 + m.x550 + m.x1253 == 0)
m.c1780 = Constraint(expr= - m.x425 + m.x446 + m.x453 - m.x523 + m.x544 + m.x551 + m.x1254 == 20)
m.c1781 = Constraint(expr= - m.x426 + m.x447 + m.x454 - m.x524 + m.x545 + m.x552 + m.x1255 == 0)
m.c1782 = Constraint(expr= - m.x427 + m.x448 + m.x455 - m.x525 + m.x546 + m.x553 + m.x1256 == 0)
m.c1783 = Constraint(expr= - m.x428 + m.x449 + m.x456 - m.x526 + m.x547 + m.x554 + m.x1257 == 0)
m.c1784 = Constraint(expr= - m.x429 + m.x457 + m.x464 + m.x471 - m.x527 + m.x555 + m.x562 + m.x569 + m.x1258 == 0)
m.c1785 = Constraint(expr= - m.x430 + m.x458 + m.x465 + m.x472 - m.x528 + m.x556 + m.x563 + m.x570 + m.x1259 == 0)
m.c1786 = Constraint(expr= - m.x431 + m.x459 + m.x466 + m.x473 - m.x529 + m.x557 + m.x564 + m.x571 + m.x1260 == 0)
m.c1787 = Constraint(expr= - m.x432 + m.x460 + m.x467 + m.x474 - m.x530 + m.x558 + m.x565 + m.x572 + m.x1261 == 0)
m.c1788 = Constraint(expr= - m.x433 + m.x461 + m.x468 + m.x475 - m.x531 + m.x559 + m.x566 + m.x573 + m.x1262 == 20)
m.c1789 = Constraint(expr= - m.x434 + m.x462 + m.x469 + m.x476 - m.x532 + m.x560 + m.x567 + m.x574 + m.x1263 == 0)
m.c1790 = Constraint(expr= - m.x435 + m.x463 + m.x470 + m.x477 - m.x533 + m.x561 + m.x568 + m.x575 + m.x1264 == 0)
m.c1791 = Constraint(expr= - m.x436 + m.x478 + m.x485 - m.x534 + m.x576 + m.x583 + m.x1265 == 0)
m.c1792 = Constraint(expr= - m.x437 + m.x479 + m.x486 - m.x535 + m.x577 + m.x584 + m.x1266 == 0)
m.c1793 = Constraint(expr= - m.x438 + m.x480 + m.x487 - m.x536 + m.x578 + m.x585 + m.x1267 == 0)
m.c1794 = Constraint(expr= - m.x439 + m.x481 + m.x488 - m.x537 + m.x579 + m.x586 + m.x1268 == 0)
m.c1795 = Constraint(expr= - m.x440 + m.x482 + m.x489 - m.x538 + m.x580 + m.x587 + m.x1269 == 0)
m.c1796 = Constraint(expr= - m.x441 + m.x483 + m.x490 - m.x539 + m.x581 + m.x588 + m.x1270 == 20)
m.c1797 = Constraint(expr= - m.x442 + m.x484 + m.x491 - m.x540 + m.x582 + m.x589 + m.x1271 == 0)
m.c1798 = Constraint(expr= - m.x443 - m.x457 + m.x492 - m.x541 - m.x555 + m.x590 + m.x1272 == 0)
m.c1799 = Constraint(expr= - m.x444 - m.x458 + m.x493 - m.x542 - m.x556 + m.x591 + m.x1273 == 0)
m.c1800 = Constraint(expr= - m.x445 - m.x459 + m.x494 - m.x543 - m.x557 + m.x592 + m.x1274 == 0)
m.c1801 = Constraint(expr= - m.x446 - m.x460 + m.x495 - m.x544 - m.x558 + m.x593 + m.x1275 == 0)
m.c1802 = Constraint(expr= - m.x447 - m.x461 + m.x496 - m.x545 - m.x559 + m.x594 + m.x1276 == 0)
m.c1803 = Constraint(expr= - m.x448 - m.x462 + m.x497 - m.x546 - m.x560 + m.x595 + m.x1277 == 0)
m.c1804 = Constraint(expr= - m.x449 - m.x463 + m.x498 - m.x547 - m.x561 + m.x596 + m.x1278 == 30)
m.c1805 = Constraint(expr= - m.x450 - m.x464 - m.x478 + m.x499 + m.x506 - m.x548 - m.x562 - m.x576 + m.x597 + m.x604
+ m.x1279 == 0)
m.c1806 = Constraint(expr= - m.x451 - m.x465 - m.x479 + m.x500 + m.x507 - m.x549 - m.x563 - m.x577 + m.x598 + m.x605
+ m.x1280 == 0)
m.c1807 = Constraint(expr= - m.x452 - m.x466 - m.x480 + m.x501 + m.x508 - m.x550 - m.x564 - m.x578 + m.x599 + m.x606
+ m.x1281 == 0)
m.c1808 = Constraint(expr= - m.x453 - m.x467 - m.x481 + m.x502 + m.x509 - m.x551 - m.x565 - m.x579 + m.x600 + m.x607
+ m.x1282 == 0)
m.c1809 = Constraint(expr= - m.x454 - m.x468 - m.x482 + m.x503 + m.x510 - m.x552 - m.x566 - m.x580 + m.x601 + m.x608
+ m.x1283 == 50)
m.c1810 = Constraint(expr= - m.x455 - m.x469 - m.x483 + m.x504 + m.x511 - m.x553 - m.x567 - m.x581 + m.x602 + m.x609
+ m.x1284 == 0)
m.c1811 = Constraint(expr= - m.x456 - m.x470 - m.x484 + m.x505 + m.x512 - m.x554 - m.x568 - m.x582 + m.x603 + m.x610
+ m.x1285 == 0)
m.c1812 = Constraint(expr= - m.x471 - m.x485 + m.x513 - m.x569 - m.x583 + m.x611 + m.x1286 == 0)
m.c1813 = Constraint(expr= - m.x472 - m.x486 + m.x514 - m.x570 - m.x584 + m.x612 + m.x1287 == 0)
m.c1814 = Constraint(expr= - m.x473 - m.x487 + m.x515 - m.x571 - m.x585 + m.x613 + m.x1288 == 0)
m.c1815 = Constraint(expr= - m.x474 - m.x488 + m.x516 - m.x572 - m.x586 + m.x614 + m.x1289 == 0)
m.c1816 = Constraint(expr= - m.x475 - m.x489 + m.x517 - m.x573 - m.x587 + m.x615 + m.x1290 == 0)
m.c1817 = Constraint(expr= - m.x476 - m.x490 + m.x518 - m.x574 - m.x588 + m.x616 + m.x1291 == 30)
m.c1818 = Constraint(expr= - m.x477 - m.x491 + m.x519 - m.x575 - m.x589 + m.x617 + m.x1292 == 0)
m.c1819 = Constraint(expr= - m.x492 - m.x499 - m.x590 - m.x597 + m.x1293 == 0)
m.c1820 = Constraint(expr= - m.x493 - m.x500 - m.x591 - m.x598 + m.x1294 == 0)
m.c1821 = Constraint(expr= - m.x494 - m.x501 - m.x592 - m.x599 + m.x1295 == 0)
m.c1822 = Constraint(expr= - m.x495 - m.x502 - m.x593 - m.x600 + m.x1296 == 0)
m.c1823 = Constraint(expr= - m.x496 - m.x503 - m.x594 - m.x601 + m.x1297 == 0)
m.c1824 = Constraint(expr= - m.x497 - m.x504 - m.x595 - m.x602 + m.x1298 == 0)
m.c1825 = Constraint(expr= - m.x498 - m.x505 - m.x596 - m.x603 + m.x1299 == 0)
m.c1826 = Constraint(expr= - m.x506 - m.x513 - m.x604 - m.x611 + m.x1300 == 0)
m.c1827 = Constraint(expr= - m.x507 - m.x514 - m.x605 - m.x612 + m.x1301 == 0)
m.c1828 = Constraint(expr= - m.x508 - m.x515 - m.x606 - m.x613 + m.x1302 == 0)
m.c1829 = Constraint(expr= - m.x509 - m.x516 - m.x607 - m.x614 + m.x1303 == 0)
m.c1830 = Constraint(expr= - m.x510 - m.x517 - m.x608 - m.x615 + m.x1304 == 0)
m.c1831 = Constraint(expr= - m.x511 - m.x518 - m.x609 - m.x616 + m.x1305 == 0)
m.c1832 = Constraint(expr= - m.x512 - m.x519 - m.x610 - m.x617 + m.x1306 == 0)
m.c1833 = Constraint(expr= m.x422 + m.x520 + m.x618 + m.x1307 == 50)
m.c1834 = Constraint(expr= m.x423 + m.x521 + m.x619 + m.x1308 == 0)
m.c1835 = Constraint(expr= m.x424 + m.x522 + m.x620 + m.x1309 == 0)
m.c1836 = Constraint(expr= m.x425 + m.x523 + m.x621 + m.x1310 == 0)
m.c1837 = Constraint(expr= m.x426 + m.x524 + m.x622 + m.x1311 == 0)
m.c1838 = Constraint(expr= m.x427 + m.x525 + m.x623 + m.x1312 == 0)
m.c1839 = Constraint(expr= m.x428 + m.x526 + m.x624 + m.x1313 == 0)
m.c1840 = Constraint(expr= m.x429 + m.x527 + m.x625 + m.x1314 == 0)
m.c1841 = Constraint(expr= m.x430 + m.x528 + m.x626 + m.x1315 == 50)
m.c1842 = Constraint(expr= m.x431 + m.x529 + m.x627 + m.x1316 == 0)
m.c1843 = Constraint(expr= m.x432 + m.x530 + m.x628 + m.x1317 == 0)
m.c1844 = Constraint(expr= m.x433 + m.x531 + m.x629 + m.x1318 == 0)
m.c1845 = Constraint(expr= m.x434 + m.x532 + m.x630 + m.x1319 == 0)
m.c1846 = Constraint(expr= m.x435 + m.x533 + m.x631 + m.x1320 == 0)
m.c1847 = Constraint(expr= m.x436 + m.x534 + m.x632 + m.x1321 == 0)
m.c1848 = Constraint(expr= m.x437 + m.x535 + m.x633 + m.x1322 == 0)
m.c1849 = Constraint(expr= m.x438 + m.x536 + m.x634 + m.x1323 == 50)
m.c1850 = Constraint(expr= m.x439 + m.x537 + m.x635 + m.x1324 == 0)
m.c1851 = Constraint(expr= m.x440 + m.x538 + m.x636 + m.x1325 == 0)
m.c1852 = Constraint(expr= m.x441 + m.x539 + m.x637 + m.x1326 == 0)
m.c1853 = Constraint(expr= m.x442 + m.x540 + m.x638 + m.x1327 == 0)
m.c1854 = Constraint(expr= - m.x422 + m.x443 + m.x450 - m.x520 + m.x541 + m.x548 - m.x618 + m.x639 + m.x646 + m.x1328
== 0)
m.c1855 = Constraint(expr= - m.x423 + m.x444 + m.x451 - m.x521 + m.x542 + m.x549 - m.x619 + m.x640 + m.x647 + m.x1329
== 0)
m.c1856 = Constraint(expr= - m.x424 + m.x445 + m.x452 - m.x522 + m.x543 + m.x550 - m.x620 + m.x641 + m.x648 + m.x1330
== 0)
m.c1857 = Constraint(expr= - m.x425 + m.x446 + m.x453 - m.x523 + m.x544 + m.x551 - m.x621 + m.x642 + m.x649 + m.x1331
== 20)
m.c1858 = Constraint(expr= - m.x426 + m.x447 + m.x454 - m.x524 + m.x545 + m.x552 - m.x622 + m.x643 + m.x650 + m.x1332
== 0)
m.c1859 = Constraint(expr= - m.x427 + m.x448 + m.x455 - m.x525 + m.x546 + m.x553 - m.x623 + m.x644 + m.x651 + m.x1333
== 0)
m.c1860 = Constraint(expr= - m.x428 + m.x449 + m.x456 - m.x526 + m.x547 + m.x554 - m.x624 + m.x645 + m.x652 + m.x1334
== 0)
m.c1861 = Constraint(expr= - m.x429 + m.x457 + m.x464 + m.x471 - m.x527 + m.x555 + m.x562 + m.x569 - m.x625 + m.x653
+ m.x660 + m.x667 + m.x1335 == 0)
m.c1862 = Constraint(expr= - m.x430 + m.x458 + m.x465 + m.x472 - m.x528 + m.x556 + m.x563 + m.x570 - m.x626 + m.x654
+ m.x661 + m.x668 + m.x1336 == 0)
m.c1863 = Constraint(expr= - m.x431 + m.x459 + m.x466 + m.x473 - m.x529 + m.x557 + m.x564 + m.x571 - m.x627 + m.x655
+ m.x662 + m.x669 + m.x1337 == 0)
m.c1864 = Constraint(expr= - m.x432 + m.x460 + m.x467 + m.x474 - m.x530 + m.x558 + m.x565 + m.x572 - m.x628 + m.x656
+ m.x663 + m.x670 + m.x1338 == 0)
m.c1865 = Constraint(expr= - m.x433 + m.x461 + m.x468 + m.x475 - m.x531 + m.x559 + m.x566 + m.x573 - m.x629 + m.x657
+ m.x664 + m.x671 + m.x1339 == 20)
m.c1866 = Constraint(expr= - m.x434 + m.x462 + m.x469 + m.x476 - m.x532 + m.x560 + m.x567 + m.x574 - m.x630 + m.x658
+ m.x665 + m.x672 + m.x1340 == 0)
m.c1867 = Constraint(expr= - m.x435 + m.x463 + m.x470 + m.x477 - m.x533 + m.x561 + m.x568 + m.x575 - m.x631 + m.x659
+ m.x666 + m.x673 + m.x1341 == 0)
m.c1868 = Constraint(expr= - m.x436 + m.x478 + m.x485 - m.x534 + m.x576 + m.x583 - m.x632 + m.x674 + m.x681 + m.x1342
== 0)
m.c1869 = Constraint(expr= - m.x437 + m.x479 + m.x486 - m.x535 + m.x577 + m.x584 - m.x633 + m.x675 + m.x682 + m.x1343
== 0)
m.c1870 = Constraint(expr= - m.x438 + m.x480 + m.x487 - m.x536 + m.x578 + m.x585 - m.x634 + m.x676 + m.x683 + m.x1344
== 0)
m.c1871 = Constraint(expr= - m.x439 + m.x481 + m.x488 - m.x537 + m.x579 + m.x586 - m.x635 + m.x677 + m.x684 + m.x1345
== 0)
m.c1872 = Constraint(expr= - m.x440 + m.x482 + m.x489 - m.x538 + m.x580 + m.x587 - m.x636 + m.x678 + m.x685 + m.x1346
== 0)
m.c1873 = Constraint(expr= - m.x441 + m.x483 + m.x490 - m.x539 + m.x581 + m.x588 - m.x637 + m.x679 + m.x686 + m.x1347
== 20)
m.c1874 = Constraint(expr= - m.x442 + m.x484 + m.x491 - m.x540 + m.x582 + m.x589 - m.x638 + m.x680 + m.x687 + m.x1348
== 0)
m.c1875 = Constraint(expr= - m.x443 - m.x457 + m.x492 - m.x541 - m.x555 + m.x590 - m.x639 - m.x653 + m.x688 + m.x1349
== 0)
m.c1876 = Constraint(expr= - m.x444 - m.x458 + m.x493 - m.x542 - m.x556 + m.x591 - m.x640 - m.x654 + m.x689 + m.x1350
== 0)
m.c1877 = Constraint(expr= - m.x445 - m.x459 + m.x494 - m.x543 - m.x557 + m.x592 - m.x641 - m.x655 + m.x690 + m.x1351
== 0)
m.c1878 = Constraint(expr= - m.x446 - m.x460 + m.x495 - m.x544 - m.x558 + m.x593 - m.x642 - m.x656 + m.x691 + m.x1352
== 0)
m.c1879 = Constraint(expr= - m.x447 - m.x461 + m.x496 - m.x545 - m.x559 + m.x594 - m.x643 - m.x657 + m.x692 + m.x1353
== 0)
m.c1880 = Constraint(expr= - m.x448 - m.x462 + m.x497 - m.x546 - m.x560 + m.x595 - m.x644 - m.x658 + m.x693 + m.x1354
== 0)
m.c1881 = Constraint(expr= - m.x449 - m.x463 + m.x498 - m.x547 - m.x561 + m.x596 - m.x645 - m.x659 + m.x694 + m.x1355
== 30)
m.c1882 = Constraint(expr= - m.x450 - m.x464 - m.x478 + m.x499 + m.x506 - m.x548 - m.x562 - m.x576 + m.x597 + m.x604
- m.x646 - m.x660 - m.x674 + m.x695 + m.x702 + m.x1356 == 0)
m.c1883 = Constraint(expr= - m.x451 - m.x465 - m.x479 + m.x500 + m.x507 - m.x549 - m.x563 - m.x577 + m.x598 + m.x605
- m.x647 - m.x661 - m.x675 + m.x696 + m.x703 + m.x1357 == 0)
m.c1884 = Constraint(expr= - m.x452 - m.x466 - m.x480 + m.x501 + m.x508 - m.x550 - m.x564 - m.x578 + m.x599 + m.x606
- m.x648 - m.x662 - m.x676 + m.x697 + m.x704 + m.x1358 == 0)
m.c1885 = Constraint(expr= - m.x453 - m.x467 - m.x481 + m.x502 + m.x509 - m.x551 - m.x565 - m.x579 + m.x600 + m.x607
- m.x649 - m.x663 - m.x677 + m.x698 + m.x705 + m.x1359 == 0)
m.c1886 = Constraint(expr= - m.x454 - m.x468 - m.x482 + m.x503 + m.x510 - m.x552 - m.x566 - m.x580 + m.x601 + m.x608
- m.x650 - m.x664 - m.x678 + m.x699 + m.x706 + m.x1360 == 50)
m.c1887 = Constraint(expr= - m.x455 - m.x469 - m.x483 + m.x504 + m.x511 - m.x553 - m.x567 - m.x581 + m.x602 + m.x609
- m.x651 - m.x665 - m.x679 + m.x700 + m.x707 + m.x1361 == 0)
m.c1888 = Constraint(expr= - m.x456 - m.x470 - m.x484 + m.x505 + m.x512 - m.x554 - m.x568 - m.x582 + m.x603 + m.x610
- m.x652 - m.x666 - m.x680 + m.x701 + m.x708 + m.x1362 == 0)
m.c1889 = Constraint(expr= - m.x471 - m.x485 + m.x513 - m.x569 - m.x583 + m.x611 - m.x667 - m.x681 + m.x709 + m.x1363
== 0)
m.c1890 = Constraint(expr= - m.x472 - m.x486 + m.x514 - m.x570 - m.x584 + m.x612 - m.x668 - m.x682 + m.x710 + m.x1364
== 0)
m.c1891 = Constraint(expr= - m.x473 - m.x487 + m.x515 - m.x571 - m.x585 + m.x613 - m.x669 - m.x683 + m.x711 + m.x1365
== 0)
m.c1892 = Constraint(expr= - m.x474 - m.x488 + m.x516 - m.x572 - m.x586 + m.x614 - m.x670 - m.x684 + m.x712 + m.x1366
== 0)
m.c1893 = Constraint(expr= - m.x475 - m.x489 + m.x517 - m.x573 - m.x587 + m.x615 - m.x671 - m.x685 + m.x713 + m.x1367
== 0)
m.c1894 = Constraint(expr= - m.x476 - m.x490 + m.x518 - m.x574 - m.x588 + m.x616 - m.x672 - m.x686 + m.x714 + m.x1368
== 30)
m.c1895 = Constraint(expr= - m.x477 - m.x491 + m.x519 - m.x575 - m.x589 + m.x617 - m.x673 - m.x687 + m.x715 + m.x1369
== 0)
m.c1896 = Constraint(expr= - m.x492 - m.x499 - m.x590 - m.x597 - m.x688 - m.x695 + m.x1370 == 0)
m.c1897 = Constraint(expr= - m.x493 - m.x500 - m.x591 - m.x598 - m.x689 - m.x696 + m.x1371 == 0)
m.c1898 = Constraint(expr= - m.x494 - m.x501 - m.x592 - m.x599 - m.x690 - m.x697 + m.x1372 == 0)
m.c1899 = Constraint(expr= - m.x495 - m.x502 - m.x593 - m.x600 - m.x691 - m.x698 + m.x1373 == 0)
m.c1900 = Constraint(expr= - m.x496 - m.x503 - m.x594 - m.x601 - m.x692 - m.x699 + m.x1374 == 0)
m.c1901 = Constraint(expr= - m.x497 - m.x504 - m.x595 - m.x602 - m.x693 - m.x700 + m.x1375 == 0)
m.c1902 = Constraint(expr= - m.x498 - m.x505 - m.x596 - m.x603 - m.x694 - m.x701 + m.x1376 == 0)
m.c1903 = Constraint(expr= - m.x506 - m.x513 - m.x604 - m.x611 - m.x702 - m.x709 + m.x1377 == 0)
m.c1904 = Constraint(expr= - m.x507 - m.x514 - m.x605 - m.x612 - m.x703 - m.x710 + m.x1378 == 0)
m.c1905 = Constraint(expr= - m.x508 - m.x515 - m.x606 - m.x613 - m.x704 - m.x711 + m.x1379 == 0)
m.c1906 = Constraint(expr= - m.x509 - m.x516 - m.x607 - m.x614 - m.x705 - m.x712 + m.x1380 == 0)
m.c1907 = Constraint(expr= - m.x510 - m.x517 - m.x608 - m.x615 - m.x706 - m.x713 + m.x1381 == 0)
m.c1908 = Constraint(expr= - m.x511 - m.x518 - m.x609 - m.x616 - m.x707 - m.x714 + m.x1382 == 0)
m.c1909 = Constraint(expr= - m.x512 - m.x519 - m.x610 - m.x617 - m.x708 - m.x715 + m.x1383 == 0)
m.c1910 = Constraint(expr= m.x422 + m.x520 + m.x618 + m.x716 + m.x1384 == 50)
m.c1911 = Constraint(expr= m.x423 + m.x521 + m.x619 + m.x717 + m.x1385 == 0)
m.c1912 = Constraint(expr= m.x424 + m.x522 + m.x620 + m.x718 + m.x1386 == 0)
m.c1913 = Constraint(expr= m.x425 + m.x523 + m.x621 + m.x719 + m.x1387 == 0)
m.c1914 = Constraint(expr= m.x426 + m.x524 + m.x622 + m.x720 + m.x1388 == 0)
m.c1915 = Constraint(expr= m.x427 + m.x525 + m.x623 + m.x721 + m.x1389 == 0)
m.c1916 = Constraint(expr= m.x428 + m.x526 + m.x624 + m.x722 + m.x1390 == 0)
m.c1917 = Constraint(expr= m.x429 + m.x527 + m.x625 + m.x723 + m.x1391 == 0)
m.c1918 = Constraint(expr= m.x430 + m.x528 + m.x626 + m.x724 + m.x1392 == 50)
m.c1919 = Constraint(expr= m.x431 + m.x529 + m.x627 + m.x725 + m.x1393 == 0)
m.c1920 = Constraint(expr= m.x432 + m.x530 + m.x628 + m.x726 + m.x1394 == 0)
m.c1921 = Constraint(expr= m.x433 + m.x531 + m.x629 + m.x727 + m.x1395 == 0)
m.c1922 = Constraint(expr= m.x434 + m.x532 + m.x630 + m.x728 + m.x1396 == 0)
m.c1923 = Constraint(expr= m.x435 + m.x533 + m.x631 + m.x729 + m.x1397 == 0)
m.c1924 = Constraint(expr= m.x436 + m.x534 + m.x632 + m.x730 + m.x1398 == 0)
m.c1925 = Constraint(expr= m.x437 + m.x535 + m.x633 + m.x731 + m.x1399 == 0)
m.c1926 = Constraint(expr= m.x438 + m.x536 + m.x634 + m.x732 + m.x1400 == 50)
m.c1927 = Constraint(expr= m.x439 + m.x537 + m.x635 + m.x733 + m.x1401 == 0)
m.c1928 = Constraint(expr= m.x440 + m.x538 + m.x636 + m.x734 + m.x1402 == 0)
m.c1929 = Constraint(expr= m.x441 + m.x539 + m.x637 + m.x735 + m.x1403 == 0)
m.c1930 = Constraint(expr= m.x442 + m.x540 + m.x638 + m.x736 + m.x1404 == 0)
m.c1931 = Constraint(expr= - m.x422 + m.x443 + m.x450 - m.x520 + m.x541 + m.x548 - m.x618 + m.x639 + m.x646 - m.x716
+ m.x737 + m.x744 + m.x1405 == 0)
m.c1932 = Constraint(expr= - m.x423 + m.x444 + m.x451 - m.x521 + m.x542 + m.x549 - m.x619 + m.x640 + m.x647 - m.x717
+ m.x738 + m.x745 + m.x1406 == 0)
m.c1933 = Constraint(expr= - m.x424 + m.x445 + m.x452 - m.x522 + m.x543 + m.x550 - m.x620 + m.x641 + m.x648 - m.x718
+ m.x739 + m.x746 + m.x1407 == 0)
m.c1934 = Constraint(expr= - m.x425 + m.x446 + m.x453 - m.x523 + m.x544 + m.x551 - m.x621 + m.x642 + m.x649 - m.x719
+ m.x740 + m.x747 + m.x1408 == 20)
m.c1935 = Constraint(expr= - m.x426 + m.x447 + m.x454 - m.x524 + m.x545 + m.x552 - m.x622 + m.x643 + m.x650 - m.x720
+ m.x741 + m.x748 + m.x1409 == 0)
m.c1936 = Constraint(expr= - m.x427 + m.x448 + m.x455 - m.x525 + m.x546 + m.x553 - m.x623 + m.x644 + m.x651 - m.x721
+ m.x742 + m.x749 + m.x1410 == 0)
m.c1937 = Constraint(expr= - m.x428 + m.x449 + m.x456 - m.x526 + m.x547 + m.x554 - m.x624 + m.x645 + m.x652 - m.x722
+ m.x743 + m.x750 + m.x1411 == 0)
m.c1938 = Constraint(expr= - m.x429 + m.x457 + m.x464 + m.x471 - m.x527 + m.x555 + m.x562 + m.x569 - m.x625 + m.x653
+ m.x660 + m.x667 - m.x723 + m.x751 + m.x758 + m.x765 + m.x1412 == 0)
m.c1939 = Constraint(expr= - m.x430 + m.x458 + m.x465 + m.x472 - m.x528 + m.x556 + m.x563 + m.x570 - m.x626 + m.x654
+ m.x661 + m.x668 - m.x724 + m.x752 + m.x759 + m.x766 + m.x1413 == 0)
m.c1940 = Constraint(expr= - m.x431 + m.x459 + m.x466 + m.x473 - m.x529 + m.x557 + m.x564 + m.x571 - m.x627 + m.x655
+ m.x662 + m.x669 - m.x725 + m.x753 + m.x760 + m.x767 + m.x1414 == 0)
m.c1941 = Constraint(expr= - m.x432 + m.x460 + m.x467 + m.x474 - m.x530 + m.x558 + m.x565 + m.x572 - m.x628 + m.x656
+ m.x663 + m.x670 - m.x726 + m.x754 + m.x761 + m.x768 + m.x1415 == 0)
m.c1942 = Constraint(expr= - m.x433 + m.x461 + m.x468 + m.x475 - m.x531 + m.x559 + m.x566 + m.x573 - m.x629 + m.x657
+ m.x664 + m.x671 - m.x727 + m.x755 + m.x762 + m.x769 + m.x1416 == 20)
m.c1943 = Constraint(expr= - m.x434 + m.x462 + m.x469 + m.x476 - m.x532 + m.x560 + m.x567 + m.x574 - m.x630 + m.x658
+ m.x665 + m.x672 - m.x728 + m.x756 + m.x763 + m.x770 + m.x1417 == 0)
m.c1944 = Constraint(expr= - m.x435 + m.x463 + m.x470 + m.x477 - m.x533 + m.x561 + m.x568 + m.x575 - m.x631 + m.x659
+ m.x666 + m.x673 - m.x729 + m.x757 + m.x764 + m.x771 + m.x1418 == 0)
m.c1945 = Constraint(expr= - m.x436 + m.x478 + m.x485 - m.x534 + m.x576 + m.x583 - m.x632 + m.x674 + m.x681 - m.x730
+ m.x772 + m.x779 + m.x1419 == 0)
m.c1946 = Constraint(expr= - m.x437 + m.x479 + m.x486 - m.x535 + m.x577 + m.x584 - m.x633 + m.x675 + m.x682 - m.x731
+ m.x773 + m.x780 + m.x1420 == 0)
m.c1947 = Constraint(expr= - m.x438 + m.x480 + m.x487 - m.x536 + m.x578 + m.x585 - m.x634 + m.x676 + m.x683 - m.x732
+ m.x774 + m.x781 + m.x1421 == 0)
m.c1948 = Constraint(expr= - m.x439 + m.x481 + m.x488 - m.x537 + m.x579 + m.x586 - m.x635 + m.x677 + m.x684 - m.x733
+ m.x775 + m.x782 + m.x1422 == 0)
m.c1949 = Constraint(expr= - m.x440 + m.x482 + m.x489 - m.x538 + m.x580 + m.x587 - m.x636 + m.x678 + m.x685 - m.x734
+ m.x776 + m.x783 + m.x1423 == 0)
m.c1950 = Constraint(expr= - m.x441 + m.x483 + m.x490 - m.x539 + m.x581 + m.x588 - m.x637 + m.x679 + m.x686 - m.x735
+ m.x777 + m.x784 + m.x1424 == 20)
m.c1951 = Constraint(expr= - m.x442 + m.x484 + m.x491 - m.x540 + m.x582 + m.x589 - m.x638 + m.x680 + m.x687 - m.x736
+ m.x778 + m.x785 + m.x1425 == 0)
m.c1952 = Constraint(expr= - m.x443 - m.x457 + m.x492 - m.x541 - m.x555 + m.x590 - m.x639 - m.x653 + m.x688 - m.x737
- m.x751 + m.x786 + m.x1426 == 0)
m.c1953 = Constraint(expr= - m.x444 - m.x458 + m.x493 - m.x542 - m.x556 + m.x591 - m.x640 - m.x654 + m.x689 - m.x738
- m.x752 + m.x787 + m.x1427 == 0)
m.c1954 = Constraint(expr= - m.x445 - m.x459 + m.x494 - m.x543 - m.x557 + m.x592 - m.x641 - m.x655 + m.x690 - m.x739
- m.x753 + m.x788 + m.x1428 == 0)
m.c1955 = Constraint(expr= - m.x446 - m.x460 + m.x495 - m.x544 - m.x558 + m.x593 - m.x642 - m.x656 + m.x691 - m.x740
- m.x754 + m.x789 + m.x1429 == 0)
m.c1956 = Constraint(expr= - m.x447 - m.x461 + m.x496 - m.x545 - m.x559 + m.x594 - m.x643 - m.x657 + m.x692 - m.x741
- m.x755 + m.x790 + m.x1430 == 0)
m.c1957 = Constraint(expr= - m.x448 - m.x462 + m.x497 - m.x546 - m.x560 + m.x595 - m.x644 - m.x658 + m.x693 - m.x742
- m.x756 + m.x791 + m.x1431 == 0)
m.c1958 = Constraint(expr= - m.x449 - m.x463 + m.x498 - m.x547 - m.x561 + m.x596 - m.x645 - m.x659 + m.x694 - m.x743
- m.x757 + m.x792 + m.x1432 == 30)
m.c1959 = Constraint(expr= - m.x450 - m.x464 - m.x478 + m.x499 + m.x506 - m.x548 - m.x562 - m.x576 + m.x597 + m.x604
- m.x646 - m.x660 - m.x674 + m.x695 + m.x702 - m.x744 - m.x758 - m.x772 + m.x793 + m.x800
+ m.x1433 == 0)
m.c1960 = Constraint(expr= - m.x451 - m.x465 - m.x479 + m.x500 + m.x507 - m.x549 - m.x563 - m.x577 + m.x598 + m.x605
- m.x647 - m.x661 - m.x675 + m.x696 + m.x703 - m.x745 - m.x759 - m.x773 + m.x794 + m.x801
+ m.x1434 == 0)
m.c1961 = Constraint(expr= - m.x452 - m.x466 - m.x480 + m.x501 + m.x508 - m.x550 - m.x564 - m.x578 + m.x599 + m.x606
- m.x648 - m.x662 - m.x676 + m.x697 + m.x704 - m.x746 - m.x760 - m.x774 + m.x795 + m.x802
+ m.x1435 == 0)
m.c1962 = Constraint(expr= - m.x453 - m.x467 - m.x481 + m.x502 + m.x509 - m.x551 - m.x565 - m.x579 + m.x600 + m.x607
- m.x649 - m.x663 - m.x677 + m.x698 + m.x705 - m.x747 - m.x761 - m.x775 + m.x796 + m.x803
+ m.x1436 == 0)
m.c1963 = Constraint(expr= - m.x454 - m.x468 - m.x482 + m.x503 + m.x510 - m.x552 - m.x566 - m.x580 + m.x601 + m.x608
- m.x650 - m.x664 - m.x678 + m.x699 + m.x706 - m.x748 - m.x762 - m.x776 + m.x797 + m.x804
+ m.x1437 == 50)
m.c1964 = Constraint(expr= - m.x455 - m.x469 - m.x483 + m.x504 + m.x511 - m.x553 - m.x567 - m.x581 + m.x602 + m.x609
- m.x651 - m.x665 - m.x679 + m.x700 + m.x707 - m.x749 - m.x763 - m.x777 + m.x798 + m.x805
+ m.x1438 == 0)
m.c1965 = Constraint(expr= - m.x456 - m.x470 - m.x484 + m.x505 + m.x512 - m.x554 - m.x568 - m.x582 + m.x603 + m.x610
- m.x652 - m.x666 - m.x680 + m.x701 + m.x708 - m.x750 - m.x764 - m.x778 + m.x799 + m.x806
+ m.x1439 == 0)
m.c1966 = Constraint(expr= - m.x471 - m.x485 + m.x513 - m.x569 - m.x583 + m.x611 - m.x667 - m.x681 + m.x709 - m.x765
- m.x779 + m.x807 + m.x1440 == 0)
m.c1967 = Constraint(expr= - m.x472 - m.x486 + m.x514 - m.x570 - m.x584 + m.x612 - m.x668 - m.x682 + m.x710 - m.x766
- m.x780 + m.x808 + m.x1441 == 0)
m.c1968 = Constraint(expr= - m.x473 - m.x487 + m.x515 - m.x571 - m.x585 + m.x613 - m.x669 - m.x683 + m.x711 - m.x767
- m.x781 + m.x809 + m.x1442 == 0)
m.c1969 = Constraint(expr= - m.x474 - m.x488 + m.x516 - m.x572 - m.x586 + m.x614 - m.x670 - m.x684 + m.x712 - m.x768
- m.x782 + m.x810 + m.x1443 == 0)
m.c1970 = Constraint(expr= - m.x475 - m.x489 + m.x517 - m.x573 - m.x587 + m.x615 - m.x671 - m.x685 + m.x713 - m.x769
- m.x783 + m.x811 + m.x1444 == 0)
m.c1971 = Constraint(expr= - m.x476 - m.x490 + m.x518 - m.x574 - m.x588 + m.x616 - m.x672 - m.x686 + m.x714 - m.x770
- m.x784 + m.x812 + m.x1445 == 30)
m.c1972 = Constraint(expr= - m.x477 - m.x491 + m.x519 - m.x575 - m.x589 + m.x617 - m.x673 - m.x687 + m.x715 - m.x771
- m.x785 + m.x813 + m.x1446 == 0)
m.c1973 = Constraint(expr= - m.x492 - m.x499 - m.x590 - m.x597 - m.x688 - m.x695 - m.x786 - m.x793 + m.x1447 == 0)
m.c1974 = Constraint(expr= - m.x493 - m.x500 - m.x591 - m.x598 - m.x689 - m.x696 - m.x787 - m.x794 + m.x1448 == 0)
m.c1975 = Constraint(expr= - m.x494 - m.x501 - m.x592 - m.x599 - m.x690 - m.x697 - m.x788 - m.x795 + m.x1449 == 0)
m.c1976 = Constraint(expr= - m.x495 - m.x502 - m.x593 - m.x600 - m.x691 - m.x698 - m.x789 - m.x796 + m.x1450 == 0)
m.c1977 = Constraint(expr= - m.x496 - m.x503 - m.x594 - m.x601 - m.x692 - m.x699 - m.x790 - m.x797 + m.x1451 == 0)
m.c1978 = Constraint(expr= - m.x497 - m.x504 - m.x595 - m.x602 - m.x693 - m.x700 - m.x791 - m.x798 + m.x1452 == 0)
m.c1979 = Constraint(expr= - m.x498 - m.x505 - m.x596 - m.x603 - m.x694 - m.x701 - m.x792 - m.x799 + m.x1453 == 0)
m.c1980 = Constraint(expr= - m.x506 - m.x513 - m.x604 - m.x611 - m.x702 - m.x709 - m.x800 - m.x807 + m.x1454 == 0)
m.c1981 = Constraint(expr= - m.x507 - m.x514 - m.x605 - m.x612 - m.x703 - m.x710 - m.x801 - m.x808 + m.x1455 == 0)
m.c1982 = Constraint(expr= - m.x508 - m.x515 - m.x606 - m.x613 - m.x704 - m.x711 - m.x802 - m.x809 + m.x1456 == 0)
m.c1983 = Constraint(expr= - m.x509 - m.x516 - m.x607 - m.x614 - m.x705 - m.x712 - m.x803 - m.x810 + m.x1457 == 0)
m.c1984 = Constraint(expr= - m.x510 - m.x517 - m.x608 - m.x615 - m.x706 - m.x713 - m.x804 - m.x811 + m.x1458 == 0)
m.c1985 = Constraint(expr= - m.x511 - m.x518 - m.x609 - m.x616 - m.x707 - m.x714 - m.x805 - m.x812 + m.x1459 == 0)
m.c1986 = Constraint(expr= - m.x512 - m.x519 - m.x610 - m.x617 - m.x708 - m.x715 - m.x806 - m.x813 + m.x1460 == 0)
m.c1987 = Constraint(expr= m.x422 + m.x520 + m.x618 + m.x716 + m.x814 + m.x1461 == 50)
m.c1988 = Constraint(expr= m.x423 + m.x521 + m.x619 + m.x717 + m.x815 + m.x1462 == 0)
m.c1989 = Constraint(expr= m.x424 + m.x522 + m.x620 + m.x718 + m.x816 + m.x1463 == 0)
m.c1990 = Constraint(expr= m.x425 + m.x523 + m.x621 + m.x719 + m.x817 + m.x1464 == 0)
m.c1991 = Constraint(expr= m.x426 + m.x524 + m.x622 + m.x720 + m.x818 + m.x1465 == 0)
m.c1992 = Constraint(expr= m.x427 + m.x525 + m.x623 + m.x721 + m.x819 + m.x1466 == 0)
m.c1993 = Constraint(expr= m.x428 + m.x526 + m.x624 + m.x722 + m.x820 + m.x1467 == 0)
m.c1994 = Constraint(expr= m.x429 + m.x527 + m.x625 + m.x723 + m.x821 + m.x1468 == 0)
m.c1995 = Constraint(expr= m.x430 + m.x528 + m.x626 + m.x724 + m.x822 + m.x1469 == 50)
m.c1996 = Constraint(expr= m.x431 + m.x529 + m.x627 + m.x725 + m.x823 + m.x1470 == 0)
m.c1997 = Constraint(expr= m.x432 + m.x530 + m.x628 + m.x726 + m.x824 + m.x1471 == 0)
m.c1998 = Constraint(expr= m.x433 + m.x531 + m.x629 + m.x727 + m.x825 + m.x1472 == 0)
m.c1999 = Constraint(expr= m.x434 + m.x532 + m.x630 + m.x728 + m.x826 + m.x1473 == 0)
m.c2000 = Constraint(expr= m.x435 + m.x533 + m.x631 + m.x729 + m.x827 + m.x1474 == 0)
m.c2001 = Constraint(expr= m.x436 + m.x534 + m.x632 + m.x730 + m.x828 + m.x1475 == 0)
m.c2002 = Constraint(expr= m.x437 + m.x535 + m.x633 + m.x731 + m.x829 + m.x1476 == 0)
m.c2003 = Constraint(expr= m.x438 + m.x536 + m.x634 + m.x732 + m.x830 + m.x1477 == 50)
m.c2004 = Constraint(expr= m.x439 + m.x537 + m.x635 + m.x733 + m.x831 + m.x1478 == 0)
m.c2005 = Constraint(expr= m.x440 + m.x538 + m.x636 + m.x734 + m.x832 + m.x1479 == 0)
m.c2006 = Constraint(expr= m.x441 + m.x539 + m.x637 + m.x735 + m.x833 + m.x1480 == 0)
m.c2007 = Constraint(expr= m.x442 + m.x540 + m.x638 + m.x736 + m.x834 + m.x1481 == 0)
m.c2008 = Constraint(expr= - m.x422 + m.x443 + m.x450 - m.x520 + m.x541 + m.x548 - m.x618 + m.x639 + m.x646 - m.x716
+ m.x737 + m.x744 - m.x814 + m.x835 + m.x842 + m.x1482 == 0)
m.c2009 = Constraint(expr= - m.x423 + m.x444 + m.x451 - m.x521 + m.x542 + m.x549 - m.x619 + m.x640 + m.x647 - m.x717
+ m.x738 + m.x745 - m.x815 + m.x836 + m.x843 + m.x1483 == 0)
m.c2010 = Constraint(expr= - m.x424 + m.x445 + m.x452 - m.x522 + m.x543 + m.x550 - m.x620 + m.x641 + m.x648 - m.x718
+ m.x739 + m.x746 - m.x816 + m.x837 + m.x844 + m.x1484 == 0)
m.c2011 = Constraint(expr= - m.x425 + m.x446 + m.x453 - m.x523 + m.x544 + m.x551 - m.x621 + m.x642 + m.x649 - m.x719
+ m.x740 + m.x747 - m.x817 + m.x838 + m.x845 + m.x1485 == 20)
m.c2012 = Constraint(expr= - m.x426 + m.x447 + m.x454 - m.x524 + m.x545 + m.x552 - m.x622 + m.x643 + m.x650 - m.x720
+ m.x741 + m.x748 - m.x818 + m.x839 + m.x846 + m.x1486 == 0)
m.c2013 = Constraint(expr= - m.x427 + m.x448 + m.x455 - m.x525 + m.x546 + m.x553 - m.x623 + m.x644 + m.x651 - m.x721
+ m.x742 + m.x749 - m.x819 + m.x840 + m.x847 + m.x1487 == 0)
m.c2014 = Constraint(expr= - m.x428 + m.x449 + m.x456 - m.x526 + m.x547 + m.x554 - m.x624 + m.x645 + m.x652 - m.x722
+ m.x743 + m.x750 - m.x820 + m.x841 + m.x848 + m.x1488 == 0)
m.c2015 = Constraint(expr= - m.x429 + m.x457 + m.x464 + m.x471 - m.x527 + m.x555 + m.x562 + m.x569 - m.x625 + m.x653
+ m.x660 + m.x667 - m.x723 + m.x751 + m.x758 + m.x765 - m.x821 + m.x849 + m.x856 + m.x863
+ m.x1489 == 0)
m.c2016 = Constraint(expr= - m.x430 + m.x458 + m.x465 + m.x472 - m.x528 + m.x556 + m.x563 + m.x570 - m.x626 + m.x654
+ m.x661 + m.x668 - m.x724 + m.x752 + m.x759 + m.x766 - m.x822 + m.x850 + m.x857 + m.x864
+ m.x1490 == 0)
m.c2017 = Constraint(expr= - m.x431 + m.x459 + m.x466 + m.x473 - m.x529 + m.x557 + m.x564 + m.x571 - m.x627 + m.x655
+ m.x662 + m.x669 - m.x725 + m.x753 + m.x760 + m.x767 - m.x823 + m.x851 + m.x858 + m.x865
+ m.x1491 == 0)
m.c2018 = Constraint(expr= - m.x432 + m.x460 + m.x467 + m.x474 - m.x530 + m.x558 + m.x565 + m.x572 - m.x628 + m.x656
+ m.x663 + m.x670 - m.x726 + m.x754 + m.x761 + m.x768 - m.x824 + m.x852 + m.x859 + m.x866
+ m.x1492 == 0)
m.c2019 = Constraint(expr= - m.x433 + m.x461 + m.x468 + m.x475 - m.x531 + m.x559 + m.x566 + m.x573 - m.x629 + m.x657
+ m.x664 + m.x671 - m.x727 + m.x755 + m.x762 + m.x769 - m.x825 + m.x853 + m.x860 + m.x867
+ m.x1493 == 20)
m.c2020 = Constraint(expr= - m.x434 + m.x462 + m.x469 + m.x476 - m.x532 + m.x560 + m.x567 + m.x574 - m.x630 + m.x658
+ m.x665 + m.x672 - m.x728 + m.x756 + m.x763 + m.x770 - m.x826 + m.x854 + m.x861 + m.x868
+ m.x1494 == 0)
m.c2021 = Constraint(expr= - m.x435 + m.x463 + m.x470 + m.x477 - m.x533 + m.x561 + m.x568 + m.x575 - m.x631 + m.x659
+ m.x666 + m.x673 - m.x729 + m.x757 + m.x764 + m.x771 - m.x827 + m.x855 + m.x862 + m.x869
+ m.x1495 == 0)
m.c2022 = Constraint(expr= - m.x436 + m.x478 + m.x485 - m.x534 + m.x576 + m.x583 - m.x632 + m.x674 + m.x681 - m.x730
+ m.x772 + m.x779 - m.x828 + m.x870 + m.x877 + m.x1496 == 0)
m.c2023 = Constraint(expr= - m.x437 + m.x479 + m.x486 - m.x535 + m.x577 + m.x584 - m.x633 + m.x675 + m.x682 - m.x731
+ m.x773 + m.x780 - m.x829 + m.x871 + m.x878 + m.x1497 == 0)
m.c2024 = Constraint(expr= - m.x438 + m.x480 + m.x487 - m.x536 + m.x578 + m.x585 - m.x634 + m.x676 + m.x683 - m.x732
+ m.x774 + m.x781 - m.x830 + m.x872 + m.x879 + m.x1498 == 0)
m.c2025 = Constraint(expr= - m.x439 + m.x481 + m.x488 - m.x537 + m.x579 + m.x586 - m.x635 + m.x677 + m.x684 - m.x733
+ m.x775 + m.x782 - m.x831 + m.x873 + m.x880 + m.x1499 == 0)
m.c2026 = Constraint(expr= - m.x440 + m.x482 + m.x489 - m.x538 + m.x580 + m.x587 - m.x636 + m.x678 + m.x685 - m.x734
+ m.x776 + m.x783 - m.x832 + m.x874 + m.x881 + m.x1500 == 0)
m.c2027 = Constraint(expr= - m.x441 + m.x483 + m.x490 - m.x539 + m.x581 + m.x588 - m.x637 + m.x679 + m.x686 - m.x735
+ m.x777 + m.x784 - m.x833 + m.x875 + m.x882 + m.x1501 == 20)
m.c2028 = Constraint(expr= - m.x442 + m.x484 + m.x491 - m.x540 + m.x582 + m.x589 - m.x638 + m.x680 + m.x687 - m.x736
+ m.x778 + m.x785 - m.x834 + m.x876 + m.x883 + m.x1502 == 0)
m.c2029 = Constraint(expr= - m.x443 - m.x457 + m.x492 - m.x541 - m.x555 + m.x590 - m.x639 - m.x653 + m.x688 - m.x737
- m.x751 + m.x786 - m.x835 - m.x849 + m.x884 + m.x1503 == 0)
m.c2030 = Constraint(expr= - m.x444 - m.x458 + m.x493 - m.x542 - m.x556 + m.x591 - m.x640 - m.x654 + m.x689 - m.x738
- m.x752 + m.x787 - m.x836 - m.x850 + m.x885 + m.x1504 == 0)
m.c2031 = Constraint(expr= - m.x445 - m.x459 + m.x494 - m.x543 - m.x557 + m.x592 - m.x641 - m.x655 + m.x690 - m.x739
- m.x753 + m.x788 - m.x837 - m.x851 + m.x886 + m.x1505 == 0)
m.c2032 = Constraint(expr= - m.x446 - m.x460 + m.x495 - m.x544 - m.x558 + m.x593 - m.x642 - m.x656 + m.x691 - m.x740
- m.x754 + m.x789 - m.x838 - m.x852 + m.x887 + m.x1506 == 0)
m.c2033 = Constraint(expr= - m.x447 - m.x461 + m.x496 - m.x545 - m.x559 + m.x594 - m.x643 - m.x657 + m.x692 - m.x741
- m.x755 + m.x790 - m.x839 - m.x853 + m.x888 + m.x1507 == 0)
m.c2034 = Constraint(expr= - m.x448 - m.x462 + m.x497 - m.x546 - m.x560 + m.x595 - m.x644 - m.x658 + m.x693 - m.x742
- m.x756 + m.x791 - m.x840 - m.x854 + m.x889 + m.x1508 == 0)
m.c2035 = Constraint(expr= - m.x449 - m.x463 + m.x498 - m.x547 - m.x561 + m.x596 - m.x645 - m.x659 + m.x694 - m.x743
- m.x757 + m.x792 - m.x841 - m.x855 + m.x890 + m.x1509 == 30)
m.c2036 = Constraint(expr= - m.x450 - m.x464 - m.x478 + m.x499 + m.x506 - m.x548 - m.x562 - m.x576 + m.x597 + m.x604
- m.x646 - m.x660 - m.x674 + m.x695 + m.x702 - m.x744 - m.x758 - m.x772 + m.x793 + m.x800
- m.x842 - m.x856 - m.x870 + m.x891 + m.x898 + m.x1510 == 0)
m.c2037 = Constraint(expr= - m.x451 - m.x465 - m.x479 + m.x500 + m.x507 - m.x549 - m.x563 - m.x577 + m.x598 + m.x605
- m.x647 - m.x661 - m.x675 + m.x696 + m.x703 - m.x745 - m.x759 - m.x773 + m.x794 + m.x801
- m.x843 - m.x857 - m.x871 + m.x892 + m.x899 + m.x1511 == 0)
m.c2038 = Constraint(expr= - m.x452 - m.x466 - m.x480 + m.x501 + m.x508 - m.x550 - m.x564 - m.x578 + m.x599 + m.x606
- m.x648 - m.x662 - m.x676 + m.x697 + m.x704 - m.x746 - m.x760 - m.x774 + m.x795 + m.x802
- m.x844 - m.x858 - m.x872 + m.x893 + m.x900 + m.x1512 == 0)
m.c2039 = Constraint(expr= - m.x453 - m.x467 - m.x481 + m.x502 + m.x509 - m.x551 - m.x565 - m.x579 + m.x600 + m.x607
- m.x649 - m.x663 - m.x677 + m.x698 + m.x705 - m.x747 - m.x761 - m.x775 + m.x796 + m.x803
- m.x845 - m.x859 - m.x873 + m.x894 + m.x901 + m.x1513 == 0)
m.c2040 = Constraint(expr= - m.x454 - m.x468 - m.x482 + m.x503 + m.x510 - m.x552 - m.x566 - m.x580 + m.x601 + m.x608
- m.x650 - m.x664 - m.x678 + m.x699 + m.x706 - m.x748 - m.x762 - m.x776 + m.x797 + m.x804
- m.x846 - m.x860 - m.x874 + m.x895 + m.x902 + m.x1514 == 50)
m.c2041 = Constraint(expr= - m.x455 - m.x469 - m.x483 + m.x504 + m.x511 - m.x553 - m.x567 - m.x581 + m.x602 + m.x609
- m.x651 - m.x665 - m.x679 + m.x700 + m.x707 - m.x749 - m.x763 - m.x777 + m.x798 + m.x805
- m.x847 - m.x861 - m.x875 + m.x896 + m.x903 + m.x1515 == 0)
m.c2042 = Constraint(expr= - m.x456 - m.x470 - m.x484 + m.x505 + m.x512 - m.x554 - m.x568 - m.x582 + m.x603 + m.x610
- m.x652 - m.x666 - m.x680 + m.x701 + m.x708 - m.x750 - m.x764 - m.x778 + m.x799 + m.x806
- m.x848 - m.x862 - m.x876 + m.x897 + m.x904 + m.x1516 == 0)
m.c2043 = Constraint(expr= - m.x471 - m.x485 + m.x513 - m.x569 - m.x583 + m.x611 - m.x667 - m.x681 + m.x709 - m.x765
- m.x779 + m.x807 - m.x863 - m.x877 + m.x905 + m.x1517 == 0)
m.c2044 = Constraint(expr= - m.x472 - m.x486 + m.x514 - m.x570 - m.x584 + m.x612 - m.x668 - m.x682 + m.x710 - m.x766
- m.x780 + m.x808 - m.x864 - m.x878 + m.x906 + m.x1518 == 0)
m.c2045 = Constraint(expr= - m.x473 - m.x487 + m.x515 - m.x571 - m.x585 + m.x613 - m.x669 - m.x683 + m.x711 - m.x767
- m.x781 + m.x809 - m.x865 - m.x879 + m.x907 + m.x1519 == 0)
m.c2046 = Constraint(expr= - m.x474 - m.x488 + m.x516 - m.x572 - m.x586 + m.x614 - m.x670 - m.x684 + m.x712 - m.x768
- m.x782 + m.x810 - m.x866 - m.x880 + m.x908 + m.x1520 == 0)
m.c2047 = Constraint(expr= - m.x475 - m.x489 + m.x517 - m.x573 - m.x587 + m.x615 - m.x671 - m.x685 + m.x713 - m.x769
- m.x783 + m.x811 - m.x867 - m.x881 + m.x909 + m.x1521 == 0)
m.c2048 = Constraint(expr= - m.x476 - m.x490 + m.x518 - m.x574 - m.x588 + m.x616 - m.x672 - m.x686 + m.x714 - m.x770
- m.x784 + m.x812 - m.x868 - m.x882 + m.x910 + m.x1522 == 30)
m.c2049 = Constraint(expr= - m.x477 - m.x491 + m.x519 - m.x575 - m.x589 + m.x617 - m.x673 - m.x687 + m.x715 - m.x771
- m.x785 + m.x813 - m.x869 - m.x883 + m.x911 + m.x1523 == 0)
m.c2050 = Constraint(expr= - m.x492 - m.x499 - m.x590 - m.x597 - m.x688 - m.x695 - m.x786 - m.x793 - m.x884 - m.x891
+ m.x1524 == 0)
m.c2051 = Constraint(expr= - m.x493 - m.x500 - m.x591 - m.x598 - m.x689 - m.x696 - m.x787 - m.x794 - m.x885 - m.x892
+ m.x1525 == 0)
m.c2052 = Constraint(expr= - m.x494 - m.x501 - m.x592 - m.x599 - m.x690 - m.x697 - m.x788 - m.x795 - m.x886 - m.x893
+ m.x1526 == 0)
m.c2053 = Constraint(expr= - m.x495 - m.x502 - m.x593 - m.x600 - m.x691 - m.x698 - m.x789 - m.x796 - m.x887 - m.x894
+ m.x1527 == 0)
m.c2054 = Constraint(expr= - m.x496 - m.x503 - m.x594 - m.x601 - m.x692 - m.x699 - m.x790 - m.x797 - m.x888 - m.x895
+ m.x1528 == 0)
m.c2055 = Constraint(expr= - m.x497 - m.x504 - m.x595 - m.x602 - m.x693 - m.x700 - m.x791 - m.x798 - m.x889 - m.x896
+ m.x1529 == 0)
m.c2056 = Constraint(expr= - m.x498 - m.x505 - m.x596 - m.x603 - m.x694 - m.x701 - m.x792 - m.x799 - m.x890 - m.x897
+ m.x1530 == 0)
m.c2057 = Constraint(expr= - m.x506 - m.x513 - m.x604 - m.x611 - m.x702 - m.x709 - m.x800 - m.x807 - m.x898 - m.x905
+ m.x1531 == 0)
m.c2058 = Constraint(expr= - m.x507 - m.x514 - m.x605 - m.x612 - m.x703 - m.x710 - m.x801 - m.x808 - m.x899 - m.x906
+ m.x1532 == 0)
m.c2059 = Constraint(expr= - m.x508 - m.x515 - m.x606 - m.x613 - m.x704 - m.x711 - m.x802 - m.x809 - m.x900 - m.x907
+ m.x1533 == 0)
m.c2060 = Constraint(expr= - m.x509 - m.x516 - m.x607 - m.x614 - m.x705 - m.x712 - m.x803 - m.x810 - m.x901 - m.x908
+ m.x1534 == 0)
m.c2061 = Constraint(expr= - m.x510 - m.x517 - m.x608 - m.x615 - m.x706 - m.x713 - m.x804 - m.x811 - m.x902 - m.x909
+ m.x1535 == 0)
m.c2062 = Constraint(expr= - m.x511 - m.x518 - m.x609 - m.x616 - m.x707 - m.x714 - m.x805 - m.x812 - m.x903 - m.x910
+ m.x1536 == 0)
m.c2063 = Constraint(expr= - m.x512 - m.x519 - m.x610 - m.x617 - m.x708 - m.x715 - m.x806 - m.x813 - m.x904 - m.x911
+ m.x1537 == 0)
m.c2064 = Constraint(expr=m.x338*m.x1076 - m.x422*m.x1010 == 0)
m.c2065 = Constraint(expr=m.x338*m.x1077 - m.x423*m.x1010 == 0)
m.c2066 = Constraint(expr=m.x338*m.x1078 - m.x424*m.x1010 == 0)
m.c2067 = Constraint(expr=m.x338*m.x1079 - m.x425*m.x1010 == 0)
m.c2068 = Constraint(expr=m.x338*m.x1080 - m.x426*m.x1010 == 0)
m.c2069 = Constraint(expr=m.x338*m.x1081 - m.x427*m.x1010 == 0)
m.c2070 = Constraint(expr=m.x338*m.x1082 - m.x428*m.x1010 == 0)
m.c2071 = Constraint(expr=m.x339*m.x1083 - m.x429*m.x1011 == 0)
m.c2072 = Constraint(expr=m.x339*m.x1084 - m.x430*m.x1011 == 0)
m.c2073 = Constraint(expr=m.x339*m.x1085 - m.x431*m.x1011 == 0)
m.c2074 = Constraint(expr=m.x339*m.x1086 - m.x432*m.x1011 == 0)
m.c2075 = Constraint(expr=m.x339*m.x1087 - m.x433*m.x1011 == 0)
m.c2076 = Constraint(expr=m.x339*m.x1088 - m.x434*m.x1011 == 0)
m.c2077 = Constraint(expr=m.x339*m.x1089 - m.x435*m.x1011 == 0)
m.c2078 = Constraint(expr=m.x340*m.x1090 - m.x436*m.x1012 == 0)
m.c2079 = Constraint(expr=m.x340*m.x1091 - m.x437*m.x1012 == 0)
m.c2080 = Constraint(expr=m.x340*m.x1092 - m.x438*m.x1012 == 0)
m.c2081 = Constraint(expr=m.x340*m.x1093 - m.x439*m.x1012 == 0)
m.c2082 = Constraint(expr=m.x340*m.x1094 - m.x440*m.x1012 == 0)
m.c2083 = Constraint(expr=m.x340*m.x1095 - m.x441*m.x1012 == 0)
m.c2084 = Constraint(expr=m.x340*m.x1096 - m.x442*m.x1012 == 0)
m.c2085 = Constraint(expr=m.x341*m.x1097 - m.x443*m.x1013 == 0)
m.c2086 = Constraint(expr=m.x341*m.x1098 - m.x444*m.x1013 == 0)
m.c2087 = Constraint(expr=m.x341*m.x1099 - m.x445*m.x1013 == 0)
m.c2088 = Constraint(expr=m.x341*m.x1100 - m.x446*m.x1013 == 0)
m.c2089 = Constraint(expr=m.x341*m.x1101 - m.x447*m.x1013 == 0)
m.c2090 = Constraint(expr=m.x341*m.x1102 - m.x448*m.x1013 == 0)
m.c2091 = Constraint(expr=m.x341*m.x1103 - m.x449*m.x1013 == 0)
m.c2092 = Constraint(expr=m.x342*m.x1097 - m.x450*m.x1013 == 0)
m.c2093 = Constraint(expr=m.x342*m.x1098 - m.x451*m.x1013 == 0)
m.c2094 = Constraint(expr=m.x342*m.x1099 - m.x452*m.x1013 == 0)
m.c2095 = Constraint(expr=m.x342*m.x1100 - m.x453*m.x1013 == 0)
m.c2096 = Constraint(expr=m.x342*m.x1101 - m.x454*m.x1013 == 0)
m.c2097 = Constraint(expr=m.x342*m.x1102 - m.x455*m.x1013 == 0)
m.c2098 = Constraint(expr=m.x342*m.x1103 - m.x456*m.x1013 == 0)
m.c2099 = Constraint(expr=m.x343*m.x1104 - m.x457*m.x1014 == 0)
m.c2100 = Constraint(expr=m.x343*m.x1105 - m.x458*m.x1014 == 0)
m.c2101 = Constraint(expr=m.x343*m.x1106 - m.x459*m.x1014 == 0)
m.c2102 = Constraint(expr=m.x343*m.x1107 - m.x460*m.x1014 == 0)
m.c2103 = Constraint(expr=m.x343*m.x1108 - m.x461*m.x1014 == 0)
m.c2104 = Constraint(expr=m.x343*m.x1109 - m.x462*m.x1014 == 0)
m.c2105 = Constraint(expr=m.x343*m.x1110 - m.x463*m.x1014 == 0)
m.c2106 = Constraint(expr=m.x344*m.x1104 - m.x464*m.x1014 == 0)
m.c2107 = Constraint(expr=m.x344*m.x1105 - m.x465*m.x1014 == 0)
m.c2108 = Constraint(expr=m.x344*m.x1106 - m.x466*m.x1014 == 0)
m.c2109 = Constraint(expr=m.x344*m.x1107 - m.x467*m.x1014 == 0)
m.c2110 = Constraint(expr=m.x344*m.x1108 - m.x468*m.x1014 == 0)
m.c2111 = Constraint(expr=m.x344*m.x1109 - m.x469*m.x1014 == 0)
m.c2112 = Constraint(expr=m.x344*m.x1110 - m.x470*m.x1014 == 0)
m.c2113 = Constraint(expr=m.x345*m.x1104 - m.x471*m.x1014 == 0)
m.c2114 = Constraint(expr=m.x345*m.x1105 - m.x472*m.x1014 == 0)
m.c2115 = Constraint(expr=m.x345*m.x1106 - m.x473*m.x1014 == 0)
m.c2116 = Constraint(expr=m.x345*m.x1107 - m.x474*m.x1014 == 0)
m.c2117 = Constraint(expr=m.x345*m.x1108 - m.x475*m.x1014 == 0)
m.c2118 = Constraint(expr=m.x345*m.x1109 - m.x476*m.x1014 == 0)
m.c2119 = Constraint(expr=m.x345*m.x1110 - m.x477*m.x1014 == 0)
m.c2120 = Constraint(expr=m.x346*m.x1111 - m.x478*m.x1015 == 0)
m.c2121 = Constraint(expr=m.x346*m.x1112 - m.x479*m.x1015 == 0)
m.c2122 = Constraint(expr=m.x346*m.x1113 - m.x480*m.x1015 == 0)
m.c2123 = Constraint(expr=m.x346*m.x1114 - m.x481*m.x1015 == 0)
m.c2124 = Constraint(expr=m.x346*m.x1115 - m.x482*m.x1015 == 0)
m.c2125 = Constraint(expr=m.x346*m.x1116 - m.x483*m.x1015 == 0)
m.c2126 = Constraint(expr=m.x346*m.x1117 - m.x484*m.x1015 == 0)
m.c2127 = Constraint(expr=m.x347*m.x1111 - m.x485*m.x1015 == 0)
m.c2128 = Constraint(expr=m.x347*m.x1112 - m.x486*m.x1015 == 0)
m.c2129 = Constraint(expr=m.x347*m.x1113 - m.x487*m.x1015 == 0)
m.c2130 = Constraint(expr=m.x347*m.x1114 - m.x488*m.x1015 == 0)
m.c2131 = Constraint(expr=m.x347*m.x1115 - m.x489*m.x1015 == 0)
m.c2132 = Constraint(expr=m.x347*m.x1116 - m.x490*m.x1015 == 0)
m.c2133 = Constraint(expr=m.x347*m.x1117 - m.x491*m.x1015 == 0)
m.c2134 = Constraint(expr=m.x348*m.x1118 - m.x492*m.x1016 == 0)
m.c2135 = Constraint(expr=m.x348*m.x1119 - m.x493*m.x1016 == 0)
m.c2136 = Constraint(expr=m.x348*m.x1120 - m.x494*m.x1016 == 0)
m.c2137 = Constraint(expr=m.x348*m.x1121 - m.x495*m.x1016 == 0)
m.c2138 = Constraint(expr=m.x348*m.x1122 - m.x496*m.x1016 == 0)
m.c2139 = Constraint(expr=m.x348*m.x1123 - m.x497*m.x1016 == 0)
m.c2140 = Constraint(expr=m.x348*m.x1124 - m.x498*m.x1016 == 0)
m.c2141 = Constraint(expr=m.x349*m.x1125 - m.x499*m.x1017 == 0)
m.c2142 = Constraint(expr=m.x349*m.x1126 - m.x500*m.x1017 == 0)
m.c2143 = Constraint(expr=m.x349*m.x1127 - m.x501*m.x1017 == 0)
m.c2144 = Constraint(expr=m.x349*m.x1128 - m.x502*m.x1017 == 0)
m.c2145 = Constraint(expr=m.x349*m.x1129 - m.x503*m.x1017 == 0)
m.c2146 = Constraint(expr=m.x349*m.x1130 - m.x504*m.x1017 == 0)
m.c2147 = Constraint(expr=m.x349*m.x1131 - m.x505*m.x1017 == 0)
m.c2148 = Constraint(expr=m.x350*m.x1125 - m.x506*m.x1017 == 0)
m.c2149 = Constraint(expr=m.x350*m.x1126 - m.x507*m.x1017 == 0)
m.c2150 = Constraint(expr=m.x350*m.x1127 - m.x508*m.x1017 == 0)
m.c2151 = Constraint(expr=m.x350*m.x1128 - m.x509*m.x1017 == 0)
m.c2152 = Constraint(expr=m.x350*m.x1129 - m.x510*m.x1017 == 0)
m.c2153 = Constraint(expr=m.x350*m.x1130 - m.x511*m.x1017 == 0)
m.c2154 = Constraint(expr=m.x350*m.x1131 - m.x512*m.x1017 == 0)
m.c2155 = Constraint(expr=m.x351*m.x1132 - m.x513*m.x1018 == 0)
m.c2156 = Constraint(expr=m.x351*m.x1133 - m.x514*m.x1018 == 0)
m.c2157 = Constraint(expr=m.x351*m.x1134 - m.x515*m.x1018 == 0)
m.c2158 = Constraint(expr=m.x351*m.x1135 - m.x516*m.x1018 == 0)
m.c2159 = Constraint(expr=m.x351*m.x1136 - m.x517*m.x1018 == 0)
m.c2160 = Constraint(expr=m.x351*m.x1137 - m.x518*m.x1018 == 0)
m.c2161 = Constraint(expr=m.x351*m.x1138 - m.x519*m.x1018 == 0)
m.c2162 = Constraint(expr=m.x352*m.x1153 - m.x520*m.x1021 == 0)
m.c2163 = Constraint(expr=m.x352*m.x1154 - m.x521*m.x1021 == 0)
m.c2164 = Constraint(expr=m.x352*m.x1155 - m.x522*m.x1021 == 0)
m.c2165 = Constraint(expr=m.x352*m.x1156 - m.x523*m.x1021 == 0)
m.c2166 = Constraint(expr=m.x352*m.x1157 - m.x524*m.x1021 == 0)
m.c2167 = Constraint(expr=m.x352*m.x1158 - m.x525*m.x1021 == 0)
m.c2168 = Constraint(expr=m.x352*m.x1159 - m.x526*m.x1021 == 0)
m.c2169 = Constraint(expr=m.x353*m.x1160 - m.x527*m.x1022 == 0)
m.c2170 = Constraint(expr=m.x353*m.x1161 - m.x528*m.x1022 == 0)
m.c2171 = Constraint(expr=m.x353*m.x1162 - m.x529*m.x1022 == 0)
m.c2172 = Constraint(expr=m.x353*m.x1163 - m.x530*m.x1022 == 0)
m.c2173 = Constraint(expr=m.x353*m.x1164 - m.x531*m.x1022 == 0)
m.c2174 = Constraint(expr=m.x353*m.x1165 - m.x532*m.x1022 == 0)
m.c2175 = Constraint(expr=m.x353*m.x1166 - m.x533*m.x1022 == 0)
m.c2176 = Constraint(expr=m.x354*m.x1167 - m.x534*m.x1023 == 0)
m.c2177 = Constraint(expr=m.x354*m.x1168 - m.x535*m.x1023 == 0)
m.c2178 = Constraint(expr=m.x354*m.x1169 - m.x536*m.x1023 == 0)
m.c2179 = Constraint(expr=m.x354*m.x1170 - m.x537*m.x1023 == 0)
m.c2180 = Constraint(expr=m.x354*m.x1171 - m.x538*m.x1023 == 0)
m.c2181 = Constraint(expr=m.x354*m.x1172 - m.x539*m.x1023 == 0)
m.c2182 = Constraint(expr=m.x354*m.x1173 - m.x540*m.x1023 == 0)
m.c2183 = Constraint(expr=m.x355*m.x1174 - m.x541*m.x1024 == 0)
m.c2184 = Constraint(expr=m.x355*m.x1175 - m.x542*m.x1024 == 0)
m.c2185 = Constraint(expr=m.x355*m.x1176 - m.x543*m.x1024 == 0)
m.c2186 = Constraint(expr=m.x355*m.x1177 - m.x544*m.x1024 == 0)
m.c2187 = Constraint(expr=m.x355*m.x1178 - m.x545*m.x1024 == 0)
m.c2188 = Constraint(expr=m.x355*m.x1179 - m.x546*m.x1024 == 0)
m.c2189 = Constraint(expr=m.x355*m.x1180 - m.x547*m.x1024 == 0)
m.c2190 = Constraint(expr=m.x356*m.x1174 - m.x548*m.x1024 == 0)
m.c2191 = Constraint(expr=m.x356*m.x1175 - m.x549*m.x1024 == 0)
m.c2192 = Constraint(expr=m.x356*m.x1176 - m.x550*m.x1024 == 0)
m.c2193 = Constraint(expr=m.x356*m.x1177 - m.x551*m.x1024 == 0)
m.c2194 = Constraint(expr=m.x356*m.x1178 - m.x552*m.x1024 == 0)
m.c2195 = Constraint(expr=m.x356*m.x1179 - m.x553*m.x1024 == 0)
m.c2196 = Constraint(expr=m.x356*m.x1180 - m.x554*m.x1024 == 0)
m.c2197 = Constraint(expr=m.x357*m.x1181 - m.x555*m.x1025 == 0)
m.c2198 = Constraint(expr=m.x357*m.x1182 - m.x556*m.x1025 == 0)
m.c2199 = Constraint(expr=m.x357*m.x1183 - m.x557*m.x1025 == 0)
m.c2200 = Constraint(expr=m.x357*m.x1184 - m.x558*m.x1025 == 0)
m.c2201 = Constraint(expr=m.x357*m.x1185 - m.x559*m.x1025 == 0)
m.c2202 = Constraint(expr=m.x357*m.x1186 - m.x560*m.x1025 == 0)
m.c2203 = Constraint(expr=m.x357*m.x1187 - m.x561*m.x1025 == 0)
m.c2204 = Constraint(expr=m.x358*m.x1181 - m.x562*m.x1025 == 0)
m.c2205 = Constraint(expr=m.x358*m.x1182 - m.x563*m.x1025 == 0)
m.c2206 = Constraint(expr=m.x358*m.x1183 - m.x564*m.x1025 == 0)
m.c2207 = Constraint(expr=m.x358*m.x1184 - m.x565*m.x1025 == 0)
m.c2208 = Constraint(expr=m.x358*m.x1185 - m.x566*m.x1025 == 0)
m.c2209 = Constraint(expr=m.x358*m.x1186 - m.x567*m.x1025 == 0)
m.c2210 = Constraint(expr=m.x358*m.x1187 - m.x568*m.x1025 == 0)
m.c2211 = Constraint(expr=m.x359*m.x1181 - m.x569*m.x1025 == 0)
m.c2212 = Constraint(expr=m.x359*m.x1182 - m.x570*m.x1025 == 0)
m.c2213 = Constraint(expr=m.x359*m.x1183 - m.x571*m.x1025 == 0)
m.c2214 = Constraint(expr=m.x359*m.x1184 - m.x572*m.x1025 == 0)
m.c2215 = Constraint(expr=m.x359*m.x1185 - m.x573*m.x1025 == 0)
m.c2216 = Constraint(expr=m.x359*m.x1186 - m.x574*m.x1025 == 0)
m.c2217 = Constraint(expr=m.x359*m.x1187 - m.x575*m.x1025 == 0)
m.c2218 = Constraint(expr=m.x360*m.x1188 - m.x576*m.x1026 == 0)
m.c2219 = Constraint(expr=m.x360*m.x1189 - m.x577*m.x1026 == 0)
m.c2220 = Constraint(expr=m.x360*m.x1190 - m.x578*m.x1026 == 0)
m.c2221 = Constraint(expr=m.x360*m.x1191 - m.x579*m.x1026 == 0)
m.c2222 = Constraint(expr=m.x360*m.x1192 - m.x580*m.x1026 == 0)
m.c2223 = Constraint(expr=m.x360*m.x1193 - m.x581*m.x1026 == 0)
m.c2224 = Constraint(expr=m.x360*m.x1194 - m.x582*m.x1026 == 0)
m.c2225 = Constraint(expr=m.x361*m.x1188 - m.x583*m.x1026 == 0)
m.c2226 = Constraint(expr=m.x361*m.x1189 - m.x584*m.x1026 == 0)
m.c2227 = Constraint(expr=m.x361*m.x1190 - m.x585*m.x1026 == 0)
m.c2228 = Constraint(expr=m.x361*m.x1191 - m.x586*m.x1026 == 0)
m.c2229 = Constraint(expr=m.x361*m.x1192 - m.x587*m.x1026 == 0)
m.c2230 = Constraint(expr=m.x361*m.x1193 - m.x588*m.x1026 == 0)
m.c2231 = Constraint(expr=m.x361*m.x1194 - m.x589*m.x1026 == 0)
m.c2232 = Constraint(expr=m.x362*m.x1195 - m.x590*m.x1027 == 0)
m.c2233 = Constraint(expr=m.x362*m.x1196 - m.x591*m.x1027 == 0)
m.c2234 = Constraint(expr=m.x362*m.x1197 - m.x592*m.x1027 == 0)
m.c2235 = Constraint(expr=m.x362*m.x1198 - m.x593*m.x1027 == 0)
m.c2236 = Constraint(expr=m.x362*m.x1199 - m.x594*m.x1027 == 0)
m.c2237 = Constraint(expr=m.x362*m.x1200 - m.x595*m.x1027 == 0)
m.c2238 = Constraint(expr=m.x362*m.x1201 - m.x596*m.x1027 == 0)
m.c2239 = Constraint(expr=m.x363*m.x1202 - m.x597*m.x1028 == 0)
m.c2240 = Constraint(expr=m.x363*m.x1203 - m.x598*m.x1028 == 0)
m.c2241 = Constraint(expr=m.x363*m.x1204 - m.x599*m.x1028 == 0)
m.c2242 = Constraint(expr=m.x363*m.x1205 - m.x600*m.x1028 == 0)
m.c2243 = Constraint(expr=m.x363*m.x1206 - m.x601*m.x1028 == 0)
m.c2244 = Constraint(expr=m.x363*m.x1207 - m.x602*m.x1028 == 0)
m.c2245 = Constraint(expr=m.x363*m.x1208 - m.x603*m.x1028 == 0)
m.c2246 = Constraint(expr=m.x364*m.x1202 - m.x604*m.x1028 == 0)
m.c2247 = Constraint(expr=m.x364*m.x1203 - m.x605*m.x1028 == 0)
m.c2248 = Constraint(expr=m.x364*m.x1204 - m.x606*m.x1028 == 0)
m.c2249 = Constraint(expr=m.x364*m.x1205 - m.x607*m.x1028 == 0)
m.c2250 = Constraint(expr=m.x364*m.x1206 - m.x608*m.x1028 == 0)
m.c2251 = Constraint(expr=m.x364*m.x1207 - m.x609*m.x1028 == 0)
m.c2252 = Constraint(expr=m.x364*m.x1208 - m.x610*m.x1028 == 0)
m.c2253 = Constraint(expr=m.x365*m.x1209 - m.x611*m.x1029 == 0)
m.c2254 = Constraint(expr=m.x365*m.x1210 - m.x612*m.x1029 == 0)
m.c2255 = Constraint(expr=m.x365*m.x1211 - m.x613*m.x1029 == 0)
m.c2256 = Constraint(expr=m.x365*m.x1212 - m.x614*m.x1029 == 0)
m.c2257 = Constraint(expr=m.x365*m.x1213 - m.x615*m.x1029 == 0)
m.c2258 = Constraint(expr=m.x365*m.x1214 - m.x616*m.x1029 == 0)
m.c2259 = Constraint(expr=m.x365*m.x1215 - m.x617*m.x1029 == 0)
m.c2260 = Constraint(expr=m.x366*m.x1230 - m.x618*m.x1032 == 0)
m.c2261 = Constraint(expr=m.x366*m.x1231 - m.x619*m.x1032 == 0)
m.c2262 = Constraint(expr=m.x366*m.x1232 - m.x620*m.x1032 == 0)
m.c2263 = Constraint(expr=m.x366*m.x1233 - m.x621*m.x1032 == 0)
m.c2264 = Constraint(expr=m.x366*m.x1234 - m.x622*m.x1032 == 0)
m.c2265 = Constraint(expr=m.x366*m.x1235 - m.x623*m.x1032 == 0)
m.c2266 = Constraint(expr=m.x366*m.x1236 - m.x624*m.x1032 == 0)
m.c2267 = Constraint(expr=m.x367*m.x1237 - m.x625*m.x1033 == 0)
m.c2268 = Constraint(expr=m.x367*m.x1238 - m.x626*m.x1033 == 0)
m.c2269 = Constraint(expr=m.x367*m.x1239 - m.x627*m.x1033 == 0)
m.c2270 = Constraint(expr=m.x367*m.x1240 - m.x628*m.x1033 == 0)
m.c2271 = Constraint(expr=m.x367*m.x1241 - m.x629*m.x1033 == 0)
m.c2272 = Constraint(expr=m.x367*m.x1242 - m.x630*m.x1033 == 0)
m.c2273 = Constraint(expr=m.x367*m.x1243 - m.x631*m.x1033 == 0)
m.c2274 = Constraint(expr=m.x368*m.x1244 - m.x632*m.x1034 == 0)
m.c2275 = Constraint(expr=m.x368*m.x1245 - m.x633*m.x1034 == 0)
m.c2276 = Constraint(expr=m.x368*m.x1246 - m.x634*m.x1034 == 0)
m.c2277 = Constraint(expr=m.x368*m.x1247 - m.x635*m.x1034 == 0)
m.c2278 = Constraint(expr=m.x368*m.x1248 - m.x636*m.x1034 == 0)
m.c2279 = Constraint(expr=m.x368*m.x1249 - m.x637*m.x1034 == 0)
m.c2280 = Constraint(expr=m.x368*m.x1250 - m.x638*m.x1034 == 0)
m.c2281 = Constraint(expr=m.x369*m.x1251 - m.x639*m.x1035 == 0)
m.c2282 = Constraint(expr=m.x369*m.x1252 - m.x640*m.x1035 == 0)
m.c2283 = Constraint(expr=m.x369*m.x1253 - m.x641*m.x1035 == 0)
m.c2284 = Constraint(expr=m.x369*m.x1254 - m.x642*m.x1035 == 0)
m.c2285 = Constraint(expr=m.x369*m.x1255 - m.x643*m.x1035 == 0)
m.c2286 = Constraint(expr=m.x369*m.x1256 - m.x644*m.x1035 == 0)
m.c2287 = Constraint(expr=m.x369*m.x1257 - m.x645*m.x1035 == 0)
m.c2288 = Constraint(expr=m.x370*m.x1251 - m.x646*m.x1035 == 0)
m.c2289 = Constraint(expr=m.x370*m.x1252 - m.x647*m.x1035 == 0)
m.c2290 = Constraint(expr=m.x370*m.x1253 - m.x648*m.x1035 == 0)
m.c2291 = Constraint(expr=m.x370*m.x1254 - m.x649*m.x1035 == 0)
m.c2292 = Constraint(expr=m.x370*m.x1255 - m.x650*m.x1035 == 0)
m.c2293 = Constraint(expr=m.x370*m.x1256 - m.x651*m.x1035 == 0)
m.c2294 = Constraint(expr=m.x370*m.x1257 - m.x652*m.x1035 == 0)
m.c2295 = Constraint(expr=m.x371*m.x1258 - m.x653*m.x1036 == 0)
m.c2296 = Constraint(expr=m.x371*m.x1259 - m.x654*m.x1036 == 0)
m.c2297 = Constraint(expr=m.x371*m.x1260 - m.x655*m.x1036 == 0)
m.c2298 = Constraint(expr=m.x371*m.x1261 - m.x656*m.x1036 == 0)
m.c2299 = Constraint(expr=m.x371*m.x1262 - m.x657*m.x1036 == 0)
m.c2300 = Constraint(expr=m.x371*m.x1263 - m.x658*m.x1036 == 0)
m.c2301 = Constraint(expr=m.x371*m.x1264 - m.x659*m.x1036 == 0)
m.c2302 = Constraint(expr=m.x372*m.x1258 - m.x660*m.x1036 == 0)
m.c2303 = Constraint(expr=m.x372*m.x1259 - m.x661*m.x1036 == 0)
m.c2304 = Constraint(expr=m.x372*m.x1260 - m.x662*m.x1036 == 0)
m.c2305 = Constraint(expr=m.x372*m.x1261 - m.x663*m.x1036 == 0)
m.c2306 = Constraint(expr=m.x372*m.x1262 - m.x664*m.x1036 == 0)
m.c2307 = Constraint(expr=m.x372*m.x1263 - m.x665*m.x1036 == 0)
m.c2308 = Constraint(expr=m.x372*m.x1264 - m.x666*m.x1036 == 0)
m.c2309 = Constraint(expr=m.x373*m.x1258 - m.x667*m.x1036 == 0)
m.c2310 = Constraint(expr=m.x373*m.x1259 - m.x668*m.x1036 == 0)
m.c2311 = Constraint(expr=m.x373*m.x1260 - m.x669*m.x1036 == 0)
m.c2312 = Constraint(expr=m.x373*m.x1261 - m.x670*m.x1036 == 0)
m.c2313 = Constraint(expr=m.x373*m.x1262 - m.x671*m.x1036 == 0)
m.c2314 = Constraint(expr=m.x373*m.x1263 - m.x672*m.x1036 == 0)
m.c2315 = Constraint(expr=m.x373*m.x1264 - m.x673*m.x1036 == 0)
m.c2316 = Constraint(expr=m.x374*m.x1265 - m.x674*m.x1037 == 0)
m.c2317 = Constraint(expr=m.x374*m.x1266 - m.x675*m.x1037 == 0)
m.c2318 = Constraint(expr=m.x374*m.x1267 - m.x676*m.x1037 == 0)
m.c2319 = Constraint(expr=m.x374*m.x1268 - m.x677*m.x1037 == 0)
m.c2320 = Constraint(expr=m.x374*m.x1269 - m.x678*m.x1037 == 0)
m.c2321 = Constraint(expr=m.x374*m.x1270 - m.x679*m.x1037 == 0)
m.c2322 = Constraint(expr=m.x374*m.x1271 - m.x680*m.x1037 == 0)
m.c2323 = Constraint(expr=m.x375*m.x1265 - m.x681*m.x1037 == 0)
m.c2324 = Constraint(expr=m.x375*m.x1266 - m.x682*m.x1037 == 0)
m.c2325 = Constraint(expr=m.x375*m.x1267 - m.x683*m.x1037 == 0)
m.c2326 = Constraint(expr=m.x375*m.x1268 - m.x684*m.x1037 == 0)
m.c2327 = Constraint(expr=m.x375*m.x1269 - m.x685*m.x1037 == 0)
m.c2328 = Constraint(expr=m.x375*m.x1270 - m.x686*m.x1037 == 0)
m.c2329 = Constraint(expr=m.x375*m.x1271 - m.x687*m.x1037 == 0)
m.c2330 = Constraint(expr=m.x376*m.x1272 - m.x688*m.x1038 == 0)
m.c2331 = Constraint(expr=m.x376*m.x1273 - m.x689*m.x1038 == 0)
m.c2332 = Constraint(expr=m.x376*m.x1274 - m.x690*m.x1038 == 0)
m.c2333 = Constraint(expr=m.x376*m.x1275 - m.x691*m.x1038 == 0)
m.c2334 = Constraint(expr=m.x376*m.x1276 - m.x692*m.x1038 == 0)
m.c2335 = Constraint(expr=m.x376*m.x1277 - m.x693*m.x1038 == 0)
m.c2336 = Constraint(expr=m.x376*m.x1278 - m.x694*m.x1038 == 0)
m.c2337 = Constraint(expr=m.x377*m.x1279 - m.x695*m.x1039 == 0)
m.c2338 = Constraint(expr=m.x377*m.x1280 - m.x696*m.x1039 == 0)
m.c2339 = Constraint(expr=m.x377*m.x1281 - m.x697*m.x1039 == 0)
m.c2340 = Constraint(expr=m.x377*m.x1282 - m.x698*m.x1039 == 0)
m.c2341 = Constraint(expr=m.x377*m.x1283 - m.x699*m.x1039 == 0)
m.c2342 = Constraint(expr=m.x377*m.x1284 - m.x700*m.x1039 == 0)
m.c2343 = Constraint(expr=m.x377*m.x1285 - m.x701*m.x1039 == 0)
m.c2344 = Constraint(expr=m.x378*m.x1279 - m.x702*m.x1039 == 0)
m.c2345 = Constraint(expr=m.x378*m.x1280 - m.x703*m.x1039 == 0)
m.c2346 = Constraint(expr=m.x378*m.x1281 - m.x704*m.x1039 == 0)
m.c2347 = Constraint(expr=m.x378*m.x1282 - m.x705*m.x1039 == 0)
m.c2348 = Constraint(expr=m.x378*m.x1283 - m.x706*m.x1039 == 0)
m.c2349 = Constraint(expr=m.x378*m.x1284 - m.x707*m.x1039 == 0)
m.c2350 = Constraint(expr=m.x378*m.x1285 - m.x708*m.x1039 == 0)
m.c2351 = Constraint(expr=m.x379*m.x1286 - m.x709*m.x1040 == 0)
m.c2352 = Constraint(expr=m.x379*m.x1287 - m.x710*m.x1040 == 0)
m.c2353 = Constraint(expr=m.x379*m.x1288 - m.x711*m.x1040 == 0)
m.c2354 = Constraint(expr=m.x379*m.x1289 - m.x712*m.x1040 == 0)
m.c2355 = Constraint(expr=m.x379*m.x1290 - m.x713*m.x1040 == 0)
m.c2356 = Constraint(expr=m.x379*m.x1291 - m.x714*m.x1040 == 0)
m.c2357 = Constraint(expr=m.x379*m.x1292 - m.x715*m.x1040 == 0)
m.c2358 = Constraint(expr=m.x380*m.x1307 - m.x716*m.x1043 == 0)
m.c2359 = Constraint(expr=m.x380*m.x1308 - m.x717*m.x1043 == 0)
m.c2360 = Constraint(expr=m.x380*m.x1309 - m.x718*m.x1043 == 0)
m.c2361 = Constraint(expr=m.x380*m.x1310 - m.x719*m.x1043 == 0)
m.c2362 = Constraint(expr=m.x380*m.x1311 - m.x720*m.x1043 == 0)
m.c2363 = Constraint(expr=m.x380*m.x1312 - m.x721*m.x1043 == 0)
m.c2364 = Constraint(expr=m.x380*m.x1313 - m.x722*m.x1043 == 0)
m.c2365 = Constraint(expr=m.x381*m.x1314 - m.x723*m.x1044 == 0)
m.c2366 = Constraint(expr=m.x381*m.x1315 - m.x724*m.x1044 == 0)
m.c2367 = Constraint(expr=m.x381*m.x1316 - m.x725*m.x1044 == 0)
m.c2368 = Constraint(expr=m.x381*m.x1317 - m.x726*m.x1044 == 0)
m.c2369 = Constraint(expr=m.x381*m.x1318 - m.x727*m.x1044 == 0)
m.c2370 = Constraint(expr=m.x381*m.x1319 - m.x728*m.x1044 == 0)
m.c2371 = Constraint(expr=m.x381*m.x1320 - m.x729*m.x1044 == 0)
m.c2372 = Constraint(expr=m.x382*m.x1321 - m.x730*m.x1045 == 0)
m.c2373 = Constraint(expr=m.x382*m.x1322 - m.x731*m.x1045 == 0)
m.c2374 = Constraint(expr=m.x382*m.x1323 - m.x732*m.x1045 == 0)
m.c2375 = Constraint(expr=m.x382*m.x1324 - m.x733*m.x1045 == 0)
m.c2376 = Constraint(expr=m.x382*m.x1325 - m.x734*m.x1045 == 0)
m.c2377 = Constraint(expr=m.x382*m.x1326 - m.x735*m.x1045 == 0)
m.c2378 = Constraint(expr=m.x382*m.x1327 - m.x736*m.x1045 == 0)
m.c2379 = Constraint(expr=m.x383*m.x1328 - m.x737*m.x1046 == 0)
m.c2380 = Constraint(expr=m.x383*m.x1329 - m.x738*m.x1046 == 0)
m.c2381 = Constraint(expr=m.x383*m.x1330 - m.x739*m.x1046 == 0)
m.c2382 = Constraint(expr=m.x383*m.x1331 - m.x740*m.x1046 == 0)
m.c2383 = Constraint(expr=m.x383*m.x1332 - m.x741*m.x1046 == 0)
m.c2384 = Constraint(expr=m.x383*m.x1333 - m.x742*m.x1046 == 0)
m.c2385 = Constraint(expr=m.x383*m.x1334 - m.x743*m.x1046 == 0)
m.c2386 = Constraint(expr=m.x384*m.x1328 - m.x744*m.x1046 == 0)
m.c2387 = Constraint(expr=m.x384*m.x1329 - m.x745*m.x1046 == 0)
m.c2388 = Constraint(expr=m.x384*m.x1330 - m.x746*m.x1046 == 0)
m.c2389 = Constraint(expr=m.x384*m.x1331 - m.x747*m.x1046 == 0)
m.c2390 = Constraint(expr=m.x384*m.x1332 - m.x748*m.x1046 == 0)
m.c2391 = Constraint(expr=m.x384*m.x1333 - m.x749*m.x1046 == 0)
m.c2392 = Constraint(expr=m.x384*m.x1334 - m.x750*m.x1046 == 0)
m.c2393 = Constraint(expr=m.x385*m.x1335 - m.x751*m.x1047 == 0)
m.c2394 = Constraint(expr=m.x385*m.x1336 - m.x752*m.x1047 == 0)
m.c2395 = Constraint(expr=m.x385*m.x1337 - m.x753*m.x1047 == 0)
m.c2396 = Constraint(expr=m.x385*m.x1338 - m.x754*m.x1047 == 0)
m.c2397 = Constraint(expr=m.x385*m.x1339 - m.x755*m.x1047 == 0)
m.c2398 = Constraint(expr=m.x385*m.x1340 - m.x756*m.x1047 == 0)
m.c2399 = Constraint(expr=m.x385*m.x1341 - m.x757*m.x1047 == 0)
m.c2400 = Constraint(expr=m.x386*m.x1335 - m.x758*m.x1047 == 0)
m.c2401 = Constraint(expr=m.x386*m.x1336 - m.x759*m.x1047 == 0)
m.c2402 = Constraint(expr=m.x386*m.x1337 - m.x760*m.x1047 == 0)
m.c2403 = Constraint(expr=m.x386*m.x1338 - m.x761*m.x1047 == 0)
m.c2404 = Constraint(expr=m.x386*m.x1339 - m.x762*m.x1047 == 0)
m.c2405 = Constraint(expr=m.x386*m.x1340 - m.x763*m.x1047 == 0)
m.c2406 = Constraint(expr=m.x386*m.x1341 - m.x764*m.x1047 == 0)
m.c2407 = Constraint(expr=m.x387*m.x1335 - m.x765*m.x1047 == 0)
m.c2408 = Constraint(expr=m.x387*m.x1336 - m.x766*m.x1047 == 0)
m.c2409 = Constraint(expr=m.x387*m.x1337 - m.x767*m.x1047 == 0)
m.c2410 = Constraint(expr=m.x387*m.x1338 - m.x768*m.x1047 == 0)
m.c2411 = Constraint(expr=m.x387*m.x1339 - m.x769*m.x1047 == 0)
m.c2412 = Constraint(expr=m.x387*m.x1340 - m.x770*m.x1047 == 0)
m.c2413 = Constraint(expr=m.x387*m.x1341 - m.x771*m.x1047 == 0)
m.c2414 = Constraint(expr=m.x388*m.x1342 - m.x772*m.x1048 == 0)
m.c2415 = Constraint(expr=m.x388*m.x1343 - m.x773*m.x1048 == 0)
m.c2416 = Constraint(expr=m.x388*m.x1344 - m.x774*m.x1048 == 0)
m.c2417 = Constraint(expr=m.x388*m.x1345 - m.x775*m.x1048 == 0)
m.c2418 = Constraint(expr=m.x388*m.x1346 - m.x776*m.x1048 == 0)
m.c2419 = Constraint(expr=m.x388*m.x1347 - m.x777*m.x1048 == 0)
m.c2420 = Constraint(expr=m.x388*m.x1348 - m.x778*m.x1048 == 0)
m.c2421 = Constraint(expr=m.x389*m.x1342 - m.x779*m.x1048 == 0)
m.c2422 = Constraint(expr=m.x389*m.x1343 - m.x780*m.x1048 == 0)
m.c2423 = Constraint(expr=m.x389*m.x1344 - m.x781*m.x1048 == 0)
m.c2424 = Constraint(expr=m.x389*m.x1345 - m.x782*m.x1048 == 0)
m.c2425 = Constraint(expr=m.x389*m.x1346 - m.x783*m.x1048 == 0)
m.c2426 = Constraint(expr=m.x389*m.x1347 - m.x784*m.x1048 == 0)
m.c2427 = Constraint(expr=m.x389*m.x1348 - m.x785*m.x1048 == 0)
m.c2428 = Constraint(expr=m.x390*m.x1349 - m.x786*m.x1049 == 0)
m.c2429 = Constraint(expr=m.x390*m.x1350 - m.x787*m.x1049 == 0)
m.c2430 = Constraint(expr=m.x390*m.x1351 - m.x788*m.x1049 == 0)
m.c2431 = Constraint(expr=m.x390*m.x1352 - m.x789*m.x1049 == 0)
m.c2432 = Constraint(expr=m.x390*m.x1353 - m.x790*m.x1049 == 0)
m.c2433 = Constraint(expr=m.x390*m.x1354 - m.x791*m.x1049 == 0)
m.c2434 = Constraint(expr=m.x390*m.x1355 - m.x792*m.x1049 == 0)
m.c2435 = Constraint(expr=m.x391*m.x1356 - m.x793*m.x1050 == 0)
m.c2436 = Constraint(expr=m.x391*m.x1357 - m.x794*m.x1050 == 0)
m.c2437 = Constraint(expr=m.x391*m.x1358 - m.x795*m.x1050 == 0)
m.c2438 = Constraint(expr=m.x391*m.x1359 - m.x796*m.x1050 == 0)
m.c2439 = Constraint(expr=m.x391*m.x1360 - m.x797*m.x1050 == 0)
m.c2440 = Constraint(expr=m.x391*m.x1361 - m.x798*m.x1050 == 0)
m.c2441 = Constraint(expr=m.x391*m.x1362 - m.x799*m.x1050 == 0)
m.c2442 = Constraint(expr=m.x392*m.x1356 - m.x800*m.x1050 == 0)
m.c2443 = Constraint(expr=m.x392*m.x1357 - m.x801*m.x1050 == 0)
m.c2444 = Constraint(expr=m.x392*m.x1358 - m.x802*m.x1050 == 0)
m.c2445 = Constraint(expr=m.x392*m.x1359 - m.x803*m.x1050 == 0)
m.c2446 = Constraint(expr=m.x392*m.x1360 - m.x804*m.x1050 == 0)
m.c2447 = Constraint(expr=m.x392*m.x1361 - m.x805*m.x1050 == 0)
m.c2448 = Constraint(expr=m.x392*m.x1362 - m.x806*m.x1050 == 0)
m.c2449 = Constraint(expr=m.x393*m.x1363 - m.x807*m.x1051 == 0)
m.c2450 = Constraint(expr=m.x393*m.x1364 - m.x808*m.x1051 == 0)
m.c2451 = Constraint(expr=m.x393*m.x1365 - m.x809*m.x1051 == 0)
m.c2452 = Constraint(expr=m.x393*m.x1366 - m.x810*m.x1051 == 0)
m.c2453 = Constraint(expr=m.x393*m.x1367 - m.x811*m.x1051 == 0)
m.c2454 = Constraint(expr=m.x393*m.x1368 - m.x812*m.x1051 == 0)
m.c2455 = Constraint(expr=m.x393*m.x1369 - m.x813*m.x1051 == 0)
m.c2456 = Constraint(expr=m.x394*m.x1384 - m.x814*m.x1054 == 0)
m.c2457 = Constraint(expr=m.x394*m.x1385 - m.x815*m.x1054 == 0)
m.c2458 = Constraint(expr=m.x394*m.x1386 - m.x816*m.x1054 == 0)
m.c2459 = Constraint(expr=m.x394*m.x1387 - m.x817*m.x1054 == 0)
m.c2460 = Constraint(expr=m.x394*m.x1388 - m.x818*m.x1054 == 0)
m.c2461 = Constraint(expr=m.x394*m.x1389 - m.x819*m.x1054 == 0)
m.c2462 = Constraint(expr=m.x394*m.x1390 - m.x820*m.x1054 == 0)
m.c2463 = Constraint(expr=m.x395*m.x1391 - m.x821*m.x1055 == 0)
m.c2464 = Constraint(expr=m.x395*m.x1392 - m.x822*m.x1055 == 0)
m.c2465 = Constraint(expr=m.x395*m.x1393 - m.x823*m.x1055 == 0)
m.c2466 = Constraint(expr=m.x395*m.x1394 - m.x824*m.x1055 == 0)
m.c2467 = Constraint(expr=m.x395*m.x1395 - m.x825*m.x1055 == 0)
m.c2468 = Constraint(expr=m.x395*m.x1396 - m.x826*m.x1055 == 0)
m.c2469 = Constraint(expr=m.x395*m.x1397 - m.x827*m.x1055 == 0)
m.c2470 = Constraint(expr=m.x396*m.x1398 - m.x828*m.x1056 == 0)
m.c2471 = Constraint(expr=m.x396*m.x1399 - m.x829*m.x1056 == 0)
m.c2472 = Constraint(expr=m.x396*m.x1400 - m.x830*m.x1056 == 0)
m.c2473 = Constraint(expr=m.x396*m.x1401 - m.x831*m.x1056 == 0)
m.c2474 = Constraint(expr=m.x396*m.x1402 - m.x832*m.x1056 == 0)
m.c2475 = Constraint(expr=m.x396*m.x1403 - m.x833*m.x1056 == 0)
m.c2476 = Constraint(expr=m.x396*m.x1404 - m.x834*m.x1056 == 0)
m.c2477 = Constraint(expr=m.x397*m.x1405 - m.x835*m.x1057 == 0)
m.c2478 = Constraint(expr=m.x397*m.x1406 - m.x836*m.x1057 == 0)
m.c2479 = Constraint(expr=m.x397*m.x1407 - m.x837*m.x1057 == 0)
m.c2480 = Constraint(expr=m.x397*m.x1408 - m.x838*m.x1057 == 0)
m.c2481 = Constraint(expr=m.x397*m.x1409 - m.x839*m.x1057 == 0)
m.c2482 = Constraint(expr=m.x397*m.x1410 - m.x840*m.x1057 == 0)
m.c2483 = Constraint(expr=m.x397*m.x1411 - m.x841*m.x1057 == 0)
m.c2484 = Constraint(expr=m.x398*m.x1405 - m.x842*m.x1057 == 0)
m.c2485 = Constraint(expr=m.x398*m.x1406 - m.x843*m.x1057 == 0)
m.c2486 = Constraint(expr=m.x398*m.x1407 - m.x844*m.x1057 == 0)
m.c2487 = Constraint(expr=m.x398*m.x1408 - m.x845*m.x1057 == 0)
m.c2488 = Constraint(expr=m.x398*m.x1409 - m.x846*m.x1057 == 0)
m.c2489 = Constraint(expr=m.x398*m.x1410 - m.x847*m.x1057 == 0)
m.c2490 = Constraint(expr=m.x398*m.x1411 - m.x848*m.x1057 == 0)
m.c2491 = Constraint(expr=m.x399*m.x1412 - m.x849*m.x1058 == 0)
m.c2492 = Constraint(expr=m.x399*m.x1413 - m.x850*m.x1058 == 0)
m.c2493 = Constraint(expr=m.x399*m.x1414 - m.x851*m.x1058 == 0)
m.c2494 = Constraint(expr=m.x399*m.x1415 - m.x852*m.x1058 == 0)
m.c2495 = Constraint(expr=m.x399*m.x1416 - m.x853*m.x1058 == 0)
m.c2496 = Constraint(expr=m.x399*m.x1417 - m.x854*m.x1058 == 0)
m.c2497 = Constraint(expr=m.x399*m.x1418 - m.x855*m.x1058 == 0)
m.c2498 = Constraint(expr=m.x400*m.x1412 - m.x856*m.x1058 == 0)
m.c2499 = Constraint(expr=m.x400*m.x1413 - m.x857*m.x1058 == 0)
m.c2500 = Constraint(expr=m.x400*m.x1414 - m.x858*m.x1058 == 0)
m.c2501 = Constraint(expr=m.x400*m.x1415 - m.x859*m.x1058 == 0)
m.c2502 = Constraint(expr=m.x400*m.x1416 - m.x860*m.x1058 == 0)
m.c2503 = Constraint(expr=m.x400*m.x1417 - m.x861*m.x1058 == 0)
m.c2504 = Constraint(expr=m.x400*m.x1418 - m.x862*m.x1058 == 0)
m.c2505 = Constraint(expr=m.x401*m.x1412 - m.x863*m.x1058 == 0)
m.c2506 = Constraint(expr=m.x401*m.x1413 - m.x864*m.x1058 == 0)
m.c2507 = Constraint(expr=m.x401*m.x1414 - m.x865*m.x1058 == 0)
m.c2508 = Constraint(expr=m.x401*m.x1415 - m.x866*m.x1058 == 0)
m.c2509 = Constraint(expr=m.x401*m.x1416 - m.x867*m.x1058 == 0)
m.c2510 = Constraint(expr=m.x401*m.x1417 - m.x868*m.x1058 == 0)
m.c2511 = Constraint(expr=m.x401*m.x1418 - m.x869*m.x1058 == 0)
m.c2512 = Constraint(expr=m.x402*m.x1419 - m.x870*m.x1059 == 0)
m.c2513 = Constraint(expr=m.x402*m.x1420 - m.x871*m.x1059 == 0)
m.c2514 = Constraint(expr=m.x402*m.x1421 - m.x872*m.x1059 == 0)
m.c2515 = Constraint(expr=m.x402*m.x1422 - m.x873*m.x1059 == 0)
m.c2516 = Constraint(expr=m.x402*m.x1423 - m.x874*m.x1059 == 0)
m.c2517 = Constraint(expr=m.x402*m.x1424 - m.x875*m.x1059 == 0)
m.c2518 = Constraint(expr=m.x402*m.x1425 - m.x876*m.x1059 == 0)
m.c2519 = Constraint(expr=m.x403*m.x1419 - m.x877*m.x1059 == 0)
m.c2520 = Constraint(expr=m.x403*m.x1420 - m.x878*m.x1059 == 0)
m.c2521 = Constraint(expr=m.x403*m.x1421 - m.x879*m.x1059 == 0)
m.c2522 = Constraint(expr=m.x403*m.x1422 - m.x880*m.x1059 == 0)
m.c2523 = Constraint(expr=m.x403*m.x1423 - m.x881*m.x1059 == 0)
m.c2524 = Constraint(expr=m.x403*m.x1424 - m.x882*m.x1059 == 0)
m.c2525 = Constraint(expr=m.x403*m.x1425 - m.x883*m.x1059 == 0)
m.c2526 = Constraint(expr=m.x404*m.x1426 - m.x884*m.x1060 == 0)
m.c2527 = Constraint(expr=m.x404*m.x1427 - m.x885*m.x1060 == 0)
m.c2528 = Constraint(expr=m.x404*m.x1428 - m.x886*m.x1060 == 0)
m.c2529 = Constraint(expr=m.x404*m.x1429 - m.x887*m.x1060 == 0)
m.c2530 = Constraint(expr=m.x404*m.x1430 - m.x888*m.x1060 == 0)
m.c2531 = Constraint(expr=m.x404*m.x1431 - m.x889*m.x1060 == 0)
m.c2532 = Constraint(expr=m.x404*m.x1432 - m.x890*m.x1060 == 0)
m.c2533 = Constraint(expr=m.x405*m.x1433 - m.x891*m.x1061 == 0)
m.c2534 = Constraint(expr=m.x405*m.x1434 - m.x892*m.x1061 == 0)
m.c2535 = Constraint(expr=m.x405*m.x1435 - m.x893*m.x1061 == 0)
m.c2536 = Constraint(expr=m.x405*m.x1436 - m.x894*m.x1061 == 0)
m.c2537 = Constraint(expr=m.x405*m.x1437 - m.x895*m.x1061 == 0)
m.c2538 = Constraint(expr=m.x405*m.x1438 - m.x896*m.x1061 == 0)
m.c2539 = Constraint(expr=m.x405*m.x1439 - m.x897*m.x1061 == 0)
m.c2540 = Constraint(expr=m.x406*m.x1433 - m.x898*m.x1061 == 0)
m.c2541 = Constraint(expr=m.x406*m.x1434 - m.x899*m.x1061 == 0)
m.c2542 = Constraint(expr=m.x406*m.x1435 - m.x900*m.x1061 == 0)
m.c2543 = Constraint(expr=m.x406*m.x1436 - m.x901*m.x1061 == 0)
m.c2544 = Constraint(expr=m.x406*m.x1437 - m.x902*m.x1061 == 0)
m.c2545 = Constraint(expr=m.x406*m.x1438 - m.x903*m.x1061 == 0)
m.c2546 = Constraint(expr=m.x406*m.x1439 - m.x904*m.x1061 == 0)
m.c2547 = Constraint(expr=m.x407*m.x1440 - m.x905*m.x1062 == 0)
m.c2548 = Constraint(expr=m.x407*m.x1441 - m.x906*m.x1062 == 0)
m.c2549 = Constraint(expr=m.x407*m.x1442 - m.x907*m.x1062 == 0)
m.c2550 = Constraint(expr=m.x407*m.x1443 - m.x908*m.x1062 == 0)
m.c2551 = Constraint(expr=m.x407*m.x1444 - m.x909*m.x1062 == 0)
m.c2552 = Constraint(expr=m.x407*m.x1445 - m.x910*m.x1062 == 0)
m.c2553 = Constraint(expr=m.x407*m.x1446 - m.x911*m.x1062 == 0)
m.c2554 = Constraint(expr=m.x408*m.x1461 - m.x912*m.x1065 == 0)
m.c2555 = Constraint(expr=m.x408*m.x1462 - m.x913*m.x1065 == 0)
m.c2556 = Constraint(expr=m.x408*m.x1463 - m.x914*m.x1065 == 0)
m.c2557 = Constraint(expr=m.x408*m.x1464 - m.x915*m.x1065 == 0)
m.c2558 = Constraint(expr=m.x408*m.x1465 - m.x916*m.x1065 == 0)
m.c2559 = Constraint(expr=m.x408*m.x1466 - m.x917*m.x1065 == 0)
m.c2560 = Constraint(expr=m.x408*m.x1467 - m.x918*m.x1065 == 0)
m.c2561 = Constraint(expr=m.x409*m.x1468 - m.x919*m.x1066 == 0)
m.c2562 = Constraint(expr=m.x409*m.x1469 - m.x920*m.x1066 == 0)
m.c2563 = Constraint(expr=m.x409*m.x1470 - m.x921*m.x1066 == 0)
m.c2564 = Constraint(expr=m.x409*m.x1471 - m.x922*m.x1066 == 0)
m.c2565 = Constraint(expr=m.x409*m.x1472 - m.x923*m.x1066 == 0)
m.c2566 = Constraint(expr=m.x409*m.x1473 - m.x924*m.x1066 == 0)
m.c2567 = Constraint(expr=m.x409*m.x1474 - m.x925*m.x1066 == 0)
m.c2568 = Constraint(expr=m.x410*m.x1475 - m.x926*m.x1067 == 0)
m.c2569 = Constraint(expr=m.x410*m.x1476 - m.x927*m.x1067 == 0)
m.c2570 = Constraint(expr=m.x410*m.x1477 - m.x928*m.x1067 == 0)
m.c2571 = Constraint(expr=m.x410*m.x1478 - m.x929*m.x1067 == 0)
m.c2572 = Constraint(expr=m.x410*m.x1479 - m.x930*m.x1067 == 0)
m.c2573 = Constraint(expr=m.x410*m.x1480 - m.x931*m.x1067 == 0)
m.c2574 = Constraint(expr=m.x410*m.x1481 - m.x932*m.x1067 == 0)
m.c2575 = Constraint(expr=m.x411*m.x1482 - m.x933*m.x1068 == 0)
m.c2576 = Constraint(expr=m.x411*m.x1483 - m.x934*m.x1068 == 0)
m.c2577 = Constraint(expr=m.x411*m.x1484 - m.x935*m.x1068 == 0)
m.c2578 = Constraint(expr=m.x411*m.x1485 - m.x936*m.x1068 == 0)
m.c2579 = Constraint(expr=m.x411*m.x1486 - m.x937*m.x1068 == 0)
m.c2580 = Constraint(expr=m.x411*m.x1487 - m.x938*m.x1068 == 0)
m.c2581 = Constraint(expr=m.x411*m.x1488 - m.x939*m.x1068 == 0)
m.c2582 = Constraint(expr=m.x412*m.x1482 - m.x940*m.x1068 == 0)
m.c2583 = Constraint(expr=m.x412*m.x1483 - m.x941*m.x1068 == 0)
m.c2584 = Constraint(expr=m.x412*m.x1484 - m.x942*m.x1068 == 0)
m.c2585 = Constraint(expr=m.x412*m.x1485 - m.x943*m.x1068 == 0)
m.c2586 = Constraint(expr=m.x412*m.x1486 - m.x944*m.x1068 == 0)
m.c2587 = Constraint(expr=m.x412*m.x1487 - m.x945*m.x1068 == 0)
m.c2588 = Constraint(expr=m.x412*m.x1488 - m.x946*m.x1068 == 0)
m.c2589 = Constraint(expr=m.x413*m.x1489 - m.x947*m.x1069 == 0)
m.c2590 = Constraint(expr=m.x413*m.x1490 - m.x948*m.x1069 == 0)
m.c2591 = Constraint(expr=m.x413*m.x1491 - m.x949*m.x1069 == 0)
m.c2592 = Constraint(expr=m.x413*m.x1492 - m.x950*m.x1069 == 0)
m.c2593 = Constraint(expr=m.x413*m.x1493 - m.x951*m.x1069 == 0)
m.c2594 = Constraint(expr=m.x413*m.x1494 - m.x952*m.x1069 == 0)
m.c2595 = Constraint(expr=m.x413*m.x1495 - m.x953*m.x1069 == 0)
m.c2596 = Constraint(expr=m.x414*m.x1489 - m.x954*m.x1069 == 0)
m.c2597 = Constraint(expr=m.x414*m.x1490 - m.x955*m.x1069 == 0)
m.c2598 = Constraint(expr=m.x414*m.x1491 - m.x956*m.x1069 == 0)
m.c2599 = Constraint(expr=m.x414*m.x1492 - m.x957*m.x1069 == 0)
m.c2600 = Constraint(expr=m.x414*m.x1493 - m.x958*m.x1069 == 0)
m.c2601 = Constraint(expr=m.x414*m.x1494 - m.x959*m.x1069 == 0)
m.c2602 = Constraint(expr=m.x414*m.x1495 - m.x960*m.x1069 == 0)
m.c2603 = Constraint(expr=m.x415*m.x1489 - m.x961*m.x1069 == 0)
m.c2604 = Constraint(expr=m.x415*m.x1490 - m.x962*m.x1069 == 0)
m.c2605 = Constraint(expr=m.x415*m.x1491 - m.x963*m.x1069 == 0)
m.c2606 = Constraint(expr=m.x415*m.x1492 - m.x964*m.x1069 == 0)
m.c2607 = Constraint(expr=m.x415*m.x1493 - m.x965*m.x1069 == 0)
m.c2608 = Constraint(expr=m.x415*m.x1494 - m.x966*m.x1069 == 0)
m.c2609 = Constraint(expr=m.x415*m.x1495 - m.x967*m.x1069 == 0)
m.c2610 = Constraint(expr=m.x416*m.x1496 - m.x968*m.x1070 == 0)
m.c2611 = Constraint(expr=m.x416*m.x1497 - m.x969*m.x1070 == 0)
m.c2612 = Constraint(expr=m.x416*m.x1498 - m.x970*m.x1070 == 0)
m.c2613 = Constraint(expr=m.x416*m.x1499 - m.x971*m.x1070 == 0)
m.c2614 = Constraint(expr=m.x416*m.x1500 - m.x972*m.x1070 == 0)
m.c2615 = Constraint(expr=m.x416*m.x1501 - m.x973*m.x1070 == 0)
m.c2616 = Constraint(expr=m.x416*m.x1502 - m.x974*m.x1070 == 0)
m.c2617 = Constraint(expr=m.x417*m.x1496 - m.x975*m.x1070 == 0)
m.c2618 = Constraint(expr=m.x417*m.x1497 - m.x976*m.x1070 == 0)
m.c2619 = Constraint(expr=m.x417*m.x1498 - m.x977*m.x1070 == 0)
m.c2620 = Constraint(expr=m.x417*m.x1499 - m.x978*m.x1070 == 0)
m.c2621 = Constraint(expr=m.x417*m.x1500 - m.x979*m.x1070 == 0)
m.c2622 = Constraint(expr=m.x417*m.x1501 - m.x980*m.x1070 == 0)
m.c2623 = Constraint(expr=m.x417*m.x1502 - m.x981*m.x1070 == 0)
m.c2624 = Constraint(expr=m.x418*m.x1503 - m.x982*m.x1071 == 0)
m.c2625 = Constraint(expr=m.x418*m.x1504 - m.x983*m.x1071 == 0)
m.c2626 = Constraint(expr=m.x418*m.x1505 - m.x984*m.x1071 == 0)
m.c2627 = Constraint(expr=m.x418*m.x1506 - m.x985*m.x1071 == 0)
m.c2628 = Constraint(expr=m.x418*m.x1507 - m.x986*m.x1071 == 0)
m.c2629 = Constraint(expr=m.x418*m.x1508 - m.x987*m.x1071 == 0)
m.c2630 = Constraint(expr=m.x418*m.x1509 - m.x988*m.x1071 == 0)
m.c2631 = Constraint(expr=m.x419*m.x1510 - m.x989*m.x1072 == 0)
m.c2632 = Constraint(expr=m.x419*m.x1511 - m.x990*m.x1072 == 0)
m.c2633 = Constraint(expr=m.x419*m.x1512 - m.x991*m.x1072 == 0)
m.c2634 = Constraint(expr=m.x419*m.x1513 - m.x992*m.x1072 == 0)
m.c2635 = Constraint(expr=m.x419*m.x1514 - m.x993*m.x1072 == 0)
m.c2636 = Constraint(expr=m.x419*m.x1515 - m.x994*m.x1072 == 0)
m.c2637 = Constraint(expr=m.x419*m.x1516 - m.x995*m.x1072 == 0)
m.c2638 = Constraint(expr=m.x420*m.x1510 - m.x996*m.x1072 == 0)
m.c2639 = Constraint(expr=m.x420*m.x1511 - m.x997*m.x1072 == 0)
m.c2640 = Constraint(expr=m.x420*m.x1512 - m.x998*m.x1072 == 0)
m.c2641 = Constraint(expr=m.x420*m.x1513 - m.x999*m.x1072 == 0)
m.c2642 = Constraint(expr=m.x420*m.x1514 - m.x1000*m.x1072 == 0)
m.c2643 = Constraint(expr=m.x420*m.x1515 - m.x1001*m.x1072 == 0)
m.c2644 = Constraint(expr=m.x420*m.x1516 - m.x1002*m.x1072 == 0)
m.c2645 = Constraint(expr=m.x421*m.x1517 - m.x1003*m.x1073 == 0)
m.c2646 = Constraint(expr=m.x421*m.x1518 - m.x1004*m.x1073 == 0)
m.c2647 = Constraint(expr=m.x421*m.x1519 - m.x1005*m.x1073 == 0)
m.c2648 = Constraint(expr=m.x421*m.x1520 - m.x1006*m.x1073 == 0)
m.c2649 = Constraint(expr=m.x421*m.x1521 - m.x1007*m.x1073 == 0)
m.c2650 = Constraint(expr=m.x421*m.x1522 - m.x1008*m.x1073 == 0)
m.c2651 = Constraint(expr=m.x421*m.x1523 - m.x1009*m.x1073 == 0)
m.c2652 = Constraint(expr= m.x338 >= 0)
m.c2653 = Constraint(expr= m.x339 >= 0)
m.c2654 = Constraint(expr= m.x340 >= 0)
m.c2655 = Constraint(expr= m.x341 >= 0)
m.c2656 = Constraint(expr= m.x342 >= 0)
m.c2657 = Constraint(expr= m.x343 >= 0)
m.c2658 = Constraint(expr= m.x344 >= 0)
m.c2659 = Constraint(expr= m.x345 >= 0)
m.c2660 = Constraint(expr= m.x346 >= 0)
m.c2661 = Constraint(expr= m.x347 >= 0)
m.c2662 = Constraint(expr= - 5*m.x180 + m.x348 >= 0)
m.c2663 = Constraint(expr= - 5*m.x181 + m.x349 >= 0)
m.c2664 = Constraint(expr= - 5*m.x182 + m.x350 >= 0)
m.c2665 = Constraint(expr= - 5*m.x183 + m.x351 >= 0)
m.c2666 = Constraint(expr= m.x352 >= 0)
m.c2667 = Constraint(expr= m.x353 >= 0)
m.c2668 = Constraint(expr= m.x354 >= 0)
m.c2669 = Constraint(expr= m.x355 >= 0)
m.c2670 = Constraint(expr= m.x356 >= 0)
m.c2671 = Constraint(expr= m.x357 >= 0)
m.c2672 = Constraint(expr= m.x358 >= 0)
m.c2673 = Constraint(expr= m.x359 >= 0)
m.c2674 = Constraint(expr= m.x360 >= 0)
m.c2675 = Constraint(expr= m.x361 >= 0)
m.c2676 = Constraint(expr= - 5*m.x194 + m.x362 >= 0)
m.c2677 = Constraint(expr= - 5*m.x195 + m.x363 >= 0)
m.c2678 = Constraint(expr= - 5*m.x196 + m.x364 >= 0)
m.c2679 = Constraint(expr= - 5*m.x197 + m.x365 >= 0)
m.c2680 = Constraint(expr= m.x366 >= 0)
m.c2681 = Constraint(expr= m.x367 >= 0)
m.c2682 = Constraint(expr= m.x368 >= 0)
m.c2683 = Constraint(expr= m.x369 >= 0)
m.c2684 = Constraint(expr= m.x370 >= 0)
m.c2685 = Constraint(expr= m.x371 >= 0)
m.c2686 = Constraint(expr= m.x372 >= 0)
m.c2687 = Constraint(expr= m.x373 >= 0)
m.c2688 = Constraint(expr= m.x374 >= 0)
m.c2689 = Constraint(expr= m.x375 >= 0)
m.c2690 = Constraint(expr= - 5*m.x208 + m.x376 >= 0)
m.c2691 = Constraint(expr= - 5*m.x209 + m.x377 >= 0)
m.c2692 = Constraint(expr= - 5*m.x210 + m.x378 >= 0)
m.c2693 = Constraint(expr= - 5*m.x211 + m.x379 >= 0)
m.c2694 = Constraint(expr= m.x380 >= 0)
m.c2695 = Constraint(expr= m.x381 >= 0)
m.c2696 = Constraint(expr= m.x382 >= 0)
m.c2697 = Constraint(expr= m.x383 >= 0)
m.c2698 = Constraint(expr= m.x384 >= 0)
m.c2699 = Constraint(expr= m.x385 >= 0)
m.c2700 = Constraint(expr= m.x386 >= 0)
m.c2701 = Constraint(expr= m.x387 >= 0)
m.c2702 = Constraint(expr= m.x388 >= 0)
m.c2703 = Constraint(expr= m.x389 >= 0)
m.c2704 = Constraint(expr= - 5*m.x222 + m.x390 >= 0)
m.c2705 = Constraint(expr= - 5*m.x223 + m.x391 >= 0)
m.c2706 = Constraint(expr= - 5*m.x224 + m.x392 >= 0)
m.c2707 = Constraint(expr= - 5*m.x225 + m.x393 >= 0)
m.c2708 = Constraint(expr= m.x394 >= 0)
m.c2709 = Constraint(expr= m.x395 >= 0)
m.c2710 = Constraint(expr= m.x396 >= 0)
m.c2711 = Constraint(expr= m.x397 >= 0)
m.c2712 = Constraint(expr= m.x398 >= 0)
m.c2713 = Constraint(expr= m.x399 >= 0)
m.c2714 = Constraint(expr= m.x400 >= 0)
m.c2715 = Constraint(expr= m.x401 >= 0)
m.c2716 = Constraint(expr= m.x402 >= 0)
m.c2717 = Constraint(expr= m.x403 >= 0)
m.c2718 = Constraint(expr= - 5*m.x236 + m.x404 >= 0)
m.c2719 = Constraint(expr= - 5*m.x237 + m.x405 >= 0)
m.c2720 = Constraint(expr= - 5*m.x238 + m.x406 >= 0)
m.c2721 = Constraint(expr= - 5*m.x239 + m.x407 >= 0)
m.c2722 = Constraint(expr= m.x408 >= 0)
m.c2723 = Constraint(expr= m.x409 >= 0)
m.c2724 = Constraint(expr= m.x410 >= 0)
m.c2725 = Constraint(expr= m.x411 >= 0)
m.c2726 = Constraint(expr= m.x412 >= 0)
m.c2727 = Constraint(expr= m.x413 >= 0)
m.c2728 = Constraint(expr= m.x414 >= 0)
m.c2729 = Constraint(expr= m.x415 >= 0)
m.c2730 = Constraint(expr= m.x416 >= 0)
m.c2731 = Constraint(expr= m.x417 >= 0)
m.c2732 = Constraint(expr= - 5*m.x250 + m.x418 >= 0)
m.c2733 = Constraint(expr= - 5*m.x251 + m.x419 >= 0)
m.c2734 = Constraint(expr= - 5*m.x252 + m.x420 >= 0)
m.c2735 = Constraint(expr= - 5*m.x253 + m.x421 >= 0)
m.c2736 = Constraint(expr= - 50*m.x170 + m.x338 <= 0)
m.c2737 = Constraint(expr= - 50*m.x171 + m.x339 <= 0)
m.c2738 = Constraint(expr= - 50*m.x172 + m.x340 <= 0)
m.c2739 = Constraint(expr= - 50*m.x173 + m.x341 <= 0)
m.c2740 = Constraint(expr= - 50*m.x174 + m.x342 <= 0)
m.c2741 = Constraint(expr= - 50*m.x175 + m.x343 <= 0)
m.c2742 = Constraint(expr= - 50*m.x176 + m.x344 <= 0)
m.c2743 = Constraint(expr= - 50*m.x177 + m.x345 <= 0)
m.c2744 = Constraint(expr= - 50*m.x178 + m.x346 <= 0)
m.c2745 = Constraint(expr= - 50*m.x179 + m.x347 <= 0)
m.c2746 = Constraint(expr= - 50*m.x180 + m.x348 <= 0)
m.c2747 = Constraint(expr= - 50*m.x181 + m.x349 <= 0)
m.c2748 = Constraint(expr= - 50*m.x182 + m.x350 <= 0)
m.c2749 = Constraint(expr= - 50*m.x183 + m.x351 <= 0)
m.c2750 = Constraint(expr= - 50*m.x184 + m.x352 <= 0)
m.c2751 = Constraint(expr= - 50*m.x185 + m.x353 <= 0)
m.c2752 = Constraint(expr= - 50*m.x186 + m.x354 <= 0)
m.c2753 = Constraint(expr= - 50*m.x187 + m.x355 <= 0)
m.c2754 = Constraint(expr= - 50*m.x188 + m.x356 <= 0)
m.c2755 = Constraint(expr= - 50*m.x189 + m.x357 <= 0)
m.c2756 = Constraint(expr= - 50*m.x190 + m.x358 <= 0)
m.c2757 = Constraint(expr= - 50*m.x191 + m.x359 <= 0)
m.c2758 = Constraint(expr= - 50*m.x192 + m.x360 <= 0)
m.c2759 = Constraint(expr= - 50*m.x193 + m.x361 <= 0)
m.c2760 = Constraint(expr= - 50*m.x194 + m.x362 <= 0)
m.c2761 = Constraint(expr= - 50*m.x195 + m.x363 <= 0)
m.c2762 = Constraint(expr= - 50*m.x196 + m.x364 <= 0)
m.c2763 = Constraint(expr= - 50*m.x197 + m.x365 <= 0)
m.c2764 = Constraint(expr= - 50*m.x198 + m.x366 <= 0)
m.c2765 = Constraint(expr= - 50*m.x199 + m.x367 <= 0)
m.c2766 = Constraint(expr= - 50*m.x200 + m.x368 <= 0)
m.c2767 = Constraint(expr= - 50*m.x201 + m.x369 <= 0)
m.c2768 = Constraint(expr= - 50*m.x202 + m.x370 <= 0)
m.c2769 = Constraint(expr= - 50*m.x203 + m.x371 <= 0)
m.c2770 = Constraint(expr= - 50*m.x204 + m.x372 <= 0)
m.c2771 = Constraint(expr= - 50*m.x205 + m.x373 <= 0)
m.c2772 = Constraint(expr= - 50*m.x206 + m.x374 <= 0)
m.c2773 = Constraint(expr= - 50*m.x207 + m.x375 <= 0)
m.c2774 = Constraint(expr= - 50*m.x208 + m.x376 <= 0)
m.c2775 = Constraint(expr= - 50*m.x209 + m.x377 <= 0)
m.c2776 = Constraint(expr= - 50*m.x210 + m.x378 <= 0)
m.c2777 = Constraint(expr= - 50*m.x211 + m.x379 <= 0)
m.c2778 = Constraint(expr= - 50*m.x212 + m.x380 <= 0)
m.c2779 = Constraint(expr= - 50*m.x213 + m.x381 <= 0)
m.c2780 = Constraint(expr= - 50*m.x214 + m.x382 <= 0)
m.c2781 = Constraint(expr= - 50*m.x215 + m.x383 <= 0)
m.c2782 = Constraint(expr= - 50*m.x216 + m.x384 <= 0)
m.c2783 = Constraint(expr= - 50*m.x217 + m.x385 <= 0)
m.c2784 = Constraint(expr= - 50*m.x218 + m.x386 <= 0)
m.c2785 = Constraint(expr= - 50*m.x219 + m.x387 <= 0)
m.c2786 = Constraint(expr= - 50*m.x220 + m.x388 <= 0)
m.c2787 = Constraint(expr= - 50*m.x221 + m.x389 <= 0)
m.c2788 = Constraint(expr= - 50*m.x222 + m.x390 <= 0)
m.c2789 = Constraint(expr= - 50*m.x223 + m.x391 <= 0)
m.c2790 = Constraint(expr= - 50*m.x224 + m.x392 <= 0)
m.c2791 = Constraint(expr= - 50*m.x225 + m.x393 <= 0)
m.c2792 = Constraint(expr= - 50*m.x226 + m.x394 <= 0)
m.c2793 = Constraint(expr= - 50*m.x227 + m.x395 <= 0)
m.c2794 = Constraint(expr= - 50*m.x228 + m.x396 <= 0)
m.c2795 = Constraint(expr= - 50*m.x229 + m.x397 <= 0)
m.c2796 = Constraint(expr= - 50*m.x230 + m.x398 <= 0)
m.c2797 = Constraint(expr= - 50*m.x231 + m.x399 <= 0)
m.c2798 = Constraint(expr= - 50*m.x232 + m.x400 <= 0)
m.c2799 = Constraint(expr= - 50*m.x233 + m.x401 <= 0)
m.c2800 = Constraint(expr= - 50*m.x234 + m.x402 <= 0)
m.c2801 = Constraint(expr= - 50*m.x235 + m.x403 <= 0)
m.c2802 = Constraint(expr= - 50*m.x236 + m.x404 <= 0)
m.c2803 = Constraint(expr= - 50*m.x237 + m.x405 <= 0)
m.c2804 = Constraint(expr= - 50*m.x238 + m.x406 <= 0)
m.c2805 = Constraint(expr= - 50*m.x239 + m.x407 <= 0)
m.c2806 = Constraint(expr= - 50*m.x240 + m.x408 <= 0)
m.c2807 = Constraint(expr= - 50*m.x241 + m.x409 <= 0)
m.c2808 = Constraint(expr= - 50*m.x242 + m.x410 <= 0)
m.c2809 = Constraint(expr= - 50*m.x243 + m.x411 <= 0)
m.c2810 = Constraint(expr= - 50*m.x244 + m.x412 <= 0)
m.c2811 = Constraint(expr= - 50*m.x245 + m.x413 <= 0)
m.c2812 = Constraint(expr= - 50*m.x246 + m.x414 <= 0)
m.c2813 = Constraint(expr= - 50*m.x247 + m.x415 <= 0)
m.c2814 = Constraint(expr= - 50*m.x248 + m.x416 <= 0)
m.c2815 = Constraint(expr= - 50*m.x249 + m.x417 <= 0)
m.c2816 = Constraint(expr= - 50*m.x250 + m.x418 <= 0)
m.c2817 = Constraint(expr= - 50*m.x251 + m.x419 <= 0)
m.c2818 = Constraint(expr= - 50*m.x252 + m.x420 <= 0)
m.c2819 = Constraint(expr= - 50*m.x253 + m.x421 <= 0)
m.c2820 = Constraint(expr= m.x180 + m.x181 + m.x194 + m.x195 + m.x208 + m.x209 + m.x222 + m.x223 + m.x236 + m.x237
+ m.x250 + m.x251 == 12)
m.c2821 = Constraint(expr= m.x182 + m.x183 + m.x196 + m.x197 + m.x210 + m.x211 + m.x224 + m.x225 + m.x238 + m.x239
+ m.x252 + m.x253 == 12)
m.c2822 = Constraint(expr= m.x348 + m.x362 + m.x376 + m.x390 + m.x404 + m.x418 >= 50)
m.c2823 = Constraint(expr= m.x351 + m.x365 + m.x379 + m.x393 + m.x407 + m.x421 >= 50)
m.c2824 = Constraint(expr= m.x349 + m.x350 + m.x363 + m.x364 + m.x377 + m.x378 + m.x391 + m.x392 + m.x405 + m.x406
+ m.x419 + m.x420 >= 50)
m.c2825 = Constraint(expr= m.x348 + m.x362 + m.x376 + m.x390 + m.x404 + m.x418 <= 50)
m.c2826 = Constraint(expr= m.x351 + m.x365 + m.x379 + m.x393 + m.x407 + m.x421 <= 50)
m.c2827 = Constraint(expr= m.x349 + m.x350 + m.x363 + m.x364 + m.x377 + m.x378 + m.x391 + m.x392 + m.x405 + m.x406
+ m.x419 + m.x420 <= 50)
m.c2828 = Constraint(expr= - 0.25*m.x348 + 0.1*m.x492 + 0.85*m.x493 + 0.6*m.x494 + 0.2*m.x495 + 0.5*m.x496 + 0.8*m.x497
+ 0.3*m.x498 >= 0)
m.c2829 = Constraint(expr= - 0.45*m.x349 + 0.1*m.x499 + 0.85*m.x500 + 0.6*m.x501 + 0.2*m.x502 + 0.5*m.x503 + 0.8*m.x504
+ 0.3*m.x505 >= 0)
m.c2830 = Constraint(expr= - 0.45*m.x350 + 0.1*m.x506 + 0.85*m.x507 + 0.6*m.x508 + 0.2*m.x509 + 0.5*m.x510 + 0.8*m.x511
+ 0.3*m.x512 >= 0)
m.c2831 = Constraint(expr= - 0.75*m.x351 + 0.1*m.x513 + 0.85*m.x514 + 0.6*m.x515 + 0.2*m.x516 + 0.5*m.x517 + 0.8*m.x518
+ 0.3*m.x519 >= 0)
m.c2832 = Constraint(expr= - 0.25*m.x362 + 0.1*m.x590 + 0.85*m.x591 + 0.6*m.x592 + 0.2*m.x593 + 0.5*m.x594 + 0.8*m.x595
+ 0.3*m.x596 >= 0)
m.c2833 = Constraint(expr= - 0.45*m.x363 + 0.1*m.x597 + 0.85*m.x598 + 0.6*m.x599 + 0.2*m.x600 + 0.5*m.x601 + 0.8*m.x602
+ 0.3*m.x603 >= 0)
m.c2834 = Constraint(expr= - 0.45*m.x364 + 0.1*m.x604 + 0.85*m.x605 + 0.6*m.x606 + 0.2*m.x607 + 0.5*m.x608 + 0.8*m.x609
+ 0.3*m.x610 >= 0)
m.c2835 = Constraint(expr= - 0.75*m.x365 + 0.1*m.x611 + 0.85*m.x612 + 0.6*m.x613 + 0.2*m.x614 + 0.5*m.x615 + 0.8*m.x616
+ 0.3*m.x617 >= 0)
m.c2836 = Constraint(expr= - 0.25*m.x376 + 0.1*m.x688 + 0.85*m.x689 + 0.6*m.x690 + 0.2*m.x691 + 0.5*m.x692 + 0.8*m.x693
+ 0.3*m.x694 >= 0)
m.c2837 = Constraint(expr= - 0.45*m.x377 + 0.1*m.x695 + 0.85*m.x696 + 0.6*m.x697 + 0.2*m.x698 + 0.5*m.x699 + 0.8*m.x700
+ 0.3*m.x701 >= 0)
m.c2838 = Constraint(expr= - 0.45*m.x378 + 0.1*m.x702 + 0.85*m.x703 + 0.6*m.x704 + 0.2*m.x705 + 0.5*m.x706 + 0.8*m.x707
+ 0.3*m.x708 >= 0)
m.c2839 = Constraint(expr= - 0.75*m.x379 + 0.1*m.x709 + 0.85*m.x710 + 0.6*m.x711 + 0.2*m.x712 + 0.5*m.x713 + 0.8*m.x714
+ 0.3*m.x715 >= 0)
m.c2840 = Constraint(expr= - 0.25*m.x390 + 0.1*m.x786 + 0.85*m.x787 + 0.6*m.x788 + 0.2*m.x789 + 0.5*m.x790 + 0.8*m.x791
+ 0.3*m.x792 >= 0)
m.c2841 = Constraint(expr= - 0.45*m.x391 + 0.1*m.x793 + 0.85*m.x794 + 0.6*m.x795 + 0.2*m.x796 + 0.5*m.x797 + 0.8*m.x798
+ 0.3*m.x799 >= 0)
m.c2842 = Constraint(expr= - 0.45*m.x392 + 0.1*m.x800 + 0.85*m.x801 + 0.6*m.x802 + 0.2*m.x803 + 0.5*m.x804 + 0.8*m.x805
+ 0.3*m.x806 >= 0)
m.c2843 = Constraint(expr= - 0.75*m.x393 + 0.1*m.x807 + 0.85*m.x808 + 0.6*m.x809 + 0.2*m.x810 + 0.5*m.x811 + 0.8*m.x812
+ 0.3*m.x813 >= 0)
m.c2844 = Constraint(expr= - 0.25*m.x404 + 0.1*m.x884 + 0.85*m.x885 + 0.6*m.x886 + 0.2*m.x887 + 0.5*m.x888 + 0.8*m.x889
+ 0.3*m.x890 >= 0)
m.c2845 = Constraint(expr= - 0.45*m.x405 + 0.1*m.x891 + 0.85*m.x892 + 0.6*m.x893 + 0.2*m.x894 + 0.5*m.x895 + 0.8*m.x896
+ 0.3*m.x897 >= 0)
m.c2846 = Constraint(expr= - 0.45*m.x406 + 0.1*m.x898 + 0.85*m.x899 + 0.6*m.x900 + 0.2*m.x901 + 0.5*m.x902 + 0.8*m.x903
+ 0.3*m.x904 >= 0)
m.c2847 = Constraint(expr= - 0.75*m.x407 + 0.1*m.x905 + 0.85*m.x906 + 0.6*m.x907 + 0.2*m.x908 + 0.5*m.x909 + 0.8*m.x910
+ 0.3*m.x911 >= 0)
m.c2848 = Constraint(expr= - 0.25*m.x418 + 0.1*m.x982 + 0.85*m.x983 + 0.6*m.x984 + 0.2*m.x985 + 0.5*m.x986 + 0.8*m.x987
+ 0.3*m.x988 >= 0)
m.c2849 = Constraint(expr= - 0.45*m.x419 + 0.1*m.x989 + 0.85*m.x990 + 0.6*m.x991 + 0.2*m.x992 + 0.5*m.x993 + 0.8*m.x994
+ 0.3*m.x995 >= 0)
m.c2850 = Constraint(expr= - 0.45*m.x420 + 0.1*m.x996 + 0.85*m.x997 + 0.6*m.x998 + 0.2*m.x999 + 0.5*m.x1000
+ 0.8*m.x1001 + 0.3*m.x1002 >= 0)
m.c2851 = Constraint(expr= - 0.75*m.x421 + 0.1*m.x1003 + 0.85*m.x1004 + 0.6*m.x1005 + 0.2*m.x1006 + 0.5*m.x1007
+ 0.8*m.x1008 + 0.3*m.x1009 >= 0)
m.c2852 = Constraint(expr= - 0.35*m.x348 + 0.1*m.x492 + 0.85*m.x493 + 0.6*m.x494 + 0.2*m.x495 + 0.5*m.x496 + 0.8*m.x497
+ 0.3*m.x498 <= 0)
m.c2853 = Constraint(expr= - 0.65*m.x349 + 0.1*m.x499 + 0.85*m.x500 + 0.6*m.x501 + 0.2*m.x502 + 0.5*m.x503 + 0.8*m.x504
+ 0.3*m.x505 <= 0)
m.c2854 = Constraint(expr= - 0.65*m.x350 + 0.1*m.x506 + 0.85*m.x507 + 0.6*m.x508 + 0.2*m.x509 + 0.5*m.x510 + 0.8*m.x511
+ 0.3*m.x512 <= 0)
m.c2855 = Constraint(expr= - 0.85*m.x351 + 0.1*m.x513 + 0.85*m.x514 + 0.6*m.x515 + 0.2*m.x516 + 0.5*m.x517 + 0.8*m.x518
+ 0.3*m.x519 <= 0)
m.c2856 = Constraint(expr= - 0.35*m.x362 + 0.1*m.x590 + 0.85*m.x591 + 0.6*m.x592 + 0.2*m.x593 + 0.5*m.x594 + 0.8*m.x595
+ 0.3*m.x596 <= 0)
m.c2857 = Constraint(expr= - 0.65*m.x363 + 0.1*m.x597 + 0.85*m.x598 + 0.6*m.x599 + 0.2*m.x600 + 0.5*m.x601 + 0.8*m.x602
+ 0.3*m.x603 <= 0)
m.c2858 = Constraint(expr= - 0.65*m.x364 + 0.1*m.x604 + 0.85*m.x605 + 0.6*m.x606 + 0.2*m.x607 + 0.5*m.x608 + 0.8*m.x609
+ 0.3*m.x610 <= 0)
m.c2859 = Constraint(expr= - 0.85*m.x365 + 0.1*m.x611 + 0.85*m.x612 + 0.6*m.x613 + 0.2*m.x614 + 0.5*m.x615 + 0.8*m.x616
+ 0.3*m.x617 <= 0)
m.c2860 = Constraint(expr= - 0.35*m.x376 + 0.1*m.x688 + 0.85*m.x689 + 0.6*m.x690 + 0.2*m.x691 + 0.5*m.x692 + 0.8*m.x693
+ 0.3*m.x694 <= 0)
m.c2861 = Constraint(expr= - 0.65*m.x377 + 0.1*m.x695 + 0.85*m.x696 + 0.6*m.x697 + 0.2*m.x698 + 0.5*m.x699 + 0.8*m.x700
+ 0.3*m.x701 <= 0)
m.c2862 = Constraint(expr= - 0.65*m.x378 + 0.1*m.x702 + 0.85*m.x703 + 0.6*m.x704 + 0.2*m.x705 + 0.5*m.x706 + 0.8*m.x707
+ 0.3*m.x708 <= 0)
m.c2863 = Constraint(expr= - 0.85*m.x379 + 0.1*m.x709 + 0.85*m.x710 + 0.6*m.x711 + 0.2*m.x712 + 0.5*m.x713 + 0.8*m.x714
+ 0.3*m.x715 <= 0)
m.c2864 = Constraint(expr= - 0.35*m.x390 + 0.1*m.x786 + 0.85*m.x787 + 0.6*m.x788 + 0.2*m.x789 + 0.5*m.x790 + 0.8*m.x791
+ 0.3*m.x792 <= 0)
m.c2865 = Constraint(expr= - 0.65*m.x391 + 0.1*m.x793 + 0.85*m.x794 + 0.6*m.x795 + 0.2*m.x796 + 0.5*m.x797 + 0.8*m.x798
+ 0.3*m.x799 <= 0)
m.c2866 = Constraint(expr= - 0.65*m.x392 + 0.1*m.x800 + 0.85*m.x801 + 0.6*m.x802 + 0.2*m.x803 + 0.5*m.x804 + 0.8*m.x805
+ 0.3*m.x806 <= 0)
m.c2867 = Constraint(expr= - 0.85*m.x393 + 0.1*m.x807 + 0.85*m.x808 + 0.6*m.x809 + 0.2*m.x810 + 0.5*m.x811 + 0.8*m.x812
+ 0.3*m.x813 <= 0)
m.c2868 = Constraint(expr= - 0.35*m.x404 + 0.1*m.x884 + 0.85*m.x885 + 0.6*m.x886 + 0.2*m.x887 + 0.5*m.x888 + 0.8*m.x889
+ 0.3*m.x890 <= 0)
m.c2869 = Constraint(expr= - 0.65*m.x405 + 0.1*m.x891 + 0.85*m.x892 + 0.6*m.x893 + 0.2*m.x894 + 0.5*m.x895 + 0.8*m.x896
+ 0.3*m.x897 <= 0)
m.c2870 = Constraint(expr= - 0.65*m.x406 + 0.1*m.x898 + 0.85*m.x899 + 0.6*m.x900 + 0.2*m.x901 + 0.5*m.x902 + 0.8*m.x903
+ 0.3*m.x904 <= 0)
m.c2871 = Constraint(expr= - 0.85*m.x407 + 0.1*m.x905 + 0.85*m.x906 + 0.6*m.x907 + 0.2*m.x908 + 0.5*m.x909 + 0.8*m.x910
+ 0.3*m.x911 <= 0)
m.c2872 = Constraint(expr= - 0.35*m.x418 + 0.1*m.x982 + 0.85*m.x983 + 0.6*m.x984 + 0.2*m.x985 + 0.5*m.x986 + 0.8*m.x987
+ 0.3*m.x988 <= 0)
m.c2873 = Constraint(expr= - 0.65*m.x419 + 0.1*m.x989 + 0.85*m.x990 + 0.6*m.x991 + 0.2*m.x992 + 0.5*m.x993 + 0.8*m.x994
+ 0.3*m.x995 <= 0)
m.c2874 = Constraint(expr= - 0.65*m.x420 + 0.1*m.x996 + 0.85*m.x997 + 0.6*m.x998 + 0.2*m.x999 + 0.5*m.x1000
+ 0.8*m.x1001 + 0.3*m.x1002 <= 0)
m.c2875 = Constraint(expr= - 0.85*m.x421 + 0.1*m.x1003 + 0.85*m.x1004 + 0.6*m.x1005 + 0.2*m.x1006 + 0.5*m.x1007
+ 0.8*m.x1008 + 0.3*m.x1009 <= 0)
m.c2876 = Constraint(expr= - m.x338 - m.x352 - m.x366 - m.x380 - m.x394 - m.x408 >= -50)
m.c2877 = Constraint(expr= - m.x339 - m.x353 - m.x367 - m.x381 - m.x395 - m.x409 >= -50)
m.c2878 = Constraint(expr= - m.x340 - m.x354 - m.x368 - m.x382 - m.x396 - m.x410 >= -50)
m.c2879 = Constraint(expr= m.x338 - m.x341 - m.x342 + m.x352 - m.x355 - m.x356 + m.x366 - m.x369 - m.x370 + m.x380
- m.x383 - m.x384 + m.x394 - m.x397 - m.x398 + m.x408 - m.x411 - m.x412 >= -20)
m.c2880 = Constraint(expr= m.x339 - m.x343 - m.x344 - m.x345 + m.x353 - m.x357 - m.x358 - m.x359 + m.x367 - m.x371
- m.x372 - m.x373 + m.x381 - m.x385 - m.x386 - m.x387 + m.x395 - m.x399 - m.x400 - m.x401
+ m.x409 - m.x413 - m.x414 - m.x415 >= -20)
m.c2881 = Constraint(expr= m.x340 - m.x346 - m.x347 + m.x354 - m.x360 - m.x361 + m.x368 - m.x374 - m.x375 + m.x382
- m.x388 - m.x389 + m.x396 - m.x402 - m.x403 + m.x410 - m.x416 - m.x417 >= -20)
m.c2882 = Constraint(expr= m.x341 + m.x343 - m.x348 + m.x355 + m.x357 - m.x362 + m.x369 + m.x371 - m.x376 + m.x383
+ m.x385 - m.x390 + m.x397 + m.x399 - m.x404 + m.x411 + m.x413 - m.x418 >= -30)
m.c2883 = Constraint(expr= m.x342 + m.x344 + m.x346 - m.x349 - m.x350 + m.x356 + m.x358 + m.x360 - m.x363 - m.x364
+ m.x370 + m.x372 + m.x374 - m.x377 - m.x378 + m.x384 + m.x386 + m.x388 - m.x391 - m.x392
+ m.x398 + m.x400 + m.x402 - m.x405 - m.x406 + m.x412 + m.x414 + m.x416 - m.x419 - m.x420
>= -50)
m.c2884 = Constraint(expr= m.x345 + m.x347 - m.x351 + m.x359 + m.x361 - m.x365 + m.x373 + m.x375 - m.x379 + m.x387
+ m.x389 - m.x393 + m.x401 + m.x403 - m.x407 + m.x415 + m.x417 - m.x421 >= -30)
m.c2885 = Constraint(expr= m.x348 + m.x349 + m.x362 + m.x363 + m.x376 + m.x377 + m.x390 + m.x391 + m.x404 + m.x405
+ m.x418 + m.x419 >= 0)
m.c2886 = Constraint(expr= m.x350 + m.x351 + m.x364 + m.x365 + m.x378 + m.x379 + m.x392 + m.x393 + m.x406 + m.x407
+ m.x420 + m.x421 >= 0)
m.c2887 = Constraint(expr= - m.x338 - m.x352 - m.x366 - m.x380 - m.x394 - m.x408 <= 0)
m.c2888 = Constraint(expr= - m.x339 - m.x353 - m.x367 - m.x381 - m.x395 - m.x409 <= 0)
m.c2889 = Constraint(expr= - m.x340 - m.x354 - m.x368 - m.x382 - m.x396 - m.x410 <= 0)
m.c2890 = Constraint(expr= m.x338 - m.x341 - m.x342 + m.x352 - m.x355 - m.x356 + m.x366 - m.x369 - m.x370 + m.x380
- m.x383 - m.x384 + m.x394 - m.x397 - m.x398 + m.x408 - m.x411 - m.x412 <= 80)
m.c2891 = Constraint(expr= m.x339 - m.x343 - m.x344 - m.x345 + m.x353 - m.x357 - m.x358 - m.x359 + m.x367 - m.x371
- m.x372 - m.x373 + m.x381 - m.x385 - m.x386 - m.x387 + m.x395 - m.x399 - m.x400 - m.x401
+ m.x409 - m.x413 - m.x414 - m.x415 <= 80)
m.c2892 = Constraint(expr= m.x340 - m.x346 - m.x347 + m.x354 - m.x360 - m.x361 + m.x368 - m.x374 - m.x375 + m.x382
- m.x388 - m.x389 + m.x396 - m.x402 - m.x403 + m.x410 - m.x416 - m.x417 <= 80)
m.c2893 = Constraint(expr= m.x341 + m.x343 - m.x348 + m.x355 + m.x357 - m.x362 + m.x369 + m.x371 - m.x376 + m.x383
+ m.x385 - m.x390 + m.x397 + m.x399 - m.x404 + m.x411 + m.x413 - m.x418 <= 70)
m.c2894 = Constraint(expr= m.x342 + m.x344 + m.x346 - m.x349 - m.x350 + m.x356 + m.x358 + m.x360 - m.x363 - m.x364
+ m.x370 + m.x372 + m.x374 - m.x377 - m.x378 + m.x384 + m.x386 + m.x388 - m.x391 - m.x392
+ m.x398 + m.x400 + m.x402 - m.x405 - m.x406 + m.x412 + m.x414 + m.x416 - m.x419 - m.x420
<= 50)
m.c2895 = Constraint(expr= m.x345 + m.x347 - m.x351 + m.x359 + m.x361 - m.x365 + m.x373 + m.x375 - m.x379 + m.x387
+ m.x389 - m.x393 + m.x401 + m.x403 - m.x407 + m.x415 + m.x417 - m.x421 <= 70)
m.c2896 = Constraint(expr= - m.x422 - m.x520 - m.x618 - m.x716 - m.x814 - m.x912 >= -50)
m.c2897 = Constraint(expr= - m.x423 - m.x521 - m.x619 - m.x717 - m.x815 - m.x913 >= 0)
m.c2898 = Constraint(expr= - m.x424 - m.x522 - m.x620 - m.x718 - m.x816 - m.x914 >= 0)
m.c2899 = Constraint(expr= - m.x425 - m.x523 - m.x621 - m.x719 - m.x817 - m.x915 >= 0)
m.c2900 = Constraint(expr= - m.x426 - m.x524 - m.x622 - m.x720 - m.x818 - m.x916 >= 0)
m.c2901 = Constraint(expr= - m.x427 - m.x525 - m.x623 - m.x721 - m.x819 - m.x917 >= 0)
m.c2902 = Constraint(expr= - m.x428 - m.x526 - m.x624 - m.x722 - m.x820 - m.x918 >= 0)
m.c2903 = Constraint(expr= - m.x429 - m.x527 - m.x625 - m.x723 - m.x821 - m.x919 >= 0)
m.c2904 = Constraint(expr= - m.x430 - m.x528 - m.x626 - m.x724 - m.x822 - m.x920 >= -50)
m.c2905 = Constraint(expr= - m.x431 - m.x529 - m.x627 - m.x725 - m.x823 - m.x921 >= 0)
m.c2906 = Constraint(expr= - m.x432 - m.x530 - m.x628 - m.x726 - m.x824 - m.x922 >= 0)
m.c2907 = Constraint(expr= - m.x433 - m.x531 - m.x629 - m.x727 - m.x825 - m.x923 >= 0)
m.c2908 = Constraint(expr= - m.x434 - m.x532 - m.x630 - m.x728 - m.x826 - m.x924 >= 0)
m.c2909 = Constraint(expr= - m.x435 - m.x533 - m.x631 - m.x729 - m.x827 - m.x925 >= 0)
m.c2910 = Constraint(expr= - m.x436 - m.x534 - m.x632 - m.x730 - m.x828 - m.x926 >= 0)
m.c2911 = Constraint(expr= - m.x437 - m.x535 - m.x633 - m.x731 - m.x829 - m.x927 >= 0)
m.c2912 = Constraint(expr= - m.x438 - m.x536 - m.x634 - m.x732 - m.x830 - m.x928 >= -50)
m.c2913 = Constraint(expr= - m.x439 - m.x537 - m.x635 - m.x733 - m.x831 - m.x929 >= 0)
m.c2914 = Constraint(expr= - m.x440 - m.x538 - m.x636 - m.x734 - m.x832 - m.x930 >= 0)
m.c2915 = Constraint(expr= - m.x441 - m.x539 - m.x637 - m.x735 - m.x833 - m.x931 >= 0)
m.c2916 = Constraint(expr= - m.x442 - m.x540 - m.x638 - m.x736 - m.x834 - m.x932 >= 0)
m.c2917 = Constraint(expr= m.x422 - m.x443 - m.x450 + m.x520 - m.x541 - m.x548 + m.x618 - m.x639 - m.x646 + m.x716
- m.x737 - m.x744 + m.x814 - m.x835 - m.x842 + m.x912 - m.x933 - m.x940 >= 0)
m.c2918 = Constraint(expr= m.x423 - m.x444 - m.x451 + m.x521 - m.x542 - m.x549 + m.x619 - m.x640 - m.x647 + m.x717
- m.x738 - m.x745 + m.x815 - m.x836 - m.x843 + m.x913 - m.x934 - m.x941 >= 0)
m.c2919 = Constraint(expr= m.x424 - m.x445 - m.x452 + m.x522 - m.x543 - m.x550 + m.x620 - m.x641 - m.x648 + m.x718
- m.x739 - m.x746 + m.x816 - m.x837 - m.x844 + m.x914 - m.x935 - m.x942 >= 0)
m.c2920 = Constraint(expr= m.x425 - m.x446 - m.x453 + m.x523 - m.x544 - m.x551 + m.x621 - m.x642 - m.x649 + m.x719
- m.x740 - m.x747 + m.x817 - m.x838 - m.x845 + m.x915 - m.x936 - m.x943 >= -20)
m.c2921 = Constraint(expr= m.x426 - m.x447 - m.x454 + m.x524 - m.x545 - m.x552 + m.x622 - m.x643 - m.x650 + m.x720
- m.x741 - m.x748 + m.x818 - m.x839 - m.x846 + m.x916 - m.x937 - m.x944 >= 0)
m.c2922 = Constraint(expr= m.x427 - m.x448 - m.x455 + m.x525 - m.x546 - m.x553 + m.x623 - m.x644 - m.x651 + m.x721
- m.x742 - m.x749 + m.x819 - m.x840 - m.x847 + m.x917 - m.x938 - m.x945 >= 0)
m.c2923 = Constraint(expr= m.x428 - m.x449 - m.x456 + m.x526 - m.x547 - m.x554 + m.x624 - m.x645 - m.x652 + m.x722
- m.x743 - m.x750 + m.x820 - m.x841 - m.x848 + m.x918 - m.x939 - m.x946 >= 0)
m.c2924 = Constraint(expr= m.x429 - m.x457 - m.x464 - m.x471 + m.x527 - m.x555 - m.x562 - m.x569 + m.x625 - m.x653
- m.x660 - m.x667 + m.x723 - m.x751 - m.x758 - m.x765 + m.x821 - m.x849 - m.x856 - m.x863
+ m.x919 - m.x947 - m.x954 - m.x961 >= 0)
m.c2925 = Constraint(expr= m.x430 - m.x458 - m.x465 - m.x472 + m.x528 - m.x556 - m.x563 - m.x570 + m.x626 - m.x654
- m.x661 - m.x668 + m.x724 - m.x752 - m.x759 - m.x766 + m.x822 - m.x850 - m.x857 - m.x864
+ m.x920 - m.x948 - m.x955 - m.x962 >= 0)
m.c2926 = Constraint(expr= m.x431 - m.x459 - m.x466 - m.x473 + m.x529 - m.x557 - m.x564 - m.x571 + m.x627 - m.x655
- m.x662 - m.x669 + m.x725 - m.x753 - m.x760 - m.x767 + m.x823 - m.x851 - m.x858 - m.x865
+ m.x921 - m.x949 - m.x956 - m.x963 >= 0)
m.c2927 = Constraint(expr= m.x432 - m.x460 - m.x467 - m.x474 + m.x530 - m.x558 - m.x565 - m.x572 + m.x628 - m.x656
- m.x663 - m.x670 + m.x726 - m.x754 - m.x761 - m.x768 + m.x824 - m.x852 - m.x859 - m.x866
+ m.x922 - m.x950 - m.x957 - m.x964 >= 0)
m.c2928 = Constraint(expr= m.x433 - m.x461 - m.x468 - m.x475 + m.x531 - m.x559 - m.x566 - m.x573 + m.x629 - m.x657
- m.x664 - m.x671 + m.x727 - m.x755 - m.x762 - m.x769 + m.x825 - m.x853 - m.x860 - m.x867
+ m.x923 - m.x951 - m.x958 - m.x965 >= -20)
m.c2929 = Constraint(expr= m.x434 - m.x462 - m.x469 - m.x476 + m.x532 - m.x560 - m.x567 - m.x574 + m.x630 - m.x658
- m.x665 - m.x672 + m.x728 - m.x756 - m.x763 - m.x770 + m.x826 - m.x854 - m.x861 - m.x868
+ m.x924 - m.x952 - m.x959 - m.x966 >= 0)
m.c2930 = Constraint(expr= m.x435 - m.x463 - m.x470 - m.x477 + m.x533 - m.x561 - m.x568 - m.x575 + m.x631 - m.x659
- m.x666 - m.x673 + m.x729 - m.x757 - m.x764 - m.x771 + m.x827 - m.x855 - m.x862 - m.x869
+ m.x925 - m.x953 - m.x960 - m.x967 >= 0)
m.c2931 = Constraint(expr= m.x436 - m.x478 - m.x485 + m.x534 - m.x576 - m.x583 + m.x632 - m.x674 - m.x681 + m.x730
- m.x772 - m.x779 + m.x828 - m.x870 - m.x877 + m.x926 - m.x968 - m.x975 >= 0)
m.c2932 = Constraint(expr= m.x437 - m.x479 - m.x486 + m.x535 - m.x577 - m.x584 + m.x633 - m.x675 - m.x682 + m.x731
- m.x773 - m.x780 + m.x829 - m.x871 - m.x878 + m.x927 - m.x969 - m.x976 >= 0)
m.c2933 = Constraint(expr= m.x438 - m.x480 - m.x487 + m.x536 - m.x578 - m.x585 + m.x634 - m.x676 - m.x683 + m.x732
- m.x774 - m.x781 + m.x830 - m.x872 - m.x879 + m.x928 - m.x970 - m.x977 >= 0)
m.c2934 = Constraint(expr= m.x439 - m.x481 - m.x488 + m.x537 - m.x579 - m.x586 + m.x635 - m.x677 - m.x684 + m.x733
- m.x775 - m.x782 + m.x831 - m.x873 - m.x880 + m.x929 - m.x971 - m.x978 >= 0)
m.c2935 = Constraint(expr= m.x440 - m.x482 - m.x489 + m.x538 - m.x580 - m.x587 + m.x636 - m.x678 - m.x685 + m.x734
- m.x776 - m.x783 + m.x832 - m.x874 - m.x881 + m.x930 - m.x972 - m.x979 >= 0)
m.c2936 = Constraint(expr= m.x441 - m.x483 - m.x490 + m.x539 - m.x581 - m.x588 + m.x637 - m.x679 - m.x686 + m.x735
- m.x777 - m.x784 + m.x833 - m.x875 - m.x882 + m.x931 - m.x973 - m.x980 >= -20)
m.c2937 = Constraint(expr= m.x442 - m.x484 - m.x491 + m.x540 - m.x582 - m.x589 + m.x638 - m.x680 - m.x687 + m.x736
- m.x778 - m.x785 + m.x834 - m.x876 - m.x883 + m.x932 - m.x974 - m.x981 >= 0)
m.c2938 = Constraint(expr= m.x443 + m.x457 - m.x492 + m.x541 + m.x555 - m.x590 + m.x639 + m.x653 - m.x688 + m.x737
+ m.x751 - m.x786 + m.x835 + m.x849 - m.x884 + m.x933 + m.x947 - m.x982 >= 0)
m.c2939 = Constraint(expr= m.x444 + m.x458 - m.x493 + m.x542 + m.x556 - m.x591 + m.x640 + m.x654 - m.x689 + m.x738
+ m.x752 - m.x787 + m.x836 + m.x850 - m.x885 + m.x934 + m.x948 - m.x983 >= 0)
m.c2940 = Constraint(expr= m.x445 + m.x459 - m.x494 + m.x543 + m.x557 - m.x592 + m.x641 + m.x655 - m.x690 + m.x739
+ m.x753 - m.x788 + m.x837 + m.x851 - m.x886 + m.x935 + m.x949 - m.x984 >= 0)
m.c2941 = Constraint(expr= m.x446 + m.x460 - m.x495 + m.x544 + m.x558 - m.x593 + m.x642 + m.x656 - m.x691 + m.x740
+ m.x754 - m.x789 + m.x838 + m.x852 - m.x887 + m.x936 + m.x950 - m.x985 >= 0)
m.c2942 = Constraint(expr= m.x447 + m.x461 - m.x496 + m.x545 + m.x559 - m.x594 + m.x643 + m.x657 - m.x692 + m.x741
+ m.x755 - m.x790 + m.x839 + m.x853 - m.x888 + m.x937 + m.x951 - m.x986 >= 0)
m.c2943 = Constraint(expr= m.x448 + m.x462 - m.x497 + m.x546 + m.x560 - m.x595 + m.x644 + m.x658 - m.x693 + m.x742
+ m.x756 - m.x791 + m.x840 + m.x854 - m.x889 + m.x938 + m.x952 - m.x987 >= 0)
m.c2944 = Constraint(expr= m.x449 + m.x463 - m.x498 + m.x547 + m.x561 - m.x596 + m.x645 + m.x659 - m.x694 + m.x743
+ m.x757 - m.x792 + m.x841 + m.x855 - m.x890 + m.x939 + m.x953 - m.x988 >= -30)
m.c2945 = Constraint(expr= m.x450 + m.x464 + m.x478 - m.x499 - m.x506 + m.x548 + m.x562 + m.x576 - m.x597 - m.x604
+ m.x646 + m.x660 + m.x674 - m.x695 - m.x702 + m.x744 + m.x758 + m.x772 - m.x793 - m.x800
+ m.x842 + m.x856 + m.x870 - m.x891 - m.x898 + m.x940 + m.x954 + m.x968 - m.x989 - m.x996
>= 0)
m.c2946 = Constraint(expr= m.x451 + m.x465 + m.x479 - m.x500 - m.x507 + m.x549 + m.x563 + m.x577 - m.x598 - m.x605
+ m.x647 + m.x661 + m.x675 - m.x696 - m.x703 + m.x745 + m.x759 + m.x773 - m.x794 - m.x801
+ m.x843 + m.x857 + m.x871 - m.x892 - m.x899 + m.x941 + m.x955 + m.x969 - m.x990 - m.x997
>= 0)
m.c2947 = Constraint(expr= m.x452 + m.x466 + m.x480 - m.x501 - m.x508 + m.x550 + m.x564 + m.x578 - m.x599 - m.x606
+ m.x648 + m.x662 + m.x676 - m.x697 - m.x704 + m.x746 + m.x760 + m.x774 - m.x795 - m.x802
+ m.x844 + m.x858 + m.x872 - m.x893 - m.x900 + m.x942 + m.x956 + m.x970 - m.x991 - m.x998
>= 0)
m.c2948 = Constraint(expr= m.x453 + m.x467 + m.x481 - m.x502 - m.x509 + m.x551 + m.x565 + m.x579 - m.x600 - m.x607
+ m.x649 + m.x663 + m.x677 - m.x698 - m.x705 + m.x747 + m.x761 + m.x775 - m.x796 - m.x803
+ m.x845 + m.x859 + m.x873 - m.x894 - m.x901 + m.x943 + m.x957 + m.x971 - m.x992 - m.x999
>= 0)
m.c2949 = Constraint(expr= m.x454 + m.x468 + m.x482 - m.x503 - m.x510 + m.x552 + m.x566 + m.x580 - m.x601 - m.x608
+ m.x650 + m.x664 + m.x678 - m.x699 - m.x706 + m.x748 + m.x762 + m.x776 - m.x797 - m.x804
+ m.x846 + m.x860 + m.x874 - m.x895 - m.x902 + m.x944 + m.x958 + m.x972 - m.x993 - m.x1000
>= -50)
m.c2950 = Constraint(expr= m.x455 + m.x469 + m.x483 - m.x504 - m.x511 + m.x553 + m.x567 + m.x581 - m.x602 - m.x609
+ m.x651 + m.x665 + m.x679 - m.x700 - m.x707 + m.x749 + m.x763 + m.x777 - m.x798 - m.x805
+ m.x847 + m.x861 + m.x875 - m.x896 - m.x903 + m.x945 + m.x959 + m.x973 - m.x994 - m.x1001
>= 0)
m.c2951 = Constraint(expr= m.x456 + m.x470 + m.x484 - m.x505 - m.x512 + m.x554 + m.x568 + m.x582 - m.x603 - m.x610
+ m.x652 + m.x666 + m.x680 - m.x701 - m.x708 + m.x750 + m.x764 + m.x778 - m.x799 - m.x806
+ m.x848 + m.x862 + m.x876 - m.x897 - m.x904 + m.x946 + m.x960 + m.x974 - m.x995 - m.x1002
>= 0)
m.c2952 = Constraint(expr= m.x471 + m.x485 - m.x513 + m.x569 + m.x583 - m.x611 + m.x667 + m.x681 - m.x709 + m.x765
+ m.x779 - m.x807 + m.x863 + m.x877 - m.x905 + m.x961 + m.x975 - m.x1003 >= 0)
m.c2953 = Constraint(expr= m.x472 + m.x486 - m.x514 + m.x570 + m.x584 - m.x612 + m.x668 + m.x682 - m.x710 + m.x766
+ m.x780 - m.x808 + m.x864 + m.x878 - m.x906 + m.x962 + m.x976 - m.x1004 >= 0)
m.c2954 = Constraint(expr= m.x473 + m.x487 - m.x515 + m.x571 + m.x585 - m.x613 + m.x669 + m.x683 - m.x711 + m.x767
+ m.x781 - m.x809 + m.x865 + m.x879 - m.x907 + m.x963 + m.x977 - m.x1005 >= 0)
m.c2955 = Constraint(expr= m.x474 + m.x488 - m.x516 + m.x572 + m.x586 - m.x614 + m.x670 + m.x684 - m.x712 + m.x768
+ m.x782 - m.x810 + m.x866 + m.x880 - m.x908 + m.x964 + m.x978 - m.x1006 >= 0)
m.c2956 = Constraint(expr= m.x475 + m.x489 - m.x517 + m.x573 + m.x587 - m.x615 + m.x671 + m.x685 - m.x713 + m.x769
+ m.x783 - m.x811 + m.x867 + m.x881 - m.x909 + m.x965 + m.x979 - m.x1007 >= 0)
m.c2957 = Constraint(expr= m.x476 + m.x490 - m.x518 + m.x574 + m.x588 - m.x616 + m.x672 + m.x686 - m.x714 + m.x770
+ m.x784 - m.x812 + m.x868 + m.x882 - m.x910 + m.x966 + m.x980 - m.x1008 >= -30)
m.c2958 = Constraint(expr= m.x477 + m.x491 - m.x519 + m.x575 + m.x589 - m.x617 + m.x673 + m.x687 - m.x715 + m.x771
+ m.x785 - m.x813 + m.x869 + m.x883 - m.x911 + m.x967 + m.x981 - m.x1009 >= 0)
m.c2959 = Constraint(expr= m.x492 + m.x499 + m.x590 + m.x597 + m.x688 + m.x695 + m.x786 + m.x793 + m.x884 + m.x891
+ m.x982 + m.x989 >= 0)
m.c2960 = Constraint(expr= m.x493 + m.x500 + m.x591 + m.x598 + m.x689 + m.x696 + m.x787 + m.x794 + m.x885 + m.x892
+ m.x983 + m.x990 >= 0)
m.c2961 = Constraint(expr= m.x494 + m.x501 + m.x592 + m.x599 + m.x690 + m.x697 + m.x788 + m.x795 + m.x886 + m.x893
+ m.x984 + m.x991 >= 0)
m.c2962 = Constraint(expr= m.x495 + m.x502 + m.x593 + m.x600 + m.x691 + m.x698 + m.x789 + m.x796 + m.x887 + m.x894
+ m.x985 + m.x992 >= 0)
m.c2963 = Constraint(expr= m.x496 + m.x503 + m.x594 + m.x601 + m.x692 + m.x699 + m.x790 + m.x797 + m.x888 + m.x895
+ m.x986 + m.x993 >= 0)
m.c2964 = Constraint(expr= m.x497 + m.x504 + m.x595 + m.x602 + m.x693 + m.x700 + m.x791 + m.x798 + m.x889 + m.x896
+ m.x987 + m.x994 >= 0)
m.c2965 = Constraint(expr= m.x498 + m.x505 + m.x596 + m.x603 + m.x694 + m.x701 + m.x792 + m.x799 + m.x890 + m.x897
+ m.x988 + m.x995 >= 0)
m.c2966 = Constraint(expr= m.x506 + m.x513 + m.x604 + m.x611 + m.x702 + m.x709 + m.x800 + m.x807 + m.x898 + m.x905
+ m.x996 + m.x1003 >= 0)
m.c2967 = Constraint(expr= m.x507 + m.x514 + m.x605 + m.x612 + m.x703 + m.x710 + m.x801 + m.x808 + m.x899 + m.x906
+ m.x997 + m.x1004 >= 0)
m.c2968 = Constraint(expr= m.x508 + m.x515 + m.x606 + m.x613 + m.x704 + m.x711 + m.x802 + m.x809 + m.x900 + m.x907
+ m.x998 + m.x1005 >= 0)
m.c2969 = Constraint(expr= m.x509 + m.x516 + m.x607 + m.x614 + m.x705 + m.x712 + m.x803 + m.x810 + m.x901 + m.x908
+ m.x999 + m.x1006 >= 0)
m.c2970 = Constraint(expr= m.x510 + m.x517 + m.x608 + m.x615 + m.x706 + m.x713 + m.x804 + m.x811 + m.x902 + m.x909
+ m.x1000 + m.x1007 >= 0)
m.c2971 = Constraint(expr= m.x511 + m.x518 + m.x609 + m.x616 + m.x707 + m.x714 + m.x805 + m.x812 + m.x903 + m.x910
+ m.x1001 + m.x1008 >= 0)
m.c2972 = Constraint(expr= m.x512 + m.x519 + m.x610 + m.x617 + m.x708 + m.x715 + m.x806 + m.x813 + m.x904 + m.x911
+ m.x1002 + m.x1009 >= 0)
m.c2973 = Constraint(expr= - m.x422 - m.x520 - m.x618 - m.x716 - m.x814 - m.x912 <= 0)
m.c2974 = Constraint(expr= - m.x423 - m.x521 - m.x619 - m.x717 - m.x815 - m.x913 <= 50)
m.c2975 = Constraint(expr= - m.x424 - m.x522 - m.x620 - m.x718 - m.x816 - m.x914 <= 50)
m.c2976 = Constraint(expr= - m.x425 - m.x523 - m.x621 - m.x719 - m.x817 - m.x915 <= 50)
m.c2977 = Constraint(expr= - m.x426 - m.x524 - m.x622 - m.x720 - m.x818 - m.x916 <= 50)
m.c2978 = Constraint(expr= - m.x427 - m.x525 - m.x623 - m.x721 - m.x819 - m.x917 <= 50)
m.c2979 = Constraint(expr= - m.x428 - m.x526 - m.x624 - m.x722 - m.x820 - m.x918 <= 50)
m.c2980 = Constraint(expr= - m.x429 - m.x527 - m.x625 - m.x723 - m.x821 - m.x919 <= 50)
m.c2981 = Constraint(expr= - m.x430 - m.x528 - m.x626 - m.x724 - m.x822 - m.x920 <= 0)
m.c2982 = Constraint(expr= - m.x431 - m.x529 - m.x627 - m.x725 - m.x823 - m.x921 <= 50)
m.c2983 = Constraint(expr= - m.x432 - m.x530 - m.x628 - m.x726 - m.x824 - m.x922 <= 50)
m.c2984 = Constraint(expr= - m.x433 - m.x531 - m.x629 - m.x727 - m.x825 - m.x923 <= 50)
m.c2985 = Constraint(expr= - m.x434 - m.x532 - m.x630 - m.x728 - m.x826 - m.x924 <= 50)
m.c2986 = Constraint(expr= - m.x435 - m.x533 - m.x631 - m.x729 - m.x827 - m.x925 <= 50)
m.c2987 = Constraint(expr= - m.x436 - m.x534 - m.x632 - m.x730 - m.x828 - m.x926 <= 50)
m.c2988 = Constraint(expr= - m.x437 - m.x535 - m.x633 - m.x731 - m.x829 - m.x927 <= 50)
m.c2989 = Constraint(expr= - m.x438 - m.x536 - m.x634 - m.x732 - m.x830 - m.x928 <= 0)
m.c2990 = Constraint(expr= - m.x439 - m.x537 - m.x635 - m.x733 - m.x831 - m.x929 <= 50)
m.c2991 = Constraint(expr= - m.x440 - m.x538 - m.x636 - m.x734 - m.x832 - m.x930 <= 50)
m.c2992 = Constraint(expr= - m.x441 - m.x539 - m.x637 - m.x735 - m.x833 - m.x931 <= 50)
m.c2993 = Constraint(expr= - m.x442 - m.x540 - m.x638 - m.x736 - m.x834 - m.x932 <= 50)
m.c2994 = Constraint(expr= m.x422 - m.x443 - m.x450 + m.x520 - m.x541 - m.x548 + m.x618 - m.x639 - m.x646 + m.x716
- m.x737 - m.x744 + m.x814 - m.x835 - m.x842 + m.x912 - m.x933 - m.x940 <= 100)
m.c2995 = Constraint(expr= m.x423 - m.x444 - m.x451 + m.x521 - m.x542 - m.x549 + m.x619 - m.x640 - m.x647 + m.x717
- m.x738 - m.x745 + m.x815 - m.x836 - m.x843 + m.x913 - m.x934 - m.x941 <= 100)
m.c2996 = Constraint(expr= m.x424 - m.x445 - m.x452 + m.x522 - m.x543 - m.x550 + m.x620 - m.x641 - m.x648 + m.x718
- m.x739 - m.x746 + m.x816 - m.x837 - m.x844 + m.x914 - m.x935 - m.x942 <= 100)
m.c2997 = Constraint(expr= m.x425 - m.x446 - m.x453 + m.x523 - m.x544 - m.x551 + m.x621 - m.x642 - m.x649 + m.x719
- m.x740 - m.x747 + m.x817 - m.x838 - m.x845 + m.x915 - m.x936 - m.x943 <= 80)
m.c2998 = Constraint(expr= m.x426 - m.x447 - m.x454 + m.x524 - m.x545 - m.x552 + m.x622 - m.x643 - m.x650 + m.x720
- m.x741 - m.x748 + m.x818 - m.x839 - m.x846 + m.x916 - m.x937 - m.x944 <= 100)
m.c2999 = Constraint(expr= m.x427 - m.x448 - m.x455 + m.x525 - m.x546 - m.x553 + m.x623 - m.x644 - m.x651 + m.x721
- m.x742 - m.x749 + m.x819 - m.x840 - m.x847 + m.x917 - m.x938 - m.x945 <= 100)
m.c3000 = Constraint(expr= m.x428 - m.x449 - m.x456 + m.x526 - m.x547 - m.x554 + m.x624 - m.x645 - m.x652 + m.x722
- m.x743 - m.x750 + m.x820 - m.x841 - m.x848 + m.x918 - m.x939 - m.x946 <= 100)
m.c3001 = Constraint(expr= m.x429 - m.x457 - m.x464 - m.x471 + m.x527 - m.x555 - m.x562 - m.x569 + m.x625 - m.x653
- m.x660 - m.x667 + m.x723 - m.x751 - m.x758 - m.x765 + m.x821 - m.x849 - m.x856 - m.x863
+ m.x919 - m.x947 - m.x954 - m.x961 <= 100)
m.c3002 = Constraint(expr= m.x430 - m.x458 - m.x465 - m.x472 + m.x528 - m.x556 - m.x563 - m.x570 + m.x626 - m.x654
- m.x661 - m.x668 + m.x724 - m.x752 - m.x759 - m.x766 + m.x822 - m.x850 - m.x857 - m.x864
+ m.x920 - m.x948 - m.x955 - m.x962 <= 100)
m.c3003 = Constraint(expr= m.x431 - m.x459 - m.x466 - m.x473 + m.x529 - m.x557 - m.x564 - m.x571 + m.x627 - m.x655
- m.x662 - m.x669 + m.x725 - m.x753 - m.x760 - m.x767 + m.x823 - m.x851 - m.x858 - m.x865
+ m.x921 - m.x949 - m.x956 - m.x963 <= 100)
m.c3004 = Constraint(expr= m.x432 - m.x460 - m.x467 - m.x474 + m.x530 - m.x558 - m.x565 - m.x572 + m.x628 - m.x656
- m.x663 - m.x670 + m.x726 - m.x754 - m.x761 - m.x768 + m.x824 - m.x852 - m.x859 - m.x866
+ m.x922 - m.x950 - m.x957 - m.x964 <= 100)
m.c3005 = Constraint(expr= m.x433 - m.x461 - m.x468 - m.x475 + m.x531 - m.x559 - m.x566 - m.x573 + m.x629 - m.x657
- m.x664 - m.x671 + m.x727 - m.x755 - m.x762 - m.x769 + m.x825 - m.x853 - m.x860 - m.x867
+ m.x923 - m.x951 - m.x958 - m.x965 <= 80)
m.c3006 = Constraint(expr= m.x434 - m.x462 - m.x469 - m.x476 + m.x532 - m.x560 - m.x567 - m.x574 + m.x630 - m.x658
- m.x665 - m.x672 + m.x728 - m.x756 - m.x763 - m.x770 + m.x826 - m.x854 - m.x861 - m.x868
+ m.x924 - m.x952 - m.x959 - m.x966 <= 100)
m.c3007 = Constraint(expr= m.x435 - m.x463 - m.x470 - m.x477 + m.x533 - m.x561 - m.x568 - m.x575 + m.x631 - m.x659
- m.x666 - m.x673 + m.x729 - m.x757 - m.x764 - m.x771 + m.x827 - m.x855 - m.x862 - m.x869
+ m.x925 - m.x953 - m.x960 - m.x967 <= 100)
m.c3008 = Constraint(expr= m.x436 - m.x478 - m.x485 + m.x534 - m.x576 - m.x583 + m.x632 - m.x674 - m.x681 + m.x730
- m.x772 - m.x779 + m.x828 - m.x870 - m.x877 + m.x926 - m.x968 - m.x975 <= 100)
m.c3009 = Constraint(expr= m.x437 - m.x479 - m.x486 + m.x535 - m.x577 - m.x584 + m.x633 - m.x675 - m.x682 + m.x731
- m.x773 - m.x780 + m.x829 - m.x871 - m.x878 + m.x927 - m.x969 - m.x976 <= 100)
m.c3010 = Constraint(expr= m.x438 - m.x480 - m.x487 + m.x536 - m.x578 - m.x585 + m.x634 - m.x676 - m.x683 + m.x732
- m.x774 - m.x781 + m.x830 - m.x872 - m.x879 + m.x928 - m.x970 - m.x977 <= 100)
m.c3011 = Constraint(expr= m.x439 - m.x481 - m.x488 + m.x537 - m.x579 - m.x586 + m.x635 - m.x677 - m.x684 + m.x733
- m.x775 - m.x782 + m.x831 - m.x873 - m.x880 + m.x929 - m.x971 - m.x978 <= 100)
m.c3012 = Constraint(expr= m.x440 - m.x482 - m.x489 + m.x538 - m.x580 - m.x587 + m.x636 - m.x678 - m.x685 + m.x734
- m.x776 - m.x783 + m.x832 - m.x874 - m.x881 + m.x930 - m.x972 - m.x979 <= 100)
m.c3013 = Constraint(expr= m.x441 - m.x483 - m.x490 + m.x539 - m.x581 - m.x588 + m.x637 - m.x679 - m.x686 + m.x735
- m.x777 - m.x784 + m.x833 - m.x875 - m.x882 + m.x931 - m.x973 - m.x980 <= 80)
m.c3014 = Constraint(expr= m.x442 - m.x484 - m.x491 + m.x540 - m.x582 - m.x589 + m.x638 - m.x680 - m.x687 + m.x736
- m.x778 - m.x785 + m.x834 - m.x876 - m.x883 + m.x932 - m.x974 - m.x981 <= 100)
m.c3015 = Constraint(expr= m.x443 + m.x457 - m.x492 + m.x541 + m.x555 - m.x590 + m.x639 + m.x653 - m.x688 + m.x737
+ m.x751 - m.x786 + m.x835 + m.x849 - m.x884 + m.x933 + m.x947 - m.x982 <= 100)
m.c3016 = Constraint(expr= m.x444 + m.x458 - m.x493 + m.x542 + m.x556 - m.x591 + m.x640 + m.x654 - m.x689 + m.x738
+ m.x752 - m.x787 + m.x836 + m.x850 - m.x885 + m.x934 + m.x948 - m.x983 <= 100)
m.c3017 = Constraint(expr= m.x445 + m.x459 - m.x494 + m.x543 + m.x557 - m.x592 + m.x641 + m.x655 - m.x690 + m.x739
+ m.x753 - m.x788 + m.x837 + m.x851 - m.x886 + m.x935 + m.x949 - m.x984 <= 100)
m.c3018 = Constraint(expr= m.x446 + m.x460 - m.x495 + m.x544 + m.x558 - m.x593 + m.x642 + m.x656 - m.x691 + m.x740
+ m.x754 - m.x789 + m.x838 + m.x852 - m.x887 + m.x936 + m.x950 - m.x985 <= 100)
m.c3019 = Constraint(expr= m.x447 + m.x461 - m.x496 + m.x545 + m.x559 - m.x594 + m.x643 + m.x657 - m.x692 + m.x741
+ m.x755 - m.x790 + m.x839 + m.x853 - m.x888 + m.x937 + m.x951 - m.x986 <= 100)
m.c3020 = Constraint(expr= m.x448 + m.x462 - m.x497 + m.x546 + m.x560 - m.x595 + m.x644 + m.x658 - m.x693 + m.x742
+ m.x756 - m.x791 + m.x840 + m.x854 - m.x889 + m.x938 + m.x952 - m.x987 <= 100)
m.c3021 = Constraint(expr= m.x449 + m.x463 - m.x498 + m.x547 + m.x561 - m.x596 + m.x645 + m.x659 - m.x694 + m.x743
+ m.x757 - m.x792 + m.x841 + m.x855 - m.x890 + m.x939 + m.x953 - m.x988 <= 70)
m.c3022 = Constraint(expr= m.x450 + m.x464 + m.x478 - m.x499 - m.x506 + m.x548 + m.x562 + m.x576 - m.x597 - m.x604
+ m.x646 + m.x660 + m.x674 - m.x695 - m.x702 + m.x744 + m.x758 + m.x772 - m.x793 - m.x800
+ m.x842 + m.x856 + m.x870 - m.x891 - m.x898 + m.x940 + m.x954 + m.x968 - m.x989 - m.x996
<= 100)
m.c3023 = Constraint(expr= m.x451 + m.x465 + m.x479 - m.x500 - m.x507 + m.x549 + m.x563 + m.x577 - m.x598 - m.x605
+ m.x647 + m.x661 + m.x675 - m.x696 - m.x703 + m.x745 + m.x759 + m.x773 - m.x794 - m.x801
+ m.x843 + m.x857 + m.x871 - m.x892 - m.x899 + m.x941 + m.x955 + m.x969 - m.x990 - m.x997
<= 100)
m.c3024 = Constraint(expr= m.x452 + m.x466 + m.x480 - m.x501 - m.x508 + m.x550 + m.x564 + m.x578 - m.x599 - m.x606
+ m.x648 + m.x662 + m.x676 - m.x697 - m.x704 + m.x746 + m.x760 + m.x774 - m.x795 - m.x802
+ m.x844 + m.x858 + m.x872 - m.x893 - m.x900 + m.x942 + m.x956 + m.x970 - m.x991 - m.x998
<= 100)
m.c3025 = Constraint(expr= m.x453 + m.x467 + m.x481 - m.x502 - m.x509 + m.x551 + m.x565 + m.x579 - m.x600 - m.x607
+ m.x649 + m.x663 + m.x677 - m.x698 - m.x705 + m.x747 + m.x761 + m.x775 - m.x796 - m.x803
+ m.x845 + m.x859 + m.x873 - m.x894 - m.x901 + m.x943 + m.x957 + m.x971 - m.x992 - m.x999
<= 100)
m.c3026 = Constraint(expr= m.x454 + m.x468 + m.x482 - m.x503 - m.x510 + m.x552 + m.x566 + m.x580 - m.x601 - m.x608
+ m.x650 + m.x664 + m.x678 - m.x699 - m.x706 + m.x748 + m.x762 + m.x776 - m.x797 - m.x804
+ m.x846 + m.x860 + m.x874 - m.x895 - m.x902 + m.x944 + m.x958 + m.x972 - m.x993 - m.x1000
<= 50)
m.c3027 = Constraint(expr= m.x455 + m.x469 + m.x483 - m.x504 - m.x511 + m.x553 + m.x567 + m.x581 - m.x602 - m.x609
+ m.x651 + m.x665 + m.x679 - m.x700 - m.x707 + m.x749 + m.x763 + m.x777 - m.x798 - m.x805
+ m.x847 + m.x861 + m.x875 - m.x896 - m.x903 + m.x945 + m.x959 + m.x973 - m.x994 - m.x1001
<= 100)
m.c3028 = Constraint(expr= m.x456 + m.x470 + m.x484 - m.x505 - m.x512 + m.x554 + m.x568 + m.x582 - m.x603 - m.x610
+ m.x652 + m.x666 + m.x680 - m.x701 - m.x708 + m.x750 + m.x764 + m.x778 - m.x799 - m.x806
+ m.x848 + m.x862 + m.x876 - m.x897 - m.x904 + m.x946 + m.x960 + m.x974 - m.x995 - m.x1002
<= 100)
m.c3029 = Constraint(expr= m.x471 + m.x485 - m.x513 + m.x569 + m.x583 - m.x611 + m.x667 + m.x681 - m.x709 + m.x765
+ m.x779 - m.x807 + m.x863 + m.x877 - m.x905 + m.x961 + m.x975 - m.x1003 <= 100)
m.c3030 = Constraint(expr= m.x472 + m.x486 - m.x514 + m.x570 + m.x584 - m.x612 + m.x668 + m.x682 - m.x710 + m.x766
+ m.x780 - m.x808 + m.x864 + m.x878 - m.x906 + m.x962 + m.x976 - m.x1004 <= 100)
m.c3031 = Constraint(expr= m.x473 + m.x487 - m.x515 + m.x571 + m.x585 - m.x613 + m.x669 + m.x683 - m.x711 + m.x767
+ m.x781 - m.x809 + m.x865 + m.x879 - m.x907 + m.x963 + m.x977 - m.x1005 <= 100)
m.c3032 = Constraint(expr= m.x474 + m.x488 - m.x516 + m.x572 + m.x586 - m.x614 + m.x670 + m.x684 - m.x712 + m.x768
+ m.x782 - m.x810 + m.x866 + m.x880 - m.x908 + m.x964 + m.x978 - m.x1006 <= 100)
m.c3033 = Constraint(expr= m.x475 + m.x489 - m.x517 + m.x573 + m.x587 - m.x615 + m.x671 + m.x685 - m.x713 + m.x769
+ m.x783 - m.x811 + m.x867 + m.x881 - m.x909 + m.x965 + m.x979 - m.x1007 <= 100)
m.c3034 = Constraint(expr= m.x476 + m.x490 - m.x518 + m.x574 + m.x588 - m.x616 + m.x672 + m.x686 - m.x714 + m.x770
+ m.x784 - m.x812 + m.x868 + m.x882 - m.x910 + m.x966 + m.x980 - m.x1008 <= 70)
m.c3035 = Constraint(expr= m.x477 + m.x491 - m.x519 + m.x575 + m.x589 - m.x617 + m.x673 + m.x687 - m.x715 + m.x771
+ m.x785 - m.x813 + m.x869 + m.x883 - m.x911 + m.x967 + m.x981 - m.x1009 <= 100)
m.c3036 = Constraint(expr= 12*m.b16 + 12*m.b19 - m.x100 - m.x103 + m.x254 + m.x257 <= 12)
m.c3037 = Constraint(expr= 12*m.b16 + 12*m.b20 - m.x100 - m.x104 + m.x254 + m.x258 <= 12)
m.c3038 = Constraint(expr= 12*m.b17 + 12*m.b21 - m.x101 - m.x105 + m.x255 + m.x259 <= 12)
m.c3039 = Constraint(expr= 12*m.b17 + 12*m.b22 - m.x101 - m.x106 + m.x255 + m.x260 <= 12)
m.c3040 = Constraint(expr= 12*m.b17 + 12*m.b23 - m.x101 - m.x107 + m.x255 + m.x261 <= 12)
m.c3041 = Constraint(expr= 12*m.b18 + 12*m.b24 - m.x102 - m.x108 + m.x256 + m.x262 <= 12)
m.c3042 = Constraint(expr= 12*m.b18 + 12*m.b25 - m.x102 - m.x109 + m.x256 + m.x263 <= 12)
m.c3043 = Constraint(expr= 12*m.b19 + 12*m.b26 - m.x103 - m.x110 + m.x257 + m.x264 <= 12)
m.c3044 = Constraint(expr= 12*m.b21 + 12*m.b26 - m.x105 - m.x110 + m.x259 + m.x264 <= 12)
m.c3045 = Constraint(expr= 12*m.b23 + 12*m.b29 - m.x107 - m.x113 + m.x261 + m.x267 <= 12)
m.c3046 = Constraint(expr= 12*m.b25 + 12*m.b29 - m.x109 - m.x113 + m.x263 + m.x267 <= 12)
m.c3047 = Constraint(expr= 12*m.b26 + 12*m.b27 - m.x110 - m.x111 + m.x264 + m.x265 <= 12)
m.c3048 = Constraint(expr= 12*m.b28 + 12*m.b29 - m.x112 - m.x113 + m.x266 + m.x267 <= 12)
m.c3049 = Constraint(expr= 12*m.b16 + 12*m.b17 + 12*m.b18 - m.x100 - m.x101 - m.x102 + m.x254 + m.x255 + m.x256 <= 12)
m.c3050 = Constraint(expr= 12*m.b20 + 12*m.b27 + 12*m.b28 - m.x104 - m.x111 - m.x112 + m.x258 + m.x265 + m.x266 <= 12)
m.c3051 = Constraint(expr= 12*m.b22 + 12*m.b27 + 12*m.b28 - m.x106 - m.x111 - m.x112 + m.x260 + m.x265 + m.x266 <= 12)
m.c3052 = Constraint(expr= 12*m.b24 + 12*m.b27 + 12*m.b28 - m.x108 - m.x111 - m.x112 + m.x262 + m.x265 + m.x266 <= 12)
m.c3053 = Constraint(expr= 12*m.b30 + 12*m.b33 - m.x114 - m.x117 + m.x184 + m.x187 + m.x254 + m.x257 <= 12)
m.c3054 = Constraint(expr= 12*m.b30 + 12*m.b34 - m.x114 - m.x118 + m.x184 + m.x188 + m.x254 + m.x258 <= 12)
m.c3055 = Constraint(expr= 12*m.b31 + 12*m.b35 - m.x115 - m.x119 + m.x185 + m.x189 + m.x255 + m.x259 <= 12)
m.c3056 = Constraint(expr= 12*m.b31 + 12*m.b36 - m.x115 - m.x120 + m.x185 + m.x190 + m.x255 + m.x260 <= 12)
m.c3057 = Constraint(expr= 12*m.b31 + 12*m.b37 - m.x115 - m.x121 + m.x185 + m.x191 + m.x255 + m.x261 <= 12)
m.c3058 = Constraint(expr= 12*m.b32 + 12*m.b38 - m.x116 - m.x122 + m.x186 + m.x192 + m.x256 + m.x262 <= 12)
m.c3059 = Constraint(expr= 12*m.b32 + 12*m.b39 - m.x116 - m.x123 + m.x186 + m.x193 + m.x256 + m.x263 <= 12)
m.c3060 = Constraint(expr= 12*m.b33 + 12*m.b40 - m.x117 - m.x124 + m.x187 + m.x194 + m.x257 + m.x264 <= 12)
m.c3061 = Constraint(expr= 12*m.b35 + 12*m.b40 - m.x119 - m.x124 + m.x189 + m.x194 + m.x259 + m.x264 <= 12)
m.c3062 = Constraint(expr= 12*m.b37 + 12*m.b43 - m.x121 - m.x127 + m.x191 + m.x197 + m.x261 + m.x267 <= 12)
m.c3063 = Constraint(expr= 12*m.b39 + 12*m.b43 - m.x123 - m.x127 + m.x193 + m.x197 + m.x263 + m.x267 <= 12)
m.c3064 = Constraint(expr= 12*m.b40 + 12*m.b41 - m.x124 - m.x125 + m.x194 + m.x195 + m.x264 + m.x265 <= 12)
m.c3065 = Constraint(expr= 12*m.b42 + 12*m.b43 - m.x126 - m.x127 + m.x196 + m.x197 + m.x266 + m.x267 <= 12)
m.c3066 = Constraint(expr= 12*m.b30 + 12*m.b31 + 12*m.b32 - m.x114 - m.x115 - m.x116 + m.x184 + m.x185 + m.x186
+ m.x254 + m.x255 + m.x256 <= 12)
m.c3067 = Constraint(expr= 12*m.b34 + 12*m.b41 + 12*m.b42 - m.x118 - m.x125 - m.x126 + m.x188 + m.x195 + m.x196
+ m.x258 + m.x265 + m.x266 <= 12)
m.c3068 = Constraint(expr= 12*m.b36 + 12*m.b41 + 12*m.b42 - m.x120 - m.x125 - m.x126 + m.x190 + m.x195 + m.x196
+ m.x260 + m.x265 + m.x266 <= 12)
m.c3069 = Constraint(expr= 12*m.b38 + 12*m.b41 + 12*m.b42 - m.x122 - m.x125 - m.x126 + m.x192 + m.x195 + m.x196
+ m.x262 + m.x265 + m.x266 <= 12)
m.c3070 = Constraint(expr= 12*m.b44 + 12*m.b47 - m.x128 - m.x131 + m.x184 + m.x187 + m.x198 + m.x201 + m.x254 + m.x257
<= 12)
m.c3071 = Constraint(expr= 12*m.b44 + 12*m.b48 - m.x128 - m.x132 + m.x184 + m.x188 + m.x198 + m.x202 + m.x254 + m.x258
<= 12)
m.c3072 = Constraint(expr= 12*m.b45 + 12*m.b49 - m.x129 - m.x133 + m.x185 + m.x189 + m.x199 + m.x203 + m.x255 + m.x259
<= 12)
m.c3073 = Constraint(expr= 12*m.b45 + 12*m.b50 - m.x129 - m.x134 + m.x185 + m.x190 + m.x199 + m.x204 + m.x255 + m.x260
<= 12)
m.c3074 = Constraint(expr= 12*m.b45 + 12*m.b51 - m.x129 - m.x135 + m.x185 + m.x191 + m.x199 + m.x205 + m.x255 + m.x261
<= 12)
m.c3075 = Constraint(expr= 12*m.b46 + 12*m.b52 - m.x130 - m.x136 + m.x186 + m.x192 + m.x200 + m.x206 + m.x256 + m.x262
<= 12)
m.c3076 = Constraint(expr= 12*m.b46 + 12*m.b53 - m.x130 - m.x137 + m.x186 + m.x193 + m.x200 + m.x207 + m.x256 + m.x263
<= 12)
m.c3077 = Constraint(expr= 12*m.b47 + 12*m.b54 - m.x131 - m.x138 + m.x187 + m.x194 + m.x201 + m.x208 + m.x257 + m.x264
<= 12)
m.c3078 = Constraint(expr= 12*m.b49 + 12*m.b54 - m.x133 - m.x138 + m.x189 + m.x194 + m.x203 + m.x208 + m.x259 + m.x264
<= 12)
m.c3079 = Constraint(expr= 12*m.b51 + 12*m.b57 - m.x135 - m.x141 + m.x191 + m.x197 + m.x205 + m.x211 + m.x261 + m.x267
<= 12)
m.c3080 = Constraint(expr= 12*m.b53 + 12*m.b57 - m.x137 - m.x141 + m.x193 + m.x197 + m.x207 + m.x211 + m.x263 + m.x267
<= 12)
m.c3081 = Constraint(expr= 12*m.b54 + 12*m.b55 - m.x138 - m.x139 + m.x194 + m.x195 + m.x208 + m.x209 + m.x264 + m.x265
<= 12)
m.c3082 = Constraint(expr= 12*m.b56 + 12*m.b57 - m.x140 - m.x141 + m.x196 + m.x197 + m.x210 + m.x211 + m.x266 + m.x267
<= 12)
m.c3083 = Constraint(expr= 12*m.b44 + 12*m.b45 + 12*m.b46 - m.x128 - m.x129 - m.x130 + m.x184 + m.x185 + m.x186
+ m.x198 + m.x199 + m.x200 + m.x254 + m.x255 + m.x256 <= 12)
m.c3084 = Constraint(expr= 12*m.b48 + 12*m.b55 + 12*m.b56 - m.x132 - m.x139 - m.x140 + m.x188 + m.x195 + m.x196
+ m.x202 + m.x209 + m.x210 + m.x258 + m.x265 + m.x266 <= 12)
m.c3085 = Constraint(expr= 12*m.b50 + 12*m.b55 + 12*m.b56 - m.x134 - m.x139 - m.x140 + m.x190 + m.x195 + m.x196
+ m.x204 + m.x209 + m.x210 + m.x260 + m.x265 + m.x266 <= 12)
m.c3086 = Constraint(expr= 12*m.b52 + 12*m.b55 + 12*m.b56 - m.x136 - m.x139 - m.x140 + m.x192 + m.x195 + m.x196
+ m.x206 + m.x209 + m.x210 + m.x262 + m.x265 + m.x266 <= 12)
m.c3087 = Constraint(expr= 12*m.b58 + 12*m.b61 - m.x142 - m.x145 + m.x184 + m.x187 + m.x198 + m.x201 + m.x212 + m.x215
+ m.x254 + m.x257 <= 12)
m.c3088 = Constraint(expr= 12*m.b58 + 12*m.b62 - m.x142 - m.x146 + m.x184 + m.x188 + m.x198 + m.x202 + m.x212 + m.x216
+ m.x254 + m.x258 <= 12)
m.c3089 = Constraint(expr= 12*m.b59 + 12*m.b63 - m.x143 - m.x147 + m.x185 + m.x189 + m.x199 + m.x203 + m.x213 + m.x217
+ m.x255 + m.x259 <= 12)
m.c3090 = Constraint(expr= 12*m.b59 + 12*m.b64 - m.x143 - m.x148 + m.x185 + m.x190 + m.x199 + m.x204 + m.x213 + m.x218
+ m.x255 + m.x260 <= 12)
m.c3091 = Constraint(expr= 12*m.b59 + 12*m.b65 - m.x143 - m.x149 + m.x185 + m.x191 + m.x199 + m.x205 + m.x213 + m.x219
+ m.x255 + m.x261 <= 12)
m.c3092 = Constraint(expr= 12*m.b60 + 12*m.b66 - m.x144 - m.x150 + m.x186 + m.x192 + m.x200 + m.x206 + m.x214 + m.x220
+ m.x256 + m.x262 <= 12)
m.c3093 = Constraint(expr= 12*m.b60 + 12*m.b67 - m.x144 - m.x151 + m.x186 + m.x193 + m.x200 + m.x207 + m.x214 + m.x221
+ m.x256 + m.x263 <= 12)
m.c3094 = Constraint(expr= 12*m.b61 + 12*m.b68 - m.x145 - m.x152 + m.x187 + m.x194 + m.x201 + m.x208 + m.x215 + m.x222
+ m.x257 + m.x264 <= 12)
m.c3095 = Constraint(expr= 12*m.b63 + 12*m.b68 - m.x147 - m.x152 + m.x189 + m.x194 + m.x203 + m.x208 + m.x217 + m.x222
+ m.x259 + m.x264 <= 12)
m.c3096 = Constraint(expr= 12*m.b65 + 12*m.b71 - m.x149 - m.x155 + m.x191 + m.x197 + m.x205 + m.x211 + m.x219 + m.x225
+ m.x261 + m.x267 <= 12)
m.c3097 = Constraint(expr= 12*m.b67 + 12*m.b71 - m.x151 - m.x155 + m.x193 + m.x197 + m.x207 + m.x211 + m.x221 + m.x225
+ m.x263 + m.x267 <= 12)
m.c3098 = Constraint(expr= 12*m.b68 + 12*m.b69 - m.x152 - m.x153 + m.x194 + m.x195 + m.x208 + m.x209 + m.x222 + m.x223
+ m.x264 + m.x265 <= 12)
m.c3099 = Constraint(expr= 12*m.b70 + 12*m.b71 - m.x154 - m.x155 + m.x196 + m.x197 + m.x210 + m.x211 + m.x224 + m.x225
+ m.x266 + m.x267 <= 12)
m.c3100 = Constraint(expr= 12*m.b58 + 12*m.b59 + 12*m.b60 - m.x142 - m.x143 - m.x144 + m.x184 + m.x185 + m.x186
+ m.x198 + m.x199 + m.x200 + m.x212 + m.x213 + m.x214 + m.x254 + m.x255 + m.x256 <= 12)
m.c3101 = Constraint(expr= 12*m.b62 + 12*m.b69 + 12*m.b70 - m.x146 - m.x153 - m.x154 + m.x188 + m.x195 + m.x196
+ m.x202 + m.x209 + m.x210 + m.x216 + m.x223 + m.x224 + m.x258 + m.x265 + m.x266 <= 12)
m.c3102 = Constraint(expr= 12*m.b64 + 12*m.b69 + 12*m.b70 - m.x148 - m.x153 - m.x154 + m.x190 + m.x195 + m.x196
+ m.x204 + m.x209 + m.x210 + m.x218 + m.x223 + m.x224 + m.x260 + m.x265 + m.x266 <= 12)
m.c3103 = Constraint(expr= 12*m.b66 + 12*m.b69 + 12*m.b70 - m.x150 - m.x153 - m.x154 + m.x192 + m.x195 + m.x196
+ m.x206 + m.x209 + m.x210 + m.x220 + m.x223 + m.x224 + m.x262 + m.x265 + m.x266 <= 12)
m.c3104 = Constraint(expr= 12*m.b72 + 12*m.b75 - m.x156 - m.x159 + m.x184 + m.x187 + m.x198 + m.x201 + m.x212 + m.x215
+ m.x226 + m.x229 + m.x254 + m.x257 <= 12)
m.c3105 = Constraint(expr= 12*m.b72 + 12*m.b76 - m.x156 - m.x160 + m.x184 + m.x188 + m.x198 + m.x202 + m.x212 + m.x216
+ m.x226 + m.x230 + m.x254 + m.x258 <= 12)
m.c3106 = Constraint(expr= 12*m.b73 + 12*m.b77 - m.x157 - m.x161 + m.x185 + m.x189 + m.x199 + m.x203 + m.x213 + m.x217
+ m.x227 + m.x231 + m.x255 + m.x259 <= 12)
m.c3107 = Constraint(expr= 12*m.b73 + 12*m.b78 - m.x157 - m.x162 + m.x185 + m.x190 + m.x199 + m.x204 + m.x213 + m.x218
+ m.x227 + m.x232 + m.x255 + m.x260 <= 12)
m.c3108 = Constraint(expr= 12*m.b73 + 12*m.b79 - m.x157 - m.x163 + m.x185 + m.x191 + m.x199 + m.x205 + m.x213 + m.x219
+ m.x227 + m.x233 + m.x255 + m.x261 <= 12)
m.c3109 = Constraint(expr= 12*m.b74 + 12*m.b80 - m.x158 - m.x164 + m.x186 + m.x192 + m.x200 + m.x206 + m.x214 + m.x220
+ m.x228 + m.x234 + m.x256 + m.x262 <= 12)
m.c3110 = Constraint(expr= 12*m.b74 + 12*m.b81 - m.x158 - m.x165 + m.x186 + m.x193 + m.x200 + m.x207 + m.x214 + m.x221
+ m.x228 + m.x235 + m.x256 + m.x263 <= 12)
m.c3111 = Constraint(expr= 12*m.b75 + 12*m.b82 - m.x159 - m.x166 + m.x187 + m.x194 + m.x201 + m.x208 + m.x215 + m.x222
+ m.x229 + m.x236 + m.x257 + m.x264 <= 12)
m.c3112 = Constraint(expr= 12*m.b77 + 12*m.b82 - m.x161 - m.x166 + m.x189 + m.x194 + m.x203 + m.x208 + m.x217 + m.x222
+ m.x231 + m.x236 + m.x259 + m.x264 <= 12)
m.c3113 = Constraint(expr= 12*m.b79 + 12*m.b85 - m.x163 - m.x169 + m.x191 + m.x197 + m.x205 + m.x211 + m.x219 + m.x225
+ m.x233 + m.x239 + m.x261 + m.x267 <= 12)
m.c3114 = Constraint(expr= 12*m.b81 + 12*m.b85 - m.x165 - m.x169 + m.x193 + m.x197 + m.x207 + m.x211 + m.x221 + m.x225
+ m.x235 + m.x239 + m.x263 + m.x267 <= 12)
m.c3115 = Constraint(expr= 12*m.b82 + 12*m.b83 - m.x166 - m.x167 + m.x194 + m.x195 + m.x208 + m.x209 + m.x222 + m.x223
+ m.x236 + m.x237 + m.x264 + m.x265 <= 12)
m.c3116 = Constraint(expr= 12*m.b84 + 12*m.b85 - m.x168 - m.x169 + m.x196 + m.x197 + m.x210 + m.x211 + m.x224 + m.x225
+ m.x238 + m.x239 + m.x266 + m.x267 <= 12)
m.c3117 = Constraint(expr= 12*m.b72 + 12*m.b73 + 12*m.b74 - m.x156 - m.x157 - m.x158 + m.x184 + m.x185 + m.x186
+ m.x198 + m.x199 + m.x200 + m.x212 + m.x213 + m.x214 + m.x226 + m.x227 + m.x228 + m.x254
+ m.x255 + m.x256 <= 12)
m.c3118 = Constraint(expr= 12*m.b76 + 12*m.b83 + 12*m.b84 - m.x160 - m.x167 - m.x168 + m.x188 + m.x195 + m.x196
+ m.x202 + m.x209 + m.x210 + m.x216 + m.x223 + m.x224 + m.x230 + m.x237 + m.x238 + m.x258
+ m.x265 + m.x266 <= 12)
m.c3119 = Constraint(expr= 12*m.b78 + 12*m.b83 + 12*m.b84 - m.x162 - m.x167 - m.x168 + m.x190 + m.x195 + m.x196
+ m.x204 + m.x209 + m.x210 + m.x218 + m.x223 + m.x224 + m.x232 + m.x237 + m.x238 + m.x260
+ m.x265 + m.x266 <= 12)
m.c3120 = Constraint(expr= 12*m.b80 + 12*m.b83 + 12*m.b84 - m.x164 - m.x167 - m.x168 + m.x192 + m.x195 + m.x196
+ m.x206 + m.x209 + m.x210 + m.x220 + m.x223 + m.x224 + m.x234 + m.x237 + m.x238 + m.x262
+ m.x265 + m.x266 <= 12)
m.c3121 = Constraint(expr= 12*m.b30 + 12*m.b33 - m.x114 - m.x117 + m.x268 + m.x271 <= 12)
m.c3122 = Constraint(expr= 12*m.b30 + 12*m.b34 - m.x114 - m.x118 + m.x268 + m.x272 <= 12)
m.c3123 = Constraint(expr= 12*m.b31 + 12*m.b35 - m.x115 - m.x119 + m.x269 + m.x273 <= 12)
m.c3124 = Constraint(expr= 12*m.b31 + 12*m.b36 - m.x115 - m.x120 + m.x269 + m.x274 <= 12)
m.c3125 = Constraint(expr= 12*m.b31 + 12*m.b37 - m.x115 - m.x121 + m.x269 + m.x275 <= 12)
m.c3126 = Constraint(expr= 12*m.b32 + 12*m.b38 - m.x116 - m.x122 + m.x270 + m.x276 <= 12)
m.c3127 = Constraint(expr= 12*m.b32 + 12*m.b39 - m.x116 - m.x123 + m.x270 + m.x277 <= 12)
m.c3128 = Constraint(expr= 12*m.b33 + 12*m.b40 - m.x117 - m.x124 + m.x271 + m.x278 <= 12)
m.c3129 = Constraint(expr= 12*m.b35 + 12*m.b40 - m.x119 - m.x124 + m.x273 + m.x278 <= 12)
m.c3130 = Constraint(expr= 12*m.b37 + 12*m.b43 - m.x121 - m.x127 + m.x275 + m.x281 <= 12)
m.c3131 = Constraint(expr= 12*m.b39 + 12*m.b43 - m.x123 - m.x127 + m.x277 + m.x281 <= 12)
m.c3132 = Constraint(expr= 12*m.b40 + 12*m.b41 - m.x124 - m.x125 + m.x278 + m.x279 <= 12)
m.c3133 = Constraint(expr= 12*m.b42 + 12*m.b43 - m.x126 - m.x127 + m.x280 + m.x281 <= 12)
m.c3134 = Constraint(expr= 12*m.b30 + 12*m.b31 + 12*m.b32 - m.x114 - m.x115 - m.x116 + m.x268 + m.x269 + m.x270 <= 12)
m.c3135 = Constraint(expr= 12*m.b34 + 12*m.b41 + 12*m.b42 - m.x118 - m.x125 - m.x126 + m.x272 + m.x279 + m.x280 <= 12)
m.c3136 = Constraint(expr= 12*m.b36 + 12*m.b41 + 12*m.b42 - m.x120 - m.x125 - m.x126 + m.x274 + m.x279 + m.x280 <= 12)
m.c3137 = Constraint(expr= 12*m.b38 + 12*m.b41 + 12*m.b42 - m.x122 - m.x125 - m.x126 + m.x276 + m.x279 + m.x280 <= 12)
m.c3138 = Constraint(expr= 12*m.b44 + 12*m.b47 - m.x128 - m.x131 + m.x198 + m.x201 + m.x268 + m.x271 <= 12)
m.c3139 = Constraint(expr= 12*m.b44 + 12*m.b48 - m.x128 - m.x132 + m.x198 + m.x202 + m.x268 + m.x272 <= 12)
m.c3140 = Constraint(expr= 12*m.b45 + 12*m.b49 - m.x129 - m.x133 + m.x199 + m.x203 + m.x269 + m.x273 <= 12)
m.c3141 = Constraint(expr= 12*m.b45 + 12*m.b50 - m.x129 - m.x134 + m.x199 + m.x204 + m.x269 + m.x274 <= 12)
m.c3142 = Constraint(expr= 12*m.b45 + 12*m.b51 - m.x129 - m.x135 + m.x199 + m.x205 + m.x269 + m.x275 <= 12)
m.c3143 = Constraint(expr= 12*m.b46 + 12*m.b52 - m.x130 - m.x136 + m.x200 + m.x206 + m.x270 + m.x276 <= 12)
m.c3144 = Constraint(expr= 12*m.b46 + 12*m.b53 - m.x130 - m.x137 + m.x200 + m.x207 + m.x270 + m.x277 <= 12)
m.c3145 = Constraint(expr= 12*m.b47 + 12*m.b54 - m.x131 - m.x138 + m.x201 + m.x208 + m.x271 + m.x278 <= 12)
m.c3146 = Constraint(expr= 12*m.b49 + 12*m.b54 - m.x133 - m.x138 + m.x203 + m.x208 + m.x273 + m.x278 <= 12)
m.c3147 = Constraint(expr= 12*m.b51 + 12*m.b57 - m.x135 - m.x141 + m.x205 + m.x211 + m.x275 + m.x281 <= 12)
m.c3148 = Constraint(expr= 12*m.b53 + 12*m.b57 - m.x137 - m.x141 + m.x207 + m.x211 + m.x277 + m.x281 <= 12)
m.c3149 = Constraint(expr= 12*m.b54 + 12*m.b55 - m.x138 - m.x139 + m.x208 + m.x209 + m.x278 + m.x279 <= 12)
m.c3150 = Constraint(expr= 12*m.b56 + 12*m.b57 - m.x140 - m.x141 + m.x210 + m.x211 + m.x280 + m.x281 <= 12)
m.c3151 = Constraint(expr= 12*m.b44 + 12*m.b45 + 12*m.b46 - m.x128 - m.x129 - m.x130 + m.x198 + m.x199 + m.x200
+ m.x268 + m.x269 + m.x270 <= 12)
m.c3152 = Constraint(expr= 12*m.b48 + 12*m.b55 + 12*m.b56 - m.x132 - m.x139 - m.x140 + m.x202 + m.x209 + m.x210
+ m.x272 + m.x279 + m.x280 <= 12)
m.c3153 = Constraint(expr= 12*m.b50 + 12*m.b55 + 12*m.b56 - m.x134 - m.x139 - m.x140 + m.x204 + m.x209 + m.x210
+ m.x274 + m.x279 + m.x280 <= 12)
m.c3154 = Constraint(expr= 12*m.b52 + 12*m.b55 + 12*m.b56 - m.x136 - m.x139 - m.x140 + m.x206 + m.x209 + m.x210
+ m.x276 + m.x279 + m.x280 <= 12)
m.c3155 = Constraint(expr= 12*m.b58 + 12*m.b61 - m.x142 - m.x145 + m.x198 + m.x201 + m.x212 + m.x215 + m.x268 + m.x271
<= 12)
m.c3156 = Constraint(expr= 12*m.b58 + 12*m.b62 - m.x142 - m.x146 + m.x198 + m.x202 + m.x212 + m.x216 + m.x268 + m.x272
<= 12)
m.c3157 = Constraint(expr= 12*m.b59 + 12*m.b63 - m.x143 - m.x147 + m.x199 + m.x203 + m.x213 + m.x217 + m.x269 + m.x273
<= 12)
m.c3158 = Constraint(expr= 12*m.b59 + 12*m.b64 - m.x143 - m.x148 + m.x199 + m.x204 + m.x213 + m.x218 + m.x269 + m.x274
<= 12)
m.c3159 = Constraint(expr= 12*m.b59 + 12*m.b65 - m.x143 - m.x149 + m.x199 + m.x205 + m.x213 + m.x219 + m.x269 + m.x275
<= 12)
m.c3160 = Constraint(expr= 12*m.b60 + 12*m.b66 - m.x144 - m.x150 + m.x200 + m.x206 + m.x214 + m.x220 + m.x270 + m.x276
<= 12)
m.c3161 = Constraint(expr= 12*m.b60 + 12*m.b67 - m.x144 - m.x151 + m.x200 + m.x207 + m.x214 + m.x221 + m.x270 + m.x277
<= 12)
m.c3162 = Constraint(expr= 12*m.b61 + 12*m.b68 - m.x145 - m.x152 + m.x201 + m.x208 + m.x215 + m.x222 + m.x271 + m.x278
<= 12)
m.c3163 = Constraint(expr= 12*m.b63 + 12*m.b68 - m.x147 - m.x152 + m.x203 + m.x208 + m.x217 + m.x222 + m.x273 + m.x278
<= 12)
m.c3164 = Constraint(expr= 12*m.b65 + 12*m.b71 - m.x149 - m.x155 + m.x205 + m.x211 + m.x219 + m.x225 + m.x275 + m.x281
<= 12)
m.c3165 = Constraint(expr= 12*m.b67 + 12*m.b71 - m.x151 - m.x155 + m.x207 + m.x211 + m.x221 + m.x225 + m.x277 + m.x281
<= 12)
m.c3166 = Constraint(expr= 12*m.b68 + 12*m.b69 - m.x152 - m.x153 + m.x208 + m.x209 + m.x222 + m.x223 + m.x278 + m.x279
<= 12)
m.c3167 = Constraint(expr= 12*m.b70 + 12*m.b71 - m.x154 - m.x155 + m.x210 + m.x211 + m.x224 + m.x225 + m.x280 + m.x281
<= 12)
m.c3168 = Constraint(expr= 12*m.b58 + 12*m.b59 + 12*m.b60 - m.x142 - m.x143 - m.x144 + m.x198 + m.x199 + m.x200
+ m.x212 + m.x213 + m.x214 + m.x268 + m.x269 + m.x270 <= 12)
m.c3169 = Constraint(expr= 12*m.b62 + 12*m.b69 + 12*m.b70 - m.x146 - m.x153 - m.x154 + m.x202 + m.x209 + m.x210
+ m.x216 + m.x223 + m.x224 + m.x272 + m.x279 + m.x280 <= 12)
m.c3170 = Constraint(expr= 12*m.b64 + 12*m.b69 + 12*m.b70 - m.x148 - m.x153 - m.x154 + m.x204 + m.x209 + m.x210
+ m.x218 + m.x223 + m.x224 + m.x274 + m.x279 + m.x280 <= 12)
m.c3171 = Constraint(expr= 12*m.b66 + 12*m.b69 + 12*m.b70 - m.x150 - m.x153 - m.x154 + m.x206 + m.x209 + m.x210
+ m.x220 + m.x223 + m.x224 + m.x276 + m.x279 + m.x280 <= 12)
m.c3172 = Constraint(expr= 12*m.b72 + 12*m.b75 - m.x156 - m.x159 + m.x198 + m.x201 + m.x212 + m.x215 + m.x226 + m.x229
+ m.x268 + m.x271 <= 12)
m.c3173 = Constraint(expr= 12*m.b72 + 12*m.b76 - m.x156 - m.x160 + m.x198 + m.x202 + m.x212 + m.x216 + m.x226 + m.x230
+ m.x268 + m.x272 <= 12)
m.c3174 = Constraint(expr= 12*m.b73 + 12*m.b77 - m.x157 - m.x161 + m.x199 + m.x203 + m.x213 + m.x217 + m.x227 + m.x231
+ m.x269 + m.x273 <= 12)
m.c3175 = Constraint(expr= 12*m.b73 + 12*m.b78 - m.x157 - m.x162 + m.x199 + m.x204 + m.x213 + m.x218 + m.x227 + m.x232
+ m.x269 + m.x274 <= 12)
m.c3176 = Constraint(expr= 12*m.b73 + 12*m.b79 - m.x157 - m.x163 + m.x199 + m.x205 + m.x213 + m.x219 + m.x227 + m.x233
+ m.x269 + m.x275 <= 12)
m.c3177 = Constraint(expr= 12*m.b74 + 12*m.b80 - m.x158 - m.x164 + m.x200 + m.x206 + m.x214 + m.x220 + m.x228 + m.x234
+ m.x270 + m.x276 <= 12)
m.c3178 = Constraint(expr= 12*m.b74 + 12*m.b81 - m.x158 - m.x165 + m.x200 + m.x207 + m.x214 + m.x221 + m.x228 + m.x235
+ m.x270 + m.x277 <= 12)
m.c3179 = Constraint(expr= 12*m.b75 + 12*m.b82 - m.x159 - m.x166 + m.x201 + m.x208 + m.x215 + m.x222 + m.x229 + m.x236
+ m.x271 + m.x278 <= 12)
m.c3180 = Constraint(expr= 12*m.b77 + 12*m.b82 - m.x161 - m.x166 + m.x203 + m.x208 + m.x217 + m.x222 + m.x231 + m.x236
+ m.x273 + m.x278 <= 12)
m.c3181 = Constraint(expr= 12*m.b79 + 12*m.b85 - m.x163 - m.x169 + m.x205 + m.x211 + m.x219 + m.x225 + m.x233 + m.x239
+ m.x275 + m.x281 <= 12)
m.c3182 = Constraint(expr= 12*m.b81 + 12*m.b85 - m.x165 - m.x169 + m.x207 + m.x211 + m.x221 + m.x225 + m.x235 + m.x239
+ m.x277 + m.x281 <= 12)
m.c3183 = Constraint(expr= 12*m.b82 + 12*m.b83 - m.x166 - m.x167 + m.x208 + m.x209 + m.x222 + m.x223 + m.x236 + m.x237
+ m.x278 + m.x279 <= 12)
m.c3184 = Constraint(expr= 12*m.b84 + 12*m.b85 - m.x168 - m.x169 + m.x210 + m.x211 + m.x224 + m.x225 + m.x238 + m.x239
+ m.x280 + m.x281 <= 12)
m.c3185 = Constraint(expr= 12*m.b72 + 12*m.b73 + 12*m.b74 - m.x156 - m.x157 - m.x158 + m.x198 + m.x199 + m.x200
+ m.x212 + m.x213 + m.x214 + m.x226 + m.x227 + m.x228 + m.x268 + m.x269 + m.x270 <= 12)
m.c3186 = Constraint(expr= 12*m.b76 + 12*m.b83 + 12*m.b84 - m.x160 - m.x167 - m.x168 + m.x202 + m.x209 + m.x210
+ m.x216 + m.x223 + m.x224 + m.x230 + m.x237 + m.x238 + m.x272 + m.x279 + m.x280 <= 12)
m.c3187 = Constraint(expr= 12*m.b78 + 12*m.b83 + 12*m.b84 - m.x162 - m.x167 - m.x168 + m.x204 + m.x209 + m.x210
+ m.x218 + m.x223 + m.x224 + m.x232 + m.x237 + m.x238 + m.x274 + m.x279 + m.x280 <= 12)
m.c3188 = Constraint(expr= 12*m.b80 + 12*m.b83 + 12*m.b84 - m.x164 - m.x167 - m.x168 + m.x206 + m.x209 + m.x210
+ m.x220 + m.x223 + m.x224 + m.x234 + m.x237 + m.x238 + m.x276 + m.x279 + m.x280 <= 12)
m.c3189 = Constraint(expr= 12*m.b44 + 12*m.b47 - m.x128 - m.x131 + m.x282 + m.x285 <= 12)
m.c3190 = Constraint(expr= 12*m.b44 + 12*m.b48 - m.x128 - m.x132 + m.x282 + m.x286 <= 12)
m.c3191 = Constraint(expr= 12*m.b45 + 12*m.b49 - m.x129 - m.x133 + m.x283 + m.x287 <= 12)
m.c3192 = Constraint(expr= 12*m.b45 + 12*m.b50 - m.x129 - m.x134 + m.x283 + m.x288 <= 12)
m.c3193 = Constraint(expr= 12*m.b45 + 12*m.b51 - m.x129 - m.x135 + m.x283 + m.x289 <= 12)
m.c3194 = Constraint(expr= 12*m.b46 + 12*m.b52 - m.x130 - m.x136 + m.x284 + m.x290 <= 12)
m.c3195 = Constraint(expr= 12*m.b46 + 12*m.b53 - m.x130 - m.x137 + m.x284 + m.x291 <= 12)
m.c3196 = Constraint(expr= 12*m.b47 + 12*m.b54 - m.x131 - m.x138 + m.x285 + m.x292 <= 12)
m.c3197 = Constraint(expr= 12*m.b49 + 12*m.b54 - m.x133 - m.x138 + m.x287 + m.x292 <= 12)
m.c3198 = Constraint(expr= 12*m.b51 + 12*m.b57 - m.x135 - m.x141 + m.x289 + m.x295 <= 12)
m.c3199 = Constraint(expr= 12*m.b53 + 12*m.b57 - m.x137 - m.x141 + m.x291 + m.x295 <= 12)
m.c3200 = Constraint(expr= 12*m.b54 + 12*m.b55 - m.x138 - m.x139 + m.x292 + m.x293 <= 12)
m.c3201 = Constraint(expr= 12*m.b56 + 12*m.b57 - m.x140 - m.x141 + m.x294 + m.x295 <= 12)
m.c3202 = Constraint(expr= 12*m.b44 + 12*m.b45 + 12*m.b46 - m.x128 - m.x129 - m.x130 + m.x282 + m.x283 + m.x284 <= 12)
m.c3203 = Constraint(expr= 12*m.b48 + 12*m.b55 + 12*m.b56 - m.x132 - m.x139 - m.x140 + m.x286 + m.x293 + m.x294 <= 12)
m.c3204 = Constraint(expr= 12*m.b50 + 12*m.b55 + 12*m.b56 - m.x134 - m.x139 - m.x140 + m.x288 + m.x293 + m.x294 <= 12)
m.c3205 = Constraint(expr= 12*m.b52 + 12*m.b55 + 12*m.b56 - m.x136 - m.x139 - m.x140 + m.x290 + m.x293 + m.x294 <= 12)
m.c3206 = Constraint(expr= 12*m.b58 + 12*m.b61 - m.x142 - m.x145 + m.x212 + m.x215 + m.x282 + m.x285 <= 12)
m.c3207 = Constraint(expr= 12*m.b58 + 12*m.b62 - m.x142 - m.x146 + m.x212 + m.x216 + m.x282 + m.x286 <= 12)
m.c3208 = Constraint(expr= 12*m.b59 + 12*m.b63 - m.x143 - m.x147 + m.x213 + m.x217 + m.x283 + m.x287 <= 12)
m.c3209 = Constraint(expr= 12*m.b59 + 12*m.b64 - m.x143 - m.x148 + m.x213 + m.x218 + m.x283 + m.x288 <= 12)
m.c3210 = Constraint(expr= 12*m.b59 + 12*m.b65 - m.x143 - m.x149 + m.x213 + m.x219 + m.x283 + m.x289 <= 12)
m.c3211 = Constraint(expr= 12*m.b60 + 12*m.b66 - m.x144 - m.x150 + m.x214 + m.x220 + m.x284 + m.x290 <= 12)
m.c3212 = Constraint(expr= 12*m.b60 + 12*m.b67 - m.x144 - m.x151 + m.x214 + m.x221 + m.x284 + m.x291 <= 12)
m.c3213 = Constraint(expr= 12*m.b61 + 12*m.b68 - m.x145 - m.x152 + m.x215 + m.x222 + m.x285 + m.x292 <= 12)
m.c3214 = Constraint(expr= 12*m.b63 + 12*m.b68 - m.x147 - m.x152 + m.x217 + m.x222 + m.x287 + m.x292 <= 12)
m.c3215 = Constraint(expr= 12*m.b65 + 12*m.b71 - m.x149 - m.x155 + m.x219 + m.x225 + m.x289 + m.x295 <= 12)
m.c3216 = Constraint(expr= 12*m.b67 + 12*m.b71 - m.x151 - m.x155 + m.x221 + m.x225 + m.x291 + m.x295 <= 12)
m.c3217 = Constraint(expr= 12*m.b68 + 12*m.b69 - m.x152 - m.x153 + m.x222 + m.x223 + m.x292 + m.x293 <= 12)
m.c3218 = Constraint(expr= 12*m.b70 + 12*m.b71 - m.x154 - m.x155 + m.x224 + m.x225 + m.x294 + m.x295 <= 12)
m.c3219 = Constraint(expr= 12*m.b58 + 12*m.b59 + 12*m.b60 - m.x142 - m.x143 - m.x144 + m.x212 + m.x213 + m.x214
+ m.x282 + m.x283 + m.x284 <= 12)
m.c3220 = Constraint(expr= 12*m.b62 + 12*m.b69 + 12*m.b70 - m.x146 - m.x153 - m.x154 + m.x216 + m.x223 + m.x224
+ m.x286 + m.x293 + m.x294 <= 12)
m.c3221 = Constraint(expr= 12*m.b64 + 12*m.b69 + 12*m.b70 - m.x148 - m.x153 - m.x154 + m.x218 + m.x223 + m.x224
+ m.x288 + m.x293 + m.x294 <= 12)
m.c3222 = Constraint(expr= 12*m.b66 + 12*m.b69 + 12*m.b70 - m.x150 - m.x153 - m.x154 + m.x220 + m.x223 + m.x224
+ m.x290 + m.x293 + m.x294 <= 12)
m.c3223 = Constraint(expr= 12*m.b72 + 12*m.b75 - m.x156 - m.x159 + m.x212 + m.x215 + m.x226 + m.x229 + m.x282 + m.x285
<= 12)
m.c3224 = Constraint(expr= 12*m.b72 + 12*m.b76 - m.x156 - m.x160 + m.x212 + m.x216 + m.x226 + m.x230 + m.x282 + m.x286
<= 12)
m.c3225 = Constraint(expr= 12*m.b73 + 12*m.b77 - m.x157 - m.x161 + m.x213 + m.x217 + m.x227 + m.x231 + m.x283 + m.x287
<= 12)
m.c3226 = Constraint(expr= 12*m.b73 + 12*m.b78 - m.x157 - m.x162 + m.x213 + m.x218 + m.x227 + m.x232 + m.x283 + m.x288
<= 12)
m.c3227 = Constraint(expr= 12*m.b73 + 12*m.b79 - m.x157 - m.x163 + m.x213 + m.x219 + m.x227 + m.x233 + m.x283 + m.x289
<= 12)
m.c3228 = Constraint(expr= 12*m.b74 + 12*m.b80 - m.x158 - m.x164 + m.x214 + m.x220 + m.x228 + m.x234 + m.x284 + m.x290
<= 12)
m.c3229 = Constraint(expr= 12*m.b74 + 12*m.b81 - m.x158 - m.x165 + m.x214 + m.x221 + m.x228 + m.x235 + m.x284 + m.x291
<= 12)
m.c3230 = Constraint(expr= 12*m.b75 + 12*m.b82 - m.x159 - m.x166 + m.x215 + m.x222 + m.x229 + m.x236 + m.x285 + m.x292
<= 12)
m.c3231 = Constraint(expr= 12*m.b77 + 12*m.b82 - m.x161 - m.x166 + m.x217 + m.x222 + m.x231 + m.x236 + m.x287 + m.x292
<= 12)
m.c3232 = Constraint(expr= 12*m.b79 + 12*m.b85 - m.x163 - m.x169 + m.x219 + m.x225 + m.x233 + m.x239 + m.x289 + m.x295
<= 12)
m.c3233 = Constraint(expr= 12*m.b81 + 12*m.b85 - m.x165 - m.x169 + m.x221 + m.x225 + m.x235 + m.x239 + m.x291 + m.x295
<= 12)
m.c3234 = Constraint(expr= 12*m.b82 + 12*m.b83 - m.x166 - m.x167 + m.x222 + m.x223 + m.x236 + m.x237 + m.x292 + m.x293
<= 12)
m.c3235 = Constraint(expr= 12*m.b84 + 12*m.b85 - m.x168 - m.x169 + m.x224 + m.x225 + m.x238 + m.x239 + m.x294 + m.x295
<= 12)
m.c3236 = Constraint(expr= 12*m.b72 + 12*m.b73 + 12*m.b74 - m.x156 - m.x157 - m.x158 + m.x212 + m.x213 + m.x214
+ m.x226 + m.x227 + m.x228 + m.x282 + m.x283 + m.x284 <= 12)
m.c3237 = Constraint(expr= 12*m.b76 + 12*m.b83 + 12*m.b84 - m.x160 - m.x167 - m.x168 + m.x216 + m.x223 + m.x224
+ m.x230 + m.x237 + m.x238 + m.x286 + m.x293 + m.x294 <= 12)
m.c3238 = Constraint(expr= 12*m.b78 + 12*m.b83 + 12*m.b84 - m.x162 - m.x167 - m.x168 + m.x218 + m.x223 + m.x224
+ m.x232 + m.x237 + m.x238 + m.x288 + m.x293 + m.x294 <= 12)
m.c3239 = Constraint(expr= 12*m.b80 + 12*m.b83 + 12*m.b84 - m.x164 - m.x167 - m.x168 + m.x220 + m.x223 + m.x224
+ m.x234 + m.x237 + m.x238 + m.x290 + m.x293 + m.x294 <= 12)
m.c3240 = Constraint(expr= 12*m.b58 + 12*m.b61 - m.x142 - m.x145 + m.x296 + m.x299 <= 12)
m.c3241 = Constraint(expr= 12*m.b58 + 12*m.b62 - m.x142 - m.x146 + m.x296 + m.x300 <= 12)
m.c3242 = Constraint(expr= 12*m.b59 + 12*m.b63 - m.x143 - m.x147 + m.x297 + m.x301 <= 12)
m.c3243 = Constraint(expr= 12*m.b59 + 12*m.b64 - m.x143 - m.x148 + m.x297 + m.x302 <= 12)
m.c3244 = Constraint(expr= 12*m.b59 + 12*m.b65 - m.x143 - m.x149 + m.x297 + m.x303 <= 12)
m.c3245 = Constraint(expr= 12*m.b60 + 12*m.b66 - m.x144 - m.x150 + m.x298 + m.x304 <= 12)
m.c3246 = Constraint(expr= 12*m.b60 + 12*m.b67 - m.x144 - m.x151 + m.x298 + m.x305 <= 12)
m.c3247 = Constraint(expr= 12*m.b61 + 12*m.b68 - m.x145 - m.x152 + m.x299 + m.x306 <= 12)
m.c3248 = Constraint(expr= 12*m.b63 + 12*m.b68 - m.x147 - m.x152 + m.x301 + m.x306 <= 12)
m.c3249 = Constraint(expr= 12*m.b65 + 12*m.b71 - m.x149 - m.x155 + m.x303 + m.x309 <= 12)
m.c3250 = Constraint(expr= 12*m.b67 + 12*m.b71 - m.x151 - m.x155 + m.x305 + m.x309 <= 12)
m.c3251 = Constraint(expr= 12*m.b68 + 12*m.b69 - m.x152 - m.x153 + m.x306 + m.x307 <= 12)
m.c3252 = Constraint(expr= 12*m.b70 + 12*m.b71 - m.x154 - m.x155 + m.x308 + m.x309 <= 12)
m.c3253 = Constraint(expr= 12*m.b58 + 12*m.b59 + 12*m.b60 - m.x142 - m.x143 - m.x144 + m.x296 + m.x297 + m.x298 <= 12)
m.c3254 = Constraint(expr= 12*m.b62 + 12*m.b69 + 12*m.b70 - m.x146 - m.x153 - m.x154 + m.x300 + m.x307 + m.x308 <= 12)
m.c3255 = Constraint(expr= 12*m.b64 + 12*m.b69 + 12*m.b70 - m.x148 - m.x153 - m.x154 + m.x302 + m.x307 + m.x308 <= 12)
m.c3256 = Constraint(expr= 12*m.b66 + 12*m.b69 + 12*m.b70 - m.x150 - m.x153 - m.x154 + m.x304 + m.x307 + m.x308 <= 12)
m.c3257 = Constraint(expr= 12*m.b72 + 12*m.b75 - m.x156 - m.x159 + m.x226 + m.x229 + m.x296 + m.x299 <= 12)
m.c3258 = Constraint(expr= 12*m.b72 + 12*m.b76 - m.x156 - m.x160 + m.x226 + m.x230 + m.x296 + m.x300 <= 12)
m.c3259 = Constraint(expr= 12*m.b73 + 12*m.b77 - m.x157 - m.x161 + m.x227 + m.x231 + m.x297 + m.x301 <= 12)
m.c3260 = Constraint(expr= 12*m.b73 + 12*m.b78 - m.x157 - m.x162 + m.x227 + m.x232 + m.x297 + m.x302 <= 12)
m.c3261 = Constraint(expr= 12*m.b73 + 12*m.b79 - m.x157 - m.x163 + m.x227 + m.x233 + m.x297 + m.x303 <= 12)
m.c3262 = Constraint(expr= 12*m.b74 + 12*m.b80 - m.x158 - m.x164 + m.x228 + m.x234 + m.x298 + m.x304 <= 12)
m.c3263 = Constraint(expr= 12*m.b74 + 12*m.b81 - m.x158 - m.x165 + m.x228 + m.x235 + m.x298 + m.x305 <= 12)
m.c3264 = Constraint(expr= 12*m.b75 + 12*m.b82 - m.x159 - m.x166 + m.x229 + m.x236 + m.x299 + m.x306 <= 12)
m.c3265 = Constraint(expr= 12*m.b77 + 12*m.b82 - m.x161 - m.x166 + m.x231 + m.x236 + m.x301 + m.x306 <= 12)
m.c3266 = Constraint(expr= 12*m.b79 + 12*m.b85 - m.x163 - m.x169 + m.x233 + m.x239 + m.x303 + m.x309 <= 12)
m.c3267 = Constraint(expr= 12*m.b81 + 12*m.b85 - m.x165 - m.x169 + m.x235 + m.x239 + m.x305 + m.x309 <= 12)
m.c3268 = Constraint(expr= 12*m.b82 + 12*m.b83 - m.x166 - m.x167 + m.x236 + m.x237 + m.x306 + m.x307 <= 12)
m.c3269 = Constraint(expr= 12*m.b84 + 12*m.b85 - m.x168 - m.x169 + m.x238 + m.x239 + m.x308 + m.x309 <= 12)
m.c3270 = Constraint(expr= 12*m.b72 + 12*m.b73 + 12*m.b74 - m.x156 - m.x157 - m.x158 + m.x226 + m.x227 + m.x228
+ m.x296 + m.x297 + m.x298 <= 12)
m.c3271 = Constraint(expr= 12*m.b76 + 12*m.b83 + 12*m.b84 - m.x160 - m.x167 - m.x168 + m.x230 + m.x237 + m.x238
+ m.x300 + m.x307 + m.x308 <= 12)
m.c3272 = Constraint(expr= 12*m.b78 + 12*m.b83 + 12*m.b84 - m.x162 - m.x167 - m.x168 + m.x232 + m.x237 + m.x238
+ m.x302 + m.x307 + m.x308 <= 12)
m.c3273 = Constraint(expr= 12*m.b80 + 12*m.b83 + 12*m.b84 - m.x164 - m.x167 - m.x168 + m.x234 + m.x237 + m.x238
+ m.x304 + m.x307 + m.x308 <= 12)
m.c3274 = Constraint(expr= 12*m.b72 + 12*m.b75 - m.x156 - m.x159 + m.x310 + m.x313 <= 12)
m.c3275 = Constraint(expr= 12*m.b72 + 12*m.b76 - m.x156 - m.x160 + m.x310 + m.x314 <= 12)
m.c3276 = Constraint(expr= 12*m.b73 + 12*m.b77 - m.x157 - m.x161 + m.x311 + m.x315 <= 12)
m.c3277 = Constraint(expr= 12*m.b73 + 12*m.b78 - m.x157 - m.x162 + m.x311 + m.x316 <= 12)
m.c3278 = Constraint(expr= 12*m.b73 + 12*m.b79 - m.x157 - m.x163 + m.x311 + m.x317 <= 12)
m.c3279 = Constraint(expr= 12*m.b74 + 12*m.b80 - m.x158 - m.x164 + m.x312 + m.x318 <= 12)
m.c3280 = Constraint(expr= 12*m.b74 + 12*m.b81 - m.x158 - m.x165 + m.x312 + m.x319 <= 12)
m.c3281 = Constraint(expr= 12*m.b75 + 12*m.b82 - m.x159 - m.x166 + m.x313 + m.x320 <= 12)
m.c3282 = Constraint(expr= 12*m.b77 + 12*m.b82 - m.x161 - m.x166 + m.x315 + m.x320 <= 12)
m.c3283 = Constraint(expr= 12*m.b79 + 12*m.b85 - m.x163 - m.x169 + m.x317 + m.x323 <= 12)
m.c3284 = Constraint(expr= 12*m.b81 + 12*m.b85 - m.x165 - m.x169 + m.x319 + m.x323 <= 12)
m.c3285 = Constraint(expr= 12*m.b82 + 12*m.b83 - m.x166 - m.x167 + m.x320 + m.x321 <= 12)
m.c3286 = Constraint(expr= 12*m.b84 + 12*m.b85 - m.x168 - m.x169 + m.x322 + m.x323 <= 12)
m.c3287 = Constraint(expr= 12*m.b72 + 12*m.b73 + 12*m.b74 - m.x156 - m.x157 - m.x158 + m.x310 + m.x311 + m.x312 <= 12)
m.c3288 = Constraint(expr= 12*m.b76 + 12*m.b83 + 12*m.b84 - m.x160 - m.x167 - m.x168 + m.x314 + m.x321 + m.x322 <= 12)
m.c3289 = Constraint(expr= 12*m.b78 + 12*m.b83 + 12*m.b84 - m.x162 - m.x167 - m.x168 + m.x316 + m.x321 + m.x322 <= 12)
m.c3290 = Constraint(expr= 12*m.b80 + 12*m.b83 + 12*m.b84 - m.x164 - m.x167 - m.x168 + m.x318 + m.x321 + m.x322 <= 12)
m.c3291 = Constraint(expr= - m.b3 - m.b4 - m.b5 - m.b6 + m.b16 <= 0)
m.c3292 = Constraint(expr= - m.b2 - m.b4 - m.b7 - m.b8 - m.b9 + m.b17 <= 0)
m.c3293 = Constraint(expr= - m.b2 - m.b3 - m.b10 - m.b11 + m.b18 <= 0)
m.c3294 = Constraint(expr= - m.b2 - m.b12 + m.b19 <= 0)
m.c3295 = Constraint(expr= - m.b2 - m.b13 - m.b14 + m.b20 <= 0)
m.c3296 = Constraint(expr= - m.b3 - m.b12 + m.b21 <= 0)
m.c3297 = Constraint(expr= - m.b3 - m.b13 - m.b14 + m.b22 <= 0)
m.c3298 = Constraint(expr= - m.b3 - m.b15 + m.b23 <= 0)
m.c3299 = Constraint(expr= - m.b4 - m.b13 - m.b14 + m.b24 <= 0)
m.c3300 = Constraint(expr= - m.b4 - m.b15 + m.b25 <= 0)
m.c3301 = Constraint(expr= - m.b5 - m.b7 - m.b13 + m.b26 <= 0)
m.c3302 = Constraint(expr= - m.b6 - m.b8 - m.b10 - m.b12 - m.b14 + m.b27 <= 0)
m.c3303 = Constraint(expr= - m.b6 - m.b8 - m.b10 - m.b13 - m.b15 + m.b28 <= 0)
m.c3304 = Constraint(expr= - m.b9 - m.b11 - m.b14 + m.b29 <= 0)
m.c3305 = Constraint(expr= - m.b17 - m.b18 - m.b19 - m.b20 + m.b30 <= 0)
m.c3306 = Constraint(expr= - m.b16 - m.b18 - m.b21 - m.b22 - m.b23 + m.b31 <= 0)
m.c3307 = Constraint(expr= - m.b16 - m.b17 - m.b24 - m.b25 + m.b32 <= 0)
m.c3308 = Constraint(expr= - m.b16 - m.b26 + m.b33 <= 0)
m.c3309 = Constraint(expr= - m.b16 - m.b27 - m.b28 + m.b34 <= 0)
m.c3310 = Constraint(expr= - m.b17 - m.b26 + m.b35 <= 0)
m.c3311 = Constraint(expr= - m.b17 - m.b27 - m.b28 + m.b36 <= 0)
m.c3312 = Constraint(expr= - m.b17 - m.b29 + m.b37 <= 0)
m.c3313 = Constraint(expr= - m.b18 - m.b27 - m.b28 + m.b38 <= 0)
m.c3314 = Constraint(expr= - m.b18 - m.b29 + m.b39 <= 0)
m.c3315 = Constraint(expr= - m.b19 - m.b21 - m.b27 + m.b40 <= 0)
m.c3316 = Constraint(expr= - m.b20 - m.b22 - m.b24 - m.b26 - m.b28 + m.b41 <= 0)
m.c3317 = Constraint(expr= - m.b20 - m.b22 - m.b24 - m.b27 - m.b29 + m.b42 <= 0)
m.c3318 = Constraint(expr= - m.b23 - m.b25 - m.b28 + m.b43 <= 0)
m.c3319 = Constraint(expr= - m.b31 - m.b32 - m.b33 - m.b34 + m.b44 <= 0)
m.c3320 = Constraint(expr= - m.b30 - m.b32 - m.b35 - m.b36 - m.b37 + m.b45 <= 0)
m.c3321 = Constraint(expr= - m.b30 - m.b31 - m.b38 - m.b39 + m.b46 <= 0)
m.c3322 = Constraint(expr= - m.b30 - m.b40 + m.b47 <= 0)
m.c3323 = Constraint(expr= - m.b30 - m.b41 - m.b42 + m.b48 <= 0)
m.c3324 = Constraint(expr= - m.b31 - m.b40 + m.b49 <= 0)
m.c3325 = Constraint(expr= - m.b31 - m.b41 - m.b42 + m.b50 <= 0)
m.c3326 = Constraint(expr= - m.b31 - m.b43 + m.b51 <= 0)
m.c3327 = Constraint(expr= - m.b32 - m.b41 - m.b42 + m.b52 <= 0)
m.c3328 = Constraint(expr= - m.b32 - m.b43 + m.b53 <= 0)
m.c3329 = Constraint(expr= - m.b33 - m.b35 - m.b41 + m.b54 <= 0)
m.c3330 = Constraint(expr= - m.b34 - m.b36 - m.b38 - m.b40 - m.b42 + m.b55 <= 0)
m.c3331 = Constraint(expr= - m.b34 - m.b36 - m.b38 - m.b41 - m.b43 + m.b56 <= 0)
m.c3332 = Constraint(expr= - m.b37 - m.b39 - m.b42 + m.b57 <= 0)
m.c3333 = Constraint(expr= - m.b45 - m.b46 - m.b47 - m.b48 + m.b58 <= 0)
m.c3334 = Constraint(expr= - m.b44 - m.b46 - m.b49 - m.b50 - m.b51 + m.b59 <= 0)
m.c3335 = Constraint(expr= - m.b44 - m.b45 - m.b52 - m.b53 + m.b60 <= 0)
m.c3336 = Constraint(expr= - m.b44 - m.b54 + m.b61 <= 0)
m.c3337 = Constraint(expr= - m.b44 - m.b55 - m.b56 + m.b62 <= 0)
m.c3338 = Constraint(expr= - m.b45 - m.b54 + m.b63 <= 0)
m.c3339 = Constraint(expr= - m.b45 - m.b55 - m.b56 + m.b64 <= 0)
m.c3340 = Constraint(expr= - m.b45 - m.b57 + m.b65 <= 0)
m.c3341 = Constraint(expr= - m.b46 - m.b55 - m.b56 + m.b66 <= 0)
m.c3342 = Constraint(expr= - m.b46 - m.b57 + m.b67 <= 0)
m.c3343 = Constraint(expr= - m.b47 - m.b49 - m.b55 + m.b68 <= 0)
m.c3344 = Constraint(expr= - m.b48 - m.b50 - m.b52 - m.b54 - m.b56 + m.b69 <= 0)
m.c3345 = Constraint(expr= - m.b48 - m.b50 - m.b52 - m.b55 - m.b57 + m.b70 <= 0)
m.c3346 = Constraint(expr= - m.b51 - m.b53 - m.b56 + m.b71 <= 0)
m.c3347 = Constraint(expr= - m.b59 - m.b60 - m.b61 - m.b62 + m.b72 <= 0)
m.c3348 = Constraint(expr= - m.b58 - m.b60 - m.b63 - m.b64 - m.b65 + m.b73 <= 0)
m.c3349 = Constraint(expr= - m.b58 - m.b59 - m.b66 - m.b67 + m.b74 <= 0)
m.c3350 = Constraint(expr= - m.b58 - m.b68 + m.b75 <= 0)
m.c3351 = Constraint(expr= - m.b58 - m.b69 - m.b70 + m.b76 <= 0)
m.c3352 = Constraint(expr= - m.b59 - m.b68 + m.b77 <= 0)
m.c3353 = Constraint(expr= - m.b59 - m.b69 - m.b70 + m.b78 <= 0)
m.c3354 = Constraint(expr= - m.b59 - m.b71 + m.b79 <= 0)
m.c3355 = Constraint(expr= - m.b60 - m.b69 - m.b70 + m.b80 <= 0)
m.c3356 = Constraint(expr= - m.b60 - m.b71 + m.b81 <= 0)
m.c3357 = Constraint(expr= - m.b61 - m.b63 - m.b69 + m.b82 <= 0)
m.c3358 = Constraint(expr= - m.b62 - m.b64 - m.b66 - m.b68 - m.b70 + m.b83 <= 0)
m.c3359 = Constraint(expr= - m.b62 - m.b64 - m.b66 - m.b69 - m.b71 + m.b84 <= 0)
m.c3360 = Constraint(expr= - m.b65 - m.b67 - m.b70 + m.b85 <= 0)
| 42.421523 | 120 | 0.616743 | [
"MIT"
] | grossmann-group/pyomo-MINLP-benchmarking | models_nonconvex_simple2/crudeoil_lee3_06.py | 374,879 | Python |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test mempool limiting together/eviction with the wallet
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class MempoolLimitTest(BitcoinTestFramework):
def __init__(self):
self.txouts = gen_return_txouts()
def setup_network(self):
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, ["-maxmempool=5", "-spendzeroconfchange=0", "-debug"]))
self.is_network_split = False
self.sync_all()
self.relayfee = self.nodes[0].getnetworkinfo()['relayfee']
def setup_chain(self):
print("Initializing test directory "+self.options.tmpdir)
initialize_chain_clean(self.options.tmpdir, 2)
def run_test(self):
txids = []
utxos = create_confirmed_utxos(self.relayfee, self.nodes[0], 90)
#create a mempool tx that will be evicted
us0 = utxos.pop()
inputs = [{ "txid" : us0["txid"], "vout" : us0["vout"]}]
outputs = {self.nodes[0].getnewaddress() : 0.0001}
tx = self.nodes[0].createrawtransaction(inputs, outputs)
self.nodes[0].settxfee(self.relayfee) # specifically fund this tx with low fee
txF = self.nodes[0].fundrawtransaction(tx)
self.nodes[0].settxfee(0) # return to automatic fee selection
txFS = self.nodes[0].signrawtransaction(txF['hex'])
txid = self.nodes[0].sendrawtransaction(txFS['hex'])
self.nodes[0].lockunspent(True, [us0])
relayfee = self.nodes[0].getnetworkinfo()['relayfee']
base_fee = relayfee*100
for i in xrange (4):
txids.append([])
txids[i] = create_lots_of_big_transactions(self.nodes[0], self.txouts, utxos[30*i:30*i+30], (i+1)*base_fee)
# by now, the tx should be evicted, check confirmation state
assert(txid not in self.nodes[0].getrawmempool())
txdata = self.nodes[0].gettransaction(txid)
assert(txdata['confirmations'] == 0) #confirmation should still be 0
if __name__ == '__main__':
MempoolLimitTest().main()
| 40.75 | 119 | 0.666521 | [
"MIT"
] | 3s3s/bitcoin-v-12.1 | qa/rpc-tests/mempool_limit.py | 2,282 | Python |
import json
import time, asyncio
from smsgateway import sink_sms
from smsgateway.config import *
from smsgateway.sources.utils import *
from slackclient import SlackClient
def init():
global IDENTIFIER, app_log
IDENTIFIER = "SL"
app_log = setup_logging("slack")
def main():
init()
sc = SlackClient(SL_TOKEN)
data = sc.api_call("users.list")
users = {}
app_log.info("Getting users..")
if not data['ok']:
app_log.error("Could not get user information!")
app_log.error(f"Token: {SL_TOKEN}")
app_log.error(data)
return
for u in data['members']:
uID = u['id']
uName = None
if 'real_name' in u:
uName = u['real_name']
else:
if 'profile' in u:
p = u['profile']
if 'real_name' in p:
uName = p['real_name']
if not uName:
app_log.warning(f'Could not get real_name of {uID}:')
app_log.warning(json.dumps(u, indent=2))
continue
app_log.debug(f"{uID}: {uName}")
users[uID] = uName
app_log.info(f"Got {len(users)} users")
app_log.info("Getting channels..")
data = sc.api_call("channels.list")
channels = {}
if not data['ok']:
app_log.error("Could not get channel information!")
app_log.error(f"Token: {SL_TOKEN}")
app_log.error(data)
return
for u in data['channels']:
uID = u['id']
uName = u['name']
app_log.debug(f"{uID}: {uName}")
channels[uID] = uName
app_log.info(f"Got {len(channels)} channels")
if not sc.rtm_connect(auto_reconnect=True):
app_log.error("Could not connect to Slack!")
return False
while True:
data = sc.rtm_read()
if data:
for entry in data:
app_log.debug(entry)
type = entry['type']
if type == 'message':
text = None
if 'message' in entry:
msg = entry['message']
isInChannel = True
app_log.info("Got a message in a channel!")
elif 'text' in entry:
msg = entry
isInChannel = False
app_log.info("Got a message from a user/bot!")
else:
app_log.warning("Could not parse this:\n" + entry)
continue
if not msg['text']:
print("Has no message!")
continue
else:
text = msg['text']
user = users[msg['user']]
chat_info = {
'date': str(int(float(msg['ts']))),
'from': user
}
if 'client_msg_id' in msg:
chat_info['ID'] = msg['client_msg_id']
if isInChannel:
channel = channels[entry['channel']]
chat_info.update({
'type': 'Group',
'to': channel,
})
sink_sms.send_dict(IDENTIFIER, text, chat_info)
time.sleep(1)
if __name__ == '__main__':
main()
# loop = asyncio.get_event_loop()
# loop.run_until_complete(main())
| 31.553571 | 74 | 0.465761 | [
"MIT"
] | Craeckie/SMSGateway | smsgateway/sources/slack.py | 3,534 | Python |
#!/usr/bin/env python
#
# pyLearn documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import pyLearn
# -- General configuration ---------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'pyLearn'
copyright = "2020, Sravan Kumar Rekandar"
author = "Sravan Kumar Rekandar"
# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
# the built documents.
#
# The short X.Y version.
version = pyLearn.__version__
# The full version, including alpha/beta/rc tags.
release = pyLearn.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output -------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# Theme options are theme-specific and customize the look and feel of a
# theme further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Options for HTMLHelp output ---------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'pyLearndoc'
# -- Options for LaTeX output ------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pyLearn.tex',
'pyLearn Documentation',
'Sravan Kumar Rekandar', 'manual'),
]
# -- Options for manual page output ------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pyLearn',
'pyLearn Documentation',
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pyLearn',
'pyLearn Documentation',
author,
'pyLearn',
'One line description of project.',
'Miscellaneous'),
]
| 29.478528 | 77 | 0.68512 | [
"MIT"
] | sravanrekandar/pyLearn | docs/conf.py | 4,805 | Python |
def remove_middle(a, b, c):
cross = (a[0] - b[0]) * (c[1] - b[1]) - (a[1] - b[1]) * (c[0] - b[0])
dot = (a[0] - b[0]) * (c[0] - b[0]) + (a[1] - b[1]) * (c[1] - b[1])
return cross < 0 or cross == 0 and dot <= 0
def convex_hull(points):
spoints = sorted(points)
hull = []
for p in spoints + spoints[::-1]:
while len(hull) >= 2 and remove_middle(hull[-2], hull[-1], p):
hull.pop()
hull.append(p)
hull.pop()
return hull
| 29.875 | 73 | 0.470711 | [
"Apache-2.0"
] | 3xp10it3r/PyRival | pyrival/geometry/convex_hull.py | 478 | Python |
"""
Base settings for Mad Taxi project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (mad_taxi/config/settings/base.py - 3 = mad_taxi/)
APPS_DIR = ROOT_DIR.path('mad_taxi')
# Load operating system environment variables and then prepare to use them
env = environ.Env()
# .env file, should load only in development environment
READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', default=False)
if READ_DOT_ENV_FILE:
# Operating System Environment variables have precedence over variables defined in the .env file,
# that is to say variables from the .env files will only be used if not defined
# as environment variables.
env_file = str(ROOT_DIR.path('.env'))
print('Loading : {}'.format(env_file))
env.read_env(env_file)
print('The .env file has been loaded. See base.py for more information')
# APP CONFIGURATION
# ------------------------------------------------------------------------------
DJANGO_APPS = [
# Default Django apps:
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Useful template tags:
# 'django.contrib.humanize',
# Admin
'django.contrib.admin',
]
THIRD_PARTY_APPS = [
'crispy_forms', # Form layouts
'allauth', # registration
'allauth.account', # registration
'allauth.socialaccount', # registration
]
# Apps specific for this project go here.
LOCAL_APPS = [
# custom users app
'mad_taxi.users.apps.UsersConfig',
# Your stuff: custom apps go here
]
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
# MIDDLEWARE CONFIGURATION
# ------------------------------------------------------------------------------
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
# MIGRATIONS CONFIGURATION
# ------------------------------------------------------------------------------
MIGRATION_MODULES = {
'sites': 'mad_taxi.contrib.sites.migrations'
}
# DEBUG
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = env.bool('DJANGO_DEBUG', False)
# FIXTURE CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS
FIXTURE_DIRS = (
str(APPS_DIR.path('fixtures')),
)
# EMAIL CONFIGURATION
# ------------------------------------------------------------------------------
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.smtp.EmailBackend')
# MANAGER CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
ADMINS = [
("""Starcraft""", '[email protected]'),
]
# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
MANAGERS = ADMINS
# DATABASE CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
# Uses django-environ to accept uri format
# See: https://django-environ.readthedocs.io/en/latest/#supported-types
DATABASES = {
'default': env.db('DATABASE_URL', default='postgres:///mad_taxi'),
}
DATABASES['default']['ATOMIC_REQUESTS'] = True
# GENERAL CONFIGURATION
# ------------------------------------------------------------------------------
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'UTC'
# See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code
LANGUAGE_CODE = 'en-us'
# See: https://docs.djangoproject.com/en/dev/ref/settings/#site-id
SITE_ID = 1
# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
USE_I18N = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-l10n
USE_L10N = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
USE_TZ = True
# TEMPLATE CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#templates
TEMPLATES = [
{
# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATES-BACKEND
'BACKEND': 'django.template.backends.django.DjangoTemplates',
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
'DIRS': [
str(APPS_DIR.path('templates')),
],
'OPTIONS': {
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
'debug': DEBUG,
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
# https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
],
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
# Your stuff: custom template context processors go here
],
},
},
]
# See: http://django-crispy-forms.readthedocs.io/en/latest/install.html#template-packs
CRISPY_TEMPLATE_PACK = 'bootstrap4'
# STATIC FILE CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
STATIC_ROOT = str(ROOT_DIR('staticfiles'))
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
STATIC_URL = '/static/'
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
STATICFILES_DIRS = [
str(APPS_DIR.path('static')),
]
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]
# MEDIA CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-root
MEDIA_ROOT = str(APPS_DIR('media'))
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-url
MEDIA_URL = '/media/'
# URL Configuration
# ------------------------------------------------------------------------------
ROOT_URLCONF = 'config.urls'
# See: https://docs.djangoproject.com/en/dev/ref/settings/#wsgi-application
WSGI_APPLICATION = 'config.wsgi.application'
# PASSWORD STORAGE SETTINGS
# ------------------------------------------------------------------------------
# See https://docs.djangoproject.com/en/dev/topics/auth/passwords/#using-argon2-with-django
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.Argon2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
]
# PASSWORD VALIDATION
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators
# ------------------------------------------------------------------------------
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# AUTHENTICATION CONFIGURATION
# ------------------------------------------------------------------------------
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
]
# Some really nice defaults
ACCOUNT_AUTHENTICATION_METHOD = 'username'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
ACCOUNT_ALLOW_REGISTRATION = env.bool('DJANGO_ACCOUNT_ALLOW_REGISTRATION', True)
ACCOUNT_ADAPTER = 'mad_taxi.users.adapters.AccountAdapter'
SOCIALACCOUNT_ADAPTER = 'mad_taxi.users.adapters.SocialAccountAdapter'
# Custom user app defaults
# Select the correct user model
AUTH_USER_MODEL = 'users.User'
LOGIN_REDIRECT_URL = 'users:redirect'
LOGIN_URL = 'account_login'
# SLUGLIFIER
AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
########## CELERY
INSTALLED_APPS += ['mad_taxi.taskapp.celery.CeleryConfig']
CELERY_BROKER_URL = env('CELERY_BROKER_URL', default='django://')
if CELERY_BROKER_URL == 'django://':
CELERY_RESULT_BACKEND = 'redis://'
else:
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
# default to json serialization only
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
########## END CELERY
# Location of root django.contrib.admin URL, use {% url 'admin:index' %}
ADMIN_URL = r'^admin/'
# Your common stuff: Below this line define 3rd party library settings
# ------------------------------------------------------------------------------
| 36.709343 | 101 | 0.630691 | [
"MIT"
] | Disruption/MadTaxiBackend | config/settings/base.py | 10,609 | Python |
'''cleanup intermediary files '''
import os
def run(c): # run something at terminal and wait to finish
print(c)
a = os.system(c)
run('rm *.png') # remove figures
run('rm test* truth*') # wipe test and truth data
run('rm -rf test truth') # wipe test and truth data segment files
| 26.454545 | 66 | 0.670103 | [
"Apache-2.0"
] | ashlinrichardson/bcgov-python-presentations | presentations/20210526_simple_character_recognition/cleanup.py | 291 | Python |
#
# Copyright 2021 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Version of ibm-appconfiguration-python-sdk
"""
__version__ = '0.1.2'
| 34.947368 | 74 | 0.753012 | [
"Apache-2.0"
] | hardik-dadhich/appconfiguration-python-sdk | ibm_appconfiguration/version.py | 664 | Python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from rest_framework.test import APIRequestFactory
from elasticsearch_dsl import Q
from rest_framework_elasticsearch.es_filters import (
ESFieldFilter, ElasticOrderingFilter, ElasticFieldsFilter,
ElasticFieldsRangeFilter, ElasticSearchFilter)
from rest_framework_elasticsearch.es_views import ElasticAPIView
from .test_data import DataDocType, DATA
from .utils import get_search_ids
rf = APIRequestFactory()
@pytest.mark.parametrize('dataset, expected', [
(
('label', 'name', 'description'),
('label', 'name', 'description')
),
(
('label', None, 'description'),
('label', 'label', 'description')
),
(
('label', None, None),
('label', 'label', None)
)
])
def test_es_field_filters(dataset, expected):
ffilter = ESFieldFilter(dataset[0],
name=dataset[1],
description=dataset[2])
assert expected == (ffilter.label, ffilter.name, ffilter.description)
class TestElasticOrderingFilter:
def setup_method(self):
self.backend = ElasticOrderingFilter()
def create_view(self, es_ordering_fields):
"""Create and return test view class instance
Args:
es_ordering_fields (tuple): ordering fields
Returns:
ElasticAPIView: test view instance
"""
view = ElasticAPIView()
view.es_ordering_fields = es_ordering_fields
return view
@pytest.mark.parametrize('es_ordering_fields, expected', [
(
("first_name", ("is_active", "active")),
("first_name", ("is_active", "active")),
),
(
"first_name",
("first_name",)
)
])
def test_get_es_ordering_fields(self, es_ordering_fields, expected):
view = self.create_view(es_ordering_fields)
result = self.backend.get_es_ordering_fields(view)
assert expected == result
@pytest.mark.parametrize('es_ordering_fields, expected', [
(
("is_active", "active"),
("is_active", "active")
),
(
"first_name",
("first_name", "first_name")
)
])
def test_validation(self, es_ordering_fields, expected):
result = ElasticOrderingFilter.validation(es_ordering_fields)
assert expected == result
def test_get_valid_fields_with_es_ordering_fields(self):
es_ordering_fields = (
"first_name",
"last_name",
("is_active", "active")
)
view = self.create_view(es_ordering_fields)
expected = [
("first_name", "first_name"),
("last_name", "last_name"),
("is_active", "active")
]
result = self.backend.get_valid_fields([], view)
assert result == expected
def test_get_valid_fields_without_es_ordering_fields(self):
view = self.create_view(None)
valid_fields = []
self.backend.get_default_valid_fields = lambda q, v: valid_fields
result = self.backend.get_valid_fields([], view)
assert result == valid_fields
@pytest.mark.parametrize('fields, expected', [
(
['first_name', 'last_name', '-active'],
['first_name', '-is_active']
),
(
['+first_name', 'last_name', '#active'],
['+first_name']
),
(
['+first_name', '-active'],
['+first_name', '-is_active']
)
])
def test_remove_invalid_fields(self, fields, expected):
es_ordering_fields = (
"first_name",
("is_active", "active")
)
view = self.create_view(es_ordering_fields)
request = rf.get('/test/')
result = self.backend.remove_invalid_fields([], fields, view, request)
assert result == expected
def test_filter_search(self, search):
def get_expected():
"""Return expected data items sorted by id"""
items = [
(
item['_id'],
item['_source']['first_name'],
item['_source']['is_active']
)
for item in DATA
]
items = sorted(items, key=lambda tup: (tup[1], not tup[2]))
return items
es_ordering_fields = (
("first_name", "first_name"),
("is_active", "-active")
)
view = self.create_view(es_ordering_fields)
request = rf.get('/test/')
request.query_params = {'ordering': 'first_name,active'}
search = self.backend.filter_search(request, search, view)
result = [
(item.meta.id, item.first_name, item.is_active)
for item in search[:len(DATA)].execute()
]
assert result == get_expected()
class TestElasticFieldsFilter:
def setup_method(self):
self.backend = ElasticFieldsFilter()
def create_view(self, es_filter_fields):
"""Create and return test view class instance
Args:
es_filter_fields ([ESFieldFilter]): filtering fields
Returns:
ElasticAPIView: test view instance
"""
view = ElasticAPIView()
view.es_model = DataDocType
view.es_filter_fields = es_filter_fields
return view
def test_get_es_filter_fields(self):
es_filter_fields = (
ESFieldFilter('skills'),
ESFieldFilter('active', 'is_active')
)
view = self.create_view(es_filter_fields)
result = self.backend.get_es_filter_fields(view)
assert result == es_filter_fields
@pytest.mark.parametrize('es_filter_fields, query_params, expected', [
(
[ESFieldFilter('active', 'is_active')],
{'active': 'False'},
[3, 6, 8, 10]
),
(
[
ESFieldFilter('birthday')
],
{'birthday': '1985-03-17T12:20:09'},
[1]
),
(
[ESFieldFilter('skills')],
{'skills': 'python'},
[1, 4, 5, 10]
),
(
[ESFieldFilter('skills')],
{'skills': 'python,ruby'},
[1, 4, 5, 6, 10]
),
(
[ESFieldFilter('active', 'is_active')],
{'active': 'False', 'skills': 'python'},
[3, 6, 8, 10]
),
(
[ESFieldFilter('active', 'is_active')],
{'active': 'False', 'skills': 'python'},
[3, 6, 8, 10]
),
(
[ESFieldFilter('score')],
{'score': '200'},
[2, 13]
),
])
def test_filter_search(self, search, es_filter_fields,
query_params, expected):
view = self.create_view(es_filter_fields)
request = rf.get('/test/')
request.query_params = query_params
search = self.backend.filter_search(request, search, view)
result = get_search_ids(search)
assert sorted(result) == sorted(expected)
class TestElasticFieldsRangeFilter:
def setup_method(self):
self.backend = ElasticFieldsRangeFilter()
def create_view(self, es_range_filter_fields):
"""Create and return test view class instance
Args:
es_range_filter_fields ([ESFieldFilter]): filtering range fields
Returns:
ElasticAPIView: test view instance
"""
view = ElasticAPIView()
view.es_model = DataDocType
view.es_range_filter_fields = es_range_filter_fields
return view
def test_get_es_filter_fields(self):
es_range_filter_fields = (
ESFieldFilter('skills'),
ESFieldFilter('active', 'is_active')
)
view = self.create_view(es_range_filter_fields)
result = self.backend.get_es_range_filter_fields(view)
assert result == es_range_filter_fields
@pytest.mark.parametrize('es_filter_fields, query_params, expected', [
(
[ESFieldFilter('score')],
{'from_score': '500'},
[6, 7, 8, 10, 11]
),
(
[ESFieldFilter('score')],
{'to_score': '100'},
[1, 3, 5, 9, 12, 14]
),
(
[ESFieldFilter('score')],
{'from_score': '500', 'to_score': '600'},
[7, 8, 10]
),
(
[ESFieldFilter('score')], {}, [int(item['_id']) for item in DATA]
),
])
def test_filter_search(self, search, es_filter_fields,
query_params, expected):
view = self.create_view(es_filter_fields)
request = rf.get('/test/')
request.query_params = query_params
search = self.backend.filter_search(request, search, view)
result = get_search_ids(search)
assert sorted(result) == sorted(expected)
class TestElasticSearchFilter:
def setup_method(self):
self.backend = ElasticSearchFilter()
def create_view(self, es_search_fields):
"""Create and return test view class instance
Args:
es_search_fields ([ESFieldFilter]): search fields
Returns:
ElasticAPIView: test view instance
"""
view = ElasticAPIView()
view.es_model = DataDocType
view.es_search_fields = es_search_fields
return view
@pytest.mark.parametrize('search_param, query_params, expected', [
(
None, {'search': 'test'}, 'test'
),
(
'search', {'search': 'test'}, 'test'
),
(
'q', {'q': 'test'}, 'test'
),
(
'search', {'q': 'test'}, ''
),
])
def test_get_search_query(self, search_param, query_params, expected):
request = rf.get('/test/')
request.query_params = query_params
if search_param:
self.backend.search_param = search_param
result = self.backend.get_search_query(request)
assert result == expected
def test_get_es_query(self):
class TestElasticSearchFilter(ElasticSearchFilter):
def get_es_query(self, s_query, s_fields, **kwargs):
return Q("match", query=s_query, field=s_fields)
s_query = "test"
s_fields = "first_name"
backend = TestElasticSearchFilter()
result = backend.get_es_query(s_query, s_fields)
expected = Q("match", query=s_query, field=s_fields)
assert result == expected
@pytest.mark.parametrize('es_search_fields, query_params, expected', [
(
('first_name',),
{'search': 'Zofia'},
[1]
),
(
('first_name', 'last_name', 'city'),
{'search': 'Zofia'},
[1]
),
(
('first_name', 'last_name', 'city'),
{'search': 'Zofia Rome'},
[4, 7]
),
(
('description'),
{'search': 'information'},
[2]
),
(
('description'),
{'search': 'Ford Prefect'},
[2, 8, 10, 5, 6, 12]
),
(
('description'),
{'search': 'Earth'},
[5, 3, 14]
),
(
('description'),
{'search': 'The Hitchhiker’s Guide'},
[8]
),
])
def test_filter_search(self, search, es_search_fields,
query_params, expected):
view = self.create_view(es_search_fields)
request = rf.get('/test/')
request.query_params = query_params
search = self.backend.filter_search(request, search, view)
result = get_search_ids(search)
assert result == expected
| 30.222785 | 78 | 0.544731 | [
"Apache-2.0"
] | ArtemBernatskyy/django-rest-elasticsearch | tests/test_filters.py | 11,940 | Python |
from __future__ import absolute_import
from datetime import datetime
from enum import Enum
from checkout_sdk.common.common import Address, Phone, CustomerRequest
from checkout_sdk.common.enums import Currency, PaymentSourceType, ChallengeIndicator, Country
class Exemption(str, Enum):
LOW_VALUE = 'low_value'
SECURE_CORPORATE_PAYMENT = 'secure_corporate_payment'
TRUSTED_LISTING = 'trusted_listing'
TRANSACTION_RISK_ASSESSMENT = 'transaction_risk_assessment'
class PaymentDestinationType(str, Enum):
BANK_ACCOUNT = 'bank_account'
CARD = 'card'
ID = 'id'
TOKEN = 'token'
class PaymentType(str, Enum):
REGULAR = 'Regular'
RECURRING = 'Recurring'
MOTO = 'MOTO'
INSTALLMENT = 'Installment'
class Purpose(str, Enum):
DONATIONS = 'donations'
EDUCATION = 'education'
EMERGENCY_NEED = 'emergency_need'
EXPATRIATION = 'expatriation'
FAMILY_SUPPORT = 'family_support'
GIFTS = 'gifts'
INCOME = 'income'
INSURANCE = 'insurance'
INVESTMENT = 'investment'
IT_SERVICES = 'it_services'
LEISURE = 'leisure'
LOAN_PAYMENT = 'loan_payment'
OTHER = 'other'
PENSION = 'pension'
ROYALTIES = 'royalties'
SAVINGS = 'savings'
TRAVEL_AND_TOURISM = 'travel_and_tourism'
FINANCIAL_SERVICES = 'financial_services'
MEDICAL_TREATMENT = 'medical_treatment'
class FundTransferType(str, Enum):
AA = 'AA'
PP = 'PP'
FT = 'FT'
FD = 'FD'
PD = 'PD'
LO = 'LO'
OG = 'OG'
class BillingDescriptor:
name: str
city: str
class BillingInformation:
address: Address
phone: Phone
class PaymentRecipient:
dob: str
account_number: str
zip: str
first_name: str
last_name: str
country: Country
class ShippingDetails:
address: Address
phone: Phone
class RiskRequest:
enabled: bool
class ThreeDsRequest:
enabled: bool
attempt_n3d: bool
eci: str
cryptogram: str
xid: str
version: str
exemption: Exemption
challenge_indicator: ChallengeIndicator
class ProcessingSettings:
aft: bool
tax_amount: int
shipping_amount: int
# Request Source
class RequestSource:
type: PaymentSourceType
def __init__(self, type_p: PaymentSourceType):
self.type = type_p
class RequestCardSource(RequestSource):
number: str
expiry_month: int
expiry_year: int
name: str
cvv: str
stored: bool
billing_address: Address
phone: Phone
def __init__(self):
super().__init__(PaymentSourceType.CARD)
class RequestCustomerSource(RequestSource):
id: str
def __init__(self):
super().__init__(PaymentSourceType.ID)
class RequestDLocalSource(RequestSource):
number: str
expiry_month: int
expiry_year: int
name: str
cvv: str
stored: bool
billing_address: Address
phone: Phone
def __init__(self):
super().__init__(PaymentSourceType.D_LOCAL)
class RequestIdSource(RequestSource):
id: str
cvv: str
def __init__(self):
super().__init__(PaymentSourceType.ID)
class RequestNetworkTokenSource(RequestSource):
token: str
expiry_month: int
expiry_year: int
token_type: str
cryptogram: str
eci: str
stored: bool
name: str
cvv: str
billing_address: Address
phone: Phone
def __init__(self):
super().__init__(PaymentSourceType.NETWORK_TOKEN)
class RequestTokenSource(RequestSource):
token: str
billing_address: Address
phone: Phone
def __init__(self):
super().__init__(PaymentSourceType.TOKEN)
# Request Destination
class RequestDestination:
type: PaymentDestinationType
first_name: str
last_name: str
def __init__(self, type_p: PaymentDestinationType):
self.type = type_p
class PaymentRequestCardDestination(RequestDestination):
number: str
expiry_month: int
expiry_year: int
name: str
billing_address: Address
phone: Phone
def __init__(self):
super().__init__(PaymentDestinationType.CARD)
class PaymentRequestIdDestination(RequestDestination):
id: str
def __init__(self):
super().__init__(PaymentDestinationType.ID)
class PaymentRequestTokenDestination(RequestDestination):
token: str
billing_address: Address
phone: Phone
def __init__(self):
super().__init__(PaymentDestinationType.TOKEN)
# Request
class PaymentRequest:
source: RequestSource
amount: int
currency: Currency
payment_type: PaymentType
merchant_initiated: bool
reference: str
description: str
capture: bool
capture_on: datetime
customer: CustomerRequest
billing_descriptor: BillingDescriptor
shipping: ShippingDetails
previous_payment_id: str
risk: RiskRequest
success_url: str
failure_url: str
payment_ip: str
three_ds: ThreeDsRequest
recipient: PaymentRecipient
metadata: dict
processing: ProcessingSettings
class PayoutRequest:
destination: RequestDestination
amount: int
fund_transfer_type: FundTransferType
currency: Currency
payment_type: PaymentType
reference: str
description: str
capture: bool
capture_on: datetime
customer: CustomerRequest
billing_descriptor: BillingDescriptor
shipping: ShippingDetails
three_ds: ThreeDsRequest
previous_payment_id: str
risk: RiskRequest
success_url: str
failure_url: str
payment_ip: str
recipient: PaymentRecipient
metadata: dict
processing: dict
# Captures
class CaptureRequest:
amount: int
reference: str
metadata: dict
# Refunds
class RefundRequest:
amount: int
reference: str
metadata: dict
# Voids
class VoidRequest:
reference: str
metadata: dict
| 19.962069 | 94 | 0.69943 | [
"MIT"
] | riaz-bordie-cko/checkout-sdk-python | checkout_sdk/payments/payments.py | 5,789 | Python |
# example of except/from exception usage
try:
1 / 0
except Exception as E:
raise NameError('bad') from E
"""
Traceback (most recent call last):
File "except_from.py", line 4, in <module>
1 / 0
ZeroDivisionError: division by zero
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "except_from.py", line 6, in <module>
raise NameError('bad') from E
NameError: bad
"""
# *implicit related exception
# try:
# 1 / 0
# except:
# wrongname # NameError
# raise <exceptionnsme> from None complitly stops relation of exception
| 21.034483 | 71 | 0.701639 | [
"MIT"
] | KonstantinKlepikov/all-python-ml-learning | python_learning/except_from.py | 610 | Python |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import math
import os
import paddle.v2 as paddle
import pickle
embsize = 32
hiddensize = 256
N = 5
cluster_train_file = "./train_data_dir/train/train.txt"
cluster_test_file = "./test_data_dir/test/test.txt"
node_id = os.getenv("OMPI_COMM_WORLD_RANK")
if not node_id:
raise EnvironmentError("must provied OMPI_COMM_WORLD_RANK")
def wordemb(inlayer):
wordemb = paddle.layer.embedding(
input=inlayer,
size=embsize,
param_attr=paddle.attr.Param(
name="_proj",
initial_std=0.001,
learning_rate=1,
l2_rate=0,
sparse_update=True))
return wordemb
def cluster_reader_cluster(filename, node_id):
def cluster_reader():
with open("-".join([filename, "%05d" % int(node_id)]), "r") as f:
for l in f:
csv_data = [int(cell) for cell in l.split(",")]
yield tuple(csv_data)
return cluster_reader
def main():
# get arguments from env
# for local training
TRUTH = ["true", "True", "TRUE", "1", "yes", "Yes", "YES"]
cluster_train = os.getenv('PADDLE_CLUSTER_TRAIN', "False") in TRUTH
use_gpu = os.getenv('PADDLE_INIT_USE_GPU', "False")
if not cluster_train:
paddle.init(
use_gpu=use_gpu,
trainer_count=int(os.getenv("PADDLE_INIT_TRAINER_COUNT", "1")))
else:
paddle.init(
use_gpu=use_gpu,
trainer_count=int(os.getenv("PADDLE_INIT_TRAINER_COUNT", "1")),
port=int(os.getenv("PADDLE_INIT_PORT", "7164")),
ports_num=int(os.getenv("PADDLE_INIT_PORTS_NUM", "1")),
ports_num_for_sparse=int(
os.getenv("PADDLE_INIT_PORTS_NUM_FOR_SPARSE", "1")),
num_gradient_servers=int(
os.getenv("PADDLE_INIT_NUM_GRADIENT_SERVERS", "1")),
trainer_id=int(os.getenv("PADDLE_INIT_TRAINER_ID", "0")),
pservers=os.getenv("PADDLE_INIT_PSERVERS", "127.0.0.1"))
fn = open("thirdparty/wuyi_train_thdpty/word_dict.pickle", "r")
word_dict = pickle.load(fn)
fn.close()
dict_size = len(word_dict)
firstword = paddle.layer.data(
name="firstw", type=paddle.data_type.integer_value(dict_size))
secondword = paddle.layer.data(
name="secondw", type=paddle.data_type.integer_value(dict_size))
thirdword = paddle.layer.data(
name="thirdw", type=paddle.data_type.integer_value(dict_size))
fourthword = paddle.layer.data(
name="fourthw", type=paddle.data_type.integer_value(dict_size))
nextword = paddle.layer.data(
name="fifthw", type=paddle.data_type.integer_value(dict_size))
Efirst = wordemb(firstword)
Esecond = wordemb(secondword)
Ethird = wordemb(thirdword)
Efourth = wordemb(fourthword)
contextemb = paddle.layer.concat(input=[Efirst, Esecond, Ethird, Efourth])
hidden1 = paddle.layer.fc(input=contextemb,
size=hiddensize,
act=paddle.activation.Sigmoid(),
layer_attr=paddle.attr.Extra(drop_rate=0.5),
bias_attr=paddle.attr.Param(learning_rate=2),
param_attr=paddle.attr.Param(
initial_std=1. / math.sqrt(embsize * 8),
learning_rate=1))
predictword = paddle.layer.fc(input=hidden1,
size=dict_size,
bias_attr=paddle.attr.Param(learning_rate=2),
act=paddle.activation.Softmax())
def event_handler(event):
if isinstance(event, paddle.event.EndIteration):
if event.batch_id % 100 == 0:
result = trainer.test(
paddle.batch(
cluster_reader_cluster(cluster_test_file, node_id), 32))
print "Pass %d, Batch %d, Cost %f, %s, Testing metrics %s" % (
event.pass_id, event.batch_id, event.cost, event.metrics,
result.metrics)
cost = paddle.layer.classification_cost(input=predictword, label=nextword)
parameters = paddle.parameters.create(cost)
adagrad = paddle.optimizer.AdaGrad(
learning_rate=3e-3,
regularization=paddle.optimizer.L2Regularization(8e-4))
trainer = paddle.trainer.SGD(cost,
parameters,
adagrad,
is_local=not cluster_train)
trainer.train(
paddle.batch(cluster_reader_cluster(cluster_train_file, node_id), 32),
num_passes=30,
event_handler=event_handler)
if __name__ == '__main__':
main()
| 38.695652 | 80 | 0.615169 | [
"Apache-2.0"
] | DarrenChanChenChi/Paddle | doc/v2/howto/cluster/src/word2vec/api_train_v2_cluster.py | 5,340 | Python |
import graphene
import datetime
import urllib
import json
from django.db import models
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.signing import TimestampSigner
from django.shortcuts import render
from .registry import registry
from .signals import preview_update
from .types.streamfield import StreamFieldType
# Classes used to define what the Django field should look like in the GQL type
class GraphQLField:
field_name: str
field_type: str
def __init__(self, field_name: str, field_type: type = None):
self.field_name = field_name
if callable(field_type):
self.field_type = field_type()
else:
self.field_type = field_type
if field_type:
self.field_type.source = field_name
def GraphQLString(field_name: str):
class Mixin(GraphQLField):
def __init__(self):
super().__init__(field_name, graphene.String)
return Mixin
def GraphQLFloat(field_name: str):
class Mixin(GraphQLField):
def __init__(self):
super().__init__(field_name, graphene.Float)
return Mixin
def GraphQLInt(field_name: str):
class Mixin(GraphQLField):
def __init__(self):
super().__init__(field_name, graphene.Int)
return Mixin
def GraphQLBoolean(field_name: str):
class Mixin(GraphQLField):
def __init__(self):
super().__init__(field_name, graphene.Boolean)
return Mixin
def GraphQLBool(field_name: str):
class Mixin(GraphQLField):
def __init__(self):
super().__init__(field_name, graphene.Boolean)
return Mixin
def GraphQLSnippet(field_name: str, snippet_model: str):
class Mixin(GraphQLField):
def __init__(self):
(app_label, model) = snippet_model.lower().split(".")
mdl = ContentType.objects.get(app_label=app_label, model=model)
if mdl:
self.field_type = registry.snippets[mdl.model_class()]
else:
self.field_type = graphene.String
self.field_name = field_name
return Mixin
def GraphQLStreamfield(field_name: str):
class Mixin(GraphQLField):
def __init__(self):
super().__init__(field_name, graphene.List(StreamFieldType))
return Mixin
def GraphQLForeignKey(field_name: str, content_type: str, is_list: bool = False):
class Mixin(GraphQLField):
def __init__(self):
app_label, model = content_type.lower().split(".")
mdl = ContentType.objects.get(app_label=app_label, model=model)
field_type = None
if mdl:
field_type = registry.models.get(mdl.model_class())
if field_type and is_list:
field_type = graphene.List(field_type)
super().__init__(field_name, field_type)
return Mixin
class PagePreview(models.Model):
token = models.CharField(max_length=255, unique=True)
content_type = models.ForeignKey(
"contenttypes.ContentType", on_delete=models.CASCADE
)
content_json = models.TextField()
created_at = models.DateField(auto_now_add=True)
def as_page(self):
content = json.loads(self.content_json)
page_model = ContentType.objects.get_for_id(
content["content_type"]
).model_class()
page = page_model.from_json(self.content_json)
page.pk = content["pk"]
return page
@classmethod
def garbage_collect(cls):
yesterday = datetime.datetime.now() - datetime.timedelta(hours=24)
cls.objects.filter(created_at__lt=yesterday).delete()
# Mixin for pages that want extra Grapple benefits:
class GrapplePageMixin:
@classmethod
def get_preview_signer(cls):
return TimestampSigner(salt="headlesspreview.token")
def create_page_preview(self):
if self.pk is None:
identifier = "parent_id=%d;page_type=%s" % (
self.get_parent().pk,
self._meta.label,
)
else:
identifier = "id=%d" % self.pk
return PagePreview.objects.create(
token=self.get_preview_signer().sign(identifier),
content_type=self.content_type,
content_json=self.to_json(),
)
def update_page_preview(self, token):
return PagePreview.objects.update_or_create(
token=token,
defaults={
"content_type": self.content_type,
"content_json": self.to_json(),
},
)
@classmethod
def get_preview_url(cls, token):
return f"{settings.GRAPPLE_PREVIEW_URL}?" + urllib.parse.urlencode(
{
"content_type": cls._meta.app_label + "." + cls.__name__.lower(),
"token": token,
}
)
def dummy_request(self, original_request=None, **meta):
request = super(GrapplePageMixin, self).dummy_request(
original_request=original_request, **meta
)
request.GET = request.GET.copy()
request.GET["realtime_preview"] = original_request.GET.get("realtime_preview")
return request
def serve_preview(self, request, mode_name):
token = request.COOKIES.get("used-token")
is_realtime = request.GET.get("realtime_preview")
if token and is_realtime:
page_preview, existed = self.update_page_preview(token)
PagePreview.garbage_collect()
preview_update.send(sender=GrapplePageMixin, token=token)
else:
page_preview = self.create_page_preview()
page_preview.save()
PagePreview.garbage_collect()
response = render(
request,
"grapple/preview.html",
{"preview_url": self.get_preview_url(page_preview.token)},
)
response.set_cookie(key="used-token", value=page_preview.token)
return response
@classmethod
def get_page_from_preview_token(cls, token):
content_type = ContentType.objects.get_for_model(cls)
# Check token is valid
cls.get_preview_signer().unsign(token)
try:
return PagePreview.objects.get(
content_type=content_type, token=token
).as_page()
except BaseException:
return
| 29.786047 | 86 | 0.638039 | [
"MIT"
] | zerolab/wagtail-grapple | grapple/models.py | 6,404 | Python |
"""
Lemur
=====
Is a TLS management and orchestration tool.
:copyright: (c) 2015 by Netflix, see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
from __future__ import absolute_import
import sys
import json
import os.path
import datetime
from distutils import log
from distutils.core import Command
from setuptools.command.develop import develop
from setuptools.command.install import install
from setuptools.command.sdist import sdist
from setuptools import setup, find_packages
from subprocess import check_output
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
# When executing the setup.py, we need to be able to import ourselves, this
# means that we need to add the src/ directory to the sys.path.
sys.path.insert(0, ROOT)
about = {}
with open(os.path.join(ROOT, 'lemur', '__about__.py')) as f:
exec(f.read(), about) # nosec: about file is benign
install_requires = [
'Flask==0.12',
'Flask-RESTful==0.3.6',
'Flask-SQLAlchemy==2.1',
'Flask-Script==2.0.6',
'Flask-Migrate==2.1.1',
'Flask-Bcrypt==0.7.1',
'Flask-Principal==0.4.0',
'Flask-Mail==0.9.1',
'SQLAlchemy-Utils==0.32.16',
'requests==2.11.1',
'ndg-httpsclient==0.4.2',
'psycopg2==2.7.3',
'arrow==0.10.0',
'six==1.10.0',
'marshmallow-sqlalchemy==0.13.1',
'gunicorn==19.7.1',
'marshmallow==2.13.6',
'cryptography==1.9',
'xmltodict==0.11.0',
'pyjwt==1.5.2',
'lockfile==0.12.2',
'inflection==0.3.1',
'future==0.16.0',
'boto3==1.4.6',
'acme==0.18.1',
'retrying==1.3.3',
'tabulate==0.7.7',
'pem==17.1.0',
'raven[flask]==6.1.0',
'jinja2==2.9.6',
'pyldap==2.4.37', # required by ldap auth provider
'paramiko==2.2.1' # required for lemur_linuxdst plugin
]
tests_require = [
'pyflakes',
'moto==1.1.5',
'nose==1.3.7',
'pytest==3.2.2',
'factory-boy==2.9.2',
'fake-factory==0.7.2',
'pytest-flask==0.10.0',
'freezegun==0.3.9',
'requests-mock==1.3.0',
'pytest-mock'
]
docs_require = [
'sphinx',
'sphinxcontrib-httpdomain',
'sphinx-rtd-theme'
]
dev_requires = [
'flake8>=3.2,<4.0',
'pre-commit',
'invoke',
'twine'
]
class SmartInstall(install):
"""
Installs Lemur into the Python environment.
If the package indicator is missing, this will also force a run of
`build_static` which is required for JavaScript assets and other things.
"""
def _needs_static(self):
return not os.path.exists(os.path.join(ROOT, 'lemur/static/dist'))
def run(self):
if self._needs_static():
self.run_command('build_static')
install.run(self)
class DevelopWithBuildStatic(develop):
def install_for_development(self):
self.run_command('build_static')
return develop.install_for_development(self)
class SdistWithBuildStatic(sdist):
def make_release_tree(self, *a, **kw):
dist_path = self.distribution.get_fullname()
sdist.make_release_tree(self, *a, **kw)
self.reinitialize_command('build_static', work_path=dist_path)
self.run_command('build_static')
with open(os.path.join(dist_path, 'lemur-package.json'), 'w') as fp:
json.dump({
'createdAt': datetime.datetime.utcnow().isoformat() + 'Z',
}, fp)
class BuildStatic(Command):
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
log.info("running [npm install --quiet] in {0}".format(ROOT))
try:
check_output(['npm', 'install', '--quiet'], cwd=ROOT)
log.info("running [gulp build]")
check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'build'], cwd=ROOT)
log.info("running [gulp package]")
check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'package'], cwd=ROOT)
except Exception as e:
log.warn("Unable to build static content")
setup(
name=about["__title__"],
version=about["__version__"],
author=about["__author__"],
author_email=about["__email__"],
url=about["__uri__"],
description=about["__summary__"],
long_description=open(os.path.join(ROOT, 'README.rst')).read(),
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
extras_require={
'tests': tests_require,
'docs': docs_require,
'dev': dev_requires,
},
cmdclass={
'build_static': BuildStatic,
'sdist': SdistWithBuildStatic,
'install': SmartInstall
},
entry_points={
'console_scripts': [
'lemur = lemur.manage:main',
],
'lemur.plugins': [
'verisign_issuer = lemur.plugins.lemur_verisign.plugin:VerisignIssuerPlugin',
'acme_issuer = lemur.plugins.lemur_acme.plugin:ACMEIssuerPlugin',
'aws_destination = lemur.plugins.lemur_aws.plugin:AWSDestinationPlugin',
'aws_source = lemur.plugins.lemur_aws.plugin:AWSSourcePlugin',
'aws_s3 = lemur.plugins.lemur_aws.plugin:S3DestinationPlugin',
'email_notification = lemur.plugins.lemur_email.plugin:EmailNotificationPlugin',
'slack_notification = lemur.plugins.lemur_slack.plugin:SlackNotificationPlugin',
'java_truststore_export = lemur.plugins.lemur_java.plugin:JavaTruststoreExportPlugin',
'java_keystore_export = lemur.plugins.lemur_java.plugin:JavaKeystoreExportPlugin',
'openssl_export = lemur.plugins.lemur_openssl.plugin:OpenSSLExportPlugin',
'atlas_metric = lemur.plugins.lemur_atlas.plugin:AtlasMetricPlugin',
'kubernetes_destination = lemur.plugins.lemur_kubernetes.plugin:KubernetesDestinationPlugin',
'cryptography_issuer = lemur.plugins.lemur_cryptography.plugin:CryptographyIssuerPlugin',
'cfssl_issuer = lemur.plugins.lemur_cfssl.plugin:CfsslIssuerPlugin',
'digicert_issuer = lemur.plugins.lemur_digicert.plugin:DigiCertIssuerPlugin',
'digicert_cis_issuer = lemur.plugins.lemur_digicert.plugin:DigiCertCISIssuerPlugin',
],
},
classifiers=[
'Framework :: Flask',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Topic :: Software Development',
"Programming Language :: Python :: 3.5",
"Natural Language :: English",
"License :: OSI Approved :: Apache Software License"
]
)
| 31.528571 | 105 | 0.644918 | [
"Apache-2.0"
] | caiges/lemur | setup.py | 6,621 | Python |
from base_sss import SubsetSelectionStrategy
import base_sss
import random
import torch
class BALDDropoutStrategy(SubsetSelectionStrategy):
def __init__(self, size, Y_vec, n_drop=10, previous_s=None):
self.previous_s = previous_s
self.n_drop = n_drop
super(BALDDropoutStrategy, self).__init__(size, Y_vec)
def get_subset(self):
# random.setstate(base_sss.sss_random_state)
if self.previous_s is not None:
Y_e = [self.Y_vec[ie] for ie in self.previous_s]
else:
Y_e = self.Y_vec #unlabelled copy mdeol outputs
#dropout
probs = torch.zeros([self.n_drop, len(Y_e), 10]) #np.unique(Y)
for i in range(self.n_drop):
for idxs in range(len(Y_e)):
probs[i][idxs] += Y_e[idxs]
pb = probs.mean(0)
entropy1 = (-pb * torch.log(pb)).sum(1)
entropy2 = (-probs * torch.log(probs)).sum(2).mean(0)
U = entropy2 - entropy1
points = U.sort()[1][:self.size]
# print("points,", points)
if self.previous_s is not None:
final_points = [self.previous_s[p] for p in points]
else:
final_points = points
return final_points
| 36.147059 | 70 | 0.609439 | [
"MIT"
] | LinaXiao201788/mexmi-project | mexmi/subset_selection_strategy/bayesian_disagreement_dropout_sss.py | 1,229 | Python |
from .fis import FIS
import numpy as np
try:
import pandas as pd
except ImportError:
pd = None
try:
from sklearn.model_selection import GridSearchCV
except ImportError:
GridSearchCV = None
def _get_vars(fis):
"""Get an encoded version of the parameters of the fuzzy sets in a FIS"""
for variable in fis.variables:
for value_name, value in variable.values.items():
for par, default in value._get_description().items():
if par != "type":
yield "var_" + variable.name + "_" + value_name + "_" + par, default
# Same for target
for variable in [fis.target]: # For symmetry
for value_name, value in variable.values.items():
for par, default in value._get_description().items():
if par != "type":
yield "target_" + variable.name + "_" + value_name + "_" + par, default
def _set_vars(fis, kwargs):
"""Return a modified version of the FIS, setting the changes in the parameters described by kwargs"""
description = fis._get_description()
positions = {variable["name"]: i for i, variable in enumerate(description["variables"])}
for code, parameter_value in kwargs.items():
if code.startswith("var_"):
_, variable_name, fuzzy_value, parameter = code.split("_")
description["variables"][positions[variable_name]]["values"][fuzzy_value][parameter] = parameter_value
elif code.startswith("target_"):
_, _, fuzzy_value, parameter = code.split("_")
description["target"]["values"][fuzzy_value][parameter] = parameter_value
elif code in ["defuzzification"]:
description[code] = parameter_value
else:
raise ValueError("Parameter not supported: %s" % code)
return FIS._from_description(description)
class ParametrizedFIS:
"""A parametrizable Fuzzy Inference System with a scikit-learn-like interface"""
def __init__(self, fis, defuzzification="centroid", **kwargs):
self.fis = fis
self.defuzzification = defuzzification
for parameter, value in _get_vars(fis):
setattr(self, parameter, kwargs.get(parameter, value))
def get_params(self, deep=True):
"""Get the parameters in a sklearn-consistent interface"""
return {"fis": self.fis,
"defuzzification": self.defuzzification,
**{parameter: getattr(self, parameter) for parameter, _ in _get_vars(self.fis)}}
def set_params(self, **parameters):
"""Set the parameters in a sklearn-consistent interface"""
for parameter, value in parameters.items():
setattr(self, parameter, value)
return self
def fit(self, X=None, y=None):
"""'Fit' the model (freeze the attributes and compile if available)"""
self.fis_ = _set_vars(self.fis, {parameter: getattr(self, parameter) for parameter, _ in _get_vars(self.fis)})
self.fis_.defuzzification = self.defuzzification
try:
self.fis_ = self.fis_.compile()
except Exception:
pass
return self
def predict(self, X):
"""A sklearn-like predict method"""
return self.fis_.batch_predict(X)
class TrivialSplitter:
"""Splitter with single split no training data and full test data"""
def __init__(self):
pass
def split(self, X, y=None, groups=None):
yield np.asarray([], dtype=int), np.arange(0, len(X))
def get_n_splits(self, X, y=None, groups=None):
return 1
class FuzzyGridTune:
"""An exhaustive FIS tuner"""
def __init__(self, fis, params, scoring="neg_root_mean_squared_error", n_jobs=None):
"""
Args:
fis (FIS): The Fuzzy Inference System to tune
params (dict of str to list): A mapping from encoded parameters to the list of values to explore.
scoring (str): The metric used for scoring. Must be one of sklearn's regression scorings.
n_jobs (int): Number of jobs to run in parallel.
"""
# Grid parameter tuning
if GridSearchCV is None:
raise ModuleNotFoundError("scikit-learn is required for model tuning")
self.fis = fis
self.cv = GridSearchCV(ParametrizedFIS(fis),
params,
scoring=scoring,
cv=TrivialSplitter(),
refit=False,
n_jobs=n_jobs
)
def fit(self, X, y=None):
"""
Args:
X (2D array-like): An object suitable for FIS.batch_predict.
y (1D array-like): An array with true values. If None, but X is a DataFrame, the values are extracted from
there.
Returns:
"""
# Try to extract y if a single dataframe is provided
if y is None and pd is not None and isinstance(X, pd.DataFrame):
y = X[self.fis.target.name]
self.cv.fit(X, y)
self.best_params_ = self.cv.best_params_
self.results = self.cv.cv_results_
self.tuned_fis_ = _set_vars(self.fis, self.cv.best_params_)
| 35.328859 | 118 | 0.606573 | [
"MIT"
] | Dih5/zadeh | zadeh/tune.py | 5,264 | Python |
import os
import site
wsgidir = os.path.dirname(__file__)
for path in ['../',
'../..',
'../../..',
'../../lib',
'../../vendor/lib/python',
'../../apps']:
site.addsitedir(os.path.abspath(os.path.join(wsgidir, path)))
from update import application
| 22.714286 | 65 | 0.477987 | [
"BSD-3-Clause"
] | Joergen/zamboni | services/wsgi/versioncheck.py | 318 | Python |
#!/usr/bin/env python
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) Google LLC, 2018
#
# Author: Tom Roeder <[email protected]>
#
"""A tool for generating compile_commands.json in the Linux kernel."""
import argparse
import json
import logging
import os
import re
_DEFAULT_OUTPUT = 'compile_commands.json'
_DEFAULT_LOG_LEVEL = 'WARNING'
_FILENAME_PATTERN = r'^\..*\.cmd$'
_LINE_PATTERN = r'^cmd_[^ ]*\.o := (.* )([^ ]*\.c)$'
_VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
# A kernel build generally has over 2000 entries in its compile_commands.json
# database. If this code finds 500 or fewer, then warn the user that they might
# not have all the .cmd files, and they might need to compile the kernel.
_LOW_COUNT_THRESHOLD = 500
def parse_arguments():
"""Sets up and parses command-line arguments.
Returns:
log_level: A logging level to filter log output.
directory: The directory to search for .cmd files.
output: Where to write the compile-commands JSON file.
"""
usage = 'Creates a compile_commands.json database from kernel .cmd files'
parser = argparse.ArgumentParser(description=usage)
directory_help = ('Path to the kernel source directory to search '
'(defaults to the working directory)')
parser.add_argument('-d', '--directory', type=str, help=directory_help)
output_help = ('The location to write compile_commands.json (defaults to '
'compile_commands.json in the search directory)')
parser.add_argument('-o', '--output', type=str, help=output_help)
log_level_help = ('The level of log messages to produce (one of ' +
', '.join(_VALID_LOG_LEVELS) + '; defaults to ' +
_DEFAULT_LOG_LEVEL + ')')
parser.add_argument(
'--log_level', type=str, default=_DEFAULT_LOG_LEVEL,
help=log_level_help)
args = parser.parse_args()
log_level = args.log_level
if log_level not in _VALID_LOG_LEVELS:
raise ValueError('%s is not a valid log level' % log_level)
directory = args.directory or os.getcwd()
output = args.output or os.path.join(directory, _DEFAULT_OUTPUT)
directory = os.path.abspath(directory)
return log_level, directory, output
def process_line(root_directory, file_directory, command_prefix, relative_path):
"""Extracts information from a .cmd line and creates an entry from it.
Args:
root_directory: The directory that was searched for .cmd files. Usually
used directly in the "directory" entry in compile_commands.json.
file_directory: The path to the directory the .cmd file was found in.
command_prefix: The extracted command line, up to the last element.
relative_path: The .c file from the end of the extracted command.
Usually relative to root_directory, but sometimes relative to
file_directory and sometimes neither.
Returns:
An entry to append to compile_commands.
Raises:
ValueError: Could not find the extracted file based on relative_path and
root_directory or file_directory.
"""
# The .cmd files are intended to be included directly by Make, so they
# escape the pound sign '#', either as '\#' or '$(pound)' (depending on the
# kernel version). The compile_commands.json file is not interepreted
# by Make, so this code replaces the escaped version with '#'.
prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
cur_dir = root_directory
expected_path = os.path.join(cur_dir, relative_path)
if not os.path.exists(expected_path):
# Try using file_directory instead. Some of the tools have a different
# style of .cmd file than the kernel.
cur_dir = file_directory
expected_path = os.path.join(cur_dir, relative_path)
if not os.path.exists(expected_path):
raise ValueError('File %s not in %s or %s' %
(relative_path, root_directory, file_directory))
return {
'directory': cur_dir,
'file': relative_path,
'command': prefix + relative_path,
}
def main():
"""Walks through the directory and finds and parses .cmd files."""
log_level, directory, output = parse_arguments()
level = getattr(logging, log_level)
logging.basicConfig(format='%(levelname)s: %(message)s', level=level)
filename_matcher = re.compile(_FILENAME_PATTERN)
line_matcher = re.compile(_LINE_PATTERN)
compile_commands = []
for dirpath, _, filenames in os.walk(directory):
for filename in filenames:
if not filename_matcher.match(filename):
continue
filepath = os.path.join(dirpath, filename)
with open(filepath, 'rt') as f:
for line in f:
result = line_matcher.match(line)
if not result:
continue
try:
entry = process_line(directory, dirpath,
result.group(1), result.group(2))
compile_commands.append(entry)
except ValueError as err:
logging.info('Could not add line from %s: %s',
filepath, err)
with open(output, 'wt') as f:
json.dump(compile_commands, f, indent=2, sort_keys=True)
count = len(compile_commands)
if count < _LOW_COUNT_THRESHOLD:
logging.warning(
'Found %s entries. Have you compiled the kernel?', count)
if __name__ == '__main__':
main()
| 37.467105 | 80 | 0.641615 | [
"Apache-2.0"
] | Akh1lesh/Object_Detection_using_Intel_Realsense | ubuntu-bionic-hwe-edge/scripts/gen_compile_commands.py | 5,695 | Python |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""Namespace browser widget"""
import os.path as osp
import socket
from spyderlib.qt.QtGui import (QWidget, QVBoxLayout, QHBoxLayout, QMenu,
QToolButton, QMessageBox, QApplication,
QCursor, QInputDialog)
from spyderlib.qt.QtCore import Qt, Signal, Slot
from spyderlib.qt.compat import getopenfilenames, getsavefilename
# Local imports
from spyderlib.widgets.externalshell.monitor import (
monitor_set_global, monitor_get_global, monitor_del_global,
monitor_copy_global, monitor_save_globals, monitor_load_globals,
communicate, REMOTE_SETTINGS)
from spyderlib.widgets.dicteditor import (RemoteDictEditorTableView,
DictEditorTableView)
from spyderlib.widgets.dicteditorutils import globalsfilter
from spyderlib.utils import encoding
from spyderlib.utils.misc import fix_reference_name
from spyderlib.utils.programs import is_module_installed
from spyderlib.utils.qthelpers import (get_icon, create_toolbutton,
add_actions, create_action)
from spyderlib.utils.iofuncs import iofunctions
from spyderlib.widgets.importwizard import ImportWizard
from spyderlib.baseconfig import _, get_supported_types
from spyderlib.py3compat import is_text_string, to_text_string, getcwd
SUPPORTED_TYPES = get_supported_types()
class NamespaceBrowser(QWidget):
"""Namespace browser (global variables explorer widget)"""
sig_option_changed = Signal(str, object)
sig_collapse = Signal()
def __init__(self, parent):
QWidget.__init__(self, parent)
self.shellwidget = None
self.is_internal_shell = None
self.ipyclient = None
self.is_ipykernel = None
self.is_visible = True # Do not modify: light mode won't work!
self.setup_in_progress = None
# Remote dict editor settings
self.check_all = None
self.exclude_private = None
self.exclude_uppercase = None
self.exclude_capitalized = None
self.exclude_unsupported = None
self.excluded_names = None
self.truncate = None
self.minmax = None
self.remote_editing = None
self.autorefresh = None
self.editor = None
self.exclude_private_action = None
self.exclude_uppercase_action = None
self.exclude_capitalized_action = None
self.exclude_unsupported_action = None
self.filename = None
def setup(self, check_all=None, exclude_private=None,
exclude_uppercase=None, exclude_capitalized=None,
exclude_unsupported=None, excluded_names=None,
truncate=None, minmax=None, remote_editing=None,
autorefresh=None):
"""Setup the namespace browser"""
assert self.shellwidget is not None
self.check_all = check_all
self.exclude_private = exclude_private
self.exclude_uppercase = exclude_uppercase
self.exclude_capitalized = exclude_capitalized
self.exclude_unsupported = exclude_unsupported
self.excluded_names = excluded_names
self.truncate = truncate
self.minmax = minmax
self.remote_editing = remote_editing
self.autorefresh = autorefresh
if self.editor is not None:
self.editor.setup_menu(truncate, minmax)
self.exclude_private_action.setChecked(exclude_private)
self.exclude_uppercase_action.setChecked(exclude_uppercase)
self.exclude_capitalized_action.setChecked(exclude_capitalized)
self.exclude_unsupported_action.setChecked(exclude_unsupported)
# Don't turn autorefresh on for IPython kernels
# See Issue 1450
if not self.is_ipykernel:
self.auto_refresh_button.setChecked(autorefresh)
self.refresh_table()
return
# Dict editor:
if self.is_internal_shell:
self.editor = DictEditorTableView(self, None, truncate=truncate,
minmax=minmax)
else:
self.editor = RemoteDictEditorTableView(self, None,
truncate=truncate, minmax=minmax,
remote_editing=remote_editing,
get_value_func=self.get_value,
set_value_func=self.set_value,
new_value_func=self.set_value,
remove_values_func=self.remove_values,
copy_value_func=self.copy_value,
is_list_func=self.is_list,
get_len_func=self.get_len,
is_array_func=self.is_array,
is_image_func=self.is_image,
is_dict_func=self.is_dict,
is_data_frame_func=self.is_data_frame,
is_time_series_func=self.is_time_series,
get_array_shape_func=self.get_array_shape,
get_array_ndim_func=self.get_array_ndim,
oedit_func=self.oedit,
plot_func=self.plot, imshow_func=self.imshow,
show_image_func=self.show_image)
self.editor.sig_option_changed.connect(self.sig_option_changed.emit)
self.editor.sig_files_dropped.connect(self.import_data)
# Setup layout
hlayout = QHBoxLayout()
vlayout = QVBoxLayout()
toolbar = self.setup_toolbar(exclude_private, exclude_uppercase,
exclude_capitalized, exclude_unsupported,
autorefresh)
vlayout.setAlignment(Qt.AlignTop)
for widget in toolbar:
vlayout.addWidget(widget)
hlayout.addWidget(self.editor)
hlayout.addLayout(vlayout)
self.setLayout(hlayout)
hlayout.setContentsMargins(0, 0, 0, 0)
self.sig_option_changed.connect(self.option_changed)
def set_shellwidget(self, shellwidget):
"""Bind shellwidget instance to namespace browser"""
self.shellwidget = shellwidget
from spyderlib.widgets import internalshell
self.is_internal_shell = isinstance(self.shellwidget,
internalshell.InternalShell)
self.is_ipykernel = self.shellwidget.is_ipykernel
if not self.is_internal_shell:
shellwidget.set_namespacebrowser(self)
def set_ipyclient(self, ipyclient):
"""Bind ipyclient instance to namespace browser"""
self.ipyclient = ipyclient
def setup_toolbar(self, exclude_private, exclude_uppercase,
exclude_capitalized, exclude_unsupported, autorefresh):
"""Setup toolbar"""
self.setup_in_progress = True
toolbar = []
refresh_button = create_toolbutton(self, text=_("Refresh"),
icon=get_icon('reload.png'),
triggered=self.refresh_table)
self.auto_refresh_button = create_toolbutton(self,
text=_("Refresh periodically"),
icon=get_icon('auto_reload.png'),
toggled=self.toggle_auto_refresh)
self.auto_refresh_button.setChecked(autorefresh)
load_button = create_toolbutton(self, text=_("Import data"),
icon=get_icon('fileimport.png'),
triggered=self.import_data)
self.save_button = create_toolbutton(self, text=_("Save data"),
icon=get_icon('filesave.png'),
triggered=lambda: self.save_data(self.filename))
self.save_button.setEnabled(False)
save_as_button = create_toolbutton(self,
text=_("Save data as..."),
icon=get_icon('filesaveas.png'),
triggered=self.save_data)
toolbar += [refresh_button, self.auto_refresh_button, load_button,
self.save_button, save_as_button]
self.exclude_private_action = create_action(self,
_("Exclude private references"),
tip=_("Exclude references which name starts"
" with an underscore"),
toggled=lambda state:
self.sig_option_changed.emit('exclude_private', state))
self.exclude_private_action.setChecked(exclude_private)
self.exclude_uppercase_action = create_action(self,
_("Exclude all-uppercase references"),
tip=_("Exclude references which name is uppercase"),
toggled=lambda state:
self.sig_option_changed.emit('exclude_uppercase', state))
self.exclude_uppercase_action.setChecked(exclude_uppercase)
self.exclude_capitalized_action = create_action(self,
_("Exclude capitalized references"),
tip=_("Exclude references which name starts with an "
"uppercase character"),
toggled=lambda state:
self.sig_option_changed.emit('exclude_capitalized', state))
self.exclude_capitalized_action.setChecked(exclude_capitalized)
self.exclude_unsupported_action = create_action(self,
_("Exclude unsupported data types"),
tip=_("Exclude references to unsupported data types"
" (i.e. which won't be handled/saved correctly)"),
toggled=lambda state:
self.sig_option_changed.emit('exclude_unsupported', state))
self.exclude_unsupported_action.setChecked(exclude_unsupported)
options_button = create_toolbutton(self, text=_("Options"),
icon=get_icon('tooloptions.png'))
toolbar.append(options_button)
options_button.setPopupMode(QToolButton.InstantPopup)
menu = QMenu(self)
editor = self.editor
actions = [self.exclude_private_action, self.exclude_uppercase_action,
self.exclude_capitalized_action,
self.exclude_unsupported_action, None,
editor.truncate_action]
if is_module_installed('numpy'):
actions.append(editor.minmax_action)
add_actions(menu, actions)
options_button.setMenu(menu)
self.setup_in_progress = False
return toolbar
def option_changed(self, option, value):
"""Option has changed"""
setattr(self, to_text_string(option), value)
if not self.is_internal_shell:
settings = self.get_view_settings()
communicate(self._get_sock(),
'set_remote_view_settings()', settings=[settings])
def visibility_changed(self, enable):
"""Notify the widget whether its container (the namespace browser
plugin is visible or not"""
self.is_visible = enable
if enable:
self.refresh_table()
@Slot(bool)
def toggle_auto_refresh(self, state):
"""Toggle auto refresh state"""
self.autorefresh = state
if not self.setup_in_progress and not self.is_internal_shell:
communicate(self._get_sock(),
"set_monitor_auto_refresh(%r)" % state)
def _get_sock(self):
"""Return socket connection"""
return self.shellwidget.introspection_socket
def get_internal_shell_filter(self, mode, check_all=None):
"""
Return internal shell data types filter:
* check_all: check all elements data types for sequences
(dict, list, tuple)
* mode (string): 'editable' or 'picklable'
"""
assert mode in list(SUPPORTED_TYPES.keys())
if check_all is None:
check_all = self.check_all
def wsfilter(input_dict, check_all=check_all,
filters=tuple(SUPPORTED_TYPES[mode])):
"""Keep only objects that can be pickled"""
return globalsfilter(
input_dict, check_all=check_all, filters=filters,
exclude_private=self.exclude_private,
exclude_uppercase=self.exclude_uppercase,
exclude_capitalized=self.exclude_capitalized,
exclude_unsupported=self.exclude_unsupported,
excluded_names=self.excluded_names)
return wsfilter
def get_view_settings(self):
"""Return dict editor view settings"""
settings = {}
for name in REMOTE_SETTINGS:
settings[name] = getattr(self, name)
return settings
@Slot()
def refresh_table(self):
"""Refresh variable table"""
if self.is_visible and self.isVisible():
if self.is_internal_shell:
# Internal shell
wsfilter = self.get_internal_shell_filter('editable')
self.editor.set_filter(wsfilter)
interpreter = self.shellwidget.interpreter
if interpreter is not None:
self.editor.set_data(interpreter.namespace)
self.editor.adjust_columns()
elif self.shellwidget.is_running():
# import time; print >>STDOUT, time.ctime(time.time()), "Refreshing namespace browser"
sock = self._get_sock()
if sock is None:
return
try:
communicate(sock, "refresh()")
except socket.error:
# Process was terminated before calling this method
pass
def process_remote_view(self, remote_view):
"""Process remote view"""
if remote_view is not None:
self.set_data(remote_view)
#------ Remote Python process commands ------------------------------------
def get_value(self, name):
value = monitor_get_global(self._get_sock(), name)
if value is None:
if communicate(self._get_sock(), '%s is not None' % name):
import pickle
msg = to_text_string(_("Object <b>%s</b> is not picklable")
% name)
raise pickle.PicklingError(msg)
return value
def set_value(self, name, value):
monitor_set_global(self._get_sock(), name, value)
self.refresh_table()
def remove_values(self, names):
for name in names:
monitor_del_global(self._get_sock(), name)
self.refresh_table()
def copy_value(self, orig_name, new_name):
monitor_copy_global(self._get_sock(), orig_name, new_name)
self.refresh_table()
def is_list(self, name):
"""Return True if variable is a list or a tuple"""
return communicate(self._get_sock(),
'isinstance(%s, (tuple, list))' % name)
def is_dict(self, name):
"""Return True if variable is a dictionary"""
return communicate(self._get_sock(), 'isinstance(%s, dict)' % name)
def get_len(self, name):
"""Return sequence length"""
return communicate(self._get_sock(), "len(%s)" % name)
def is_array(self, name):
"""Return True if variable is a NumPy array"""
return communicate(self._get_sock(), 'is_array("%s")' % name)
def is_image(self, name):
"""Return True if variable is a PIL.Image image"""
return communicate(self._get_sock(), 'is_image("%s")' % name)
def is_data_frame(self, name):
"""Return True if variable is a data_frame"""
return communicate(self._get_sock(),
"isinstance(globals()['%s'], DataFrame)" % name)
def is_time_series(self, name):
"""Return True if variable is a data_frame"""
return communicate(self._get_sock(),
"isinstance(globals()['%s'], TimeSeries)" % name)
def get_array_shape(self, name):
"""Return array's shape"""
return communicate(self._get_sock(), "%s.shape" % name)
def get_array_ndim(self, name):
"""Return array's ndim"""
return communicate(self._get_sock(), "%s.ndim" % name)
def plot(self, name, funcname):
command = "import spyderlib.pyplot; "\
"__fig__ = spyderlib.pyplot.figure(); "\
"__items__ = getattr(spyderlib.pyplot, '%s')(%s); "\
"spyderlib.pyplot.show(); "\
"del __fig__, __items__;" % (funcname, name)
if self.is_ipykernel:
self.ipyclient.shellwidget.execute("%%varexp --%s %s" % (funcname,
name))
else:
self.shellwidget.send_to_process(command)
def imshow(self, name):
command = "import spyderlib.pyplot; " \
"__fig__ = spyderlib.pyplot.figure(); " \
"__items__ = spyderlib.pyplot.imshow(%s); " \
"spyderlib.pyplot.show(); del __fig__, __items__;" % name
if self.is_ipykernel:
self.ipyclient.shellwidget.execute("%%varexp --imshow %s" % name)
else:
self.shellwidget.send_to_process(command)
def show_image(self, name):
command = "%s.show()" % name
if self.is_ipykernel:
self.ipyclient.shellwidget.execute(command)
else:
self.shellwidget.send_to_process(command)
def oedit(self, name):
command = "from spyderlib.widgets.objecteditor import oedit; " \
"oedit('%s', modal=False, namespace=locals());" % name
self.shellwidget.send_to_process(command)
#------ Set, load and save data -------------------------------------------
def set_data(self, data):
"""Set data"""
if data != self.editor.model.get_data():
self.editor.set_data(data)
self.editor.adjust_columns()
def collapse(self):
"""Collapse"""
self.sig_collapse.emit()
@Slot(list)
def import_data(self, filenames=None):
"""Import data from text file"""
title = _("Import data")
if filenames is None:
if self.filename is None:
basedir = getcwd()
else:
basedir = osp.dirname(self.filename)
filenames, _selfilter = getopenfilenames(self, title, basedir,
iofunctions.load_filters)
if not filenames:
return
elif is_text_string(filenames):
filenames = [filenames]
for filename in filenames:
self.filename = to_text_string(filename)
ext = osp.splitext(self.filename)[1].lower()
if ext not in iofunctions.load_funcs:
buttons = QMessageBox.Yes | QMessageBox.Cancel
answer = QMessageBox.question(self, title,
_("<b>Unsupported file extension '%s'</b><br><br>"
"Would you like to import it anyway "
"(by selecting a known file format)?"
) % ext, buttons)
if answer == QMessageBox.Cancel:
return
formats = list(iofunctions.load_extensions.keys())
item, ok = QInputDialog.getItem(self, title,
_('Open file as:'),
formats, 0, False)
if ok:
ext = iofunctions.load_extensions[to_text_string(item)]
else:
return
load_func = iofunctions.load_funcs[ext]
# 'import_wizard' (self.setup_io)
if is_text_string(load_func):
# Import data with import wizard
error_message = None
try:
text, _encoding = encoding.read(self.filename)
if self.is_internal_shell:
self.editor.import_from_string(text)
else:
base_name = osp.basename(self.filename)
editor = ImportWizard(self, text, title=base_name,
varname=fix_reference_name(base_name))
if editor.exec_():
var_name, clip_data = editor.get_data()
monitor_set_global(self._get_sock(),
var_name, clip_data)
except Exception as error:
error_message = str(error)
else:
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
QApplication.processEvents()
if self.is_internal_shell:
namespace, error_message = load_func(self.filename)
interpreter = self.shellwidget.interpreter
for key in list(namespace.keys()):
new_key = fix_reference_name(key,
blacklist=list(interpreter.namespace.keys()))
if new_key != key:
namespace[new_key] = namespace.pop(key)
if error_message is None:
interpreter.namespace.update(namespace)
else:
error_message = monitor_load_globals(self._get_sock(),
self.filename, ext)
QApplication.restoreOverrideCursor()
QApplication.processEvents()
if error_message is not None:
QMessageBox.critical(self, title,
_("<b>Unable to load '%s'</b>"
"<br><br>Error message:<br>%s"
) % (self.filename, error_message))
self.refresh_table()
@Slot()
def save_data(self, filename=None):
"""Save data"""
if filename is None:
filename = self.filename
if filename is None:
filename = getcwd()
filename, _selfilter = getsavefilename(self, _("Save data"),
filename,
iofunctions.save_filters)
if filename:
self.filename = filename
else:
return False
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
QApplication.processEvents()
if self.is_internal_shell:
wsfilter = self.get_internal_shell_filter('picklable',
check_all=True)
namespace = wsfilter(self.shellwidget.interpreter.namespace).copy()
error_message = iofunctions.save(namespace, filename)
else:
settings = self.get_view_settings()
error_message = monitor_save_globals(self._get_sock(),
settings, filename)
QApplication.restoreOverrideCursor()
QApplication.processEvents()
if error_message is not None:
QMessageBox.critical(self, _("Save data"),
_("<b>Unable to save current workspace</b>"
"<br><br>Error message:<br>%s") % error_message)
self.save_button.setEnabled(self.filename is not None)
| 45.217626 | 102 | 0.544887 | [
"MIT"
] | junglefunkyman/spectracer | spyderlib/widgets/externalshell/namespacebrowser.py | 25,142 | Python |
from typing import Optional
from inan.types.blockchain_format.coin import Coin
from inan.types.blockchain_format.program import Program
from inan.types.blockchain_format.sized_bytes import bytes32
from inan.wallet.puzzles.load_clvm import load_clvm
MOD = load_clvm("genesis-by-coin-id-with-0.clvm", package_or_requirement=__name__)
def create_genesis_or_zero_coin_checker(genesis_coin_id: bytes32) -> Program:
"""
Given a specific genesis coin id, create a `genesis_coin_mod` that allows
both that coin id to issue a cc, or anyone to create a cc with amount 0.
"""
genesis_coin_mod = MOD
return genesis_coin_mod.curry(genesis_coin_id)
def genesis_coin_id_for_genesis_coin_checker(
genesis_coin_checker: Program,
) -> Optional[bytes32]:
"""
Given a `genesis_coin_checker` program, pull out the genesis coin id.
"""
r = genesis_coin_checker.uncurry()
if r is None:
return r
f, args = r
if f != MOD:
return None
return args.first().as_atom()
def lineage_proof_for_genesis(parent_coin: Coin) -> Program:
return Program.to((0, [parent_coin.as_list(), 0]))
def lineage_proof_for_zero(parent_coin: Coin) -> Program:
return Program.to((0, [parent_coin.as_list(), 1]))
def lineage_proof_for_coin(parent_coin: Coin) -> Program:
if parent_coin.amount == 0:
return lineage_proof_for_zero(parent_coin)
return lineage_proof_for_genesis(parent_coin)
| 30.787234 | 82 | 0.73877 | [
"Apache-2.0"
] | inan0812/Inans-blockchain | inan/wallet/puzzles/genesis_by_coin_id_with_0.py | 1,447 | Python |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
import tensorflow as tf
from edward.inferences.monte_carlo import MonteCarlo
from edward.models import RandomVariable, Empirical
from edward.util import copy
try:
from edward.models import Normal
except Exception as e:
raise ImportError("{0}. Your TensorFlow version is not supported.".format(e))
class SGHMC(MonteCarlo):
"""Stochastic gradient Hamiltonian Monte Carlo (Chen et al., 2014).
#### Notes
In conditional inference, we infer $z$ in $p(z, \\beta
\mid x)$ while fixing inference over $\\beta$ using another
distribution $q(\\beta)$.
`SGHMC` substitutes the model's log marginal density
$\log p(x, z) = \log \mathbb{E}_{q(\\beta)} [ p(x, z, \\beta) ]
\\approx \log p(x, z, \\beta^*)$
leveraging a single Monte Carlo sample, where $\\beta^* \sim
q(\\beta)$. This is unbiased (and therefore asymptotically exact as a
pseudo-marginal method) if $q(\\beta) = p(\\beta \mid x)$.
#### Examples
```python
mu = Normal(loc=0.0, scale=1.0)
x = Normal(loc=mu, scale=1.0, sample_shape=10)
qmu = Empirical(tf.Variable(tf.zeros(500)))
inference = ed.SGHMC({mu: qmu}, {x: np.zeros(10, dtype=np.float32)})
```
"""
def __init__(self, *args, **kwargs):
super(SGHMC, self).__init__(*args, **kwargs)
def initialize(self, step_size=0.25, friction=0.1, *args, **kwargs):
"""Initialize inference algorithm.
Args:
step_size: float, optional.
Constant scale factor of learning rate.
friction: float, optional.
Constant scale on the friction term in the Hamiltonian system.
"""
self.step_size = step_size
self.friction = friction
self.v = {z: tf.Variable(tf.zeros(qz.params.shape[1:]))
for z, qz in six.iteritems(self.latent_vars)}
return super(SGHMC, self).initialize(*args, **kwargs)
def build_update(self):
"""Simulate Hamiltonian dynamics with friction using a discretized
integrator. Its discretization error goes to zero as the learning
rate decreases.
Implements the update equations from (15) of Chen et al. (2014).
"""
old_sample = {z: tf.gather(qz.params, tf.maximum(self.t - 1, 0))
for z, qz in six.iteritems(self.latent_vars)}
old_v_sample = {z: v for z, v in six.iteritems(self.v)}
# Simulate Hamiltonian dynamics with friction.
friction = tf.constant(self.friction, dtype=tf.float32)
learning_rate = tf.constant(self.step_size * 0.01, dtype=tf.float32)
grad_log_joint = tf.gradients(self._log_joint(old_sample),
list(six.itervalues(old_sample)))
# v_sample is so named b/c it represents a velocity rather than momentum.
sample = {}
v_sample = {}
for z, grad_log_p in zip(six.iterkeys(old_sample), grad_log_joint):
qz = self.latent_vars[z]
event_shape = qz.event_shape
normal = Normal(loc=tf.zeros(event_shape),
scale=(tf.sqrt(learning_rate * friction) *
tf.ones(event_shape)))
sample[z] = old_sample[z] + old_v_sample[z]
v_sample[z] = ((1. - 0.5 * friction) * old_v_sample[z] +
learning_rate * tf.convert_to_tensor(grad_log_p) +
normal.sample())
# Update Empirical random variables.
assign_ops = []
for z, qz in six.iteritems(self.latent_vars):
variable = qz.get_variables()[0]
assign_ops.append(tf.scatter_update(variable, self.t, sample[z]))
assign_ops.append(tf.assign(self.v[z], v_sample[z]).op)
# Increment n_accept.
assign_ops.append(self.n_accept.assign_add(1))
return tf.group(*assign_ops)
def _log_joint(self, z_sample):
"""Utility function to calculate model's log joint density,
log p(x, z), for inputs z (and fixed data x).
Args:
z_sample: dict.
Latent variable keys to samples.
"""
scope = tf.get_default_graph().unique_name("inference")
# Form dictionary in order to replace conditioning on prior or
# observed variable with conditioning on a specific value.
dict_swap = z_sample.copy()
for x, qx in six.iteritems(self.data):
if isinstance(x, RandomVariable):
if isinstance(qx, RandomVariable):
qx_copy = copy(qx, scope=scope)
dict_swap[x] = qx_copy.value()
else:
dict_swap[x] = qx
log_joint = 0.0
for z in six.iterkeys(self.latent_vars):
z_copy = copy(z, dict_swap, scope=scope)
log_joint += tf.reduce_sum(
self.scale.get(z, 1.0) * z_copy.log_prob(dict_swap[z]))
for x in six.iterkeys(self.data):
if isinstance(x, RandomVariable):
x_copy = copy(x, dict_swap, scope=scope)
log_joint += tf.reduce_sum(
self.scale.get(x, 1.0) * x_copy.log_prob(dict_swap[x]))
return log_joint
| 35.637681 | 79 | 0.652908 | [
"Apache-2.0"
] | mmargenot/edward | edward/inferences/sghmc.py | 4,918 | Python |
import torch.nn as nn
import numpy as np
import pytest
from test.utils import convert_and_test
class LayerSigmoid(nn.Module):
"""
Test for nn.layers based types
"""
def __init__(self):
super(LayerSigmoid, self).__init__()
self.sig = nn.Sigmoid()
def forward(self, x):
x = self.sig(x)
return x
class FSigmoid(nn.Module):
"""
Test for nn.functional types
"""
def __init__(self):
super(FSigmoid, self).__init__()
def forward(self, x):
from torch.nn import functional as F
return F.sigmoid(x)
@pytest.mark.parametrize('change_ordering', [True, False])
def test_layer_sigmoid(change_ordering):
model = LayerSigmoid()
model.eval()
input_np = np.random.uniform(0, 1, (1, 3, 224, 224))
error = convert_and_test(model, input_np, verbose=False, change_ordering=change_ordering)
@pytest.mark.parametrize('change_ordering', [True, False])
def test_f_sigmoid(change_ordering):
model = FSigmoid()
model.eval()
input_np = np.random.uniform(0, 1, (1, 3, 224, 224))
error = convert_and_test(model, input_np, verbose=False, change_ordering=change_ordering)
| 25.06383 | 93 | 0.669779 | [
"MIT"
] | Andredance/onnx2keras | test/layers/activations/test_sigmoid.py | 1,178 | Python |
import sys
import threading
from pynput import keyboard
from pynput.keyboard import Controller, Key
from massivemacro import main
COMMAND_KEY = Key.cmd_l if sys.platform == "darwin" else Key.ctrl_l
ALL_MODIFIERS = set()
ALL_KEY_BINDINGS = set()
class EnterKeyBinding(object):
def __init__(self, massivizer, *args):
self.massivizer = massivizer
self.modifiers = set()
for modifier in args:
self.modifiers.add(modifier)
ALL_MODIFIERS.add(modifier)
ALL_KEY_BINDINGS.add(self)
@property
def massivizer(self):
return self.__massivizer
@massivizer.setter
def massivizer(self, massivizer):
for key_binding in ALL_KEY_BINDINGS:
if key_binding is not self and key_binding.__massivizer == massivizer:
key_binding.__massivizer = self.__massivizer
self.__massivizer = massivizer
key_controller = Controller()
active_modifiers = set()
current_listener = None
stopped = False
def press(key):
key_controller.press(key)
def release(key):
key_controller.release(key)
def command(key):
key_controller.press(COMMAND_KEY)
key_controller.press(key)
key_controller.release(key)
key_controller.release(COMMAND_KEY)
def translate_modifier(key):
if key == Key.ctrl_l or key == Key.ctrl_r:
return Key.ctrl
if key == Key.alt_l or key == Key.alt_r:
return Key.alt
if key == Key.shift_l or key == Key.shift_r:
return Key.shift
return key
def on_press(key):
print(key)
if key != Key.enter:
if translate_modifier(key) in ALL_MODIFIERS:
active_modifiers.add(key)
return
for key_binding in ALL_KEY_BINDINGS:
if len(key_binding.modifiers) != len(active_modifiers):
continue
all_modifiers_found = True
for modifier in key_binding.modifiers:
modifier_found = False
for active_modifier in active_modifiers:
if translate_modifier(active_modifier) == modifier:
modifier_found = True
if not modifier_found:
all_modifiers_found = False
break
if all_modifiers_found:
main.handle_massivization(key_binding.massivizer)
return
def on_release(key):
try:
active_modifiers.remove(key)
except KeyError:
pass
def start_listener(gui):
if gui:
thread = threading.Thread(target=actually_start_listener)
thread.start()
else:
actually_start_listener()
def actually_start_listener():
global current_listener
global stopped
stopped = False
while True:
if stopped:
return
with keyboard.Listener(on_press=on_press, on_release=on_release) as listener:
current_listener = listener
try:
listener.join()
except KeyError:
print(
"Non-fatal error. MassiveMacro will continue to run."
)
def stop_listener():
global stopped
current_listener.stop()
stopped = True
| 18.606897 | 79 | 0.749444 | [
"MIT"
] | TheRandomLabs/MassiveMacro | massivemacro/key_handler.py | 2,698 | Python |
#!/usr/bin/env python
# Copyright (c) 2013-2014 Will Thames <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from __future__ import print_function
import errno
import optparse
import sys
import ansiblelint
import ansiblelint.formatters as formatters
import six
from ansiblelint import RulesCollection
from ansiblelint.version import __version__
import yaml
import os
def load_config(config_file):
config_path = config_file if config_file else ".ansible-lint"
if os.path.exists(config_path):
with open(config_path, "r") as stream:
try:
return yaml.load(stream)
except yaml.YAMLError:
pass
return None
def main():
formatter = formatters.Formatter()
parser = optparse.OptionParser("%prog [options] playbook.yml [playbook2 ...]",
version="%prog " + __version__)
parser.add_option('-L', dest='listrules', default=False,
action='store_true', help="list all the rules")
parser.add_option('-q', dest='quiet',
default=False,
action='store_true',
help="quieter, although not silent output")
parser.add_option('-p', dest='parseable',
default=False,
action='store_true',
help="parseable output in the format of pep8")
parser.add_option('-r', action='append', dest='rulesdir',
default=[], type='str',
help="specify one or more rules directories using "
"one or more -r arguments. Any -r flags override "
"the default rules in %s, unless -R is also used."
% ansiblelint.default_rulesdir)
parser.add_option('-R', action='store_true',
default=False,
dest='use_default_rules',
help="Use default rules in %s in addition to any extra "
"rules directories specified with -r. There is "
"no need to specify this if no -r flags are used"
% ansiblelint.default_rulesdir)
parser.add_option('-t', dest='tags',
action='append',
default=[],
help="only check rules whose id/tags match these values")
parser.add_option('-T', dest='listtags', action='store_true',
help="list all the tags")
parser.add_option('-v', dest='verbosity', action='count',
help="Increase verbosity level",
default=0)
parser.add_option('-x', dest='skip_list', default=[], action='append',
help="only check rules whose id/tags do not " +
"match these values")
parser.add_option('--nocolor', dest='colored',
default=hasattr(sys.stdout, 'isatty') and sys.stdout.isatty(),
action='store_false',
help="disable colored output")
parser.add_option('--force-color', dest='colored',
action='store_true',
help="Try force colored output (relying on ansible's code)")
parser.add_option('--exclude', dest='exclude_paths', action='append',
help='path to directories or files to skip. This option'
' is repeatable.',
default=[])
parser.add_option('-c', help='Specify configuration file to use. Defaults to ".ansible-lint"')
options, args = parser.parse_args(sys.argv[1:])
config = load_config(options.c)
if config:
if 'quiet' in config:
options.quiet = options.quiet or config['quiet']
if 'parseable' in config:
options.parseable = options.parseable or config['parseable']
if 'use_default_rules' in config:
options.use_default_rules = options.use_default_rules or config['use_default_rules']
if 'verbosity' in config:
options.verbosity = options.verbosity + config['verbosity']
if 'exclude_paths' in config:
options.exclude_paths = options.exclude_paths + config['exclude_paths']
if 'rulesdir' in config:
options.rulesdir = options.rulesdir + config['rulesdir']
if 'skip_list' in config:
options.skip_list = options.skip_list + config['skip_list']
if 'tags' in config:
options.tags = options.tags + config['tags']
if options.quiet:
formatter = formatters.QuietFormatter()
if options.parseable:
formatter = formatters.ParseableFormatter()
if len(args) == 0 and not (options.listrules or options.listtags):
parser.print_help(file=sys.stderr)
return 1
if options.use_default_rules:
rulesdirs = options.rulesdir + [ansiblelint.default_rulesdir]
else:
rulesdirs = options.rulesdir or [ansiblelint.default_rulesdir]
rules = RulesCollection()
for rulesdir in rulesdirs:
rules.extend(RulesCollection.create_from_directory(rulesdir))
if options.listrules:
print(rules)
return 0
if options.listtags:
print(rules.listtags())
return 0
if isinstance(options.tags, six.string_types):
options.tags = options.tags.split(',')
skip = set()
for s in options.skip_list:
skip.update(s.split(','))
options.skip_list = frozenset(skip)
playbooks = set(args)
matches = list()
checked_files = set()
for playbook in playbooks:
runner = ansiblelint.Runner(rules, playbook, options.tags,
options.skip_list, options.exclude_paths,
options.verbosity, checked_files)
matches.extend(runner.run())
matches.sort(key=lambda x: (x.filename, x.linenumber, x.rule.id))
for match in matches:
print(formatter.format(match, options.colored))
if len(matches):
return 2
else:
return 0
if __name__ == "__main__":
try:
sys.exit(main())
except IOError as exc:
if exc.errno != errno.EPIPE:
raise
except RuntimeError as e:
raise SystemExit(str(e))
| 37.401015 | 99 | 0.609799 | [
"MIT"
] | Chrislyle8/Test | lib/ansiblelint/__main__.py | 7,368 | Python |
#!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import re
import os.path
from io import open
from setuptools import find_packages, setup
# Change the PACKAGE_NAME only to change folder and different name
PACKAGE_NAME = "azure-mgmt-netapp"
PACKAGE_PPRINT_NAME = "NetApp Files Management"
# a-b-c => a/b/c
package_folder_path = PACKAGE_NAME.replace('-', '/')
# a-b-c => a.b.c
namespace_name = PACKAGE_NAME.replace('-', '.')
# Version extraction inspired from 'requests'
with open(os.path.join(package_folder_path, 'version.py')
if os.path.exists(os.path.join(package_folder_path, 'version.py'))
else os.path.join(package_folder_path, '_version.py'), 'r') as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
if not version:
raise RuntimeError('Cannot find version information')
with open('README.md', encoding='utf-8') as f:
readme = f.read()
with open('CHANGELOG.md', encoding='utf-8') as f:
changelog = f.read()
setup(
name=PACKAGE_NAME,
version=version,
description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME),
long_description=readme + '\n\n' + changelog,
long_description_content_type='text/markdown',
license='MIT License',
author='Microsoft Corporation',
author_email='[email protected]',
url='https://github.com/Azure/azure-sdk-for-python',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: MIT License',
],
zip_safe=False,
packages=find_packages(exclude=[
'tests',
# Exclude packages that will be covered by PEP420 or nspkg
'azure',
'azure.mgmt',
]),
install_requires=[
'msrest>=0.6.21',
'azure-common~=1.1',
'azure-mgmt-core>=1.3.0,<2.0.0',
],
python_requires=">=3.6",
)
| 34.293333 | 91 | 0.60381 | [
"MIT"
] | AFengKK/azure-sdk-for-python | sdk/netapp/azure-mgmt-netapp/setup.py | 2,572 | Python |
from typing import List, Optional
from discord.ext import commands
from fastapi import APIRouter
from pydantic import BaseModel
from bot.utils import ConnectionUtil, get_conn
class PartialAnswer(BaseModel):
"""Represents the model for an incomplete 8ball answer."""
response: Optional[str]
weight: Optional[int]
class Answer(PartialAnswer):
"""Represents an already inserted 8ball answer, is usually returned."""
id: int
api = APIRouter(prefix='/8ball')
@api.get('/')
async def get_random_response(conn: ConnectionUtil = get_conn) -> str:
# Weighted random selection
return await conn.fetchval('SELECT response FROM eightball ORDER BY RANDOM()*weight;')
@api.get('/answers', response_model=List[Answer])
async def get_answers(conn: ConnectionUtil = get_conn) -> List[Answer]:
# FastAPI converts it into a list of Answers
return [record for record in await conn.fetch('SELECT * FROM eightball;')]
@api.post('/answers', response_model=Answer)
async def add_answer(answer: PartialAnswer, conn: ConnectionUtil = get_conn) -> Answer:
# FastAPI handles convering it into an Answer
return await conn.fetchrow(
'INSERT INTO eightball (response, weight) VALUES ($1, $2) RETURNING *;',
answer.response, answer.weight
)
@api.get('/answers/{answer_id}', response_model=Answer)
async def get_answer(answer_id: int, conn: ConnectionUtil = get_conn) -> Answer:
return await conn.fetchrow(
'SELECT id, response, weight FROM eightball WHERE id=$1', answer_id
)
@api.patch('/answers/{answer_id}', response_model=Answer)
async def edit_answer(
answer_id: int, answer: PartialAnswer, conn: ConnectionUtil = get_conn
) -> Answer:
return await conn.fetchrow("""
UPDATE eightball SET
response=COALESCE($2, response),
weight=COALESCE($3, weight)
WHERE id=$1 RETURNING *;
""", answer_id, answer.response, answer.weight)
@api.delete('/answers/{answer_id}', response_model=Answer)
async def delete_answer(answer_id: int, conn: ConnectionUtil = get_conn) -> Answer:
return await conn.fetchrow('DELETE FROM eightball WHERE id=$1 RETURNING *;', answer_id)
@commands.command(name='8ball')
async def eightball(ctx, *, question: str = None):
await ctx.send(await get_random_response(ctx))
| 32.194444 | 91 | 0.715703 | [
"MIT"
] | Bluenix2/WinterBot | bot/extensions/misc/eight_ball.py | 2,318 | Python |
#!/usr/bin/env python3
import os
import subprocess
import sys
import serial
import numpy as np
import datetime
iterations = 1
def run(scheme, precomp_bitslicing, use_hardware_crypto):
os.system("make clean")
path = f"crypto_sign/{scheme}/m4"
binary = f"crypto_sign_{scheme}_m4_stack.bin"
if precomp_bitslicing:
precomp_bitslicing = 1
else:
precomp_bitslicing = 0
if use_hardware_crypto:
use_hardware_crypto = 1
else:
use_hardware_crypto = 0
subprocess.check_call(f"make PRECOMPUTE_BITSLICING={precomp_bitslicing} USE_HARDWARE_CRYPTO={use_hardware_crypto} IMPLEMENTATION_PATH={path} CRYPTO_ITERATIONS={iterations} bin/{binary}", shell=True)
os.system(f"./flash.sh bin/{binary}")
# get serial output and wait for '#'
with serial.Serial("/dev/ttyUSB0", 115200, timeout=20) as dev:
logs = []
iteration = 0
log = b""
while iteration < iterations:
device_output = dev.read()
sys.stdout.buffer.write(device_output)
sys.stdout.flush()
log += device_output
if device_output == b'#':
logs.append(log)
log = b""
iteration += 1
return logs
def parseLog(log, v):
log = log.decode(errors="ignore")
lines = str(log).splitlines()
v = int(lines[1+lines.index(v)])
return v
def printMacro(name, value):
value = f"{round(value):,}"
value = value.replace(",", "\\,")
return f"\\newcommand{{\\{name}}}{{{value}}}"
def e(logs, f, texname, v):
print("##########")
print(v)
logs = np.array([parseLog(log, v) for log in logs])
print(logs)
avgs = logs.mean()
print("avg=", avgs)
print("median=", np.median(logs))
print("max=", logs.max())
print("min=", logs.min())
print("var=", np.var(logs))
print("std=", np.std(logs))
print(printMacro(f"{texname}stack", int(avgs)), file=f)
f.flush()
def do_it(scheme, texname, precomp_bitslicing, use_hardware_crypto, f):
print(f"% {scheme}", file=f)
logs = run(scheme, precomp_bitslicing, use_hardware_crypto)
e([logs[0]], f, f"{texname}Keygen", "keypair stack usage:")
e(logs, f, f"{texname}Sign", "sign stack usage:")
e(logs, f, f"{texname}Verify", "verify stack usage:")
with open("stackbenchmarks.tex", "a") as f:
now = datetime.datetime.now()
print(f"% Benchmarks started at {now} (iterations={iterations})", file=f)
schemes = {
"rainbowI-classic" : "rainbowIclassic",
"rainbowI-classic-tweaked" : "rainbowIclassictweaked",
"rainbowI-circumzenithal" : "rainbowIcircumzenithal",
"rainbowI-circumzenithal-tweaked" : "rainbowIcircumzenithaltweaked",
"rainbowI-compressed" : "rainbowIcompressed",
"rainbowI-compressed-tweaked" : "rainbowIcompressedtweaked"
}
for scheme, texName in schemes.items():
for precomp in [True, False]:
if (scheme == "rainbowI-compressed" or scheme == "rainbowI-compressed-tweaked") and precomp:
continue
for hardware_crypto in [True, False]:
name = texName
if precomp:
name += "Precomp"
if hardware_crypto:
name += "HWCrypto"
do_it(scheme, name, precomp, hardware_crypto, f)
now = datetime.datetime.now()
print(f"% Benchmarks finished at {now} (iterations={iterations})", file=f)
| 30.229358 | 200 | 0.647648 | [
"CC0-1.0"
] | TobiasKovats/rainbowm4 | run_all_stack.py | 3,295 | Python |
# python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Core Acme interfaces.
This file specifies and documents the notions of `Actor` and `Learner`.
"""
import abc
import itertools
from typing import Generic, List, Optional, Sequence, TypeVar
from acme import types
# Internal imports.
from acme.utils import metrics
import dm_env
T = TypeVar('T')
@metrics.record_class_usage
class Actor(abc.ABC):
"""Interface for an agent that can act.
This interface defines an API for an Actor to interact with an EnvironmentLoop
(see acme.environment_loop), e.g. a simple RL loop where each step is of the
form:
# Make the first observation.
timestep = env.reset()
actor.observe_first(timestep.observation)
# Take a step and observe.
action = actor.select_action(timestep.observation)
next_timestep = env.step(action)
actor.observe(action, next_timestep)
# Update the actor policy/parameters.
actor.update()
"""
@abc.abstractmethod
def select_action(self, observation: types.NestedArray) -> types.NestedArray:
"""Samples from the policy and returns an action."""
@abc.abstractmethod
def observe_first(self, timestep: dm_env.TimeStep):
"""Make a first observation from the environment.
Note that this need not be an initial state, it is merely beginning the
recording of a trajectory.
Args:
timestep: first timestep.
"""
@abc.abstractmethod
def observe(
self,
action: types.NestedArray,
next_timestep: dm_env.TimeStep,
):
"""Make an observation of timestep data from the environment.
Args:
action: action taken in the environment.
next_timestep: timestep produced by the environment given the action.
"""
@abc.abstractmethod
def update(self, wait: bool = False):
"""Perform an update of the actor parameters from past observations.
Args:
wait: if True, the update will be blocking.
"""
# Internal class.
class VariableSource(abc.ABC):
"""Abstract source of variables.
Objects which implement this interface provide a source of variables, returned
as a collection of (nested) numpy arrays. Generally this will be used to
provide variables to some learned policy/etc.
"""
@abc.abstractmethod
def get_variables(self, names: Sequence[str]) -> List[types.NestedArray]:
"""Return the named variables as a collection of (nested) numpy arrays.
Args:
names: args where each name is a string identifying a predefined subset of
the variables.
Returns:
A list of (nested) numpy arrays `variables` such that `variables[i]`
corresponds to the collection named by `names[i]`.
"""
@metrics.record_class_usage
class Worker(abc.ABC):
"""An interface for (potentially) distributed workers."""
@abc.abstractmethod
def run(self):
"""Runs the worker."""
class Saveable(abc.ABC, Generic[T]):
"""An interface for saveable objects."""
@abc.abstractmethod
def save(self) -> T:
"""Returns the state from the object to be saved."""
@abc.abstractmethod
def restore(self, state: T):
"""Given the state, restores the object."""
class Learner(VariableSource, Worker, Saveable):
"""Abstract learner object.
This corresponds to an object which implements a learning loop. A single step
of learning should be implemented via the `step` method and this step
is generally interacted with via the `run` method which runs update
continuously.
All objects implementing this interface should also be able to take in an
external dataset (see acme.datasets) and run updates using data from this
dataset. This can be accomplished by explicitly running `learner.step()`
inside a for/while loop or by using the `learner.run()` convenience function.
Data will be read from this dataset asynchronously and this is primarily
useful when the dataset is filled by an external process.
"""
@abc.abstractmethod
def step(self):
"""Perform an update step of the learner's parameters."""
def run(self, num_steps: Optional[int] = None) -> None:
"""Run the update loop; typically an infinite loop which calls step."""
iterator = range(num_steps) if num_steps is not None else itertools.count()
for _ in iterator:
self.step()
def save(self):
raise NotImplementedError('Method "save" is not implemented.')
def restore(self, state):
raise NotImplementedError('Method "restore" is not implemented.')
| 29.670588 | 80 | 0.720658 | [
"Apache-2.0"
] | Idate96/acme | acme/core.py | 5,044 | Python |
from random import randrange
from autokeras.bayesian import SearchTree, contain
from autokeras.net_transformer import transform
from autokeras.search import Searcher
class RandomSearcher(Searcher):
""" Class to search for neural architectures using Random search strategy.
Attributes:
search_tree: The network morphism search tree
"""
def __init__(self, n_output_node, input_shape, path, metric, loss, generators, verbose,
trainer_args=None,
default_model_len=None,
default_model_width=None):
super(RandomSearcher, self).__init__(n_output_node, input_shape,
path, metric, loss, generators,
verbose, trainer_args, default_model_len,
default_model_width)
self.search_tree = SearchTree()
def generate(self, multiprocessing_queue):
"""Generate the next neural architecture.
Args:
multiprocessing_queue: the Queue for multiprocessing return value.
Returns:
list of 2-element tuples: generated_graph and other_info,
for random searcher the length of list is 1.
generated_graph: An instance of Graph.
other_info: Anything to be saved in the training queue together with the architecture.
"""
random_index = randrange(len(self.history))
model_id = self.history[random_index]['model_id']
graph = self.load_model_by_id(model_id)
new_father_id = None
generated_graph = None
for temp_graph in transform(graph):
if not contain(self.descriptors, temp_graph.extract_descriptor()):
new_father_id = model_id
generated_graph = temp_graph
break
if new_father_id is None:
new_father_id = 0
generated_graph = self.generators[0](self.n_classes, self.input_shape). \
generate(self.default_model_len, self.default_model_width)
return [(generated_graph, new_father_id)]
def update(self, other_info, model_id, *args):
""" Update the controller with evaluation result of a neural architecture.
Args:
other_info: Anything. In our case it is the father ID in the search tree.
model_id: An integer.
"""
father_id = other_info
self.search_tree.add_child(father_id, model_id) | 40.451613 | 98 | 0.631978 | [
"MIT"
] | Beomi/autokeras | nas/random.py | 2,508 | Python |
import cv2
from util.image_type import ColorImage
class VideoWriter:
"""
This class wraps a cv2.VideoWriter object,
preset some parameters so simpler to use.
"""
def __init__(self, video_path: str, fps: float = 10.0) -> None:
"""
Arguments:
video_path: The path to output the video.
fps: If higher than the writing rate, the video will be fast-forwarded.
"""
fourcc: int = cv2.VideoWriter_fourcc(*"mp4v")
self._video_writer = cv2.VideoWriter(video_path + ".mp4", fourcc, fps, (640, 480))
def write(self, image: ColorImage) -> None:
"""Writes the next video frame."""
self._video_writer.write(image)
def is_opened(self) -> bool:
"""Returns True if video writer has been successfully initialized."""
return self._video_writer.isOpend()
def release(self) -> None:
"""Closes the video writer."""
self._video_writer.release()
| 30.375 | 90 | 0.626543 | [
"MIT"
] | Lai-YT/webcam-applications | util/video_writer.py | 972 | Python |
"""
The automcomplete example rewritten for bottle / gevent.
- Requires besides bottle and gevent also the geventwebsocket pip package
- Instead of a future we create the inner stream for flat_map_latest manually
"""
from bottle import request, Bottle, abort
import gevent
from geventwebsocket import WebSocketError
from geventwebsocket.handler import WebSocketHandler
import json, requests
import rx3
from rx3.subject import Subject
from rx3.scheduler.eventloop import GEventScheduler
class WikiFinder:
tmpl = 'http://en.wikipedia.org/w/api.php'
tmpl += '?action=opensearch&search=%s&format=json'
def __init__(self, term):
self.res = r = gevent.event.AsyncResult()
gevent.spawn(lambda: requests.get(self.tmpl % term).text).link(r)
def subscribe(self, on_next, on_err, on_compl):
try:
self.res.get()
on_next(self.res.value)
except Exception as ex:
on_err(ex.args)
on_compl()
app, PORT = Bottle(), 8081
scheduler = GEventScheduler(gevent)
@app.route('/ws')
def handle_websocket():
wsock = request.environ.get('wsgi.websocket')
if not wsock:
abort(400, 'Expected WebSocket request.')
stream = Subject()
query = stream.map(
lambda x: x["term"]
).filter(
lambda text: len(text) > 2 # Only if text is longer than 2 characters
).debounce(
0.750, # Pause for 750ms
scheduler=scheduler
).distinct_until_changed() # Only if the value has changed
searcher = query.flat_map_latest(lambda term: WikiFinder(term))
def send_response(x):
wsock.on_next(x)
def on_error(ex):
print(ex)
searcher.subscribe(send_response, on_error)
while True:
try:
message = wsock.receive()
# like {'term': '<current textbox val>'}
obj = json.loads(message)
stream.on_next(obj)
except WebSocketError:
break
@app.route('/static/autocomplete.js')
def get_js():
# blatantly ignoring bottle's template engine:
return open('autocomplete.js').read().replace('8080', str(PORT))
@app.route('/')
def get_index():
return open("index.html").read()
if __name__ == '__main__':
h = ('0.0.0.0', PORT)
server = gevent.pywsgi.WSGIServer(h, app, handler_class=WebSocketHandler)
server.serve_forever()
| 26.886364 | 78 | 0.658495 | [
"MIT"
] | samiur/RxPY | examples/autocomplete/bottle_autocomplete.py | 2,366 | Python |
import pytest
from jina.drivers.rank import Chunk2DocRankDriver
from jina.executors.rankers import Chunk2DocRanker
from jina.hub.rankers.MaxRanker import MaxRanker
from jina.hub.rankers.MinRanker import MinRanker
from jina.proto import jina_pb2
class MockLengthRanker(Chunk2DocRanker):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.required_keys = {'length'}
def _get_score(self, match_idx, query_chunk_meta, match_chunk_meta, *args, **kwargs):
return match_idx[0][self.col_doc_id], match_chunk_meta[match_idx[0][self.col_chunk_id]]['length']
class SimpleChunk2DocRankDriver(Chunk2DocRankDriver):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@property
def exec_fn(self):
return self._exec_fn
def create_document_to_score():
# doc: 1
# |- chunk: 2
# | |- matches: (id: 4, parent_id: 40, score.value: 4),
# | |- matches: (id: 5, parent_id: 50, score.value: 5),
# |
# |- chunk: 3
# |- matches: (id: 6, parent_id: 60, score.value: 6),
# |- matches: (id: 7, parent_id: 70, score.value: 7)
doc = jina_pb2.Document()
doc.id = 1
for c in range(2):
chunk = doc.chunks.add()
chunk.id = doc.id + c + 1
for m in range(2):
match = chunk.matches.add()
match.id = 2 * chunk.id + m
match.parent_id = 10 * match.id
match.length = match.id
# to be used by MaxRanker and MinRanker
match.score.ref_id = chunk.id
match.score.value = match.id
return doc
def create_chunk_matches_to_score():
# doc: (id: 100, granularity=0)
# |- chunks: (id: 10)
# | |- matches: (id: 11, parent_id: 1, score.value: 2),
# | |- matches: (id: 12, parent_id: 1, score.value: 3),
# |- chunks: (id: 20)
# |- matches: (id: 21, parent_id: 2, score.value: 4),
# |- matches: (id: 22, parent_id: 2, score.value: 5)
doc = jina_pb2.Document()
doc.id = 100
doc.granularity = 0
num_matches = 2
for parent_id in range(1, 3):
chunk = doc.chunks.add()
chunk.id = parent_id * 10
chunk.granularity = doc.granularity + 1
for score_value in range(parent_id * 2, parent_id * 2 + num_matches):
match = chunk.matches.add()
match.granularity = chunk.granularity
match.parent_id = parent_id
match.score.value = score_value
match.score.ref_id = chunk.id
match.id = 10 * parent_id + score_value
match.length = 4
return doc
def create_chunk_chunk_matches_to_score():
# doc: (id: 100, granularity=0)
# |- chunk: (id: 101, granularity=1)
# |- chunks: (id: 10)
# | |- matches: (id: 11, parent_id: 1, score.value: 2),
# | |- matches: (id: 12, parent_id: 1, score.value: 3),
# |- chunks: (id: 20)
# |- matches: (id: 21, parent_id: 2, score.value: 4),
# |- matches: (id: 22, parent_id: 2, score.value: 5)
doc = jina_pb2.Document()
doc.id = 100
doc.granularity = 0
chunk = doc.chunks.add()
chunk.id = 101
chunk.granularity = doc.granularity + 1
num_matches = 2
for parent_id in range(1, 3):
chunk_chunk = chunk.chunks.add()
chunk_chunk.id = parent_id * 10
chunk_chunk.granularity = chunk.granularity + 1
for score_value in range(parent_id * 2, parent_id * 2 + num_matches):
match = chunk_chunk.matches.add()
match.parent_id = parent_id
match.score.value = score_value
match.score.ref_id = chunk_chunk.id
match.id = 10 * parent_id + score_value
match.length = 4
return doc
def test_chunk2doc_ranker_driver_mock_exec():
doc = create_document_to_score()
driver = SimpleChunk2DocRankDriver()
executor = MockLengthRanker()
driver.attach(executor=executor, pea=None)
driver._apply_all(doc.chunks, doc)
assert len(doc.matches) == 4
assert doc.matches[0].id == 70
assert doc.matches[0].score.value == 7
assert doc.matches[1].id == 60
assert doc.matches[1].score.value == 6
assert doc.matches[2].id == 50
assert doc.matches[2].score.value == 5
assert doc.matches[3].id == 40
assert doc.matches[3].score.value == 4
for match in doc.matches:
# match score is computed w.r.t to doc.id
assert match.score.ref_id == doc.id
def test_chunk2doc_ranker_driver_max_ranker():
doc = create_document_to_score()
driver = SimpleChunk2DocRankDriver()
executor = MaxRanker()
driver.attach(executor=executor, pea=None)
driver._apply_all(doc.chunks, doc)
assert len(doc.matches) == 4
assert doc.matches[0].id == 70
assert doc.matches[0].score.value == 7
assert doc.matches[1].id == 60
assert doc.matches[1].score.value == 6
assert doc.matches[2].id == 50
assert doc.matches[2].score.value == 5
assert doc.matches[3].id == 40
assert doc.matches[3].score.value == 4
for match in doc.matches:
# match score is computed w.r.t to doc.id
assert match.score.ref_id == doc.id
def test_chunk2doc_ranker_driver_min_ranker():
doc = create_document_to_score()
driver = SimpleChunk2DocRankDriver()
executor = MinRanker()
driver.attach(executor=executor, pea=None)
driver._apply_all(doc.chunks, doc)
assert len(doc.matches) == 4
assert doc.matches[0].id == 40
assert doc.matches[0].score.value == pytest.approx(1 / (1 + 4), 0.0001)
assert doc.matches[1].id == 50
assert doc.matches[1].score.value == pytest.approx(1 / (1 + 5), 0.0001)
assert doc.matches[2].id == 60
assert doc.matches[2].score.value == pytest.approx(1 / (1 + 6), 0.0001)
assert doc.matches[3].id == 70
assert doc.matches[3].score.value == pytest.approx(1 / (1 + 7), 0.0001)
for match in doc.matches:
# match score is computed w.r.t to doc.id
assert match.score.ref_id == doc.id
def test_chunk2doc_ranker_driver_traverse_apply():
docs = [create_chunk_matches_to_score(), ]
driver = SimpleChunk2DocRankDriver(recur_range=(0, 1))
executor = MinRanker()
driver.attach(executor=executor, pea=None)
driver._traverse_apply(docs)
for doc in docs:
assert len(doc.matches) == 2
for idx, m in enumerate(doc.matches):
# the score should be 1 / (1 + id * 2)
assert m.score.value == pytest.approx(1. / (1 + m.id * 2.), 0.0001)
def test_chunk2doc_ranker_driver_traverse_apply_larger_range():
docs = [create_chunk_chunk_matches_to_score(), ]
driver = SimpleChunk2DocRankDriver(granularity_range=(0, 2))
executor = MinRanker()
driver.attach(executor=executor, pea=None)
driver._traverse_apply(docs)
for doc in docs:
assert len(doc.matches) == 1
assert len(doc.chunks) == 1
chunk = doc.chunks[0]
assert len(chunk.matches) == 2
min_granularity_2 = chunk.matches[0].score.value
for idx, m in enumerate(chunk.matches):
# the score should be 1 / (1 + id * 2)
if m.score.value < min_granularity_2:
min_granularity_2 = m.score.value
assert m.score.value == pytest.approx(1. / (1 + m.id * 2.), 0.0001)
assert m.score.ref_id == 101
match = doc.matches[0]
assert match.score.ref_id == 100
assert match.score.value == pytest.approx(1. / (1 + min_granularity_2), 0.0001)
| 36.790244 | 105 | 0.620525 | [
"Apache-2.0"
] | DavidSanwald/jina | tests/unit/drivers/test_chunk2doc_rank_drivers.py | 7,542 | Python |
import os
import sys
import numpy as np
import pandas as pd
import random
from tqdm import tqdm
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
import torch.nn.functional as F
import albumentations as A
from albumentations.pytorch.transforms import ToTensorV2
from dataset import MelanomaDataset
from modules import ResNetModel, EfficientModel, Model
import time
""" Initialization"""
SEED = 45
resolution = 320 # orignal res for B5
input_res = 512
DEBUG = False
# test = '../data_256/test'
test ='../data_merged_512/512x512-test/512x512-test'
labels = '../data/test.csv'
# train_labels = '../data/train_combined.csv'
sample = '../data/sample_submission.csv'
# external = '../data/external_mal.csv'
def seed_everything(seed):
random.seed(seed)
os.environ['PYTHONHASHSEED'] = str(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
# torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
seed_everything(SEED)
train_on_gpu = torch.cuda.is_available()
if not train_on_gpu:
print("CUDA is not available. Testing on CPU...")
else:
print("CUDA is available. Testing on GPU...")
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
df = pd.read_csv(labels)
df=df.rename(columns = {'image_name':'image_id'})
# df_train = pd.read_csv(train_labels)
# df_ext = pd.read_csv(external)
# df_train = pd.concat([df_train, df_ext], ignore_index=True)
""" Normalizing Meta features"""
## Sex Features
df['sex'] = df['sex'].map({'male': 1, 'female': 0})
df["sex"] = df["sex"].fillna(-1)
## Age Features
df["age_approx"] /= df["age_approx"].max()
df['age_approx'] = df['age_approx'].fillna(0)
meta_features = ['sex', 'age_approx']
print(df.head())
print("Previous Length", len(df))
if DEBUG:
df = df[:100]
print("Usable Length", len(df))
""" Dataset """
# test_transform=transforms.Compose([
# # transforms.Resize((256,256)),
# transforms.ToTensor(),
# transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[
# 0.229, 0.224, 0.225])])
test_transform = A.Compose([
A.JpegCompression(p=0.5),
A.RandomSizedCrop(min_max_height=(int(resolution*0.9), int(resolution*1.1)),
height=resolution, width=resolution, p=1.0),
A.HorizontalFlip(p=0.5),
A.VerticalFlip(p=0.5),
A.Transpose(p=0.5),
A.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
ToTensorV2(),
], p=1.0)
t_dataset=MelanomaDataset(df=df, imfolder=test,
train=False, transforms=test_transform, meta_features=meta_features)
print('Length of test set is {}'.format(len(t_dataset)))
testloader=DataLoader(t_dataset, batch_size=8, shuffle=False, num_workers=8)
"""Testing"""
# model = ResNetModel()()
# model = EfficientModel()
# model = EfficientModel(n_meta_features=len(meta_features))
model = Model(arch='efficientnet-b1')
# model.load_state_dict(torch.load("../checkpoint/fold_1/efficient_256/efficientb0_256_14_0.9212.pth", map_location=torch.device(device)))
model.load_state_dict(torch.load("..//checkpoint/fold_1/efficient_320/efficientb1_320_14_0.9293.pth", map_location=torch.device(device)))
model.to(device)
model.eval()
test_prob_stack = []
img_ids = []
with torch.no_grad():
for i in range(15):
test_prob = []
for img, meta, img_id in tqdm(testloader):
if train_on_gpu:
img, meta = img.to(device), meta.to(device)
logits = model.forward(img)
pred = logits.sigmoid().detach().cpu()
test_prob.append(pred)
if i == 0:
img_ids.append(img_id)
test_prob = torch.cat(test_prob).cpu()
test_prob_stack.append(test_prob)
test_prob_stack = torch.stack([test_prob_stack[0], test_prob_stack[1], test_prob_stack[2], test_prob_stack[3], test_prob_stack[4], test_prob_stack[5], test_prob_stack[6], test_prob_stack[7], test_prob_stack[8], test_prob_stack[9], test_prob_stack[10], test_prob_stack[11], test_prob_stack[12], test_prob_stack[13], test_prob_stack[14]], dim=0)
test_prob_avg = torch.mean(test_prob_stack, dim=0).numpy()
test_prob_avg = np.concatenate(test_prob_avg, axis=None)
img_ids = np.concatenate(img_ids, axis=None)
sub_df = pd.DataFrame({'image_name': img_ids, 'target': test_prob_avg})
sub_df.to_csv('../submission/submission_b1_320.csv', index=False)
print(sub_df.head())
# print(test_prob_avg)
# sub = pd.read_csv(sample)
# sub['target'] = test_prob_avg.reshape(-1,)
# sub.to_csv('../submission/submission_15.csv', index=False)
| 30.638037 | 343 | 0.653584 | [
"MIT"
] | SumanSudhir/Kaggle-SIIM-ISIC-Melanoma-Classification | src/test.py | 4,994 | Python |
import sublime
import os
import queue
import unittest
import unittesting
import tempfile
from Tutkain.api import edn
from Tutkain.src import repl
from Tutkain.src.repl import formatter
from Tutkain.src import base64
from Tutkain.src import test
from .mock import JvmBackchannelServer, JvmServer
from .util import PackageTestCase
def select_keys(d, ks):
return {k: d[k] for k in ks}
def input(val):
return edn.kwmap({"tag": edn.Keyword("in"), "val": val})
def ret(val):
return edn.kwmap({"tag": edn.Keyword("ret"), "val": val})
class TestJVMClient(PackageTestCase):
@classmethod
def setUpClass(self):
super().setUpClass()
self.window = sublime.active_window()
server = JvmBackchannelServer().start()
self.client = repl.JVMClient(server.host, server.port)
self.output_view = repl.views.get_or_create_view(self.window, "view")
repl.start(self.output_view, self.client)
self.server = server.connection.result(timeout=5)
self.client.printq.get(timeout=5)
self.addClassCleanup(repl.stop, self.window)
self.addClassCleanup(self.server.backchannel.stop)
self.addClassCleanup(self.server.stop)
def get_print(self):
return self.client.printq.get(timeout=5)
#@unittest.SkipTest
def test_eval_context_file(self):
file = os.path.join(tempfile.gettempdir(), "my.clj")
self.view.retarget(file)
self.set_view_content("(inc 1)")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"scope": "outermost"})
self.assertEquals(input("(inc 1)\n"), self.get_print())
self.eval_context(file=file)
self.assertEquals("(inc 1)\n", self.server.recv())
self.server.send("2")
self.assertEquals(ret("2\n"), self.get_print())
#@unittest.SkipTest
def test_outermost(self):
self.set_view_content("(comment (inc 1) (inc 2))")
self.set_selections((9, 9), (17, 17))
self.view.run_command("tutkain_evaluate", {"scope": "outermost"})
self.assertEquals(input("(inc 1)\n"), self.get_print())
self.eval_context(column=10)
self.assertEquals(input("(inc 2)\n"), self.get_print())
self.eval_context(column=18)
self.assertEquals("(inc 1)\n", self.server.recv())
self.server.send("2")
self.assertEquals("(inc 2)\n", self.server.recv())
self.server.send("3")
self.assertEquals(ret("2\n"), self.get_print())
self.assertEquals(ret("3\n"), self.get_print())
#@unittest.SkipTest
def test_outermost_empty(self):
self.set_view_content("")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"scope": "outermost"})
self.assertRaises(queue.Empty, lambda: self.server.recvq.get_nowait())
#@unittest.SkipTest
def test_innermost(self):
self.set_view_content("(map inc (range 10))")
self.set_selections((9, 9))
self.view.run_command("tutkain_evaluate", {"scope": "innermost"})
self.assertEquals(input("(range 10)\n"), self.get_print())
self.eval_context(column=10)
self.assertEquals("(range 10)\n", self.server.recv())
self.server.send("(0 1 2 3 4 5 6 7 8 9)")
self.assertEquals(ret("(0 1 2 3 4 5 6 7 8 9)\n"), self.get_print())
#@unittest.SkipTest
def test_empty_string(self):
self.set_view_content(" ")
self.set_selections((0, 1))
self.view.run_command("tutkain_evaluate", {"scope": "innermost"})
self.assertRaises(queue.Empty, lambda: self.client.printq.get_nowait())
self.assertRaises(queue.Empty, lambda: self.server.recvq.get_nowait())
self.assertRaises(queue.Empty, lambda: self.server.backchannel.recvq.get_nowait())
#@unittest.SkipTest
def test_form(self):
self.set_view_content("42 84")
self.set_selections((0, 0), (3, 3))
self.view.run_command("tutkain_evaluate", {"scope": "form"})
self.assertEquals(input("42\n"), self.get_print())
self.eval_context()
self.assertEquals(input("84\n"), self.get_print())
self.eval_context(column=4)
self.assertEquals("42\n", self.server.recv())
self.server.send("42")
self.assertEquals(ret("42\n"), self.get_print())
self.assertEquals("84\n", self.server.recv())
self.server.send("84")
self.assertEquals(ret("84\n"), self.get_print())
#@unittest.SkipTest
def test_ns_variable(self):
self.set_view_content("(ns foo.bar)")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"code": "(in-ns '${ns})"})
self.assertEquals(input("(in-ns 'foo.bar)\n"), self.get_print())
self.eval_context(ns=edn.Symbol("foo.bar"))
self.assertEquals("(in-ns 'foo.bar)\n", self.server.recv())
self.server.send("""#object[clojure.lang.Namespace 0x4a1c0752 "foo.bar"]""")
self.assertEquals(ret("""#object[clojure.lang.Namespace 0x4a1c0752 "foo.bar"]\n"""), self.get_print())
#@unittest.SkipTest
def test_file_variable(self):
file = os.path.join(tempfile.gettempdir(), "my.clj")
self.view.retarget(file)
self.set_view_content("(inc 1)")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"code": """((requiring-resolve 'cognitect.transcriptor/run) "${file}")"""})
self.assertEquals(input(f"""((requiring-resolve 'cognitect.transcriptor/run) "{file}")\n"""), self.get_print())
self.eval_context(file=file)
self.assertEquals(f"""((requiring-resolve 'cognitect.transcriptor/run) "{file}")\n""", self.server.recv())
self.server.send("nil")
self.assertEquals(ret("nil\n"), self.get_print())
#@unittest.SkipTest
def test_parameterized(self):
self.set_view_content("{:a 1} {:b 2}")
self.set_selections((0, 0), (7, 7))
self.view.run_command("tutkain_evaluate", {"code": "((requiring-resolve 'clojure.data/diff) $0 $1)"})
self.assertEquals(input("((requiring-resolve 'clojure.data/diff) {:a 1} {:b 2})\n"), self.get_print())
self.eval_context()
self.assertEquals("((requiring-resolve 'clojure.data/diff) {:a 1} {:b 2})\n", self.server.recv())
self.server.send("({:a 1} {:b 2} nil)")
self.assertEquals(ret("({:a 1} {:b 2} nil)\n"), self.get_print())
#@unittest.SkipTest
def test_eval_in_ns(self):
self.view.run_command("tutkain_evaluate", {"code": "(reset)", "ns": "foo.bar"})
self.assertEquals(input("(reset)\n"), self.get_print())
self.eval_context(ns=edn.Symbol("foo.bar"))
self.assertEquals("(reset)\n", self.server.recv())
self.server.send("nil")
self.assertEquals(ret("nil\n"), self.get_print())
#@unittest.SkipTest
def test_ns(self):
self.set_view_content("(ns foo.bar) (ns baz.quux) (defn x [y] y)")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"scope": "ns"})
self.assertEquals(input("(ns foo.bar)\n"), self.get_print())
self.eval_context(ns=edn.Symbol("foo.bar"))
self.assertEquals(input("(ns baz.quux)\n"), self.get_print())
# TODO: ns here is unintuitive, should be baz.quux maybe?
self.eval_context(column=14, ns=edn.Symbol("foo.bar"))
self.assertEquals("(ns foo.bar)\n", self.server.recv())
self.assertEquals("(ns baz.quux)\n", self.server.recv())
self.server.send("nil") # foo.bar
self.assertEquals(ret("nil\n"), self.get_print())
self.server.send("nil") # baz.quux
self.assertEquals(ret("nil\n"), self.get_print())
#@unittest.SkipTest
def test_view(self):
self.set_view_content("(ns foo.bar) (defn x [y] y)")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"scope": "view"})
message = edn.read(self.server.backchannel.recv())
id = message.get(edn.Keyword("id"))
self.assertEquals({
edn.Keyword("op"): edn.Keyword("load"),
edn.Keyword("code"): base64.encode("(ns foo.bar) (defn x [y] y)".encode("utf-8")),
edn.Keyword("file"): None,
edn.Keyword("id"): id
}, message)
response = edn.kwmap({"id": id, "tag": edn.Keyword("ret"), "val": "nil"})
self.server.backchannel.send(response)
#@unittest.SkipTest
def test_view_syntax_error(self):
self.set_view_content("(ns foo.bar) (defn x [y] y") # missing close paren
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"scope": "view"})
message = edn.read(self.server.backchannel.recv())
id = message.get(edn.Keyword("id"))
self.assertEquals({
edn.Keyword("op"): edn.Keyword("load"),
edn.Keyword("code"): base64.encode("(ns foo.bar) (defn x [y] y".encode("utf-8")),
edn.Keyword("file"): None,
edn.Keyword("id"): id
}, message)
# Can't be bothered to stick a completely realistic exception map
# here, this'll do
ex_message = """{:via [{:type clojure.lang.Compiler$CompilerException, :message "Syntax error reading source at (NO_SOURCE_FILE)"}]}"""
response = edn.kwmap({
"id": id,
"tag": edn.Keyword("ret"),
"val": ex_message,
"exception": True
})
self.server.backchannel.send(response)
self.assertEquals(response, self.get_print())
#@unittest.SkipTest
def test_view_common(self):
self.view.assign_syntax("Packages/Tutkain/Clojure Common (Tutkain).sublime-syntax")
self.set_view_content("(ns baz.quux) (defn x [y] y)")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"scope": "view"})
message = edn.read(self.server.backchannel.recv())
id = message.get(edn.Keyword("id"))
self.assertEquals({
edn.Keyword("op"): edn.Keyword("load"),
edn.Keyword("code"): base64.encode("(ns baz.quux) (defn x [y] y)".encode("utf-8")),
edn.Keyword("file"): None,
edn.Keyword("id"): id
}, message)
response = edn.kwmap({"id": id, "tag": edn.Keyword("ret"), "val": "#'baz.quux/x"})
self.server.backchannel.send(response)
#@unittest.SkipTest
def test_discard(self):
self.set_view_content("#_(inc 1)")
self.set_selections((2, 2))
self.view.run_command("tutkain_evaluate", {"scope": "innermost"})
self.assertEquals(input("(inc 1)\n"), self.get_print())
self.eval_context(column=3)
self.assertEquals("(inc 1)\n", self.server.recv())
self.server.send("2")
self.assertEquals(ret("2\n"), self.get_print())
self.set_view_content("#_(inc 1)")
self.set_selections((2, 2))
self.view.run_command("tutkain_evaluate", {"scope": "outermost"})
self.assertEquals(input("(inc 1)\n"), self.get_print())
self.eval_context(column=3)
self.assertEquals("(inc 1)\n", self.server.recv())
self.server.send("2")
self.assertEquals(ret("2\n"), self.get_print())
self.set_view_content("(inc #_(dec 2) 4)")
self.set_selections((14, 14))
self.view.run_command("tutkain_evaluate", {"scope": "innermost"})
self.assertEquals(input("(dec 2)\n"), self.get_print())
self.eval_context(column=8)
self.assertEquals("(dec 2)\n", self.server.recv())
self.server.send("1")
self.assertEquals(ret("1\n"), self.get_print())
self.set_view_content("#_:a")
self.set_selections((2, 2))
self.view.run_command("tutkain_evaluate", {"scope": "form"})
self.assertEquals(input(":a\n"), self.get_print())
self.eval_context(column=3)
self.assertEquals(":a\n", self.server.recv())
self.server.send(":a")
self.assertEquals(ret(":a\n"), self.get_print())
#@unittest.SkipTest
def test_lookup(self):
self.set_view_content("(rand)")
for n in range(1, 5):
self.set_selections((n, n))
self.view.run_command("tutkain_show_information", {
"selector": "variable.function"
})
response = edn.read(self.server.backchannel.recv())
self.assertEquals({
edn.Keyword("op"): edn.Keyword("lookup"),
edn.Keyword("ident"): "rand",
edn.Keyword("ns"): None,
edn.Keyword("dialect"): edn.Keyword("clj"),
edn.Keyword("id"): response.get(edn.Keyword("id"))
}, response)
#@unittest.SkipTest
def test_lookup_var(self):
self.set_view_content("#'foo/bar")
for n in range(0, 9):
self.set_selections((n, n))
self.view.run_command("tutkain_show_information")
response = edn.read(self.server.backchannel.recv())
self.assertEquals({
edn.Keyword("op"): edn.Keyword("lookup"),
edn.Keyword("ident"): "foo/bar",
edn.Keyword("ns"): None,
edn.Keyword("dialect"): edn.Keyword("clj"),
edn.Keyword("id"): response.get(edn.Keyword("id"))
}, response)
#@unittest.SkipTest
def test_lookup_head(self):
self.set_view_content("(map inc )")
self.set_selections((9, 9))
self.view.run_command("tutkain_show_information", {
"selector": "variable.function",
"seek_backward": True
})
response = edn.read(self.server.backchannel.recv())
self.assertEquals({
edn.Keyword("op"): edn.Keyword("lookup"),
edn.Keyword("ident"): "map",
edn.Keyword("ns"): None,
edn.Keyword("dialect"): edn.Keyword("clj"),
edn.Keyword("id"): response.get(edn.Keyword("id"))
}, response)
# @unittest.SkipTest
# def test_issue_46(self):
# n = io.DEFAULT_BUFFER_SIZE + 1024
# code = """(apply str (repeat {n} "x"))"""
# self.set_view_content(code)
# self.set_selections((0, 0))
# self.view.run_command("tutkain_evaluate", {"scope": "innermost"})
# self.eval_context()
# self.assertEquals(f"user=> {code}\n", self.get_print())
# self.assertEquals(code + "\n", self.server.recv())
# response = "x" * n
# self.server.send(response)
# chunks = [
# response[i:i + io.DEFAULT_BUFFER_SIZE] for i in range(0, len(response), io.DEFAULT_BUFFER_SIZE)
# ]
# for chunk in chunks[:-1]:
# self.assertEquals(chunk, self.get_print())
# self.assertEquals(chunks[-1] + "\n", self.get_print())
#@unittest.SkipTest
def test_evaluate_dialect(self):
self.view.run_command("tutkain_evaluate", {"code": "(random-uuid)", "dialect": "cljs"})
# The server and the client receive no messages because the evaluation
# uses a different dialect than the server.
self.assertRaises(queue.Empty, lambda: self.client.printq.get_nowait())
self.assertRaises(queue.Empty, lambda: self.server.recvq.get_nowait())
self.view.run_command("tutkain_evaluate", {"code": """(Integer/parseInt "42")""", "dialect": "clj"})
self.assertEquals(input("""(Integer/parseInt "42")\n"""), self.get_print())
self.eval_context()
self.assertEquals("""(Integer/parseInt "42")\n""", self.server.recv())
self.server.send("""42""")
self.assertEquals(ret("""42\n"""), self.get_print())
#@unittest.SkipTest
def test_async_run_tests_ns(self):
code = """
(ns my.app
(:require [clojure.test :refer [deftest is]]))
(deftest my-test
(is (= 2 (+ 1 1))))
"""
self.set_view_content(code)
self.view.run_command("tutkain_run_tests", {"scope": "ns"})
message = edn.read(self.server.backchannel.recv())
id = message.get(edn.Keyword("id"))
self.assertEquals(edn.kwmap({
"op": edn.Keyword("test"),
"file": None,
"ns": "my.app",
"vars": [],
"code": base64.encode(code.encode("utf-8")),
"id": id
}), message)
response = edn.kwmap({
"id": id,
"tag": edn.Keyword("ret"),
"val": "{:test 1, :pass 1, :fail 0, :error 0, :assert 1, :type :summary}",
"pass": [edn.kwmap({
"type": edn.Keyword("pass"),
"line": 5,
"var-meta": edn.kwmap({
"line": 4,
"column": 1,
"file": "NO_SOURCE_FILE",
"name": edn.Symbol("my-test"),
"ns": "my.app"
})
})],
"fail": [],
"error": []
})
self.server.backchannel.send(response)
yield unittesting.AWAIT_WORKER # Why?
self.assertEquals(
[sublime.Region(78, 78)],
test.regions(self.view, "passes")
)
self.assertFalse(test.regions(self.view, "fail"))
self.assertFalse(test.regions(self.view, "error"))
#@unittest.SkipTest
def test_run_tests_view_error(self):
code = """
(ns my.app
(:require [clojure.test :refer [deftest is]]))
(deftest my-test
(is (= foo (+ 1 1))))
"""
self.set_view_content(code)
self.view.run_command("tutkain_run_tests", {"scope": "ns"})
message = edn.read(self.server.backchannel.recv())
id = message.get(edn.Keyword("id"))
self.assertEquals(edn.kwmap({
"op": edn.Keyword("test"),
"file": None,
"ns": "my.app",
"vars": [],
"code": base64.encode(code.encode("utf-8")),
"id": id
}), message)
response = edn.kwmap({
"id": id,
"tag": edn.Keyword("ret"),
"val": """{:via [{:type clojure.lang.Compiler$CompilerException, :message "Syntax error compiling at (NO_SOURCE_FILE:5:3).", :data #:clojure.error{:phase :compile-syntax-check, :line 5, :column 3, :source "NO_SOURCE_FILE"}, :at [clojure.lang.Compiler analyze "Compiler.java" 6812]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: foo in this context", :at [clojure.lang.Util runtimeException "Util.java" 221]}], :trace [[clojure.lang.Util runtimeException "Util.java" 221] [clojure.lang.Compiler resolveIn "Compiler.java" 7418] [clojure.lang.Compiler resolve "Compiler.java" 7362]], :cause "Unable to resolve symbol: foo in this context", :phase :execution}""",
"exception": True
})
self.server.backchannel.send(response)
yield unittesting.AWAIT_WORKER # Why?
self.assertFalse(test.regions(self.view, "passes"))
self.assertFalse(test.regions(self.view, "fail"))
self.assertFalse(test.regions(self.view, "error"))
self.assertEquals(response, self.get_print())
#@unittest.SkipTest
def test_async_unsuccessful_tests(self):
code = """
(ns my.app
(:require [clojure.test :refer [deftest is]]))
(deftest my-test
(is (= 3 (+ 1 1))))
"""
self.set_view_content(code)
self.view.run_command("tutkain_run_tests", {"scope": "ns"})
response = edn.read(self.server.backchannel.recv())
id = response.get(edn.Keyword("id"))
self.assertEquals(edn.kwmap({
"op": edn.Keyword("test"),
"file": None,
"ns": "my.app",
"vars": [],
"code": base64.encode(code.encode("utf-8")),
"id": id
}), response)
response = edn.kwmap({
"id": id,
"tag": edn.Keyword("ret"),
"val": "{:test 1, :pass 0, :fail 1, :error 0, :assert 1, :type :summary}",
"pass": [],
"fail": [edn.kwmap({
"file": None,
"type": edn.Keyword("fail"),
"line": 5,
"expected": "3\\n",
"actual": "2\\n",
"message": None,
"var-meta": edn.kwmap({
"line": 4,
"column": 1,
"file": "NO_SOURCE_FILE",
"name": edn.Symbol("my-test"),
"ns": "my.app"
})
})],
"error": []
})
self.server.backchannel.send(response)
yield unittesting.AWAIT_WORKER # Why?
self.assertEquals(
[sublime.Region(78, 78)],
test.regions(self.view, "failures")
)
self.assertEquals(
[{"name": "my-test", "region": [78, 78], "type": "fail"}],
test.unsuccessful(self.view)
)
self.assertFalse(test.regions(self.view, "passes"))
self.assertFalse(test.regions(self.view, "error"))
#@unittest.SkipTest
def test_apropos(self):
self.view.window().run_command("tutkain_apropos", {"pattern": "cat"})
op = edn.read(self.server.backchannel.recv())
id = op.get(edn.Keyword("id"))
self.assertEquals(edn.kwmap({
"op": edn.Keyword("apropos"),
"id": id,
"pattern": "cat"
}), op)
# TODO: This is not useful at the moment. How do we test things like
# this that go into a quick panel and not in the REPL view? Should
# they also go through printq (or equivalent)?
self.server.backchannel.send(edn.kwmap({
"vars": [edn.kwmap({
"name": edn.Symbol("cat"),
"file": "jar:file:/home/.m2/repository/org/clojure/clojure/1.11.0-alpha1/clojure-1.11.0-alpha1.jar!/clojure/core.clj",
"column": 1,
"line": 7644,
"arglists": ["[rf]"],
"doc": ["A transducer which concatenates the contents of each input, which must be a\\n collection, into the reduction."],
"type": "function",
"ns": "clojure.core"
})]
}))
print(self.get_print())
#@unittest.SkipTest
def test_evaluate_to_clipboard(self):
self.set_view_content("(inc 1)")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"scope": "outermost", "output": "clipboard"})
self.assertEquals(input("(inc 1)\n"), self.get_print())
# Client sends eval context over backchannel
eval_context = edn.read(self.server.backchannel.recv())
self.assertEquals(
edn.kwmap({
"op": edn.Keyword("set-eval-context"),
"file": "NO_SOURCE_FILE",
"line": 1,
"column": 1,
"response": edn.kwmap({
"output": edn.Keyword("clipboard")
}),
}),
select_keys(eval_context, [
edn.Keyword("op"),
edn.Keyword("file"),
edn.Keyword("line"),
edn.Keyword("column"),
edn.Keyword("response")
])
)
# Backchannel sends eval context response
self.server.backchannel.send(edn.kwmap({
"id": eval_context.get(edn.Keyword("id")),
"result": edn.Keyword("ok")
}))
# Client sends code string over eval channel
self.assertEquals("(inc 1)\n", self.server.recv())
# Server sends response over backchannel
response = edn.kwmap({
"output": edn.Keyword("clipboard"),
"tag": edn.Keyword("ret"),
"string": "2",
"val": "2\n",
})
self.server.backchannel.send(response)
self.assertEquals(response, self.get_print())
#@unittest.SkipTest
def test_evaluate_to_inline(self):
self.set_view_content("(inc 1)")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"scope": "outermost", "inline_result": True})
self.assertEquals(input("(inc 1)\n"), self.get_print())
# Client sends eval context over backchannel
eval_context = edn.read(self.server.backchannel.recv())
self.assertEquals(
edn.kwmap({
"op": edn.Keyword("set-eval-context"),
"file": "NO_SOURCE_FILE",
"line": 1,
"column": 1,
"response": edn.kwmap({
"point": 7,
"output": edn.Keyword("inline"),
"view-id": self.view.id()
}),
}),
select_keys(eval_context, [
edn.Keyword("op"),
edn.Keyword("file"),
edn.Keyword("line"),
edn.Keyword("column"),
edn.Keyword("response")
])
)
# Backchannel sends eval context response
self.server.backchannel.send(edn.kwmap({
"id": eval_context.get(edn.Keyword("id")),
"result": edn.Keyword("ok")
}))
# Client sends code string over eval channel
self.assertEquals("(inc 1)\n", self.server.recv())
view_id = eval_context.get(edn.Keyword("response")).get(edn.Keyword("view-id"))
# Server sends response over backchannel
response = edn.kwmap({
"tag": edn.Keyword("ret"),
"val": "2",
"output": eval_context.get(edn.Keyword("response")).get(edn.Keyword("output")),
"view-id": view_id,
"point": 7
})
self.server.backchannel.send(response)
self.assertEquals(response, self.get_print())
#@unittest.SkipTest
def test_evaluate_code_to_inline(self):
self.set_view_content("(inc 1)")
self.set_selections((7, 7))
self.view.run_command("tutkain_evaluate", {"code": "(inc 1)", "inline_result": True})
self.assertEquals(input("(inc 1)\n"), self.get_print())
# Client sends eval context over backchannel
eval_context = edn.read(self.server.backchannel.recv())
self.assertEquals(
edn.kwmap({
"op": edn.Keyword("set-eval-context"),
"file": "NO_SOURCE_FILE",
"line": 1,
"column": 1,
"response": edn.kwmap({
"point": 7,
"output": edn.Keyword("inline"),
"view-id": self.view.id()
}),
}),
select_keys(eval_context, [
edn.Keyword("op"),
edn.Keyword("file"),
edn.Keyword("line"),
edn.Keyword("column"),
edn.Keyword("response")
])
)
# Backchannel sends eval context response
self.server.backchannel.send(edn.kwmap({
"id": eval_context.get(edn.Keyword("id")),
"result": edn.Keyword("ok")
}))
# Client sends code string over eval channel
self.assertEquals("(inc 1)\n", self.server.recv())
view_id = eval_context.get(edn.Keyword("response")).get(edn.Keyword("view-id"))
# Server sends response over backchannel
response = edn.kwmap({
"tag": edn.Keyword("ret"),
"val": "2",
"output": eval_context.get(edn.Keyword("response")).get(edn.Keyword("output")),
"view-id": view_id,
"point": 7
})
self.server.backchannel.send(response)
self.assertEquals(response, self.get_print())
class TestNoBackchannelJVMClient(PackageTestCase):
@classmethod
def setUpClass(self):
super().setUpClass()
self.window = sublime.active_window()
server = JvmServer().start()
self.client = repl.JVMClient(server.host, server.port, options={"backchannel": {"enabled": False}})
self.output_view = repl.views.get_or_create_view(self.window, "view")
repl.start(self.output_view, self.client)
self.server = server.connection.result(timeout=5)
self.client.printq.get(timeout=5) # Swallow the initial prompt
self.addClassCleanup(repl.stop, self.window)
self.addClassCleanup(self.server.stop)
def get_print(self):
return self.client.printq.get(timeout=5)
#@unittest.SkipTest
def test_outermost(self):
self.set_view_content("(map inc (range 10))")
self.set_selections((0, 0))
self.view.run_command("tutkain_evaluate", {"scope": "outermost"})
self.assertEquals(input("(map inc (range 10))\n"), self.get_print())
self.assertEquals("(map inc (range 10))\n", self.server.recv())
self.server.send("(1 2 3 4 5 6 7 8 9 10)")
self.assertEquals(ret("(1 2 3 4 5 6 7 8 9 10)\n"), self.get_print())
| 38.156658 | 696 | 0.562166 | [
"Apache-2.0"
] | eerohele/disjure | tests/test_client_jvm.py | 29,228 | Python |
import os
import re
import sys
import json
import glob
import hashlib
import requests
import concurrent.futures as futures
from tqdm import tqdm
from zipfile import ZipFile
from datetime import datetime
from abd_model.core import load_config, Logs
from abd_model.tiles import tiles_from_csv, tiles_to_granules
def add_parser(subparser, formatter_class):
parser = subparser.add_parser("sat", help="Retrieve Satellite Scenes", formatter_class=formatter_class)
parser.add_argument("--config", type=str, help="path to config file [required]")
parser.add_argument("--pg", type=str, help="If set, override config PostgreSQL dsn.")
extent = parser.add_argument_group("Spatial extent [one among the following is required]")
extent.add_argument("--cover", type=str, help="path to csv tiles cover file")
extent.add_argument("--granules", type=str, nargs="+", help="Military Grid Granules, (e.g 31TFL)")
extent.add_argument("--scenes", type=str, help="Path to a Scenes UUID file")
filters = parser.add_argument_group("Filters")
filters.add_argument("--level", type=str, choices=["2A", "3A"], help="Processing Level")
filters.add_argument("--start", type=str, help="YYYY-MM-DD starting date")
filters.add_argument("--end", type=str, help="YYYY-MM-DD end date")
filters.add_argument("--clouds", type=int, help="max threshold for cloud coverage [0-100]")
filters.add_argument("--limit", type=int, default=500, help="max number of results per granule")
dl = parser.add_argument_group("Download")
dl.add_argument("--download", action="store_true", help="if set, perform also download operation.")
dl.add_argument("--workers", type=int, default=4, help="number of workers [default: 4]")
dl.add_argument("--timeout", type=int, default=180, help="download request timeout (in seconds) [default: 180]")
parser.add_argument("--out", type=str, nargs="?", help="output directory path [required if download is set]")
parser.set_defaults(func=main)
THEIA_URL = "https://theia.cnes.fr/atdistrib"
def get_token(login, password):
resp = requests.post(THEIA_URL + "/services/authenticate/", data={"ident": login, "pass": password})
assert resp, "Unable to join Theia Server, check your connection"
token = resp.text
assert re.match("[a-zA-Z0-9]+", token), "Invalid authentification, check you login/pass"
return token
def md5(path):
assert os.path.isfile(path), "Unable to perform md5 on {}".format(path)
with open(path, "rb") as fp:
md5 = hashlib.md5()
while True:
chunk = fp.read(16384)
if not chunk:
break
md5.update(chunk)
return md5.hexdigest()
def search_scenes(args, log):
scenes = []
for granule in args.granules:
data = {"location": "T" + granule, "maxRecords": 500}
if args.level:
data["processingLevel"] = "LEVEL" + args.level
if args.start:
data["startDate"] = args.start
if args.end:
data["completionDate"] = args.end
url = THEIA_URL + "/resto2/api/collections/SENTINEL2/search.json?"
data = json.loads(requests.get(url, params=data).text)
assert data, "Unable to perform query: {}".format(url)
if not len(data["features"]):
log.log("======================================================")
log.log("WARNING: No scene found for {} granule".format(granule))
log.log("======================================================")
continue
log.log("=============================================================================")
log.log("Selected scenes for {} granule".format(granule))
log.log("-----------------------------------------------------------------------------")
log.log(" Date Clouds Scene UUID Processing ")
log.log("-----------------------------------------------------------------------------")
features = (
[feature for feature in data["features"] if int(feature["properties"]["cloudCover"]) <= args.clouds]
if args.clouds is not None
else data["features"]
)
features = [feature for i, feature in enumerate(features) if i < args.limit]
for feature in features:
date = datetime.strptime(feature["properties"]["startDate"], "%Y-%m-%dT%H:%M:%SZ").date()
cover = str(feature["properties"]["cloudCover"]).rjust(3, " ")
scenes.append(
{
"uuid": feature["id"],
"checksum": feature["properties"]["services"]["download"]["checksum"],
"dir": feature["properties"]["title"],
}
)
log.log("{}\t{}\t{}\t{}".format(date, cover, feature["id"], feature["properties"]["processingLevel"]))
log.log("=============================================================================")
return scenes
def main(args):
assert args.cover or args.granules or args.scenes, "Either --cover OR --granules OR --scenes is mandatory"
assert not (args.download and not args.out), "--download implies out parameter"
assert args.limit, "What about increasing --limit value ?"
config = load_config(args.config)
if args.cover:
args.pg = args.pg if args.pg else config["auth"]["pg"]
assert args.pg, "PostgreSQL connection settting is mandatory with --cover"
args.granules = tiles_to_granules(tiles_from_csv(os.path.expanduser(args.cover)), args.pg)
if args.out:
args.out = os.path.expanduser(args.out)
os.makedirs(args.out, exist_ok=True)
log = Logs(os.path.join(args.out, "log"), out=sys.stderr)
else:
log = Logs(None, out=sys.stderr)
log.log("abd sat on granules: {}".format(" ".join(args.granules)))
scenes = search_scenes(args, log)
if args.download:
log.log("")
log.log("=============================================================================")
log.log("Downloading selected scenes")
log.log("=============================================================================")
report = []
login, password = dict([auth.split("=") for auth in config["auth"]["theia"].split(" ")]).values()
with futures.ThreadPoolExecutor(args.workers) as executor:
def worker(scene):
scene_dir = os.path.join(args.out, scene["dir"][:42]) # 42 related to Theia MD issue, dirty workaround
if not os.path.isabs(scene_dir):
scene_dir = "./" + scene_dir
if glob.glob(scene_dir + "*"):
scene["dir"] = glob.glob(scene_dir + "*")[0]
return scene, None, True # Already Downloaded
token = get_token(login, password)
url = THEIA_URL + "/resto2/collections/SENTINEL2/{}/download/?issuerId=theia".format(scene["uuid"])
resp = requests.get(url, headers={"Authorization": "Bearer {}".format(token)}, stream=True)
if resp is None:
return scene, None, False # Auth issue
zip_path = os.path.join(args.out, scene["uuid"] + ".zip")
with open(zip_path, "wb") as fp:
progress = tqdm(unit="B", desc=scene["uuid"], total=int(resp.headers["Content-Length"]))
for chunk in resp.iter_content(chunk_size=16384):
progress.update(16384)
fp.write(chunk)
return scene, zip_path, True
return scene, None, False # Write issue
for scene, zip_path, ok in executor.map(worker, scenes):
if zip_path and md5(zip_path) == scene["checksum"]:
scene["dir"] = os.path.dirname(ZipFile(zip_path).namelist()[0])
ZipFile(zip_path).extractall(args.out)
os.remove(zip_path)
report.append("Scene {} available in {}".format(scene["uuid"], scene["dir"]))
elif ok:
report.append("SKIPPING downloading {}, as already in {}".format(scene["uuid"], scene["dir"]))
else:
report.append("ERROR: Unable to retrieve Scene {}".format(scene["uuid"]))
log.log("")
log.log("=============================================================================")
for line in report:
log.log(line)
log.log("=============================================================================")
| 44.055838 | 119 | 0.546031 | [
"MIT"
] | SeasyHQ/automated-building-detection | abd_model/src/abd_model/tools/_sat.py | 8,679 | Python |
"""
GTSAM Copyright 2010-2020, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
See LICENSE for the license information
Rules and classes for parsing a module.
Author: Duy Nguyen Ta, Fan Jiang, Matthew Sklar, Varun Agrawal, and Frank Dellaert
"""
# pylint: disable=unnecessary-lambda, unused-import, expression-not-assigned, no-else-return, protected-access, too-few-public-methods, too-many-arguments
from pyparsing import (ParseResults, ZeroOrMore, # type: ignore
cppStyleComment, stringEnd)
from .classes import Class
from .declaration import ForwardDeclaration, Include
from .enum import Enum
from .function import GlobalFunction
from .namespace import Namespace
from .template import TypedefTemplateInstantiation
from .variable import Variable
class Module:
"""
Module is just a global namespace.
E.g.
```
namespace gtsam {
...
}
```
"""
rule = (
ZeroOrMore(ForwardDeclaration.rule #
^ Include.rule #
^ Class.rule #
^ TypedefTemplateInstantiation.rule #
^ GlobalFunction.rule #
^ Enum.rule #
^ Variable.rule #
^ Namespace.rule #
).setParseAction(lambda t: Namespace('', t.asList())) +
stringEnd)
rule.ignore(cppStyleComment)
@staticmethod
def parseString(s: str) -> ParseResults:
"""Parse the source string and apply the rules."""
return Module.rule.parseString(s)[0]
| 27.912281 | 154 | 0.636706 | [
"BSD-3-Clause"
] | BaiLiping/gtsam | wrap/gtwrap/interface_parser/module.py | 1,591 | Python |
# Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and#
# limitations under the License.
import mock
from cloudferry.lib.copy_engines import base
from cloudferry.lib.copy_engines import bbcp_copier
from cloudferry.lib.utils import remote_runner
from tests.lib.copy_engines import test_base
from tests import test
class BbcpCopierTestCase(test_base.BaseTestCase):
copier_class = bbcp_copier.BbcpCopier
def setUp(self):
super(BbcpCopierTestCase, self).setUp()
self.src_cloud.hosts_with_bbcp = set()
self.dst_cloud.hosts_with_bbcp = set()
@mock.patch('cloudferry.lib.utils.utils.forward_agent')
@mock.patch('os.path.isfile')
def test_usage_false(self, mock_isfile, _):
mock_isfile.return_value = False
self.assertFalse(self.copier.check_usage(self.data))
mock_isfile.return_value = True
with mock.patch.object(self.copier, 'copy_bbcp',
side_effect=remote_runner.RemoteExecutionError):
self.assertFalse(self.copier.check_usage(self.data))
@mock.patch('os.path.isfile')
def test_usage_true(self, mock_isfile):
mock_isfile.return_value = True
with mock.patch.object(self.copier, 'copy_bbcp') as mock_copy_bbcp:
self.assertTrue(self.copier.check_usage(self.data))
self.assertEqual(2, mock_copy_bbcp.call_count)
mock_copy_bbcp.reset_mock()
self.assertTrue(self.copier.check_usage(self.data))
mock_copy_bbcp.assert_not_called()
def test_transfer_direct_true(self):
with self.mock_runner() as mock_runner:
self.copier.transfer(self.data)
self.assertCalledOnce(mock_runner.run)
mock_runner.reset_mock()
self.cfg.set_override('retry', 2, 'migrate')
mock_runner.run.side_effect = remote_runner.RemoteExecutionError()
with mock.patch.object(self.copier, 'clean_dst') as mock_clean_dst:
self.assertRaises(base.FileCopyError, self.copier.transfer,
self.data)
self.assertEqual(2, mock_runner.run.call_count)
self.assertCalledOnce(mock_clean_dst)
@mock.patch('cloudferry.lib.utils.local.run')
def test_transfer_direct_false(self, mock_run):
self.cfg.set_override('direct_transfer', False, 'migrate')
self.copier.transfer(self.data)
self.assertCalledOnce(mock_run)
@mock.patch('cloudferry.lib.utils.local.run')
def test_copy_bbcp(self, mock_run):
with self.mock_runner() as runner:
self.copier.copy_bbcp('fake_host', 'src')
self.assertCalledOnce(runner.run)
mock_run.assert_not_called()
runner.reset_mock()
runner.run.side_effect = (remote_runner.RemoteExecutionError,
None)
self.copier.copy_bbcp('fake_host', 'src')
self.assertEqual(2, runner.run.call_count)
self.assertCalledOnce(mock_run)
class RemoveBBCPTestCase(test.TestCase):
@mock.patch('cloudferry.lib.utils.remote_runner.RemoteRunner.'
'run_ignoring_errors')
def test_remove_bbcp(self, mock_run_ignoring_errors):
cloud = mock.Mock()
cloud.hosts_with_bbcp = {'fake_host_1', 'fake_host_2'}
cloud.position = 'src'
bbcp_copier.remove_bbcp(cloud)
self.assertEqual(2, mock_run_ignoring_errors.call_count)
| 39.969697 | 79 | 0.682841 | [
"Apache-2.0"
] | Mirantis/CloudFerry | tests/lib/copy_engines/test_bbcp_copier.py | 3,957 | Python |
#!/usr/bin/env python
"""
Memory Loss
github.com/irlrobot/memory_loss
"""
from __future__ import print_function
from random import choice, shuffle
from alexa_responses import speech_with_card
from brain_training import QUESTIONS
def handle_answer_request(player_answer, session):
"""check if the answer is right, adjust score, and continue"""
print("=====handle_answer_request fired...")
attributes = {}
should_end_session = False
print("=====answer heard was: " + player_answer)
current_question = session['attributes']['question']
correct_answer = current_question['answer']
shuffle(QUESTIONS)
next_question = choice(QUESTIONS)
if correct_answer == player_answer:
answered_correctly = True
else:
log_wrong_answer(current_question['question'], player_answer, correct_answer)
answered_correctly = False
next_tts = "Next question in 3... 2... 1... " + next_question['question']
attributes = {
"question": next_question,
"game_status": "in_progress"
}
if answered_correctly:
speech_output = "Correct!" + next_tts
card_title = "Correct!"
else:
speech_output = "Wrong!" + next_tts
card_title = "Wrong!"
card_text = "The question was:\n" + current_question['question']
return speech_with_card(speech_output, attributes, should_end_session,
card_title, card_text, answered_correctly)
def log_wrong_answer(question, answer, correct_answer):
"""log all questions answered incorrectly so i can analyze later"""
print("[WRONG ANSWER]:" + question + ":" + answer + ":" + correct_answer)
| 33.959184 | 85 | 0.685697 | [
"Apache-2.0"
] | irlrobot/memory_loss | src/handle_answer_request.py | 1,664 | Python |
# Copyright 2015 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import copy
import fixtures
import mock
from oslo_config import cfg
import oslo_messaging as messaging
from oslo_messaging import conffixture as messaging_conffixture
from oslo_messaging.rpc import dispatcher
import testtools
from neutron.common import rpc
from neutron.tests import base
CONF = cfg.CONF
CONF.import_opt('state_path', 'neutron.conf.common')
class RPCFixture(fixtures.Fixture):
def _setUp(self):
self.trans = copy.copy(rpc.TRANSPORT)
self.noti_trans = copy.copy(rpc.NOTIFICATION_TRANSPORT)
self.noti = copy.copy(rpc.NOTIFIER)
self.all_mods = copy.copy(rpc.ALLOWED_EXMODS)
self.ext_mods = copy.copy(rpc.EXTRA_EXMODS)
self.addCleanup(self._reset_everything)
def _reset_everything(self):
rpc.TRANSPORT = self.trans
rpc.NOTIFICATION_TRANSPORT = self.noti_trans
rpc.NOTIFIER = self.noti
rpc.ALLOWED_EXMODS = self.all_mods
rpc.EXTRA_EXMODS = self.ext_mods
class TestRPC(base.DietTestCase):
def setUp(self):
super(TestRPC, self).setUp()
self.useFixture(RPCFixture())
@mock.patch.object(rpc, 'get_allowed_exmods')
@mock.patch.object(rpc, 'RequestContextSerializer')
@mock.patch.object(messaging, 'get_rpc_transport')
@mock.patch.object(messaging, 'get_notification_transport')
@mock.patch.object(messaging, 'Notifier')
def test_init(self, mock_not, mock_noti_trans, mock_trans, mock_ser,
mock_exmods):
notifier = mock.Mock()
transport = mock.Mock()
noti_transport = mock.Mock()
serializer = mock.Mock()
conf = mock.Mock()
mock_exmods.return_value = ['foo']
mock_trans.return_value = transport
mock_noti_trans.return_value = noti_transport
mock_ser.return_value = serializer
mock_not.return_value = notifier
rpc.init(conf)
mock_exmods.assert_called_once_with()
mock_trans.assert_called_once_with(conf, allowed_remote_exmods=['foo'])
mock_noti_trans.assert_called_once_with(conf,
allowed_remote_exmods=['foo'])
mock_not.assert_called_once_with(noti_transport,
serializer=serializer)
self.assertIsNotNone(rpc.TRANSPORT)
self.assertIsNotNone(rpc.NOTIFICATION_TRANSPORT)
self.assertIsNotNone(rpc.NOTIFIER)
def test_cleanup_transport_null(self):
rpc.NOTIFIER = mock.Mock()
rpc.NOTIFICATION_TRANSPORT = mock.Mock()
self.assertRaises(AssertionError, rpc.cleanup)
def test_cleanup_notification_transport_null(self):
rpc.TRANSPORT = mock.Mock()
rpc.NOTIFIER = mock.Mock()
self.assertRaises(AssertionError, rpc.cleanup)
def test_cleanup_notifier_null(self):
rpc.TRANSPORT = mock.Mock()
rpc.NOTIFICATION_TRANSPORT = mock.Mock()
self.assertRaises(AssertionError, rpc.cleanup)
def test_cleanup(self):
rpc.NOTIFIER = mock.Mock()
rpc.NOTIFICATION_TRANSPORT = mock.Mock()
rpc.TRANSPORT = mock.Mock()
trans_cleanup = mock.Mock()
not_trans_cleanup = mock.Mock()
rpc.TRANSPORT.cleanup = trans_cleanup
rpc.NOTIFICATION_TRANSPORT.cleanup = not_trans_cleanup
rpc.cleanup()
trans_cleanup.assert_called_once_with()
not_trans_cleanup.assert_called_once_with()
self.assertIsNone(rpc.TRANSPORT)
self.assertIsNone(rpc.NOTIFICATION_TRANSPORT)
self.assertIsNone(rpc.NOTIFIER)
def test_add_extra_exmods(self):
rpc.EXTRA_EXMODS = []
rpc.add_extra_exmods('foo', 'bar')
self.assertEqual(['foo', 'bar'], rpc.EXTRA_EXMODS)
def test_clear_extra_exmods(self):
rpc.EXTRA_EXMODS = ['foo', 'bar']
rpc.clear_extra_exmods()
self.assertEqual(0, len(rpc.EXTRA_EXMODS))
def test_get_allowed_exmods(self):
rpc.ALLOWED_EXMODS = ['foo']
rpc.EXTRA_EXMODS = ['bar']
exmods = rpc.get_allowed_exmods()
self.assertEqual(['foo', 'bar'], exmods)
@mock.patch.object(rpc, 'RequestContextSerializer')
@mock.patch.object(rpc, 'BackingOffClient')
def test_get_client(self, mock_client, mock_ser):
rpc.TRANSPORT = mock.Mock()
tgt = mock.Mock()
ser = mock.Mock()
mock_client.return_value = 'client'
mock_ser.return_value = ser
client = rpc.get_client(tgt, version_cap='1.0', serializer='foo')
mock_ser.assert_called_once_with('foo')
mock_client.assert_called_once_with(rpc.TRANSPORT,
tgt, version_cap='1.0',
serializer=ser)
self.assertEqual('client', client)
@mock.patch.object(rpc, 'RequestContextSerializer')
@mock.patch.object(messaging, 'get_rpc_server')
def test_get_server(self, mock_get, mock_ser):
rpc.TRANSPORT = mock.Mock()
ser = mock.Mock()
tgt = mock.Mock()
ends = mock.Mock()
mock_ser.return_value = ser
mock_get.return_value = 'server'
server = rpc.get_server(tgt, ends, serializer='foo')
mock_ser.assert_called_once_with('foo')
access_policy = dispatcher.DefaultRPCAccessPolicy
mock_get.assert_called_once_with(rpc.TRANSPORT, tgt, ends,
'eventlet', ser,
access_policy=access_policy)
self.assertEqual('server', server)
def test_get_notifier(self):
rpc.NOTIFIER = mock.Mock()
mock_prep = mock.Mock()
mock_prep.return_value = 'notifier'
rpc.NOTIFIER.prepare = mock_prep
notifier = rpc.get_notifier('service', publisher_id='foo')
mock_prep.assert_called_once_with(publisher_id='foo')
self.assertEqual('notifier', notifier)
def test_get_notifier_null_publisher(self):
rpc.NOTIFIER = mock.Mock()
mock_prep = mock.Mock()
mock_prep.return_value = 'notifier'
rpc.NOTIFIER.prepare = mock_prep
notifier = rpc.get_notifier('service', host='bar')
mock_prep.assert_called_once_with(publisher_id='service.bar')
self.assertEqual('notifier', notifier)
class TestRequestContextSerializer(base.DietTestCase):
def setUp(self):
super(TestRequestContextSerializer, self).setUp()
self.mock_base = mock.Mock()
self.ser = rpc.RequestContextSerializer(self.mock_base)
self.ser_null = rpc.RequestContextSerializer(None)
def test_serialize_entity(self):
self.mock_base.serialize_entity.return_value = 'foo'
ser_ent = self.ser.serialize_entity('context', 'entity')
self.mock_base.serialize_entity.assert_called_once_with('context',
'entity')
self.assertEqual('foo', ser_ent)
def test_deserialize_entity(self):
self.mock_base.deserialize_entity.return_value = 'foo'
deser_ent = self.ser.deserialize_entity('context', 'entity')
self.mock_base.deserialize_entity.assert_called_once_with('context',
'entity')
self.assertEqual('foo', deser_ent)
def test_deserialize_entity_null_base(self):
deser_ent = self.ser_null.deserialize_entity('context', 'entity')
self.assertEqual('entity', deser_ent)
def test_serialize_context(self):
context = mock.Mock()
self.ser.serialize_context(context)
context.to_dict.assert_called_once_with()
def test_deserialize_context(self):
context_dict = {'foo': 'bar',
'user_id': 1,
'tenant_id': 1,
'is_admin': True}
c = self.ser.deserialize_context(context_dict)
self.assertEqual(1, c.user_id)
self.assertEqual(1, c.project_id)
def test_deserialize_context_no_user_id(self):
context_dict = {'foo': 'bar',
'user': 1,
'tenant_id': 1,
'is_admin': True}
c = self.ser.deserialize_context(context_dict)
self.assertEqual(1, c.user_id)
self.assertEqual(1, c.project_id)
def test_deserialize_context_no_tenant_id(self):
context_dict = {'foo': 'bar',
'user_id': 1,
'project_id': 1,
'is_admin': True}
c = self.ser.deserialize_context(context_dict)
self.assertEqual(1, c.user_id)
self.assertEqual(1, c.project_id)
def test_deserialize_context_no_ids(self):
context_dict = {'foo': 'bar', 'is_admin': True}
c = self.ser.deserialize_context(context_dict)
self.assertIsNone(c.user_id)
self.assertIsNone(c.project_id)
class ServiceTestCase(base.DietTestCase):
# the class cannot be based on BaseTestCase since it mocks rpc.Connection
def setUp(self):
super(ServiceTestCase, self).setUp()
self.host = 'foo'
self.topic = 'neutron-agent'
self.target_mock = mock.patch('oslo_messaging.Target')
self.target_mock.start()
self.messaging_conf = messaging_conffixture.ConfFixture(CONF)
self.messaging_conf.transport_driver = 'fake'
self.messaging_conf.response_timeout = 0
self.useFixture(self.messaging_conf)
self.addCleanup(rpc.cleanup)
rpc.init(CONF)
def test_operations(self):
with mock.patch('oslo_messaging.get_rpc_server') as get_rpc_server:
rpc_server = get_rpc_server.return_value
service = rpc.Service(self.host, self.topic)
service.start()
rpc_server.start.assert_called_once_with()
service.stop()
rpc_server.stop.assert_called_once_with()
rpc_server.wait.assert_called_once_with()
class TimeoutTestCase(base.DietTestCase):
def setUp(self):
super(TimeoutTestCase, self).setUp()
self.messaging_conf = messaging_conffixture.ConfFixture(CONF)
self.messaging_conf.transport_driver = 'fake'
self.messaging_conf.response_timeout = 0
self.useFixture(self.messaging_conf)
self.addCleanup(rpc.cleanup)
rpc.init(CONF)
rpc.TRANSPORT = mock.MagicMock()
rpc.TRANSPORT._send.side_effect = messaging.MessagingTimeout
target = messaging.Target(version='1.0', topic='testing')
self.client = rpc.get_client(target)
self.call_context = mock.Mock()
self.sleep = mock.patch('time.sleep').start()
rpc.TRANSPORT.conf.rpc_response_timeout = 10
def test_timeout_unaffected_when_explicitly_set(self):
rpc.TRANSPORT.conf.rpc_response_timeout = 5
ctx = self.client.prepare(topic='sandwiches', timeout=77)
with testtools.ExpectedException(messaging.MessagingTimeout):
ctx.call(self.call_context, 'create_pb_and_j')
# ensure that the timeout was not increased and the back-off sleep
# wasn't called
self.assertEqual(
5,
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['create_pb_and_j'])
self.assertFalse(self.sleep.called)
def test_timeout_store_defaults(self):
# any method should default to the configured timeout
self.assertEqual(
rpc.TRANSPORT.conf.rpc_response_timeout,
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'])
self.assertEqual(
rpc.TRANSPORT.conf.rpc_response_timeout,
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_2'])
# a change to an existing should not affect new or existing ones
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_2'] = 7000
self.assertEqual(
rpc.TRANSPORT.conf.rpc_response_timeout,
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'])
self.assertEqual(
rpc.TRANSPORT.conf.rpc_response_timeout,
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_3'])
def test_method_timeout_sleep(self):
rpc.TRANSPORT.conf.rpc_response_timeout = 2
for i in range(100):
with testtools.ExpectedException(messaging.MessagingTimeout):
self.client.call(self.call_context, 'method_1')
# sleep value should always be between 0 and configured timeout
self.assertGreaterEqual(self.sleep.call_args_list[0][0][0], 0)
self.assertLessEqual(self.sleep.call_args_list[0][0][0], 2)
self.sleep.reset_mock()
def test_method_timeout_increases_on_timeout_exception(self):
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'] = 1
for i in range(4):
with testtools.ExpectedException(messaging.MessagingTimeout):
self.client.call(self.call_context, 'method_1')
# we only care to check the timeouts sent to the transport
timeouts = [call[1]['timeout']
for call in rpc.TRANSPORT._send.call_args_list]
self.assertEqual([1, 2, 4, 8], timeouts)
def test_method_timeout_10x_config_ceiling(self):
rpc.TRANSPORT.conf.rpc_response_timeout = 10
# 5 doublings should max out at the 10xdefault ceiling
for i in range(5):
with testtools.ExpectedException(messaging.MessagingTimeout):
self.client.call(self.call_context, 'method_1')
self.assertEqual(
1 * rpc.TRANSPORT.conf.rpc_response_timeout,
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'])
with testtools.ExpectedException(messaging.MessagingTimeout):
self.client.call(self.call_context, 'method_1')
self.assertEqual(
1 * rpc.TRANSPORT.conf.rpc_response_timeout,
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'])
def test_timeout_unchanged_on_other_exception(self):
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'] = 1
rpc.TRANSPORT._send.side_effect = ValueError
with testtools.ExpectedException(ValueError):
self.client.call(self.call_context, 'method_1')
rpc.TRANSPORT._send.side_effect = messaging.MessagingTimeout
with testtools.ExpectedException(messaging.MessagingTimeout):
self.client.call(self.call_context, 'method_1')
timeouts = [call[1]['timeout']
for call in rpc.TRANSPORT._send.call_args_list]
self.assertEqual([1, 1], timeouts)
def test_timeouts_for_methods_tracked_independently(self):
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'] = 1
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_2'] = 1
for method in ('method_1', 'method_1', 'method_2',
'method_1', 'method_2'):
with testtools.ExpectedException(messaging.MessagingTimeout):
self.client.call(self.call_context, method)
timeouts = [call[1]['timeout']
for call in rpc.TRANSPORT._send.call_args_list]
self.assertEqual([1, 2, 1, 4, 2], timeouts)
def test_timeouts_for_namespaces_tracked_independently(self):
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['ns1.method'] = 1
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['ns2.method'] = 1
for ns in ('ns1', 'ns2'):
self.client.target.namespace = ns
for i in range(4):
with testtools.ExpectedException(messaging.MessagingTimeout):
self.client.call(self.call_context, 'method')
timeouts = [call[1]['timeout']
for call in rpc.TRANSPORT._send.call_args_list]
self.assertEqual([1, 2, 4, 8, 1, 2, 4, 8], timeouts)
def test_method_timeout_increases_with_prepare(self):
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'] = 1
ctx = self.client.prepare(version='1.4')
with testtools.ExpectedException(messaging.MessagingTimeout):
ctx.call(self.call_context, 'method_1')
with testtools.ExpectedException(messaging.MessagingTimeout):
ctx.call(self.call_context, 'method_1')
# we only care to check the timeouts sent to the transport
timeouts = [call[1]['timeout']
for call in rpc.TRANSPORT._send.call_args_list]
self.assertEqual([1, 2], timeouts)
def test_set_max_timeout_caps_all_methods(self):
rpc.TRANSPORT.conf.rpc_response_timeout = 300
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'] = 100
rpc.BackingOffClient.set_max_timeout(50)
# both explicitly tracked
self.assertEqual(
50, rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'])
# as well as new methods
self.assertEqual(
50, rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_2'])
def test_set_max_timeout_retains_lower_timeouts(self):
rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'] = 10
rpc.BackingOffClient.set_max_timeout(50)
self.assertEqual(
10, rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1'])
def test_set_max_timeout_overrides_default_timeout(self):
rpc.TRANSPORT.conf.rpc_response_timeout = 10
self.assertEqual(
10, rpc._BackingOffContextWrapper.get_max_timeout())
rpc._BackingOffContextWrapper.set_max_timeout(10)
self.assertEqual(10, rpc._BackingOffContextWrapper.get_max_timeout())
class CastExceptionTestCase(base.DietTestCase):
def setUp(self):
super(CastExceptionTestCase, self).setUp()
self.messaging_conf = messaging_conffixture.ConfFixture(CONF)
self.messaging_conf.transport_driver = 'fake'
self.messaging_conf.response_timeout = 0
self.useFixture(self.messaging_conf)
self.addCleanup(rpc.cleanup)
rpc.init(CONF)
rpc.TRANSPORT = mock.MagicMock()
rpc.TRANSPORT._send.side_effect = Exception
target = messaging.Target(version='1.0', topic='testing')
self.client = rpc.get_client(target)
self.cast_context = mock.Mock()
def test_cast_catches_exception(self):
self.client.cast(self.cast_context, 'method_1')
class TestConnection(base.DietTestCase):
def setUp(self):
super(TestConnection, self).setUp()
self.conn = rpc.Connection()
@mock.patch.object(messaging, 'Target')
@mock.patch.object(cfg, 'CONF')
@mock.patch.object(rpc, 'get_server')
def test_create_consumer(self, mock_get, mock_cfg, mock_tgt):
mock_cfg.host = 'foo'
server = mock.Mock()
target = mock.Mock()
mock_get.return_value = server
mock_tgt.return_value = target
self.conn.create_consumer('topic', 'endpoints', fanout=True)
mock_tgt.assert_called_once_with(topic='topic', server='foo',
fanout=True)
mock_get.assert_called_once_with(target, 'endpoints')
self.assertEqual([server], self.conn.servers)
def test_consume_in_threads(self):
self.conn.servers = [mock.Mock(), mock.Mock()]
servs = self.conn.consume_in_threads()
for serv in self.conn.servers:
serv.start.assert_called_once_with()
self.assertEqual(servs, self.conn.servers)
def test_close(self):
self.conn.servers = [mock.Mock(), mock.Mock()]
self.conn.close()
for serv in self.conn.servers:
serv.stop.assert_called_once_with()
serv.wait.assert_called_once_with()
| 38.566288 | 79 | 0.658154 | [
"Apache-2.0"
] | ericho/stx-neutron | neutron/tests/unit/common/test_rpc.py | 20,363 | Python |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-02-17 20:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("scripts", "0007_auto_20150403_2339"), ("comms", "0010_auto_20161206_1912")]
operations = [
migrations.AddField(
model_name="msg",
name="db_receivers_scripts",
field=models.ManyToManyField(
blank=True,
help_text="script_receivers",
null=True,
related_name="receiver_script_set",
to="scripts.ScriptDB",
),
),
migrations.AddField(
model_name="msg",
name="db_sender_scripts",
field=models.ManyToManyField(
blank=True,
db_index=True,
null=True,
related_name="sender_script_set",
to="scripts.ScriptDB",
verbose_name="sender(script)",
),
),
]
| 27.810811 | 97 | 0.524781 | [
"BSD-3-Clause"
] | 3eluk/evennia | evennia/comms/migrations/0011_auto_20170217_2039.py | 1,029 | Python |
#
# (C) Copyright IBM Corp. 2018
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import logging
from pywren_ibm_cloud.config import cloud_logging_config
from pywren_ibm_cloud.runtime.function_handler import function_handler
cloud_logging_config(logging.INFO)
logger = logging.getLogger('__main__')
def main(args):
logger.info("Starting IBM Cloud Functions execution")
function_handler(args)
return {"Execution": "Finished"}
| 32.413793 | 74 | 0.77234 | [
"Apache-2.0"
] | edwardstudy/pywren-ibm-cloud | pywren_ibm_cloud/compute/backends/ibm_cf/entry_point.py | 940 | Python |
from mitsubishi_central_controller.util.ControllerDictBuilder import ControllerDictBuilder
import aiohttp
import asyncio
from mitsubishi_central_controller.util.dict_utils import get_group_list_from_dict, get_system_data_from_dict, \
get_single_bulk_from_dict, get_single_racsw_from_dict, get_single_energycontrol_from_dict, get_lcd_name_from_dict, \
get_group_info_list_from_dict
from mitsubishi_central_controller.util.temperature_utils import f_to_c
from mitsubishi_central_controller.util.xml_utils import parse_xml
class CentralController:
def __init__(self, url):
self.url = url
self.full_url = url + "/servlet/MIMEReceiveServlet"
self.session = None
self.groups = None
self.system_data = None
self.semaphore = None
def print(self):
print(self.__dict__)
async def get_session(self):
if self.session is None:
self.session = aiohttp.ClientSession()
self.semaphore = asyncio.Semaphore(value=7)
return self.session
else:
return self.session
async def initialize_group(self, group):
await self.async_update_single_group_bulk(group)
group.update_from_bulk()
print(group.__dict__)
async def initialize_all(self):
await self.async_initialize_system_data()
await self.async_initialize_group_list()
await asyncio.wait([self.initialize_group(group) for group in self.groups])
async def async_send_command(self, command):
session = await self.get_session()
await self.semaphore.acquire()
resp = await session.post(self.full_url, data=command, headers={'Content-Type': 'text/xml'})
self.semaphore.release()
return await resp.text()
async def async_initialize_system_data(self):
xml = ControllerDictBuilder().get_system_data().to_xml()
xml_response = await self.async_send_command(xml)
parsed = parse_xml(xml_response)
self.system_data = get_system_data_from_dict(parsed)
async def async_initialize_group_list(self):
xml = ControllerDictBuilder().get_mnet_group_list().to_xml()
xml_response = await self.async_send_command(xml)
parsed = parse_xml(xml_response)
self.groups = get_group_list_from_dict(parsed)
await self.async_update_group_list_with_names()
async def async_update_group_list_with_names(self):
xml = ControllerDictBuilder().get_mnet_list().to_xml()
xml_response = await self.async_send_command(xml)
parsed = parse_xml(xml_response)
groups_info = get_group_info_list_from_dict(parsed)
for group in self.groups:
group.web_name = groups_info[group.group_id]["web_name"]
group.lcd_name = groups_info[group.group_id]["lcd_name"]
async def async_update_single_group_bulk(self, group):
xml = ControllerDictBuilder().get_single_bulk_data(group.group_id).to_xml()
xml_response = await self.async_send_command(xml)
parsed = parse_xml(xml_response)
group.bulk_string = get_single_bulk_from_dict(parsed)
group.rac_sw = get_single_racsw_from_dict(parsed)
group.energy_control = get_single_energycontrol_from_dict(parsed)
return group
async def update_lcd_name_for_group(self, group):
xml = ControllerDictBuilder().get_mnet(group.group_id, lcd_name=True).to_xml()
xml_response = await self.async_send_command(xml)
parsed = parse_xml(xml_response)
group.lcd_name = get_lcd_name_from_dict(parsed)
async def set_drive_for_group(self, group, drive_string):
xml = ControllerDictBuilder().set_mnet(group.group_id, drive=drive_string).to_xml()
await self.async_send_command(xml)
await self.async_update_single_group_bulk(group)
async def set_mode_for_group(self, group, mode):
xml = ControllerDictBuilder().set_mnet(group.group_id, mode=mode).to_xml()
await self.async_send_command(xml)
await self.async_update_single_group_bulk(group)
async def set_temperature_fahrenheit_for_group(self, group, temperature):
xml = ControllerDictBuilder().set_mnet(group.group_id, set_temp=f_to_c(int(temperature))).to_xml()
await self.async_send_command(xml)
await self.async_update_single_group_bulk(group)
async def set_air_direction_for_group(self, group, air_direction):
xml = ControllerDictBuilder().set_mnet(group.group_id, air_direction=air_direction).to_xml()
await self.async_send_command(xml)
await self.async_update_single_group_bulk(group)
async def set_fan_speed_for_group(self, group, fan_speed):
xml = ControllerDictBuilder().set_mnet(group.group_id, fan_speed=fan_speed).to_xml()
await self.async_send_command(xml)
await self.async_update_single_group_bulk(group)
async def set_remote_controller_for_group(self, group, remote_controller):
xml = ControllerDictBuilder().set_mnet(group.group_id, remote_controller=remote_controller).to_xml()
await self.async_send_command(xml)
await self.async_update_single_group_bulk(group)
async def reset_filter_for_group(self, group):
xml = ControllerDictBuilder().set_mnet(group.group_id, filter_sign="RESET").to_xml()
await self.async_send_command(xml)
await self.async_update_single_group_bulk(group)
async def reset_error_for_group(self, group):
xml = ControllerDictBuilder().set_mnet(group.group_id, error_sign="RESET").to_xml()
await self.async_send_command(xml)
await self.async_update_single_group_bulk(group)
async def close_connection(self):
s = await self.get_session()
await s.close()
| 44.72093 | 120 | 0.729243 | [
"MIT"
] | adgelbfish/mitsubishi-central-controller2 | mitsubishi_central_controller/CentralController.py | 5,769 | Python |
# libraries imported
import os
import pathlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
# uses predict folder code to run predictor on entire folders
from predict_folder import predict_dir
def predict_dirs(model_type, target_prediction):
directory_name = str(pathlib.Path(__file__).parent.resolve()) + "/data/"
# list holding all folders to use
folder_names = [
"Novice Pointing",
"Novice Tracing",
"Surgeon Pointing",
"Surgeon Tracing"
]
# finds the directories
directories = []
for folder_name in folder_names:
os.fsencode(directory_name + folder_name + "/")
# puts all txt files' names in a list
file_names = []
for directory in directories:
for file in os.listdir(directory):
file_names.append(os.fsdecode(file))
if model_type == "SVM":
C_parameters = []
epsilon_parameters = []
elif model_type == "Random Forest":
num_trees = []
all_r2 = []
all_tremor_r2 = []
all_rmse = []
all_tremor_rmse = []
all_training_times = []
all_prediction_times = []
# runs the prediction code for each folder
for folder_name in folder_names:
[hyperparameters, r2_scores, tremor_r2_scores, rmses, tremor_rmses, training_times, prediction_times] \
= predict_dir(directory_name + folder_name, model_type, target_prediction)
if model_type == "SVM":
C_parameters.extend(hyperparameters[:2])
epsilon_parameters.extend(hyperparameters[2:])
elif model_type == "Random Forest":
num_trees.extend(hyperparameters)
all_r2.append(r2_scores)
all_tremor_r2.append(tremor_r2_scores)
all_rmse.append(rmses)
all_tremor_rmse.append(tremor_rmses)
all_training_times.append(training_times)
all_prediction_times.append(prediction_times)
if model_type == "SVM":
maxmin_hyperparameters = [
np.max(C_parameters), np.min(C_parameters),
np.max(epsilon_parameters), np.min(epsilon_parameters)
]
print("\nHyperparameters of the model [C_max, C_min, epsilon_max, epsilon_min]:", maxmin_hyperparameters)
elif model_type == "Random Forest":
maxmin_hyperparameters = [np.max(num_trees), np.min(num_trees)]
print("\nHyperparameters of the model [n_estimators_max, n_estimators_min]:", maxmin_hyperparameters)
# prints the average metrics for all datasets
print(
"\nAverage R2 score of the model:", str(np.mean(all_r2)) + "%",
"\nAverage R2 score of the tremor component:", str(np.mean(all_tremor_r2)) + "%",
"\nAverage RMS error of the model:", str(np.mean(all_rmse)) + "mm",
"\nAverage RMS error of the tremor component:", str(np.mean(all_tremor_rmse)) + "mm",
"\nAverage time taken to train:", str(np.mean(all_training_times)) + "s",
"\nAverage time taken to make a prediction:", str(np.mean(all_prediction_times)) + "s"
)
fig, axes = plt.subplots(2, figsize=(10, 10))
# bar chart properties
bar_width = 0.1
labels = folder_names
x_axis = np.arange(len(labels))
# data for plotting bar chart
bar_xr2 = []
bar_yr2 = []
bar_zr2 = []
bar_xtremor_r2 = []
bar_ytremor_r2 = []
bar_ztremor_r2 = []
bar_training_times = np.round(np.multiply(all_training_times, 1000), 2)
bar_xpredict_times = []
bar_ypredict_times = []
bar_zpredict_times = []
# formats the lists above for use in generating bars in the chart
for i in range(len(folder_names)):
bar_xr2.append(np.round(all_r2[i][0]))
bar_yr2.append(np.round(all_r2[i][1]))
bar_zr2.append(np.round(all_r2[i][2]))
bar_xtremor_r2.append(np.round(all_tremor_r2[i][0]))
bar_ytremor_r2.append(np.round(all_tremor_r2[i][1]))
bar_ztremor_r2.append(np.round(all_tremor_r2[i][2]))
bar_xpredict_times.append(round(1000 * all_prediction_times[i][0], 2))
bar_ypredict_times.append(round(1000 * all_prediction_times[i][1], 2))
bar_zpredict_times.append(round(1000 * all_prediction_times[i][2], 2))
# bars for each result
bar1 = axes[0].bar(x_axis - (5 * bar_width / 2), bar_xr2, width=bar_width, label="R2 (X)")
bar2 = axes[0].bar(x_axis - (3 * bar_width / 2), bar_yr2, width=bar_width, label="R2 (Y)")
bar3 = axes[0].bar(x_axis - (bar_width / 2), bar_zr2, width=bar_width, label="R2 (Z)")
bar4 = axes[0].bar(x_axis + (bar_width / 2), bar_xtremor_r2, width=bar_width, label="Tremor R2 (X)")
bar5 = axes[0].bar(x_axis + (3 * bar_width / 2), bar_ytremor_r2, width=bar_width, label="Tremor R2 (Y)")
bar6 = axes[0].bar(x_axis + (5 * bar_width / 2), bar_ztremor_r2, width=bar_width, label="Tremor R2 (Z)")
bar7 = axes[1].bar(x_axis - (3 * bar_width / 2), bar_training_times, width=bar_width, label="Training time")
bar8 = axes[1].bar(x_axis - (bar_width / 2), bar_xpredict_times, width=bar_width, label="Prediction time (X)")
bar9 = axes[1].bar(x_axis + (bar_width / 2), bar_ypredict_times, width=bar_width, label="Prediction time (Y)")
bar10 = axes[1].bar(x_axis + (3 * bar_width / 2), bar_zpredict_times, width=bar_width, label="Prediction time (Z)")
# displays bar value above the bar
axes[0].bar_label(bar1)
axes[0].bar_label(bar2)
axes[0].bar_label(bar3)
axes[0].bar_label(bar4)
axes[0].bar_label(bar5)
axes[0].bar_label(bar6)
axes[1].bar_label(bar7)
axes[1].bar_label(bar8)
axes[1].bar_label(bar9)
axes[1].bar_label(bar10)
# axis labels + title
axes[0].set_title("Accuracy", fontweight="bold")
axes[0].set_xlabel("R2 score metrics")
axes[0].set_ylabel("Accuracy (%)")
axes[1].set_title("Speed", fontweight="bold")
axes[1].set_xlabel("Time metrics")
axes[1].set_ylabel("Time (ms)")
# setting ticks and tick params
axes[0].set_xticks(x_axis)
axes[0].set_xticklabels(labels)
axes[1].set_xticks(x_axis)
axes[1].set_xticklabels(labels)
axes[0].tick_params(axis="x", which="both")
axes[0].tick_params(axis="y", which="both")
axes[1].tick_params(axis="x", which="both")
axes[1].tick_params(axis="y", which="both")
# legend
font_prop = FontProperties()
font_prop.set_size("small") # font size of the legend content
legend1 = axes[0].legend(prop=font_prop)
legend2 = axes[1].legend(prop=font_prop)
# font size of the legend title
plt.setp(legend1.get_title(), fontsize="medium")
plt.setp(legend2.get_title(), fontsize="medium")
# figure title
fig.suptitle((model + " results based on multiple datasets"), fontweight="bold", fontsize="x-large")
plt.show()
if __name__ == '__main__':
# choose what ML regression algorithm to use
# model = "SVM"
model = "Random Forest"
# choose what output to predict
# prediction_target = "voluntary motion"
prediction_target = "tremor component"
predict_dirs(model, prediction_target)
| 40.308571 | 119 | 0.663312 | [
"Apache-2.0"
] | abdmoh123/tremor-predictor | predict_all_data.py | 7,054 | Python |
#!/usr/bin/env python3
"""Example code that demonstrates using a button connected through the hat.
The button uses a hat pin through the sysfs driver illustrating the edge
detection polling.
The demo will light up the on board LED whenever PIN_D is drawn high.
"""
from signal import pause
from gpiozero import Button
from gpiozero import LED
from aiy.vision.pins import LED_1
from aiy.vision.pins import PIN_D
# Set up a gpiozero LED using the first onboard LED on the vision hat.
led = LED(LED_1)
# Set up a gpiozero Button using the 4th pin on the vision hat expansion.
button = Button(PIN_D)
# When the button is pressed, call the led.on() function (turn the led on)
button.when_pressed = led.on
# When the button is released, call the led.off() function (turn the led off)
button.when_released = led.off
# Wait for the user to kill the example.
pause()
| 30.857143 | 77 | 0.767361 | [
"Apache-2.0"
] | EdieW/controlcenter | src/examples/vision/gpiozero/bonnet_button.py | 864 | Python |
# Use of this source code is governed by the MIT license.
__license__ = "MIT"
"""This is the IP Analyzer program for the AlteMatrix module."""
| 28.8 | 64 | 0.736111 | [
"MIT"
] | Ir0n-c0d3X/AlteMatrix | AlteMatrix/ipanalyzer/__init__.py | 144 | Python |
#!/usr/bin/python
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utilities for PyAuto."""
import logging
import os
import shutil
import sys
import tempfile
import zipfile
class ExistingPathReplacer(object):
"""Facilitates backing up a given path (file or dir)..
Often you want to manipulate a directory or file for testing but don't want to
meddle with the existing contents. This class lets you make a backup, and
reinstate the backup when done. A backup is made in an adjacent directory,
so you need to make sure you have write permissions to the parent directory.
Works seemlessly in cases where the requested path already exists, or not.
Automatically reinstates the backed up path (if any) when object is deleted.
"""
_path = ''
_backup_dir = None # dir to which existing content is backed up
_backup_basename = ''
def __init__(self, path, path_type='dir'):
"""Initialize the object, making backups if necessary.
Args:
path: the requested path to file or directory
path_type: path type. Options: 'file', 'dir'. Default: 'dir'
"""
assert path_type in ('file', 'dir'), 'Invalid path_type: %s' % path_type
self._path_type = path_type
self._path = path
if os.path.exists(self._path):
if 'dir' == self._path_type:
assert os.path.isdir(self._path), '%s is not a directory' % self._path
else:
assert os.path.isfile(self._path), '%s is not a file' % self._path
# take a backup
self._backup_basename = os.path.basename(self._path)
self._backup_dir = tempfile.mkdtemp(dir=os.path.dirname(self._path),
prefix='bkp-' + self._backup_basename)
logging.info('Backing up %s in %s' % (self._path, self._backup_dir))
shutil.move(self._path,
os.path.join(self._backup_dir, self._backup_basename))
self._CreateRequestedPath()
def __del__(self):
"""Cleanup. Reinstate backup."""
self._CleanupRequestedPath()
if self._backup_dir: # Reinstate, if backed up.
from_path = os.path.join(self._backup_dir, self._backup_basename)
logging.info('Reinstating backup from %s to %s' % (from_path, self._path))
shutil.move(from_path, self._path)
self._RemoveBackupDir()
def _CreateRequestedPath(self):
# Create intermediate dirs if needed.
if not os.path.exists(os.path.dirname(self._path)):
os.makedirs(os.path.dirname(self._path))
if 'dir' == self._path_type:
os.mkdir(self._path)
else:
open(self._path, 'w').close()
def _CleanupRequestedPath(self):
if os.path.exists(self._path):
if os.path.isdir(self._path):
shutil.rmtree(self._path, ignore_errors=True)
else:
os.remove(self._path)
def _RemoveBackupDir(self):
if self._backup_dir and os.path.isdir(self._backup_dir):
shutil.rmtree(self._backup_dir, ignore_errors=True)
def RemovePath(path):
"""Remove the given path (file or dir)."""
if os.path.isdir(path):
shutil.rmtree(path, ignore_errors=True)
return
try:
os.remove(path)
except OSError:
pass
def UnzipFilenameToDir(filename, dir):
"""Unzip |filename| to directory |dir|.
This works with as low as python2.4 (used on win).
"""
zf = zipfile.ZipFile(filename)
pushd = os.getcwd()
if not os.path.isdir(dir):
os.mkdir(dir)
os.chdir(dir)
# Extract files.
for info in zf.infolist():
name = info.filename
if name.endswith('/'): # dir
if not os.path.isdir(name):
os.makedirs(name)
else: # file
dir = os.path.dirname(name)
if not os.path.isdir(dir):
os.makedirs(dir)
out = open(name, 'wb')
out.write(zf.read(name))
out.close()
# Set permissions. Permission info in external_attr is shifted 16 bits.
os.chmod(name, info.external_attr >> 16L)
os.chdir(pushd)
def GetCurrentPlatform():
"""Get a string representation for the current platform.
Returns:
'mac', 'win' or 'linux'
"""
if sys.platform == 'darwin':
return 'mac'
if sys.platform == 'win32':
return 'win'
if sys.platform == 'linux2':
return 'linux'
raise RuntimeError('Unknown platform')
| 30.842857 | 80 | 0.667439 | [
"BSD-3-Clause"
] | Gitman1989/chromium | chrome/test/pyautolib/pyauto_utils.py | 4,318 | Python |
"""
URLConf for OCR presets.
"""
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from ocradmin.presets import views
urlpatterns = patterns('',
(r'^builder/?$', login_required(views.builder)),
(r'^builder/(?P<pid>[^/]+)/?$', login_required(views.builder_doc_edit)),
(r'^clear_cache/?$', login_required(views.clear_cache)),
(r'^clear_node_cache/?$', views.clear_node_cache),
(r'^create/?$', login_required(views.presetcreate)),
(r'^createjson/?$', login_required(views.createjson)),
(r'^data/(?P<slug>[-\w]+)/?$', views.data),
(r'^delete/(?P<slug>[-\w]+)/?$', login_required(views.presetdelete)),
(r'^download/(?P<slug>[-\w]+)/?$', views.download),
(r'^edit/(?P<slug>[-\w]+)/?$', login_required(views.presetedit)),
(r'^fetch/?$', views.fetch),
(r'^layout_graph/?$', views.layout_graph),
(r'^list/?$', views.presetlist),
(r'^query/?$', views.query_nodes),
(r'^run/?$', views.run_preset),
(r'^show/(?P<slug>[-\w]+)/?$', views.presetdetail),
(r'^update_data/(?P<slug>[-\w]+)/?$', views.update_data),
(r'^upload/?$', login_required(views.upload_file)),
(r'^(?P<slug>[-\w]+)/?$', views.presetdetail),
)
| 40.6 | 73 | 0.618227 | [
"Apache-2.0"
] | DomWeldon/ocropodium | ocradmin/presets/urls.py | 1,218 | Python |
import collections
import itertools
import re
import yaml
from ansible.errors import AnsibleError
from cumulus_vxconfig.utils.filters import Filters
from cumulus_vxconfig.utils import File, Network, Link, Inventory, Host
filter = Filters()
mf = File().master()
inventory = Inventory()
class CheckVars:
'''
Pre-Check of variables defined in master.yml
'''
def _yaml_f(self, data, style="", flow=None, start=True):
return yaml.dump(
data, default_style=style,
explicit_start=start,
default_flow_style=flow
)
@property
def vlans(self):
master_vlans = mf['vlans']
vids = []
for tenant, vlans in master_vlans.items():
for vlan in vlans:
vids.append(vlan['id'])
dup_vids = [vid for vid in set(vids) if vids.count(vid) > 1]
if len(dup_vids) > 0:
error = {}
for tenant, value in master_vlans.items():
v = [v for v in value for d in dup_vids if v['id'] == d]
if len(v) > 0:
error[tenant] = v
msg = ("VLANID conflict:\nRefer to the errors "
"below and check the 'master.yml' file\n{}")
raise AnsibleError(
msg.format(self._yaml_f({'vlans': error}))
)
return master_vlans
@property
def mlag_bonds(self):
mlag_bonds = mf['mlag_bonds']
vids = {}
for tenant, vlans in self.vlans.items():
ids = []
for vlan in vlans:
ids.append(vlan['id'])
vids[tenant] = ids
vids_list = [x for i in vids.values() for x in i]
def _get_tenant(vid):
return ''.join([
k for k, v in self.vlans.items() for i in v if i['id'] == vid
])
for rack, bonds in mlag_bonds.items():
# Check for bonds member conflict
mems = filter.uncluster(
[i for v in bonds for i in v['members'].split(',')]
)
for mem in set(mems):
if mems.count(mem) > 1:
self._mlag_bonds_error(
rack, mem, 'bond member conflict: ' + mem
)
# Check for bonds name conflict
names = [v['name'] for v in bonds]
for name in set(names):
if names.count(name) > 1:
self._mlag_bonds_error(
rack, name, 'bond name conflict: ' + name
)
for bond in bonds:
set_items = set([])
bond_vids = filter.uncluster(bond['vids'])
for bond_vid in bond_vids:
# Check if assign vids exist in tenant vlans
if bond_vid not in vids_list:
self._mlag_bonds_error(
rack, bond['vids'], 'VLANID not found: ' + bond_vid
)
if len(bond_vids) > 1:
for bond_vid in bond_vids:
set_items.add((_get_tenant(bond_vid), bond['vids']))
if len(set_items) > 1:
title = ("bond assigned with a VLANID which "
"belongs to multiple tenant: ")
for item in set_items:
self._mlag_bonds_error(rack, item[1], title)
return mlag_bonds
def _mlag_bonds_error(self, rack, item, title):
bonds = []
for bond in mf['mlag_bonds'][rack]:
if item in filter.uncluster(bond['members']):
bonds.append(bond)
elif bond['name'] == item:
bonds.append(bond)
elif bond['vids'] == item:
bonds.append(bond)
if len(bonds) > 0:
msg = ("{}\nRefer to the errors below and "
"check the 'master.yml' file.\n{}")
raise AnsibleError(msg.format(
title, filter.yaml_format({'mlag_bonds': {rack: bonds}})
)
)
@property
def mlag_peerlink_interfaces(self):
mlag_peerlink_interfaces = mf['mlag_peerlink_interfaces']
ifaces = filter.uncluster(mlag_peerlink_interfaces)
dup_ifaces = [i for i in set(ifaces) if ifaces.count(i) > 1]
if len(dup_ifaces) > 0:
msg = ("interfaces conflict:\nRefer to the errors below and "
"check the 'master.yml' file.\n{}")
raise AnsibleError(
msg.format(self._yaml_f({
'mlag_peerlink_interfaces': mlag_peerlink_interfaces
}, flow=False)))
return ','.join(ifaces)
@property
def base_networks(self):
base_networks = mf['base_networks']
def networks():
networks = collections.defaultdict(list)
for k, v in base_networks.items():
if isinstance(v, dict):
for _k, _v in v.items():
net = Network(_v)
networks[net.id].append((k, _k, net))
else:
net = Network(v)
networks[net.id].append((k, net))
_networks = []
for k, v in networks.items():
_networks.extend(list(itertools.combinations(v, 2)))
return _networks
def overlaps():
for items in networks():
nets = items[0][-1], items[1][-1]
net_a, net_b = sorted(nets)
if net_a.overlaps(net_b):
return items
if overlaps() is not None:
error = collections.defaultdict(dict)
for item in overlaps():
if len(item) > 2:
error[item[0]][item[1]] = str(item[-1])
else:
error[item[0]] = str(item[-1])
msg = ("networks conflict:\nRefer to the errors below and "
"check the 'master.yml' file.\n{}")
raise AnsibleError(
msg.format(self._yaml_f(
{'base_networks': dict(error)}, flow=False))
)
return base_networks
def vlans_network(self, tenant, vlan, vlans_network=None):
vnp = Network(vlan['network_prefix'])
# Check vlan subnet against base_networks
for var, net in self.base_networks.items():
if var != 'vlans':
if var == 'loopbacks':
for group, network in net.items():
_net = Network(network)
if (vnp.overlaps(_net)
or _net.overlaps(vnp)):
msg = ("networks conflict:\nRefer to the errors "
"below and check the 'master.yml' file."
"\n{}\n{}")
raise AnsibleError(msg.format(
filter.yaml_format({
'vlans': {tenant: [vlan]}
}),
filter.yaml_format({
'base_networks': {var: {group: network}}
}, start=False)
))
else:
_net = Network(net)
if (vnp.overlaps(_net)
or _net.overlaps(vnp)):
msg = ("networks conflict:\nRefer to the errors below "
"and check the 'master.yml' file.\n{}\n{}")
raise AnsibleError(msg.format(
filter.yaml_format({'vlans': {tenant: [vlan]}}),
filter.yaml_format({
'base_networks': {var: net}}, start=False)
))
for k, v in vlans_network.items():
_vnp = Network(v['network_prefix'])
if (vnp.overlaps(_vnp)
or _vnp.overlaps(vnp)):
msg = ("networks conflict: {} overlaps with existing network "
"{}(VLAN{})\nRefer to the errors below and check the "
"'master.yml' file.\n{}")
raise AnsibleError(msg.format(
str(vnp), str(_vnp), v['id'],
filter.yaml_format({'vlans': {tenant: [vlan]}})
))
def link_base_network(self, name):
base_networks = self.base_networks
if name not in base_networks:
raise AnsibleError(
"Please define a base networks for network link '{}' in "
"'base_networks' variable in 'master.yml'".format(name)
)
return base_networks[name]
@property
def base_asn(self):
base_asn = mf['base_asn']
group_asn = ((k, v) for k, v in base_asn.items())
for group_asn in itertools.combinations(group_asn, 2):
g1, g2 = group_asn
if g1[1] == g2[1]:
msg = ("duplicate AS: {}\n"
"Refer to the errors below and check the "
"'master.yml' file.\n{}")
x = {item[0]: item[1] for item in group_asn}
raise AnsibleError(
msg.format(g1[1], filter.yaml_format({'base_asn': x}))
)
for k, _ in base_asn.items():
if k not in inventory.group_names():
raise AnsibleError(
'Group not found: {}'.format(k)
)
return base_asn
@property
def interfaces(self):
interfaces = collections.defaultdict(set)
# Interfaces in links
net_links = mf['network_links']
for k, v in net_links.items():
links = Link(k, v['links'])
device_interfaces = links.device_interfaces()
for dev in device_interfaces:
re_order = []
for item in device_interfaces[dev]:
port, link, var, name = item
re_order.append((port, var, name, link))
for item in re_order:
interfaces[dev].add(tuple(item))
# Interface in mlag bonds
mlag_bonds = self.mlag_bonds
for rack, bonds in mlag_bonds.items():
items = []
for idx, bond in enumerate(bonds):
members = filter.uncluster(bond['members'])
for member in members:
items.append((member, 'mlag_bonds', rack, idx))
for host in inventory.hosts('leaf'):
_host = Host(host)
if rack == _host.rack:
for item in items:
interfaces[host].add(tuple(item))
# Interfaces peerlink
ifaces = filter.uncluster(mf['mlag_peerlink_interfaces'])
for host in inventory.hosts('leaf'):
for iface in ifaces:
item = (
iface,
'mlag_peerlink_interfaces',
mf['mlag_peerlink_interfaces']
)
interfaces[host].add(tuple(item))
hosts = [h for h in interfaces if h in inventory.hosts()]
for host in hosts:
x = interfaces[host]
for k, v in interfaces.items():
if host in inventory.hosts(k):
interfaces[host] = interfaces[k] | x
for k, v in interfaces.items():
ports = [item[0] for item in v]
dup_ports = [item for item in set(ports) if ports.count(item) > 1]
if len(dup_ports):
error_items = [i for i in v if i[0] == dup_ports[0]]
yaml_vars = collections.defaultdict(dict)
for item in error_items:
port, mfvar, name, *r = item
if mfvar == 'network_links':
yaml_vars[mfvar][name] = {'links': [r[0]]}
elif mfvar == 'mlag_bonds':
yaml_vars[mfvar][name] = mf[mfvar][name][r[0]]
elif mfvar == 'mlag_peerlink_interfaces':
yaml_vars[mfvar] = name
_yaml_vars = {}
for k, v in yaml_vars.items():
if isinstance(v, collections.defaultdict):
_yaml_vars.update({k: dict(v)})
else:
_yaml_vars.update({k: v})
msg = ("overlapping interface: '{}'\n"
"Refer to the errors below and check the "
"'master.yml' file.\n{}")
raise AnsibleError(
msg.format(port, filter.yaml_format(_yaml_vars))
)
def _mlag_bonds(self, key='name'):
mlag_bonds = self.mlag_bonds
x = {}
for rack, bonds in mlag_bonds.items():
_groupby = {}
for k, v in itertools.groupby(bonds, lambda x: x[key]):
for item in list(v):
_groupby[k] = item
x[rack] = _groupby
return x
def _server_bonds(self, key='name'):
host_ifaces = mf['server_interfaces']
mlag_bonds = self._mlag_bonds()
servers = inventory.hosts('server')
is_rack_exist = True
is_bond_exist = True
_server_bonds = {}
for host, iface in host_ifaces.items():
if host in servers:
for idx, bond in enumerate(iface['bonds']):
rack = 'rack' + str(bond['rack'])
try:
mlag_bonds[rack]
except KeyError:
is_rack_exist = False
try:
vids = mlag_bonds[rack][bond['name']]['vids']
except KeyError:
is_bond_exist = False
if not is_rack_exist:
raise AnsibleError(
'rack not found: {} ({}) in {}'.format(
rack, list(mlag_bonds.keys()), host)
)
elif not is_bond_exist:
bonds = list(mlag_bonds[rack].keys())
raise AnsibleError(
'bond not found: {} ({}) in {}'.format(
bond['name'], bonds, host)
)
bond.update({'vids': vids, 'index': idx})
_groupby = collections.defaultdict(list)
for k, v in itertools.groupby(iface['bonds'], lambda x: x[key]):
list_v = list(v)
if key == 'slaves' or key == 'vids':
for item in filter.uncluster(k):
_groupby[item].extend(list_v)
else:
_groupby[k].extend(list_v)
_server_bonds[host] = _groupby
else:
raise AnsibleError(
"%s not found in inventory file, "
"check the master.yml in server_interfaces" % host
)
return _server_bonds
def server_bonds(self):
server_bonds = self._server_bonds()
mlag_bonds = self._mlag_bonds()
bonds = []
for host in server_bonds:
for bond, v in server_bonds[host].items():
# Check for duplicate bonds per host
if len(v) > 1:
msg = 'multiple bond assignment: {} in {}'
raise AnsibleError(msg.format(bond, host))
for item in v:
rack = 'rack' + str(item['rack'])
# Check if bond exist in rack per host
if item['name'] not in mlag_bonds[rack]:
racks = list(mlag_bonds[rack].keys())
raise AnsibleError(
"bond not found: {} ({}) in {}".format(
item['name'], racks, host)
)
item.update({'host': host})
bonds.extend(v)
# Check for duplicate bond slaves per host
for slave, v in self._server_bonds(key='slaves')[host].items():
if len(v) > 1:
bonds = [i['name'] for i in v]
msg = "multiple bond slaves assignment: {} ({}) in {}"
raise AnsibleError(msg.format(slave, bonds, host))
# Check for multiple vlan assignments per host
for vid, v in self._server_bonds(key='vids')[host].items():
if len(v) > 1:
msg = "multiple bond vlans assignment: {} ({}) in {}"
bonds = [i['name'] for i in v]
raise AnsibleError(msg.format('vlan' + vid, bonds, host))
# Check for multiple bond assignment per rack
for k, v in itertools.groupby(bonds, lambda x: x['rack']):
list_v = list(v)
y = collections.defaultdict(list)
for item in list_v:
y[item['name']].append(item)
for bond, _v in y.items():
if len(_v) > 1:
hosts = [i['host'] for i in _v]
msg = ('multiple bond assigment '
'with the same rack: {} in ({})')
raise AnsibleError(msg.format(bond, hosts))
return server_bonds
| 37.395349 | 80 | 0.466248 | [
"MIT"
] | rynldtbuen/ansible-configvars | cumulus_vxconfig/utils/checkvars.py | 17,688 | Python |
def solution(S, T):
#대소문자 변형
S = S.lower()
T = T.lower()
dic = {}
for i in S:
if dic.get(i):
dic[i] += 1
else:
dic[i] = 1
for i in T:
if dic.get(i):
dic[i] -= 1
else:
dic[i] = -1
for i in dic.values():
if i != 0:
return False
return True
S = "DOcING"
T = "CODING"
print(solution(S, T)) | 16.192308 | 26 | 0.391924 | [
"MIT"
] | love-adela/algorithm | codility/1_2.py | 433 | Python |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""Transformer model module."""
from .transformer import Transformer
from .encoder import TransformerEncoder
from .decoder import TransformerDecoder
from .beam_search import BeamSearchDecoder
from .transformer_for_train import TransformerTraining, LabelSmoothedCrossEntropyCriterion, \
TransformerNetworkWithLoss, TransformerTrainOneStepWithLossScaleCell
from .infer_mass import infer
__all__ = [
"infer",
"TransformerTraining",
"LabelSmoothedCrossEntropyCriterion",
"TransformerTrainOneStepWithLossScaleCell",
"TransformerNetworkWithLoss",
"Transformer",
"TransformerEncoder",
"TransformerDecoder",
"BeamSearchDecoder"
]
| 38 | 93 | 0.73985 | [
"Apache-2.0"
] | wudenggang/mindspore | model_zoo/mass/src/transformer/__init__.py | 1,330 | Python |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from collections import OrderedDict
import os
import re
from typing import Callable, Dict, Sequence, Tuple, Type, Union
import pkg_resources
import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials # type: ignore
from google.auth.transport import mtls # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore
from google.api_core import operation
from google.api_core import operation_async
from google.cloud.talent_v4beta1.services.job_service import pagers
from google.cloud.talent_v4beta1.types import common
from google.cloud.talent_v4beta1.types import job
from google.cloud.talent_v4beta1.types import job as gct_job
from google.cloud.talent_v4beta1.types import job_service
from google.protobuf import timestamp_pb2 as timestamp # type: ignore
from .transports.base import JobServiceTransport
from .transports.grpc import JobServiceGrpcTransport
from .transports.grpc_asyncio import JobServiceGrpcAsyncIOTransport
class JobServiceClientMeta(type):
"""Metaclass for the JobService client.
This provides class-level methods for building and retrieving
support objects (e.g. transport) without polluting the client instance
objects.
"""
_transport_registry = OrderedDict() # type: Dict[str, Type[JobServiceTransport]]
_transport_registry["grpc"] = JobServiceGrpcTransport
_transport_registry["grpc_asyncio"] = JobServiceGrpcAsyncIOTransport
def get_transport_class(cls, label: str = None,) -> Type[JobServiceTransport]:
"""Return an appropriate transport class.
Args:
label: The name of the desired transport. If none is
provided, then the first transport in the registry is used.
Returns:
The transport class to use.
"""
# If a specific transport is requested, return that one.
if label:
return cls._transport_registry[label]
# No transport is requested; return the default (that is, the first one
# in the dictionary).
return next(iter(cls._transport_registry.values()))
class JobServiceClient(metaclass=JobServiceClientMeta):
"""A service handles job management, including job CRUD,
enumeration and search.
"""
@staticmethod
def _get_default_mtls_endpoint(api_endpoint):
"""Convert api endpoint to mTLS endpoint.
Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
"*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
Args:
api_endpoint (Optional[str]): the api endpoint to convert.
Returns:
str: converted mTLS api endpoint.
"""
if not api_endpoint:
return api_endpoint
mtls_endpoint_re = re.compile(
r"(?P<name>[^.]+)(?P<mtls>\.mtls)?(?P<sandbox>\.sandbox)?(?P<googledomain>\.googleapis\.com)?"
)
m = mtls_endpoint_re.match(api_endpoint)
name, mtls, sandbox, googledomain = m.groups()
if mtls or not googledomain:
return api_endpoint
if sandbox:
return api_endpoint.replace(
"sandbox.googleapis.com", "mtls.sandbox.googleapis.com"
)
return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com")
DEFAULT_ENDPOINT = "jobs.googleapis.com"
DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore
DEFAULT_ENDPOINT
)
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.
Args:
filename (str): The path to the service account private key json
file.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.
Returns:
{@api.name}: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(filename)
kwargs["credentials"] = credentials
return cls(*args, **kwargs)
from_service_account_json = from_service_account_file
@staticmethod
def job_path(project: str, tenant: str, job: str,) -> str:
"""Return a fully-qualified job string."""
return "projects/{project}/tenants/{tenant}/jobs/{job}".format(
project=project, tenant=tenant, job=job,
)
@staticmethod
def parse_job_path(path: str) -> Dict[str, str]:
"""Parse a job path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/tenants/(?P<tenant>.+?)/jobs/(?P<job>.+?)$",
path,
)
return m.groupdict() if m else {}
def __init__(
self,
*,
credentials: credentials.Credentials = None,
transport: Union[str, JobServiceTransport] = None,
client_options: ClientOptions = None,
) -> None:
"""Instantiate the job service client.
Args:
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
transport (Union[str, ~.JobServiceTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (ClientOptions): Custom options for the client. It
won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS
environment variable can also be used to override the endpoint:
"always" (always use the default mTLS endpoint), "never" (always
use the default regular endpoint, this is the default value for
the environment variable) and "auto" (auto switch to the default
mTLS endpoint if client SSL credentials is present). However,
the ``api_endpoint`` property takes precedence if provided.
(2) The ``client_cert_source`` property is used to provide client
SSL credentials for mutual TLS transport. If not provided, the
default SSL credentials will be used if present.
Raises:
google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
creation failed for any reason.
"""
if isinstance(client_options, dict):
client_options = ClientOptions.from_dict(client_options)
if client_options is None:
client_options = ClientOptions.ClientOptions()
if client_options.api_endpoint is None:
use_mtls_env = os.getenv("GOOGLE_API_USE_MTLS", "never")
if use_mtls_env == "never":
client_options.api_endpoint = self.DEFAULT_ENDPOINT
elif use_mtls_env == "always":
client_options.api_endpoint = self.DEFAULT_MTLS_ENDPOINT
elif use_mtls_env == "auto":
has_client_cert_source = (
client_options.client_cert_source is not None
or mtls.has_default_client_cert_source()
)
client_options.api_endpoint = (
self.DEFAULT_MTLS_ENDPOINT
if has_client_cert_source
else self.DEFAULT_ENDPOINT
)
else:
raise MutualTLSChannelError(
"Unsupported GOOGLE_API_USE_MTLS value. Accepted values: never, auto, always"
)
# Save or instantiate the transport.
# Ordinarily, we provide the transport, but allowing a custom transport
# instance provides an extensibility point for unusual situations.
if isinstance(transport, JobServiceTransport):
# transport is a JobServiceTransport instance.
if credentials or client_options.credentials_file:
raise ValueError(
"When providing a transport instance, "
"provide its credentials directly."
)
if client_options.scopes:
raise ValueError(
"When providing a transport instance, "
"provide its scopes directly."
)
self._transport = transport
else:
Transport = type(self).get_transport_class(transport)
self._transport = Transport(
credentials=credentials,
credentials_file=client_options.credentials_file,
host=client_options.api_endpoint,
scopes=client_options.scopes,
api_mtls_endpoint=client_options.api_endpoint,
client_cert_source=client_options.client_cert_source,
quota_project_id=client_options.quota_project_id,
)
def create_job(
self,
request: job_service.CreateJobRequest = None,
*,
parent: str = None,
job: gct_job.Job = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> gct_job.Job:
r"""Creates a new job.
Typically, the job becomes searchable within 10 seconds,
but it may take up to 5 minutes.
Args:
request (:class:`~.job_service.CreateJobRequest`):
The request object. Create job request.
parent (:class:`str`):
Required. The resource name of the tenant under which
the job is created.
The format is
"projects/{project_id}/tenants/{tenant_id}". For
example, "projects/foo/tenant/bar". If tenant id is
unspecified a default tenant is created. For example,
"projects/foo".
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
job (:class:`~.gct_job.Job`):
Required. The Job to be created.
This corresponds to the ``job`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
~.gct_job.Job:
A Job resource represents a job posting (also referred
to as a "job listing" or "job requisition"). A job
belongs to a
[Company][google.cloud.talent.v4beta1.Company], which is
the hiring entity responsible for the job.
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([parent, job])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
# Minor optimization to avoid making a copy if the user passes
# in a job_service.CreateJobRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.CreateJobRequest):
request = job_service.CreateJobRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if parent is not None:
request.parent = parent
if job is not None:
request.job = job
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.create_job]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
# Done; return the response.
return response
def batch_create_jobs(
self,
request: job_service.BatchCreateJobsRequest = None,
*,
parent: str = None,
jobs: Sequence[job.Job] = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
r"""Begins executing a batch create jobs operation.
Args:
request (:class:`~.job_service.BatchCreateJobsRequest`):
The request object. Request to create a batch of jobs.
parent (:class:`str`):
Required. The resource name of the tenant under which
the job is created.
The format is
"projects/{project_id}/tenants/{tenant_id}". For
example, "projects/foo/tenant/bar". If tenant id is
unspecified, a default tenant is created. For example,
"projects/foo".
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
jobs (:class:`Sequence[~.job.Job]`):
Required. The jobs to be created.
This corresponds to the ``jobs`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
~.operation.Operation:
An object representing a long-running operation.
The result type for the operation will be
:class:``~.job_service.JobOperationResult``: The result
of
[JobService.BatchCreateJobs][google.cloud.talent.v4beta1.JobService.BatchCreateJobs]
or
[JobService.BatchUpdateJobs][google.cloud.talent.v4beta1.JobService.BatchUpdateJobs]
APIs. It's used to replace
[google.longrunning.Operation.response][google.longrunning.Operation.response]
in case of success.
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([parent, jobs])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
# Minor optimization to avoid making a copy if the user passes
# in a job_service.BatchCreateJobsRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.BatchCreateJobsRequest):
request = job_service.BatchCreateJobsRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if parent is not None:
request.parent = parent
if jobs is not None:
request.jobs = jobs
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.batch_create_jobs]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
# Wrap the response in an operation future.
response = operation.from_gapic(
response,
self._transport.operations_client,
job_service.JobOperationResult,
metadata_type=common.BatchOperationMetadata,
)
# Done; return the response.
return response
def get_job(
self,
request: job_service.GetJobRequest = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> job.Job:
r"""Retrieves the specified job, whose status is OPEN or
recently EXPIRED within the last 90 days.
Args:
request (:class:`~.job_service.GetJobRequest`):
The request object. Get job request.
name (:class:`str`):
Required. The resource name of the job to retrieve.
The format is
"projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}".
For example, "projects/foo/tenants/bar/jobs/baz".
If tenant id is unspecified, the default tenant is used.
For example, "projects/foo/jobs/bar".
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
~.job.Job:
A Job resource represents a job posting (also referred
to as a "job listing" or "job requisition"). A job
belongs to a
[Company][google.cloud.talent.v4beta1.Company], which is
the hiring entity responsible for the job.
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
# Minor optimization to avoid making a copy if the user passes
# in a job_service.GetJobRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.GetJobRequest):
request = job_service.GetJobRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.get_job]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)
# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
# Done; return the response.
return response
def update_job(
self,
request: job_service.UpdateJobRequest = None,
*,
job: gct_job.Job = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> gct_job.Job:
r"""Updates specified job.
Typically, updated contents become visible in search
results within 10 seconds, but it may take up to 5
minutes.
Args:
request (:class:`~.job_service.UpdateJobRequest`):
The request object. Update job request.
job (:class:`~.gct_job.Job`):
Required. The Job to be updated.
This corresponds to the ``job`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
~.gct_job.Job:
A Job resource represents a job posting (also referred
to as a "job listing" or "job requisition"). A job
belongs to a
[Company][google.cloud.talent.v4beta1.Company], which is
the hiring entity responsible for the job.
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([job])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
# Minor optimization to avoid making a copy if the user passes
# in a job_service.UpdateJobRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.UpdateJobRequest):
request = job_service.UpdateJobRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if job is not None:
request.job = job
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.update_job]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("job.name", request.job.name),)),
)
# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
# Done; return the response.
return response
def batch_update_jobs(
self,
request: job_service.BatchUpdateJobsRequest = None,
*,
parent: str = None,
jobs: Sequence[job.Job] = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
r"""Begins executing a batch update jobs operation.
Args:
request (:class:`~.job_service.BatchUpdateJobsRequest`):
The request object. Request to update a batch of jobs.
parent (:class:`str`):
Required. The resource name of the tenant under which
the job is created.
The format is
"projects/{project_id}/tenants/{tenant_id}". For
example, "projects/foo/tenant/bar". If tenant id is
unspecified, a default tenant is created. For example,
"projects/foo".
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
jobs (:class:`Sequence[~.job.Job]`):
Required. The jobs to be updated.
This corresponds to the ``jobs`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
~.operation.Operation:
An object representing a long-running operation.
The result type for the operation will be
:class:``~.job_service.JobOperationResult``: The result
of
[JobService.BatchCreateJobs][google.cloud.talent.v4beta1.JobService.BatchCreateJobs]
or
[JobService.BatchUpdateJobs][google.cloud.talent.v4beta1.JobService.BatchUpdateJobs]
APIs. It's used to replace
[google.longrunning.Operation.response][google.longrunning.Operation.response]
in case of success.
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([parent, jobs])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
# Minor optimization to avoid making a copy if the user passes
# in a job_service.BatchUpdateJobsRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.BatchUpdateJobsRequest):
request = job_service.BatchUpdateJobsRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if parent is not None:
request.parent = parent
if jobs is not None:
request.jobs = jobs
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.batch_update_jobs]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
# Wrap the response in an operation future.
response = operation.from_gapic(
response,
self._transport.operations_client,
job_service.JobOperationResult,
metadata_type=common.BatchOperationMetadata,
)
# Done; return the response.
return response
def delete_job(
self,
request: job_service.DeleteJobRequest = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes the specified job.
Typically, the job becomes unsearchable within 10
seconds, but it may take up to 5 minutes.
Args:
request (:class:`~.job_service.DeleteJobRequest`):
The request object. Delete job request.
name (:class:`str`):
Required. The resource name of the job to be deleted.
The format is
"projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}".
For example, "projects/foo/tenants/bar/jobs/baz".
If tenant id is unspecified, the default tenant is used.
For example, "projects/foo/jobs/bar".
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
# Minor optimization to avoid making a copy if the user passes
# in a job_service.DeleteJobRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.DeleteJobRequest):
request = job_service.DeleteJobRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.delete_job]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)
# Send the request.
rpc(
request, retry=retry, timeout=timeout, metadata=metadata,
)
def batch_delete_jobs(
self,
request: job_service.BatchDeleteJobsRequest = None,
*,
parent: str = None,
filter: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by
filter.
Args:
request (:class:`~.job_service.BatchDeleteJobsRequest`):
The request object. Batch delete jobs request.
parent (:class:`str`):
Required. The resource name of the tenant under which
the job is created.
The format is
"projects/{project_id}/tenants/{tenant_id}". For
example, "projects/foo/tenant/bar". If tenant id is
unspecified, a default tenant is created. For example,
"projects/foo".
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
filter (:class:`str`):
Required. The filter string specifies the jobs to be
deleted.
Supported operator: =, AND
The fields eligible for filtering are:
- ``companyName`` (Required)
- ``requisitionId`` (Required)
Sample Query: companyName = "projects/foo/companies/bar"
AND requisitionId = "req-1".
This corresponds to the ``filter`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([parent, filter])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
# Minor optimization to avoid making a copy if the user passes
# in a job_service.BatchDeleteJobsRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.BatchDeleteJobsRequest):
request = job_service.BatchDeleteJobsRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if parent is not None:
request.parent = parent
if filter is not None:
request.filter = filter
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.batch_delete_jobs]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
# Send the request.
rpc(
request, retry=retry, timeout=timeout, metadata=metadata,
)
def list_jobs(
self,
request: job_service.ListJobsRequest = None,
*,
parent: str = None,
filter: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListJobsPager:
r"""Lists jobs by filter.
Args:
request (:class:`~.job_service.ListJobsRequest`):
The request object. List jobs request.
parent (:class:`str`):
Required. The resource name of the tenant under which
the job is created.
The format is
"projects/{project_id}/tenants/{tenant_id}". For
example, "projects/foo/tenant/bar". If tenant id is
unspecified, a default tenant is created. For example,
"projects/foo".
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
filter (:class:`str`):
Required. The filter string specifies the jobs to be
enumerated.
Supported operator: =, AND
The fields eligible for filtering are:
- ``companyName`` (Required)
- ``requisitionId``
- ``status`` Available values: OPEN, EXPIRED, ALL.
Defaults to OPEN if no value is specified.
Sample Query:
- companyName =
"projects/foo/tenants/bar/companies/baz"
- companyName =
"projects/foo/tenants/bar/companies/baz" AND
requisitionId = "req-1"
- companyName =
"projects/foo/tenants/bar/companies/baz" AND status =
"EXPIRED".
This corresponds to the ``filter`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
~.pagers.ListJobsPager:
List jobs response.
Iterating over this object will yield
results and resolve additional pages
automatically.
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([parent, filter])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)
# Minor optimization to avoid making a copy if the user passes
# in a job_service.ListJobsRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.ListJobsRequest):
request = job_service.ListJobsRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if parent is not None:
request.parent = parent
if filter is not None:
request.filter = filter
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.list_jobs]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListJobsPager(
method=rpc, request=request, response=response, metadata=metadata,
)
# Done; return the response.
return response
def search_jobs(
self,
request: job_service.SearchJobsRequest = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.SearchJobsPager:
r"""Searches for jobs using the provided
[SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].
This call constrains the
[visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs
present in the database, and only returns jobs that the caller
has permission to search against.
Args:
request (:class:`~.job_service.SearchJobsRequest`):
The request object. The Request body of the `SearchJobs`
call.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
~.pagers.SearchJobsPager:
Response for SearchJob method.
Iterating over this object will yield
results and resolve additional pages
automatically.
"""
# Create or coerce a protobuf request object.
# Minor optimization to avoid making a copy if the user passes
# in a job_service.SearchJobsRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.SearchJobsRequest):
request = job_service.SearchJobsRequest(request)
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.search_jobs]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.SearchJobsPager(
method=rpc, request=request, response=response, metadata=metadata,
)
# Done; return the response.
return response
def search_jobs_for_alert(
self,
request: job_service.SearchJobsRequest = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.SearchJobsForAlertPager:
r"""Searches for jobs using the provided
[SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].
This API call is intended for the use case of targeting passive
job seekers (for example, job seekers who have signed up to
receive email alerts about potential job opportunities), and has
different algorithmic adjustments that are targeted to passive
job seekers.
This call constrains the
[visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs
present in the database, and only returns jobs the caller has
permission to search against.
Args:
request (:class:`~.job_service.SearchJobsRequest`):
The request object. The Request body of the `SearchJobs`
call.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
~.pagers.SearchJobsForAlertPager:
Response for SearchJob method.
Iterating over this object will yield
results and resolve additional pages
automatically.
"""
# Create or coerce a protobuf request object.
# Minor optimization to avoid making a copy if the user passes
# in a job_service.SearchJobsRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, job_service.SearchJobsRequest):
request = job_service.SearchJobsRequest(request)
# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.search_jobs_for_alert]
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
)
# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.SearchJobsForAlertPager(
method=rpc, request=request, response=response, metadata=metadata,
)
# Done; return the response.
return response
try:
_client_info = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-talent",).version,
)
except pkg_resources.DistributionNotFound:
_client_info = gapic_v1.client_info.ClientInfo()
__all__ = ("JobServiceClient",)
| 41.057726 | 106 | 0.606974 | [
"Apache-2.0"
] | busunkim96/python-talent | google/cloud/talent_v4beta1/services/job_service/client.py | 46,231 | Python |
from __future__ import absolute_import
from .textfield import TextField
from .textarea import Textarea
from .password import PasswordField
from .command import CommandField
from .dropdown import Dropdown
from .listbox import Listbox
from .checkbox import CheckBox
from .checkbox import BlockCheckbox
from .counter import Counter
from .radio_group import RadioGroup
from .choosers import *
from .dropdown_filterable import FilterableDropdown
from .numeric_fields import IntegerField, DecimalField
from .slider import Slider
| 31.764706 | 55 | 0.825926 | [
"MIT"
] | 3ehzad/Gooey | gooey/gui/components/widgets/__init__.py | 540 | Python |
from ...Classes.Material import Material
from ...Functions.Material.compare_material import compare_material
def replace_material_pyleecan_obj(obj, mat1, mat2, comp_name_path=True):
"""
replace first material by the second in the object
Parameters
----------
obj: Pyleecan object
mat1: Material
material to replace
mat2: Material
new material
comp_name_path: bool
replace strictly mat1 or replace materials without comparing mat1.path and mat1.name
Returns
-------
is_change: bool
True if a material has been replaced
"""
is_change = False
obj_dict = obj.as_dict()
if comp_name_path:
for key, val in obj_dict.items():
if isinstance(getattr(obj, key), Material) and getattr(obj, key) == mat1:
setattr(obj, key, mat2)
is_change = True
# Call the function recursively to modify attributes materials
elif isinstance(val, dict):
is_change_recurs = replace_material_pyleecan_obj(
getattr(obj, key), mat1, mat2, comp_name_path
)
# update is_change if needed
if not is_change:
is_change = is_change_recurs
else:
for key, val in obj_dict.items():
# Compare materials with mat1 without name and path
if isinstance(getattr(obj, key), Material) and compare_material(
getattr(obj, key), mat1
):
setattr(obj, key, mat2)
is_change = True
# Call the function recursively to modify attributes materials
elif isinstance(val, dict):
is_change_recurs = replace_material_pyleecan_obj(
getattr(obj, key), mat1, mat2, comp_name_path
)
# update is_change if needed
if not is_change:
is_change = is_change_recurs
return is_change
| 35.263158 | 92 | 0.589552 | [
"Apache-2.0"
] | BonneelP/pyleecan | pyleecan/Functions/Material/replace_material_pyleecan_obj.py | 2,010 | Python |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle
import paddle.nn.functional as F
__all__ = [
'pad_gt', 'gather_topk_anchors', 'check_points_inside_bboxes',
'compute_max_iou_anchor', 'compute_max_iou_gt',
'generate_anchors_for_grid_cell'
]
def pad_gt(gt_labels, gt_bboxes, gt_scores=None):
r""" Pad 0 in gt_labels and gt_bboxes.
Args:
gt_labels (Tensor|List[Tensor], int64): Label of gt_bboxes,
shape is [B, n, 1] or [[n_1, 1], [n_2, 1], ...], here n = sum(n_i)
gt_bboxes (Tensor|List[Tensor], float32): Ground truth bboxes,
shape is [B, n, 4] or [[n_1, 4], [n_2, 4], ...], here n = sum(n_i)
gt_scores (Tensor|List[Tensor]|None, float32): Score of gt_bboxes,
shape is [B, n, 1] or [[n_1, 4], [n_2, 4], ...], here n = sum(n_i)
Returns:
pad_gt_labels (Tensor, int64): shape[B, n, 1]
pad_gt_bboxes (Tensor, float32): shape[B, n, 4]
pad_gt_scores (Tensor, float32): shape[B, n, 1]
pad_gt_mask (Tensor, float32): shape[B, n, 1], 1 means bbox, 0 means no bbox
"""
if isinstance(gt_labels, paddle.Tensor) and isinstance(gt_bboxes,
paddle.Tensor):
assert gt_labels.ndim == gt_bboxes.ndim and \
gt_bboxes.ndim == 3
pad_gt_mask = (
gt_bboxes.sum(axis=-1, keepdim=True) > 0).astype(gt_bboxes.dtype)
if gt_scores is None:
gt_scores = pad_gt_mask.clone()
assert gt_labels.ndim == gt_scores.ndim
return gt_labels, gt_bboxes, gt_scores, pad_gt_mask
elif isinstance(gt_labels, list) and isinstance(gt_bboxes, list):
assert len(gt_labels) == len(gt_bboxes), \
'The number of `gt_labels` and `gt_bboxes` is not equal. '
num_max_boxes = max([len(a) for a in gt_bboxes])
batch_size = len(gt_bboxes)
# pad label and bbox
pad_gt_labels = paddle.zeros(
[batch_size, num_max_boxes, 1], dtype=gt_labels[0].dtype)
pad_gt_bboxes = paddle.zeros(
[batch_size, num_max_boxes, 4], dtype=gt_bboxes[0].dtype)
pad_gt_scores = paddle.zeros(
[batch_size, num_max_boxes, 1], dtype=gt_bboxes[0].dtype)
pad_gt_mask = paddle.zeros(
[batch_size, num_max_boxes, 1], dtype=gt_bboxes[0].dtype)
for i, (label, bbox) in enumerate(zip(gt_labels, gt_bboxes)):
if len(label) > 0 and len(bbox) > 0:
pad_gt_labels[i, :len(label)] = label
pad_gt_bboxes[i, :len(bbox)] = bbox
pad_gt_mask[i, :len(bbox)] = 1.
if gt_scores is not None:
pad_gt_scores[i, :len(gt_scores[i])] = gt_scores[i]
if gt_scores is None:
pad_gt_scores = pad_gt_mask.clone()
return pad_gt_labels, pad_gt_bboxes, pad_gt_scores, pad_gt_mask
else:
raise ValueError('The input `gt_labels` or `gt_bboxes` is invalid! ')
def gather_topk_anchors(metrics, topk, largest=True, topk_mask=None, eps=1e-9):
r"""
Args:
metrics (Tensor, float32): shape[B, n, L], n: num_gts, L: num_anchors
topk (int): The number of top elements to look for along the axis.
largest (bool) : largest is a flag, if set to true,
algorithm will sort by descending order, otherwise sort by
ascending order. Default: True
topk_mask (Tensor, bool|None): shape[B, n, topk], ignore bbox mask,
Default: None
eps (float): Default: 1e-9
Returns:
is_in_topk (Tensor, float32): shape[B, n, L], value=1. means selected
"""
num_anchors = metrics.shape[-1]
topk_metrics, topk_idxs = paddle.topk(
metrics, topk, axis=-1, largest=largest)
if topk_mask is None:
topk_mask = (topk_metrics.max(axis=-1, keepdim=True) > eps).tile(
[1, 1, topk])
topk_idxs = paddle.where(topk_mask, topk_idxs,
paddle.zeros_like(topk_idxs))
is_in_topk = F.one_hot(topk_idxs, num_anchors).sum(axis=-2)
is_in_topk = paddle.where(is_in_topk > 1,
paddle.zeros_like(is_in_topk), is_in_topk)
return is_in_topk.astype(metrics.dtype)
def check_points_inside_bboxes(points, bboxes, eps=1e-9):
r"""
Args:
points (Tensor, float32): shape[L, 2], "xy" format, L: num_anchors
bboxes (Tensor, float32): shape[B, n, 4], "xmin, ymin, xmax, ymax" format
eps (float): Default: 1e-9
Returns:
is_in_bboxes (Tensor, float32): shape[B, n, L], value=1. means selected
"""
points = points.unsqueeze([0, 1])
x, y = points.chunk(2, axis=-1)
xmin, ymin, xmax, ymax = bboxes.unsqueeze(2).chunk(4, axis=-1)
l = x - xmin
t = y - ymin
r = xmax - x
b = ymax - y
bbox_ltrb = paddle.concat([l, t, r, b], axis=-1)
return (bbox_ltrb.min(axis=-1) > eps).astype(bboxes.dtype)
def compute_max_iou_anchor(ious):
r"""
For each anchor, find the GT with the largest IOU.
Args:
ious (Tensor, float32): shape[B, n, L], n: num_gts, L: num_anchors
Returns:
is_max_iou (Tensor, float32): shape[B, n, L], value=1. means selected
"""
num_max_boxes = ious.shape[-2]
max_iou_index = ious.argmax(axis=-2)
is_max_iou = F.one_hot(max_iou_index, num_max_boxes).transpose([0, 2, 1])
return is_max_iou.astype(ious.dtype)
def compute_max_iou_gt(ious):
r"""
For each GT, find the anchor with the largest IOU.
Args:
ious (Tensor, float32): shape[B, n, L], n: num_gts, L: num_anchors
Returns:
is_max_iou (Tensor, float32): shape[B, n, L], value=1. means selected
"""
num_anchors = ious.shape[-1]
max_iou_index = ious.argmax(axis=-1)
is_max_iou = F.one_hot(max_iou_index, num_anchors)
return is_max_iou.astype(ious.dtype)
def generate_anchors_for_grid_cell(feats,
fpn_strides,
grid_cell_size=5.0,
grid_cell_offset=0.5):
r"""
Like ATSS, generate anchors based on grid size.
Args:
feats (List[Tensor]): shape[s, (b, c, h, w)]
fpn_strides (tuple|list): shape[s], stride for each scale feature
grid_cell_size (float): anchor size
grid_cell_offset (float): The range is between 0 and 1.
Returns:
anchors (List[Tensor]): shape[s, (l, 4)]
num_anchors_list (List[int]): shape[s]
stride_tensor_list (List[Tensor]): shape[s, (l, 1)]
"""
assert len(feats) == len(fpn_strides)
anchors = []
num_anchors_list = []
stride_tensor_list = []
for feat, stride in zip(feats, fpn_strides):
_, _, h, w = feat.shape
cell_half_size = grid_cell_size * stride * 0.5
shift_x = (paddle.arange(end=w) + grid_cell_offset) * stride
shift_y = (paddle.arange(end=h) + grid_cell_offset) * stride
shift_y, shift_x = paddle.meshgrid(shift_y, shift_x)
anchor = paddle.stack(
[
shift_x - cell_half_size, shift_y - cell_half_size,
shift_x + cell_half_size, shift_y + cell_half_size
],
axis=-1).astype(feat.dtype)
anchors.append(anchor.reshape([-1, 4]))
num_anchors_list.append(len(anchors[-1]))
stride_tensor_list.append(
paddle.full([num_anchors_list[-1], 1], stride))
return anchors, num_anchors_list, stride_tensor_list
| 41.617347 | 84 | 0.618855 | [
"Apache-2.0"
] | 17729703508/PaddleX | paddlex/ppdet/modeling/assigners/utils.py | 8,157 | Python |
#!/usr/bin/env python3
import sys
def application(env, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
return [b'Hello from Python %s' % sys.version.encode('utf-8')]
| 25.375 | 66 | 0.674877 | [
"MIT"
] | altermarkive/Scheduled-Tasks-with-Cron-Python-Ubuntu-Docker | uwsgi-nginx-container/root/app/main.py | 203 | Python |
import os
import logging
from mtkclient.Library.utils import LogBase
class damodes:
DEFAULT = 0
XFLASH = 1
class chipconfig:
def __init__(self, var1=None, watchdog=None, uart=None, brom_payload_addr=None,
da_payload_addr=None, pl_payload_addr=None, cqdma_base=None, sej_base=None, dxcc_base=None,
gcpu_base=None, ap_dma_mem=None, name="", description="", dacode=None,
meid_addr=None, socid_addr=None, blacklist=(), blacklist_count=None,
send_ptr=None, ctrl_buffer=(), cmd_handler=None, brom_register_access=None,
damode=damodes.DEFAULT, loader=None):
self.var1 = var1
self.watchdog = watchdog
self.uart = uart
self.brom_payload_addr = brom_payload_addr
self.da_payload_addr = da_payload_addr
self.pl_payload_addr = pl_payload_addr
self.cqdma_base = cqdma_base
self.ap_dma_mem = ap_dma_mem
self.sej_base = sej_base
self.dxcc_base = dxcc_base
self.name = name
self.description = description
self.dacode = dacode
self.blacklist = blacklist
self.blacklist_count = blacklist_count,
self.send_ptr = send_ptr,
self.ctrl_buffer = ctrl_buffer,
self.cmd_handler = cmd_handler,
self.brom_register_access = brom_register_access,
self.meid_addr = meid_addr
self.socid_addr = socid_addr
self.gcpu_base = gcpu_base
self.dacode = dacode
self.damode = damode
self.loader = loader
# Credits to cyrozap and Chaosmaster for some values
"""
0x0: chipconfig(var1=0x0,
watchdog=0x0,
uart=0x0,
brom_payload_addr=0x0,
da_payload_addr=0x0,
cqdma_base=0x0,
gcpu_base=0x0,
blacklist=[(0x0, 0x0),(0x00105704, 0x0)],
dacode=0x0,
name=""),
Needed fields
For hashimoto:
cqdma_base,
ap_dma_mem,
blacklist
For kamakiri:
var1
For amonet:
gpu_base
blacklist
"""
"""
0x5700: chipconfig( # var1
# watchdog
# uart
# brom_payload_addr
# da_payload_addr
gcpu_base=0x10016000,
# sej_base
# no dxcc
# cqdma_base
# ap_dma_mem
# blacklist
damode=damodes.DEFAULT,
# dacode
name="MT5700"),
0x6588: chipconfig( # var1
watchdog=0x10000000,
# uart
# brom_payload_addr
# da_payload_addr
# gcpu_base
# sej_base
# dxcc_base
# cqdma_base
ap_dma_mem=0x11000000 + 0x1A0,
# blacklist
damode=damodes.DEFAULT,
dacode=0x6588,
name="MT6588"),
"""
hwconfig = {
0x571: chipconfig( # var1
watchdog=0x10007000,
# uart
# brom_payload_addr
# da_payload_addr
# gcpu_base
# sej_base
# cqdma_base
# ap_dma_mem
# blacklist
damode=damodes.DEFAULT, #
dacode=0x0571,
name="MT0571"),
0x598: chipconfig( # var1
watchdog=0x10211000,
uart=0x11020000,
brom_payload_addr=0x100A00, # todo:check
da_payload_addr=0x201000, # todo:check
gcpu_base=0x10224000,
sej_base=0x1000A000,
cqdma_base=0x10212c00,
ap_dma_mem=0x11000000 + 0x1A0,
# blacklist
damode=damodes.DEFAULT,
dacode=0x0598,
name="ELBRUS/MT0598"),
0x992: chipconfig( # var1
# watchdog
# uart
# brom_payload_addr
# da_payload_addr
# gcpu_base
# sej_base
# cqdma_base
# ap_dma_mem
# blacklist
damode=damodes.XFLASH,
dacode=0x0992,
name="MT0992"),
0x2601: chipconfig(
var1=0xA, # Smartwatch, confirmed
watchdog=0x10007000,
uart=0x11005000,
brom_payload_addr=0x100A00,
da_payload_addr=0x2008000,
pl_payload_addr=0x81E00000, #
# no gcpu_base =0x10210000,
sej_base=0x1000A000, # hacc
# no dxcc
# no cqdma_base
# no ap_dma_mem
blacklist=[(0x11141F0C, 0x0), (0x11144BC4, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x11141f4c, 0xba68),
ctrl_buffer=0x11142BE0,
cmd_handler=0x0040C5AF,
brom_register_access=(0x40bd48, 0x40befc),
meid_addr=0x11142C34,
dacode=0x2601,
damode=damodes.DEFAULT, #
name="MT2601",
loader="mt2601_payload.bin"),
0x3967: chipconfig( # var1
# watchdog
# uart
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40020000,
# gcpu_base
# sej_base
# no dxcc
# cqdma_base
# ap_dma_mem
# blacklist
dacode=0x3967,
damode=damodes.DEFAULT,
name="MT3967"),
0x6255: chipconfig( # var1
# watchdog
# uart
# brom_payload_addr
# da_payload_addr
# gcpu_base
sej_base=0x80140000,
# no dxcc
# cqdma_base
# ap_dma_mem
# blacklist
damode=damodes.DEFAULT,
# dacode
name="MT6255"),
0x6261: chipconfig(
var1=0x28, # Smartwatch, confirmed
watchdog=0xA0030000,
uart=0xA0080000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
# no gcpu_base
sej_base=0xA0110000,
# no dxcc
# no cqdma_base
# no ap_dma_mem
blacklist=[(0xE003FC83, 0)],
send_ptr=(0x700044b0, 0x700058EC),
ctrl_buffer=0x700041A8,
cmd_handler=0x700061F6,
damode=damodes.DEFAULT,
dacode=0x6261,
name="MT6261",
loader="mt6261_payload.bin"
),
0x6280: chipconfig( # var1
# watchdog
# uart
# brom_payload_addr
# da_payload_addr
# gcpu_base
sej_base=0x80080000,
# no dxcc
# cqdma_base
# ap_dma_mem
# blacklist
damode=damodes.DEFAULT,
name="MT6280"
),
0x6516: chipconfig( # var1
watchdog=0x10003000,
uart=0x10023000,
da_payload_addr=0x201000, # todo: check
# gcpu_base
sej_base=0x1002D000,
# no dxcc
# cqdma_base
# ap_dma_mem
# blacklist
damode=damodes.DEFAULT,
dacode=0x6516,
name="MT6516"),
0x633: chipconfig( # var1
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00, # todo: check
da_payload_addr=0x201000,
pl_payload_addr=0x80001000, #
gcpu_base=0x1020D000,
sej_base=0x1000A000,
# no dxcc
cqdma_base=0x1020ac00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_P_DMA_I2C_RX_MEM_ADDR
damode=damodes.XFLASH,
dacode=0x6570,
name="MT6570"),
0x6571: chipconfig( # var1
watchdog=0x10007400,
# uart
da_payload_addr=0x2009000,
pl_payload_addr=0x80001000,
# gcpu_base
# sej_base
# no dxcc
# cqdma_base
# ap_dma_mem
# blacklist
damode=damodes.DEFAULT, #
dacode=0x6571,
name="MT6571"),
0x6572: chipconfig(
var1=0xA,
watchdog=0x10007000,
uart=0x11005000,
brom_payload_addr=0x10036A0,
da_payload_addr=0x2008000,
pl_payload_addr=0x81E00000, #
# gcpu_base
# sej_base
# no dxcc
# cqdma_base
ap_dma_mem=0x11000000 + 0x19C, # AP_P_DMA_I2C_1_MEM_ADDR
blacklist=[(0x11141F0C, 0), (0x11144BC4, 0)],
blacklist_count=0x00000008,
send_ptr=(0x11141f4c, 0xba68),
ctrl_buffer=0x11142BE0,
cmd_handler=0x40C5AF,
brom_register_access=(0xbd48, 0xbefc),
meid_addr=0x11142C34,
damode=damodes.DEFAULT, #
dacode=0x6572,
name="MT6572",
loader="mt6572_payload.bin"),
0x6573: chipconfig( # var1
watchdog=0x70025000,
# uart
da_payload_addr=0x90006000,
pl_payload_addr=0xf1020000,
# gcpu_base
sej_base=0x7002A000,
# no dxcc
# cqdma_base
# ap_dma_mem
# blacklist
damode=damodes.DEFAULT,
dacode=0x6573,
name="MT6573/MT6260"),
0x6575: chipconfig( # var1
watchdog=0xC0000000, #
# uart
da_payload_addr=0xc2001000,
pl_payload_addr=0xc2058000,
# gcpu_base
sej_base=0xC101A000,
# no dxcc
# cqdma_base
ap_dma_mem=0xC100119C,
# blacklist
damode=damodes.DEFAULT, #
dacode=0x6575,
name="MT6575/77"),
0x6577: chipconfig( # var1
watchdog=0xC0000000, # fixme
uart=0xC1009000,
da_payload_addr=0xc2001000,
pl_payload_addr=0xc2058000,
# gcpu_base
sej_base=0xC101A000,
# no dxcc
# cqdma_base
ap_dma_mem=0xC100119C,
# blacklist
damode=damodes.DEFAULT, #
dacode=0x6577,
name="MT6577"),
0x6580: chipconfig(var1=0xAC,
watchdog=0x10007000,
uart=0x11005000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x80001000, #
# no gcpu_base
sej_base=0x1000A000,
# dxcc_base
cqdma_base=0x1020AC00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_P_DMA_I2C_1_RX_MEM_ADDR
blacklist=[(0x102764, 0x0), (0x001071D4, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1027a4, 0xb60c),
ctrl_buffer=0x00103060,
cmd_handler=0x0000C113,
brom_register_access=(0xb8e0, 0xba94),
meid_addr=0x1030B4,
damode=damodes.DEFAULT,
dacode=0x6580,
name="MT6580",
loader="mt6580_payload.bin"),
0x6582: chipconfig(
var1=0xA, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x80001000, #
gcpu_base=0x1101B000,
sej_base=0x1000A000,
# no dxcc
# no cqdma_base
ap_dma_mem=0x11000000 + 0x320, # AP_DMA_I2C_0_RX_MEM_ADDR
blacklist=[(0x102788, 0x0), (0x00105BE4, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1027c8, 0xa5fc),
ctrl_buffer=0x00103078,
cmd_handler=0x0000B2E7,
brom_register_access=(0xa8d0, 0xaa84),
meid_addr=0x1030CC,
damode=damodes.DEFAULT, #
dacode=0x6582,
name="MT6582/MT6574",
loader="mt6582_payload.bin"),
0x6583: chipconfig( # var1
watchdog=0x10000000, # fixme
uart=0x11006000,
brom_payload_addr=0x100A00,
da_payload_addr=0x12001000,
pl_payload_addr=0x80001000, #
gcpu_base=0x10210000,
sej_base=0x1000A000,
# no dxcc
# blacklist
cqdma_base=0x10212000, # This chip might not support cqdma
ap_dma_mem=0x11000000 + 0x320, # AP_DMA_I2C_0_RX_MEM_ADDR
damode=damodes.DEFAULT,
dacode=0x6589,
name="MT6583/6589"),
0x6592: chipconfig(
var1=0xA, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x111000,
pl_payload_addr=0x80001000,
gcpu_base=0x10210000,
sej_base=0x1000A000,
# no dxcc
cqdma_base=0x10212000, # This chip might not support cqdma
ap_dma_mem=0x11000000 + 0x320, # AP_DMA_I2C_0_RX_MEM_ADDR
blacklist=[(0x00102764, 0), (0x00105BF0, 0)],
blacklist_count=0x00000008,
send_ptr=(0x1027a4, 0xa564),
ctrl_buffer=0x00103054,
cmd_handler=0x0000B09F,
brom_register_access=(0xa838, 0xa9ec),
meid_addr=0x1030A8,
dacode=0x6592,
damode=damodes.DEFAULT, #
name="MT6592",
loader="mt6592_payload.bin"),
0x6595: chipconfig(var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x111000,
# gcpu_base
sej_base=0x1000A000,
# dxcc_base
# cqdma_base
ap_dma_mem=0x11000000 + 0x1A0,
blacklist=[(0x00102768, 0), (0x0106c88, 0)],
blacklist_count=0x00000008,
send_ptr=(0x1027a8, 0xb218),
ctrl_buffer=0x00103050,
cmd_handler=0x0000BD53,
brom_register_access=(0xb4ec, 0xb6a0),
meid_addr=0x1030A4,
dacode=0x6595,
damode=damodes.DEFAULT, #
name="MT6595",
loader="mt6595_payload.bin"),
# 6725
0x321: chipconfig(
var1=0x28,
watchdog=0x10212000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10216000,
sej_base=0x10008000, # hacc
# no dxcc
cqdma_base=0x10217C00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_DMA_I2C_O_RX_MEM_ADDR
blacklist=[(0x00102760, 0x0), (0x00105704, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1027a0, 0x95f8),
ctrl_buffer=0x0010305C,
cmd_handler=0x0000A17F,
brom_register_access=(0x98cc, 0x9a94),
meid_addr=0x1030B0,
damode=damodes.DEFAULT, #
dacode=0x6735,
name="MT6735/T",
loader="mt6735_payload.bin"),
0x335: chipconfig(
var1=0x28, # confirmed
watchdog=0x10212000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10216000,
sej_base=0x10008000,
# no dxcc
cqdma_base=0x10217C00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_DMA_I2C_O_RX_MEM_ADDR
blacklist=[(0x00102760, 0x0), (0x00105704, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1027a0, 0x9608),
ctrl_buffer=0x0010305C,
cmd_handler=0x0000A18F,
brom_register_access=(0x98dc, 0x9aa4),
meid_addr=0x1030B0,
damode=damodes.DEFAULT, #
dacode=0x6735,
name="MT6737M",
loader="mt6737_payload.bin"),
# MT6738
0x699: chipconfig(
var1=0xB4,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000,
sej_base=0x1000A000, # hacc
dxcc_base=0x10210000,
cqdma_base=0x10212000,
ap_dma_mem=0x11000000 + 0x1a0, # AP_DMA_I2C_1_RX_MEM_ADDR
blacklist=[(0x10282C, 0x0), (0x001076AC, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x102870, 0xdf1c),
ctrl_buffer=0x00102A28,
cmd_handler=0x0000EC49,
brom_register_access=(0xe330, 0xe3e8),
meid_addr=0x102AF8,
socid_addr=0x102b08,
damode=damodes.XFLASH,
dacode=0x6739,
name="MT6739/MT6731",
loader="mt6739_payload.bin"),
0x601: chipconfig(
var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10210000,
sej_base=0x1000A000, # hacc
cqdma_base=0x10212C00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_DMA_I2C_1_RX_MEM_ADDR
# blacklist
damode=damodes.XFLASH,
dacode=0x6755,
name="MT6750"),
0x6752: chipconfig( # var1
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000, #
pl_payload_addr=0x40001000, #
gcpu_base=0x10210000,
sej_base=0x1000A000, # hacc
# no dxcc
cqdma_base=0x10212C00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_DMA_I2C_0_RX_MEM_ADDR
# blacklist
damode=damodes.DEFAULT, #
dacode=0x6752,
name="MT6752"),
0x337: chipconfig(
var1=0x28, # confirmed
watchdog=0x10212000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10216000,
sej_base=0x10008000,
# no dxcc
cqdma_base=0x10217C00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_DMA_I2C_0_RX_MEM_ADDR
blacklist=[(0x00102760, 0x0), (0x00105704, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1027a0, 0x9668),
ctrl_buffer=0x0010305C,
cmd_handler=0x0000A1EF,
brom_register_access=(0x993c, 0x9b04),
meid_addr=0x1030B0,
damode=damodes.DEFAULT, #
dacode=0x6735,
name="MT6753",
loader="mt6753_payload.bin"),
0x326: chipconfig(
var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10210000,
sej_base=0x1000A000, # hacc
# no dxcc
cqdma_base=0x10212C00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_DMA_I2C_1_RX_MEM_ADDR
blacklist=[(0x10276C, 0x0), (0x00105704, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1027b0, 0x9a6c),
ctrl_buffer=0x00103058,
cmd_handler=0x0000A5FF,
brom_register_access=(0x9d4c, 0x9f14),
meid_addr=0x1030AC,
damode=damodes.XFLASH,
dacode=0x6755,
name="MT6755/MT6750/M/T/S",
description="Helio P10/P15/P18",
loader="mt6755_payload.bin"),
0x551: chipconfig(
var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10210000,
sej_base=0x1000A000,
# no dxcc
cqdma_base=0x10212C00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_DMA_I2C_1_RX_MEM_ADDR
blacklist=[(0x102774, 0x0), (0x00105704, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x1027b8, 0x9c2c),
ctrl_buffer=0x00103060,
cmd_handler=0x0000A8FB,
brom_register_access=(0xa030, 0xa0e8),
meid_addr=0x1030B4,
damode=damodes.XFLASH,
dacode=0x6757,
name="MT6757/MT6757D",
description="Helio P20",
loader="mt6757_payload.bin"),
0x688: chipconfig(
var1=0xA,
watchdog=0x10211000, #
uart=0x11020000,
brom_payload_addr=0x100A00, #
da_payload_addr=0x201000, #
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000, #
sej_base=0x10080000, # hacc
dxcc_base=0x11240000, #
cqdma_base=0x10200000, #
ap_dma_mem=0x11000000 + 0x1A0, #
blacklist=[(0x102830,0),(0x106A60,0)],
blacklist_count=0xA,
send_ptr=(0x102874,0xd860),
ctrl_buffer=0x102B28,
cmd_handler=0xE58D,
brom_register_access=(0xdc74,0xdd2c),
meid_addr=0x102bf8,
socid_addr=0x102c08,
damode=damodes.XFLASH,
dacode=0x6758,
name="MT6758",
description="Helio P30",
loader="mt6758_payload.bin"
),
0x507: chipconfig( # var1
watchdog=0x10210000,
uart=0x11020000,
brom_payload_addr=0x100A00, # todo
da_payload_addr=0x201000,
# pl_payload_addr
gcpu_base=0x10210000,
# sej_base
# dxcc_base
# cqdma_base
ap_dma_mem=0x1030000 + 0x1A0, # todo
# blacklist
# blacklist_count
# send_ptr
# ctrl_buffer
# cmd_handler
# brom_Register_access
# meid_addr
damode=damodes.DEFAULT,
dacode=0x6758,
name="MT6759",
description="Helio P30"
# loader
),
0x717: chipconfig(
var1=0x25,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000,
sej_base=0x1000A000, # hacc
dxcc_base=0x10210000,
cqdma_base=0x10212000,
ap_dma_mem=0x11000a80 + 0x1a0, # AP_DMA_I2C_CH0_RX_MEM_ADDR
blacklist=[(0x102828, 0x0), (0x00105994, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x10286c, 0xbc8c),
ctrl_buffer=0x00102A28,
cmd_handler=0x0000C9B9,
brom_register_access=(0xc0a0, 0xc158),
meid_addr=0x102AF8,
socid_addr=0x102b08,
damode=damodes.XFLASH,
dacode=0x6761,
name="MT6761/MT6762/MT3369/MT8766B",
description="Helio A20/P22/A22/A25/G25",
loader="mt6761_payload.bin"),
0x690: chipconfig(
var1=0x7F,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000,
dxcc_base=0x10210000,
sej_base=0x1000A000, # hacc
cqdma_base=0x10212000,
ap_dma_mem=0x11000a80 + 0x1a0,
blacklist=[(0x102834, 0x0), (0x00106CA4, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x102878, 0xd66c),
ctrl_buffer=0x00102A90,
cmd_handler=0x0000E383,
brom_register_access=(0xda80, 0xdb38),
meid_addr=0x102B78,
socid_addr=0x102b88,
damode=damodes.XFLASH,
dacode=0x6763,
name="MT6763",
description="Helio P23",
loader="mt6763_payload.bin"),
0x766: chipconfig(
var1=0x25, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000, # not confirmed
sej_base=0x1000a000, # hacc
dxcc_base=0x10210000,
cqdma_base=0x10212000,
ap_dma_mem=0x11000000 + 0x1a0, # AP_DMA_I2C2_CH0_RX_MEM_ADDR
blacklist=[(0x102828, 0x0), (0x00105994, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x10286c, 0xbdc0),
ctrl_buffer=0x00102A28,
cmd_handler=0x0000CAED,
brom_register_access=(0xc1d4, 0xc28c),
meid_addr=0x102AF8,
socid_addr=0x102b08,
damode=damodes.XFLASH,
dacode=0x6765,
name="MT6765",
description="Helio P35/G35",
loader="mt6765_payload.bin"),
0x707: chipconfig(
var1=0x25,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000,
sej_base=0x1000A000, # hacc
dxcc_base=0x10210000,
cqdma_base=0x10212000,
ap_dma_mem=0x11000000 + 0x1A0,
blacklist=[(0x10282C, 0x0), (0x00105994, 0)],
blacklist_count=0x0000000A,
send_ptr=(0x10286c, 0xc190),
ctrl_buffer=0x00102A28,
cmd_handler=0x0000CF15,
brom_register_access=(0xc598, 0xc650),
meid_addr=0x102AF8,
socid_addr=0x102b08,
damode=damodes.XFLASH,
dacode=0x6768,
name="MT6768",
description="Helio P65/G85 k68v1",
loader="mt6768_payload.bin"),
0x788: chipconfig(
var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000,
sej_base=0x1000A000, # hacc
#dxcc_base=0x10210000, # dxcc_sec
cqdma_base=0x10212000,
ap_dma_mem=0x11000000 + 0x158, # AP_DMA_I2C_1_RX_MEM_ADDR
blacklist=[(0x00102834, 0x0), (0x00106A60, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x102878, 0xdebc),
ctrl_buffer=0x00102A80,
cmd_handler=0x0000EBE9,
brom_register_access=(0xe2d0, 0xe388),
meid_addr=0x102B38,
socid_addr=0x102B48,
damode=damodes.XFLASH,
dacode=0x6771,
name="MT6771/MT8385/MT8183/MT8666",
description="Helio P60/P70/G80",
loader="mt6771_payload.bin"),
# blacklist=[(0x00102830, 0x00200008), # Static permission table pointer
# (0x00102834, 2), # Static permission table entry count
# (0x00200000, 0x00000000), # Memory region minimum address
# (0x00200004, 0xfffffffc), # Memory region maximum address
# (0x00200008, 0x00000200), # Memory read command bitmask
# (0x0020000c, 0x00200000), # Memory region array pointer
# (0x00200010, 0x00000001), # Memory region array length
# (0x00200014, 0x00000400), # Memory write command bitmask
# (0x00200018, 0x00200000), # Memory region array pointer
# (0x0020001c, 0x00000001), # Memory region array length
# (0x00106A60, 0)], # Dynamic permission table entry count?),
0x725: chipconfig(var1=0xA, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000,
sej_base=0x1000a000, # hacc
dxcc_base=0x10210000,
cqdma_base=0x10212000,
ap_dma_mem=0x11000000 + 0x158,
blacklist=[(0x102838, 0x0), (0x00106A60, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x102878, 0xe04c),
ctrl_buffer=0x00102A80,
cmd_handler=0x0000ED6D,
brom_register_access=(0xe454, 0xe50c),
meid_addr=0x102B38,
socid_addr=0x102B48,
damode=damodes.XFLASH,
dacode=0x6779,
name="MT6779",
description="Helio P90 k79v1",
loader="mt6779_payload.bin"),
0x1066: chipconfig(
# var1=0xA, #confirmed
# watchdog=0x10007000,
# uart=0x11002000,
# brom_payload_addr=0x100A00,
# da_payload_addr=0x201000,
# pl_payload_addr=0x40200000,
# gcpu_base=0x10050000,
# sej_base=0x1000A000, # hacc
# dxcc_base=0x10210000,
# cqdma_base=0x10212000,
# ap_dma_mem=0x11000000 + 0x158,
# blacklist=[(0x102838, 0x0)],
# blacklist_count=0x0000000A,
# send_ptr=(0x102878,0xe2a4),
# ctrl_buffer=0x00102A80,
# cmd_handler=0x0000EFD9,
# brom_register_access=(0xe6ac,0xe764),
# meid_addr=0x102B38,
# socid_addr=0x102B48,
damode=damodes.XFLASH,
dacode=0x6781,
name="MT6781",
description="Helio A22",
# loader="mt6781_payload.bin"
),
0x813: chipconfig(var1=0xA, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000,
sej_base=0x1000A000, # hacc
dxcc_base=0x10210000,
cqdma_base=0x10212000,
ap_dma_mem=0x11000000 + 0x158,
blacklist=[(0x102838, 0x0), (0x00106A60, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x102878, 0xe2a4),
ctrl_buffer=0x00102A80,
cmd_handler=0x0000F029,
brom_register_access=(0xe6ac, 0xe764),
meid_addr=0x102B38,
socid_addr=0x102B48,
damode=damodes.XFLASH,
dacode=0x6785,
name="MT6785",
description="Helio G90",
loader="mt6785_payload.bin"),
0x6795: chipconfig(
var1=0xA, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x110000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10210000,
sej_base=0x1000A000, # hacc
# no dxcc
cqdma_base=0x10212c00,
ap_dma_mem=0x11000000 + 0x1A0,
blacklist=[(0x102764, 0x0), (0x00105704, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1027a4, 0x978c),
ctrl_buffer=0x0010304C,
cmd_handler=0x0000A313,
brom_register_access=(0x9a60, 0x9c28),
meid_addr=0x1030A0,
damode=damodes.DEFAULT, #
dacode=0x6795,
name="MT6795",
description="Helio X10",
loader="mt6795_payload.bin"),
0x279: chipconfig(
var1=0xA, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10210000,
# no dxcc
sej_base=0x1000A000, # hacc
cqdma_base=0x10212C00,
ap_dma_mem=0x11000000 + 0x1A0, # AP_DMA_I2C_1_RX_MEM_ADDR
blacklist=[(0x0010276C, 0x0), (0x00105704, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1027b0, 0x9eac),
ctrl_buffer=0x00103058,
cmd_handler=0x0000AA3F,
brom_register_access=(0xa18c, 0xa354),
meid_addr=0x1030AC,
damode=damodes.XFLASH,
dacode=0x6797,
name="MT6797/MT6767",
description="Helio X23/X25/X27",
loader="mt6797_payload.bin"),
0x562: chipconfig(
var1=0xA, # confirmed
watchdog=0x10211000,
uart=0x11020000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, # not confirmed
gcpu_base=0x10210000,
cqdma_base=0x11B30000,
ap_dma_mem=0x11000000 + 0x1A0, # AP_DMA_I2C_2_RX_MEM_ADDR
dxcc_base=0x11B20000,
sej_base=0x1000A000,
blacklist=[(0x00102870, 0x0), (0x00107070, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x1028b4, 0xf5ac),
ctrl_buffer=0x001032F0,
cmd_handler=0x000102C3,
brom_register_access=(0xf9c0, 0xfa78),
meid_addr=0x1033B8,
socid_addr=0x1033C8,
damode=damodes.XFLASH,
dacode=0x6799,
name="MT6799",
description="Helio X30/X35",
loader="mt6799_payload.bin"),
0x989: chipconfig(
var1=0x73,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00, #
da_payload_addr=0x201000, #
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000,
dxcc_base=0x10210000,
sej_base=0x1000a000, # hacc
cqdma_base=0x10212000,
ap_dma_mem=0x10217a80 + 0x1a0,
blacklist=[(0x00102844, 0x0), (0x00106B54, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x102884, 0xdfe0),
ctrl_buffer=0x00102AA4,
cmd_handler=0x0000EDAD,
brom_register_access=(0xe3e8, 0xe4a0),
meid_addr=0x102b98,
socid_addr=0x102ba8,
damode=damodes.XFLASH,
dacode=0x6833,
name="MT6833",
description="Dimensity 700 5G k6833",
loader="mt6833_payload.bin"),
0x996: chipconfig(var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000, #
gcpu_base=0x10050000,
dxcc_base=0x10210000,
cqdma_base=0x10212000,
sej_base=0x1000a000, # hacc
ap_dma_mem=0x10217a80 + 0x1A0,
blacklist=[(0x10284C, 0x0), (0x00106B60, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x10288c, 0xea64),
ctrl_buffer=0x00102AA0,
cmd_handler=0x0000F831,
brom_register_access=(0xee6c, 0xef24),
meid_addr=0x102b78,
socid_addr=0x102b88,
damode=damodes.XFLASH,
dacode=0x6853,
name="MT6853",
description="Dimensity 720 5G",
loader="mt6853_payload.bin"),
0x886: chipconfig(
var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000,
gcpu_base=0x10050000,
dxcc_base=0x10210000,
sej_base=0x1000a000, # hacc
cqdma_base=0x10212000,
ap_dma_mem=0x10217a80 + 0x1A0,
blacklist=[(0x10284C, 0x0), (0x00106B60, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x10288c, 0xea78),
ctrl_buffer=0x00102AA0,
cmd_handler=0x0000F7AD,
brom_register_access=(0xee80, 0xef38),
meid_addr=0x102B78,
socid_addr=0x102B88,
damode=damodes.XFLASH,
dacode=0x6873,
name="MT6873",
description="Dimensity 800/820 5G",
loader="mt6873_payload.bin"),
0x959: chipconfig(
var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000,
gcpu_base=0x10050000,
sej_base=0x1000a000, # hacc
dxcc_base=0x10210000,
cqdma_base=0x10212000,
ap_dma_mem=0x10217a80 + 0x1A0,
blacklist=[(0x102848, 0x0), (0x00106B60, 0x0)],
blacklist_count=0xA,
send_ptr=(0x102888,0xe8d0),
ctrl_buffer=0x00102A9C,
cmd_handler=0x0000F69D,
brom_register_access=(0xecd8,0xed90),
meid_addr=0x102b98,
socid_addr=0x102ba8,
damode=damodes.XFLASH,
dacode=0x6877, # todo
name="MT6877",
description="Dimensity 900",
loader="mt6877_payload.bin"
),
0x816: chipconfig(
var1=0xA, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000,
gcpu_base=0x10050000,
dxcc_base=0x10210000,
sej_base=0x1000a000, # hacc
cqdma_base=0x10212000,
ap_dma_mem=0x11000a80 + 0x1a0,
blacklist=[(0x102848, 0x0), (0x00106B60, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x102888, 0xE6FC),
ctrl_buffer=0x00102A9C,
cmd_handler=0x0000F481,
brom_register_access=(0xeb04, 0xebbc),
meid_addr=0x102B78,
socid_addr=0x102B88,
damode=damodes.XFLASH,
dacode=0x6885,
name="MT6885/MT6883/MT6889/MT6880/MT6890",
description="Dimensity 1000L/1000",
loader="mt6885_payload.bin"),
0x950: chipconfig(
var1=0xA, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000,
gcpu_base=0x10050000,
dxcc_base=0x10210000,
sej_base=0x1000a000, # hacc
cqdma_base=0x10212000,
ap_dma_mem=0x11000a80 + 0x1a0,
blacklist=[(0x102848, 0x0), (0x00106B60, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x102888, 0xE79C),
ctrl_buffer=0x00102A9C,
cmd_handler=0x0000F569,
brom_register_access=(0xeba4, 0xec5c),
meid_addr=0x102B98,
socid_addr=0x102BA8,
damode=damodes.XFLASH,
dacode=0x6893,
name="MT6893",
description="Dimensity 1200",
loader="mt6893_payload.bin"),
# Dimensity 1100 - MT6891 Realme Q3 Pro
0x8110: chipconfig( # var1
# watchdog
# uart
# brom_payload_addr
# da_payload_addr
# gcpu_base
# sej_base
# cqdma_base
# ap_dma_mem
# blacklist
damode=damodes.XFLASH,
dacode=0x8110,
name="MT8110"),
0x8127: chipconfig(
var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x80001000,
gcpu_base=0x11010000,
sej_base=0x1000A000,
# no cqdma_base
ap_dma_mem=0x11000000 + 0x1A0,
blacklist=[(0x102870, 0x0), (0x00106C7C, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1028b0, 0xb2b8),
ctrl_buffer=0x00103178,
cmd_handler=0x0000BDF3,
brom_register_access=(0xb58c, 0xb740),
meid_addr=0x1031CC,
damode=damodes.DEFAULT, #
dacode=0x8127,
name="MT8127/MT3367",
loader="mt8127_payload.bin"), # ford,austin,tank #mhmm wdt, nochmal checken
0x8135: chipconfig( # var1
watchdog=0x10000000,
# uart
# brom_payload_addr
da_payload_addr=0x12001000,
# pl_payload_addr
# gcpu_base
# sej_base
# cqdma_base
# ap_dma_mem
# blacklist
# blacklist_count
# send_ptr
# ctrl_buffer
# cmd_handler
# brom_register_access
# meid_addr
# socid_addr
damode=damodes.DEFAULT, #
dacode=0x8135,
name="MT8135"
# description
# loader
),
0x8163: chipconfig(
var1=0xB1,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40001000, #
gcpu_base=0x10210000,
sej_base=0x1000A000,
# no dxcc
cqdma_base=0x10212C00,
ap_dma_mem=0x11000000 + 0x1A0,
blacklist=[(0x102868, 0x0), (0x001072DC, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1028a8, 0xc12c),
ctrl_buffer=0x0010316C,
cmd_handler=0x0000CCB3,
brom_register_access=(0xc400, 0xc5c8),
meid_addr=0x1031C0,
damode=damodes.DEFAULT, #
dacode=0x8163,
name="MT8163",
loader="mt8163_payload.bin"), # douglas, karnak
0x8167: chipconfig(var1=0xCC,
watchdog=0x10007000,
uart=0x11005000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40001000, #
gcpu_base=0x1020D000,
sej_base=0x1000A000,
# no dxcc
cqdma_base=0x10212C00,
ap_dma_mem=0x11000000 + 0x1A0,
blacklist=[(0x102968, 0x0), (0x00107954, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x1029ac, 0xd2e4),
ctrl_buffer=0x0010339C,
cmd_handler=0x0000DFF7,
brom_register_access=(0xd6f2, 0xd7ac),
meid_addr=0x103478,
socid_addr=0x103488,
damode=damodes.XFLASH,
dacode=0x8167,
name="MT8167/MT8516/MT8362",
# description
loader="mt8167_payload.bin"),
0x8168: chipconfig( # var1
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
# pl_payload_addr=0x40001000
# gcpu_base
# sej_base=0x1000A000,
# cqdma_base
ap_dma_mem=0x11000280 + 0x1A0,
# blacklist
# blacklist_count
# send_ptr
# ctrl_buffer
# cmd_handler
# brom_register_access
# meid_addr
# socid_addr
damode=damodes.XFLASH,
dacode=0x8168,
name="MT8168"
# description
# loader
),
0x8172: chipconfig(
var1=0xA,
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x120A00,
da_payload_addr=0xC0000,
pl_payload_addr=0x40001000, #
# gcpu_base
sej_base=0x1000a000,
# no dxcc
cqdma_base=0x10212c00,
ap_dma_mem=0x11000000 + 0x1A0,
blacklist=[(0x122774, 0x0), (0x00125904, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1227b4, 0xa0e4),
ctrl_buffer=0x0012305C,
cmd_handler=0x0000AC6B,
brom_register_access=(0xa3b8, 0xa580),
meid_addr=0x1230B0,
damode=damodes.DEFAULT, #
dacode=0x8173,
name="MT8173",
# description
loader="mt8173_payload.bin"), # sloane, suez
0x8176: chipconfig(
# var1
watchdog=0x10212c00,
uart=0x11002000,
brom_payload_addr=0x120A00,
da_payload_addr=0xC0000,
pl_payload_addr=0x40200000,
# gcpu_base
sej_base=0x1000A000,
# no dxcc
cqdma_base=0x10212c00,
ap_dma_mem=0x11000000 + 0x1A0,
# blacklist
# blacklist_count
# send_ptr
# ctrl_buffer
# cmd_handler
# brom_register_access
# meid_addr
# socid_addr
dacode=0x8173,
damode=damodes.DEFAULT,
# description
name="MT8176"
# loader
),
0x930: chipconfig(
# var1
# watchdog
# uart
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000,
# gcpu_base
# sej_base
# cqdma_base
# ap_dma_mem
# blacklist
# blacklist_count
# send_ptr
# ctrl_buffer
# cmd_handler
# brom_register_access
# meid_addr
# socid_addr
dacode=0x8195,
damode=damodes.XFLASH,
# description
name="MT8195"
# loader
),
0x8512: chipconfig( # var1
# watchdog
# uart
# brom_payload_addr
da_payload_addr=0x111000,
# gcpu_base
# sej_base
# cqdma_base
# ap_dma_mem
# blacklist
# blacklist_count
# send_ptr
# ctrl_buffer
# cmd_handler
# brom_register_access
# meid_addr
# socid_addr
dacode=0x8512,
damode=damodes.XFLASH,
# description
name="MT8512"
# loader
),
0x8518: chipconfig( # var1
# watchdog
# uart
# brom_payload_addr
da_payload_addr=0x201000,
# gcpu_base
# sej_base
# cqdma_base
# ap_dma_mem
# blacklist
# blacklist_count
# send_ptr
# ctrl_buffer
# cmd_handler
# brom_register_access
# meid_addr
# socid_addr
dacode=0x8518,
damode=damodes.XFLASH,
name="MT8518"),
0x8590: chipconfig(
var1=0xA, # confirmed, router
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x80001000,
gcpu_base=0x1101B000,
sej_base=0x1000A000,
# cqdma_base
# ap_dma_mem=0x11000000 + 0x1A0,
blacklist=[(0x102870, 0x0), (0x106c7c, 0x0)],
blacklist_count=0x00000008,
send_ptr=(0x1028b0, 0xbbe4),
ctrl_buffer=0x00103184,
cmd_handler=0x0000C71F,
brom_register_access=(0xbeb8, 0xc06c),
meid_addr=0x1031D8,
dacode=0x8590,
damode=damodes.DEFAULT,
name="MT8590/MT7683/MT8521/MT7623",
# description=
loader="mt8590_payload.bin"),
0x8695: chipconfig(
var1=0xA, # confirmed
watchdog=0x10007000,
uart=0x11002000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40001000, #
# gcpu_base
sej_base=0x1000A000,
# cqdma_base
ap_dma_mem=0x11000280 + 0x1A0,
blacklist=[(0x103048, 0x0), (0x00106EC4, 0x0)],
blacklist_count=0x0000000A,
send_ptr=(0x103088, 0xbeec),
ctrl_buffer=0x001031EC,
cmd_handler=0x0000CAA7,
brom_register_access=(0xc298, 0xc3f8),
meid_addr=0x1032B8,
damode=damodes.XFLASH,
dacode=0x8695,
name="MT8695", # mantis
# description
loader="mt8695_payload.bin"),
0x908: chipconfig(
# var1
watchdog=0x10007000,
# uart
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
# gcpu_base
# sej_base
# cqdma_base
# ap_dma_mem
# blacklist
# blacklist_count
# send_ptr
# ctrl_buffer
# cmd_handler
# brom_register_access
# meid_addr
# socid_addr
damode=damodes.XFLASH,
dacode=0x8696,
# description
name="MT8696"
# loader
),
}
class Mtk_Config(metaclass=LogBase):
def __init__(self, loglevel=logging.INFO):
self.pid = -1
self.vid = -1
self.var1 = 0xA
self.is_brom = False
self.skipwdt = False
self.interface = -1
self.readsocid = False
self.enforcecrash = False
self.debugmode = False
self.preloader = None
self.payloadfile = None
self.loader = None
self.ptype = "kamakiri2"
self.generatekeys = None
self.bmtflag = None
self.bmtblockcount = None
self.bmtpartsize = None
self.packetsizeread = 0x400
self.flashinfo = None
self.flashsize = 0
self.readsize = 0
self.sparesize = 16
self.plcap = None
self.blver = -2
self.da = None
self.gcpu = None
self.pagesize = 512
self.SECTOR_SIZE_IN_BYTES = 4096 # fixme
self.baudrate = 115200
self.flash = "emmc"
self.cpu = ""
self.hwcode = None
self.meid = None
self.target_config = None
self.chipconfig = chipconfig()
if loglevel == logging.DEBUG:
logfilename = os.path.join("logs", "log.txt")
fh = logging.FileHandler(logfilename)
self.__logger.addHandler(fh)
self.__logger.setLevel(logging.DEBUG)
else:
self.__logger.setLevel(logging.INFO)
def default_values(self, hwcode):
if self.chipconfig.var1 is None:
self.chipconfig.var1 = 0xA
if self.chipconfig.watchdog is None:
self.chipconfig.watchdog = 0x10007000
if self.chipconfig.uart is None:
self.chipconfig.uart = 0x11002000
if self.chipconfig.brom_payload_addr is None:
self.chipconfig.brom_payload_addr = 0x100A00
if self.chipconfig.da_payload_addr is None:
self.chipconfig.da_payload_addr = 0x200000
if self.chipconfig.cqdma_base is None:
self.chipconfig.cqdma_base = None
if self.chipconfig.gcpu_base is None:
self.chipconfig.gcpu_base = None
if self.chipconfig.sej_base is None:
self.chipconfig.sej_base = None
if self.chipconfig.dacode is None:
self.chipconfig.dacode = hwcode
if self.chipconfig.ap_dma_mem is None:
self.chipconfig.ap_dma_mem = 0x11000000 + 0x1A0
if self.chipconfig.damode is None:
self.chipconfig.damode = damodes.DEFAULT
if self.chipconfig.dxcc_base is None:
self.chipconfig.dxcc_base = None
if self.chipconfig.meid_addr is None:
self.chipconfig.meid_addr = None
if self.chipconfig.socid_addr is None:
self.chipconfig.socid_addr = None
def init_hwcode(self, hwcode):
self.hwcode = hwcode
if hwcode in hwconfig:
self.chipconfig = hwconfig[hwcode]
else:
self.chipconfig = chipconfig()
self.default_values(hwcode)
def get_watchdog_addr(self):
wdt = self.chipconfig.watchdog
if wdt != 0:
if wdt == 0x10007000:
return [wdt, 0x22000064]
elif wdt == 0x10212000:
return [wdt, 0x22000000]
elif wdt == 0x10211000:
return [wdt, 0x22000064]
elif wdt == 0x10007400:
return [wdt, 0x22000000]
elif wdt == 0xC0000000:
return [wdt, 0x0]
elif wdt == 0x2200:
if self.hwcode == 0x6276 or self.hwcode == 0x8163:
return [wdt, 0x610C0000]
elif self.hwcode == 0x6251 or self.hwcode == 0x6516:
return [wdt, 0x80030000]
elif self.hwcode == 0x6255:
return [wdt, 0x701E0000]
else:
return [wdt, 0x70025000]
else:
return [wdt, 0x22000064]
def bmtsettings(self, hwcode):
bmtflag = 1
bmtblockcount = 0
bmtpartsize = 0
if hwcode in [0x6592, 0x6582, 0x8127, 0x6571]:
if self.flash == "emmc":
bmtflag = 1
bmtblockcount = 0xA8
bmtpartsize = 0x1500000
elif hwcode in [0x6570, 0x8167, 0x6580, 0x6735, 0x6753, 0x6755, 0x6752, 0x6595, 0x6795, 0x6767, 0x6797, 0x8163]:
bmtflag = 1
bmtpartsize = 0
elif hwcode in [0x6571]:
if self.flash == "nand":
bmtflag = 0
bmtblockcount = 0x38
bmtpartsize = 0xE00000
elif self.flash == "emmc":
bmtflag = 1
bmtblockcount = 0xA8
bmtpartsize = 0x1500000
elif hwcode in [0x6575]:
if self.flash == "nand":
bmtflag = 0
bmtblockcount = 0x50
elif self.flash == "emmc":
bmtflag = 1
bmtblockcount = 0xA8
bmtpartsize = 0x1500000
elif hwcode in [0x6572]:
if self.flash == "nand":
bmtflag = 0
bmtpartsize = 0xA00000
bmtblockcount = 0x50
elif self.flash == "emmc":
bmtflag = 0
bmtpartsize = 0xA8
bmtblockcount = 0x50
elif hwcode in [0x6577, 0x6583, 0x6589]:
if self.flash == "nand":
bmtflag = 0
bmtpartsize = 0xA00000
bmtblockcount = 0xA8
self.bmtflag = bmtflag
self.bmtblockcount = bmtblockcount
self.bmtpartsize = bmtpartsize
return bmtflag, bmtblockcount, bmtpartsize
| 32.865947 | 120 | 0.569059 | [
"MIT"
] | ligteltelecom/mtkclient | mtkclient/config/brom_config.py | 51,731 | Python |
import collections
from tensorflow.keras.losses import SparseCategoricalCrossentropy, BinaryCrossentropy
from tensorflow.keras.metrics import Mean, Accuracy
optimizer = SGD(lr=0.01, momentum=0.9, nesterov=True)
cce = SparseCategoricalCrossentropy()
bce = BinaryCrossentropy()
model.compile(
optimizer=optimizer,
loss=[cce, bce],
metrics=["accuracy"]
)
def train_epoch(source_train_generator, target_train_generator):
global lambda_factor, global_step
# Keras provide helpful classes to monitor various metrics:
epoch_source_digits = tf.keras.metrics.Mean(name="source_digits_loss")
epoch_source_domains = tf.keras.metrics.Mean(name="source_domain_loss")
epoch_target_domains = tf.keras.metrics.Mean(name="target_domain_loss")
epoch_accuracy = tf.keras.metrics.SparseCategoricalAccuracy("source_digits_accuracy")
# Fetch all trainable variables but those used uniquely for the digits classification:
variables_but_classifier = list(filter(lambda x: "digits" not in x.name, model.trainable_variables))
loss_record = collections.defaultdict(list)
for i, data in enumerate(zip(source_train_generator, target_train_generator)):
source_data, target_data = data
# Training digits classifier & domain classifier on source:
x_source, y_source, d_source = source_data
with tf.GradientTape() as tape:
digits_prob, domains_probs = model(x_source)
digits_loss = cce(y_source, digits_prob)
domains_loss = bce(d_source, domains_probs)
source_loss = digits_loss + 0.2 * domains_loss
gradients = tape.gradient(source_loss, model.trainable_variables)
optimizer.apply_gradients(zip(gradients, model.trainable_variables))
epoch_source_digits(digits_loss)
epoch_source_domains(domains_loss)
epoch_accuracy(y_source, digits_prob)
# Training domain classifier on target:
x_target, d_target = target_data
with tf.GradientTape() as tape:
_, domains_probs = model(x_target)
target_loss = 0.2 * bce(d_target, domains_probs)
gradients = tape.gradient(target_loss, variables_but_classifier)
optimizer.apply_gradients(zip(gradients, variables_but_classifier))
epoch_target_domains(target_loss)
print("Source digits loss={}, Source Accuracy={}, Source domain loss={}, Target domain loss={}".format(
epoch_source_digits.result(), epoch_accuracy.result(),
epoch_source_domains.result(), epoch_target_domains.result()))
for epoch in range(epochs):
print("Epoch: {}".format(epoch), end=" ")
loss_record = train_epoch(source_train_generator, target_train_generator)
| 39.434783 | 107 | 0.732819 | [
"MIT"
] | Mougatine/lectures-labs | labs/10_unsupervised_generative_models/solutions/grl_training.py | 2,721 | Python |
"""Test module for detecting uncollectable garbage in PyTables.
This test module *must* be loaded in the last place. It just checks for
the existence of uncollectable garbage in ``gc.garbage`` after running
all the tests.
"""
import gc
from tables.tests import common
class GarbageTestCase(common.PyTablesTestCase):
"""Test for uncollectable garbage."""
def test00(self):
"""Checking for uncollectable garbage."""
garbageLen = len(gc.garbage)
if garbageLen == 0:
return # success
if common.verbose:
classCount = {}
# Count uncollected objects for each class.
for obj in gc.garbage:
objClass = obj.__class__.__name__
if objClass in classCount:
classCount[objClass] += 1
else:
classCount[objClass] = 1
incidence = ['``%s``: %d' % (cls, cnt)
for (cls, cnt) in classCount.items()]
print("Class incidence:", ', '.join(incidence))
self.fail("Possible leak: %d uncollected objects." % garbageLen)
def suite():
"""Return a test suite consisting of all the test cases in the module."""
theSuite = common.unittest.TestSuite()
theSuite.addTest(common.unittest.makeSuite(GarbageTestCase))
return theSuite
if __name__ == '__main__':
import sys
common.parse_argv(sys.argv)
common.print_versions()
common.unittest.main(defaultTest='suite')
| 28.961538 | 77 | 0.616202 | [
"BSD-3-Clause"
] | Daybreak2019/PyTables | tables/tests/test_garbage.py | 1,506 | Python |
import logging
import random
import re
from uuid import UUID
import dateutil.parser
import w3lib.url
from yarl import URL
from .captcha import CaptchaSolver
from .starbelly_pb2 import (
PatternMatch as PbPatternMatch,
PolicyRobotsTxt as PbPolicyRobotsTxt,
PolicyUrlRule as PbPolicyUrlRule
)
logger = logging.getLogger(__name__)
ACTION_ENUM = PbPolicyUrlRule.Action
MATCH_ENUM = PbPatternMatch
USAGE_ENUM = PbPolicyRobotsTxt.Usage
class PolicyValidationError(Exception):
''' Custom error for policy validation. '''
def _invalid(message, location=None):
''' A helper for validating policies. '''
if location is None:
raise PolicyValidationError(f'{message}.')
raise PolicyValidationError(f'{message} in {location}.')
class Policy:
''' A container for subpolicies. '''
@staticmethod
def convert_doc_to_pb(doc, pb):
'''
Convert policy from database document to protobuf.
:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.Policy
'''
if 'id' in doc:
pb.policy_id = UUID(doc['id']).bytes
pb.name = doc['name']
pb.created_at = doc['created_at'].isoformat()
pb.updated_at = doc['updated_at'].isoformat()
# A copy of a policy is stored with each job, so we need to be able
# to gracefully handle old policies that are missing expected fields.
PolicyAuthentication.convert_doc_to_pb(doc.get('authentication',
dict()), pb.authentication)
if doc.get('captcha_solver_id') is not None:
pb.captcha_solver_id = UUID(doc['captcha_solver_id']).bytes
PolicyLimits.convert_doc_to_pb(doc.get('limits', dict()), pb.limits)
PolicyMimeTypeRules.convert_doc_to_pb(doc.get('mime_type_rules',
list()), pb.mime_type_rules)
PolicyProxyRules.convert_doc_to_pb(doc.get('proxy_rules', list()),
pb.proxy_rules)
PolicyRobotsTxt.convert_doc_to_pb(doc.get('robots_txt', dict()),
pb.robots_txt)
PolicyUrlNormalization.convert_doc_to_pb(doc.get('url_normalization',
dict()), pb.url_normalization)
PolicyUrlRules.convert_doc_to_pb(doc.get('url_rules', list()),
pb.url_rules)
PolicyUserAgents.convert_doc_to_pb(doc.get('user_agents', list()),
pb.user_agents)
@staticmethod
def convert_pb_to_doc(pb):
'''
Convert protobuf to database document.
:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.Policy.
:returns: Database document.
:rtype: dict
'''
doc = {
'name': pb.name,
'authentication': dict(),
'limits': dict(),
'mime_type_rules': list(),
'proxy_rules': list(),
'robots_txt': dict(),
'url_normalization': dict(),
'url_rules': list(),
'user_agents': list(),
}
if pb.HasField('policy_id'):
doc['id'] = str(UUID(bytes=pb.policy_id))
if pb.HasField('created_at'):
doc['created_at'] = dateutil.parser.parse(pb.created_at)
if pb.HasField('updated_at'):
doc['updated_at'] = dateutil.parser.parse(pb.updated_at)
PolicyAuthentication.convert_pb_to_doc(pb.authentication,
doc['authentication'])
if pb.HasField('captcha_solver_id'):
doc['captcha_solver_id'] = str(UUID(bytes=pb.captcha_solver_id))
else:
doc['captcha_solver_id'] = None
PolicyLimits.convert_pb_to_doc(pb.limits, doc['limits'])
PolicyMimeTypeRules.convert_pb_to_doc(pb.mime_type_rules,
doc['mime_type_rules'])
PolicyProxyRules.convert_pb_to_doc(pb.proxy_rules, doc['proxy_rules'])
PolicyRobotsTxt.convert_pb_to_doc(pb.robots_txt, doc['robots_txt'])
PolicyUrlNormalization.convert_pb_to_doc(pb.url_normalization,
doc['url_normalization'])
PolicyUrlRules.convert_pb_to_doc(pb.url_rules, doc['url_rules'])
PolicyUserAgents.convert_pb_to_doc(pb.user_agents, doc['user_agents'])
return doc
def __init__(self, doc, version, seeds):
'''
Initialize a policy object from its database document.
:param dict doc: A database document.
:param str version: The version number of Starbelly that created the
policy.
:param list seeds: A list of seed URLs, used for computing costs for
crawled links.
'''
if doc['name'].strip() == '':
_invalid('Policy name cannot be blank')
self.authentication = PolicyAuthentication(doc['authentication'])
if 'captcha_solver' in doc:
self.captcha_solver = CaptchaSolver(doc['captcha_solver'])
else:
self.captcha_solver = None
self.limits = PolicyLimits(doc['limits'])
self.mime_type_rules = PolicyMimeTypeRules(doc['mime_type_rules'])
self.proxy_rules = PolicyProxyRules(doc['proxy_rules'])
self.robots_txt = PolicyRobotsTxt(doc['robots_txt'])
self.url_normalization = PolicyUrlNormalization(
doc['url_normalization'])
self.url_rules = PolicyUrlRules(doc['url_rules'], seeds)
self.user_agents = PolicyUserAgents(doc['user_agents'], version)
def replace_mime_type_rules(self, rules):
'''
Return a shallow copy of this policy with new MIME type rules from
``doc``.
:param list rules: MIME type rules in database document form.
:returns: A new policy.
:rtype: Policy
'''
policy = Policy.__new__(Policy)
policy.authentication = self.authentication
policy.captcha_solver = self.captcha_solver
policy.limits = self.limits
policy.mime_type_rules = PolicyMimeTypeRules(rules)
policy.proxy_rules = self.proxy_rules
policy.robots_txt = self.robots_txt
policy.url_normalization = self.url_normalization
policy.url_rules = self.url_rules
policy.user_agents = self.user_agents
return policy
class PolicyAuthentication:
''' Policy for authenticated crawling. '''
@staticmethod
def convert_doc_to_pb(doc, pb):
'''
Convert from database document to protobuf.
:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.PolicyAuthentication
'''
pb.enabled = doc['enabled']
@staticmethod
def convert_pb_to_doc(pb, doc):
'''
Convert protobuf to database document.
:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyAuthentication
:returns: Database document.
:rtype: dict
'''
doc['enabled'] = pb.enabled
def __init__(self, doc):
'''
Initialize from a database document.
:param dict doc: A database document.
'''
self._enabled = doc.get('enabled', False)
def is_enabled(self):
'''
Return True if authentication is enabled.
:rtype: bool
'''
return self._enabled
class PolicyLimits:
''' Limits on crawl size/duration. '''
@staticmethod
def convert_doc_to_pb(doc, pb):
'''
Convert from database document to protobuf.
:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.PolicyLimits
'''
if doc.get('max_cost') is not None:
pb.max_cost = doc['max_cost']
if doc.get('max_duration') is not None:
pb.max_duration = doc['max_duration']
if doc.get('max_items') is not None:
pb.max_items = doc['max_items']
@staticmethod
def convert_pb_to_doc(pb, doc):
'''
Convert protobuf to database document.
:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyLimits
:returns: Database document.
:rtype: dict
'''
doc['max_cost'] = pb.max_cost if pb.HasField('max_cost') else None
doc['max_duration'] = pb.max_duration if pb.HasField('max_duration') \
else None
doc['max_items'] = pb.max_items if pb.HasField('max_items') else None
def __init__(self, doc):
'''
Initialize from a database document.
:param dict doc: A database document.
'''
self._max_cost = doc.get('max_cost')
self._max_duration = doc.get('max_duration')
self._max_items = doc.get('max_items')
if self._max_duration is not None and self._max_duration < 0:
_invalid('Max duration must be ≥0')
if self._max_items is not None and self._max_items < 0:
_invalid('Max items must be ≥0')
@property
def max_duration(self):
'''
The maximum duration that a crawl is allowed to run.
:rtype: float or None
'''
return self._max_duration
def met_item_limit(self, items):
'''
Return true if ``items`` is greater than or equal to the policy's max
item count.
:param int items:
:rtype: bool
'''
return self._max_items is not None and items >= self._max_items
def exceeds_max_cost(self, cost):
'''
Return true if ``cost`` is greater than the policy's max cost.
:param float cost:
:rtype: bool
'''
return self._max_cost is not None and cost > self._max_cost
class PolicyMimeTypeRules:
''' Filter responses by MIME type. '''
@staticmethod
def convert_doc_to_pb(doc, pb):
'''
Convert from database document to protobuf.
:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.PolicyMimeTypeRules
'''
for doc_mime in doc:
pb_mime = pb.add()
if 'pattern' in doc_mime:
pb_mime.pattern = doc_mime['pattern']
if 'match' in doc_mime:
pb_mime.match = MATCH_ENUM.Value(doc_mime['match'])
if 'save' in doc_mime:
pb_mime.save = doc_mime['save']
@staticmethod
def convert_pb_to_doc(pb, doc):
'''
Convert protobuf to database document.
:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyMimeTypeRules
:returns: Database document.
:rtype: dict
'''
for pb_mime in pb:
doc_mime = dict()
if pb_mime.HasField('pattern'):
doc_mime['pattern'] = pb_mime.pattern
if pb_mime.HasField('match'):
doc_mime['match'] = MATCH_ENUM.Name(pb_mime.match)
if pb_mime.HasField('save'):
doc_mime['save'] = pb_mime.save
doc.append(doc_mime)
def __init__(self, docs):
'''
Initialize from database documents.
:param docs: Database document.
:type docs: list[dict]
'''
if not docs:
_invalid('At least one MIME type rule is required')
# Rules are stored as list of tuples: (pattern, match, save)
self._rules = list()
max_index = len(docs) - 1
for index, mime_type_rule in enumerate(docs):
if index < max_index:
location = 'MIME type rule #{}'.format(index+1)
if mime_type_rule.get('pattern', '').strip() == '':
_invalid('Pattern is required', location)
if 'save' not in mime_type_rule:
_invalid('Save selector is required', location)
if 'match' not in mime_type_rule:
_invalid('Match selector is required', location)
try:
pattern_re = re.compile(mime_type_rule['pattern'])
except:
_invalid('Invalid regular expression', location)
self._rules.append((
pattern_re,
mime_type_rule['match'],
mime_type_rule['save'],
))
else:
location = 'last MIME type rule'
if 'save' not in mime_type_rule:
_invalid('Save selector is required', location)
if 'pattern' in mime_type_rule:
_invalid('Pattern is not allowed', location)
if 'match' in mime_type_rule:
_invalid('Match selector is not allowed', location)
self._rules.append((None, None, mime_type_rule['save']))
def should_save(self, mime_type):
'''
Returns True if ``mime_type`` is approved by this policy.
If rules are valid, this method always returns True or False.
:param str mime_type:
:rtype: bool
'''
should_save = False
for pattern, match, save in self._rules:
if pattern is None:
should_save = save
break
mimecheck = pattern.search(mime_type) is not None
if match == 'DOES_NOT_MATCH':
mimecheck = not mimecheck
if mimecheck:
should_save = save
break
return should_save
class PolicyProxyRules:
''' Modify which proxies are used for each request. '''
PROXY_SCHEMES = ('http', 'https', 'socks4', 'socks4a', 'socks5')
@staticmethod
def convert_doc_to_pb(doc, pb):
'''
Convert from database document to protobuf.
:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.PolicyProxyRules
'''
for doc_proxy in doc:
pb_proxy = pb.add()
if 'pattern' in doc_proxy:
pb_proxy.pattern = doc_proxy['pattern']
if 'match' in doc_proxy:
pb_proxy.match = MATCH_ENUM.Value(doc_proxy['match'])
if 'proxy_url' in doc_proxy:
pb_proxy.proxy_url = doc_proxy['proxy_url']
@staticmethod
def convert_pb_to_doc(pb, doc):
'''
Convert protobuf to database document.
:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyProxyRules
:returns: Database document.
:rtype: dict
'''
for pb_proxy in pb:
doc_proxy = dict()
if pb_proxy.HasField('pattern'):
doc_proxy['pattern'] = pb_proxy.pattern
if pb_proxy.HasField('match'):
doc_proxy['match'] = MATCH_ENUM.Name(pb_proxy.match)
if pb_proxy.HasField('proxy_url'):
doc_proxy['proxy_url'] = pb_proxy.proxy_url
doc.append(doc_proxy)
def __init__(self, docs):
'''
Initialize from database documents.
:param docs: Database document.
:type docs: list[dict]
'''
# Rules are stored as list of tuples: (pattern, match, proxy_type,
# proxy_url)
self._rules = list()
max_index = len(docs) - 1
for index, proxy_rule in enumerate(docs):
if index < max_index:
location = 'proxy rule #{}'.format(index+1)
if proxy_rule.get('pattern', '').strip() == '':
_invalid('Pattern is required', location)
try:
pattern_re = re.compile(proxy_rule['pattern'])
except:
_invalid('Invalid regular expression', location)
try:
match = (proxy_rule['match'] == 'MATCHES')
except KeyError:
_invalid('Match selector is required', location)
proxy_url = proxy_rule.get('proxy_url', '')
if proxy_url == '':
_invalid('Proxy URL is required', location)
else:
location = 'last proxy rule'
if 'pattern' in proxy_rule:
_invalid('Pattern is not allowed', location)
if 'match' in proxy_rule:
_invalid('Pattern is not allowed', location)
pattern_re = None
match = None
proxy_type = None
proxy_url = proxy_rule.get('proxy_url')
if proxy_url is None:
proxy_type = None
else:
try:
parsed = URL(proxy_url)
proxy_type = parsed.scheme
if proxy_type not in self.PROXY_SCHEMES:
raise ValueError()
except:
schemes = ', '.join(self.PROXY_SCHEMES)
_invalid('Must have a valid URL with one of the '
f'following schemes: {schemes}', location)
self._rules.append((
pattern_re,
match,
proxy_type,
proxy_url,
))
def get_proxy_url(self, target_url):
'''
Return a proxy (type, URL) tuple associated with ``target_url`` or
(None, None) if no such proxy is defined.
:param str target_url:
:rtype: tuple[proxy_type,URL]
'''
proxy = None, None
for pattern, needs_match, proxy_type, proxy_url in self._rules:
if pattern is not None:
has_match = pattern.search(target_url) is not None
if has_match == needs_match:
proxy = proxy_type, proxy_url
break
elif proxy_url is not None:
proxy = proxy_type, proxy_url
break
return proxy
class PolicyRobotsTxt:
''' Designate how robots.txt affects crawl behavior. '''
@staticmethod
def convert_doc_to_pb(doc, pb):
'''
Convert from database document to protobuf.
:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.PolicyRobotsTxt
'''
pb.usage = USAGE_ENUM.Value(doc['usage'])
@staticmethod
def convert_pb_to_doc(pb, doc):
'''
Convert protobuf to database document.
:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyRobotsTxt
:returns: Database document.
:rtype: dict
'''
if pb.HasField('usage'):
doc['usage'] = USAGE_ENUM.Name(pb.usage)
def __init__(self, doc):
'''
Initialize from a database document.
:param dict doc: A database document.
'''
if 'usage' not in doc:
_invalid('Robots.txt usage is required')
self._usage = doc['usage']
@property
def usage(self):
''' OBEY, IGNORE, or INVERT '''
return self._usage
class PolicyUrlNormalization:
''' Customize URL normalization. '''
@staticmethod
def convert_doc_to_pb(doc, pb):
'''
Convert from database document to protobuf.
:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.PolicyUrlNormalization
'''
if 'enabled' in doc:
pb.enabled = doc['enabled']
if 'strip_parameters' in doc:
pb.strip_parameters.extend(doc['strip_parameters'])
@staticmethod
def convert_pb_to_doc(pb, doc):
'''
Convert protobuf to database document.
:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyUrlNormalization
:returns: Database document.
:rtype: dict
'''
if pb.HasField('enabled'):
doc['enabled'] = pb.enabled
doc['strip_parameters'] = list(pb.strip_parameters)
def __init__(self, doc):
'''
Initialize from a database document.
:param dict doc: A database document.
'''
self._enabled = doc.get('enabled', True)
self._strip_parameters = doc.get('strip_parameters', list())
def normalize(self, url):
'''
Normalize ``url`` according to policy.
:param str url: The URL to be normalized.
:returns: The normalized URL.
:rtype str:
'''
if self._enabled:
if self._strip_parameters:
url = w3lib.url.url_query_cleaner(url, remove=True,
unique=False, parameterlist=self._strip_parameters)
url = w3lib.url.canonicalize_url(url)
return url
class PolicyUrlRules:
''' Customize link priorities based on URL. '''
@staticmethod
def convert_doc_to_pb(doc, pb):
'''
Convert from database document to protobuf.
:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.PolicyUrlRules
'''
for doc_url in doc:
pb_url = pb.add()
if 'pattern' in doc_url:
pb_url.pattern = doc_url['pattern']
if 'match' in doc_url:
pb_url.match = MATCH_ENUM.Value(doc_url['match'])
if 'action' in doc_url:
pb_url.action = ACTION_ENUM.Value(doc_url['action'])
if 'amount' in doc_url:
pb_url.amount = doc_url['amount']
@staticmethod
def convert_pb_to_doc(pb, doc):
'''
Convert protobuf to database document.
:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyUrlRules
:returns: Database document.
:rtype: dict
'''
for pb_url in pb:
doc_url = dict()
if pb_url.HasField('pattern'):
doc_url['pattern'] = pb_url.pattern
if pb_url.HasField('match'):
doc_url['match'] = MATCH_ENUM.Name(pb_url.match)
if pb_url.HasField('action'):
doc_url['action'] = ACTION_ENUM.Name(pb_url.action)
if pb_url.HasField('amount'):
doc_url['amount'] = pb_url.amount
doc.append(doc_url)
def __init__(self, docs, seeds):
'''
Initialize from database documents.
:param docs: Database document.
:type docs: list[dict]
:param seeds: Seed URLs, used for computing the costs for crawled links.
:type seeds: list[str]
'''
if not docs:
_invalid('At least one URL rule is required')
# Rules are stored as tuples: (pattern, match, action, amount)
self._rules = list()
max_index = len(docs) - 1
seed_domains = {URL(seed).host for seed in seeds}
for index, url_rule in enumerate(docs):
if index < max_index:
location = 'URL rule #{}'.format(index+1)
if url_rule.get('pattern', '').strip() == '':
_invalid('Pattern is required', location)
if 'match' not in url_rule:
_invalid('Match selector is required', location)
if 'action' not in url_rule:
_invalid('Action selector is required', location)
if 'amount' not in url_rule:
_invalid('Amount is required', location)
try:
pattern_re = re.compile(url_rule['pattern']
.format(SEED_DOMAINS='|'.join(seed_domains)))
except:
_invalid('Invalid regular expression', location)
self._rules.append((
pattern_re,
url_rule['match'],
url_rule['action'],
url_rule['amount'],
))
else:
location = 'last URL rule'
if 'pattern' in url_rule:
_invalid('Pattern is not allowed', location)
if 'match' in url_rule:
_invalid('Match is not allowed', location)
if 'action' not in url_rule:
_invalid('Action is required', location)
if 'amount' not in url_rule:
_invalid('Amount is required', location)
self._rules.append((
None,
None,
url_rule['action'],
url_rule['amount'],
))
def get_cost(self, parent_cost, url):
'''
Return the cost for a URL.
:param float parent_cost: The cost of the resource which yielded this
URL.
:param str url: The URL to compute cost for.
:returns: Cost of ``url``.
:rtype: float
'''
# pylint: disable=undefined-loop-variable
for pattern, match, action, amount in self._rules:
if pattern is None:
break
else:
result = pattern.search(url) is not None
if match == 'DOES_NOT_MATCH':
result = not result
if result:
break
if action == 'ADD':
return parent_cost + amount
return parent_cost * amount
class PolicyUserAgents:
''' Specify user agent string to send in HTTP requests. '''
@staticmethod
def convert_doc_to_pb(doc, pb):
'''
Convert from database document to protobuf.
:param dict doc: Database document.
:param pb: An empty protobuf.
:type pb: starbelly.starbelly_pb2.PolicyUserAgents
'''
for doc_user_agent in doc:
pb_user_agent = pb.add()
pb_user_agent.name = doc_user_agent['name']
@staticmethod
def convert_pb_to_doc(pb, doc):
'''
Convert protobuf to database document.
:param pb: A protobuf
:type pb: starbelly.starbelly_pb2.PolicyUserAgents
:returns: Database document.
:rtype: dict
'''
for user_agent in pb:
doc.append({
'name': user_agent.name,
})
def __init__(self, docs, version):
'''
Initialize from database documents.
:param docs: Database document.
:type docs: list[dict]
:param str version: The version number interpolated into ``{VERSION}``.
'''
if not docs:
_invalid('At least one user agent is required')
self._user_agents = list()
for index, user_agent in enumerate(docs):
location = 'User agent #{}'.format(index + 1)
if user_agent.get('name', '').strip() == '':
_invalid('Name is required', location)
self._user_agents.append(user_agent['name'].format(VERSION=version))
def get_first_user_agent(self):
'''
:returns: Return the first user agent.
:rtype: str
'''
return self._user_agents[0]
def get_user_agent(self):
'''
:returns: A randomly selected user agent string.
:rtype: str
'''
return random.choice(self._user_agents)
| 33.33865 | 80 | 0.568032 | [
"MIT"
] | HyperionGray/starbelly | starbelly/policy.py | 27,175 | Python |
import os
from datetime import date, datetime, timedelta
from enum import Enum
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import Group
from django.core.cache import cache
from django.core.cache.utils import make_template_fragment_key
from django.core.exceptions import SuspiciousOperation
from django.db import transaction
from django.db.models import Count
from django.utils.html import format_html, format_html_join
from django.utils.translation import gettext_lazy as _
from evap.evaluation.models import Contribution, Course, Evaluation, TextAnswer, UserProfile
from evap.evaluation.models_logging import LogEntry
from evap.evaluation.tools import clean_email, is_external_email
from evap.grades.models import GradeDocument
from evap.results.tools import STATES_WITH_RESULTS_CACHING, cache_results
def forward_messages(request, success_messages, warnings):
for message in success_messages:
messages.success(request, message)
for category in warnings:
for warning in warnings[category]:
messages.warning(request, warning)
class ImportType(Enum):
USER = "user"
CONTRIBUTOR = "contributor"
PARTICIPANT = "participant"
SEMESTER = "semester"
USER_BULK_UPDATE = "user_bulk_update"
def generate_import_filename(user_id, import_type):
return os.path.join(settings.MEDIA_ROOT, "temp_import_files", f"{user_id}.{import_type.value}.xls")
def save_import_file(excel_file, user_id, import_type):
filename = generate_import_filename(user_id, import_type)
os.makedirs(os.path.dirname(filename), exist_ok=True)
with open(filename, "wb") as file:
for chunk in excel_file.chunks():
file.write(chunk)
excel_file.seek(0)
def delete_import_file(user_id, import_type):
filename = generate_import_filename(user_id, import_type)
try:
os.remove(filename)
except OSError:
pass
def import_file_exists(user_id, import_type):
filename = generate_import_filename(user_id, import_type)
return os.path.isfile(filename)
def get_import_file_content_or_raise(user_id, import_type):
filename = generate_import_filename(user_id, import_type)
if not os.path.isfile(filename):
raise SuspiciousOperation("No test run performed previously.")
with open(filename, "rb") as file:
return file.read()
def delete_navbar_cache_for_users(users):
# delete navbar cache from base.html
for user in users:
key = make_template_fragment_key("navbar", [user.email, "de"])
cache.delete(key)
key = make_template_fragment_key("navbar", [user.email, "en"])
cache.delete(key)
def create_user_list_html_string_for_message(users):
return format_html_join("", "<br />{} {} ({})", ((user.first_name, user.last_name, user.email) for user in users))
def find_matching_internal_user_for_email(request, email):
# for internal users only the part before the @ must be the same to match a user to an email
matching_users = [
user
for user in UserProfile.objects.filter(email__startswith=email.split("@")[0] + "@").order_by("id")
if not user.is_external
]
if not matching_users:
return None
if len(matching_users) > 1:
raise UserProfile.MultipleObjectsReturned(matching_users)
return matching_users[0]
def bulk_update_users(request, user_file_content, test_run):
# pylint: disable=too-many-branches,too-many-locals
# user_file must have one user per line in the format "{username},{email}"
imported_emails = {clean_email(line.decode().split(",")[1]) for line in user_file_content.splitlines()}
emails_of_users_to_be_created = []
users_to_be_updated = []
skipped_external_emails_counter = 0
for imported_email in imported_emails:
if is_external_email(imported_email):
skipped_external_emails_counter += 1
continue
try:
matching_user = find_matching_internal_user_for_email(request, imported_email)
except UserProfile.MultipleObjectsReturned as e:
messages.error(
request,
format_html(
_("Multiple users match the email {}:{}"),
imported_email,
create_user_list_html_string_for_message(e.args[0]),
),
)
return False
if not matching_user:
emails_of_users_to_be_created.append(imported_email)
elif matching_user.email != imported_email:
users_to_be_updated.append((matching_user, imported_email))
emails_of_non_obsolete_users = set(imported_emails) | {user.email for user, _ in users_to_be_updated}
deletable_users, users_to_mark_inactive = [], []
for user in UserProfile.objects.exclude(email__in=emails_of_non_obsolete_users):
if user.can_be_deleted_by_manager:
deletable_users.append(user)
elif user.is_active and user.can_be_marked_inactive_by_manager:
users_to_mark_inactive.append(user)
messages.info(
request,
_(
"The uploaded text file contains {} internal and {} external users. The external users will be ignored. "
"{} users are currently in the database. Of those, {} will be updated, {} will be deleted and {} will be "
"marked inactive. {} new users will be created."
).format(
len(imported_emails) - skipped_external_emails_counter,
skipped_external_emails_counter,
UserProfile.objects.count(),
len(users_to_be_updated),
len(deletable_users),
len(users_to_mark_inactive),
len(emails_of_users_to_be_created),
),
)
if users_to_be_updated:
messages.info(
request,
format_html(
_("Users to be updated are:{}"),
format_html_join(
"",
"<br />{} {} ({} > {})",
((user.first_name, user.last_name, user.email, email) for user, email in users_to_be_updated),
),
),
)
if deletable_users:
messages.info(
request,
format_html(_("Users to be deleted are:{}"), create_user_list_html_string_for_message(deletable_users)),
)
if users_to_mark_inactive:
messages.info(
request,
format_html(
_("Users to be marked inactive are:{}"),
create_user_list_html_string_for_message(users_to_mark_inactive),
),
)
if emails_of_users_to_be_created:
messages.info(
request,
format_html(
_("Users to be created are:{}"),
format_html_join("", "<br />{}", ((email,) for email in emails_of_users_to_be_created)),
),
)
with transaction.atomic():
for user in deletable_users + users_to_mark_inactive:
for message in remove_user_from_represented_and_ccing_users(
user, deletable_users + users_to_mark_inactive, test_run
):
messages.warning(request, message)
if test_run:
messages.info(request, _("No data was changed in this test run."))
else:
for user in deletable_users:
user.delete()
for user in users_to_mark_inactive:
user.is_active = False
user.save()
for user, email in users_to_be_updated:
user.email = email
user.save()
userprofiles_to_create = []
for email in emails_of_users_to_be_created:
userprofiles_to_create.append(UserProfile(email=email))
UserProfile.objects.bulk_create(userprofiles_to_create)
messages.success(request, _("Users have been successfully updated."))
return True
@transaction.atomic
def merge_users(main_user, other_user, preview=False):
"""Merges other_user into main_user"""
# This is much stuff to do. However, splitting it up into subtasks doesn't make much sense.
# pylint: disable=too-many-statements
merged_user = {}
merged_user["is_active"] = main_user.is_active or other_user.is_active
merged_user["title"] = main_user.title or other_user.title or ""
merged_user["first_name"] = main_user.first_name or other_user.first_name or ""
merged_user["last_name"] = main_user.last_name or other_user.last_name or ""
merged_user["email"] = main_user.email or other_user.email or None
merged_user["groups"] = Group.objects.filter(user__in=[main_user, other_user]).distinct()
merged_user["is_superuser"] = main_user.is_superuser or other_user.is_superuser
merged_user["is_proxy_user"] = main_user.is_proxy_user or other_user.is_proxy_user
merged_user["delegates"] = UserProfile.objects.filter(represented_users__in=[main_user, other_user]).distinct()
merged_user["represented_users"] = UserProfile.objects.filter(delegates__in=[main_user, other_user]).distinct()
merged_user["cc_users"] = UserProfile.objects.filter(ccing_users__in=[main_user, other_user]).distinct()
merged_user["ccing_users"] = UserProfile.objects.filter(cc_users__in=[main_user, other_user]).distinct()
errors = []
warnings = []
courses_main_user_is_responsible_for = main_user.get_sorted_courses_responsible_for()
if any(
course in courses_main_user_is_responsible_for for course in other_user.get_sorted_courses_responsible_for()
):
errors.append("courses_responsible_for")
if any(
contribution.evaluation in [contribution.evaluation for contribution in main_user.get_sorted_contributions()]
for contribution in other_user.get_sorted_contributions()
):
errors.append("contributions")
if any(
evaluation in main_user.get_sorted_evaluations_participating_in()
for evaluation in other_user.get_sorted_evaluations_participating_in()
):
errors.append("evaluations_participating_in")
if any(
evaluation in main_user.get_sorted_evaluations_voted_for()
for evaluation in other_user.get_sorted_evaluations_voted_for()
):
errors.append("evaluations_voted_for")
if main_user.reward_point_grantings.all().exists() and other_user.reward_point_grantings.all().exists():
warnings.append("rewards")
merged_user["courses_responsible_for"] = Course.objects.filter(responsibles__in=[main_user, other_user]).order_by(
"semester__created_at", "name_de"
)
merged_user["contributions"] = Contribution.objects.filter(contributor__in=[main_user, other_user]).order_by(
"evaluation__course__semester__created_at", "evaluation__name_de"
)
merged_user["evaluations_participating_in"] = Evaluation.objects.filter(
participants__in=[main_user, other_user]
).order_by("course__semester__created_at", "name_de")
merged_user["evaluations_voted_for"] = Evaluation.objects.filter(voters__in=[main_user, other_user]).order_by(
"course__semester__created_at", "name_de"
)
merged_user["reward_point_grantings"] = (
main_user.reward_point_grantings.all() or other_user.reward_point_grantings.all()
)
merged_user["reward_point_redemptions"] = (
main_user.reward_point_redemptions.all() or other_user.reward_point_redemptions.all()
)
if preview or errors:
return merged_user, errors, warnings
# update responsibility
for course in Course.objects.filter(responsibles__in=[other_user]):
responsibles = list(course.responsibles.all())
responsibles.remove(other_user)
responsibles.append(main_user)
course.responsibles.set(responsibles)
GradeDocument.objects.filter(last_modified_user=other_user).update(last_modified_user=main_user)
# email must not exist twice. other_user can't be deleted before contributions have been changed
other_user.email = ""
other_user.save()
# update values for main user
for key, value in merged_user.items():
attr = getattr(main_user, key)
if hasattr(attr, "set"):
attr.set(value) # use the 'set' method for e.g. many-to-many relations
else:
setattr(main_user, key, value) # use direct assignment for everything else
main_user.save()
# delete rewards
other_user.reward_point_grantings.all().delete()
other_user.reward_point_redemptions.all().delete()
# update logs
LogEntry.objects.filter(user=other_user).update(user=main_user)
# refresh results cache
evaluations = Evaluation.objects.filter(
contributions__contributor=main_user, state__in=STATES_WITH_RESULTS_CACHING
).distinct()
for evaluation in evaluations:
cache_results(evaluation)
# delete other_user
other_user.delete()
return merged_user, errors, warnings
def find_unreviewed_evaluations(semester, excluded):
# as evaluations are open for an offset of hours after vote_end_datetime, the evaluations ending yesterday are also excluded during offset
exclude_date = date.today()
if datetime.now().hour < settings.EVALUATION_END_OFFSET_HOURS:
exclude_date -= timedelta(days=1)
# Evaluations where the grading process is finished should be shown first, need to be sorted in Python
return sorted(
(
semester.evaluations.exclude(pk__in=excluded)
.exclude(state=Evaluation.State.PUBLISHED)
.exclude(vote_end_date__gte=exclude_date)
.exclude(can_publish_text_results=False)
.filter(contributions__textanswer_set__state=TextAnswer.State.NOT_REVIEWED)
.annotate(num_unreviewed_textanswers=Count("contributions__textanswer_set"))
),
key=lambda e: (-e.grading_process_is_finished, e.vote_end_date, -e.num_unreviewed_textanswers),
)
def remove_user_from_represented_and_ccing_users(user, ignored_users=None, test_run=False):
remove_messages = []
ignored_users = ignored_users or []
for represented_user in user.represented_users.exclude(id__in=[user.id for user in ignored_users]):
if test_run:
remove_messages.append(
_("{} will be removed from the delegates of {}.").format(user.full_name, represented_user.full_name)
)
else:
represented_user.delegates.remove(user)
remove_messages.append(
_("Removed {} from the delegates of {}.").format(user.full_name, represented_user.full_name)
)
for cc_user in user.ccing_users.exclude(id__in=[user.id for user in ignored_users]):
if test_run:
remove_messages.append(
_("{} will be removed from the CC users of {}.").format(user.full_name, cc_user.full_name)
)
else:
cc_user.cc_users.remove(user)
remove_messages.append(_("Removed {} from the CC users of {}.").format(user.full_name, cc_user.full_name))
return remove_messages
| 40.686327 | 142 | 0.68918 | [
"MIT"
] | lill28/EvaP | evap/staff/tools.py | 15,176 | Python |
import os
import fabdeploytools.envs
from fabric.api import env, lcd, local, task
from fabdeploytools import helpers
import deploysettings as settings
env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(settings.CLUSTER)
ROOT, PROJECT_NAME = helpers.get_app_dirs(__file__)
@task
def build():
with lcd(PROJECT_NAME):
local('npm install')
local('make install')
local('cp src/media/js/settings_local_hosted.js '
'src/media/js/settings_local.js')
local('make build')
local('node_modules/.bin/commonplace langpacks')
@task
def deploy_jenkins():
r = helpers.build_rpm(name=settings.PROJECT_NAME,
app_dir='marketplace-style-guide',
env=settings.ENV,
cluster=settings.CLUSTER,
domain=settings.DOMAIN,
root=ROOT)
r.local_install()
r.remote_install(['web'])
| 26.189189 | 60 | 0.627451 | [
"MPL-2.0"
] | mozilla/marketplace-style-guide | fabfile.py | 969 | Python |
"""
Consensus Algorithm for 6 Mobile robots using MLP Model for Line Graph Implementation
Inputs: Mx, My
Outputs: Ux, Uy
"""
import torch
import MLP_Model
import math
import numpy as np
import rclpy
from rclpy.node import Node
from tf2_msgs.msg import TFMessage
from std_msgs.msg import Float32
import time
L = 1
d = 0.5
#distance = 2
A = np.ones(6) - np.identity(6) # Adjancency Matrix fully connected case 6x6
ux = np.zeros((6,1)) # 6x1 controller vector
uy = np.zeros((6,1)) # 6x1 controller vector
# load model using dict
FILE = "model.pth"
loaded_model = MLP_Model.MLP()
loaded_model.load_state_dict(torch.load(FILE))
loaded_model.eval()
def euler_from_quaternion(x, y, z, w):
t3 = +2.0 * (w * z + x * y)
t4 = +1.0 - 2.0 * (y * y + z * z)
yaw_z = math.atan2(t3, t4)
return yaw_z # in radians
class MinimalPublisher(Node):
def __init__(self):
super().__init__('minimal_publisher1')
self.publisher_l1 = self.create_publisher(Float32, '/leftMotorSpeedrobot1', 0) #Change according to topic in child script,String to Float32
self.publisher_r1 = self.create_publisher(Float32, '/rightMotorSpeedrobot1', 0) #Change according to topic in child script,String to Float32
self.publisher_l2 = self.create_publisher(Float32, '/leftMotorSpeedrobot2', 0) #Change according to topic in child script,String to Float32
self.publisher_r2 = self.create_publisher(Float32, '/rightMotorSpeedrobot2', 0) #Change according to topic in child script,String to Float32
self.publisher_l3 = self.create_publisher(Float32, '/leftMotorSpeedrobot3', 0) #Change according to topic in child script,String to Float32
self.publisher_r3 = self.create_publisher(Float32, '/rightMotorSpeedrobot3', 0) #Change according to topic in child script,String to Float32
self.publisher_l4 = self.create_publisher(Float32, '/leftMotorSpeedrobot4', 0) #Change according to topic in child script,String to Float32
self.publisher_r4 = self.create_publisher(Float32, '/rightMotorSpeedrobot4', 0) #Change according to topic in child script,String to Float32
self.publisher_l5 = self.create_publisher(Float32, '/leftMotorSpeedrobot5', 0) #Change according to topic in child script,String to Float32
self.publisher_r5 = self.create_publisher(Float32, '/rightMotorSpeedrobot5', 0) #Change according to topic in child script,String to Float32
self.publisher_l6 = self.create_publisher(Float32, '/leftMotorSpeedrobot6', 0) #Change according to topic in child script,String to Float32
self.publisher_r6 = self.create_publisher(Float32, '/rightMotorSpeedrobot6', 0) #Change according to topic in child script,String to Float32
self.subscription = self.create_subscription(
TFMessage,
'/tf',
self.listener_callback,
0)
" Timer Callback "
#self.publisher_ = self.create_publisher(Float32(), 'topic', 10)
timer_period = 0.01 # seconds
self.timer = self.create_timer(timer_period, self.timer_callback)
self.i = 0
"Parameters "
self.k = 1 # Control Gain
self.scene = 0 # Nb of scene iteration
" Mobile Robot 1 Parameters "
self.x1 = 0
self.y1 = 0
self.Theta1 = 0
self.v1 = 0
self.w1 = 0
self.vL1 = 0
self.vR1 = 0
" Mobile Robot 1 Parameters "
self.x2 = 0
self.y2 = 0
self.Theta2 = 0
self.v2 = 0
self.w2 = 0
self.vL2 = 0
self.vR2 = 0
" Mobile Robot 3 Parameters "
self.x3 = 0
self.y3 = 0
self.Theta3 = 0
self.v3 = 0
self.w3 = 0
self.vL3 = 0
self.vR3 = 0
" Mobile Robot 4 Parameters "
self.x4 = 0
self.y4 = 0
self.Theta4 = 0
self.v4 = 0
self.w4 = 0
self.vL4 = 0
self.vR4 = 0
" Mobile Robot 5 Parameters "
self.x5 = 0
self.y5 = 0
self.Theta5 = 0
self.v5 = 0
self.w5 = 0
self.vL5 = 0
self.vR5 = 0
" Mobile Robot 6 Parameters "
self.x6 = 0
self.y6 = 0
self.Theta6 = 0
self.v6 = 0
self.w6 = 0
self.vL6 = 0
self.vR6 = 0
def timer_callback(self):
" Calculate Mx1, My1, ...... Mx6, My6 "
Mx1 = self.x2 - self.x1 # 1x1
My1 = self.y2 - self.y1 # 1x1
Mx2 = ( ( self.x1 - self.x2 ) + ( self.x3 - self.x2 ) ) / 2 # 1x1
My2 = ( ( self.y1 - self.y2 ) + ( self.y3 - self.y2 ) ) / 2 # 1x1
Mx3 = ( ( self.x2 - self.x3 ) + ( self.x4 - self.x3 ) ) / 2 # 1x1
My3 = ( ( self.y2 - self.y3 ) + ( self.y4 - self.y3 ) ) / 2 # 1x1
Mx4 = ( ( self.x3 - self.x4 ) + ( self.x5 - self.x4 ) ) / 2 # 1x1
My4 = ( ( self.y4 - self.y4 ) + ( self.y5 - self.y4 ) ) / 2 # 1x1
Mx5 = ( ( self.x4 - self.x5 ) + ( self.x6 - self.x5 ) ) / 2 # 1x1
My5 = ( ( self.y4 - self.y5 ) + ( self.y6 - self.y5 ) ) / 2 # 1x1
Mx6 = self.x5 - self.x6 # 1x1
My6 = self.y5 - self.y6 # 1x1
" Use MLP to Predict control inputs "
relative_pose_1 = [ Mx1, My1 ] # tensor data for MLP model
relative_pose_2 = [ Mx2, My2 ] # tensor data for MLP model
relative_pose_3 = [ Mx3, My3 ] # tensor data for MLP model
relative_pose_4 = [ Mx4, My4 ] # tensor data for MLP model
relative_pose_5 = [ Mx5, My5 ] # tensor data for MLP model
relative_pose_6 = [ Mx6, My6 ] # tensor data for MLP model
u1_predicted = MLP_Model.predict(relative_pose_1, loaded_model) # predict control input u1, tensor
u2_predicted = MLP_Model.predict(relative_pose_2, loaded_model) # predict control input u2, tensor
u3_predicted = MLP_Model.predict(relative_pose_3, loaded_model) # predict control input u3, tensor
u4_predicted = MLP_Model.predict(relative_pose_4, loaded_model) # predict control input u4, tensor
u5_predicted = MLP_Model.predict(relative_pose_5, loaded_model) # predict control input u5, tensor
u6_predicted = MLP_Model.predict(relative_pose_6, loaded_model) # predict control input u6, tensor
u1_predicted_np = np.array([[ u1_predicted[0][0] ], [ u1_predicted[0][1] ]]) # from tensor to numpy array for calculation
u2_predicted_np = np.array([[ u2_predicted[0][0] ], [ u2_predicted[0][1] ]]) # from tensor to numpy array for calculation
u3_predicted_np = np.array([[ u3_predicted[0][0] ], [ u3_predicted[0][1] ]]) # from tensor to numpy array for calculation
u4_predicted_np = np.array([[ u4_predicted[0][0] ], [ u4_predicted[0][1] ]]) # from tensor to numpy array for calculation
u5_predicted_np = np.array([[ u5_predicted[0][0] ], [ u5_predicted[0][1] ]]) # from tensor to numpy array for calculation
u6_predicted_np = np.array([[ u6_predicted[0][0] ], [ u6_predicted[0][1] ]]) # from tensor to numpy array for calculation
" Calculate V1/W1, V2/W2, V3/W3, V4/W4, V5/W5, V6/W6 "
S1 = np.array([[self.v1], [self.w1]]) #2x1
G1 = np.array([[1,0], [0,1/L]]) #2x2
R1 = np.array([[math.cos(self.Theta1),math.sin(self.Theta1)],[-math.sin(self.Theta1),math.cos(self.Theta1)]]) #2x2
S1 = np.dot(np.dot(G1, R1), u1_predicted_np) #2x1
S2 = np.array([[self.v2], [self.w2]]) #2x1
G2 = np.array([[1,0], [0,1/L]]) #2x2
R2 = np.array([[math.cos(self.Theta2),math.sin(self.Theta2)],[-math.sin(self.Theta2),math.cos(self.Theta2)]]) #2x2
S2 = np.dot(np.dot(G2, R2), u2_predicted_np) # 2x1
S3 = np.array([[self.v3], [self.w3]]) #2x1
G3 = np.array([[1,0], [0,1/L]]) #2x2
R3 = np.array([[math.cos(self.Theta3),math.sin(self.Theta3)],[-math.sin(self.Theta3),math.cos(self.Theta3)]]) #2x2
S3 = np.dot(np.dot(G3, R3), u3_predicted_np) #2x1
S4 = np.array([[self.v4], [self.w4]]) #2x1
G4 = np.array([[1,0], [0,1/L]]) #2x2
R4 = np.array([[math.cos(self.Theta4),math.sin(self.Theta4)],[-math.sin(self.Theta4),math.cos(self.Theta4)]]) #2x2
S4 = np.dot(np.dot(G4, R4), u4_predicted_np) #2x1
S5 = np.array([[self.v5], [self.w5]]) #2x1
G5 = np.array([[1,0], [0,1/L]]) #2x2
R5 = np.array([[math.cos(self.Theta5),math.sin(self.Theta5)],[-math.sin(self.Theta5),math.cos(self.Theta5)]]) #2x2
S5 = np.dot(np.dot(G5, R5), u5_predicted_np) #2x1
S6 = np.array([[self.v6], [self.w6]]) #2x1
G6 = np.array([[1,0], [0,1/L]]) #2x2
R6 = np.array([[math.cos(self.Theta6),math.sin(self.Theta6)],[-math.sin(self.Theta6),math.cos(self.Theta6)]]) #2x2
S6 = np.dot(np.dot(G6, R6), u6_predicted_np) #2x1
" Calculate VL1/VR1, VL2/VR2, VL3/VR3, VL4/VR4, VL5/VR5, VL6/VR6 "
D = np.array([[1/2,1/2],[-1/(2*d),1/(2*d)]]) #2x2
Di = np.linalg.inv(D) #2x2
Speed_L1 = np.array([[self.vL1], [self.vR1]]) # Vector 2x1 for Speed of Robot 1
Speed_L2 = np.array([[self.vL2], [self.vR2]]) # Vector 2x1 for Speed of Robot 2
Speed_L3 = np.array([[self.vL3], [self.vR3]]) # Vector 2x1 for Speed of Robot 3
Speed_L4 = np.array([[self.vL4], [self.vR4]]) # Vector 2x1 for Speed of Robot 4
Speed_L5 = np.array([[self.vL5], [self.vR5]]) # Vector 2x1 for Speed of Robot 5
Speed_L6 = np.array([[self.vL6], [self.vR6]]) # Vector 2x1 for Speed of Robot 6
M1 = np.array([[S1[0]],[S1[1]]]).reshape(2,1) #2x1
M2 = np.array([[S2[0]],[S2[1]]]).reshape(2,1) #2x1
M3 = np.array([[S3[0]],[S3[1]]]).reshape(2,1) #2x1
M4 = np.array([[S4[0]],[S4[1]]]).reshape(2,1) #2x1
M5 = np.array([[S5[0]],[S5[1]]]).reshape(2,1) #2x1
M6 = np.array([[S6[0]],[S6[1]]]).reshape(2,1) #2x1
Speed_L1 = np.dot(Di, M1) # 2x1 (VL1, VR1)
Speed_L2 = np.dot(Di, M2) # 2x1 (VL2, VR2)
Speed_L3 = np.dot(Di, M3) # 2x1 (VL3, VR3)
Speed_L4 = np.dot(Di, M4) # 2x1 (VL4, VR4)
Speed_L5 = np.dot(Di, M5) # 2x1 (VL5, VR5)
Speed_L6 = np.dot(Di, M6) # 2x1 (VL6, VR6)
VL1 = float(Speed_L1[0])
VR1 = float(Speed_L1[1])
VL2 = float(Speed_L2[0])
VR2 = float(Speed_L2[1])
VL3 = float(Speed_L3[0])
VR3 = float(Speed_L3[1])
VL4 = float(Speed_L4[0])
VR4 = float(Speed_L4[1])
VL5 = float(Speed_L5[0])
VR5 = float(Speed_L5[1])
VL6 = float(Speed_L6[0])
VR6 = float(Speed_L6[1])
" Publish Speed Commands to Robot 1 "
msgl1 = Float32()
msgr1 = Float32()
msgl1.data = VL1
msgr1.data = VR1
self.publisher_l1.publish(msgl1)
self.publisher_r1.publish(msgr1)
#self.get_logger().info('Publishing R1: "%s"' % msgr1.data)
" Publish Speed Commands to Robot 2 "
msgl2 = Float32()
msgr2 = Float32()
msgl2.data = VL2
msgr2.data = VR2
self.publisher_l2.publish(msgl2)
self.publisher_r2.publish(msgr2)
" Publish Speed Commands to Robot 3 "
msgl3 = Float32()
msgr3 = Float32()
msgl3.data = VL3
msgr3.data = VR3
self.publisher_l3.publish(msgl3)
self.publisher_r3.publish(msgr3)
" Publish Speed Commands to Robot 4 "
msgl4 = Float32()
msgr4 = Float32()
msgl4.data = VL4
msgr4.data = VR4
self.publisher_l4.publish(msgl4)
self.publisher_r4.publish(msgr4)
" Publish Speed Commands to Robot 5 "
msgl5 = Float32()
msgr5 = Float32()
msgl5.data = VL5
msgr5.data = VR5
self.publisher_l5.publish(msgl5)
self.publisher_r5.publish(msgr5)
" Publish Speed Commands to Robot 6 "
msgl6 = Float32()
msgr6 = Float32()
msgl6.data = VL6
msgr6.data = VR6
self.publisher_l6.publish(msgl6)
self.publisher_r6.publish(msgr6)
self.i += 1
def listener_callback(self, msg):
if msg.transforms[0].child_frame_id == 'robot1' :
self.x1 = msg.transforms[0].transform.translation.x
self.y1 = msg.transforms[0].transform.translation.y
self.xr1 = msg.transforms[0].transform.rotation.x
self.yr1 = msg.transforms[0].transform.rotation.y
self.zr1 = msg.transforms[0].transform.rotation.z
self.wr1 = msg.transforms[0].transform.rotation.w
self.Theta1 = euler_from_quaternion(self.xr1,self.yr1,self.zr1,self.wr1)
if msg.transforms[0].child_frame_id == 'robot2' :
self.x2 = msg.transforms[0].transform.translation.x
self.y2 = msg.transforms[0].transform.translation.y
self.xr2 = msg.transforms[0].transform.rotation.x
self.yr2 = msg.transforms[0].transform.rotation.y
self.zr2 = msg.transforms[0].transform.rotation.z
self.wr2 = msg.transforms[0].transform.rotation.w
self.Theta2 = euler_from_quaternion(self.xr2,self.yr2,self.zr2,self.wr2)
if msg.transforms[0].child_frame_id == 'robot3' :
self.x3 = msg.transforms[0].transform.translation.x
self.y3 = msg.transforms[0].transform.translation.y
self.xr3 = msg.transforms[0].transform.rotation.x
self.yr3 = msg.transforms[0].transform.rotation.y
self.zr3 = msg.transforms[0].transform.rotation.z
self.wr3 = msg.transforms[0].transform.rotation.w
self.Theta3 = euler_from_quaternion(self.xr3,self.yr3,self.zr3,self.wr3)
if msg.transforms[0].child_frame_id == 'robot4' :
self.x4 = msg.transforms[0].transform.translation.x
self.y4 = msg.transforms[0].transform.translation.y
self.xr4 = msg.transforms[0].transform.rotation.x
self.yr4 = msg.transforms[0].transform.rotation.y
self.zr4 = msg.transforms[0].transform.rotation.z
self.wr4 = msg.transforms[0].transform.rotation.w
self.Theta4 = euler_from_quaternion(self.xr4,self.yr4,self.zr4,self.wr4)
if msg.transforms[0].child_frame_id == 'robot5' :
self.x5 = msg.transforms[0].transform.translation.x
self.y5 = msg.transforms[0].transform.translation.y
self.xr5 = msg.transforms[0].transform.rotation.x
self.yr5 = msg.transforms[0].transform.rotation.y
self.zr5 = msg.transforms[0].transform.rotation.z
self.wr5 = msg.transforms[0].transform.rotation.w
self.Theta5 = euler_from_quaternion(self.xr5,self.yr5,self.zr5,self.wr5)
if msg.transforms[0].child_frame_id == 'robot6' :
self.x6 = msg.transforms[0].transform.translation.x
self.y6 = msg.transforms[0].transform.translation.y
self.xr6 = msg.transforms[0].transform.rotation.x
self.yr6 = msg.transforms[0].transform.rotation.y
self.zr6 = msg.transforms[0].transform.rotation.z
self.wr6 = msg.transforms[0].transform.rotation.w
self.Theta6 = euler_from_quaternion(self.xr6,self.yr6,self.zr6,self.wr6)
def main(args=None):
rclpy.init(args=args)
minimal_publisher = MinimalPublisher()
time.sleep(5)
rclpy.spin(minimal_publisher)
minimal_publisher.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()
| 42.073491 | 162 | 0.581347 | [
"MIT"
] | HusseinLezzaik/Consensus-Algorithm-for-2-Mobile-Robots | Real Topology Graph/GNN Model 1/Cyclic Graph/Main_MLP_line.py | 16,030 | Python |
from rest_framework import serializers
from django.shortcuts import get_object_or_404
from django.contrib.auth import get_user_model
from postreview.models import Review
class ReviewListSerializer(serializers.ModelSerializer):
first_name = serializers.SerializerMethodField()
url = serializers.HyperlinkedIdentityField(view_name='postreview-api:detail')
class Meta:
model = Review
fields = [
'first_name',
'url',
'last_name',
'photograph',
'designation',
'company',
'department',
'comments'
]
def get_first_name(self, obj):
return obj.first_name
class ReviewDetailSerializer(serializers.ModelSerializer):
url = serializers.HyperlinkedIdentityField(view_name='postreview-api:update')
class Meta:
model = Review
fields = [
'url',
'first_name',
'last_name',
'photograph',
'designation',
'company',
'department',
'comments'
]
class ReviewCreateSerializer(serializers.ModelSerializer):
url = serializers.HyperlinkedIdentityField(view_name='postreview-api:list')
class Meta:
model = Review
fields = [
'url',
'first_name',
'last_name',
'photograph',
'designation',
'company',
'department',
'comments'
]
read_only_fields = ['user', ]
class ReviewDeleteSerializer(serializers.ModelSerializer):
url = serializers.HyperlinkedIdentityField(view_name='postreview-api:list')
class Meta:
model = Review
fields = [
'url',
'first_name',
'last_name',
'photograph',
'designation',
'company',
'department',
'comments'
]
read_only_fields = ['user', ]
class ReviewUpdateSerializer(serializers.ModelSerializer):
class Meta:
model = Review
fields = [
'first_name',
'last_name',
'photograph',
'designation',
'company',
'department',
'comments'
]
read_only_fields = ['user', ]
| 24.536842 | 81 | 0.551266 | [
"MIT"
] | ananyamalik/unicode-website | postreview/api/serializers.py | 2,331 | Python |
# Accessor functions for control properties
from Controls import *
import struct
# These needn't go through this module, but are here for completeness
def SetControlData_Handle(control, part, selector, data):
control.SetControlData_Handle(part, selector, data)
def GetControlData_Handle(control, part, selector):
return control.GetControlData_Handle(part, selector)
_accessdict = {
kControlPopupButtonMenuHandleTag: (SetControlData_Handle, GetControlData_Handle),
}
_codingdict = {
kControlPushButtonDefaultTag : ("b", None, None),
kControlEditTextTextTag: (None, None, None),
kControlEditTextPasswordTag: (None, None, None),
kControlPopupButtonMenuIDTag: ("h", None, None),
kControlListBoxDoubleClickTag: ("b", None, None),
}
def SetControlData(control, part, selector, data):
if _accessdict.has_key(selector):
setfunc, getfunc = _accessdict[selector]
setfunc(control, part, selector, data)
return
if not _codingdict.has_key(selector):
raise KeyError, ('Unknown control selector', selector)
structfmt, coder, decoder = _codingdict[selector]
if coder:
data = coder(data)
if structfmt:
data = struct.pack(structfmt, data)
control.SetControlData(part, selector, data)
def GetControlData(control, part, selector):
if _accessdict.has_key(selector):
setfunc, getfunc = _accessdict[selector]
return getfunc(control, part, selector, data)
if not _codingdict.has_key(selector):
raise KeyError, ('Unknown control selector', selector)
structfmt, coder, decoder = _codingdict[selector]
data = control.GetControlData(part, selector)
if structfmt:
data = struct.unpack(structfmt, data)
if decoder:
data = decoder(data)
if type(data) == type(()) and len(data) == 1:
data = data[0]
return data
| 32.793103 | 85 | 0.695058 | [
"MIT"
] | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.3/Lib/plat-mac/Carbon/ControlAccessor.py | 1,902 | Python |
# coding: utf-8
from __future__ import unicode_literals
from .spike import ParamountNetworkIE
class TVLandIE(ParamountNetworkIE):
IE_NAME = 'tvland.com'
_VALID_URL = r'https?://(?:www\.)?tvland\.com/(?:video-clips|(?:full-)?episodes)/(?P<id>[^/?#.]+)'
_FEED_URL = 'http://www.tvland.com/feeds/mrss/'
_TESTS = [{
# Geo-restricted. Without a proxy metadata are still there. With a
# proxy it redirects to http://m.tvland.com/app/
'url': 'https://www.tvland.com/episodes/s04pzf/everybody-loves-raymond-the-dog-season-1-ep-19',
'info_dict': {
'description': 'md5:84928e7a8ad6649371fbf5da5e1ad75a',
'title': 'The Dog',
},
'playlist_mincount': 5,
}, {
'url': 'https://www.tvland.com/video-clips/4n87f2/younger-a-first-look-at-younger-season-6',
'md5': 'e2c6389401cf485df26c79c247b08713',
'info_dict': {
'id': '891f7d3c-5b5b-4753-b879-b7ba1a601757',
'ext': 'mp4',
'title': 'Younger|April 30, 2019|6|NO-EPISODE#|A First Look at Younger Season 6',
'description': 'md5:595ea74578d3a888ae878dfd1c7d4ab2',
'upload_date': '20190430',
'timestamp': 1556658000,
},
'params': {
'skip_download': True,
},
}, {
'url': 'http://www.tvland.com/full-episodes/iu0hz6/younger-a-kiss-is-just-a-kiss-season-3-ep-301',
'only_matching': True,
}]
| 38.631579 | 106 | 0.592643 | [
"Unlicense"
] | 0017031/youtube-dl | youtube_dl/extractor/tvland.py | 1,468 | Python |
import argparse
import logging
from pprint import pprint
from .gcal import GCal
logger = logging.getLogger(__name__)
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="TODO"
)
parser.add_argument(
'-v', '--verbose', action='count', default=0,
)
return parser.parse_args()
def setup_logging(args: argparse.Namespace) -> None:
level = (
logging.DEBUG if args.verbose >= 2 else
logging.INFO if args.verbose >= 1 else
logging.WARNING
)
logging.basicConfig(level=level)
def main() -> None:
args = parse_args()
setup_logging(args)
cal = GCal()
pprint(list(cal.list_calendars(fields="items(id,summary)")))
| 20.914286 | 64 | 0.655738 | [
"MIT"
] | liskin/gcal-sync | src/gcal_sync/cli.py | 732 | Python |
from ..options import Option, OptionHandler
class LocaleOptionsMixin(OptionHandler):
"""
Mixin which adds a locale option to option handlers.
"""
# The locale to use
locale = Option(
help="the locale to use for parsing the numbers",
default="en_US"
)
| 22.538462 | 57 | 0.651877 | [
"MIT"
] | waikato-datamining/wai-spectral-io | src/wai/spectralio/mixins/_LocaleOptionsMixin.py | 293 | Python |
"""Sets of metrics to look at the SRD metrics.
"""
import numpy as np
import healpy as hp
import rubin_sim.maf.metrics as metrics
import rubin_sim.maf.slicers as slicers
import rubin_sim.maf.stackers as stackers
import rubin_sim.maf.plots as plots
import rubin_sim.maf.metricBundles as mb
from .colMapDict import ColMapDict
from .common import standardSummary, radecCols, combineMetadata
__all__ = ['fOBatch', 'astrometryBatch', 'rapidRevisitBatch']
def fOBatch(colmap=None, runName='opsim', extraSql=None, extraMetadata=None, nside=64,
benchmarkArea=18000, benchmarkNvisits=825, minNvisits=750):
"""Metrics for calculating fO.
Parameters
----------
colmap : dict or None, optional
A dictionary with a mapping of column names. Default will use OpsimV4 column names.
runName : str, optional
The name of the simulated survey. Default is "opsim".
nside : int, optional
Nside for the healpix slicer. Default 64.
extraSql : str or None, optional
Additional sql constraint to apply to all metrics.
extraMetadata : str or None, optional
Additional metadata to apply to all results.
Returns
-------
metricBundleDict
"""
if colmap is None:
colmap = ColMapDict('fbs')
bundleList = []
sql = ''
metadata = 'All visits'
# Add additional sql constraint (such as wfdWhere) and metadata, if provided.
if (extraSql is not None) and (len(extraSql) > 0):
sql = extraSql
if extraMetadata is None:
metadata = extraSql.replace('filter =', '').replace('filter=', '')
metadata = metadata.replace('"', '').replace("'", '')
if extraMetadata is not None:
metadata = extraMetadata
subgroup = metadata
raCol, decCol, degrees, ditherStacker, ditherMeta = radecCols(None, colmap, None)
# Don't want dither info in subgroup (too long), but do want it in bundle name.
metadata = combineMetadata(metadata, ditherMeta)
# Set up fO metric.
slicer = slicers.HealpixSlicer(nside=nside, lonCol=raCol, latCol=decCol, latLonDeg=degrees)
displayDict = {'group': 'SRD FO metrics', 'subgroup': subgroup, 'order': 0}
# Configure the count metric which is what is used for f0 slicer.
metric = metrics.CountExplimMetric(col=colmap['mjd'], metricName='fO', expCol=colmap['exptime'])
plotDict = {'xlabel': 'Number of Visits', 'Asky': benchmarkArea,
'Nvisit': benchmarkNvisits, 'xMin': 0, 'xMax': 1500}
summaryMetrics = [metrics.fOArea(nside=nside, norm=False, metricName='fOArea',
Asky=benchmarkArea, Nvisit=benchmarkNvisits),
metrics.fOArea(nside=nside, norm=True, metricName='fOArea/benchmark',
Asky=benchmarkArea, Nvisit=benchmarkNvisits),
metrics.fONv(nside=nside, norm=False, metricName='fONv',
Asky=benchmarkArea, Nvisit=benchmarkNvisits),
metrics.fONv(nside=nside, norm=True, metricName='fONv/benchmark',
Asky=benchmarkArea, Nvisit=benchmarkNvisits),
metrics.fOArea(nside=nside, norm=False, metricName=f'fOArea_{minNvisits}',
Asky=benchmarkArea, Nvisit=minNvisits)]
caption = 'The FO metric evaluates the overall efficiency of observing. '
caption += ('foNv: out of %.2f sq degrees, the area receives at least X and a median of Y visits '
'(out of %d, if compared to benchmark). ' % (benchmarkArea, benchmarkNvisits))
caption += ('fOArea: this many sq deg (out of %.2f sq deg if compared '
'to benchmark) receives at least %d visits. ' % (benchmarkArea, benchmarkNvisits))
displayDict['caption'] = caption
bundle = mb.MetricBundle(metric, slicer, sql, plotDict=plotDict,
stackerList = [ditherStacker],
displayDict=displayDict, summaryMetrics=summaryMetrics,
plotFuncs=[plots.FOPlot()], metadata=metadata)
bundleList.append(bundle)
# Set the runName for all bundles and return the bundleDict.
for b in bundleList:
b.setRunName(runName)
return mb.makeBundlesDictFromList(bundleList)
def astrometryBatch(colmap=None, runName='opsim',
extraSql=None, extraMetadata=None,
nside=64, ditherStacker=None, ditherkwargs=None):
"""Metrics for evaluating proper motion and parallax.
Parameters
----------
colmap : dict or None, optional
A dictionary with a mapping of column names. Default will use OpsimV4 column names.
runName : str, optional
The name of the simulated survey. Default is "opsim".
nside : int, optional
Nside for the healpix slicer. Default 64.
extraSql : str or None, optional
Additional sql constraint to apply to all metrics.
extraMetadata : str or None, optional
Additional metadata to apply to all results.
ditherStacker: str or rubin_sim.maf.stackers.BaseDitherStacker
Optional dither stacker to use to define ra/dec columns.
ditherkwargs: dict, optional
Optional dictionary of kwargs for the dither stacker.
Returns
-------
metricBundleDict
"""
if colmap is None:
colmap = ColMapDict('fbs')
bundleList = []
sql = ''
metadata = 'All visits'
# Add additional sql constraint (such as wfdWhere) and metadata, if provided.
if (extraSql is not None) and (len(extraSql) > 0):
sql = extraSql
if extraMetadata is None:
metadata = extraSql.replace('filter =', '').replace('filter=', '')
metadata = metadata.replace('"', '').replace("'", '')
if extraMetadata is not None:
metadata = extraMetadata
subgroup = metadata
raCol, decCol, degrees, ditherStacker, ditherMeta = radecCols(ditherStacker, colmap, ditherkwargs)
# Don't want dither info in subgroup (too long), but do want it in bundle name.
metadata = combineMetadata(metadata, ditherMeta)
rmags_para = [22.4, 24.0]
rmags_pm = [20.5, 24.0]
# Set up parallax/dcr stackers.
parallaxStacker = stackers.ParallaxFactorStacker(raCol=raCol, decCol=decCol,
dateCol=colmap['mjd'], degrees=degrees)
dcrStacker = stackers.DcrStacker(filterCol=colmap['filter'], altCol=colmap['alt'], degrees=degrees,
raCol=raCol, decCol=decCol, lstCol=colmap['lst'],
site='LSST', mjdCol=colmap['mjd'])
# Set up parallax metrics.
slicer = slicers.HealpixSlicer(nside=nside, lonCol=raCol, latCol=decCol, latLonDeg=degrees)
subsetPlots = [plots.HealpixSkyMap(), plots.HealpixHistogram()]
displayDict = {'group': 'SRD Parallax', 'subgroup': subgroup,
'order': 0, 'caption': None}
# Expected error on parallax at 10 AU.
plotmaxVals = (2.0, 15.0)
summary = [metrics.AreaSummaryMetric(area=18000, reduce_func=np.median, decreasing=False,
metricName='Median Parallax Error (18k)')]
summary.append(metrics.PercentileMetric(percentile=95, metricName='95th Percentile Parallax Error'))
summary.extend(standardSummary())
for rmag, plotmax in zip(rmags_para, plotmaxVals):
plotDict = {'xMin': 0, 'xMax': plotmax, 'colorMin': 0, 'colorMax': plotmax}
metric = metrics.ParallaxMetric(metricName='Parallax Error @ %.1f' % (rmag), rmag=rmag,
seeingCol=colmap['seeingGeom'], filterCol=colmap['filter'],
m5Col=colmap['fiveSigmaDepth'], normalize=False)
bundle = mb.MetricBundle(metric, slicer, sql, metadata=metadata,
stackerList=[parallaxStacker, ditherStacker],
displayDict=displayDict, plotDict=plotDict,
summaryMetrics=summary,
plotFuncs=subsetPlots)
bundleList.append(bundle)
displayDict['order'] += 1
# Parallax normalized to 'best possible' if all visits separated by 6 months.
# This separates the effect of cadence from depth.
for rmag in rmags_para:
metric = metrics.ParallaxMetric(metricName='Normalized Parallax @ %.1f' % (rmag), rmag=rmag,
seeingCol=colmap['seeingGeom'], filterCol=colmap['filter'],
m5Col=colmap['fiveSigmaDepth'], normalize=True)
bundle = mb.MetricBundle(metric, slicer, sql, metadata=metadata,
stackerList=[parallaxStacker, ditherStacker],
displayDict=displayDict,
summaryMetrics=standardSummary(),
plotFuncs=subsetPlots)
bundleList.append(bundle)
displayDict['order'] += 1
# Parallax factor coverage.
for rmag in rmags_para:
metric = metrics.ParallaxCoverageMetric(metricName='Parallax Coverage @ %.1f' % (rmag),
rmag=rmag, m5Col=colmap['fiveSigmaDepth'],
mjdCol=colmap['mjd'], filterCol=colmap['filter'],
seeingCol=colmap['seeingGeom'])
bundle = mb.MetricBundle(metric, slicer, sql, metadata=metadata,
stackerList=[parallaxStacker, ditherStacker],
displayDict=displayDict, summaryMetrics=standardSummary(),
plotFuncs=subsetPlots)
bundleList.append(bundle)
displayDict['order'] += 1
# Parallax problems can be caused by HA and DCR degeneracies. Check their correlation.
for rmag in rmags_para:
metric = metrics.ParallaxDcrDegenMetric(metricName='Parallax-DCR degeneracy @ %.1f' % (rmag),
rmag=rmag, seeingCol=colmap['seeingEff'],
filterCol=colmap['filter'], m5Col=colmap['fiveSigmaDepth'])
caption = 'Correlation between parallax offset magnitude and hour angle for a r=%.1f star.' % (rmag)
caption += ' (0 is good, near -1 or 1 is bad).'
bundle = mb.MetricBundle(metric, slicer, sql, metadata=metadata,
stackerList=[dcrStacker, parallaxStacker, ditherStacker],
displayDict=displayDict, summaryMetrics=standardSummary(),
plotFuncs=subsetPlots)
bundleList.append(bundle)
displayDict['order'] += 1
# Proper Motion metrics.
displayDict = {'group': 'SRD Proper Motion', 'subgroup': subgroup, 'order': 0, 'caption': None}
# Proper motion errors.
plotmaxVals = (1.0, 5.0)
summary = [metrics.AreaSummaryMetric(area=18000, reduce_func=np.median, decreasing=False,
metricName='Median Proper Motion Error (18k)')]
summary.append(metrics.PercentileMetric(metricName='95th Percentile Proper Motion Error'))
summary.extend(standardSummary())
for rmag, plotmax in zip(rmags_pm, plotmaxVals):
plotDict = {'xMin': 0, 'xMax': plotmax, 'colorMin': 0, 'colorMax': plotmax}
metric = metrics.ProperMotionMetric(metricName='Proper Motion Error @ %.1f' % rmag,
rmag=rmag, m5Col=colmap['fiveSigmaDepth'],
mjdCol=colmap['mjd'], filterCol=colmap['filter'],
seeingCol=colmap['seeingGeom'], normalize=False)
bundle = mb.MetricBundle(metric, slicer, sql, metadata=metadata,
stackerList=[ditherStacker],
displayDict=displayDict, plotDict=plotDict,
summaryMetrics=summary,
plotFuncs=subsetPlots)
bundleList.append(bundle)
displayDict['order'] += 1
# Normalized proper motion.
for rmag in rmags_pm:
metric = metrics.ProperMotionMetric(metricName='Normalized Proper Motion @ %.1f' % rmag,
rmag=rmag, m5Col=colmap['fiveSigmaDepth'],
mjdCol=colmap['mjd'], filterCol=colmap['filter'],
seeingCol=colmap['seeingGeom'], normalize=True)
bundle = mb.MetricBundle(metric, slicer, sql, metadata=metadata,
stackerList=[ditherStacker],
displayDict=displayDict, summaryMetrics=standardSummary(),
plotFuncs=subsetPlots)
bundleList.append(bundle)
displayDict['order'] += 1
# Set the runName for all bundles and return the bundleDict.
for b in bundleList:
b.setRunName(runName)
return mb.makeBundlesDictFromList(bundleList)
def rapidRevisitBatch(colmap=None, runName='opsim',
extraSql=None, extraMetadata=None, nside=64,
ditherStacker=None, ditherkwargs=None):
"""Metrics for evaluating proper motion and parallax.
Parameters
----------
colmap : dict or None, optional
A dictionary with a mapping of column names. Default will use OpsimV4 column names.
runName : str, optional
The name of the simulated survey. Default is "opsim".
nside : int, optional
Nside for the healpix slicer. Default 64.
extraSql : str or None, optional
Additional sql constraint to apply to all metrics.
extraMetadata : str or None, optional
Additional metadata to apply to all results.
ditherStacker: str or rubin_sim.maf.stackers.BaseDitherStacker
Optional dither stacker to use to define ra/dec columns.
ditherkwargs: dict, optional
Optional dictionary of kwargs for the dither stacker.
Returns
-------
metricBundleDict
"""
if colmap is None:
colmap = ColMapDict('fbs')
bundleList = []
sql = ''
metadata = 'All visits'
# Add additional sql constraint (such as wfdWhere) and metadata, if provided.
if (extraSql is not None) and (len(extraSql) > 0):
sql = extraSql
if extraMetadata is None:
metadata = extraSql.replace('filter =', '').replace('filter=', '')
metadata = metadata.replace('"', '').replace("'", '')
if extraMetadata is not None:
metadata = extraMetadata
subgroup = metadata
raCol, decCol, degrees, ditherStacker, ditherMeta = radecCols(ditherStacker, colmap, ditherkwargs)
# Don't want dither info in subgroup (too long), but do want it in bundle name.
metadata = combineMetadata(metadata, ditherMeta)
slicer = slicers.HealpixSlicer(nside=nside, lonCol=raCol, latCol=decCol, latLonDeg=degrees)
subsetPlots = [plots.HealpixSkyMap(), plots.HealpixHistogram()]
displayDict = {'group': 'SRD Rapid Revisits', 'subgroup': subgroup,
'order': 0, 'caption': None}
# Calculate the actual number of revisits within 30 minutes.
dTmax = 30 # time in minutes
m2 = metrics.NRevisitsMetric(dT=dTmax, mjdCol=colmap['mjd'], normed=False,
metricName='NumberOfQuickRevisits')
plotDict = {'colorMin': 400, 'colorMax': 2000, 'xMin': 400, 'xMax': 2000}
caption = 'Number of consecutive visits with return times faster than %.1f minutes, ' % (dTmax)
caption += 'in any filter, all proposals. '
displayDict['caption'] = caption
bundle = mb.MetricBundle(m2, slicer, sql, plotDict=plotDict, plotFuncs=subsetPlots,
stackerList=[ditherStacker],
metadata=metadata, displayDict=displayDict,
summaryMetrics=standardSummary(withCount=False))
bundleList.append(bundle)
displayDict['order'] += 1
# Better version of the rapid revisit requirements: require a minimum number of visits between
# dtMin and dtMax, but also a minimum number of visits between dtMin and dtPair (the typical pair time).
# 1 means the healpix met the requirements (0 means did not).
dTmin = 40.0/60.0 # (minutes) 40s minumum for rapid revisit range
dTpairs = 20.0 # minutes (time when pairs should start kicking in)
dTmax = 30.0 # 30 minute maximum for rapid revisit range
nOne = 82 # Number of revisits between 40s-30m required
nTwo = 28 # Number of revisits between 40s - tPairs required.
pixArea = float(hp.nside2pixarea(nside, degrees=True))
scale = pixArea * hp.nside2npix(nside)
m1 = metrics.RapidRevisitMetric(metricName='RapidRevisits', mjdCol=colmap['mjd'],
dTmin=dTmin / 60.0 / 60.0 / 24.0, dTpairs = dTpairs / 60.0 / 24.0,
dTmax=dTmax / 60.0 / 24.0, minN1=nOne, minN2=nTwo)
plotDict = {'xMin': 0, 'xMax': 1, 'colorMin': 0, 'colorMax': 1, 'logScale': False}
cutoff1 = 0.9
summaryStats = [metrics.FracAboveMetric(cutoff=cutoff1, scale=scale, metricName='Area (sq deg)')]
caption = 'Rapid Revisit: area that receives at least %d visits between %.3f and %.1f minutes, ' \
% (nOne, dTmin, dTmax)
caption += 'with at least %d of those visits falling between %.3f and %.1f minutes. ' \
% (nTwo, dTmin, dTpairs)
caption += 'Summary statistic "Area" indicates the area on the sky which meets this requirement.' \
' (SRD design specification is 2000 sq deg).'
displayDict['caption'] = caption
bundle = mb.MetricBundle(m1, slicer, sql, plotDict=plotDict, plotFuncs=subsetPlots,
stackerList=[ditherStacker],
metadata=metadata, displayDict=displayDict, summaryMetrics=summaryStats)
bundleList.append(bundle)
displayDict['order'] += 1
# Set the runName for all bundles and return the bundleDict.
for b in bundleList:
b.setRunName(runName)
return mb.makeBundlesDictFromList(bundleList)
| 51.164804 | 108 | 0.612928 | [
"MIT"
] | RileyWClarke/Flarubin | rubin_sim/maf/batches/srdBatch.py | 18,317 | Python |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""i_naturalist2018 dataset."""
from tensorflow_datasets.image_classification.i_naturalist2018.i_naturalist2018 import INaturalist2018
| 39.368421 | 102 | 0.783422 | [
"Apache-2.0"
] | BeeAlarmed/datasets | tensorflow_datasets/image_classification/i_naturalist2018/__init__.py | 748 | Python |
# Copyright 2016, Kay Hayen, mailto:[email protected]
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
""" Code generation for lists.
Right now only the creation is done here. But more should be added later on.
"""
from .ErrorCodes import (
getErrorExitBoolCode,
getErrorExitCode,
getReleaseCode,
getReleaseCodes
)
from .Helpers import generateChildExpressionsCode, generateExpressionCode
from .PythonAPICodes import generateCAPIObjectCode
def generateListCreationCode(to_name, expression, emit, context):
elements = expression.getElements()
emit(
"%s = PyList_New( %d );" % (
to_name,
len(elements)
)
)
context.addCleanupTempName(to_name)
element_name = context.allocateTempName("list_element")
for count, element in enumerate(elements):
generateExpressionCode(
to_name = element_name,
expression = element,
emit = emit,
context = context
)
if not context.needsCleanup(element_name):
emit("Py_INCREF( %s );" % element_name)
else:
context.removeCleanupTempName(element_name)
emit(
"PyList_SET_ITEM( %s, %d, %s );" % (
to_name,
count,
element_name
)
)
def generateListOperationAppendCode(statement, emit, context):
list_arg_name = context.allocateTempName("append_list")
generateExpressionCode(
to_name = list_arg_name,
expression = statement.getList(),
emit = emit,
context = context
)
value_arg_name = context.allocateTempName("append_value")
generateExpressionCode(
to_name = value_arg_name,
expression = statement.getValue(),
emit = emit,
context = context
)
context.setCurrentSourceCodeReference(statement.getSourceReference())
res_name = context.getIntResName()
emit("assert( PyList_Check( %s ) );" % list_arg_name)
emit(
"%s = PyList_Append( %s, %s );" % (
res_name,
list_arg_name,
value_arg_name
)
)
getReleaseCodes(
release_names = (list_arg_name, value_arg_name),
emit = emit,
context = context
)
getErrorExitBoolCode(
condition = "%s == -1" % res_name,
emit = emit,
context = context
)
def generateListOperationExtendCode(to_name, expression, emit, context):
list_arg_name, value_arg_name = generateChildExpressionsCode(
expression = expression,
emit = emit,
context = context
)
emit("assert( PyList_Check( %s ) );" % list_arg_name)
emit(
"%s = _PyList_Extend( (PyListObject *)%s, %s );" % (
to_name,
list_arg_name,
value_arg_name
)
)
getReleaseCodes(
release_names = (list_arg_name, value_arg_name),
emit = emit,
context = context
)
getErrorExitCode(
check_name = to_name,
emit = emit,
context = context
)
context.addCleanupTempName(to_name)
def generateListOperationPopCode(to_name, expression, emit, context):
list_arg_name, = generateChildExpressionsCode(
expression = expression,
emit = emit,
context = context
)
# TODO: Have a dedicated helper instead, this could be more efficient.
emit("assert( PyList_Check( %s ) );" % list_arg_name)
emit(
'%s = PyObject_CallMethod( %s, (char *)"pop", NULL );' % (
to_name,
list_arg_name
)
)
getReleaseCode(
release_name = list_arg_name,
emit = emit,
context = context
)
getErrorExitCode(
check_name = to_name,
emit = emit,
context = context
)
context.addCleanupTempName(to_name)
def generateBuiltinListCode(to_name, expression, emit, context):
generateCAPIObjectCode(
to_name = to_name,
capi = "PySequence_List",
arg_desc = (
("list_arg", expression.getValue()),
),
may_raise = expression.mayRaiseException(BaseException),
source_ref = expression.getCompatibleSourceReference(),
emit = emit,
context = context
)
| 27.521505 | 78 | 0.601094 | [
"Apache-2.0"
] | augustand/Nuitka | nuitka/codegen/ListCodes.py | 5,119 | Python |
ADD_USER_ROLE = '''
INSERT INTO UserRole(roleId, userId) VALUES (
(SELECT id FROM Role WHERE name = :roleName),
:userId
)
'''
#
# User table queries
#
ADD_USER = '''
INSERT OR IGNORE INTO User(id, username) VALUES(:userId, :username)
'''
UPDATE_USERNAME = '''
UPDATE User
SET username = :username
WHERE id = :userId
'''
GET_USERNAME = '''
SELECT name FROM User WHERE id = :userId
'''
#
# Tag queries
#
ADD_TAG = '''
INSERT INTO Tag(name) VALUES (:name)
'''
GET_IMAGE_TAGS = '''
SELECT Tag.name FROM Tag
JOIN ImageTag ON ImageTag.tagId = Tag.id
JOIN Image ON ImageTag.imageId = Image.id
WHERE Image.id = :imageId
'''
#
# Image queries
#
ADD_IMAGE = '''
INSERT INTO Image(id, guid, submitterId, caption, qualityRating, channelId, postDate, hash)
VALUES (:imageId, :guid, :submitterId, :caption, 0, :channelId, :postDate, :hash)
'''
GET_IMAGE_HASH = '''
SELECT id, guid FROM Image
WHERE hash = :hash
'''
| 20.72 | 96 | 0.603282 | [
"MIT"
] | camd67/moebot-py-archive | bot/queries.py | 1,036 | Python |
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advanced ways than the prior generations of tools. Cisco Intersight provides an integrated and intuitive management experience for resources in the traditional data center as well as at the edge. With flexible deployment options to address complex security needs, getting started with Intersight is quick and easy. Cisco Intersight has deep integration with Cisco UCS and HyperFlex systems allowing for remote deployment, configuration, and ongoing maintenance. The model-based deployment works for a single system in a remote location or hundreds of systems in a data center and enables rapid, standardized configuration and deployment. It also streamlines maintaining those systems whether you are working with small or very large configurations. The Intersight OpenAPI document defines the complete set of properties that are returned in the HTTP response. From that perspective, a client can expect that no additional properties are returned, unless these properties are explicitly defined in the OpenAPI document. However, when a client uses an older version of the Intersight OpenAPI document, the server may send additional properties because the software is more recent than the client. In that case, the client may receive properties that it does not know about. Some generated SDKs perform a strict validation of the HTTP response body against the OpenAPI document. # noqa: E501
The version of the OpenAPI document: 1.0.9-4950
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from intersight.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def lazy_import():
from intersight.model.asset_device_registration_relationship import AssetDeviceRegistrationRelationship
from intersight.model.compute_mapping_relationship import ComputeMappingRelationship
from intersight.model.compute_physical_relationship import ComputePhysicalRelationship
from intersight.model.compute_vmedia import ComputeVmedia
from intersight.model.display_names import DisplayNames
from intersight.model.inventory_device_info_relationship import InventoryDeviceInfoRelationship
from intersight.model.mo_base_mo_relationship import MoBaseMoRelationship
from intersight.model.mo_mo_ref import MoMoRef
from intersight.model.mo_tag import MoTag
from intersight.model.mo_version_context import MoVersionContext
globals()['AssetDeviceRegistrationRelationship'] = AssetDeviceRegistrationRelationship
globals()['ComputeMappingRelationship'] = ComputeMappingRelationship
globals()['ComputePhysicalRelationship'] = ComputePhysicalRelationship
globals()['ComputeVmedia'] = ComputeVmedia
globals()['DisplayNames'] = DisplayNames
globals()['InventoryDeviceInfoRelationship'] = InventoryDeviceInfoRelationship
globals()['MoBaseMoRelationship'] = MoBaseMoRelationship
globals()['MoMoRef'] = MoMoRef
globals()['MoTag'] = MoTag
globals()['MoVersionContext'] = MoVersionContext
class ComputeVmediaRelationship(ModelComposed):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
('class_id',): {
'MO.MOREF': "mo.MoRef",
},
('object_type',): {
'AAA.AUDITRECORD': "aaa.AuditRecord",
'AAA.RETENTIONCONFIG': "aaa.RetentionConfig",
'AAA.RETENTIONPOLICY': "aaa.RetentionPolicy",
'ACCESS.POLICY': "access.Policy",
'ADAPTER.CONFIGPOLICY': "adapter.ConfigPolicy",
'ADAPTER.EXTETHINTERFACE': "adapter.ExtEthInterface",
'ADAPTER.HOSTETHINTERFACE': "adapter.HostEthInterface",
'ADAPTER.HOSTFCINTERFACE': "adapter.HostFcInterface",
'ADAPTER.HOSTISCSIINTERFACE': "adapter.HostIscsiInterface",
'ADAPTER.UNIT': "adapter.Unit",
'ADAPTER.UNITEXPANDER': "adapter.UnitExpander",
'APPLIANCE.APPSTATUS': "appliance.AppStatus",
'APPLIANCE.AUTORMAPOLICY': "appliance.AutoRmaPolicy",
'APPLIANCE.BACKUP': "appliance.Backup",
'APPLIANCE.BACKUPPOLICY': "appliance.BackupPolicy",
'APPLIANCE.CERTIFICATESETTING': "appliance.CertificateSetting",
'APPLIANCE.DATAEXPORTPOLICY': "appliance.DataExportPolicy",
'APPLIANCE.DEVICECERTIFICATE': "appliance.DeviceCertificate",
'APPLIANCE.DEVICECLAIM': "appliance.DeviceClaim",
'APPLIANCE.DEVICEUPGRADEPOLICY': "appliance.DeviceUpgradePolicy",
'APPLIANCE.DIAGSETTING': "appliance.DiagSetting",
'APPLIANCE.EXTERNALSYSLOGSETTING': "appliance.ExternalSyslogSetting",
'APPLIANCE.FILEGATEWAY': "appliance.FileGateway",
'APPLIANCE.FILESYSTEMSTATUS': "appliance.FileSystemStatus",
'APPLIANCE.GROUPSTATUS': "appliance.GroupStatus",
'APPLIANCE.IMAGEBUNDLE': "appliance.ImageBundle",
'APPLIANCE.NODEINFO': "appliance.NodeInfo",
'APPLIANCE.NODESTATUS': "appliance.NodeStatus",
'APPLIANCE.RELEASENOTE': "appliance.ReleaseNote",
'APPLIANCE.REMOTEFILEIMPORT': "appliance.RemoteFileImport",
'APPLIANCE.RESTORE': "appliance.Restore",
'APPLIANCE.SETUPINFO': "appliance.SetupInfo",
'APPLIANCE.SYSTEMINFO': "appliance.SystemInfo",
'APPLIANCE.SYSTEMSTATUS': "appliance.SystemStatus",
'APPLIANCE.UPGRADE': "appliance.Upgrade",
'APPLIANCE.UPGRADEPOLICY': "appliance.UpgradePolicy",
'ASSET.CLUSTERMEMBER': "asset.ClusterMember",
'ASSET.DEPLOYMENT': "asset.Deployment",
'ASSET.DEPLOYMENTDEVICE': "asset.DeploymentDevice",
'ASSET.DEVICECLAIM': "asset.DeviceClaim",
'ASSET.DEVICECONFIGURATION': "asset.DeviceConfiguration",
'ASSET.DEVICECONNECTORMANAGER': "asset.DeviceConnectorManager",
'ASSET.DEVICECONTRACTINFORMATION': "asset.DeviceContractInformation",
'ASSET.DEVICECONTRACTNOTIFICATION': "asset.DeviceContractNotification",
'ASSET.DEVICEREGISTRATION': "asset.DeviceRegistration",
'ASSET.SUBSCRIPTION': "asset.Subscription",
'ASSET.SUBSCRIPTIONACCOUNT': "asset.SubscriptionAccount",
'ASSET.SUBSCRIPTIONDEVICECONTRACTINFORMATION': "asset.SubscriptionDeviceContractInformation",
'ASSET.TARGET': "asset.Target",
'BIOS.BOOTDEVICE': "bios.BootDevice",
'BIOS.BOOTMODE': "bios.BootMode",
'BIOS.POLICY': "bios.Policy",
'BIOS.SYSTEMBOOTORDER': "bios.SystemBootOrder",
'BIOS.TOKENSETTINGS': "bios.TokenSettings",
'BIOS.UNIT': "bios.Unit",
'BIOS.VFSELECTMEMORYRASCONFIGURATION': "bios.VfSelectMemoryRasConfiguration",
'BOOT.CDDDEVICE': "boot.CddDevice",
'BOOT.DEVICEBOOTMODE': "boot.DeviceBootMode",
'BOOT.DEVICEBOOTSECURITY': "boot.DeviceBootSecurity",
'BOOT.HDDDEVICE': "boot.HddDevice",
'BOOT.ISCSIDEVICE': "boot.IscsiDevice",
'BOOT.NVMEDEVICE': "boot.NvmeDevice",
'BOOT.PCHSTORAGEDEVICE': "boot.PchStorageDevice",
'BOOT.PRECISIONPOLICY': "boot.PrecisionPolicy",
'BOOT.PXEDEVICE': "boot.PxeDevice",
'BOOT.SANDEVICE': "boot.SanDevice",
'BOOT.SDDEVICE': "boot.SdDevice",
'BOOT.UEFISHELLDEVICE': "boot.UefiShellDevice",
'BOOT.USBDEVICE': "boot.UsbDevice",
'BOOT.VMEDIADEVICE': "boot.VmediaDevice",
'BULK.EXPORT': "bulk.Export",
'BULK.EXPORTEDITEM': "bulk.ExportedItem",
'BULK.MOCLONER': "bulk.MoCloner",
'BULK.MOMERGER': "bulk.MoMerger",
'BULK.REQUEST': "bulk.Request",
'BULK.SUBREQUESTOBJ': "bulk.SubRequestObj",
'CAPABILITY.ADAPTERUNITDESCRIPTOR': "capability.AdapterUnitDescriptor",
'CAPABILITY.CATALOG': "capability.Catalog",
'CAPABILITY.CHASSISDESCRIPTOR': "capability.ChassisDescriptor",
'CAPABILITY.CHASSISMANUFACTURINGDEF': "capability.ChassisManufacturingDef",
'CAPABILITY.CIMCFIRMWAREDESCRIPTOR': "capability.CimcFirmwareDescriptor",
'CAPABILITY.EQUIPMENTPHYSICALDEF': "capability.EquipmentPhysicalDef",
'CAPABILITY.EQUIPMENTSLOTARRAY': "capability.EquipmentSlotArray",
'CAPABILITY.FANMODULEDESCRIPTOR': "capability.FanModuleDescriptor",
'CAPABILITY.FANMODULEMANUFACTURINGDEF': "capability.FanModuleManufacturingDef",
'CAPABILITY.IOCARDCAPABILITYDEF': "capability.IoCardCapabilityDef",
'CAPABILITY.IOCARDDESCRIPTOR': "capability.IoCardDescriptor",
'CAPABILITY.IOCARDMANUFACTURINGDEF': "capability.IoCardManufacturingDef",
'CAPABILITY.PORTGROUPAGGREGATIONDEF': "capability.PortGroupAggregationDef",
'CAPABILITY.PSUDESCRIPTOR': "capability.PsuDescriptor",
'CAPABILITY.PSUMANUFACTURINGDEF': "capability.PsuManufacturingDef",
'CAPABILITY.SERVERMODELSCAPABILITYDEF': "capability.ServerModelsCapabilityDef",
'CAPABILITY.SERVERSCHEMADESCRIPTOR': "capability.ServerSchemaDescriptor",
'CAPABILITY.SIOCMODULECAPABILITYDEF': "capability.SiocModuleCapabilityDef",
'CAPABILITY.SIOCMODULEDESCRIPTOR': "capability.SiocModuleDescriptor",
'CAPABILITY.SIOCMODULEMANUFACTURINGDEF': "capability.SiocModuleManufacturingDef",
'CAPABILITY.SWITCHCAPABILITY': "capability.SwitchCapability",
'CAPABILITY.SWITCHDESCRIPTOR': "capability.SwitchDescriptor",
'CAPABILITY.SWITCHMANUFACTURINGDEF': "capability.SwitchManufacturingDef",
'CERTIFICATEMANAGEMENT.POLICY': "certificatemanagement.Policy",
'CHASSIS.CONFIGCHANGEDETAIL': "chassis.ConfigChangeDetail",
'CHASSIS.CONFIGIMPORT': "chassis.ConfigImport",
'CHASSIS.CONFIGRESULT': "chassis.ConfigResult",
'CHASSIS.CONFIGRESULTENTRY': "chassis.ConfigResultEntry",
'CHASSIS.IOMPROFILE': "chassis.IomProfile",
'CHASSIS.PROFILE': "chassis.Profile",
'CLOUD.AWSBILLINGUNIT': "cloud.AwsBillingUnit",
'CLOUD.AWSKEYPAIR': "cloud.AwsKeyPair",
'CLOUD.AWSNETWORKINTERFACE': "cloud.AwsNetworkInterface",
'CLOUD.AWSORGANIZATIONALUNIT': "cloud.AwsOrganizationalUnit",
'CLOUD.AWSSECURITYGROUP': "cloud.AwsSecurityGroup",
'CLOUD.AWSSUBNET': "cloud.AwsSubnet",
'CLOUD.AWSVIRTUALMACHINE': "cloud.AwsVirtualMachine",
'CLOUD.AWSVOLUME': "cloud.AwsVolume",
'CLOUD.AWSVPC': "cloud.AwsVpc",
'CLOUD.COLLECTINVENTORY': "cloud.CollectInventory",
'CLOUD.REGIONS': "cloud.Regions",
'CLOUD.SKUCONTAINERTYPE': "cloud.SkuContainerType",
'CLOUD.SKUDATABASETYPE': "cloud.SkuDatabaseType",
'CLOUD.SKUINSTANCETYPE': "cloud.SkuInstanceType",
'CLOUD.SKUNETWORKTYPE': "cloud.SkuNetworkType",
'CLOUD.SKUREGIONRATECARDS': "cloud.SkuRegionRateCards",
'CLOUD.SKUVOLUMETYPE': "cloud.SkuVolumeType",
'CLOUD.TFCAGENTPOOL': "cloud.TfcAgentpool",
'CLOUD.TFCORGANIZATION': "cloud.TfcOrganization",
'CLOUD.TFCWORKSPACE': "cloud.TfcWorkspace",
'COMM.HTTPPROXYPOLICY': "comm.HttpProxyPolicy",
'COMPUTE.BIOSPOSTPOLICY': "compute.BiosPostPolicy",
'COMPUTE.BLADE': "compute.Blade",
'COMPUTE.BLADEIDENTITY': "compute.BladeIdentity",
'COMPUTE.BOARD': "compute.Board",
'COMPUTE.MAPPING': "compute.Mapping",
'COMPUTE.PHYSICALSUMMARY': "compute.PhysicalSummary",
'COMPUTE.RACKUNIT': "compute.RackUnit",
'COMPUTE.RACKUNITIDENTITY': "compute.RackUnitIdentity",
'COMPUTE.SERVERPOWERPOLICY': "compute.ServerPowerPolicy",
'COMPUTE.SERVERSETTING': "compute.ServerSetting",
'COMPUTE.VMEDIA': "compute.Vmedia",
'COND.ALARM': "cond.Alarm",
'COND.ALARMAGGREGATION': "cond.AlarmAggregation",
'COND.HCLSTATUS': "cond.HclStatus",
'COND.HCLSTATUSDETAIL': "cond.HclStatusDetail",
'COND.HCLSTATUSJOB': "cond.HclStatusJob",
'CONNECTORPACK.CONNECTORPACKUPGRADE': "connectorpack.ConnectorPackUpgrade",
'CONNECTORPACK.UPGRADEIMPACT': "connectorpack.UpgradeImpact",
'CONVERGEDINFRA.HEALTHCHECKDEFINITION': "convergedinfra.HealthCheckDefinition",
'CONVERGEDINFRA.HEALTHCHECKEXECUTION': "convergedinfra.HealthCheckExecution",
'CONVERGEDINFRA.POD': "convergedinfra.Pod",
'CRD.CUSTOMRESOURCE': "crd.CustomResource",
'DEVICECONNECTOR.POLICY': "deviceconnector.Policy",
'EQUIPMENT.CHASSIS': "equipment.Chassis",
'EQUIPMENT.CHASSISIDENTITY': "equipment.ChassisIdentity",
'EQUIPMENT.CHASSISOPERATION': "equipment.ChassisOperation",
'EQUIPMENT.DEVICESUMMARY': "equipment.DeviceSummary",
'EQUIPMENT.EXPANDERMODULE': "equipment.ExpanderModule",
'EQUIPMENT.FAN': "equipment.Fan",
'EQUIPMENT.FANCONTROL': "equipment.FanControl",
'EQUIPMENT.FANMODULE': "equipment.FanModule",
'EQUIPMENT.FEX': "equipment.Fex",
'EQUIPMENT.FEXIDENTITY': "equipment.FexIdentity",
'EQUIPMENT.FEXOPERATION': "equipment.FexOperation",
'EQUIPMENT.FRU': "equipment.Fru",
'EQUIPMENT.IDENTITYSUMMARY': "equipment.IdentitySummary",
'EQUIPMENT.IOCARD': "equipment.IoCard",
'EQUIPMENT.IOCARDOPERATION': "equipment.IoCardOperation",
'EQUIPMENT.IOEXPANDER': "equipment.IoExpander",
'EQUIPMENT.LOCATORLED': "equipment.LocatorLed",
'EQUIPMENT.PSU': "equipment.Psu",
'EQUIPMENT.PSUCONTROL': "equipment.PsuControl",
'EQUIPMENT.RACKENCLOSURE': "equipment.RackEnclosure",
'EQUIPMENT.RACKENCLOSURESLOT': "equipment.RackEnclosureSlot",
'EQUIPMENT.SHAREDIOMODULE': "equipment.SharedIoModule",
'EQUIPMENT.SWITCHCARD': "equipment.SwitchCard",
'EQUIPMENT.SYSTEMIOCONTROLLER': "equipment.SystemIoController",
'EQUIPMENT.TPM': "equipment.Tpm",
'EQUIPMENT.TRANSCEIVER': "equipment.Transceiver",
'ETHER.HOSTPORT': "ether.HostPort",
'ETHER.NETWORKPORT': "ether.NetworkPort",
'ETHER.PHYSICALPORT': "ether.PhysicalPort",
'ETHER.PORTCHANNEL': "ether.PortChannel",
'EXTERNALSITE.AUTHORIZATION': "externalsite.Authorization",
'FABRIC.APPLIANCEPCROLE': "fabric.AppliancePcRole",
'FABRIC.APPLIANCEROLE': "fabric.ApplianceRole",
'FABRIC.CONFIGCHANGEDETAIL': "fabric.ConfigChangeDetail",
'FABRIC.CONFIGRESULT': "fabric.ConfigResult",
'FABRIC.CONFIGRESULTENTRY': "fabric.ConfigResultEntry",
'FABRIC.ELEMENTIDENTITY': "fabric.ElementIdentity",
'FABRIC.ESTIMATEIMPACT': "fabric.EstimateImpact",
'FABRIC.ETHNETWORKCONTROLPOLICY': "fabric.EthNetworkControlPolicy",
'FABRIC.ETHNETWORKGROUPPOLICY': "fabric.EthNetworkGroupPolicy",
'FABRIC.ETHNETWORKPOLICY': "fabric.EthNetworkPolicy",
'FABRIC.FCNETWORKPOLICY': "fabric.FcNetworkPolicy",
'FABRIC.FCSTORAGEROLE': "fabric.FcStorageRole",
'FABRIC.FCUPLINKPCROLE': "fabric.FcUplinkPcRole",
'FABRIC.FCUPLINKROLE': "fabric.FcUplinkRole",
'FABRIC.FCOEUPLINKPCROLE': "fabric.FcoeUplinkPcRole",
'FABRIC.FCOEUPLINKROLE': "fabric.FcoeUplinkRole",
'FABRIC.FLOWCONTROLPOLICY': "fabric.FlowControlPolicy",
'FABRIC.LINKAGGREGATIONPOLICY': "fabric.LinkAggregationPolicy",
'FABRIC.LINKCONTROLPOLICY': "fabric.LinkControlPolicy",
'FABRIC.MULTICASTPOLICY': "fabric.MulticastPolicy",
'FABRIC.PCMEMBER': "fabric.PcMember",
'FABRIC.PCOPERATION': "fabric.PcOperation",
'FABRIC.PORTMODE': "fabric.PortMode",
'FABRIC.PORTOPERATION': "fabric.PortOperation",
'FABRIC.PORTPOLICY': "fabric.PortPolicy",
'FABRIC.SERVERROLE': "fabric.ServerRole",
'FABRIC.SWITCHCLUSTERPROFILE': "fabric.SwitchClusterProfile",
'FABRIC.SWITCHCONTROLPOLICY': "fabric.SwitchControlPolicy",
'FABRIC.SWITCHPROFILE': "fabric.SwitchProfile",
'FABRIC.SYSTEMQOSPOLICY': "fabric.SystemQosPolicy",
'FABRIC.UPLINKPCROLE': "fabric.UplinkPcRole",
'FABRIC.UPLINKROLE': "fabric.UplinkRole",
'FABRIC.VLAN': "fabric.Vlan",
'FABRIC.VSAN': "fabric.Vsan",
'FAULT.INSTANCE': "fault.Instance",
'FC.PHYSICALPORT': "fc.PhysicalPort",
'FC.PORTCHANNEL': "fc.PortChannel",
'FCPOOL.FCBLOCK': "fcpool.FcBlock",
'FCPOOL.LEASE': "fcpool.Lease",
'FCPOOL.POOL': "fcpool.Pool",
'FCPOOL.POOLMEMBER': "fcpool.PoolMember",
'FCPOOL.UNIVERSE': "fcpool.Universe",
'FEEDBACK.FEEDBACKPOST': "feedback.FeedbackPost",
'FIRMWARE.BIOSDESCRIPTOR': "firmware.BiosDescriptor",
'FIRMWARE.BOARDCONTROLLERDESCRIPTOR': "firmware.BoardControllerDescriptor",
'FIRMWARE.CHASSISUPGRADE': "firmware.ChassisUpgrade",
'FIRMWARE.CIMCDESCRIPTOR': "firmware.CimcDescriptor",
'FIRMWARE.DIMMDESCRIPTOR': "firmware.DimmDescriptor",
'FIRMWARE.DISTRIBUTABLE': "firmware.Distributable",
'FIRMWARE.DISTRIBUTABLEMETA': "firmware.DistributableMeta",
'FIRMWARE.DRIVEDESCRIPTOR': "firmware.DriveDescriptor",
'FIRMWARE.DRIVERDISTRIBUTABLE': "firmware.DriverDistributable",
'FIRMWARE.EULA': "firmware.Eula",
'FIRMWARE.FIRMWARESUMMARY': "firmware.FirmwareSummary",
'FIRMWARE.GPUDESCRIPTOR': "firmware.GpuDescriptor",
'FIRMWARE.HBADESCRIPTOR': "firmware.HbaDescriptor",
'FIRMWARE.IOMDESCRIPTOR': "firmware.IomDescriptor",
'FIRMWARE.MSWITCHDESCRIPTOR': "firmware.MswitchDescriptor",
'FIRMWARE.NXOSDESCRIPTOR': "firmware.NxosDescriptor",
'FIRMWARE.PCIEDESCRIPTOR': "firmware.PcieDescriptor",
'FIRMWARE.PSUDESCRIPTOR': "firmware.PsuDescriptor",
'FIRMWARE.RUNNINGFIRMWARE': "firmware.RunningFirmware",
'FIRMWARE.SASEXPANDERDESCRIPTOR': "firmware.SasExpanderDescriptor",
'FIRMWARE.SERVERCONFIGURATIONUTILITYDISTRIBUTABLE': "firmware.ServerConfigurationUtilityDistributable",
'FIRMWARE.STORAGECONTROLLERDESCRIPTOR': "firmware.StorageControllerDescriptor",
'FIRMWARE.SWITCHUPGRADE': "firmware.SwitchUpgrade",
'FIRMWARE.UNSUPPORTEDVERSIONUPGRADE': "firmware.UnsupportedVersionUpgrade",
'FIRMWARE.UPGRADE': "firmware.Upgrade",
'FIRMWARE.UPGRADEIMPACT': "firmware.UpgradeImpact",
'FIRMWARE.UPGRADEIMPACTSTATUS': "firmware.UpgradeImpactStatus",
'FIRMWARE.UPGRADESTATUS': "firmware.UpgradeStatus",
'FORECAST.CATALOG': "forecast.Catalog",
'FORECAST.DEFINITION': "forecast.Definition",
'FORECAST.INSTANCE': "forecast.Instance",
'GRAPHICS.CARD': "graphics.Card",
'GRAPHICS.CONTROLLER': "graphics.Controller",
'HCL.COMPATIBILITYSTATUS': "hcl.CompatibilityStatus",
'HCL.DRIVERIMAGE': "hcl.DriverImage",
'HCL.EXEMPTEDCATALOG': "hcl.ExemptedCatalog",
'HCL.HYPERFLEXSOFTWARECOMPATIBILITYINFO': "hcl.HyperflexSoftwareCompatibilityInfo",
'HCL.OPERATINGSYSTEM': "hcl.OperatingSystem",
'HCL.OPERATINGSYSTEMVENDOR': "hcl.OperatingSystemVendor",
'HCL.SUPPORTEDDRIVERNAME': "hcl.SupportedDriverName",
'HYPERFLEX.ALARM': "hyperflex.Alarm",
'HYPERFLEX.APPCATALOG': "hyperflex.AppCatalog",
'HYPERFLEX.AUTOSUPPORTPOLICY': "hyperflex.AutoSupportPolicy",
'HYPERFLEX.BACKUPCLUSTER': "hyperflex.BackupCluster",
'HYPERFLEX.CAPABILITYINFO': "hyperflex.CapabilityInfo",
'HYPERFLEX.CLUSTER': "hyperflex.Cluster",
'HYPERFLEX.CLUSTERBACKUPPOLICY': "hyperflex.ClusterBackupPolicy",
'HYPERFLEX.CLUSTERBACKUPPOLICYDEPLOYMENT': "hyperflex.ClusterBackupPolicyDeployment",
'HYPERFLEX.CLUSTERBACKUPPOLICYINVENTORY': "hyperflex.ClusterBackupPolicyInventory",
'HYPERFLEX.CLUSTERHEALTHCHECKEXECUTIONSNAPSHOT': "hyperflex.ClusterHealthCheckExecutionSnapshot",
'HYPERFLEX.CLUSTERNETWORKPOLICY': "hyperflex.ClusterNetworkPolicy",
'HYPERFLEX.CLUSTERPROFILE': "hyperflex.ClusterProfile",
'HYPERFLEX.CLUSTERREPLICATIONNETWORKPOLICY': "hyperflex.ClusterReplicationNetworkPolicy",
'HYPERFLEX.CLUSTERREPLICATIONNETWORKPOLICYDEPLOYMENT': "hyperflex.ClusterReplicationNetworkPolicyDeployment",
'HYPERFLEX.CLUSTERSTORAGEPOLICY': "hyperflex.ClusterStoragePolicy",
'HYPERFLEX.CONFIGRESULT': "hyperflex.ConfigResult",
'HYPERFLEX.CONFIGRESULTENTRY': "hyperflex.ConfigResultEntry",
'HYPERFLEX.DATAPROTECTIONPEER': "hyperflex.DataProtectionPeer",
'HYPERFLEX.DATASTORESTATISTIC': "hyperflex.DatastoreStatistic",
'HYPERFLEX.DEVICEPACKAGEDOWNLOADSTATE': "hyperflex.DevicePackageDownloadState",
'HYPERFLEX.DRIVE': "hyperflex.Drive",
'HYPERFLEX.EXTFCSTORAGEPOLICY': "hyperflex.ExtFcStoragePolicy",
'HYPERFLEX.EXTISCSISTORAGEPOLICY': "hyperflex.ExtIscsiStoragePolicy",
'HYPERFLEX.FEATURELIMITEXTERNAL': "hyperflex.FeatureLimitExternal",
'HYPERFLEX.FEATURELIMITINTERNAL': "hyperflex.FeatureLimitInternal",
'HYPERFLEX.HEALTH': "hyperflex.Health",
'HYPERFLEX.HEALTHCHECKDEFINITION': "hyperflex.HealthCheckDefinition",
'HYPERFLEX.HEALTHCHECKEXECUTION': "hyperflex.HealthCheckExecution",
'HYPERFLEX.HEALTHCHECKEXECUTIONSNAPSHOT': "hyperflex.HealthCheckExecutionSnapshot",
'HYPERFLEX.HEALTHCHECKPACKAGECHECKSUM': "hyperflex.HealthCheckPackageChecksum",
'HYPERFLEX.HXDPVERSION': "hyperflex.HxdpVersion",
'HYPERFLEX.LICENSE': "hyperflex.License",
'HYPERFLEX.LOCALCREDENTIALPOLICY': "hyperflex.LocalCredentialPolicy",
'HYPERFLEX.NODE': "hyperflex.Node",
'HYPERFLEX.NODECONFIGPOLICY': "hyperflex.NodeConfigPolicy",
'HYPERFLEX.NODEPROFILE': "hyperflex.NodeProfile",
'HYPERFLEX.PROTECTEDCLUSTER': "hyperflex.ProtectedCluster",
'HYPERFLEX.PROXYSETTINGPOLICY': "hyperflex.ProxySettingPolicy",
'HYPERFLEX.SERVERFIRMWAREVERSION': "hyperflex.ServerFirmwareVersion",
'HYPERFLEX.SERVERFIRMWAREVERSIONENTRY': "hyperflex.ServerFirmwareVersionEntry",
'HYPERFLEX.SERVERMODEL': "hyperflex.ServerModel",
'HYPERFLEX.SERVICEAUTHTOKEN': "hyperflex.ServiceAuthToken",
'HYPERFLEX.SOFTWAREDISTRIBUTIONCOMPONENT': "hyperflex.SoftwareDistributionComponent",
'HYPERFLEX.SOFTWAREDISTRIBUTIONENTRY': "hyperflex.SoftwareDistributionEntry",
'HYPERFLEX.SOFTWAREDISTRIBUTIONVERSION': "hyperflex.SoftwareDistributionVersion",
'HYPERFLEX.SOFTWAREVERSIONPOLICY': "hyperflex.SoftwareVersionPolicy",
'HYPERFLEX.STORAGECONTAINER': "hyperflex.StorageContainer",
'HYPERFLEX.SYSCONFIGPOLICY': "hyperflex.SysConfigPolicy",
'HYPERFLEX.UCSMCONFIGPOLICY': "hyperflex.UcsmConfigPolicy",
'HYPERFLEX.VCENTERCONFIGPOLICY': "hyperflex.VcenterConfigPolicy",
'HYPERFLEX.VMBACKUPINFO': "hyperflex.VmBackupInfo",
'HYPERFLEX.VMIMPORTOPERATION': "hyperflex.VmImportOperation",
'HYPERFLEX.VMRESTOREOPERATION': "hyperflex.VmRestoreOperation",
'HYPERFLEX.VMSNAPSHOTINFO': "hyperflex.VmSnapshotInfo",
'HYPERFLEX.VOLUME': "hyperflex.Volume",
'HYPERFLEX.WITNESSCONFIGURATION': "hyperflex.WitnessConfiguration",
'IAAS.CONNECTORPACK': "iaas.ConnectorPack",
'IAAS.DEVICESTATUS': "iaas.DeviceStatus",
'IAAS.DIAGNOSTICMESSAGES': "iaas.DiagnosticMessages",
'IAAS.LICENSEINFO': "iaas.LicenseInfo",
'IAAS.MOSTRUNTASKS': "iaas.MostRunTasks",
'IAAS.SERVICEREQUEST': "iaas.ServiceRequest",
'IAAS.UCSDINFO': "iaas.UcsdInfo",
'IAAS.UCSDMANAGEDINFRA': "iaas.UcsdManagedInfra",
'IAAS.UCSDMESSAGES': "iaas.UcsdMessages",
'IAM.ACCOUNT': "iam.Account",
'IAM.ACCOUNTEXPERIENCE': "iam.AccountExperience",
'IAM.APIKEY': "iam.ApiKey",
'IAM.APPREGISTRATION': "iam.AppRegistration",
'IAM.BANNERMESSAGE': "iam.BannerMessage",
'IAM.CERTIFICATE': "iam.Certificate",
'IAM.CERTIFICATEREQUEST': "iam.CertificateRequest",
'IAM.DOMAINGROUP': "iam.DomainGroup",
'IAM.ENDPOINTPRIVILEGE': "iam.EndPointPrivilege",
'IAM.ENDPOINTROLE': "iam.EndPointRole",
'IAM.ENDPOINTUSER': "iam.EndPointUser",
'IAM.ENDPOINTUSERPOLICY': "iam.EndPointUserPolicy",
'IAM.ENDPOINTUSERROLE': "iam.EndPointUserRole",
'IAM.IDP': "iam.Idp",
'IAM.IDPREFERENCE': "iam.IdpReference",
'IAM.IPACCESSMANAGEMENT': "iam.IpAccessManagement",
'IAM.IPADDRESS': "iam.IpAddress",
'IAM.LDAPGROUP': "iam.LdapGroup",
'IAM.LDAPPOLICY': "iam.LdapPolicy",
'IAM.LDAPPROVIDER': "iam.LdapProvider",
'IAM.LOCALUSERPASSWORD': "iam.LocalUserPassword",
'IAM.LOCALUSERPASSWORDPOLICY': "iam.LocalUserPasswordPolicy",
'IAM.OAUTHTOKEN': "iam.OAuthToken",
'IAM.PERMISSION': "iam.Permission",
'IAM.PRIVATEKEYSPEC': "iam.PrivateKeySpec",
'IAM.PRIVILEGE': "iam.Privilege",
'IAM.PRIVILEGESET': "iam.PrivilegeSet",
'IAM.QUALIFIER': "iam.Qualifier",
'IAM.RESOURCELIMITS': "iam.ResourceLimits",
'IAM.RESOURCEPERMISSION': "iam.ResourcePermission",
'IAM.RESOURCEROLES': "iam.ResourceRoles",
'IAM.ROLE': "iam.Role",
'IAM.SECURITYHOLDER': "iam.SecurityHolder",
'IAM.SERVICEPROVIDER': "iam.ServiceProvider",
'IAM.SESSION': "iam.Session",
'IAM.SESSIONLIMITS': "iam.SessionLimits",
'IAM.SYSTEM': "iam.System",
'IAM.TRUSTPOINT': "iam.TrustPoint",
'IAM.USER': "iam.User",
'IAM.USERGROUP': "iam.UserGroup",
'IAM.USERPREFERENCE': "iam.UserPreference",
'INVENTORY.DEVICEINFO': "inventory.DeviceInfo",
'INVENTORY.DNMOBINDING': "inventory.DnMoBinding",
'INVENTORY.GENERICINVENTORY': "inventory.GenericInventory",
'INVENTORY.GENERICINVENTORYHOLDER': "inventory.GenericInventoryHolder",
'INVENTORY.REQUEST': "inventory.Request",
'IPMIOVERLAN.POLICY': "ipmioverlan.Policy",
'IPPOOL.BLOCKLEASE': "ippool.BlockLease",
'IPPOOL.IPLEASE': "ippool.IpLease",
'IPPOOL.POOL': "ippool.Pool",
'IPPOOL.POOLMEMBER': "ippool.PoolMember",
'IPPOOL.SHADOWBLOCK': "ippool.ShadowBlock",
'IPPOOL.SHADOWPOOL': "ippool.ShadowPool",
'IPPOOL.UNIVERSE': "ippool.Universe",
'IQNPOOL.BLOCK': "iqnpool.Block",
'IQNPOOL.LEASE': "iqnpool.Lease",
'IQNPOOL.POOL': "iqnpool.Pool",
'IQNPOOL.POOLMEMBER': "iqnpool.PoolMember",
'IQNPOOL.UNIVERSE': "iqnpool.Universe",
'IWOTENANT.TENANTSTATUS': "iwotenant.TenantStatus",
'KUBERNETES.ACICNIAPIC': "kubernetes.AciCniApic",
'KUBERNETES.ACICNIPROFILE': "kubernetes.AciCniProfile",
'KUBERNETES.ACICNITENANTCLUSTERALLOCATION': "kubernetes.AciCniTenantClusterAllocation",
'KUBERNETES.ADDONDEFINITION': "kubernetes.AddonDefinition",
'KUBERNETES.ADDONPOLICY': "kubernetes.AddonPolicy",
'KUBERNETES.ADDONREPOSITORY': "kubernetes.AddonRepository",
'KUBERNETES.BAREMETALNODEPROFILE': "kubernetes.BaremetalNodeProfile",
'KUBERNETES.CATALOG': "kubernetes.Catalog",
'KUBERNETES.CLUSTER': "kubernetes.Cluster",
'KUBERNETES.CLUSTERADDONPROFILE': "kubernetes.ClusterAddonProfile",
'KUBERNETES.CLUSTERPROFILE': "kubernetes.ClusterProfile",
'KUBERNETES.CONFIGRESULT': "kubernetes.ConfigResult",
'KUBERNETES.CONFIGRESULTENTRY': "kubernetes.ConfigResultEntry",
'KUBERNETES.CONTAINERRUNTIMEPOLICY': "kubernetes.ContainerRuntimePolicy",
'KUBERNETES.DAEMONSET': "kubernetes.DaemonSet",
'KUBERNETES.DEPLOYMENT': "kubernetes.Deployment",
'KUBERNETES.INGRESS': "kubernetes.Ingress",
'KUBERNETES.NETWORKPOLICY': "kubernetes.NetworkPolicy",
'KUBERNETES.NODE': "kubernetes.Node",
'KUBERNETES.NODEGROUPPROFILE': "kubernetes.NodeGroupProfile",
'KUBERNETES.POD': "kubernetes.Pod",
'KUBERNETES.SERVICE': "kubernetes.Service",
'KUBERNETES.STATEFULSET': "kubernetes.StatefulSet",
'KUBERNETES.SYSCONFIGPOLICY': "kubernetes.SysConfigPolicy",
'KUBERNETES.TRUSTEDREGISTRIESPOLICY': "kubernetes.TrustedRegistriesPolicy",
'KUBERNETES.VERSION': "kubernetes.Version",
'KUBERNETES.VERSIONPOLICY': "kubernetes.VersionPolicy",
'KUBERNETES.VIRTUALMACHINEINFRACONFIGPOLICY': "kubernetes.VirtualMachineInfraConfigPolicy",
'KUBERNETES.VIRTUALMACHINEINFRASTRUCTUREPROVIDER': "kubernetes.VirtualMachineInfrastructureProvider",
'KUBERNETES.VIRTUALMACHINEINSTANCETYPE': "kubernetes.VirtualMachineInstanceType",
'KUBERNETES.VIRTUALMACHINENODEPROFILE': "kubernetes.VirtualMachineNodeProfile",
'KVM.POLICY': "kvm.Policy",
'KVM.SESSION': "kvm.Session",
'KVM.TUNNEL': "kvm.Tunnel",
'LICENSE.ACCOUNTLICENSEDATA': "license.AccountLicenseData",
'LICENSE.CUSTOMEROP': "license.CustomerOp",
'LICENSE.IKSCUSTOMEROP': "license.IksCustomerOp",
'LICENSE.IKSLICENSECOUNT': "license.IksLicenseCount",
'LICENSE.IWOCUSTOMEROP': "license.IwoCustomerOp",
'LICENSE.IWOLICENSECOUNT': "license.IwoLicenseCount",
'LICENSE.LICENSEINFO': "license.LicenseInfo",
'LICENSE.LICENSERESERVATIONOP': "license.LicenseReservationOp",
'LICENSE.SMARTLICENSETOKEN': "license.SmartlicenseToken",
'LS.SERVICEPROFILE': "ls.ServiceProfile",
'MACPOOL.IDBLOCK': "macpool.IdBlock",
'MACPOOL.LEASE': "macpool.Lease",
'MACPOOL.POOL': "macpool.Pool",
'MACPOOL.POOLMEMBER': "macpool.PoolMember",
'MACPOOL.UNIVERSE': "macpool.Universe",
'MANAGEMENT.CONTROLLER': "management.Controller",
'MANAGEMENT.ENTITY': "management.Entity",
'MANAGEMENT.INTERFACE': "management.Interface",
'MEMORY.ARRAY': "memory.Array",
'MEMORY.PERSISTENTMEMORYCONFIGRESULT': "memory.PersistentMemoryConfigResult",
'MEMORY.PERSISTENTMEMORYCONFIGURATION': "memory.PersistentMemoryConfiguration",
'MEMORY.PERSISTENTMEMORYNAMESPACE': "memory.PersistentMemoryNamespace",
'MEMORY.PERSISTENTMEMORYNAMESPACECONFIGRESULT': "memory.PersistentMemoryNamespaceConfigResult",
'MEMORY.PERSISTENTMEMORYPOLICY': "memory.PersistentMemoryPolicy",
'MEMORY.PERSISTENTMEMORYREGION': "memory.PersistentMemoryRegion",
'MEMORY.PERSISTENTMEMORYUNIT': "memory.PersistentMemoryUnit",
'MEMORY.UNIT': "memory.Unit",
'META.DEFINITION': "meta.Definition",
'NETWORK.ELEMENT': "network.Element",
'NETWORK.ELEMENTSUMMARY': "network.ElementSummary",
'NETWORK.FCZONEINFO': "network.FcZoneInfo",
'NETWORK.VLANPORTINFO': "network.VlanPortInfo",
'NETWORKCONFIG.POLICY': "networkconfig.Policy",
'NIAAPI.APICCCOPOST': "niaapi.ApicCcoPost",
'NIAAPI.APICFIELDNOTICE': "niaapi.ApicFieldNotice",
'NIAAPI.APICHWEOL': "niaapi.ApicHweol",
'NIAAPI.APICLATESTMAINTAINEDRELEASE': "niaapi.ApicLatestMaintainedRelease",
'NIAAPI.APICRELEASERECOMMEND': "niaapi.ApicReleaseRecommend",
'NIAAPI.APICSWEOL': "niaapi.ApicSweol",
'NIAAPI.DCNMCCOPOST': "niaapi.DcnmCcoPost",
'NIAAPI.DCNMFIELDNOTICE': "niaapi.DcnmFieldNotice",
'NIAAPI.DCNMHWEOL': "niaapi.DcnmHweol",
'NIAAPI.DCNMLATESTMAINTAINEDRELEASE': "niaapi.DcnmLatestMaintainedRelease",
'NIAAPI.DCNMRELEASERECOMMEND': "niaapi.DcnmReleaseRecommend",
'NIAAPI.DCNMSWEOL': "niaapi.DcnmSweol",
'NIAAPI.FILEDOWNLOADER': "niaapi.FileDownloader",
'NIAAPI.NIAMETADATA': "niaapi.NiaMetadata",
'NIAAPI.NIBFILEDOWNLOADER': "niaapi.NibFileDownloader",
'NIAAPI.NIBMETADATA': "niaapi.NibMetadata",
'NIAAPI.VERSIONREGEX': "niaapi.VersionRegex",
'NIATELEMETRY.AAALDAPPROVIDERDETAILS': "niatelemetry.AaaLdapProviderDetails",
'NIATELEMETRY.AAARADIUSPROVIDERDETAILS': "niatelemetry.AaaRadiusProviderDetails",
'NIATELEMETRY.AAATACACSPROVIDERDETAILS': "niatelemetry.AaaTacacsProviderDetails",
'NIATELEMETRY.APICAPPPLUGINDETAILS': "niatelemetry.ApicAppPluginDetails",
'NIATELEMETRY.APICCOREFILEDETAILS': "niatelemetry.ApicCoreFileDetails",
'NIATELEMETRY.APICDBGEXPRSEXPORTDEST': "niatelemetry.ApicDbgexpRsExportDest",
'NIATELEMETRY.APICDBGEXPRSTSSCHEDULER': "niatelemetry.ApicDbgexpRsTsScheduler",
'NIATELEMETRY.APICFANDETAILS': "niatelemetry.ApicFanDetails",
'NIATELEMETRY.APICFEXDETAILS': "niatelemetry.ApicFexDetails",
'NIATELEMETRY.APICFLASHDETAILS': "niatelemetry.ApicFlashDetails",
'NIATELEMETRY.APICNTPAUTH': "niatelemetry.ApicNtpAuth",
'NIATELEMETRY.APICPSUDETAILS': "niatelemetry.ApicPsuDetails",
'NIATELEMETRY.APICREALMDETAILS': "niatelemetry.ApicRealmDetails",
'NIATELEMETRY.APICSNMPCLIENTGRPDETAILS': "niatelemetry.ApicSnmpClientGrpDetails",
'NIATELEMETRY.APICSNMPCOMMUNITYACCESSDETAILS': "niatelemetry.ApicSnmpCommunityAccessDetails",
'NIATELEMETRY.APICSNMPCOMMUNITYDETAILS': "niatelemetry.ApicSnmpCommunityDetails",
'NIATELEMETRY.APICSNMPTRAPDETAILS': "niatelemetry.ApicSnmpTrapDetails",
'NIATELEMETRY.APICSNMPTRAPFWDSERVERDETAILS': "niatelemetry.ApicSnmpTrapFwdServerDetails",
'NIATELEMETRY.APICSNMPVERSIONTHREEDETAILS': "niatelemetry.ApicSnmpVersionThreeDetails",
'NIATELEMETRY.APICSYSLOGGRP': "niatelemetry.ApicSysLogGrp",
'NIATELEMETRY.APICSYSLOGSRC': "niatelemetry.ApicSysLogSrc",
'NIATELEMETRY.APICTRANSCEIVERDETAILS': "niatelemetry.ApicTransceiverDetails",
'NIATELEMETRY.APICUIPAGECOUNTS': "niatelemetry.ApicUiPageCounts",
'NIATELEMETRY.APPDETAILS': "niatelemetry.AppDetails",
'NIATELEMETRY.COMMONPOLICIES': "niatelemetry.CommonPolicies",
'NIATELEMETRY.DCNMFANDETAILS': "niatelemetry.DcnmFanDetails",
'NIATELEMETRY.DCNMFEXDETAILS': "niatelemetry.DcnmFexDetails",
'NIATELEMETRY.DCNMMODULEDETAILS': "niatelemetry.DcnmModuleDetails",
'NIATELEMETRY.DCNMPSUDETAILS': "niatelemetry.DcnmPsuDetails",
'NIATELEMETRY.DCNMTRANSCEIVERDETAILS': "niatelemetry.DcnmTransceiverDetails",
'NIATELEMETRY.EPG': "niatelemetry.Epg",
'NIATELEMETRY.FABRICMODULEDETAILS': "niatelemetry.FabricModuleDetails",
'NIATELEMETRY.FABRICPODPROFILE': "niatelemetry.FabricPodProfile",
'NIATELEMETRY.FABRICPODSS': "niatelemetry.FabricPodSs",
'NIATELEMETRY.FAULT': "niatelemetry.Fault",
'NIATELEMETRY.HTTPSACLCONTRACTDETAILS': "niatelemetry.HttpsAclContractDetails",
'NIATELEMETRY.HTTPSACLCONTRACTFILTERMAP': "niatelemetry.HttpsAclContractFilterMap",
'NIATELEMETRY.HTTPSACLEPGCONTRACTMAP': "niatelemetry.HttpsAclEpgContractMap",
'NIATELEMETRY.HTTPSACLEPGDETAILS': "niatelemetry.HttpsAclEpgDetails",
'NIATELEMETRY.HTTPSACLFILTERDETAILS': "niatelemetry.HttpsAclFilterDetails",
'NIATELEMETRY.LC': "niatelemetry.Lc",
'NIATELEMETRY.MSOCONTRACTDETAILS': "niatelemetry.MsoContractDetails",
'NIATELEMETRY.MSOEPGDETAILS': "niatelemetry.MsoEpgDetails",
'NIATELEMETRY.MSOSCHEMADETAILS': "niatelemetry.MsoSchemaDetails",
'NIATELEMETRY.MSOSITEDETAILS': "niatelemetry.MsoSiteDetails",
'NIATELEMETRY.MSOTENANTDETAILS': "niatelemetry.MsoTenantDetails",
'NIATELEMETRY.NEXUSDASHBOARDCONTROLLERDETAILS': "niatelemetry.NexusDashboardControllerDetails",
'NIATELEMETRY.NEXUSDASHBOARDDETAILS': "niatelemetry.NexusDashboardDetails",
'NIATELEMETRY.NEXUSDASHBOARDMEMORYDETAILS': "niatelemetry.NexusDashboardMemoryDetails",
'NIATELEMETRY.NEXUSDASHBOARDS': "niatelemetry.NexusDashboards",
'NIATELEMETRY.NIAFEATUREUSAGE': "niatelemetry.NiaFeatureUsage",
'NIATELEMETRY.NIAINVENTORY': "niatelemetry.NiaInventory",
'NIATELEMETRY.NIAINVENTORYDCNM': "niatelemetry.NiaInventoryDcnm",
'NIATELEMETRY.NIAINVENTORYFABRIC': "niatelemetry.NiaInventoryFabric",
'NIATELEMETRY.NIALICENSESTATE': "niatelemetry.NiaLicenseState",
'NIATELEMETRY.PASSWORDSTRENGTHCHECK': "niatelemetry.PasswordStrengthCheck",
'NIATELEMETRY.PODCOMMPOLICIES': "niatelemetry.PodCommPolicies",
'NIATELEMETRY.PODSNMPPOLICIES': "niatelemetry.PodSnmpPolicies",
'NIATELEMETRY.PODTIMESERVERPOLICIES': "niatelemetry.PodTimeServerPolicies",
'NIATELEMETRY.SITEINVENTORY': "niatelemetry.SiteInventory",
'NIATELEMETRY.SNMPSRC': "niatelemetry.SnmpSrc",
'NIATELEMETRY.SSHVERSIONTWO': "niatelemetry.SshVersionTwo",
'NIATELEMETRY.SUPERVISORMODULEDETAILS': "niatelemetry.SupervisorModuleDetails",
'NIATELEMETRY.SYSLOGREMOTEDEST': "niatelemetry.SyslogRemoteDest",
'NIATELEMETRY.SYSLOGSYSMSG': "niatelemetry.SyslogSysMsg",
'NIATELEMETRY.SYSLOGSYSMSGFACFILTER': "niatelemetry.SyslogSysMsgFacFilter",
'NIATELEMETRY.SYSTEMCONTROLLERDETAILS': "niatelemetry.SystemControllerDetails",
'NIATELEMETRY.TENANT': "niatelemetry.Tenant",
'NOTIFICATION.ACCOUNTSUBSCRIPTION': "notification.AccountSubscription",
'NTP.POLICY': "ntp.Policy",
'OAUTH.ACCESSTOKEN': "oauth.AccessToken",
'OAUTH.AUTHORIZATION': "oauth.Authorization",
'OPRS.DEPLOYMENT': "oprs.Deployment",
'OPRS.SYNCTARGETLISTMESSAGE': "oprs.SyncTargetListMessage",
'ORGANIZATION.ORGANIZATION': "organization.Organization",
'OS.BULKINSTALLINFO': "os.BulkInstallInfo",
'OS.CATALOG': "os.Catalog",
'OS.CONFIGURATIONFILE': "os.ConfigurationFile",
'OS.DISTRIBUTION': "os.Distribution",
'OS.INSTALL': "os.Install",
'OS.OSSUPPORT': "os.OsSupport",
'OS.SUPPORTEDVERSION': "os.SupportedVersion",
'OS.TEMPLATEFILE': "os.TemplateFile",
'OS.VALIDINSTALLTARGET': "os.ValidInstallTarget",
'PCI.COPROCESSORCARD': "pci.CoprocessorCard",
'PCI.DEVICE': "pci.Device",
'PCI.LINK': "pci.Link",
'PCI.SWITCH': "pci.Switch",
'PORT.GROUP': "port.Group",
'PORT.MACBINDING': "port.MacBinding",
'PORT.SUBGROUP': "port.SubGroup",
'POWER.CONTROLSTATE': "power.ControlState",
'POWER.POLICY': "power.Policy",
'PROCESSOR.UNIT': "processor.Unit",
'RACK.UNITPERSONALITY': "rack.UnitPersonality",
'RECOMMENDATION.CAPACITYRUNWAY': "recommendation.CapacityRunway",
'RECOMMENDATION.PHYSICALITEM': "recommendation.PhysicalItem",
'RECOVERY.BACKUPCONFIGPOLICY': "recovery.BackupConfigPolicy",
'RECOVERY.BACKUPPROFILE': "recovery.BackupProfile",
'RECOVERY.CONFIGRESULT': "recovery.ConfigResult",
'RECOVERY.CONFIGRESULTENTRY': "recovery.ConfigResultEntry",
'RECOVERY.ONDEMANDBACKUP': "recovery.OnDemandBackup",
'RECOVERY.RESTORE': "recovery.Restore",
'RECOVERY.SCHEDULECONFIGPOLICY': "recovery.ScheduleConfigPolicy",
'RESOURCE.GROUP': "resource.Group",
'RESOURCE.GROUPMEMBER': "resource.GroupMember",
'RESOURCE.LICENSERESOURCECOUNT': "resource.LicenseResourceCount",
'RESOURCE.MEMBERSHIP': "resource.Membership",
'RESOURCE.MEMBERSHIPHOLDER': "resource.MembershipHolder",
'RESOURCE.RESERVATION': "resource.Reservation",
'RESOURCEPOOL.LEASE': "resourcepool.Lease",
'RESOURCEPOOL.LEASERESOURCE': "resourcepool.LeaseResource",
'RESOURCEPOOL.POOL': "resourcepool.Pool",
'RESOURCEPOOL.POOLMEMBER': "resourcepool.PoolMember",
'RESOURCEPOOL.UNIVERSE': "resourcepool.Universe",
'RPROXY.REVERSEPROXY': "rproxy.ReverseProxy",
'SDCARD.POLICY': "sdcard.Policy",
'SDWAN.PROFILE': "sdwan.Profile",
'SDWAN.ROUTERNODE': "sdwan.RouterNode",
'SDWAN.ROUTERPOLICY': "sdwan.RouterPolicy",
'SDWAN.VMANAGEACCOUNTPOLICY': "sdwan.VmanageAccountPolicy",
'SEARCH.SEARCHITEM': "search.SearchItem",
'SEARCH.TAGITEM': "search.TagItem",
'SECURITY.UNIT': "security.Unit",
'SERVER.CONFIGCHANGEDETAIL': "server.ConfigChangeDetail",
'SERVER.CONFIGIMPORT': "server.ConfigImport",
'SERVER.CONFIGRESULT': "server.ConfigResult",
'SERVER.CONFIGRESULTENTRY': "server.ConfigResultEntry",
'SERVER.PROFILE': "server.Profile",
'SERVER.PROFILETEMPLATE': "server.ProfileTemplate",
'SMTP.POLICY': "smtp.Policy",
'SNMP.POLICY': "snmp.Policy",
'SOFTWARE.APPLIANCEDISTRIBUTABLE': "software.ApplianceDistributable",
'SOFTWARE.DOWNLOADHISTORY': "software.DownloadHistory",
'SOFTWARE.HCLMETA': "software.HclMeta",
'SOFTWARE.HYPERFLEXBUNDLEDISTRIBUTABLE': "software.HyperflexBundleDistributable",
'SOFTWARE.HYPERFLEXDISTRIBUTABLE': "software.HyperflexDistributable",
'SOFTWARE.RELEASEMETA': "software.ReleaseMeta",
'SOFTWARE.SOLUTIONDISTRIBUTABLE': "software.SolutionDistributable",
'SOFTWARE.UCSDBUNDLEDISTRIBUTABLE': "software.UcsdBundleDistributable",
'SOFTWARE.UCSDDISTRIBUTABLE': "software.UcsdDistributable",
'SOFTWAREREPOSITORY.AUTHORIZATION': "softwarerepository.Authorization",
'SOFTWAREREPOSITORY.CACHEDIMAGE': "softwarerepository.CachedImage",
'SOFTWAREREPOSITORY.CATALOG': "softwarerepository.Catalog",
'SOFTWAREREPOSITORY.CATEGORYMAPPER': "softwarerepository.CategoryMapper",
'SOFTWAREREPOSITORY.CATEGORYMAPPERMODEL': "softwarerepository.CategoryMapperModel",
'SOFTWAREREPOSITORY.CATEGORYSUPPORTCONSTRAINT': "softwarerepository.CategorySupportConstraint",
'SOFTWAREREPOSITORY.DOWNLOADSPEC': "softwarerepository.DownloadSpec",
'SOFTWAREREPOSITORY.OPERATINGSYSTEMFILE': "softwarerepository.OperatingSystemFile",
'SOFTWAREREPOSITORY.RELEASE': "softwarerepository.Release",
'SOL.POLICY': "sol.Policy",
'SSH.POLICY': "ssh.Policy",
'STORAGE.CONTROLLER': "storage.Controller",
'STORAGE.DISKGROUP': "storage.DiskGroup",
'STORAGE.DISKSLOT': "storage.DiskSlot",
'STORAGE.DRIVEGROUP': "storage.DriveGroup",
'STORAGE.ENCLOSURE': "storage.Enclosure",
'STORAGE.ENCLOSUREDISK': "storage.EnclosureDisk",
'STORAGE.ENCLOSUREDISKSLOTEP': "storage.EnclosureDiskSlotEp",
'STORAGE.FLEXFLASHCONTROLLER': "storage.FlexFlashController",
'STORAGE.FLEXFLASHCONTROLLERPROPS': "storage.FlexFlashControllerProps",
'STORAGE.FLEXFLASHPHYSICALDRIVE': "storage.FlexFlashPhysicalDrive",
'STORAGE.FLEXFLASHVIRTUALDRIVE': "storage.FlexFlashVirtualDrive",
'STORAGE.FLEXUTILCONTROLLER': "storage.FlexUtilController",
'STORAGE.FLEXUTILPHYSICALDRIVE': "storage.FlexUtilPhysicalDrive",
'STORAGE.FLEXUTILVIRTUALDRIVE': "storage.FlexUtilVirtualDrive",
'STORAGE.HITACHIARRAY': "storage.HitachiArray",
'STORAGE.HITACHICONTROLLER': "storage.HitachiController",
'STORAGE.HITACHIDISK': "storage.HitachiDisk",
'STORAGE.HITACHIHOST': "storage.HitachiHost",
'STORAGE.HITACHIHOSTLUN': "storage.HitachiHostLun",
'STORAGE.HITACHIPARITYGROUP': "storage.HitachiParityGroup",
'STORAGE.HITACHIPOOL': "storage.HitachiPool",
'STORAGE.HITACHIPORT': "storage.HitachiPort",
'STORAGE.HITACHIVOLUME': "storage.HitachiVolume",
'STORAGE.HYPERFLEXSTORAGECONTAINER': "storage.HyperFlexStorageContainer",
'STORAGE.HYPERFLEXVOLUME': "storage.HyperFlexVolume",
'STORAGE.ITEM': "storage.Item",
'STORAGE.NETAPPAGGREGATE': "storage.NetAppAggregate",
'STORAGE.NETAPPBASEDISK': "storage.NetAppBaseDisk",
'STORAGE.NETAPPCLUSTER': "storage.NetAppCluster",
'STORAGE.NETAPPETHERNETPORT': "storage.NetAppEthernetPort",
'STORAGE.NETAPPEXPORTPOLICY': "storage.NetAppExportPolicy",
'STORAGE.NETAPPFCINTERFACE': "storage.NetAppFcInterface",
'STORAGE.NETAPPFCPORT': "storage.NetAppFcPort",
'STORAGE.NETAPPINITIATORGROUP': "storage.NetAppInitiatorGroup",
'STORAGE.NETAPPIPINTERFACE': "storage.NetAppIpInterface",
'STORAGE.NETAPPLICENSE': "storage.NetAppLicense",
'STORAGE.NETAPPLUN': "storage.NetAppLun",
'STORAGE.NETAPPLUNMAP': "storage.NetAppLunMap",
'STORAGE.NETAPPNODE': "storage.NetAppNode",
'STORAGE.NETAPPNTPSERVER': "storage.NetAppNtpServer",
'STORAGE.NETAPPSENSOR': "storage.NetAppSensor",
'STORAGE.NETAPPSTORAGEVM': "storage.NetAppStorageVm",
'STORAGE.NETAPPVOLUME': "storage.NetAppVolume",
'STORAGE.NETAPPVOLUMESNAPSHOT': "storage.NetAppVolumeSnapshot",
'STORAGE.PHYSICALDISK': "storage.PhysicalDisk",
'STORAGE.PHYSICALDISKEXTENSION': "storage.PhysicalDiskExtension",
'STORAGE.PHYSICALDISKUSAGE': "storage.PhysicalDiskUsage",
'STORAGE.PUREARRAY': "storage.PureArray",
'STORAGE.PURECONTROLLER': "storage.PureController",
'STORAGE.PUREDISK': "storage.PureDisk",
'STORAGE.PUREHOST': "storage.PureHost",
'STORAGE.PUREHOSTGROUP': "storage.PureHostGroup",
'STORAGE.PUREHOSTLUN': "storage.PureHostLun",
'STORAGE.PUREPORT': "storage.PurePort",
'STORAGE.PUREPROTECTIONGROUP': "storage.PureProtectionGroup",
'STORAGE.PUREPROTECTIONGROUPSNAPSHOT': "storage.PureProtectionGroupSnapshot",
'STORAGE.PUREREPLICATIONSCHEDULE': "storage.PureReplicationSchedule",
'STORAGE.PURESNAPSHOTSCHEDULE': "storage.PureSnapshotSchedule",
'STORAGE.PUREVOLUME': "storage.PureVolume",
'STORAGE.PUREVOLUMESNAPSHOT': "storage.PureVolumeSnapshot",
'STORAGE.SASEXPANDER': "storage.SasExpander",
'STORAGE.SASPORT': "storage.SasPort",
'STORAGE.SPAN': "storage.Span",
'STORAGE.STORAGEPOLICY': "storage.StoragePolicy",
'STORAGE.VDMEMBEREP': "storage.VdMemberEp",
'STORAGE.VIRTUALDRIVE': "storage.VirtualDrive",
'STORAGE.VIRTUALDRIVECONTAINER': "storage.VirtualDriveContainer",
'STORAGE.VIRTUALDRIVEEXTENSION': "storage.VirtualDriveExtension",
'STORAGE.VIRTUALDRIVEIDENTITY': "storage.VirtualDriveIdentity",
'SYSLOG.POLICY': "syslog.Policy",
'TAM.ADVISORYCOUNT': "tam.AdvisoryCount",
'TAM.ADVISORYDEFINITION': "tam.AdvisoryDefinition",
'TAM.ADVISORYINFO': "tam.AdvisoryInfo",
'TAM.ADVISORYINSTANCE': "tam.AdvisoryInstance",
'TAM.SECURITYADVISORY': "tam.SecurityAdvisory",
'TASK.HITACHISCOPEDINVENTORY': "task.HitachiScopedInventory",
'TASK.HYPERFLEXSCOPEDINVENTORY': "task.HyperflexScopedInventory",
'TASK.IWESCOPEDINVENTORY': "task.IweScopedInventory",
'TASK.NETAPPSCOPEDINVENTORY': "task.NetAppScopedInventory",
'TASK.PUBLICCLOUDSCOPEDINVENTORY': "task.PublicCloudScopedInventory",
'TASK.PURESCOPEDINVENTORY': "task.PureScopedInventory",
'TASK.SERVERSCOPEDINVENTORY': "task.ServerScopedInventory",
'TECHSUPPORTMANAGEMENT.COLLECTIONCONTROLPOLICY': "techsupportmanagement.CollectionControlPolicy",
'TECHSUPPORTMANAGEMENT.DOWNLOAD': "techsupportmanagement.Download",
'TECHSUPPORTMANAGEMENT.TECHSUPPORTBUNDLE': "techsupportmanagement.TechSupportBundle",
'TECHSUPPORTMANAGEMENT.TECHSUPPORTSTATUS': "techsupportmanagement.TechSupportStatus",
'TERMINAL.AUDITLOG': "terminal.AuditLog",
'TERRAFORM.EXECUTOR': "terraform.Executor",
'THERMAL.POLICY': "thermal.Policy",
'TOP.SYSTEM': "top.System",
'UCSD.BACKUPINFO': "ucsd.BackupInfo",
'UUIDPOOL.BLOCK': "uuidpool.Block",
'UUIDPOOL.POOL': "uuidpool.Pool",
'UUIDPOOL.POOLMEMBER': "uuidpool.PoolMember",
'UUIDPOOL.UNIVERSE': "uuidpool.Universe",
'UUIDPOOL.UUIDLEASE': "uuidpool.UuidLease",
'VIRTUALIZATION.CISCOHYPERVISORMANAGER': "virtualization.CiscoHypervisorManager",
'VIRTUALIZATION.ESXICONSOLE': "virtualization.EsxiConsole",
'VIRTUALIZATION.HOST': "virtualization.Host",
'VIRTUALIZATION.IWECLUSTER': "virtualization.IweCluster",
'VIRTUALIZATION.IWEDATACENTER': "virtualization.IweDatacenter",
'VIRTUALIZATION.IWEDVUPLINK': "virtualization.IweDvUplink",
'VIRTUALIZATION.IWEDVSWITCH': "virtualization.IweDvswitch",
'VIRTUALIZATION.IWEHOST': "virtualization.IweHost",
'VIRTUALIZATION.IWEHOSTINTERFACE': "virtualization.IweHostInterface",
'VIRTUALIZATION.IWEHOSTVSWITCH': "virtualization.IweHostVswitch",
'VIRTUALIZATION.IWENETWORK': "virtualization.IweNetwork",
'VIRTUALIZATION.IWEVIRTUALDISK': "virtualization.IweVirtualDisk",
'VIRTUALIZATION.IWEVIRTUALMACHINE': "virtualization.IweVirtualMachine",
'VIRTUALIZATION.IWEVIRTUALMACHINENETWORKINTERFACE': "virtualization.IweVirtualMachineNetworkInterface",
'VIRTUALIZATION.VIRTUALDISK': "virtualization.VirtualDisk",
'VIRTUALIZATION.VIRTUALMACHINE': "virtualization.VirtualMachine",
'VIRTUALIZATION.VIRTUALNETWORK': "virtualization.VirtualNetwork",
'VIRTUALIZATION.VMWARECLUSTER': "virtualization.VmwareCluster",
'VIRTUALIZATION.VMWAREDATACENTER': "virtualization.VmwareDatacenter",
'VIRTUALIZATION.VMWAREDATASTORE': "virtualization.VmwareDatastore",
'VIRTUALIZATION.VMWAREDATASTORECLUSTER': "virtualization.VmwareDatastoreCluster",
'VIRTUALIZATION.VMWAREDISTRIBUTEDNETWORK': "virtualization.VmwareDistributedNetwork",
'VIRTUALIZATION.VMWAREDISTRIBUTEDSWITCH': "virtualization.VmwareDistributedSwitch",
'VIRTUALIZATION.VMWAREFOLDER': "virtualization.VmwareFolder",
'VIRTUALIZATION.VMWAREHOST': "virtualization.VmwareHost",
'VIRTUALIZATION.VMWAREKERNELNETWORK': "virtualization.VmwareKernelNetwork",
'VIRTUALIZATION.VMWARENETWORK': "virtualization.VmwareNetwork",
'VIRTUALIZATION.VMWAREPHYSICALNETWORKINTERFACE': "virtualization.VmwarePhysicalNetworkInterface",
'VIRTUALIZATION.VMWAREUPLINKPORT': "virtualization.VmwareUplinkPort",
'VIRTUALIZATION.VMWAREVCENTER': "virtualization.VmwareVcenter",
'VIRTUALIZATION.VMWAREVIRTUALDISK': "virtualization.VmwareVirtualDisk",
'VIRTUALIZATION.VMWAREVIRTUALMACHINE': "virtualization.VmwareVirtualMachine",
'VIRTUALIZATION.VMWAREVIRTUALMACHINESNAPSHOT': "virtualization.VmwareVirtualMachineSnapshot",
'VIRTUALIZATION.VMWAREVIRTUALNETWORKINTERFACE': "virtualization.VmwareVirtualNetworkInterface",
'VIRTUALIZATION.VMWAREVIRTUALSWITCH': "virtualization.VmwareVirtualSwitch",
'VMEDIA.POLICY': "vmedia.Policy",
'VMRC.CONSOLE': "vmrc.Console",
'VNC.CONSOLE': "vnc.Console",
'VNIC.ETHADAPTERPOLICY': "vnic.EthAdapterPolicy",
'VNIC.ETHIF': "vnic.EthIf",
'VNIC.ETHNETWORKPOLICY': "vnic.EthNetworkPolicy",
'VNIC.ETHQOSPOLICY': "vnic.EthQosPolicy",
'VNIC.FCADAPTERPOLICY': "vnic.FcAdapterPolicy",
'VNIC.FCIF': "vnic.FcIf",
'VNIC.FCNETWORKPOLICY': "vnic.FcNetworkPolicy",
'VNIC.FCQOSPOLICY': "vnic.FcQosPolicy",
'VNIC.ISCSIADAPTERPOLICY': "vnic.IscsiAdapterPolicy",
'VNIC.ISCSIBOOTPOLICY': "vnic.IscsiBootPolicy",
'VNIC.ISCSISTATICTARGETPOLICY': "vnic.IscsiStaticTargetPolicy",
'VNIC.LANCONNECTIVITYPOLICY': "vnic.LanConnectivityPolicy",
'VNIC.LCPSTATUS': "vnic.LcpStatus",
'VNIC.SANCONNECTIVITYPOLICY': "vnic.SanConnectivityPolicy",
'VNIC.SCPSTATUS': "vnic.ScpStatus",
'VRF.VRF': "vrf.Vrf",
'WORKFLOW.ANSIBLEBATCHEXECUTOR': "workflow.AnsibleBatchExecutor",
'WORKFLOW.BATCHAPIEXECUTOR': "workflow.BatchApiExecutor",
'WORKFLOW.BUILDTASKMETA': "workflow.BuildTaskMeta",
'WORKFLOW.BUILDTASKMETAOWNER': "workflow.BuildTaskMetaOwner",
'WORKFLOW.CATALOG': "workflow.Catalog",
'WORKFLOW.CUSTOMDATATYPEDEFINITION': "workflow.CustomDataTypeDefinition",
'WORKFLOW.ERRORRESPONSEHANDLER': "workflow.ErrorResponseHandler",
'WORKFLOW.PENDINGDYNAMICWORKFLOWINFO': "workflow.PendingDynamicWorkflowInfo",
'WORKFLOW.ROLLBACKWORKFLOW': "workflow.RollbackWorkflow",
'WORKFLOW.SOLUTIONACTIONDEFINITION': "workflow.SolutionActionDefinition",
'WORKFLOW.SOLUTIONACTIONINSTANCE': "workflow.SolutionActionInstance",
'WORKFLOW.SOLUTIONDEFINITION': "workflow.SolutionDefinition",
'WORKFLOW.SOLUTIONINSTANCE': "workflow.SolutionInstance",
'WORKFLOW.SOLUTIONOUTPUT': "workflow.SolutionOutput",
'WORKFLOW.SSHBATCHEXECUTOR': "workflow.SshBatchExecutor",
'WORKFLOW.TASKDEBUGLOG': "workflow.TaskDebugLog",
'WORKFLOW.TASKDEFINITION': "workflow.TaskDefinition",
'WORKFLOW.TASKINFO': "workflow.TaskInfo",
'WORKFLOW.TASKMETADATA': "workflow.TaskMetadata",
'WORKFLOW.TASKNOTIFICATION': "workflow.TaskNotification",
'WORKFLOW.TEMPLATEEVALUATION': "workflow.TemplateEvaluation",
'WORKFLOW.TEMPLATEFUNCTIONMETA': "workflow.TemplateFunctionMeta",
'WORKFLOW.WORKFLOWDEFINITION': "workflow.WorkflowDefinition",
'WORKFLOW.WORKFLOWINFO': "workflow.WorkflowInfo",
'WORKFLOW.WORKFLOWMETA': "workflow.WorkflowMeta",
'WORKFLOW.WORKFLOWMETADATA': "workflow.WorkflowMetadata",
'WORKFLOW.WORKFLOWNOTIFICATION': "workflow.WorkflowNotification",
},
}
validations = {
}
@cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False
@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
lazy_import()
return {
'class_id': (str,), # noqa: E501
'moid': (str,), # noqa: E501
'selector': (str,), # noqa: E501
'link': (str,), # noqa: E501
'account_moid': (str,), # noqa: E501
'create_time': (datetime,), # noqa: E501
'domain_group_moid': (str,), # noqa: E501
'mod_time': (datetime,), # noqa: E501
'owners': ([str], none_type,), # noqa: E501
'shared_scope': (str,), # noqa: E501
'tags': ([MoTag], none_type,), # noqa: E501
'version_context': (MoVersionContext,), # noqa: E501
'ancestors': ([MoBaseMoRelationship], none_type,), # noqa: E501
'parent': (MoBaseMoRelationship,), # noqa: E501
'permission_resources': ([MoBaseMoRelationship], none_type,), # noqa: E501
'display_names': (DisplayNames,), # noqa: E501
'device_mo_id': (str,), # noqa: E501
'dn': (str,), # noqa: E501
'rn': (str,), # noqa: E501
'enabled': (bool,), # noqa: E501
'encryption': (bool,), # noqa: E501
'low_power_usb': (bool,), # noqa: E501
'compute_physical_unit': (ComputePhysicalRelationship,), # noqa: E501
'inventory_device_info': (InventoryDeviceInfoRelationship,), # noqa: E501
'mappings': ([ComputeMappingRelationship], none_type,), # noqa: E501
'registered_device': (AssetDeviceRegistrationRelationship,), # noqa: E501
'object_type': (str,), # noqa: E501
}
@cached_property
def discriminator():
lazy_import()
val = {
'compute.Vmedia': ComputeVmedia,
'mo.MoRef': MoMoRef,
}
if not val:
return None
return {'class_id': val}
attribute_map = {
'class_id': 'ClassId', # noqa: E501
'moid': 'Moid', # noqa: E501
'selector': 'Selector', # noqa: E501
'link': 'link', # noqa: E501
'account_moid': 'AccountMoid', # noqa: E501
'create_time': 'CreateTime', # noqa: E501
'domain_group_moid': 'DomainGroupMoid', # noqa: E501
'mod_time': 'ModTime', # noqa: E501
'owners': 'Owners', # noqa: E501
'shared_scope': 'SharedScope', # noqa: E501
'tags': 'Tags', # noqa: E501
'version_context': 'VersionContext', # noqa: E501
'ancestors': 'Ancestors', # noqa: E501
'parent': 'Parent', # noqa: E501
'permission_resources': 'PermissionResources', # noqa: E501
'display_names': 'DisplayNames', # noqa: E501
'device_mo_id': 'DeviceMoId', # noqa: E501
'dn': 'Dn', # noqa: E501
'rn': 'Rn', # noqa: E501
'enabled': 'Enabled', # noqa: E501
'encryption': 'Encryption', # noqa: E501
'low_power_usb': 'LowPowerUsb', # noqa: E501
'compute_physical_unit': 'ComputePhysicalUnit', # noqa: E501
'inventory_device_info': 'InventoryDeviceInfo', # noqa: E501
'mappings': 'Mappings', # noqa: E501
'registered_device': 'RegisteredDevice', # noqa: E501
'object_type': 'ObjectType', # noqa: E501
}
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
'_composed_instances',
'_var_name_to_model_instances',
'_additional_properties_model_instances',
])
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""ComputeVmediaRelationship - a model defined in OpenAPI
Args:
Keyword Args:
class_id (str): The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.. defaults to "mo.MoRef", must be one of ["mo.MoRef", ] # noqa: E501
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
moid (str): The Moid of the referenced REST resource.. [optional] # noqa: E501
selector (str): An OData $filter expression which describes the REST resource to be referenced. This field may be set instead of 'moid' by clients. 1. If 'moid' is set this field is ignored. 1. If 'selector' is set and 'moid' is empty/absent from the request, Intersight determines the Moid of the resource matching the filter expression and populates it in the MoRef that is part of the object instance being inserted/updated to fulfill the REST request. An error is returned if the filter matches zero or more than one REST resource. An example filter string is: Serial eq '3AA8B7T11'.. [optional] # noqa: E501
link (str): A URL to an instance of the 'mo.MoRef' class.. [optional] # noqa: E501
account_moid (str): The Account ID for this managed object.. [optional] # noqa: E501
create_time (datetime): The time when this managed object was created.. [optional] # noqa: E501
domain_group_moid (str): The DomainGroup ID for this managed object.. [optional] # noqa: E501
mod_time (datetime): The time when this managed object was last modified.. [optional] # noqa: E501
owners ([str], none_type): [optional] # noqa: E501
shared_scope (str): Intersight provides pre-built workflows, tasks and policies to end users through global catalogs. Objects that are made available through global catalogs are said to have a 'shared' ownership. Shared objects are either made globally available to all end users or restricted to end users based on their license entitlement. Users can use this property to differentiate the scope (global or a specific license tier) to which a shared MO belongs.. [optional] # noqa: E501
tags ([MoTag], none_type): [optional] # noqa: E501
version_context (MoVersionContext): [optional] # noqa: E501
ancestors ([MoBaseMoRelationship], none_type): An array of relationships to moBaseMo resources.. [optional] # noqa: E501
parent (MoBaseMoRelationship): [optional] # noqa: E501
permission_resources ([MoBaseMoRelationship], none_type): An array of relationships to moBaseMo resources.. [optional] # noqa: E501
display_names (DisplayNames): [optional] # noqa: E501
device_mo_id (str): The database identifier of the registered device of an object.. [optional] # noqa: E501
dn (str): The Distinguished Name unambiguously identifies an object in the system.. [optional] # noqa: E501
rn (str): The Relative Name uniquely identifies an object within a given context.. [optional] # noqa: E501
enabled (bool): State of the Virtual Media service on the server.. [optional] if omitted the server will use the default value of True # noqa: E501
encryption (bool): If enabled, allows encryption of all Virtual Media communications.. [optional] # noqa: E501
low_power_usb (bool): If enabled, the virtual drives appear on the boot selection menu after mapping the image and rebooting the host.. [optional] if omitted the server will use the default value of True # noqa: E501
compute_physical_unit (ComputePhysicalRelationship): [optional] # noqa: E501
inventory_device_info (InventoryDeviceInfoRelationship): [optional] # noqa: E501
mappings ([ComputeMappingRelationship], none_type): An array of relationships to computeMapping resources.. [optional] # noqa: E501
registered_device (AssetDeviceRegistrationRelationship): [optional] # noqa: E501
object_type (str): The fully-qualified name of the remote type referred by this relationship.. [optional] # noqa: E501
"""
class_id = kwargs.get('class_id', "mo.MoRef")
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
constant_args = {
'_check_type': _check_type,
'_path_to_item': _path_to_item,
'_spec_property_naming': _spec_property_naming,
'_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes,
}
required_args = {
'class_id': class_id,
}
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info(
constant_args, model_args, self)
self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3]
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
not self._additional_properties_model_instances:
# discard variable.
continue
setattr(self, var_name, var_value)
@cached_property
def _composed_schemas():
# we need this here to make our import statements work
# we must store _composed_schemas in here so the code is only run
# when we invoke this method. If we kept this at the class
# level we would get an error beause the class level
# code would be run when this module is imported, and these composed
# classes don't exist yet because their module has not finished
# loading
lazy_import()
return {
'anyOf': [
],
'allOf': [
],
'oneOf': [
ComputeVmedia,
MoMoRef,
none_type,
],
}
| 62.959543 | 1,678 | 0.660306 | [
"Apache-2.0"
] | CiscoDevNet/intersight-python | intersight/model/compute_vmedia_relationship.py | 71,585 | Python |
from setuptools import setup, find_packages
def readme():
with open('README.rst') as f:
return f.read()
setup(name = "triceratops",
version = '1.0.10',
description = "Statistical Validation of Transiting Planet Candidates",
long_description = readme(),
author = "Steven Giacalone",
author_email = "[email protected]",
url = "https://github.com/stevengiacalone/triceratops",
packages = find_packages(),
package_data = {'triceratops': ['data/*']},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Topic :: Scientific/Engineering :: Astronomy'
],
install_requires=['numpy>=1.18.1','pandas>=0.23.4', 'scipy>=1.1.0', 'matplotlib>=3.0.3',
'astropy>=4.0', 'astroquery>=0.4', 'pytransit>=2.2',
'mechanicalsoup>=0.12.0', 'emcee>=3.0.2', 'seaborn>=0.11.1',
'numba>=0.52.0', 'pyrr>=0.10.3', 'celerite>=0.4.0', 'lightkurve>=2.0.0'],
zip_safe=False
)
| 40.9 | 97 | 0.581907 | [
"MIT"
] | martindevora/triceratops | setup.py | 1,227 | Python |
np.deg2rad(x) | 13 | 13 | 0.769231 | [
"BSD-3-Clause"
] | kuanpern/jupyterlab-snippets-multimenus | example_snippets/multimenus_snippets/NewSnippets/NumPy/Vectorized (universal) functions/Trigonometric and hyperbolic functions/deg2rad Convert angles from degrees to radians.py | 13 | Python |
import time
import RPi.GPIO as GPIO
from adafruit_servokit import ServoKit
'''GPIO.setmode(GPIO.BCM)
GPIO.setup(11,GPIO.OUT)
servo1=GPIO.PWM(11,50)
servo1.start(2)'''
h = ServoKit(channels=16)
#servo1.ChangeDutyCycle(12)
#kit.servo[0].angle
init = [0,90,20,0,180,160,170,180,60,0,0,150]
limitLo = [0,0,20,0,0,40,0,0,60,0,0,30]
limitHi = [35,180,180,180,180,160,170,180,180,180,180,150]
cur = init
def changeDeg(pin,newDegree):
maxChange = 0
pinSize = len(pin)
for i in range(0,pinSize):
maxChange = max(abs(cur[pin[i]]-newDegree[i]),maxChange)
for deg in range(0,maxChange,5):
for i in range(0,pinSize):
if cur[pin[i]]<newDegree[i]:
cur[pin[i]] += 5
elif cur[pin[i]]>newDegree[i]:
cur[pin[i]] -= 5
for i in range(0,pinSize):
h.servo[pin[i]].angle = cur[pin[i]]
time.sleep(0.05)
#function closed
for i in range(0,12):
h.servo[i].angle=init[i]
time.sleep(0.05)
#up
changeDeg([3],[60])
changeDeg([7],[150])
time.sleep(0.5)
#shake
for i in range(0,5):
if i&1:
h.servo[7].angle=170
else:
h.servo[7].angle=120
time.sleep(0.2)
time.sleep(1)
#down
changeDeg([7],[180])
changeDeg([3],[0])
time.sleep(2)
for i in range(0,12):
print(cur[i]," ",init[i])
changeDeg([i],[init[i]])
| 20.630769 | 64 | 0.595078 | [
"MIT"
] | DevJewel143/Robot-Leena | Store/robot-test-old/hand_shake.py | 1,341 | Python |
""" Modified from offical repo and mmlab's repo of HRNet
MIT License
Copyright (c) 2019 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import torch
import torch.nn as nn
from torch.utils.model_zoo import load_url as load_state_dict_from_url
BatchNorm2d = nn.BatchNorm2d
BN_MOMENTUM = 0.1
__all__ = ['HighResolutionNet', 'HighResolutionModule',
'hrnetv2_w18', 'hrnetv2_w32', 'hrnetv2_w40']
model_urls = {
'hrnetv2_w18': 'https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/hrnetv2_w18-00eb2006.pth',
'hrnetv2_w32': 'https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/hrnetv2_w32-dc9eeb4f.pth',
'hrnetv2_w40': 'https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/hrnetv2_w40-ed0b031c.pth',
'hrnetv2_w48': 'https://download.openmmlab.com/pretrain/third_party/hrnetv2_w48-d2186c55.pth'
}
model_extra = dict(
hrnetv2_w18=dict(
stage1=dict(
num_modules=1,
num_branches=1,
block='BOTTLENECK',
num_blocks=(4,),
num_channels=(64,),
fuse_method='SUM'),
stage2=dict(
num_modules=1,
num_branches=2,
block='BASIC',
num_blocks=(4, 4),
num_channels=(18, 36),
fuse_method='SUM'),
stage3=dict(
num_modules=4,
num_branches=3,
block='BASIC',
num_blocks=(4, 4, 4),
num_channels=(18, 36, 72),
fuse_method='SUM'),
stage4=dict(
num_modules=3,
num_branches=4,
block='BASIC',
num_blocks=(4, 4, 4, 4),
num_channels=(18, 36, 72, 144),
fuse_method='SUM')),
hrnetv2_w32=dict(
stage1=dict(
num_modules=1,
num_branches=1,
block='BOTTLENECK',
num_blocks=(4,),
num_channels=(64,),
fuse_method='SUM'),
stage2=dict(
num_modules=1,
num_branches=2,
block='BASIC',
num_blocks=(4, 4),
num_channels=(32, 64),
fuse_method='SUM'),
stage3=dict(
num_modules=4,
num_branches=3,
block='BASIC',
num_blocks=(4, 4, 4),
num_channels=(32, 64, 128),
fuse_method='SUM'),
stage4=dict(
num_modules=3,
num_branches=4,
block='BASIC',
num_blocks=(4, 4, 4, 4),
num_channels=(32, 64, 128, 256),
fuse_method='SUM')),
hrnetv2_w40=dict(
stage1=dict(
num_modules=1,
num_branches=1,
block='BOTTLENECK',
num_blocks=(4,),
num_channels=(64,),
fuse_method='SUM'),
stage2=dict(
num_modules=1,
num_branches=2,
block='BASIC',
num_blocks=(4, 4),
num_channels=(40, 80),
fuse_method='SUM'),
stage3=dict(
num_modules=4,
num_branches=3,
block='BASIC',
num_blocks=(4, 4, 4),
num_channels=(40, 80, 160),
fuse_method='SUM'),
stage4=dict(
num_modules=3,
num_branches=4,
block='BASIC',
num_blocks=(4, 4, 4, 4),
num_channels=(40, 80, 160, 320),
fuse_method='SUM')),
hrnetv2_w48=dict(
stage1=dict(
num_modules=1,
num_branches=1,
block='BOTTLENECK',
num_blocks=(4,),
num_channels=(64,),
fuse_method='SUM'),
stage2=dict(
num_modules=1,
num_branches=2,
block='BASIC',
num_blocks=(4, 4),
num_channels=(48, 96),
fuse_method='SUM'),
stage3=dict(
num_modules=4,
num_branches=3,
block='BASIC',
num_blocks=(4, 4, 4),
num_channels=(48, 96, 192),
fuse_method='SUM'),
stage4=dict(
num_modules=3,
num_branches=4,
block='BASIC',
num_blocks=(4, 4, 4, 4),
num_channels=(48, 96, 192, 384),
fuse_method='SUM'))
)
def constant_init(module, val, bias=0):
nn.init.constant_(module.weight, val)
if hasattr(module, 'bias') and module.bias is not None:
nn.init.constant_(module.bias, bias)
def kaiming_init(module,
a=0,
mode='fan_out',
nonlinearity='relu',
bias=0,
distribution='normal'):
assert distribution in ['uniform', 'normal']
if distribution == 'uniform':
nn.init.kaiming_uniform_(
module.weight, a=a, mode=mode, nonlinearity=nonlinearity)
else:
nn.init.kaiming_normal_(
module.weight, a=a, mode=mode, nonlinearity=nonlinearity)
if hasattr(module, 'bias') and module.bias is not None:
nn.init.constant_(module.bias, bias)
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, inplanes, planes, stride=1, downsample=None):
super(BasicBlock, self).__init__()
self.conv1 = conv3x3(inplanes, planes, stride)
self.bn1 = BatchNorm2d(planes, momentum=BN_MOMENTUM)
self.relu = nn.ReLU(inplace=True)
self.conv2 = conv3x3(planes, planes)
self.bn2 = BatchNorm2d(planes, momentum=BN_MOMENTUM)
self.downsample = downsample
self.stride = stride
def forward(self, x):
residual = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
if self.downsample is not None:
residual = self.downsample(x)
out += residual
out = self.relu(out)
return out
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, inplanes, planes, stride=1, downsample=None):
super(Bottleneck, self).__init__()
self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False)
self.bn1 = BatchNorm2d(planes, momentum=BN_MOMENTUM)
self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride,
padding=1, bias=False)
self.bn2 = BatchNorm2d(planes, momentum=BN_MOMENTUM)
self.conv3 = nn.Conv2d(planes, planes * self.expansion, kernel_size=1,
bias=False)
self.bn3 = BatchNorm2d(planes * self.expansion,
momentum=BN_MOMENTUM)
self.relu = nn.ReLU(inplace=True)
self.downsample = downsample
self.stride = stride
def forward(self, x):
residual = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
out = self.relu(out)
out = self.conv3(out)
out = self.bn3(out)
if self.downsample is not None:
residual = self.downsample(x)
out += residual
out = self.relu(out)
return out
class HighResolutionModule(nn.Module):
def __init__(self, num_branches, blocks, num_blocks, num_inchannels,
num_channels, fuse_method, multi_scale_output=True):
super(HighResolutionModule, self).__init__()
self._check_branches(
num_branches, blocks, num_blocks, num_inchannels, num_channels)
self.num_inchannels = num_inchannels
self.fuse_method = fuse_method
self.num_branches = num_branches
self.multi_scale_output = multi_scale_output
self.branches = self._make_branches(
num_branches, blocks, num_blocks, num_channels)
self.fuse_layers = self._make_fuse_layers()
self.relu = nn.ReLU(False)
def _check_branches(self, num_branches, blocks, num_blocks,
num_inchannels, num_channels):
if num_branches != len(num_blocks):
error_msg = 'NUM_BRANCHES({}) <> NUM_BLOCKS({})'.format(
num_branches, len(num_blocks))
raise ValueError(error_msg)
if num_branches != len(num_channels):
error_msg = 'NUM_BRANCHES({}) <> NUM_CHANNELS({})'.format(
num_branches, len(num_channels))
raise ValueError(error_msg)
if num_branches != len(num_inchannels):
error_msg = 'NUM_BRANCHES({}) <> NUM_INCHANNELS({})'.format(
num_branches, len(num_inchannels))
raise ValueError(error_msg)
def _make_one_branch(self, branch_index, block, num_blocks, num_channels,
stride=1):
downsample = None
if stride != 1 or \
self.num_inchannels[branch_index] != num_channels[branch_index] * block.expansion:
downsample = nn.Sequential(
nn.Conv2d(self.num_inchannels[branch_index],
num_channels[branch_index] * block.expansion,
kernel_size=1, stride=stride, bias=False),
BatchNorm2d(num_channels[branch_index] * block.expansion,
momentum=BN_MOMENTUM),
)
layers = []
layers.append(block(self.num_inchannels[branch_index],
num_channels[branch_index], stride, downsample))
self.num_inchannels[branch_index] = \
num_channels[branch_index] * block.expansion
for i in range(1, num_blocks[branch_index]):
layers.append(block(self.num_inchannels[branch_index],
num_channels[branch_index]))
return nn.Sequential(*layers)
def _make_branches(self, num_branches, block, num_blocks, num_channels):
branches = []
for i in range(num_branches):
branches.append(
self._make_one_branch(i, block, num_blocks, num_channels))
return nn.ModuleList(branches)
def _make_fuse_layers(self):
if self.num_branches == 1:
return None
num_branches = self.num_branches
num_inchannels = self.num_inchannels
fuse_layers = []
for i in range(num_branches if self.multi_scale_output else 1):
fuse_layer = []
for j in range(num_branches):
if j > i:
fuse_layer.append(nn.Sequential(
nn.Conv2d(num_inchannels[j],
num_inchannels[i],
1,
1,
0,
bias=False),
BatchNorm2d(num_inchannels[i], momentum=BN_MOMENTUM),
nn.Upsample(scale_factor=2 ** (j - i), mode='nearest')))
elif j == i:
fuse_layer.append(None)
else:
conv3x3s = []
for k in range(i - j):
if k == i - j - 1:
num_outchannels_conv3x3 = num_inchannels[i]
conv3x3s.append(nn.Sequential(
nn.Conv2d(num_inchannels[j],
num_outchannels_conv3x3,
3, 2, 1, bias=False),
BatchNorm2d(num_outchannels_conv3x3, momentum=BN_MOMENTUM)))
else:
num_outchannels_conv3x3 = num_inchannels[j]
conv3x3s.append(nn.Sequential(
nn.Conv2d(num_inchannels[j],
num_outchannels_conv3x3,
3, 2, 1, bias=False),
BatchNorm2d(num_outchannels_conv3x3,
momentum=BN_MOMENTUM),
nn.ReLU(False)))
fuse_layer.append(nn.Sequential(*conv3x3s))
fuse_layers.append(nn.ModuleList(fuse_layer))
return nn.ModuleList(fuse_layers)
def get_num_inchannels(self):
return self.num_inchannels
def forward(self, x):
if self.num_branches == 1:
return [self.branches[0](x[0])]
for i in range(self.num_branches):
x[i] = self.branches[i](x[i])
x_fuse = []
for i in range(len(self.fuse_layers)):
if i == 0:
y = x[0]
else:
y = self.fuse_layers[i][0](x[0])
for j in range(1, self.num_branches):
if i == j:
y = y + x[j]
else:
y = y + self.fuse_layers[i][j](x[j])
x_fuse.append(self.relu(y))
return x_fuse
blocks_dict = {
'BASIC': BasicBlock,
'BOTTLENECK': Bottleneck
}
class HighResolutionNet(nn.Module):
def __init__(self,
extra,
norm_eval=True,
zero_init_residual=False,
frozen_stages=-1):
super(HighResolutionNet, self).__init__()
self.norm_eval = norm_eval
self.frozen_stages = frozen_stages
self.zero_init_residual = zero_init_residual
# for
self.extra = extra
# stem network
# stem net
self.conv1 = nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1,
bias=False)
self.bn1 = BatchNorm2d(64, momentum=BN_MOMENTUM)
self.conv2 = nn.Conv2d(64, 64, kernel_size=3, stride=2, padding=1,
bias=False)
self.bn2 = BatchNorm2d(64, momentum=BN_MOMENTUM)
self.relu = nn.ReLU(inplace=True)
# stage 1
self.stage1_cfg = self.extra['stage1']
num_channels = self.stage1_cfg['num_channels'][0]
block_type = self.stage1_cfg['block']
num_blocks = self.stage1_cfg['num_blocks'][0]
block = blocks_dict[block_type]
stage1_out_channels = num_channels * block.expansion
self.layer1 = self._make_layer(block, 64, num_channels, num_blocks)
# stage 2
self.stage2_cfg = self.extra['stage2']
num_channels = self.stage2_cfg['num_channels']
block_type = self.stage2_cfg['block']
block = blocks_dict[block_type]
num_channels = [num_channels[i] * block.expansion for i in range(len(num_channels))]
self.transition1 = self._make_transition_layer([stage1_out_channels], num_channels)
# num_modules, num_branches, num_blocks, num_channels, block, fuse_method, num_inchannels
self.stage2, pre_stage_channels = self._make_stage(self.stage2_cfg, num_channels)
# stage 3
self.stage3_cfg = self.extra['stage3']
num_channels = self.stage3_cfg['num_channels']
block_type = self.stage3_cfg['block']
block = blocks_dict[block_type]
num_channels = [num_channels[i] * block.expansion for i in range(len(num_channels))]
self.transition2 = self._make_transition_layer(pre_stage_channels, num_channels)
self.stage3, pre_stage_channels = self._make_stage(self.stage3_cfg, num_channels)
# stage 4
self.stage4_cfg = self.extra['stage4']
num_channels = self.stage4_cfg['num_channels']
block_type = self.stage4_cfg['block']
block = blocks_dict[block_type]
num_channels = [num_channels[i] * block.expansion for i in range(len(num_channels))]
self.transition3 = self._make_transition_layer(pre_stage_channels, num_channels)
self.stage4, pre_stage_channels = self._make_stage(self.stage4_cfg, num_channels)
self._frozen_stages()
def _make_transition_layer(
self, num_channels_pre_layer, num_channels_cur_layer):
num_branches_cur = len(num_channels_cur_layer)
num_branches_pre = len(num_channels_pre_layer)
transition_layers = []
for i in range(num_branches_cur):
if i < num_branches_pre:
if num_channels_cur_layer[i] != num_channels_pre_layer[i]:
transition_layers.append(nn.Sequential(
nn.Conv2d(num_channels_pre_layer[i],
num_channels_cur_layer[i],
3,
1,
1,
bias=False),
BatchNorm2d(
num_channels_cur_layer[i], momentum=BN_MOMENTUM),
nn.ReLU(inplace=True)))
else:
transition_layers.append(None)
else:
conv3x3s = []
for j in range(i + 1 - num_branches_pre):
inchannels = num_channels_pre_layer[-1]
outchannels = num_channels_cur_layer[i] \
if j == i - num_branches_pre else inchannels
conv3x3s.append(nn.Sequential(
nn.Conv2d(
inchannels, outchannels, 3, 2, 1, bias=False),
BatchNorm2d(outchannels, momentum=BN_MOMENTUM),
nn.ReLU(inplace=True)))
transition_layers.append(nn.Sequential(*conv3x3s))
return nn.ModuleList(transition_layers)
def _make_layer(self, block, inplanes, planes, blocks, stride=1):
downsample = None
if stride != 1 or inplanes != planes * block.expansion:
downsample = nn.Sequential(
nn.Conv2d(inplanes, planes * block.expansion,
kernel_size=1, stride=stride, bias=False),
BatchNorm2d(planes * block.expansion, momentum=BN_MOMENTUM),
)
layers = []
layers.append(block(inplanes, planes, stride, downsample))
inplanes = planes * block.expansion
for i in range(1, blocks):
layers.append(block(inplanes, planes))
return nn.Sequential(*layers)
def _frozen_stages(self):
# frozen stage 1 or stem networks
if self.frozen_stages >= 0:
for m in [self.conv1, self.bn1, self.conv2, self.bn2]:
for param in m.parameters():
param.requires_grad = False
if self.frozen_stages == 1:
for param in self.layer1.parameters():
param.requires_grad = False
def _make_stage(self, layer_config, num_inchannels,
multi_scale_output=True):
num_modules = layer_config['num_modules']
num_branches = layer_config['num_branches']
num_blocks = layer_config['num_blocks']
num_channels = layer_config['num_channels']
block = blocks_dict[layer_config['block']]
fuse_method = layer_config['fuse_method']
modules = []
for i in range(num_modules):
# multi_scale_output is only used last module
if not multi_scale_output and i == num_modules - 1:
reset_multi_scale_output = False
else:
reset_multi_scale_output = True
modules.append(
HighResolutionModule(num_branches,
block,
num_blocks,
num_inchannels,
num_channels,
fuse_method,
reset_multi_scale_output)
)
num_inchannels = modules[-1].get_num_inchannels()
return nn.Sequential(*modules), num_inchannels
def forward(self, x):
# h, w = x.size(2), x.size(3)
x = self.conv1(x)
x = self.bn1(x)
x = self.relu(x)
x = self.conv2(x)
x = self.bn2(x)
x = self.relu(x)
x = self.layer1(x)
x_list = []
for i in range(self.stage2_cfg['num_branches']):
if self.transition1[i] is not None:
x_list.append(self.transition1[i](x))
else:
x_list.append(x)
y_list = self.stage2(x_list)
x_list = []
for i in range(self.stage3_cfg['num_branches']):
if self.transition2[i] is not None:
x_list.append(self.transition2[i](y_list[-1]))
else:
x_list.append(y_list[i])
y_list = self.stage3(x_list)
x_list = []
for i in range(self.stage4_cfg['num_branches']):
if self.transition3[i] is not None:
x_list.append(self.transition3[i](y_list[-1]))
else:
x_list.append(y_list[i])
y_list = self.stage4(x_list)
return y_list
def train(self, mode=True):
super(HighResolutionNet, self).train(mode)
if mode and self.norm_eval:
for m in self.modules():
# trick: eval have effect on BatchNorm only
if isinstance(m, nn.BatchNorm2d):
m.eval()
def hrnetv2_w18(pretrained=False, weight_path=None, norm_eval=False, frozen_stages=-1):
model = HighResolutionNet(model_extra['hrnetv2_w18'], norm_eval, zero_init_residual=False,
frozen_stages=frozen_stages)
if pretrained:
if weight_path is not None:
state_dict = torch.load(weight_path, map_location=torch.device("cpu"))
else:
state_dict = load_state_dict_from_url(model_urls['hrnetv2_w18'],
progress=True)
model.load_state_dict(state_dict, strict=False)
return model
def hrnetv2_w32(pretrained=False, weight_path=None, norm_eval=False, frozen_stages=-1):
model = HighResolutionNet(model_extra['hrnetv2_w32'], norm_eval, zero_init_residual=False,
frozen_stages=frozen_stages)
if pretrained:
if weight_path is not None:
state_dict = torch.load(weight_path, map_location=torch.device("cpu"))
else:
state_dict = load_state_dict_from_url(model_urls['hrnetv2_w32'],
progress=True)
model.load_state_dict(state_dict, strict=False)
return model
def hrnetv2_w40(pretrained=False, weight_path=None, norm_eval=False, frozen_stages=-1):
model = HighResolutionNet(model_extra['hrnetv2_w40'], norm_eval, zero_init_residual=False,
frozen_stages=frozen_stages)
if pretrained:
if weight_path is not None:
state_dict = torch.load(weight_path, map_location=torch.device("cpu"))
else:
state_dict = load_state_dict_from_url(model_urls['hrnetv2_w40'],
progress=True)
model.load_state_dict(state_dict, strict=False)
return model
def hrnetv2_w48(pretrained=False, weight_path=None, norm_eval=False, frozen_stages=-1):
model = HighResolutionNet(model_extra['hrnetv2_w48'], norm_eval, zero_init_residual=False,
frozen_stages=frozen_stages)
if pretrained:
if weight_path is not None:
state_dict = torch.load(weight_path, map_location=torch.device("cpu"))
else:
state_dict = load_state_dict_from_url(model_urls['hrnetv2_w48'],
progress=True)
model.load_state_dict(state_dict, strict=False)
return model
| 37.651515 | 118 | 0.562656 | [
"Apache-2.0"
] | Bobholamovic/ever | ever/module/_hrnet.py | 24,850 | Python |
from __future__ import print_function
import glob
import os
import datetime
import argparse
import json
import csv
import re
import pdb
import copy
import subprocess
import fnmatch
import textwrap
import sys
import tempfile
DEFAULT_BUILD_TAGS = "darwin,linux,windows"
# Get the beats repo root directory, making sure it's downloaded first.
subprocess.run(["go", "mod", "download", "github.com/elastic/beats/..."], check=True)
BEATS_DIR = subprocess.check_output(
["go", "list", "-m", "-f", "{{.Dir}}", "github.com/elastic/beats/..."]).decode("utf-8").strip()
# notice_overrides holds additional overrides entries for go-licence-detector.
notice_overrides = [
{"name": "github.com/elastic/beats/v7", "licenceType": "Elastic"}
]
# Additional third-party, non-source code dependencies, to add to the CSV output.
additional_third_party_deps = [{
"name": "Red Hat Universal Base Image minimal",
"version": "8",
"url": "https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8",
"license": "Custom;https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf",
"sourceURL": "https://oss-dependencies.elastic.co/red-hat-universal-base-image-minimal/8/ubi-minimal-8-source.tar.gz",
}]
def read_go_deps(main_packages, build_tags):
"""
read_go_deps returns a list of module dependencies in JSON format.
Main modules are excluded; only dependencies are returned.
Unlike `go list -m all`, this function excludes modules that are only
required for running tests.
"""
go_list_args = ["go", "list", "-deps", "-json"]
if build_tags:
go_list_args.extend(["-tags", build_tags])
output = subprocess.check_output(go_list_args + main_packages).decode("utf-8")
modules = {}
decoder = json.JSONDecoder()
while True:
output = output.strip()
if not output:
break
pkg, end = decoder.raw_decode(output)
output = output[end:]
if 'Standard' in pkg:
continue
module = pkg['Module']
if "Main" not in module:
modules[module['Path']] = module
return sorted(modules.values(), key=lambda module: module['Path'])
def go_license_detector(notice_out, deps_out, modules):
modules_json = "\n".join(map(json.dumps, modules))
beats_deps_template_path = os.path.join(BEATS_DIR, "dev-tools", "notice", "dependencies.csv.tmpl")
beats_notice_template_path = os.path.join(BEATS_DIR, "dev-tools", "notice", "NOTICE.txt.tmpl")
beats_overrides_path = os.path.join(BEATS_DIR, "dev-tools", "notice", "overrides.json")
beats_rules_path = os.path.join(BEATS_DIR, "dev-tools", "notice", "rules.json")
beats_notice_template = open(beats_notice_template_path).read()
beats_overrides = open(beats_overrides_path).read()
with tempfile.TemporaryDirectory() as tmpdir:
# Create notice overrides.json by combining the overrides from beats with apm-server specific ones.
overrides_file = open(os.path.join(tmpdir, "overrides.json"), "w")
overrides_file.write(beats_overrides)
overrides_file.write("\n")
for entry in notice_overrides:
overrides_file.write("\n")
json.dump(entry, overrides_file)
overrides_file.close()
# Replace "Elastic Beats" with "Elastic APM Server" in the NOTICE.txt template.
notice_template_file = open(os.path.join(tmpdir, "NOTICE.txt.tmpl"), "w")
notice_template_file.write(beats_notice_template.replace("Elastic Beats", "Elastic APM Server"))
notice_template_file.close()
args = [
"go", "run", "go.elastic.co/go-licence-detector",
"-includeIndirect",
"-overrides", overrides_file.name,
"-rules", beats_rules_path,
"-noticeTemplate", notice_template_file.name,
"-depsTemplate", beats_deps_template_path,
"-noticeOut", notice_out,
"-depsOut", deps_out,
]
subprocess.run(args, check=True, input=modules_json.encode("utf-8"))
def write_notice_file(notice_filename, modules):
go_license_detector(notice_filename, "", modules)
def write_csv_file(csv_filename, modules):
with tempfile.TemporaryDirectory() as tmpdir:
tmp_deps_path = os.path.join(tmpdir, "dependencies.csv")
go_license_detector("", tmp_deps_path, modules)
rows = []
fieldnames = []
with open(tmp_deps_path) as csvfile:
reader = csv.DictReader(csvfile)
fieldnames = reader.fieldnames
rows = [row for row in reader]
with open(csv_filename, "w") as csvfile:
writer = csv.DictWriter(csvfile, fieldnames)
writer.writeheader()
for row in rows:
writer.writerow(row)
for dep in additional_third_party_deps:
writer.writerow(dep)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate the NOTICE file from package dependencies")
parser.add_argument("main_package", nargs="*", default=["."],
help="List of main Go packages for which dependencies should be processed")
parser.add_argument("--csv", dest="csvfile",
help="Output to a csv file")
parser.add_argument("--build-tags", default=DEFAULT_BUILD_TAGS,
help="Comma-separated list of build tags to pass to 'go list -deps'")
args = parser.parse_args()
modules = read_go_deps(args.main_package, args.build_tags)
if args.csvfile:
write_csv_file(args.csvfile, modules)
print(args.csvfile)
else:
notice_filename = os.path.abspath("NOTICE.txt")
write_notice_file(notice_filename, modules)
print(notice_filename)
| 39.472973 | 122 | 0.667237 | [
"ECL-2.0",
"Apache-2.0"
] | cyrille-leclerc/apm-server | script/generate_notice.py | 5,842 | Python |
"""
Facebook platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.facebook/
"""
import logging
from aiohttp.hdrs import CONTENT_TYPE
import requests
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService)
from homeassistant.const import CONTENT_TYPE_JSON
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
CONF_PAGE_ACCESS_TOKEN = 'page_access_token'
BASE_URL = 'https://graph.facebook.com/v2.6/me/messages'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_PAGE_ACCESS_TOKEN): cv.string,
})
def get_service(hass, config, discovery_info=None):
"""Get the Facebook notification service."""
return FacebookNotificationService(config[CONF_PAGE_ACCESS_TOKEN])
class FacebookNotificationService(BaseNotificationService):
"""Implementation of a notification service for the Facebook service."""
def __init__(self, access_token):
"""Initialize the service."""
self.page_access_token = access_token
def send_message(self, message="", **kwargs):
"""Send some message."""
payload = {'access_token': self.page_access_token}
targets = kwargs.get(ATTR_TARGET)
data = kwargs.get(ATTR_DATA)
body_message = {"text": message}
if data is not None:
body_message.update(data)
# Only one of text or attachment can be specified
if 'attachment' in body_message:
body_message.pop('text')
if not targets:
_LOGGER.error("At least 1 target is required")
return
for target in targets:
# If the target starts with a "+", we suppose it's a phone number,
# otherwise it's a user id.
if target.startswith('+'):
recipient = {"phone_number": target}
else:
recipient = {"id": target}
body = {
"recipient": recipient,
"message": body_message
}
import json
resp = requests.post(BASE_URL, data=json.dumps(body),
params=payload,
headers={CONTENT_TYPE: CONTENT_TYPE_JSON},
timeout=10)
if resp.status_code != 200:
obj = resp.json()
error_message = obj['error']['message']
error_code = obj['error']['code']
_LOGGER.error(
"Error %s : %s (Code %s)", resp.status_code, error_message,
error_code)
| 33.621951 | 79 | 0.6177 | [
"Apache-2.0"
] | Anthonymcqueen21/home-assistant | homeassistant/components/notify/facebook.py | 2,757 | Python |
#!/usr/bin/env pvpython
# -*- Python -*- (syntax highlighting)
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2021 University of California, Davis
#
# See LICENSE.md for license information.
#
# ----------------------------------------------------------------------
# Plot the undeformed domain as a gray wireframe and then the fault
# surfaces, colored by the magnitude of fault slip.
#
# This Python script runs using pvpython or within the ParaView Python
# shell.
# User-specified parameters.
#
# Default values for parameters. To use different values, overwrite
# them in the ParaView Python shell or on the command line. For
# example, set OUTPUT_DIR to the absolute path if not starting
# ParaView from the terminal shell where you ran PyLith:
#
# import os
# OUTPUT_DIR = os.path.join(os.environ["HOME"], "src", "pylith", "examples", "2d", "subduction", "output")
DEFAULTS = {
"OUTPUT_DIR": "output",
"SIM": "step02",
"FIELD": "normal_dir",
"FAULTS": ["fault-slab"],
}
# ----------------------------------------------------------------------
from paraview.simple import *
import os
def visualize(parameters):
# Disable automatic camera reset on "Show"
paraview.simple._DisableFirstRenderCameraReset()
# Read domain data
filename = os.path.join(parameters.output_dir, "%s-domain.xmf" % parameters.sim)
if not os.path.isfile(filename):
raise IOError("File '%s' does not exist." % filename)
dataDomain = XDMFReader(FileNames=[filename])
RenameSource("%s-domain" % parameters.sim, dataDomain)
scene = GetAnimationScene()
scene.UpdateAnimationUsingDataTimeSteps()
view = GetActiveViewOrCreate('RenderView')
# Gray wireframe for undeformed domain.
domainDisplay = Show(dataDomain, view)
domainDisplay.Representation = 'Wireframe'
domainDisplay.AmbientColor = [0.5, 0.5, 0.5]
# Read fault data
dataFaults = []
for fault in parameters.faults:
filename = os.path.join(parameters.output_dir, "%s-%s_info.xmf" % (parameters.sim, fault))
if not os.path.isfile(filename):
raise IOError("File '%s' does not exist." % filename)
data = XDMFReader(FileNames=[filename])
RenameSource("%s-%s" % (parameters.sim, fault), data)
dataFaults.append(data)
groupFaults = GroupDatasets(Input=dataFaults)
faultDisplay = Show(groupFaults, view)
faultDisplay.SetRepresentationType('Surface With Edges')
faultDisplayProperties = GetDisplayProperties(groupFaults, view=view)
faultDisplayProperties.DiffuseColor = [0.25, 0.25, 1.0]
# Add arrows to show displacement vectors.
glyph = Glyph(Input=groupFaults, GlyphType="Arrow")
glyph.Vectors = ["POINTS", parameters.field]
glyph.GlyphMode = "All Points"
glyphDisplay = Show(glyph, view)
glyphDisplay.Representation = "Surface"
view.ResetCamera()
view.Update()
Render()
class Parameters(object):
keys = ("OUTPUT_DIR", "SIM", "FIELD", "FAULTS")
def __init__(self):
globalVars = globals()
for key in Parameters.keys:
if key in globalVars.keys():
setattr(self, key.lower(), globalVars[key])
else:
setattr(self, key.lower(), DEFAULTS[key])
return
# ----------------------------------------------------------------------
if __name__ == "__main__":
# Running from outside the ParaView GUI via pvpython
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--output-dir", action="store", dest="output_dir", default=DEFAULTS["OUTPUT_DIR"])
parser.add_argument("--sim", action="store", dest="sim", default=DEFAULTS["SIM"])
parser.add_argument("--faults", action="store", dest="faults")
parser.add_argument("--field", action="store", dest="field", default=DEFAULTS["FIELD"])
args = parser.parse_args()
if args.faults:
args.faults = args.faults.split(",")
else:
args.faults = DEFAULTS["FAULTS"]
visualize(args)
Interact()
else:
# Running inside the ParaView GUI
visualize(Parameters())
# End of file
| 33.398496 | 106 | 0.630347 | [
"MIT"
] | Shengduo/pylith | examples/3d/subduction/viz/plot_faultdir.py | 4,442 | Python |
import os
import shutil
from unittest import TestCase
from osbot_utils.utils.Files import folder_exists, temp_folder, file_exists, folder_temp, folder_delete_all, temp_file, \
file_copy
from cdr_plugin_folder_to_folder.pre_processing.utils.file_service import File_Service
from cdr_plugin_folder_to_folder.utils.testing.Test_Data import Test_Data
class test_File_service(TestCase):
#test_folder="./test_data/test_files"
#new_folder=os.path.join(test_folder, "sample")
new_folder = None
@classmethod
def setUpClass(cls) -> None:
cls.new_folder = temp_folder()
@classmethod
def tearDownClass(cls) -> None:
shutil.rmtree(cls.new_folder)
pass
def setUp(self) -> None:
self.test_data = Test_Data()
self.file_service = File_Service()
self.test_folder = self.test_data.path_test_files
self.test_file = self.test_data.image()
self.dict_content = { "value": "testing" }
def test_copy_file(self):
assert file_exists(self.test_file)
assert folder_exists(self.new_folder)
self.dst = os.path.join(self.new_folder,"image2.jpg")
self.file_service.copy_file(self.test_file,self.dst )
assert os.path.exists(self.dst) is True
def test_create_folder(self):
self.file_service.create_folder(self.new_folder)
assert os.path.exists(self.new_folder) is True
def test_copy_folder(self):
temp_folder = folder_temp()
folder_delete_all(temp_folder)
self.file_service.copy_folder(self.test_folder,temp_folder)
directory = os.listdir(temp_folder)
assert len(directory) is not 0
def test_wrtie_json_file(self):
self.file_service.create_folder(self.new_folder)
self.file_service.wrtie_json_file(self.new_folder,"test.json",self.dict_content)
assert os.path.exists(os.path.join(self.new_folder,"test.json")) is True
def test_read_json_file(self):
json_file_path=self.test_data.json()
content=self.file_service.read_json_file(json_file_path)
assert content is not None
def test_move_file(self):
source_file = temp_file()
target_file = temp_file()
file_copy(self.test_file, source_file)
self.file_service.move_file(source_file, target_file)
assert os.path.exists(source_file ) is False
assert os.path.exists(target_file ) is True
def test_delete_folder(self):
self.file_service.delete_folder(self.new_folder)
assert os.path.exists(self.new_folder) is False
| 30.151163 | 121 | 0.706132 | [
"Apache-2.0"
] | lucia15/cdr-plugin-folder-to-folder | tests/unit/pre_processing/utils/test_File_service.py | 2,593 | Python |
# -*- coding: utf-8 -*-
"""\
Copyright (c) 2015-2018, MGH Computational Pathology
"""
from __future__ import print_function
from calicoml.core.metrics import ppv, npv, ROC
from calicoml.core.metrics import compute_averaged_metrics, accuracy_from_confusion_matrix, ConditionalMeansSelector
from calicoml.core.metrics import f_pearson
from calicoml.core.serialization.model import roc_auc_function
import numpy as np
import nose
from rpy2.robjects import FloatVector
from rpy2.robjects.packages import importr
from sklearn.metrics import confusion_matrix
from scipy.stats import pearsonr
def test_ppv():
"""Verifies correctness of the PPV calculation"""
nose.tools.eq_(ppv([1], [1]), 1.0)
nose.tools.eq_(ppv([1, 1], [1, 0]), 1.0)
nose.tools.eq_(ppv([1, 0, 0, 1], [1, 1, 1, 1]), 0.5)
nose.tools.eq_(ppv([1, 0, 0, 1], [0, 1, 1, 0]), 0.0)
nose.tools.eq_(ppv([1, 0, 0, 1], [1, 1, 0, 1]), 2.0 / 3)
nose.tools.eq_(ppv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0]), 1.0)
nose.tools.eq_(ppv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1, 0, 0, 1]), 0.8)
nose.tools.eq_(ppv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 0, 1, 0, 1]), 0.6)
nose.tools.eq_(ppv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1, 0, 1, 0, 1]), 0.4)
nose.tools.eq_(ppv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 0, 1, 0, 1, 0, 1, 0, 1]), 0.2)
nose.tools.eq_(ppv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]), 0.0)
# Bad values should fail
nose.tools.assert_raises(AssertionError, lambda: ppv([1, 0, 1], [1, 0]))
nose.tools.assert_raises(AssertionError, lambda: ppv([1, 0], [1, 0, 1]))
nose.tools.assert_raises(AssertionError, lambda: ppv([1, 0, 2], [1, 0, 1]))
nose.tools.assert_raises(AssertionError, lambda: ppv([1, 0, 1], [1, 0, 2]))
def test_npv():
"""Verifies correctness of the NPV calculation"""
nose.tools.eq_(npv([0], [0]), 1.0)
nose.tools.eq_(npv([0, 0], [0, 1]), 1.0)
nose.tools.eq_(npv([0, 1], [0, 0]), 0.5)
nose.tools.eq_(npv([1, 0, 0, 1], [0, 0, 0, 0]), 0.5)
nose.tools.eq_(npv([1, 0, 0, 1], [0, 1, 1, 0]), 0.0)
nose.tools.eq_(npv([0, 1, 1, 0], [0, 0, 1, 0]), 2.0 / 3)
nose.tools.eq_(npv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0]), 1.0)
nose.tools.eq_(npv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1, 0, 0, 1]), 0.8)
nose.tools.eq_(npv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 0, 1, 0, 1]), 0.6)
nose.tools.eq_(npv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1, 0, 1, 0, 1]), 0.4)
nose.tools.eq_(npv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 0, 1, 0, 1, 0, 1, 0, 1]), 0.2)
nose.tools.eq_(npv([1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]), 0.0)
# Bad values should fail
nose.tools.assert_raises(AssertionError, lambda: npv([1, 0, 1], [1, 0]))
nose.tools.assert_raises(AssertionError, lambda: npv([1, 0], [1, 0, 1]))
nose.tools.assert_raises(AssertionError, lambda: npv([1, 0, 2], [1, 0, 1]))
nose.tools.assert_raises(AssertionError, lambda: npv([1, 0, 1], [1, 0, 2]))
def test_roc():
"""Tests the ROC class"""
def checkme(y_true, y_pred, expected_auc):
"""Tests the ROC for a single set of predictions. Mostly sanity checks since all the computation is done
by scikit, which we assume is correct"""
roc = ROC.from_scores(y_true, y_pred)
nose.tools.assert_almost_equal(roc.auc, expected_auc)
nose.tools.ok_(all(0 <= fpr_val <= 1 for fpr_val in roc.fpr))
nose.tools.ok_(all(0 <= tpr_val <= 1 for tpr_val in roc.tpr))
nose.tools.assert_list_equal(list(roc.dataframe['tpr']), list(roc.tpr))
nose.tools.assert_list_equal(list(roc.dataframe['thresholds']), list(roc.thresholds))
for prop in ['fpr', 'tpr', 'thresholds']:
nose.tools.assert_list_equal(list(roc.dataframe[prop]), list(getattr(roc, prop)))
nose.tools.assert_greater_equal(len(roc.dataframe[prop]), 2) # needs to have at least the two extremes
yield checkme, [1, 1, 1, 1, 0, 0, 0, 0], [1, 1, 1, 1, 0, 0, 0, 0], 1.0
yield checkme, [1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1], 0.0
yield checkme, [1, 1, 1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 1, 0, 1, 0], 0.5
yield checkme, [1, 1, 1, 1, 0, 0, 0, 0], [1, 1, 1, 0, 1, 0, 0, 0], 0.75
def test_auc_ci():
"""Validates the AUC confidence interval by comparing with R's pROC"""
def checkme(y_true, y_pred):
"""Test utility"""
roc = ROC.from_scores(y_true, y_pred)
print(roc.auc_ci)
np.testing.assert_allclose(roc.auc_ci.estimate, roc.auc, atol=0.01)
proc = importr('pROC')
r_ci_obj = proc.ci(proc.roc(FloatVector(y_true), FloatVector(y_pred), ci=True), method='bootstrap')
r_ci_dict = dict(list(r_ci_obj.items()))
np.testing.assert_allclose(r_ci_dict['2.5%'], roc.auc_ci.low, atol=0.02)
np.testing.assert_allclose(r_ci_dict['97.5%'], roc.auc_ci.high, atol=0.02)
np.random.seed(0xC0FFEE)
yield checkme, [1, 1, 1, 1, 0, 0, 0, 0] * 10, [1, 1, 1, 1, 0, 0, 0, 0] * 10
yield checkme, [1, 1, 1, 1, 0, 0, 0, 0] * 10, [1, 0, 1, 0, 1, 0, 1, 0] * 10
for _ in range(5):
y_true = np.random.choice([0, 1], size=100)
y_pred = np.random.normal(size=100)
y_pred[y_true == 1] += np.abs(np.random.normal())
yield checkme, y_true, y_pred
def test_compute_averaged_metrics():
""" Tests compute_averaged_metrics function"""
y_truth = [0, 1, 2, 0, 1, 2]
scores1 = [[0.7, 0.2, 0.1], [0.1, 0.7, 0.2], [0.2, 0.1, 0.7], [0.8, 0.1, 0.1], [0.1, 0.8, 0.1], [0.1, 0.1, 0.8]]
result1 = compute_averaged_metrics(y_truth, scores1, roc_auc_function)
nose.tools.assert_almost_equal(1.0, result1, delta=1e-6)
scores2 = [[0.1, 0.1, 0.8], [0.7, 0.2, 0.1], [0.1, 0.7, 0.2], [0.2, 0.1, 0.7], [0.8, 0.1, 0.1], [0.1, 0.8, 0.1]]
result2 = compute_averaged_metrics(y_truth, scores2, roc_auc_function)
nose.tools.assert_almost_equal(0.375, result2, delta=1e-6)
def test_pearson():
""" Validate pearson correlation"""
X = np.asarray([[1, 2], [-2, 8], [3, 5]])
y = np.asarray([-1, -2, 0])
rs_pearson, ps_pearson = f_pearson(X, y)
nose.tools.assert_almost_equal(0.073186395040328034, ps_pearson[0], delta=1e-6)
nose.tools.assert_almost_equal(0.66666666666666663, ps_pearson[1], delta=1e-6)
nose.tools.assert_almost_equal(0.993399267799, rs_pearson[0], delta=1e-6)
nose.tools.assert_almost_equal(-0.5, rs_pearson[1], delta=1e-6)
def test_accuracy_from_confusion_matrix():
""" test accuracy computations from confusion matrix """
y_truth = [0, 1, 2, 0, 1, 2]
y_score = [[0.7, 0.2, 0.1], [0.1, 0.7, 0.2], [0.2, 0.1, 0.7], [0.1, 0.8, 0.1], [0.1, 0.8, 0.1], [0.8, 0.1, 0.1]]
y_pred = [0, 1, 2, 1, 1, 0]
computed_confusion_matrix = confusion_matrix(y_truth, y_pred)
accuracy = accuracy_from_confusion_matrix(y_truth, y_score, computed_confusion_matrix)
nose.tools.assert_almost_equal(0.6666667, accuracy, delta=1e-6)
def test_conditional_means_selector():
""" test ConditionalMeansSelector class """
# first check means in reverse order
cms = ConditionalMeansSelector(f_pearson)
test_y = np.asarray([3, 2, 1, 0, 3, 2, 1, 0])
test_x = np.asarray([[0, 3], [5, 2], [9, 1], [13, 0], [0, 3], [5, 2], [9, 1], [13, 0]])
rs_cond_means, ps_cond_means = cms.selector_function(test_x, test_y)
nose.tools.assert_almost_equal(1.0, rs_cond_means[0], delta=1e-6)
nose.tools.assert_almost_equal(1.0, rs_cond_means[1], delta=1e-6)
nose.tools.assert_almost_equal(0.0, ps_cond_means[0], delta=1e-6)
nose.tools.assert_almost_equal(0.0, ps_cond_means[1], delta=1e-6)
# check that direct call does not produce right result, do NOT use as code pattern !!!
rs_cond_means_wrong, _ = f_pearson(test_x, test_y)
nose.tools.assert_not_almost_equal(1.0, rs_cond_means_wrong[0], delta=1e-6)
# check means in same order
cms_pairwise = ConditionalMeansSelector(pearsonr, True)
rs_cond_means_pw, ps_cond_means_pw = cms_pairwise.selector_function(test_x, test_y)
nose.tools.assert_almost_equal(1.0, rs_cond_means_pw[0], delta=1e-6)
nose.tools.assert_almost_equal(1.0, rs_cond_means_pw[1], delta=1e-6)
nose.tools.assert_almost_equal(0.0, ps_cond_means_pw[0], delta=1e-6)
nose.tools.assert_almost_equal(0.0, ps_cond_means_pw[1], delta=1e-6)
| 49.25731 | 116 | 0.611421 | [
"BSD-3-Clause"
] | MGHComputationalPathology/CalicoML | tests/test_metrics.py | 8,423 | Python |
# Copyright (C) 2016 Li Cheng at Beijing University of Posts
# and Telecommunications. www.muzixing.com
# Copyright (C) 2016 Huang MaChi at Chongqing University
# of Posts and Telecommunications, China.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import division
import copy
from operator import attrgetter
from ryu import cfg
from ryu.base import app_manager
from ryu.base.app_manager import lookup_service_brick
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.lib import hub
import setting
CONF = cfg.CONF
class NetworkMonitor(app_manager.RyuApp):
"""
NetworkMonitor is a Ryu app for collecting traffic information.
"""
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
def __init__(self, *args, **kwargs):
super(NetworkMonitor, self).__init__(*args, **kwargs)
self.name = 'monitor'
self.datapaths = {}
self.port_stats = {}
self.port_speed = {}
self.flow_stats = {}
self.flow_speed = {}
self.stats = {}
self.port_features = {}
self.free_bandwidth = {} # self.free_bandwidth = {dpid:{port_no:free_bw,},} unit:Kbit/s
self.awareness = lookup_service_brick('awareness')
self.graph = None
self.capabilities = None
self.best_paths = None
# Start to green thread to monitor traffic and calculating
# free bandwidth of links respectively.
self.monitor_thread = hub.spawn(self._monitor)
self.save_freebandwidth_thread = hub.spawn(self._save_bw_graph)
def _monitor(self):
"""
Main entry method of monitoring traffic.
"""
while CONF.weight == 'bw':
self.stats['flow'] = {}
self.stats['port'] = {}
for dp in self.datapaths.values():
self.port_features.setdefault(dp.id, {})
self._request_stats(dp)
# Refresh data.
self.capabilities = None
self.best_paths = None
hub.sleep(setting.MONITOR_PERIOD)
if self.stats['flow'] or self.stats['port']:
self.show_stat('flow')
self.show_stat('port')
hub.sleep(1)
def _save_bw_graph(self):
"""
Save bandwidth data into networkx graph object.
"""
while CONF.weight == 'bw':
self.graph = self.create_bw_graph(self.free_bandwidth)
self.logger.debug("save free bandwidth")
hub.sleep(setting.MONITOR_PERIOD)
@set_ev_cls(ofp_event.EventOFPStateChange,
[MAIN_DISPATCHER, DEAD_DISPATCHER])
def _state_change_handler(self, ev):
"""
Record datapath information.
"""
datapath = ev.datapath
if ev.state == MAIN_DISPATCHER:
if not datapath.id in self.datapaths:
self.logger.debug('register datapath: %016x', datapath.id)
self.datapaths[datapath.id] = datapath
elif ev.state == DEAD_DISPATCHER:
if datapath.id in self.datapaths:
self.logger.debug('unregister datapath: %016x', datapath.id)
del self.datapaths[datapath.id]
else:
pass
@set_ev_cls(ofp_event.EventOFPFlowStatsReply, MAIN_DISPATCHER)
def _flow_stats_reply_handler(self, ev):
"""
Save flow stats reply information into self.flow_stats.
Calculate flow speed and Save it.
(old) self.flow_stats = {dpid:{(in_port, ipv4_dst, out-port):[(packet_count, byte_count, duration_sec, duration_nsec),],},}
(old) self.flow_speed = {dpid:{(in_port, ipv4_dst, out-port):[speed,],},}
(new) self.flow_stats = {dpid:{(priority, ipv4_src, ipv4_dst):[(packet_count, byte_count, duration_sec, duration_nsec),],},}
(new) self.flow_speed = {dpid:{(priority, ipv4_src, ipv4_dst):[speed,],},}
Because the proactive flow entrys don't have 'in_port' and 'out-port' field.
Note: table-miss, LLDP and ARP flow entries are not what we need, just filter them.
"""
body = ev.msg.body
dpid = ev.msg.datapath.id
self.stats['flow'][dpid] = body
self.flow_stats.setdefault(dpid, {})
self.flow_speed.setdefault(dpid, {})
for stat in sorted([flow for flow in body if ((flow.priority not in [0, 65535]) and (flow.match.get('ipv4_src')) and (flow.match.get('ipv4_dst')))],
key=lambda flow: (flow.priority, flow.match.get('ipv4_src'), flow.match.get('ipv4_dst'))):
key = (stat.priority, stat.match.get('ipv4_src'), stat.match.get('ipv4_dst'))
value = (stat.packet_count, stat.byte_count,
stat.duration_sec, stat.duration_nsec)
self._save_stats(self.flow_stats[dpid], key, value, 5)
# Get flow's speed and Save it.
pre = 0
period = setting.MONITOR_PERIOD
tmp = self.flow_stats[dpid][key]
if len(tmp) > 1:
pre = tmp[-2][1]
period = self._get_period(tmp[-1][2], tmp[-1][3],
tmp[-2][2], tmp[-2][3])
speed = self._get_speed(self.flow_stats[dpid][key][-1][1],
pre, period)
self._save_stats(self.flow_speed[dpid], key, speed, 5)
@set_ev_cls(ofp_event.EventOFPPortStatsReply, MAIN_DISPATCHER)
def _port_stats_reply_handler(self, ev):
"""
Save port's stats information into self.port_stats.
Calculate port speed and Save it.
self.port_stats = {(dpid, port_no):[(tx_bytes, rx_bytes, rx_errors, duration_sec, duration_nsec),],}
self.port_speed = {(dpid, port_no):[speed,],}
Note: The transmit performance and receive performance are independent of a port.
We calculate the load of a port only using tx_bytes.
"""
body = ev.msg.body
dpid = ev.msg.datapath.id
self.stats['port'][dpid] = body
self.free_bandwidth.setdefault(dpid, {})
for stat in sorted(body, key=attrgetter('port_no')):
port_no = stat.port_no
if port_no != ofproto_v1_3.OFPP_LOCAL:
key = (dpid, port_no)
value = (stat.tx_bytes, stat.rx_bytes, stat.rx_errors,
stat.duration_sec, stat.duration_nsec)
self._save_stats(self.port_stats, key, value, 5)
# Get port speed and Save it.
pre = 0
period = setting.MONITOR_PERIOD
tmp = self.port_stats[key]
if len(tmp) > 1:
# Calculate only the tx_bytes, not the rx_bytes. (hmc)
pre = tmp[-2][0]
period = self._get_period(tmp[-1][3], tmp[-1][4], tmp[-2][3], tmp[-2][4])
speed = self._get_speed(self.port_stats[key][-1][0], pre, period)
self._save_stats(self.port_speed, key, speed, 5)
self._save_freebandwidth(dpid, port_no, speed)
@set_ev_cls(ofp_event.EventOFPPortDescStatsReply, MAIN_DISPATCHER)
def port_desc_stats_reply_handler(self, ev):
"""
Save port description info.
"""
msg = ev.msg
dpid = msg.datapath.id
ofproto = msg.datapath.ofproto
config_dict = {ofproto.OFPPC_PORT_DOWN: "Down",
ofproto.OFPPC_NO_RECV: "No Recv",
ofproto.OFPPC_NO_FWD: "No Farward",
ofproto.OFPPC_NO_PACKET_IN: "No Packet-in"}
state_dict = {ofproto.OFPPS_LINK_DOWN: "Down",
ofproto.OFPPS_BLOCKED: "Blocked",
ofproto.OFPPS_LIVE: "Live"}
ports = []
for p in ev.msg.body:
ports.append('port_no=%d hw_addr=%s name=%s config=0x%08x '
'state=0x%08x curr=0x%08x advertised=0x%08x '
'supported=0x%08x peer=0x%08x curr_speed=%d '
'max_speed=%d' %
(p.port_no, p.hw_addr,
p.name, p.config,
p.state, p.curr, p.advertised,
p.supported, p.peer, p.curr_speed,
p.max_speed))
if p.config in config_dict:
config = config_dict[p.config]
else:
config = "up"
if p.state in state_dict:
state = state_dict[p.state]
else:
state = "up"
# Recording data.
port_feature = (config, state, p.curr_speed)
self.port_features[dpid][p.port_no] = port_feature
@set_ev_cls(ofp_event.EventOFPPortStatus, MAIN_DISPATCHER)
def _port_status_handler(self, ev):
"""
Handle the port status changed event.
"""
msg = ev.msg
ofproto = msg.datapath.ofproto
reason = msg.reason
dpid = msg.datapath.id
port_no = msg.desc.port_no
reason_dict = {ofproto.OFPPR_ADD: "added",
ofproto.OFPPR_DELETE: "deleted",
ofproto.OFPPR_MODIFY: "modified", }
if reason in reason_dict:
print "switch%d: port %s %s" % (dpid, reason_dict[reason], port_no)
else:
print "switch%d: Illeagal port state %s %s" % (dpid, port_no, reason)
def _request_stats(self, datapath):
"""
Sending request msg to datapath
"""
self.logger.debug('send stats request: %016x', datapath.id)
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
req = parser.OFPPortDescStatsRequest(datapath, 0)
datapath.send_msg(req)
req = parser.OFPPortStatsRequest(datapath, 0, ofproto.OFPP_ANY)
datapath.send_msg(req)
req = parser.OFPFlowStatsRequest(datapath)
datapath.send_msg(req)
def get_min_bw_of_links(self, graph, path, min_bw):
"""
Getting bandwidth of path. Actually, the mininum bandwidth
of links is the path's bandwith, because it is the bottleneck of path.
"""
_len = len(path)
if _len > 1:
minimal_band_width = min_bw
for i in xrange(_len-1):
pre, curr = path[i], path[i+1]
if 'bandwidth' in graph[pre][curr]:
bw = graph[pre][curr]['bandwidth']
minimal_band_width = min(bw, minimal_band_width)
else:
continue
return minimal_band_width
else:
return min_bw
def get_best_path_by_bw(self, graph, paths):
"""
Get best path by comparing paths.
Note: This function is called in EFattree module.
"""
capabilities = {}
best_paths = copy.deepcopy(paths)
for src in paths:
for dst in paths[src]:
if src == dst:
best_paths[src][src] = [src]
capabilities.setdefault(src, {src: setting.MAX_CAPACITY})
capabilities[src][src] = setting.MAX_CAPACITY
else:
max_bw_of_paths = 0
best_path = paths[src][dst][0]
for path in paths[src][dst]:
min_bw = setting.MAX_CAPACITY
min_bw = self.get_min_bw_of_links(graph, path, min_bw)
if min_bw > max_bw_of_paths:
max_bw_of_paths = min_bw
best_path = path
best_paths[src][dst] = best_path
capabilities.setdefault(src, {dst: max_bw_of_paths})
capabilities[src][dst] = max_bw_of_paths
# self.capabilities and self.best_paths have no actual utility in this module.
self.capabilities = capabilities
self.best_paths = best_paths
return capabilities, best_paths
def create_bw_graph(self, bw_dict):
"""
Save bandwidth data into networkx graph object.
"""
try:
graph = self.awareness.graph
link_to_port = self.awareness.link_to_port
for link in link_to_port:
(src_dpid, dst_dpid) = link
(src_port, dst_port) = link_to_port[link]
if src_dpid in bw_dict and dst_dpid in bw_dict:
bandwidth = bw_dict[src_dpid][src_port]
# Add key:value pair of bandwidth into graph.
if graph.has_edge(src_dpid, dst_dpid):
graph[src_dpid][dst_dpid]['bandwidth'] = bandwidth
else:
graph.add_edge(src_dpid, dst_dpid)
graph[src_dpid][dst_dpid]['bandwidth'] = bandwidth
else:
if graph.has_edge(src_dpid, dst_dpid):
graph[src_dpid][dst_dpid]['bandwidth'] = 0
else:
graph.add_edge(src_dpid, dst_dpid)
graph[src_dpid][dst_dpid]['bandwidth'] = 0
return graph
except:
self.logger.info("Create bw graph exception")
if self.awareness is None:
self.awareness = lookup_service_brick('awareness')
return self.awareness.graph
def _save_freebandwidth(self, dpid, port_no, speed):
"""
Calculate free bandwidth of port and Save it.
port_feature = (config, state, p.curr_speed)
self.port_features[dpid][p.port_no] = port_feature
self.free_bandwidth = {dpid:{port_no:free_bw,},}
"""
port_state = self.port_features.get(dpid).get(port_no)
if port_state:
capacity = 10000 # The true bandwidth of link, instead of 'curr_speed'.
free_bw = self._get_free_bw(capacity, speed)
self.free_bandwidth[dpid].setdefault(port_no, None)
self.free_bandwidth[dpid][port_no] = free_bw
else:
self.logger.info("Port is Down")
def _save_stats(self, _dict, key, value, length=5):
if key not in _dict:
_dict[key] = []
_dict[key].append(value)
if len(_dict[key]) > length:
_dict[key].pop(0)
def _get_speed(self, now, pre, period):
if period:
return (now - pre) / (period)
else:
return 0
def _get_free_bw(self, capacity, speed):
# freebw: Kbit/s
return max(capacity - speed * 8 / 1000.0, 0)
def _get_time(self, sec, nsec):
return sec + nsec / 1000000000.0
def _get_period(self, n_sec, n_nsec, p_sec, p_nsec):
return self._get_time(n_sec, n_nsec) - self._get_time(p_sec, p_nsec)
def show_stat(self, _type):
'''
Show statistics information according to data type.
_type: 'port' / 'flow'
'''
if setting.TOSHOW is False:
return
bodys = self.stats[_type]
if _type == 'flow':
print('\ndatapath '
'priority ip_src ip_dst '
' packets bytes flow-speed(Kb/s)')
print('-------- '
'-------- ------------ ------------ '
'--------- ----------- ----------------')
for dpid in sorted(bodys.keys()):
for stat in sorted([flow for flow in bodys[dpid] if ((flow.priority not in [0, 65535]) and (flow.match.get('ipv4_src')) and (flow.match.get('ipv4_dst')))],
key=lambda flow: (flow.priority, flow.match.get('ipv4_src'), flow.match.get('ipv4_dst'))):
print('%8d %8s %12s %12s %9d %11d %16.1f' % (
dpid,
stat.priority, stat.match.get('ipv4_src'), stat.match.get('ipv4_dst'),
stat.packet_count, stat.byte_count,
abs(self.flow_speed[dpid][(stat.priority, stat.match.get('ipv4_src'), stat.match.get('ipv4_dst'))][-1])*8/1000.0))
print
if _type == 'port':
print('\ndatapath port '
' rx-pkts rx-bytes '' tx-pkts tx-bytes '
' port-bw(Kb/s) port-speed(b/s) port-freebw(Kb/s) '
' port-state link-state')
print('-------- ---- '
'--------- ----------- ''--------- ----------- '
'------------- --------------- ----------------- '
'---------- ----------')
_format = '%8d %4x %9d %11d %9d %11d %13d %15.1f %17.1f %10s %10s'
for dpid in sorted(bodys.keys()):
for stat in sorted(bodys[dpid], key=attrgetter('port_no')):
if stat.port_no != ofproto_v1_3.OFPP_LOCAL:
print(_format % (
dpid, stat.port_no,
stat.rx_packets, stat.rx_bytes,
stat.tx_packets, stat.tx_bytes,
10000,
abs(self.port_speed[(dpid, stat.port_no)][-1] * 8),
self.free_bandwidth[dpid][stat.port_no],
self.port_features[dpid][stat.port_no][0],
self.port_features[dpid][stat.port_no][1]))
print
| 35.293023 | 160 | 0.654389 | [
"Apache-2.0"
] | Helloworld1995/Ryu_SDN_Controller | build/lib.linux-x86_64-2.7/ryu/app/experiments/RUN-master/EFattree/network_monitor.py | 15,176 | Python |
"""engine.SCons.Tool.f03
Tool-specific initialization for the generic Posix f03 Fortran compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Tool/f03.py 2013/03/03 09:48:35 garyo"
import SCons.Defaults
import SCons.Tool
import SCons.Util
import fortran
from SCons.Tool.FortranCommon import add_all_to_env, add_f03_to_env
compilers = ['f03']
def generate(env):
add_all_to_env(env)
add_f03_to_env(env)
fcomp = env.Detect(compilers) or 'f03'
env['F03'] = fcomp
env['SHF03'] = fcomp
env['FORTRAN'] = fcomp
env['SHFORTRAN'] = fcomp
def exists(env):
return env.Detect(compilers)
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
| 32.109375 | 113 | 0.750852 | [
"BSD-3-Clause"
] | Acpharis/protein_prep | pdb2pqr-1.9.0/scons/scons-local-2.3.0/SCons/Tool/f03.py | 2,055 | Python |
"""add ondelete set null to question_repyl, tabled_committee_report and call_for_comment tables
Revision ID: 122a38429a58
Revises: 29cf770ce19b
Create Date: 2015-02-10 10:13:58.437446
"""
# revision identifiers, used by Alembic.
revision = '122a38429a58'
down_revision = '29cf770ce19b'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.drop_constraint("question_reply_committee_id_fkey", 'question_reply')
op.create_foreign_key('question_reply_committee_id_fkey', 'question_reply', 'committee', ['committee_id'], ['id'], ondelete='SET NULL')
op.drop_constraint("tabled_committee_report_committee_id_fkey", 'tabled_committee_report')
op.create_foreign_key('tabled_committee_report_committee_id_fkey', 'tabled_committee_report', 'committee', ['committee_id'], ['id'], ondelete='SET NULL')
op.drop_constraint("call_for_comment_committee_id_fkey", 'call_for_comment')
op.create_foreign_key('call_for_comment_committee_id_fkey', 'call_for_comment', 'committee', ['committee_id'], ['id'], ondelete='SET NULL')
def downgrade():
pass
| 34.9375 | 157 | 0.77907 | [
"Apache-2.0"
] | Lunga001/pmg-cms-2 | migrations/versions/122a38429a58_add_ondelete_set_null_to_question_repyl_.py | 1,118 | Python |
#!/usr/bin/env python3
from aws_cdk import core
from arm64_wheel_tester_stack.arm64_wheel_tester_stack import Arm64WheelTesterStack
app = core.App()
Arm64WheelTesterStack(app, "arm64-github-testers", env={'region': 'us-east-1'})
app.synth()
| 20.5 | 83 | 0.780488 | [
"BSD-2-Clause"
] | AWSjswinney/arm64-python-wheel-tester | app.py | 246 | Python |
#
# This file is part of pyasn1-alt-modules software.
#
# Created by Russ Housley
# Copyright (c) 2020-2022, Vigil Security, LLC
# License: http://vigilsec.com/pyasn1-alt-modules-license.txt
#
import sys
import unittest
from pyasn1.codec.der.decoder import decode as der_decoder
from pyasn1.codec.der.encoder import encode as der_encoder
from pyasn1_alt_modules import pem
from pyasn1_alt_modules import rfc5280
from pyasn1_alt_modules import rfc8737
from pyasn1_alt_modules import opentypemap
class ACMEIdentifierTestCase(unittest.TestCase):
pem_text = """\
MIIDXDCCAkSgAwIBAgIUaKWDEVneTUkvvTOZB4f4Hhbfkj0wDQYJKoZIhvcNAQEL
BQAwGzEZMBcGA1UEAxMQdGVzdC5leGFtcGxlLmNvbTAeFw0yMDEyMjkyMjA1MjFa
Fw0yMTAxMDIyMjA1MjFaMBsxGTAXBgNVBAMTEHRlc3QuZXhhbXBsZS5jb20wggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC8vg/L5D+VSxSY4omMBkkZHlgg
rvM9cMHmwkAFzQwkO022DCRvYPfkvFjzbR5YqwuuZyyAeUHCgp/arIUslXQJ39W5
HEWtih/sHe5N/9u91IoDvP7Zn8OimXbC6YxKQvskJkIZ5r8Eqqwms3NIIwJ21FJz
jI3iA8GRdc7oJgMplU8GjO1PsKnW+tePOuaM7XDDUvTAazhloZRSts42K+bnh90m
vhyPZ57mDQ6EyplJU5MKZCSqzh3lfMKCwJgYEJk/CP7JwZc+/Y+ZkRQ5stXg/rTg
wh3+tkLdYIgzfVMzTuNSePUA5AjJEDK/wugIAMF7co7iZ1HbEhvI8niebv0zAgMB
AAGjgZcwgZQwMQYIKwYBBQUHAR8BAf8EIgQghzeHN4c3hzeHN4c3hzeHN4c3hzeH
N4c3hzeHN4c3hzcwQgYJYIZIAYb4QgENBDUWM1RoaXMgY2VydGlmaWNhdGUgY2Fu
bm90IGJlIHRydXN0ZWQgZm9yIGFueSBwdXJwb3NlLjAbBgNVHREEFDASghB0ZXN0
LmV4YW1wbGUuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQAZdlB0TAKlgAsVqCm+Bg1j
iEA8A7ZKms6J/CYy6LB6oJPcUqVMmUMigEvWD2mIO4Q2cHwJ6Gn9Zf5jb0jhBPS2
HYGJN2wVGYmWdyB4TOWRhu122iXpKGkQZ01+knP+ueVLqYvmRGx/V3sw12mbN+PB
y+EhhFdfjfuY95qbo5yBmY7EQSKf7lXyUvFkPAtirj6lvzTEIshvS9qkj0XiMiO8
6F/d2sVhPWpD3JOxhp0D+JEYcXwfwmn6OprRUTAvCFhpC+qkQOoTa37Xy65V0435
LWIbHF0HSW/CxDQo22mHT+tMqd13NzlDN3HxurIEGU4fBjk/rMSxw/bAPf4O0QT3
"""
def setUp(self):
self.asn1Spec = rfc5280.Certificate()
def testDerCodec(self):
substrate = pem.readBase64fromText(self.pem_text)
asn1Object, rest = der_decoder(substrate, asn1Spec=self.asn1Spec)
self.assertFalse(rest)
self.assertTrue(asn1Object.prettyPrint())
self.assertEqual(substrate, der_encoder(asn1Object))
found = False
certificateExtensionsMap = opentypemap.get('certificateExtensionsMap')
for extn in asn1Object['tbsCertificate']['extensions']:
if extn['extnID'] == rfc8737.id_pe_acmeIdentifier:
self.assertTrue(extn['critical'])
self.assertIn(extn['extnID'], certificateExtensionsMap)
auth, rest = der_decoder(
extn['extnValue'], asn1Spec=rfc8737.Authorization())
self.assertFalse(rest)
self.assertTrue(auth.prettyPrint())
self.assertEqual(extn['extnValue'], der_encoder(auth))
self.assertEqual(32, len(auth))
found = True
self.assertTrue(found)
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite)
| 40.472973 | 78 | 0.795659 | [
"BSD-2-Clause"
] | CBonnell/pyasn1-alt-modules | tests/test_rfc8737.py | 2,995 | Python |
nome = input ('qual é o seu nome?')
print('é um prazer te conhecer, {}!'.format(nome))
| 17.8 | 50 | 0.629213 | [
"MIT"
] | railenedev/curso-em-video | exercicio2.py | 91 | Python |
import argparse
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
parser = argparse.ArgumentParser(description="Batch arguments")
parser.add_argument('--num-training-steps', type=int, dest='num_training_steps', default=2000)
parser.add_argument('--mini-batch-size', type=int, dest='mini_batch_size', default=50)
args = parser.parse_args()
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf.Variable(initial)
def conv2d(x, W):
return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
def max_pool_2x2(x):
return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],
strides=[1, 2, 2, 1], padding='SAME')
def run():
sess = tf.Session()
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
x = tf.placeholder(tf.float32, shape=[None, 784], name="x")
y_ = tf.placeholder(tf.float32, shape=[None, 10])
x_image = tf.reshape(x, [-1, 28, 28, 1])
W_conv1 = weight_variable([5, 5, 1, 32])
b_conv1 = bias_variable([32])
h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)
h_pool1 = max_pool_2x2(h_conv1)
W_conv2 = weight_variable([5, 5, 32, 64])
b_conv2 = bias_variable([64])
h_conv2 = tf.nn.relu(conv2d(h_pool1, W_conv2) + b_conv2)
h_pool2 = max_pool_2x2(h_conv2)
W_fc1 = weight_variable([7 * 7 * 64, 1024])
b_fc1 = bias_variable([1024])
h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64])
h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)
keep_prob = tf.placeholder(tf.float32, name="keep_prob")
h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
W_fc2 = weight_variable([1024, 10])
b_fc2 = bias_variable([10])
y_conv = tf.nn.softmax(tf.matmul(h_fc1_drop, W_fc2) + b_fc2, name="y_conv")
cross_entropy = tf.reduce_mean(
-tf.reduce_sum(y_ * tf.log(y_conv), reduction_indices=[1]))
train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)
correct_prediction = tf.equal(tf.argmax(y_conv,1), tf.argmax(y_,1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
sess.run(tf.initialize_all_variables())
for i in xrange(args.num_training_steps):
batch = mnist.train.next_batch(args.mini_batch_size)
if i % 100 == 0:
train_accuracy = accuracy.eval(
feed_dict={
x:batch[0], y_: batch[1], keep_prob: 1.0},
session=sess)
print "step %d, training accuracy %g" %(i, train_accuracy)
train_step.run(session=sess,
feed_dict={x: batch[0], y_: batch[1], keep_prob: 0.5})
print "test accuracy %s"%accuracy.eval(feed_dict={
x: mnist.test.images, y_: mnist.test.labels, keep_prob: 1.0},
session=sess)
saver = tf.train.Saver()
save_path = saver.save(sess, 'model.ckpt')
print "Model saved in file {}".format(save_path)
if __name__=='__main__':
run()
| 34.235955 | 94 | 0.656055 | [
"MIT"
] | alexanderlevin/mnist_digit_recognition | batch/train_model.py | 3,047 | Python |
from __future__ import absolute_import
import datetime
import jwt
import re
import json
import logging
from hashlib import md5 as _md5
from six.moves.urllib.parse import parse_qs, urlparse, urlsplit
from sentry.utils.cache import cache
from django.utils.encoding import force_bytes
from sentry.integrations.atlassian_connect import get_query_hash
from sentry.integrations.exceptions import ApiError
from sentry.integrations.client import ApiClient
from sentry.utils.http import absolute_uri
logger = logging.getLogger('sentry.integrations.jira')
JIRA_KEY = '%s.jira' % (urlparse(absolute_uri()).hostname, )
ISSUE_KEY_RE = re.compile(r'^[A-Za-z][A-Za-z0-9]*-\d+$')
def md5(*bits):
return _md5(':'.join((force_bytes(bit, errors='replace') for bit in bits)))
class JiraCloud(object):
"""
Contains the jira-cloud specifics that a JiraClient needs
in order to communicate with jira
"""
def __init__(self, shared_secret):
self.shared_secret = shared_secret
@property
def cache_prefix(self):
return 'sentry-jira-2:'
def request_hook(self, method, path, data, params, **kwargs):
"""
Used by Jira Client to apply the jira-cloud authentication
"""
# handle params that are already part of the path
url_params = dict(parse_qs(urlsplit(path).query))
url_params.update(params or {})
path = path.split('?')[0]
jwt_payload = {
'iss': JIRA_KEY,
'iat': datetime.datetime.utcnow(),
'exp': datetime.datetime.utcnow() + datetime.timedelta(seconds=5 * 60),
'qsh': get_query_hash(path, method.upper(), url_params),
}
encoded_jwt = jwt.encode(jwt_payload, self.shared_secret)
params = dict(
jwt=encoded_jwt,
**(url_params or {})
)
request_spec = kwargs.copy()
request_spec.update(dict(
method=method,
path=path,
data=data,
params=params))
return request_spec
class JiraApiClient(ApiClient):
COMMENTS_URL = '/rest/api/2/issue/%s/comment'
COMMENT_URL = '/rest/api/2/issue/%s/comment/%s'
STATUS_URL = '/rest/api/2/status'
CREATE_URL = '/rest/api/2/issue'
ISSUE_URL = '/rest/api/2/issue/%s'
META_URL = '/rest/api/2/issue/createmeta'
PRIORITIES_URL = '/rest/api/2/priority'
PROJECT_URL = '/rest/api/2/project'
SEARCH_URL = '/rest/api/2/search/'
VERSIONS_URL = '/rest/api/2/project/%s/versions'
USERS_URL = '/rest/api/2/user/assignable/search'
SERVER_INFO_URL = '/rest/api/2/serverInfo'
ASSIGN_URL = '/rest/api/2/issue/%s/assignee'
TRANSITION_URL = '/rest/api/2/issue/%s/transitions'
def __init__(self, base_url, jira_style, verify_ssl):
self.base_url = base_url
# `jira_style` encapsulates differences between jira server & jira cloud.
# We only support one API version for Jira, but server/cloud require different
# authentication mechanisms and caching.
self.jira_style = jira_style
super(JiraApiClient, self).__init__(verify_ssl)
def request(self, method, path, data=None, params=None, **kwargs):
"""
Use the request_hook method for our specific style of Jira to
add authentication data and transform parameters.
"""
request_spec = self.jira_style.request_hook(method, path, data, params, **kwargs)
return self._request(**request_spec)
def get_cached(self, url, params=None):
"""
Basic Caching mechanism for Jira metadata which changes infrequently
"""
query = ''
if params:
query = json.dumps(params, sort_keys=True)
key = self.jira_style.cache_prefix + md5(url, query, self.base_url).hexdigest()
cached_result = cache.get(key)
if not cached_result:
cached_result = self.get(url, params=params)
# This timeout is completely arbitrary. Jira doesn't give us any
# caching headers to work with. Ideally we want a duration that
# lets the user make their second jira issue with cached data.
cache.set(key, cached_result, 240)
return cached_result
def get_issue(self, issue_id):
return self.get(self.ISSUE_URL % (issue_id,))
def search_issues(self, query):
# check if it looks like an issue id
if ISSUE_KEY_RE.match(query):
jql = 'id="%s"' % query.replace('"', '\\"')
else:
jql = 'text ~ "%s"' % query.replace('"', '\\"')
return self.get(self.SEARCH_URL, params={'jql': jql})
def create_comment(self, issue_key, comment):
return self.post(self.COMMENTS_URL % issue_key, data={'body': comment})
def update_comment(self, issue_key, comment_id, comment):
return self.put(self.COMMENT_URL % (issue_key, comment_id), data={'body': comment})
def get_projects_list(self):
return self.get_cached(self.PROJECT_URL)
def get_project_key_for_id(self, project_id):
if not project_id:
return ''
projects = self.get_projects_list()
for project in projects:
if project['id'] == project_id:
return project['key'].encode('utf-8')
return ''
def get_create_meta_for_project(self, project):
params = {
'expand': 'projects.issuetypes.fields',
'projectIds': project
}
metas = self.get_cached(
self.META_URL,
params=params,
)
# We saw an empty JSON response come back from the API :(
if not metas:
logger.info('jira.get-create-meta.empty-response', extra={
'base_url': self.base_url,
'project': project,
})
return None
# XXX(dcramer): document how this is possible, if it even is
if len(metas['projects']) > 1:
raise ApiError(u'More than one project found matching {}.'.format(project))
try:
return metas['projects'][0]
except IndexError:
logger.info('jira.get-create-meta.key-error', extra={
'base_url': self.base_url,
'project': project,
})
return None
def get_versions(self, project):
return self.get_cached(self.VERSIONS_URL % project)
def get_priorities(self):
return self.get_cached(self.PRIORITIES_URL)
def get_users_for_project(self, project):
# Jira Server wants a project key, while cloud is indifferent.
project_key = self.get_project_key_for_id(project)
return self.get_cached(self.USERS_URL, params={'project': project_key})
def search_users_for_project(self, project, username):
# Jira Server wants a project key, while cloud is indifferent.
project_key = self.get_project_key_for_id(project)
return self.get_cached(
self.USERS_URL,
params={'project': project_key, 'username': username})
def search_users_for_issue(self, issue_key, email):
# not actully in the official documentation, but apparently
# you can pass email as the username param see:
# https://community.atlassian.com/t5/Answers-Developer-Questions/JIRA-Rest-API-find-JIRA-user-based-on-user-s-email-address/qaq-p/532715
return self.get_cached(
self.USERS_URL,
params={'issueKey': issue_key, 'username': email})
def create_issue(self, raw_form_data):
data = {'fields': raw_form_data}
return self.post(self.CREATE_URL, data=data)
def get_server_info(self):
return self.get(self.SERVER_INFO_URL)
def get_valid_statuses(self):
return self.get_cached(self.STATUS_URL)
def get_transitions(self, issue_key):
return self.get_cached(self.TRANSITION_URL % issue_key)['transitions']
def transition_issue(self, issue_key, transition_id):
return self.post(self.TRANSITION_URL % issue_key, {
'transition': {'id': transition_id},
})
def assign_issue(self, key, username):
return self.put(self.ASSIGN_URL % key, data={'name': username})
| 36.555556 | 144 | 0.638541 | [
"BSD-3-Clause"
] | YtvwlD/sentry | src/sentry/integrations/jira/client.py | 8,225 | Python |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Differentially private version of Keras optimizer v2."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import sys
from tensorflow_privacy.privacy.dp_query import gaussian_query
def make_keras_optimizer_class(cls):
"""Constructs a DP Keras optimizer class from an existing one."""
class DPOptimizerClass(cls):
"""Differentially private subclass of given class cls.
The class tf.keras.optimizers.Optimizer has two methods to compute
gradients, `_compute_gradients` and `get_gradients`. The first works
with eager execution, while the second runs in graph mode and is used
by canned estimators.
Internally, DPOptimizerClass stores hyperparameters both individually
and encapsulated in a `GaussianSumQuery` object for these two use cases.
However, this should be invisible to users of this class.
"""
def __init__(
self,
l2_norm_clip,
noise_multiplier,
changing_clipping=False,
num_microbatches=None,
gradient_norm=None,
*args, # pylint: disable=keyword-arg-before-vararg, g-doc-args
**kwargs):
"""Initialize the DPOptimizerClass.
Args:
l2_norm_clip: Clipping norm (max L2 norm of per microbatch gradients)
noise_multiplier: Ratio of the standard deviation to the clipping norm
num_microbatches: The number of microbatches into which each minibatch
is split.
"""
super(DPOptimizerClass, self).__init__(*args, **kwargs)
self._l2_norm_clip = l2_norm_clip
self._norm_clip = tf.Variable(l2_norm_clip)
self._noise_multiplier = noise_multiplier
self._num_microbatches = num_microbatches
self._dp_sum_query = gaussian_query.GaussianSumQuery(
l2_norm_clip, l2_norm_clip * noise_multiplier)
self._global_state = None
self._was_dp_gradients_called = False
self._changing_clipping = changing_clipping
self.gradient_norm = gradient_norm
def _compute_gradients(self, loss, var_list, grad_loss=None, tape=None):
# if self._changing_clipping:
# tf.print("cur C:", self._norm_clip.value(), output_stream=sys.stdout)
"""DP version of superclass method."""
self._was_dp_gradients_called = True
# Compute loss.
if not callable(loss) and tape is None:
raise ValueError('`tape` is required when a `Tensor` loss is passed.')
tape = tape if tape is not None else tf.GradientTape()
if callable(loss):
with tape:
if not callable(var_list):
tape.watch(var_list)
if callable(loss):
loss = loss()
microbatch_losses = tf.reduce_mean(
tf.reshape(loss, [self._num_microbatches, -1]), axis=1)
if callable(var_list):
var_list = var_list()
else:
with tape:
microbatch_losses = tf.reduce_mean(
tf.reshape(loss, [self._num_microbatches, -1]), axis=1)
var_list = tf.nest.flatten(var_list)
# Compute the per-microbatch losses using helpful jacobian method.
with tf.keras.backend.name_scope(self._name + '/gradients'):
jacobian = tape.jacobian(microbatch_losses, var_list)
if self._changing_clipping:
if False:
self._norm_clip.assign_add(0.002)
tf.print("cur C:", self._norm_clip.value(), output_stream=sys.stdout)
else:
gr_norm = jacobian.copy()
for i in range(len(gr_norm)):
gr_norm[i] = tf.norm(gr_norm[i])
gr_mean = tf.math.reduce_mean(gr_norm)
# tf.print("cur norm:", gr_mean, output_stream=sys.stdout)
self._norm_clip.assign(gr_mean)
C = self._norm_clip.value()
tf.print("cur C:", C, output_stream=sys.stdout)
# d_clip = gr_norm
# if self._changing_clipping and (C < d_clip):
# d_clip += 0.1*(d_clip - C)
# self._norm_clip.assign(d_clip)
# tf.print("cur C:", self._norm_clip.value(), output_stream=sys.stdout)
# Clip gradients to given l2_norm_clip.
def clip_gradients(g):
return tf.clip_by_global_norm(g, self._norm_clip.value())[0]
clipped_gradients = tf.map_fn(clip_gradients, jacobian)
def reduce_noise_normalize_batch(g):
# Sum gradients over all microbatches.
summed_gradient = tf.reduce_sum(g, axis=0)
# Add noise to summed gradients.
noise_stddev = self._l2_norm_clip * self._noise_multiplier
noise = tf.random.normal(
tf.shape(input=summed_gradient), stddev=noise_stddev)
noised_gradient = tf.add(summed_gradient, noise)
# Normalize by number of microbatches and return.
return tf.truediv(noised_gradient, self._num_microbatches)
final_gradients = tf.nest.map_structure(reduce_noise_normalize_batch,
clipped_gradients)
return list(zip(final_gradients, var_list))
def get_gradients(self, loss, params):
if self._changing_clipping:
self._l2_norm_clip *= 0.99
tf.print("cur C:", self._l2_norm_clip, output_stream=sys.stdout)
"""DP version of superclass method."""
self._was_dp_gradients_called = True
if self._global_state is None:
self._global_state = self._dp_sum_query.initial_global_state()
# This code mostly follows the logic in the original DPOptimizerClass
# in dp_optimizer.py, except that this returns only the gradients,
# not the gradients and variables.
microbatch_losses = tf.reshape(loss, [self._num_microbatches, -1])
sample_params = (
self._dp_sum_query.derive_sample_params(self._global_state))
def process_microbatch(i, sample_state):
"""Process one microbatch (record) with privacy helper."""
mean_loss = tf.reduce_mean(
input_tensor=tf.gather(microbatch_losses, [i]))
grads = tf.gradients(mean_loss, params)
sample_state = self._dp_sum_query.accumulate_record(
sample_params, sample_state, grads)
return sample_state
sample_state = self._dp_sum_query.initial_sample_state(params)
for idx in range(self._num_microbatches):
sample_state = process_microbatch(idx, sample_state)
grad_sums, self._global_state = (
self._dp_sum_query.get_noised_result(sample_state,
self._global_state))
def normalize(v):
try:
return tf.truediv(v, tf.cast(self._num_microbatches, tf.float32))
except TypeError:
return None
final_grads = tf.nest.map_structure(normalize, grad_sums)
return final_grads
def apply_gradients(self, grads_and_vars, global_step=None, name=None):
assert self._was_dp_gradients_called, (
'Neither _compute_gradients() or get_gradients() on the '
'differentially private optimizer was called. This means the '
'training is not differentially private. It may be the case that '
'you need to upgrade to TF 2.4 or higher to use this particular '
'optimizer.')
return super(DPOptimizerClass,
self).apply_gradients(grads_and_vars, global_step, name)
return DPOptimizerClass
DPKerasAdagradOptimizer = make_keras_optimizer_class(
tf.keras.optimizers.Adagrad)
DPKerasAdamOptimizer = make_keras_optimizer_class(tf.keras.optimizers.Adam)
DPKerasSGDOptimizer = make_keras_optimizer_class(tf.keras.optimizers.SGD)
| 39.106481 | 85 | 0.664023 | [
"Apache-2.0"
] | Jerry-li-uw/privacy | tutorials/dp_optimizer_adp.py | 8,447 | Python |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 ysitu <[email protected]>
# All rights reserved.
# BSD license.
#
# Author: ysitu <[email protected]>
"""
Algebraic connectivity and Fiedler vectors of undirected graphs.
"""
from functools import partial
import networkx as nx
from networkx.utils import not_implemented_for
from networkx.utils import reverse_cuthill_mckee_ordering
try:
from numpy import array, asmatrix, asarray, dot, ndarray, ones, sqrt, zeros
from numpy.linalg import norm, qr
from numpy.random import normal
from scipy.linalg import eigh, inv
from scipy.sparse import csc_matrix, spdiags
from scipy.sparse.linalg import eigsh, lobpcg
__all__ = ['algebraic_connectivity', 'fiedler_vector', 'spectral_ordering']
except ImportError:
__all__ = []
try:
from scipy.linalg.blas import dasum, daxpy, ddot
except ImportError:
if __all__:
# Make sure the imports succeeded.
# Use minimal replacements if BLAS is unavailable from SciPy.
dasum = partial(norm, ord=1)
ddot = dot
def daxpy(x, y, a):
y += a * x
return y
class _PCGSolver(object):
"""Preconditioned conjugate gradient method.
To solve Ax = b:
M = A.diagonal() # or some other preconditioner
solver = _PCGSolver(lambda x: A * x, lambda x: M * x)
x = solver.solve(b)
The inputs A and M are functions which compute
matrix multiplication on the argument.
A - multiply by the matrix A in Ax=b
M - multiply by M, the preconditioner surragate for A
Warning: There is no limit on number of iterations.
"""
def __init__(self, A, M):
self._A = A
self._M = M or (lambda x: x.copy())
def solve(self, B, tol):
B = asarray(B)
X = ndarray(B.shape, order='F')
for j in range(B.shape[1]):
X[:, j] = self._solve(B[:, j], tol)
return X
def _solve(self, b, tol):
A = self._A
M = self._M
tol *= dasum(b)
# Initialize.
x = zeros(b.shape)
r = b.copy()
z = M(r)
rz = ddot(r, z)
p = z.copy()
# Iterate.
while True:
Ap = A(p)
alpha = rz / ddot(p, Ap)
x = daxpy(p, x, a=alpha)
r = daxpy(Ap, r, a=-alpha)
if dasum(r) < tol:
return x
z = M(r)
beta = ddot(r, z)
beta, rz = beta / rz, beta
p = daxpy(p, z, a=beta)
class _CholeskySolver(object):
"""Cholesky factorization.
To solve Ax = b:
solver = _CholeskySolver(A)
x = solver.solve(b)
optional argument `tol` on solve method is ignored but included
to match _PCGsolver API.
"""
def __init__(self, A):
if not self._cholesky:
raise nx.NetworkXError('Cholesky solver unavailable.')
self._chol = self._cholesky(A)
def solve(self, B, tol=None):
return self._chol(B)
try:
from scikits.sparse.cholmod import cholesky
_cholesky = cholesky
except ImportError:
_cholesky = None
class _LUSolver(object):
"""LU factorization.
To solve Ax = b:
solver = _LUSolver(A)
x = solver.solve(b)
optional argument `tol` on solve method is ignored but included
to match _PCGsolver API.
"""
def __init__(self, A):
if not self._splu:
raise nx.NetworkXError('LU solver unavailable.')
self._LU = self._splu(A)
def solve(self, B, tol=None):
B = asarray(B)
X = ndarray(B.shape, order='F')
for j in range(B.shape[1]):
X[:, j] = self._LU.solve(B[:, j])
return X
try:
from scipy.sparse.linalg import splu
_splu = partial(splu, permc_spec='MMD_AT_PLUS_A', diag_pivot_thresh=0.,
options={'Equil': True, 'SymmetricMode': True})
except ImportError:
_splu = None
def _preprocess_graph(G, weight):
"""Compute edge weights and eliminate zero-weight edges.
"""
if G.is_directed():
H = nx.MultiGraph()
H.add_nodes_from(G)
H.add_weighted_edges_from(((u, v, e.get(weight, 1.))
for u, v, e in G.edges(data=True)
if u != v), weight=weight)
G = H
if not G.is_multigraph():
edges = ((u, v, abs(e.get(weight, 1.)))
for u, v, e in G.edges(data=True) if u != v)
else:
edges = ((u, v, sum(abs(e.get(weight, 1.)) for e in G[u][v].values()))
for u, v in G.edges() if u != v)
H = nx.Graph()
H.add_nodes_from(G)
H.add_weighted_edges_from((u, v, e) for u, v, e in edges if e != 0)
return H
def _rcm_estimate(G, nodelist):
"""Estimate the Fiedler vector using the reverse Cuthill-McKee ordering.
"""
G = G.subgraph(nodelist)
order = reverse_cuthill_mckee_ordering(G)
n = len(nodelist)
index = dict(zip(nodelist, range(n)))
x = ndarray(n, dtype=float)
for i, u in enumerate(order):
x[index[u]] = i
x -= (n - 1) / 2.
return x
def _tracemin_fiedler(L, X, normalized, tol, method):
"""Compute the Fiedler vector of L using the TraceMIN-Fiedler algorithm.
The Fiedler vector of a connected undirected graph is the eigenvector
corresponding to the second smallest eigenvalue of the Laplacian matrix of
of the graph. This function starts with the Laplacian L, not the Graph.
Parameters
----------
L : Laplacian of a possibly weighted or normalized, but undirected graph
X : Initial guess for a solution. Usually a matrix of random numbers.
This function allows more than one column in X to identify more than
one eigenvector if desired.
normalized : bool
Whether the normalized Laplacian matrix is used.
tol : float
Tolerance of relative residual in eigenvalue computation.
Warning: There is no limit on number of iterations.
method : string
Should be 'tracemin_pcg', 'tracemin_chol' or 'tracemin_lu'.
Otherwise exception is raised.
Returns
-------
sigma, X : Two NumPy arrays of floats.
The lowest eigenvalues and corresponding eigenvectors of L.
The size of input X determines the size of these outputs.
As this is for Fiedler vectors, the zero eigenvalue (and
constant eigenvector) are avoided.
"""
n = X.shape[0]
if normalized:
# Form the normalized Laplacian matrix and determine the eigenvector of
# its nullspace.
e = sqrt(L.diagonal())
D = spdiags(1. / e, [0], n, n, format='csr')
L = D * L * D
e *= 1. / norm(e, 2)
if normalized:
def project(X):
"""Make X orthogonal to the nullspace of L.
"""
X = asarray(X)
for j in range(X.shape[1]):
X[:, j] -= dot(X[:, j], e) * e
else:
def project(X):
"""Make X orthogonal to the nullspace of L.
"""
X = asarray(X)
for j in range(X.shape[1]):
X[:, j] -= X[:, j].sum() / n
if method == 'tracemin_pcg':
D = L.diagonal().astype(float)
solver = _PCGSolver(lambda x: L * x, lambda x: D * x)
elif method == 'tracemin_chol' or method == 'tracemin_lu':
# Convert A to CSC to suppress SparseEfficiencyWarning.
A = csc_matrix(L, dtype=float, copy=True)
# Force A to be nonsingular. Since A is the Laplacian matrix of a
# connected graph, its rank deficiency is one, and thus one diagonal
# element needs to modified. Changing to infinity forces a zero in the
# corresponding element in the solution.
i = (A.indptr[1:] - A.indptr[:-1]).argmax()
A[i, i] = float('inf')
if method == 'tracemin_chol':
solver = _CholeskySolver(A)
else:
solver = _LUSolver(A)
else:
raise nx.NetworkXError('Unknown linear system solver: ' + method)
# Initialize.
Lnorm = abs(L).sum(axis=1).flatten().max()
project(X)
W = asmatrix(ndarray(X.shape, order='F'))
while True:
# Orthonormalize X.
X = qr(X)[0]
# Compute interation matrix H.
W[:, :] = L * X
H = X.T * W
sigma, Y = eigh(H, overwrite_a=True)
# Compute the Ritz vectors.
X *= Y
# Test for convergence exploiting the fact that L * X == W * Y.
res = dasum(W * asmatrix(Y)[:, 0] - sigma[0] * X[:, 0]) / Lnorm
if res < tol:
break
# Compute X = L \ X / (X' * (L \ X)).
# L \ X can have an arbitrary projection on the nullspace of L,
# which will be eliminated.
W[:, :] = solver.solve(X, tol)
X = (inv(W.T * X) * W.T).T # Preserves Fortran storage order.
project(X)
return sigma, asarray(X)
def _get_fiedler_func(method):
"""Return a function that solves the Fiedler eigenvalue problem.
"""
if method == "tracemin": # old style keyword <v2.1
method = "tracemin_pcg"
if method in ("tracemin_pcg", "tracemin_chol", "tracemin_lu"):
def find_fiedler(L, x, normalized, tol):
q = 1 if method == 'tracemin_pcg' else min(4, L.shape[0] - 1)
X = asmatrix(normal(size=(q, L.shape[0]))).T
sigma, X = _tracemin_fiedler(L, X, normalized, tol, method)
return sigma[0], X[:, 0]
elif method == 'lanczos' or method == 'lobpcg':
def find_fiedler(L, x, normalized, tol):
L = csc_matrix(L, dtype=float)
n = L.shape[0]
if normalized:
D = spdiags(1. / sqrt(L.diagonal()), [0], n, n, format='csc')
L = D * L * D
if method == 'lanczos' or n < 10:
# Avoid LOBPCG when n < 10 due to
# https://github.com/scipy/scipy/issues/3592
# https://github.com/scipy/scipy/pull/3594
sigma, X = eigsh(L, 2, which='SM', tol=tol,
return_eigenvectors=True)
return sigma[1], X[:, 1]
else:
X = asarray(asmatrix(x).T)
M = spdiags(1. / L.diagonal(), [0], n, n)
Y = ones(n)
if normalized:
Y /= D.diagonal()
sigma, X = lobpcg(L, X, M=M, Y=asmatrix(Y).T, tol=tol,
maxiter=n, largest=False)
return sigma[0], X[:, 0]
else:
raise nx.NetworkXError("unknown method '%s'." % method)
return find_fiedler
@not_implemented_for('directed')
def algebraic_connectivity(G, weight='weight', normalized=False, tol=1e-8,
method='tracemin_pcg'):
"""Return the algebraic connectivity of an undirected graph.
The algebraic connectivity of a connected undirected graph is the second
smallest eigenvalue of its Laplacian matrix.
Parameters
----------
G : NetworkX graph
An undirected graph.
weight : object, optional (default: None)
The data key used to determine the weight of each edge. If None, then
each edge has unit weight.
normalized : bool, optional (default: False)
Whether the normalized Laplacian matrix is used.
tol : float, optional (default: 1e-8)
Tolerance of relative residual in eigenvalue computation.
method : string, optional (default: 'tracemin_pcg')
Method of eigenvalue computation. It must be one of the tracemin
options shown below (TraceMIN), 'lanczos' (Lanczos iteration)
or 'lobpcg' (LOBPCG).
The TraceMIN algorithm uses a linear system solver. The following
values allow specifying the solver to be used.
=============== ========================================
Value Solver
=============== ========================================
'tracemin_pcg' Preconditioned conjugate gradient method
'tracemin_chol' Cholesky factorization
'tracemin_lu' LU factorization
=============== ========================================
Returns
-------
algebraic_connectivity : float
Algebraic connectivity.
Raises
------
NetworkXNotImplemented
If G is directed.
NetworkXError
If G has less than two nodes.
Notes
-----
Edge weights are interpreted by their absolute values. For MultiGraph's,
weights of parallel edges are summed. Zero-weighted edges are ignored.
To use Cholesky factorization in the TraceMIN algorithm, the
:samp:`scikits.sparse` package must be installed.
See Also
--------
laplacian_matrix
"""
if len(G) < 2:
raise nx.NetworkXError('graph has less than two nodes.')
G = _preprocess_graph(G, weight)
if not nx.is_connected(G):
return 0.
L = nx.laplacian_matrix(G)
if L.shape[0] == 2:
return 2. * L[0, 0] if not normalized else 2.
find_fiedler = _get_fiedler_func(method)
x = None if method != 'lobpcg' else _rcm_estimate(G, G)
sigma, fiedler = find_fiedler(L, x, normalized, tol)
return sigma
@not_implemented_for('directed')
def fiedler_vector(G, weight='weight', normalized=False, tol=1e-8,
method='tracemin_pcg'):
"""Return the Fiedler vector of a connected undirected graph.
The Fiedler vector of a connected undirected graph is the eigenvector
corresponding to the second smallest eigenvalue of the Laplacian matrix of
of the graph.
Parameters
----------
G : NetworkX graph
An undirected graph.
weight : object, optional (default: None)
The data key used to determine the weight of each edge. If None, then
each edge has unit weight.
normalized : bool, optional (default: False)
Whether the normalized Laplacian matrix is used.
tol : float, optional (default: 1e-8)
Tolerance of relative residual in eigenvalue computation.
method : string, optional (default: 'tracemin_pcg')
Method of eigenvalue computation. It must be one of the tracemin
options shown below (TraceMIN), 'lanczos' (Lanczos iteration)
or 'lobpcg' (LOBPCG).
The TraceMIN algorithm uses a linear system solver. The following
values allow specifying the solver to be used.
=============== ========================================
Value Solver
=============== ========================================
'tracemin_pcg' Preconditioned conjugate gradient method
'tracemin_chol' Cholesky factorization
'tracemin_lu' LU factorization
=============== ========================================
Returns
-------
fiedler_vector : NumPy array of floats.
Fiedler vector.
Raises
------
NetworkXNotImplemented
If G is directed.
NetworkXError
If G has less than two nodes or is not connected.
Notes
-----
Edge weights are interpreted by their absolute values. For MultiGraph's,
weights of parallel edges are summed. Zero-weighted edges are ignored.
To use Cholesky factorization in the TraceMIN algorithm, the
:samp:`scikits.sparse` package must be installed.
See Also
--------
laplacian_matrix
"""
if len(G) < 2:
raise nx.NetworkXError('graph has less than two nodes.')
G = _preprocess_graph(G, weight)
if not nx.is_connected(G):
raise nx.NetworkXError('graph is not connected.')
if len(G) == 2:
return array([1., -1.])
find_fiedler = _get_fiedler_func(method)
L = nx.laplacian_matrix(G)
x = None if method != 'lobpcg' else _rcm_estimate(G, G)
sigma, fiedler = find_fiedler(L, x, normalized, tol)
return fiedler
def spectral_ordering(G, weight='weight', normalized=False, tol=1e-8,
method='tracemin_pcg'):
"""Compute the spectral_ordering of a graph.
The spectral ordering of a graph is an ordering of its nodes where nodes
in the same weakly connected components appear contiguous and ordered by
their corresponding elements in the Fiedler vector of the component.
Parameters
----------
G : NetworkX graph
A graph.
weight : object, optional (default: None)
The data key used to determine the weight of each edge. If None, then
each edge has unit weight.
normalized : bool, optional (default: False)
Whether the normalized Laplacian matrix is used.
tol : float, optional (default: 1e-8)
Tolerance of relative residual in eigenvalue computation.
method : string, optional (default: 'tracemin_pcg')
Method of eigenvalue computation. It must be one of the tracemin
options shown below (TraceMIN), 'lanczos' (Lanczos iteration)
or 'lobpcg' (LOBPCG).
The TraceMIN algorithm uses a linear system solver. The following
values allow specifying the solver to be used.
=============== ========================================
Value Solver
=============== ========================================
'tracemin_pcg' Preconditioned conjugate gradient method
'tracemin_chol' Cholesky factorization
'tracemin_lu' LU factorization
=============== ========================================
Returns
-------
spectral_ordering : NumPy array of floats.
Spectral ordering of nodes.
Raises
------
NetworkXError
If G is empty.
Notes
-----
Edge weights are interpreted by their absolute values. For MultiGraph's,
weights of parallel edges are summed. Zero-weighted edges are ignored.
To use Cholesky factorization in the TraceMIN algorithm, the
:samp:`scikits.sparse` package must be installed.
See Also
--------
laplacian_matrix
"""
if len(G) == 0:
raise nx.NetworkXError('graph is empty.')
G = _preprocess_graph(G, weight)
find_fiedler = _get_fiedler_func(method)
order = []
for component in nx.connected_components(G):
size = len(component)
if size > 2:
L = nx.laplacian_matrix(G, component)
x = None if method != 'lobpcg' else _rcm_estimate(G, component)
sigma, fiedler = find_fiedler(L, x, normalized, tol)
sort_info = zip(fiedler, range(size), component)
order.extend(u for x, c, u in sorted(sort_info))
else:
order.extend(component)
return order
# fixture for nose tests
def setup_module(module):
from nose import SkipTest
try:
import numpy
import scipy.sparse
except ImportError:
raise SkipTest('SciPy not available.')
| 32.598276 | 79 | 0.582271 | [
"Unlicense"
] | AlexKovrigin/facerecognition | venv/Lib/site-packages/networkx/linalg/algebraicconnectivity.py | 18,907 | Python |
#!/usr/bin/env python3
# @generated AUTOGENERATED file. Do not Change!
from dataclasses import dataclass, field as _field
from functools import partial
from ...config import custom_scalars, datetime
from numbers import Number
from typing import Any, AsyncGenerator, Dict, List, Generator, Optional
from dataclasses_json import DataClassJsonMixin, config
from ..input.document_category_input import DocumentCategoryInput
from ..input.property_type_input import PropertyTypeInput
@dataclass(frozen=True)
class EditLocationTypeInput(DataClassJsonMixin):
id: str
name: str
documentCategories: List[DocumentCategoryInput]
properties: List[PropertyTypeInput]
mapType: Optional[str] = None
mapZoomLevel: Optional[int] = None
isSite: Optional[bool] = None
| 31.24 | 71 | 0.795134 | [
"BSD-3-Clause"
] | jesusrh12/symphony | cli/psym/graphql/input/edit_location_type_input.py | 781 | Python |
from shopyoapi.init import db
class Product(db.Model):
__tablename__ = "product"
barcode = db.Column(db.String(100), primary_key=True)
price = db.Column(db.Float)
name = db.Column(db.String(100))
description = db.Column(db.String(300))
date = db.Column(db.String(100))
in_stock = db.Column(db.Integer)
discontinued = db.Column(db.Boolean)
selling_price = db.Column(db.Float)
category_name = db.Column(
db.String(100), db.ForeignKey("category.name"), nullable=False
)
| 30.647059 | 70 | 0.675624 | [
"MIT"
] | ouyangjunfei/shopyo | shopyo/modules/product/models.py | 521 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.