content
stringlengths
5
1.05M
#!/usr/bin/env python3 import argparse import json import requests import sys import uuid from bs4 import BeautifulSoup # Parse arguments parser = argparse.ArgumentParser() parser.add_argument('-8', '--x86', default=False, action='store_true', help='Request x86 instead of x64') parser.add_argument('-l', '--language', type=str, default='English', help='Language to request link for') parser.add_argument('edition', type=str, help='Edition to request - use "latest" for the latest version') parser.add_argument('-L', '--list-langs', default=False, action='store_true', help='List languages instead of downloading') parser.add_argument('-S', '--show-edition', default=False, action='store_true', help='Show edition number we would download (mainly useful for the latest edition)') args = parser.parse_args() # Prepare requests sessionID = uuid.uuid1() s = requests.Session() s.headers.update({ 'User-Agent': 'Mozilla/5.0 (X11; Linux i586; rv:57.0) Gecko/1/1/2008 Firefox/57.0' }) # Fetch latest version if args.edition == 'latest': url = 'https://www.microsoft.com/en-us/software-download/windows10ISO' resp = s.get(url) assert resp.status_code == 200 html = BeautifulSoup(resp.text, features='html.parser') edition = 0 for opt in html.find_all('option'): value = opt['value'] if value == '': continue if int(value) > edition: edition = int(value) else: edition = args.edition if args.show_edition: print(edition) sys.exit(0) # Fetch languages url = 'https://www.microsoft.com/en-US/api/controls/contentinclude/html' + \ '?pageId=a8f8f489-4c7f-463a-9ca6-5cff94d8d041' + \ '&host=www.microsoft.com' + \ '&segments=software-download,windows10ISO' + \ '&query=&action=getskuinformationbyproductedition' + \ '&sessionId={}'.format(sessionID) + \ '&productEditionId={}'.format(edition) + \ '&sdVersion=2' # Request all languages resp = s.post(url) assert resp.status_code == 200 # Parse languages into an object skus = {} html = BeautifulSoup(resp.text, features='html.parser') for opt in html.find_all('option'): text = opt.text value = opt['value'] if value == '': continue skus[text] = value if args.list_langs: for name in skus.keys(): print(name) sys.exit(0) # Select language sku = skus[args.language] skuJson = json.loads(sku) skuId = skuJson['id'] skuName = skuJson['language'] # Fetch download links url = 'https://www.microsoft.com/en-US/api/controls/contentinclude/html' + \ '?pageId=cfa9e580-a81e-4a4b-a846-7b21bf4e2e5b' + \ '&host=www.microsoft.com' + \ '&segments=software-download,windows10ISO' + \ '&query=&action=GetProductDownloadLinksBySku' + \ '&sessionId={}'.format(sessionID) + \ '&skuId={}'.format(skuId) + \ '&language={}'.format(skuName) + \ '&sdVersion=2' # Request downloads resp = s.post(url) assert resp.status_code == 200 html = BeautifulSoup(resp.text, features='html.parser') # Parse downloads downloads = html.find_all('a', {'class': 'button-flat'}) # This weird contraption is the Python equivalent of Nix's `!args.x86 -> 'IsoX64' in d.text` and `head` download = filter(lambda d: args.x86 or 'IsoX64' in d.text, downloads).__next__() print(download['href'])
# -*- coding: utf-8 -*- """ Not compatible with Python 3 Created on Fri Dec 4 18:11:16 2015 @author: Sravani Kamisetty """ from pandas import Series, DataFrame from sklearn import tree import pandas as pd import numpy as np import nltk import re from nltk.stem import WordNetLemmatizer from sklearn.svm import LinearSVC from sklearn.metrics import classification_report import sklearn.metrics from sklearn.feature_extraction.text import TfidfVectorizer from sklearn import grid_search from sklearn.linear_model import LogisticRegression def computeAccuracy(Y,YPredicted): count = 0 for i in range(0,len(Y)): if Y[i] == YPredicted[i]: count = count + 1 return (count/len(Y) * 100) # A combination of Word lemmatization + LinearSVC model finally pushes the accuracy score past 80% traindf = pd.read_json("resources/train.json") traindf['ingredients_clean_string'] = [' , '.join(z).strip() for z in traindf['ingredients']] traindf['ingredients_string'] = [' '.join([WordNetLemmatizer().lemmatize(re.sub('[^A-Za-z]', ' ', line)) for line in lists]).strip() for lists in traindf['ingredients']] testdf = pd.read_json("resources/test.json") testdf['ingredients_clean_string'] = [' , '.join(z).strip() for z in testdf['ingredients']] testdf['ingredients_string'] = [' '.join([WordNetLemmatizer().lemmatize(re.sub('[^A-Za-z]', ' ', line)) for line in lists]).strip() for lists in testdf['ingredients']] corpustr = traindf['ingredients_string'] vectorizertr = TfidfVectorizer(stop_words='english', ngram_range = ( 1 , 1 ),analyzer="word", max_df = .57 , binary=False , token_pattern=r'\w+' , sublinear_tf=False) tfidftr=vectorizertr.fit_transform(corpustr).todense() corpusts = testdf['ingredients_string'] vectorizerts = TfidfVectorizer(stop_words='english') tfidfts=vectorizertr.transform(corpusts) predictors_tr = tfidftr targets_tr = traindf['cuisine'] predictors_ts = tfidfts # LR, SCV classifier = LinearSVC(C=0.80, penalty="l2", dual=False) parameters = {'C':[1, 10]} clf = LinearSVC() clf = LogisticRegression() classifier = grid_search.GridSearchCV(clf, parameters) classifier=classifier.fit(predictors_tr,targets_tr) #decision trees #clf = tree.DecisionTreeClassifier() #parameters = {'max_depth':[100]} #classifier=clf.fit(predictors_tr,targets_tr) predictions_train = classifier.predict(predictors_tr) predictions=classifier.predict(predictors_ts) for i in range(0,predictions.size): predictions[i] = str(predictions[i]) for i in range(0,predictions_train.size): predictions_train[i] = str(predictions_train[i]) #print predictions_train testdf['cuisine'] = predictions testdf = testdf.sort('id' , ascending=True) #print computeAccuracy(predictors_tr,predictions_train) #print predictions_train #print computeAccuracy(predictions,targets_ts) #print testdf testdf[['id' , 'cuisine' ]].to_csv("subTree.csv");
# Rainbow Mode from base_classes import * from datetime import datetime, timedelta import time class RainbowMode(Mode): key = "RAINBOW" pos = 0.0 refTime = datetime.now() def __init__(self, variant, speed, _range): self.speed = speed self.range = _range self.variant = variant def args(self): return str(self.variant) + "," + str(self.speed) + "," + str(self.range) def copy(self): return RainbowMode(self.variant, self.speed, self.range) def loop(self, _leds): refTime = RainbowMode.refTime currentTime = datetime.now() pos = RainbowMode.pos RainbowMode.pos += float((currentTime - refTime).total_seconds() * (self.speed / ((1 + self.range) / 2))) RainbowMode.refTime = currentTime for led in _leds: if self.variant == 0: led.c = self.wheel(int(pos / self.range) & 255) elif self.variant == 1: led.c = self.wheel(int(int(led.continent.index * 256 / len(continents) / self.range) + pos) & 255) elif self.variant == 2: led.c = self.wheel(int(int(led.pos * 256 / len(_leds) / self.range) + pos) & 255) elif self.variant == 3: led.c = self.wheel(int(int(led.long * 256 / 360 / self.range) + pos) & 255) elif self.variant == 4: led.c = self.wheel(int(int(led.lat * 256 / 180 / self.range) + pos) & 255) elif self.variant == 5: led.c = self.wheel(int(int(dist(led, 0, 0) * 256 / 180 / self.range) - pos) & 255) led.load() #def transition(self, variant): # if variant == 0: def wheel(self, pos): if pos < 85: return C.fromRGB(255 - pos * 3, pos * 3, 0) elif pos < 170: pos -= 85 return C.fromRGB(0, 255 - pos * 3, pos * 3) else: pos -= 170 return C.fromRGB(pos * 3, 0, 255 - pos * 3)
from __future__ import print_function import sys import numpy as np import time from io_shared import NumpyShare def main(): N = 150000 cloud = np.empty((N, 4), dtype=np.float32) size = cloud.nbytes cloud_share = NumpyShare('/py27_to_py37', '5M', 'put') label_share = NumpyShare('/py37_to_py27', '5M', 'get') start = time.time() for i in range(100): cloud_share.put(cloud) label = label_share.get() assert (cloud == label).all() end = time.time() print(end - start) if __name__ == '__main__': main()
import numpy as np # Reward matrix R = np.matrix([ [-1,-1,-1,-1,0,-1], [-1,-1,-1,0,-1,100], [-1,-1,-1,0,-1,-1], [-1,0,0,-1,0,-1], [-1,0,0,-1,-1,100], [-1,0,-1,-1,0,100] ]) # Quality matrix Q = np.matrix(np.zeros([6,6])) gamma = 0.8 # --------------------------------------------------------------------------------- def get_next_action(state): current_state_row = R[state,] av_act = np.where(current_state_row >= 0)[1] next_action = int(np.random.choice(av_act,1)) return next_action def update(current_state, action, gamma): max_index = np.where(Q[action,] == np.max(Q[action,]))[1] if max_index.shape[0] > 1: max_index = int(np.random.choice(max_index, size = 1)) else: max_index = int(max_index) max_value = Q[action, max_index] # Q learning formula Q[current_state, action] = R[current_state, action] + gamma * max_value # -------------------------------------------------------------------------------- for i in range(10000): current_state = np.random.randint(0, int(Q.shape[0])) action = get_next_action(current_state) update(current_state,action,gamma) # Normalize the "trained" Q matrix print("Trained Q matrix:") print(Q/np.max(Q)*100) # -------------------------------------------------------------------------------- current_state = 2 # steps = [current_state] while current_state != 5: next_step_index = np.where(Q[current_state,] == np.max(Q[current_state,]))[1] #büyük olanı seçiyor if next_step_index.shape[0] > 1: next_step_index = int(np.random.choice(next_step_index, size = 1)) #en büyük değerden iki tane varsa rasgele seciyor else: next_step_index = int(next_step_index) steps.append(next_step_index) #seçilen state i list e yazıyr current_state = next_step_index # Print selected sequence of steps print("Selected path:") print(steps)
def lin_test(name, tags=[]): native.cc_test( name = name, srcs = native.glob([name + "/*.cpp"]), deps = [ "@gtest//:gtest_main", "//:lin" ], tags = tags, visibility = ["//visibility:private"], )
# Xlib.xobject.drawable -- drawable objects (window and pixmap) # # Copyright (C) 2000 Peter Liljenberg <[email protected]> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., # 59 Temple Place, # Suite 330, # Boston, MA 02111-1307 USA from Xlib import X, Xatom, Xutil from Xlib.protocol import request, rq # Other X resource objects from . import resource from . import colormap from . import cursor from . import fontable # Inter-client communication conventions from . import icccm class Drawable(resource.Resource): __drawable__ = resource.Resource.__resource__ def get_geometry(self): return request.GetGeometry(display = self.display, drawable = self) def create_pixmap(self, width, height, depth): pid = self.display.allocate_resource_id() request.CreatePixmap(display = self.display, depth = depth, pid = pid, drawable = self.id, width = width, height = height) cls = self.display.get_resource_class('pixmap', Pixmap) return cls(self.display, pid, owner = 1) def create_gc(self, **keys): cid = self.display.allocate_resource_id() request.CreateGC(display = self.display, cid = cid, drawable = self.id, attrs = keys) cls = self.display.get_resource_class('gc', fontable.GC) return cls(self.display, cid, owner = 1) def copy_area(self, gc, src_drawable, src_x, src_y, width, height, dst_x, dst_y, onerror = None): request.CopyArea(display = self.display, onerror = onerror, src_drawable = src_drawable, dst_drawable = self.id, gc = gc, src_x = src_x, src_y = src_y, dst_x = dst_x, dst_y = dst_y, width = width, height = height) def copy_plane(self, gc, src_drawable, src_x, src_y, width, height, dst_x, dst_y, bit_plane, onerror = None): request.CopyPlane(display = self.display, onerror = onerror, src_drawable = src_drawable, dst_drawable = self.id, gc = gc, src_x = src_x, src_y = src_y, dst_x = dst_x, dst_y = dst_y, width = width, height = height, bit_plane = bit_plane) def poly_point(self, gc, coord_mode, points, onerror = None): request.PolyPoint(display = self.display, onerror = onerror, coord_mode = coord_mode, drawable = self.id, gc = gc, points = points) def point(self, gc, x, y, onerror = None): request.PolyPoint(display = self.display, onerror = onerror, coord_mode = X.CoordModeOrigin, drawable = self.id, gc = gc, points = [(x, y)]) def poly_line(self, gc, coord_mode, points, onerror = None): request.PolyLine(display = self.display, onerror = onerror, coord_mode = coord_mode, drawable = self.id, gc = gc, points = points) def line(self, gc, x1, y1, x2, y2, onerror = None): request.PolySegment(display = self.display, onerror = onerror, drawable = self.id, gc = gc, segments = [(x1, y1, x2, y2)]) def poly_segment(self, gc, segments, onerror = None): request.PolySegment(display = self.display, onerror = onerror, drawable = self.id, gc = gc, segments = segments) def poly_rectangle(self, gc, rectangles, onerror = None): request.PolyRectangle(display = self.display, onerror = onerror, drawable = self.id, gc = gc, rectangles = rectangles) def rectangle(self, gc, x, y, width, height, onerror = None): request.PolyRectangle(display = self.display, onerror = onerror, drawable = self.id, gc = gc, rectangles = [(x, y, width, height)]) def poly_arc(self, gc, arcs, onerror = None): request.PolyArc(display = self.display, onerror = onerror, drawable = self.id, gc = gc, arcs = arcs) def arc(self, gc, x, y, width, height, angle1, angle2, onerror = None): request.PolyArc(display = self.display, onerror = onerror, drawable = self.id, gc = gc, arcs = [(x, y, width, height, angle1, angle2)]) def fill_poly(self, gc, shape, coord_mode, points, onerror = None): request.FillPoly(display = self.display, onerror = onerror, shape = shape, coord_mode = coord_mode, drawable = self.id, gc = gc, points = points) def poly_fill_rectangle(self, gc, rectangles, onerror = None): request.PolyFillRectangle(display = self.display, onerror = onerror, drawable = self.id, gc = gc, rectangles = rectangles) def fill_rectangle(self, gc, x, y, width, height, onerror = None): request.PolyFillRectangle(display = self.display, onerror = onerror, drawable = self.id, gc = gc, rectangles = [(x, y, width, height)]) def poly_fill_arc(self, gc, arcs, onerror = None): request.PolyFillArc(display = self.display, onerror = onerror, drawable = self.id, gc = gc, arcs = arcs) def fill_arc(self, gc, x, y, width, height, angle1, angle2, onerror = None): request.PolyFillArc(display = self.display, onerror = onerror, drawable = self.id, gc = gc, arcs = [(x, y, width, height, angle1, angle2)]) def put_image(self, gc, x, y, width, height, format, depth, left_pad, data, onerror = None): request.PutImage(display = self.display, onerror = onerror, format = format, drawable = self.id, gc = gc, width = width, height = height, dst_x = x, dst_y = y, left_pad = left_pad, depth = depth, data = data) # Trivial little method for putting PIL images. Will break on anything # but depth 1 or 24... def put_pil_image(self, gc, x, y, image, onerror = None): width, height = image.size if image.mode == '1': format = X.XYBitmap depth = 1 if self.display.info.bitmap_format_bit_order == 0: rawmode = '1;R' else: rawmode = '1' pad = self.display.info.bitmap_format_scanline_pad stride = roundup(width, pad) >> 3 elif image.mode == 'RGB': format = X.ZPixmap depth = 24 if self.display.info.image_byte_order == 0: rawmode = 'BGRX' else: rawmode = 'RGBX' pad = self.display.info.bitmap_format_scanline_pad unit = self.display.info.bitmap_format_scanline_unit stride = roundup(width * unit, pad) >> 3 else: raise ValueError('Unknown data format') maxlen = (self.display.info.max_request_length << 2) \ - request.PutImage._request.static_size split = maxlen // stride x1 = 0 x2 = width y1 = 0 while y1 < height: h = min(height, split) if h < height: subimage = image.crop((x1, y1, x2, y1 + h)) else: subimage = image w, h = subimage.size data = subimage.tostring("raw", rawmode, stride, 0) self.put_image(gc, x, y, w, h, format, depth, 0, data) y1 = y1 + h y = y + h def get_image(self, x, y, width, height, format, plane_mask): return request.GetImage(display = self.display, format = format, drawable = self.id, x = x, y = y, width = width, height = height, plane_mask = plane_mask) def draw_text(self, gc, x, y, text, onerror = None): request.PolyText8(display = self.display, onerror = onerror, drawable = self.id, gc = gc, x = x, y = y, items = [text]) def poly_text(self, gc, x, y, items, onerror = None): request.PolyText8(display = self.display, onerror = onerror, drawable = self.id, gc = gc, x = x, y = y, items = items) def poly_text_16(self, gc, x, y, items, onerror = None): request.PolyText16(display = self.display, onerror = onerror, drawable = self.id, gc = gc, x = x, y = y, items = items) def image_text(self, gc, x, y, string, onerror = None): request.ImageText8(display = self.display, onerror = onerror, drawable = self.id, gc = gc, x = x, y = y, string = string) def image_text_16(self, gc, x, y, string, onerror = None): request.ImageText16(display = self.display, onerror = onerror, drawable = self.id, gc = gc, x = x, y = y, string = string) def query_best_size(self, item_class, width, height): return request.QueryBestSize(display = self.display, item_class = item_class, drawable = self.id, width = width, height = height) class Window(Drawable): __window__ = resource.Resource.__resource__ _STRING_ENCODING = 'ISO-8859-1' _UTF8_STRING_ENCODING = 'UTF-8' def create_window(self, x, y, width, height, border_width, depth, window_class = X.CopyFromParent, visual = X.CopyFromParent, onerror = None, **keys): wid = self.display.allocate_resource_id() request.CreateWindow(display = self.display, onerror = onerror, depth = depth, wid = wid, parent = self.id, x = x, y = y, width = width, height = height, border_width = border_width, window_class = window_class, visual = visual, attrs = keys) cls = self.display.get_resource_class('window', Window) return cls(self.display, wid, owner = 1) def change_attributes(self, onerror = None, **keys): request.ChangeWindowAttributes(display = self.display, onerror = onerror, window = self.id, attrs = keys) def get_attributes(self): return request.GetWindowAttributes(display = self.display, window = self.id) def destroy(self, onerror = None): request.DestroyWindow(display = self.display, onerror = onerror, window = self.id) self.display.free_resource_id(self.id) def destroy_sub_windows(self, onerror = None): request.DestroySubWindows(display = self.display, onerror = onerror, window = self.id) def change_save_set(self, mode, onerror = None): request.ChangeSaveSet(display = self.display, onerror = onerror, mode = mode, window = self.id) def reparent(self, parent, x, y, onerror = None): request.ReparentWindow(display = self.display, onerror = onerror, window = self.id, parent = parent, x = x, y = y) def map(self, onerror = None): request.MapWindow(display = self.display, onerror = onerror, window = self.id) def map_sub_windows(self, onerror = None): request.MapSubwindows(display = self.display, onerror = onerror, window = self.id) def unmap(self, onerror = None): request.UnmapWindow(display = self.display, onerror = onerror, window = self.id) def unmap_sub_windows(self, onerror = None): request.UnmapSubwindows(display = self.display, onerror = onerror, window = self.id) def configure(self, onerror = None, **keys): request.ConfigureWindow(display = self.display, onerror = onerror, window = self.id, attrs = keys) def circulate(self, direction, onerror = None): request.CirculateWindow(display = self.display, onerror = onerror, direction = direction, window = self.id) def raise_window(self, onerror = None): """alias for raising the window to the top - as in XRaiseWindow""" self.configure(onerror, stack_mode = X.Above) def query_tree(self): return request.QueryTree(display = self.display, window = self.id) def change_property(self, property, property_type, format, data, mode = X.PropModeReplace, onerror = None): request.ChangeProperty(display = self.display, onerror = onerror, mode = mode, window = self.id, property = property, type = property_type, data = (format, data)) def change_text_property(self, property, property_type, data, mode = X.PropModeReplace, onerror = None): if not isinstance(data, bytes): if property_type == Xatom.STRING: data = data.encode(self._STRING_ENCODING) elif property_type == self.display.get_atom('UTF8_STRING'): data = data.encode(self._UTF8_STRING_ENCODING) self.change_property(property, property_type, 8, data, mode=mode, onerror=onerror) def delete_property(self, property, onerror = None): request.DeleteProperty(display = self.display, onerror = onerror, window = self.id, property = property) def get_property(self, property, property_type, offset, length, delete = 0): r = request.GetProperty(display = self.display, delete = delete, window = self.id, property = property, type = property_type, long_offset = offset, long_length = length) if r.property_type: fmt, value = r.value r.format = fmt r.value = value return r else: return None def get_full_property(self, property, property_type, sizehint = 10): prop = self.get_property(property, property_type, 0, sizehint) if prop: val = prop.value if prop.bytes_after: prop = self.get_property(property, property_type, sizehint, prop.bytes_after // 4 + 1) val = val + prop.value prop.value = val return prop else: return None def get_full_text_property(self, property, property_type=X.AnyPropertyType, sizehint = 10): prop = self.get_full_property(property, property_type, sizehint=sizehint) if prop is None or prop.format != 8: return None if prop.property_type == Xatom.STRING: prop.value = prop.value.decode(self._STRING_ENCODING) elif prop.property_type == self.display.get_atom('UTF8_STRING'): prop.value = prop.value.decode(self._UTF8_STRING_ENCODING) # FIXME: at least basic support for compound text would be nice. # elif prop.property_type == self.display.get_atom('COMPOUND_TEXT'): return prop.value def list_properties(self): r = request.ListProperties(display = self.display, window = self.id) return r.atoms def set_selection_owner(self, selection, time, onerror = None): request.SetSelectionOwner(display = self.display, onerror = onerror, window = self.id, selection = selection, time = time) def convert_selection(self, selection, target, property, time, onerror = None): request.ConvertSelection(display = self.display, onerror = onerror, requestor = self.id, selection = selection, target = target, property = property, time = time) def send_event(self, event, event_mask = 0, propagate = 0, onerror = None): request.SendEvent(display = self.display, onerror = onerror, propagate = propagate, destination = self.id, event_mask = event_mask, event = event) def grab_pointer(self, owner_events, event_mask, pointer_mode, keyboard_mode, confine_to, cursor, time): r = request.GrabPointer(display = self.display, owner_events = owner_events, grab_window = self.id, event_mask = event_mask, pointer_mode = pointer_mode, keyboard_mode = keyboard_mode, confine_to = confine_to, cursor = cursor, time = time) return r.status def grab_button(self, button, modifiers, owner_events, event_mask, pointer_mode, keyboard_mode, confine_to, cursor, onerror = None): request.GrabButton(display = self.display, onerror = onerror, owner_events = owner_events, grab_window = self.id, event_mask = event_mask, pointer_mode = pointer_mode, keyboard_mode = keyboard_mode, confine_to = confine_to, cursor = cursor, button = button, modifiers = modifiers) def ungrab_button(self, button, modifiers, onerror = None): request.UngrabButton(display = self.display, onerror = onerror, button = button, grab_window = self.id, modifiers = modifiers) def grab_keyboard(self, owner_events, pointer_mode, keyboard_mode, time): r = request.GrabKeyboard(display = self.display, owner_events = owner_events, grab_window = self.id, time = time, pointer_mode = pointer_mode, keyboard_mode = keyboard_mode) return r.status def grab_key(self, key, modifiers, owner_events, pointer_mode, keyboard_mode, onerror = None): request.GrabKey(display = self.display, onerror = onerror, owner_events = owner_events, grab_window = self.id, modifiers = modifiers, key = key, pointer_mode = pointer_mode, keyboard_mode = keyboard_mode) def ungrab_key(self, key, modifiers, onerror = None): request.UngrabKey(display = self.display, onerror = onerror, key = key, grab_window = self.id, modifiers = modifiers) def query_pointer(self): return request.QueryPointer(display = self.display, window = self.id) def get_motion_events(self, start, stop): r = request.GetMotionEvents(display = self.display, window = self.id, start = start, stop = stop) return r.events def translate_coords(self, src_window, src_x, src_y): return request.TranslateCoords(display = self.display, src_wid = src_window, dst_wid = self.id, src_x = src_x, src_y = src_y) def warp_pointer(self, x, y, src_window = 0, src_x = 0, src_y = 0, src_width = 0, src_height = 0, onerror = None): request.WarpPointer(display = self.display, onerror = onerror, src_window = src_window, dst_window = self.id, src_x = src_x, src_y = src_y, src_width = src_width, src_height = src_height, dst_x = x, dst_y = y) def set_input_focus(self, revert_to, time, onerror = None): request.SetInputFocus(display = self.display, onerror = onerror, revert_to = revert_to, focus = self.id, time = time) def clear_area(self, x = 0, y = 0, width = 0, height = 0, exposures = 0, onerror = None): request.ClearArea(display = self.display, onerror = onerror, exposures = exposures, window = self.id, x = x, y = y, width = width, height = height) def create_colormap(self, visual, alloc): mid = self.display.allocate_resource_id() request.CreateColormap(display = self.display, alloc = alloc, mid = mid, window = self.id, visual = visual) cls = self.display.get_resource_class('colormap', colormap.Colormap) return cls(self.display, mid, owner = 1) def list_installed_colormaps(self): r = request.ListInstalledColormaps(display = self.display, window = self.id) return r.cmaps def rotate_properties(self, properties, delta, onerror = None): request.RotateProperties(display = self.display, onerror = onerror, window = self.id, delta = delta, properties = properties) def set_wm_name(self, name, onerror = None): self.change_text_property(Xatom.WM_NAME, Xatom.STRING, name, onerror = onerror) def get_wm_name(self): return self.get_full_text_property(Xatom.WM_NAME, Xatom.STRING) def set_wm_icon_name(self, name, onerror = None): self.change_text_property(Xatom.WM_ICON_NAME, Xatom.STRING, name, onerror = onerror) def get_wm_icon_name(self): return self.get_full_text_property(Xatom.WM_ICON_NAME, Xatom.STRING) def set_wm_class(self, inst, cls, onerror = None): self.change_text_property(Xatom.WM_CLASS, Xatom.STRING, '%s\0%s\0' % (inst, cls), onerror = onerror) def get_wm_class(self): value = self.get_full_text_property(Xatom.WM_CLASS, Xatom.STRING) if value is None: return None parts = value.split('\0') if len(parts) < 2: return None else: return parts[0], parts[1] def set_wm_transient_for(self, window, onerror = None): self.change_property(Xatom.WM_TRANSIENT_FOR, Xatom.WINDOW, 32, [window.id], onerror = onerror) def get_wm_transient_for(self): d = self.get_property(Xatom.WM_TRANSIENT_FOR, Xatom.WINDOW, 0, 1) if d is None or d.format != 32 or len(d.value) < 1: return None else: cls = self.display.get_resource_class('window', Window) return cls(self.display, d.value[0]) def set_wm_protocols(self, protocols, onerror = None): self.change_property(self.display.get_atom('WM_PROTOCOLS'), Xatom.ATOM, 32, protocols, onerror = onerror) def get_wm_protocols(self): d = self.get_full_property(self.display.get_atom('WM_PROTOCOLS'), Xatom.ATOM) if d is None or d.format != 32: return [] else: return d.value def set_wm_colormap_windows(self, windows, onerror = None): self.change_property(self.display.get_atom('WM_COLORMAP_WINDOWS'), Xatom.WINDOW, 32, map(lambda w: w.id, windows), onerror = onerror) def get_wm_colormap_windows(self): d = self.get_full_property(self.display.get_atom('WM_COLORMAP_WINDOWS'), Xatom.WINDOW) if d is None or d.format != 32: return [] else: cls = self.display.get_resource_class('window', Window) return map(lambda i, d = self.display, c = cls: c(d, i), d.value) def set_wm_client_machine(self, name, onerror = None): self.change_text_property(Xatom.WM_CLIENT_MACHINE, Xatom.STRING, name, onerror = onerror) def get_wm_client_machine(self): return self.get_full_text_property(Xatom.WM_CLIENT_MACHINE, Xatom.STRING) def set_wm_normal_hints(self, hints = {}, onerror = None, **keys): self._set_struct_prop(Xatom.WM_NORMAL_HINTS, Xatom.WM_SIZE_HINTS, icccm.WMNormalHints, hints, keys, onerror) def get_wm_normal_hints(self): return self._get_struct_prop(Xatom.WM_NORMAL_HINTS, Xatom.WM_SIZE_HINTS, icccm.WMNormalHints) def set_wm_hints(self, hints = {}, onerror = None, **keys): self._set_struct_prop(Xatom.WM_HINTS, Xatom.WM_HINTS, icccm.WMHints, hints, keys, onerror) def get_wm_hints(self): return self._get_struct_prop(Xatom.WM_HINTS, Xatom.WM_HINTS, icccm.WMHints) def set_wm_state(self, hints = {}, onerror = None, **keys): atom = self.display.get_atom('WM_STATE') self._set_struct_prop(atom, atom, icccm.WMState, hints, keys, onerror) def get_wm_state(self): atom = self.display.get_atom('WM_STATE') return self._get_struct_prop(atom, atom, icccm.WMState) def set_wm_icon_size(self, hints = {}, onerror = None, **keys): self._set_struct_prop(Xatom.WM_ICON_SIZE, Xatom.WM_ICON_SIZE, icccm.WMIconSize, hints, keys, onerror) def get_wm_icon_size(self): return self._get_struct_prop(Xatom.WM_ICON_SIZE, Xatom.WM_ICON_SIZE, icccm.WMIconSize) # Helper function for getting structured properties. # pname and ptype are atoms, and pstruct is a Struct object. # Returns a DictWrapper, or None def _get_struct_prop(self, pname, ptype, pstruct): r = self.get_property(pname, ptype, 0, pstruct.static_size // 4) if r and r.format == 32: value = r.value.tostring() if len(value) == pstruct.static_size: return pstruct.parse_binary(value, self.display)[0] return None # Helper function for setting structured properties. # pname and ptype are atoms, and pstruct is a Struct object. # hints is a mapping or a DictWrapper, keys is a mapping. keys # will be modified. onerror is the error handler. def _set_struct_prop(self, pname, ptype, pstruct, hints, keys, onerror): if isinstance(hints, rq.DictWrapper): keys.update(hints._data) else: keys.update(hints) value = pstruct.to_binary(*(), **keys) self.change_property(pname, ptype, 32, value, onerror = onerror) class Pixmap(Drawable): __pixmap__ = resource.Resource.__resource__ def free(self, onerror = None): request.FreePixmap(display = self.display, onerror = onerror, pixmap = self.id) self.display.free_resource_id(self.id) def create_cursor(self, mask, foreground, background, x, y): fore_red, fore_green, fore_blue = foreground back_red, back_green, back_blue = background cid = self.display.allocate_resource_id() request.CreateCursor(display = self.display, cid = cid, source = self.id, mask = mask, fore_red = fore_red, fore_green = fore_green, fore_blue = fore_blue, back_red = back_red, back_green = back_green, back_blue = back_blue, x = x, y = y) cls = self.display.get_resource_class('cursor', cursor.Cursor) return cls(self.display, cid, owner = 1) def roundup(value, unit): return (value + (unit - 1)) & ~(unit - 1)
from tkinter import * from PIL import Image,ImageTk from tkinter import ttk from tkinter import messagebox import pymysql class Registration: def __init__(self,root): self.root=root self.root.title('VOTER REGISTRATION') self.root.geometry("1000x563+490+100") self.root.iconphoto(True,PhotoImage(file="icons/logo.png")) self.root.config(bg="white") self.root.resizable(0,0) #=================================================== self.root.bg=ImageTk.PhotoImage(file="image/registration.jpg") bg=Label(root,image=self.root.bg,background="steelblue").place(x=0,y=0,relwidth=1,relheight=1) frame=Frame(self.root,bg="white") frame.place(x=80,y=80,height=400,width=830) self.img=ImageTk.PhotoImage(file="icons/user_img.png") user_img=Label(self.root,image=self.img,bg="light blue").place(x=455,y=10,width=60,height=60) Vid=Label(frame,text="Voter ID :",bg="white",font=("times new roman",12)).grid(row=0,column=0) self.txt_Vid=Entry(frame,font=("times new roman",16),bg="white") self.txt_Vid.grid(row=0,column=1) Name=Label(frame,text="Full Name :",bg="white",font=("times new roman",12)).grid(ipadx=50,pady=30,row=1,column=0) self.txt_Name=Entry(frame,font=("times new roman",11),bg="white") self.txt_Name.grid(row=1,column=1) Email=Label(frame,text="Email Id :",bg="white",font=("times new roman",12)).grid(row=1,column=2) self.txt_Email=Entry(frame,font=("times new roman",11),bg="white") self.txt_Email.grid(row=1,column=3) Pno=Label(frame,text="Phone No :",bg="white",font=("times new roman",12)).grid(ipadx=50,pady=30,row=2,column=0) self.txt_Pno=Entry(frame,font=("times new roman",11),bg="white") self.txt_Pno.grid(row=2,column=1) State=Label(frame,text="Choose State :",font=("times new roman",12),bg="white").grid(row=2,column=2) self.cmb_State=ttk.Combobox(frame,font=("times new roman",9),state='readonly',justify=CENTER) self.cmb_State['values']=("","Bihar","Delhi","Mumbai","Madhya Pradesh","Uttar Pradesh") self.cmb_State.grid(row=2,column=3) self.cmb_State.current(0) Age=Label(frame,text="Age :",bg="white",font=("times new roman",12)).grid(ipadx=50,pady=30,row=3,column=0) self.txt_Age=Entry(frame,font=("times new roman",11),bg="white") self.txt_Age.grid(row=3,column=1) Gender=Label(frame,text="Gender :",font=("times new roman",12),bg="white").grid(row=3,column=2) self.cmb_Gender=ttk.Combobox(frame,font=("times new roman",8),state='readonly',justify=CENTER) self.cmb_Gender['values']=("","MALE","FEMALE","OTHERS") self.cmb_Gender.grid(row=3,column=3) self.cmb_Gender.current(0) Pwd=Label(frame,text="Password :",bg="white",font=("times new roman",12)).grid(row=4,column=0) self.txt_Pwd=Entry(frame,font=("times new roman",11),bg="white") self.txt_Pwd.grid(row=4,column=1) Cpwd=Label(frame,text="Confirm Password :",bg="white",font=("times new roman",12)).grid(row=4,column=2) self.txt_Cpwd=Entry(frame,font=("times new roman",11),bg="white") self.txt_Cpwd.grid(ipadx=50,pady=30,row=4,column=3) #=====================BUTTON=========================================== self.root.btn_img=ImageTk.PhotoImage(file="icons/register.png") btn_img=Button(self.root,image=root.btn_img,bg="steel blue",activebackground="light blue",bd=0,cursor="hand2",command=self.register).place(x=370,y=480,height=45,width=170) def register(self): if self.txt_Vid.get() == "" or self.txt_Name.get()=="" or self.txt_Email.get()=="" or self.txt_Pno.get()=="" or self.txt_Age.get()=="" or self.txt_Pwd.get()=="" or self.txt_Cpwd.get()=="" or self.cmb_State.get()=="" or self.cmb_Gender.get()=="": messagebox.showerror("warning","All fields are required to fill",parent=self.root ) elif self.txt_Pwd.get() != self.txt_Cpwd.get(): messagebox.showerror("warning","password and confirm password should be same",parent=self.root) else: try: conn = pymysql.connect(host="localhost",user="root",password="",database="vote_india") cursor=conn.cursor() cursor.execute("insert into voter_registration(voter_id,name,email,phone_no,state,age,gender,password)values(%s,%s,%s,%s,%s,%s,%s,%s)", ( self.txt_Vid.get(), self.txt_Name.get(), self.txt_Email.get(), self.txt_Pno.get(), self.cmb_State.get(), self.txt_Age.get(), self.cmb_Gender.get(), self.txt_Pwd.get(), )) conn.commit() conn.close() messagebox.showinfo("success","Register successfully",parent=self.root) root.destroy() except Exception as es: messagebox.showerror("error","error handle,{str(es)}",parent=self.root) root=Tk() obj=Registration(root) root.mainloop()
import setuptools from torch.utils.cpp_extension import BuildExtension, CUDAExtension import os cxx_flags = [] ext_libs = [] authors = [ 'Jiaao He', 'Jiezhong Qiu', 'Aohan Zeng', 'Tiago Antunes', 'Jinjun Peng', 'Qin Li', ] if os.environ.get('USE_NCCL', '0') == '1': cxx_flags.append('-DFMOE_USE_NCCL') ext_libs.append('nccl') if __name__ == '__main__': setuptools.setup( name='fastmoe', version='0.2.2', description='An efficient Mixture-of-Experts system for PyTorch', author=', '.join(authors), author_email='[email protected]', license='Apache-2', url='https://github.com/laekov/fastmoe', packages=['fmoe', 'fmoe.megatron', 'fmoe.gates'], ext_modules=[ CUDAExtension( name='fmoe_cuda', sources=[ 'cuda/stream_manager.cpp', 'cuda/bagua_kernels.cu', 'cuda/local_exchange.cu', 'cuda/balancing.cu', 'cuda/global_exchange.cpp', 'cuda/parallel_linear.cu', 'cuda/fmoe_cuda.cpp', ], extra_compile_args={ 'cxx': cxx_flags, 'nvcc': cxx_flags }, libraries=ext_libs ) ], cmdclass={ 'build_ext': BuildExtension })
import torch import torch.nn as nn from typing import Tuple def TheisConv(input=3, out=64, kernel=5, stride=1, activation=True) -> nn.Sequential: if activation: return nn.Sequential( nn.ReflectionPad2d((1, stride, 1, stride)), nn.Conv2d( in_channels=input, out_channels=out, kernel_size=(kernel, kernel), stride=(stride, stride), ), nn.LeakyReLU(), ) else: return nn.Sequential( nn.ReflectionPad2d((1, stride, 1, stride)), nn.Conv2d( in_channels=input, out_channels=out, kernel_size=(kernel, kernel), stride=(stride, stride), ), ) def TheisResidual(first_activation=True, second_activation=False) -> nn.Sequential: return nn.Sequential( TheisConv(kernel=3, input=128, out=128, activation=first_activation), TheisConv(kernel=3, input=128, out=128, activation=second_activation), ) class ClipGradient(torch.autograd.Function): """ Clips the output to [0, 255] and casts it to an integer """ @staticmethod def forward(ctx, input): return torch.clamp(input, 0, 255).round() @staticmethod def backward(ctx, grad_output): return grad_output class TheisRounding(torch.autograd.Function): """ You compute r(x) = [x]. This a transformation from """ @staticmethod def forward(ctx, input): with torch.no_grad(): z = input.round() return z @staticmethod def backward(ctx, grad_output): return grad_output def Subpixel(input=96, out=512, scale=2) -> nn.Sequential: return nn.Sequential( nn.ConvTranspose2d(input, out, 3, stride=1, padding=1), nn.modules.PixelShuffle(scale), )
from ruamel.yaml import YAML import os import pickle import glob import errno import csv import copy import time import logging from .problem import Problem, ProblemException logger = logging.getLogger("contest") class Contest: def __init__(self, path="."): self.path = path self.yaml = YAML() config_file = os.path.join(self.path, "contest.yml") try: with open(config_file, "r") as stream: try: self.config = self.yaml.load(stream) except yaml.YAMLError: raise except FileNotFoundError as e: raise ProblemException("File %s doesn't exist, create `contest.yml` first" % config_file) from e self.dump_file = os.path.join(self.path, "contest.dat") try: with open(self.dump_file, "rb") as stream: self.data = pickle.load(stream) except FileNotFoundError as e: self.data = ContestData() self.mode = self.config.get("mode", "plain") if not self.mode in ("plain", "subfolder"): raise ProblemException("Unsupported contest mode: %s" % self.mode) self.problems = [] for problem_config in self.config["problems"]: problem = ContestProblem(self, problem_config) self.problems.append(problem) try: os.mkdir(os.path.join(self.path, "players")) except OSError as e: if e.errno != errno.EEXIST: raise def scan(self): players = os.listdir(os.path.join(self.path, "players")) for player in players: if not player in self.data.players: logger.info("Found new player %s" % player) self.data.players[player] = ContestPlayer(player) def cleanup(self): players = set(os.listdir(os.path.join(self.path, "players"))) for player in self.data.players: if not player in players: players.pop(player) for name, player in self.data.players.items(): player.cleanup() def judge_all(self, force=False): for player_name in self.data.players: self.judge_player(player_name, force=force) def judge_player(self, player_name, force=False): if not player_name in self.data.players: raise ProblemException("Unknown player %s" % player_name) player = copy.deepcopy(self.data.players[player_name]) for problem in self.problems: if force or not problem.name in player.judge_result: logger.info("Judging problem %s for player %s" % (problem.name, player_name)) if self.mode == "plain": files = glob.glob(os.path.join(self.path, "players", player.name, problem.name + ".*")) elif self.mode == "subfolder": files = glob.glob(os.path.join(self.path, "players", player.name, problem.name, problem.name + ".*")) if len(files) != 0: player.judge_result[problem.name] = problem.problem.judge(files[0]) player.score = sum(result.score for _, result in player.judge_result.items()) player.judge_time = time.time() self.data.players[player_name] = player def save(self): with open(self.dump_file, "wb") as stream: pickle.dump(self.data, stream) def export(self, path): with open(path, "w") as csvfile: writer = csv.writer(csvfile) first_row = ["player"] for problem in self.problems: first_row.append(problem.name) first_row.append("score") writer.writerow(first_row) for _, player in self.data.players.items(): row = [player.name] for problem in self.problems: try: row.append(player.judge_result[problem.name].score) except: row.append(None) row.append(player.score) writer.writerow(row) class ContestProblem: def __init__(self, contest, config): self.contest = contest self.config = config self.name = config["name"] self.path = os.path.join(self.contest.path, config["path"]) self.problem = Problem(self.path) class ContestData: def __init__(self): self.players = {} class ContestPlayer: def __init__(self, name): self.name = name self.judge_result = {} self.judge_time = None self.score = None
import os import six import PIL from tmtoolkit.topicmod import model_io, visualize try: from wordcloud import WordCloud def test_generate_wordclouds_for_topic_words(): py3file = '.py3' if six.PY3 else '' data = model_io.load_ldamodel_from_pickle('tests/data/tiny_model_reuters_5_topics%s.pickle' % py3file) model = data['model'] vocab = data['vocab'] phi = model.topic_word_ assert phi.shape == (5, len(vocab)) topic_word_clouds = visualize.generate_wordclouds_for_topic_words(phi, vocab, 10) assert len(topic_word_clouds) == 5 assert set(topic_word_clouds.keys()) == set('topic_%d' % i for i in range(1, 6)) assert all(isinstance(wc, PIL.Image.Image) for wc in topic_word_clouds.values()) topic_word_clouds = visualize.generate_wordclouds_for_topic_words(phi, vocab, 10, which_topics=('topic_1', 'topic_2'), return_images=False, width=640, height=480) assert set(topic_word_clouds.keys()) == {'topic_1', 'topic_2'} assert all(isinstance(wc, WordCloud) for wc in topic_word_clouds.values()) assert all(wc.width == 640 and wc.height == 480 for wc in topic_word_clouds.values()) def test_generate_wordclouds_for_document_topics(): py3file = '.py3' if six.PY3 else '' data = model_io.load_ldamodel_from_pickle('tests/data/tiny_model_reuters_5_topics%s.pickle' % py3file) model = data['model'] doc_labels = data['doc_labels'] theta = model.doc_topic_ assert theta.shape == (len(doc_labels), 5) doc_topic_clouds = visualize.generate_wordclouds_for_document_topics(theta, doc_labels, 3) assert len(doc_topic_clouds) == len(doc_labels) assert set(doc_topic_clouds.keys()) == set(doc_labels) assert all(isinstance(wc, PIL.Image.Image) for wc in doc_topic_clouds.values()) which_docs = doc_labels[:2] assert len(which_docs) == 2 doc_topic_clouds = visualize.generate_wordclouds_for_document_topics(theta, doc_labels, 3, which_documents=which_docs, return_images=False, width=640, height=480) assert set(doc_topic_clouds.keys()) == set(which_docs) assert all(isinstance(wc, WordCloud) for wc in doc_topic_clouds.values()) assert all(wc.width == 640 and wc.height == 480 for wc in doc_topic_clouds.values()) def test_write_wordclouds_to_folder(tmpdir): path = tmpdir.mkdir('wordclouds').dirname py3file = '.py3' if six.PY3 else '' data = model_io.load_ldamodel_from_pickle('tests/data/tiny_model_reuters_5_topics%s.pickle' % py3file) model = data['model'] vocab = data['vocab'] phi = model.topic_word_ assert phi.shape == (5, len(vocab)) topic_word_clouds = visualize.generate_wordclouds_for_topic_words(phi, vocab, 10) visualize.write_wordclouds_to_folder(topic_word_clouds, path, 'cloud_{label}.png') for label in topic_word_clouds.keys(): assert os.path.exists(os.path.join(path, 'cloud_{label}.png'.format(label=label))) except: # wordcloud module not found pass
# ***************************************************************************** # ***************************************************************************** # # Name: ellipse.py # Purpose: Ellipse Algorithm test. Manipulated circle :) # Created: 8th March 2020 # Author: Paul Robson ([email protected]) # # ***************************************************************************** # ***************************************************************************** import random # ***************************************************************************** # # A simple display class # # ***************************************************************************** class Display(object): def __init__(self,width=48,height=32): self.width = width self.height = height self.display = [] for i in range(0,self.height): self.display.append(["."] * self.width) # def plot(self,x,y,c): self.display[y][x] = c[0] # def show(self): s = "\n".join(["".join(self.display[x]) for x in range(0,self.height)]) print(s) # def draw(self,radius,c = "*"): f = 1 - radius ddfX = 0 ddfY = -2 * radius x = 0 y = radius self.qplot(x,y) while x < y: if f >= 0: y = y - 1 ddfY += 2 f += ddfY x += 1 ddfX += 2 f += ddfX + 1 self.qplot(x,y) def qplot(self,x,y): self.plot(int(self.width/2)+x,int(self.height/2)+y,"*") self.plot(int(self.width/2)+y,int(self.height/2)+x,"*") self.plot(int(self.width/2)+x,int(self.height/2)-y,"*") self.plot(int(self.width/2)+y,int(self.height/2)-x,"*") self.plot(int(self.width/2)-x,int(self.height/2)+y,"*") self.plot(int(self.width/2)-y,int(self.height/2)+x,"*") self.plot(int(self.width/2)-x,int(self.height/2)-y,"*") self.plot(int(self.width/2)-y,int(self.height/2)-x,"*") d = Display() d.draw(14) d.show()
# author: Max Carter # date: 25/11/18 # Sends the top posts from /r/ProgrammerHumor to a discord channel. #import modules from discord import * from discord.ext.commands import Bot from discord.ext import commands import asyncio import time import praw #setting up reddit account reddit = praw.Reddit(client_id = "", client_secret = "", username = "", password = "", user_agent = "") #setting up subreddit subreddit = reddit.subreddit("ProgrammerHumor") posted_memes = [] #setting up the bot on discord bot = commands.Bot(command_prefix = "!") #when the bot starts @bot.event async def on_ready(): print("bot ready") #when a meme is requested @bot.command(pass_context=True) async def meme(message): posts = subreddit.hot(limit=100) for submission in posts: if not submission.stickied and not submission in posted_memes: await bot.say(submission.url) await bot.say(submission.title) posted_memes.append(submission) return #running bot on discord bot.run("")
# -*- coding: utf-8 -*- from utils import strip_html, simplify_html from cleaners import default_cleaner __all__ = ['strip_html', 'simplify_html', 'default_cleaner']
# Copyright 2021 Mario Guzzi # # 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. # ''' Created on Oct. 22, 2021 @author: Mario Guzzi ''' ''' Flight network classes ''' class Node: def isStart(self): return isinstance(self.obj,Start) def isSegment(self): return isinstance(self.obj,Segment) def isDayItem(self): return isinstance(self.obj,DayItem) def __init__(self, obj ): if ( isinstance(obj,Segment)): self.task_id = obj.task_id self.lab = obj.lab self.obj = obj elif ( isinstance(obj,Start)): self.task_id = obj.task_id self.lab = obj.lab self.obj = obj elif ( isinstance(obj,DayItem)): self.task_id = obj.task_id self.lab = obj.lab self.obj = obj else: raise Exception("Error on type. Got %s" % (type(obj))) ''' Trip Start ''' class Start: def __init__(self, task_id, lab): self.task_id = task_id self.lab = lab ''' Flight Segment ''' class Segment: def getUarrtime(self): return ((self.getUdeptime() + self.ft)) def getUdeptime(self): return ((self.depday - 1) * 1440 + self.deptime) def setT(self, T): self.T = T self.UT1 = self.getUdeptime() self.UT2 = T - ( self.getUdeptime() + self.ft) def getUT(self): return( self.T - self.ft) def getUT1(self): return( self.UT1) def getUT2(self): return( self.UT2) def setCI(self,ci): self.ci = ci def setCO(self,co): self.co = co def getCI(self): return self.ci def getCO(self): return self.co def __init__(self, task_id, lab, dep, arr, deptime, arrtime, depday, arrday, HomeBases): self.task_id = task_id self.lab = lab self.dep = dep self.arr = arr self.deptime = deptime self.arrtime = arrtime self.depday = depday self.arrday = arrday self.ft = (arrday-1) * 1440 + arrtime - ( (depday-1) * 1440 + deptime ) self.UT1 = 0 self.UT2 = 0 self.T = 0 self.ci = 0 self.co = 0 # NOTE: Base handling is being reworked. In the latest design # we are not implementing this in each segment. Work in progress. # NOTE2: The concept of Base Weight is also being revised self.DepBaseWgt = 0 self.ArrBaseWgt = 0 if ( self.dep in HomeBases): self.DepBaseWgt = HomeBases[dep] if ( self.arr in HomeBases): self.ArrBaseWgt = HomeBases[arr] ''' Day Activity Item - (for solving assignment problems - TBD) ''' class DayItem: def __init__(self, task_id, day): self.task_id = task_id # self.lab = "DO-" + str(day) # self.t1 = 0 # Start of day self.t2 = 1439 # End of day self.date = day return
""" Athena SQL table definitions. NOTE: make sure that any changes here are reflected in the parquet schemas defined in parquet_variants.py and parquet_anno.py. """ def create_table_sql(table_type, table_name=None): """ Generates SQL DDL to create a variants table with the given name. Returns a query which has a single named parameter, 'location', which should refer to the s3 location of the table data. """ # The table name is usually the same as its type, but this lets us # easily create new tables of a given type for development if not table_name: table_name = table_type if "`" in table_name: raise RuntimeError(f"Table name {table_name} may not contain backquotes") try: return { "variants": f""" CREATE EXTERNAL TABLE IF NOT EXISTS `{table_name}` ( `chrom` STRING, `spans` ARRAY<BIGINT>, `reflen` BIGINT, `pos` BIGINT, `varend` BIGINT, `varid` STRING, `ref` STRING, `alt` STRING, `qual` FLOAT, `filt` STRING, `info` MAP<STRING, STRING>, `sample` MAP<STRING, STRING> ) PARTITIONED BY ( `sample_name` STRING, `build` STRING, `aid` STRING ) STORED AS PARQUET LOCATION %(location)s ; """, "headers": f""" CREATE EXTERNAL TABLE IF NOT EXISTS `{table_name}` ( `refname` STRING, `refhash` STRING, `header` STRING, `description` STRING, `imported_on` TIMESTAMP, `variant_count` BIGINT, `filename` STRING ) PARTITIONED BY ( `sample_name` STRING, `build` STRING, `aid` STRING ) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION %(location)s ; """, "study_variants": f""" CREATE EXTERNAL TABLE IF NOT EXISTS `{table_name}` ( `chrom` STRING, `spans` ARRAY<BIGINT>, `reflen` BIGINT, `pos` BIGINT, `varend` BIGINT, `varid` STRING, `ref` STRING, `alt` STRING, `qual` FLOAT, `filt` STRING, `info` MAP<STRING, STRING>, `sample` MAP<STRING, STRING> ) PARTITIONED BY ( `study_name` STRING, `checkpoint` BIGINT, `sample_name` STRING, `aid` STRING ) STORED AS PARQUET LOCATION %(location)s ; """, "study_merged": f""" CREATE EXTERNAL TABLE IF NOT EXISTS `{table_name}` ( `chrom` STRING, `spans` ARRAY<BIGINT>, `reflen` BIGINT, `pos` BIGINT, `varend` BIGINT, `varid` STRING, `ref` STRING, `alt` STRING, `qual` FLOAT, `filters` ARRAY<STRING>, `infos` MAP<STRING, STRING>, `samples` MAP<STRING, MAP<STRING, STRING>> ) PARTITIONED BY ( `study_name` STRING, `checkpoint` BIGINT ) STORED AS PARQUET LOCATION %(location)s ; """, "study_meta": f""" CREATE EXTERNAL TABLE IF NOT EXISTS `{table_name}` ( `key` STRING, `value` STRING, `dtype` STRING ) PARTITIONED BY ( `study_name` STRING ) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\\t' ESCAPED BY '\\\\' LINES TERMINATED BY '\\n' LOCATION %(location)s ; """, "anno": f""" CREATE EXTERNAL TABLE IF NOT EXISTS `{table_name}` ( `chrom` STRING, `spans` ARRAY<BIGINT>, `reflen` BIGINT, `pos` BIGINT, `varend` BIGINT, `varid` STRING, `ref` STRING, `alt` STRING, `qual` FLOAT, `filt` STRING, `info` MAP<STRING, STRING>, `source` STRING, `feature` STRING, `score` FLOAT, `frame` STRING, `strand` STRING, `attributes` MAP<STRING, STRING> ) PARTITIONED BY ( `build` STRING, `anno_name` STRING, `version` STRING, `aid` STRING ) STORED AS PARQUET LOCATION %(location)s ; """, "anno_meta": f""" CREATE EXTERNAL TABLE IF NOT EXISTS `{table_name}` ( `refname` STRING, `refhash` STRING, `header` STRING, `description` STRING, `imported_on` TIMESTAMP, `variant_count` BIGINT, `filename` STRING ) PARTITIONED BY ( `build` STRING, `anno_name` STRING, `version` STRING, `aid` STRING ) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' LOCATION %(location)s ; """, }[table_type] except KeyError: raise SystemExit(f"Cannot create table of unknown type: {table_type}")
import os from functools import wraps FILE_PATH = os.path.dirname(__file__) def _give_it_name(func, name): @wraps(func) def wrap(): return func(name) return wrap class _BuiltInDataSetsBase: def __init__(self, file_name): self._FILEPATH = os.path.join(FILE_PATH, './built-in-datasets/', file_name) assert os.path.exists(self._FILEPATH) with open(self._FILEPATH, 'r', encoding='utf-8') as f: self._d = f.read() @property def data(self): return self._d LoadSDYXZ = _give_it_name(_BuiltInDataSetsBase, name='shediao.txt')
from primrose.base.node import AbstractNode class TestExtNode(AbstractNode): def necessary_config(self, node_config): return [] def run(self, data_object): terminate = False return data_object, terminate
""" Library for the retroactively-updatable views. """ import threading import baseviews class Sum(baseviews.NumericView): """ View for retroactively-updatable Sum. Since Sum is invertible and commutative, its implementation is fairly simple. """ def __init__(self, store, index): self._index = index self._store = store self._value = sum([ record.values()[index] for record in store._records.values()]) store.add_delete_callback(self._delete_callback) store.add_insert_callback(self._insert_callback) def _delete_callback(self, record): self._value -= record.values()[self._index] def _insert_callback(self, record): self._value += record.values()[self._index] class Min(baseviews.NumericView): """ View for retroactively-updatable Min. Uses several trees to bookkeep. """ def __init__(self, store, index): self._index = index self._store = store self._value = min([ record.values()[index] for record in store._records.values()]) store.add_delete_callback(self._delete_callback) store.add_insert_callback(self._insert_callback) def _delete_callback(self, record): # Min might have changed if self._value == record.values()[self._index]: # TODO: improve this with a real retroactive data structure self._value = min([ record.values()[self._index] \ for record in self._store._records.values()]) def _insert_callback(self, record): self._value = min(self._value, record.values()[self._index])
from setuptools import setup, find_packages setup(name='sane_tikz', version='0.1', description='Python to TikZ transpiler', long_description=open('tutorial.md', 'r', encoding='utf-8').read(), long_description_content_type='text/markdown', url='http://github.com/negrinho/sane_tikz', author='Renato Negrinho', author_email='[email protected]', license='MIT', packages=find_packages(include=["sane_tikz*"]), python_requires='>=3.6', install_requires=["numpy"], classifiers=[ 'Intended Audience :: Science/Research', 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.6', "Topic :: Scientific/Engineering :: Visualization" ])
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn import sys, os root_dir = os.path.join(os.path.dirname(__file__),'..') if root_dir not in sys.path: sys.path.insert(0, root_dir) import time import pickle import numpy as np from evaluation import compute_error_verts, compute_similarity_transform, compute_similarity_transform_torch, \ batch_compute_similarity_transform_torch, compute_mpjpe def batch_kp_2d_l2_loss(real, pred, weights=None): vis = (real>-1.).sum(-1)==real.shape[-1] pred[~vis] = real[~vis] error = torch.norm(real-pred, p=2, dim=-1) if weights is not None: error = error * weights.to(error.device) loss = error.sum(-1) / (1e-6+vis.sum(-1)) return loss def align_by_parts(joints, align_inds=None): if align_inds is None: return joints pelvis = joints[:, align_inds].mean(1) return joints - torch.unsqueeze(pelvis, dim=1) def calc_mpjpe(real, pred, align_inds=None, sample_wise=True, trans=None, return_org=False): vis_mask = real[:,:,0] != -2. if align_inds is not None: pred_aligned = align_by_parts(pred,align_inds=align_inds) if trans is not None: pred_aligned += trans real_aligned = align_by_parts(real,align_inds=align_inds) else: pred_aligned, real_aligned = pred, real mpjpe_each = compute_mpjpe(pred_aligned, real_aligned, vis_mask, sample_wise=sample_wise) if return_org: return mpjpe_each, (real_aligned, pred_aligned, vis_mask) return mpjpe_each def calc_pampjpe(real, pred, sample_wise=True,return_transform_mat=False): real, pred = real.float(), pred.float() # extracting the keypoints that all samples have the annotations vis_mask = (real[:,:,0] != -2.).sum(0)==len(real) pred_tranformed, PA_transform = batch_compute_similarity_transform_torch(pred[:,vis_mask], real[:,vis_mask]) pa_mpjpe_each = compute_mpjpe(pred_tranformed, real[:,vis_mask], sample_wise=sample_wise) if return_transform_mat: return pa_mpjpe_each, PA_transform else: return pa_mpjpe_each
# coding=utf-8 # Copyright (c) 2015 EMC Corporation. # 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 unicode_literals import logging from unittest import TestCase from hamcrest import assert_that, equal_to, none, instance_of, raises,\ is_not from storops import VNXSystem from storops.exception import VNXDeleteHbaNotFoundError, VNXCredentialError, \ VNXUserNameInUseError, VNXBackendError, VNXSetArrayNameError from storops.lib.common import instance_cache from storops.lib.resource import ResourceListCollection from storops.vnx.enums import VNXLunType, VNXPortType, VNXSPEnum, \ VNXUserRoleEnum from storops.vnx.resource.cifs_server import CifsDomain from storops.vnx.resource.disk import VNXDisk from storops.vnx.resource.lun import VNXLun from storops.vnx.resource.mirror_view import VNXMirrorViewList, \ VNXMirrorGroup, VNXMirrorGroupList, VNXMirrorViewAsyncList, \ VNXMirrorGroupAsync, VNXMirrorGroupAsyncList from storops.vnx.resource.mover import VNXMoverList from storops.vnx.resource.nqm import VNXIOClass, VNXIOClassList, VNXIOPolicy, \ VNXIOPolicyList from storops.vnx.resource.port import VNXSPPortList, VNXConnectionPortList, \ VNXConnectionPort, VNXConnectionVirtualPort from storops.vnx.resource.system import VNXAgent from storops.vnx.resource.system import VNXArrayName from storops.vnx.resource.vdm import VNXVdmList from storops.vnx.resource.vnx_domain import VNXDomainMemberList, \ VNXStorageProcessor from storops_test.vnx.cli_mock import patch_cli, t_vnx, t_cli from storops_test.vnx.nas_mock import patch_post from storops_test.vnx.resource.verifiers import verify_pool_0 __author__ = 'Cedric Zhuang' log = logging.getLogger(__name__) class VNXSystemTest(TestCase): @patch_cli() def setUp(self): self.vnx = t_vnx() @patch_cli def test_properties(self): assert_that(self.vnx.model, equal_to("VNX5800")) assert_that(self.vnx.model_type, equal_to('Rackmount')) assert_that(self.vnx.serial, equal_to('APM00153042305')) assert_that(self.vnx.agent_rev, equal_to('7.33.8 (2.97)')) assert_that(self.vnx.name, equal_to('IT_IS_ARR_NAME')) assert_that(self.vnx.revision, equal_to('05.33.008.3.297')) assert_that(self.vnx.existed, equal_to(True)) @patch_cli def test_get_pool_list(self): pool_list = self.vnx.get_pool() assert_that(len(pool_list), equal_to(5)) @patch_cli def test_get_pool(self): pool = self.vnx.get_pool(pool_id=0) verify_pool_0(pool) @patch_cli def test_member_ips(self): vnx = VNXSystem('10.244.211.30', heartbeat_interval=0) assert_that(vnx.spa_ip, equal_to('192.168.1.52')) assert_that(vnx.spb_ip, equal_to('192.168.1.53')) assert_that(vnx.control_station_ip, equal_to('10.244.211.32')) @patch_cli def test_get_snap(self): snaps = self.vnx.get_snap() assert_that(len(snaps), equal_to(47)) snap = self.vnx.get_snap('gan_snap') assert_that(snap.creation_time, equal_to('05/24/13 20:06:12')) @patch_cli def test_get_migration_session_list(self): ms_list = self.vnx.get_migration_session() assert_that(len(ms_list), equal_to(2)) @patch_cli def test_get_migration_session(self): source = VNXLun(lun_id=0) ms = self.vnx.get_migration_session(source) assert_that(ms.existed, equal_to(True)) @patch_cli def test_get_snap_lun(self): snap_luns = self.vnx.get_lun(lun_type=VNXLunType.SNAP_MOUNT_POINT) assert_that(len(snap_luns), equal_to(45)) for snap_lun in snap_luns: assert_that(snap_lun.is_snap_mount_point, equal_to(True)) @patch_cli def test_pool_feature(self): pf = self.vnx.get_pool_feature() assert_that(pf.max_pool_luns, equal_to(2100)) assert_that(pf.total_pool_luns, equal_to(2)) @patch_cli def test_pool_feature_no_poll(self): pf = self.vnx.get_pool_feature(False) assert_that(pf.max_pool_luns, equal_to(2100)) @patch_cli def test_sp_port(self): assert_that(len(self.vnx.get_sp_port()), equal_to(32)) @patch_cli def test_connection_port(self): ports = self.vnx.get_connection_port() assert_that(len(ports), equal_to(23)) assert_that(ports, instance_of(VNXConnectionPortList)) for x in ports: assert_that(x, instance_of(VNXConnectionVirtualPort)) @patch_cli def test_get_port_multi_vports(self): port_a5 = self.vnx.get_connection_port(sp=VNXSPEnum.SP_A, port_id=5) assert_that(port_a5, instance_of(VNXConnectionPortList)) assert_that(port_a5.existed, equal_to(True)) assert_that(len(port_a5), equal_to(3)) assert_that(port_a5[0].vport_id, equal_to(0)) assert_that(port_a5[0].virtual_port_id, equal_to(0)) assert_that(port_a5[1].vport_id, equal_to(1)) assert_that(port_a5[1].virtual_port_id, equal_to(1)) @patch_cli def test_get_single_virtual_port(self): port_a5_1_2 = self.vnx.get_connection_port( sp=VNXSPEnum.SP_A, port_id=5, vport_id=2) assert_that(port_a5_1_2, instance_of(VNXConnectionPort)) assert_that(port_a5_1_2.wwn, equal_to('iqn.1992-04.com.emc:cx.apm00153906536.a5')) assert_that(port_a5_1_2.sp, equal_to(VNXSPEnum.SP_A)) assert_that(port_a5_1_2.port_id, equal_to(5)) assert_that(port_a5_1_2.virtual_port_id, equal_to(2)) assert_that(port_a5_1_2.vport_id, equal_to(2)) assert_that(port_a5_1_2.vlan_id, equal_to(3991)) @patch_cli def test_is_feature_enabled(self): assert_that(self.vnx.is_compression_enabled(), equal_to(True)) assert_that(self.vnx.is_snap_enabled(), equal_to(True)) assert_that(self.vnx.is_dedup_enabled(), equal_to(True)) assert_that(self.vnx.is_mirror_view_async_enabled(), equal_to(True)) assert_that(self.vnx.is_mirror_view_sync_enabled(), equal_to(True)) assert_that(self.vnx.is_mirror_view_enabled(), equal_to(True)) assert_that(self.vnx.is_thin_enabled(), equal_to(True)) assert_that(self.vnx.is_sancopy_enabled(), equal_to(True)) assert_that(self.vnx.is_auto_tiering_enabled(), equal_to(True)) assert_that(self.vnx.is_fast_cache_enabled(), equal_to(True)) @patch_cli def test_available_disks(self): disks = self.vnx.get_available_disks() assert_that(len(disks), equal_to(5)) for disk in disks: assert_that(disk, instance_of(VNXDisk)) assert_that(disk.existed, equal_to(True)) @patch_cli(mock_map={'-np_domain': 'domain_-list_no_cs.txt'}) def test_member_ip_no_cs(self): vnx = VNXSystem('1.1.1.1', heartbeat_interval=0) assert_that(vnx.control_station_ip, none()) @patch_cli def test_get_fc_port_all(self): ports = self.vnx.get_fc_port() assert_that(ports, instance_of(VNXSPPortList)) assert_that(len(ports), equal_to(28)) for port in ports: assert_that(port.type, equal_to(VNXPortType.FC)) @patch_cli def test_get_fc_port_filtered_to_single(self): ports = self.vnx.get_fc_port(sp=VNXSPEnum.SP_A, port_id=1) assert_that(len(ports), equal_to(1)) port = ports[0] assert_that(port.sp, equal_to(VNXSPEnum.SP_A)) assert_that(port.port_id, equal_to(1)) assert_that(port.type, equal_to(VNXPortType.FC)) @patch_cli def test_get_fc_port_filtered_by_id(self): ports = self.vnx.get_fc_port(port_id=1) assert_that(ports, instance_of(VNXSPPortList)) assert_that(len(ports), equal_to(2)) @patch_cli def test_get_iscsi_port_all(self): ports = self.vnx.get_iscsi_port() assert_that(ports, instance_of(VNXConnectionPortList)) assert_that(len(ports), equal_to(16)) for port in ports: assert_that(port.type, equal_to(VNXPortType.ISCSI)) @patch_cli def test_get_iscsi_port_with_ip(self): ports = self.vnx.get_iscsi_port(has_ip=True) assert_that(ports, instance_of(VNXConnectionPortList)) assert_that(len(ports), equal_to(4)) @patch_cli def test_get_iscsi_port_without_ip(self): ports = self.vnx.get_iscsi_port(has_ip=False) assert_that(ports, instance_of(VNXConnectionPortList)) assert_that(len(ports), equal_to(12)) @patch_cli def test_get_iscsi_port_filtered_type_not_match(self): port = self.vnx.get_iscsi_port(sp=VNXSPEnum.SP_A, port_id=8, vport_id=0) assert_that(port, none()) @patch_cli def test_get_iscsi_port_filtered_type_match(self): port = self.vnx.get_iscsi_port(sp=VNXSPEnum.SP_A, port_id=5, vport_id=0) assert_that(port.sp, equal_to(VNXSPEnum.SP_A)) assert_that(port.port_id, equal_to(5)) assert_that(port.vport_id, equal_to(0)) @patch_cli def test_get_iscsi_port_filtered_without_vport(self): ports = self.vnx.get_iscsi_port(sp=VNXSPEnum.SP_B, port_id=10) port = ports[0] assert_that(port.sp, equal_to(VNXSPEnum.SP_B)) assert_that(port.port_id, equal_to(10)) assert_that(port.virtual_port_id, none()) @patch_cli def test_get_iscsi_port_filtered_no_vport(self): port = self.vnx.get_iscsi_port(sp=VNXSPEnum.SP_B, port_id=10, vport_id=0) assert_that(port, none()) @patch_cli def test_get_iscsi_port_filtered_by_vport(self): ports = self.vnx.get_iscsi_port(vport_id=0) assert_that(ports, instance_of(VNXConnectionPortList)) assert_that(len(ports), equal_to(4)) @patch_cli def test_ping_node(self): port = self.vnx.get_iscsi_port(sp=VNXSPEnum.SP_A, port_id=5, vport_id=2) port.ping_node('192.168.1.50') assert_that('A-5-2', port.display_name) @patch_cli def test_get_fcoe_port_all(self): ports = self.vnx.get_fcoe_port() assert_that(ports, instance_of(VNXConnectionPortList)) assert_that(len(ports), equal_to(4)) for port in ports: assert_that(port.type, equal_to(VNXPortType.FCOE)) @patch_cli def test_get_fcoe_port_filtered_to_single(self): port = self.vnx.get_fcoe_port(sp=VNXSPEnum.SP_A, port_id=6, vport_id=0) assert_that(port.sp, equal_to(VNXSPEnum.SP_A)) assert_that(port.port_id, equal_to(6)) assert_that(port.vport_id, equal_to(0)) assert_that(port.type, equal_to(VNXPortType.FCOE)) @patch_cli def test_get_fcoe_port_filtered_by_sp(self): ports = self.vnx.get_fcoe_port(sp=VNXSPEnum.SP_B) assert_that(ports, instance_of(VNXConnectionPortList)) assert_that(len(ports), equal_to(2)) @patch_cli def test_delete_hba_already_removed(self): def f(): uid = '00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01' self.vnx.delete_hba(uid) assert_that(f, raises(VNXDeleteHbaNotFoundError)) @patch_cli def test_get_block_users(self): users = self.vnx.get_block_user() assert_that(len(users), equal_to(2)) @patch_cli def test_create_user_existed(self): def f(): self.vnx.create_block_user('b', 'b', role=VNXUserRoleEnum.OPERATOR) assert_that(f, raises(VNXUserNameInUseError, 'failed')) @patch_cli def test_get_mirror_view(self): mv_list = self.vnx.get_mirror_view() assert_that(mv_list, instance_of(VNXMirrorViewList)) assert_that(len(mv_list), equal_to(4)) @patch_cli def test_create_mirror_view(self): lun = VNXLun(245) mv = self.vnx.create_mirror_view('mv0', lun) assert_that(mv.state, equal_to('Active')) @patch_cli def test_get_mirror_group(self): mg_list = self.vnx.get_mirror_group() assert_that(mg_list, instance_of(VNXMirrorGroupList)) assert_that(len(mg_list), equal_to(2)) @patch_cli def test_create_mirror_group(self): mg = self.vnx.create_mirror_group('test_group') assert_that(mg.state, equal_to('Synchronized')) assert_that(mg.condition, equal_to('Active')) assert_that(mg, instance_of(VNXMirrorGroup)) @patch_cli def test_get_mirror_view_async(self): mv_list = self.vnx.get_mirror_view_async() assert_that(mv_list, instance_of(VNXMirrorViewAsyncList)) assert_that(len(mv_list), equal_to(2)) @patch_cli def test_create_mirror_view_async(self): lun = VNXLun(71) mv = self.vnx.create_mirror_view_async('testdr_003', lun) assert_that(mv.state, equal_to('Active')) @patch_cli def test_get_mirror_group_async(self): mg_list = self.vnx.get_mirror_group_async() assert_that(mg_list, instance_of(VNXMirrorGroupAsyncList)) assert_that(len(mg_list), equal_to(2)) @patch_cli def test_create_mirror_group_async(self): mg = self.vnx.create_mirror_group_async('petermg') assert_that(mg.state, equal_to('Synchronized')) assert_that(mg.condition, equal_to('Normal')) assert_that(mg, instance_of(VNXMirrorGroupAsync)) @patch_cli(output='credential_error.txt') def test_credential_error(self): def f(): return VNXSystem('10.244.211.30', heartbeat_interval=0).spa_ip assert_that(f, raises(VNXCredentialError, 'invalid username')) @patch_cli def test_get_capacity(self): capacity = self.vnx.get_capacity() assert_that(capacity.total, equal_to(178269.891)) @property @patch_cli @instance_cache def vnx_file(self): log.info('init file mock connection: {}.'.format(self.vnx._file_cli)) log.info('mock cs ip: {}.'.format(self.vnx.control_station_ip)) return self.vnx @patch_post def test_get_file_system(self): assert_that(len(self.vnx_file.get_file_system()), equal_to(25)) @patch_post def test_get_nas_pool(self): assert_that(len(self.vnx_file.get_nas_pool()), equal_to(6)) @patch_post def test_get_cifs_server(self): assert_that(len(self.vnx_file.get_cifs_server()), equal_to(4)) @patch_post def test_create_cifs_server(self): def f(): domain = CifsDomain('test.dev') self.vnx_file.create_cifs_server('test', 1, domain=domain) assert_that(f, raises(VNXBackendError, 'default NT server')) @patch_post def test_get_cifs_share(self): assert_that(len(self.vnx_file.get_cifs_share()), equal_to(16)) @patch_post def test_get_physical_data_mover(self): dm_list = self.vnx_file.get_mover() assert_that(dm_list, instance_of(VNXMoverList)) assert_that(len(dm_list), equal_to(2)) @patch_post def test_get_vdm(self): vdm_list = self.vnx_file.get_mover(is_vdm=True) assert_that(vdm_list, instance_of(VNXVdmList)) assert_that(len(vdm_list), equal_to(2)) @patch_post def test_file_system_snap(self): snap = self.vnx_file.get_file_system_snap() assert_that(len(snap), equal_to(2)) @patch_post def test_get_nfs_share(self): assert_that(len(self.vnx_file.get_nfs_share()), equal_to(26)) @patch_cli def test_domain_properties(self): assert_that(self.vnx.domain, instance_of(VNXDomainMemberList)) @patch_cli def test_alive_sp_ip(self): log.debug('sp ips {}, {}'.format(self.vnx.spa_ip, self.vnx.spb_ip)) assert_that(self.vnx.alive_sp_ip, equal_to('10.244.211.30')) @patch_cli def test_get_sp(self): assert_that(len(self.vnx.get_sp()), equal_to(2)) assert_that(self.vnx.spa, instance_of(VNXStorageProcessor)) assert_that(self.vnx.spa.name, equal_to('A')) assert_that(self.vnx.spa.signature, equal_to(4022290)) assert_that(self.vnx.spb, instance_of(VNXStorageProcessor)) assert_that(self.vnx.spb.name, equal_to('B')) assert_that(self.vnx.spb.signature, equal_to(4022287)) @patch_cli def test_create_pool(self): pool = self.vnx.create_pool('Pool4File') assert_that(pool.existed, equal_to(True)) assert_that(pool.name, equal_to('Pool4File')) @patch_cli def test_get_host(self): host = self.vnx.get_host('ubuntu14') assert_that(host.name, equal_to('ubuntu14')) assert_that(host.existed, equal_to(True)) assert_that(len(host.connections), equal_to(4)) @patch_cli def create_policy(self): ioclass = VNXIOClass.get(cli=self.naviseccli, name='simple') policy = self.vnx.create_policy('new_policy', ioclasses=[ioclass]) assert_that(policy, instance_of(VNXIOPolicy)) @patch_cli def test_get_policy(self): policy = self.vnx.get_policy('new_policy') assert_that(policy, instance_of(VNXIOPolicy)) assert_that(policy.name, equal_to('new_policy')) assert_that(policy.status, equal_to('Warning')) @patch_cli def test_get_policies(self): policies = self.vnx.get_policy() assert_that(policies, instance_of(VNXIOPolicyList)) assert_that(len(policies), equal_to(3)) @patch_cli def test_stop_policy(self): self.vnx.stop_policy() @patch_cli def test_create_ioclass(self): lun = self.vnx.get_lun(name='lun1') ioclass = self.vnx.create_ioclass('simple', iotype='w', luns=lun) assert_that(ioclass, instance_of(VNXIOClass)) assert_that(ioclass.status, equal_to('Ready')) @patch_cli def test_get_ioclass(self): ioclass = self.vnx.get_ioclass('simple') assert_that(ioclass, instance_of(VNXIOClass)) assert_that(ioclass.name, equal_to('simple')) assert_that(ioclass.status, equal_to('Ready')) @patch_cli def test_get_ioclasses(self): ioclasses = self.vnx.get_ioclass() assert_that(ioclasses, instance_of(VNXIOClassList)) assert_that(len(ioclasses), equal_to(6)) @patch_cli def test_enable_perf_stats_default(self): vnx = VNXSystem('10.244.211.30', heartbeat_interval=0) clz_list = vnx.enable_perf_stats() assert_that(len(clz_list), equal_to(6)) assert_that(vnx.is_perf_stats_enabled(), equal_to(True)) vnx.disable_perf_stats() assert_that(vnx.is_perf_stats_enabled(), equal_to(False)) @patch_cli def test_enable_perf_stats_filtered(self): vnx = VNXSystem('10.244.211.30', heartbeat_interval=0) clz_list = vnx.enable_perf_stats([VNXLun, VNXDisk]) assert_that(len(clz_list), equal_to(2)) vnx.disable_perf_stats() @patch_cli def test_get_rsc_list_2_returns_different_instances(self): ret1 = self.vnx.get_rsc_list_2() ret2 = self.vnx.get_rsc_list_2() assert_that(ret1, is_not(equal_to(ret2))) @patch_cli def test_enable_persist_perf_stats(self): vnx = VNXSystem('10.244.211.30', heartbeat_interval=0) vnx.enable_persist_perf_stats() assert_that(vnx.is_perf_stats_persisted(), equal_to(True)) vnx.disable_persist_perf_stats() assert_that(vnx.is_perf_stats_persisted(), equal_to(False)) @patch_cli def test_collect_perf_record(self): record = self.vnx.collect_perf_record([VNXLun, VNXDisk]) assert_that(record, instance_of(ResourceListCollection)) assert_that(len(record), equal_to(2)) class VNXArrayNameTest(TestCase): @patch_cli def test_get(self): array_name = VNXArrayName(t_cli()) assert_that(array_name.name, equal_to('IT_IS_ARR_NAME')) @patch_cli def test_set_too_long(self): def f(): array_name = VNXArrayName(t_cli()) array_name.set_name( '123456789_123456789_123456789_123456789' '_123456789_123456789_123456789') assert_that(f, raises(VNXSetArrayNameError, 'is 64')) class VNXAgentTest(TestCase): @patch_cli def test_get(self): agent = VNXAgent(t_cli()) assert_that(agent.revision, equal_to('05.33.008.3.297'))
from construct import * from construct.lib import * repeat_eos_struct__chunk = Struct( 'offset' / Int32ul, 'len' / Int32ul, ) repeat_eos_struct = Struct( 'chunks' / GreedyRange(LazyBound(lambda: repeat_eos_struct__chunk)), ) _schema = repeat_eos_struct
""" ui.py """ from __future__ import print_function import atexit import sys from core import ansi from core import completion import libc from typing import Any, List, Optional, Dict, IO, TYPE_CHECKING if TYPE_CHECKING: from core.util import _DebugFile from core import completion # ANSI escape codes affect the prompt! # https://superuser.com/questions/301353/escape-non-printing-characters-in-a-function-for-a-bash-prompt # # Readline understands \x01 and \x02, while bash understands \[ and \]. # NOTE: There were used in demoish.py. Do we still want those styles? if 0: PROMPT_BOLD = '\x01%s\x02' % ansi.BOLD PROMPT_RESET = '\x01%s\x02' % ansi.RESET PROMPT_UNDERLINE = '\x01%s\x02' % ansi.UNDERLINE PROMPT_REVERSE = '\x01%s\x02' % ansi.REVERSE def _PromptLen(prompt_str): # type: (str) -> int """Ignore all characters between \x01 and \x02 and handle unicode characters. In particular, the display width of a string may be different from either the number of bytes or the number of unicode characters. Additionally, if there are multiple lines in the prompt, only give the length of the last line.""" escaped = False display_str = "" for c in prompt_str: if c == '\x01': escaped = True elif c == '\x02': escaped = False elif not escaped: display_str += c last_line = display_str.split('\n')[-1] try: width = libc.wcswidth(last_line) # en_US.UTF-8 locale missing, just return the number of bytes except (SystemError, UnicodeError): return len(display_str) if width == -1: return len(display_str) return width class PromptState(object): """For the InteractiveLineReader to communicate with the Display callback.""" def __init__(self): # type: () -> None self.last_prompt_str = None # type: Optional[str] self.last_prompt_len = -1 def SetLastPrompt(self, prompt_str): # type: (str) -> None self.last_prompt_str = prompt_str self.last_prompt_len = _PromptLen(prompt_str) class State(object): """For the RootCompleter to communicate with the Display callback.""" def __init__(self): # type: () -> None self.line_until_tab = None # original line, truncated # Start offset in EVERY candidate to display. We send fully-completed # LINES to readline because we don't want it to do its own word splitting. self.display_pos = -1 # completion candidate descriptions self.descriptions = {} # type: Dict[str, str] class _IDisplay(object): """Interface for completion displays.""" def __init__(self, comp_state, prompt_state, num_lines_cap, f, debug_f): # type: (State, PromptState, int, IO[bytes], _DebugFile) -> None self.comp_state = comp_state self.prompt_state = prompt_state self.num_lines_cap = num_lines_cap self.f = f self.debug_f = debug_f def PrintCandidates(self, *args): # type: (*Any) -> None try: self._PrintCandidates(*args) except Exception as e: if 0: import traceback traceback.print_exc() def _PrintCandidates(self, unused_subst, matches, unused_match_len): # type: (Optional[Any], List[str], Optional[Any]) -> None """Abstract method.""" raise NotImplementedError() def Reset(self): # type: () -> None """Call this in between commands.""" pass def ShowPromptOnRight(self, rendered): # type: (str) -> None # Doesn't apply to MinimalDisplay pass def EraseLines(self): # type: () -> None # Doesn't apply to MinimalDisplay pass def PrintRequired(self, msg, *args): # type: (str, *Any) -> None # This gets called with "nothing to display" pass def PrintOptional(self, msg, *args): # type: (str, *Any) -> None pass def OnWindowChange(self): # type: () -> None # MinimalDisplay doesn't care about terminal width. pass class MinimalDisplay(_IDisplay): """A display with minimal dependencies. It doesn't output color or depend on the terminal width. It could be useful if we ever have a browser build! We can see completion without testing it. """ def __init__(self, comp_state, prompt_state, debug_f, num_lines_cap=10, f=sys.stdout): # type: (State, PromptState, _DebugFile, int, IO[bytes]) -> None _IDisplay.__init__(self, comp_state, prompt_state, num_lines_cap, f, debug_f) self.reader = None def _RedrawPrompt(self): # type: () -> None # NOTE: This has to reprint the prompt and the command line! # Like bash, we SAVE the prompt and print it, rather than re-evaluating it. self.f.write(self.prompt_state.last_prompt_str) self.f.write(self.comp_state.line_until_tab) def _PrintCandidates(self, unused_subst, matches, unused_match_len): # type: (Optional[Any], List[str], Optional[Any]) -> None #log('_PrintCandidates %s', matches) self.f.write('\n') # need this display_pos = self.comp_state.display_pos assert display_pos != -1 too_many = False i = 0 for m in matches: self.f.write(' %s\n' % m[display_pos:]) if i == self.num_lines_cap: too_many = True i += 1 # Count this one break i += 1 if too_many: num_left = len(matches) - i if num_left: self.f.write(' ... and %d more\n' % num_left) self._RedrawPrompt() def PrintRequired(self, msg, *args): # type: (str, *Any) -> None self.f.write('\n') if args: msg = msg % args self.f.write(' %s\n' % msg) # need a newline self._RedrawPrompt() def _PrintPacked(matches, max_match_len, term_width, max_lines, f): # type: (List[str], int, int, int, IO[bytes]) -> int # With of each candidate. 2 spaces between each. w = max_match_len + 2 # Number of candidates per line. Don't print in first or last column. num_per_line = max(1, (term_width-2) // w) fmt = '%-' + str(w) + 's' num_lines = 0 too_many = False remainder = num_per_line - 1 i = 0 # num matches for m in matches: if i % num_per_line == 0: f.write(' ') # 1 space left gutter f.write(fmt % m) if i % num_per_line == remainder: f.write('\n') # newline (leaving 1 space right gutter) num_lines += 1 # Check if we've printed enough lines if num_lines == max_lines: too_many = True i += 1 # count this one break i += 1 # Write last line break, unless it came out exactly. if i % num_per_line != 0: #log('i = %d, num_per_line = %d, i %% num_per_line = %d', # i, num_per_line, i % num_per_line) f.write('\n') num_lines += 1 if too_many: # TODO: Save this in the Display class fmt2 = ansi.BOLD + ansi.BLUE + '%' + str(term_width-2) + 's' + ansi.RESET num_left = len(matches) - i if num_left: f.write(fmt2 % '... and %d more\n' % num_left) num_lines += 1 return num_lines def _PrintLong(matches, # type: List[str] max_match_len, # type: int term_width, # type: int max_lines, # type: int descriptions, # type: Dict[str, str] f, # type: Any ): # type: (...) -> int """Print flags with descriptions, one per line. Args: descriptions: dict of { prefix-stripped match -> description } Returns: The number of lines printed. """ #log('desc = %s', descriptions) # Subtract 3 chars: 1 for left and right margin, and then 1 for the space in # between. max_desc = max(0, term_width - max_match_len - 3) fmt = ' %-' + str(max_match_len) + 's ' + ansi.YELLOW + '%s' + ansi.RESET + '\n' num_lines = 0 # rl_match is a raw string, which may or may not have a trailing space for rl_match in matches: desc = descriptions.get(rl_match) or '' if max_desc == 0: # the window is not wide enough for some flag f.write(' %s\n' % rl_match) else: if len(desc) > max_desc: desc = desc[:max_desc-5] + ' ... ' f.write(fmt % (rl_match, desc)) num_lines += 1 if num_lines == max_lines: # right justify fmt2 = ansi.BOLD + ansi.BLUE + '%' + str(term_width-1) + 's' + ansi.RESET num_left = len(matches) - num_lines if num_left: f.write(fmt2 % '... and %d more\n' % num_left) num_lines += 1 break return num_lines class NiceDisplay(_IDisplay): """Methods to display completion candidates and other messages. This object has to remember how many lines we last drew, in order to erase them before drawing something new. It's also useful for: - Stripping off the common prefix according to OUR rules, not readline's. - displaying descriptions of flags and builtins """ def __init__(self, term_width, # type: int comp_state, # type: State prompt_state, # type: PromptState debug_f, # type: _DebugFile readline_mod, # type: Any f=sys.stdout, # type: IO[bytes] num_lines_cap=10, # type: int bold_line=False, # type: bool ): # type: (...) -> None """ Args: bold_line: Should user's entry be bold? """ _IDisplay.__init__(self, comp_state, prompt_state, num_lines_cap, f, debug_f) self.readline_mod = readline_mod self.term_width = term_width self.width_is_dirty = False self.bold_line = bold_line self.num_lines_last_displayed = 0 # For debugging only, could get rid of self.c_count = 0 self.m_count = 0 # hash of matches -> count. Has exactly ONE entry at a time. self.dupes = {} # type: Dict[int, int] def Reset(self): # type: () -> None """Call this in between commands.""" self.num_lines_last_displayed = 0 self.dupes.clear() def _ReturnToPrompt(self, num_lines): # type: (int) -> None # NOTE: We can't use ANSI terminal codes to save and restore the prompt, # because the screen may have scrolled. Instead we have to keep track of # how many lines we printed and the original column of the cursor. orig_len = len(self.comp_state.line_until_tab) self.f.write('\x1b[%dA' % num_lines) # UP last_prompt_len = self.prompt_state.last_prompt_len assert last_prompt_len != -1 # Go right, but not more than the terminal width. n = orig_len + last_prompt_len n = n % self._GetTerminalWidth() self.f.write('\x1b[%dC' % n) # RIGHT if self.bold_line: self.f.write(ansi.BOLD) # Experiment self.f.flush() def _PrintCandidates(self, unused_subst, matches, unused_max_match_len): # type: (Optional[Any], List[str], Optional[Any]) -> None term_width = self._GetTerminalWidth() # Variables set by the completion generator. They should always exist, # because we can't get "matches" without calling that function. display_pos = self.comp_state.display_pos self.debug_f.log('DISPLAY POS in _PrintCandidates = %d', display_pos) self.f.write('\n') self.EraseLines() # Delete previous completions! #log('_PrintCandidates %r', unused_subst, file=DEBUG_F) # Figure out if the user hit TAB multiple times to show more matches. # It's not correct to hash the line itself, because two different lines can # have the same completions: # # ls <TAB> # ls --<TAB> # # This is because there is a common prefix. # So instead use the hash of all matches as the identity. # This could be more accurate but I think it's good enough. comp_id = hash(''.join(matches)) if comp_id in self.dupes: self.dupes[comp_id] += 1 else: self.dupes.clear() # delete the old ones self.dupes[comp_id] = 1 max_lines = self.num_lines_cap * self.dupes[comp_id] assert display_pos != -1 if display_pos == 0: # slight optimization for first word to_display = matches else: to_display = [m[display_pos:] for m in matches] # Calculate max length after stripping prefix. max_match_len = max(len(m) for m in to_display) # TODO: NiceDisplay should truncate when max_match_len > term_width? # Also truncate when a single candidate is super long? # Print and go back up. But we have to ERASE these before hitting enter! if self.comp_state.descriptions: # exists and is NON EMPTY num_lines = _PrintLong(to_display, max_match_len, term_width, max_lines, self.comp_state.descriptions, self.f) else: num_lines = _PrintPacked(to_display, max_match_len, term_width, max_lines, self.f) self._ReturnToPrompt(num_lines+1) self.num_lines_last_displayed = num_lines self.c_count += 1 def PrintRequired(self, msg, *args): # type: (str, *Any) -> None """ Print a message below the prompt, and then return to the location on the prompt line. """ if args: msg = msg % args # This will mess up formatting assert not msg.endswith('\n'), msg self.f.write('\n') self.EraseLines() #log('PrintOptional %r', msg, file=DEBUG_F) # Truncate to terminal width max_len = self._GetTerminalWidth() - 2 if len(msg) > max_len: msg = msg[:max_len-5] + ' ... ' # NOTE: \n at end is REQUIRED. Otherwise we get drawing problems when on # the last line. fmt = ansi.BOLD + ansi.BLUE + '%' + str(max_len) + 's' + ansi.RESET + '\n' self.f.write(fmt % msg) self._ReturnToPrompt(2) self.num_lines_last_displayed = 1 self.m_count += 1 def PrintOptional(self, msg, *args): # type: (str, *Any) -> None self.PrintRequired(msg, *args) def ShowPromptOnRight(self, rendered): # type: (str) -> None n = self._GetTerminalWidth() - 2 - len(rendered) spaces = ' ' * n # We avoid drawing problems if we print it on its own line: # - inserting text doesn't push it to the right # - you can't overwrite it self.f.write(spaces + ansi.REVERSE + ' ' + rendered + ' ' + ansi.RESET + '\r\n') def EraseLines(self): # type: () -> None """Clear N lines one-by-one. Assume the cursor is right below thep rompt: ish$ echo hi _ <-- HERE That's the first line to erase out of N. After erasing them, return it there. """ if self.bold_line: self.f.write(ansi.RESET) # if command is bold self.f.flush() n = self.num_lines_last_displayed #log('EraseLines %d (c = %d, m = %d)', n, self.c_count, self.m_count, # file=DEBUG_F) if n == 0: return for i in xrange(n): self.f.write('\x1b[2K') # 2K clears entire line (not 0K or 1K) self.f.write('\x1b[1B') # go down one line # Now go back up self.f.write('\x1b[%dA' % n) self.f.flush() # Without this, output will look messed up def _GetTerminalWidth(self): # type: () -> int if self.width_is_dirty: try: self.term_width = libc.get_terminal_width() except IOError: # This shouldn't raise IOError because we did it at startup! Under # rare circumstances stdin can change, e.g. if you do exec <& # input.txt. So we have a fallback. self.term_width = 80 self.width_is_dirty = False return self.term_width def OnWindowChange(self): # type: () -> None # Only do it for the NEXT completion. The signal handler can be run in # between arbitrary bytecodes, and we don't want a single completion # display to be shown with different widths. self.width_is_dirty = True # NOTE: This readline function REDRAWS the prompt, and we don't want to # happen on SIGWINCH -- e.g. in the middle of a read(). # # We could call rl_set_screen_size or rl_get_screen_size() instead. # But Oil is handling all the drawing, so I don't see why readline needs # to know about the terminal size. # # https://tiswww.case.edu/php/chet/readline/readline.html #self.readline_mod.resize_terminal() def InitReadline(readline_mod, history_filename, root_comp, display, debug_f): # type: (Any, str, completion.RootCompleter, _IDisplay, _DebugFile) -> None assert readline_mod try: readline_mod.read_history_file(history_filename) except IOError: pass def _MaybeWriteHistoryFile(history_filename): # type: (str) -> None try: readline_mod.write_history_file(history_filename) except IOError: pass # The 'atexit' module is a small wrapper around sys.exitfunc. atexit.register(_MaybeWriteHistoryFile, history_filename) readline_mod.parse_and_bind("tab: complete") # How does this map to C? # https://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC45 complete_cb = completion.ReadlineCallback(readline_mod, root_comp, debug_f) readline_mod.set_completer(complete_cb) # http://web.mit.edu/gnu/doc/html/rlman_2.html#SEC39 # "The basic list of characters that signal a break between words for the # completer routine. The default value of this variable is the characters # which break words for completion in Bash, i.e., " \t\n\"\\'`@$><=;|&{("" # This determines the boundaries you get back from get_begidx() and # get_endidx() at completion time! # We could be more conservative and set it to ' ', but then cases like # 'ls|w<TAB>' would try to complete the whole thing, intead of just 'w'. # # Note that this should not affect the OSH completion algorithm. It only # affects what we pass back to readline and what readline displays to the # user! # No delimiters because readline isn't smart enough to tokenize shell! readline_mod.set_completer_delims('') readline_mod.set_completion_display_matches_hook( lambda *args: display.PrintCandidates(*args) )
import aku import gym import launch_moire app = aku.App(__file__) @app.register def train(device: str = 'CPU', beta: float = 1e-4, average_entropy_decay: float = 0.999, backward_separately: bool = True, batch_size: int = 32, n_episodes: int = 2000, max_episode_len: int = 20000, num_layers: int = 3, hidden_size: int = 100): launch_moire.launch_moire(device) import dynet as dy from moire import ParameterCollection from moire import nn from moire.nn.thresholds import relu from moire.nn.reinforces.agents.reinforce import REINFORCE pc = ParameterCollection() policy = nn.MLP(pc, num_layers=num_layers, in_feature=4, out_feature=2, hidden_feature=hidden_size, nonlinear=relu) optimizer = dy.AdamTrainer(pc) agent = REINFORCE( policy=policy, optimizer=optimizer, beta=beta, average_entropy_decay=average_entropy_decay, backward_separately=backward_separately, batch_size=batch_size, ) env = gym.make('CartPole-v0') for i in range(1, n_episodes + 1): obs = env.reset() reward = 0 done = False R = 0 # return (sum of rewards) t = 0 # time step while not done and t < max_episode_len: dy.renew_cg() action = agent.act_and_train(dy.inputVector(obs), reward) obs, reward, done, _ = env.step(action) R += reward t += 1 if i % 10 == 0: print('episode:', i, 'R:', R, f'average_entropy: {agent.average_entropy:.03f}') agent.stop_episode_and_train(dy.inputVector(obs), reward, done) print('Finished.') if __name__ == '__main__': app.run()
import sys from os import path # To support 'uwsgiconf.contrib.django.uwsgify' in INSTALLED_APPS: sys.path.insert(0, path.dirname(__file__))
import utils with open("4.txt") as f: candidate = None max_count = 0 for line in f.readlines(): decrypted, key, count = utils.freq_analysis(utils.ByteArray.fromHexString(line.strip())) if count > max_count: max_count = count candidate = decrypted print candidate
# # Created by Lukas Lüftinger on 05/02/2019. # try: from .annotation import fastas_to_grs except ModuleNotFoundError: from phenotrex.util.helpers import fail_missing_dependency as fastas_to_grs __all__ = ['fastas_to_grs']
# Conductance models of specific cell subtypes #=============================================================================== # Mostly based on: Destexhe et al. J Neurophys 1994 (72) # https://pdfs.semanticscholar.org/7d54/8359042fabc4d0fcd20f8cfe98a3af9309bf.pdf # Calcium dynamics from: https://www.physiology.org/doi/abs/10.1152/jn.1992.68.4.1384 from . import chans as ch from . import calc as ca from . import synapse as sy from . import params as pr from .incurr import Id from scipy.integrate import odeint import numpy as np ############################### Cell definitions ############################### #=============================================================================== # Simulation executor #=============================================================================== def IN(y,t,p,s=None): dy = np.zeros((np.shape(p['snames'])[0],)) sn = p['snames'] Vm = y[sn.index('Vm')] # Evaluate intrinsic states #--------------------------------------------------------------------------- l = ch.Leak(Vm,p) k = ch.K(Vm, p, y[sn.index('m_K')]) na = ch.Na(Vm,p, y[sn.index('m_Na')], y[sn.index('h_Na')]) nap = ch.NaP(Vm,p,y[sn.index('m_NaP')]) Int = l + k[0] + na[0] + nap[0] # Evaluate synaptic potentials #--------------------------------------------------------------------------- # Calculate membrane potential #--------------------------------------------------------------------------- dy[sn.index('Vm')] = (Id(t,p['paradigm'])*p['I_sc']-p['I_off'] - Int) / p['Cm'] # Voltage sensitive gating #--------------------------------------------------------------------------- dy[sn.index('m_K')] = k[1] dy[sn.index('m_Na')] = na[1] dy[sn.index('h_Na')] = na[2] dy[sn.index('m_NaP')] = nap[1] return dy def PY(y,t,p,s=None): dy = np.zeros((np.shape(p['snames'])[0],)) sn = p['snames'] Vm = y[sn.index('Vm')] # Evaluate intrinsic states #--------------------------------------------------------------------------- l = ch.Leak(Vm,p) k = ch.K(Vm, p, y[sn.index('m_K')]) na = ch.Na(Vm,p, y[sn.index('m_Na')], y[sn.index('h_Na')]) nap = ch.NaP(Vm,p,y[sn.index('m_NaP')]) km = ch.M(Vm,p,y[sn.index('m_KM')]) Int = l + k[0] + na[0] + nap[0] + km[0] # Evaluate synaptic potentials #--------------------------------------------------------------------------- # gaba = sy.GABA(Vm, p, y[sn.index('rGABA')], s) # Syn = np.sum(gaba[0]) # Calculate membrane potential #--------------------------------------------------------------------------- dy[sn.index('Vm')] = (Id(t, p['paradigm'])*p['I_sc'] - Int) / p['Cm'] # Voltage sensitive gating #--------------------------------------------------------------------------- dy[sn.index('m_K')] = k[1] dy[sn.index('m_Na')] = na[1] dy[sn.index('h_Na')] = na[2] dy[sn.index('m_NaP')] = nap[1] dy[sn.index('m_KM')] = km[1] # dy[sn.index('rGABA')] = gaba[1] return dy def RE(y,t,p): dy = np.zeros((np.shape(p['snames'])[0],)) sn = p['snames'] Vm = y[sn.index('Vm')] # Evaluate intrinsic states #--------------------------------------------------------------------------- l = ch.Leak(Vm,p) k = ch.K(Vm, p, y[sn.index('m_K')]) na = ch.Na(Vm,p, y[sn.index('m_Na')], y[sn.index('h_Na')]) nap = ch.NaP(Vm,p,y[sn.index('m_NaP')]) km = ch.M(Vm,p,y[sn.index('m_KM')]) th = ch.Th(Vm,p,y[sn.index('m_Th')], y[sn.index('h_Th')], ca.ECa(p,y[sn.index('Ca_i')])) can = ch.CAN(Vm,p,y[sn.index('m_CAN')],y[sn.index('Ca_i')]) kca = ch.KCa(Vm,p,y[sn.index('m_KCa')],y[sn.index('Ca_i')]) Int = l + k[0] + na[0] + nap[0] + km[0] + th[0] # + can[0] + kca[0] # Calculate membrane potential #--------------------------------------------------------------------------- dy[sn.index('Vm')] = (Id(t, p['paradigm'])*p['I_sc'] - Int) / p['Cm'] # Voltage sensitive gating #--------------------------------------------------------------------------- dy[sn.index('m_K')] = k[1] dy[sn.index('m_Na')] = na[1] dy[sn.index('h_Na')] = na[2] dy[sn.index('m_NaP')] = nap[1] dy[sn.index('m_KM')] = km[1] dy[sn.index('m_CAN')] = can[1] dy[sn.index('m_KCa')] = kca[1] dy[sn.index('m_Th')] = th[1] dy[sn.index('h_Th')] = th[2] # Calcium dynamics #--------------------------------------------------------------------------- dy[sn.index('Ca_i')] = ca.dCaI(y[sn.index('Ca_i')],th[0]) return dy ################################## ODE Solver ################################## #=============================================================================== # Simulation executor #=============================================================================== def runsim(i_scl, NaP_scl, specs, Y0 = None): # This code will simulate a single cell of the specified subtype with sheets cell = globals()[specs.ctyp] Vy = {} # Run simulation across conditions #------------------------------------------------------------------------------- for ci in range(len(specs.conds)): par = pr.params(specs.conds[ci], i_scl, specs.ctyp, specs.paradigm, NaP_scl = NaP_scl) if Y0 == None: Y0 = specs.Y0 if hasattr(specs, 'Y0') else specs.initialise().Y0 y0 = specs.Y0[specs.conds[ci]][-1,:] Vy.update({specs.conds[ci]:odeint(cell, y0, specs.T, args=(par,))}) return Vy
""" Project Euler: Problem 1: Multiples of 3 and 5 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below the provided parameter value number. """ def multiples(n): sum = 0 for ii in range(n): if (ii % 3 == 0 or ii % 5 == 0): sum += ii return sum def testme(): assert multiples(10) == 23, "Sum of all multiples in 3,5 for 0 to 10 should be 23" if __name__ == "__main__": testme() print("*" * 50, "Everything passed. No asserts if we reached here", "*" * 50, sep="\n")
# Generous tit for tat import random class MyPlayer: def __init__(self, payoff_matrix, number_of_iterations): self.payoff_matrix = payoff_matrix self.number_of_iterations = number_of_iterations self.opponent_last_move = False def move(self): if self.opponent_last_move == True: if random.random() < 0.1: move = False else: move = True else: move = False return move # True(defect) or False(coop) def record_last_moves(self, my_last_move, opponent_last_move): self.opponent_last_move = opponent_last_move
""" A collection of some distance computing functions for calculating similarity between two tensors. They are useful in metric-based meta-learning algorithms. """ import torch import torch.nn.functional as f from typing import Callable __all__ = ['get_distance_function'] def euclidean_distance( x: torch.FloatTensor, y: torch.FloatTensor ) -> torch.FloatTensor: """ Compute the pairwise squared Euclidean distance between two tensors: .. math :: \\text{distance} = \| x - y \|^2 Args: x (torch.Tensor): A tensor with shape ``(N, embed_dim)`` y (torch.Tensor): A tensor with shape ``(M, embed_dim)`` eps (float, optional, default=1e-10): A small value to avoid division by zero. Returns: distance (torch.Tensor): Euclidean distance between tensor ``x`` and \ tensor ``y``, with shape ``(M, N)`` .. admonition:: References 1. "`Prototypical Networks for Few-shot Learning. \ <https://arxiv.org/abs/1703.05175>`_" Jake Snell, et al. NIPS 2017. """ n = x.size(0) m = y.size(0) x = x.unsqueeze(0).expand(m, n, -1) y = y.unsqueeze(1).expand(m, n, -1) distance = ((x - y) ** 2).sum(dim=-1) return distance def cosine_distance( x: torch.FloatTensor, y: torch.FloatTensor, eps: float = 1e-10 ) -> torch.FloatTensor: """ Compute the pairwise cosine distance between two tensors: .. math :: \\text{distance} = \\frac{x \cdot y}{\| x \|_2 \cdot \| x_2 \|_2} Args: x (torch.Tensor): A tensor with shape ``(N, embed_dim)`` y (torch.Tensor): A tensor with shape ``(M, embed_dim)`` Returns: distance (torch.Tensor): cosine distance between tensor ``x`` and \ tensor ``y``, with shape ``(M, N)`` .. admonition:: References 1. "`Matching Networks for One Shot Learning. \ <https://arxiv.org/abs/1606.04080>`_" Oriol Vinyals, et al. NIPS 2016. """ x_norm = f.normalize(x, dim=1, eps=eps) y_norm = f.normalize(y, dim=1, eps=eps) return (x_norm @ y_norm.t()).t() _DISTANCE = { 'euclidean': euclidean_distance, 'cosine': cosine_distance } def get_distance_function(distance: str) -> Callable: return _DISTANCE[distance]
import time from typing import Any, Union import numpy as np import pandas as pd from .format_time import format_time_hhmmss class Timestamps: def __init__(self) -> None: """ Container for storing timestamps and calculating the difference between two timestamps (e.g. the latest 2). """ self.timestamps = [] self.name_to_idx = {} self.idx_to_name = {} def __len__(self) -> int: """ Number of stored timestamps. """ return len(self.timestamps) def __eq__(self, other: object) -> bool: """ Equality test. Checks whether the list of timestamps and the dict mapping `stamp name -> index` are equal. Parameters ---------- other : `Timestamps` Another `Timestamps` collection. Returns ------- bool Whether the two `Timestamps` collections are equal. """ return ( self.timestamps == other.timestamps and self.name_to_idx == other.name_to_idx ) def __getitem__(self, idx_or_name: Union[str, int]) -> int: """ Get numeric timestamp (as recorded with `time.time()`) by indexing (via idx or name) in square brackets. Parameters ---------- idx_or_name : int or str Index or name of timestamp. """ assert isinstance(idx_or_name, (str, int)) key = "idx" if isinstance(idx_or_name, int) else "name" return self.get_stamp(**{key: idx_or_name}, as_str=False) def __str__(self) -> str: string = "Timestamps:\n\n" return string + self.to_data_frame().to_string(max_rows=30) + "\n" def _stamp(self) -> None: """ Add current time to list of timestamps. """ t = time.time() self.timestamps.append(t) def stamp(self, name: str = None) -> None: """ Add current time to list of timestamps. *Optionally* save the timestamp index with a name in the `name_to_idx` dictionary to allow easy extraction later. E.g. use to get the time difference between two larger blocks of code with in-between timestamps. Parameters ---------- name : str (Optional) Unique name to store the index of the timestamp with. """ self._stamp() if name is not None: if name in self.name_to_idx: raise ValueError("`name` was already used. Use a unique name.") idx = len(self) - 1 self.name_to_idx[name] = idx self.idx_to_name[idx] = name def get_stamp(self, idx: Union[int, None] = None, name: Union[str, None] = None, as_str: bool = True) -> Union[int, str]: """ Get specific timestamp from either the index or name it was recorded under. Note: The raw list of timestamps are also available as `.timestamps` while the `name->index` dict is available as `.name_to_idx`. Parameters ---------- idx : int Index of the timestamp to get. name : str Name of the timestamp. as_str : bool Whether to format the difference as a string. Returns ------- int or str Timestamp made with `time.time()`. Optionally formatted as a string with hh:mm:ss. """ if sum([idx is not None, name is not None]) != 1: raise ValueError( "Exactly one of `idx` and `name` should be specified.") if idx is not None: t = self.timestamps[idx] else: if name not in self.name_to_idx: raise KeyError(f"`name` '{name}' was not found.") t = self.timestamps[self.get_stamp_idx(name=name)] if as_str: t = format_time_hhmmss(t) return t def get_stamp_idx(self, name: str) -> int: """ Get timestamp index from name of timestamp. Parameters ---------- name : str Name used to store index of timestamp with. Returns ------- int Index of timestamp stored with `name`. """ if name not in self.name_to_idx: raise KeyError(f"`name` '{name}' was not found.") return self.name_to_idx[name] def get_stamp_name(self, idx: int) -> str: """ Get timestamp name from index of timestamp. Parameters ---------- idx : int Index of timestamp to get name for. Returns ------- str or None Name of timestamp at the given index. When no name was recorded, `None` is returned. """ if np.abs(idx) > len(self) - 1: raise ValueError( f"`idx` was out of bounds: '{idx}'. Currently stores {len(self)} timestamps.") return self.idx_to_name.get(idx, None) def to_data_frame(self): """ Get times as `pandas.DataFrame` with columns [`Name`, `Time`]. Returns ------- `pandas.DataFrame` Data frame with names and times in the recorded order. """ names = [""] * len(self) for idx, name in self.idx_to_name.items(): names[idx] = name times = self.timestamps.copy() times_from_start = [t - times[0] for t in times] times_from_start = [format_time_hhmmss(t) for t in times_from_start] return pd.DataFrame({ "Name": names, "Time Raw": times, "Time From Start": times_from_start }) def to_csv(self, *args: Any, **kwargs: Any) -> None: """ Write timestamps to a csv file. Converts a copy of the collection to a `pandas.DataFrame` and saves it with `pandas.DataFrame.to_csv()`. Parameters ---------- args positional arguments for `pandas.DataFrame.to_csv()`. kwargs keyword arguments for `pandas.DataFrame.to_csv()`. """ df = self.to_data_frame() df.to_csv(*args, **kwargs) def took(self, start: Union[int, str] = -2, end: Union[int, str] = -1, as_str: bool = True, raise_negative: bool = True) -> Union[int, str]: """ Get the difference between two timestamps. By default, the two latest timestamps are used. Parameters ---------- start : int or str Either: 1) The index of the starting timestamp. 2) The name of the starting timestamp. end_idx : int or str Either: 1) The index of the end timestamp. 2) The name of the end timestamp. as_str : bool Whether to format the difference as a string. raise_negative : bool Whether to raise an error when the time difference between the two stamps are negative. In thus case, `end` came before `start`. When `False`, a negative number is returned. Returns ------- int or str Difference in time between two given timestamps, either as a number or a formatted string. """ start_time = self.get_stamp( idx=None if not isinstance(start, int) else start, name=None if not isinstance(start, str) else start, as_str=False ) end_time = self.get_stamp( idx=None if not isinstance(end, int) else end, name=None if not isinstance(end, str) else end, as_str=False ) diff = end_time - start_time if diff < 0 and raise_negative: raise ValueError(( "Difference between timestamps was negative. " "`start` should correspond to an earlier timestamp than `end` " "(or disable `raise_negative`).")) if as_str: return format_time_hhmmss(diff) return diff def get_total_time(self, as_str: str = True) -> Union[int, str]: """ Get the time difference between the first and last timestamps. Parameters ---------- as_str : bool Whether to format the difference as a string. Returns ------- int Difference in time between first and last timestamp, either as a number or a formatted string. """ return self.took( start=0, end=-1, as_str=as_str ) def update(self, other: object): """ Update existing `Timestamps` collection with another `Timestamps` collection. Combines the list of timestamps (sorted by time) and updates the name->idx and idx->name maps, which is likely to change the indices. When both collections have the same key in the `.name_to_idx` and `.idx_to_name` dicts, the member from `other` is used. Parameters ---------- other : `Timestamps` object Another `Timestamps` collection to combine with the current collection. """ self.merge(other=other, suffix_identical_names=False) def merge(self, other: object, suffix_identical_names: bool = True): """ Merge this `Timestamps` collection with another `Timestamps` collection. Combines the list of timestamps (sorted by time) and updates the name->idx and idx->name maps, which is likely to change the indices. By default, clashing names are suffixed with "_0" (this) and "_1" (other). If this does not lead to unique names, the suffix increases by one ("_2", "_3", "_4", ...) until it does. Parameters ---------- other : `Timestamps` object Another `Timestamps` collection to combine with the current collection. suffix_identical_names : bool Whether to add a suffix ("_0", "_1", etc.) to clashing names with an increasing count until names are unique. When `False`, the dict members in `.name_to_idx` and `.idx_to_name` from `other` is used. """ # Add the two timestamps lists together # but as tuples with indices and an identifier # of which collection it came from combined_timestamps = \ _list_to_enumerated_tuple( l=self.timestamps, identifier="this") + \ _list_to_enumerated_tuple( l=other.timestamps, identifier="other") # Sort by ascending time combined_timestamps = sorted(combined_timestamps, key=lambda x: x[0]) # Update name->index maps colls = {"this": self, "other": other} for new_idx, (_, old_idx, coll_id) in enumerate(combined_timestamps): coll = colls[coll_id] name = coll.idx_to_name.get(old_idx, None) if name is not None: coll.name_to_idx[name] = new_idx # Handle clashing names # Either by suffixing or overwriting if suffix_identical_names: # Find the clashing names all_names = list(self.name_to_idx.keys()) + \ list(other.name_to_idx.keys()) duplicate_names = set(self.name_to_idx.keys()).intersection( other.name_to_idx.keys()) if duplicate_names: for coll in [self, other]: for name in duplicate_names: new_name = _create_unique_name(name, all_names) all_names += [new_name] coll.name_to_idx[new_name] = coll.name_to_idx.pop(name) # Update the dict self.name_to_idx.update(other.name_to_idx) # Create idx_to_name dict self.idx_to_name = {v: k for k, v in self.name_to_idx.items()} # Assign the combined timestamps self.timestamps = [x[0] for x in combined_timestamps] def _list_to_enumerated_tuple(l, identifier): def make_tuple(t, i, identifier): if identifier is None: return (t, i) return (t, i, identifier) return [make_tuple(t, i, identifier) for i, t in enumerate(l)] def _create_unique_name(name, l): # Add underscore name += "_" counter = 0 while name + str(counter) in l: counter += 1 return name + str(counter)
#!/usr/bin/env python # 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 zope.interface import Interface __author__ = 'Oscar Eriksson <[email protected]>' class IDriver(Interface): def init(self): """ creates keyspace, tables, views etc. :return: nothing """ def msg_select(self, msg_id): """ select one message :param msg_id: uuid of the message :return: the message, if found """ def msg_insert(self, msg_id, from_user, to_user, body, domain, timestamp, channel_id, deleted=False) -> None: """ store a new message :param msg_id: uuid of the message :param from_user: id of the user sending the message :param to_user: id of the user receiving the message (or uuid of the target room) :param body: the message text :param domain: private/group :param timestamp: published timestamp :param channel_id: the channel of the room :param deleted: if the message is deleted or not :return: nothing """ def msgs_select_non_deleted_for_user(self, from_user_id: str): """ Get all un-deleted message ids send from a certain user. User by rest api to delete everything from a certain user, which does not happen often so we can allow this filtering, slow query. :param from_user_id: the id of the user to find messages for :return: a list of message ids """ def msgs_select(self, to_user_id: str): """ find all messages sent to a user id/room id :param to_user_id: either a user id or room uuid :return: all messages to this user/room """
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 1997-2021 Andy Lewis # # --------------------------------------------------------------------------- # # For details, see the LICENSE file in this repository # def mean(values): return sum(values)/len(values) def sum2(values): return sum(x*x for x in values) def variance(values): return(sum2(values)/len(values) - mean(values)**2) def stdev(values): return variance(values)**0.5 def percentileindex(p, n): x = n*p/100 return (int(x), True) if x == int(x) else (int(x)+1, False) def quartiles(values): values.sort() n = len(values) i, exact = percentileindex(25, n) Q1 = (values[i]+values[i+1])/2 if exact else values[i] i, exact = percentileindex(50, n) Q2 = (values[i]+values[i+1])/2 if exact else values[i] i, exact = percentileindex(75, n) Q3 = (values[i]+values[i+1])/2 if exact else values[i] return (Q1, Q2, Q3) def regressioninfo(points): n = len(points) xvalues = [x[0] for x in points] yvalues = [x[1] for x in points] sx = sum(xvalues) sx2 = sum2(xvalues) Sxx = sx2 - sx*sx/n sy = sum(yvalues) sy2 = sum2(yvalues) Syy = sy2 - sy*sy/n sxy = sum(x*y for (x, y) in points) Sxy = sxy - sx*sy/n pmcc = Sxy/(Sxx*Syy)**0.5 gradient = Sxy/Sxx yintercept = (sy - gradient*sx)/n return pmcc, gradient, yintercept def convertifnumber(string): try: x = float(string) except ValueError: return string else: n = int(x) return n if n == x else x if __name__=="__main__": points = [(164,6.5), (153,3), (163,4), (157,8), (161,5), (155,4), (168,4), (174,7), (167,6), (164,7), (159,3), (167,6)] pmcc, gradient, yintercept = regressioninfo(points) print(pmcc, gradient, yintercept)
from django.utils import timezone from processes.models import GroupInfo import factory from pytest_factoryboy import register from .group_factory import GroupFactory @register class GroupInfoFactory(factory.django.DjangoModelFactory): class Meta: model = GroupInfo group = factory.SubFactory(GroupFactory) api_credits_used_current_month = 0 api_credits_used_previous_month = 500 api_last_used_at = timezone.now() updated_at = timezone.now()
from padinfo.core.find_monster import findMonsterCustom2 async def perform_transforminfo_query(dgcog, raw_query, beta_id3): db_context = dgcog.database mgraph = dgcog.database.graph found_monster, err, debug_info = await findMonsterCustom2(dgcog, beta_id3, raw_query) if not found_monster: return found_monster, err, debug_info, None altversions = mgraph.process_alt_versions(found_monster.monster_id) for mon_id in sorted(altversions): if mgraph.monster_is_transform_base_by_id(mon_id): transformed_mon = dgcog.get_monster(mgraph.get_next_transform_id_by_monster_id(mon_id)) if transformed_mon: base_mon = dgcog.get_monster(mon_id) break if not transformed_mon: return found_monster, err, debug_info, transformed_mon return base_mon, err, debug_info, transformed_mon
# Generated by Django 2.2.4 on 2019-08-09 21:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0001_initial'), ] operations = [ migrations.AlterField( model_name='post', name='content', field=models.TextField(blank=True, default='', verbose_name='content'), ), migrations.AlterField( model_name='post', name='excerpt', field=models.TextField(blank=True, default='', verbose_name='excerpt'), ), ]
import unittest try: import vimba from vimba import Vimba, VimbaFeatureError except Exception: raise unittest.SkipTest( "vimba not installed. Skipping all tests in avt_camera_test.py") from pysilico_server.devices.avtCamera import AvtCamera from time import sleep import functools def withCamera(): def wrapperFunc(f): @functools.wraps(f) def wrapper(self, *args, **kwds): with Vimba.get_instance(): with self._vimbacamera: return f(self, *args, **kwds) return wrapper return wrapperFunc class HwAvtCameraTest(unittest.TestCase): def setUp(self): with Vimba.get_instance() as v: self._vimbacamera = v.get_all_cameras()[0] self._cam = AvtCamera(self._vimbacamera, 'camera_name') def test_exposure_time(self): self._cam.setExposureTime(100) exp_time = self._cam.exposureTime() self.assertAlmostEqual(100, exp_time) self._cam.setExposureTime(200) exp_time = self._cam.exposureTime() self.assertAlmostEqual(200, exp_time) def test_after_initialize(self): self.assertAlmostEqual(10000000, self._cam.getStreamBytesPerSecond()) self.assertAlmostEqual(1, self._cam.getBinning()) @withCamera() def test_framerate(self): wanted = 2 self._cam.startAcquisition() sleep(3) self._cam.setFrameRate(wanted) got = self._cam.getFrameRate() self._cam.stopAcquisition() self.assertAlmostEqual(wanted, got) def test_print_info(self): print('model name %s' % self._cam.deviceModelName()) print('id %s' % self._cam.deviceID()) print('ip address %s' % self._cam.ipAddress()) class VimbaTest(unittest.TestCase): def test_list_features(self): with Vimba.get_instance() as v: vimbacamera = v.get_all_cameras()[0] with vimbacamera: for feature in vimbacamera.get_all_features(): self._print_feature(feature) def _print_feature(self, feature): try: value = feature.get() except (AttributeError, VimbaFeatureError): value = None print('/// Feature name : {}'.format(feature.get_name())) print('/// Display name : {}'.format(feature.get_display_name())) print('/// Tooltip : {}'.format(feature.get_tooltip())) print('/// Description : {}'.format(feature.get_description())) print('/// SFNC Namespace : {}'.format(feature.get_sfnc_namespace())) print('/// Unit : {}'.format(feature.get_unit())) print('/// Value : {}\n'.format(str(value))) if __name__ == "__main__": # import sys;sys.argv = ['', 'Test.testName'] unittest.main()
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # 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. # ------------------------------------------------------------------------- """\ ======================== Doctree to HTML Renderer ======================== Renderer for converting docutils document trees to HTML output with Kamaelia website specific directives, and automatic links for certain text patterns. """ import textwrap import inspect import pprint import time from docutils import core from docutils import nodes import docutils import re class RenderHTML(object): """\ RenderHTML([debug][,titlePrefix][,urlPrefix][,rawFooter]) -> new RenderHTML object Renders docutils document trees to html with Kamaelia website specific directives. Also contains helper functions for determining filenames and URIs for documents. Keyword arguments:: - debug -- Optional. True for debugging mode - currently does nothing (default=False) - titlePrefix -- Optional. Prefix for the HTML <head><title> (default="") - urlPrefix -- Optional. Prefix for all URLs. Should include a trailing slash if needed (default="") - rawFooter -- Optional. Footer text that will be appended just before the </body></html> tags (default="") """ def __init__(self, debug=False, titlePrefix="", urlPrefix="",rawFooter=""): super(RenderHTML,self).__init__() self.titlePrefix=titlePrefix self.debug=debug self.urlPrefix=urlPrefix self.rawFooter=rawFooter self.mappings={} def makeFilename(self, docName): """\ Returns the file name for a given document name. Eg. "Kamaelia.Chassis" will be mapped to something like "Kamaelia.Chassis.html" """ return docName + ".html" def makeURI(self, docName,internalRef=None): """\ Returns the URI for a given document name. Takes into account the url prefix. Eg. "Kamaelia.Chassis" will be mapped to something like "/mydocs/Kamaelia.Chassis.html" """ if internalRef is not None: suffix="#"+internalRef else: suffix="" return self.urlPrefix+self.makeFilename(docName)+suffix def setAutoCrossLinks(self, mappings): """\ Set mapping for the automagic generation of hyperlinks between content. Supply a dict of mappings mapping patterns (strings) to the fully qualified entity name to be linked to. """ self.mappings = {} for (key,ref) in mappings.items(): # compile as an RE - detects the pattern providing nothign preceeds it, # and it is not part of a larger pattern, eg A.B is part of A.B.C pattern=re.compile("(?<![a-zA-Z0-9._])"+re.escape(key)+"(?!\.?[a-zA-Z0-9_])") # convert the destination to a URI uri = self.makeURI(ref) self.mappings[pattern] = uri def addAutoLinksToURI(self, mappings): for (key,uri) in mappings.items(): pattern=re.compile("(?<![a-zA-Z0-9._])"+re.escape(key)+"(?!\.?[a-zA-Z0-9_])") self.mappings[pattern] = uri def render(self, docName, docTree): """\ Render the named document tree as HTML with Kamaelia website specific directives. Returns string containing the entire HTML document. """ if not isinstance(docTree, nodes.document): root = core.publish_doctree('') root.append(docTree) docTree = root docTree.attributes['title']=docName # do this first, before we turn the boxright nodes into "[ [boxright] ... ]" docTree.transformer.add_transform(squareBracketReplace_transform) docTree.transformer.apply_transforms() docTree.transformer.add_transform(boxright_transform) docTree.transformer.add_transform(crosslink_transform, priority=None, mappings=self.mappings) docTree.transformer.apply_transforms() reader = docutils.readers.doctree.Reader(parser_name='null') pub = core.Publisher(reader, None, None, source=docutils.io.DocTreeInput(docTree), destination_class=docutils.io.StringOutput) pub.set_writer("html") output = pub.publish(enable_exit_status=None) parts = pub.writer.parts doc = parts["html_title"] \ + parts["html_subtitle"] \ + parts["docinfo"] \ + parts["fragment"] wholedoc = self.headers(docTree) + doc + self.footers(docTree) return wholedoc def headers(self,doc): title = self.titlePrefix + doc.attributes['title'] return """\ <html> <head> <title>"""+title+"""</title> <style type="test/css"> pre.literal-block, pre.doctest-block { margin-left: 2em ; margin-right: 2em ; background-color: #eeeeee } </style> </head> <body> """ def footers(self,doc): return self.rawFooter+"</body></html>\n" from Nodes import boxright class boxright_transform(docutils.transforms.Transform): """\ Transform that replaces boxright nodes with the corresponding Kamaelia website [[boxright] <child node content> ] directive """ default_priority=100 def apply(self): boxes=[] for target in self.document.traverse(boxright): target.insert(0, nodes.Text("[[boxright] ")) target.append(nodes.Text("]")) boxes.append(target) for box in boxes: box.replace_self( nodes.container('', *box.children) ) class crosslink_transform(docutils.transforms.Transform): """\ Transform that searches text in the document for any of the patterns in the supplied set of mappings. If a pattern is found it is converted to a hyperlink """ default_priority=100 def apply(self, mappings): self.mappings = mappings self.recurse(self.document) def recurse(self, parent): i=0 while i<len(parent.children): thisNode = parent[i] if isinstance(thisNode, nodes.Text): changeMade = self.crosslink(parent, i) if not changeMade: i=i+1 else: if isinstance(thisNode, (nodes.reference,)): # nodes.literal_block)): pass elif thisNode.children: self.recurse(thisNode) i=i+1 def crosslink(self, parent, i): text = parent[i].astext() for pattern in self.mappings.keys(): match = pattern.search(text) if match: head = text[:match.start()] tail = text[match.end():] middle = text[match.start():match.end()] URI = self.mappings[pattern] parent.remove(parent[i]) if tail: parent.insert(i, nodes.Text(tail)) if middle: parent.insert(i, nodes.reference('', nodes.Text(middle), refuri=URI)) if head: parent.insert(i, nodes.Text(head)) return True return False class squareBracketReplace_transform(docutils.transforms.Transform): """\ Transform that replaces square brackets in text with escape codes, so that the Kamaelia website doesn't interpret them as directives """ default_priority=100 def apply(self): for target in self.document.traverse(nodes.Text): newText = target.replace("[","%91%") newText = newText.replace("]","%93%") target.parent.replace(target, newText)
def main(): # Prompt the user to enter a file filename = input("Enter a filename: ").strip() infile = open(filename, "r") # Open the file wordCounts = {} # Create an empty dictionary to count words for line in infile: processLine(line.lower(), wordCounts) pairs = list(wordCounts.items()) # Get pairs from in the list items = [[x, y] for (y, x) in pairs] # Reverse pairs in the list items.sort() # Sort pairs in items for i in range(len(items) - 1, len(items) - 11, -1): print(items[i][1] + "\t" + str(items[i][0])) # Count each word in the line def processLine(line, wordCounts): line = replacePunctuations(line) # Replace punctuation with space words = line.split() # Get words from each line for word in words: if word in wordCounts: wordCounts[word] += 1 else: wordCounts[word] = 1 # Replace punctuation in the line with a space def replacePunctuations(line): for ch in line: if ch in "~!@#$%^&*()_+-={}[]|:;\"'<>?,./": line = line.replace(ch, ' ') return line main() # Call the main function
# coding: utf-8 import math from datetime import datetime from datetime import timedelta import pytz TIMESTAMP_BASEDATE = datetime(year=1970,month=1,day=1,tzinfo=pytz.utc) class TimeUtil: @staticmethod def timestamp_utc(timeaware_datetime): diff = timeaware_datetime - TIMESTAMP_BASEDATE return diff.total_seconds() @staticmethod def now_utc(): return datetime.now(pytz.utc) @staticmethod def now_timestamp_utc(): return TimeUtil.timestamp_utc(TimeUtil.now_utc()) @staticmethod def fromutctimestamp(timestamp): return TIMESTAMP_BASEDATE + timedelta(seconds=timestamp) class BitcoinUtil: @staticmethod def roundBTCby1satoshi(btc): return BitcoinUtil.roundBTC(btc, len("00000001")) @staticmethod def roundBTC(btc, roundDigitCountLessThan1): if roundDigitCountLessThan1 <= 0: return btc # 1satoshi: 0.00000001 btc_str = "%.8f" % btc pos = btc_str.find(".") if pos < 0: #小数点以下なし return btc upper_part = btc_str[0:pos] lower_part = btc_str[pos+1:] # 指定された小数点以下の桁数 len_of_less_than_1 = roundDigitCountLessThan1 if len(lower_part) > len_of_less_than_1: lower_part = lower_part[0:len_of_less_than_1] if upper_part == "": upper_part = "0" return float(upper_part + "." + lower_part)
''' .. module:: skrf.io.general ======================================== general (:mod:`skrf.io.general`) ======================================== General io functions for reading and writing skrf objects .. autosummary:: :toctree: generated/ read read_all read_all_networks write write_all save_sesh Writing output to spreadsheet .. autosummary:: :toctree: generated/ network_2_spreadsheet networkset_2_spreadsheet ''' try: import cPickle as pickle from cPickle import UnpicklingError except ImportError: import pickle as pickle from pickle import UnpicklingError import inspect import os import zipfile import warnings import sys from ..util import get_extn, get_fid from ..network import Network from ..frequency import Frequency from ..media import Media from ..networkSet import NetworkSet from ..calibration.calibration import Calibration from copy import copy dir_ = copy(dir) #delayed import: from pandas import DataFrame, Series for ntwk_2_spreadsheet # file extension conventions for skrf objects. global OBJ_EXTN OBJ_EXTN = [ [Frequency, 'freq'], [Network, 'ntwk'], [NetworkSet, 'ns'], [Calibration, 'cal'], [Media, 'med'], [object, 'p'], ] def read(file, *args, **kwargs): ''' Read skrf object[s] from a pickle file Reads a skrf object that is written with :func:`write`, which uses the :mod:`pickle` module. Parameters ------------ file : str or file-object name of file, or a file-object \*args, \*\*kwargs : arguments and keyword arguments passed through to pickle.load Examples ------------- >>> n = rf.Network(f=[1,2,3],s=[1,1,1],z0=50) >>> n.write('my_ntwk.ntwk') >>> n_2 = rf.read('my_ntwk.ntwk') See Also ---------- read : read a skrf object write : write skrf object[s] read_all : read all skrf objects in a directory write_all : write dictionary of skrf objects to a directory Notes ------- if `file` is a file-object it is left open, if it is a filename then a file-object is opened and closed. If file is a file-object and reading fails, then the position is reset back to 0 using seek if possible. ''' fid = get_fid(file, mode='rb') try: obj = pickle.load(fid, *args, **kwargs) except (UnpicklingError, UnicodeDecodeError) as e: # if fid is seekable then reset to beginning of file fid.seek(0) if isinstance(file, str): # we created the fid so close it fid.close() raise if isinstance(file, str): # we created the fid so close it fid.close() return obj def write(file, obj, overwrite = True): ''' Write skrf object[s] to a file This uses the :mod:`pickle` module to write skrf objects to a file. Note that you can write any pickl-able python object. For example, you can write a list or dictionary of :class:`~skrf.network.Network` objects or :class:`~skrf.calibration.calibration.Calibration` objects. This will write out a single file. If you would like to write out a seperate file for each object, use :func:`write_all`. Parameters ------------ file : file or string File or filename to which the data is saved. If file is a file-object, then the filename is unchanged. If file is a string, an appropriate extension will be appended to the file name if it does not already have an extension. obj : an object, or list/dict of objects object or list/dict of objects to write to disk overwrite : Boolean if file exists, should it be overwritten? Notes ------- If `file` is a str, but doesnt contain a suffix, one is chosen automatically. Here are the extensions ==================================================== =============== skrf object extension ==================================================== =============== :class:`~skrf.frequency.Frequency` '.freq' :class:`~skrf.network.Network` '.ntwk' :class:`~skrf.networkSet.NetworkSet` '.ns' :class:`~skrf.calibration.calibration.Calibration` '.cal' :class:`~skrf.media.media.Media` '.med' other '.p' ==================================================== =============== To make file written by this method cross-platform, the pickling protocol 2 is used. See :mod:`pickle` for more info. Examples ------------- Convert a touchstone file to a pickled Network, >>> n = rf.Network('my_ntwk.s2p') >>> rf.write('my_ntwk',n) >>> n_red = rf.read('my_ntwk.ntwk') Writing a list of different objects >>> n = rf.Network('my_ntwk.s2p') >>> ns = rf.NetworkSet([n,n,n]) >>> rf.write('out',[n,ns]) >>> n_red = rf.read('out.p') See Also ------------ read : read a skrf object write : write skrf object[s] read_all : read all skrf objects in a directory write_all : write dictionary of skrf objects to a directory skrf.network.Network.write : write method of Network skrf.calibration.calibration.Calibration.write : write method of Calibration ''' if isinstance(file, str): extn = get_extn(file) if extn is None: # if there is not extension add one for obj_extn in OBJ_EXTN: if isinstance(obj, obj_extn[0]): extn = obj_extn[1] break file = file + '.' + extn if os.path.exists(file): if not overwrite: warnings.warn('file exists, and overwrite option is False. Not writing.') return with open(file, 'wb') as fid: pickle.dump(obj, fid, protocol=2) else: fid = file pickle.dump(obj, fid, protocol=2) fid.close() def read_all(dir='.', contains = None, f_unit = None, obj_type=None): ''' Read all skrf objects in a directory Attempts to load all files in `dir`, using :func:`read`. Any file that is not readable by skrf is skipped. Optionally, simple filtering can be achieved through the use of `contains` argument. Parameters -------------- dir : str, optional the directory to load from, default \'.\' contains : str, optional if not None, only files containing this substring will be loaded f_unit : ['hz','khz','mhz','ghz','thz'] for all :class:`~skrf.network.Network` objects, set their frequencies's :attr:`~skrf.frequency.Frequency.f_unit` obj_type : str Name of skrf object types to read (ie 'Network') Returns --------- out : dictionary dictionary containing all loaded skrf objects. keys are the filenames without extensions, and the values are the objects Examples ---------- >>> rf.read_all('skrf/data/') {'delay_short': 1-Port Network: 'delay_short', 75-110 GHz, 201 pts, z0=[ 50.+0.j], 'line': 2-Port Network: 'line', 75-110 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j], 'ntwk1': 2-Port Network: 'ntwk1', 1-10 GHz, 91 pts, z0=[ 50.+0.j 50.+0.j], 'one_port': one port Calibration: 'one_port', 500-750 GHz, 201 pts, 4-ideals/4-measured, ... >>> rf.read_all('skrf/data/', obj_type = 'Network') {'delay_short': 1-Port Network: 'delay_short', 75-110 GHz, 201 pts, z0=[ 50.+0.j], 'line': 2-Port Network: 'line', 75-110 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j], 'ntwk1': 2-Port Network: 'ntwk1', 1-10 GHz, 91 pts, z0=[ 50.+0.j 50.+0.j], ... See Also ---------- read : read a skrf object write : write skrf object[s] read_all : read all skrf objects in a directory write_all : write dictionary of skrf objects to a directory ''' out={} for filename in os.listdir(dir): if contains is not None and contains not in filename: continue fullname = os.path.join(dir,filename) keyname = os.path.splitext(filename)[0] try: out[keyname] = read(fullname) continue except: pass try: out[keyname] = Network(fullname) continue except: pass if f_unit is not None: for keyname in out: try: out[keyname].frequency.unit = f_unit except: pass if obj_type is not None: out = dict([(k, out[k]) for k in out if isinstance(out[k],sys.modules[__name__].__dict__[obj_type])]) return out def read_all_networks(*args, **kwargs): ''' Read all networks in a directory. This is a convenience function. It just calls:: read_all(*args,obj_type='Network', **kwargs) See Also ---------- read_all ''' if 'f_unit' not in kwargs: kwargs.update({'f_unit':'ghz'}) return read_all(*args,obj_type='Network', **kwargs) ran = read_all_networks def write_all(dict_objs, dir='.', *args, **kwargs): ''' Write a dictionary of skrf objects individual files in `dir`. Each object is written to its own file. The filename used for each object is taken from its key in the dictionary. If no extension exists in the key, then one is added. See :func:`write` for a list of extensions. If you would like to write the dictionary to a single output file use :func:`write`. Notes ------- Any object in dict_objs that is pickl-able will be written. Parameters ------------ dict_objs : dict dictionary of skrf objects dir : str directory to save skrf objects into \*args, \*\*kwargs : passed through to :func:`~skrf.io.general.write`. `overwrite` option may be of use. See Also ----------- read : read a skrf object write : write skrf object[s] read_all : read all skrf objects in a directory write_all : write dictionary of skrf objects to a directory Examples ---------- Writing a diction of different skrf objects >>> from skrf.data import line, short >>> d = {'ring_slot':ring_slot, 'one_port_cal':one_port_cal} >>> rf.write_all(d) ''' if not os.path.exists('.'): raise OSError('No such directory: %s'%dir) for k in dict_objs: filename = k obj = dict_objs[k] extn = get_extn(filename) if extn is None: # if there is not extension add one for obj_extn in OBJ_EXTN: if isinstance(obj, obj_extn[0]): extn = obj_extn[1] break filename = filename + '.' + extn try: with open(os.path.join(dir+'/', filename), 'w') as fid: write(fid, obj,*args, **kwargs) except Exception as inst: print(inst) warnings.warn('couldnt write %s: %s'%(k,inst.strerror)) pass def save_sesh(dict_objs, file='skrfSesh.p', module='skrf', exclude_prefix='_'): ''' Save all `skrf` objects in the local namespace. This is used to save current workspace in a hurry, by passing it the output of :func:`locals` (see Examples). Note this can be used for other modules as well by passing a different `module` name. Parameters ------------ dict_objs : dict dictionary containing `skrf` objects. See the Example. file : str or file-object, optional the file to save all objects to module : str, optional the module name to grep for. exclude_prefix: str, optional dont save objects which have this as a prefix. See Also ---------- read : read a skrf object write : write skrf object[s] read_all : read all skrf objects in a directory write_all : write dictionary of skrf objects to a directory Examples --------- Write out all skrf objects in current namespace. >>> rf.write_all(locals(), 'mysesh.p') ''' objects = {} print('pickling: ') for k in dict_objs: try: if module in inspect.getmodule(dict_objs[k]).__name__: try: pickle.dumps(dict_objs[k]) if k[0] != '_': objects[k] = dict_objs[k] print(k+', ') finally: pass except(AttributeError, TypeError): pass if len (objects ) == 0: print('nothing') write(file, objects) def load_all_touchstones(dir = '.', contains=None, f_unit=None): ''' Loads all touchtone files in a given dir into a dictionary. Notes ------- Alternatively you can use the :func:`read_all` function. Parameters ----------- dir : string the path contains : string a string the filenames must contain to be loaded. f_unit : ['hz','mhz','ghz'] the frequency unit to assign all loaded networks. see :attr:`frequency.Frequency.unit`. Returns --------- ntwkDict : a dictonary with keys equal to the file name (without a suffix), and values equal to the corresponding ntwk types Examples ---------- >>> ntwk_dict = rf.load_all_touchstones('.', contains ='20v') See Also ----------- read_all ''' ntwkDict = {} for f in os.listdir (dir): if contains is not None and contains not in f: continue fullname = os.path.join(dir,f) keyname,extn = os.path.splitext(f) extn = extn.lower() try: if extn[1]== 's' and extn[-1]=='p': ntwkDict[keyname]=(Network(dir +'/'+f)) if f_unit is not None: ntwkDict[keyname].frequency.unit=f_unit except: pass return ntwkDict def write_dict_of_networks(ntwkDict, dir='.'): ''' Saves a dictionary of networks touchstone files in a given directory The filenames assigned to the touchstone files are taken from the keys of the dictionary. Parameters ----------- ntwkDict : dictionary dictionary of :class:`Network` objects dir : string directory to write touchstone file to ''' warnings.warn('Deprecated. use write_all.', DeprecationWarning) for ntwkKey in ntwkDict: ntwkDict[ntwkKey].write_touchstone(filename = dir+'/'+ntwkKey) def read_csv(filename): ''' Read a 2-port s-parameter data from a csv file. Specifically, this reads a two-port csv file saved from a Rohde Shcwarz ZVA-40, and possibly other network analyzers. It returns into a :class:`Network` object. Parameters ------------ filename : str name of file Returns -------- ntwk : :class:`Network` object the network representing data in the csv file ''' ntwk = Network(name=filename[:-4]) try: data = npy.loadtxt(filename, skiprows=3,delimiter=',',\ usecols=range(9)) s11 = data[:,1] +1j*data[:,2] s21 = data[:,3] +1j*data[:,4] s12 = data[:,5] +1j*data[:,6] s22 = data[:,7] +1j*data[:,8] ntwk.s = npy.array([[s11, s21],[s12,s22]]).transpose().reshape(-1,2,2) except(IndexError): data = npy.loadtxt(filename, skiprows=3,delimiter=',',\ usecols=range(3)) ntwk.s = data[:,1] +1j*data[:,2] ntwk.frequency.f = data[:,0] ntwk.frequency.unit='ghz' return ntwk ## file conversion def statistical_2_touchstone(file_name, new_file_name=None,\ header_string='# GHz S RI R 50.0'): ''' Converts Statistical file to a touchstone file. Converts the file format used by Statistical and other Dylan Williams software to standard touchstone format. Parameters ------------ file_name : string name of file to convert new_file_name : string name of new file to write out (including extension) header_string : string touchstone header written to first beginning of file ''' if new_file_name is None: new_file_name = 'tmp-'+file_name remove_tmp_file = True # This breaks compatibility with python 2.6 and older with file(file_name, 'r') as old_file, open(new_file_name, 'w') as new_file: new_file.write('%s\n'%header_string) for line in old_file: new_file.write(line) if remove_tmp_file is True: os.rename(new_file_name,file_name) def network_2_spreadsheet(ntwk, file_name =None, file_type= 'excel', form='db', *args, **kwargs): ''' Write a Network object to a spreadsheet, for your boss Write the s-parameters of a network to a spreadsheet, in a variety of forms. This functions makes use of the pandas module, which in turn makes use of the xlrd module. These are imported during this function call. For more details about the file-writing functions see the pandas.DataFrom.to_?? functions. Notes ------ The frequency unit used in the spreadsheet is take from `ntwk.frequency.unit` Parameters ----------- ntwk : :class:`~skrf.network.Network` object the network to write file_name : str, None the file_name to write. if None, ntwk.name is used. file_type : ['csv','excel','html'] the type of file to write. See pandas.DataFrame.to_??? functions. form : 'db','ma','ri' format to write data, * db = db, deg * ma = mag, deg * ri = real, imag \*args, \*\*kwargs : passed to pandas.DataFrame.to_??? functions. See Also --------- networkset_2_spreadsheet : writes a spreadsheet for many networks ''' from pandas import DataFrame, Series # delayed because its not a requirement file_extns = {'csv':'csv','excel':'xls','html':'html'} form = form.lower() if form not in ['db','ri','ma']: raise ValueError('`form` must be either `db`,`ma`,`ri`') file_type = file_type.lower() if file_type not in file_extns.keys(): raise ValueError('file_type must be `csv`,`html`,`excel` ') if ntwk.name is None and file_name is None: raise ValueError('Either ntwk must have name or give a file_name') if file_name is None and 'excel_writer' not in kwargs.keys(): file_name = ntwk.name + '.'+file_extns[file_type] d = {} index =ntwk.frequency.f_scaled if form =='db': for m,n in ntwk.port_tuples: d['S%i%i Log Mag(dB)'%(m+1,n+1)] = \ Series(ntwk.s_db[:,m,n], index = index) d[u'S%i%i Phase(deg)'%(m+1,n+1)] = \ Series(ntwk.s_deg[:,m,n], index = index) elif form =='ma': for m,n in ntwk.port_tuples: d['S%i%i Mag(lin)'%(m+1,n+1)] = \ Series(ntwk.s_mag[:,m,n], index = index) d[u'S%i%i Phase(deg)'%(m+1,n+1)] = \ Series(ntwk.s_deg[:,m,n], index = index) elif form =='ri': for m,n in ntwk.port_tuples: d['S%i%i Real'%(m+1,n+1)] = \ Series(ntwk.s_re[:,m,n], index = index) d[u'S%i%i Imag'%(m+1,n+1)] = \ Series(ntwk.s_im[:,m,n], index = index) df = DataFrame(d) df.__getattribute__('to_%s'%file_type)(file_name, index_label='Freq(%s)'%ntwk.frequency.unit, *args, **kwargs) def network_2_dataframe(ntwk, attrs=['s_db'], ports = None): ''' Convert one or more attributes of a network to a pandas DataFrame Parameters -------------- ntwk : :class:`~skrf.network.Network` object the network to write attrs : list Network attributes like ['s_db','s_deg'] ports : list of tuples list of port pairs to write. defaults to ntwk.port_tuples (like [[0,0]]) Returns ---------- df : pandas DataFrame Object ''' from pandas import DataFrame, Series # delayed because its not a requirement d = {} index =ntwk.frequency.f_scaled if ports is None: ports = ntwk.port_tuples for attr in attrs: for m,n in ports: d['%s %i%i'%(attr, m+1,n+1)] = \ Series(ntwk.__getattribute__(attr)[:,m,n], index = index) return DataFrame(d) def networkset_2_spreadsheet(ntwkset, file_name=None, file_type= 'excel', *args, **kwargs): ''' Write a NetworkSet object to a spreadsheet, for your boss Write the s-parameters of a each network in the networkset to a spreadsheet. If the `excel` file_type is used, then each network, is written to its own sheet, with the sheetname taken from the network `name` attribute. This functions makes use of the pandas module, which in turn makes use of the xlrd module. These are imported during this function Notes ------ The frequency unit used in the spreadsheet is take from `ntwk.frequency.unit` Parameters ----------- ntwkset : :class:`~skrf.networkSet.NetworkSet` object the network to write file_name : str, None the file_name to write. if None, ntwk.name is used. file_type : ['csv','excel','html'] the type of file to write. See pandas.DataFrame.to_??? functions. form : 'db','ma','ri' format to write data, * db = db, deg * ma = mag, deg * ri = real, imag \*args, \*\*kwargs : passed to pandas.DataFrame.to_??? functions. See Also --------- networkset_2_spreadsheet : writes a spreadsheet for many networks ''' from pandas import DataFrame, Series, ExcelWriter # delayed because its not a requirement if ntwkset.name is None and file_name is None: raise(ValueError('Either ntwkset must have name or give a file_name')) if file_type == 'excel': writer = ExcelWriter(file_name) [network_2_spreadsheet(k, writer, sheet_name =k.name, *args, **kwargs) for k in ntwkset] writer.save() else: [network_2_spreadsheet(k,*args, **kwargs) for k in ntwkset]
#AmendEmployeeScreen ADMIN_PASS_INCORRECT = u"The Administrator password was incorrect." AMEND_BUTTON_TEXT = u"Amend" AMEND_BY_TEXT = u"Amend Field : " AMEND_EMP_SCREEN_NONETYPE_ERROR_TEXT = u"Please enter Amendment Criteria." AMEND_FOR_TEXT = u"Amend to : " AMEND_FOR_EMPLOYEES_TEXT = u"Amend a Record : " BACK_BUTTON_TEXT = u"Back" CODE_TEXT = u"Code" DEPARTMENT_TEXT = u"Department" DOB_TEXT = u"DOB" DROPDOWN_DEPARTMENT_TEXT = u"Department" DROPDOWN_DOB_TEXT = u"DOB" DROPDOWN_EMPCODE_TEXT = u"Employee Code" DROPDOWN_NAME_TEXT = u"Name" DROPDOWN_SALARY_TEXT = u"Salary" EMP_CODE_TEXT = u"Employee Code" GENDER_TEXT = u"Gender" HELP_OPTION_TEXT = u"Here you can amend employee records by field." INVALID_DOB_TEXT = u"Please enter a valid DOB (DD/MM/YYYY)" NAME_TEXT = u"Name" NO_EMP_RECORDS_TEXT = u"There are no employee records." SALARY_TEXT = u"Salary"
# -*- coding: utf-8 -*- """ 1656. Design an Ordered Stream There is a stream of n (id, value) pairs arriving in an arbitrary order, where id is an integer between 1 and n and value is a string. No two pairs have the same id. Design a stream that returns the values in increasing order of their IDs by returning a chunk (list) of values after each insertion. The concatenation of all the chunks should result in a list of the sorted values. Implement the OrderedStream class: OrderedStream(int n) Constructs the stream to take n values. String[] insert(int id, String value) Inserts the pair (id, value) into the stream, then returns the largest possible chunk of currently inserted values that appear next in the order. Constraints: 1 <= n <= 1000 1 <= id <= n value.length == 5 value consists only of lowercase letters. Each call to insert will have a unique id. Exactly n calls will be made to insert. """ class OrderedStream: def __init__(self, n: int): self.cache = dict((i, "") for i in range(1, n + 1)) self.cur_index = 1 self.max_ind = n def insert(self, ind: int, value: str): self.cache[ind] = value res = [] while self.cur_index <= self.max_ind: if self.cache[self.cur_index] == "": break else: res.append(self.cache[self.cur_index]) self.cur_index += 1 return res # Your OrderedStream object will be instantiated and called as such: # obj = OrderedStream(n) # param_1 = obj.insert(id,value)
# -*- coding: utf-8 -*- ####################################################################### # # Series Plugin for Enigma-2 # Coded by betonme (c) 2012 <glaserfrank(at)gmail.com> # Support: http://www.i-have-a-dreambox.com/wbb2/thread.php?threadid=TBD # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # ####################################################################### import logging import os, sys, traceback from Components.config import config localLog = False log = "" logger = None def initLog(): global logger logger = logger or logging.getLogger("AutoTimer") logger.setLevel(logging.DEBUG) logger.handlers = [] if config.plugins.autotimer.log_shell.value: shandler = logging.StreamHandler(sys.stdout) shandler.setLevel(logging.DEBUG) sformatter = logging.Formatter('[%(name)s] %(levelname)s - %(message)s') shandler.setFormatter(sformatter) logger.addHandler(shandler) logger.setLevel(logging.DEBUG) if config.plugins.autotimer.log_write.value: fhandler = logging.FileHandler(config.plugins.autotimer.log_file.value) fhandler.setLevel(logging.DEBUG) fformatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') fhandler.setFormatter(fformatter) logger.addHandler(fhandler) logger.setLevel(logging.DEBUG) def shutdownLog(): global logger if logger: logger.shutdown() def startLog(): global log, localLog log = "" localLog = True def getLog(): global log, localLog localLog = False return log def doDebug(*args): strargs = " ".join( [ str(arg) for arg in args ] ) global logger if logger: logger.debug(strargs) elif config.plugins.autotimer.log_shell.value: print strargs def doLog(*args): strargs = " ".join( [ str(arg) for arg in args ] ) global log, localLog if localLog: log += "&#13;&#10;" + strargs global logger if logger: logger.info(strargs) elif config.plugins.autotimer.log_shell.value: print strargs initLog()
# This file was automatically created by FeynRules 2.3.35 # Mathematica version: 12.1.0 for Linux x86 (64-bit) (March 18, 2020) # Date: Wed 6 Jan 2021 16:20:38 from object_library import all_vertices, Vertex import particles as P import couplings as C import lorentz as L V_1 = Vertex(name = 'V_1', particles = [ P.a, P.W__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVV1, L.VVV10, L.VVV12, L.VVV3, L.VVV4, L.VVV7, L.VVV8 ], couplings = {(0,3):C.GC_333,(0,0):C.GC_359,(0,2):C.GC_207,(0,1):C.GC_206,(0,5):C.GC_3,(0,4):C.GC_440,(0,6):C.GC_448}) V_2 = Vertex(name = 'V_2', particles = [ P.a, P.W__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_457}) V_3 = Vertex(name = 'V_3', particles = [ P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVV10, L.VVV12, L.VVV2, L.VVV3, L.VVV5, L.VVV6, L.VVV7, L.VVV9 ], couplings = {(0,3):C.GC_360,(0,2):C.GC_332,(0,1):C.GC_61,(0,0):C.GC_60,(0,6):C.GC_137,(0,4):C.GC_454,(0,7):C.GC_399,(0,5):C.GC_375}) V_4 = Vertex(name = 'V_4', particles = [ P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_455}) V_5 = Vertex(name = 'V_5', particles = [ P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_446}) V_6 = Vertex(name = 'V_6', particles = [ P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_447}) V_7 = Vertex(name = 'V_7', particles = [ P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_449}) V_8 = Vertex(name = 'V_8', particles = [ P.g, P.g, P.g ], color = [ 'f(1,2,3)' ], lorentz = [ L.VVV10, L.VVV11, L.VVV3, L.VVV7 ], couplings = {(0,2):C.GC_334,(0,1):C.GC_16,(0,0):C.GC_15,(0,3):C.GC_7}) V_9 = Vertex(name = 'V_9', particles = [ P.g, P.g, P.g, P.g ], color = [ 'f(-1,1,2)*f(3,4,-1)', 'f(-1,1,3)*f(2,4,-1)', 'f(-1,1,4)*f(2,3,-1)' ], lorentz = [ L.VVVV1, L.VVVV10, L.VVVV12, L.VVVV13, L.VVVV2, L.VVVV3, L.VVVV4, L.VVVV6, L.VVVV9 ], couplings = {(0,7):C.GC_72,(1,6):C.GC_72,(2,5):C.GC_72,(0,4):C.GC_71,(1,3):C.GC_71,(2,2):C.GC_71,(1,8):C.GC_8,(0,0):C.GC_8,(2,1):C.GC_8}) V_10 = Vertex(name = 'V_10', particles = [ P.g, P.g, P.g, P.g, P.g ], color = [ 'f(-2,1,2)*f(-1,-2,3)*f(4,5,-1)', 'f(-2,1,2)*f(-1,-2,4)*f(3,5,-1)', 'f(-2,1,2)*f(-1,-2,5)*f(3,4,-1)', 'f(-2,1,3)*f(-1,-2,2)*f(4,5,-1)', 'f(-2,1,3)*f(-1,-2,4)*f(2,5,-1)', 'f(-2,1,3)*f(-1,-2,5)*f(2,4,-1)', 'f(-2,1,4)*f(-1,-2,2)*f(3,5,-1)', 'f(-2,1,4)*f(-1,-2,3)*f(2,5,-1)', 'f(-2,1,4)*f(-1,-2,5)*f(2,3,-1)', 'f(-2,1,5)*f(-1,-2,2)*f(3,4,-1)', 'f(-2,1,5)*f(-1,-2,3)*f(2,4,-1)', 'f(-2,1,5)*f(-1,-2,4)*f(2,3,-1)', 'f(-2,2,3)*f(-1,-2,1)*f(4,5,-1)', 'f(-2,2,3)*f(-1,-2,4)*f(1,5,-1)', 'f(-2,2,3)*f(-1,-2,5)*f(1,4,-1)', 'f(-2,2,4)*f(-1,-2,1)*f(3,5,-1)', 'f(-2,2,4)*f(-1,-2,3)*f(1,5,-1)', 'f(-2,2,4)*f(-1,-2,5)*f(1,3,-1)', 'f(-2,2,5)*f(-1,-2,1)*f(3,4,-1)', 'f(-2,2,5)*f(-1,-2,3)*f(1,4,-1)', 'f(-2,2,5)*f(-1,-2,4)*f(1,3,-1)', 'f(-2,3,4)*f(-1,-2,1)*f(2,5,-1)', 'f(-2,3,4)*f(-1,-2,2)*f(1,5,-1)', 'f(-2,3,4)*f(-1,-2,5)*f(1,2,-1)', 'f(-2,3,5)*f(-1,-2,1)*f(2,4,-1)', 'f(-2,3,5)*f(-1,-2,2)*f(1,4,-1)', 'f(-2,3,5)*f(-1,-2,4)*f(1,2,-1)', 'f(-2,4,5)*f(-1,-2,1)*f(2,3,-1)', 'f(-2,4,5)*f(-1,-2,2)*f(1,3,-1)', 'f(-2,4,5)*f(-1,-2,3)*f(1,2,-1)' ], lorentz = [ L.VVVVV1, L.VVVVV10, L.VVVVV11, L.VVVVV12, L.VVVVV13, L.VVVVV14, L.VVVVV15, L.VVVVV17, L.VVVVV18, L.VVVVV19, L.VVVVV2, L.VVVVV20, L.VVVVV21, L.VVVVV22, L.VVVVV23, L.VVVVV24, L.VVVVV25, L.VVVVV28, L.VVVVV29, L.VVVVV3, L.VVVVV30, L.VVVVV31, L.VVVVV33, L.VVVVV34, L.VVVVV35, L.VVVVV36, L.VVVVV37, L.VVVVV4, L.VVVVV40, L.VVVVV41, L.VVVVV42, L.VVVVV43, L.VVVVV44, L.VVVVV46, L.VVVVV47, L.VVVVV48, L.VVVVV49, L.VVVVV5, L.VVVVV50, L.VVVVV51, L.VVVVV53, L.VVVVV54, L.VVVVV6, L.VVVVV7, L.VVVVV9 ], couplings = {(27,37):C.GC_77,(24,8):C.GC_78,(21,12):C.GC_77,(18,11):C.GC_78,(15,9):C.GC_77,(12,27):C.GC_77,(28,42):C.GC_77,(25,15):C.GC_78,(22,14):C.GC_77,(9,16):C.GC_77,(6,13):C.GC_78,(3,43):C.GC_78,(29,0):C.GC_78,(19,20):C.GC_77,(16,18):C.GC_78,(10,17):C.GC_77,(7,21):C.GC_78,(0,44):C.GC_77,(26,10):C.GC_77,(20,1):C.GC_78,(13,24):C.GC_77,(11,2):C.GC_78,(4,22):C.GC_77,(1,23):C.GC_77,(23,19):C.GC_78,(17,4):C.GC_77,(14,25):C.GC_78,(8,3):C.GC_77,(5,28):C.GC_78,(2,26):C.GC_78,(24,29):C.GC_76,(21,30):C.GC_75,(18,30):C.GC_76,(15,29):C.GC_75,(28,6):C.GC_76,(22,34):C.GC_76,(9,34):C.GC_75,(3,6):C.GC_75,(29,7):C.GC_76,(16,35):C.GC_76,(10,35):C.GC_75,(0,7):C.GC_75,(26,39):C.GC_75,(20,38):C.GC_75,(4,38):C.GC_76,(1,39):C.GC_76,(25,33):C.GC_76,(6,33):C.GC_75,(19,36):C.GC_76,(7,36):C.GC_75,(23,41):C.GC_75,(17,40):C.GC_75,(5,40):C.GC_76,(2,41):C.GC_76,(27,5):C.GC_76,(12,5):C.GC_75,(13,31):C.GC_76,(11,31):C.GC_75,(14,32):C.GC_75,(8,32):C.GC_76}) V_11 = Vertex(name = 'V_11', particles = [ P.g, P.g, P.g, P.g, P.g, P.g ], color = [ 'f(-3,1,2)*f(-2,3,4)*f(-1,-2,-3)*f(5,6,-1)', 'f(-3,1,2)*f(-2,3,5)*f(-1,-2,-3)*f(4,6,-1)', 'f(-3,1,2)*f(-2,3,6)*f(-1,-2,-3)*f(4,5,-1)', 'f(-3,1,2)*f(-2,4,5)*f(-1,-2,-3)*f(3,6,-1)', 'f(-3,1,2)*f(-2,4,6)*f(-1,-2,-3)*f(3,5,-1)', 'f(-3,1,2)*f(-2,5,6)*f(-1,-2,-3)*f(3,4,-1)', 'f(-3,1,3)*f(-2,2,4)*f(-1,-2,-3)*f(5,6,-1)', 'f(-3,1,3)*f(-2,2,5)*f(-1,-2,-3)*f(4,6,-1)', 'f(-3,1,3)*f(-2,2,6)*f(-1,-2,-3)*f(4,5,-1)', 'f(-3,1,3)*f(-2,4,5)*f(-1,-2,-3)*f(2,6,-1)', 'f(-3,1,3)*f(-2,4,6)*f(-1,-2,-3)*f(2,5,-1)', 'f(-3,1,3)*f(-2,5,6)*f(-1,-2,-3)*f(2,4,-1)', 'f(-3,1,4)*f(-2,2,3)*f(-1,-2,-3)*f(5,6,-1)', 'f(-3,1,4)*f(-2,2,5)*f(-1,-2,-3)*f(3,6,-1)', 'f(-3,1,4)*f(-2,2,6)*f(-1,-2,-3)*f(3,5,-1)', 'f(-3,1,4)*f(-2,3,5)*f(-1,-2,-3)*f(2,6,-1)', 'f(-3,1,4)*f(-2,3,6)*f(-1,-2,-3)*f(2,5,-1)', 'f(-3,1,4)*f(-2,5,6)*f(-1,-2,-3)*f(2,3,-1)', 'f(-3,1,5)*f(-2,2,3)*f(-1,-2,-3)*f(4,6,-1)', 'f(-3,1,5)*f(-2,2,4)*f(-1,-2,-3)*f(3,6,-1)', 'f(-3,1,5)*f(-2,2,6)*f(-1,-2,-3)*f(3,4,-1)', 'f(-3,1,5)*f(-2,3,4)*f(-1,-2,-3)*f(2,6,-1)', 'f(-3,1,5)*f(-2,3,6)*f(-1,-2,-3)*f(2,4,-1)', 'f(-3,1,5)*f(-2,4,6)*f(-1,-2,-3)*f(2,3,-1)', 'f(-3,1,6)*f(-2,2,3)*f(-1,-2,-3)*f(4,5,-1)', 'f(-3,1,6)*f(-2,2,4)*f(-1,-2,-3)*f(3,5,-1)', 'f(-3,1,6)*f(-2,2,5)*f(-1,-2,-3)*f(3,4,-1)', 'f(-3,1,6)*f(-2,3,4)*f(-1,-2,-3)*f(2,5,-1)', 'f(-3,1,6)*f(-2,3,5)*f(-1,-2,-3)*f(2,4,-1)', 'f(-3,1,6)*f(-2,4,5)*f(-1,-2,-3)*f(2,3,-1)', 'f(-3,2,3)*f(-2,1,4)*f(-1,-2,-3)*f(5,6,-1)', 'f(-3,2,3)*f(-2,1,5)*f(-1,-2,-3)*f(4,6,-1)', 'f(-3,2,3)*f(-2,1,6)*f(-1,-2,-3)*f(4,5,-1)', 'f(-3,2,3)*f(-2,4,5)*f(-1,-2,-3)*f(1,6,-1)', 'f(-3,2,3)*f(-2,4,6)*f(-1,-2,-3)*f(1,5,-1)', 'f(-3,2,3)*f(-2,5,6)*f(-1,-2,-3)*f(1,4,-1)', 'f(-3,2,4)*f(-2,1,3)*f(-1,-2,-3)*f(5,6,-1)', 'f(-3,2,4)*f(-2,1,5)*f(-1,-2,-3)*f(3,6,-1)', 'f(-3,2,4)*f(-2,1,6)*f(-1,-2,-3)*f(3,5,-1)', 'f(-3,2,4)*f(-2,3,5)*f(-1,-2,-3)*f(1,6,-1)', 'f(-3,2,4)*f(-2,3,6)*f(-1,-2,-3)*f(1,5,-1)', 'f(-3,2,4)*f(-2,5,6)*f(-1,-2,-3)*f(1,3,-1)', 'f(-3,2,5)*f(-2,1,3)*f(-1,-2,-3)*f(4,6,-1)', 'f(-3,2,5)*f(-2,1,4)*f(-1,-2,-3)*f(3,6,-1)', 'f(-3,2,5)*f(-2,1,6)*f(-1,-2,-3)*f(3,4,-1)', 'f(-3,2,5)*f(-2,3,4)*f(-1,-2,-3)*f(1,6,-1)', 'f(-3,2,5)*f(-2,3,6)*f(-1,-2,-3)*f(1,4,-1)', 'f(-3,2,5)*f(-2,4,6)*f(-1,-2,-3)*f(1,3,-1)', 'f(-3,2,6)*f(-2,1,3)*f(-1,-2,-3)*f(4,5,-1)', 'f(-3,2,6)*f(-2,1,4)*f(-1,-2,-3)*f(3,5,-1)', 'f(-3,2,6)*f(-2,1,5)*f(-1,-2,-3)*f(3,4,-1)', 'f(-3,2,6)*f(-2,3,4)*f(-1,-2,-3)*f(1,5,-1)', 'f(-3,2,6)*f(-2,3,5)*f(-1,-2,-3)*f(1,4,-1)', 'f(-3,2,6)*f(-2,4,5)*f(-1,-2,-3)*f(1,3,-1)', 'f(-3,3,4)*f(-2,1,2)*f(-1,-2,-3)*f(5,6,-1)', 'f(-3,3,4)*f(-2,1,5)*f(-1,-2,-3)*f(2,6,-1)', 'f(-3,3,4)*f(-2,1,6)*f(-1,-2,-3)*f(2,5,-1)', 'f(-3,3,4)*f(-2,2,5)*f(-1,-2,-3)*f(1,6,-1)', 'f(-3,3,4)*f(-2,2,6)*f(-1,-2,-3)*f(1,5,-1)', 'f(-3,3,4)*f(-2,5,6)*f(-1,-2,-3)*f(1,2,-1)', 'f(-3,3,5)*f(-2,1,2)*f(-1,-2,-3)*f(4,6,-1)', 'f(-3,3,5)*f(-2,1,4)*f(-1,-2,-3)*f(2,6,-1)', 'f(-3,3,5)*f(-2,1,6)*f(-1,-2,-3)*f(2,4,-1)', 'f(-3,3,5)*f(-2,2,4)*f(-1,-2,-3)*f(1,6,-1)', 'f(-3,3,5)*f(-2,2,6)*f(-1,-2,-3)*f(1,4,-1)', 'f(-3,3,5)*f(-2,4,6)*f(-1,-2,-3)*f(1,2,-1)', 'f(-3,3,6)*f(-2,1,2)*f(-1,-2,-3)*f(4,5,-1)', 'f(-3,3,6)*f(-2,1,4)*f(-1,-2,-3)*f(2,5,-1)', 'f(-3,3,6)*f(-2,1,5)*f(-1,-2,-3)*f(2,4,-1)', 'f(-3,3,6)*f(-2,2,4)*f(-1,-2,-3)*f(1,5,-1)', 'f(-3,3,6)*f(-2,2,5)*f(-1,-2,-3)*f(1,4,-1)', 'f(-3,3,6)*f(-2,4,5)*f(-1,-2,-3)*f(1,2,-1)', 'f(-3,4,5)*f(-2,1,2)*f(-1,-2,-3)*f(3,6,-1)', 'f(-3,4,5)*f(-2,1,3)*f(-1,-2,-3)*f(2,6,-1)', 'f(-3,4,5)*f(-2,1,6)*f(-1,-2,-3)*f(2,3,-1)', 'f(-3,4,5)*f(-2,2,3)*f(-1,-2,-3)*f(1,6,-1)', 'f(-3,4,5)*f(-2,2,6)*f(-1,-2,-3)*f(1,3,-1)', 'f(-3,4,5)*f(-2,3,6)*f(-1,-2,-3)*f(1,2,-1)', 'f(-3,4,6)*f(-2,1,2)*f(-1,-2,-3)*f(3,5,-1)', 'f(-3,4,6)*f(-2,1,3)*f(-1,-2,-3)*f(2,5,-1)', 'f(-3,4,6)*f(-2,1,5)*f(-1,-2,-3)*f(2,3,-1)', 'f(-3,4,6)*f(-2,2,3)*f(-1,-2,-3)*f(1,5,-1)', 'f(-3,4,6)*f(-2,2,5)*f(-1,-2,-3)*f(1,3,-1)', 'f(-3,4,6)*f(-2,3,5)*f(-1,-2,-3)*f(1,2,-1)', 'f(-3,5,6)*f(-2,1,2)*f(-1,-2,-3)*f(3,4,-1)', 'f(-3,5,6)*f(-2,1,3)*f(-1,-2,-3)*f(2,4,-1)', 'f(-3,5,6)*f(-2,1,4)*f(-1,-2,-3)*f(2,3,-1)', 'f(-3,5,6)*f(-2,2,3)*f(-1,-2,-3)*f(1,4,-1)', 'f(-3,5,6)*f(-2,2,4)*f(-1,-2,-3)*f(1,3,-1)', 'f(-3,5,6)*f(-2,3,4)*f(-1,-2,-3)*f(1,2,-1)' ], lorentz = [ L.VVVVVV1, L.VVVVVV10, L.VVVVVV11, L.VVVVVV12, L.VVVVVV13, L.VVVVVV14, L.VVVVVV15, L.VVVVVV16, L.VVVVVV17, L.VVVVVV18, L.VVVVVV19, L.VVVVVV2, L.VVVVVV20, L.VVVVVV21, L.VVVVVV22, L.VVVVVV23, L.VVVVVV24, L.VVVVVV25, L.VVVVVV26, L.VVVVVV27, L.VVVVVV28, L.VVVVVV29, L.VVVVVV3, L.VVVVVV30, L.VVVVVV31, L.VVVVVV32, L.VVVVVV33, L.VVVVVV34, L.VVVVVV35, L.VVVVVV36, L.VVVVVV37, L.VVVVVV38, L.VVVVVV39, L.VVVVVV4, L.VVVVVV40, L.VVVVVV41, L.VVVVVV42, L.VVVVVV43, L.VVVVVV44, L.VVVVVV45, L.VVVVVV46, L.VVVVVV47, L.VVVVVV48, L.VVVVVV49, L.VVVVVV5, L.VVVVVV50, L.VVVVVV51, L.VVVVVV52, L.VVVVVV54, L.VVVVVV55, L.VVVVVV56, L.VVVVVV57, L.VVVVVV58, L.VVVVVV59, L.VVVVVV6, L.VVVVVV60, L.VVVVVV61, L.VVVVVV7, L.VVVVVV8, L.VVVVVV9 ], couplings = {(41,58):C.GC_83,(47,59):C.GC_82,(53,7):C.GC_83,(35,57):C.GC_82,(46,14):C.GC_83,(52,17):C.GC_82,(34,2):C.GC_83,(40,10):C.GC_82,(51,37):C.GC_83,(33,4):C.GC_82,(39,21):C.GC_83,(45,30):C.GC_82,(17,57):C.GC_83,(23,2):C.GC_82,(29,4):C.GC_83,(11,58):C.GC_82,(22,10):C.GC_83,(28,21):C.GC_82,(10,59):C.GC_83,(16,14):C.GC_82,(27,30):C.GC_83,(9,7):C.GC_82,(15,17):C.GC_83,(21,37):C.GC_82,(59,0):C.GC_83,(65,11):C.GC_82,(71,44):C.GC_83,(64,12):C.GC_83,(70,23):C.GC_82,(58,16):C.GC_82,(69,31):C.GC_83,(57,19):C.GC_83,(63,39):C.GC_82,(5,0):C.GC_82,(20,16):C.GC_83,(26,19):C.GC_82,(4,11):C.GC_83,(14,12):C.GC_82,(25,39):C.GC_83,(3,44):C.GC_82,(13,23):C.GC_83,(19,31):C.GC_82,(77,22):C.GC_82,(83,33):C.GC_83,(76,1):C.GC_83,(82,8):C.GC_82,(81,40):C.GC_83,(75,35):C.GC_82,(2,22):C.GC_83,(8,1):C.GC_82,(24,35):C.GC_83,(1,33):C.GC_82,(7,8):C.GC_83,(18,40):C.GC_82,(89,54):C.GC_83,(88,6):C.GC_82,(87,25):C.GC_83,(0,54):C.GC_82,(6,6):C.GC_83,(12,25):C.GC_82,(62,15):C.GC_83,(68,18):C.GC_82,(56,13):C.GC_82,(67,38):C.GC_83,(55,24):C.GC_83,(61,32):C.GC_82,(44,13):C.GC_83,(50,24):C.GC_82,(38,15):C.GC_82,(49,32):C.GC_83,(37,18):C.GC_83,(43,38):C.GC_82,(74,3):C.GC_83,(80,5):C.GC_82,(79,34):C.GC_83,(73,42):C.GC_82,(32,3):C.GC_82,(48,42):C.GC_83,(31,5):C.GC_83,(42,34):C.GC_82,(86,9):C.GC_82,(85,20):C.GC_83,(30,9):C.GC_83,(36,20):C.GC_82,(78,41):C.GC_83,(72,36):C.GC_82,(66,36):C.GC_83,(60,41):C.GC_82,(65,43):C.GC_80,(71,46):C.GC_81,(77,46):C.GC_80,(83,43):C.GC_81,(41,28):C.GC_80,(53,50):C.GC_80,(76,50):C.GC_81,(88,28):C.GC_81,(35,29):C.GC_80,(52,53):C.GC_80,(64,53):C.GC_81,(87,29):C.GC_81,(34,52):C.GC_81,(40,51):C.GC_81,(69,51):C.GC_80,(81,52):C.GC_80,(17,29):C.GC_81,(23,52):C.GC_80,(80,52):C.GC_81,(86,29):C.GC_80,(11,28):C.GC_81,(22,51):C.GC_80,(68,51):C.GC_81,(85,28):C.GC_80,(9,50):C.GC_81,(15,53):C.GC_81,(61,53):C.GC_80,(73,50):C.GC_80,(4,43):C.GC_81,(14,53):C.GC_80,(49,53):C.GC_81,(78,43):C.GC_80,(3,46):C.GC_80,(19,51):C.GC_81,(37,51):C.GC_80,(72,46):C.GC_81,(2,46):C.GC_81,(8,50):C.GC_80,(48,50):C.GC_81,(66,46):C.GC_80,(1,43):C.GC_80,(18,52):C.GC_81,(31,52):C.GC_80,(60,43):C.GC_81,(6,28):C.GC_80,(12,29):C.GC_80,(30,29):C.GC_81,(36,28):C.GC_81,(47,48):C.GC_80,(82,48):C.GC_81,(46,55):C.GC_80,(70,55):C.GC_81,(33,56):C.GC_81,(39,49):C.GC_81,(63,49):C.GC_80,(75,56):C.GC_80,(29,56):C.GC_80,(74,56):C.GC_81,(28,49):C.GC_80,(62,49):C.GC_81,(10,48):C.GC_81,(16,55):C.GC_81,(67,55):C.GC_80,(79,48):C.GC_80,(25,49):C.GC_81,(38,49):C.GC_80,(13,55):C.GC_80,(43,55):C.GC_81,(24,56):C.GC_81,(32,56):C.GC_80,(7,48):C.GC_80,(42,48):C.GC_81,(84,26):C.GC_83,(54,26):C.GC_82,(59,27):C.GC_80,(89,27):C.GC_81,(51,45):C.GC_80,(58,45):C.GC_81,(21,45):C.GC_81,(55,45):C.GC_80,(5,27):C.GC_81,(20,45):C.GC_80,(50,45):C.GC_81,(84,27):C.GC_80,(0,27):C.GC_80,(54,27):C.GC_81,(45,47):C.GC_81,(57,47):C.GC_80,(27,47):C.GC_80,(56,47):C.GC_81,(26,47):C.GC_81,(44,47):C.GC_80}) V_12 = Vertex(name = 'V_12', particles = [ P.a, P.a, P.W__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV15, L.VVVV5, L.VVVV8 ], couplings = {(0,1):C.GC_209,(0,0):C.GC_208,(0,2):C.GC_5}) V_13 = Vertex(name = 'V_13', particles = [ P.a, P.a, P.W__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_459}) V_14 = Vertex(name = 'V_14', particles = [ P.a, P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVV11, L.VVVV14, L.VVVV7 ], couplings = {(0,2):C.GC_67,(0,1):C.GC_66,(0,0):C.GC_138}) V_15 = Vertex(name = 'V_15', particles = [ P.a, P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_456}) V_16 = Vertex(name = 'V_16', particles = [ P.a, P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_451}) V_17 = Vertex(name = 'V_17', particles = [ P.a, P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_452}) V_18 = Vertex(name = 'V_18', particles = [ P.a, P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_453}) V_19 = Vertex(name = 'V_19', particles = [ P.a, P.a, P.a, P.W__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVVV16, L.VVVVV8 ], couplings = {(0,1):C.GC_211,(0,0):C.GC_210}) V_20 = Vertex(name = 'V_20', particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV15, L.VVVV5, L.VVVV8 ], couplings = {(0,1):C.GC_164,(0,0):C.GC_162,(0,2):C.GC_98}) V_21 = Vertex(name = 'V_21', particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_376}) V_22 = Vertex(name = 'V_22', particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_379}) V_23 = Vertex(name = 'V_23', particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_382}) V_24 = Vertex(name = 'V_24', particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_442}) V_25 = Vertex(name = 'V_25', particles = [ P.a, P.a, P.W__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVVV26, L.VVVVV55 ], couplings = {(0,0):C.GC_70,(0,1):C.GC_69}) V_26 = Vertex(name = 'V_26', particles = [ P.a, P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVVV32, L.VVVVV57 ], couplings = {(0,0):C.GC_169,(0,1):C.GC_167}) V_27 = Vertex(name = 'V_27', particles = [ P.a, P.a, P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVVVV53 ], couplings = {(0,0):C.GC_171}) V_28 = Vertex(name = 'V_28', particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVV15, L.VVVV5, L.VVVV8 ], couplings = {(0,1):C.GC_165,(0,0):C.GC_163,(0,2):C.GC_100}) V_29 = Vertex(name = 'V_29', particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_377}) V_30 = Vertex(name = 'V_30', particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_380}) V_31 = Vertex(name = 'V_31', particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_381}) V_32 = Vertex(name = 'V_32', particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_458}) V_33 = Vertex(name = 'V_33', particles = [ P.a, P.W__minus__, P.W__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVVV38, L.VVVVV45 ], couplings = {(0,0):C.GC_170,(0,1):C.GC_168}) V_34 = Vertex(name = 'V_34', particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVVV27, L.VVVVV52 ], couplings = {(0,0):C.GC_106,(0,1):C.GC_104}) V_35 = Vertex(name = 'V_35', particles = [ P.a, P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVVVV62 ], couplings = {(0,0):C.GC_108}) V_36 = Vertex(name = 'V_36', particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVVVV53 ], couplings = {(0,0):C.GC_96}) V_37 = Vertex(name = 'V_37', particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVVV39, L.VVVVV56 ], couplings = {(0,0):C.GC_107,(0,1):C.GC_105}) V_38 = Vertex(name = 'V_38', particles = [ P.a, P.a, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS3, L.VVSS6 ], couplings = {(0,0):C.GC_53,(0,1):C.GC_52}) V_39 = Vertex(name = 'V_39', particles = [ P.a, P.a, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS3, L.VVSS6 ], couplings = {(0,0):C.GC_204,(0,1):C.GC_201}) V_40 = Vertex(name = 'V_40', particles = [ P.a, P.a, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS3, L.VVSS6 ], couplings = {(0,0):C.GC_220,(0,1):C.GC_219}) V_41 = Vertex(name = 'V_41', particles = [ P.a, P.a, P.H ], color = [ '1' ], lorentz = [ L.VVS3, L.VVS6 ], couplings = {(0,0):C.GC_270,(0,1):C.GC_224}) V_42 = Vertex(name = 'V_42', particles = [ P.a, P.a, P.H ], color = [ '1' ], lorentz = [ L.VVS3, L.VVS6 ], couplings = {(0,0):C.GC_325,(0,1):C.GC_269}) V_43 = Vertex(name = 'V_43', particles = [ P.a, P.a, P.H ], color = [ '1' ], lorentz = [ L.VVS3, L.VVS6 ], couplings = {(0,0):C.GC_330,(0,1):C.GC_322}) V_44 = Vertex(name = 'V_44', particles = [ P.a, P.a, P.H ], color = [ '1' ], lorentz = [ L.VVS6 ], couplings = {(0,0):C.GC_329}) V_45 = Vertex(name = 'V_45', particles = [ P.g, P.g, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.VVSS3, L.VVSS6 ], couplings = {(0,0):C.GC_21,(0,1):C.GC_20}) V_46 = Vertex(name = 'V_46', particles = [ P.g, P.g, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.VVS3, L.VVS6, L.VVS7, L.VVS8, L.VVS9 ], couplings = {(0,0):C.GC_266,(0,1):C.GC_225,(0,3):C.GC_238,(0,2):C.GC_234,(0,4):C.GC_229}) V_47 = Vertex(name = 'V_47', particles = [ P.g, P.g, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.VVS6 ], couplings = {(0,0):C.GC_265}) V_48 = Vertex(name = 'V_48', particles = [ P.W__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS2, L.VVSS4, L.VVSS6 ], couplings = {(0,0):C.GC_23,(0,2):C.GC_22,(0,1):C.GC_97}) V_49 = Vertex(name = 'V_49', particles = [ P.W__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_339}) V_50 = Vertex(name = 'V_50', particles = [ P.W__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_362}) V_51 = Vertex(name = 'V_51', particles = [ P.W__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_439}) V_52 = Vertex(name = 'V_52', particles = [ P.W__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_378}) V_53 = Vertex(name = 'V_53', particles = [ P.W__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_441}) V_54 = Vertex(name = 'V_54', particles = [ P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVS2, L.VVS4, L.VVS6 ], couplings = {(0,0):C.GC_268,(0,2):C.GC_267,(0,1):C.GC_284}) V_55 = Vertex(name = 'V_55', particles = [ P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_434}) V_56 = Vertex(name = 'V_56', particles = [ P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_460}) V_57 = Vertex(name = 'V_57', particles = [ P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_461}) V_58 = Vertex(name = 'V_58', particles = [ P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_462}) V_59 = Vertex(name = 'V_59', particles = [ P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_463}) V_60 = Vertex(name = 'V_60', particles = [ P.a, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS2, L.VVSS6 ], couplings = {(0,0):C.GC_222,(0,1):C.GC_221}) V_61 = Vertex(name = 'V_61', particles = [ P.a, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS2, L.VVSS6 ], couplings = {(0,0):C.GC_199,(0,1):C.GC_198}) V_62 = Vertex(name = 'V_62', particles = [ P.a, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS2, L.VVSS6 ], couplings = {(0,0):C.GC_205,(0,1):C.GC_200}) V_63 = Vertex(name = 'V_63', particles = [ P.a, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS2, L.VVS6 ], couplings = {(0,0):C.GC_437,(0,1):C.GC_228}) V_64 = Vertex(name = 'V_64', particles = [ P.a, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS2, L.VVS6 ], couplings = {(0,0):C.GC_320,(0,1):C.GC_436}) V_65 = Vertex(name = 'V_65', particles = [ P.a, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS2, L.VVS6 ], couplings = {(0,0):C.GC_326,(0,1):C.GC_319}) V_66 = Vertex(name = 'V_66', particles = [ P.a, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS6 ], couplings = {(0,0):C.GC_321}) V_67 = Vertex(name = 'V_67', particles = [ P.Z, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS1, L.VVSS3, L.VVSS4, L.VVSS5, L.VVSS6 ], couplings = {(0,1):C.GC_55,(0,4):C.GC_54,(0,0):C.GC_202,(0,2):C.GC_99,(0,3):C.GC_223}) V_68 = Vertex(name = 'V_68', particles = [ P.Z, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS3, L.VVSS4, L.VVSS6 ], couplings = {(0,0):C.GC_203,(0,2):C.GC_217,(0,1):C.GC_340}) V_69 = Vertex(name = 'V_69', particles = [ P.Z, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS3, L.VVSS4 ], couplings = {(0,0):C.GC_218,(0,1):C.GC_443}) V_70 = Vertex(name = 'V_70', particles = [ P.Z, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_444}) V_71 = Vertex(name = 'V_71', particles = [ P.Z, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_445}) V_72 = Vertex(name = 'V_72', particles = [ P.Z, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_450}) V_73 = Vertex(name = 'V_73', particles = [ P.Z, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS1, L.VVS3, L.VVS4, L.VVS5, L.VVS6 ], couplings = {(0,1):C.GC_272,(0,4):C.GC_271,(0,0):C.GC_323,(0,2):C.GC_285,(0,3):C.GC_438}) V_74 = Vertex(name = 'V_74', particles = [ P.Z, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS3, L.VVS4, L.VVS6 ], couplings = {(0,0):C.GC_324,(0,2):C.GC_327,(0,1):C.GC_435}) V_75 = Vertex(name = 'V_75', particles = [ P.Z, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS3, L.VVS4 ], couplings = {(0,0):C.GC_328,(0,1):C.GC_464}) V_76 = Vertex(name = 'V_76', particles = [ P.Z, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_465}) V_77 = Vertex(name = 'V_77', particles = [ P.Z, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_466}) V_78 = Vertex(name = 'V_78', particles = [ P.Z, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_467}) V_79 = Vertex(name = 'V_79', particles = [ P.g, P.g, P.g, P.H, P.H ], color = [ 'f(1,2,3)' ], lorentz = [ L.VVVSS3, L.VVVSS6 ], couplings = {(0,0):C.GC_74,(0,1):C.GC_73}) V_80 = Vertex(name = 'V_80', particles = [ P.g, P.g, P.g, P.H ], color = [ 'f(1,2,3)' ], lorentz = [ L.VVVS10, L.VVVS3, L.VVVS6, L.VVVS7, L.VVVS8, L.VVVS9 ], couplings = {(0,1):C.GC_279,(0,4):C.GC_230,(0,0):C.GC_239,(0,5):C.GC_235,(0,3):C.GC_232,(0,2):C.GC_226}) V_81 = Vertex(name = 'V_81', particles = [ P.g, P.g, P.g, P.H ], color = [ 'f(1,2,3)' ], lorentz = [ L.VVVS6 ], couplings = {(0,0):C.GC_278}) V_82 = Vertex(name = 'V_82', particles = [ P.a, P.W__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVVSS1, L.VVVSS3, L.VVVSS4, L.VVVSS6 ], couplings = {(0,1):C.GC_65,(0,0):C.GC_160,(0,3):C.GC_62,(0,2):C.GC_159}) V_83 = Vertex(name = 'V_83', particles = [ P.a, P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVVS1, L.VVVS3, L.VVVS4, L.VVVS6 ], couplings = {(0,1):C.GC_276,(0,0):C.GC_316,(0,3):C.GC_273,(0,2):C.GC_315}) V_84 = Vertex(name = 'V_84', particles = [ P.W__minus__, P.W__plus__, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVVSS2, L.VVVSS3, L.VVVSS5, L.VVVSS6 ], couplings = {(0,1):C.GC_161,(0,0):C.GC_64,(0,3):C.GC_158,(0,2):C.GC_63}) V_85 = Vertex(name = 'V_85', particles = [ P.W__minus__, P.W__plus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVVS2, L.VVVS3, L.VVVS5, L.VVVS6 ], couplings = {(0,1):C.GC_317,(0,0):C.GC_275,(0,3):C.GC_314,(0,2):C.GC_274}) V_86 = Vertex(name = 'V_86', particles = [ P.H, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSSS1, L.SSSS2, L.SSSS3 ], couplings = {(0,0):C.GC_9,(0,2):C.GC_18,(0,1):C.GC_19}) V_87 = Vertex(name = 'V_87', particles = [ P.H, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSSS1 ], couplings = {(0,0):C.GC_331}) V_88 = Vertex(name = 'V_88', particles = [ P.H, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSSS1 ], couplings = {(0,0):C.GC_335}) V_89 = Vertex(name = 'V_89', particles = [ P.H, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSSS1 ], couplings = {(0,0):C.GC_336}) V_90 = Vertex(name = 'V_90', particles = [ P.H, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSSS1 ], couplings = {(0,0):C.GC_337}) V_91 = Vertex(name = 'V_91', particles = [ P.H, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSSS1 ], couplings = {(0,0):C.GC_338}) V_92 = Vertex(name = 'V_92', particles = [ P.H, P.H, P.H, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSSSSS1 ], couplings = {(0,0):C.GC_17}) V_93 = Vertex(name = 'V_93', particles = [ P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSS1, L.SSS2, L.SSS3 ], couplings = {(0,0):C.GC_261,(0,2):C.GC_263,(0,1):C.GC_264}) V_94 = Vertex(name = 'V_94', particles = [ P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSS1 ], couplings = {(0,0):C.GC_429}) V_95 = Vertex(name = 'V_95', particles = [ P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSS1 ], couplings = {(0,0):C.GC_430}) V_96 = Vertex(name = 'V_96', particles = [ P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSS1 ], couplings = {(0,0):C.GC_431}) V_97 = Vertex(name = 'V_97', particles = [ P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSS1 ], couplings = {(0,0):C.GC_432}) V_98 = Vertex(name = 'V_98', particles = [ P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSS1 ], couplings = {(0,0):C.GC_433}) V_99 = Vertex(name = 'V_99', particles = [ P.H, P.H, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.SSSSS1 ], couplings = {(0,0):C.GC_262}) V_100 = Vertex(name = 'V_100', particles = [ P.g, P.g, P.g, P.g, P.H, P.H ], color = [ 'f(-1,1,2)*f(3,4,-1)', 'f(-1,1,3)*f(2,4,-1)', 'f(-1,1,4)*f(2,3,-1)' ], lorentz = [ L.VVVVSS1, L.VVVVSS3, L.VVVVSS4 ], couplings = {(1,1):C.GC_79,(0,0):C.GC_79,(2,2):C.GC_79}) V_101 = Vertex(name = 'V_101', particles = [ P.g, P.g, P.g, P.g, P.H ], color = [ 'f(-1,1,2)*f(3,4,-1)', 'f(-1,1,3)*f(2,4,-1)', 'f(-1,1,4)*f(2,3,-1)' ], lorentz = [ L.VVVVS1, L.VVVVS10, L.VVVVS11, L.VVVVS12, L.VVVVS13, L.VVVVS14, L.VVVVS15, L.VVVVS16, L.VVVVS17, L.VVVVS19, L.VVVVS2, L.VVVVS3, L.VVVVS4, L.VVVVS7, L.VVVVS8 ], couplings = {(2,5):C.GC_231,(2,8):C.GC_240,(1,4):C.GC_231,(1,9):C.GC_240,(2,6):C.GC_237,(0,11):C.GC_233,(0,12):C.GC_241,(1,7):C.GC_237,(0,3):C.GC_236,(1,2):C.GC_233,(2,1):C.GC_233,(0,10):C.GC_231,(1,13):C.GC_227,(0,0):C.GC_227,(2,14):C.GC_227}) V_102 = Vertex(name = 'V_102', particles = [ P.g, P.g, P.g, P.g, P.H ], color = [ 'f(-1,1,2)*f(3,4,-1)', 'f(-1,1,3)*f(2,4,-1)', 'f(-1,1,4)*f(2,3,-1)' ], lorentz = [ L.VVVVS1, L.VVVVS7, L.VVVVS8 ], couplings = {(1,1):C.GC_280,(0,0):C.GC_280,(2,2):C.GC_280}) V_103 = Vertex(name = 'V_103', particles = [ P.a, P.a, P.W__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVVVSS2 ], couplings = {(0,0):C.GC_68}) V_104 = Vertex(name = 'V_104', particles = [ P.a, P.a, P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVVVS6 ], couplings = {(0,0):C.GC_277}) V_105 = Vertex(name = 'V_105', particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVVVSS2 ], couplings = {(0,0):C.GC_101}) V_106 = Vertex(name = 'V_106', particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVVVS6 ], couplings = {(0,0):C.GC_286}) V_107 = Vertex(name = 'V_107', particles = [ P.a, P.W__minus__, P.W__plus__, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVVVSS5 ], couplings = {(0,0):C.GC_166}) V_108 = Vertex(name = 'V_108', particles = [ P.a, P.W__minus__, P.W__plus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVVVS9 ], couplings = {(0,0):C.GC_318}) V_109 = Vertex(name = 'V_109', particles = [ P.Z, P.Z, P.H, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSSSS1 ], couplings = {(0,0):C.GC_102}) V_110 = Vertex(name = 'V_110', particles = [ P.Z, P.Z, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSSS1 ], couplings = {(0,0):C.GC_287}) V_111 = Vertex(name = 'V_111', particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVVVSS2 ], couplings = {(0,0):C.GC_103}) V_112 = Vertex(name = 'V_112', particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z, P.H ], color = [ '1' ], lorentz = [ L.VVVVS6 ], couplings = {(0,0):C.GC_288}) V_113 = Vertex(name = 'V_113', particles = [ P.H, P.H, P.H, P.H1 ], color = [ '1' ], lorentz = [ L.SSSS1 ], couplings = {(0,0):C.GC_88}) V_114 = Vertex(name = 'V_114', particles = [ P.H, P.H, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.SSSS1 ], couplings = {(0,0):C.GC_93}) V_115 = Vertex(name = 'V_115', particles = [ P.H, P.H1, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.SSSS1 ], couplings = {(0,0):C.GC_94}) V_116 = Vertex(name = 'V_116', particles = [ P.H1, P.H1, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.SSSS1 ], couplings = {(0,0):C.GC_95}) V_117 = Vertex(name = 'V_117', particles = [ P.H, P.H, P.H1 ], color = [ '1' ], lorentz = [ L.SSS1 ], couplings = {(0,0):C.GC_281}) V_118 = Vertex(name = 'V_118', particles = [ P.H, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.SSS1 ], couplings = {(0,0):C.GC_282}) V_119 = Vertex(name = 'V_119', particles = [ P.H1, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.SSS1 ], couplings = {(0,0):C.GC_283}) V_120 = Vertex(name = 'V_120', particles = [ P.a, P.W__minus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_85}) V_121 = Vertex(name = 'V_121', particles = [ P.a, P.W1__minus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_90}) V_122 = Vertex(name = 'V_122', particles = [ P.a, P.W1__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_85}) V_123 = Vertex(name = 'V_123', particles = [ P.W__minus__, P.W1__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_109}) V_124 = Vertex(name = 'V_124', particles = [ P.W__minus__, P.W1__plus__, P.H, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_113}) V_125 = Vertex(name = 'V_125', particles = [ P.W__minus__, P.W1__plus__, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_117}) V_126 = Vertex(name = 'V_126', particles = [ P.W__minus__, P.W1__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_289}) V_127 = Vertex(name = 'V_127', particles = [ P.W__minus__, P.W1__plus__, P.H1 ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_291}) V_128 = Vertex(name = 'V_128', particles = [ P.a, P.a, P.W__minus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_86}) V_129 = Vertex(name = 'V_129', particles = [ P.W__minus__, P.W1__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_184}) V_130 = Vertex(name = 'V_130', particles = [ P.W__minus__, P.W1__plus__, P.Z1 ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_190}) V_131 = Vertex(name = 'V_131', particles = [ P.W1__minus__, P.W1__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_113}) V_132 = Vertex(name = 'V_132', particles = [ P.W1__minus__, P.W1__plus__, P.H, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_117}) V_133 = Vertex(name = 'V_133', particles = [ P.W1__minus__, P.W1__plus__, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_121}) V_134 = Vertex(name = 'V_134', particles = [ P.W1__minus__, P.W1__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_291}) V_135 = Vertex(name = 'V_135', particles = [ P.W1__minus__, P.W1__plus__, P.H1 ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_293}) V_136 = Vertex(name = 'V_136', particles = [ P.a, P.a, P.W1__minus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_91}) V_137 = Vertex(name = 'V_137', particles = [ P.W1__minus__, P.W1__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_190}) V_138 = Vertex(name = 'V_138', particles = [ P.W1__minus__, P.W1__plus__, P.Z1 ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_193}) V_139 = Vertex(name = 'V_139', particles = [ P.W__minus__, P.W__minus__, P.W1__plus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_114}) V_140 = Vertex(name = 'V_140', particles = [ P.W__minus__, P.W1__minus__, P.W1__plus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_118}) V_141 = Vertex(name = 'V_141', particles = [ P.W1__minus__, P.W1__minus__, P.W1__plus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_122}) V_142 = Vertex(name = 'V_142', particles = [ P.W__minus__, P.W__plus__, P.H, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_109}) V_143 = Vertex(name = 'V_143', particles = [ P.W__minus__, P.W__plus__, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_113}) V_144 = Vertex(name = 'V_144', particles = [ P.W__minus__, P.W__plus__, P.H1 ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_289}) V_145 = Vertex(name = 'V_145', particles = [ P.W__minus__, P.W__plus__, P.Z1 ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_184}) V_146 = Vertex(name = 'V_146', particles = [ P.W1__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_109}) V_147 = Vertex(name = 'V_147', particles = [ P.W1__minus__, P.W__plus__, P.H, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_113}) V_148 = Vertex(name = 'V_148', particles = [ P.W1__minus__, P.W__plus__, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_117}) V_149 = Vertex(name = 'V_149', particles = [ P.W1__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_289}) V_150 = Vertex(name = 'V_150', particles = [ P.W1__minus__, P.W__plus__, P.H1 ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_291}) V_151 = Vertex(name = 'V_151', particles = [ P.a, P.a, P.W1__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_86}) V_152 = Vertex(name = 'V_152', particles = [ P.W1__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_184}) V_153 = Vertex(name = 'V_153', particles = [ P.W1__minus__, P.W__plus__, P.Z1 ], color = [ '1' ], lorentz = [ L.VVV7 ], couplings = {(0,0):C.GC_190}) V_154 = Vertex(name = 'V_154', particles = [ P.W__minus__, P.W__minus__, P.W1__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_110}) V_155 = Vertex(name = 'V_155', particles = [ P.W__minus__, P.W1__minus__, P.W1__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_114}) V_156 = Vertex(name = 'V_156', particles = [ P.W1__minus__, P.W1__minus__, P.W1__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_118}) V_157 = Vertex(name = 'V_157', particles = [ P.W__minus__, P.W1__minus__, P.W__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_110}) V_158 = Vertex(name = 'V_158', particles = [ P.W1__minus__, P.W1__minus__, P.W__plus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_114}) V_159 = Vertex(name = 'V_159', particles = [ P.a, P.W__minus__, P.W1__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_185}) V_160 = Vertex(name = 'V_160', particles = [ P.a, P.W1__minus__, P.W1__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_191}) V_161 = Vertex(name = 'V_161', particles = [ P.a, P.W1__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_185}) V_162 = Vertex(name = 'V_162', particles = [ P.Z, P.Z, P.H, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_111}) V_163 = Vertex(name = 'V_163', particles = [ P.Z, P.Z, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_115}) V_164 = Vertex(name = 'V_164', particles = [ P.Z, P.Z, P.H1 ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_290}) V_165 = Vertex(name = 'V_165', particles = [ P.W__minus__, P.W1__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_112}) V_166 = Vertex(name = 'V_166', particles = [ P.W1__minus__, P.W1__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_116}) V_167 = Vertex(name = 'V_167', particles = [ P.W1__minus__, P.W__plus__, P.Z, P.Z ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_112}) V_168 = Vertex(name = 'V_168', particles = [ P.a, P.W__minus__, P.W1__plus__, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_191}) V_169 = Vertex(name = 'V_169', particles = [ P.a, P.W1__minus__, P.W1__plus__, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_194}) V_170 = Vertex(name = 'V_170', particles = [ P.a, P.W__minus__, P.W__plus__, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_185}) V_171 = Vertex(name = 'V_171', particles = [ P.a, P.W1__minus__, P.W__plus__, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV11 ], couplings = {(0,0):C.GC_191}) V_172 = Vertex(name = 'V_172', particles = [ P.Z, P.Z1, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_111}) V_173 = Vertex(name = 'V_173', particles = [ P.Z, P.Z1, P.H, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_115}) V_174 = Vertex(name = 'V_174', particles = [ P.Z, P.Z1, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_119}) V_175 = Vertex(name = 'V_175', particles = [ P.Z, P.Z1, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_290}) V_176 = Vertex(name = 'V_176', particles = [ P.Z, P.Z1, P.H1 ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_292}) V_177 = Vertex(name = 'V_177', particles = [ P.W__minus__, P.W1__plus__, P.Z, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_116}) V_178 = Vertex(name = 'V_178', particles = [ P.W1__minus__, P.W1__plus__, P.Z, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_120}) V_179 = Vertex(name = 'V_179', particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_112}) V_180 = Vertex(name = 'V_180', particles = [ P.W1__minus__, P.W__plus__, P.Z, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_116}) V_181 = Vertex(name = 'V_181', particles = [ P.Z1, P.Z1, P.H, P.H ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_115}) V_182 = Vertex(name = 'V_182', particles = [ P.Z1, P.Z1, P.H, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_119}) V_183 = Vertex(name = 'V_183', particles = [ P.Z1, P.Z1, P.H1, P.H1 ], color = [ '1' ], lorentz = [ L.VVSS4 ], couplings = {(0,0):C.GC_123}) V_184 = Vertex(name = 'V_184', particles = [ P.Z1, P.Z1, P.H ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_292}) V_185 = Vertex(name = 'V_185', particles = [ P.Z1, P.Z1, P.H1 ], color = [ '1' ], lorentz = [ L.VVS4 ], couplings = {(0,0):C.GC_294}) V_186 = Vertex(name = 'V_186', particles = [ P.W__minus__, P.W1__plus__, P.Z1, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_120}) V_187 = Vertex(name = 'V_187', particles = [ P.W1__minus__, P.W1__plus__, P.Z1, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_124}) V_188 = Vertex(name = 'V_188', particles = [ P.W__minus__, P.W__plus__, P.Z1, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_116}) V_189 = Vertex(name = 'V_189', particles = [ P.W1__minus__, P.W__plus__, P.Z1, P.Z1 ], color = [ '1' ], lorentz = [ L.VVVV8 ], couplings = {(0,0):C.GC_120}) V_190 = Vertex(name = 'V_190', particles = [ P.e__plus__, P.e__minus__, P.a ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_4,(0,2):C.GC_707,(0,1):C.GC_706}) V_191 = Vertex(name = 'V_191', particles = [ P.e__plus__, P.e__minus__, P.a ], color = [ '1' ], lorentz = [ L.FFV2, L.FFV8 ], couplings = {(0,1):C.GC_721,(0,0):C.GC_720}) V_192 = Vertex(name = 'V_192', particles = [ P.mu__plus__, P.mu__minus__, P.a ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_4,(0,2):C.GC_802,(0,1):C.GC_801}) V_193 = Vertex(name = 'V_193', particles = [ P.mu__plus__, P.mu__minus__, P.a ], color = [ '1' ], lorentz = [ L.FFV2, L.FFV8 ], couplings = {(0,1):C.GC_816,(0,0):C.GC_815}) V_194 = Vertex(name = 'V_194', particles = [ P.ta__plus__, P.ta__minus__, P.a ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_4,(0,2):C.GC_1159,(0,1):C.GC_1158}) V_195 = Vertex(name = 'V_195', particles = [ P.ta__plus__, P.ta__minus__, P.a ], color = [ '1' ], lorentz = [ L.FFV2, L.FFV8 ], couplings = {(0,1):C.GC_1173,(0,0):C.GC_1172}) V_196 = Vertex(name = 'V_196', particles = [ P.e__plus__, P.e__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV8 ], couplings = {(0,0):C.GC_197,(0,2):C.GC_136,(0,3):C.GC_352,(0,4):C.GC_709,(0,1):C.GC_708}) V_197 = Vertex(name = 'V_197', particles = [ P.e__plus__, P.e__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV8 ], couplings = {(0,0):C.GC_364,(0,2):C.GC_353,(0,3):C.GC_392,(0,4):C.GC_719,(0,1):C.GC_718}) V_198 = Vertex(name = 'V_198', particles = [ P.e__plus__, P.e__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_395,(0,1):C.GC_384,(0,2):C.GC_398}) V_199 = Vertex(name = 'V_199', particles = [ P.e__plus__, P.e__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_387}) V_200 = Vertex(name = 'V_200', particles = [ P.mu__plus__, P.mu__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV8 ], couplings = {(0,0):C.GC_197,(0,2):C.GC_136,(0,3):C.GC_352,(0,1):C.GC_803,(0,4):C.GC_804}) V_201 = Vertex(name = 'V_201', particles = [ P.mu__plus__, P.mu__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV8 ], couplings = {(0,0):C.GC_364,(0,2):C.GC_353,(0,3):C.GC_392,(0,1):C.GC_813,(0,4):C.GC_814}) V_202 = Vertex(name = 'V_202', particles = [ P.mu__plus__, P.mu__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_395,(0,1):C.GC_384,(0,2):C.GC_398}) V_203 = Vertex(name = 'V_203', particles = [ P.mu__plus__, P.mu__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_387}) V_204 = Vertex(name = 'V_204', particles = [ P.ta__plus__, P.ta__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV8 ], couplings = {(0,0):C.GC_197,(0,2):C.GC_136,(0,3):C.GC_352,(0,4):C.GC_1161,(0,1):C.GC_1160}) V_205 = Vertex(name = 'V_205', particles = [ P.ta__plus__, P.ta__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV8 ], couplings = {(0,0):C.GC_364,(0,2):C.GC_353,(0,3):C.GC_392,(0,4):C.GC_1171,(0,1):C.GC_1170}) V_206 = Vertex(name = 'V_206', particles = [ P.ta__plus__, P.ta__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_395,(0,1):C.GC_384,(0,2):C.GC_398}) V_207 = Vertex(name = 'V_207', particles = [ P.ta__plus__, P.ta__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_387}) V_208 = Vertex(name = 'V_208', particles = [ P.d__tilde__, P.d, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_1,(0,2):C.GC_637,(0,1):C.GC_636}) V_209 = Vertex(name = 'V_209', particles = [ P.d__tilde__, P.d, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV2, L.FFV8 ], couplings = {(0,1):C.GC_653,(0,0):C.GC_652}) V_210 = Vertex(name = 'V_210', particles = [ P.s__tilde__, P.s, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_1,(0,2):C.GC_903,(0,1):C.GC_902}) V_211 = Vertex(name = 'V_211', particles = [ P.s__tilde__, P.s, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV2, L.FFV8 ], couplings = {(0,1):C.GC_919,(0,0):C.GC_918}) V_212 = Vertex(name = 'V_212', particles = [ P.b__tilde__, P.b, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_1,(0,2):C.GC_503,(0,1):C.GC_502}) V_213 = Vertex(name = 'V_213', particles = [ P.b__tilde__, P.b, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV2, L.FFV8 ], couplings = {(0,1):C.GC_519,(0,0):C.GC_518}) V_214 = Vertex(name = 'V_214', particles = [ P.u__tilde__, P.u, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_2,(0,2):C.GC_1289,(0,1):C.GC_1288}) V_215 = Vertex(name = 'V_215', particles = [ P.u__tilde__, P.u, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV2, L.FFV8 ], couplings = {(0,1):C.GC_1312,(0,0):C.GC_1311}) V_216 = Vertex(name = 'V_216', particles = [ P.c__tilde__, P.c, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_2,(0,2):C.GC_554,(0,1):C.GC_553}) V_217 = Vertex(name = 'V_217', particles = [ P.c__tilde__, P.c, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV2, L.FFV8 ], couplings = {(0,1):C.GC_577,(0,0):C.GC_576}) V_218 = Vertex(name = 'V_218', particles = [ P.t__tilde__, P.t, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_2,(0,2):C.GC_992,(0,1):C.GC_991}) V_219 = Vertex(name = 'V_219', particles = [ P.t__tilde__, P.t, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV2, L.FFV8 ], couplings = {(0,1):C.GC_1015,(0,0):C.GC_1014}) V_220 = Vertex(name = 'V_220', particles = [ P.d__tilde__, P.d, P.g ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_6,(0,2):C.GC_630,(0,1):C.GC_629}) V_221 = Vertex(name = 'V_221', particles = [ P.s__tilde__, P.s, P.g ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_6,(0,2):C.GC_896,(0,1):C.GC_895}) V_222 = Vertex(name = 'V_222', particles = [ P.b__tilde__, P.b, P.g ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_6,(0,2):C.GC_496,(0,1):C.GC_495}) V_223 = Vertex(name = 'V_223', particles = [ P.u__tilde__, P.u, P.g ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_6,(0,2):C.GC_1291,(0,1):C.GC_1290}) V_224 = Vertex(name = 'V_224', particles = [ P.c__tilde__, P.c, P.g ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_6,(0,2):C.GC_556,(0,1):C.GC_555}) V_225 = Vertex(name = 'V_225', particles = [ P.t__tilde__, P.t, P.g ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV8 ], couplings = {(0,0):C.GC_6,(0,2):C.GC_994,(0,1):C.GC_993}) V_226 = Vertex(name = 'V_226', particles = [ P.d__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_1295,(0,3):C.GC_633,(0,0):C.GC_126,(0,2):C.GC_1353}) V_227 = Vertex(name = 'V_227', particles = [ P.d__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_1297,(0,3):C.GC_635,(0,0):C.GC_341,(0,2):C.GC_1354}) V_228 = Vertex(name = 'V_228', particles = [ P.d__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_366}) V_229 = Vertex(name = 'V_229', particles = [ P.d__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_400}) V_230 = Vertex(name = 'V_230', particles = [ P.d__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_410}) V_231 = Vertex(name = 'V_231', particles = [ P.d__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_420}) V_232 = Vertex(name = 'V_232', particles = [ P.s__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_127,(0,1):C.GC_1425}) V_233 = Vertex(name = 'V_233', particles = [ P.s__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_342,(0,1):C.GC_1426}) V_234 = Vertex(name = 'V_234', particles = [ P.s__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_367}) V_235 = Vertex(name = 'V_235', particles = [ P.s__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_401}) V_236 = Vertex(name = 'V_236', particles = [ P.s__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_411}) V_237 = Vertex(name = 'V_237', particles = [ P.s__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_421}) V_238 = Vertex(name = 'V_238', particles = [ P.b__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_128,(0,1):C.GC_1335}) V_239 = Vertex(name = 'V_239', particles = [ P.b__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_343,(0,1):C.GC_1336}) V_240 = Vertex(name = 'V_240', particles = [ P.b__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_368}) V_241 = Vertex(name = 'V_241', particles = [ P.b__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_402}) V_242 = Vertex(name = 'V_242', particles = [ P.b__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_412}) V_243 = Vertex(name = 'V_243', particles = [ P.b__tilde__, P.u, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_422}) V_244 = Vertex(name = 'V_244', particles = [ P.d__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_129,(0,1):C.GC_676}) V_245 = Vertex(name = 'V_245', particles = [ P.d__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_344,(0,1):C.GC_677}) V_246 = Vertex(name = 'V_246', particles = [ P.d__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_369}) V_247 = Vertex(name = 'V_247', particles = [ P.d__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_403}) V_248 = Vertex(name = 'V_248', particles = [ P.d__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_413}) V_249 = Vertex(name = 'V_249', particles = [ P.d__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_423}) V_250 = Vertex(name = 'V_250', particles = [ P.s__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_560,(0,3):C.GC_899,(0,0):C.GC_130,(0,2):C.GC_942}) V_251 = Vertex(name = 'V_251', particles = [ P.s__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_562,(0,3):C.GC_901,(0,0):C.GC_345,(0,2):C.GC_943}) V_252 = Vertex(name = 'V_252', particles = [ P.s__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_370}) V_253 = Vertex(name = 'V_253', particles = [ P.s__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_404}) V_254 = Vertex(name = 'V_254', particles = [ P.s__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_414}) V_255 = Vertex(name = 'V_255', particles = [ P.s__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_424}) V_256 = Vertex(name = 'V_256', particles = [ P.b__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_131,(0,1):C.GC_600}) V_257 = Vertex(name = 'V_257', particles = [ P.b__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_346,(0,1):C.GC_601}) V_258 = Vertex(name = 'V_258', particles = [ P.b__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_371}) V_259 = Vertex(name = 'V_259', particles = [ P.b__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_405}) V_260 = Vertex(name = 'V_260', particles = [ P.b__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_415}) V_261 = Vertex(name = 'V_261', particles = [ P.b__tilde__, P.c, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_425}) V_262 = Vertex(name = 'V_262', particles = [ P.d__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_132,(0,1):C.GC_1056}) V_263 = Vertex(name = 'V_263', particles = [ P.d__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_347,(0,1):C.GC_1057}) V_264 = Vertex(name = 'V_264', particles = [ P.d__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_372}) V_265 = Vertex(name = 'V_265', particles = [ P.d__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_406}) V_266 = Vertex(name = 'V_266', particles = [ P.d__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_416}) V_267 = Vertex(name = 'V_267', particles = [ P.d__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_426}) V_268 = Vertex(name = 'V_268', particles = [ P.s__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_133,(0,1):C.GC_1128}) V_269 = Vertex(name = 'V_269', particles = [ P.s__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_348,(0,1):C.GC_1129}) V_270 = Vertex(name = 'V_270', particles = [ P.s__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_373}) V_271 = Vertex(name = 'V_271', particles = [ P.s__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_407}) V_272 = Vertex(name = 'V_272', particles = [ P.s__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_417}) V_273 = Vertex(name = 'V_273', particles = [ P.s__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_427}) V_274 = Vertex(name = 'V_274', particles = [ P.b__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_998,(0,3):C.GC_499,(0,0):C.GC_134,(0,2):C.GC_1038}) V_275 = Vertex(name = 'V_275', particles = [ P.b__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_1000,(0,3):C.GC_501,(0,0):C.GC_349,(0,2):C.GC_1039}) V_276 = Vertex(name = 'V_276', particles = [ P.b__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_374}) V_277 = Vertex(name = 'V_277', particles = [ P.b__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_408}) V_278 = Vertex(name = 'V_278', particles = [ P.b__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_418}) V_279 = Vertex(name = 'V_279', particles = [ P.b__tilde__, P.t, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_428}) V_280 = Vertex(name = 'V_280', particles = [ P.d__tilde__, P.u, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_1349,(0,0):C.GC_140}) V_281 = Vertex(name = 'V_281', particles = [ P.d__tilde__, P.u, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_1350}) V_282 = Vertex(name = 'V_282', particles = [ P.s__tilde__, P.u, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_1421,(0,0):C.GC_141}) V_283 = Vertex(name = 'V_283', particles = [ P.s__tilde__, P.u, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_1422}) V_284 = Vertex(name = 'V_284', particles = [ P.b__tilde__, P.u, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_1331,(0,0):C.GC_142}) V_285 = Vertex(name = 'V_285', particles = [ P.b__tilde__, P.u, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_1332}) V_286 = Vertex(name = 'V_286', particles = [ P.d__tilde__, P.c, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_672,(0,0):C.GC_143}) V_287 = Vertex(name = 'V_287', particles = [ P.d__tilde__, P.c, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_673}) V_288 = Vertex(name = 'V_288', particles = [ P.s__tilde__, P.c, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_938,(0,0):C.GC_144}) V_289 = Vertex(name = 'V_289', particles = [ P.s__tilde__, P.c, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_939}) V_290 = Vertex(name = 'V_290', particles = [ P.b__tilde__, P.c, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_596,(0,0):C.GC_145}) V_291 = Vertex(name = 'V_291', particles = [ P.b__tilde__, P.c, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_597}) V_292 = Vertex(name = 'V_292', particles = [ P.d__tilde__, P.t, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_1052,(0,0):C.GC_146}) V_293 = Vertex(name = 'V_293', particles = [ P.d__tilde__, P.t, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_1053}) V_294 = Vertex(name = 'V_294', particles = [ P.s__tilde__, P.t, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_1124,(0,0):C.GC_147}) V_295 = Vertex(name = 'V_295', particles = [ P.s__tilde__, P.t, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_1125}) V_296 = Vertex(name = 'V_296', particles = [ P.b__tilde__, P.t, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_1034,(0,0):C.GC_148}) V_297 = Vertex(name = 'V_297', particles = [ P.b__tilde__, P.t, P.W__minus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_1035}) V_298 = Vertex(name = 'V_298', particles = [ P.d__tilde__, P.u, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,1):C.GC_1269,(0,3):C.GC_607,(0,2):C.GC_1351,(0,0):C.GC_296}) V_299 = Vertex(name = 'V_299', particles = [ P.d__tilde__, P.u, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,0):C.GC_1271,(0,2):C.GC_609,(0,1):C.GC_1352}) V_300 = Vertex(name = 'V_300', particles = [ P.s__tilde__, P.u, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_1423,(0,0):C.GC_297}) V_301 = Vertex(name = 'V_301', particles = [ P.s__tilde__, P.u, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_1424}) V_302 = Vertex(name = 'V_302', particles = [ P.b__tilde__, P.u, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_1333,(0,0):C.GC_298}) V_303 = Vertex(name = 'V_303', particles = [ P.b__tilde__, P.u, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_1334}) V_304 = Vertex(name = 'V_304', particles = [ P.d__tilde__, P.c, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_674,(0,0):C.GC_299}) V_305 = Vertex(name = 'V_305', particles = [ P.d__tilde__, P.c, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_675}) V_306 = Vertex(name = 'V_306', particles = [ P.s__tilde__, P.c, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,1):C.GC_534,(0,3):C.GC_873,(0,2):C.GC_940,(0,0):C.GC_300}) V_307 = Vertex(name = 'V_307', particles = [ P.s__tilde__, P.c, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,0):C.GC_536,(0,2):C.GC_875,(0,1):C.GC_941}) V_308 = Vertex(name = 'V_308', particles = [ P.b__tilde__, P.c, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_598,(0,0):C.GC_301}) V_309 = Vertex(name = 'V_309', particles = [ P.b__tilde__, P.c, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_599}) V_310 = Vertex(name = 'V_310', particles = [ P.d__tilde__, P.t, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_1054,(0,0):C.GC_302}) V_311 = Vertex(name = 'V_311', particles = [ P.d__tilde__, P.t, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_1055}) V_312 = Vertex(name = 'V_312', particles = [ P.s__tilde__, P.t, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_1126,(0,0):C.GC_303}) V_313 = Vertex(name = 'V_313', particles = [ P.s__tilde__, P.t, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_1127}) V_314 = Vertex(name = 'V_314', particles = [ P.b__tilde__, P.t, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,1):C.GC_970,(0,3):C.GC_473,(0,2):C.GC_1036,(0,0):C.GC_304}) V_315 = Vertex(name = 'V_315', particles = [ P.b__tilde__, P.t, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,0):C.GC_972,(0,2):C.GC_475,(0,1):C.GC_1037}) V_316 = Vertex(name = 'V_316', particles = [ P.e__plus__, P.ve, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV9 ], couplings = {(0,1):C.GC_703,(0,0):C.GC_125}) V_317 = Vertex(name = 'V_317', particles = [ P.e__plus__, P.ve, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV9 ], couplings = {(0,1):C.GC_705,(0,0):C.GC_365}) V_318 = Vertex(name = 'V_318', particles = [ P.e__plus__, P.ve, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_389}) V_319 = Vertex(name = 'V_319', particles = [ P.e__plus__, P.ve, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_409}) V_320 = Vertex(name = 'V_320', particles = [ P.e__plus__, P.ve, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_419}) V_321 = Vertex(name = 'V_321', particles = [ P.mu__plus__, P.vm, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV9 ], couplings = {(0,1):C.GC_798,(0,0):C.GC_125}) V_322 = Vertex(name = 'V_322', particles = [ P.mu__plus__, P.vm, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV9 ], couplings = {(0,1):C.GC_800,(0,0):C.GC_365}) V_323 = Vertex(name = 'V_323', particles = [ P.mu__plus__, P.vm, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_389}) V_324 = Vertex(name = 'V_324', particles = [ P.mu__plus__, P.vm, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_409}) V_325 = Vertex(name = 'V_325', particles = [ P.mu__plus__, P.vm, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_419}) V_326 = Vertex(name = 'V_326', particles = [ P.ta__plus__, P.vt, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV9 ], couplings = {(0,1):C.GC_1155,(0,0):C.GC_125}) V_327 = Vertex(name = 'V_327', particles = [ P.ta__plus__, P.vt, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV9 ], couplings = {(0,1):C.GC_1157,(0,0):C.GC_365}) V_328 = Vertex(name = 'V_328', particles = [ P.ta__plus__, P.vt, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_389}) V_329 = Vertex(name = 'V_329', particles = [ P.ta__plus__, P.vt, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_409}) V_330 = Vertex(name = 'V_330', particles = [ P.ta__plus__, P.vt, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_419}) V_331 = Vertex(name = 'V_331', particles = [ P.e__plus__, P.ve, P.W__minus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_139}) V_332 = Vertex(name = 'V_332', particles = [ P.mu__plus__, P.vm, P.W__minus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_139}) V_333 = Vertex(name = 'V_333', particles = [ P.ta__plus__, P.vt, P.W__minus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_139}) V_334 = Vertex(name = 'V_334', particles = [ P.e__plus__, P.ve, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS2, L.FFVS6 ], couplings = {(0,1):C.GC_681,(0,0):C.GC_295}) V_335 = Vertex(name = 'V_335', particles = [ P.e__plus__, P.ve, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS6 ], couplings = {(0,0):C.GC_683}) V_336 = Vertex(name = 'V_336', particles = [ P.mu__plus__, P.vm, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS2, L.FFVS6 ], couplings = {(0,1):C.GC_776,(0,0):C.GC_295}) V_337 = Vertex(name = 'V_337', particles = [ P.mu__plus__, P.vm, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS6 ], couplings = {(0,0):C.GC_778}) V_338 = Vertex(name = 'V_338', particles = [ P.ta__plus__, P.vt, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS2, L.FFVS6 ], couplings = {(0,1):C.GC_1133,(0,0):C.GC_295}) V_339 = Vertex(name = 'V_339', particles = [ P.ta__plus__, P.vt, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS6 ], couplings = {(0,0):C.GC_1135}) V_340 = Vertex(name = 'V_340', particles = [ P.u__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_634,(0,3):C.GC_1294,(0,0):C.GC_1482,(0,2):C.GC_1617}) V_341 = Vertex(name = 'V_341', particles = [ P.u__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_635,(0,3):C.GC_1297,(0,0):C.GC_1486,(0,2):C.GC_1618}) V_342 = Vertex(name = 'V_342', particles = [ P.u__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1487}) V_343 = Vertex(name = 'V_343', particles = [ P.u__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1488}) V_344 = Vertex(name = 'V_344', particles = [ P.u__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1489}) V_345 = Vertex(name = 'V_345', particles = [ P.u__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1490}) V_346 = Vertex(name = 'V_346', particles = [ P.c__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_2103,(0,1):C.GC_2184}) V_347 = Vertex(name = 'V_347', particles = [ P.c__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_2107,(0,1):C.GC_2185}) V_348 = Vertex(name = 'V_348', particles = [ P.c__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2108}) V_349 = Vertex(name = 'V_349', particles = [ P.c__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2109}) V_350 = Vertex(name = 'V_350', particles = [ P.c__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2110}) V_351 = Vertex(name = 'V_351', particles = [ P.c__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2111}) V_352 = Vertex(name = 'V_352', particles = [ P.t__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_2724,(0,1):C.GC_2834}) V_353 = Vertex(name = 'V_353', particles = [ P.t__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_2729,(0,1):C.GC_2835}) V_354 = Vertex(name = 'V_354', particles = [ P.t__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2730}) V_355 = Vertex(name = 'V_355', particles = [ P.t__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2731}) V_356 = Vertex(name = 'V_356', particles = [ P.t__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2732}) V_357 = Vertex(name = 'V_357', particles = [ P.t__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2733}) V_358 = Vertex(name = 'V_358', particles = [ P.u__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_1689,(0,1):C.GC_1860}) V_359 = Vertex(name = 'V_359', particles = [ P.u__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_1693,(0,1):C.GC_1861}) V_360 = Vertex(name = 'V_360', particles = [ P.u__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1694}) V_361 = Vertex(name = 'V_361', particles = [ P.u__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1695}) V_362 = Vertex(name = 'V_362', particles = [ P.u__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1696}) V_363 = Vertex(name = 'V_363', particles = [ P.u__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1697}) V_364 = Vertex(name = 'V_364', particles = [ P.c__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_900,(0,3):C.GC_559,(0,0):C.GC_2310,(0,2):C.GC_2427}) V_365 = Vertex(name = 'V_365', particles = [ P.c__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_901,(0,3):C.GC_562,(0,0):C.GC_2314,(0,2):C.GC_2428}) V_366 = Vertex(name = 'V_366', particles = [ P.c__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2315}) V_367 = Vertex(name = 'V_367', particles = [ P.c__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2316}) V_368 = Vertex(name = 'V_368', particles = [ P.c__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2317}) V_369 = Vertex(name = 'V_369', particles = [ P.c__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2318}) V_370 = Vertex(name = 'V_370', particles = [ P.t__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_2932,(0,1):C.GC_3078}) V_371 = Vertex(name = 'V_371', particles = [ P.t__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_2937,(0,1):C.GC_3079}) V_372 = Vertex(name = 'V_372', particles = [ P.t__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2938}) V_373 = Vertex(name = 'V_373', particles = [ P.t__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2939}) V_374 = Vertex(name = 'V_374', particles = [ P.t__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2940}) V_375 = Vertex(name = 'V_375', particles = [ P.t__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2941}) V_376 = Vertex(name = 'V_376', particles = [ P.u__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_1896,(0,1):C.GC_2007}) V_377 = Vertex(name = 'V_377', particles = [ P.u__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_1900,(0,1):C.GC_2008}) V_378 = Vertex(name = 'V_378', particles = [ P.u__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1901}) V_379 = Vertex(name = 'V_379', particles = [ P.u__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1902}) V_380 = Vertex(name = 'V_380', particles = [ P.u__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1903}) V_381 = Vertex(name = 'V_381', particles = [ P.u__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1904}) V_382 = Vertex(name = 'V_382', particles = [ P.c__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_2517,(0,1):C.GC_2574}) V_383 = Vertex(name = 'V_383', particles = [ P.c__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV5 ], couplings = {(0,0):C.GC_2521,(0,1):C.GC_2575}) V_384 = Vertex(name = 'V_384', particles = [ P.c__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2522}) V_385 = Vertex(name = 'V_385', particles = [ P.c__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2523}) V_386 = Vertex(name = 'V_386', particles = [ P.c__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2524}) V_387 = Vertex(name = 'V_387', particles = [ P.c__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2525}) V_388 = Vertex(name = 'V_388', particles = [ P.t__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_500,(0,3):C.GC_997,(0,0):C.GC_3140,(0,2):C.GC_3226}) V_389 = Vertex(name = 'V_389', particles = [ P.t__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV4, L.FFV5, L.FFV9 ], couplings = {(0,1):C.GC_501,(0,3):C.GC_1000,(0,0):C.GC_3145,(0,2):C.GC_3227}) V_390 = Vertex(name = 'V_390', particles = [ P.t__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_3146}) V_391 = Vertex(name = 'V_391', particles = [ P.t__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_3147}) V_392 = Vertex(name = 'V_392', particles = [ P.t__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_3148}) V_393 = Vertex(name = 'V_393', particles = [ P.t__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_3149}) V_394 = Vertex(name = 'V_394', particles = [ P.u__tilde__, P.d, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_1613,(0,0):C.GC_1483}) V_395 = Vertex(name = 'V_395', particles = [ P.u__tilde__, P.d, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_1614}) V_396 = Vertex(name = 'V_396', particles = [ P.c__tilde__, P.d, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_2180,(0,0):C.GC_2104}) V_397 = Vertex(name = 'V_397', particles = [ P.c__tilde__, P.d, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_2181}) V_398 = Vertex(name = 'V_398', particles = [ P.t__tilde__, P.d, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_2830,(0,0):C.GC_2725}) V_399 = Vertex(name = 'V_399', particles = [ P.t__tilde__, P.d, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_2831}) V_400 = Vertex(name = 'V_400', particles = [ P.u__tilde__, P.s, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_1856,(0,0):C.GC_1690}) V_401 = Vertex(name = 'V_401', particles = [ P.u__tilde__, P.s, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_1857}) V_402 = Vertex(name = 'V_402', particles = [ P.c__tilde__, P.s, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_2423,(0,0):C.GC_2311}) V_403 = Vertex(name = 'V_403', particles = [ P.c__tilde__, P.s, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_2424}) V_404 = Vertex(name = 'V_404', particles = [ P.t__tilde__, P.s, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_3074,(0,0):C.GC_2933}) V_405 = Vertex(name = 'V_405', particles = [ P.t__tilde__, P.s, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_3075}) V_406 = Vertex(name = 'V_406', particles = [ P.u__tilde__, P.b, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_2003,(0,0):C.GC_1897}) V_407 = Vertex(name = 'V_407', particles = [ P.u__tilde__, P.b, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_2004}) V_408 = Vertex(name = 'V_408', particles = [ P.c__tilde__, P.b, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_2570,(0,0):C.GC_2518}) V_409 = Vertex(name = 'V_409', particles = [ P.c__tilde__, P.b, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_2571}) V_410 = Vertex(name = 'V_410', particles = [ P.t__tilde__, P.b, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,1):C.GC_3222,(0,0):C.GC_3141}) V_411 = Vertex(name = 'V_411', particles = [ P.t__tilde__, P.b, P.W__plus__, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS2 ], couplings = {(0,0):C.GC_3223}) V_412 = Vertex(name = 'V_412', particles = [ P.u__tilde__, P.d, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,1):C.GC_608,(0,3):C.GC_1268,(0,2):C.GC_1615,(0,0):C.GC_1485}) V_413 = Vertex(name = 'V_413', particles = [ P.u__tilde__, P.d, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,0):C.GC_609,(0,2):C.GC_1271,(0,1):C.GC_1616}) V_414 = Vertex(name = 'V_414', particles = [ P.c__tilde__, P.d, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_2182,(0,0):C.GC_2106}) V_415 = Vertex(name = 'V_415', particles = [ P.c__tilde__, P.d, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_2183}) V_416 = Vertex(name = 'V_416', particles = [ P.t__tilde__, P.d, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_2832,(0,0):C.GC_2728}) V_417 = Vertex(name = 'V_417', particles = [ P.t__tilde__, P.d, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_2833}) V_418 = Vertex(name = 'V_418', particles = [ P.u__tilde__, P.s, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_1858,(0,0):C.GC_1692}) V_419 = Vertex(name = 'V_419', particles = [ P.u__tilde__, P.s, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_1859}) V_420 = Vertex(name = 'V_420', particles = [ P.c__tilde__, P.s, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,1):C.GC_874,(0,3):C.GC_533,(0,2):C.GC_2425,(0,0):C.GC_2313}) V_421 = Vertex(name = 'V_421', particles = [ P.c__tilde__, P.s, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,0):C.GC_875,(0,2):C.GC_536,(0,1):C.GC_2426}) V_422 = Vertex(name = 'V_422', particles = [ P.t__tilde__, P.s, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_3076,(0,0):C.GC_2936}) V_423 = Vertex(name = 'V_423', particles = [ P.t__tilde__, P.s, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_3077}) V_424 = Vertex(name = 'V_424', particles = [ P.u__tilde__, P.b, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_2005,(0,0):C.GC_1899}) V_425 = Vertex(name = 'V_425', particles = [ P.u__tilde__, P.b, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_2006}) V_426 = Vertex(name = 'V_426', particles = [ P.c__tilde__, P.b, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS4 ], couplings = {(0,1):C.GC_2572,(0,0):C.GC_2520}) V_427 = Vertex(name = 'V_427', particles = [ P.c__tilde__, P.b, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS4 ], couplings = {(0,0):C.GC_2573}) V_428 = Vertex(name = 'V_428', particles = [ P.t__tilde__, P.b, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS2, L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,1):C.GC_474,(0,3):C.GC_969,(0,2):C.GC_3224,(0,0):C.GC_3144}) V_429 = Vertex(name = 'V_429', particles = [ P.t__tilde__, P.b, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS3, L.FFVS4, L.FFVS6 ], couplings = {(0,0):C.GC_475,(0,2):C.GC_972,(0,1):C.GC_3225}) V_430 = Vertex(name = 'V_430', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV4 ], couplings = {(0,1):C.GC_704,(0,0):C.GC_125}) V_431 = Vertex(name = 'V_431', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV4 ], couplings = {(0,1):C.GC_705,(0,0):C.GC_365}) V_432 = Vertex(name = 'V_432', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_389}) V_433 = Vertex(name = 'V_433', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_409}) V_434 = Vertex(name = 'V_434', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_419}) V_435 = Vertex(name = 'V_435', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV4 ], couplings = {(0,1):C.GC_799,(0,0):C.GC_125}) V_436 = Vertex(name = 'V_436', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV4 ], couplings = {(0,1):C.GC_800,(0,0):C.GC_365}) V_437 = Vertex(name = 'V_437', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_389}) V_438 = Vertex(name = 'V_438', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_409}) V_439 = Vertex(name = 'V_439', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_419}) V_440 = Vertex(name = 'V_440', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV4 ], couplings = {(0,1):C.GC_1156,(0,0):C.GC_125}) V_441 = Vertex(name = 'V_441', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3, L.FFV4 ], couplings = {(0,1):C.GC_1157,(0,0):C.GC_365}) V_442 = Vertex(name = 'V_442', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_389}) V_443 = Vertex(name = 'V_443', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_409}) V_444 = Vertex(name = 'V_444', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_419}) V_445 = Vertex(name = 'V_445', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_139}) V_446 = Vertex(name = 'V_446', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_139}) V_447 = Vertex(name = 'V_447', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_139}) V_448 = Vertex(name = 'V_448', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS2, L.FFVS3 ], couplings = {(0,1):C.GC_682,(0,0):C.GC_295}) V_449 = Vertex(name = 'V_449', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS3 ], couplings = {(0,0):C.GC_683}) V_450 = Vertex(name = 'V_450', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS2, L.FFVS3 ], couplings = {(0,1):C.GC_777,(0,0):C.GC_295}) V_451 = Vertex(name = 'V_451', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS3 ], couplings = {(0,0):C.GC_778}) V_452 = Vertex(name = 'V_452', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS2, L.FFVS3 ], couplings = {(0,1):C.GC_1134,(0,0):C.GC_295}) V_453 = Vertex(name = 'V_453', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVS3 ], couplings = {(0,0):C.GC_1135}) V_454 = Vertex(name = 'V_454', particles = [ P.d__tilde__, P.d, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,0):C.GC_154,(0,1):C.GC_149}) V_455 = Vertex(name = 'V_455', particles = [ P.d__tilde__, P.d, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_156}) V_456 = Vertex(name = 'V_456', particles = [ P.s__tilde__, P.s, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,0):C.GC_154,(0,1):C.GC_149}) V_457 = Vertex(name = 'V_457', particles = [ P.s__tilde__, P.s, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_156}) V_458 = Vertex(name = 'V_458', particles = [ P.b__tilde__, P.b, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,0):C.GC_154,(0,1):C.GC_149}) V_459 = Vertex(name = 'V_459', particles = [ P.b__tilde__, P.b, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_156}) V_460 = Vertex(name = 'V_460', particles = [ P.d__tilde__, P.d, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS4, L.FFVS5 ], couplings = {(0,1):C.GC_310,(0,2):C.GC_305,(0,3):C.GC_613,(0,0):C.GC_612}) V_461 = Vertex(name = 'V_461', particles = [ P.d__tilde__, P.d, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS5 ], couplings = {(0,1):C.GC_312,(0,2):C.GC_626,(0,0):C.GC_625}) V_462 = Vertex(name = 'V_462', particles = [ P.s__tilde__, P.s, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS4, L.FFVS5 ], couplings = {(0,1):C.GC_310,(0,2):C.GC_305,(0,3):C.GC_879,(0,0):C.GC_878}) V_463 = Vertex(name = 'V_463', particles = [ P.s__tilde__, P.s, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS5 ], couplings = {(0,1):C.GC_312,(0,2):C.GC_892,(0,0):C.GC_891}) V_464 = Vertex(name = 'V_464', particles = [ P.b__tilde__, P.b, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS4, L.FFVS5 ], couplings = {(0,1):C.GC_310,(0,2):C.GC_305,(0,3):C.GC_479,(0,0):C.GC_478}) V_465 = Vertex(name = 'V_465', particles = [ P.b__tilde__, P.b, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS5 ], couplings = {(0,1):C.GC_312,(0,2):C.GC_492,(0,0):C.GC_491}) V_466 = Vertex(name = 'V_466', particles = [ P.d__tilde__, P.d, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV7, L.FFV8 ], couplings = {(0,0):C.GC_195,(0,2):C.GC_136,(0,4):C.GC_391,(0,3):C.GC_350,(0,5):C.GC_639,(0,1):C.GC_638}) V_467 = Vertex(name = 'V_467', particles = [ P.d__tilde__, P.d, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV7, L.FFV8 ], couplings = {(0,0):C.GC_363,(0,2):C.GC_354,(0,3):C.GC_394,(0,4):C.GC_651,(0,1):C.GC_650}) V_468 = Vertex(name = 'V_468', particles = [ P.d__tilde__, P.d, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV7 ], couplings = {(0,0):C.GC_356,(0,1):C.GC_397}) V_469 = Vertex(name = 'V_469', particles = [ P.d__tilde__, P.d, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_384}) V_470 = Vertex(name = 'V_470', particles = [ P.d__tilde__, P.d, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_386}) V_471 = Vertex(name = 'V_471', particles = [ P.d__tilde__, P.d, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_387}) V_472 = Vertex(name = 'V_472', particles = [ P.s__tilde__, P.s, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV7, L.FFV8 ], couplings = {(0,0):C.GC_195,(0,2):C.GC_136,(0,4):C.GC_391,(0,3):C.GC_350,(0,5):C.GC_905,(0,1):C.GC_904}) V_473 = Vertex(name = 'V_473', particles = [ P.s__tilde__, P.s, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV7, L.FFV8 ], couplings = {(0,0):C.GC_363,(0,2):C.GC_354,(0,3):C.GC_394,(0,4):C.GC_917,(0,1):C.GC_916}) V_474 = Vertex(name = 'V_474', particles = [ P.s__tilde__, P.s, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV7 ], couplings = {(0,0):C.GC_356,(0,1):C.GC_397}) V_475 = Vertex(name = 'V_475', particles = [ P.s__tilde__, P.s, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_384}) V_476 = Vertex(name = 'V_476', particles = [ P.s__tilde__, P.s, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_386}) V_477 = Vertex(name = 'V_477', particles = [ P.s__tilde__, P.s, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_387}) V_478 = Vertex(name = 'V_478', particles = [ P.b__tilde__, P.b, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV7, L.FFV8 ], couplings = {(0,0):C.GC_195,(0,2):C.GC_136,(0,4):C.GC_391,(0,3):C.GC_350,(0,5):C.GC_505,(0,1):C.GC_504}) V_479 = Vertex(name = 'V_479', particles = [ P.b__tilde__, P.b, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV7, L.FFV8 ], couplings = {(0,0):C.GC_363,(0,2):C.GC_354,(0,3):C.GC_394,(0,4):C.GC_517,(0,1):C.GC_516}) V_480 = Vertex(name = 'V_480', particles = [ P.b__tilde__, P.b, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV7 ], couplings = {(0,0):C.GC_356,(0,1):C.GC_397}) V_481 = Vertex(name = 'V_481', particles = [ P.b__tilde__, P.b, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_384}) V_482 = Vertex(name = 'V_482', particles = [ P.b__tilde__, P.b, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_386}) V_483 = Vertex(name = 'V_483', particles = [ P.b__tilde__, P.b, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_387}) V_484 = Vertex(name = 'V_484', particles = [ P.e__plus__, P.e__minus__, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,0):C.GC_151,(0,1):C.GC_150}) V_485 = Vertex(name = 'V_485', particles = [ P.e__plus__, P.e__minus__, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_153}) V_486 = Vertex(name = 'V_486', particles = [ P.mu__plus__, P.mu__minus__, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,0):C.GC_151,(0,1):C.GC_150}) V_487 = Vertex(name = 'V_487', particles = [ P.mu__plus__, P.mu__minus__, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_153}) V_488 = Vertex(name = 'V_488', particles = [ P.ta__plus__, P.ta__minus__, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,0):C.GC_151,(0,1):C.GC_150}) V_489 = Vertex(name = 'V_489', particles = [ P.ta__plus__, P.ta__minus__, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_153}) V_490 = Vertex(name = 'V_490', particles = [ P.e__plus__, P.e__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS4, L.FFVS5 ], couplings = {(0,1):C.GC_307,(0,2):C.GC_306,(0,3):C.GC_687,(0,0):C.GC_686}) V_491 = Vertex(name = 'V_491', particles = [ P.e__plus__, P.e__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS5 ], couplings = {(0,1):C.GC_309,(0,2):C.GC_698,(0,0):C.GC_697}) V_492 = Vertex(name = 'V_492', particles = [ P.mu__plus__, P.mu__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS4, L.FFVS5 ], couplings = {(0,1):C.GC_307,(0,2):C.GC_306,(0,3):C.GC_782,(0,0):C.GC_781}) V_493 = Vertex(name = 'V_493', particles = [ P.mu__plus__, P.mu__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS5 ], couplings = {(0,1):C.GC_309,(0,2):C.GC_793,(0,0):C.GC_792}) V_494 = Vertex(name = 'V_494', particles = [ P.ta__plus__, P.ta__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS4, L.FFVS5 ], couplings = {(0,1):C.GC_307,(0,2):C.GC_306,(0,3):C.GC_1139,(0,0):C.GC_1138}) V_495 = Vertex(name = 'V_495', particles = [ P.ta__plus__, P.ta__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS5 ], couplings = {(0,1):C.GC_309,(0,2):C.GC_1150,(0,0):C.GC_1149}) V_496 = Vertex(name = 'V_496', particles = [ P.u__tilde__, P.u, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV6, L.FFV8 ], couplings = {(0,0):C.GC_196,(0,2):C.GC_135,(0,4):C.GC_390,(0,3):C.GC_357,(0,5):C.GC_1298,(0,1):C.GC_1296}) V_497 = Vertex(name = 'V_497', particles = [ P.u__tilde__, P.u, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV6, L.FFV8 ], couplings = {(0,0):C.GC_361,(0,2):C.GC_354,(0,3):C.GC_393,(0,4):C.GC_1310,(0,1):C.GC_1309}) V_498 = Vertex(name = 'V_498', particles = [ P.u__tilde__, P.u, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV6 ], couplings = {(0,0):C.GC_355,(0,1):C.GC_396}) V_499 = Vertex(name = 'V_499', particles = [ P.u__tilde__, P.u, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_383}) V_500 = Vertex(name = 'V_500', particles = [ P.u__tilde__, P.u, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_385}) V_501 = Vertex(name = 'V_501', particles = [ P.u__tilde__, P.u, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_388}) V_502 = Vertex(name = 'V_502', particles = [ P.c__tilde__, P.c, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV6, L.FFV8 ], couplings = {(0,0):C.GC_196,(0,2):C.GC_135,(0,4):C.GC_390,(0,3):C.GC_357,(0,5):C.GC_563,(0,1):C.GC_561}) V_503 = Vertex(name = 'V_503', particles = [ P.c__tilde__, P.c, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV6, L.FFV8 ], couplings = {(0,0):C.GC_361,(0,2):C.GC_354,(0,3):C.GC_393,(0,4):C.GC_575,(0,1):C.GC_574}) V_504 = Vertex(name = 'V_504', particles = [ P.c__tilde__, P.c, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV6 ], couplings = {(0,0):C.GC_355,(0,1):C.GC_396}) V_505 = Vertex(name = 'V_505', particles = [ P.c__tilde__, P.c, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_383}) V_506 = Vertex(name = 'V_506', particles = [ P.c__tilde__, P.c, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_385}) V_507 = Vertex(name = 'V_507', particles = [ P.c__tilde__, P.c, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_388}) V_508 = Vertex(name = 'V_508', particles = [ P.t__tilde__, P.t, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV5, L.FFV6, L.FFV8 ], couplings = {(0,0):C.GC_196,(0,2):C.GC_135,(0,4):C.GC_390,(0,3):C.GC_357,(0,5):C.GC_1001,(0,1):C.GC_999}) V_509 = Vertex(name = 'V_509', particles = [ P.t__tilde__, P.t, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV2, L.FFV3, L.FFV6, L.FFV8 ], couplings = {(0,0):C.GC_361,(0,2):C.GC_354,(0,3):C.GC_393,(0,4):C.GC_1013,(0,1):C.GC_1012}) V_510 = Vertex(name = 'V_510', particles = [ P.t__tilde__, P.t, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3, L.FFV6 ], couplings = {(0,0):C.GC_355,(0,1):C.GC_396}) V_511 = Vertex(name = 'V_511', particles = [ P.t__tilde__, P.t, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_383}) V_512 = Vertex(name = 'V_512', particles = [ P.t__tilde__, P.t, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_385}) V_513 = Vertex(name = 'V_513', particles = [ P.t__tilde__, P.t, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_388}) V_514 = Vertex(name = 'V_514', particles = [ P.u__tilde__, P.u, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,0):C.GC_154,(0,1):C.GC_157}) V_515 = Vertex(name = 'V_515', particles = [ P.u__tilde__, P.u, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_155}) V_516 = Vertex(name = 'V_516', particles = [ P.c__tilde__, P.c, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,0):C.GC_154,(0,1):C.GC_157}) V_517 = Vertex(name = 'V_517', particles = [ P.c__tilde__, P.c, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_155}) V_518 = Vertex(name = 'V_518', particles = [ P.t__tilde__, P.t, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1, L.FFVSS2 ], couplings = {(0,0):C.GC_154,(0,1):C.GC_157}) V_519 = Vertex(name = 'V_519', particles = [ P.t__tilde__, P.t, P.Z, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_155}) V_520 = Vertex(name = 'V_520', particles = [ P.u__tilde__, P.u, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS4, L.FFVS5 ], couplings = {(0,1):C.GC_310,(0,2):C.GC_313,(0,3):C.GC_1272,(0,0):C.GC_1270}) V_521 = Vertex(name = 'V_521', particles = [ P.u__tilde__, P.u, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS5 ], couplings = {(0,1):C.GC_311,(0,2):C.GC_1285,(0,0):C.GC_1284}) V_522 = Vertex(name = 'V_522', particles = [ P.c__tilde__, P.c, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS4, L.FFVS5 ], couplings = {(0,1):C.GC_310,(0,2):C.GC_313,(0,3):C.GC_537,(0,0):C.GC_535}) V_523 = Vertex(name = 'V_523', particles = [ P.c__tilde__, P.c, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS5 ], couplings = {(0,1):C.GC_311,(0,2):C.GC_550,(0,0):C.GC_549}) V_524 = Vertex(name = 'V_524', particles = [ P.t__tilde__, P.t, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS4, L.FFVS5 ], couplings = {(0,1):C.GC_310,(0,2):C.GC_313,(0,3):C.GC_973,(0,0):C.GC_971}) V_525 = Vertex(name = 'V_525', particles = [ P.t__tilde__, P.t, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS2, L.FFVS5 ], couplings = {(0,1):C.GC_311,(0,2):C.GC_988,(0,0):C.GC_987}) V_526 = Vertex(name = 'V_526', particles = [ P.ve__tilde__, P.ve, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_135}) V_527 = Vertex(name = 'V_527', particles = [ P.ve__tilde__, P.ve, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_351}) V_528 = Vertex(name = 'V_528', particles = [ P.ve__tilde__, P.ve, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_353}) V_529 = Vertex(name = 'V_529', particles = [ P.ve__tilde__, P.ve, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_358}) V_530 = Vertex(name = 'V_530', particles = [ P.vm__tilde__, P.vm, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_135}) V_531 = Vertex(name = 'V_531', particles = [ P.vm__tilde__, P.vm, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_351}) V_532 = Vertex(name = 'V_532', particles = [ P.vm__tilde__, P.vm, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_353}) V_533 = Vertex(name = 'V_533', particles = [ P.vm__tilde__, P.vm, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_358}) V_534 = Vertex(name = 'V_534', particles = [ P.vt__tilde__, P.vt, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_135}) V_535 = Vertex(name = 'V_535', particles = [ P.vt__tilde__, P.vt, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_351}) V_536 = Vertex(name = 'V_536', particles = [ P.vt__tilde__, P.vt, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_353}) V_537 = Vertex(name = 'V_537', particles = [ P.vt__tilde__, P.vt, P.Z ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_358}) V_538 = Vertex(name = 'V_538', particles = [ P.ve__tilde__, P.ve, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_151}) V_539 = Vertex(name = 'V_539', particles = [ P.ve__tilde__, P.ve, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_152}) V_540 = Vertex(name = 'V_540', particles = [ P.vm__tilde__, P.vm, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_151}) V_541 = Vertex(name = 'V_541', particles = [ P.vm__tilde__, P.vm, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_152}) V_542 = Vertex(name = 'V_542', particles = [ P.vt__tilde__, P.vt, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_151}) V_543 = Vertex(name = 'V_543', particles = [ P.vt__tilde__, P.vt, P.Z, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFVSS1 ], couplings = {(0,0):C.GC_152}) V_544 = Vertex(name = 'V_544', particles = [ P.ve__tilde__, P.ve, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS2 ], couplings = {(0,0):C.GC_307}) V_545 = Vertex(name = 'V_545', particles = [ P.ve__tilde__, P.ve, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS2 ], couplings = {(0,0):C.GC_308}) V_546 = Vertex(name = 'V_546', particles = [ P.vm__tilde__, P.vm, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS2 ], couplings = {(0,0):C.GC_307}) V_547 = Vertex(name = 'V_547', particles = [ P.vm__tilde__, P.vm, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS2 ], couplings = {(0,0):C.GC_308}) V_548 = Vertex(name = 'V_548', particles = [ P.vt__tilde__, P.vt, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS2 ], couplings = {(0,0):C.GC_307}) V_549 = Vertex(name = 'V_549', particles = [ P.vt__tilde__, P.vt, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVS2 ], couplings = {(0,0):C.GC_308}) V_550 = Vertex(name = 'V_550', particles = [ P.t__tilde__, P.t1, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1 ], couplings = {(0,0):C.GC_84}) V_551 = Vertex(name = 'V_551', particles = [ P.t1__tilde__, P.t1, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1 ], couplings = {(0,0):C.GC_89}) V_552 = Vertex(name = 'V_552', particles = [ P.t1__tilde__, P.t, P.a ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1 ], couplings = {(0,0):C.GC_84}) V_553 = Vertex(name = 'V_553', particles = [ P.t__tilde__, P.t1, P.g ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFV1 ], couplings = {(0,0):C.GC_87}) V_554 = Vertex(name = 'V_554', particles = [ P.t1__tilde__, P.t1, P.g ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFV1 ], couplings = {(0,0):C.GC_92}) V_555 = Vertex(name = 'V_555', particles = [ P.t1__tilde__, P.t, P.g ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFV1 ], couplings = {(0,0):C.GC_87}) V_556 = Vertex(name = 'V_556', particles = [ P.d__tilde__, P.t1, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_179}) V_557 = Vertex(name = 'V_557', particles = [ P.s__tilde__, P.t1, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_180}) V_558 = Vertex(name = 'V_558', particles = [ P.b__tilde__, P.t1, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_181}) V_559 = Vertex(name = 'V_559', particles = [ P.d__tilde__, P.t1, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_186}) V_560 = Vertex(name = 'V_560', particles = [ P.s__tilde__, P.t1, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_187}) V_561 = Vertex(name = 'V_561', particles = [ P.b__tilde__, P.t1, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_188}) V_562 = Vertex(name = 'V_562', particles = [ P.d__tilde__, P.u, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_173}) V_563 = Vertex(name = 'V_563', particles = [ P.s__tilde__, P.u, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_174}) V_564 = Vertex(name = 'V_564', particles = [ P.b__tilde__, P.u, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_175}) V_565 = Vertex(name = 'V_565', particles = [ P.d__tilde__, P.c, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_176}) V_566 = Vertex(name = 'V_566', particles = [ P.s__tilde__, P.c, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_177}) V_567 = Vertex(name = 'V_567', particles = [ P.b__tilde__, P.c, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_178}) V_568 = Vertex(name = 'V_568', particles = [ P.d__tilde__, P.t, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_179}) V_569 = Vertex(name = 'V_569', particles = [ P.s__tilde__, P.t, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_180}) V_570 = Vertex(name = 'V_570', particles = [ P.b__tilde__, P.t, P.W1__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_181}) V_571 = Vertex(name = 'V_571', particles = [ P.e__plus__, P.ve, P.W1__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_172}) V_572 = Vertex(name = 'V_572', particles = [ P.mu__plus__, P.vm, P.W1__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_172}) V_573 = Vertex(name = 'V_573', particles = [ P.ta__plus__, P.vt, P.W1__minus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_172}) V_574 = Vertex(name = 'V_574', particles = [ P.t1__tilde__, P.d, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2727}) V_575 = Vertex(name = 'V_575', particles = [ P.t1__tilde__, P.s, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2935}) V_576 = Vertex(name = 'V_576', particles = [ P.t1__tilde__, P.b, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_3143}) V_577 = Vertex(name = 'V_577', particles = [ P.u__tilde__, P.d, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1484}) V_578 = Vertex(name = 'V_578', particles = [ P.c__tilde__, P.d, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2105}) V_579 = Vertex(name = 'V_579', particles = [ P.t__tilde__, P.d, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2726}) V_580 = Vertex(name = 'V_580', particles = [ P.u__tilde__, P.s, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1691}) V_581 = Vertex(name = 'V_581', particles = [ P.c__tilde__, P.s, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2312}) V_582 = Vertex(name = 'V_582', particles = [ P.t__tilde__, P.s, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2934}) V_583 = Vertex(name = 'V_583', particles = [ P.u__tilde__, P.b, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_1898}) V_584 = Vertex(name = 'V_584', particles = [ P.c__tilde__, P.b, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2519}) V_585 = Vertex(name = 'V_585', particles = [ P.t__tilde__, P.b, P.W1__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_3142}) V_586 = Vertex(name = 'V_586', particles = [ P.ve__tilde__, P.e__minus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_172}) V_587 = Vertex(name = 'V_587', particles = [ P.vm__tilde__, P.mu__minus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_172}) V_588 = Vertex(name = 'V_588', particles = [ P.vt__tilde__, P.ta__minus__, P.W1__plus__ ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_172}) V_589 = Vertex(name = 'V_589', particles = [ P.t1__tilde__, P.d, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2726}) V_590 = Vertex(name = 'V_590', particles = [ P.t1__tilde__, P.s, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_2934}) V_591 = Vertex(name = 'V_591', particles = [ P.t1__tilde__, P.b, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_3142}) V_592 = Vertex(name = 'V_592', particles = [ P.t__tilde__, P.t1, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_213,(0,1):C.GC_182}) V_593 = Vertex(name = 'V_593', particles = [ P.t1__tilde__, P.t1, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_215,(0,1):C.GC_189}) V_594 = Vertex(name = 'V_594', particles = [ P.t1__tilde__, P.t, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_213,(0,1):C.GC_182}) V_595 = Vertex(name = 'V_595', particles = [ P.d__tilde__, P.d, P.Z1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_212,(0,1):C.GC_183}) V_596 = Vertex(name = 'V_596', particles = [ P.s__tilde__, P.s, P.Z1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_212,(0,1):C.GC_183}) V_597 = Vertex(name = 'V_597', particles = [ P.b__tilde__, P.b, P.Z1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_212,(0,1):C.GC_183}) V_598 = Vertex(name = 'V_598', particles = [ P.e__plus__, P.e__minus__, P.Z1 ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_214,(0,1):C.GC_183}) V_599 = Vertex(name = 'V_599', particles = [ P.mu__plus__, P.mu__minus__, P.Z1 ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_214,(0,1):C.GC_183}) V_600 = Vertex(name = 'V_600', particles = [ P.ta__plus__, P.ta__minus__, P.Z1 ], color = [ '1' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_214,(0,1):C.GC_183}) V_601 = Vertex(name = 'V_601', particles = [ P.t__tilde__, P.t1, P.Z1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_215,(0,1):C.GC_189}) V_602 = Vertex(name = 'V_602', particles = [ P.t1__tilde__, P.t1, P.Z1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_216,(0,1):C.GC_192}) V_603 = Vertex(name = 'V_603', particles = [ P.t1__tilde__, P.t, P.Z1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_215,(0,1):C.GC_189}) V_604 = Vertex(name = 'V_604', particles = [ P.u__tilde__, P.u, P.Z1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_213,(0,1):C.GC_182}) V_605 = Vertex(name = 'V_605', particles = [ P.c__tilde__, P.c, P.Z1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_213,(0,1):C.GC_182}) V_606 = Vertex(name = 'V_606', particles = [ P.t__tilde__, P.t, P.Z1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFV1, L.FFV3 ], couplings = {(0,0):C.GC_213,(0,1):C.GC_182}) V_607 = Vertex(name = 'V_607', particles = [ P.ve__tilde__, P.ve, P.Z1 ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_182}) V_608 = Vertex(name = 'V_608', particles = [ P.vm__tilde__, P.vm, P.Z1 ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_182}) V_609 = Vertex(name = 'V_609', particles = [ P.vt__tilde__, P.vt, P.Z1 ], color = [ '1' ], lorentz = [ L.FFV3 ], couplings = {(0,0):C.GC_182}) V_610 = Vertex(name = 'V_610', particles = [ P.d__tilde__, P.d, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS1, L.FFS2 ], couplings = {(0,0):C.GC_654,(0,1):C.GC_602}) V_611 = Vertex(name = 'V_611', particles = [ P.d__tilde__, P.d, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_655}) V_612 = Vertex(name = 'V_612', particles = [ P.d__tilde__, P.d, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_656}) V_613 = Vertex(name = 'V_613', particles = [ P.d__tilde__, P.d, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_657}) V_614 = Vertex(name = 'V_614', particles = [ P.d__tilde__, P.d, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_658}) V_615 = Vertex(name = 'V_615', particles = [ P.d__tilde__, P.d, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_659}) V_616 = Vertex(name = 'V_616', particles = [ P.s__tilde__, P.s, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS1, L.FFS2 ], couplings = {(0,0):C.GC_920,(0,1):C.GC_868}) V_617 = Vertex(name = 'V_617', particles = [ P.s__tilde__, P.s, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_921}) V_618 = Vertex(name = 'V_618', particles = [ P.s__tilde__, P.s, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_922}) V_619 = Vertex(name = 'V_619', particles = [ P.s__tilde__, P.s, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_923}) V_620 = Vertex(name = 'V_620', particles = [ P.s__tilde__, P.s, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_924}) V_621 = Vertex(name = 'V_621', particles = [ P.s__tilde__, P.s, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_925}) V_622 = Vertex(name = 'V_622', particles = [ P.b__tilde__, P.b, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS1, L.FFS2 ], couplings = {(0,0):C.GC_520,(0,1):C.GC_468}) V_623 = Vertex(name = 'V_623', particles = [ P.b__tilde__, P.b, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_521}) V_624 = Vertex(name = 'V_624', particles = [ P.b__tilde__, P.b, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_522}) V_625 = Vertex(name = 'V_625', particles = [ P.b__tilde__, P.b, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_523}) V_626 = Vertex(name = 'V_626', particles = [ P.b__tilde__, P.b, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_524}) V_627 = Vertex(name = 'V_627', particles = [ P.b__tilde__, P.b, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_525}) V_628 = Vertex(name = 'V_628', particles = [ P.e__plus__, P.e__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS1, L.FFS2 ], couplings = {(0,0):C.GC_722,(0,1):C.GC_678}) V_629 = Vertex(name = 'V_629', particles = [ P.e__plus__, P.e__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_723}) V_630 = Vertex(name = 'V_630', particles = [ P.e__plus__, P.e__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_724}) V_631 = Vertex(name = 'V_631', particles = [ P.e__plus__, P.e__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_725}) V_632 = Vertex(name = 'V_632', particles = [ P.e__plus__, P.e__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_726}) V_633 = Vertex(name = 'V_633', particles = [ P.e__plus__, P.e__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_727}) V_634 = Vertex(name = 'V_634', particles = [ P.mu__plus__, P.mu__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS1, L.FFS2 ], couplings = {(0,0):C.GC_817,(0,1):C.GC_773}) V_635 = Vertex(name = 'V_635', particles = [ P.mu__plus__, P.mu__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_818}) V_636 = Vertex(name = 'V_636', particles = [ P.mu__plus__, P.mu__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_819}) V_637 = Vertex(name = 'V_637', particles = [ P.mu__plus__, P.mu__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_820}) V_638 = Vertex(name = 'V_638', particles = [ P.mu__plus__, P.mu__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_821}) V_639 = Vertex(name = 'V_639', particles = [ P.mu__plus__, P.mu__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_822}) V_640 = Vertex(name = 'V_640', particles = [ P.ta__plus__, P.ta__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS1, L.FFS2 ], couplings = {(0,0):C.GC_1174,(0,1):C.GC_1130}) V_641 = Vertex(name = 'V_641', particles = [ P.ta__plus__, P.ta__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1175}) V_642 = Vertex(name = 'V_642', particles = [ P.ta__plus__, P.ta__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1176}) V_643 = Vertex(name = 'V_643', particles = [ P.ta__plus__, P.ta__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1177}) V_644 = Vertex(name = 'V_644', particles = [ P.ta__plus__, P.ta__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1178}) V_645 = Vertex(name = 'V_645', particles = [ P.ta__plus__, P.ta__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1179}) V_646 = Vertex(name = 'V_646', particles = [ P.u__tilde__, P.u, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS1, L.FFS2 ], couplings = {(0,0):C.GC_1317,(0,1):C.GC_1261}) V_647 = Vertex(name = 'V_647', particles = [ P.u__tilde__, P.u, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1313}) V_648 = Vertex(name = 'V_648', particles = [ P.u__tilde__, P.u, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1314}) V_649 = Vertex(name = 'V_649', particles = [ P.u__tilde__, P.u, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1315}) V_650 = Vertex(name = 'V_650', particles = [ P.u__tilde__, P.u, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1316}) V_651 = Vertex(name = 'V_651', particles = [ P.u__tilde__, P.u, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1318}) V_652 = Vertex(name = 'V_652', particles = [ P.c__tilde__, P.c, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS1, L.FFS2 ], couplings = {(0,0):C.GC_582,(0,1):C.GC_526}) V_653 = Vertex(name = 'V_653', particles = [ P.c__tilde__, P.c, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_578}) V_654 = Vertex(name = 'V_654', particles = [ P.c__tilde__, P.c, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_579}) V_655 = Vertex(name = 'V_655', particles = [ P.c__tilde__, P.c, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_580}) V_656 = Vertex(name = 'V_656', particles = [ P.c__tilde__, P.c, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_581}) V_657 = Vertex(name = 'V_657', particles = [ P.c__tilde__, P.c, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_583}) V_658 = Vertex(name = 'V_658', particles = [ P.t__tilde__, P.t, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS1, L.FFS2 ], couplings = {(0,0):C.GC_1020,(0,1):C.GC_962}) V_659 = Vertex(name = 'V_659', particles = [ P.t__tilde__, P.t, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1016}) V_660 = Vertex(name = 'V_660', particles = [ P.t__tilde__, P.t, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1017}) V_661 = Vertex(name = 'V_661', particles = [ P.t__tilde__, P.t, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1018}) V_662 = Vertex(name = 'V_662', particles = [ P.t__tilde__, P.t, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1019}) V_663 = Vertex(name = 'V_663', particles = [ P.t__tilde__, P.t, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1021}) V_664 = Vertex(name = 'V_664', particles = [ P.d__tilde__, P.d, P.H, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSSS1, L.FFSSS2 ], couplings = {(0,0):C.GC_605,(0,1):C.GC_606}) V_665 = Vertex(name = 'V_665', particles = [ P.s__tilde__, P.s, P.H, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSSS1, L.FFSSS2 ], couplings = {(0,0):C.GC_871,(0,1):C.GC_872}) V_666 = Vertex(name = 'V_666', particles = [ P.b__tilde__, P.b, P.H, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSSS1, L.FFSSS2 ], couplings = {(0,0):C.GC_471,(0,1):C.GC_472}) V_667 = Vertex(name = 'V_667', particles = [ P.d__tilde__, P.d, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSS1, L.FFSS2 ], couplings = {(0,0):C.GC_631,(0,1):C.GC_632}) V_668 = Vertex(name = 'V_668', particles = [ P.s__tilde__, P.s, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSS1, L.FFSS2 ], couplings = {(0,0):C.GC_897,(0,1):C.GC_898}) V_669 = Vertex(name = 'V_669', particles = [ P.b__tilde__, P.b, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSS1, L.FFSS2 ], couplings = {(0,0):C.GC_497,(0,1):C.GC_498}) V_670 = Vertex(name = 'V_670', particles = [ P.e__plus__, P.e__minus__, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFSSS1, L.FFSSS2 ], couplings = {(0,0):C.GC_679,(0,1):C.GC_680}) V_671 = Vertex(name = 'V_671', particles = [ P.mu__plus__, P.mu__minus__, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFSSS1, L.FFSSS2 ], couplings = {(0,0):C.GC_774,(0,1):C.GC_775}) V_672 = Vertex(name = 'V_672', particles = [ P.ta__plus__, P.ta__minus__, P.H, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFSSS1, L.FFSSS2 ], couplings = {(0,0):C.GC_1131,(0,1):C.GC_1132}) V_673 = Vertex(name = 'V_673', particles = [ P.e__plus__, P.e__minus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFSS1, L.FFSS2 ], couplings = {(0,0):C.GC_701,(0,1):C.GC_702}) V_674 = Vertex(name = 'V_674', particles = [ P.mu__plus__, P.mu__minus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFSS1, L.FFSS2 ], couplings = {(0,0):C.GC_796,(0,1):C.GC_797}) V_675 = Vertex(name = 'V_675', particles = [ P.ta__plus__, P.ta__minus__, P.H, P.H ], color = [ '1' ], lorentz = [ L.FFSS1, L.FFSS2 ], couplings = {(0,0):C.GC_1153,(0,1):C.GC_1154}) V_676 = Vertex(name = 'V_676', particles = [ P.u__tilde__, P.u, P.H, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSSS1, L.FFSSS2 ], couplings = {(0,0):C.GC_1266,(0,1):C.GC_1267}) V_677 = Vertex(name = 'V_677', particles = [ P.c__tilde__, P.c, P.H, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSSS1, L.FFSSS2 ], couplings = {(0,0):C.GC_531,(0,1):C.GC_532}) V_678 = Vertex(name = 'V_678', particles = [ P.t__tilde__, P.t, P.H, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSSS1, L.FFSSS2 ], couplings = {(0,0):C.GC_967,(0,1):C.GC_968}) V_679 = Vertex(name = 'V_679', particles = [ P.u__tilde__, P.u, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSS1, L.FFSS2 ], couplings = {(0,0):C.GC_1292,(0,1):C.GC_1293}) V_680 = Vertex(name = 'V_680', particles = [ P.c__tilde__, P.c, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSS1, L.FFSS2 ], couplings = {(0,0):C.GC_557,(0,1):C.GC_558}) V_681 = Vertex(name = 'V_681', particles = [ P.t__tilde__, P.t, P.H, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFSS1, L.FFSS2 ], couplings = {(0,0):C.GC_995,(0,1):C.GC_996}) V_682 = Vertex(name = 'V_682', particles = [ P.d__tilde__, P.d, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_619}) V_683 = Vertex(name = 'V_683', particles = [ P.s__tilde__, P.s, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_885}) V_684 = Vertex(name = 'V_684', particles = [ P.b__tilde__, P.b, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_485}) V_685 = Vertex(name = 'V_685', particles = [ P.e__plus__, P.e__minus__, P.H1 ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_691}) V_686 = Vertex(name = 'V_686', particles = [ P.mu__plus__, P.mu__minus__, P.H1 ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_786}) V_687 = Vertex(name = 'V_687', particles = [ P.ta__plus__, P.ta__minus__, P.H1 ], color = [ '1' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1143}) V_688 = Vertex(name = 'V_688', particles = [ P.t__tilde__, P.t1, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_979}) V_689 = Vertex(name = 'V_689', particles = [ P.t__tilde__, P.t1, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_980}) V_690 = Vertex(name = 'V_690', particles = [ P.t1__tilde__, P.t1, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_980}) V_691 = Vertex(name = 'V_691', particles = [ P.t1__tilde__, P.t1, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_981}) V_692 = Vertex(name = 'V_692', particles = [ P.t1__tilde__, P.t, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_979}) V_693 = Vertex(name = 'V_693', particles = [ P.t1__tilde__, P.t, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_980}) V_694 = Vertex(name = 'V_694', particles = [ P.u__tilde__, P.u, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_1278}) V_695 = Vertex(name = 'V_695', particles = [ P.c__tilde__, P.c, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_543}) V_696 = Vertex(name = 'V_696', particles = [ P.t__tilde__, P.t, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFS2 ], couplings = {(0,0):C.GC_979}) V_697 = Vertex(name = 'V_697', particles = [ P.d__tilde__, P.d, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_611,(0,0):C.GC_610}) V_698 = Vertex(name = 'V_698', particles = [ P.d__tilde__, P.d, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_628,(0,0):C.GC_627}) V_699 = Vertex(name = 'V_699', particles = [ P.s__tilde__, P.s, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_877,(0,0):C.GC_876}) V_700 = Vertex(name = 'V_700', particles = [ P.s__tilde__, P.s, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_894,(0,0):C.GC_893}) V_701 = Vertex(name = 'V_701', particles = [ P.b__tilde__, P.b, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_477,(0,0):C.GC_476}) V_702 = Vertex(name = 'V_702', particles = [ P.b__tilde__, P.b, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_494,(0,0):C.GC_493}) V_703 = Vertex(name = 'V_703', particles = [ P.d__tilde__, P.d, P.g, P.H ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_604,(0,0):C.GC_603}) V_704 = Vertex(name = 'V_704', particles = [ P.s__tilde__, P.s, P.g, P.H ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_870,(0,0):C.GC_869}) V_705 = Vertex(name = 'V_705', particles = [ P.b__tilde__, P.b, P.g, P.H ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_470,(0,0):C.GC_469}) V_706 = Vertex(name = 'V_706', particles = [ P.d__tilde__, P.d, P.g, P.g, P.H ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_618,(0,0):C.GC_617}) V_707 = Vertex(name = 'V_707', particles = [ P.s__tilde__, P.s, P.g, P.g, P.H ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_884,(0,0):C.GC_883}) V_708 = Vertex(name = 'V_708', particles = [ P.b__tilde__, P.b, P.g, P.g, P.H ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_484,(0,0):C.GC_483}) V_709 = Vertex(name = 'V_709', particles = [ P.d__tilde__, P.d, P.g, P.g ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_644,(0,0):C.GC_643}) V_710 = Vertex(name = 'V_710', particles = [ P.s__tilde__, P.s, P.g, P.g ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_910,(0,0):C.GC_909}) V_711 = Vertex(name = 'V_711', particles = [ P.b__tilde__, P.b, P.g, P.g ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_510,(0,0):C.GC_509}) V_712 = Vertex(name = 'V_712', particles = [ P.u__tilde__, P.d, P.a, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_614,(0,1):C.GC_1273}) V_713 = Vertex(name = 'V_713', particles = [ P.u__tilde__, P.d, P.a, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_616,(0,1):C.GC_1275}) V_714 = Vertex(name = 'V_714', particles = [ P.c__tilde__, P.s, P.a, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_880,(0,1):C.GC_538}) V_715 = Vertex(name = 'V_715', particles = [ P.c__tilde__, P.s, P.a, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_882,(0,1):C.GC_540}) V_716 = Vertex(name = 'V_716', particles = [ P.t__tilde__, P.b, P.a, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_480,(0,1):C.GC_974}) V_717 = Vertex(name = 'V_717', particles = [ P.t__tilde__, P.b, P.a, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_482,(0,1):C.GC_976}) V_718 = Vertex(name = 'V_718', particles = [ P.u__tilde__, P.d, P.a, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_640,(0,1):C.GC_1299}) V_719 = Vertex(name = 'V_719', particles = [ P.u__tilde__, P.d, P.a, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_642,(0,1):C.GC_1301}) V_720 = Vertex(name = 'V_720', particles = [ P.c__tilde__, P.s, P.a, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_906,(0,1):C.GC_564}) V_721 = Vertex(name = 'V_721', particles = [ P.c__tilde__, P.s, P.a, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_908,(0,1):C.GC_566}) V_722 = Vertex(name = 'V_722', particles = [ P.t__tilde__, P.b, P.a, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_506,(0,1):C.GC_1002}) V_723 = Vertex(name = 'V_723', particles = [ P.t__tilde__, P.b, P.a, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_508,(0,1):C.GC_1004}) V_724 = Vertex(name = 'V_724', particles = [ P.d__tilde__, P.d, P.W__minus__, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_621,(0,0):C.GC_620}) V_725 = Vertex(name = 'V_725', particles = [ P.s__tilde__, P.s, P.W__minus__, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_887,(0,0):C.GC_886}) V_726 = Vertex(name = 'V_726', particles = [ P.b__tilde__, P.b, P.W__minus__, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_487,(0,0):C.GC_486}) V_727 = Vertex(name = 'V_727', particles = [ P.d__tilde__, P.d, P.W__minus__, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_646,(0,0):C.GC_645}) V_728 = Vertex(name = 'V_728', particles = [ P.s__tilde__, P.s, P.W__minus__, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_912,(0,0):C.GC_911}) V_729 = Vertex(name = 'V_729', particles = [ P.b__tilde__, P.b, P.W__minus__, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_512,(0,0):C.GC_511}) V_730 = Vertex(name = 'V_730', particles = [ P.e__plus__, P.e__minus__, P.a, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_685,(0,0):C.GC_684}) V_731 = Vertex(name = 'V_731', particles = [ P.e__plus__, P.e__minus__, P.a, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_700,(0,0):C.GC_699}) V_732 = Vertex(name = 'V_732', particles = [ P.mu__plus__, P.mu__minus__, P.a, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_780,(0,0):C.GC_779}) V_733 = Vertex(name = 'V_733', particles = [ P.mu__plus__, P.mu__minus__, P.a, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_795,(0,0):C.GC_794}) V_734 = Vertex(name = 'V_734', particles = [ P.ta__plus__, P.ta__minus__, P.a, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_1137,(0,0):C.GC_1136}) V_735 = Vertex(name = 'V_735', particles = [ P.ta__plus__, P.ta__minus__, P.a, P.H ], color = [ '1' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_1152,(0,0):C.GC_1151}) V_736 = Vertex(name = 'V_736', particles = [ P.ve__tilde__, P.e__minus__, P.a, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_688}) V_737 = Vertex(name = 'V_737', particles = [ P.ve__tilde__, P.e__minus__, P.a, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_690}) V_738 = Vertex(name = 'V_738', particles = [ P.vm__tilde__, P.mu__minus__, P.a, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_783}) V_739 = Vertex(name = 'V_739', particles = [ P.vm__tilde__, P.mu__minus__, P.a, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_785}) V_740 = Vertex(name = 'V_740', particles = [ P.vt__tilde__, P.ta__minus__, P.a, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_1140}) V_741 = Vertex(name = 'V_741', particles = [ P.vt__tilde__, P.ta__minus__, P.a, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_1142}) V_742 = Vertex(name = 'V_742', particles = [ P.ve__tilde__, P.e__minus__, P.a, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_710}) V_743 = Vertex(name = 'V_743', particles = [ P.ve__tilde__, P.e__minus__, P.a, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_712}) V_744 = Vertex(name = 'V_744', particles = [ P.vm__tilde__, P.mu__minus__, P.a, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_805}) V_745 = Vertex(name = 'V_745', particles = [ P.vm__tilde__, P.mu__minus__, P.a, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_807}) V_746 = Vertex(name = 'V_746', particles = [ P.vt__tilde__, P.ta__minus__, P.a, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_1162}) V_747 = Vertex(name = 'V_747', particles = [ P.vt__tilde__, P.ta__minus__, P.a, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_1164}) V_748 = Vertex(name = 'V_748', particles = [ P.e__plus__, P.e__minus__, P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_693,(0,0):C.GC_692}) V_749 = Vertex(name = 'V_749', particles = [ P.mu__plus__, P.mu__minus__, P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_788,(0,0):C.GC_787}) V_750 = Vertex(name = 'V_750', particles = [ P.ta__plus__, P.ta__minus__, P.W__minus__, P.W__plus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_1145,(0,0):C.GC_1144}) V_751 = Vertex(name = 'V_751', particles = [ P.e__plus__, P.e__minus__, P.W__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_714,(0,0):C.GC_713}) V_752 = Vertex(name = 'V_752', particles = [ P.mu__plus__, P.mu__minus__, P.W__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_809,(0,0):C.GC_808}) V_753 = Vertex(name = 'V_753', particles = [ P.ta__plus__, P.ta__minus__, P.W__minus__, P.W__plus__ ], color = [ '1' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_1166,(0,0):C.GC_1165}) V_754 = Vertex(name = 'V_754', particles = [ P.u__tilde__, P.u, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_1263,(0,0):C.GC_1262}) V_755 = Vertex(name = 'V_755', particles = [ P.u__tilde__, P.u, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_1287,(0,0):C.GC_1286}) V_756 = Vertex(name = 'V_756', particles = [ P.c__tilde__, P.c, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_528,(0,0):C.GC_527}) V_757 = Vertex(name = 'V_757', particles = [ P.c__tilde__, P.c, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_552,(0,0):C.GC_551}) V_758 = Vertex(name = 'V_758', particles = [ P.t__tilde__, P.t, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_964,(0,0):C.GC_963}) V_759 = Vertex(name = 'V_759', particles = [ P.t__tilde__, P.t, P.a, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_990,(0,0):C.GC_989}) V_760 = Vertex(name = 'V_760', particles = [ P.u__tilde__, P.u, P.g, P.H ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_1265,(0,0):C.GC_1264}) V_761 = Vertex(name = 'V_761', particles = [ P.c__tilde__, P.c, P.g, P.H ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_530,(0,0):C.GC_529}) V_762 = Vertex(name = 'V_762', particles = [ P.t__tilde__, P.t, P.g, P.H ], color = [ 'T(3,2,1)' ], lorentz = [ L.FFVS1, L.FFVS5 ], couplings = {(0,1):C.GC_966,(0,0):C.GC_965}) V_763 = Vertex(name = 'V_763', particles = [ P.u__tilde__, P.u, P.g, P.g, P.H ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_1277,(0,0):C.GC_1276}) V_764 = Vertex(name = 'V_764', particles = [ P.c__tilde__, P.c, P.g, P.g, P.H ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_542,(0,0):C.GC_541}) V_765 = Vertex(name = 'V_765', particles = [ P.t__tilde__, P.t, P.g, P.g, P.H ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_978,(0,0):C.GC_977}) V_766 = Vertex(name = 'V_766', particles = [ P.u__tilde__, P.u, P.g, P.g ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_1303,(0,0):C.GC_1302}) V_767 = Vertex(name = 'V_767', particles = [ P.c__tilde__, P.c, P.g, P.g ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_568,(0,0):C.GC_567}) V_768 = Vertex(name = 'V_768', particles = [ P.t__tilde__, P.t, P.g, P.g ], color = [ 'f(-1,3,4)*T(-1,2,1)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_1006,(0,0):C.GC_1005}) V_769 = Vertex(name = 'V_769', particles = [ P.d__tilde__, P.u, P.a, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_1273,(0,1):C.GC_614}) V_770 = Vertex(name = 'V_770', particles = [ P.d__tilde__, P.u, P.a, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_1274,(0,1):C.GC_615}) V_771 = Vertex(name = 'V_771', particles = [ P.s__tilde__, P.c, P.a, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_538,(0,1):C.GC_880}) V_772 = Vertex(name = 'V_772', particles = [ P.s__tilde__, P.c, P.a, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_539,(0,1):C.GC_881}) V_773 = Vertex(name = 'V_773', particles = [ P.b__tilde__, P.t, P.a, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_974,(0,1):C.GC_480}) V_774 = Vertex(name = 'V_774', particles = [ P.b__tilde__, P.t, P.a, P.W__minus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_975,(0,1):C.GC_481}) V_775 = Vertex(name = 'V_775', particles = [ P.d__tilde__, P.u, P.a, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_1299,(0,1):C.GC_640}) V_776 = Vertex(name = 'V_776', particles = [ P.d__tilde__, P.u, P.a, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_1300,(0,1):C.GC_641}) V_777 = Vertex(name = 'V_777', particles = [ P.s__tilde__, P.c, P.a, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_564,(0,1):C.GC_906}) V_778 = Vertex(name = 'V_778', particles = [ P.s__tilde__, P.c, P.a, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_565,(0,1):C.GC_907}) V_779 = Vertex(name = 'V_779', particles = [ P.b__tilde__, P.t, P.a, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_1002,(0,1):C.GC_506}) V_780 = Vertex(name = 'V_780', particles = [ P.b__tilde__, P.t, P.a, P.W__minus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_1003,(0,1):C.GC_507}) V_781 = Vertex(name = 'V_781', particles = [ P.u__tilde__, P.u, P.W__minus__, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_1281,(0,0):C.GC_1279}) V_782 = Vertex(name = 'V_782', particles = [ P.c__tilde__, P.c, P.W__minus__, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_546,(0,0):C.GC_544}) V_783 = Vertex(name = 'V_783', particles = [ P.t__tilde__, P.t, P.W__minus__, P.W__plus__, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS1, L.FFVVS3 ], couplings = {(0,1):C.GC_984,(0,0):C.GC_982}) V_784 = Vertex(name = 'V_784', particles = [ P.u__tilde__, P.u, P.W__minus__, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_1306,(0,0):C.GC_1304}) V_785 = Vertex(name = 'V_785', particles = [ P.c__tilde__, P.c, P.W__minus__, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_571,(0,0):C.GC_569}) V_786 = Vertex(name = 'V_786', particles = [ P.t__tilde__, P.t, P.W__minus__, P.W__plus__ ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV1, L.FFVV3 ], couplings = {(0,1):C.GC_1009,(0,0):C.GC_1007}) V_787 = Vertex(name = 'V_787', particles = [ P.u__tilde__, P.d, P.W__plus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_622,(0,1):C.GC_1280}) V_788 = Vertex(name = 'V_788', particles = [ P.u__tilde__, P.d, P.W__plus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_623,(0,1):C.GC_1282}) V_789 = Vertex(name = 'V_789', particles = [ P.c__tilde__, P.s, P.W__plus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_888,(0,1):C.GC_545}) V_790 = Vertex(name = 'V_790', particles = [ P.c__tilde__, P.s, P.W__plus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_889,(0,1):C.GC_547}) V_791 = Vertex(name = 'V_791', particles = [ P.t__tilde__, P.b, P.W__plus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_488,(0,1):C.GC_983}) V_792 = Vertex(name = 'V_792', particles = [ P.t__tilde__, P.b, P.W__plus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_489,(0,1):C.GC_985}) V_793 = Vertex(name = 'V_793', particles = [ P.u__tilde__, P.d, P.W__plus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_647,(0,1):C.GC_1305}) V_794 = Vertex(name = 'V_794', particles = [ P.u__tilde__, P.d, P.W__plus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_648,(0,1):C.GC_1307}) V_795 = Vertex(name = 'V_795', particles = [ P.c__tilde__, P.s, P.W__plus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_913,(0,1):C.GC_570}) V_796 = Vertex(name = 'V_796', particles = [ P.c__tilde__, P.s, P.W__plus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_914,(0,1):C.GC_572}) V_797 = Vertex(name = 'V_797', particles = [ P.t__tilde__, P.b, P.W__plus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_513,(0,1):C.GC_1008}) V_798 = Vertex(name = 'V_798', particles = [ P.t__tilde__, P.b, P.W__plus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_514,(0,1):C.GC_1010}) V_799 = Vertex(name = 'V_799', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_694}) V_800 = Vertex(name = 'V_800', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_695}) V_801 = Vertex(name = 'V_801', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_789}) V_802 = Vertex(name = 'V_802', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_790}) V_803 = Vertex(name = 'V_803', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_1146}) V_804 = Vertex(name = 'V_804', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS2 ], couplings = {(0,0):C.GC_1147}) V_805 = Vertex(name = 'V_805', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_715}) V_806 = Vertex(name = 'V_806', particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_716}) V_807 = Vertex(name = 'V_807', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_810}) V_808 = Vertex(name = 'V_808', particles = [ P.vm__tilde__, P.mu__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_811}) V_809 = Vertex(name = 'V_809', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_1167}) V_810 = Vertex(name = 'V_810', particles = [ P.vt__tilde__, P.ta__minus__, P.W__plus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV2 ], couplings = {(0,0):C.GC_1168}) V_811 = Vertex(name = 'V_811', particles = [ P.d__tilde__, P.u, P.W__minus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_1280,(0,1):C.GC_622}) V_812 = Vertex(name = 'V_812', particles = [ P.d__tilde__, P.u, P.W__minus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_1283,(0,1):C.GC_624}) V_813 = Vertex(name = 'V_813', particles = [ P.s__tilde__, P.c, P.W__minus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_545,(0,1):C.GC_888}) V_814 = Vertex(name = 'V_814', particles = [ P.s__tilde__, P.c, P.W__minus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_548,(0,1):C.GC_890}) V_815 = Vertex(name = 'V_815', particles = [ P.b__tilde__, P.t, P.W__minus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_983,(0,1):C.GC_488}) V_816 = Vertex(name = 'V_816', particles = [ P.b__tilde__, P.t, P.W__minus__, P.Z, P.H ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVVS2, L.FFVVS4 ], couplings = {(0,0):C.GC_986,(0,1):C.GC_490}) V_817 = Vertex(name = 'V_817', particles = [ P.d__tilde__, P.u, P.W__minus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_1305,(0,1):C.GC_647}) V_818 = Vertex(name = 'V_818', particles = [ P.d__tilde__, P.u, P.W__minus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_1308,(0,1):C.GC_649}) V_819 = Vertex(name = 'V_819', particles = [ P.s__tilde__, P.c, P.W__minus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_570,(0,1):C.GC_913}) V_820 = Vertex(name = 'V_820', particles = [ P.s__tilde__, P.c, P.W__minus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_573,(0,1):C.GC_915}) V_821 = Vertex(name = 'V_821', particles = [ P.b__tilde__, P.t, P.W__minus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_1008,(0,1):C.GC_513}) V_822 = Vertex(name = 'V_822', particles = [ P.b__tilde__, P.t, P.W__minus__, P.Z ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFVV2, L.FFVV4 ], couplings = {(0,0):C.GC_1011,(0,1):C.GC_515}) V_823 = Vertex(name = 'V_823', particles = [ P.e__plus__, P.ve, P.a, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_688}) V_824 = Vertex(name = 'V_824', particles = [ P.e__plus__, P.ve, P.a, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_689}) V_825 = Vertex(name = 'V_825', particles = [ P.mu__plus__, P.vm, P.a, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_783}) V_826 = Vertex(name = 'V_826', particles = [ P.mu__plus__, P.vm, P.a, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_784}) V_827 = Vertex(name = 'V_827', particles = [ P.ta__plus__, P.vt, P.a, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_1140}) V_828 = Vertex(name = 'V_828', particles = [ P.ta__plus__, P.vt, P.a, P.W__minus__, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_1141}) V_829 = Vertex(name = 'V_829', particles = [ P.e__plus__, P.ve, P.a, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_710}) V_830 = Vertex(name = 'V_830', particles = [ P.e__plus__, P.ve, P.a, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_711}) V_831 = Vertex(name = 'V_831', particles = [ P.mu__plus__, P.vm, P.a, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_805}) V_832 = Vertex(name = 'V_832', particles = [ P.mu__plus__, P.vm, P.a, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_806}) V_833 = Vertex(name = 'V_833', particles = [ P.ta__plus__, P.vt, P.a, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_1162}) V_834 = Vertex(name = 'V_834', particles = [ P.ta__plus__, P.vt, P.a, P.W__minus__ ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_1163}) V_835 = Vertex(name = 'V_835', particles = [ P.e__plus__, P.ve, P.W__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_694}) V_836 = Vertex(name = 'V_836', particles = [ P.e__plus__, P.ve, P.W__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_696}) V_837 = Vertex(name = 'V_837', particles = [ P.mu__plus__, P.vm, P.W__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_789}) V_838 = Vertex(name = 'V_838', particles = [ P.mu__plus__, P.vm, P.W__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_791}) V_839 = Vertex(name = 'V_839', particles = [ P.ta__plus__, P.vt, P.W__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_1146}) V_840 = Vertex(name = 'V_840', particles = [ P.ta__plus__, P.vt, P.W__minus__, P.Z, P.H ], color = [ '1' ], lorentz = [ L.FFVVS4 ], couplings = {(0,0):C.GC_1148}) V_841 = Vertex(name = 'V_841', particles = [ P.e__plus__, P.ve, P.W__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_715}) V_842 = Vertex(name = 'V_842', particles = [ P.e__plus__, P.ve, P.W__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_717}) V_843 = Vertex(name = 'V_843', particles = [ P.mu__plus__, P.vm, P.W__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_810}) V_844 = Vertex(name = 'V_844', particles = [ P.mu__plus__, P.vm, P.W__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_812}) V_845 = Vertex(name = 'V_845', particles = [ P.ta__plus__, P.vt, P.W__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_1167}) V_846 = Vertex(name = 'V_846', particles = [ P.ta__plus__, P.vt, P.W__minus__, P.Z ], color = [ '1' ], lorentz = [ L.FFVV4 ], couplings = {(0,0):C.GC_1169}) V_847 = Vertex(name = 'V_847', particles = [ P.d__tilde__, P.d, P.d__tilde__, P.d ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF13, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF17, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,6):C.GC_44,(0,7):C.GC_44,(0,0):C.GC_41,(2,0):C.GC_42,(1,3):C.GC_41,(3,3):C.GC_42,(1,1):C.GC_41,(3,1):C.GC_42,(1,2):C.GC_10,(0,4):C.GC_41,(2,4):C.GC_42,(0,5):C.GC_10}) V_848 = Vertex(name = 'V_848', particles = [ P.d__tilde__, P.d, P.d__tilde__, P.d ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF15, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,2):C.GC_45,(0,3):C.GC_45,(1,0):C.GC_11,(0,1):C.GC_11}) V_849 = Vertex(name = 'V_849', particles = [ P.d__tilde__, P.d, P.d__tilde__, P.d ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_47}) V_850 = Vertex(name = 'V_850', particles = [ P.d__tilde__, P.d, P.d__tilde__, P.d ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_48,(0,1):C.GC_48}) V_851 = Vertex(name = 'V_851', particles = [ P.s__tilde__, P.d, P.d__tilde__, P.s ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_44,(0,5):C.GC_45,(1,2):C.GC_41,(2,2):C.GC_42,(1,0):C.GC_41,(2,0):C.GC_42,(1,1):C.GC_10,(0,3):C.GC_11}) V_852 = Vertex(name = 'V_852', particles = [ P.s__tilde__, P.d, P.d__tilde__, P.s ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_48}) V_853 = Vertex(name = 'V_853', particles = [ P.b__tilde__, P.d, P.d__tilde__, P.b ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_44,(0,5):C.GC_45,(1,2):C.GC_41,(2,2):C.GC_42,(1,0):C.GC_41,(2,0):C.GC_42,(1,1):C.GC_10,(0,3):C.GC_11}) V_854 = Vertex(name = 'V_854', particles = [ P.b__tilde__, P.d, P.d__tilde__, P.b ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_48}) V_855 = Vertex(name = 'V_855', particles = [ P.s__tilde__, P.s, P.s__tilde__, P.s ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF13, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF17, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,6):C.GC_44,(0,7):C.GC_44,(0,0):C.GC_41,(2,0):C.GC_42,(1,3):C.GC_41,(3,3):C.GC_42,(1,1):C.GC_41,(3,1):C.GC_42,(1,2):C.GC_10,(0,4):C.GC_41,(2,4):C.GC_42,(0,5):C.GC_10}) V_856 = Vertex(name = 'V_856', particles = [ P.s__tilde__, P.s, P.s__tilde__, P.s ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF15, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,2):C.GC_45,(0,3):C.GC_45,(1,0):C.GC_11,(0,1):C.GC_11}) V_857 = Vertex(name = 'V_857', particles = [ P.s__tilde__, P.s, P.s__tilde__, P.s ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_47}) V_858 = Vertex(name = 'V_858', particles = [ P.s__tilde__, P.s, P.s__tilde__, P.s ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_48,(0,1):C.GC_48}) V_859 = Vertex(name = 'V_859', particles = [ P.b__tilde__, P.s, P.s__tilde__, P.b ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_44,(0,5):C.GC_45,(1,2):C.GC_41,(2,2):C.GC_42,(1,0):C.GC_41,(2,0):C.GC_42,(1,1):C.GC_10,(0,3):C.GC_11}) V_860 = Vertex(name = 'V_860', particles = [ P.b__tilde__, P.s, P.s__tilde__, P.b ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_48}) V_861 = Vertex(name = 'V_861', particles = [ P.b__tilde__, P.b, P.b__tilde__, P.b ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF13, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF17, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,6):C.GC_44,(0,7):C.GC_44,(0,0):C.GC_41,(2,0):C.GC_42,(1,3):C.GC_41,(3,3):C.GC_42,(1,1):C.GC_41,(3,1):C.GC_42,(1,2):C.GC_10,(0,4):C.GC_41,(2,4):C.GC_42,(0,5):C.GC_10}) V_862 = Vertex(name = 'V_862', particles = [ P.b__tilde__, P.b, P.b__tilde__, P.b ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF15, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,2):C.GC_45,(0,3):C.GC_45,(1,0):C.GC_11,(0,1):C.GC_11}) V_863 = Vertex(name = 'V_863', particles = [ P.b__tilde__, P.b, P.b__tilde__, P.b ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_47}) V_864 = Vertex(name = 'V_864', particles = [ P.b__tilde__, P.b, P.b__tilde__, P.b ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_48,(0,1):C.GC_48}) V_865 = Vertex(name = 'V_865', particles = [ P.e__plus__, P.e__minus__, P.e__plus__, P.e__minus__ ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF17, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(0,6):C.GC_26,(0,7):C.GC_26,(0,0):C.GC_25,(0,3):C.GC_25,(0,1):C.GC_25,(0,2):C.GC_13,(0,4):C.GC_25,(0,5):C.GC_13}) V_866 = Vertex(name = 'V_866', particles = [ P.e__plus__, P.e__minus__, P.e__plus__, P.e__minus__ ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_27,(0,1):C.GC_27}) V_867 = Vertex(name = 'V_867', particles = [ P.mu__plus__, P.e__minus__, P.e__plus__, P.mu__minus__ ], color = [ '1' ], lorentz = [ L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF3, L.FFFF4 ], couplings = {(0,3):C.GC_26,(0,4):C.GC_27,(0,2):C.GC_25,(0,0):C.GC_25,(0,1):C.GC_13}) V_868 = Vertex(name = 'V_868', particles = [ P.ta__plus__, P.e__minus__, P.e__plus__, P.ta__minus__ ], color = [ '1' ], lorentz = [ L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF3, L.FFFF4 ], couplings = {(0,3):C.GC_26,(0,4):C.GC_27,(0,2):C.GC_25,(0,0):C.GC_25,(0,1):C.GC_13}) V_869 = Vertex(name = 'V_869', particles = [ P.mu__plus__, P.mu__minus__, P.mu__plus__, P.mu__minus__ ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF17, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(0,6):C.GC_26,(0,7):C.GC_26,(0,0):C.GC_25,(0,3):C.GC_25,(0,1):C.GC_25,(0,2):C.GC_13,(0,4):C.GC_25,(0,5):C.GC_13}) V_870 = Vertex(name = 'V_870', particles = [ P.mu__plus__, P.mu__minus__, P.mu__plus__, P.mu__minus__ ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_27,(0,1):C.GC_27}) V_871 = Vertex(name = 'V_871', particles = [ P.ta__plus__, P.mu__minus__, P.mu__plus__, P.ta__minus__ ], color = [ '1' ], lorentz = [ L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF3, L.FFFF4 ], couplings = {(0,3):C.GC_26,(0,4):C.GC_27,(0,2):C.GC_25,(0,0):C.GC_25,(0,1):C.GC_13}) V_872 = Vertex(name = 'V_872', particles = [ P.ta__plus__, P.ta__minus__, P.ta__plus__, P.ta__minus__ ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF17, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(0,6):C.GC_26,(0,7):C.GC_26,(0,0):C.GC_25,(0,3):C.GC_25,(0,1):C.GC_25,(0,2):C.GC_13,(0,4):C.GC_25,(0,5):C.GC_13}) V_873 = Vertex(name = 'V_873', particles = [ P.ta__plus__, P.ta__minus__, P.ta__plus__, P.ta__minus__ ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_27,(0,1):C.GC_27}) V_874 = Vertex(name = 'V_874', particles = [ P.e__plus__, P.e__minus__, P.d__tilde__, P.d ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF4, L.FFFF9 ], couplings = {(0,4):C.GC_28,(0,1):C.GC_43,(0,2):C.GC_24,(0,3):C.GC_12,(0,5):C.GC_764,(0,0):C.GC_765}) V_875 = Vertex(name = 'V_875', particles = [ P.e__plus__, P.e__minus__, P.d__tilde__, P.d ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF4, L.FFFF9 ], couplings = {(0,1):C.GC_30,(0,2):C.GC_769,(0,0):C.GC_769}) V_876 = Vertex(name = 'V_876', particles = [ P.mu__plus__, P.mu__minus__, P.d__tilde__, P.d ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF4, L.FFFF9 ], couplings = {(0,4):C.GC_28,(0,1):C.GC_43,(0,2):C.GC_24,(0,3):C.GC_12,(0,5):C.GC_859,(0,0):C.GC_860}) V_877 = Vertex(name = 'V_877', particles = [ P.mu__plus__, P.mu__minus__, P.d__tilde__, P.d ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF4, L.FFFF9 ], couplings = {(0,1):C.GC_30,(0,2):C.GC_864,(0,0):C.GC_864}) V_878 = Vertex(name = 'V_878', particles = [ P.ta__plus__, P.ta__minus__, P.d__tilde__, P.d ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF4, L.FFFF9 ], couplings = {(0,4):C.GC_28,(0,1):C.GC_43,(0,2):C.GC_24,(0,3):C.GC_12,(0,5):C.GC_1216,(0,0):C.GC_1217}) V_879 = Vertex(name = 'V_879', particles = [ P.ta__plus__, P.ta__minus__, P.d__tilde__, P.d ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF4, L.FFFF9 ], couplings = {(0,1):C.GC_30,(0,2):C.GC_1221,(0,0):C.GC_1221}) V_880 = Vertex(name = 'V_880', particles = [ P.e__plus__, P.e__minus__, P.s__tilde__, P.s ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF4, L.FFFF9 ], couplings = {(0,4):C.GC_28,(0,1):C.GC_43,(0,2):C.GC_24,(0,3):C.GC_12,(0,5):C.GC_944,(0,0):C.GC_945}) V_881 = Vertex(name = 'V_881', particles = [ P.e__plus__, P.e__minus__, P.s__tilde__, P.s ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF4, L.FFFF9 ], couplings = {(0,1):C.GC_30,(0,2):C.GC_949,(0,0):C.GC_949}) V_882 = Vertex(name = 'V_882', particles = [ P.mu__plus__, P.mu__minus__, P.s__tilde__, P.s ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF4, L.FFFF9 ], couplings = {(0,4):C.GC_28,(0,1):C.GC_43,(0,2):C.GC_24,(0,3):C.GC_12,(0,5):C.GC_953,(0,0):C.GC_954}) V_883 = Vertex(name = 'V_883', particles = [ P.mu__plus__, P.mu__minus__, P.s__tilde__, P.s ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF4, L.FFFF9 ], couplings = {(0,1):C.GC_30,(0,2):C.GC_958,(0,0):C.GC_958}) V_884 = Vertex(name = 'V_884', particles = [ P.ta__plus__, P.ta__minus__, P.s__tilde__, P.s ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF4, L.FFFF9 ], couplings = {(0,4):C.GC_28,(0,1):C.GC_43,(0,2):C.GC_24,(0,3):C.GC_12,(0,5):C.GC_1225,(0,0):C.GC_1226}) V_885 = Vertex(name = 'V_885', particles = [ P.ta__plus__, P.ta__minus__, P.s__tilde__, P.s ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF4, L.FFFF9 ], couplings = {(0,1):C.GC_30,(0,2):C.GC_1230,(0,0):C.GC_1230}) V_886 = Vertex(name = 'V_886', particles = [ P.e__plus__, P.e__minus__, P.b__tilde__, P.b ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF4, L.FFFF9 ], couplings = {(0,4):C.GC_28,(0,1):C.GC_43,(0,2):C.GC_24,(0,3):C.GC_12,(0,5):C.GC_728,(0,0):C.GC_729}) V_887 = Vertex(name = 'V_887', particles = [ P.e__plus__, P.e__minus__, P.b__tilde__, P.b ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF4, L.FFFF9 ], couplings = {(0,1):C.GC_30,(0,2):C.GC_733,(0,0):C.GC_733}) V_888 = Vertex(name = 'V_888', particles = [ P.mu__plus__, P.mu__minus__, P.b__tilde__, P.b ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF4, L.FFFF9 ], couplings = {(0,4):C.GC_28,(0,1):C.GC_43,(0,2):C.GC_24,(0,3):C.GC_12,(0,5):C.GC_823,(0,0):C.GC_824}) V_889 = Vertex(name = 'V_889', particles = [ P.mu__plus__, P.mu__minus__, P.b__tilde__, P.b ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF4, L.FFFF9 ], couplings = {(0,1):C.GC_30,(0,2):C.GC_828,(0,0):C.GC_828}) V_890 = Vertex(name = 'V_890', particles = [ P.ta__plus__, P.ta__minus__, P.b__tilde__, P.b ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF4, L.FFFF9 ], couplings = {(0,4):C.GC_28,(0,1):C.GC_43,(0,2):C.GC_24,(0,3):C.GC_12,(0,5):C.GC_1180,(0,0):C.GC_1181}) V_891 = Vertex(name = 'V_891', particles = [ P.ta__plus__, P.ta__minus__, P.b__tilde__, P.b ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF4, L.FFFF9 ], couplings = {(0,1):C.GC_30,(0,2):C.GC_1185,(0,0):C.GC_1185}) V_892 = Vertex(name = 'V_892', particles = [ P.ve__tilde__, P.e__minus__, P.d__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_31,(0,5):C.GC_1368,(0,3):C.GC_1369,(0,4):C.GC_1369,(0,1):C.GC_1357,(0,0):C.GC_766}) V_893 = Vertex(name = 'V_893', particles = [ P.ve__tilde__, P.e__minus__, P.d__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1377,(0,2):C.GC_1376,(0,3):C.GC_1376,(0,1):C.GC_1361,(0,0):C.GC_770}) V_894 = Vertex(name = 'V_894', particles = [ P.ve__tilde__, P.e__minus__, P.d__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_34,(0,5):C.GC_750,(0,3):C.GC_751,(0,4):C.GC_751,(0,1):C.GC_739,(0,0):C.GC_767}) V_895 = Vertex(name = 'V_895', particles = [ P.ve__tilde__, P.e__minus__, P.d__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_759,(0,2):C.GC_758,(0,3):C.GC_758,(0,1):C.GC_743,(0,0):C.GC_771}) V_896 = Vertex(name = 'V_896', particles = [ P.ve__tilde__, P.e__minus__, P.d__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_37,(0,5):C.GC_1071,(0,3):C.GC_1072,(0,4):C.GC_1072,(0,1):C.GC_1060,(0,0):C.GC_768}) V_897 = Vertex(name = 'V_897', particles = [ P.ve__tilde__, P.e__minus__, P.d__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1080,(0,2):C.GC_1079,(0,3):C.GC_1079,(0,1):C.GC_1064,(0,0):C.GC_772}) V_898 = Vertex(name = 'V_898', particles = [ P.ve__tilde__, P.e__minus__, P.s__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_32,(0,5):C.GC_1370,(0,3):C.GC_1371,(0,4):C.GC_1371,(0,1):C.GC_1358,(0,0):C.GC_946}) V_899 = Vertex(name = 'V_899', particles = [ P.ve__tilde__, P.e__minus__, P.s__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1379,(0,2):C.GC_1378,(0,3):C.GC_1378,(0,1):C.GC_1362,(0,0):C.GC_950}) V_900 = Vertex(name = 'V_900', particles = [ P.ve__tilde__, P.e__minus__, P.s__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_35,(0,5):C.GC_752,(0,3):C.GC_753,(0,4):C.GC_753,(0,1):C.GC_740,(0,0):C.GC_947}) V_901 = Vertex(name = 'V_901', particles = [ P.ve__tilde__, P.e__minus__, P.s__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_761,(0,2):C.GC_760,(0,3):C.GC_760,(0,1):C.GC_744,(0,0):C.GC_951}) V_902 = Vertex(name = 'V_902', particles = [ P.ve__tilde__, P.e__minus__, P.s__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_38,(0,5):C.GC_1073,(0,3):C.GC_1074,(0,4):C.GC_1074,(0,1):C.GC_1061,(0,0):C.GC_948}) V_903 = Vertex(name = 'V_903', particles = [ P.ve__tilde__, P.e__minus__, P.s__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1082,(0,2):C.GC_1081,(0,3):C.GC_1081,(0,1):C.GC_1065,(0,0):C.GC_952}) V_904 = Vertex(name = 'V_904', particles = [ P.ve__tilde__, P.e__minus__, P.b__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_33,(0,5):C.GC_1372,(0,3):C.GC_1373,(0,4):C.GC_1373,(0,1):C.GC_1359,(0,0):C.GC_730}) V_905 = Vertex(name = 'V_905', particles = [ P.ve__tilde__, P.e__minus__, P.b__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1381,(0,2):C.GC_1380,(0,3):C.GC_1380,(0,1):C.GC_1363,(0,0):C.GC_734}) V_906 = Vertex(name = 'V_906', particles = [ P.ve__tilde__, P.e__minus__, P.b__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_36,(0,5):C.GC_754,(0,3):C.GC_755,(0,4):C.GC_755,(0,1):C.GC_741,(0,0):C.GC_731}) V_907 = Vertex(name = 'V_907', particles = [ P.ve__tilde__, P.e__minus__, P.b__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_763,(0,2):C.GC_762,(0,3):C.GC_762,(0,1):C.GC_745,(0,0):C.GC_735}) V_908 = Vertex(name = 'V_908', particles = [ P.ve__tilde__, P.e__minus__, P.b__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_39,(0,5):C.GC_1075,(0,3):C.GC_1076,(0,4):C.GC_1076,(0,1):C.GC_1062,(0,0):C.GC_732}) V_909 = Vertex(name = 'V_909', particles = [ P.ve__tilde__, P.e__minus__, P.b__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1084,(0,2):C.GC_1083,(0,3):C.GC_1083,(0,1):C.GC_1066,(0,0):C.GC_736}) V_910 = Vertex(name = 'V_910', particles = [ P.vm__tilde__, P.mu__minus__, P.d__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_31,(0,5):C.GC_1395,(0,3):C.GC_1396,(0,4):C.GC_1396,(0,1):C.GC_1384,(0,0):C.GC_861}) V_911 = Vertex(name = 'V_911', particles = [ P.vm__tilde__, P.mu__minus__, P.d__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1404,(0,2):C.GC_1403,(0,3):C.GC_1403,(0,1):C.GC_1388,(0,0):C.GC_865}) V_912 = Vertex(name = 'V_912', particles = [ P.vm__tilde__, P.mu__minus__, P.d__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_34,(0,5):C.GC_845,(0,3):C.GC_846,(0,4):C.GC_846,(0,1):C.GC_834,(0,0):C.GC_862}) V_913 = Vertex(name = 'V_913', particles = [ P.vm__tilde__, P.mu__minus__, P.d__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_854,(0,2):C.GC_853,(0,3):C.GC_853,(0,1):C.GC_838,(0,0):C.GC_866}) V_914 = Vertex(name = 'V_914', particles = [ P.vm__tilde__, P.mu__minus__, P.d__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_37,(0,5):C.GC_1098,(0,3):C.GC_1099,(0,4):C.GC_1099,(0,1):C.GC_1087,(0,0):C.GC_863}) V_915 = Vertex(name = 'V_915', particles = [ P.vm__tilde__, P.mu__minus__, P.d__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1107,(0,2):C.GC_1106,(0,3):C.GC_1106,(0,1):C.GC_1091,(0,0):C.GC_867}) V_916 = Vertex(name = 'V_916', particles = [ P.vm__tilde__, P.mu__minus__, P.s__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_32,(0,5):C.GC_1397,(0,3):C.GC_1398,(0,4):C.GC_1398,(0,1):C.GC_1385,(0,0):C.GC_955}) V_917 = Vertex(name = 'V_917', particles = [ P.vm__tilde__, P.mu__minus__, P.s__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1406,(0,2):C.GC_1405,(0,3):C.GC_1405,(0,1):C.GC_1389,(0,0):C.GC_959}) V_918 = Vertex(name = 'V_918', particles = [ P.vm__tilde__, P.mu__minus__, P.s__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_35,(0,5):C.GC_847,(0,3):C.GC_848,(0,4):C.GC_848,(0,1):C.GC_835,(0,0):C.GC_956}) V_919 = Vertex(name = 'V_919', particles = [ P.vm__tilde__, P.mu__minus__, P.s__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_856,(0,2):C.GC_855,(0,3):C.GC_855,(0,1):C.GC_839,(0,0):C.GC_960}) V_920 = Vertex(name = 'V_920', particles = [ P.vm__tilde__, P.mu__minus__, P.s__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_38,(0,5):C.GC_1100,(0,3):C.GC_1101,(0,4):C.GC_1101,(0,1):C.GC_1088,(0,0):C.GC_957}) V_921 = Vertex(name = 'V_921', particles = [ P.vm__tilde__, P.mu__minus__, P.s__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1109,(0,2):C.GC_1108,(0,3):C.GC_1108,(0,1):C.GC_1092,(0,0):C.GC_961}) V_922 = Vertex(name = 'V_922', particles = [ P.vm__tilde__, P.mu__minus__, P.b__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_33,(0,5):C.GC_1399,(0,3):C.GC_1400,(0,4):C.GC_1400,(0,1):C.GC_1386,(0,0):C.GC_825}) V_923 = Vertex(name = 'V_923', particles = [ P.vm__tilde__, P.mu__minus__, P.b__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1408,(0,2):C.GC_1407,(0,3):C.GC_1407,(0,1):C.GC_1390,(0,0):C.GC_829}) V_924 = Vertex(name = 'V_924', particles = [ P.vm__tilde__, P.mu__minus__, P.b__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_36,(0,5):C.GC_849,(0,3):C.GC_850,(0,4):C.GC_850,(0,1):C.GC_836,(0,0):C.GC_826}) V_925 = Vertex(name = 'V_925', particles = [ P.vm__tilde__, P.mu__minus__, P.b__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_858,(0,2):C.GC_857,(0,3):C.GC_857,(0,1):C.GC_840,(0,0):C.GC_830}) V_926 = Vertex(name = 'V_926', particles = [ P.vm__tilde__, P.mu__minus__, P.b__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_39,(0,5):C.GC_1102,(0,3):C.GC_1103,(0,4):C.GC_1103,(0,1):C.GC_1089,(0,0):C.GC_827}) V_927 = Vertex(name = 'V_927', particles = [ P.vm__tilde__, P.mu__minus__, P.b__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1111,(0,2):C.GC_1110,(0,3):C.GC_1110,(0,1):C.GC_1093,(0,0):C.GC_831}) V_928 = Vertex(name = 'V_928', particles = [ P.vt__tilde__, P.ta__minus__, P.d__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_31,(0,5):C.GC_1440,(0,3):C.GC_1441,(0,4):C.GC_1441,(0,1):C.GC_1429,(0,0):C.GC_1218}) V_929 = Vertex(name = 'V_929', particles = [ P.vt__tilde__, P.ta__minus__, P.d__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1449,(0,2):C.GC_1448,(0,3):C.GC_1448,(0,1):C.GC_1433,(0,0):C.GC_1222}) V_930 = Vertex(name = 'V_930', particles = [ P.vt__tilde__, P.ta__minus__, P.d__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_34,(0,5):C.GC_1202,(0,3):C.GC_1203,(0,4):C.GC_1203,(0,1):C.GC_1191,(0,0):C.GC_1219}) V_931 = Vertex(name = 'V_931', particles = [ P.vt__tilde__, P.ta__minus__, P.d__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1211,(0,2):C.GC_1210,(0,3):C.GC_1210,(0,1):C.GC_1195,(0,0):C.GC_1223}) V_932 = Vertex(name = 'V_932', particles = [ P.vt__tilde__, P.ta__minus__, P.d__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_37,(0,5):C.GC_1247,(0,3):C.GC_1248,(0,4):C.GC_1248,(0,1):C.GC_1236,(0,0):C.GC_1220}) V_933 = Vertex(name = 'V_933', particles = [ P.vt__tilde__, P.ta__minus__, P.d__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1256,(0,2):C.GC_1255,(0,3):C.GC_1255,(0,1):C.GC_1240,(0,0):C.GC_1224}) V_934 = Vertex(name = 'V_934', particles = [ P.vt__tilde__, P.ta__minus__, P.s__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_32,(0,5):C.GC_1442,(0,3):C.GC_1443,(0,4):C.GC_1443,(0,1):C.GC_1430,(0,0):C.GC_1227}) V_935 = Vertex(name = 'V_935', particles = [ P.vt__tilde__, P.ta__minus__, P.s__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1451,(0,2):C.GC_1450,(0,3):C.GC_1450,(0,1):C.GC_1434,(0,0):C.GC_1231}) V_936 = Vertex(name = 'V_936', particles = [ P.vt__tilde__, P.ta__minus__, P.s__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_35,(0,5):C.GC_1204,(0,3):C.GC_1205,(0,4):C.GC_1205,(0,1):C.GC_1192,(0,0):C.GC_1228}) V_937 = Vertex(name = 'V_937', particles = [ P.vt__tilde__, P.ta__minus__, P.s__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1213,(0,2):C.GC_1212,(0,3):C.GC_1212,(0,1):C.GC_1196,(0,0):C.GC_1232}) V_938 = Vertex(name = 'V_938', particles = [ P.vt__tilde__, P.ta__minus__, P.s__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_38,(0,5):C.GC_1249,(0,3):C.GC_1250,(0,4):C.GC_1250,(0,1):C.GC_1237,(0,0):C.GC_1229}) V_939 = Vertex(name = 'V_939', particles = [ P.vt__tilde__, P.ta__minus__, P.s__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1258,(0,2):C.GC_1257,(0,3):C.GC_1257,(0,1):C.GC_1241,(0,0):C.GC_1233}) V_940 = Vertex(name = 'V_940', particles = [ P.vt__tilde__, P.ta__minus__, P.b__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_33,(0,5):C.GC_1444,(0,3):C.GC_1445,(0,4):C.GC_1445,(0,1):C.GC_1431,(0,0):C.GC_1182}) V_941 = Vertex(name = 'V_941', particles = [ P.vt__tilde__, P.ta__minus__, P.b__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1453,(0,2):C.GC_1452,(0,3):C.GC_1452,(0,1):C.GC_1435,(0,0):C.GC_1186}) V_942 = Vertex(name = 'V_942', particles = [ P.vt__tilde__, P.ta__minus__, P.b__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_36,(0,5):C.GC_1206,(0,3):C.GC_1207,(0,4):C.GC_1207,(0,1):C.GC_1193,(0,0):C.GC_1183}) V_943 = Vertex(name = 'V_943', particles = [ P.vt__tilde__, P.ta__minus__, P.b__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1215,(0,2):C.GC_1214,(0,3):C.GC_1214,(0,1):C.GC_1197,(0,0):C.GC_1187}) V_944 = Vertex(name = 'V_944', particles = [ P.vt__tilde__, P.ta__minus__, P.b__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,2):C.GC_39,(0,5):C.GC_1251,(0,3):C.GC_1252,(0,4):C.GC_1252,(0,1):C.GC_1238,(0,0):C.GC_1184}) V_945 = Vertex(name = 'V_945', particles = [ P.vt__tilde__, P.ta__minus__, P.b__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF11, L.FFFF2, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,4):C.GC_1260,(0,2):C.GC_1259,(0,3):C.GC_1259,(0,1):C.GC_1242,(0,0):C.GC_1188}) V_946 = Vertex(name = 'V_946', particles = [ P.u__tilde__, P.d, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,7):C.GC_44,(0,8):C.GC_49,(1,0):C.GC_1341,(3,0):C.GC_1347,(0,6):C.GC_1337,(2,6):C.GC_1343,(1,5):C.GC_41,(3,5):C.GC_42,(1,3):C.GC_50,(3,3):C.GC_51,(1,4):C.GC_56,(3,4):C.GC_57,(1,1):C.GC_1340,(3,1):C.GC_1346,(0,2):C.GC_1338,(2,2):C.GC_1344}) V_947 = Vertex(name = 'V_947', particles = [ P.u__tilde__, P.d, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_46,(0,5):C.GC_1464,(1,0):C.GC_1342,(3,0):C.GC_1348,(0,3):C.GC_1339,(2,3):C.GC_1345,(1,1):C.GC_1342,(3,1):C.GC_1348,(0,2):C.GC_1339,(2,2):C.GC_1345}) V_948 = Vertex(name = 'V_948', particles = [ P.u__tilde__, P.d, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1455,(1,0):C.GC_1570,(3,0):C.GC_1592,(0,3):C.GC_1580,(2,3):C.GC_1602,(1,1):C.GC_1569,(3,1):C.GC_1591,(0,2):C.GC_1581,(2,2):C.GC_1603}) V_949 = Vertex(name = 'V_949', particles = [ P.u__tilde__, P.d, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1473,(1,0):C.GC_1575,(3,0):C.GC_1597,(0,3):C.GC_1586,(2,3):C.GC_1608,(1,1):C.GC_1575,(3,1):C.GC_1597,(0,2):C.GC_1586,(2,2):C.GC_1608}) V_950 = Vertex(name = 'V_950', particles = [ P.c__tilde__, P.d, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2076,(0,5):C.GC_2085,(1,0):C.GC_2258,(3,0):C.GC_2270,(0,3):C.GC_2264,(2,3):C.GC_2276,(1,1):C.GC_2136,(3,1):C.GC_2158,(0,2):C.GC_2147,(2,2):C.GC_2169}) V_951 = Vertex(name = 'V_951', particles = [ P.c__tilde__, P.d, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2094,(1,0):C.GC_2261,(3,0):C.GC_2273,(0,3):C.GC_2267,(2,3):C.GC_2279,(1,1):C.GC_2142,(3,1):C.GC_2164,(0,2):C.GC_2153,(2,2):C.GC_2175}) V_952 = Vertex(name = 'V_952', particles = [ P.t__tilde__, P.d, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2697,(0,5):C.GC_2706,(1,0):C.GC_2880,(3,0):C.GC_2892,(0,3):C.GC_2886,(2,3):C.GC_2898,(1,1):C.GC_2786,(3,1):C.GC_2808,(0,2):C.GC_2797,(2,2):C.GC_2819}) V_953 = Vertex(name = 'V_953', particles = [ P.t__tilde__, P.d, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2715,(1,0):C.GC_2883,(3,0):C.GC_2895,(0,3):C.GC_2889,(2,3):C.GC_2901,(1,1):C.GC_2792,(3,1):C.GC_2814,(0,2):C.GC_2803,(2,2):C.GC_2825}) V_954 = Vertex(name = 'V_954', particles = [ P.u__tilde__, P.d, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1458,(0,5):C.GC_1467,(1,0):C.GC_1491,(3,0):C.GC_1503,(0,3):C.GC_1497,(2,3):C.GC_1509,(1,1):C.GC_1573,(3,1):C.GC_1595,(0,2):C.GC_1584,(2,2):C.GC_1606}) V_955 = Vertex(name = 'V_955', particles = [ P.u__tilde__, P.d, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1476,(1,0):C.GC_1494,(3,0):C.GC_1506,(0,3):C.GC_1500,(2,3):C.GC_1512,(1,1):C.GC_1578,(3,1):C.GC_1600,(0,2):C.GC_1589,(2,2):C.GC_1611}) V_956 = Vertex(name = 'V_956', particles = [ P.c__tilde__, P.d, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,7):C.GC_44,(0,8):C.GC_49,(1,0):C.GC_664,(3,0):C.GC_670,(0,6):C.GC_660,(2,6):C.GC_666,(1,5):C.GC_41,(3,5):C.GC_42,(1,3):C.GC_50,(3,3):C.GC_51,(1,4):C.GC_56,(3,4):C.GC_57,(1,1):C.GC_663,(3,1):C.GC_669,(0,2):C.GC_661,(2,2):C.GC_667}) V_957 = Vertex(name = 'V_957', particles = [ P.c__tilde__, P.d, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_46,(0,5):C.GC_2088,(1,0):C.GC_665,(3,0):C.GC_671,(0,3):C.GC_662,(2,3):C.GC_668,(1,1):C.GC_665,(3,1):C.GC_671,(0,2):C.GC_662,(2,2):C.GC_668}) V_958 = Vertex(name = 'V_958', particles = [ P.c__tilde__, P.d, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2079,(1,0):C.GC_2138,(3,0):C.GC_2160,(0,3):C.GC_2148,(2,3):C.GC_2170,(1,1):C.GC_2137,(3,1):C.GC_2159,(0,2):C.GC_2149,(2,2):C.GC_2171}) V_959 = Vertex(name = 'V_959', particles = [ P.c__tilde__, P.d, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2097,(1,0):C.GC_2143,(3,0):C.GC_2165,(0,3):C.GC_2154,(2,3):C.GC_2176,(1,1):C.GC_2143,(3,1):C.GC_2165,(0,2):C.GC_2154,(2,2):C.GC_2176}) V_960 = Vertex(name = 'V_960', particles = [ P.t__tilde__, P.d, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2700,(0,5):C.GC_2709,(1,0):C.GC_2734,(3,0):C.GC_2746,(0,3):C.GC_2740,(2,3):C.GC_2752,(1,1):C.GC_2787,(3,1):C.GC_2809,(0,2):C.GC_2798,(2,2):C.GC_2820}) V_961 = Vertex(name = 'V_961', particles = [ P.t__tilde__, P.d, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2718,(1,0):C.GC_2737,(3,0):C.GC_2749,(0,3):C.GC_2743,(2,3):C.GC_2755,(1,1):C.GC_2793,(3,1):C.GC_2815,(0,2):C.GC_2804,(2,2):C.GC_2826}) V_962 = Vertex(name = 'V_962', particles = [ P.u__tilde__, P.d, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1461,(0,5):C.GC_1470,(1,0):C.GC_1519,(3,0):C.GC_1531,(0,3):C.GC_1525,(2,3):C.GC_1537,(1,1):C.GC_1574,(3,1):C.GC_1596,(0,2):C.GC_1585,(2,2):C.GC_1607}) V_963 = Vertex(name = 'V_963', particles = [ P.u__tilde__, P.d, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1479,(1,0):C.GC_1522,(3,0):C.GC_1534,(0,3):C.GC_1528,(2,3):C.GC_1540,(1,1):C.GC_1579,(3,1):C.GC_1601,(0,2):C.GC_1590,(2,2):C.GC_1612}) V_964 = Vertex(name = 'V_964', particles = [ P.c__tilde__, P.d, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2082,(0,5):C.GC_2091,(1,0):C.GC_2226,(3,0):C.GC_2238,(0,3):C.GC_2232,(2,3):C.GC_2244,(1,1):C.GC_2141,(3,1):C.GC_2163,(0,2):C.GC_2152,(2,2):C.GC_2174}) V_965 = Vertex(name = 'V_965', particles = [ P.c__tilde__, P.d, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2100,(1,0):C.GC_2229,(3,0):C.GC_2241,(0,3):C.GC_2235,(2,3):C.GC_2247,(1,1):C.GC_2146,(3,1):C.GC_2168,(0,2):C.GC_2157,(2,2):C.GC_2179}) V_966 = Vertex(name = 'V_966', particles = [ P.t__tilde__, P.d, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,7):C.GC_44,(0,8):C.GC_49,(1,0):C.GC_1044,(3,0):C.GC_1050,(0,6):C.GC_1040,(2,6):C.GC_1046,(1,5):C.GC_41,(3,5):C.GC_42,(1,3):C.GC_50,(3,3):C.GC_51,(1,4):C.GC_56,(3,4):C.GC_57,(1,1):C.GC_1043,(3,1):C.GC_1049,(0,2):C.GC_1041,(2,2):C.GC_1047}) V_967 = Vertex(name = 'V_967', particles = [ P.t__tilde__, P.d, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_46,(0,5):C.GC_2712,(1,0):C.GC_1045,(3,0):C.GC_1051,(0,3):C.GC_1042,(2,3):C.GC_1048,(1,1):C.GC_1045,(3,1):C.GC_1051,(0,2):C.GC_1042,(2,2):C.GC_1048}) V_968 = Vertex(name = 'V_968', particles = [ P.t__tilde__, P.d, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2703,(1,0):C.GC_2789,(3,0):C.GC_2811,(0,3):C.GC_2799,(2,3):C.GC_2821,(1,1):C.GC_2788,(3,1):C.GC_2810,(0,2):C.GC_2800,(2,2):C.GC_2822}) V_969 = Vertex(name = 'V_969', particles = [ P.t__tilde__, P.d, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2721,(1,0):C.GC_2794,(3,0):C.GC_2816,(0,3):C.GC_2805,(2,3):C.GC_2827,(1,1):C.GC_2794,(3,1):C.GC_2816,(0,2):C.GC_2805,(2,2):C.GC_2827}) V_970 = Vertex(name = 'V_970', particles = [ P.u__tilde__, P.d, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1456,(0,5):C.GC_1465,(1,0):C.GC_1571,(3,0):C.GC_1593,(0,3):C.GC_1582,(2,3):C.GC_1604,(1,1):C.GC_1631,(3,1):C.GC_1643,(0,2):C.GC_1637,(2,2):C.GC_1649}) V_971 = Vertex(name = 'V_971', particles = [ P.u__tilde__, P.d, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1474,(1,0):C.GC_1576,(3,0):C.GC_1598,(0,3):C.GC_1587,(2,3):C.GC_1609,(1,1):C.GC_1634,(3,1):C.GC_1646,(0,2):C.GC_1640,(2,2):C.GC_1652}) V_972 = Vertex(name = 'V_972', particles = [ P.c__tilde__, P.d, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2077,(0,5):C.GC_2086,(1,0):C.GC_2259,(3,0):C.GC_2271,(0,3):C.GC_2265,(2,3):C.GC_2277,(1,1):C.GC_2202,(3,1):C.GC_2214,(0,2):C.GC_2208,(2,2):C.GC_2220}) V_973 = Vertex(name = 'V_973', particles = [ P.c__tilde__, P.d, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2095,(1,0):C.GC_2262,(3,0):C.GC_2274,(0,3):C.GC_2268,(2,3):C.GC_2280,(1,1):C.GC_2205,(3,1):C.GC_2217,(0,2):C.GC_2211,(2,2):C.GC_2223}) V_974 = Vertex(name = 'V_974', particles = [ P.t__tilde__, P.d, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2698,(0,5):C.GC_2707,(1,0):C.GC_2881,(3,0):C.GC_2893,(0,3):C.GC_2887,(2,3):C.GC_2899,(1,1):C.GC_2848,(3,1):C.GC_2860,(0,2):C.GC_2854,(2,2):C.GC_2866}) V_975 = Vertex(name = 'V_975', particles = [ P.t__tilde__, P.d, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2716,(1,0):C.GC_2884,(3,0):C.GC_2896,(0,3):C.GC_2890,(2,3):C.GC_2902,(1,1):C.GC_2851,(3,1):C.GC_2863,(0,2):C.GC_2857,(2,2):C.GC_2869}) V_976 = Vertex(name = 'V_976', particles = [ P.u__tilde__, P.d, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1459,(0,5):C.GC_1468,(1,0):C.GC_1492,(3,0):C.GC_1504,(0,3):C.GC_1498,(2,3):C.GC_1510,(1,1):C.GC_1632,(3,1):C.GC_1644,(0,2):C.GC_1638,(2,2):C.GC_1650}) V_977 = Vertex(name = 'V_977', particles = [ P.u__tilde__, P.d, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1477,(1,0):C.GC_1495,(3,0):C.GC_1507,(0,3):C.GC_1501,(2,3):C.GC_1513,(1,1):C.GC_1635,(3,1):C.GC_1647,(0,2):C.GC_1641,(2,2):C.GC_1653}) V_978 = Vertex(name = 'V_978', particles = [ P.c__tilde__, P.d, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2080,(0,5):C.GC_2089,(1,0):C.GC_2139,(3,0):C.GC_2161,(0,3):C.GC_2150,(2,3):C.GC_2172,(1,1):C.GC_2203,(3,1):C.GC_2215,(0,2):C.GC_2209,(2,2):C.GC_2221}) V_979 = Vertex(name = 'V_979', particles = [ P.c__tilde__, P.d, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2098,(1,0):C.GC_2144,(3,0):C.GC_2166,(0,3):C.GC_2155,(2,3):C.GC_2177,(1,1):C.GC_2206,(3,1):C.GC_2218,(0,2):C.GC_2212,(2,2):C.GC_2224}) V_980 = Vertex(name = 'V_980', particles = [ P.t__tilde__, P.d, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2701,(0,5):C.GC_2710,(1,0):C.GC_2735,(3,0):C.GC_2747,(0,3):C.GC_2741,(2,3):C.GC_2753,(1,1):C.GC_2849,(3,1):C.GC_2861,(0,2):C.GC_2855,(2,2):C.GC_2867}) V_981 = Vertex(name = 'V_981', particles = [ P.t__tilde__, P.d, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2719,(1,0):C.GC_2738,(3,0):C.GC_2750,(0,3):C.GC_2744,(2,3):C.GC_2756,(1,1):C.GC_2852,(3,1):C.GC_2864,(0,2):C.GC_2858,(2,2):C.GC_2870}) V_982 = Vertex(name = 'V_982', particles = [ P.u__tilde__, P.d, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1462,(0,5):C.GC_1471,(1,0):C.GC_1520,(3,0):C.GC_1532,(0,3):C.GC_1526,(2,3):C.GC_1538,(1,1):C.GC_1633,(3,1):C.GC_1645,(0,2):C.GC_1639,(2,2):C.GC_1651}) V_983 = Vertex(name = 'V_983', particles = [ P.u__tilde__, P.d, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1480,(1,0):C.GC_1523,(3,0):C.GC_1535,(0,3):C.GC_1529,(2,3):C.GC_1541,(1,1):C.GC_1636,(3,1):C.GC_1648,(0,2):C.GC_1642,(2,2):C.GC_1654}) V_984 = Vertex(name = 'V_984', particles = [ P.c__tilde__, P.d, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2083,(0,5):C.GC_2092,(1,0):C.GC_2227,(3,0):C.GC_2239,(0,3):C.GC_2233,(2,3):C.GC_2245,(1,1):C.GC_2204,(3,1):C.GC_2216,(0,2):C.GC_2210,(2,2):C.GC_2222}) V_985 = Vertex(name = 'V_985', particles = [ P.c__tilde__, P.d, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2101,(1,0):C.GC_2230,(3,0):C.GC_2242,(0,3):C.GC_2236,(2,3):C.GC_2248,(1,1):C.GC_2207,(3,1):C.GC_2219,(0,2):C.GC_2213,(2,2):C.GC_2225}) V_986 = Vertex(name = 'V_986', particles = [ P.t__tilde__, P.d, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2704,(0,5):C.GC_2713,(1,0):C.GC_2790,(3,0):C.GC_2812,(0,3):C.GC_2801,(2,3):C.GC_2823,(1,1):C.GC_2850,(3,1):C.GC_2862,(0,2):C.GC_2856,(2,2):C.GC_2868}) V_987 = Vertex(name = 'V_987', particles = [ P.t__tilde__, P.d, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2722,(1,0):C.GC_2795,(3,0):C.GC_2817,(0,3):C.GC_2806,(2,3):C.GC_2828,(1,1):C.GC_2853,(3,1):C.GC_2865,(0,2):C.GC_2859,(2,2):C.GC_2871}) V_988 = Vertex(name = 'V_988', particles = [ P.u__tilde__, P.d, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1457,(0,5):C.GC_1466,(1,0):C.GC_1572,(3,0):C.GC_1594,(0,3):C.GC_1583,(2,3):C.GC_1605,(1,1):C.GC_1545,(3,1):C.GC_1557,(0,2):C.GC_1551,(2,2):C.GC_1563}) V_989 = Vertex(name = 'V_989', particles = [ P.u__tilde__, P.d, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1475,(1,0):C.GC_1577,(3,0):C.GC_1599,(0,3):C.GC_1588,(2,3):C.GC_1610,(1,1):C.GC_1548,(3,1):C.GC_1560,(0,2):C.GC_1554,(2,2):C.GC_1566}) V_990 = Vertex(name = 'V_990', particles = [ P.c__tilde__, P.d, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2078,(0,5):C.GC_2087,(1,0):C.GC_2260,(3,0):C.GC_2272,(0,3):C.GC_2266,(2,3):C.GC_2278,(1,1):C.GC_2112,(3,1):C.GC_2124,(0,2):C.GC_2118,(2,2):C.GC_2130}) V_991 = Vertex(name = 'V_991', particles = [ P.c__tilde__, P.d, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2096,(1,0):C.GC_2263,(3,0):C.GC_2275,(0,3):C.GC_2269,(2,3):C.GC_2281,(1,1):C.GC_2115,(3,1):C.GC_2127,(0,2):C.GC_2121,(2,2):C.GC_2133}) V_992 = Vertex(name = 'V_992', particles = [ P.t__tilde__, P.d, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2699,(0,5):C.GC_2708,(1,0):C.GC_2882,(3,0):C.GC_2894,(0,3):C.GC_2888,(2,3):C.GC_2900,(1,1):C.GC_2762,(3,1):C.GC_2774,(0,2):C.GC_2768,(2,2):C.GC_2780}) V_993 = Vertex(name = 'V_993', particles = [ P.t__tilde__, P.d, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2717,(1,0):C.GC_2885,(3,0):C.GC_2897,(0,3):C.GC_2891,(2,3):C.GC_2903,(1,1):C.GC_2765,(3,1):C.GC_2777,(0,2):C.GC_2771,(2,2):C.GC_2783}) V_994 = Vertex(name = 'V_994', particles = [ P.u__tilde__, P.d, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1460,(0,5):C.GC_1469,(1,0):C.GC_1493,(3,0):C.GC_1505,(0,3):C.GC_1499,(2,3):C.GC_1511,(1,1):C.GC_1546,(3,1):C.GC_1558,(0,2):C.GC_1552,(2,2):C.GC_1564}) V_995 = Vertex(name = 'V_995', particles = [ P.u__tilde__, P.d, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1478,(1,0):C.GC_1496,(3,0):C.GC_1508,(0,3):C.GC_1502,(2,3):C.GC_1514,(1,1):C.GC_1549,(3,1):C.GC_1561,(0,2):C.GC_1555,(2,2):C.GC_1567}) V_996 = Vertex(name = 'V_996', particles = [ P.c__tilde__, P.d, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2081,(0,5):C.GC_2090,(1,0):C.GC_2140,(3,0):C.GC_2162,(0,3):C.GC_2151,(2,3):C.GC_2173,(1,1):C.GC_2113,(3,1):C.GC_2125,(0,2):C.GC_2119,(2,2):C.GC_2131}) V_997 = Vertex(name = 'V_997', particles = [ P.c__tilde__, P.d, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2099,(1,0):C.GC_2145,(3,0):C.GC_2167,(0,3):C.GC_2156,(2,3):C.GC_2178,(1,1):C.GC_2116,(3,1):C.GC_2128,(0,2):C.GC_2122,(2,2):C.GC_2134}) V_998 = Vertex(name = 'V_998', particles = [ P.t__tilde__, P.d, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2702,(0,5):C.GC_2711,(1,0):C.GC_2736,(3,0):C.GC_2748,(0,3):C.GC_2742,(2,3):C.GC_2754,(1,1):C.GC_2763,(3,1):C.GC_2775,(0,2):C.GC_2769,(2,2):C.GC_2781}) V_999 = Vertex(name = 'V_999', particles = [ P.t__tilde__, P.d, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2720,(1,0):C.GC_2739,(3,0):C.GC_2751,(0,3):C.GC_2745,(2,3):C.GC_2757,(1,1):C.GC_2766,(3,1):C.GC_2778,(0,2):C.GC_2772,(2,2):C.GC_2784}) V_1000 = Vertex(name = 'V_1000', particles = [ P.u__tilde__, P.d, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1463,(0,5):C.GC_1472,(1,0):C.GC_1521,(3,0):C.GC_1533,(0,3):C.GC_1527,(2,3):C.GC_1539,(1,1):C.GC_1547,(3,1):C.GC_1559,(0,2):C.GC_1553,(2,2):C.GC_1565}) V_1001 = Vertex(name = 'V_1001', particles = [ P.u__tilde__, P.d, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1481,(1,0):C.GC_1524,(3,0):C.GC_1536,(0,3):C.GC_1530,(2,3):C.GC_1542,(1,1):C.GC_1550,(3,1):C.GC_1562,(0,2):C.GC_1556,(2,2):C.GC_1568}) V_1002 = Vertex(name = 'V_1002', particles = [ P.c__tilde__, P.d, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2084,(0,5):C.GC_2093,(1,0):C.GC_2228,(3,0):C.GC_2240,(0,3):C.GC_2234,(2,3):C.GC_2246,(1,1):C.GC_2114,(3,1):C.GC_2126,(0,2):C.GC_2120,(2,2):C.GC_2132}) V_1003 = Vertex(name = 'V_1003', particles = [ P.c__tilde__, P.d, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2102,(1,0):C.GC_2231,(3,0):C.GC_2243,(0,3):C.GC_2237,(2,3):C.GC_2249,(1,1):C.GC_2117,(3,1):C.GC_2129,(0,2):C.GC_2123,(2,2):C.GC_2135}) V_1004 = Vertex(name = 'V_1004', particles = [ P.t__tilde__, P.d, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2705,(0,5):C.GC_2714,(1,0):C.GC_2791,(3,0):C.GC_2813,(0,3):C.GC_2802,(2,3):C.GC_2824,(1,1):C.GC_2764,(3,1):C.GC_2776,(0,2):C.GC_2770,(2,2):C.GC_2782}) V_1005 = Vertex(name = 'V_1005', particles = [ P.t__tilde__, P.d, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2723,(1,0):C.GC_2796,(3,0):C.GC_2818,(0,3):C.GC_2807,(2,3):C.GC_2829,(1,1):C.GC_2767,(3,1):C.GC_2779,(0,2):C.GC_2773,(2,2):C.GC_2785}) V_1006 = Vertex(name = 'V_1006', particles = [ P.u__tilde__, P.s, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1662,(0,5):C.GC_1671,(1,0):C.GC_1812,(3,0):C.GC_1834,(0,3):C.GC_1823,(2,3):C.GC_1845,(1,1):C.GC_1776,(3,1):C.GC_1788,(0,2):C.GC_1782,(2,2):C.GC_1794}) V_1007 = Vertex(name = 'V_1007', particles = [ P.u__tilde__, P.s, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1680,(1,0):C.GC_1818,(3,0):C.GC_1840,(0,3):C.GC_1829,(2,3):C.GC_1851,(1,1):C.GC_1779,(3,1):C.GC_1791,(0,2):C.GC_1785,(2,2):C.GC_1797}) V_1008 = Vertex(name = 'V_1008', particles = [ P.c__tilde__, P.s, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2283,(0,5):C.GC_2292,(1,0):C.GC_2465,(3,0):C.GC_2477,(0,3):C.GC_2471,(2,3):C.GC_2483,(1,1):C.GC_2343,(3,1):C.GC_2355,(0,2):C.GC_2349,(2,2):C.GC_2361}) V_1009 = Vertex(name = 'V_1009', particles = [ P.c__tilde__, P.s, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2301,(1,0):C.GC_2468,(3,0):C.GC_2480,(0,3):C.GC_2474,(2,3):C.GC_2486,(1,1):C.GC_2346,(3,1):C.GC_2358,(0,2):C.GC_2352,(2,2):C.GC_2364}) V_1010 = Vertex(name = 'V_1010', particles = [ P.t__tilde__, P.s, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2905,(0,5):C.GC_2914,(1,0):C.GC_3088,(3,0):C.GC_3100,(0,3):C.GC_3094,(2,3):C.GC_3106,(1,1):C.GC_2994,(3,1):C.GC_3006,(0,2):C.GC_3000,(2,2):C.GC_3012}) V_1011 = Vertex(name = 'V_1011', particles = [ P.t__tilde__, P.s, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2923,(1,0):C.GC_3091,(3,0):C.GC_3103,(0,3):C.GC_3097,(2,3):C.GC_3109,(1,1):C.GC_2997,(3,1):C.GC_3009,(0,2):C.GC_3003,(2,2):C.GC_3015}) V_1012 = Vertex(name = 'V_1012', particles = [ P.u__tilde__, P.s, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1665,(0,5):C.GC_1674,(1,0):C.GC_1698,(3,0):C.GC_1710,(0,3):C.GC_1704,(2,3):C.GC_1716,(1,1):C.GC_1777,(3,1):C.GC_1789,(0,2):C.GC_1783,(2,2):C.GC_1795}) V_1013 = Vertex(name = 'V_1013', particles = [ P.u__tilde__, P.s, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1683,(1,0):C.GC_1701,(3,0):C.GC_1713,(0,3):C.GC_1707,(2,3):C.GC_1719,(1,1):C.GC_1780,(3,1):C.GC_1792,(0,2):C.GC_1786,(2,2):C.GC_1798}) V_1014 = Vertex(name = 'V_1014', particles = [ P.c__tilde__, P.s, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2286,(0,5):C.GC_2295,(1,0):C.GC_2380,(3,0):C.GC_2402,(0,3):C.GC_2391,(2,3):C.GC_2413,(1,1):C.GC_2344,(3,1):C.GC_2356,(0,2):C.GC_2350,(2,2):C.GC_2362}) V_1015 = Vertex(name = 'V_1015', particles = [ P.c__tilde__, P.s, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2304,(1,0):C.GC_2386,(3,0):C.GC_2408,(0,3):C.GC_2397,(2,3):C.GC_2419,(1,1):C.GC_2347,(3,1):C.GC_2359,(0,2):C.GC_2353,(2,2):C.GC_2365}) V_1016 = Vertex(name = 'V_1016', particles = [ P.t__tilde__, P.s, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2908,(0,5):C.GC_2917,(1,0):C.GC_2942,(3,0):C.GC_2954,(0,3):C.GC_2948,(2,3):C.GC_2960,(1,1):C.GC_2995,(3,1):C.GC_3007,(0,2):C.GC_3001,(2,2):C.GC_3013}) V_1017 = Vertex(name = 'V_1017', particles = [ P.t__tilde__, P.s, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2926,(1,0):C.GC_2945,(3,0):C.GC_2957,(0,3):C.GC_2951,(2,3):C.GC_2963,(1,1):C.GC_2998,(3,1):C.GC_3010,(0,2):C.GC_3004,(2,2):C.GC_3016}) V_1018 = Vertex(name = 'V_1018', particles = [ P.u__tilde__, P.s, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1668,(0,5):C.GC_1677,(1,0):C.GC_1726,(3,0):C.GC_1738,(0,3):C.GC_1732,(2,3):C.GC_1744,(1,1):C.GC_1778,(3,1):C.GC_1790,(0,2):C.GC_1784,(2,2):C.GC_1796}) V_1019 = Vertex(name = 'V_1019', particles = [ P.u__tilde__, P.s, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1686,(1,0):C.GC_1729,(3,0):C.GC_1741,(0,3):C.GC_1735,(2,3):C.GC_1747,(1,1):C.GC_1781,(3,1):C.GC_1793,(0,2):C.GC_1787,(2,2):C.GC_1799}) V_1020 = Vertex(name = 'V_1020', particles = [ P.c__tilde__, P.s, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2289,(0,5):C.GC_2298,(1,0):C.GC_2433,(3,0):C.GC_2445,(0,3):C.GC_2439,(2,3):C.GC_2451,(1,1):C.GC_2345,(3,1):C.GC_2357,(0,2):C.GC_2351,(2,2):C.GC_2363}) V_1021 = Vertex(name = 'V_1021', particles = [ P.c__tilde__, P.s, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2307,(1,0):C.GC_2436,(3,0):C.GC_2448,(0,3):C.GC_2442,(2,3):C.GC_2454,(1,1):C.GC_2348,(3,1):C.GC_2360,(0,2):C.GC_2354,(2,2):C.GC_2366}) V_1022 = Vertex(name = 'V_1022', particles = [ P.t__tilde__, P.s, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2911,(0,5):C.GC_2920,(1,0):C.GC_3032,(3,0):C.GC_3054,(0,3):C.GC_3043,(2,3):C.GC_3065,(1,1):C.GC_2996,(3,1):C.GC_3008,(0,2):C.GC_3002,(2,2):C.GC_3014}) V_1023 = Vertex(name = 'V_1023', particles = [ P.t__tilde__, P.s, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2929,(1,0):C.GC_3038,(3,0):C.GC_3060,(0,3):C.GC_3049,(2,3):C.GC_3071,(1,1):C.GC_2999,(3,1):C.GC_3011,(0,2):C.GC_3005,(2,2):C.GC_3017}) V_1024 = Vertex(name = 'V_1024', particles = [ P.u__tilde__, P.s, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,7):C.GC_44,(0,8):C.GC_49,(1,0):C.GC_1413,(3,0):C.GC_1419,(0,6):C.GC_1409,(2,6):C.GC_1415,(1,5):C.GC_41,(3,5):C.GC_42,(1,3):C.GC_50,(3,3):C.GC_51,(1,4):C.GC_56,(3,4):C.GC_57,(1,1):C.GC_1412,(3,1):C.GC_1418,(0,2):C.GC_1410,(2,2):C.GC_1416}) V_1025 = Vertex(name = 'V_1025', particles = [ P.u__tilde__, P.s, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_46,(0,5):C.GC_1672,(1,0):C.GC_1414,(3,0):C.GC_1420,(0,3):C.GC_1411,(2,3):C.GC_1417,(1,1):C.GC_1414,(3,1):C.GC_1420,(0,2):C.GC_1411,(2,2):C.GC_1417}) V_1026 = Vertex(name = 'V_1026', particles = [ P.u__tilde__, P.s, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1663,(1,0):C.GC_1814,(3,0):C.GC_1836,(0,3):C.GC_1824,(2,3):C.GC_1846,(1,1):C.GC_1813,(3,1):C.GC_1835,(0,2):C.GC_1825,(2,2):C.GC_1847}) V_1027 = Vertex(name = 'V_1027', particles = [ P.u__tilde__, P.s, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1681,(1,0):C.GC_1819,(3,0):C.GC_1841,(0,3):C.GC_1830,(2,3):C.GC_1852,(1,1):C.GC_1819,(3,1):C.GC_1841,(0,2):C.GC_1830,(2,2):C.GC_1852}) V_1028 = Vertex(name = 'V_1028', particles = [ P.c__tilde__, P.s, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2284,(0,5):C.GC_2293,(1,0):C.GC_2466,(3,0):C.GC_2478,(0,3):C.GC_2472,(2,3):C.GC_2484,(1,1):C.GC_2379,(3,1):C.GC_2401,(0,2):C.GC_2390,(2,2):C.GC_2412}) V_1029 = Vertex(name = 'V_1029', particles = [ P.c__tilde__, P.s, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2302,(1,0):C.GC_2469,(3,0):C.GC_2481,(0,3):C.GC_2475,(2,3):C.GC_2487,(1,1):C.GC_2385,(3,1):C.GC_2407,(0,2):C.GC_2396,(2,2):C.GC_2418}) V_1030 = Vertex(name = 'V_1030', particles = [ P.t__tilde__, P.s, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2906,(0,5):C.GC_2915,(1,0):C.GC_3089,(3,0):C.GC_3101,(0,3):C.GC_3095,(2,3):C.GC_3107,(1,1):C.GC_3030,(3,1):C.GC_3052,(0,2):C.GC_3041,(2,2):C.GC_3063}) V_1031 = Vertex(name = 'V_1031', particles = [ P.t__tilde__, P.s, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2924,(1,0):C.GC_3092,(3,0):C.GC_3104,(0,3):C.GC_3098,(2,3):C.GC_3110,(1,1):C.GC_3036,(3,1):C.GC_3058,(0,2):C.GC_3047,(2,2):C.GC_3069}) V_1032 = Vertex(name = 'V_1032', particles = [ P.u__tilde__, P.s, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1666,(0,5):C.GC_1675,(1,0):C.GC_1699,(3,0):C.GC_1711,(0,3):C.GC_1705,(2,3):C.GC_1717,(1,1):C.GC_1816,(3,1):C.GC_1838,(0,2):C.GC_1827,(2,2):C.GC_1849}) V_1033 = Vertex(name = 'V_1033', particles = [ P.u__tilde__, P.s, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1684,(1,0):C.GC_1702,(3,0):C.GC_1714,(0,3):C.GC_1708,(2,3):C.GC_1720,(1,1):C.GC_1821,(3,1):C.GC_1843,(0,2):C.GC_1832,(2,2):C.GC_1854}) V_1034 = Vertex(name = 'V_1034', particles = [ P.c__tilde__, P.s, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,7):C.GC_44,(0,8):C.GC_49,(1,0):C.GC_930,(3,0):C.GC_936,(0,6):C.GC_926,(2,6):C.GC_932,(1,5):C.GC_41,(3,5):C.GC_42,(1,3):C.GC_50,(3,3):C.GC_51,(1,4):C.GC_56,(3,4):C.GC_57,(1,1):C.GC_929,(3,1):C.GC_935,(0,2):C.GC_927,(2,2):C.GC_933}) V_1035 = Vertex(name = 'V_1035', particles = [ P.c__tilde__, P.s, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_46,(0,5):C.GC_2296,(1,0):C.GC_931,(3,0):C.GC_937,(0,3):C.GC_928,(2,3):C.GC_934,(1,1):C.GC_931,(3,1):C.GC_937,(0,2):C.GC_928,(2,2):C.GC_934}) V_1036 = Vertex(name = 'V_1036', particles = [ P.c__tilde__, P.s, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2287,(1,0):C.GC_2382,(3,0):C.GC_2404,(0,3):C.GC_2392,(2,3):C.GC_2414,(1,1):C.GC_2381,(3,1):C.GC_2403,(0,2):C.GC_2393,(2,2):C.GC_2415}) V_1037 = Vertex(name = 'V_1037', particles = [ P.c__tilde__, P.s, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2305,(1,0):C.GC_2387,(3,0):C.GC_2409,(0,3):C.GC_2398,(2,3):C.GC_2420,(1,1):C.GC_2387,(3,1):C.GC_2409,(0,2):C.GC_2398,(2,2):C.GC_2420}) V_1038 = Vertex(name = 'V_1038', particles = [ P.t__tilde__, P.s, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2909,(0,5):C.GC_2918,(1,0):C.GC_2943,(3,0):C.GC_2955,(0,3):C.GC_2949,(2,3):C.GC_2961,(1,1):C.GC_3031,(3,1):C.GC_3053,(0,2):C.GC_3042,(2,2):C.GC_3064}) V_1039 = Vertex(name = 'V_1039', particles = [ P.t__tilde__, P.s, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2927,(1,0):C.GC_2946,(3,0):C.GC_2958,(0,3):C.GC_2952,(2,3):C.GC_2964,(1,1):C.GC_3037,(3,1):C.GC_3059,(0,2):C.GC_3048,(2,2):C.GC_3070}) V_1040 = Vertex(name = 'V_1040', particles = [ P.u__tilde__, P.s, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1669,(0,5):C.GC_1678,(1,0):C.GC_1727,(3,0):C.GC_1739,(0,3):C.GC_1733,(2,3):C.GC_1745,(1,1):C.GC_1817,(3,1):C.GC_1839,(0,2):C.GC_1828,(2,2):C.GC_1850}) V_1041 = Vertex(name = 'V_1041', particles = [ P.u__tilde__, P.s, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1687,(1,0):C.GC_1730,(3,0):C.GC_1742,(0,3):C.GC_1736,(2,3):C.GC_1748,(1,1):C.GC_1822,(3,1):C.GC_1844,(0,2):C.GC_1833,(2,2):C.GC_1855}) V_1042 = Vertex(name = 'V_1042', particles = [ P.c__tilde__, P.s, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2290,(0,5):C.GC_2299,(1,0):C.GC_2434,(3,0):C.GC_2446,(0,3):C.GC_2440,(2,3):C.GC_2452,(1,1):C.GC_2384,(3,1):C.GC_2406,(0,2):C.GC_2395,(2,2):C.GC_2417}) V_1043 = Vertex(name = 'V_1043', particles = [ P.c__tilde__, P.s, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2308,(1,0):C.GC_2437,(3,0):C.GC_2449,(0,3):C.GC_2443,(2,3):C.GC_2455,(1,1):C.GC_2389,(3,1):C.GC_2411,(0,2):C.GC_2400,(2,2):C.GC_2422}) V_1044 = Vertex(name = 'V_1044', particles = [ P.t__tilde__, P.s, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,7):C.GC_44,(0,8):C.GC_49,(1,0):C.GC_1116,(3,0):C.GC_1122,(0,6):C.GC_1112,(2,6):C.GC_1118,(1,5):C.GC_41,(3,5):C.GC_42,(1,3):C.GC_50,(3,3):C.GC_51,(1,4):C.GC_56,(3,4):C.GC_57,(1,1):C.GC_1115,(3,1):C.GC_1121,(0,2):C.GC_1113,(2,2):C.GC_1119}) V_1045 = Vertex(name = 'V_1045', particles = [ P.t__tilde__, P.s, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_46,(0,5):C.GC_2921,(1,0):C.GC_1117,(3,0):C.GC_1123,(0,3):C.GC_1114,(2,3):C.GC_1120,(1,1):C.GC_1117,(3,1):C.GC_1123,(0,2):C.GC_1114,(2,2):C.GC_1120}) V_1046 = Vertex(name = 'V_1046', particles = [ P.t__tilde__, P.s, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2912,(1,0):C.GC_3034,(3,0):C.GC_3056,(0,3):C.GC_3044,(2,3):C.GC_3066,(1,1):C.GC_3033,(3,1):C.GC_3055,(0,2):C.GC_3045,(2,2):C.GC_3067}) V_1047 = Vertex(name = 'V_1047', particles = [ P.t__tilde__, P.s, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2930,(1,0):C.GC_3039,(3,0):C.GC_3061,(0,3):C.GC_3050,(2,3):C.GC_3072,(1,1):C.GC_3039,(3,1):C.GC_3061,(0,2):C.GC_3050,(2,2):C.GC_3072}) V_1048 = Vertex(name = 'V_1048', particles = [ P.u__tilde__, P.s, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1664,(0,5):C.GC_1673,(1,0):C.GC_1815,(3,0):C.GC_1837,(0,3):C.GC_1826,(2,3):C.GC_1848,(1,1):C.GC_1752,(3,1):C.GC_1764,(0,2):C.GC_1758,(2,2):C.GC_1770}) V_1049 = Vertex(name = 'V_1049', particles = [ P.u__tilde__, P.s, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1682,(1,0):C.GC_1820,(3,0):C.GC_1842,(0,3):C.GC_1831,(2,3):C.GC_1853,(1,1):C.GC_1755,(3,1):C.GC_1767,(0,2):C.GC_1761,(2,2):C.GC_1773}) V_1050 = Vertex(name = 'V_1050', particles = [ P.c__tilde__, P.s, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2285,(0,5):C.GC_2294,(1,0):C.GC_2467,(3,0):C.GC_2479,(0,3):C.GC_2473,(2,3):C.GC_2485,(1,1):C.GC_2319,(3,1):C.GC_2331,(0,2):C.GC_2325,(2,2):C.GC_2337}) V_1051 = Vertex(name = 'V_1051', particles = [ P.c__tilde__, P.s, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2303,(1,0):C.GC_2470,(3,0):C.GC_2482,(0,3):C.GC_2476,(2,3):C.GC_2488,(1,1):C.GC_2322,(3,1):C.GC_2334,(0,2):C.GC_2328,(2,2):C.GC_2340}) V_1052 = Vertex(name = 'V_1052', particles = [ P.t__tilde__, P.s, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2907,(0,5):C.GC_2916,(1,0):C.GC_3090,(3,0):C.GC_3102,(0,3):C.GC_3096,(2,3):C.GC_3108,(1,1):C.GC_2970,(3,1):C.GC_2982,(0,2):C.GC_2976,(2,2):C.GC_2988}) V_1053 = Vertex(name = 'V_1053', particles = [ P.t__tilde__, P.s, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2925,(1,0):C.GC_3093,(3,0):C.GC_3105,(0,3):C.GC_3099,(2,3):C.GC_3111,(1,1):C.GC_2973,(3,1):C.GC_2985,(0,2):C.GC_2979,(2,2):C.GC_2991}) V_1054 = Vertex(name = 'V_1054', particles = [ P.u__tilde__, P.s, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1667,(0,5):C.GC_1676,(1,0):C.GC_1700,(3,0):C.GC_1712,(0,3):C.GC_1706,(2,3):C.GC_1718,(1,1):C.GC_1753,(3,1):C.GC_1765,(0,2):C.GC_1759,(2,2):C.GC_1771}) V_1055 = Vertex(name = 'V_1055', particles = [ P.u__tilde__, P.s, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1685,(1,0):C.GC_1703,(3,0):C.GC_1715,(0,3):C.GC_1709,(2,3):C.GC_1721,(1,1):C.GC_1756,(3,1):C.GC_1768,(0,2):C.GC_1762,(2,2):C.GC_1774}) V_1056 = Vertex(name = 'V_1056', particles = [ P.c__tilde__, P.s, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2288,(0,5):C.GC_2297,(1,0):C.GC_2383,(3,0):C.GC_2405,(0,3):C.GC_2394,(2,3):C.GC_2416,(1,1):C.GC_2320,(3,1):C.GC_2332,(0,2):C.GC_2326,(2,2):C.GC_2338}) V_1057 = Vertex(name = 'V_1057', particles = [ P.c__tilde__, P.s, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2306,(1,0):C.GC_2388,(3,0):C.GC_2410,(0,3):C.GC_2399,(2,3):C.GC_2421,(1,1):C.GC_2323,(3,1):C.GC_2335,(0,2):C.GC_2329,(2,2):C.GC_2341}) V_1058 = Vertex(name = 'V_1058', particles = [ P.t__tilde__, P.s, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2910,(0,5):C.GC_2919,(1,0):C.GC_2944,(3,0):C.GC_2956,(0,3):C.GC_2950,(2,3):C.GC_2962,(1,1):C.GC_2971,(3,1):C.GC_2983,(0,2):C.GC_2977,(2,2):C.GC_2989}) V_1059 = Vertex(name = 'V_1059', particles = [ P.t__tilde__, P.s, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2928,(1,0):C.GC_2947,(3,0):C.GC_2959,(0,3):C.GC_2953,(2,3):C.GC_2965,(1,1):C.GC_2974,(3,1):C.GC_2986,(0,2):C.GC_2980,(2,2):C.GC_2992}) V_1060 = Vertex(name = 'V_1060', particles = [ P.u__tilde__, P.s, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1670,(0,5):C.GC_1679,(1,0):C.GC_1728,(3,0):C.GC_1740,(0,3):C.GC_1734,(2,3):C.GC_1746,(1,1):C.GC_1754,(3,1):C.GC_1766,(0,2):C.GC_1760,(2,2):C.GC_1772}) V_1061 = Vertex(name = 'V_1061', particles = [ P.u__tilde__, P.s, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1688,(1,0):C.GC_1731,(3,0):C.GC_1743,(0,3):C.GC_1737,(2,3):C.GC_1749,(1,1):C.GC_1757,(3,1):C.GC_1769,(0,2):C.GC_1763,(2,2):C.GC_1775}) V_1062 = Vertex(name = 'V_1062', particles = [ P.c__tilde__, P.s, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2291,(0,5):C.GC_2300,(1,0):C.GC_2435,(3,0):C.GC_2447,(0,3):C.GC_2441,(2,3):C.GC_2453,(1,1):C.GC_2321,(3,1):C.GC_2333,(0,2):C.GC_2327,(2,2):C.GC_2339}) V_1063 = Vertex(name = 'V_1063', particles = [ P.c__tilde__, P.s, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2309,(1,0):C.GC_2438,(3,0):C.GC_2450,(0,3):C.GC_2444,(2,3):C.GC_2456,(1,1):C.GC_2324,(3,1):C.GC_2336,(0,2):C.GC_2330,(2,2):C.GC_2342}) V_1064 = Vertex(name = 'V_1064', particles = [ P.t__tilde__, P.s, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2913,(0,5):C.GC_2922,(1,0):C.GC_3035,(3,0):C.GC_3057,(0,3):C.GC_3046,(2,3):C.GC_3068,(1,1):C.GC_2972,(3,1):C.GC_2984,(0,2):C.GC_2978,(2,2):C.GC_2990}) V_1065 = Vertex(name = 'V_1065', particles = [ P.t__tilde__, P.s, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2931,(1,0):C.GC_3040,(3,0):C.GC_3062,(0,3):C.GC_3051,(2,3):C.GC_3073,(1,1):C.GC_2975,(3,1):C.GC_2987,(0,2):C.GC_2981,(2,2):C.GC_2993}) V_1066 = Vertex(name = 'V_1066', particles = [ P.u__tilde__, P.b, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1869,(0,5):C.GC_1878,(1,0):C.GC_1959,(3,0):C.GC_1981,(0,3):C.GC_1970,(2,3):C.GC_1992,(1,1):C.GC_2009,(3,1):C.GC_2021,(0,2):C.GC_2015,(2,2):C.GC_2027}) V_1067 = Vertex(name = 'V_1067', particles = [ P.u__tilde__, P.b, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1887,(1,0):C.GC_1965,(3,0):C.GC_1987,(0,3):C.GC_1976,(2,3):C.GC_1998,(1,1):C.GC_2012,(3,1):C.GC_2024,(0,2):C.GC_2018,(2,2):C.GC_2030}) V_1068 = Vertex(name = 'V_1068', particles = [ P.c__tilde__, P.b, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2490,(0,5):C.GC_2499,(1,0):C.GC_2672,(3,0):C.GC_2684,(0,3):C.GC_2678,(2,3):C.GC_2690,(1,1):C.GC_2576,(3,1):C.GC_2588,(0,2):C.GC_2582,(2,2):C.GC_2594}) V_1069 = Vertex(name = 'V_1069', particles = [ P.c__tilde__, P.b, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2508,(1,0):C.GC_2675,(3,0):C.GC_2687,(0,3):C.GC_2681,(2,3):C.GC_2693,(1,1):C.GC_2579,(3,1):C.GC_2591,(0,2):C.GC_2585,(2,2):C.GC_2597}) V_1070 = Vertex(name = 'V_1070', particles = [ P.t__tilde__, P.b, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_3113,(0,5):C.GC_3122,(1,0):C.GC_3296,(3,0):C.GC_3308,(0,3):C.GC_3302,(2,3):C.GC_3314,(1,1):C.GC_3228,(3,1):C.GC_3240,(0,2):C.GC_3234,(2,2):C.GC_3246}) V_1071 = Vertex(name = 'V_1071', particles = [ P.t__tilde__, P.b, P.d__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3131,(1,0):C.GC_3299,(3,0):C.GC_3311,(0,3):C.GC_3305,(2,3):C.GC_3317,(1,1):C.GC_3231,(3,1):C.GC_3243,(0,2):C.GC_3237,(2,2):C.GC_3249}) V_1072 = Vertex(name = 'V_1072', particles = [ P.u__tilde__, P.b, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1872,(0,5):C.GC_1881,(1,0):C.GC_1905,(3,0):C.GC_1917,(0,3):C.GC_1911,(2,3):C.GC_1923,(1,1):C.GC_2010,(3,1):C.GC_2022,(0,2):C.GC_2016,(2,2):C.GC_2028}) V_1073 = Vertex(name = 'V_1073', particles = [ P.u__tilde__, P.b, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1890,(1,0):C.GC_1908,(3,0):C.GC_1920,(0,3):C.GC_1914,(2,3):C.GC_1926,(1,1):C.GC_2013,(3,1):C.GC_2025,(0,2):C.GC_2019,(2,2):C.GC_2031}) V_1074 = Vertex(name = 'V_1074', particles = [ P.c__tilde__, P.b, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2493,(0,5):C.GC_2502,(1,0):C.GC_2527,(3,0):C.GC_2549,(0,3):C.GC_2538,(2,3):C.GC_2560,(1,1):C.GC_2577,(3,1):C.GC_2589,(0,2):C.GC_2583,(2,2):C.GC_2595}) V_1075 = Vertex(name = 'V_1075', particles = [ P.c__tilde__, P.b, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2511,(1,0):C.GC_2533,(3,0):C.GC_2555,(0,3):C.GC_2544,(2,3):C.GC_2566,(1,1):C.GC_2580,(3,1):C.GC_2592,(0,2):C.GC_2586,(2,2):C.GC_2598}) V_1076 = Vertex(name = 'V_1076', particles = [ P.t__tilde__, P.b, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_3116,(0,5):C.GC_3125,(1,0):C.GC_3150,(3,0):C.GC_3162,(0,3):C.GC_3156,(2,3):C.GC_3168,(1,1):C.GC_3229,(3,1):C.GC_3241,(0,2):C.GC_3235,(2,2):C.GC_3247}) V_1077 = Vertex(name = 'V_1077', particles = [ P.t__tilde__, P.b, P.d__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3134,(1,0):C.GC_3153,(3,0):C.GC_3165,(0,3):C.GC_3159,(2,3):C.GC_3171,(1,1):C.GC_3232,(3,1):C.GC_3244,(0,2):C.GC_3238,(2,2):C.GC_3250}) V_1078 = Vertex(name = 'V_1078', particles = [ P.u__tilde__, P.b, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1875,(0,5):C.GC_1884,(1,0):C.GC_1933,(3,0):C.GC_1945,(0,3):C.GC_1939,(2,3):C.GC_1951,(1,1):C.GC_2011,(3,1):C.GC_2023,(0,2):C.GC_2017,(2,2):C.GC_2029}) V_1079 = Vertex(name = 'V_1079', particles = [ P.u__tilde__, P.b, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1893,(1,0):C.GC_1936,(3,0):C.GC_1948,(0,3):C.GC_1942,(2,3):C.GC_1954,(1,1):C.GC_2014,(3,1):C.GC_2026,(0,2):C.GC_2020,(2,2):C.GC_2032}) V_1080 = Vertex(name = 'V_1080', particles = [ P.c__tilde__, P.b, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2496,(0,5):C.GC_2505,(1,0):C.GC_2640,(3,0):C.GC_2652,(0,3):C.GC_2646,(2,3):C.GC_2658,(1,1):C.GC_2578,(3,1):C.GC_2590,(0,2):C.GC_2584,(2,2):C.GC_2596}) V_1081 = Vertex(name = 'V_1081', particles = [ P.c__tilde__, P.b, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2514,(1,0):C.GC_2643,(3,0):C.GC_2655,(0,3):C.GC_2649,(2,3):C.GC_2661,(1,1):C.GC_2581,(3,1):C.GC_2593,(0,2):C.GC_2587,(2,2):C.GC_2599}) V_1082 = Vertex(name = 'V_1082', particles = [ P.t__tilde__, P.b, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_3119,(0,5):C.GC_3128,(1,0):C.GC_3180,(3,0):C.GC_3202,(0,3):C.GC_3191,(2,3):C.GC_3213,(1,1):C.GC_3230,(3,1):C.GC_3242,(0,2):C.GC_3236,(2,2):C.GC_3248}) V_1083 = Vertex(name = 'V_1083', particles = [ P.t__tilde__, P.b, P.d__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3137,(1,0):C.GC_3186,(3,0):C.GC_3208,(0,3):C.GC_3197,(2,3):C.GC_3219,(1,1):C.GC_3233,(3,1):C.GC_3245,(0,2):C.GC_3239,(2,2):C.GC_3251}) V_1084 = Vertex(name = 'V_1084', particles = [ P.u__tilde__, P.b, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1870,(0,5):C.GC_1879,(1,0):C.GC_1960,(3,0):C.GC_1982,(0,3):C.GC_1971,(2,3):C.GC_1993,(1,1):C.GC_2045,(3,1):C.GC_2057,(0,2):C.GC_2051,(2,2):C.GC_2063}) V_1085 = Vertex(name = 'V_1085', particles = [ P.u__tilde__, P.b, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1888,(1,0):C.GC_1966,(3,0):C.GC_1988,(0,3):C.GC_1977,(2,3):C.GC_1999,(1,1):C.GC_2048,(3,1):C.GC_2060,(0,2):C.GC_2054,(2,2):C.GC_2066}) V_1086 = Vertex(name = 'V_1086', particles = [ P.c__tilde__, P.b, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2491,(0,5):C.GC_2500,(1,0):C.GC_2673,(3,0):C.GC_2685,(0,3):C.GC_2679,(2,3):C.GC_2691,(1,1):C.GC_2616,(3,1):C.GC_2628,(0,2):C.GC_2622,(2,2):C.GC_2634}) V_1087 = Vertex(name = 'V_1087', particles = [ P.c__tilde__, P.b, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2509,(1,0):C.GC_2676,(3,0):C.GC_2688,(0,3):C.GC_2682,(2,3):C.GC_2694,(1,1):C.GC_2619,(3,1):C.GC_2631,(0,2):C.GC_2625,(2,2):C.GC_2637}) V_1088 = Vertex(name = 'V_1088', particles = [ P.t__tilde__, P.b, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_3114,(0,5):C.GC_3123,(1,0):C.GC_3297,(3,0):C.GC_3309,(0,3):C.GC_3303,(2,3):C.GC_3315,(1,1):C.GC_3264,(3,1):C.GC_3276,(0,2):C.GC_3270,(2,2):C.GC_3282}) V_1089 = Vertex(name = 'V_1089', particles = [ P.t__tilde__, P.b, P.s__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3132,(1,0):C.GC_3300,(3,0):C.GC_3312,(0,3):C.GC_3306,(2,3):C.GC_3318,(1,1):C.GC_3267,(3,1):C.GC_3279,(0,2):C.GC_3273,(2,2):C.GC_3285}) V_1090 = Vertex(name = 'V_1090', particles = [ P.u__tilde__, P.b, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1873,(0,5):C.GC_1882,(1,0):C.GC_1906,(3,0):C.GC_1918,(0,3):C.GC_1912,(2,3):C.GC_1924,(1,1):C.GC_2046,(3,1):C.GC_2058,(0,2):C.GC_2052,(2,2):C.GC_2064}) V_1091 = Vertex(name = 'V_1091', particles = [ P.u__tilde__, P.b, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1891,(1,0):C.GC_1909,(3,0):C.GC_1921,(0,3):C.GC_1915,(2,3):C.GC_1927,(1,1):C.GC_2049,(3,1):C.GC_2061,(0,2):C.GC_2055,(2,2):C.GC_2067}) V_1092 = Vertex(name = 'V_1092', particles = [ P.c__tilde__, P.b, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2494,(0,5):C.GC_2503,(1,0):C.GC_2528,(3,0):C.GC_2550,(0,3):C.GC_2539,(2,3):C.GC_2561,(1,1):C.GC_2617,(3,1):C.GC_2629,(0,2):C.GC_2623,(2,2):C.GC_2635}) V_1093 = Vertex(name = 'V_1093', particles = [ P.c__tilde__, P.b, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2512,(1,0):C.GC_2534,(3,0):C.GC_2556,(0,3):C.GC_2545,(2,3):C.GC_2567,(1,1):C.GC_2620,(3,1):C.GC_2632,(0,2):C.GC_2626,(2,2):C.GC_2638}) V_1094 = Vertex(name = 'V_1094', particles = [ P.t__tilde__, P.b, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_3117,(0,5):C.GC_3126,(1,0):C.GC_3151,(3,0):C.GC_3163,(0,3):C.GC_3157,(2,3):C.GC_3169,(1,1):C.GC_3265,(3,1):C.GC_3277,(0,2):C.GC_3271,(2,2):C.GC_3283}) V_1095 = Vertex(name = 'V_1095', particles = [ P.t__tilde__, P.b, P.s__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3135,(1,0):C.GC_3154,(3,0):C.GC_3166,(0,3):C.GC_3160,(2,3):C.GC_3172,(1,1):C.GC_3268,(3,1):C.GC_3280,(0,2):C.GC_3274,(2,2):C.GC_3286}) V_1096 = Vertex(name = 'V_1096', particles = [ P.u__tilde__, P.b, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1876,(0,5):C.GC_1885,(1,0):C.GC_1934,(3,0):C.GC_1946,(0,3):C.GC_1940,(2,3):C.GC_1952,(1,1):C.GC_2047,(3,1):C.GC_2059,(0,2):C.GC_2053,(2,2):C.GC_2065}) V_1097 = Vertex(name = 'V_1097', particles = [ P.u__tilde__, P.b, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1894,(1,0):C.GC_1937,(3,0):C.GC_1949,(0,3):C.GC_1943,(2,3):C.GC_1955,(1,1):C.GC_2050,(3,1):C.GC_2062,(0,2):C.GC_2056,(2,2):C.GC_2068}) V_1098 = Vertex(name = 'V_1098', particles = [ P.c__tilde__, P.b, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2497,(0,5):C.GC_2506,(1,0):C.GC_2641,(3,0):C.GC_2653,(0,3):C.GC_2647,(2,3):C.GC_2659,(1,1):C.GC_2618,(3,1):C.GC_2630,(0,2):C.GC_2624,(2,2):C.GC_2636}) V_1099 = Vertex(name = 'V_1099', particles = [ P.c__tilde__, P.b, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2515,(1,0):C.GC_2644,(3,0):C.GC_2656,(0,3):C.GC_2650,(2,3):C.GC_2662,(1,1):C.GC_2621,(3,1):C.GC_2633,(0,2):C.GC_2627,(2,2):C.GC_2639}) V_1100 = Vertex(name = 'V_1100', particles = [ P.t__tilde__, P.b, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_3120,(0,5):C.GC_3129,(1,0):C.GC_3181,(3,0):C.GC_3203,(0,3):C.GC_3192,(2,3):C.GC_3214,(1,1):C.GC_3266,(3,1):C.GC_3278,(0,2):C.GC_3272,(2,2):C.GC_3284}) V_1101 = Vertex(name = 'V_1101', particles = [ P.t__tilde__, P.b, P.s__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3138,(1,0):C.GC_3187,(3,0):C.GC_3209,(0,3):C.GC_3198,(2,3):C.GC_3220,(1,1):C.GC_3269,(3,1):C.GC_3281,(0,2):C.GC_3275,(2,2):C.GC_3287}) V_1102 = Vertex(name = 'V_1102', particles = [ P.u__tilde__, P.b, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,7):C.GC_44,(0,8):C.GC_49,(1,0):C.GC_1323,(3,0):C.GC_1329,(0,6):C.GC_1319,(2,6):C.GC_1325,(1,5):C.GC_41,(3,5):C.GC_42,(1,3):C.GC_50,(3,3):C.GC_51,(1,4):C.GC_56,(3,4):C.GC_57,(1,1):C.GC_1322,(3,1):C.GC_1328,(0,2):C.GC_1320,(2,2):C.GC_1326}) V_1103 = Vertex(name = 'V_1103', particles = [ P.u__tilde__, P.b, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_46,(0,5):C.GC_1880,(1,0):C.GC_1324,(3,0):C.GC_1330,(0,3):C.GC_1321,(2,3):C.GC_1327,(1,1):C.GC_1324,(3,1):C.GC_1330,(0,2):C.GC_1321,(2,2):C.GC_1327}) V_1104 = Vertex(name = 'V_1104', particles = [ P.u__tilde__, P.b, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1871,(1,0):C.GC_1962,(3,0):C.GC_1984,(0,3):C.GC_1972,(2,3):C.GC_1994,(1,1):C.GC_1961,(3,1):C.GC_1983,(0,2):C.GC_1973,(2,2):C.GC_1995}) V_1105 = Vertex(name = 'V_1105', particles = [ P.u__tilde__, P.b, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1889,(1,0):C.GC_1967,(3,0):C.GC_1989,(0,3):C.GC_1978,(2,3):C.GC_2000,(1,1):C.GC_1967,(3,1):C.GC_1989,(0,2):C.GC_1978,(2,2):C.GC_2000}) V_1106 = Vertex(name = 'V_1106', particles = [ P.c__tilde__, P.b, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2492,(0,5):C.GC_2501,(1,0):C.GC_2674,(3,0):C.GC_2686,(0,3):C.GC_2680,(2,3):C.GC_2692,(1,1):C.GC_2526,(3,1):C.GC_2548,(0,2):C.GC_2537,(2,2):C.GC_2559}) V_1107 = Vertex(name = 'V_1107', particles = [ P.c__tilde__, P.b, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2510,(1,0):C.GC_2677,(3,0):C.GC_2689,(0,3):C.GC_2683,(2,3):C.GC_2695,(1,1):C.GC_2532,(3,1):C.GC_2554,(0,2):C.GC_2543,(2,2):C.GC_2565}) V_1108 = Vertex(name = 'V_1108', particles = [ P.t__tilde__, P.b, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_3115,(0,5):C.GC_3124,(1,0):C.GC_3298,(3,0):C.GC_3310,(0,3):C.GC_3304,(2,3):C.GC_3316,(1,1):C.GC_3178,(3,1):C.GC_3200,(0,2):C.GC_3189,(2,2):C.GC_3211}) V_1109 = Vertex(name = 'V_1109', particles = [ P.t__tilde__, P.b, P.b__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3133,(1,0):C.GC_3301,(3,0):C.GC_3313,(0,3):C.GC_3307,(2,3):C.GC_3319,(1,1):C.GC_3184,(3,1):C.GC_3206,(0,2):C.GC_3195,(2,2):C.GC_3217}) V_1110 = Vertex(name = 'V_1110', particles = [ P.u__tilde__, P.b, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1874,(0,5):C.GC_1883,(1,0):C.GC_1907,(3,0):C.GC_1919,(0,3):C.GC_1913,(2,3):C.GC_1925,(1,1):C.GC_1963,(3,1):C.GC_1985,(0,2):C.GC_1974,(2,2):C.GC_1996}) V_1111 = Vertex(name = 'V_1111', particles = [ P.u__tilde__, P.b, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1892,(1,0):C.GC_1910,(3,0):C.GC_1922,(0,3):C.GC_1916,(2,3):C.GC_1928,(1,1):C.GC_1968,(3,1):C.GC_1990,(0,2):C.GC_1979,(2,2):C.GC_2001}) V_1112 = Vertex(name = 'V_1112', particles = [ P.c__tilde__, P.b, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,7):C.GC_44,(0,8):C.GC_49,(1,0):C.GC_588,(3,0):C.GC_594,(0,6):C.GC_584,(2,6):C.GC_590,(1,5):C.GC_41,(3,5):C.GC_42,(1,3):C.GC_50,(3,3):C.GC_51,(1,4):C.GC_56,(3,4):C.GC_57,(1,1):C.GC_587,(3,1):C.GC_593,(0,2):C.GC_585,(2,2):C.GC_591}) V_1113 = Vertex(name = 'V_1113', particles = [ P.c__tilde__, P.b, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_46,(0,5):C.GC_2504,(1,0):C.GC_589,(3,0):C.GC_595,(0,3):C.GC_586,(2,3):C.GC_592,(1,1):C.GC_589,(3,1):C.GC_595,(0,2):C.GC_586,(2,2):C.GC_592}) V_1114 = Vertex(name = 'V_1114', particles = [ P.c__tilde__, P.b, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2495,(1,0):C.GC_2530,(3,0):C.GC_2552,(0,3):C.GC_2540,(2,3):C.GC_2562,(1,1):C.GC_2529,(3,1):C.GC_2551,(0,2):C.GC_2541,(2,2):C.GC_2563}) V_1115 = Vertex(name = 'V_1115', particles = [ P.c__tilde__, P.b, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2513,(1,0):C.GC_2535,(3,0):C.GC_2557,(0,3):C.GC_2546,(2,3):C.GC_2568,(1,1):C.GC_2535,(3,1):C.GC_2557,(0,2):C.GC_2546,(2,2):C.GC_2568}) V_1116 = Vertex(name = 'V_1116', particles = [ P.t__tilde__, P.b, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_3118,(0,5):C.GC_3127,(1,0):C.GC_3152,(3,0):C.GC_3164,(0,3):C.GC_3158,(2,3):C.GC_3170,(1,1):C.GC_3179,(3,1):C.GC_3201,(0,2):C.GC_3190,(2,2):C.GC_3212}) V_1117 = Vertex(name = 'V_1117', particles = [ P.t__tilde__, P.b, P.b__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3136,(1,0):C.GC_3155,(3,0):C.GC_3167,(0,3):C.GC_3161,(2,3):C.GC_3173,(1,1):C.GC_3185,(3,1):C.GC_3207,(0,2):C.GC_3196,(2,2):C.GC_3218}) V_1118 = Vertex(name = 'V_1118', particles = [ P.u__tilde__, P.b, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_1877,(0,5):C.GC_1886,(1,0):C.GC_1935,(3,0):C.GC_1947,(0,3):C.GC_1941,(2,3):C.GC_1953,(1,1):C.GC_1964,(3,1):C.GC_1986,(0,2):C.GC_1975,(2,2):C.GC_1997}) V_1119 = Vertex(name = 'V_1119', particles = [ P.u__tilde__, P.b, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_1895,(1,0):C.GC_1938,(3,0):C.GC_1950,(0,3):C.GC_1944,(2,3):C.GC_1956,(1,1):C.GC_1969,(3,1):C.GC_1991,(0,2):C.GC_1980,(2,2):C.GC_2002}) V_1120 = Vertex(name = 'V_1120', particles = [ P.c__tilde__, P.b, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_2498,(0,5):C.GC_2507,(1,0):C.GC_2642,(3,0):C.GC_2654,(0,3):C.GC_2648,(2,3):C.GC_2660,(1,1):C.GC_2531,(3,1):C.GC_2553,(0,2):C.GC_2542,(2,2):C.GC_2564}) V_1121 = Vertex(name = 'V_1121', particles = [ P.c__tilde__, P.b, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_2516,(1,0):C.GC_2645,(3,0):C.GC_2657,(0,3):C.GC_2651,(2,3):C.GC_2663,(1,1):C.GC_2536,(3,1):C.GC_2558,(0,2):C.GC_2547,(2,2):C.GC_2569}) V_1122 = Vertex(name = 'V_1122', particles = [ P.t__tilde__, P.b, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,7):C.GC_44,(0,8):C.GC_49,(1,0):C.GC_1026,(3,0):C.GC_1032,(0,6):C.GC_1022,(2,6):C.GC_1028,(1,5):C.GC_41,(3,5):C.GC_42,(1,3):C.GC_50,(3,3):C.GC_51,(1,4):C.GC_56,(3,4):C.GC_57,(1,1):C.GC_1025,(3,1):C.GC_1031,(0,2):C.GC_1023,(2,2):C.GC_1029}) V_1123 = Vertex(name = 'V_1123', particles = [ P.t__tilde__, P.b, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_46,(0,5):C.GC_3130,(1,0):C.GC_1027,(3,0):C.GC_1033,(0,3):C.GC_1024,(2,3):C.GC_1030,(1,1):C.GC_1027,(3,1):C.GC_1033,(0,2):C.GC_1024,(2,2):C.GC_1030}) V_1124 = Vertex(name = 'V_1124', particles = [ P.t__tilde__, P.b, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3121,(1,0):C.GC_3183,(3,0):C.GC_3205,(0,3):C.GC_3193,(2,3):C.GC_3215,(1,1):C.GC_3182,(3,1):C.GC_3204,(0,2):C.GC_3194,(2,2):C.GC_3216}) V_1125 = Vertex(name = 'V_1125', particles = [ P.t__tilde__, P.b, P.b__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF1, L.FFFF10, L.FFFF12, L.FFFF2, L.FFFF3 ], couplings = {(1,4):C.GC_3139,(1,0):C.GC_3188,(3,0):C.GC_3210,(0,3):C.GC_3199,(2,3):C.GC_3221,(1,1):C.GC_3188,(3,1):C.GC_3210,(0,2):C.GC_3199,(2,2):C.GC_3221}) V_1126 = Vertex(name = 'V_1126', particles = [ P.e__plus__, P.e__minus__, P.u__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,8):C.GC_28,(0,11):C.GC_1367,(0,9):C.GC_1365,(0,10):C.GC_1365,(0,5):C.GC_1355,(0,1):C.GC_43,(0,2):C.GC_40,(0,3):C.GC_14,(0,7):C.GC_1364,(0,4):C.GC_1366,(0,6):C.GC_1366,(0,0):C.GC_1356}) V_1127 = Vertex(name = 'V_1127', particles = [ P.e__plus__, P.e__minus__, P.u__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,5):C.GC_29,(0,8):C.GC_1375,(0,6):C.GC_1374,(0,7):C.GC_1374,(0,2):C.GC_1360,(0,4):C.GC_1375,(0,1):C.GC_1374,(0,3):C.GC_1374,(0,0):C.GC_1360}) V_1128 = Vertex(name = 'V_1128', particles = [ P.e__plus__, P.e__minus__, P.c__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,8):C.GC_28,(0,11):C.GC_749,(0,9):C.GC_747,(0,10):C.GC_747,(0,5):C.GC_737,(0,1):C.GC_43,(0,2):C.GC_40,(0,3):C.GC_14,(0,7):C.GC_746,(0,4):C.GC_748,(0,6):C.GC_748,(0,0):C.GC_738}) V_1129 = Vertex(name = 'V_1129', particles = [ P.e__plus__, P.e__minus__, P.c__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,5):C.GC_29,(0,8):C.GC_757,(0,6):C.GC_756,(0,7):C.GC_756,(0,2):C.GC_742,(0,4):C.GC_757,(0,1):C.GC_756,(0,3):C.GC_756,(0,0):C.GC_742}) V_1130 = Vertex(name = 'V_1130', particles = [ P.e__plus__, P.e__minus__, P.t__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,8):C.GC_28,(0,11):C.GC_1070,(0,9):C.GC_1068,(0,10):C.GC_1068,(0,5):C.GC_1058,(0,1):C.GC_43,(0,2):C.GC_40,(0,3):C.GC_14,(0,7):C.GC_1067,(0,4):C.GC_1069,(0,6):C.GC_1069,(0,0):C.GC_1059}) V_1131 = Vertex(name = 'V_1131', particles = [ P.e__plus__, P.e__minus__, P.t__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,5):C.GC_29,(0,8):C.GC_1078,(0,6):C.GC_1077,(0,7):C.GC_1077,(0,2):C.GC_1063,(0,4):C.GC_1078,(0,1):C.GC_1077,(0,3):C.GC_1077,(0,0):C.GC_1063}) V_1132 = Vertex(name = 'V_1132', particles = [ P.mu__plus__, P.mu__minus__, P.u__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,8):C.GC_28,(0,11):C.GC_1394,(0,9):C.GC_1392,(0,10):C.GC_1392,(0,5):C.GC_1382,(0,1):C.GC_43,(0,2):C.GC_40,(0,3):C.GC_14,(0,7):C.GC_1391,(0,4):C.GC_1393,(0,6):C.GC_1393,(0,0):C.GC_1383}) V_1133 = Vertex(name = 'V_1133', particles = [ P.mu__plus__, P.mu__minus__, P.u__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,5):C.GC_29,(0,8):C.GC_1402,(0,6):C.GC_1401,(0,7):C.GC_1401,(0,2):C.GC_1387,(0,4):C.GC_1402,(0,1):C.GC_1401,(0,3):C.GC_1401,(0,0):C.GC_1387}) V_1134 = Vertex(name = 'V_1134', particles = [ P.mu__plus__, P.mu__minus__, P.c__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,8):C.GC_28,(0,11):C.GC_844,(0,9):C.GC_842,(0,10):C.GC_842,(0,5):C.GC_832,(0,1):C.GC_43,(0,2):C.GC_40,(0,3):C.GC_14,(0,7):C.GC_841,(0,4):C.GC_843,(0,6):C.GC_843,(0,0):C.GC_833}) V_1135 = Vertex(name = 'V_1135', particles = [ P.mu__plus__, P.mu__minus__, P.c__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,5):C.GC_29,(0,8):C.GC_852,(0,6):C.GC_851,(0,7):C.GC_851,(0,2):C.GC_837,(0,4):C.GC_852,(0,1):C.GC_851,(0,3):C.GC_851,(0,0):C.GC_837}) V_1136 = Vertex(name = 'V_1136', particles = [ P.mu__plus__, P.mu__minus__, P.t__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,8):C.GC_28,(0,11):C.GC_1097,(0,9):C.GC_1095,(0,10):C.GC_1095,(0,5):C.GC_1085,(0,1):C.GC_43,(0,2):C.GC_40,(0,3):C.GC_14,(0,7):C.GC_1094,(0,4):C.GC_1096,(0,6):C.GC_1096,(0,0):C.GC_1086}) V_1137 = Vertex(name = 'V_1137', particles = [ P.mu__plus__, P.mu__minus__, P.t__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,5):C.GC_29,(0,8):C.GC_1105,(0,6):C.GC_1104,(0,7):C.GC_1104,(0,2):C.GC_1090,(0,4):C.GC_1105,(0,1):C.GC_1104,(0,3):C.GC_1104,(0,0):C.GC_1090}) V_1138 = Vertex(name = 'V_1138', particles = [ P.ta__plus__, P.ta__minus__, P.u__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF6, L.FFFF7, L.FFFF8 ], couplings = {(0,11):C.GC_1446,(0,8):C.GC_28,(0,12):C.GC_1439,(0,9):C.GC_1437,(0,10):C.GC_1437,(0,5):C.GC_1427,(0,4):C.GC_1438,(0,6):C.GC_1438,(0,1):C.GC_43,(0,2):C.GC_40,(0,3):C.GC_14,(0,7):C.GC_1436,(0,0):C.GC_1428}) V_1139 = Vertex(name = 'V_1139', particles = [ P.ta__plus__, P.ta__minus__, P.u__tilde__, P.u ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF8 ], couplings = {(0,5):C.GC_29,(0,7):C.GC_1447,(0,6):C.GC_1446,(0,2):C.GC_1432,(0,1):C.GC_1446,(0,3):C.GC_1446,(0,4):C.GC_1447,(0,0):C.GC_1432}) V_1140 = Vertex(name = 'V_1140', particles = [ P.ta__plus__, P.ta__minus__, P.c__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,8):C.GC_28,(0,11):C.GC_1201,(0,9):C.GC_1199,(0,10):C.GC_1199,(0,5):C.GC_1189,(0,1):C.GC_43,(0,2):C.GC_40,(0,3):C.GC_14,(0,7):C.GC_1198,(0,4):C.GC_1200,(0,6):C.GC_1200,(0,0):C.GC_1190}) V_1141 = Vertex(name = 'V_1141', particles = [ P.ta__plus__, P.ta__minus__, P.c__tilde__, P.c ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,5):C.GC_29,(0,8):C.GC_1209,(0,6):C.GC_1208,(0,7):C.GC_1208,(0,2):C.GC_1194,(0,4):C.GC_1209,(0,1):C.GC_1208,(0,3):C.GC_1208,(0,0):C.GC_1194}) V_1142 = Vertex(name = 'V_1142', particles = [ P.ta__plus__, P.ta__minus__, P.t__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF13, L.FFFF17, L.FFFF18, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,8):C.GC_28,(0,11):C.GC_1246,(0,9):C.GC_1244,(0,10):C.GC_1244,(0,5):C.GC_1234,(0,1):C.GC_43,(0,2):C.GC_40,(0,3):C.GC_14,(0,7):C.GC_1243,(0,4):C.GC_1245,(0,6):C.GC_1245,(0,0):C.GC_1235}) V_1143 = Vertex(name = 'V_1143', particles = [ P.ta__plus__, P.ta__minus__, P.t__tilde__, P.t ], color = [ 'Identity(3,4)' ], lorentz = [ L.FFFF12, L.FFFF19, L.FFFF2, L.FFFF20, L.FFFF21, L.FFFF4, L.FFFF5, L.FFFF7, L.FFFF8 ], couplings = {(0,5):C.GC_29,(0,8):C.GC_1254,(0,6):C.GC_1253,(0,7):C.GC_1253,(0,2):C.GC_1239,(0,4):C.GC_1254,(0,1):C.GC_1253,(0,3):C.GC_1253,(0,0):C.GC_1239}) V_1144 = Vertex(name = 'V_1144', particles = [ P.u__tilde__, P.u, P.u__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF13, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF17, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,6):C.GC_44,(0,7):C.GC_44,(0,0):C.GC_50,(2,0):C.GC_51,(1,3):C.GC_50,(3,3):C.GC_51,(1,1):C.GC_50,(3,1):C.GC_51,(1,2):C.GC_58,(0,4):C.GC_50,(2,4):C.GC_51,(0,5):C.GC_58}) V_1145 = Vertex(name = 'V_1145', particles = [ P.u__tilde__, P.u, P.u__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF15, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,2):C.GC_45,(0,3):C.GC_45,(1,0):C.GC_59,(0,1):C.GC_59}) V_1146 = Vertex(name = 'V_1146', particles = [ P.u__tilde__, P.u, P.u__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_47}) V_1147 = Vertex(name = 'V_1147', particles = [ P.u__tilde__, P.u, P.u__tilde__, P.u ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_48,(0,1):C.GC_48}) V_1148 = Vertex(name = 'V_1148', particles = [ P.c__tilde__, P.u, P.u__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_44,(0,5):C.GC_45,(1,2):C.GC_50,(2,2):C.GC_51,(1,0):C.GC_50,(2,0):C.GC_51,(1,1):C.GC_58,(0,3):C.GC_59}) V_1149 = Vertex(name = 'V_1149', particles = [ P.c__tilde__, P.u, P.u__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_48}) V_1150 = Vertex(name = 'V_1150', particles = [ P.t__tilde__, P.u, P.u__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_44,(0,5):C.GC_45,(1,2):C.GC_50,(2,2):C.GC_51,(1,0):C.GC_50,(2,0):C.GC_51,(1,1):C.GC_58,(0,3):C.GC_59}) V_1151 = Vertex(name = 'V_1151', particles = [ P.t__tilde__, P.u, P.u__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_48}) V_1152 = Vertex(name = 'V_1152', particles = [ P.c__tilde__, P.c, P.c__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF13, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF17, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,6):C.GC_44,(0,7):C.GC_44,(0,0):C.GC_50,(2,0):C.GC_51,(1,3):C.GC_50,(3,3):C.GC_51,(1,1):C.GC_50,(3,1):C.GC_51,(1,2):C.GC_58,(0,4):C.GC_50,(2,4):C.GC_51,(0,5):C.GC_58}) V_1153 = Vertex(name = 'V_1153', particles = [ P.c__tilde__, P.c, P.c__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF15, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,2):C.GC_45,(0,3):C.GC_45,(1,0):C.GC_59,(0,1):C.GC_59}) V_1154 = Vertex(name = 'V_1154', particles = [ P.c__tilde__, P.c, P.c__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_47}) V_1155 = Vertex(name = 'V_1155', particles = [ P.c__tilde__, P.c, P.c__tilde__, P.c ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_48,(0,1):C.GC_48}) V_1156 = Vertex(name = 'V_1156', particles = [ P.t__tilde__, P.c, P.c__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,4):C.GC_44,(0,5):C.GC_45,(1,2):C.GC_50,(2,2):C.GC_51,(1,0):C.GC_50,(2,0):C.GC_51,(1,1):C.GC_58,(0,3):C.GC_59}) V_1157 = Vertex(name = 'V_1157', particles = [ P.t__tilde__, P.c, P.c__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_48}) V_1158 = Vertex(name = 'V_1158', particles = [ P.t__tilde__, P.t, P.t__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)', 'T(-1,2,1)*T(-1,4,3)', 'T(-1,2,3)*T(-1,4,1)' ], lorentz = [ L.FFFF13, L.FFFF14, L.FFFF15, L.FFFF16, L.FFFF17, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,6):C.GC_44,(0,7):C.GC_44,(0,0):C.GC_50,(2,0):C.GC_51,(1,3):C.GC_50,(3,3):C.GC_51,(1,1):C.GC_50,(3,1):C.GC_51,(1,2):C.GC_58,(0,4):C.GC_50,(2,4):C.GC_51,(0,5):C.GC_58}) V_1159 = Vertex(name = 'V_1159', particles = [ P.t__tilde__, P.t, P.t__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF15, L.FFFF18, L.FFFF3, L.FFFF4 ], couplings = {(1,2):C.GC_45,(0,3):C.GC_45,(1,0):C.GC_59,(0,1):C.GC_59}) V_1160 = Vertex(name = 'V_1160', particles = [ P.t__tilde__, P.t, P.t__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_47,(0,1):C.GC_47}) V_1161 = Vertex(name = 'V_1161', particles = [ P.t__tilde__, P.t, P.t__tilde__, P.t ], color = [ 'Identity(1,2)*Identity(3,4)', 'Identity(1,4)*Identity(2,3)' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(1,0):C.GC_48,(0,1):C.GC_48}) V_1162 = Vertex(name = 'V_1162', particles = [ P.e__plus__, P.e__minus__, P.ve__tilde__, P.ve ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_26,(0,0):C.GC_25}) V_1163 = Vertex(name = 'V_1163', particles = [ P.e__plus__, P.e__minus__, P.ve__tilde__, P.ve ], color = [ '1' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_27}) V_1164 = Vertex(name = 'V_1164', particles = [ P.e__plus__, P.e__minus__, P.vm__tilde__, P.vm ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_26,(0,0):C.GC_25}) V_1165 = Vertex(name = 'V_1165', particles = [ P.e__plus__, P.e__minus__, P.vt__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_26,(0,0):C.GC_25}) V_1166 = Vertex(name = 'V_1166', particles = [ P.mu__plus__, P.e__minus__, P.ve__tilde__, P.vm ], color = [ '1' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_27}) V_1167 = Vertex(name = 'V_1167', particles = [ P.ta__plus__, P.e__minus__, P.ve__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_27}) V_1168 = Vertex(name = 'V_1168', particles = [ P.e__plus__, P.mu__minus__, P.vm__tilde__, P.ve ], color = [ '1' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_27}) V_1169 = Vertex(name = 'V_1169', particles = [ P.mu__plus__, P.mu__minus__, P.ve__tilde__, P.ve ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_26,(0,0):C.GC_25}) V_1170 = Vertex(name = 'V_1170', particles = [ P.mu__plus__, P.mu__minus__, P.vm__tilde__, P.vm ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_26,(0,0):C.GC_25}) V_1171 = Vertex(name = 'V_1171', particles = [ P.mu__plus__, P.mu__minus__, P.vm__tilde__, P.vm ], color = [ '1' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_27}) V_1172 = Vertex(name = 'V_1172', particles = [ P.mu__plus__, P.mu__minus__, P.vt__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_26,(0,0):C.GC_25}) V_1173 = Vertex(name = 'V_1173', particles = [ P.ta__plus__, P.mu__minus__, P.vm__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_27}) V_1174 = Vertex(name = 'V_1174', particles = [ P.e__plus__, P.ta__minus__, P.vt__tilde__, P.ve ], color = [ '1' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_27}) V_1175 = Vertex(name = 'V_1175', particles = [ P.mu__plus__, P.ta__minus__, P.vt__tilde__, P.vm ], color = [ '1' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_27}) V_1176 = Vertex(name = 'V_1176', particles = [ P.ta__plus__, P.ta__minus__, P.ve__tilde__, P.ve ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_26,(0,0):C.GC_25}) V_1177 = Vertex(name = 'V_1177', particles = [ P.ta__plus__, P.ta__minus__, P.vm__tilde__, P.vm ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_26,(0,0):C.GC_25}) V_1178 = Vertex(name = 'V_1178', particles = [ P.ta__plus__, P.ta__minus__, P.vt__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_26,(0,0):C.GC_25}) V_1179 = Vertex(name = 'V_1179', particles = [ P.ta__plus__, P.ta__minus__, P.vt__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_27}) V_1180 = Vertex(name = 'V_1180', particles = [ P.ve__tilde__, P.ve, P.ve__tilde__, P.ve ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_26,(0,1):C.GC_26}) V_1181 = Vertex(name = 'V_1181', particles = [ P.ve__tilde__, P.ve, P.ve__tilde__, P.ve ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_27,(0,1):C.GC_27}) V_1182 = Vertex(name = 'V_1182', particles = [ P.vm__tilde__, P.ve, P.ve__tilde__, P.vm ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_26,(0,1):C.GC_27}) V_1183 = Vertex(name = 'V_1183', particles = [ P.vt__tilde__, P.ve, P.ve__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_26,(0,1):C.GC_27}) V_1184 = Vertex(name = 'V_1184', particles = [ P.vm__tilde__, P.vm, P.vm__tilde__, P.vm ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_26,(0,1):C.GC_26}) V_1185 = Vertex(name = 'V_1185', particles = [ P.vm__tilde__, P.vm, P.vm__tilde__, P.vm ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_27,(0,1):C.GC_27}) V_1186 = Vertex(name = 'V_1186', particles = [ P.vt__tilde__, P.vm, P.vm__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_26,(0,1):C.GC_27}) V_1187 = Vertex(name = 'V_1187', particles = [ P.vt__tilde__, P.vt, P.vt__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_26,(0,1):C.GC_26}) V_1188 = Vertex(name = 'V_1188', particles = [ P.vt__tilde__, P.vt, P.vt__tilde__, P.vt ], color = [ '1' ], lorentz = [ L.FFFF3, L.FFFF4 ], couplings = {(0,0):C.GC_27,(0,1):C.GC_27}) V_1189 = Vertex(name = 'V_1189', particles = [ P.u__tilde__, P.u, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_40}) V_1190 = Vertex(name = 'V_1190', particles = [ P.u__tilde__, P.u, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_30}) V_1191 = Vertex(name = 'V_1191', particles = [ P.u__tilde__, P.u, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_40}) V_1192 = Vertex(name = 'V_1192', particles = [ P.u__tilde__, P.u, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_30}) V_1193 = Vertex(name = 'V_1193', particles = [ P.u__tilde__, P.u, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_40}) V_1194 = Vertex(name = 'V_1194', particles = [ P.u__tilde__, P.u, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_30}) V_1195 = Vertex(name = 'V_1195', particles = [ P.c__tilde__, P.c, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_40}) V_1196 = Vertex(name = 'V_1196', particles = [ P.c__tilde__, P.c, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_30}) V_1197 = Vertex(name = 'V_1197', particles = [ P.c__tilde__, P.c, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_40}) V_1198 = Vertex(name = 'V_1198', particles = [ P.c__tilde__, P.c, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_30}) V_1199 = Vertex(name = 'V_1199', particles = [ P.c__tilde__, P.c, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_40}) V_1200 = Vertex(name = 'V_1200', particles = [ P.c__tilde__, P.c, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_30}) V_1201 = Vertex(name = 'V_1201', particles = [ P.t__tilde__, P.t, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_40}) V_1202 = Vertex(name = 'V_1202', particles = [ P.t__tilde__, P.t, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_30}) V_1203 = Vertex(name = 'V_1203', particles = [ P.t__tilde__, P.t, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_40}) V_1204 = Vertex(name = 'V_1204', particles = [ P.t__tilde__, P.t, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_30}) V_1205 = Vertex(name = 'V_1205', particles = [ P.t__tilde__, P.t, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_40}) V_1206 = Vertex(name = 'V_1206', particles = [ P.t__tilde__, P.t, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_30}) V_1207 = Vertex(name = 'V_1207', particles = [ P.u__tilde__, P.d, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_1454,(0,4):C.GC_1622,(0,2):C.GC_1621,(0,3):C.GC_1621,(0,0):C.GC_1515,(0,1):C.GC_1619}) V_1208 = Vertex(name = 'V_1208', particles = [ P.u__tilde__, P.d, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_1624,(0,2):C.GC_1623,(0,3):C.GC_1623,(0,0):C.GC_1516,(0,1):C.GC_1620}) V_1209 = Vertex(name = 'V_1209', particles = [ P.c__tilde__, P.d, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2075,(0,4):C.GC_2189,(0,2):C.GC_2188,(0,3):C.GC_2188,(0,0):C.GC_2192,(0,1):C.GC_2186}) V_1210 = Vertex(name = 'V_1210', particles = [ P.c__tilde__, P.d, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2191,(0,2):C.GC_2190,(0,3):C.GC_2190,(0,0):C.GC_2193,(0,1):C.GC_2187}) V_1211 = Vertex(name = 'V_1211', particles = [ P.t__tilde__, P.d, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2696,(0,4):C.GC_2839,(0,2):C.GC_2838,(0,3):C.GC_2838,(0,0):C.GC_2758,(0,1):C.GC_2836}) V_1212 = Vertex(name = 'V_1212', particles = [ P.t__tilde__, P.d, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2841,(0,2):C.GC_2840,(0,3):C.GC_2840,(0,0):C.GC_2759,(0,1):C.GC_2837}) V_1213 = Vertex(name = 'V_1213', particles = [ P.u__tilde__, P.d, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_1454,(0,4):C.GC_1628,(0,2):C.GC_1627,(0,3):C.GC_1627,(0,0):C.GC_1517,(0,1):C.GC_1625}) V_1214 = Vertex(name = 'V_1214', particles = [ P.u__tilde__, P.d, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_1630,(0,2):C.GC_1629,(0,3):C.GC_1629,(0,0):C.GC_1518,(0,1):C.GC_1626}) V_1215 = Vertex(name = 'V_1215', particles = [ P.c__tilde__, P.d, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2075,(0,4):C.GC_2197,(0,2):C.GC_2196,(0,3):C.GC_2196,(0,0):C.GC_2200,(0,1):C.GC_2194}) V_1216 = Vertex(name = 'V_1216', particles = [ P.c__tilde__, P.d, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2199,(0,2):C.GC_2198,(0,3):C.GC_2198,(0,0):C.GC_2201,(0,1):C.GC_2195}) V_1217 = Vertex(name = 'V_1217', particles = [ P.t__tilde__, P.d, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2696,(0,4):C.GC_2845,(0,2):C.GC_2844,(0,3):C.GC_2844,(0,0):C.GC_2760,(0,1):C.GC_2842}) V_1218 = Vertex(name = 'V_1218', particles = [ P.t__tilde__, P.d, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2847,(0,2):C.GC_2846,(0,3):C.GC_2846,(0,0):C.GC_2761,(0,1):C.GC_2843}) V_1219 = Vertex(name = 'V_1219', particles = [ P.u__tilde__, P.d, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_1454,(0,4):C.GC_1658,(0,2):C.GC_1657,(0,3):C.GC_1657,(0,0):C.GC_1543,(0,1):C.GC_1655}) V_1220 = Vertex(name = 'V_1220', particles = [ P.u__tilde__, P.d, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_1660,(0,2):C.GC_1659,(0,3):C.GC_1659,(0,0):C.GC_1544,(0,1):C.GC_1656}) V_1221 = Vertex(name = 'V_1221', particles = [ P.c__tilde__, P.d, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2075,(0,4):C.GC_2253,(0,2):C.GC_2252,(0,3):C.GC_2252,(0,0):C.GC_2256,(0,1):C.GC_2250}) V_1222 = Vertex(name = 'V_1222', particles = [ P.c__tilde__, P.d, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2255,(0,2):C.GC_2254,(0,3):C.GC_2254,(0,0):C.GC_2257,(0,1):C.GC_2251}) V_1223 = Vertex(name = 'V_1223', particles = [ P.t__tilde__, P.d, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2696,(0,4):C.GC_2877,(0,2):C.GC_2876,(0,3):C.GC_2876,(0,0):C.GC_2872,(0,1):C.GC_2874}) V_1224 = Vertex(name = 'V_1224', particles = [ P.t__tilde__, P.d, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2879,(0,2):C.GC_2878,(0,3):C.GC_2878,(0,0):C.GC_2873,(0,1):C.GC_2875}) V_1225 = Vertex(name = 'V_1225', particles = [ P.u__tilde__, P.s, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_1661,(0,4):C.GC_1803,(0,2):C.GC_1802,(0,3):C.GC_1802,(0,0):C.GC_1722,(0,1):C.GC_1800}) V_1226 = Vertex(name = 'V_1226', particles = [ P.u__tilde__, P.s, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_1805,(0,2):C.GC_1804,(0,3):C.GC_1804,(0,0):C.GC_1723,(0,1):C.GC_1801}) V_1227 = Vertex(name = 'V_1227', particles = [ P.c__tilde__, P.s, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2282,(0,4):C.GC_2370,(0,2):C.GC_2369,(0,3):C.GC_2369,(0,0):C.GC_2429,(0,1):C.GC_2367}) V_1228 = Vertex(name = 'V_1228', particles = [ P.c__tilde__, P.s, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2372,(0,2):C.GC_2371,(0,3):C.GC_2371,(0,0):C.GC_2430,(0,1):C.GC_2368}) V_1229 = Vertex(name = 'V_1229', particles = [ P.t__tilde__, P.s, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2904,(0,4):C.GC_3021,(0,2):C.GC_3020,(0,3):C.GC_3020,(0,0):C.GC_2966,(0,1):C.GC_3018}) V_1230 = Vertex(name = 'V_1230', particles = [ P.t__tilde__, P.s, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_3023,(0,2):C.GC_3022,(0,3):C.GC_3022,(0,0):C.GC_2967,(0,1):C.GC_3019}) V_1231 = Vertex(name = 'V_1231', particles = [ P.u__tilde__, P.s, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_1661,(0,4):C.GC_1809,(0,2):C.GC_1808,(0,3):C.GC_1808,(0,0):C.GC_1724,(0,1):C.GC_1806}) V_1232 = Vertex(name = 'V_1232', particles = [ P.u__tilde__, P.s, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_1811,(0,2):C.GC_1810,(0,3):C.GC_1810,(0,0):C.GC_1725,(0,1):C.GC_1807}) V_1233 = Vertex(name = 'V_1233', particles = [ P.c__tilde__, P.s, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2282,(0,4):C.GC_2376,(0,2):C.GC_2375,(0,3):C.GC_2375,(0,0):C.GC_2431,(0,1):C.GC_2373}) V_1234 = Vertex(name = 'V_1234', particles = [ P.c__tilde__, P.s, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2378,(0,2):C.GC_2377,(0,3):C.GC_2377,(0,0):C.GC_2432,(0,1):C.GC_2374}) V_1235 = Vertex(name = 'V_1235', particles = [ P.t__tilde__, P.s, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2904,(0,4):C.GC_3027,(0,2):C.GC_3026,(0,3):C.GC_3026,(0,0):C.GC_2968,(0,1):C.GC_3024}) V_1236 = Vertex(name = 'V_1236', particles = [ P.t__tilde__, P.s, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_3029,(0,2):C.GC_3028,(0,3):C.GC_3028,(0,0):C.GC_2969,(0,1):C.GC_3025}) V_1237 = Vertex(name = 'V_1237', particles = [ P.u__tilde__, P.s, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_1661,(0,4):C.GC_1865,(0,2):C.GC_1864,(0,3):C.GC_1864,(0,0):C.GC_1750,(0,1):C.GC_1862}) V_1238 = Vertex(name = 'V_1238', particles = [ P.u__tilde__, P.s, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_1867,(0,2):C.GC_1866,(0,3):C.GC_1866,(0,0):C.GC_1751,(0,1):C.GC_1863}) V_1239 = Vertex(name = 'V_1239', particles = [ P.c__tilde__, P.s, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2282,(0,4):C.GC_2460,(0,2):C.GC_2459,(0,3):C.GC_2459,(0,0):C.GC_2463,(0,1):C.GC_2457}) V_1240 = Vertex(name = 'V_1240', particles = [ P.c__tilde__, P.s, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2462,(0,2):C.GC_2461,(0,3):C.GC_2461,(0,0):C.GC_2464,(0,1):C.GC_2458}) V_1241 = Vertex(name = 'V_1241', particles = [ P.t__tilde__, P.s, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2904,(0,4):C.GC_3085,(0,2):C.GC_3084,(0,3):C.GC_3084,(0,0):C.GC_3080,(0,1):C.GC_3082}) V_1242 = Vertex(name = 'V_1242', particles = [ P.t__tilde__, P.s, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_3087,(0,2):C.GC_3086,(0,3):C.GC_3086,(0,0):C.GC_3081,(0,1):C.GC_3083}) V_1243 = Vertex(name = 'V_1243', particles = [ P.u__tilde__, P.b, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_1868,(0,4):C.GC_2036,(0,2):C.GC_2035,(0,3):C.GC_2035,(0,0):C.GC_1929,(0,1):C.GC_2033}) V_1244 = Vertex(name = 'V_1244', particles = [ P.u__tilde__, P.b, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2038,(0,2):C.GC_2037,(0,3):C.GC_2037,(0,0):C.GC_1930,(0,1):C.GC_2034}) V_1245 = Vertex(name = 'V_1245', particles = [ P.c__tilde__, P.b, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2489,(0,4):C.GC_2605,(0,2):C.GC_2604,(0,3):C.GC_2604,(0,0):C.GC_2600,(0,1):C.GC_2602}) V_1246 = Vertex(name = 'V_1246', particles = [ P.c__tilde__, P.b, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2607,(0,2):C.GC_2606,(0,3):C.GC_2606,(0,0):C.GC_2601,(0,1):C.GC_2603}) V_1247 = Vertex(name = 'V_1247', particles = [ P.t__tilde__, P.b, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_3112,(0,4):C.GC_3255,(0,2):C.GC_3254,(0,3):C.GC_3254,(0,0):C.GC_3174,(0,1):C.GC_3252}) V_1248 = Vertex(name = 'V_1248', particles = [ P.t__tilde__, P.b, P.e__plus__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_3257,(0,2):C.GC_3256,(0,3):C.GC_3256,(0,0):C.GC_3175,(0,1):C.GC_3253}) V_1249 = Vertex(name = 'V_1249', particles = [ P.u__tilde__, P.b, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_1868,(0,4):C.GC_2042,(0,2):C.GC_2041,(0,3):C.GC_2041,(0,0):C.GC_1931,(0,1):C.GC_2039}) V_1250 = Vertex(name = 'V_1250', particles = [ P.u__tilde__, P.b, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2044,(0,2):C.GC_2043,(0,3):C.GC_2043,(0,0):C.GC_1932,(0,1):C.GC_2040}) V_1251 = Vertex(name = 'V_1251', particles = [ P.c__tilde__, P.b, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2489,(0,4):C.GC_2613,(0,2):C.GC_2612,(0,3):C.GC_2612,(0,0):C.GC_2608,(0,1):C.GC_2610}) V_1252 = Vertex(name = 'V_1252', particles = [ P.c__tilde__, P.b, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2615,(0,2):C.GC_2614,(0,3):C.GC_2614,(0,0):C.GC_2609,(0,1):C.GC_2611}) V_1253 = Vertex(name = 'V_1253', particles = [ P.t__tilde__, P.b, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_3112,(0,4):C.GC_3261,(0,2):C.GC_3260,(0,3):C.GC_3260,(0,0):C.GC_3176,(0,1):C.GC_3258}) V_1254 = Vertex(name = 'V_1254', particles = [ P.t__tilde__, P.b, P.mu__plus__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_3263,(0,2):C.GC_3262,(0,3):C.GC_3262,(0,0):C.GC_3177,(0,1):C.GC_3259}) V_1255 = Vertex(name = 'V_1255', particles = [ P.u__tilde__, P.b, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_1868,(0,4):C.GC_2072,(0,2):C.GC_2071,(0,3):C.GC_2071,(0,0):C.GC_1957,(0,1):C.GC_2069}) V_1256 = Vertex(name = 'V_1256', particles = [ P.u__tilde__, P.b, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2074,(0,2):C.GC_2073,(0,3):C.GC_2073,(0,0):C.GC_1958,(0,1):C.GC_2070}) V_1257 = Vertex(name = 'V_1257', particles = [ P.c__tilde__, P.b, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_2489,(0,4):C.GC_2669,(0,2):C.GC_2668,(0,3):C.GC_2668,(0,0):C.GC_2664,(0,1):C.GC_2666}) V_1258 = Vertex(name = 'V_1258', particles = [ P.c__tilde__, P.b, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_2671,(0,2):C.GC_2670,(0,3):C.GC_2670,(0,0):C.GC_2665,(0,1):C.GC_2667}) V_1259 = Vertex(name = 'V_1259', particles = [ P.t__tilde__, P.b, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21, L.FFFF4 ], couplings = {(0,5):C.GC_3112,(0,4):C.GC_3293,(0,2):C.GC_3292,(0,3):C.GC_3292,(0,0):C.GC_3288,(0,1):C.GC_3290}) V_1260 = Vertex(name = 'V_1260', particles = [ P.t__tilde__, P.b, P.ta__plus__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF11, L.FFFF12, L.FFFF19, L.FFFF20, L.FFFF21 ], couplings = {(0,4):C.GC_3295,(0,2):C.GC_3294,(0,3):C.GC_3294,(0,0):C.GC_3289,(0,1):C.GC_3291}) V_1261 = Vertex(name = 'V_1261', particles = [ P.d__tilde__, P.d, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_24}) V_1262 = Vertex(name = 'V_1262', particles = [ P.d__tilde__, P.d, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_29}) V_1263 = Vertex(name = 'V_1263', particles = [ P.d__tilde__, P.d, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_24}) V_1264 = Vertex(name = 'V_1264', particles = [ P.d__tilde__, P.d, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_29}) V_1265 = Vertex(name = 'V_1265', particles = [ P.d__tilde__, P.d, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_24}) V_1266 = Vertex(name = 'V_1266', particles = [ P.d__tilde__, P.d, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_29}) V_1267 = Vertex(name = 'V_1267', particles = [ P.s__tilde__, P.s, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_24}) V_1268 = Vertex(name = 'V_1268', particles = [ P.s__tilde__, P.s, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_29}) V_1269 = Vertex(name = 'V_1269', particles = [ P.s__tilde__, P.s, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_24}) V_1270 = Vertex(name = 'V_1270', particles = [ P.s__tilde__, P.s, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_29}) V_1271 = Vertex(name = 'V_1271', particles = [ P.s__tilde__, P.s, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_24}) V_1272 = Vertex(name = 'V_1272', particles = [ P.s__tilde__, P.s, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_29}) V_1273 = Vertex(name = 'V_1273', particles = [ P.b__tilde__, P.b, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_24}) V_1274 = Vertex(name = 'V_1274', particles = [ P.b__tilde__, P.b, P.ve__tilde__, P.ve ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_29}) V_1275 = Vertex(name = 'V_1275', particles = [ P.b__tilde__, P.b, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_24}) V_1276 = Vertex(name = 'V_1276', particles = [ P.b__tilde__, P.b, P.vm__tilde__, P.vm ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_29}) V_1277 = Vertex(name = 'V_1277', particles = [ P.b__tilde__, P.b, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF13, L.FFFF4 ], couplings = {(0,1):C.GC_28,(0,0):C.GC_24}) V_1278 = Vertex(name = 'V_1278', particles = [ P.b__tilde__, P.b, P.vt__tilde__, P.vt ], color = [ 'Identity(1,2)' ], lorentz = [ L.FFFF4 ], couplings = {(0,0):C.GC_29}) V_1279 = Vertex(name = 'V_1279', particles = [ P.a, P.a, P.H1 ], color = [ '1' ], lorentz = [ L.VVS6 ], couplings = {(0,0):C.GC_242}) V_1280 = Vertex(name = 'V_1280', particles = [ P.g, P.g, P.H1 ], color = [ 'Identity(1,2)' ], lorentz = [ L.VVS6, L.VVS7, L.VVS8, L.VVS9 ], couplings = {(0,0):C.GC_243,(0,2):C.GC_256,(0,1):C.GC_252,(0,3):C.GC_247}) V_1281 = Vertex(name = 'V_1281', particles = [ P.a, P.Z, P.H1 ], color = [ '1' ], lorentz = [ L.VVS6 ], couplings = {(0,0):C.GC_246}) V_1282 = Vertex(name = 'V_1282', particles = [ P.a, P.Z1, P.H ], color = [ '1' ], lorentz = [ L.VVS6 ], couplings = {(0,0):C.GC_246}) V_1283 = Vertex(name = 'V_1283', particles = [ P.a, P.Z1, P.H1 ], color = [ '1' ], lorentz = [ L.VVS6 ], couplings = {(0,0):C.GC_260}) V_1284 = Vertex(name = 'V_1284', particles = [ P.g, P.g, P.g, P.H1 ], color = [ 'f(1,2,3)' ], lorentz = [ L.VVVS10, L.VVVS6, L.VVVS7, L.VVVS8, L.VVVS9 ], couplings = {(0,3):C.GC_248,(0,0):C.GC_257,(0,4):C.GC_253,(0,2):C.GC_250,(0,1):C.GC_244}) V_1285 = Vertex(name = 'V_1285', particles = [ P.g, P.g, P.g, P.g, P.H1 ], color = [ 'f(-1,1,2)*f(-1,3,4)', 'f(-1,1,3)*f(-1,2,4)', 'f(-1,1,4)*f(-1,2,3)' ], lorentz = [ L.VVVVS1, L.VVVVS10, L.VVVVS11, L.VVVVS12, L.VVVVS13, L.VVVVS14, L.VVVVS15, L.VVVVS16, L.VVVVS18, L.VVVVS2, L.VVVVS20, L.VVVVS3, L.VVVVS5, L.VVVVS7, L.VVVVS8 ], couplings = {(2,5):C.GC_249,(2,8):C.GC_258,(1,4):C.GC_249,(1,10):C.GC_258,(2,6):C.GC_255,(0,11):C.GC_251,(0,12):C.GC_259,(1,7):C.GC_255,(0,3):C.GC_254,(1,2):C.GC_251,(2,1):C.GC_251,(0,9):C.GC_249,(1,13):C.GC_245,(0,0):C.GC_245,(2,14):C.GC_245})
import tensorflow as tf import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt from plotting import newfig, savefig import matplotlib.gridspec as gridspec import time from utilities import neural_net, fwd_gradients,\ tf_session, mean_squared_error, relative_error class HiddenPathways(object): # Initialize the class def __init__(self, t_data, S_data, t_eqns, layers): self.D = S_data.shape[1] self.t_min = t_data.min(0) self.t_max = t_data.max(0) self.S_scale = tf.Variable(S_data.std(0), dtype=tf.float32, trainable=False) # data on all the species (only some are used as input) self.t_data, self.S_data = t_data, S_data self.t_eqns = t_eqns # layers self.layers = layers # self.J0 = tf.Variable(2.5, dtype=tf.float32, trainable=False) # self.k1 = tf.Variable(100.0, dtype=tf.float32, trainable=False) # self.k2 = tf.Variable(6.0, dtype=tf.float32, trainable=False) # self.k3 = tf.Variable(16.0, dtype=tf.float32, trainable=False) # self.k4 = tf.Variable(100.0, dtype=tf.float32, trainable=False) # self.k5 = tf.Variable(1.28, dtype=tf.float32, trainable=False) # self.k6 = tf.Variable(12.0, dtype=tf.float32, trainable=False) # self.k = tf.Variable(1.8, dtype=tf.float32, trainable=False) # self.kappa = tf.Variable(13.0, dtype=tf.float32, trainable=False) # self.q = tf.Variable(4.0, dtype=tf.float32, trainable=False) # self.K1 = tf.Variable(0.52, dtype=tf.float32, trainable=False) # self.psi = tf.Variable(0.1, dtype=tf.float32, trainable=False) # self.N = tf.Variable(1.0, dtype=tf.float32, trainable=False) # self.A = tf.Variable(4.0, dtype=tf.float32, trainable=False) self.logJ0 = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logk1 = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logk2 = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logk3 = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logk4 = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logk5 = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logk6 = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logk = tf.Variable(1.0, dtype=tf.float32, trainable=True) self.logkappa = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logq = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logK1 = tf.Variable(1.0, dtype=tf.float32, trainable=True) self.logpsi = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logN = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.logA = tf.Variable(0.0, dtype=tf.float32, trainable=True) self.var_list_eqns = [self.logJ0, self.logk1, self.logk2, self.logk3, self.logk4, self.logk5, self.logk6, self.logk, self.logkappa, self.logq, self.logK1, self.logpsi, self.logN, self.logA] self.J0 = tf.exp(self.logJ0) self.k1 = tf.exp(self.logk1) self.k2 = tf.exp(self.logk2) self.k3 = tf.exp(self.logk3) self.k4 = tf.exp(self.logk4) self.k5 = tf.exp(self.logk5) self.k6 = tf.exp(self.logk6) self.k = tf.exp(self.logk) self.kappa = tf.exp(self.logkappa) self.q = tf.exp(self.logq) self.K1 = tf.exp(self.logK1) self.psi = tf.exp(self.logpsi) self.N = tf.exp(self.logN) self.A = tf.exp(self.logA) # placeholders for data self.t_data_tf = tf.placeholder(tf.float32, shape=[None, 1]) self.S_data_tf = tf.placeholder(tf.float32, shape=[None, self.D]) self.t_eqns_tf = tf.placeholder(tf.float32, shape=[None, 1]) self.learning_rate = tf.placeholder(tf.float32, shape=[]) # physics uninformed neural networks self.net_sysbio = neural_net(layers=self.layers) self.H_data = 2.0*(self.t_data_tf - self.t_min)/(self.t_max - self.t_min) - 1.0 self.S_data_pred = self.S_data[0,:] + self.S_scale*(self.H_data+1.0)*self.net_sysbio(self.H_data) # physics informed neural networks self.H_eqns = 2.0*(self.t_eqns_tf - self.t_min)/(self.t_max - self.t_min) - 1.0 self.S_eqns_pred = self.S_data[0,:] + self.S_scale*(self.H_eqns+1.0)*self.net_sysbio(self.H_eqns) self.E_eqns_pred = self.SysODE(self.S_eqns_pred, self.t_eqns_tf) # self.S_scale = 0.9*self.S_scale + 0.1*tf.math.reduce_std(self.S_eqns_pred, 0) # scale_list = tf.unstack(self.S_scale) # scale_list[4:6] = self.S_data.std(0)[4:6] # self.S_scale = tf.stack(scale_list) # loss self.loss_data = mean_squared_error(self.S_data_tf[:,4:6]/self.S_scale[4:6], self.S_data_pred[:,4:6]/self.S_scale[4:6]) self.loss_eqns = mean_squared_error(0.0, self.E_eqns_pred/self.S_scale) self.loss_auxl = mean_squared_error(self.S_data_tf[-1,:]/self.S_scale[:], self.S_data_pred[-1,:]/self.S_scale[:]) self.loss = 0.95*self.loss_data + 0.05*self.loss_eqns + 0.05*self.loss_auxl # optimizers self.optimizer = tf.train.AdamOptimizer(learning_rate=self.learning_rate) self.optimizer_para = tf.train.AdamOptimizer(learning_rate=0.001) self.train_op = self.optimizer.minimize(self.loss, var_list=[self.net_sysbio.weights, self.net_sysbio.biases, self.net_sysbio.gammas]) self.trainpara_op = self.optimizer_para.minimize(self.loss, var_list=self.var_list_eqns) self.sess = tf_session() def SysODE(self, S, t): F1 = self.J0 - (self.k1*S[:,0:1]*S[:,5:6])/(1+(S[:,5:6]/self.K1)**self.q) F2 = 2*(self.k1*S[:,0:1]*S[:,5:6])/(1+(S[:,5:6]/self.K1)**self.q) - self.k2*S[:,1:2]*(self.N-S[:,4:5]) - self.k6*S[:,1:2]*S[:,4:5] F3 = self.k2*S[:,1:2]*(self.N-S[:,4:5]) - self.k3*S[:,2:3]*(self.A-S[:,5:6]) F4 = self.k3*S[:,2:3]*(self.A-S[:,5:6]) - self.k4*S[:,3:4]*S[:,4:5] - self.kappa*(S[:,3:4]-S[:,6:7]) F5 = self.k2*S[:,1:2]*(self.N-S[:,4:5]) - self.k4*S[:,3:4]*S[:,4:5] - self.k6*S[:,1:2]*S[:,4:5] F6 = -2*(self.k1*S[:,0:1]*S[:,5:6])/(1+(S[:,5:6]/self.K1)**self.q) + 2*self.k3*S[:,2:3]*(self.A-S[:,5:6]) - self.k5*S[:,5:6] F7 = self.psi*self.kappa*(S[:,3:4]-S[:,6:7]) - self.k*S[:,6:7] F = tf.concat([F1, F2, F3, F4, F5, F6, F7], 1) S_t = fwd_gradients(S, t) E = S_t - F return E def train(self, num_epochs, batch_size, learning_rate): N_data = self.t_data.shape[0] N_eqns = self.t_eqns.shape[0] for epoch in range(num_epochs): start_time = time.time() for it in range(N_eqns//batch_size): idx_data = np.concatenate([np.array([0]), np.random.choice(np.arange(1, N_data-1), min(batch_size, N_data)-2), np.array([N_data-1])]) idx_eqns = np.random.choice(N_eqns, batch_size) t_data_batch, S_data_batch = self.t_data[idx_data,:], self.S_data[idx_data,:] t_eqns_batch = self.t_eqns[idx_eqns,:] tf_dict = {self.t_data_tf: t_data_batch, self.S_data_tf: S_data_batch, self.t_eqns_tf: t_eqns_batch, self.learning_rate: learning_rate} self.sess.run([self.train_op, self.trainpara_op], tf_dict) # Print if it % 10 == 0: elapsed = time.time() - start_time [loss_data_value, loss_eqns_value, loss_auxl_value, learning_rate_value] = self.sess.run([self.loss_data, self.loss_eqns, self.loss_auxl, self.learning_rate], tf_dict) print('Epoch: %d, It: %d, Loss Data: %.3e, Loss Eqns: %.3e, Loss Aux: %.3e, Time: %.3f, Learning Rate: %.1e' %(epoch, it, loss_data_value, loss_eqns_value, loss_auxl_value, elapsed, learning_rate_value)) start_time = time.time() def predict(self, t_star): tf_dict = {self.t_eqns_tf: t_star} S_star, S_scale = self.sess.run([self.S_eqns_pred, self.S_scale], tf_dict) return S_star, S_scale if __name__ == "__main__": layers = [1] + 7*[7*40] + [7] # function that returns dx/dt def f(x, t): # x is 7 x 1 J0 = 2.5 k1 = 100.0 k2 = 6.0 k3 = 16.0 k4 = 100.0 k5 = 1.28 k6 = 12.0 k = 1.8 kappa = 13.0 q = 4.0 K1 = 0.52 psi = 0.1 N = 1.0 A = 4.0 f1 = J0 - (k1*x[0]*x[5])/(1+(x[5]/K1)**q) f2 = 2*(k1*x[0]*x[5])/(1+(x[5]/K1)**q) - k2*x[1]*(N-x[4]) - k6*x[1]*x[4] f3 = k2*x[1]*(N-x[4]) - k3*x[2]*(A-x[5]) f4 = k3*x[2]*(A-x[5]) - k4*x[3]*x[4] - kappa*(x[3]-x[6]) f5 = k2*x[1]*(N-x[4]) - k4*x[3]*x[4] - k6*x[1]*x[4] f6 = -2*(k1*x[0]*x[5])/(1+(x[5]/K1)**q) + 2*k3*x[2]*(A-x[5]) - k5*x[5] f7 = psi*kappa*(x[3]-x[6]) - k*x[6] f = np.array([f1, f2, f3, f4, f5, f6, f7]) return f def addNoise(S, noise): std = noise*S.std(0) S[1:,:] += np.random.normal(0.0, std, (S.shape[0]-1, S.shape[1])) return S # time points t_star = np.arange(0, 10, 0.005) N = t_star.shape[0] N_eqns = N N_data = N // 4 S1 = np.random.uniform(0.15, 1.60, 1) S2 = np.random.uniform(0.19, 2.16, 1) S3 = np.random.uniform(0.04, 0.20, 1) S4 = np.random.uniform(0.10, 0.35, 1) S5 = np.random.uniform(0.08, 0.30, 1) S6 = np.random.uniform(0.14, 2.67, 1) S7 = np.random.uniform(0.05, 0.10, 1) # initial condition # x0 = np.array([S1, S2, S3, S4, S5, S6, S7]).flatten() x0 = np.array([0.50144272, 1.95478666, 0.19788759, 0.14769148, 0.16059078, 0.16127341, 0.06404702]).flatten() # solve ODE S_star = odeint(f, x0, t_star) noise = 0.1 t_train = t_star[:,None] S_train = addNoise(S_star, noise) N0 = 0 N1 = N - 1 idx_data = np.concatenate([np.array([N0]), np.random.choice(np.arange(1, N-1), size=N_data, replace=False), np.array([N-1]), np.array([N1])]) idx_eqns = np.concatenate([np.array([N0]), np.random.choice(np.arange(1, N-1), size=N_eqns-2, replace=False), np.array([N-1])]) model = HiddenPathways(t_train[idx_data], S_train[idx_data,:], t_train[idx_eqns], layers) model.train(num_epochs=20000, batch_size=N_eqns, learning_rate=1e-3) model.train(num_epochs=40000, batch_size=N_eqns, learning_rate=1e-4) model.train(num_epochs=20000, batch_size=N_eqns, learning_rate=1e-5) S_pred, S_pred_std = model.predict(t_star[:,None]) ####### Plotting ################## fig, ax = newfig(3.0, 0.3) gs0 = gridspec.GridSpec(1, 2) gs0.update(top=0.95, bottom=0.1, left=0.1, right=0.95, hspace=0.5, wspace=0.3) ax = plt.subplot(gs0[0:1, 0:1]) ax.plot(t_star,S_star[:,4],'C1',linewidth=2,label='input data') ax.scatter(t_star[idx_data],S_star[idx_data,4],marker='o',s=50,label='sampled input') ax.set_xlabel('$t\ (min)$', fontsize=18) ax.set_ylabel('$S_5\ (mM)$', fontsize=18) ax.legend(fontsize='large') ax = plt.subplot(gs0[0:1, 1:2]) ax.plot(t_star,S_star[:,5],'C1',linewidth=2) ax.scatter(t_star[idx_data],S_star[idx_data,5],marker='o',s=50) ax.set_xlabel('$t\ (min)$', fontsize=18) ax.set_ylabel('$S_6\ (mM)$', fontsize=18) #################################### fig, ax = newfig(3.0, 0.4) gs1 = gridspec.GridSpec(1, 3) gs1.update(top=0.95, bottom=0.15, left=0.1, right=0.95, hspace=0.3, wspace=0.3) ax = plt.subplot(gs1[0:1, 0:1]) ax.plot(t_star,S_star[:,0],'C1',linewidth=2,label='exact') ax.plot(t_star,S_pred[:,0],'g-.',linewidth=3,label='learned') ax.set_xlabel('$t\ (min)$', fontsize=18) ax.set_ylabel('$S_1\ (mM)$', fontsize=18) ax.legend(fontsize='large') ax = plt.subplot(gs1[0:1, 1:2]) ax.plot(t_star,S_star[:,1],'C1',linewidth=2) ax.plot(t_star,S_pred[:,1],'g-.',linewidth=3) ax.set_xlabel('$t\ (min)$', fontsize=18) ax.set_ylabel('$S_2\ (mM)$', fontsize=18) ax = plt.subplot(gs1[0:1, 2:3]) ax.plot(t_star,S_star[:,2],'C1',linewidth=2) ax.plot(t_star,S_pred[:,2],'g-.',linewidth=3) ax.set_xlabel('$t\ (min)$', fontsize=18) ax.set_ylabel('$S_3\ (mM)$', fontsize=18) fig, ax = newfig(3.5, 0.4) gs2 = gridspec.GridSpec(1, 3) gs2.update(top=0.95, bottom=0.15, left=0.1, right=0.95, hspace=0.3, wspace=0.3) ax = plt.subplot(gs2[0:1, 0:1]) ax.plot(t_star,S_star[:,3],'C1',linewidth=2) ax.plot(t_star,S_pred[:,3],'g-.',linewidth=3) ax.set_xlabel('$t\ (min)$', fontsize=18) ax.set_ylabel('$S_4\ (mM)$', fontsize=18) ax = plt.subplot(gs2[0:1, 1:2]) ax.scatter(t_star[idx_data],S_star[idx_data,4],marker='o',c='C1',s=30) ax.plot(t_star,S_pred[:,4],'g-.',linewidth=3) ax.set_xlabel('$t\ (min)$', fontsize=18) ax.set_ylabel('$S_5\ (mM)$', fontsize=18) ax = plt.subplot(gs2[0:1, 2:3]) ax.scatter(t_star[idx_data],S_star[idx_data,5],marker='o',c='C1',s=30) ax.plot(t_star,S_pred[:,5],'g--',linewidth=3) ax.set_xlabel('$t\ (min)$', fontsize=18) ax.set_ylabel('$S_6\ (mM)$', fontsize=18) fig, ax = newfig(1, 1.5) gs3 = gridspec.GridSpec(1, 1) gs3.update(top=0.95, bottom=0.15, left=0.15, right=0.95, hspace=0.3, wspace=0.3) ax = plt.subplot(gs3[0:1, 0:1]) ax.plot(t_star,S_star[:,6],'C1',linewidth=2) ax.plot(t_star,S_pred[:,6],'g-.',linewidth=3) ax.set_xlabel('$t\ (min)$', fontsize=18) ax.set_ylabel('$S_7\ (mM)$', fontsize=18) print('J0 = %.6f' % ( model.sess.run(model.J0) ) ) print('k1 = %.6f' % ( model.sess.run(model.k1) ) ) print('k2 = %.6f' % ( model.sess.run(model.k2) ) ) print('k3 = %.6f' % ( model.sess.run(model.k3) ) ) print('k4 = %.6f' % ( model.sess.run(model.k4) ) ) print('k5 = %.6f' % ( model.sess.run(model.k5) ) ) print('k6 = %.6f' % ( model.sess.run(model.k6) ) ) print('k = %.6f' % ( model.sess.run(model.k) ) ) print('kappa = %.6f' % ( model.sess.run(model.kappa) ) ) print('q = %.6f' % ( model.sess.run(model.q) ) ) print('K1 = %.6f' % ( model.sess.run(model.K1) ) ) print('psi = %.6f' % ( model.sess.run(model.psi) ) ) print('N = %.6f' % ( model.sess.run(model.N) ) ) print('A = %.6f' % ( model.sess.run(model.A) ) ) # savefig('./figures/Glycolytic', crop = False)
"""Module for tracing equilibria in mixture games""" import numpy as np from scipy import integrate from gameanalysis import regret from gameanalysis import rsgame from gameanalysis import utils # FIXME Doesn't matter if F is singular, it matters if any solution exists. If # F is nonsingular, then a solution definitely exists, otherwise, it might, and # we can use np.linalg.lstsq to find it. We need to text that we've found a # solution afterwards. This should be done with np.linalg.norm < # np.finfo(dtype).eps * num_strats def trace_equilibrium( # pylint: disable=too-many-locals game0, game1, peq, eqm, target, *, regret_thresh=1e-3, max_step=0.1, singular=1e-7, **ivp_args ): """Try to trace an equilibrium out to target Takes two games, a fraction that they're mixed (`peq`), and an equilibrium of the mixed game (`eqm`). It then attempts to find the equilibrium at the `target` mixture. It may not reach target, but will return as far as it got. The return value is two parallel arrays for the probabilities with known equilibria and the equilibria. Parameters ---------- game0 : RsGame The first game that's merged. Represents the payoffs when `peq` is 0. game1 : RsGame The second game that's merged. Represents the payoffs when `peq` is 1. peq : float The amount that the two games are merged such that `eqm` is an equilibrium. Must be in [0, 1]. eqm : ndarray An equilibrium when `game0` and `game1` are merged a `peq` fraction. target : float The desired mixture probability to have an equilibrium at. regret_thresh : float, optional The amount of gain from deviating to a strategy outside support can have before it's considered a beneficial deviation and the tracing stops. This should be larger than zero as most equilibria are approximate due to floating point precision. max_step : float, optional The maximum step to take in t when evaluating. singular : float, optional An absolute determinant below this value is considered singular. Occasionally the derivative doesn't exist, and this is one way in which that manifests. This values regulate when ODE solving terminates due to a singular matrix. ivp_args Any remaining keyword arguments are passed to the ivp solver. """ egame = rsgame.empty_copy(game0) eqm = np.asarray(eqm, float) utils.check(egame.is_mixture(eqm), "equilibrium wasn't a valid mixture") utils.check( regret.mixture_regret(rsgame.mix(game0, game1, peq), eqm) <= regret_thresh + 1e-7, "equilibrium didn't have regret below threshold", ) ivp_args.update(max_step=max_step) # It may be handy to have the derivative of this so that the ode solver can # be more efficient, except that computing the derivative w.r.t. t requires # the hessian of the deviation payoffs, which would be complicated and so # far has no use anywhere else. def ode(prob, mix_neg): """ODE function for solve_ivp""" div = np.zeros(egame.num_strats) mix = egame.trim_mixture_support(mix_neg, thresh=0) supp = mix > 0 rgame = egame.restrict(supp) dev1, jac1 = game0.deviation_payoffs(mix, jacobian=True) dev2, jac2 = game1.deviation_payoffs(mix, jacobian=True) gvals = (dev1 - dev2)[supp] fvecs = ((1 - prob) * jac1 + prob * jac2)[supp][:, supp] gvec = np.concatenate( [ np.delete(np.diff(gvals), rgame.role_starts[1:] - 1), np.zeros(egame.num_roles), ] ) fmat = np.concatenate( [ np.delete(np.diff(fvecs, 1, 0), rgame.role_starts[1:] - 1, 0), np.eye(egame.num_roles).repeat(rgame.num_role_strats, 1), ] ) if singular < np.abs(np.linalg.det(fmat)): div[supp] = np.linalg.solve(fmat, gvec) return div def below_regret_thresh(prob, mix_neg): """Event for regret going above threshold""" mix = egame.trim_mixture_support(mix_neg, thresh=0) reg = regret.mixture_regret(rsgame.mix(game0, game1, prob), mix) return reg - regret_thresh below_regret_thresh.terminal = True below_regret_thresh.direction = 1 def singular_jacobian(prob, mix_neg): """Event for when jacobian is singular""" mix = egame.trim_mixture_support(mix_neg, thresh=0) supp = mix > 0 rgame = egame.restrict(supp) _, jac1 = game0.deviation_payoffs(mix, jacobian=True) _, jac2 = game1.deviation_payoffs(mix, jacobian=True) fvecs = ((1 - prob) * jac1 + prob * jac2)[supp][:, supp] fmat = np.concatenate( [ np.delete(np.diff(fvecs, 1, 0), rgame.role_starts[1:] - 1, 0), np.eye(egame.num_roles).repeat(rgame.num_role_strats, 1), ] ) return np.abs(np.linalg.det(fmat)) - singular singular_jacobian.terminal = True singular_jacobian.direction = -1 events = [below_regret_thresh, singular_jacobian] # This is to scope the index def create_support_loss(ind): """Create support loss for every ind""" def support_loss(_, mix): """Support loss event""" return mix[ind] support_loss.direction = -1 return support_loss for strat in range(egame.num_strats): events.append(create_support_loss(strat)) with np.errstate(divide="ignore"): res = integrate.solve_ivp(ode, [peq, target], eqm, events=events, **ivp_args) return res.t, egame.trim_mixture_support(res.y.T, thresh=0) def trace_interpolate( game0, game1, peqs, eqa, targets, **kwargs ): # pylint: disable=too-many-locals """Get an equilibrium at a specific time Parameters ---------- game0 : RsGame The game to get data from when the mixture probability is 0. game1 : RsGame The game to get data from when the mixture probability is 1. peqs : [float] A parallel list of probabilities for each equilibria in a continuous trace. eqa : [eqm] A parallel list of equilibria for each probability representing continuous equilibria for prob mixture games. targets : [float] The probabilities to compute an equilibria at. kwargs : options The same options as `trace_equilibrium`. """ peqs = np.asarray(peqs, float) eqa = np.asarray(eqa, float) targets = np.asarray(targets, float) # Make everything sorted if np.all(np.diff(peqs) <= 0): peqs = peqs[::-1] eqa = eqa[::-1] order = np.argsort(targets) targets = targets[order] utils.check(np.all(np.diff(peqs) >= 0), "trace probabilities must be sorted") utils.check( peqs[0] <= targets[0] and targets[-1] <= peqs[-1], "targets must be internal to trace", ) result = np.empty((targets.size, game0.num_strats)) scan = zip(utils.subsequences(peqs), utils.subsequences(eqa)) (pi1, pi2), (eqm1, eqm2) = next(scan) for target, i in zip(targets, order): while target > pi2: (pi1, pi2), (eqm1, eqm2) = next(scan) (*_, pt1), ( *_, eqt1, ) = trace_equilibrium( # pylint: disable=too-many-star-expressions game0, game1, pi1, eqm1, target, **kwargs ) (*_, pt2), ( *_, eqt2, ) = trace_equilibrium( # pylint: disable=too-many-star-expressions game0, game1, pi2, eqm2, target, **kwargs ) if np.isclose(pt1, target) and np.isclose(pt2, target): mixgame = rsgame.mix(game0, game1, target) _, _, result[i] = min( (regret.mixture_regret(mixgame, eqt1), 0, eqt1), (regret.mixture_regret(mixgame, eqt2), 1, eqt2), ) elif np.isclose(pt1, target): result[i] = eqt1 elif np.isclose(pt2, target): result[i] = eqt2 else: # pragma: no cover raise ValueError("ode solving failed to reach prob") return result
# 2016-17 By Tropicalrambler GPL V3.0 License #!/usr/bin/env python # ^^^^^^^^^^^^^^^^^^^ World famous shebang line! # TESTED! 18-DEC-2016 ON TSC TPP-442 Pro, WORKS GREAT! ###### DEPENDENCIES!! Requires pip, reportlab, pybarcode, babel # CODETAGS from PEP -0350 #https://www.python.org/dev/peps/pep-0350/#general-syntax # TODO: Informal tasks/features that are pending completion. # FIXME: Areas of problematic or ugly code needing refactoring or cleanup. # BUG: Reported defects tracked in bug database. # NOBUG: Will Not Be Fixed : Problems that are well-known but will never be addressed due to design problems or domain limitations. # REQ: Satisfactions of specific, formal requirements. # RFE: Roadmap items not yet implemented. # IDEA: Possible RFE candidates, but less formal than RFE. # ???: Misunderstood details. # !!!: In need of immediate attention. # HACK: Temporary code to force inflexible functionality, or simply a test change, or workaround a known problem. # PORT: Workarounds specific to OS, Python version, etc. # CAVEAT: Implementation details/gotchas that stand out as non-intuitive. # NOTE: Sections where a code reviewer found something that needs discussion or further investigation. # FAQ: Interesting areas that require external explanation. # GLOSS: Definitions for project glossary. # SEE: Pointers to other code, web link, etc. # TODOC: Areas of code that still need to be documented. # CRED: Accreditations for external provision of enlightenment. # STAT: File-level statistical indicator of maturity of this file. # RVD: File-level indicator that review was conducted. ####################################################################################### # # 1. Import modules # ####################################################################################### # 1.1 Python default modules csv, sys, random, string, os import os, sys, locale, datetime, time, subprocess, random, string, csv from Tkinter import * import tkFileDialog # 1.2 Dependent modules _ must ensure that you install these beforehand! # 1.2.1 pyBarcode. INSTALL BY RUNNING IN CLI: # sudo pip install barcode import barcode # 1.2.2 Reportlab modules # sudo pip install pybarcode # 1.2.2.1 Reportlab Graphics # from reportlab.graphics.barcode import code39, code128, code93, qr, usps # Constructor formulas are located here: reportlab.graphics.barcode.eanbc.py from reportlab.graphics.barcode import eanbc from reportlab.graphics.shapes import Drawing from reportlab.graphics import renderPDF # To Render the PDF # 1.2.2.2 Reportlab lib from reportlab.lib.pagesizes import letter from reportlab.lib.units import mm # Converts mm to points. from reportlab.lib import colors # Color management from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_LEFT, TA_CENTER # 1.2.2.3 Reportlab pdfgen PDF Generator from reportlab.pdfgen import canvas # 1.2.2.4 Reportlab pdfmetric, TTFont (to enable your own font) FIXME # Functions calling these are not working FIXME from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont # 1.2.2.5 platypus from reportlab.platypus import Paragraph # Paragraph style from reportlab # 1.3 Babel modules # sudo pip install babel from babel import Locale from babel.dates import UTC, format_date, format_datetime, format_time, get_timezone from babel.numbers import format_number, format_decimal, format_percent # 1.4 HTMLParser https://docs.python.org/2/library/htmlparser.html from HTMLParser import HTMLParser ####################################################################################### # # 2. File Opening and Formatting variables # ####################################################################################### # 2.1 Variables of file and data ot open fileName_w_ext = "ProductionPlanningTool.csv" accessModeUniv_nl = "rU" accessMode_W = "w" accessMode_WB = "wb" dot_pdf = ".pdf" # 2.2 Register a csv Dialect (can be changed to suit specific csv files) csv.register_dialect( 'mydialect', delimiter = ',', quotechar = '"', doublequote = True, skipinitialspace = True, lineterminator = '\r\n', quoting = csv.QUOTE_MINIMAL) # 2.3 strip filename of extension and store it in a variable fileName_wo_ext = os.path.splitext(os.path.basename(fileName_w_ext))[0] fileName_PDF_w_ext = fileName_wo_ext + dot_pdf # 2.3 Formatting Variables, fonts, locale settings, clear command line #locale.setlocale(locale.LC_ALL, 'en_US') # see python doc 22.2 internationalization guate = Locale('es', 'GT') nl = "\n" dot = "." space = " " colon = ":" dash = "-" # 2.5 Tildes unicode http://www.fileformat.info/info/unicode/char/00f3/index.htm a_acute_unicode = b'\xC3\xA1' e_acute_unicode = b'\xC3\xA9' i_acute_unicode = b'\xC3\xAD' o_acute_unicode = b'\xC3\xB3' u_acute_unicode = b'\xC3\xBA' n_tilde_unicode = b'\xC3\xB1' per_unicode = b'\x25' registered_unicode = b'\xc2\xae' copyright_unicode = b'\xc2\xa9' # 2.6 decoded unicode a_tilde_utf = a_acute_unicode.decode('utf8') e_tilde_utf = e_acute_unicode.decode('utf8') i_tilde_utf = i_acute_unicode.decode('utf8') o_tilde_utf = o_acute_unicode.decode('utf8') u_tilde_utf = u_acute_unicode.decode('utf8') n_enie_utf = n_tilde_unicode.decode('utf8') percent_utf = per_unicode.decode('utf8') registered_utf = registered_unicode.decode('utf8') copyright_utf = copyright_unicode.decode('utf8') html_par_open = "<p>" html_par_close = "</p>" html_br = "<br>" html_div_open = "<div>" html_div_close = "</div>" html_span_open = "<span>" html_span_close = "</span>" font_path = "fonts/" load_font_roboto = font_path + "roboto/Roboto-Regular.ttf" image_logo_filename = './assets/fogliasana-logo-peq-etiq-cod-barras-negro.jpg' clear_command_line = os.system('cls' if os.name == 'nt' else 'clear') clear_command_line ####################################################################################### # # 3. Page size / label size / margins # ####################################################################################### # 3.1 GENERAL USER MODIFIABLE VARIABLES. # These variables represent the most important properties of the barcode. # We begin with the page or label size in millimeters. #-------------------------------------------------------------------------------------- # IMPORTANT NOTE ABOUT LABEL PRINTING!!! # Label printers use the x axis as the width, same here. # As a general rule, the widest part of the label will be also the x axis. # Do not alter the orientation aspects of labels when printing, print as portrait! # FIXME configure a 105mm x 51mm label height: 51mm, width: 105mm label_height_mm = 38 # default = 38 label_width_mm = 50 # default = 51 lft_mgn = 3 #Left margin in mm (helps to wrap paragraph lines) rgt_mgn = 3 #Right margin in mm (helps to wrap paragraph lines) ####################################################################################### # # 4. Fixed Variables for labels (Days until expiration, field text, etc.) # ####################################################################################### #No extra spaces, the string concatenators will handle that. Just the data. #test_bar_code = "1234567800069" #test_prod_desc = "Pillow Case Large" #test_prod_weight = "20" #test_prod_unit = "Oz." dest_filename = "barcode-labels" line3_produced_date_text = "Harvested:" line4_expiration_date_text = "Expires:" days_to_expiration = 7 currency_symb = "Q" test_price = 30.05 #Price not larger than Q99,000 below_barcode_string = 'Hidrop' + o_tilde_utf + 'nic. Sustainable. Pure' ####################################################################################### # # 5. Colors # ####################################################################################### # 5.1 Desired colors in RGB value o to 255 rgb_pantone_3005_c_blue = (0,117,201) rgb_pantone_360_c_green = (108,192,74) rgb_pantone_000_c_white = (255,255,255) rgb_pantone_black = (0,0,0) # 5.2 Desired colors in HEX hex_pantone_3005_c_blue = "#0075c9" hex_pantone_360_c_green = "#6cc04a" hex_pantone_000_c_white = "#ffffff" hex_pantone_black = "#000000" # 5.3 Convert colors to intensity mode 0- 100% rgb_pantone_black_int_red = rgb_pantone_black[0]/float(255) rgb_pantone_black_int_grn = rgb_pantone_black[1]/float(255) rgb_pantone_black_int_blu = rgb_pantone_black[2]/float(255) rgb_pantone_3005_c_blue_int_red = rgb_pantone_3005_c_blue[0]/float(255) rgb_pantone_3005_c_blue_int_grn = rgb_pantone_3005_c_blue[1]/float(255) rgb_pantone_3005_c_blue_int_blu = rgb_pantone_3005_c_blue[2]/float(255) # 5.3 bar color assignment bar_red = rgb_pantone_black_int_red bar_grn = rgb_pantone_black_int_grn bar_blu = rgb_pantone_black_int_blu # 5.4 text color assignment txt_red = rgb_pantone_black_int_red txt_grn = rgb_pantone_black_int_grn txt_blu = rgb_pantone_black_int_blu # 5.5 bar_stroke_color assignment stk_red = rgb_pantone_black_int_red stk_grn = rgb_pantone_black_int_grn stk_blu = rgb_pantone_black_int_blu ####################################################################################### # # 6. Barcode Style parameters # ####################################################################################### # 6.1 FONTS Available fonts for the barcode human readable text # ,Mac expert, standard, symbol, winansi, zapfdingbats, courier, courier bold corierboldoblique courieroblique, helvetica bold, helvetica bold oblique, symbol, times bold times bold italic times italic timesroman zapfdingbats. barcode_font_name = 'Helvetica' # String. default 'Helvetica' barcode_font_size = 11 # Number. mm. default = 10 # 6.2 Bars # 6.2.1 Color. method. default = colors.black, or colors.Color(R,G,B,1), or colors. bar_fill_color = colors.Color(bar_red,bar_grn,bar_blu,alpha=1) # 6.2.2 Height, Width, stroke width bar_height_mm = 15 # Number. default = 13 bar_width_mm = .41 # Number. default = .41 bar_stroke_width = .05 # Number. default = .05 # 6.2.3 Stroke Color. method. default = colors.black bar_stroke_color = colors.Color(stk_red,stk_grn,stk_blu,alpha=1) # 6.2.4 Human Readable text color. method. default = colors.black barcode_text_color = colors.Color(txt_red,txt_grn,txt_blu,alpha=1) # 6.2.5 Human Readable text switch ON/OFF (TRUE/FALSE) barcode_human_readable = 'TRUE' # Boolean. Default 'TRUE' # 6.3 Code NOT WORKING! barcode_use_quiet_space = 0 # Number integer. 0 = no, 1 = YES. Default = 1 left_quiet_space = 1 # Number integer default = 1 DO NOT CHANGE!! right_quiet_space = 1 # Number integer default = 1 DO NOT CHANGE!! """ #Check this one out! http://pydoc.net/Python/reportlab/3.3.0/reportlab.graphics.barcode/ """ # 6.4 Defining the quiet space value if barcode_use_quiet_space == 'yes': quiet_space = 'TRUE' ####################################################################################### # # 7. Paragraph style parameters for Product Name # ####################################################################################### prod_style_name = 'FSBlue' #name your style: 'Stylename' prod_font_name ='Helvetica' # default = 'Helvetica' prod_font_size = 12 # default = 12 prod_leading = 12 # default = 12 prod_left_indent = 0 # default = 0 prod_right_indent = 0 # default = 0 prod_first_line_indent = 0 # default = 0 prod_alignment = TA_LEFT # default = TA_LEFT prod_space_before = 0 # default = 0 prod_space_after = 0 # default = 0 prod_bullet_font_name = 'Times-Roman' # default = 'Times-Roman' prod_bullet_font_size = 10 # default = 10 prod_bullet_indent = 0 # default = 0 prod_text_color = hex_pantone_black # default = hex_pantone_3005_c_blue prod_back_color = None # default = None prod_word_wrap = None # default = None prod_border_width = 0 # default = 0 prod_border_padding = 0 # default = 0 prod_border_color = None # default = None prod_border_radius = None # default = None prod_allow_widows = 1 # default = 1 prod_allow_orphans = 0 # default = 0 prod_text_transform = None # 'uppercase' | 'lowercase' | None prod_end_dots = None # default = None prod_split_long_words = 1 # default = 1 ####################################################################################### # # 8. Paragraph style parameters for line below product name # ####################################################################################### line3_style_name = 'line3' #name your style: 'Stylename' line3_font_name ='Helvetica' # default = 'Helvetica' line3_font_size = 12 # default = 12 line3_leading = 12 # default = 12 line3_left_indent = 0 # default = 0 line3_right_indent = 0 # default = 0 line3_first_line_indent = 0 # default = 0 line3_alignment = TA_LEFT # default = TA_LEFT line3_space_before = 0 # default = 0 line3_space_after = 0 # default = 0 line3_bullet_font_name = 'Times-Roman' # default = 'Times-Roman' line3_bullet_font_size = 10 # default = 10 line3_bullet_indent = 0 # default = 0 line3_text_color = hex_pantone_black # default = hex_pantone_3005_c_blue line3_back_color = None # default = None line3_word_wrap = None # default = None line3_border_width = 0 # default = 0 line3_border_padding = 0 # default = 0 line3_border_color = None # default = None line3_border_radius = None # default = None line3_allow_widows = 1 # default = 1 line3_allow_orphans = 0 # default = 0 line3_text_transform = None # 'uppercase' | 'lowercase' | None line3_end_dots = None # default = None line3_split_long_words = 1 # default = 1 ####################################################################################### # # 9. Paragraph style parameters for second line below product name # ####################################################################################### line4_style_name = 'line4' #name your style: 'Stylename' line4_font_name ='Helvetica' # default = 'Helvetica' line4_font_size = 12 # default = 12 line4_leading = 12 # default = 12 line4_left_indent = 0 # default = 0 line4_right_indent = 0 # default = 0 line4_first_line_indent = 0 # default = 0 line4_alignment = TA_LEFT # default = TA_LEFT line4_space_before = 0 # default = 0 line4_space_after = 0 # default = 0 line4_bullet_font_name = 'Times-Roman' # default = 'Times-Roman' line4_bullet_font_size = 10 # default = 10 line4_bullet_indent = 0 # default = 0 line4_text_color = hex_pantone_black # default = hex_pantone_3005_c_blue line4_back_color = None # default = None line4_word_wrap = None # default = None line4_border_width = 0 # default = 0 line4_border_padding = 0 # default = 0 line4_border_color = None # default = None line4_border_radius = None # default = None line4_allow_widows = 1 # default = 1 line4_allow_orphans = 0 # default = 0 line4_text_transform = None # 'uppercase' | 'lowercase' | None line4_end_dots = None # default = None line4_split_long_words = 1 # default = 1 ####################################################################################### # # 10. Paragraph style parameters for line below product name # ####################################################################################### below_barcode_style_name = 'below-barcode' # name your style: 'Stylename' below_barcode_font_name ='Helvetica-bold' # default = 'Helvetica' below_barcode_font_size = 8 # default = 12 below_barcode_leading = 12 # default = 12 below_barcode_left_indent = 0 # default = 0 below_barcode_right_indent = 0 # default = 0 below_barcode_first_line_indent = 0 # default = 0 below_barcode_alignment = TA_LEFT # default = TA_LEFT below_barcode_space_before = 0 # default = 0 below_barcode_space_after = 0 # default = 0 below_barcode_bullet_font_name = 'Times-Roman' # default = 'Times-Roman' below_barcode_bullet_font_size = 10 # default = 10 below_barcode_bullet_indent = 0 # default = 0 below_barcode_text_color = hex_pantone_black # default = hex_pantone_3005_c_blue below_barcode_back_color = None # default = None below_barcode_word_wrap = None # default = None below_barcode_border_width = 0 # default = 0 below_barcode_border_padding = 0 # default = 0 below_barcode_border_color = None # default = None below_barcode_border_radius = None # default = None below_barcode_allow_widows = 1 # default = 1 below_barcode_allow_orphans = 0 # default = 0 below_barcode_text_transform = None # 'uppercase' | 'lowercase' | None below_barcode_end_dots = None # default = None below_barcode_split_long_words = 0 # default = 1 ####################################################################################### # # 11. Move everything by x or y mm # ####################################################################################### # 7.1 This moves everything by the specified mm. Useful for adjustments on the fly! # x axis + moves to right, - moves to left # y axis + moves up, - moves down move_x_mm = 0 move_y_mm = 0 ####################################################################################### # # 12. Rotate everything 90 deg to the right, upside down, 90 to the left TODO: Pending! # ####################################################################################### ####################################################################################### # # 13. Positions of elements on page # ####################################################################################### # 13.1 Element Individual Starting Positions # Elements must be placed, measuring from bottom left of label. # The general structure is # lINE 1= Product name and weight # LINE 2= Product name and wight continued # LINE 3= Produced: (date of production) # LINE 4= Expires: (date of expiration) # BARCODE = EAN-13 Barcode # LINE 5 = Price # TODO: If nothing specified, an IF function should default to CENTERING EVERYTHING # In relation to the chosen page size below # with DEFAULTS! For quick and easy setup. # 13.2 Product Text position prod_x_pos_mm = 1 # 51mm x 38mm default = 3 prod_y_pos_mm = 30 # 51mm x 38mm default = 30 # 13.3 "Date of production" line_3_x_pos_mm = 1 # 51mm x 38mm default = 3 line_3_y_pos_mm = 25 # 51mm x 38mm default = 25 # 13.4 "Expiration date" #This line is set at 12.4mm from x origin to align the ":" for easier reading. line_4_x_pos_mm = 10.4 # 51mm x 38mm default = 12.4 line_4_y_pos_mm = 21 # 51mm x 38mm default = 21 # 13.5 Barcode position barcode_x_pos_mm = 5 # 51mm x 38mm default = 7 barcode_y_pos_mm = 5 # 51mm x 38mm default = 5 # 13.6 Usually the price or another description goes here below_barcode_x_pos_mm = 3 # 51mm x 38mm default = 19 for centered price below_barcode_y_pos_mm = .5 # 51mm x 38mm default = 1 # 13.7 a Small number that returns the label group amount. # If you print 40 labels for a particular code, you can serialize it # for ease of counting. label_series_x_pos_mm = 0 # 51mm x 38mm default = 0 label_series_y_pos_mm = 0 # 51mm x 38mm default = 0 # 13.8 logo position image_logo_x_pos_mm = 16 # 51mm x 38mm default = 0 image_logo_y_pos_mm = 30 # 51mm x 38mm default = 0 image_logo_height_mm = 5 # 51mm x 38mm default = 5 ####################################################################################### # # 9. Element Wrappers. in mm. Creates a "virtual box" so that text doesn't flow out # ####################################################################################### #line_1_2_x_wrap_mm = label_width_mm-lft_mgn-rgt_mgn #line_1_2_y_wrap_mm = label_height_mm-bar_height_mm prod_x_wrap_mm = label_width_mm-lft_mgn-rgt_mgn prod_y_wrap_mm = label_height_mm-bar_height_mm #Create a wrapper for line 3, so text cuts off rather than intrude elsewhere line_3_x_wrap_mm = label_width_mm-lft_mgn-rgt_mgn line_3_y_wrap_mm = label_height_mm-bar_height_mm #Create a wrapper for line 4, so text cuts off rather than intrude elsewhere line_4_x_wrap_mm = label_width_mm-lft_mgn-rgt_mgn line_4_y_wrap_mm = label_height_mm-bar_height_mm #Create a wrapper for line 4, so text cuts off rather than intrude elsewhere below_barcode_x_wrap_mm = label_width_mm-lft_mgn-rgt_mgn below_barcode_y_wrap_mm = label_height_mm-bar_height_mm #Create a wrapper for label series, so text cuts off rather than intrude elsewhere label_series_x_wrap_mm = label_width_mm-lft_mgn-rgt_mgn label_series_y_wrap_mm = label_height_mm-bar_height_mm ####################################################################################### # # 9A. Program variables that involve flow control CAREFUL! # ####################################################################################### # 2.4 THE VALID PREFIX. If you change this, no barcodes will be printed! # This prefix must be the one issued by GS1 or prefix issuing authority in your locality. valid_gs1_prefix = "74011688" # 2.5 Search string used right before product name # PLEASE NOTE: Label must be an Item in ERPNext, part of the Bill of Materials of the sales item, and the name must beign with this string, otherwise, the label will not be counted. desc_search_string = "Etiqueta Normal" desc_ending_html = html_par_close # Empty list that will contain the key,value pairs of Barcode and product, to dump into # the PDF creation function. all_unique_labels_lst = [] ####################################################################################### # # 10. date calculations (default date is today) # ####################################################################################### # 10.1 Date calculation and formatting. # default= today, or can be specified date(2016, 14, 11) production_date = datetime.date.today() production_date_print = format_date(production_date,"dd.LLLyyyy" ,locale='es_GT') # 10.2 Expiration date calculation and formatting #Calculates from the production date stated above. expiration_date = production_date + datetime.timedelta(days=days_to_expiration) expiration_date_print = format_date(expiration_date,"dd.LLLyyyy" ,locale='es_GT') # 10.3 Destination Filename Variable that includes dates file_datetime = format_datetime(datetime.datetime.now(), "yyyy-MM-dd-kk-mm-ss", locale='es_GT') date_time_fileName_PDF_w_ext = file_datetime + dash + dest_filename + dot_pdf ####################################################################################### # # 11. Currency formatting # ####################################################################################### #2.3 Using python string formatting #test_price_str = str("%0.2f" % test_price) # no commas # below format with commas and two decimal points. #test_format_price = locale.format("%0.2f",test_price, grouping=True) format_price_print = format_decimal(test_price, format='#,##0.##;-#', locale='es_GT') ###################################################### # # 12. mm to point converter # ###################################################### """ For our label, the position must be specified in points. Above the user enters the values in mm, and these will convert from mm to points. The move_x_mm and move_y_mm will shift the position of all the items in the label together, when specified by the user. """ prod_x_pos = (prod_x_pos_mm+move_x_mm)*mm #10 prod_y_pos = (prod_y_pos_mm+move_y_mm)*mm #95 line_3_x_pos = (line_3_x_pos_mm+move_x_mm)*mm #10 line_3_y_pos = (line_3_y_pos_mm+move_y_mm)*mm #75 line_4_x_pos = (line_4_x_pos_mm+move_x_mm)*mm #10 line_4_y_pos = (line_4_y_pos_mm+move_y_mm)*mm #65 barcode_x_pos = (barcode_x_pos_mm+move_x_mm)*mm #10 barcode_y_pos = (barcode_y_pos_mm+move_y_mm)*mm #95 bar_width = bar_width_mm*mm bar_height = bar_height_mm*mm below_barcode_x_pos = (below_barcode_x_pos_mm+move_x_mm)*mm below_barcode_y_pos = (below_barcode_y_pos_mm+move_y_mm)*mm label_series_x_pos = (label_series_x_pos_mm+move_x_mm)*mm label_series_y_pos = (label_series_y_pos_mm+move_y_mm)*mm image_logo_x_pos = (image_logo_x_pos_mm+move_x_mm)*mm image_logo_y_pos = (image_logo_y_pos_mm+move_y_mm)*mm prod_x_wrap = (prod_x_wrap_mm+move_x_mm)*mm prod_y_wrap = (prod_y_wrap_mm+move_y_mm)*mm line_3_x_wrap = (line_3_x_wrap_mm+move_x_mm)*mm line_3_y_wrap = (line_3_y_wrap_mm+move_y_mm)*mm line_4_x_wrap = (line_4_x_wrap_mm+move_x_mm)*mm line_4_y_wrap = (line_4_y_wrap_mm+move_y_mm)*mm below_barcode_x_wrap = (below_barcode_x_wrap_mm+move_x_mm)*mm below_barcode_y_wrap = (below_barcode_y_wrap_mm+move_y_mm)*mm label_series_x_wrap = (label_series_x_wrap_mm+move_x_mm)*mm label_series_y_wrap = (label_series_y_wrap_mm+move_y_mm)*mm image_logo_height = (image_logo_height_mm+move_y_mm)*mm ###################################################### # # 12.B Concatenating the text strings # ###################################################### #2.3 Concatenating the Strings required by the label. line_3_text = line3_produced_date_text + production_date_print line_4_text = line4_expiration_date_text + expiration_date_print below_barcode_text = below_barcode_string #currency_symb + format_price_print ###################################################### # # 12.C Creating Application class for TkInter window usage. PENDING! NOT FUNCTIONAL YET. Will probably not be used, since it will be all used with ERPNext. #TODO: Adjust window properly. ###################################################### class BarcodeLabelGen_old: def __init__(self, master): frame = Frame(master) frame.pack() self.file_select = Entry(master) self.file_select.pack(side=LEFT) self.file_select.delete(0,END) self.file_select.insert(0,fileName_w_ext) self.button = Button( frame, text="SALIR", fg="red", command=frame.quit) self.button.pack(side=LEFT) self.hi_there = Button(frame, text="Abrir Archivo .csv", command=self.say_hi) self.hi_there.pack(side=LEFT) def say_hi(self): print "Aqui cargaremos el archivo!" class BarcodeLabelGen(Frame): def __init__(self, parent): Frame.__init__(self, parent) self.parent = parent self.button = Button(parent, text="CERRAR", fg="red", command=parent.quit) self.button.pack(side=LEFT) self.initUI() def initUI(self): self.parent.title("Etiquetas PDF") self.pack(fill=BOTH, expand=1) menubar = Menu(self.parent) self.parent.config(menu=menubar) fileMenu = Menu(menubar) fileMenu.add_command(label="Abrir", command=self.onOpen) menubar.add_cascade(label="Archivo", menu=fileMenu) self.txt = Text(self) self.txt.pack(fill=BOTH, expand=1) def onOpen(self): ftypes = [('Comma Separated Values', '*.csv'), ('All files', '*')] dlg = tkFileDialog.Open(self, filetypes = ftypes) fl = dlg.show() if fl != '': text = self.readFile(fl) self.txt.insert(END, text) def readFile(self, filename): f = open(filename, "r") text = f.read() return text ####################################################################################### # # 13. BEGIN DEFINE LABEL CREATION FUNCTION TODO: Create two types of labels. # ####################################################################################### def create51mmx38mmlabels(): ################################################################################### # # 13.1 Create a drawing object to contain everything # ################################################################################### """ Create a PDFCanvas object where we will deposit all the elements of the PDF. drawing object, and then add the barcode to the drawing. Add styles to platypus style Then using renderPDF, you place the drawing on the PDF. Finally, you save the file. """ PDFcanvas = canvas.Canvas(date_time_fileName_PDF_w_ext) PDFcanvas.setPageSize((label_width_mm*mm, label_height_mm*mm)) ################################################################################### # # 13.2 Apply paragraph styles for entire document # ################################################################################### styles = getSampleStyleSheet() styles.add(ParagraphStyle(name=prod_style_name, fontName=prod_font_name, fontSize=prod_font_size, leading=prod_leading, leftIndent=prod_left_indent, rightIndent=prod_right_indent, firstLineIndent=prod_first_line_indent, alignment=prod_alignment, spaceBefore=prod_space_before, spaceAfter=prod_space_after, bulletFontName=prod_bullet_font_name, bulletFontSize=prod_bullet_font_size, bulletIndent=prod_bullet_indent, textColor=prod_text_color, backColor=prod_back_color, wordWrap=prod_word_wrap, borderWidth=prod_border_width, borderPadding=prod_border_padding, borderColor=prod_border_color, borderRadius=prod_border_radius, allowWidows=prod_allow_widows, allowOrphans=prod_allow_orphans, textTransform=prod_text_transform, endDots=prod_end_dots, splitLongWords=prod_split_long_words)) styles.add(ParagraphStyle(name=line3_style_name, fontName=line3_font_name, fontSize=line3_font_size, leading=line3_leading, leftIndent=line3_left_indent, rightIndent=line3_right_indent, firstLineIndent=line3_first_line_indent, alignment=line3_alignment, spaceBefore=line3_space_before, spaceAfter=line3_space_after, bulletFontName=line3_bullet_font_name, bulletFontSize=line3_bullet_font_size, bulletIndent=line3_bullet_indent, textColor=line3_text_color, backColor=line3_back_color, wordWrap=line3_word_wrap, borderWidth=line3_border_width, borderPadding=line3_border_padding, borderColor=line3_border_color, borderRadius=line3_border_radius, allowWidows=line3_allow_widows, allowOrphans=line3_allow_orphans, textTransform=line3_text_transform, endDots=line3_end_dots, splitLongWords=line3_split_long_words)) styles.add(ParagraphStyle(name=line4_style_name, fontName=line4_font_name, fontSize=line4_font_size, leading=line4_leading, leftIndent=line4_left_indent, rightIndent=line4_right_indent, firstLineIndent=line4_first_line_indent, alignment=line4_alignment, spaceBefore=line4_space_before, spaceAfter=line4_space_after, bulletFontName=line4_bullet_font_name, bulletFontSize=line4_bullet_font_size, bulletIndent=line4_bullet_indent, textColor=line4_text_color, backColor=line4_back_color, wordWrap=line4_word_wrap, borderWidth=line4_border_width, borderPadding=line4_border_padding, borderColor=line4_border_color, borderRadius=line4_border_radius, allowWidows=line4_allow_widows, allowOrphans=line4_allow_orphans, textTransform=line4_text_transform, endDots=line4_end_dots, splitLongWords=line4_split_long_words)) styles.add(ParagraphStyle(name=below_barcode_style_name, fontName=below_barcode_font_name, fontSize=below_barcode_font_size, leading=below_barcode_leading, leftIndent=below_barcode_left_indent, rightIndent=below_barcode_right_indent, firstLineIndent=below_barcode_first_line_indent, alignment=below_barcode_alignment, spaceBefore=below_barcode_space_before, spaceAfter=below_barcode_space_after, bulletFontName=below_barcode_bullet_font_name, bulletFontSize=below_barcode_bullet_font_size, bulletIndent=below_barcode_bullet_indent, textColor=below_barcode_text_color, backColor=below_barcode_back_color, wordWrap=below_barcode_word_wrap, borderWidth=below_barcode_border_width, borderPadding=below_barcode_border_padding, borderColor=below_barcode_border_color, borderRadius=below_barcode_border_radius, allowWidows=below_barcode_allow_widows, allowOrphans=below_barcode_allow_orphans, textTransform=below_barcode_text_transform, endDots=below_barcode_end_dots, splitLongWords=below_barcode_split_long_words)) ################################################################################### # # 13.3 Set the FONT load_font_roboto = font_path + "roboto/Roboto-Regular.ttf" # FIXME ################################################################################### #barcode_font = FIXME r"/Users/retina/devtools/python-barcode/EAN13-BarcodePDF/fonts/roboto/RobotoRegular.ttf" #barcode_font = r"/fonts/roboto/RobotoRegular.ttf" #barcode_font = "fonts/roboto/RobotoRegular.ttf" FIXME #pdfmetrics.registerFont(TTFont('vera','RobotoRegular.ttf')) ################################################################################### # # 13.4 Loop through the list creating the individual labels # ################################################################################### #The enumerate function allows access to the list items while the for loop iterates for index, each_label_tuple in enumerate(all_unique_labels_lst): # Index variable is initiated above, and returns the index or position of the list item being iterated. #print("this is the index: " + str(index)) # each_label_tuple is initiated above, and is usedby enumerate to return the # contents of the current list item being iterated. #print("this is the tuple item: " + str(each_label_tuple)) ############################################################################### # # 13.4.1 Obtain the contents of the unique label list tuples # ############################################################################### curr_tuple_label_desc = str(each_label_tuple[0]) curr_tuple_label_barcode = str(each_label_tuple[1]) #print("Current Code from tuple: " + curr_tuple_label_barcode) #print("Current Product from tuple: " + curr_tuple_label_desc) ############################################################################### # # 13.4.2 Draw the EAN-13 Code # ############################################################################### # Pass barcode creation parameters to reportlab, any order, as name=value pairs. # Order may be changed, since reportlab maps name=value pairs automatically. # Source code for ordering # http://pydoc.net/Python/reportlab/3.3.0/reportlab.graphics.barcode.eanbc/ barcode_eanbc13 = eanbc.Ean13BarcodeWidget(value=curr_tuple_label_barcode,fontName=barcode_font_name,fontSize=barcode_font_size,x=barcode_x_pos,y=barcode_y_pos,barFillColor=bar_fill_color,barHeight=bar_height,barWidth=bar_width,barStrokeWidth=bar_stroke_width,barStrokeColor=bar_stroke_color,textColor=barcode_text_color,humanReadable=barcode_human_readable,quiet=barcode_use_quiet_space,lquiet=1,rquiet=1) ############################################################################### # # 13.4.? Create the drawing using the same size as the label indicated above # ############################################################################### #size of drawing? d = Drawing(label_width_mm*mm, label_height_mm*mm) ############################################################################### # # 13.4.? Set the text fill color for strings # ############################################################################### PDFcanvas.setFillColorRGB(txt_red,txt_grn,txt_blu) #choose your font color ############################################################################### # # 13.4.? OPTIONAL. Populate the PDF with strings and images # ############################################################################### #PDFcanvas.drawString(line_1_x_pos,line_1_y_pos,line_1_txt) #PDFcanvas.drawString(line_2_x_pos,line_2_y_pos,line_2_txt) #PDFcanvas.drawString(line_3_x_pos,line_3_y_pos,line_3_txt) #PDFcanvas.drawString(line_4_x_pos,line_4_y_pos,line_4_txt) PDFcanvas.drawString(image_logo_x_pos+62, image_logo_y_pos,registered_utf) PDFcanvas.drawImage(image_logo_filename, image_logo_x_pos, image_logo_y_pos, width=None, height=image_logo_height, mask=None, preserveAspectRatio=True, anchor='c') ############################################################################### # # 13.4.? Add the barcode and position it on the PDFcanvas # ############################################################################### d.add(barcode_eanbc13) # Place the generated barcode on the page. # (Drawing object, Barcode object, x position, y position) renderPDF.draw(d, PDFcanvas, 0, 0) #PDFcanvas.setFont('vera', 32) #This draws the text strings, gets position numbers from variables at beggining of file. """ OPTIONAL IF YOU REGISTER A BARCODE FONT, THIS IS ANOTHER WAY TO SET IT UP barcode_string = '<font name="Free 3 of 9 Regular" size="12">%s</font>' barcode_string = barcode_string % "1234567890" """ #line_1_and_2 = '<font name="Helvetica" size="12">%s</font>' #line_1_and_2 = line_1_and_2 % line_1_txt ############################################################################### # # 13.4.? Add the Product description as a paragraph # ############################################################################### label_prod_desc_area = Paragraph(curr_tuple_label_desc, style=styles["FSBlue"]) label_prod_desc_area.wrapOn(PDFcanvas, prod_x_wrap, prod_y_wrap) label_prod_desc_area.drawOn(PDFcanvas, prod_x_pos, prod_y_pos, mm) ############################################################################### # # 13.4.? Add line 3 (below Prod description 1 or 2 lines) as a paragraph # ############################################################################### label_line3_area = Paragraph(line_3_text, style=styles["line3"]) label_line3_area.wrapOn(PDFcanvas, line_3_x_wrap, line_3_y_wrap) label_line3_area.drawOn(PDFcanvas, line_3_x_pos, line_3_y_pos, mm) ############################################################################### # # 13.4.? Add line 4 (below line 3) as a paragraph # ############################################################################### label_line4_area = Paragraph(line_4_text, style=styles["line4"]) label_line4_area.wrapOn(PDFcanvas, line_4_x_wrap, line_4_y_wrap) label_line4_area.drawOn(PDFcanvas, line_4_x_pos, line_4_y_pos, mm) ############################################################################### # # 13.4.? Add below barcode as a paragraph # NOTE: This is NOT the group of human readable numbers below barcode! ############################################################################### label_below_barcode_area = Paragraph(below_barcode_text, style=styles["below-barcode"]) label_below_barcode_area.wrapOn(PDFcanvas, below_barcode_x_wrap, below_barcode_y_wrap) label_below_barcode_area.drawOn(PDFcanvas, below_barcode_x_pos, below_barcode_y_pos, mm) ############################################################################### # # 13.4.? Show the PDF # ############################################################################### PDFcanvas.showPage() ############################################################################### # # 13.4.? Save the PDF in its current state. # ############################################################################### PDFcanvas.save() ################################################################################### # # 13.4 END LOOPING THROUGH LIST CREATING INDIVIDUAL LABELS # ################################################################################### ####################################################################################### # # 13. END DEFINE LABEL CREATION FUNCTION # ####################################################################################### ####################################################################################### # # 14. BEGIN READING CSV FILE HEADERS FOR INDEXING # ####################################################################################### # 14.1 This portion reads only the headers of the file, and assigns them to variables. # with This protects you, by using with and the one at the bottom, it ensures that # if there is an error, it will close the file automatically. with open (fileName_w_ext, accessModeUniv_nl) as csvFileHeaders: csvRead = csv.reader(csvFileHeaders, dialect='mydialect') headers = csvRead.next() header_length = str(len(headers)) #print(nl + 'There are ' + header_length + ' headers (columns) in this file.' + nl) # 14.2 Assigns header text content to variables. #--------------------------------------- CSV COLUMN 1 ---------------------------- try: header1 = headers[0] except IndexError: print('This csv file does not have a single column, please try again') else: #print('This csv file has at least one column') #---------------------------------- CSV COLUMN 2 ----------------------------- try: header2 = headers[1] except IndexError: print('This csv file has less than two columns, please try again') else: #print('This csv file has at least two columns') #------------------------------ CSV COLUMN 3 ----------------------------- try: header3 = headers[2] except IndexError: print('This csv file has less than three columns, please try again') else: #print('This csv file has at least three columns') #-------------------------- CSV COLUMN 4 ----------------------------- try: header4 = headers[3] except IndexError: print('This csv file has less than four columns, please try again') else: #print('This csv file has at least four columns') #---------------------- CSV COLUMN 5 ----------------------------- try: header5 = headers[4] except IndexError: print('This csv file has less than five columns') else: #print('This csv file has at least five columns') #------------------ CSV COLUMN 6 ----------------------------- try: header6 = headers[5] except IndexError: print('This csv file has less than six columns') else: #print('This csv file has at least six columns') #-------------- CSV COLUMN 7 ----------------------------- try: header7 = headers[6] except IndexError: print('This csv file has less than seven columns') else: #print('This csv file has at least seven columns') #---------- CSV COLUMN 8 ----------------------------- try: header8 = headers[7] except IndexError: print('This csv file has less than eight columns') else: #print('This csv file has at least eight columns') #------ CSV COLUMN 9 ----------------------------- try: header9 = headers[8] except IndexError: print('This csv file has less than nine columns') else: #print('This csv file has at least nine columns') #-- CSV COLUMN 10 ---------------------------- try: header10 = headers[9] except IndexError: print('This csv file has less than ten columns') else: print('This csv file has at least ten columns') #verifies the content of the first line of the file. #print("These are the headers: " + str(headers) + nl) ####################################################################################### # # 14. END READING CSV FILE HEADERS FOR INDEXING # ####################################################################################### ####################################################################################### # # 14A. Opening the GUI app, calling the BarcodeLabelGen not working yet! #TODO ####################################################################################### """ root = Tk() app = BarcodeLabelGen(root) root.geometry("300x250+300+300") root.mainloop() root.destroy() # optional; see description below """ ####################################################################################### # # 15. BEGIN PROCESSING THE CSV FILE DATA # ####################################################################################### with open (fileName_w_ext, accessModeUniv_nl) as csvFileContents: # Read the file contents using csv library. # Calls the function .DictReader # don't worry about loading into a list up to about 30MB size files. # Opening with the DictReader class RowDict = csv.DictReader(csvFileContents, dialect='mydialect') #prints the dictionary item and its memory address at the moment #print RowDict ################################################################################### # # 15.2 Iterate through each row and add barcodes to a tuple, append to list # ################################################################################### for row in RowDict : ############################################################################### # # 15.2.1 Map each column to a variable for processing # ############################################################################### # This field holds the codes. Will be searched for barcodes field_item_code = row[header1] # This field will be stripped of HTML to get prod desc. field_item_desc = row[header2] field_item_stock_uom = row[header3] # This field has the required quantity. For each number, a label has to be created. field_req_qty = row[header4] field_warehouse = row[header5] field_reqstd_qty = row[header6] field_ordered_qty = row[header7] field_actual_qty = row[header8] #Clean up functions for ProductionPlanningTool.csv ############################################################################### # # 15.2.2 Process field_item_code (Is it a VALID GS1 code?) # RFE TODO: Evaluate all columns, search against a list containing valid barcodes. ############################################################################### # First of all, evaluate the existence a valid_gs1_prefix exists TRUE or FALSE is_a_barcode = valid_gs1_prefix in field_item_code # TODO: Evaluate ALL columns. create a function to map correct col to var. # so that the column order of the csv is IRRELEVANT. However, if is_a_barcode == True: #Convert field_item_code to a string field_item_code_str = str(field_item_code) field_item_code_len = len(field_item_code_str) #print("Found a Barcode: " + field_item_code_str + " and the string that has it is " + str(field_item_code_len) + " characters long.") # Find barcode position in a string. By default, the end equals string length, but it can be specified. barcode_to_extract_begins_at = field_item_code_str.find(valid_gs1_prefix,0,field_item_code_len) #print barcode_to_extract_begins_at # Slice the string, begin at prefix found position, end at string end. extracted_barcode_as_is = field_item_code_str[barcode_to_extract_begins_at:field_item_code_len] # Slice the string, begin at prefix found position, count 12 digits extracted_barcode_no_check = field_item_code_str[barcode_to_extract_begins_at:barcode_to_extract_begins_at+12] #print extracted_barcode_as_is #print extracted_barcode_no_check ########################################################################### # # 15.2.2.1 Validate whether it is a correct barcode, otherwise exit. # ########################################################################### barcode_with_calc_check_sum = barcode.ean.EuropeanArticleNumber13(extracted_barcode_no_check, writer=None) if str(barcode_with_calc_check_sum) == extracted_barcode_as_is: #print("Barcode has been correctly obtained, continuing program.") curr_label_barcode = extracted_barcode_as_is else: #print("Will use barcode with correctly calculated checksum: " + str(barcode_with_calc_check_sum)) curr_label_barcode = barcode_with_calc_check_sum #print("Barcode found: " + curr_label_barcode + nl) ########################################################################### # # 15.2.2.2 Process the field_item_desc. # ########################################################################### #Convert field_item_desc to a string field_item_desc_str = str(field_item_desc) #find the length field_item_desc_len = len(field_item_desc_str) #find the length of the search string used to position slicing cursor desc_search_string_len = len(desc_search_string) # find length of the HTML ending tag for the string. desc_ending_html_len = len(desc_ending_html) #print("The Barcode desc is now: " + field_item_desc_str + nl + " and it is " + str(field_item_desc_len) + " characters long.") #Find the ending HTML tag, and set as ending point of selection for the slicing desc_to_extract_ends_at = field_item_desc_str.find(desc_ending_html,0,field_item_desc_len) # Find where to extract in the string desc_to_extract_begins_at = field_item_desc_str.find(desc_search_string,0,field_item_desc_len) #print barcode_to_extract_begins_at # Slice the string, begin at description search string, add length of search string, add one char for space, end string where HTML tag starts. extracted_desc_as_is = field_item_desc_str[desc_to_extract_begins_at+desc_search_string_len+1:desc_to_extract_ends_at] #print("The product description is: |" + extracted_desc_as_is + "|") # Set the extracted description as the current label Product. curr_label_product = extracted_desc_as_is ########################################################################### # # 15.2.2.3 Process the field_req_qty. # ########################################################################### # Convert the required quantity to an integer. First to float, then to integer #http://stackoverflow.com/questions/1841565/valueerror-invalid-literal-for-int-with-base-10 field_req_qty_int = int(float(field_req_qty)) field_req_qty_str = str(field_req_qty_int) #Setting the current label required quantity to prevent changing code if processing is modified. curr_label_req_qty = field_req_qty_int #print("You need to print " + field_req_qty_str + " labels of: "+ nl + curr_label_product + nl + curr_label_barcode) ########################################################################### # # 15.2.2.4 Create the tuple containing data for the current label. # ########################################################################### curr_label_tuple = (curr_label_product,curr_label_barcode) ########################################################################### # # 15.2.2.5 Create a list containing the tuples with barcode and product. # ########################################################################### for lbl in range(field_req_qty_int): all_unique_labels_lst.append(curr_label_tuple) #print("Tuple at 0: " + str(curr_label_tuple[0]) + " Tuple at 1: " + \ #str(curr_label_tuple[1])) #if ends here. No need to return anything, just finish. #else: #print("This row did NOT have a valid EAN-13 Code, moving to the next") ################################################################################### # # 15.3 Count the amount of labels to be printed (tuples in the list) # ################################################################################### label_amount_to_print = len(all_unique_labels_lst) #PRINT THE ENTIRE LIST OF BARCODE, PRODUCT DESCRIPTION TUPLES. SUCCESS!!! #print all_unique_labels_lst print("There are " + str(label_amount_to_print) + " labels to be printed...") ####################################################################################### # # 15. END PROCESSING THE CSV FILE DATA # ####################################################################################### ####################################################################################### # # 16. BEGIN CALL Create51mmx38mmlabel function # ####################################################################################### if __name__ == "__main__": create51mmx38mmlabels() ############################################################################### # # 16.1 Show success message! # ############################################################################### end_datetime = format_datetime(datetime.datetime.now(), "yyyy.MMMdd kk:mm:ss", locale='es_GT') print("Success! Finished processing at " + end_datetime + ". Please search for the file") #print a_tilde_utf + space + e_tilde_utf + space + i_tilde_utf + space + o_tilde_utf + space + u_tilde_utf + space + n_enie_utf + space + percent_utf + space + registered_utf + space + copyright_utf
import collections class Solution: def minFlips(self, mat: List[List[int]]) -> int: m, n = len(mat), len(mat[0]) state = sum(cell << (i * n + j) for i, row in enumerate(mat) for j, cell in enumerate(row)) Q = collections.deque([state]) visited = set([state]) step = 0 while Q: for _ in range(len(Q)): curr = Q.popleft() if curr == 0: return step for r in range(m): for c in range(n): state = curr ^ (1 << (r * n + c)) for nr, nc in (r-1, c), (r+1, c), (r, c-1), (r, c+1): if 0 <= nr < m and 0 <= nc < n: state ^= 1 << (nr * n + nc) if state not in visited: Q.append(state) visited.add(state) step += 1 return -1
from PyQt5.QtWidgets import QApplication from PyQt5.QtCore import QRect from orangewidget import gui from orangewidget.settings import Setting from oasys.widgets import widget import oasys.widgets.gui as oasysgui from oasys.widgets.gui import ConfirmDialog from orangecontrib.photolab.widgets.gui.ow_photolab_widget import OWPhotolabWidget from orangecontrib.photolab.util.photolab_objects import PLPhoto # import matplotlib.pyplot as plt import matplotlib.image as mpimg from PyQt5.QtWidgets import QApplication, QFileSystemModel, QTreeView, QWidget, QVBoxLayout class OWFileSelector(OWPhotolabWidget): name = "File Selector" description = "File Selector" icon = "icons/selector.png" maintainer = "Manuel Sanchez del Rio" maintainer_email = "[email protected]" priority = 10 category = "Tools" keywords = ["data", "file", "load", "read"] outputs = [ {"name": "PLPhoto", "type": PLPhoto, "doc": "photolab photo", "id": "photolab photo"}, {"name": "filename", "type": str, "doc": "selected file name", "id": "filename"}, ] want_main_area=1 filename = Setting("None") input_data = PLPhoto() def __init__(self): super().__init__() file_box = oasysgui.widgetBox(self.general_options_box, "", addSpace=False, orientation="vertical", height=25) self.le_file = oasysgui.lineEdit(file_box, self, "filename", label="Select file", addSpace=False, orientation="horizontal") file_box = oasysgui.widgetBox(self.general_options_box, "", addSpace=False, orientation="vertical") self.model = QFileSystemModel() self.model.setRootPath('/Users/srio/Desktop/') self.tree = QTreeView(file_box) self.tree.setModel(self.model) self.tree.setAnimated(False) self.tree.setIndentation(20) self.tree.setSortingEnabled(True) self.tree.setWindowTitle("Dir View") self.tree.resize(370, 600) self.tree.clicked.connect(self.onClicked) file_box = oasysgui.widgetBox(self.general_options_box, "", addSpace=False, orientation="vertical", height=25) def onClicked(self, index): path = self.sender().model().filePath(index) print(path) self.le_file.setText(path) self.process() def select_file(self): self.filename = oasysgui.selectFileFromDialog(self, self.filename, "Open File", file_extension_filter="*.*") self.le_file.setText(self.filename) def process_specific(self): self.input_data.set_url(self.filename) self.input_data.load() self.photolab_output.setText("\nCurrent image: \n" + self.input_data.info()) self.preview(self.input_data.image()) self.send("filename", self.filename) self.send("PLPhoto", self.input_data) self.photolab_python_script.set_code(self.input_data.to_python_code()) def set_input(self, input_data): pass if __name__ == "__main__": import sys app = QApplication(sys.argv) w = OWFileSelector() w.filename = "/Users/srio/Public/ines/DSC_1575.jpg" w.show() app.exec() w.saveSettings()
from flask import ( current_app, request, redirect, url_for, render_template, flash, abort ) from flask.ext.babel import gettext, lazy_gettext from flask.ext.login import login_user, login_required, logout_user from itsdangerous import URLSafeSerializer, BadSignature from app.public.forms import RegisterGroupForm, RegisterFirmaForm from app.extensions import lm from app.data.models import User, Group, Firma from . import auth import json class CustomEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, User): return obj.to_json() return json.JSONEncoder.default(self, obj) @lm.user_loader def load_user(id): return User.get_by_id(int(id)) @auth.route('/profile') @login_required def profile(): return render_template('profile.html') @auth.route('/logout', methods=['GET']) @login_required def logout(): logout_user() flash(gettext('You were logged out'), 'success') return redirect(url_for('public.login')) @auth.route('/create_group', methods=['GET', 'POST']) @login_required def create_group(): form = RegisterGroupForm() if form.validate_on_submit(): group = Group.create(nazev=form.data['nazev'],) flash(gettext('Group {name} created').format(name=group.nazev),'success') return redirect(url_for('public.index')) return render_template('create_group.html', form=form) @auth.route('/create_organization', methods=['GET', 'POST']) @login_required def create_organization(): form = RegisterFirmaForm() if form.validate_on_submit(): firma = Firma.create(nazev=form.data['nazev'], state=form.data['state'], address=form.data['address'], phone_number=form.data['phone_number'], contact_person=form.data['contact_person'], website=form.data['website']) flash(gettext('Organization {name} created').format(name=firma.nazev),'success') return redirect(url_for('public.index')) return render_template('create_firma.html', form=form) @auth.route('/group/add/<int:id>', methods=['GET', 'POST']) def group_add_user(id): group = Group.query.filter_by(id=id).first_or_404() users = User.query.all() pole = json.dumps(users, cls=CustomEncoder) return render_template('group_add_users.html', pole=pole)
from django.conf.urls import url from django.contrib.auth.decorators import login_required from user import views from user.views import ActiveView, LoginView, RegisterView, LogoutView, UserInfoView, AddressView, UserOrderView urlpatterns = [ # url(r'^register$',views.register, name='register'), # url(r'^register_handle$',views.register_handle, name='register_handle'), url(r"^test$",views.test, name='test'), # 测试模块 url(r'^register$',RegisterView.as_view(), name='register'), # 注册 url(r'^active/(?P<token>.*)$',ActiveView.as_view(), name='active'), # 激活 url(r'^login$',LoginView.as_view(), name='login'), # 登录 url(r'^logout$',LogoutView.as_view(), name='logout'), # 登出 # url(r'^$',login_required(UserInfoView.as_view()), name='user'), # 用户中心信息页 # url(r'^address$',login_required(AddressView.as_view()), name='address'), # 用户中心地址页 # url(r'^order$',login_required(UserOrderView.as_view()), name='order'), # 用户中心订单页 url(r'^$',UserInfoView.as_view(), name='user'), # 用户中心信息页 url(r'^address$',AddressView.as_view(), name='address'), # 用户中心地址页 url(r'^order$',UserOrderView.as_view(), name='order'), # 用户中心订单页 ]
""" Django settings for cogpheno project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import sys from datetime import timedelta import matplotlib import tempfile from kombu import Exchange, Queue matplotlib.use('Agg') BASE_DIR = os.path.dirname(os.path.dirname(__file__)) ADMINS = ( (('vsochat', '@vsoch')) ) MANAGERS = ADMINS # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ DEBUG = False TEMPLATE_DEBUG = False ALLOWED_HOSTS = ["*"] # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'postgres', # The following settings are not used with sqlite3: 'USER': 'postgres', 'HOST': 'db', 'PORT': '5432', } } # Application definition INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'cogpheno.apps.main', 'cogpheno.apps.turk', 'cogpheno.apps.assessments', 'cogpheno.apps.users', 'social.apps.django_app.default', 'crispy_forms', 'dbbackup', 'djrill' ) # User Functions USER_ROLES = ( 'question_editor', 'assessment_editor', 'behavior_editor', 'viewer' ) AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'social.backends.facebook.FacebookOAuth2', 'social.backends.google.GoogleOAuth2', ) SOCIAL_AUTH_PIPELINE = ( 'social.pipeline.social_auth.social_details', 'social.pipeline.social_auth.social_uid', 'social.pipeline.social_auth.auth_allowed', 'social.pipeline.social_auth.social_user', 'social.pipeline.user.get_username', 'social.pipeline.social_auth.associate_by_email', # <--- enable this one 'social.pipeline.user.create_user', 'social.pipeline.social_auth.associate_user', 'social.pipeline.social_auth.load_extra_data', 'social.pipeline.user.user_details' ) SOCIAL_AUTH_FACEBOOK_SCOPE = ['email'] MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ROOT_URLCONF = 'cogpheno.urls' TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.static", "django.core.context_processors.tz", "django.contrib.messages.context_processors.messages", 'django.core.context_processors.request', ) TEST_RUNNER = 'django.test.runner.DiscoverRunner' WSGI_APPLICATION = 'cogpheno.wsgi.application' # Internationalization # https://docs.djangoproject.com/en/1.7/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True SITE_ID = 1 ANONYMOUS_USER_ID = -1 # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ STATIC_ROOT = '/var/www/static/' STATIC_URL = '/static/' # List of finder classes that know how to find static files in # various locations. STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ) # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'hamlpy.template.loaders.HamlPyFilesystemLoader', 'hamlpy.template.loaders.HamlPyAppDirectoriesLoader', 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' SENDFILE_BACKEND = 'sendfile.backends.development' PRIVATE_MEDIA_REDIRECT_HEADER = 'X-Accel-Redirect' CRISPY_TEMPLATE_PACK = 'bootstrap3' CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', } } # Mandrill config MANDRILL_API_KEY = "z2O_vfFUJB4L2yeF4Be9Tg" # this is a test key replace wit ha different one in production EMAIL_BACKEND = "djrill.mail.backends.djrill.DjrillBackend" CSRF_COOKIE_SECURE = False SESSION_COOKIE_SECURE = False # Bogus secret key. try: from secrets import * except ImportError: from bogus_secrets import * # Local settings try: from local_settings import * except ImportError: pass
# Copyright 2010 Google 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. """ Commands for a voting application. The commands are split into two categories. The first is for people who are performing the voting. The second category is for the creation and management of polls. Voting: Players find out about new polls by retrieving messages with types 'poll' or 'closed_poll' from the instance. Once a player has found out about polls, they can cast votes and get results for closed polls and polls they have already voted in. When a player votes in a poll they immediately receive the current results of that poll. They will be able to fetch those results until the poll creator deletes the poll. Poll Management: The remaining commands are for managing polls. Polls can be created, closed and deleted. Players can get the polls they have created with the get my polls command. """ __authors__ = ['"Bill Magnuson" <[email protected]>'] from django.utils import simplejson from game_server.models.message import Message from google.appengine.ext import db def cast_vote_command(instance, player, arguments): """ Cast a vote in a poll and return its current results. Args: instance: The parent GameInstance model of this poll. player: The player that is casting a vote. arguments: A two item list of the poll id and the zero based index of the option to select. Returns: A two item list contaning a message and the current votes for the poll. The message will be one of: Your vote was already counted in this poll. Poll closed to new votes. Vote accepted. Raises: ValueError if the vote index is larger than the number of options. ValueError if the player is not in the instance. """ instance.check_player(player) poll = get_poll(instance, arguments[0]) if not poll.open: return ['Poll closed to new votes.', poll.votes] if player in poll.voters: return ['Your vote was already counted in this poll.', poll.votes] try: poll.voters.append(player) vote_index = int(arguments[1]) poll.votes[vote_index] += 1 poll.put() except ValueError: raise ValueError('Invalid vote choice.') return ['Vote accepted.', poll.votes] def get_results_command(instance, player, arguments): """ Gets the results of a poll. Args: instance: The parent GameInstance model of the poll. player: The player requesting the results. arguments: A one item list containing the id number of the poll. Returns: If the player has not voted in this poll and it is still open, this will return a single item list with a message for the requesting player. Otherwise returns a list with information about the poll. See get_poll_return_list for its format. Raises: ValueError if the player is not in the instance. """ instance.check_player(player) poll = get_poll(instance, arguments[0]) if not poll.open: return ['Poll is now closed.', poll.votes] if player in poll.voters: return ['You have already voted in this poll.', poll.votes] return ['You have not voted in this poll yet.'] def make_new_poll_command(instance, player, arguments): """ Make a new poll. Args: instance: The game instance to add the poll to. player: The email of the player creating the poll. arguments: A two item list containing the question and a second list of 2-5 options. Returns: Returns a list with information about the poll just created. See get_poll_return_list for its format. Raises: ValueError if the player is not in the instance. """ instance.check_player(player) if not arguments[0]: raise ValueError('Question cannot be empty') size = len(arguments[1]) if size < 2 or size > 5: raise ValueError('Incorrect number of options for poll. ' + 'Must be between two and five.') poll = Message(parent = instance, sender = player, msg_type = 'poll', recipient = '') poll.put() arguments.append(poll.key().id()) poll.content = simplejson.dumps(arguments) poll.votes = [0] * size poll.open = True poll.voters = [''] poll.put() return get_poll_return_list(poll) def close_poll_command(instance, player, arguments): """ Close an existing poll. Args: instance: The parent GameInstance model of the poll. player: The email of the player closing the poll. Must be the poll's creator. arguments: A one argument list with the poll's id number. Returns: A list with information about the poll just closed. See get_poll_return_list for its format. Raises: ValueError if player is not the creator of the poll. ValueError if the player is not in the instance. """ instance.check_player(player) poll = get_poll(instance, arguments[0]) if poll.sender != player: raise ValueError('Only the person that created this poll may close it.') poll.open = False poll.msg_type = 'closed_poll' poll.put() return get_poll_return_list(poll) def delete_poll_command(instance, player, arguments): """ Delete an existing poll. Args: instance: The parent GameInstance model of the poll. player: The email of the player closing the poll. Must be the poll's creator. arguments: A one argument list with the poll's id number. Returns: True if the deletion is successful. Raises: ValueError if player is not the creator of the poll. ValueError if the player is not in the instance. """ instance.check_player(player) poll = get_poll(instance, arguments[0]) if poll.sender != player: raise ValueError('Only the person that created this poll may delete it.') db.delete(poll) return [True] def get_poll_info_command(instance, player, arguments): """ Get information about an existing poll. Args: instance: The parent GameInstance model of the poll. player: The email of the player requesting information. Must be the poll's creator. arguments: A one argument list with the poll's id number. Returns: A list with information about the poll. See get_poll_return_list for its format. Raises: ValueError if player is not the creator of the poll. Raises: ValueError if the player is not in the instance. """ instance.check_player(player) poll = get_poll(instance, arguments[0]) if poll.sender != player: raise ValueError('Only the person that created the poll can' + 'request its information.') return get_poll_return_list(poll) def get_my_polls_command(instance, player, arguments = None): """ Get the polls created by a player in the instance. Args: instance: The parent GameInstance model of the polls. player: The email of the player requesting the polls. arguments: Not used, can be any value. Finds all polls created by this player. Returns: A list of two item lists with each containing the id number of the poll and its question. Raises: ValueError if the player is not in the instance. """ instance.check_player(player) query = instance.get_messages_query('', '', sender = player) polls = query.fetch(1000) return [[poll.key().id(), poll.get_content()[0]] for poll in polls[::-1]] def get_poll(instance, argument): """ Get a poll database model. Args: instance: The parent GameInstance database model of the poll. argument: The poll id argument from the server command arguments list. Returns: A Message database model of the poll. Raises: ValueError if argument fails to parse to an int or the poll doesn't exist in the database. """ try: poll_id = int(argument) except ValueError: raise ValueError('Poll id failed to parse to a number.') poll_key = db.Key.from_path('Message', poll_id, parent = instance.key()) poll = db.get(poll_key) if poll is None: raise ValueError('Poll no longer exists.') return poll def get_poll_return_list(poll): """ Get a list to return to the GameClient component for a poll. Args: poll: A Message database model that is a poll. Returns: A list with the following five items: The poll question. The poll options as a list. The poll id number. The poll votes as a list. Whether the poll is open. """ content = poll.get_content() content.extend([poll.votes, poll.open]) return content
import os import time from _functions.setup_database import create_database, fill_database, drop_database from classes.poducts_filter import FilterProducts from classes.pymongo_converter import Converter from classes.send_data import DataSender from classes.sessions_filter import FilterSessions from Rules.Content_rules import ContentRules ''' Create converter and select the wanted fieldnames. Also give the name of the file u want to create. ''' # Create and fill the database with the table structure # drop_database() # create_database() # fill_database() # # converter = Converter() # converter.products(fieldnames=['_id', 'name', 'brand', 'category', 'deeplink', 'properties.doelgroep', 'fast_mover', 'gender', 'herhaalaankopen', 'price.selling_price'], filename='products.csv') # # ''' # Create filter and load in the file. then replace the wanted values. # # After that save the new data and print te amount of <null> values in the csv file to check if the filtering process worked. # ''' # # filter_products = FilterProducts() # filter_products.load_dataframe(filename='products.csv') # filter_products.replace_null(columns=['_id', 'name', 'brand', 'category', 'deeplink', 'fast_mover', 'gender', 'herhaalaankopen', 'selling_price', 'doelgroep']) # filter_products.replace_doelgroep() # filter_products.replace_gender(invalid=['Gezin', 'B2B', 'Kinderen', 'Senior', 'Baby', 'Grootverpakking', '8719497835768']) # filter_products.save_dataframe() # print(filter_products.dataframe.isna().sum()) # # # Create sender and query the products # # absolutepath = os.getcwd() # # data_sender = DataSender() # data_sender.copy_products_csv(pathname = absolutepath + "\products.csv") # # converter.visitors(fieldnames=['recommendations.segment', 'recommendations.latest_visit'], filename='visitors.csv') # # data_sender.copy_visitors_csv(pathname= absolutepath + "\visitors.csv") # # converter.sessions(fieldnames=['user_agent.identifier', 'session_start', 'session_end'], filename='sessions.csv') # # filter_sessions = FilterSessions() # filter_sessions.load_dataframe(filename='sessions.csv') # filter_sessions.save_dataframe() # # data_sender.copy_sessions_csv(pathname=absolutepath + "\sessions.csv") content = ContentRules() content.create_table(target='Gezond & verzorging', type='category') content.create_table(target='Huishouden', type='category') content.create_table(target='Elektronica & media', type='category') content.create_table(target='Eten & drinken', type='category') content.create_table(target='Make-up & geuren', type='category') content.create_table(target='Baby & kind', type='category') content.create_table(target='50% korting', type='category') content.create_table(target='Nieuw', type='category') content.create_table(target='Kleding & sieraden', type='category') content.create_table(target='op=opruiming', type='category') content.create_table(target='Cadeau ideeën', type='category') content.create_table(target='Folder artikelen', type='category') content.create_table(target='Black Friday', type='category') content.create_table(target='Extra Deals', type='category') content.create_table(target='Opruiming', type='category') content.create_table(target='onbekend', type='category')
# coding: utf-8 from django.shortcuts import render, get_object_or_404 from django.http import Http404, QueryDict from django.core.exceptions import PermissionDenied from django.http import HttpResponse from django.db.models import Q from django.contrib.auth.models import User from django.utils.translation import ugettext as _ from django.utils.timezone import localtime, now from django.contrib.auth.decorators import login_required from django.conf import settings from django.views.decorators.http import require_http_methods from collections import defaultdict, Counter import datetime import logging import requests from reversion import revisions as reversion from courses.models import Course, DefaultTeacher, StudentCourseMark, MarkField, FilenameExtension from groups.models import Group from tasks.models import Task, TaskGroupRelations from years.models import Year from years.common import get_current_year from anycontest.common import get_contest_info, FakeResponse from issues.models import Issue from issues.issueFilter import IssueFilter from issues.model_issue_status import IssueStatus from issues.views import contest_rejudge from users.forms import InviteActivationForm from users.models import UserProfile from courses import pythontask from lessons.models import Lesson from common.ordered_dict import OrderedDict from common.timezone import convert_datetime from courses.forms import default_teacher_forms_factory, DefaultTeacherForm from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML import json logger = logging.getLogger('django.request') QUEUE_SESSION_PREFIX = 'queue' QUEUE_COLUMN_ORDER = { "1": ["student__last_name", "student__first_name"], "2": ["task__title"], "3": ["update_time"], "4": ["mark"], "5": ["responsible__last_name", "responsible__first_name"], } @require_http_methods(['GET']) @login_required def queue_page(request, course_id): user = request.user course = get_object_or_404(Course, id=course_id) if not course.user_can_see_queue(user): raise PermissionDenied f = IssueFilter(request.GET, {}) f.set_course(course, user) session_key = '_'.join([QUEUE_SESSION_PREFIX, str(course_id)]) if request.GET: request.session[session_key] = f.form.data elif session_key in request.session: f.form.data = request.session.get(session_key) f.form.helper = FormHelper(f.form) f.form.helper.form_method = 'get' f.form.helper.layout.append( HTML( u""" <div class="form-group row"> <button id="button_clear" class="btn btn-secondary" type="button">{0}</button> </div> <div class="form-group row"> <button id="button_filter" class="btn btn-primary" type="button">{1}</button> </div> """.format(_(u'ochistit'), _(u'primenit')) ) ) schools = course.school_set.all() context = { 'course': course, 'user_is_teacher': course.user_is_teacher(user), 'visible_attendance_log': course.user_can_see_attendance_log(user), 'filter': f, 'school': schools[0] if schools else '', 'full_width_page': True, 'timezone': user.profile.time_zone } return render(request, 'courses/queue.html', context) def set_order_direction(values, direction): if direction == "desc": return map(lambda x: "-" + x, values) return values @require_http_methods(['POST']) @login_required def ajax_get_queue(request): user = request.user if "draw" not in request.POST or "course_id" not in request.POST: raise PermissionDenied course = get_object_or_404(Course, id=request.POST['course_id']) if not course.user_can_see_queue(user): raise PermissionDenied issues = Issue.objects.filter( Q(task__course=course) & (Q(student__profile__user_status__tag='active') | Q(student__profile__user_status__tag=None)) & Q(student__group__course=course) ).exclude( task__type=Task.TYPE_SEMINAR, ).exclude( task__type=Task.TYPE_MATERIAL, ).distinct().select_related('student', 'task', 'responsible', 'status_field') order = [] for order_info in json.loads(request.POST.get("order", "[]")): order.extend(set_order_direction(QUEUE_COLUMN_ORDER.get(str(order_info.get("column"))), order_info.get("dir"))) issues = issues.order_by(*order) f = IssueFilter(QueryDict(request.POST["filter"]), issues) f.set_course(course, user) f.set_data(request.POST) session_key = '_'.join([QUEUE_SESSION_PREFIX, str(course.id)]) if f.form.data: request.session[session_key] = f.form.data f.qs.count() return HttpResponse(json.dumps(f.response), content_type="application/json") @require_http_methods(['GET']) @login_required def gradebook(request, course_id, task_id=None, group_id=None): """Page with course related information contexts: - tasklist - tasks_description """ user = request.user if not user.profile.is_active(): raise PermissionDenied course = get_object_or_404(Course, id=course_id) if task_id: task = get_object_or_404(Task, id=task_id, type=Task.TYPE_SEMINAR) else: task = None if group_id: group = get_object_or_404(Group, id=group_id) else: group = None schools = course.school_set.all() if course.private and not course.user_is_attended(request.user): return render(request, 'courses/course_forbidden.html', {"course": course, 'school': schools[0] if schools else '', 'invite_form': InviteActivationForm()}) lang = request.session.get('django_language', user.profile.language) issue_statuses = [] seminar_color = IssueStatus.COLOR_DEFAULT for status in course.issue_status_system.statuses.all(): issue_statuses.append((status.color, status.get_name(lang))) if status.tag == IssueStatus.STATUS_SEMINAR: seminar_color = status.color tasklist_context = tasklist_shad_cpp(request, course, task, group) context = tasklist_context context.update({ 'tasklist_template': 'courses/tasklist/shad_cpp.html', 'task_types': dict(Task().TASK_TYPE_CHOICES).items(), 'group_gradebook': True if group else False, 'show_hidden_tasks': request.session.get( str(request.user.id) + '_' + str(course.id) + '_show_hidden_tasks', False ), 'show_academ_users': request.session.get( str(request.user.id) + '_' + str(course.id) + '_show_academ_users', True ), 'school': schools[0] if schools else '', 'full_width_page': True, 'issue_statuses': issue_statuses, 'seminar_color': seminar_color, }) return render(request, 'courses/gradebook.html', context) @require_http_methods(['GET']) @login_required def course_page(request, course_id): """Page with course related information contexts: - tasklist - tasks_description """ user = request.user if not user.profile.is_active(): raise PermissionDenied course = get_object_or_404(Course, id=course_id) if course.is_python_task: return pythontask.tasks_list(request, course) schools = course.school_set.all() if course.private and not course.user_is_attended(request.user): return render(request, 'courses/course_forbidden.html', {"course": course, 'school': schools[0] if schools else '', 'invite_form': InviteActivationForm()}) course.can_edit = course.user_can_edit_course(user) if course.can_edit: groups = course.groups.all().order_by('name') tasks = [{'group': tgr.group, 'task': tgr.task} for tgr in TaskGroupRelations.objects.filter(task__course=course, group__in=groups, deleted=False).order_by( 'group', 'position')] else: groups = Group.objects.filter(students=user, course__in=[course]) tasks = TaskGroupRelations.objects.filter( task__course=course, group__in=groups, deleted=False ).order_by( 'group', 'position' ).values_list( 'task__id', flat=True ).distinct() tasks = Task.objects.filter(id__in=tasks) if StudentCourseMark.objects.filter(student=user, course=course): mark = StudentCourseMark.objects.get(student=user, course=course).mark else: mark = None context = {} context['course'] = course context['tasks'] = tasks context['mark'] = mark or '--' context['visible_queue'] = course.user_can_see_queue(user), context['visible_attendance_log'] = course.user_can_see_attendance_log(user), context['user_is_teacher'] = course.user_is_teacher(user) context['task_types'] = dict(Task().TASK_TYPE_CHOICES).items() context['show_hidden_tasks'] = request.session.get( str(request.user.id) + '_' + str(course.id) + '_show_hidden_tasks', False) context['school'] = schools[0] if schools else '' context['visible_attendance_log'] = course.user_can_see_attendance_log(request.user) context['jupyterhub_url'] = getattr(settings, 'JUPYTERHUB_URL', '') return render(request, 'courses/course.html', context) @login_required def seminar_page(request, course_id, task_id): """Page with course related information contexts: - tasklist - tasks_description """ user = request.user if not user.profile.is_active(): raise PermissionDenied course = get_object_or_404(Course, id=course_id) task = get_object_or_404(Task, id=task_id, type=Task.TYPE_SEMINAR) schools = course.school_set.all() if course.private and not course.user_is_attended(request.user): return render(request, 'courses/course_forbidden.html', {"course": course, 'school': schools[0] if schools else '', 'invite_form': InviteActivationForm()}) course.can_edit = course.user_can_edit_course(user) if course.can_edit: groups = task.groups.all().order_by('name') tasks = [{'group': tgr.group, 'task': tgr.task} for tgr in TaskGroupRelations.objects.filter(task__parent_task=task, group__in=groups, deleted=False).order_by( 'group', 'position')] else: groups = Group.objects.filter(students=user, course__in=[course]) tasks = TaskGroupRelations.objects.filter( task__course=course, group__in=groups, deleted=False ).order_by( 'group', 'position' ).values_list( 'task__id', flat=True ).distinct() tasks = Task.objects.filter(id__in=tasks) if Issue.objects.filter(task=task, student=user): mark = Issue.objects.get(task=task, student=user).mark else: mark = None context = {} context['course'] = course context['tasks'] = tasks context['mark'] = mark if mark else '--' context['visible_queue'] = course.user_can_see_queue(user), context['visible_attendance_log'] = course.user_can_see_attendance_log(user), context['user_is_teacher'] = course.user_is_teacher(user) context['seminar'] = task context['task_types'] = dict(Task().TASK_TYPE_CHOICES).items() context['show_hidden_tasks'] = request.session.get( str(request.user.id) + '_' + str(course.id) + '_show_hidden_tasks', False) context['school'] = schools[0] if schools else '' context['visible_attendance_log'] = course.user_can_see_attendance_log(request.user) return render(request, 'courses/course.html', context) def tasklist_shad_cpp(request, course, seminar=None, group=None): user = request.user user_is_attended = False user_is_attended_special_course = False if seminar: groups = seminar.groups.all().order_by('name') else: groups = course.groups.all().order_by('name') course.can_edit = course.user_can_edit_course(user) if course.can_be_chosen_by_extern: course.groups.add(course.group_with_extern) if group: groups = [group] group_x_student_x_task_takens = OrderedDict() group_x_task_list = {} group_x_max_score = {} default_teacher = {} show_hidden_tasks = request.session.get(str(request.user.id) + '_' + str(course.id) + '_show_hidden_tasks', False) show_academ_users = request.session.get(str(request.user.id) + '_' + str(course.id) + '_show_academ_users', True) academ_students = [] for group in groups: student_x_task_x_task_takens = {} tasks_for_groups = TaskGroupRelations.objects \ .filter(task__course=course, group=group, deleted=False, task__parent_task=seminar) \ .exclude(task__type=Task.TYPE_MATERIAL) \ .distinct() \ .order_by('position') \ .prefetch_related('task__groups') \ .select_related('task') if show_hidden_tasks: group_x_task_list[group] = [x.task for x in tasks_for_groups] else: group_x_task_list[group] = [x.task for x in tasks_for_groups if not x.task.is_hidden] group_x_max_score.setdefault(group, 0) for task in group_x_task_list[group]: if not task.is_hidden: if task.type == task.TYPE_SEMINAR: group_x_max_score[group] += sum([x.score_max for x in task.children.all()]) else: group_x_max_score[group] += task.score_max if task.task_text is None: task.task_text = '' issues_students_in_group = Issue.objects \ .filter(task__in=group_x_task_list[group], student__group__in=[group]) \ .order_by('student') \ .select_related("task") \ .prefetch_related('task__groups', 'task') issues_x_student = defaultdict(list) for issue in issues_students_in_group.all(): student_id = issue.student.id issues_x_student[student_id].append(issue) students = group.students.filter(is_active=True) not_active_students = UserProfile.objects.filter( Q(user__in=group.students.filter(is_active=True)) & (Q(user_status__tag='not_active') | Q(user_status__tag='academic')) ) academ_students += [x.user for x in not_active_students] if not show_academ_users: students = set(students) - set(academ_students) for student in students: if user == student: user_is_attended = True user_is_attended_special_course = True student_task_takens = issues_x_student[student.id] task_x_task_taken = {} student_summ_scores = 0 for task_taken in student_task_takens: task_x_task_taken[task_taken.task.id] = task_taken if not task_taken.task.is_hidden: if task_taken.task.type == Task.TYPE_SEMINAR or \ task_taken.task.score_after_deadline or \ not (not task_taken.task.score_after_deadline and task_taken.is_status_accepted_after_deadline()): student_summ_scores += task_taken.mark student_x_task_x_task_takens[student] = (task_x_task_taken, student_summ_scores) group_x_student_x_task_takens[group] = student_x_task_x_task_takens try: default_teacher[group] = DefaultTeacher.objects.get(course=course, group=group).teacher except DefaultTeacher.DoesNotExist: default_teacher[group] = None group_x_student_information = OrderedDict() for group, student_x_task_x_task_takens in group_x_student_x_task_takens.iteritems(): group_x_student_information.setdefault(group, []) for student in sorted(student_x_task_x_task_takens.keys(), key=lambda x: u"{0} {1}".format(x.last_name, x.first_name)): if user == student: user_is_attended = True elif not course.user_can_see_transcript(user, student): continue mark_id, course_mark, course_mark_int = get_course_mark(course, student) group_x_student_information[group].append((student, student_x_task_x_task_takens[student][0], student_x_task_x_task_takens[student][1], mark_id, course_mark, course_mark_int)) context = { 'course': course, 'course_mark_system_vals': course.mark_system.marks.all() if course.mark_system else None, 'group_information': group_x_student_information, 'group_tasks': group_x_task_list, 'group_x_max_score': group_x_max_score, 'default_teacher': default_teacher, 'user': user, 'user_is_attended': user_is_attended, 'user_is_attended_special_course': user_is_attended_special_course, 'user_is_teacher': course.user_is_teacher(user), 'seminar': seminar, 'visible_queue': course.user_can_see_queue(user), 'visible_attendance_log': course.user_can_see_attendance_log(request.user), 'visible_hide_button': Task.objects.filter(Q(course=course) & Q(is_hidden=True)).exists(), 'show_hidden_tasks': show_hidden_tasks, 'visible_hide_button_users': len(academ_students), 'show_academ_users': show_academ_users } return context def get_tasklist_context(request, course): return tasklist_shad_cpp(request, course) def get_course_mark(course, student): mark_id = -1 course_mark = '--' course_mark_int = -1 course_marks = course.mark_system if course_marks and course_marks.marks: if course_marks.marks.all()[0].name_int != -1: course_mark_int = -10 try: student_course_mark = StudentCourseMark.objects.get(course=course, student=student) if student_course_mark.mark: mark_id = student_course_mark.mark.id course_mark = unicode(student_course_mark) course_mark_int = student_course_mark.mark.name_int except StudentCourseMark.DoesNotExist: pass return mark_id, course_mark, course_mark_int def courses_list(request, year=None): if year is None: year_object = get_current_year() else: year_object = get_object_or_404(Year, start_year=year) if year_object is None: raise Http404 courses_list = Course.objects.filter(year=year_object).order_by('name') context = { 'courses_list': courses_list, 'year': year_object, } return render(request, 'course_list.html', context) @require_http_methods(['POST']) @login_required def edit_course_information(request): user = request.user for key in ['course_id', 'course_information']: if key not in request.POST: raise PermissionDenied try: course_id = int(request.POST['course_id']) course_information = request.POST['course_information'].strip() except ValueError: # not int raise PermissionDenied course = get_object_or_404(Course, id=course_id) if not course.user_can_edit_course(user): raise PermissionDenied if course_information and not course_information.startswith(u'<div class="not-sanitize">'): course_information = u'<div class="not-sanitize">' + course_information + u'</div>' course.information = course_information course.save() return HttpResponse(json.dumps({'info': course_information}), content_type="application/json") @require_http_methods(['POST']) @login_required def set_spectial_course_attend(request): user = request.user try: course_id = int(request.POST['course_id']) action = request.POST['action'] except ValueError: # not int raise PermissionDenied course = get_object_or_404(Course, id=course_id) if action == "add": course.add_user_to_group_with_extern(user) if action == "remove": course.remove_user_from_group_with_extern(user) return HttpResponse("OK") def default_teachers_generate_form(course, post_data=None): groups_teacher = {} groups_forms = {} groups = course.groups.all().order_by('name') for default_teacher in DefaultTeacher.objects.filter(course=course).filter(group__in=groups): groups_teacher[default_teacher.group.id] = default_teacher.teacher for group in groups: teacher = groups_teacher.get(group.id) groups_forms[group] = default_teacher_forms_factory(course, group, teacher, post_data) return groups_forms def get_filename_extensions(course): extensions = FilenameExtension.objects.all().order_by('name') course_extensions = course.filename_extensions.all() return [(ext, True) if ext in course_extensions else (ext, False) for ext in extensions] @require_http_methods(['GET', 'POST']) @login_required def course_settings(request, course_id): course = get_object_or_404(Course, id=course_id) if not course.user_is_teacher(request.user): raise PermissionDenied schools = course.school_set.all() tasks_with_contest = {} if course.is_contest_integrated(): for task in course.task_set.filter(contest_integrated=True, is_hidden=False): tasks_with_contest[task.contest_id] = tasks_with_contest.get(task.contest_id, list()) + [task] context = {'course': course, 'visible_queue': course.user_can_see_queue(request.user), 'visible_attendance_log': course.user_can_see_attendance_log(request.user), 'user_is_teacher': course.user_is_teacher(request.user), 'school': schools[0] if schools else '', 'tasks_with_contest': tasks_with_contest, } if request.method != "POST": form = DefaultTeacherForm(course) context['form'] = form context['file_extensions'] = get_filename_extensions(course) return render(request, 'courses/settings.html', context) form = DefaultTeacherForm(course, request.POST) context['form'] = form if not form.is_valid(): context['file_extensions'] = get_filename_extensions(course) return render(request, 'courses/settings.html', context) for group_key, teacher_id in form.cleaned_data.iteritems(): teacher_id = int(teacher_id) group = form.groups[group_key] if teacher_id == 0: DefaultTeacher.objects.filter(course=course).filter(group=group).delete() else: teacher = get_object_or_404(User, id=teacher_id) default_teacher, _ = DefaultTeacher.objects.get_or_create(course=course, group=group) default_teacher.teacher = teacher default_teacher.save() for issue in Issue.objects.filter(task__course=course, student__group=group, responsible__isnull=True): issue.set_teacher(teacher=teacher) if 'rb_extensions[]' in request.POST: course.filename_extensions = request.POST.getlist('rb_extensions[]') else: course.filename_extensions.clear() course.show_task_one_file_upload = 'show_task_one_file_upload' in request.POST course.default_task_send_to_users = 'default_task_send_to_users' in request.POST course.default_task_one_file_upload = 'default_task_one_file_upload' in request.POST course.show_accepted_after_contest_ok = 'show_accepted_after_contest_ok' in request.POST course.default_accepted_after_contest_ok = 'default_accepted_after_contest_ok' in request.POST course.show_contest_run_id = 'show_contest_run_id' in request.POST redirect_page = None if course.has_attendance_log and 'has_attendance_log' not in request.POST: redirect_page = '/course/%d' % course.id course.has_attendance_log = 'has_attendance_log' in request.POST course.save() return HttpResponse(json.dumps({'redirect_page': redirect_page}), content_type="application/json") @require_http_methods(['POST']) @login_required def change_visibility_hidden_tasks(request): course = get_object_or_404(Course, id=int(request.POST['course_id'])) if not course.user_is_teacher(request.user): raise PermissionDenied session_var_name = str(request.user.id) + '_' + request.POST['course_id'] + '_show_hidden_tasks' request.session[session_var_name] = not request.session.get(session_var_name, False) return HttpResponse("OK") @require_http_methods(['POST']) @login_required def change_visibility_academ_users(request): course = get_object_or_404(Course, id=int(request.POST['course_id'])) if not course.user_is_teacher(request.user): raise PermissionDenied session_var_name = str(request.user.id) + '_' + request.POST['course_id'] + '_show_academ_users' request.session[session_var_name] = not request.session.get(session_var_name, True) return HttpResponse("OK") @require_http_methods(['POST']) @login_required def set_course_mark(request): user = request.user course = get_object_or_404(Course, id=request.POST['course_id']) if not course.user_is_teacher(user): raise PermissionDenied student = get_object_or_404(User, id=request.POST['student_id']) if request.POST['mark_id'] != '-1': mark = get_object_or_404(MarkField, id=request.POST['mark_id']) else: mark = MarkField() student_course_mark = StudentCourseMark() try: student_course_mark = StudentCourseMark.objects.get(course=course, student=student) except StudentCourseMark.DoesNotExist: student_course_mark.course = course student_course_mark.student = student student_course_mark.teacher = user student_course_mark.update_time = datetime.datetime.now() student_course_mark.mark = mark student_course_mark.save() return HttpResponse(json.dumps({'mark': unicode(mark), 'mark_id': mark.id, 'mark_int': mark.name_int}), content_type="application/json") @require_http_methods(['POST']) @login_required def set_task_mark(request): task_id = request.POST['task_id'] task = get_object_or_404(Task, id=task_id) if not task.course.user_is_teacher(request.user): raise PermissionDenied issue, created = Issue.objects.get_or_create(task_id=task_id, student_id=request.POST['student_id']) mark = 0 if request.POST['mark_value'] == '-': issue.set_status_new() else: mark = float(request.POST['mark_value']) if mark <= 0: issue.set_status_rework() else: issue.set_status_accepted() issue.set_byname('mark', mark) return HttpResponse(json.dumps({'mark': mark, 'color': issue.status_field.color}), content_type="application/json") @require_http_methods(['POST']) @login_required def change_table_tasks_pos(request): course = get_object_or_404(Course, id=int(request.POST['course_id'])) if not course.user_is_teacher(request.user): raise PermissionDenied group = get_object_or_404(Group, id=int(request.POST['group_id'])) deleting_ids_from_groups = json.loads(request.POST['deleting_ids_from_groups']) if deleting_ids_from_groups: for task_id, group_ids in deleting_ids_from_groups.iteritems(): group_ids = list(set(group_ids)) task = get_object_or_404(Task, id=int(task_id)) task_groups = task.groups.filter(id__in=group_ids) if task.type == task.TYPE_SEMINAR: children_groups = reduce(lambda x, y: x + y, [list(child.groups.all()) for child in task.children.all()], []) if set(children_groups).intersection(task_groups): raise PermissionDenied else: for tg in task_groups: if Issue.objects.filter(task=task, student__in=tg.students.all()).count(): raise PermissionDenied task.groups.remove(*task.groups.filter(id__in=group_ids)) task.save() for task_relations in TaskGroupRelations.objects.filter(task=task, group__id__in=group_ids): task_relations.deleted = True task_relations.save() if 'task_deleted[]' in request.POST: task_deleted = map(lambda x: int(x), dict(request.POST)['task_deleted[]']) for task in Task.objects.filter(id__in=task_deleted): if task.type == task.TYPE_SEMINAR and not task.children.exists(): Issue.objects.filter(task=task).delete() if not Issue.objects.filter(task=task).count(): try: task.delete() TaskGroupRelations.objects.get(task=task, group=group).delete() except TaskGroupRelations.DoesNotExist: pass else: raise PermissionDenied if 'task_order[]' in request.POST: task_order = map(lambda x: int(x), dict(request.POST)['task_order[]']) for task_relations in TaskGroupRelations.objects.select_related('task') \ .filter(task__id__in=task_order).filter(group=group): task_relations.position = task_order.index(task_relations.task.id) task_relations.save() return HttpResponse("OK") @require_http_methods(['POST']) @login_required def ajax_update_contest_tasks(request): user = request.user if not request.is_ajax(): raise PermissionDenied if 'tasks_with_contest[]' not in request.POST or 'contest_id' not in request.POST: raise PermissionDenied contest_id = int(request.POST['contest_id']) response = {'is_error': False, 'contest_id': contest_id, 'error': '', 'tasks_title': {}} got_info, contest_info = get_contest_info(contest_id) if got_info: problem_req = FakeResponse() problem_req = requests.get(settings.CONTEST_API_URL + 'problems?contestId=' + str(contest_id), headers={'Authorization': 'OAuth ' + settings.CONTEST_OAUTH}) problems = [] if 'error' in problem_req: response['is_error'] = True if 'IndexOutOfBoundsException' in problem_req['error']['name']: response['error'] = _(u'kontesta_ne_sushestvuet') else: response['error'] = _(u'oshibka_kontesta') + ' ' + problem_req['error']['message'] if 'result' in problem_req.json(): problems = problem_req.json()['result']['problems'] contest_responses = [contest_info, problems] else: response['is_error'] = True if "You're not allowed to view this contest." in contest_info: response['error'] = _(u"net_prav_na_kontest") elif "Contest with specified id does not exist." in contest_info: response['error'] = _(u'kontesta_ne_sushestvuet') else: response['error'] = _(u'oshibka_kontesta') + contest_info if not response['is_error']: for task in Task.objects.filter(id__in=dict(request.POST)['tasks_with_contest[]']): alias = task.problem_id if contest_id != task.contest_id: continue for problem in contest_responses[0]['problems']: if problem['alias'] == alias: task.title = problem['problemTitle'] task.task_text = problem['statement'] if 'endTime' in contest_responses[0]: deadline = contest_responses[0]['endTime'].split('+')[0] task.deadline_time = datetime.datetime.strptime(deadline, '%Y-%m-%dT%H:%M:%S.%f') else: task.deadline_time = None break for problem in contest_responses[1]: if problem['title'] == alias: if 'score' in problem: task.score_max = problem['score'] task.save() reversion.set_user(user) reversion.set_comment("Update from contest") response['tasks_title'][task.id] = task.get_title(user.profile.language) return HttpResponse(json.dumps(response), content_type="application/json") @require_http_methods(['POST']) @login_required def ajax_rejudge_contest_tasks(request): if not request.is_ajax(): raise PermissionDenied if 'tasks_with_contest[]' not in request.POST: raise PermissionDenied for issue in Issue.objects.filter(task_id__in=dict(request.POST)['tasks_with_contest[]']): contest_rejudge(issue) return HttpResponse("OK") def attendance_list(request, course, group=None): user = request.user user_is_attended = False user_is_attended_special_course = False show_academ_users = request.session.get("%s_%s_show_academ_users" % (request.user.id, course.id), True) msk_time = convert_datetime(localtime(now()), user.profile.time_zone) course.can_edit = course.user_can_edit_course(user) if course.can_be_chosen_by_extern: course.groups.add(course.group_with_extern) if group: groups = [group] else: groups = course.groups.all().order_by('name') group_x_student_x_lessons = OrderedDict() group_x_lesson_list = {} group_inactive_lessons = {} default_teacher = {} academ_students = [] for group in groups: group_x_lesson_list[group] = Lesson.objects.filter(course=course, group=group).order_by('position') group_inactive_lessons[group] = Lesson.objects.filter(course=course, group=group, date_starttime__gt=msk_time ).order_by('position') active_lessons_count = len(group_x_lesson_list[group]) - len(group_inactive_lessons[group]) students = group.students.filter(is_active=True) not_active_students = UserProfile.objects.filter(Q(user__in=group.students.filter(is_active=True)) & (Q(user_status__tag='not_active') | Q(user_status__tag='academic'))) academ_students += [x.user for x in not_active_students] if not show_academ_users: students = set(students) - set(academ_students) students_x_lessons = {} for student in students: if user == student: user_is_attended = True user_is_attended_special_course = True not_visited_lessons = [] for lssn in group_x_lesson_list[group][:active_lessons_count]: if student in lssn.not_visited_students.all(): not_visited_lessons.append(lssn) students_x_lessons[student] = not_visited_lessons, active_lessons_count - len(not_visited_lessons) group_x_student_x_lessons[group] = students_x_lessons try: default_teacher[group] = DefaultTeacher.objects.get(course=course, group=group).teacher except DefaultTeacher.DoesNotExist: default_teacher[group] = None group_x_student_information = OrderedDict() for group, students_x_lessons in group_x_student_x_lessons.iteritems(): group_x_student_information.setdefault(group, []) for student in sorted(students_x_lessons.keys(), key=lambda x: u"{0} {1}".format(x.last_name, x.first_name)): if user == student: user_is_attended = True elif not course.user_can_see_transcript(user, student): continue group_x_student_information[group].append((student, students_x_lessons[student][0], students_x_lessons[student][1])) context = { 'course': course, 'group_information': group_x_student_information, 'group_lessons': group_x_lesson_list, 'group_inactive_lessons': group_inactive_lessons, 'default_teacher': default_teacher, 'user': user, 'user_is_attended': user_is_attended, 'user_is_attended_special_course': user_is_attended_special_course, 'user_is_teacher': course.user_is_teacher(user), 'visible_hide_button_users': len(academ_students), 'show_academ_students': show_academ_users } return context @require_http_methods(['GET']) @login_required def attendance_page(request, course_id, group_id=None): user = request.user if not user.profile.is_active(): raise PermissionDenied course = get_object_or_404(Course, id=course_id) if not course.user_can_see_attendance_log(request.user): raise PermissionDenied if group_id: group = get_object_or_404(Group, id=group_id) else: group = None schools = course.school_set.all() attendance_context = attendance_list(request, course, group) context = attendance_context context['lssnlist_template'] = 'courses/attendance_list.html' context['group_attendance_list'] = bool(group) context['school'] = schools[0] if schools else '' context['show_academ_users'] = request.session.get( str(request.user.id) + '_' + str(course.id) + '_show_academ_users', True) context['full_width_page'] = True return render(request, 'courses/attendance.html', context) @require_http_methods(['POST']) @login_required def lesson_visited(request): lesson_id = request.POST['lssn_id'] lesson = get_object_or_404(Lesson, id=lesson_id) if not lesson.course.user_is_teacher(request.user): raise PermissionDenied if lesson.date_starttime.date() > datetime.datetime.today().date(): raise PermissionDenied student = User.objects.get(id=request.POST['student_id']) if 'lesson_visited' in request.POST: value = 1 lesson.not_visited_students.remove(student) else: value = -1 lesson.not_visited_students.add(student) lesson.save() can_be_deleted = lesson.group.students.count() - lesson.not_visited_students.count() return HttpResponse(json.dumps({'visited': value, 'lesson_id': lesson_id, 'deleted': can_be_deleted}), content_type="application/json") @login_required def lesson_delete(request): if request.method != 'POST': raise PermissionDenied lesson_id = request.POST['lesson_id'] delete_all = request.POST['delete_all'] == 'true' lesson = get_object_or_404(Lesson, id=lesson_id) student_ids = lesson.group.students.values_list('id', flat=True) students_x_lesson_diff = {} if not delete_all: deleted_ids = [lesson_id] students_not_visited = lesson.not_visited_students.values_list('id', flat=True) if lesson.date_starttime <= now(): students_x_lesson_diff = {stud: 1 for stud in student_ids if stud not in students_not_visited} lesson.delete() else: schedule_id = lesson.schedule_id count_lessons_inactive = Lesson.objects.filter( schedule_id=schedule_id, date_starttime__gte=max(now(), lesson.date_starttime) ).count() lessons_to_del = Lesson.objects.filter( schedule_id=schedule_id, date_starttime__gte=lesson.date_starttime ).order_by('position') students_x_lesson_diff = {stud: len(lessons_to_del) - count_lessons_inactive for stud in student_ids} deleted_ids = [] students_not_visited = [] for lssn in lessons_to_del: students_not_visited += lssn.not_visited_students.values_list('id', flat=True) deleted_ids.append(lssn.id) lssn.delete() count_not_visited_students = Counter(students_not_visited) for stud in student_ids: students_x_lesson_diff[stud] -= count_not_visited_students[stud] return HttpResponse(json.dumps({'deleted': deleted_ids, 'students_lesson_diff': students_x_lesson_diff.items()}), content_type="application/json") def view_statistic(request, course_id): course = get_object_or_404(Course, id=course_id) if course.is_python_task: return pythontask.python_stat(request, course)
# Generated by Django 2.2.24 on 2022-02-23 22:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('exchange', '0003_auto_20200122_2156'), ] operations = [ migrations.AddField( model_name='currency', name='active', field=models.BooleanField(default=True), ), ]
import configparser import urllib.parse class ConfigLoader: class SectionNotFound(Exception): pass class KeyNotFound(Exception): pass def __init__(self, file): self.config = configparser.ConfigParser() self.config.read(file) self.check_sections() self.check_keys() self.username = self.config['Credentials']['username'] self.password = self.config['Credentials']['password'] self.url = self.config['Credentials']['url'] self.uri = urllib.parse.urlparse(self.url).netloc self.mail_host = self.config['Mail']['host'] self.mail_port = int(self.config['Mail']['port']) self.mail_username = self.config['Mail']['username'] self.mail_password = self.config['Mail']['password'] self.mail_from = self.config['Mail']['from'] self.mail_to = self.config['Mail']['to'] self.interval = int(self.config['Misc']['interval']) def check_sections(self): needed_sections = ['Credentials', 'Mail', 'Misc'] for section in needed_sections: if section not in self.config: raise self.SectionNotFound(section) def check_keys(self): needed_auth_keys = ['username', 'password'] needed_mail_keys = ['username', 'password', 'from', 'to', 'host', 'port'] needed_misc_keys = ['interval'] for key in needed_auth_keys: if key not in self.config['Credentials']: raise self.KeyNotFound(key) for key in needed_mail_keys: if key not in self.config['Mail']: raise self.KeyNotFound(key) for key in needed_misc_keys: if key not in self.config['Misc']: raise self.KeyNotFound(key) def get_username(self) -> str: return self.username def get_password(self) -> str: return self.password def get_url(self) -> str: return self.url def get_uri(self) -> str: return self.uri def get_mail_host(self) -> str: return self.mail_host def get_mail_port(self) -> int: return self.mail_port def get_mail_username(self) -> str: return self.mail_username def get_mail_password(self) -> str: return self.mail_password def get_mail_from(self) -> str: return self.mail_from def get_mail_to(self) -> str: return self.mail_to def get_interval(self) -> int: return self.interval
import lmdb env = lmdb.open(path='/media/scratch/t4.lmdb', map_size=1048576*1024*3, map_async=True, sync=False, metasync=False, writemap=False) txn = env.begin(write=True) it = None unhex = lambda s: s.decode('hex') for line in file('/tmp/lmdb.trace'): bits = line.rstrip('\n').split(' ') if bits[0] == 'put': txn.put(unhex(bits[1]), unhex(bits[2])) elif bits[0] == 'delete': txn.delete(unhex(bits[1])) elif bits[0] == 'commit': print 'commit' txn.commit() txn = env.begin(write=True) elif bits[0] == 'iter': it = txn.cursor()._iter_from(unhex(bits[1]), unhex(bits[2]) == 'True') elif bits[0] == 'fetch': key, value = next(it, (None, None)) elif bits[0] == 'yield': assert (key, value) == (unhex(bits[1]), unhex(bits[2]))
#!/usr/bin/python # ToDo: Refactoring # ToDo: Mapping a tiny piano-keyboard to the keyboard import time import keyboard import paho.mqtt.client as mqtt import logging logging.basicConfig(level=logging.DEBUG) from utils.display import triangel, piano, pluck from utils.functions import get_ip_adress from utils.settings import * client = mqtt.Client() client.connect(settings.broker, settings.broker_port, 60) logging.info("Connected to "+settings.broker) client.loop_start() ip_adress = get_ip_adress() # Tonleiter und Instrument auswählen # ====================================================================================================================== # Tonleiter scale = ["C", "D", "E", "F", "G", "A", "H"] # ToDo: Was ist der Unterschied zwischen B und H, weil H gibt es in Sonic Pi nicht!!! scale[-1] = "B" # Instrumente synt = ['tri', 'piano', 'pluck'] current_synt = 0 current_tones = 0 octave = 5 while True: # making a loop if keyboard.is_pressed('up'): # iy 'q' is pressed current_tones += 1 if current_tones >= len(scale): current_tones = 0 octave += 1 if octave > 8: octave = 0 logging.debug(str(scale[current_tones])) elif keyboard.is_pressed('down'): # iy 'q' is pressed current_tones -= 1 if current_tones < 0: current_tones = len(scale) - 1 octave -= 1 if octave < 0: octave = 8 logging.debug(str(scale[current_tones])) elif keyboard.is_pressed('right'): # iy 'q' is pressed current_synt += 1 if current_synt >= len(synt): current_synt = 0 logging.debug(current_synt) elif keyboard.is_pressed('left'): # iy 'q' is pressed current_synt -= 1 if current_synt < 0: current_synt = len(synt) - 1 logging.debug(current_synt) if keyboard.is_pressed('space'): # if key 'space' is pressed send = f"{ip_adress};{scale[current_tones]}{octave};{synt[current_synt]}" client.publish(settings.topic_sound_msg, payload=send, qos=0, retain=False) logging.debug(send) if keyboard.is_pressed('s'): send = f"{ip_adress};C{octave};{synt[current_synt]}" client.publish(settings.topic_sound_msg, payload=send, qos=0, retain=False) logging.debug(send) if keyboard.is_pressed('d'): send = f"{ip_adress};D{octave};{synt[current_synt]}" client.publish(settings.topic_sound_msg, payload=send, qos=0, retain=False) logging.debug(send) if keyboard.is_pressed('f'): send = f"{ip_adress};E{octave};{synt[current_synt]}" client.publish(settings.topic_sound_msg, payload=send, qos=0, retain=False) logging.debug(send) if keyboard.is_pressed('g'): send = f"{ip_adress};F{octave};{synt[current_synt]}" client.publish(settings.topic_sound_msg, payload=send, qos=0, retain=False) logging.debug(send) if keyboard.is_pressed('h'): send = f"{ip_adress};G{octave};{synt[current_synt]}" client.publish(settings.topic_sound_msg, payload=send, qos=0, retain=False) logging.debug(send) if keyboard.is_pressed('j'): send = f"{ip_adress};A{octave};{synt[current_synt]}" client.publish(settings.topic_sound_msg, payload=send, qos=0, retain=False) logging.debug(send) if keyboard.is_pressed('k'): send = f"{ip_adress};B{octave};{synt[current_synt]}" client.publish(settings.topic_sound_msg, payload=send, qos=0, retain=False) logging.debug(send) else: pass time.sleep(0.08)
import unittest from mock import MagicMock, patch, call from device.simulated.grid_controller import GridController from device.simulated.diesel_generator import DieselGenerator from device.simulated.pv import Pv from device.simulated.grid_controller.price_logic import AveragePriceLogic from device.simulated.eud import Eud class TestGridController(unittest.TestCase): def setUp(self): config = { "device_id": "gc_1", } # setup the grid controller device self.gc = GridController(config) # setup the callback functions self.gc._broadcast_new_ttie_callback = MagicMock(name="_broadcast_new_ttie_callback") self.gc._broadcast_new_power_callback = MagicMock(name="_broadcast_new_power_callback") self.gc._broadcast_new_price_callback = MagicMock(name="_broadcast_new_price_callback") self.gc._broadcast_new_capacity_callback = MagicMock(name="_broadcast_new_capacity_callback") # initialize the gc self.gc.init() # add devices self.gc.add_device("eud_1", Eud) self.gc.add_device("dg_1", DieselGenerator) self.gc.add_device("eud_2", Eud) self.gc.add_device("dg_2", DieselGenerator) def test_default_price_logic(self): """Test the price logic object is loaded""" # gc._price_logic should be an instance of AveragePriceLogic self.assertIsInstance(self.gc._price_logic, AveragePriceLogic) def test_adding_devices(self): """Test adding euds and power sources""" # test the count of regular devices self.assertEqual(self.gc.device_manager.count(), 2) # test the count on the power sources self.assertEqual(self.gc.power_source_manager.count(), 2) def test_set_capacity_for_power_source(self): """Test setting the capacity for a power source""" self.gc.on_capacity_change("dg_1", "gc_1", 0, 1000.0) self.gc.on_capacity_change("dg_2", "gc_1", 0, 5000.0) # make sure the capacity for the device is set correctly d = self.gc.power_source_manager.get("dg_1") self.assertEqual(d.capacity, 1000.0) # make sure the capacity for the device is set correctly d = self.gc.power_source_manager.get("dg_2") self.assertEqual(d.capacity, 5000.0) # test the sum of all the devices # need to set prices for the power sources first self.gc.on_price_change("dg_1", "gc_1", 0, 0.15) self.gc.on_price_change("dg_2", "gc_1", 0, 0.30) self.assertEqual(self.gc.power_source_manager.total_capacity(), 6000.0) def test_set_price_for_power_source(self): """Test setting the price for a power source""" # set the capacities for the two power sources self.gc.on_capacity_change("dg_1", "gc_1", 0, 1000.0) self.gc.on_capacity_change("dg_2", "gc_1", 0, 1000.0) # set the price for dg_1, should trigger a new price broadcast to all eud's self.gc.on_price_change("dg_1", "gc_1", 0, 0.2) calls = [ call("gc_1", "eud_1", 0, 0.2), call("gc_1", "eud_2", 0, 0.2) ] self.gc._broadcast_new_price_callback.assert_has_calls(calls, any_order=False) # make sure the price for the device is set correctly d = self.gc.power_source_manager.get("dg_1") self.assertEqual(d.price, 0.2) # reset the mock object self.gc._broadcast_new_price_callback.reset_mock() # make the call to trigger the price change and callbacks self.gc.on_price_change("dg_2", "gc_1", 0, 0.4) # make sure calls were made for each of the two eud's mock_calls = self.gc._broadcast_new_price_callback.mock_calls self.assertEqual(len(mock_calls), 2) # now check parameters of each call # first call name, args, kwargs = mock_calls[0] self.assertEqual(args[0], "gc_1") self.assertEqual(args[1], "eud_1") self.assertEqual(args[2], 0) self.assertAlmostEqual(args[3], 0.3) # second call name, args, kwargs = mock_calls[1] self.assertEqual(args[0], "gc_1") self.assertEqual(args[1], "eud_2") self.assertEqual(args[2], 0) self.assertAlmostEqual(args[3], 0.3) # make sure the the price was set on the device in the grid controller d = self.gc.power_source_manager.get("dg_2") self.assertEqual(d.price, 0.4) def test_change_load(self): """Test setting a load on a power source, then taking it off""" self.gc.on_capacity_change("dg_1", "gc_1", 0, 1000.0) self.gc.on_price_change("dg_1", "gc_1", 0, 0.15) self.gc.on_power_change("eud_1", "gc_1", 0, 100.0) self.assertEqual(self.gc.power_source_manager.total_load(), 100.0) self.gc.on_power_change("eud_1", "gc_1", 3600, 0) self.assertEqual(self.gc.power_source_manager.total_load(), 0) def test_optimize_load(self): """ Test optimize load. Add load to devices, change the capacities and prices to move the load around """ # setup dg_1 self.gc.on_capacity_change("dg_1", "gc_1", 0, 1000.0) self.gc.on_price_change("dg_1", "gc_1", 0, 0.15) dg_1 = self.gc.power_source_manager.get("dg_1") # setup dg_2 self.gc.on_capacity_change("dg_2", "gc_1", 0, 1000.0) self.gc.on_price_change("dg_2", "gc_1", 0, 0.30) dg_2 = self.gc.power_source_manager.get("dg_2") # setup the eud self.gc.on_power_change("eud_1", "gc_1", 0, 100.0) # all load should be on dg_1 self.assertEqual(dg_1.load, 100) # reset the mock object self.gc._broadcast_new_power_callback.reset_mock() # change the price of dg_1 to move load over to dg_2 self.gc.on_price_change("dg_1", "gc_1", 0, 0.45) self.assertEqual(dg_1.price, 0.45) self.assertEqual(dg_1.load, 0) self.assertEqual(dg_2.load, 100) # check the callback functions for power mock_calls = self.gc._broadcast_new_power_callback.mock_calls self.assertEqual(len(mock_calls), 2) # change the capacity of dg_2 so load gets split between the two power sources # reset the mock mock_calls = self.gc._broadcast_new_power_callback.reset_mock() # set capacity to 20W, should now have 80 W on dg_1 self.gc.on_capacity_change("dg_2", "gc_1", 0, 20.0) self.assertEqual(dg_1.load, 80) self.assertEqual(dg_2.load, 20) # check the callback functions for power mock_calls = self.gc._broadcast_new_power_callback.mock_calls self.assertEqual(len(mock_calls), 2) # now set the capacity of dg_2 to zero, all load should go over to dg_1 # reset the mock mock_calls = self.gc._broadcast_new_power_callback.reset_mock() self.gc.on_capacity_change("dg_2", "gc_1", 0, 0) self.assertEqual(dg_1.load, 100) self.assertEqual(dg_2.load, 0) mock_calls = self.gc._broadcast_new_power_callback.mock_calls self.assertEqual(len(mock_calls), 2) if __name__ == "__main__": unittest.main()
# ******************************************************************************* # Copyright (C) 2020-2021 INAF # # This software is distributed under the terms of the BSD-3-Clause license # # Authors: # Ambra Di Piano <[email protected]> # ******************************************************************************* #!/usr/bin/python # -*- coding: latin-1 -*- from setuptools import setup, find_packages setup( name='tutorials', version='0.0.1.dev1', author='Ambra Di Piano', author_email='[email protected]', packages=find_packages(), package_dir={'tutorials': 'tutorials'}, include_package_data=True, license='BSD-3-Clause' )
import json import gym import gzip import time from gym.utils.play import play, PlayPlot from ai_traineree.buffers import ReplayBuffer def buffer_callback(buffer): def callback(obs_t, obs_next, action, rew, done, *args, **kwargs): buffer.add(**dict(state=obs_t, action=[action], reward=[rew], done=[done]), next_state=obs_next) return [ rew, ] return callback buffer = ReplayBuffer(10, 2000) callback = buffer_callback(buffer) plotter = PlayPlot(callback, 30 * 5, ["reward"]) env_name = "Breakout-v0" env = gym.make(env_name) env.reset() play(env, fps=20, callback=plotter.callback) t = [] exp_dump = buffer.dump_buffer(serialize=True) t.append(time.time()) with gzip.open("buffer.gzip", "wt") as f: for exp in exp_dump: f.write(json.dumps(exp)) f.write("\n") t.append(time.time()) print(f"Writing to gzip took: {t[1]-t[0]} s")
from __future__ import unicode_literals import collections import os import subprocess import sys import _pyterminalsize import pytest import pyterminalsize PY3 = str is not bytes WIN = sys.platform == 'win32' def to_n(s): if isinstance(s, bytes) and PY3: # pragma: no cover (py3) s = s.decode('UTF-8') elif not isinstance(s, bytes) and not PY3: # pragma: no cover (py2) s = s.encode('UTF-8') return s def dct_to_native(dct): return dict((to_n(k), to_n(v)) for k, v in dct.items()) @pytest.fixture(autouse=True, scope='session') def reset_terminal_size(): size = pyterminalsize.get_terminal_size() yield for fd in (0, 1, 2): try: _pyterminalsize.set_terminal_size(fd, *size[:2]) except OSError: # pragma: no cover (windows) if fd != 0: raise def norm(s): return s.replace('\r\n', '\n') def _run(cmd, **kwargs): stdin = kwargs.pop('stdin', None) if stdin is not None: kwargs['stdin'] = subprocess.PIPE if 'env' in kwargs: # Allows `random` to be importable kwargs['env']['SYSTEMROOT'] = os.environ.get('SYSTEMROOT', '') if 'PATH' not in kwargs['env']: kwargs['env']['PATH'] = os.environ['PATH'] kwargs['env'] = dct_to_native(kwargs['env']) proc = subprocess.Popen(cmd, **kwargs) out, err = proc.communicate(stdin) assert not proc.returncode, (proc.returncode, out, err) return ( norm(out.decode('UTF-8')) if out is not None else None, norm(err.decode('UTF-8')) if err is not None else None, ) def run_with_coverage(*args, **kwargs): return _run((sys.executable, '-m', 'coverage', 'run') + args, **kwargs) def test_from_tput_no_tput_on_path(): out, _ = run_with_coverage( '-m', 'testing.from_tput_prog', stdout=subprocess.PIPE, env={'PATH': '', 'TERM': 'dumb'}, ) key = collections.namedtuple('key', ('win', 'py3')) error = { key(win=True, py3=True): ( '[WinError 2] The system cannot find the file specified' ), key(win=True, py3=False): ( '[Error 2] The system cannot find the file specified' ), key(win=False, py3=True): ( "[Errno 2] No such file or directory: 'tput': 'tput'" ), key(win=False, py3=False): ( '[Errno 2] No such file or directory' ), } assert out == ( 'Caught OSError\n' '{}\n'.format(error[key(win=WIN, py3=PY3)]) ) def test_from_tput_bs_terminal_proc_returncode(): out, _ = run_with_coverage( '-m', 'testing.from_tput_prog', stdout=subprocess.PIPE, env={'TERM': 'bs'}, ) assert out == ( 'Caught OSError\n' 'tput returned 3\n' ) def test_from_tput_no_term(): out, _ = run_with_coverage( '-m', 'testing.from_tput_prog', stdout=subprocess.PIPE, env={}, ) assert out == ( 'Caught OSError\n' 'Cannot determine cols / lines without TERM\n' ) def test_from_tput_dumb_term(): out, _ = run_with_coverage( '-m', 'testing.from_tput_prog', # Both being a pipe is important, this makes tput lookup based on TERM stdout=subprocess.PIPE, stderr=subprocess.PIPE, env={'TERM': 'dumb'}, ) assert out == '(80, 24)\n' def test_from_environment(): out, _ = run_with_coverage( '-m', 'testing.get_terminal_size_prog', stdout=subprocess.PIPE, env={'COLUMNS': '10', 'LINES': '20'}, ) assert out == "Size(columns=10, lines=20, source='environment')\n" def test_get_from_tput(): out, _ = run_with_coverage( '-m', 'testing.get_terminal_size_prog', # when stdin / stdout / stderr are all pipes it will fall back to tput stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=b'', env={'TERM': 'dumb'}, ) assert out == "Size(columns=80, lines=24, source='tput')\n" def test_fallback(): out, _ = run_with_coverage( '-m', 'testing.get_terminal_size_prog', # when stdin / stdout / stderr are all pipes it will fall back to tput stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=b'', # When TERM is not set it cannot fall back to tput env={}, ) assert out == "Size(columns=10, lines=20, source='fallback')\n" @pytest.mark.parametrize('source', ('stdout', 'stderr')) def test_from_source(source): kwargs = { 'stdin': b'', 'stdout': subprocess.PIPE, 'stderr': subprocess.PIPE, } kwargs.pop(source) arg = 'stderr' if source == 'stdout' else 'stdout' out, err = run_with_coverage( '-m', 'testing.changes_size_prog', arg, **kwargs ) output = err if source == 'stdout' else out assert output == ( "Size(columns=30, lines=40, source='{0}')".format(source) ) @pytest.mark.xfail( sys.platform == 'win32', reason='stdin does not work correctly on windows' ) def test_from_stdin(): test_from_source('stdin')
from heapq import heappush, heappop class Stack: def __init__(self): self.data = [] @property def empty(self): return len(self.data) == 0 def push(self, element): self.data.append(element) def pop(self): return self.data.pop() class Queue: def __init__(self): self.data = [] @property def empty(self): return len(self.data) == 0 def push(self, element): self.data.append(element) def pop(self): return self.data.pop(0) class PriorityQueue: def __init__(self): self.data = [] @property def empty(self): return len(self.data) == 0 def push(self, element): heappush(self.data, element) def pop(self): return heappop(self.data) if __name__ == '__main__': s = Stack() s.push(1) s.push(2) s.push(3) while not(s.empty): print(s.pop()) q = Queue() q.push(1) q.push(2) q.push(3) while not(q.empty): print(q.pop()) p = PriorityQueue() p.push(2) p.push(3) p.push(1) while not(p.empty): print(p.pop())
#!/usr/bin/env python # -*- coding: utf-8 -*- import pymongo from pymongo import MongoClient from pymongo import errors import re from datetime import datetime TASK_MANAGER_NAME = "crawtext_jobs" TASK_COLL = "job" class Database(object): '''Database creation''' def __init__(self, database_name, debug=False): self.debug = debug self.client = MongoClient('mongodb://localhost,localhost:27017') self.db_name = database_name self.db = getattr(self.client,database_name) self.date = datetime.now() def set_colls(self): self.sources = self.db["sources"] self.logs = self.db["logs"] self.results = self.db["results"] self.queue = self.db["queue"] return self def use_db(self, database_name): return self.client[str(database_name)] def use_coll(self, coll_name): return self.db[coll_name] def show_dbs(self): return self.client.database_names() def create_coll(self, coll_name): setattr(self, str(coll_name), self.db[str(coll_name)]) #print ("coll : %s has been created in db:%s ") %(self.__dict__[str(coll_name)], self.db_name) #return self.__dict__[str(coll_name)] return self def create_colls(self, coll_names=["results","sources", "logs", "queue"]): for n in coll_names: setattr(self, n, self.db[str(n)]) # self.queue = self.db['queue'] # self.log = self.db['log'] # self.sources = self.db['sources'] # #print ("Creating coll", [n for n in self.db.collection_names()]) return [n for n in self.db.collection_names()] def show_coll(self): try: print ("using collection %s in DB : %s") %(self.coll_name, self.db_name) return self.coll_name except AttributeError: return False def show_coll_items(self, coll_name): return [n for n in self.db[str(coll_name)].find(timeout=False)] def drop(self, type, name): if type == "collection": return self.db[str(name)].drop() elif type == "database": return self.client.drop_database(str(name)) else: print ("Unknown Type") return False def drop_db(self): return self.client.drop_database(str(self.db_name)) def drop_all_dbs(self): '''remove EVERY SINGLE MONGO DATABASE''' for n in self.show_dbs(): #if n not in ["projects", "tasks"]: self.use_db(n) def insert_logs(self, log_list): for log in log_list: self.insert_log(self, log) def insert_log(self, log): # if self.debug: print "insert log", log["msg"] url = log["url"] try: del log['html'] except KeyError: pass if url in self.db.sources.distinct("url"): if self.debug: print "Source updated" exists = self.db.sources.find_one({"url":url},timeout=False) if exists is not None: del log["url"] try: self.db.sources.update({"_id":exists["_id"]}, {"$push": log}) return True except: self.db.sources.update({"url":url}, {"$push": log}) return True else: if url not in self.db.logs.distinct("url"): self.db.logs.insert({"url":url,"msg":log["msg"], "status":log["status"], "code": log["code"], "date": [datetime.now()]}) return True else: exists = self.db.logs.find_one({"url": url},timeout=False) self.db.sources.update({"_id":exists["_id"]}, {"$push": log}) return True def insert_results(self,results): for log in results: self.insert_result(self, log) return True def insert_result(self, log): self.debug = True result = self.db.results.find_one({"url":log['url']},timeout=False) source = self.db.sources.find_one({"url":log['url']},timeout=False) if source is not None: if self.debug: print "\t- sources udpated" self.db.sources.update({"_id":source["_id"]}, {"$push": {"date": log["date"], "status": True, "msg": "Result stored"}}) if result is not None: return self.update_result(log) else: if self.debug: print "\t-page inserted" self.db.results.insert(log) return True def update_result(self, log): "\t-result updated" try: result = self.db.results.find_one({"url":log['url']},timeout=False) updated = self.db.results.update({"_id":result["_id"]},{"$push": {"date": log["date"], "status": True, "msg": "Result stored"}}) # print updated try: incremented = self.db.results.update({"_id":result["_id"]},{"$set": {"crawl_nb":result["crawl_nb"]+1}}) except: incremented = self.db.results.update({"_id":result["_id"]},{"$set": {"crawl_nb":1}}) # print incremented return True except Exception: print "No url provided" return False def insert_queue(self, log): if self.debug: print "insert queue", log["url"] if log["url"] not in self.db.queue.distinct("url"): self.db.queue.insert(log) return True def remove_queue(self, log): self.db.queue.remove({"url":log["url"]}) return True def sources_stats(self): self.show_stats() return self.template[3] def results_stats(self): self.show_stats() return self.template[1] def results_stats(self): self.show_stats() return self.template[2] def show_stats(self): '''Output the current stats of database in Terminal''' self.stats() date = datetime.now() date = date.strftime("- %d/%M/%Y at %H:%M -") title = "==== Project: %s ====\n%s" %(str(self.db_name).capitalize(), date) results = "#Results:\n\t-Total:%d\n\t-Unique urls:%d"%(self.results_nb, self.uniq_results_nb) errors = "#Errors:\n\t-Total:%d\n\t-Unique:%d"%(self.logs_nb, self.uniq_logs_nb) sources = "#Sources:\n\t-Total: %d\n-Unique: %d\n\t-Valid: %d\n\t-Invalid: %d\nCollected methods:\n\t-From search:%d\n\t-From file:%d\n\t-Manual:%d\n\t-Automatic:%d"%(self.sources_nb, self.uniq_sources_nb,self.active_sources_nb, self.inactive_sources_nb, self.bing_sources, self.file_sources, self.manual_sources, self.expanded_sources) process = "#Process:\n\t-Total: %d\n\t-Unique: %d\n\t-Treated: %d" %(self.queue_nb, self.uniq_queue_nb, self.treated_nb) other = "#Other:\n\tName of the database: %s\n\tSize of the database: %d MB" %(self.db_name, (self.db.command('dbStats', 1024)['storageSize'])/1024/1024.) self.template = [title, results, errors, sources, process, other] return "\n".join(self.template) def stats(self): #sources self.sources_nb = self.db.sources.count() self.uniq_sources_nb = len(self.db.sources.distinct("url")) #self.active_sources_nb = self.db.sources.find({"status":True}, { "status": {"$slice": -1 } } ).count() self.inactive_sources_nb = self.db.sources.find({"status":False}, { "status": {"$slice": -1 } },timeout=False ).count() self.active_sources_nb = self.sources_nb - self.inactive_sources_nb self.bing_sources = self.db.sources.find({"origin":"bing"},timeout=False).count() self.file_sources = self.db.sources.find({"origin":"file"},timeout=False).count() self.manual_sources = self.db.sources.find({"origin":"manual"},timeout=False).count() self.expanded_sources = self.db.sources.find({"origin":"automatic"},timeout=False).count() #results self.results_nb = self.db.results.count() self.uniq_results_nb = len(self.db.results.distinct("url")) #logs self.logs_nb = self.db.logs.count() self.uniq_logs_nb = len(self.db.logs.distinct("url")) self.non_pertinent_nb = self.db.logs.find({"code":800}, { "code": {"$slice": -1 } }, timeout=False ).count() #treated self.treated_nb = int(int(self.db.results.count()) + int(self.db.logs.count())) self.queue_nb = self.db.queue.count() self.uniq_queue_nb = len(self.db.queue.distinct("url")) return self def mail_report(self): self.show_stats() title = "Report for project %s" %(str(self.db_name)) template = [title] template.append("<ul>") for n in self.template: chunk = n.split("\n") for c in chunk: if c.startswith("#"): c = "<h3>%s</h3>"%str(c) elif c.startswith("="): c = "<h2>%s</h2>"%str(c) else: c = "<li>%s</li>"%str(c) template.append(c) template.append("</ul>") return "".join(template) class TaskDB(Database): def __init__(self): Database.__init__(self, TASK_MANAGER_NAME) self.coll = self.db[str(TASK_COLL)] def get(self): return self.coll if __name__== "__main": print "Database"
#!/usr/bin/env python # Copyright (c) 2009-2010 Matt Harrison import sys import optparse import os import logging from coverage.report import Reporter from coverage.misc import CoverageException from coverage.control import Coverage from coverage.config import CoverageConfig from . import meta COVERED = 'Error'#'Covered' IGNORED = 'Ignored' MISSED = 'Missed' logging.basicConfig(level=logging.DEBUG, filename='.cov2emacs.log') LOG = logging class BasicReporter(Reporter): """ Hacked subclass of coverage.py Reporter that instead of actually doing anything just yields the data. Since the .coverage file only contains the line's covered we need to use Coverage.py's logic to determine the 'missing' lines. """ def __init__(self, report_file, ignore_errors=False): coverage = Coverage(report_file) coverage.use_cache(True) coverage.load() self.config = CoverageConfig() super(BasicReporter, self).__init__(coverage, ignore_errors) def report_filenames(self, filenames=None): filenames = filenames or [] for filename in filenames: yield self.coverage.analysis(filename) def report(self, morfs=None, directory=None): for result in self.report_files(morfs, directory): yield result def report_files(self, morfs, directory=None): """Run a reporting function on a number of morfs. No callback function, just yield the cu, statements, excluded and missing """ self.find_code_units(morfs, self.config) self.directory = directory if self.directory and not os.path.exists(self.directory): os.makedirs(self.directory) for cu in self.code_units: try: # don't filter relative!!! # if not cu.relative: # continue #statements, excluded, missing, _ = self.coverage._analyze(cu) analysis_instance = self.coverage._analyze(cu) yield (cu, analysis_instance.statements, analysis_instance.excluded, analysis_instance.missing) except KeyboardInterrupt: raise except CoverageException as e: pass except: if not self.ignore_errors: raise class Coverage2Emacs(object): """ Convert coverage.py data to something emacs likes """ def __init__(self, cov_file): if os.path.basename(cov_file) != '.coverage': raise Exception('wrong filename %s' % cov_file) self.cov_file = cov_file def to_emacs_flymake_mode(self, filename, fout=None): """ flymake mode output looks like this: filename:lineno: Warning|Error (function):msg """ fout = fout or sys.stdout reporter = BasicReporter(self.cov_file) for cu, statements, excluded, missing in reporter.report(): if cu.filename != filename: # probably could filter earlier to speed things up continue for line in missing: fout.write('%s:%s: Error Line not covered by test\n' %(cu.filename, line)) def to_emacs_compile_mode(self, fout=None, filenames=None, combine_nums=False, status_line=True): """ spit out something easy to parse in emacs ie: filename:linenumber:message Message can be Covered|Ignored|Missed """ filenames = [os.path.abspath(f) for f in filenames] or [] LOG.debug('compile_mode filenames: %s' % filenames) fout = fout or sys.stdout reporter = BasicReporter(self.cov_file) # convert the report output to a more useful generator data_iter = [] for file, executable_lines, not_executed, summary in reporter.report_filenames(filenames): # executable lines are lines that can "run" versus comments/etc if len(executable_lines) == 0: percent_executed = 100 else: percent_executed = 100*(len(executable_lines) - len(not_executed) + 0.)/len(executable_lines) data_iter.append((file, not_executed, 'MISSING', percent_executed)) filtered_names = self.filter_old_files(data_iter) for filename, lines, status, percent in filtered_names: # if filenames and filename not in filenames: # continue if status == 'OLD': fout.write('OLD:?\n') # don't bother writing out stale data continue elif status: fout.write('SUCCESS:%d\n' % percent) if combine_nums: for line_chunk in combine_linenums(lines): fout.write('%s:%s:%s\n' %(filename, line_chunk, status)) else: for num in lines: fout.write('%s:%s:%s\n' %(filename, num, status)) def filter_old_files(self, data_iter): cov_date = os.stat(self.cov_file).st_mtime LOG.debug("FILTER COV MTIME %s " % cov_date) file_date = None prev_file = None for data in data_iter: filename = data[0] if prev_file is None or prev_file != filename: file_date = os.stat(filename).st_mtime if file_date > cov_date: LOG.debug("FILTERING %s date: %s > %s" % (filename, file_date, cov_date)) # assume that file has been tweeked and data is wrong data = list(data) data[2] = "OLD" yield data prev_file = filename def parent_dirs(start_file): """ find parent dirs >>> list(parent_dirs('/usr/lib/python')) ['/usr/lib', '/usr', '/'] """ start_path = os.path.abspath(start_file) start_dir = os.path.dirname(start_path) done = False while not done: yield start_dir next_dir = os.path.dirname(start_dir) done = next_dir == start_dir start_dir = next_dir def is_older(filename, other_mtime): mtime = os.stat(filename).st_mtime return mtime > other_mtime class OldFile(Exception): pass def find_coverage_file(start_file, file_to_find='.coverage'): start_mtime = os.stat(start_file).st_mtime for parent in parent_dirs(start_file): potential = os.path.join(parent, file_to_find) LOG.debug('Potential: %s' % potential) if not os.path.exists(potential): LOG.debug('No file: %s' % potential) continue if is_older(potential, start_mtime): LOG.debug('FOUND! newer: %s' % potential) return potential else: LOG.debug('OLDER: %s' % potential) raise OldFile() return None def combine_linenums(linenums): """ >>> list(combine_linenums([1,2,3])) ['1-3'] >>> list(combine_linenums([1,3])) ['1', '3'] >>> list(combine_linenums([1,3,5,6,7])) ['1', '3', '5-7'] >>> list(combine_linenums([1,2,4,5,6])) ['1-2', '4-6'] """ prev_start = None prev_num = None for num in linenums: if prev_start is None: prev_start = num elif prev_num + 1 != num: if prev_start == prev_num: yield '%d' % prev_num else: yield '%d-%d' %(prev_start, prev_num) prev_start = num prev_num = num if prev_num and prev_start: if prev_start == prev_num: yield '%d' % prev_num else: yield '%d-%d' %(prev_start, num) elif prev_num: yield '%d' % prev_num def _test(): import doctest doctest.testmod() def main(prog_args): parser = optparse.OptionParser(version=meta.__version__) parser.add_option('--coverage-file') parser.add_option('--python-file', help='specify Python file to analyze') group = optparse.OptionGroup(parser, "Flymake mode") group.add_option('--flymake', action='store_true', help='spit out flymake compatible output (requires --python-file)') parser.add_option_group(group) compile_group = optparse.OptionGroup(parser, "Compile mode") group.add_option('--compile-mode', action='store_true', help='spit out compile compatible output') parser.add_option_group(compile_group) func_group = optparse.OptionGroup(parser, "Run a function with coverage") func_group.add_option('--function-name', help='Report on coverage for tests for this function (requires --python-file)') parser.add_option_group(func_group) parser.add_option('-t', '--run-tests', action='store_true', help='run doctests') opt, args = parser.parse_args(prog_args) if opt.run_tests: _test() return if opt.flymake or opt.compile_mode: c2e = None if opt.coverage_file: c2e = Coverage2Emacs(opt.coverage_file) elif opt.python_file: try: cov = find_coverage_file(opt.python_file) except OldFile: sys.stderr.write("OLD") return if cov: c2e = Coverage2Emacs(cov) if c2e is None: sys.stderr.write("NO COVERAGE FILE::") return if opt.function_name: import findtests # requires nose findtests.get_coverage_for_function(opt.function_name, opt.python_file) cov = find_coverage_file(opt.python_file) c2e = Coverage2Emacs(cov) if opt.flymake: c2e.to_emacs_flymake_mode(opt.python_file) elif opt.compile_mode: filenames = [] if opt.python_file: filenames.append(opt.python_file) c2e.to_emacs_compile_mode(filenames=filenames) if __name__ == '__main__': sys.exit(main(sys.argv))
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ============================================================================= # Created By : Simon Schaefer # Description : Task aware image downscaling autoencoder model - SCALING. # Convolutional layers only (no resblocks). # ============================================================================= import torch from torch import nn from tar.modules import _Resblock_, _ReversePixelShuffle_ def build_net(): return CONV_ONLY_LARGE() class CONV_ONLY_LARGE(nn.Module): def __init__(self): super(CONV_ONLY_LARGE, self).__init__() # Build encoding part. self._downscaling = nn.Sequential( nn.Conv2d(3, 8, 3, stride=1, padding=1), nn.Conv2d(8, 16, 3, stride=1, padding=1), _ReversePixelShuffle_(downscale_factor=2), ) self._conv_en1 = nn.Conv2d(64, 64, 3, stride=1, padding=1) self._conv_en2 = nn.Conv2d(64, 64, 3, stride=1, padding=1) self._conv_en3 = nn.Conv2d(64, 64, 3, stride=1, padding=1) self._conv_en4 = nn.Conv2d(64, 64, 3, stride=1, padding=1) self._conv_en5 = nn.Conv2d(64, 3, 3, stride=1, padding=1) # Build decoding part. self._conv_de1 = nn.Conv2d(3, 64, 3, stride=1, padding=1) self._conv_de2 = nn.Conv2d(64, 64, 3, stride=1, padding=1) self._conv_de3 = nn.Conv2d(64, 64, 3, stride=1, padding=1) self._conv_de4 = nn.Conv2d(64, 64, 3, stride=1, padding=1) self._conv_de5 = nn.Conv2d(64, 64, 3, stride=1, padding=1) self._upscaling = nn.Sequential( nn.Conv2d(64, 256, 3, stride=1, padding=1), nn.PixelShuffle(upscale_factor=2), nn.Conv2d(64, 3, 3, stride=1, padding=1) ) def encode(self, x: torch.Tensor) -> torch.Tensor: # b, 3, p, p x = self._downscaling(x) # b, 64, p/2, p/2 residual = x x = self._conv_en1(x) # b, 64, p/2, p/2 x = self._conv_en2(x) # b, 64, p/2, p/2 x = torch.add(residual, x) # b, 64, p/2, p/2 x = self._conv_en3(x) # b, 64, p/2, p/2 x = self._conv_en4(x) # b, 64, p/2, p/2 x = torch.add(residual, x) # b, 64, p/2, p/2 x = self._conv_en5(x) # b, 3, p/2, p/2 return x def decode(self, x: torch.Tensor) -> torch.Tensor: x = self._conv_de1(x) # b, 64, p/2, p/2 residual = x x = self._conv_de2(x) # b, 64, p/2, p/2 x = self._conv_de3(x) # b, 64, p/2, p/2 x = torch.add(residual, x) # b, 64, p/2, p/2 x = self._conv_de4(x) # b, 64, p/2, p/2 x = self._conv_de5(x) # b, 64, p/2, p/2 x = torch.add(residual, x) # b, 64, p/2, p/2 x = self._upscaling(x) # b, 3, p, p return x def forward(self, x: torch.Tensor) -> torch.Tensor: return self.decode(self.encode(x))
#!/usr/bin/python # # Copyright (C) 2008 Google 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. """Contains extensions to ElementWrapper objects used with Google Contacts.""" __author__ = 'dbrattli (Dag Brattli)' import atom import gdata ## Constants from http://code.google.com/apis/gdata/elements.html ## REL_HOME = 'http://schemas.google.com/g/2005#home' REL_WORK = 'http://schemas.google.com/g/2005#work' REL_OTHER = 'http://schemas.google.com/g/2005#other' IM_AIM = 'http://schemas.google.com/g/2005#AIM' # AOL Instant Messenger protocol IM_MSN = 'http://schemas.google.com/g/2005#MSN' # MSN Messenger protocol IM_YAHOO = 'http://schemas.google.com/g/2005#YAHOO' # Yahoo Messenger protocol IM_SKYPE = 'http://schemas.google.com/g/2005#SKYPE' # Skype protocol IM_QQ = 'http://schemas.google.com/g/2005#QQ' # QQ protocol IM_GOOGLE_TALK = 'http://schemas.google.com/g/2005#GOOGLE_TALK' # Google Talk protocol IM_ICQ = 'http://schemas.google.com/g/2005#ICQ' # ICQ protocol IM_JABBER = 'http://schemas.google.com/g/2005#JABBER' # Jabber protocol class OrgName(atom.AtomBase): _tag = 'orgName' _namespace = gdata.GDATA_NAMESPACE _children = atom.AtomBase._children.copy() _attributes = atom.AtomBase._attributes.copy() def __init__(self, text=None, extension_elements=None, extension_attributes=None): self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} class OrgTitle(atom.AtomBase): _tag = 'orgTitle' _namespace = gdata.GDATA_NAMESPACE _children = atom.AtomBase._children.copy() _attributes = atom.AtomBase._attributes.copy() def __init__(self, text=None, extension_elements=None, extension_attributes=None): self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} class Organization(atom.AtomBase): _tag = 'organization' _namespace = gdata.GDATA_NAMESPACE _children = atom.AtomBase._children.copy() _attributes = atom.AtomBase._attributes.copy() _attributes['rel'] = 'rel' _attributes['label'] = 'label' _attributes['primary'] = 'primary' _children['{%s}orgName' % gdata.GDATA_NAMESPACE] = ('org_name', OrgName) _children['{%s}orgTitle' % gdata.GDATA_NAMESPACE] = ('org_title', OrgTitle) def __init__(self, rel=None, primary='false', org_name=None, org_title=None, label=None, text=None, extension_elements=None, extension_attributes=None): self.rel = rel or REL_OTHER self.primary = primary self.org_name = org_name self.org_title = org_title self.label = label self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} class PostalAddress(atom.AtomBase): _tag = 'postalAddress' _namespace = gdata.GDATA_NAMESPACE _children = atom.AtomBase._children.copy() _attributes = atom.AtomBase._attributes.copy() _attributes['primary'] = 'primary' _attributes['rel'] = 'rel' def __init__(self, primary=None, rel=None, text=None, extension_elements=None, extension_attributes=None): self.primary = primary self.rel = rel or REL_OTHER self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} class IM(atom.AtomBase): _tag = 'im' _namespace = gdata.GDATA_NAMESPACE _children = atom.AtomBase._children.copy() _attributes = atom.AtomBase._attributes.copy() _attributes['address'] = 'address' _attributes['primary'] = 'primary' _attributes['protocol'] = 'protocol' _attributes['label'] = 'label' _attributes['rel'] = 'rel' def __init__(self, primary=None, rel=None, address=None, protocol=None, label=None, text=None, extension_elements=None, extension_attributes=None): self.protocol = protocol self.address = address self.primary = primary self.rel = rel or REL_OTHER self.label = label self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} class Email(atom.AtomBase): _tag = 'email' _namespace = gdata.GDATA_NAMESPACE _children = atom.AtomBase._children.copy() _attributes = atom.AtomBase._attributes.copy() _attributes['address'] = 'address' _attributes['primary'] = 'primary' _attributes['rel'] = 'rel' _attributes['label'] = 'label' def __init__(self, primary=None, rel=None, address=None, text=None, label=None, extension_elements=None, extension_attributes=None): self.address = address self.primary = primary self.rel = rel or REL_OTHER self.label = label self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} class PhoneNumber(atom.AtomBase): _tag = 'phoneNumber' _namespace = gdata.GDATA_NAMESPACE _children = atom.AtomBase._children.copy() _attributes = atom.AtomBase._attributes.copy() _attributes['primary'] = 'primary' _attributes['rel'] = 'rel' def __init__(self, primary=None, rel=None, text=None, extension_elements=None, extension_attributes=None): self.primary = primary self.rel = rel or REL_OTHER self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} class Deleted(atom.AtomBase): _tag = 'deleted' _namespace = gdata.GDATA_NAMESPACE def __init__(self, text=None, extension_elements=None, extension_attributes=None): self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} class ContactEntry(gdata.BatchEntry): """A Google Contact flavor of an Atom Entry """ _tag = gdata.BatchEntry._tag _namespace = gdata.BatchEntry._namespace _children = gdata.BatchEntry._children.copy() _attributes = gdata.BatchEntry._attributes.copy() _children['{%s}postalAddress' % gdata.GDATA_NAMESPACE] = ('postal_address', [PostalAddress]) _children['{%s}phoneNumber' % gdata.GDATA_NAMESPACE] = ('phone_number', [PhoneNumber]) _children['{%s}organization' % gdata.GDATA_NAMESPACE] = ('organization', Organization) _children['{%s}email' % gdata.GDATA_NAMESPACE] = ('email', [Email]) _children['{%s}im' % gdata.GDATA_NAMESPACE] = ('im', [IM]) _children['{%s}deleted' % gdata.GDATA_NAMESPACE] = ('deleted', Deleted) def __init__(self, author=None, category=None, content=None, atom_id=None, link=None, published=None, title=None, updated=None, transparency=None, comments=None, email=None, postal_address=None, deleted=None, organization=None, phone_number=None, im=None, extended_property=None, original_event=None, batch_operation=None, batch_id=None, batch_status=None, extension_elements=None, extension_attributes=None, text=None): gdata.BatchEntry.__init__(self, author=author, category=category, content=content, atom_id=atom_id, link=link, published=published, batch_operation=batch_operation, batch_id=batch_id, batch_status=batch_status, title=title, updated=updated) self.transparency = transparency self.comments = comments self.organization = organization self.deleted = deleted self.phone_number = phone_number or [] self.postal_address = postal_address or [] self.im = im or [] self.extended_property = extended_property or [] self.email = email or [] self.text = text self.extension_elements = extension_elements or [] self.extension_attributes = extension_attributes or {} def ContactEntryFromString(xml_string): return atom.CreateClassFromXMLString(ContactEntry, xml_string) class ContactsFeed(gdata.GDataFeed, gdata.LinkFinder): """A Google Contacts feed flavor of an Atom Feed""" _tag = gdata.GDataFeed._tag _namespace = gdata.GDataFeed._namespace _children = gdata.GDataFeed._children.copy() _attributes = gdata.GDataFeed._attributes.copy() _children['{%s}entry' % atom.ATOM_NAMESPACE] = ('entry', [ContactEntry]) def __init__(self, author=None, category=None, contributor=None, generator=None, icon=None, atom_id=None, link=None, logo=None, rights=None, subtitle=None, title=None, updated=None, entry=None, total_results=None, start_index=None, items_per_page=None, extension_elements=None, extension_attributes=None, text=None): gdata.GDataFeed.__init__(self, author=author, category=category, contributor=contributor, generator=generator, icon=icon, atom_id=atom_id, link=link, logo=logo, rights=rights, subtitle=subtitle, title=title, updated=updated, entry=entry, total_results=total_results, start_index=start_index, items_per_page=items_per_page, extension_elements=extension_elements, extension_attributes=extension_attributes, text=text) def ContactsFeedFromString(xml_string): return atom.CreateClassFromXMLString(ContactsFeed, xml_string)
#!/usr/bin/env python3 '''fhnwtoys ~ package Copyright (C) 2020 Dominik Müller and Nico Canzani ''' from setuptools import setup, find_packages setup(name='fhnwtoys', version='1.0', packages=find_packages())
from csdl.core.standard_operation import StandardOperation from csdl.core.node import Node class indexed_passthrough(StandardOperation): def __init__(self, *args, output, **kwargs): self.nargs = None self.nouts = 1 super().__init__(*args, **kwargs) self.outs = [output]
# Generated by Django 3.2 on 2021-04-12 10:27 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('AnalysisApp', '0002_alter_users_departmentid'), ] operations = [ migrations.RenameField( model_name='team', old_name='DepartmentId', new_name='TeamId', ), migrations.RenameField( model_name='team', old_name='DepartmentName', new_name='TeamName', ), migrations.RenameField( model_name='users', old_name='DepartmentId', new_name='TeamId', ), ]
import numpy as np class InfoManager(): def __init__(self,server, pid): self.server=server self.pid=pid self.info={} self.kind='InfoManager' self.itype_fromto={ 'ping':0, 'player_data':1, } def get_data(self, pid): info_string='/'.join([ '{}|'.format(self.itype_fromto[info])+'|'.join(['{}'.format(par) for par in self.info[pid][info]]) for info in self.info[pid] if info in self.itype_fromto]) return '0:[' + info_string +']' def update(self): for pid in self.server.entity_manager.entities: if self.server.entity_manager.entities[pid].kind=='Character': self.info[pid]['ping']=[0] self.info[pid]['player_data']=[int(self.server.entity_manager.entities[pid].health)]
# 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 datetime import mock from oslo_config import cfg from oslo_utils import timeutils from oslo_utils import uuidutils from wsme import types as wtypes from magnum.api import attr_validator from magnum.api.controllers.v1 import bay as api_bay from magnum.common import exception from magnum.conductor import api as rpcapi from magnum import objects from magnum.tests import base from magnum.tests.unit.api import base as api_base from magnum.tests.unit.api import utils as apiutils from magnum.tests.unit.objects import utils as obj_utils class TestBayObject(base.TestCase): def test_bay_init(self): bay_dict = apiutils.bay_post_data(baymodel_id=None) del bay_dict['node_count'] del bay_dict['master_count'] del bay_dict['bay_create_timeout'] bay = api_bay.Bay(**bay_dict) self.assertEqual(1, bay.node_count) self.assertEqual(1, bay.master_count) self.assertEqual(60, bay.bay_create_timeout) # test unset value for baymodel_id bay.baymodel_id = wtypes.Unset self.assertEqual(wtypes.Unset, bay.baymodel_id) # test backwards compatibility of bay fields with new objects bay_dict['bay_create_timeout'] = 15 bay_dict['bay_faults'] = {'testfault': 'fault'} bay = api_bay.Bay(**bay_dict) self.assertEqual(15, bay.bay_create_timeout) self.assertEqual(15, bay.create_timeout) self.assertIn('testfault', bay.bay_faults) self.assertIn('testfault', bay.faults) def test_as_dict_faults(self): bay_dict = apiutils.bay_post_data(baymodel_id=None) del bay_dict['node_count'] del bay_dict['master_count'] del bay_dict['bay_create_timeout'] bay = api_bay.Bay(**bay_dict) bay.bay_faults = {'testfault': 'fault'} dict = bay.as_dict() self.assertEqual({'testfault': 'fault'}, dict['faults']) class TestListBay(api_base.FunctionalTest): _bay_attrs = ("name", "baymodel_id", "node_count", "status", "master_count", "stack_id", "bay_create_timeout") _expand_bay_attrs = ("name", "baymodel_id", "node_count", "status", "api_address", "discovery_url", "node_addresses", "master_count", "master_addresses", "stack_id", "bay_create_timeout", "status_reason") def setUp(self): super(TestListBay, self).setUp() obj_utils.create_test_cluster_template(self.context) def test_empty(self): response = self.get_json('/bays') self.assertEqual([], response['bays']) def test_one(self): bay = obj_utils.create_test_cluster(self.context) response = self.get_json('/bays') self.assertEqual(bay.uuid, response['bays'][0]["uuid"]) self._verify_attrs(self._bay_attrs, response['bays'][0]) # Verify atts that should not appear from bay's get_all response none_attrs = set(self._expand_bay_attrs) - set(self._bay_attrs) self._verify_attrs(none_attrs, response['bays'][0], positive=False) def test_get_one(self): bay = obj_utils.create_test_cluster(self.context) response = self.get_json('/bays/%s' % bay['uuid']) self.assertEqual(bay.uuid, response['uuid']) self._verify_attrs(self._expand_bay_attrs, response) @mock.patch('magnum.common.clients.OpenStackClients.heat') def test_get_one_failed_bay(self, mock_heat): fake_resources = mock.MagicMock() fake_resources.resource_name = 'fake_name' fake_resources.resource_status_reason = 'fake_reason' ht = mock.MagicMock() ht.resources.list.return_value = [fake_resources] mock_heat.return_value = ht bay = obj_utils.create_test_cluster(self.context, status='CREATE_FAILED') response = self.get_json('/bays/%s' % bay['uuid']) self.assertEqual(bay.uuid, response['uuid']) self.assertEqual({'fake_name': 'fake_reason'}, response['bay_faults']) @mock.patch('magnum.common.clients.OpenStackClients.heat') def test_get_one_failed_bay_heatclient_exception(self, mock_heat): mock_heat.resources.list.side_effect = Exception('fake') bay = obj_utils.create_test_cluster(self.context, status='CREATE_FAILED') response = self.get_json('/bays/%s' % bay['uuid']) self.assertEqual(bay.uuid, response['uuid']) self.assertEqual({}, response['bay_faults']) def test_get_one_by_name(self): bay = obj_utils.create_test_cluster(self.context) response = self.get_json('/bays/%s' % bay['name']) self.assertEqual(bay.uuid, response['uuid']) self._verify_attrs(self._expand_bay_attrs, response) def test_get_one_by_name_not_found(self): response = self.get_json( '/bays/not_found', expect_errors=True) self.assertEqual(404, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue(response.json['errors']) def test_get_one_by_name_multiple_bay(self): obj_utils.create_test_cluster(self.context, name='test_bay', uuid=uuidutils.generate_uuid()) obj_utils.create_test_cluster(self.context, name='test_bay', uuid=uuidutils.generate_uuid()) response = self.get_json('/bays/test_bay', expect_errors=True) self.assertEqual(409, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue(response.json['errors']) def test_get_all_with_pagination_marker(self): bay_list = [] for id_ in range(4): bay = obj_utils.create_test_cluster(self.context, id=id_, uuid=uuidutils.generate_uuid()) bay_list.append(bay) response = self.get_json('/bays?limit=3&marker=%s' % bay_list[2].uuid) self.assertEqual(1, len(response['bays'])) self.assertEqual(bay_list[-1].uuid, response['bays'][0]['uuid']) def test_detail(self): bay = obj_utils.create_test_cluster(self.context) response = self.get_json('/bays/detail') self.assertEqual(bay.uuid, response['bays'][0]["uuid"]) self._verify_attrs(self._expand_bay_attrs, response['bays'][0]) def test_detail_with_pagination_marker(self): bay_list = [] for id_ in range(4): bay = obj_utils.create_test_cluster(self.context, id=id_, uuid=uuidutils.generate_uuid()) bay_list.append(bay) response = self.get_json('/bays/detail?limit=3&marker=%s' % bay_list[2].uuid) self.assertEqual(1, len(response['bays'])) self.assertEqual(bay_list[-1].uuid, response['bays'][0]['uuid']) self._verify_attrs(self._expand_bay_attrs, response['bays'][0]) def test_detail_against_single(self): bay = obj_utils.create_test_cluster(self.context) response = self.get_json('/bays/%s/detail' % bay['uuid'], expect_errors=True) self.assertEqual(404, response.status_int) def test_many(self): bm_list = [] for id_ in range(5): bay = obj_utils.create_test_cluster(self.context, id=id_, uuid=uuidutils.generate_uuid()) bm_list.append(bay.uuid) response = self.get_json('/bays') self.assertEqual(len(bm_list), len(response['bays'])) uuids = [b['uuid'] for b in response['bays']] self.assertEqual(sorted(bm_list), sorted(uuids)) def test_links(self): uuid = uuidutils.generate_uuid() obj_utils.create_test_cluster(self.context, id=1, uuid=uuid) response = self.get_json('/bays/%s' % uuid) self.assertIn('links', response.keys()) self.assertEqual(2, len(response['links'])) self.assertIn(uuid, response['links'][0]['href']) for l in response['links']: bookmark = l['rel'] == 'bookmark' self.assertTrue(self.validate_link(l['href'], bookmark=bookmark)) def test_collection_links(self): for id_ in range(5): obj_utils.create_test_cluster(self.context, id=id_, uuid=uuidutils.generate_uuid()) response = self.get_json('/bays/?limit=3') self.assertEqual(3, len(response['bays'])) next_marker = response['bays'][-1]['uuid'] self.assertIn(next_marker, response['next']) def test_collection_links_default_limit(self): cfg.CONF.set_override('max_limit', 3, 'api') for id_ in range(5): obj_utils.create_test_cluster(self.context, id=id_, uuid=uuidutils.generate_uuid()) response = self.get_json('/bays') self.assertEqual(3, len(response['bays'])) next_marker = response['bays'][-1]['uuid'] self.assertIn(next_marker, response['next']) class TestPatch(api_base.FunctionalTest): def setUp(self): super(TestPatch, self).setUp() self.cluster_template = obj_utils.create_test_cluster_template( self.context) self.bay = obj_utils.create_test_cluster(self.context, name='bay_example_A', node_count=3) p = mock.patch.object(rpcapi.API, 'cluster_update') self.mock_bay_update = p.start() self.mock_bay_update.side_effect = self._simulate_rpc_bay_update self.addCleanup(p.stop) def _simulate_rpc_bay_update(self, bay, rollback=False): bay.save() return bay @mock.patch('oslo_utils.timeutils.utcnow') def test_replace_ok(self, mock_utcnow): new_node_count = 4 test_time = datetime.datetime(2000, 1, 1, 0, 0) mock_utcnow.return_value = test_time response = self.patch_json('/bays/%s' % self.bay.uuid, [{'path': '/node_count', 'value': new_node_count, 'op': 'replace'}]) self.assertEqual('application/json', response.content_type) self.assertEqual(200, response.status_code) response = self.get_json('/bays/%s' % self.bay.uuid) self.assertEqual(new_node_count, response['node_count']) return_updated_at = timeutils.parse_isotime( response['updated_at']).replace(tzinfo=None) self.assertEqual(test_time, return_updated_at) # Assert nothing else was changed self.assertEqual(self.bay.uuid, response['uuid']) self.assertEqual(self.bay.cluster_template_id, response['baymodel_id']) @mock.patch('oslo_utils.timeutils.utcnow') def test_replace_ok_by_name(self, mock_utcnow): new_node_count = 4 test_time = datetime.datetime(2000, 1, 1, 0, 0) mock_utcnow.return_value = test_time response = self.patch_json('/bays/%s' % self.bay.name, [{'path': '/node_count', 'value': new_node_count, 'op': 'replace'}]) self.assertEqual('application/json', response.content_type) self.assertEqual(200, response.status_code) response = self.get_json('/bays/%s' % self.bay.uuid) self.assertEqual(new_node_count, response['node_count']) return_updated_at = timeutils.parse_isotime( response['updated_at']).replace(tzinfo=None) self.assertEqual(test_time, return_updated_at) # Assert nothing else was changed self.assertEqual(self.bay.uuid, response['uuid']) self.assertEqual(self.bay.cluster_template_id, response['baymodel_id']) @mock.patch('oslo_utils.timeutils.utcnow') def test_replace_ok_by_name_not_found(self, mock_utcnow): name = 'not_found' test_time = datetime.datetime(2000, 1, 1, 0, 0) mock_utcnow.return_value = test_time response = self.patch_json('/bays/%s' % name, [{'path': '/name', 'value': name, 'op': 'replace'}], expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(404, response.status_code) def test_replace_baymodel_id_failed(self): cluster_template = obj_utils.create_test_cluster_template( self.context, uuid=uuidutils.generate_uuid()) response = self.patch_json('/bays/%s' % self.bay.uuid, [{'path': '/baymodel_id', 'value': cluster_template.uuid, 'op': 'replace'}], expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_code) self.assertTrue(response.json['errors']) @mock.patch('oslo_utils.timeutils.utcnow') def test_replace_ok_by_name_multiple_bay(self, mock_utcnow): test_time = datetime.datetime(2000, 1, 1, 0, 0) mock_utcnow.return_value = test_time obj_utils.create_test_cluster(self.context, name='test_bay', uuid=uuidutils.generate_uuid()) obj_utils.create_test_cluster(self.context, name='test_bay', uuid=uuidutils.generate_uuid()) response = self.patch_json('/bays/test_bay', [{'path': '/name', 'value': 'test_bay', 'op': 'replace'}], expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(409, response.status_code) def test_replace_non_existent_baymodel_id(self): response = self.patch_json('/bays/%s' % self.bay.uuid, [{'path': '/baymodel_id', 'value': uuidutils.generate_uuid(), 'op': 'replace'}], expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_code) self.assertTrue(response.json['errors']) def test_replace_invalid_node_count(self): response = self.patch_json('/bays/%s' % self.bay.uuid, [{'path': '/node_count', 'value': -1, 'op': 'replace'}], expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_code) self.assertTrue(response.json['errors']) def test_replace_non_existent_bay(self): response = self.patch_json('/bays/%s' % uuidutils.generate_uuid(), [{'path': '/name', 'value': 'bay_example_B', 'op': 'replace'}], expect_errors=True) self.assertEqual(404, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue(response.json['errors']) def test_replace_bay_name_failed(self): response = self.patch_json('/bays/%s' % self.bay.uuid, [{'path': '/name', 'value': 'bay_example_B', 'op': 'replace'}], expect_errors=True) self.assertEqual(400, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue(response.json['errors']) def test_add_non_existent_property(self): response = self.patch_json( '/bays/%s' % self.bay.uuid, [{'path': '/foo', 'value': 'bar', 'op': 'add'}], expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) @mock.patch.object(rpcapi.API, 'cluster_update_async') def test_update_bay_async(self, mock_update): response = self.patch_json( '/bays/%s' % self.bay.name, [{'path': '/node_count', 'value': 4, 'op': 'replace'}], headers={'OpenStack-API-Version': 'container-infra 1.2'}) self.assertEqual(202, response.status_code) @mock.patch.object(rpcapi.API, 'cluster_update_async') def test_update_bay_with_rollback_enabled(self, mock_update): response = self.patch_json( '/bays/%s/?rollback=True' % self.bay.name, [{'path': '/node_count', 'value': 4, 'op': 'replace'}], headers={'OpenStack-API-Version': 'container-infra 1.3'}) mock_update.assert_called_once_with(mock.ANY, rollback=True) self.assertEqual(202, response.status_code) def test_remove_ok(self): response = self.get_json('/bays/%s' % self.bay.uuid) self.assertIsNotNone(response['name']) response = self.patch_json('/bays/%s' % self.bay.uuid, [{'path': '/node_count', 'op': 'remove'}]) self.assertEqual('application/json', response.content_type) self.assertEqual(200, response.status_code) response = self.get_json('/bays/%s' % self.bay.uuid) # only allow node_count for bay, and default value is 1 self.assertEqual(1, response['node_count']) # Assert nothing else was changed self.assertEqual(self.bay.uuid, response['uuid']) self.assertEqual(self.bay.cluster_template_id, response['baymodel_id']) self.assertEqual(self.bay.name, response['name']) self.assertEqual(self.bay.master_count, response['master_count']) def test_remove_mandatory_property_fail(self): mandatory_properties = ('/uuid', '/baymodel_id') for p in mandatory_properties: response = self.patch_json('/bays/%s' % self.bay.uuid, [{'path': p, 'op': 'remove'}], expect_errors=True) self.assertEqual(400, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue(response.json['errors']) def test_remove_non_existent_property(self): response = self.patch_json( '/bays/%s' % self.bay.uuid, [{'path': '/non-existent', 'op': 'remove'}], expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_code) self.assertTrue(response.json['errors']) class TestPost(api_base.FunctionalTest): def setUp(self): super(TestPost, self).setUp() self.cluster_template = obj_utils.create_test_cluster_template( self.context) p = mock.patch.object(rpcapi.API, 'cluster_create') self.mock_bay_create = p.start() self.mock_bay_create.side_effect = self._simulate_rpc_bay_create self.addCleanup(p.stop) p = mock.patch.object(attr_validator, 'validate_os_resources') self.mock_valid_os_res = p.start() self.addCleanup(p.stop) def _simulate_rpc_bay_create(self, bay, bay_create_timeout): bay.create() return bay @mock.patch('oslo_utils.timeutils.utcnow') def test_create_bay(self, mock_utcnow): bdict = apiutils.bay_post_data() test_time = datetime.datetime(2000, 1, 1, 0, 0) mock_utcnow.return_value = test_time response = self.post_json('/bays', bdict) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) # Check location header self.assertIsNotNone(response.location) self.assertTrue(uuidutils.is_uuid_like(response.json['uuid'])) self.assertNotIn('updated_at', response.json.keys) return_created_at = timeutils.parse_isotime( response.json['created_at']).replace(tzinfo=None) self.assertEqual(test_time, return_created_at) self.assertEqual(bdict['bay_create_timeout'], response.json['bay_create_timeout']) def test_create_bay_set_project_id_and_user_id(self): bdict = apiutils.bay_post_data() def _simulate_rpc_bay_create(bay, bay_create_timeout): self.assertEqual(self.context.project_id, bay.project_id) self.assertEqual(self.context.user_id, bay.user_id) bay.create() return bay self.mock_bay_create.side_effect = _simulate_rpc_bay_create self.post_json('/bays', bdict) def test_create_bay_doesnt_contain_id(self): with mock.patch.object(self.dbapi, 'create_cluster', wraps=self.dbapi.create_cluster) as cc_mock: bdict = apiutils.bay_post_data(name='bay_example_A') response = self.post_json('/bays', bdict) self.assertEqual(bdict['name'], response.json['name']) cc_mock.assert_called_once_with(mock.ANY) # Check that 'id' is not in first arg of positional args self.assertNotIn('id', cc_mock.call_args[0][0]) def test_create_bay_generate_uuid(self): bdict = apiutils.bay_post_data() del bdict['uuid'] response = self.post_json('/bays', bdict) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(bdict['name'], response.json['name']) self.assertTrue(uuidutils.is_uuid_like(response.json['uuid'])) def test_create_bay_no_baymodel_id(self): bdict = apiutils.bay_post_data() del bdict['baymodel_id'] response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) def test_create_bay_with_non_existent_baymodel_id(self): bdict = apiutils.bay_post_data(baymodel_id=uuidutils.generate_uuid()) response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_baymodel_name(self): bdict = apiutils.bay_post_data(baymodel_id=self.cluster_template.name) response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) def test_create_bay_with_node_count_zero(self): bdict = apiutils.bay_post_data() bdict['node_count'] = 0 response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_node_count_negative(self): bdict = apiutils.bay_post_data() bdict['node_count'] = -1 response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_no_node_count(self): bdict = apiutils.bay_post_data() del bdict['node_count'] response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(1, response.json['node_count']) def test_create_bay_with_master_count_zero(self): bdict = apiutils.bay_post_data() bdict['master_count'] = 0 response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_no_master_count(self): bdict = apiutils.bay_post_data() del bdict['master_count'] response = self.post_json('/bays', bdict) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(1, response.json['master_count']) def test_create_bay_with_invalid_long_name(self): bdict = apiutils.bay_post_data(name='x' * 243) response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_invalid_integer_name(self): bdict = apiutils.bay_post_data(name='123456') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_invalid_integer_str_name(self): bdict = apiutils.bay_post_data(name='123456test_bay') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_hyphen_invalid_at_start_name(self): bdict = apiutils.bay_post_data(name='-test_bay') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_period_invalid_at_start_name(self): bdict = apiutils.bay_post_data(name='.test_bay') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_underscore_invalid_at_start_name(self): bdict = apiutils.bay_post_data(name='_test_bay') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_valid_str_int_name(self): bdict = apiutils.bay_post_data(name='test_bay123456') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(response.json['name'], bdict['name']) def test_create_bay_with_hyphen_valid_name(self): bdict = apiutils.bay_post_data(name='test-bay') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(response.json['name'], bdict['name']) def test_create_bay_with_period_valid_name(self): bdict = apiutils.bay_post_data(name='test.bay') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(response.json['name'], bdict['name']) def test_create_bay_with_period_at_end_valid_name(self): bdict = apiutils.bay_post_data(name='testbay.') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(response.json['name'], bdict['name']) def test_create_bay_with_hyphen_at_end_valid_name(self): bdict = apiutils.bay_post_data(name='testbay-') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(response.json['name'], bdict['name']) def test_create_bay_with_underscore_at_end_valid_name(self): bdict = apiutils.bay_post_data(name='testbay_') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(response.json['name'], bdict['name']) def test_create_bay_with_mix_special_char_valid_name(self): bdict = apiutils.bay_post_data(name='test.-_bay') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(response.json['name'], bdict['name']) def test_create_bay_with_capital_letter_start_valid_name(self): bdict = apiutils.bay_post_data(name='Testbay') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertEqual(response.json['name'], bdict['name']) def test_create_bay_with_invalid_empty_name(self): bdict = apiutils.bay_post_data(name='') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_without_name(self): bdict = apiutils.bay_post_data() del bdict['name'] response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) self.assertIsNotNone(response.json['name']) def test_create_bay_with_timeout_none(self): bdict = apiutils.bay_post_data() bdict['bay_create_timeout'] = None response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) def test_create_bay_with_no_timeout(self): def _simulate_rpc_bay_create(bay, bay_create_timeout): self.assertEqual(60, bay_create_timeout) bay.create() return bay self.mock_bay_create.side_effect = _simulate_rpc_bay_create bdict = apiutils.bay_post_data() del bdict['bay_create_timeout'] response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) def test_create_bay_with_timeout_negative(self): bdict = apiutils.bay_post_data() bdict['bay_create_timeout'] = -1 response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) self.assertTrue(response.json['errors']) def test_create_bay_with_timeout_zero(self): bdict = apiutils.bay_post_data() bdict['bay_create_timeout'] = 0 response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) def test_create_bay_with_invalid_flavor(self): bdict = apiutils.bay_post_data() self.mock_valid_os_res.side_effect = exception.FlavorNotFound( 'test-flavor') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertTrue(self.mock_valid_os_res.called) self.assertEqual(400, response.status_int) def test_create_bay_with_invalid_ext_network(self): bdict = apiutils.bay_post_data() self.mock_valid_os_res.side_effect = exception.ExternalNetworkNotFound( 'test-net') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertTrue(self.mock_valid_os_res.called) self.assertEqual(400, response.status_int) def test_create_bay_with_invalid_keypair(self): bdict = apiutils.bay_post_data() self.mock_valid_os_res.side_effect = exception.KeyPairNotFound( 'test-key') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertTrue(self.mock_valid_os_res.called) self.assertEqual(404, response.status_int) def test_create_bay_with_nonexist_image(self): bdict = apiutils.bay_post_data() self.mock_valid_os_res.side_effect = exception.ImageNotFound( 'test-img') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertTrue(self.mock_valid_os_res.called) self.assertEqual(400, response.status_int) def test_create_bay_with_multi_images_same_name(self): bdict = apiutils.bay_post_data() self.mock_valid_os_res.side_effect = exception.Conflict('test-img') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertTrue(self.mock_valid_os_res.called) self.assertEqual(409, response.status_int) def test_create_bay_with_on_os_distro_image(self): bdict = apiutils.bay_post_data() self.mock_valid_os_res.side_effect = exception.OSDistroFieldNotFound( 'img') response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertTrue(self.mock_valid_os_res.called) self.assertEqual(400, response.status_int) def test_create_bay_with_no_lb_one_node(self): cluster_template = obj_utils.create_test_cluster_template( self.context, name='foo', uuid='foo', master_lb_enabled=False) bdict = apiutils.bay_post_data(baymodel_id=cluster_template.name, master_count=1) response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) def test_create_bay_with_no_lb_multi_node(self): cluster_template = obj_utils.create_test_cluster_template( self.context, name='foo', uuid='foo', master_lb_enabled=False) bdict = apiutils.bay_post_data(baymodel_id=cluster_template.name, master_count=3) response = self.post_json('/bays', bdict, expect_errors=True) self.assertEqual('application/json', response.content_type) self.assertEqual(400, response.status_int) def test_create_bay_with_docker_volume_size(self): bdict = apiutils.bay_post_data() bdict['docker_volume_size'] = 3 response = self.post_json('/bays', bdict) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) bay, timeout = self.mock_bay_create.call_args self.assertEqual(3, bay[0].docker_volume_size) def test_create_bay_without_docker_volume_size(self): bdict = apiutils.bay_post_data() # Remove the default docker_volume_size from the bay dict. del bdict['docker_volume_size'] response = self.post_json('/bays', bdict) self.assertEqual('application/json', response.content_type) self.assertEqual(201, response.status_int) bay, timeout = self.mock_bay_create.call_args # Verify docker_volume_size from BayModel is used self.assertEqual(20, bay[0].docker_volume_size) class TestDelete(api_base.FunctionalTest): def setUp(self): super(TestDelete, self).setUp() self.cluster_template = obj_utils.create_test_cluster_template( self.context) self.bay = obj_utils.create_test_cluster(self.context) p = mock.patch.object(rpcapi.API, 'cluster_delete') self.mock_bay_delete = p.start() self.mock_bay_delete.side_effect = self._simulate_rpc_bay_delete self.addCleanup(p.stop) def _simulate_rpc_bay_delete(self, bay_uuid): bay = objects.Cluster.get_by_uuid(self.context, bay_uuid) bay.destroy() def test_delete_bay(self): self.delete('/bays/%s' % self.bay.uuid) response = self.get_json('/bays/%s' % self.bay.uuid, expect_errors=True) self.assertEqual(404, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue(response.json['errors']) def test_delete_bay_not_found(self): uuid = uuidutils.generate_uuid() response = self.delete('/bays/%s' % uuid, expect_errors=True) self.assertEqual(404, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue(response.json['errors']) def test_delete_bay_with_name_not_found(self): response = self.delete('/bays/not_found', expect_errors=True) self.assertEqual(404, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue(response.json['errors']) def test_delete_bay_with_name(self): response = self.delete('/bays/%s' % self.bay.name, expect_errors=True) self.assertEqual(204, response.status_int) def test_delete_multiple_bay_by_name(self): obj_utils.create_test_cluster(self.context, name='test_bay', uuid=uuidutils.generate_uuid()) obj_utils.create_test_cluster(self.context, name='test_bay', uuid=uuidutils.generate_uuid()) response = self.delete('/bays/test_bay', expect_errors=True) self.assertEqual(409, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue(response.json['errors']) class TestBayPolicyEnforcement(api_base.FunctionalTest): def setUp(self): super(TestBayPolicyEnforcement, self).setUp() obj_utils.create_test_cluster_template(self.context) def _common_policy_check(self, rule, func, *arg, **kwarg): self.policy.set_rules({rule: "project:non_fake"}) response = func(*arg, **kwarg) self.assertEqual(403, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue( "Policy doesn't allow %s to be performed." % rule, response.json['errors'][0]['detail']) def test_policy_disallow_get_all(self): self._common_policy_check( "bay:get_all", self.get_json, '/bays', expect_errors=True) def test_policy_disallow_get_one(self): self.bay = obj_utils.create_test_cluster(self.context) self._common_policy_check( "bay:get", self.get_json, '/bays/%s' % self.bay.uuid, expect_errors=True) def test_policy_disallow_detail(self): self._common_policy_check( "bay:detail", self.get_json, '/bays/%s/detail' % uuidutils.generate_uuid(), expect_errors=True) def test_policy_disallow_update(self): self.bay = obj_utils.create_test_cluster(self.context, name='bay_example_A', node_count=3) self._common_policy_check( "bay:update", self.patch_json, '/bays/%s' % self.bay.name, [{'path': '/name', 'value': "new_name", 'op': 'replace'}], expect_errors=True) def test_policy_disallow_create(self): bdict = apiutils.bay_post_data(name='bay_example_A') self._common_policy_check( "bay:create", self.post_json, '/bays', bdict, expect_errors=True) def _simulate_rpc_bay_delete(self, bay_uuid): bay = objects.Cluster.get_by_uuid(self.context, bay_uuid) bay.destroy() def test_policy_disallow_delete(self): p = mock.patch.object(rpcapi.API, 'cluster_delete') self.mock_bay_delete = p.start() self.mock_bay_delete.side_effect = self._simulate_rpc_bay_delete self.addCleanup(p.stop) self.bay = obj_utils.create_test_cluster(self.context) self._common_policy_check( "bay:delete", self.delete, '/bays/%s' % self.bay.uuid, expect_errors=True) def _owner_check(self, rule, func, *args, **kwargs): self.policy.set_rules({rule: "user_id:%(user_id)s"}) response = func(*args, **kwargs) self.assertEqual(403, response.status_int) self.assertEqual('application/json', response.content_type) self.assertTrue( "Policy doesn't allow %s to be performed." % rule, response.json['errors'][0]['detail']) def test_policy_only_owner_get_one(self): bay = obj_utils.create_test_cluster(self.context, user_id='another') self._owner_check("bay:get", self.get_json, '/bays/%s' % bay.uuid, expect_errors=True) def test_policy_only_owner_update(self): bay = obj_utils.create_test_cluster(self.context, user_id='another') self._owner_check( "bay:update", self.patch_json, '/bays/%s' % bay.uuid, [{'path': '/name', 'value': "new_name", 'op': 'replace'}], expect_errors=True) def test_policy_only_owner_delete(self): bay = obj_utils.create_test_cluster(self.context, user_id='another') self._owner_check("bay:delete", self.delete, '/bays/%s' % bay.uuid, expect_errors=True)
import socket, struct, math, time def fk(l1, l2, t1, t2): th1 = math.radians(t1) th2 = math.radians(t2) x = l1*math.cos(th1) + l2*math.cos(th1+th2) y = l1*math.sin(th1) + l2*math.sin(th1+th2) return x, y host = "127.0.0.1" port = 5678 addr = (host, port) steps = 99 while True: t1 = float(input("theta1> ")) t2 = float(input("theta2> ")) print ("(x, y) = " + str(fk(1.0, 1.0, t1, t2))) step = 0 while True: d = step / steps (dt1, dt2) = (d * t1, d * t2) data = struct.pack("d d", math.radians(dt1), math.radians(dt2)) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.sendto(data, addr) sock.close() step += 1 if (step > steps): step = 0 break time.sleep (0.05) pass pass
def simple_replace(source): source = source.replace("isWalkable", "isAccessible") source = source.replace(".x()", ".x") source = source.replace(".y()", ".y") source = source.replace("groundWeaponMaxRange", "weaponMaxRange") source = source.replace("airWeaponMaxRange", "weaponMaxRange") source = source.replace("groundWeaponDamageCooldown", "weaponDamageCooldown") source = source.replace("energyUsed", "energyCost") source = source.replace("setReplayVision", "setVision") return source def warn_issues(filename): with open(filename) as myFile: for num, line in enumerate(myFile, 1): # getResources now returns last-known resource amount if unit # becomes inaccessible. if "getResources" in line: print("{}: getResources has changed.".format(num)) # Parameters changed from build(Unit, TilePosition) to build( def manual_fix(filename): deprecated_functions = ["getScreenBuffer", "changeRace", "startGame", "getUpgradeLevel"] with open(filename) as fp: for num, line in enumerate(fp, 1): for func in deprecated_functions: if func in line: print("{line}: {func} is deprecated.".format(line=num, func=func))
import os FIRST_VERSION = '1.00.00.00' def ReadVersion(version_filename): if os.path.exists(version_filename): return open(version_filename).readlines()[0] else: return FIRST_VERSION def ReadAndUpdateVersion(version_filename, update_position=None): """Takes given filename containing version, optionally updates the version and saves it, and returns the version.""" if os.path.exists(version_filename): current_version = open(version_filename).readlines()[0] numbers = current_version.split('.') if update_position: numbers[update_position] = '%02d' % (int(numbers[update_position]) + 1) if update_position < -1: numbers[update_position + 1:] = ['00'] * -(update_position + 1) version = '.'.join(numbers) else: version = FIRST_VERSION with open(version_filename, 'w') as fout: fout.write(version) print('\n'.join(['Version %s' % version])) return version
from unittest import mock import pytest from allauth.socialaccount.models import SocialApp from ..views import CustomGitHubOAuth2Adapter class TestGitHubOAuth2Adapter: @pytest.mark.django_db def test_complete_login(self, mocker, rf): mocker.patch("metecho.oauth2.github.views.GitHubOAuth2Adapter.complete_login") token = mock.MagicMock(app=SocialApp(provider="github")) request = rf.get("/") adapter = CustomGitHubOAuth2Adapter(request) adapter.complete_login(request, None, token) # make sure this created a SocialApp in the db assert token.app.pk is not None
# -*- coding: utf-8 -*- # Copyright 2014-2022 CERN # # 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. # # Authors: # - Mario Lassnig <[email protected]>, 2014-2020 # - Cedric Serfon <[email protected]>, 2014-2020 # - Vincent Garonne <[email protected]>, 2014-2016 # - Martin Barisits <[email protected]>, 2014-2020 # - Wen Guan <[email protected]>, 2014-2016 # - Joaquín Bogado <[email protected]>, 2016 # - Thomas Beermann <[email protected]>, 2016-2021 # - Brian Bockelman <[email protected]>, 2018 # - Eric Vaandering <[email protected]>, 2018-2020 # - dciangot <[email protected]>, 2018 # - Hannes Hansen <[email protected]>, 2018 # - Andrew Lister <[email protected]>, 2019 # - Matt Snyder <[email protected]>, 2019 # - Gabriele Fronze' <[email protected]>, 2019 # - Jaroslav Guenther <[email protected]>, 2019-2020 # - Benedikt Ziemons <[email protected]>, 2020 # - Patrick Austin <[email protected]>, 2020 # - Radu Carpa <[email protected]>, 2021-2022 # - Nick Smith <[email protected]>, 2021 # - David Población Criado <[email protected]>, 2021 """ Methods common to different conveyor submitter daemons. """ from __future__ import division import datetime import logging import os import socket import threading import time from typing import TYPE_CHECKING from rucio.common.config import config_get, config_get_int from rucio.common.exception import (InvalidRSEExpression, TransferToolTimeout, TransferToolWrongAnswer, RequestNotFound, DuplicateFileTransferSubmission, VONotFound) from rucio.common.logging import formatted_logger from rucio.common.utils import PriorityQueue from rucio.core import heartbeat, request as request_core, transfer as transfer_core from rucio.core.monitor import record_counter, record_timer from rucio.core.replica import add_replicas, tombstone_from_delay, update_replica_state from rucio.core.request import set_request_state, queue_requests from rucio.core.rse import list_rses from rucio.core.rse_expression_parser import parse_expression from rucio.core.vo import list_vos from rucio.db.sqla import models from rucio.db.sqla.constants import RequestState, RequestType, ReplicaState from rucio.db.sqla.session import transactional_session from rucio.rse import rsemanager as rsemgr if TYPE_CHECKING: from typing import Callable, Dict, List, Optional, Set, Tuple, Type from rucio.core.request import RequestWithSources from rucio.core.transfer import DirectTransferDefinition from rucio.transfertool.transfertool import Transfertool, TransferToolBuilder from sqlalchemy.orm import Session class HeartbeatHandler: """ Simple contextmanager which sets a heartbeat and associated logger on entry and cleans up the heartbeat on exit. """ def __init__(self, executable, renewal_interval, logger_prefix=None): """ :param executable: the executable name which will be set in heartbeats :param renewal_interval: the interval at which the heartbeat will be renewed in the database. Calls to live() in-between intervals will re-use the locally cached heartbeat. :param logger_prefix: the prefix to be prepended to all log messages """ self.executable = executable self.renewal_interval = renewal_interval self.older_than = renewal_interval * 10 if renewal_interval and renewal_interval > 0 else None # 10 was chosen without any particular reason self.logger_prefix = logger_prefix or executable self.hostname = socket.getfqdn() self.pid = os.getpid() self.hb_thread = threading.current_thread() self.logger = None self.last_heart_beat = None self.last_time = None def __enter__(self): heartbeat.sanity_check(executable=self.executable, hostname=self.hostname) self.live() return self def __exit__(self, exc_type, exc_val, exc_tb): if self.last_heart_beat: heartbeat.die(self.executable, self.hostname, self.pid, self.hb_thread) if self.logger: self.logger(logging.INFO, 'Heartbeat cleaned up') def live(self): """ :return: a tuple: <the number of the current worker>, <total number of workers>, <decorated logger> """ if not self.last_time or self.last_time < datetime.datetime.now() - datetime.timedelta(seconds=self.renewal_interval): if self.older_than: self.last_heart_beat = heartbeat.live(self.executable, self.hostname, self.pid, self.hb_thread, older_than=self.older_than) else: self.last_heart_beat = heartbeat.live(self.executable, self.hostname, self.pid, self.hb_thread) prefix = '%s[%i/%i]: ' % (self.logger_prefix, self.last_heart_beat['assign_thread'], self.last_heart_beat['nr_threads']) self.logger = formatted_logger(logging.log, prefix + '%s') if not self.last_time: self.logger(logging.DEBUG, 'First heartbeat set') else: self.logger(logging.DEBUG, 'Heartbeat renewed') self.last_time = datetime.datetime.now() return self.last_heart_beat['assign_thread'], self.last_heart_beat['nr_threads'], self.logger def run_conveyor_daemon(once, graceful_stop, executable, logger_prefix, partition_wait_time, sleep_time, run_once_fnc, activities=None): with HeartbeatHandler(executable=executable, renewal_interval=sleep_time - 1, logger_prefix=logger_prefix) as heartbeat_handler: logger = heartbeat_handler.logger logger(logging.INFO, 'started') if partition_wait_time: graceful_stop.wait(partition_wait_time) activity_next_exe_time = PriorityQueue() for activity in activities or [None]: activity_next_exe_time[activity] = time.time() while not graceful_stop.is_set() and activity_next_exe_time: if once: activity = activity_next_exe_time.pop() time_to_sleep = 0 else: activity = activity_next_exe_time.top() time_to_sleep = activity_next_exe_time[activity] - time.time() if time_to_sleep > 0: if activity: logger(logging.DEBUG, 'Switching to activity %s and sleeping %s seconds', activity, time_to_sleep) else: logger(logging.DEBUG, 'Sleeping %s seconds', time_to_sleep) graceful_stop.wait(time_to_sleep) else: if activity: logger(logging.DEBUG, 'Switching to activity %s', activity) else: logger(logging.DEBUG, 'Starting next iteration') _, _, logger = heartbeat_handler.live() must_sleep = True try: must_sleep = run_once_fnc(activity=activity, heartbeat_handler=heartbeat_handler) except Exception: logger(logging.CRITICAL, "Exception", exc_info=True) if once: raise if not once: if must_sleep: activity_next_exe_time[activity] = time.time() + sleep_time else: activity_next_exe_time[activity] = time.time() + 1 @transactional_session def next_transfers_to_submit(total_workers=0, worker_number=0, partition_hash_var=None, limit=None, activity=None, older_than=None, rses=None, schemes=None, failover_schemes=None, filter_transfertool=None, transfertools_by_name=None, request_type=RequestType.TRANSFER, ignore_availability=False, logger=logging.log, session=None): """ Get next transfers to be submitted; grouped by transfertool which can submit them :param total_workers: Number of total workers. :param worker_number: Id of the executing worker. :param partition_hash_var The hash variable used for partitioning thread work :param limit: Maximum number of requests to retrieve from database. :param activity: Activity. :param older_than: Get transfers older than. :param rses: Include RSES. :param schemes: Include schemes. :param failover_schemes: Failover schemes. :param transfertools_by_name: Dict: {transfertool_name_str: transfertool class} :param filter_transfertool: The transfer tool to filter requests on. :param request_type The type of requests to retrieve (Transfer/Stagein) :param ignore_availability: Ignore blocklisted RSEs :param logger: Optional decorated logger that can be passed from the calling daemons or servers. :param session: The database session in use. :returns: Dict: {TransferToolBuilder: <list of transfer paths (possibly multihop) to be submitted>} """ candidate_paths, reqs_no_source, reqs_scheme_mismatch, reqs_only_tape_source = transfer_core.get_transfer_paths( total_workers=total_workers, worker_number=worker_number, partition_hash_var=partition_hash_var, limit=limit, activity=activity, older_than=older_than, rses=rses, schemes=schemes, failover_schemes=failover_schemes, filter_transfertool=filter_transfertool, ignore_availability=ignore_availability, request_type=request_type, logger=logger, session=session, ) # Assign paths to be executed by transfertools # if the chosen best path is a multihop, create intermediate replicas and the intermediate transfer requests paths_by_transfertool_builder, reqs_no_host, reqs_unsupported_transfertool = __assign_paths_to_transfertool_and_create_hops( candidate_paths, transfertools_by_name=transfertools_by_name, logger=logger, session=session, ) if reqs_unsupported_transfertool: logger(logging.INFO, "Ignoring request because of unsupported transfertool: %s", reqs_unsupported_transfertool) reqs_no_source.update(reqs_no_host) if reqs_no_source: logger(logging.INFO, "Marking requests as no-sources: %s", reqs_no_source) request_core.set_requests_state_if_possible(reqs_no_source, RequestState.NO_SOURCES, logger=logger, session=session) if reqs_only_tape_source: logger(logging.INFO, "Marking requests as only-tape-sources: %s", reqs_only_tape_source) request_core.set_requests_state_if_possible(reqs_only_tape_source, RequestState.ONLY_TAPE_SOURCES, logger=logger, session=session) if reqs_scheme_mismatch: logger(logging.INFO, "Marking requests as scheme-mismatch: %s", reqs_scheme_mismatch) request_core.set_requests_state_if_possible(reqs_scheme_mismatch, RequestState.MISMATCH_SCHEME, logger=logger, session=session) return paths_by_transfertool_builder def __parse_request_transfertools( rws: "RequestWithSources", logger: "Callable" = logging.log, ): """ Parse a set of desired transfertool names from the database field request.transfertool """ request_transfertools = set() try: if rws.transfertool: request_transfertools = {tt.strip() for tt in rws.transfertool.split(',')} except Exception: logger(logging.WARN, "Unable to parse requested transfertools: {}".format(request_transfertools)) request_transfertools = None return request_transfertools def __assign_paths_to_transfertool_and_create_hops( candidate_paths_by_request_id: "Dict[str: List[DirectTransferDefinition]]", transfertools_by_name: "Optional[Dict[str, Type[Transfertool]]]" = None, logger: "Callable" = logging.log, session: "Optional[Session]" = None, ) -> "Tuple[Dict[TransferToolBuilder, List[DirectTransferDefinition]], Set[str], Set[str]]": """ for each request, pick the first path which can be submitted by one of the transfertools. If the chosen path is multihop, create all missing intermediate requests and replicas. """ reqs_no_host = set() reqs_unsupported_transfertool = set() paths_by_transfertool_builder = {} default_tombstone_delay = config_get_int('transfers', 'multihop_tombstone_delay', default=transfer_core.DEFAULT_MULTIHOP_TOMBSTONE_DELAY, expiration_time=600) for request_id, candidate_paths in candidate_paths_by_request_id.items(): # Get the rws object from any candidate path. It is the same for all candidate paths. For multihop, the initial request is the last hop rws = candidate_paths[0][-1].rws request_transfertools = __parse_request_transfertools(rws, logger) if request_transfertools is None: # Parsing failed reqs_no_host.add(request_id) continue if request_transfertools and transfertools_by_name and not request_transfertools.intersection(transfertools_by_name): # The request explicitly asks for a transfertool which this submitter doesn't support reqs_unsupported_transfertool.add(request_id) continue # Selects the first path which can be submitted by a supported transfertool and for which the creation of # intermediate hops (if it is a multihop) work correctly best_path = None builder_to_use = None must_skip_submission = False for transfer_path in candidate_paths: builder = None if transfertools_by_name: transfertools_to_try = set(transfertools_by_name) if request_transfertools: transfertools_to_try = transfertools_to_try.intersection(request_transfertools) for transfertool in transfertools_to_try: builder = transfertools_by_name[transfertool].submission_builder_for_path(transfer_path, logger=logger) if builder: break if builder or not transfertools_by_name: created, must_skip_submission = __create_missing_replicas_and_requests( transfer_path, default_tombstone_delay, logger=logger, session=session ) if created: best_path = transfer_path builder_to_use = builder if created or must_skip_submission: break if not best_path: reqs_no_host.add(request_id) logger(logging.INFO, '%s: Cannot pick transfertool, or create intermediate requests' % request_id) continue transfer_core.ensure_db_sources(best_path, logger=logger, session=session) if len(best_path) > 1: logger(logging.INFO, '%s: Best path is multihop: %s' % (rws.request_id, transfer_core.transfer_path_str(best_path))) elif best_path is not candidate_paths[0] or len(best_path[0].sources) > 1: # Only print singlehop if it brings additional information: # - either it's not the first candidate path # - or it's a multi-source # in other cases, it doesn't bring any additional information to what is known from previous logs logger(logging.INFO, '%s: Best path is direct: %s' % (rws.request_id, transfer_core.transfer_path_str(best_path))) if must_skip_submission: logger(logging.INFO, '%s: Part of the transfer is already being handled. Skip for now.' % request_id) continue paths_by_transfertool_builder.setdefault(builder_to_use, []).append(best_path) return paths_by_transfertool_builder, reqs_no_host, reqs_unsupported_transfertool @transactional_session def __create_missing_replicas_and_requests( transfer_path: "List[DirectTransferDefinition]", default_tombstone_delay: int, logger: "Callable", session: "Optional[Session]" = None ) -> "Tuple[bool, bool]": """ Create replicas and requests in the database for the intermediate hops """ initial_request_id = transfer_path[-1].rws.request_id creation_successful = True must_skip_submission = False created_requests = [] # Iterate the path in reverse order. The last hop is the initial request, so # next_hop.rws.request_id will always be initialized when handling the current hop. for i in reversed(range(len(transfer_path))): hop = transfer_path[i] rws = hop.rws if rws.request_id: continue tombstone_delay = rws.dest_rse.attributes.get('multihop_tombstone_delay', default_tombstone_delay) try: tombstone = tombstone_from_delay(tombstone_delay) except ValueError: logger(logging.ERROR, "%s: Cannot parse multihop tombstone delay %s", initial_request_id, tombstone_delay) creation_successful = False break files = [{'scope': rws.scope, 'name': rws.name, 'bytes': rws.byte_count, 'adler32': rws.adler32, 'md5': rws.md5, 'tombstone': tombstone, 'state': 'C'}] try: add_replicas(rse_id=rws.dest_rse.id, files=files, account=rws.account, ignore_availability=False, dataset_meta=None, session=session) # Set replica state to Copying in case replica already existed in another state. # Can happen when a multihop transfer failed previously, and we are re-scheduling it now. update_replica_state(rse_id=rws.dest_rse.id, scope=rws.scope, name=rws.name, state=ReplicaState.COPYING, session=session) except Exception as error: logger(logging.ERROR, '%s: Problem adding replicas on %s : %s', initial_request_id, rws.dest_rse, str(error)) rws.attributes['is_intermediate_hop'] = True rws.attributes['source_replica_expression'] = hop.src.rse.name new_req = queue_requests(requests=[{'dest_rse_id': rws.dest_rse.id, 'scope': rws.scope, 'name': rws.name, 'rule_id': '00000000000000000000000000000000', # Dummy Rule ID used for multihop. TODO: Replace with actual rule_id once we can flag intermediate requests 'attributes': rws.attributes, 'request_type': rws.request_type, 'retry_count': rws.retry_count, 'account': rws.account, 'requested_at': datetime.datetime.now()}], session=session) # If a request already exists, new_req will be an empty list. if new_req: db_req = new_req[0] else: db_req = request_core.get_request_by_did(rws.scope, rws.name, rws.dest_rse.id, session=session) # A transfer already exists for part of the path. Just construct the remaining # path, but don't submit the transfer. We must wait for the existing transfer to be # completed before continuing. must_skip_submission = True models.TransferHop(request_id=db_req['id'], next_hop_request_id=transfer_path[i + 1].rws.request_id, initial_request_id=initial_request_id, ).save(session=session, flush=False) rws.request_id = db_req['id'] rws.requested_at = db_req['requested_at'] logger(logging.DEBUG, '%s: New request created for the transfer between %s and %s : %s', initial_request_id, transfer_path[0].src, transfer_path[-1].dst, rws.request_id) set_request_state(rws.request_id, RequestState.QUEUED, session=session, logger=logger) created_requests.append(rws.request_id) return creation_successful, must_skip_submission def submit_transfer(transfertool_obj, transfers, job_params, submitter='submitter', timeout=None, logger=logging.log): """ Submit a transfer or staging request :param transfertool_obj: The transfertool object to be used for submission :param transfers: Transfer objects to be submitted :param job_params: Parameters to be used for all transfers in the given job. :param submitter: Name of the submitting entity. :param timeout: Timeout :param logger: Optional decorated logger that can be passed from the calling daemons or servers. """ for transfer in transfers: try: transfer_core.mark_submitting(transfer, external_host=transfertool_obj.external_host, logger=logger) except RequestNotFound as error: logger(logging.ERROR, str(error)) return except Exception: logger(logging.ERROR, 'Failed to prepare requests %s state to SUBMITTING. Mark it SUBMISSION_FAILED and abort submission.' % [str(t.rws) for t in transfers], exc_info=True) set_request_state(request_id=transfer.rws.request_id, state=RequestState.SUBMISSION_FAILED) return try: _submit_transfers(transfertool_obj, transfers, job_params, submitter, timeout, logger) except DuplicateFileTransferSubmission as error: logger(logging.WARNING, 'Failed to bulk submit a job because of duplicate file : %s', str(error)) logger(logging.INFO, 'Submitting files one by one') for transfer in transfers: _submit_transfers(transfertool_obj, [transfer], job_params, submitter, timeout, logger) def _submit_transfers(transfertool_obj, transfers, job_params, submitter='submitter', timeout=None, logger=logging.log): """ helper function for submit_transfers. Performs the actual submission of one or more transfers. If the bulk submission of multiple transfers fails due to duplicate submissions, the exception is propagated to the caller context, which is then responsible for calling this function again for each of the transfers separately. """ logger(logging.INFO, 'About to submit job to %s with timeout %s' % (transfertool_obj, timeout)) # A eid is returned if the job is properly submitted otherwise an exception is raised is_bulk = len(transfers) > 1 eid = None start_time = time.time() state_to_set = RequestState.SUBMISSION_FAILED try: record_counter('core.request.submit_transfer') eid = transfertool_obj.submit(transfers, job_params, timeout) state_to_set = RequestState.SUBMITTED except DuplicateFileTransferSubmission: if is_bulk: raise except (TransferToolTimeout, TransferToolWrongAnswer) as error: logger(logging.ERROR, 'Failed to submit a job with error %s', str(error), exc_info=True) except Exception as error: logger(logging.ERROR, 'Failed to submit a job with error %s', str(error), exc_info=True) # Keep the behavior from before the refactoring: in case of unexpected exception, only # update request state on individual transfers, and do nothing for bulks. # Don't know why it's like that. # # FIXME: shouldn't we always set the state to SUBMISSION_FAILED? if is_bulk: state_to_set = None if eid is not None: duration = time.time() - start_time logger(logging.INFO, 'Submit job %s to %s in %s seconds' % (eid, transfertool_obj, duration)) record_timer('daemons.conveyor.{submitter}.submit_bulk_transfer.per_file', (time.time() - start_time) * 1000 / len(transfers) or 1, labels={'submitter': submitter}) record_counter('daemons.conveyor.{submitter}.submit_bulk_transfer', delta=len(transfers), labels={'submitter': submitter}) record_timer('daemons.conveyor.{submitter}.submit_bulk_transfer.files', len(transfers), labels={'submitter': submitter}) if state_to_set: try: transfer_core.set_transfers_state(transfers, state=state_to_set, external_host=transfertool_obj.external_host, external_id=eid, submitted_at=datetime.datetime.utcnow(), logger=logger) except Exception: logger(logging.ERROR, 'Failed to register transfer state with error', exc_info=True) if eid is not None: # The job is still submitted in the file transfer service but the request is not updated. # Possibility to have a double submission during the next cycle. Try to cancel the external request. try: logger(logging.INFO, 'Cancel transfer %s on %s', eid, transfertool_obj) transfer_core.cancel_transfer(transfertool_obj, eid) except Exception: logger(logging.ERROR, 'Failed to cancel transfers %s on %s with error' % (eid, transfertool_obj), exc_info=True) def get_conveyor_rses(rses=None, include_rses=None, exclude_rses=None, vos=None, logger=logging.log): """ Get a list of rses for conveyor :param rses: List of rses (Single-VO only) :param include_rses: RSEs to include :param exclude_rses: RSEs to exclude :param vos: VOs on which to look for RSEs. Only used in multi-VO mode. If None, we either use all VOs if run from "def", or the current VO otherwise. :param logger: Optional decorated logger that can be passed from the calling daemons or servers. :return: List of working rses """ multi_vo = config_get('common', 'multi_vo', raise_exception=False, default=False) if not multi_vo: if vos: logger(logging.WARNING, 'Ignoring argument vos, this is only applicable in a multi-VO setup.') vos = ['def'] else: if vos: invalid = set(vos) - set([v['vo'] for v in list_vos()]) if invalid: msg = 'VO{} {} cannot be found'.format('s' if len(invalid) > 1 else '', ', '.join([repr(v) for v in invalid])) raise VONotFound(msg) else: vos = [v['vo'] for v in list_vos()] logger(logging.INFO, 'This instance will work on VO%s: %s' % ('s' if len(vos) > 1 else '', ', '.join([v for v in vos]))) working_rses = [] rses_list = [] for vo in vos: rses_list.extend(list_rses(filters={'vo': vo})) if rses: working_rses = [rse for rse in rses_list if rse['rse'] in rses] if include_rses: for vo in vos: try: parsed_rses = parse_expression(include_rses, filter_={'vo': vo}, session=None) except InvalidRSEExpression: logger(logging.ERROR, "Invalid RSE exception %s to include RSEs", include_rses) else: for rse in parsed_rses: if rse not in working_rses: working_rses.append(rse) if not (rses or include_rses): working_rses = rses_list if exclude_rses: try: parsed_rses = parse_expression(exclude_rses, session=None) except InvalidRSEExpression as error: logger(logging.ERROR, "Invalid RSE exception %s to exclude RSEs: %s", exclude_rses, error) else: working_rses = [rse for rse in working_rses if rse not in parsed_rses] working_rses = [rsemgr.get_rse_info(rse_id=rse['id']) for rse in working_rses] return working_rses
from __future__ import unicode_literals from django.apps import AppConfig class FeedbackManagementConfig(AppConfig): name = 'feedback_management'
import warnings warnings.simplefilter('ignore', FutureWarning) from pandas_datareader import wb import matplotlib.pyplot as plt df = wb.download(indicator='SP.POP.TOTL', country=['JP', 'US'], start=1960, end=2014) print(df) # SP.POP.TOTL # country year # Japan 2014 127276000 # 2013 127445000 # 2012 127629000 # 2011 127833000 # 2010 128070000 # ... ... # United States 1964 191889000 # 1963 189242000 # 1962 186538000 # 1961 183691000 # 1960 180671000 # # [110 rows x 1 columns] df2 = df.unstack(level=0) print(df2.head()) # SP.POP.TOTL # country Japan United States # year # 1960 92500572 180671000 # 1961 94943000 183691000 # 1962 95832000 186538000 # 1963 96812000 189242000 # 1964 97826000 191889000 print(df2.tail()) # SP.POP.TOTL # country Japan United States # year # 2010 128070000 309321666 # 2011 127833000 311556874 # 2012 127629000 313830990 # 2013 127445000 315993715 # 2014 127276000 318301008 print(df2.columns) # MultiIndex([('SP.POP.TOTL', 'Japan'), # ('SP.POP.TOTL', 'United States')], # names=[None, 'country']) df2.columns = ['Japan', 'United States'] print(df2.head()) # Japan United States # year # 1960 92500572 180671000 # 1961 94943000 183691000 # 1962 95832000 186538000 # 1963 96812000 189242000 # 1964 97826000 191889000 df2.plot(grid=True) plt.savefig('data/dst/pandas_datareader_wb.png') plt.close() # ![pandas_datareader_wb.png](data/dst/pandas_datareader_wb.png)
class Solution: def largestNumber(self, nums: List[int]) -> str: for i in range(len(nums), 0, -1): for j in range(i-1): if not self.compare(nums[j], nums[j+1]): nums[j], nums[j+1] = nums[j+1], nums[j] return str(int("".join(map(str, nums)))) def compare(self, n1, n2): return str(n1) + str(n2) > str(n2) + str(n1)
"""Line-delimited GeoJSON""" from .geojson import GeoJsonReader, GeoJsonWriter, GeoJsonDriver FIONA_DRIVER = 'GeoJSONSeq' PATH_REGEXP = r'^(?P<file_path>(?:.*/)?(?P<file_own_name>.*)\.(?P<extension>geojsonl\.json|geojsonl))$' class GeoJsonSeqReader(GeoJsonReader): fiona_driver = FIONA_DRIVER source_regexp = PATH_REGEXP class GeoJsonSeqWriter(GeoJsonWriter): fiona_driver = FIONA_DRIVER target_regexp = PATH_REGEXP class GeoJsonSeqDriver(GeoJsonDriver): reader = GeoJsonSeqReader writer = GeoJsonSeqWriter path_regexp = PATH_REGEXP fiona_driver = FIONA_DRIVER driver = GeoJsonSeqDriver
""" SynthTIGER Copyright (c) 2021-present NAVER Corp. MIT license """ import imgaug.augmenters as iaa import numpy as np from synthtiger.components.component import Component class AdditiveGaussianNoise(Component): def __init__(self, scale=(8, 32), per_channel=0.5): super().__init__() self.scale = scale self.per_channel = per_channel def sample(self, meta=None): if meta is None: meta = {} scale = meta.get("scale", np.random.uniform(self.scale[0], self.scale[1])) per_channel = meta.get("per_channel", np.random.rand() < self.per_channel) meta = { "scale": scale, "per_channel": per_channel, } return meta def apply(self, layers, meta=None): meta = self.sample(meta) scale = meta["scale"] per_channel = meta["per_channel"] aug = iaa.AdditiveGaussianNoise(scale=scale, per_channel=per_channel) for layer in layers: rgb = layer.image[..., :3].astype(np.uint8) alpha = layer.image[..., 3, np.newaxis].astype(np.uint8) rgb = aug(image=rgb) image = np.concatenate((rgb, alpha), axis=-1).astype(np.float32) layer.image = image return meta
def partition(a,si,ei): p = a[si] c = 0 # c will be number of elements smaller than p for i in range(si,ei+1): if a[i] < p: c += 1 a[si], a[si+c] = a[si+c], a[si] i = si j = ei while i < j: if a[i] < p: i = i+1 elif a[j] >= p: j = j-1 else: a[i], a[j] = a[j], a[i] i = i+1 j = j-1 return si+c def quick_sort(arr,si,ei): if si >= ei: return i = partition(arr,si,ei) quick_sort(arr,si,i-1) quick_sort(arr, i+1, ei) a = [5,1,3,5,7,2,4,6,8,5,5,5,5] quick_sort(a,0,len(a)-1)
#!/usr/local/bin/python3 # # Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause OR Arm’s non-OSI source license # # secure boot process. # Key certificate structure is : # FIELD NAME SIZE (words) # ---------- ------------ # Header token 1 # version number 1 # size in words (offset to signature) 1 # Flags 1 # N Pub key 96 # Np 5 # active SW version 1 # public key HASH 8 # RSA Signature 96 import os import struct import sys from pathlib import Path import pdb import subprocess # Definitions for paths ####################### if sys.platform != "win32" : path_div = "/" else : #platform = win32 path_div = "\\" # Adding the utility python scripts to the python PATH CURRENT_PATH = sys.path[0] # In case the scripts were run from current directory CURRENT_PATH_SCRIPTS = path_div + ".." + path_div + 'common_utils' # this is the scripts local path, from where the program was called #sys.path.append(CURRENT_PATH+CURRENT_PATH_SCRIPTS) sys.path.append(str(Path(CURRENT_PATH).parent)+CURRENT_PATH_SCRIPTS) OUTPUT_DIR_NAME = CURRENT_PATH + "/am_cert_key_util_output/" from cert_cfg_parser_util import * # this is the path of the proj config file PROJ_CFG_PATH = "src" + path_div PROJ_CONFIG = str(Path(Path(CURRENT_PATH).parent).parent) + '/proj.cfg' from key_data_structures import * import string from global_defines import * from ctypes import * import global_defines import configparser from cert_basic_utilities import * #################################################################### # Filename - sb_key_util.py # Description - This file contains the main functionality of the key # certificate generation. #################################################################### ########### Certificate utility functions ########################## # The GetSWVersion function returns CertSwVersion object with S/W version value def GetSWVersion(logFile, swVersionVal): CertSwVersionObj = CertSwVersion(swVersionVal) return CertSwVersionObj # End of GetSWVersion # The BinStrToList function takes a binary string and returns a list with HEX # representation for the bytes def BinStrToList(str1): TempList = list() ConvList = list(str1.encode('iso-8859-1')) for i in range(len(str1)): TempList.append("0x%02x" % ConvList[i]) return TempList # End of BinStrToList # The CreateCertBinFile opens a binary and text file and writes the certificate data into it def Create_CertBinFile(logFile, binStr, txtList, certFileName): try: # Open a binary file and write the data to it FileObj = open(certFileName, "wb") FileObj.write(bytes(binStr.encode('iso-8859-1'))) FileObj.close() # Assemble the text file name (cert + number 1 for primary , 2 for secondary + .txt) certFileNameTxt = certFileName[:-4] + '_' + Cert_FileName + Cert_FileExtTxt # Open a text file and write the data into it, in lines of 4 bytes FileObj = open(certFileNameTxt, "w") NumOfChars = len(txtList) FileObj.write("char cert_bin_image[] = {\n") for i in range(NumOfChars): FileObj.write(txtList[i]) if i != NumOfChars-1: FileObj.write(',') if (i+1) % 4 == 0: FileObj.write('\n') FileObj.write("}") FileObj.close() except IOError as Error7: (errno, strerror) = Error7.args print_and_log(logFile, "Error in openning file - %s" %certFileName) sys.exit(1) return # End of CreateCertBinFile def CreateWordsListFromBytesList(BytesList): # Create words in reverse order wordsList = list() length = len(BytesList)/4 for i in range(int(length)): tmpStr = str() for j in range(4): byte = str() byte = BytesList[i*4 + 4 - j - 1] byte = byte[2:] tmpStr = tmpStr + byte tmpStr = '0x' + tmpStr wordsList.append(tmpStr) return wordsList ########### certificate creation - Utility functions End ########### # Parse script parameters def parse_shell_arguments (): len_arg = len(sys.argv) if len_arg < 2: print("len " + str(len_arg) + " invalid. Usage:" + sys.argv[0] + "<test configuration file>\n") for i in range(1,len_arg): print("i " + str(i) + " arg " + sys.argv[i] + "\n") sys.exit(1) config_fname = sys.argv[1] if len_arg == 3: log_fname = sys.argv[2] else: log_fname = "sb_key_cert.log" return config_fname, log_fname # The function analyzes the input files and creates a key certificate binary file to be used in the # The function does the following steps: # 1. Create the certificate header and add to list # 2. Create RSA public key parameters and add to list # 3. Create SW version parameters and add to list # 4. Add the next public key HASH # 5. In a loop create binary string out of the certificate so far (header + public key + sw version + HASH) # 6. Do RSA signature over the HASH value of the certificate so far # 7. Build the end of the certificate # 8. Write the certificate as binary and text string to file # # In case an error occurs the function throws exception and exits ################################################################################# def CreateCertUtility(sysArgsList): try: config_fname, log_fname = parse_shell_arguments() log_file = create_log_file(log_fname) # Check the input parameters and save it to list ArgsDict, config = key_cert_config_file_parser(config_fname, log_file) if ArgsDict == None: log_file.close() exit(1) print_and_log(log_file, "**** Creating Key certificate Table **** ") # Create the certificate objects and add it to a list CertDataList = list() DLLHandle = LoadDLLGetHandle() print_and_log(log_file, "\n Prepare certificate header ") # Create the certificate header and add to list -> header includes CertDataList.append(CertHeader(log_file, ArgsDict['hbk_id'], CERT_TYPE_KEY, 0, 0, 0, 0, PrjDefines)) print_and_log(log_file, "\n Create RSA public key parameters to insert to the certificate") # Create RSA key parameters and add to list (according to which Public key derivative is used) RSAPubKey = GetRSAKeyParams(log_file, ArgsDict['cert_keypair'], ArgsDict['cert_keypair_pwd'], DLLHandle) CertDataList.append(RSAPubKey) print_and_log(log_file, "\n Get SW version parameters") # Create SW version parameters and add to list CertDataList.append(GetSWVersion(log_file, ArgsDict['nvcounter_val'])) # Add HASH of next certificate public key print_and_log(log_file, "\n Create HASH of public key and Np of the next certificate") CertDataList.append(GetPubKeyHash(log_file, ArgsDict['next_cert_pubkey'], DLLHandle)) print_and_log(log_file, "\n Create the certificate as binary string and calculate RSA signature on it") # In a loop create binary string out of the certificate so far (header + public key + sw version + pub key HASH) BinStr = str() for obj in CertDataList: BinStr = BinStr + obj.VarsToBinString() # file = open("temp1.bin", 'w') # file.write(BinStr) # file.close() # Do RSA signature Signature = GetRSASignature(log_file, BinStr, ArgsDict['cert_keypair'], ArgsDict['cert_keypair_pwd'], DLLHandle) print_and_log(log_file, "\n Add the signature to the certificate ") # Build the end of the certificate - add the signature BinStr = BinStr + Signature.VarsToBinString() # create output dir if not there if not os.path.exists(OUTPUT_DIR_NAME): os.makedirs(OUTPUT_DIR_NAME) print_and_log(log_file, "\n Write the certificate to file ") # Write binary and text string to file Create_CertBinFile(log_file, BinStr, BinStrToList(BinStr), OUTPUT_DIR_NAME+ArgsDict['cert_pkg']) print_and_log(log_file, "\n**** Certificate file creation has been completed successfully ****") except IOError as Error8: (errno, strerror) = Error8.args print_and_log(log_file, "I/O error(%s): %s" % (errno, strerror)) raise except NameError: print_and_log(log_file, "Unexpected error, exiting program") raise # Debug info except ValueError: print_and_log(log_file, "Illegal variable type") raise # Debug info ################################## # Main function ################################## if __name__ == "__main__": import sys if sys.version_info<(3,0,0): print("You need python 3.0 or later to run this script") exit(1) if "-cfg_file" in sys.argv: PROJ_CONFIG = sys.argv[sys.argv.index("-cfg_file") + 1] print("Config File - %s\n" %PROJ_CONFIG) # Get the project configuration values PrjDefines = parseConfFile(PROJ_CONFIG,LIST_OF_CONF_PARAMS) CreateCertUtility(sys.argv) ######################################## END OF FILE ########################################
# encoding: utf-8 # module pandas._libs.tslibs.resolution # from C:\Python27\lib\site-packages\pandas\_libs\tslibs\resolution.pyd # by generator 1.147 # no doc # imports import __builtin__ as __builtins__ # <module '__builtin__' (built-in)> import numpy as np # C:\Python27\lib\site-packages\numpy\__init__.pyc # functions def get_freq_group(W_MON): # real signature unknown; restored from __doc__ """ Return frequency code group of given frequency str or offset. Example ------- >>> get_freq_group('W-MON') 4000 >>> get_freq_group('W-FRI') 4000 """ pass def month_position_check(*args, **kwargs): # real signature unknown pass def resolution(*args, **kwargs): # real signature unknown pass def __pyx_unpickle_Enum(*args, **kwargs): # real signature unknown pass # classes class Resolution(object): # no doc @classmethod def get_freq(cls, day): # real signature unknown; restored from __doc__ """ Return frequency str against resolution str. Example ------- >>> f.Resolution.get_freq('day') 'D' """ pass @classmethod def get_freq_group(cls, day): # real signature unknown; restored from __doc__ """ Return frequency str against resolution str. Example ------- >>> f.Resolution.get_freq_group('day') 4000 """ pass @classmethod def get_reso(cls, second): # real signature unknown; restored from __doc__ """ Return resolution str against resolution code. Example ------- >>> Resolution.get_reso('second') 2 >>> Resolution.get_reso('second') == Resolution.RESO_SEC True """ pass @classmethod def get_reso_from_freq(cls, H): # real signature unknown; restored from __doc__ """ Return resolution code against frequency str. Example ------- >>> Resolution.get_reso_from_freq('H') 4 >>> Resolution.get_reso_from_freq('H') == Resolution.RESO_HR True """ pass @classmethod def get_str(cls, Resolution_RESO_SEC): # real signature unknown; restored from __doc__ """ Return resolution str against resolution code. Example ------- >>> Resolution.get_str(Resolution.RESO_SEC) 'second' """ pass @classmethod def get_stride_from_decimal(cls, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ """ Convert freq with decimal stride into a higher freq with integer stride Parameters ---------- value : integer or float freq : string Frequency string Raises ------ ValueError If the float cannot be converted to an integer at any resolution. Example ------- >>> Resolution.get_stride_from_decimal(1.5, 'T') (90, 'S') >>> Resolution.get_stride_from_decimal(1.04, 'H') (3744, 'S') >>> Resolution.get_stride_from_decimal(1, 'D') (1, 'D') """ pass @classmethod def get_str_from_freq(cls, H): # real signature unknown; restored from __doc__ """ Return resolution str against frequency str. Example ------- >>> Resolution.get_str_from_freq('H') 'hour' """ pass def __init__(self, *args, **kwargs): # real signature unknown pass __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """list of weak references to the object (if defined)""" RESO_DAY = 6 RESO_HR = 5 RESO_MIN = 4 RESO_MS = 2 RESO_NS = 0 RESO_SEC = 3 RESO_US = 1 _freq_reso_map = { 'A': 'year', 'D': 'day', 'H': 'hour', 'L': 'millisecond', 'M': 'month', 'N': 'nanosecond', 'Q': 'quarter', 'S': 'second', 'T': 'minute', 'U': 'microsecond', } _reso_freq_map = { 'day': 'D', 'hour': 'H', 'microsecond': 'U', 'millisecond': 'L', 'minute': 'T', 'month': 'M', 'nanosecond': 'N', 'quarter': 'Q', 'second': 'S', 'year': 'A', } _reso_mult_map = { 0: None, 1: 1000, 2: 1000, 3: 1000, 4: 60, 5: 60, 6: 24, } _reso_str_bump_map = { 'D': 'H', 'H': 'T', 'L': 'U', 'N': None, 'S': 'L', 'T': 'S', 'U': 'N', } _reso_str_map = { 0: 'nanosecond', 1: 'microsecond', 2: 'millisecond', 3: 'second', 4: 'minute', 5: 'hour', 6: 'day', } _str_reso_map = { 'day': 6, 'hour': 5, 'microsecond': 1, 'millisecond': 2, 'minute': 4, 'nanosecond': 0, 'second': 3, } __dict__ = None # (!) real value is "dict_proxy({'_reso_str_bump_map': {'D': 'H', 'H': 'T', 'L': 'U', 'N': None, 'S': 'L', 'U': 'N', 'T': 'S'}, 'get_freq': <classmethod object at 0x0000000003F32378>, '__module__': 'pandas._libs.tslibs.resolution', 'get_str': <classmethod object at 0x0000000003F322E8>, 'get_reso_from_freq': <classmethod object at 0x0000000003F323D8>, 'RESO_NS': 0, 'RESO_SEC': 3, '_reso_mult_map': {0: None, 1: 1000, 2: 1000, 3: 1000, 4: 60, 5: 60, 6: 24}, 'RESO_MS': 2, 'RESO_DAY': 6, 'get_stride_from_decimal': <classmethod object at 0x0000000003F32408>, '__dict__': <attribute '__dict__' of 'Resolution' objects>, 'get_reso': <classmethod object at 0x0000000003F32318>, '__weakref__': <attribute '__weakref__' of 'Resolution' objects>, '_str_reso_map': {'millisecond': 2, 'hour': 5, 'nanosecond': 0, 'second': 3, 'microsecond': 1, 'day': 6, 'minute': 4}, 'RESO_MIN': 4, '_reso_str_map': {0: 'nanosecond', 1: 'microsecond', 2: 'millisecond', 3: 'second', 4: 'minute', 5: 'hour', 6: 'day'}, 'RESO_US': 1, '_reso_freq_map': {'millisecond': 'L', 'second': 'S', 'microsecond': 'U', 'hour': 'H', 'year': 'A', 'quarter': 'Q', 'nanosecond': 'N', 'day': 'D', 'minute': 'T', 'month': 'M'}, 'get_str_from_freq': <classmethod object at 0x0000000003F323A8>, '__doc__': None, '__qualname__': 'Resolution', 'RESO_HR': 5, 'get_freq_group': <classmethod object at 0x0000000003F32348>, '_freq_reso_map': {'A': 'year', 'D': 'day', 'H': 'hour', 'M': 'month', 'L': 'millisecond', 'N': 'nanosecond', 'Q': 'quarter', 'S': 'second', 'U': 'microsecond', 'T': 'minute'}})" __qualname__ = 'Resolution' # variables with complex values __test__ = { u'Resolution.get_freq (line 232)': u"\n Return frequency str against resolution str.\n\n Example\n -------\n >>> f.Resolution.get_freq('day')\n 'D'\n ", u'Resolution.get_freq_group (line 220)': u"\n Return frequency str against resolution str.\n\n Example\n -------\n >>> f.Resolution.get_freq_group('day')\n 4000\n ", u'Resolution.get_reso (line 205)': u"\n Return resolution str against resolution code.\n\n Example\n -------\n >>> Resolution.get_reso('second')\n 2\n\n >>> Resolution.get_reso('second') == Resolution.RESO_SEC\n True\n ", u'Resolution.get_reso_from_freq (line 256)': u"\n Return resolution code against frequency str.\n\n Example\n -------\n >>> Resolution.get_reso_from_freq('H')\n 4\n\n >>> Resolution.get_reso_from_freq('H') == Resolution.RESO_HR\n True\n ", u'Resolution.get_str (line 193)': u"\n Return resolution str against resolution code.\n\n Example\n -------\n >>> Resolution.get_str(Resolution.RESO_SEC)\n 'second'\n ", u'Resolution.get_str_from_freq (line 244)': u"\n Return resolution str against frequency str.\n\n Example\n -------\n >>> Resolution.get_str_from_freq('H')\n 'hour'\n ", u'Resolution.get_stride_from_decimal (line 271)': u"\n Convert freq with decimal stride into a higher freq with integer stride\n\n Parameters\n ----------\n value : integer or float\n freq : string\n Frequency string\n\n Raises\n ------\n ValueError\n If the float cannot be converted to an integer at any resolution.\n\n Example\n -------\n >>> Resolution.get_stride_from_decimal(1.5, 'T')\n (90, 'S')\n\n >>> Resolution.get_stride_from_decimal(1.04, 'H')\n (3744, 'S')\n\n >>> Resolution.get_stride_from_decimal(1, 'D')\n (1, 'D')\n ", u'get_freq_group (line 110)': u"\n Return frequency code group of given frequency str or offset.\n\n Example\n -------\n >>> get_freq_group('W-MON')\n 4000\n\n >>> get_freq_group('W-FRI')\n 4000\n ", }
from django.contrib import admin from .models import Person, Page admin.site.register(Person) admin.site.register(Page)
""" Backward-compatibility shim for users referencing the module by name. Ref #487. """ import warnings from .macOS import Keyring __all__ = ['Keyring'] warnings.warn("OS_X module is deprecated.", DeprecationWarning)
class Solution: def myAtoi(self, s: str) -> int: max_value = 2 ** 31 - 1 min_value = -2 ** 31 num = 0 digit_only = False sign = None for c in s: if '0' <= c <= '9': digit_only = True c = int(c) if num is None: num = 0 if sign == '-': if (num == 214748364 and c > 8) or (num > 214748364): return min_value else: if (num == 214748364 and c > 7) or (num > 214748364): return max_value num = num * 10 + c else: if digit_only: return -num if sign == '-' else num if c == ' ': continue if c in '+-': digit_only = True if sign is not None: return -num if sign == '-' else num sign = c else: return -num if sign == '-' else num return -num if sign == '-' else num
#! /usr/env/python """Fastscape stream power erosion.""" # This module attempts to "component-ify" GT's Fastscape stream # power erosion. # Created DEJH, March 2014. from __future__ import print_function import numpy as np from six import string_types from landlab import BAD_INDEX_VALUE as UNDEFINED_INDEX, Component, RasterModelGrid from landlab.utils.decorators import use_file_name_or_kwds from .cfuncs import ( brent_method_erode_fixed_threshold, brent_method_erode_variable_threshold, ) class FastscapeEroder(Component): r"""Fastscape stream power erosion. This class uses the Braun-Willett Fastscape approach to calculate the amount of erosion at each node in a grid, following a stream power framework. This should allow it to be stable against larger timesteps than an explicit stream power scheme. Note that although this scheme is nominally implicit, and will reach a numerically-correct solution under topographic steady state regardless of timestep length, the accuracy of transient solutions is *not* timestep independent (see Braun & Willett 2013, Appendix B for further details). Although the scheme remains significantly more robust and permits longer timesteps than a traditional explicit solver under such conditions, it is still possible to create numerical instability through use of too long a timestep while using this component. The user is cautioned to check their implementation is behaving stably before fully trusting it. Stream power erosion is implemented as: .. math:: E = K (\textit{rainfall_intensity} \, A) ^ m S ^ n - \textit{threshold_sp} if :math:`K A ^ m S ^ n > \textit{threshold_sp}`, and: .. math:: E = 0, if :math:`K A^m S^n <= \textit{threshold_sp}`. This module assumes you have already run :func:`landlab.components.flow_accum.flow_accumulator.FlowAccumulator.run_one_step` in the same timestep. It looks for 'flow__upstream_node_order', 'flow__link_to_receiver_node', 'drainage_area', 'flow__receiver_node', and 'topographic__elevation' at the nodes in the grid. 'drainage_area' should be in area upstream, not volume (i.e., set runoff_rate=1.0 when calling FlowAccumulator.run_one_step). The primary method of this class is :func:`run_one_step`. Examples -------- >>> import numpy as np >>> from landlab import RasterModelGrid >>> from landlab import CLOSED_BOUNDARY, FIXED_VALUE_BOUNDARY >>> from landlab.components import FlowAccumulator, FastscapeEroder >>> grid = RasterModelGrid((5, 5), xy_spacing=10.) >>> z = np.array([7., 7., 7., 7., 7., ... 7., 5., 3.2, 6., 7., ... 7., 2., 3., 5., 7., ... 7., 1., 1.9, 4., 7., ... 7., 0., 7., 7., 7.]) >>> z = grid.add_field('topographic__elevation', z, at='node') >>> fr = FlowAccumulator(grid, flow_director='D8') >>> sp = FastscapeEroder(grid, K_sp=1.) >>> fr.run_one_step() >>> sp.run_one_step(dt=1.) >>> z # doctest: +NORMALIZE_WHITESPACE array([ 7. , 7. , 7. , 7. , 7. , 7. , 2.92996598, 2.02996598, 4.01498299, 7. , 7. , 0.85993197, 1.87743897, 3.28268321, 7. , 7. , 0.28989795, 0.85403051, 2.42701526, 7. , 7. , 0. , 7. , 7. , 7. ]) >>> grid = RasterModelGrid((3, 7), xy_spacing=1.) >>> z = np.array(grid.node_x ** 2.) >>> z = grid.add_field('topographic__elevation', z, at='node') >>> grid.status_at_node[grid.nodes_at_left_edge] = FIXED_VALUE_BOUNDARY >>> grid.status_at_node[grid.nodes_at_top_edge] = CLOSED_BOUNDARY >>> grid.status_at_node[grid.nodes_at_bottom_edge] = CLOSED_BOUNDARY >>> grid.status_at_node[grid.nodes_at_right_edge] = CLOSED_BOUNDARY >>> fr = FlowAccumulator(grid, flow_director='D8') >>> sp = FastscapeEroder(grid, K_sp=0.1, m_sp=0., n_sp=2., ... threshold_sp=2.) >>> fr.run_one_step() >>> sp.run_one_step(dt=10.) >>> z.reshape(grid.shape)[1, :] # doctest: +NORMALIZE_WHITESPACE array([ 0. , 1. , 4. , 8.52493781, 13.29039716, 18.44367965, 36. ]) >>> grid = RasterModelGrid((3, 7), xy_spacing=1.) >>> z = np.array(grid.node_x ** 2.) >>> z = grid.add_field('topographic__elevation', z, at='node') >>> grid.status_at_node[grid.nodes_at_left_edge] = FIXED_VALUE_BOUNDARY >>> grid.status_at_node[grid.nodes_at_top_edge] = CLOSED_BOUNDARY >>> grid.status_at_node[grid.nodes_at_bottom_edge] = CLOSED_BOUNDARY >>> grid.status_at_node[grid.nodes_at_right_edge] = CLOSED_BOUNDARY >>> fr = FlowAccumulator(grid, flow_director='D8') >>> K_field = grid.ones(at='node') # K can be a field >>> sp = FastscapeEroder(grid, K_sp=K_field, m_sp=1., n_sp=0.6, ... threshold_sp=grid.node_x, ... rainfall_intensity=2.) >>> fr.run_one_step() >>> sp.run_one_step(1.) >>> z.reshape(grid.shape)[1, :] # doctest: +NORMALIZE_WHITESPACE array([ 0. , 0.0647484 , 0.58634455, 2.67253503, 8.49212152, 20.92606987, 36. ]) >>> previous_z = z.copy() >>> sp.run_one_step(1., rainfall_intensity_if_used=0.) >>> np.allclose(z, previous_z) True """ _name = "FastscapeEroder" _input_var_names = ( "topographic__elevation", "drainage_area", "flow__link_to_receiver_node", "flow__upstream_node_order", "flow__receiver_node", ) _output_var_names = ("topographic__elevation",) _var_units = { "topographic__elevation": "m", "drainage_area": "m**2", "flow__link_to_receiver_node": "-", "flow__upstream_node_order": "-", "flow__receiver_node": "-", } _var_mapping = { "topographic__elevation": "node", "drainage_area": "node", "flow__link_to_receiver_node": "node", "flow__upstream_node_order": "node", "flow__receiver_node": "node", } _var_doc = { "topographic__elevation": "Land surface topographic elevation", "drainage_area": "Upstream accumulated surface area contributing to the node's " "discharge", "flow__link_to_receiver_node": "ID of link downstream of each node, which carries the discharge", "flow__upstream_node_order": "Node array containing downstream-to-upstream ordered list of " "node IDs", "flow__receiver_node": "Node array of receivers (node that receives flow from current " "node)", } @use_file_name_or_kwds def __init__( self, grid, K_sp=None, m_sp=0.5, n_sp=1.0, threshold_sp=0.0, rainfall_intensity=1.0, discharge_name="drainage_area", **kwds ): """ Initialize the Fastscape stream power component. Note: a timestep, dt, can no longer be supplied to this component through the input file. It must instead be passed directly to the run method. Parameters ---------- grid : ModelGrid A grid. K_sp : float, array, or field name K in the stream power equation (units vary with other parameters). m_sp : float, optional m in the stream power equation (power on drainage area). n_sp : float, optional n in the stream power equation (power on slope). rainfall intensity : float, array, or field name; optional Modifying factor on drainage area to convert it to a true water volume flux in (m/time). i.e., E = K * (r_i*A)**m * S**n discharge_name : string; optional Name of field to use for discharge proxy. Defaults to 'drainage_area', which means the component will expect the driver or another component to have created and populated a 'drainage_area' field. To use a different field, such as 'surface_water__discharge', give its name in this argument. """ if "flow__receiver_node" in grid.at_node: if grid.at_node["flow__receiver_node"].size != grid.size("node"): msg = ( "A route-to-multiple flow director has been " "run on this grid. The landlab development team has not " "verified that FastscapeEroder is compatible with " "route-to-multiple methods. Please open a GitHub Issue " "to start this process." ) raise NotImplementedError(msg) self._grid = grid self.K = K_sp # overwritten below in special cases self.m = float(m_sp) self.n = float(n_sp) if isinstance(threshold_sp, (float, int)): self.thresholds = float(threshold_sp) else: if isinstance(threshold_sp, string_types): self.thresholds = self.grid.at_node[threshold_sp] else: self.thresholds = threshold_sp assert self.thresholds.size == self.grid.number_of_nodes # make storage variables self.A_to_the_m = grid.zeros(at="node") self.alpha = grid.empty(at="node") if self.K is None: raise ValueError( "K_sp must be set as a float, node array, or " + "field name. It was None." ) # now handle the inputs that could be float, array or field name: # some support here for old-style inputs if isinstance(K_sp, string_types): if K_sp == "array": self.K = None else: self.K = self._grid.at_node[K_sp] elif isinstance(K_sp, (float, int)): self.K = float(K_sp) else: self.K = np.asarray(K_sp, dtype=float) if len(self.K) != self.grid.number_of_nodes: raise TypeError("Supplied value of K_sp is not n_nodes long") if isinstance(rainfall_intensity, string_types): raise ValueError( "This component can no longer handle " + "spatially variable runoff directly. Use " + "FlowAccumulator with specified " + "water__unit_flux_in, or use StreamPowerEroder" + "component instead of FastscapeEroder." ) if rainfall_intensity == "array": self._r_i = None else: self._r_i = self._grid.at_node[rainfall_intensity] elif isinstance(rainfall_intensity, (float, int)): # a float self._r_i = float(rainfall_intensity) elif len(rainfall_intensity) == self.grid.number_of_nodes: raise ValueError( "This component can no longer handle " "spatially variable runoff directly. Use " "FlowAccumulator with specified " "water__unit_flux_in, or use StreamPowerEroder" "component instead of FastscapeEroder." ) self._r_i = np.array(rainfall_intensity) else: raise TypeError("Supplied type of rainfall_intensity was " "not recognised") # We now forbid changing of the field name if "value_field" in kwds.keys(): raise ValueError( "This component can no longer support variable" 'field names. Use "topographic__elevation".' ) # Handle option for area vs discharge self.discharge_name = discharge_name def erode( self, grid_in, dt=None, K_if_used=None, flooded_nodes=None, rainfall_intensity_if_used=None, ): """Erode using stream power erosion. This method implements the stream power erosion, following the Braun- Willett (2013) implicit Fastscape algorithm. This should allow it to be stable against larger timesteps than an explicit stream power scheme. This driving method for this component is now superceded by the new, standardized wrapper :func:`run_one_step`, but is retained for back compatibility. Set *K_if_used* as a field name or nnodes-long array if you set *K_sp* as *"array"* during initialization. It returns the grid, in which it will have modified the value of *value_field*, as specified in component initialization. Parameters ---------- grid_in : a grid This is a dummy argument maintained for component back- compatibility. It is superceded by the copy of the grid passed during initialization. dt : float Time-step size. If you are calling the deprecated function :func:`gear_timestep`, that method will supercede any value supplied here. K_if_used : array (optional) Set this to an array if you set K_sp to 'array' in your input file. flooded_nodes : ndarray of int (optional) IDs of nodes that are flooded and should have no erosion. If not provided but flow has still been routed across depressions, erosion may still occur beneath the apparent water level (though will always still be positive). rainfall_intensity_if_used : float or None (optional) Supply to drive this component with a time-varying spatially constant rainfall. Returns ------- grid A reference to the grid. """ if self._grid.at_node["flow__receiver_node"].size != self._grid.size("node"): msg = ( "A route-to-multiple flow director has been " "run on this grid. The landlab development team has not " "verified that FastscapeEroder is compatible with " "route-to-multiple methods. Please open a GitHub Issue " "to start this process." ) raise NotImplementedError(msg) upstream_order_IDs = self._grid.at_node["flow__upstream_node_order"] z = self._grid.at_node["topographic__elevation"] defined_flow_receivers = np.not_equal( self._grid.at_node["flow__link_to_receiver_node"], UNDEFINED_INDEX ) if isinstance(self._grid, RasterModelGrid): flow_link_lengths = self._grid.length_of_d8[ self._grid.at_node["flow__link_to_receiver_node"][ defined_flow_receivers ] ] else: flow_link_lengths = self._grid.length_of_link[ self._grid.at_node["flow__link_to_receiver_node"][ defined_flow_receivers ] ] # make arrays from input the right size if isinstance(self.K, np.ndarray): K_here = self.K[defined_flow_receivers] else: K_here = self.K if rainfall_intensity_if_used is not None: assert type(rainfall_intensity_if_used) in (float, np.float64, int) r_i_here = float(rainfall_intensity_if_used) else: r_i_here = self._r_i if dt is None: dt = self.dt assert dt is not None, ( "Fastscape component could not find a dt to " + "use. Pass dt to the run_one_step() method." ) if self.K is None: # "old style" setting of array assert K_if_used is not None self.K = K_if_used n = float(self.n) np.power(self._grid["node"][self.discharge_name], self.m, out=self.A_to_the_m) self.alpha[defined_flow_receivers] = ( r_i_here ** self.m * K_here * dt * self.A_to_the_m[defined_flow_receivers] / (flow_link_lengths ** self.n) ) flow_receivers = self._grid["node"]["flow__receiver_node"] alpha = self.alpha # Handle flooded nodes, if any (no erosion there) if flooded_nodes is not None: alpha[flooded_nodes] = 0.0 else: reversed_flow = z < z[flow_receivers] # this check necessary if flow has been routed across depressions alpha[reversed_flow] = 0.0 threshsdt = self.thresholds * dt # solve using Brent's Method in Cython for Speed if isinstance(self.thresholds, float): brent_method_erode_fixed_threshold( upstream_order_IDs, flow_receivers, threshsdt, alpha, n, z ) else: brent_method_erode_variable_threshold( upstream_order_IDs, flow_receivers, threshsdt, alpha, n, z ) return self._grid def run_one_step( self, dt, flooded_nodes=None, rainfall_intensity_if_used=None, **kwds ): """Erode for a single time step. This method implements the stream power erosion across one time interval, dt, following the Braun-Willett (2013) implicit Fastscape algorithm. This follows Landlab standardized component design, and supercedes the old driving method :func:`erode`. Parameters ---------- dt : float Time-step size flooded_nodes : ndarray of int (optional) IDs of nodes that are flooded and should have no erosion. If not provided but flow has still been routed across depressions, erosion may still occur beneath the apparent water level (though will always still be positive). rainfall_intensity_if_used : float or None (optional) Supply to drive this component with a time-varying spatially constant rainfall. """ self.erode( grid_in=self._grid, dt=dt, flooded_nodes=flooded_nodes, rainfall_intensity_if_used=rainfall_intensity_if_used, )
# -*- coding: utf-8 -*- import time import re import base import swagger_client from swagger_client.rest import ApiException class System(base.Base): def get_gc_history(self, expect_status_code = 200, expect_response_body = None, **kwargs): client = self._get_client(**kwargs) try: data, status_code, _ = client.system_gc_get_with_http_info() except ApiException as e: if e.status == expect_status_code: if expect_response_body is not None and e.body.strip() != expect_response_body.strip(): raise Exception(r"Get configuration response body is not as expected {} actual status is {}.".format(expect_response_body.strip(), e.body.strip())) else: return e.reason, e.body else: raise Exception(r"Get configuration result is not as expected {} actual status is {}.".format(expect_status_code, e.status)) base._assert_status_code(expect_status_code, status_code) return data def get_gc_status_by_id(self, job_id, expect_status_code = 200, expect_response_body = None, **kwargs): client = self._get_client(**kwargs) try: data, status_code, _ = client.system_gc_id_get_with_http_info(job_id) except ApiException as e: if e.status == expect_status_code: if expect_response_body is not None and e.body.strip() != expect_response_body.strip(): raise Exception(r"Get configuration response body is not as expected {} actual status is {}.".format(expect_response_body.strip(), e.body.strip())) else: return e.reason, e.body else: raise Exception(r"Get configuration result is not as expected {} actual status is {}.".format(expect_status_code, e.status)) base._assert_status_code(expect_status_code, status_code) return data def get_gc_log_by_id(self, job_id, expect_status_code = 200, expect_response_body = None, **kwargs): client = self._get_client(**kwargs) try: data, status_code, _ = client.system_gc_id_log_get_with_http_info(job_id) except ApiException as e: if e.status == expect_status_code: if expect_response_body is not None and e.body.strip() != expect_response_body.strip(): raise Exception(r"Get configuration response body is not as expected {} actual status is {}.".format(expect_response_body.strip(), e.body.strip())) else: return e.reason, e.body else: raise Exception(r"Get configuration result is not as expected {} actual status is {}.".format(expect_status_code, e.status)) base._assert_status_code(expect_status_code, status_code) return data def get_gc_schedule(self, expect_status_code = 200, expect_response_body = None, **kwargs): client = self._get_client(**kwargs) try: data, status_code, _ = client.system_gc_schedule_get_with_http_info() except ApiException as e: if e.status == expect_status_code: if expect_response_body is not None and e.body.strip() != expect_response_body.strip(): raise Exception(r"Get configuration response body is not as expected {} actual status is {}.".format(expect_response_body.strip(), e.body.strip())) else: return e.reason, e.body else: raise Exception(r"Get configuration result is not as expected {} actual status is {}.".format(expect_status_code, e.status)) base._assert_status_code(expect_status_code, status_code) return data def set_cve_allowlist(self, expires_at=None, expected_status_code=200, *cve_ids, **kwargs): client = self._get_client(**kwargs) cve_list = [swagger_client.CVEAllowlistItem(cve_id=c) for c in cve_ids] allowlist = swagger_client.CVEAllowlist(expires_at=expires_at, items=cve_list) try: r = client.system_cve_allowlist_put_with_http_info(allowlist=allowlist, _preload_content=False) except Exception as e: base._assert_status_code(expected_status_code, e.status) else: base._assert_status_code(expected_status_code, r.status) def get_cve_allowlist(self, **kwargs): client = self._get_client(**kwargs) return client.system_cve_allowlist_get() def get_project_quota(self, reference, reference_id, **kwargs): params={} params['reference'] = reference params['reference_id'] = reference_id client = self._get_client(api_type='quota', **kwargs) data, status_code, _ = client.list_quotas_with_http_info(**params) base._assert_status_code(200, status_code) return data
from django import forms from django.db.models import query from .models import eventos, eliminar from randp.models import Ramos_y_preferencias class formularioEventos(forms.ModelForm): nombre = forms.CharField(widget=forms.TextInput(attrs={"placeholder" : "Nombre de la evaluacion..." , "max_length" : 20})) fecha = forms.DateField(widget=forms.DateInput(attrs={"placeholder" : "aaaa-mm-dd" })) descripcion = forms.CharField(widget=forms.Textarea(attrs={"placeholder" : "Ingrese una descripcion de su evaluacion", "rows": 10, "cols": 40})) prioridad = forms.IntegerField(widget = forms.TextInput(attrs = {"placeholder" : "Prioridad de la evaluacion 1-10", "size": 30 })) ramo = forms.ChoiceField(choices = [("luego será reescrito", "asi que no importa")]) class Meta: model = eventos fields = ['nombre', 'fecha', 'descripcion', 'prioridad', 'ramo'] #Sirve para poner self.request def __init__(self, *args, **kwargs): self.user = kwargs.pop('user', None) super(formularioEventos, self).__init__(*args, **kwargs) #Sobrescribimos ramo opciones = [] for ramo in Ramos_y_preferencias.objects.filter(usuario = self.user): opciones.append((ramo.nombre, ramo.nombre)) self.fields['ramo'].choices = opciones self.fields['descripcion'].label = "Descripcion" def clean_prioridad(self, *args, **kwargs): numero = self.cleaned_data.get('prioridad') if numero > 10 or numero < 1: raise forms.ValidationError("Debe ingresar una prioridad dentro del rango (1-10)") else: return numero def clean_nombre(self, *args, **kwargs): a = self.cleaned_data.get('nombre') lista = [] for b in eventos.objects.filter(usuario = self.user).values_list('nombre', flat = True): lista.append(b) if a in lista: raise forms.ValidationError("Ya existe un evento con ese nombre") else: return a #No es necesario pues ahora se selecciona el ramo con una lsita def clean_ramo(self, *args, **kwargs): lista_objetos = Ramos_y_preferencias.objects.filter(usuario = self.user) lista_ramos = [] for objeto in lista_objetos: lista_ramos.append(objeto.nombre) ramo_evento = self.cleaned_data.get("ramo") if ramo_evento in lista_ramos: return ramo_evento else: raise forms.ValidationError("No está registrado ese ramo") class eliminarEvento(forms.Form): opciones = [] for evento in eventos.objects.all(): opciones.append((evento.nombre, evento.nombre)) event_id = forms.ChoiceField(choices = opciones) class Meta: model = eliminar fields = ['event_id'] #Sirve para poder poner self.request def __init__(self, *args, **kwargs): self.request = kwargs.pop('request', None) super(eliminarEvento, self).__init__(*args, **kwargs) opciones = [] for evento in eventos.objects.filter(usuario = self.request.user): opciones.append((evento.nombre, evento.nombre)) #Overwrite el field event id para poder poner self.request.user: self.fields['event_id'].choices = opciones self.fields['event_id'].label = "Elimine una evaluacion:" def clean_event_id(self, *args, **kwargs): nombre = self.cleaned_data.get("event_id") if nombre in eventos.objects.filter(usuario = self.request.user).values_list('nombre', flat=True): return nombre else: raise forms.ValidationError("No existe un evento con ese id")
import copy import json import random from utils import common from utils import fever_db from utils.sentence_utils import SENT_LINE, check_and_clean_evidence, Evidences def load_data(file): d_list = [] with open(file, encoding='utf-8', mode='r') as in_f: for line in in_f: item = json.loads(line.strip()) d_list.append(item) return d_list def convert_evidence2scoring_format(predicted_sentids): e_list = predicted_sentids pred_evidence_list = [] for i, cur_e in enumerate(e_list): doc_id = cur_e.split(SENT_LINE)[0] ln = cur_e.split(SENT_LINE)[1] pred_evidence_list.append([doc_id, int(ln)]) return pred_evidence_list def paired_selection_score_dict(sent_list, selection_dict=None): if selection_dict is None: selection_dict = dict() for item in sent_list: selection_id: str = item['selection_id'] item_id: int = int(selection_id.split('<##>')[0]) sentid: str = selection_id.split('<##>')[1] doc_id: str = sentid.split(SENT_LINE)[0] ln: int = int(sentid.split(SENT_LINE)[1]) score: float = float(item['score']) prob: float = float(item['prob']) claim: str = item['query'] ssid = (item_id, doc_id, ln) if ssid in selection_dict: assert claim == selection_dict[ssid]['claim'] error_rate_prob = prob - float(selection_dict[ssid]['prob']) assert error_rate_prob < 0.01 else: selection_dict[ssid] = dict() selection_dict[ssid]['score'] = score selection_dict[ssid]['prob'] = prob selection_dict[ssid]['claim'] = claim return selection_dict def threshold_sampler_insure_unique_list(org_data_file, full_sent_list, prob_threshold=0.5, top_n=5): """ Providing samples to the Training set by a probability threshold on the upstream selected sentences. """ d_list = org_data_file augmented_dict = dict() for sent_item in full_sent_list: selection_id = sent_item['selection_id'] # The id for the current one selection. org_id = int(selection_id.split('<##>')[0]) remain_str = selection_id.split('<##>')[1] if org_id in augmented_dict: if remain_str not in augmented_dict[org_id]: augmented_dict[org_id][remain_str] = sent_item else: print("Exist") else: augmented_dict[org_id] = {remain_str: sent_item} for item in d_list: if int(item['id']) not in augmented_dict: # print("Potential error?") cur_predicted_sentids = [] else: cur_predicted_sentids = [] # formating doc_id + c_score.SENTLINT + line_number sents = augmented_dict[int(item['id'])].values() # Modify some mechaism here to selection sentence whether by some score or label for sent_i in sents: if sent_i['prob'] >= prob_threshold: cur_predicted_sentids.append((sent_i['sid'], sent_i['score'], sent_i['prob'])) # Important sentences for scaling training. Jul 21. # del sent_i['prob'] cur_predicted_sentids = sorted(cur_predicted_sentids, key=lambda x: -x[1]) item['scored_sentids'] = cur_predicted_sentids[:top_n] # Important sentences for scaling training. Jul 21. item['predicted_sentids'] = [sid for sid, _, _ in item['scored_sentids']][:top_n] item['predicted_evidence'] = convert_evidence2scoring_format(item['predicted_sentids']) # item['predicted_label'] = item['label'] # give ground truth label return d_list def threshold_sampler_insure_unique_merge(org_data_file, full_sent_list, prob_threshold=0.5, top_n=5, add_n=1): """ Providing samples to the Training set by a probability threshold on the upstream selected sentences. """ if not isinstance(org_data_file, list): d_list = common.load_jsonl(org_data_file) else: d_list = org_data_file augmented_dict = dict() for sent_item in full_sent_list: selection_id = sent_item['selection_id'] # The id for the current one selection. org_id = int(selection_id.split('<##>')[0]) remain_str = selection_id.split('<##>')[1] if org_id in augmented_dict: if remain_str not in augmented_dict[org_id]: augmented_dict[org_id][remain_str] = sent_item else: augmented_dict[org_id] = {remain_str: sent_item} for item in d_list: if int(item['id']) not in augmented_dict: # print("Potential error?") cur_predicted_sentids = [] else: cur_predicted_sentids = [] # formating doc_id + c_score.SENTLINT + line_number sents = augmented_dict[int(item['id'])].values() # Modify some mechaism here to selection sentence whether by some score or label for sent_i in sents: if sent_i['prob'] >= prob_threshold: cur_predicted_sentids.append((sent_i['sid'], sent_i['score'], sent_i['prob'])) # Important sentences for scaling training. Jul 21. # del sent_i['prob'] cur_predicted_sentids = sorted(cur_predicted_sentids, key=lambda x: -x[1]) cur_predicted_sentids = cur_predicted_sentids[:add_n] # if item['scored_sentids'] if len(item['predicted_sentids']) >= 5: continue else: item['predicted_sentids'].extend( [sid for sid, _, _ in cur_predicted_sentids if sid not in item['predicted_sentids']]) item['predicted_sentids'] = item['predicted_sentids'][:top_n] item['predicted_evidence'] = convert_evidence2scoring_format(item['predicted_sentids']) # item['predicted_label'] = item['label'] # give ground truth label return d_list def sample_additional_data_for_item_v1_0(item, additional_data_dictionary): res_sentids_list = [] flags = [] if item['verifiable'] == "VERIFIABLE": assert item['label'] == 'SUPPORTS' or item['label'] == 'REFUTES' e_list = check_and_clean_evidence(item) current_id = item['id'] assert current_id in additional_data_dictionary additional_data = additional_data_dictionary[current_id]['predicted_sentids'] # additional_data_with_score = additional_data_dictionary[current_id]['scored_sentids'] # print(len(additional_data)) for evidences in e_list: # print(evidences) new_evidences = copy.deepcopy(evidences) n_e = len(evidences) if n_e < 5: current_sample_num = random.randint(0, 5 - n_e) random.shuffle(additional_data) for sampled_e in additional_data[:current_sample_num]: doc_ids = sampled_e.split(SENT_LINE)[0] ln = int(sampled_e.split(SENT_LINE)[1]) new_evidences.add_sent(doc_ids, ln) if new_evidences != evidences: flag = f"verifiable.non_eq.{len(new_evidences) - len(evidences)}" flags.append(flag) pass else: flag = "verifiable.eq.0" flags.append(flag) pass res_sentids_list.append(new_evidences) assert len(res_sentids_list) == len(e_list) elif item['verifiable'] == "NOT VERIFIABLE": assert item['label'] == 'NOT ENOUGH INFO' e_list = check_and_clean_evidence(item) current_id = item['id'] additional_data = additional_data_dictionary[current_id]['predicted_sentids'] # print(len(additional_data)) random.shuffle(additional_data) current_sample_num = random.randint(2, 5) raw_evidences_list = [] for sampled_e in additional_data[:current_sample_num]: doc_ids = sampled_e.split(SENT_LINE)[0] ln = int(sampled_e.split(SENT_LINE)[1]) raw_evidences_list.append((doc_ids, ln)) new_evidences = Evidences(raw_evidences_list) if len(new_evidences) == 0: flag = f"verifiable.eq.0" flags.append(flag) pass else: flag = f"not_verifiable.non_eq.{len(new_evidences)}" flags.append(flag) assert all(len(e) == 0 for e in e_list) res_sentids_list.append(new_evidences) assert len(res_sentids_list) == 1 assert len(res_sentids_list) == len(flags) return res_sentids_list, flags def evidence_list_to_text_list(cursor, evidences, contain_head=True): # One evidence one text and len(evidences) == len(text_list) current_evidence_text_list = [] evidences = sorted(evidences, key=lambda x: (x[0], x[1])) cur_head = 'DO NOT INCLUDE THIS FLAG' for doc_id, line_num in evidences: _, e_text, _ = fever_db.get_evidence(cursor, doc_id, line_num) cur_text = "" if contain_head and cur_head != doc_id: cur_head = doc_id t_doc_id_natural_format = common.doc_id_to_tokenized_text(doc_id) if line_num != 0: cur_text = f"{t_doc_id_natural_format} <t> " # Important change move one line below: July 16 # current_evidence_text.append(e_text) cur_text = cur_text + e_text current_evidence_text_list.append(cur_text) assert len(evidences) == len(current_evidence_text_list) return current_evidence_text_list def select_sent_with_prob_for_eval_list(input_file, additional_file, prob_dict_file, cursor): """ This method select sentences with upstream sentence retrieval. :param input_file: This should be the file with 5 sentences selected. :return: """ if isinstance(additional_file, list): additional_d_list = additional_file else: additional_d_list = load_data(additional_file) additional_data_dict = dict() for add_item in additional_d_list: additional_data_dict[add_item['id']] = add_item d_list = input_file for item in d_list: e_list = additional_data_dict[item['id']]['predicted_sentids'] assert additional_data_dict[item['id']]['id'] == item['id'] pred_evidence_list = [] for i, cur_e in enumerate(e_list): doc_id = cur_e.split(SENT_LINE)[0] ln = int(cur_e.split(SENT_LINE)[1]) # Important changes Bugs: July 21 pred_evidence_list.append((doc_id, ln)) pred_evidence = Evidences(pred_evidence_list) evidence_text_list = evidence_list_to_text_list(cursor, pred_evidence, contain_head=True) evidences = sorted(pred_evidence, key=lambda x: (x[0], x[1])) item_id = int(item['id']) evidence_text_list_with_prob = [] for text, (doc_id, ln) in zip(evidence_text_list, evidences): ssid = (item_id, doc_id, int(ln)) if ssid not in prob_dict_file: print("Some sentence pair don't have 'prob'.") prob = 0.5 else: prob = prob_dict_file[ssid]['prob'] assert item['claim'] == prob_dict_file[ssid]['claim'] evidence_text_list_with_prob.append((text, prob)) item['evid'] = evidence_text_list_with_prob item['predicted_evidence'] = convert_evidence2scoring_format(e_list) item['predicted_sentids'] = e_list # This change need to be saved. # item['predicted_label'] = additional_data_dict[item['id']]['label'] return d_list
# MODULE: file # PURPOSE: copies files, changes modes, renders templates, deletes files, slices, dices # CATEGORY: general # PROVIDERS: file # RELATED: directory # FYI: See the online documentation for the full parmameter list # # DESCRIPTION: # # The File module handles all major types of file operations in OpsMop. # ======================================================================================= from opsmop.core.easy import * import getpass USERNAME = getpass.getuser() # -------------------------------------------------------------------------------------- # EXAMPLE: Template # SEE_FILE: templates/foo.txt.j2 # # DESCRIPTION: # # Templating a file from a jinja2 template # # See the official `Jinja2 documentation <http://jinja.pocoo.org/docs>`_ for full capabilities # of Jinja2 templates # ======================================================================================= class Jinja2TemplateExample(Role): def set_variables(self): return dict(a=1, b=5150, c="badwolf") def set_resources(self): return Resources( # for template language and variable scoping information, please consult the language docs Debug(), File(name="/tmp/opsmop-demo/foo1.txt", from_template="templates/foo.txt.j2"), Shell("cat /tmp/opsmop-demo/foo1.txt") ) # -------------------------------------------------------------------------------------- # EXAMPLE: Copy # # DESCRIPTION: # # Copying a file with owner, permission, and mode # ======================================================================================= class CopyExample(Role): def set_resources(self): return Resources( # owner/group/mode can be used with any of these forms, just showing one example here File(name="/tmp/opsmop-demo/foo2.txt", from_file="files/foo.txt", owner=USERNAME, mode=0x755), Shell("cat /tmp/opsmop-demo/foo2.txt") ) # -------------------------------------------------------------------------------------- # EXAMPLE: Copy From String # # DESCRIPTION: # # For very small files, this is also possible # ======================================================================================= class ContentExample(Role): def set_variables(self): return dict(a=2, b=2112, c="darmok") def set_resources(self): return Resources( Debug(), File(name="/tmp/opsmop-demo/foo3.txt", from_content="Happy Birthday"), Shell("cat /tmp/opsmop-demo/foo3.txt"), File(name="/tmp/opsmop-demo/foo4.txt", from_content=T("Template test! a={{ a}}")), Shell("cat /tmp/opsmop-demo/foo4.txt") ) # --------------------------------------------------------------------------------------- # EXAMPLE: Deleting a File # # DESCRIPTION: # # Ensure that a file does not exist # ======================================================================================= class AbsentExample(Role): def set_resources(self): return Resources( File(name="/tmp/opsmop-demo/foo4.txt", absent=True), Shell("ls /tmp/opsmop-demo/foo4.txt", ignore_errors=True), # the file is already deleted so this next step is a no-op File(name="/tmp/opsmop-demo/foo4.txt", absent=True), ) # --------------------------------------------------------------------------------------- # SETUP: a helper role that sets up for this demo # ======================================================================================= class CommonSetup(Role): def set_resources(self): return Roles( Directory(name="/tmp/opsmop-demo/") ) # --------------------------------------------------------------------------------------- # POLICY: loads all of the above roles # ======================================================================================= class Demo(Policy): def set_roles(self): return Roles( CommonSetup(), Jinja2TemplateExample(d=4, e=5, f=6), CopyExample(), ContentExample(), AbsentExample() ) if __name__ == '__main__': Cli(Demo())
from optparse import OptionParser from jai.logger import Severity, log import jai from jai.mode import Mode def version(): print(f"Jai {jai.__version__}") exit(0) def get_args(): ops = OptionParser() ops.add_option( "--version", action="store_true", dest="version", default=False, help="Get the version", ) ops.add_option( "-o", "--outfile", dest="outfile", default=False, help="Set the output file", ) ops.add_option( "-d", "--dont_write", action="store_true", dest="dont_write", default=False, help="Outputs the code gen", ) options, args = ops.parse_args() if options.version: version() mode = Mode.NotSet filename = "" if len(args) > 0: filename = str(args[0]) mode = Mode.Filemode else: mode = Mode.Interactive return mode, filename, options, args
""" Alex Staley -- Student ID: 919519311 Assignment 2 -- February 2020 ### HERE BEGINS THE Network.py FILE ### This code defines the NeuralNetwork class. It contains two arrays of Perceptron objects, representing a hidden layer and an output layer of neurons. Methods implemented here execute forward propagation through both layers, calculation of the error associated with each training example, and back propagation through both layers. Parameters are set via global constants declared in the Perceptron.py file. """ from neuralNetwork.Perceptron import * class NeuralNetwork(object): # Two connected layers of perceptron-like objects hiddenLayer = np.array([]) outputLayer = np.array([]) def __init__(self): for i in range(NUM_HIDDEN_UNITS): self.hiddenLayer = np.append(self.hiddenLayer, pTron(i, NUM_HIDDEN_INPUTS)) for i in range(NUM_OUTPUT_UNITS): self.outputLayer = np.append(self.outputLayer, pTron(i, NUM_OUTPUT_INPUTS)) def forwardPropagate(self, features): """ :param features: 1-d array of input fodder :return: outputActivation: for error calculation :return: hiddenActivation: for error calculation :return: hiddenActivationWithBias: for back propagation """ bias = 1 hiddenActivation = np.array([]) outputActivation = np.array([]) # Propagate inputs thru hidden layer: for i in range(NUM_HIDDEN_UNITS): hiddenActivation = np.append(hiddenActivation, self.hiddenLayer[i].activate(features)) # Append bias value: hiddenActivationWithBias = np.append(hiddenActivation, bias) # Propagate hidden activations thru output layer: for i in range(NUM_OUTPUT_UNITS): outputActivation = np.append(outputActivation, self.outputLayer[i].activate(hiddenActivationWithBias)) return outputActivation, hiddenActivation, hiddenActivationWithBias def calculateError(self, targetVector, outputActivation, hiddenActivation): """ :param targetVector: one training example, 0.9 for the actual value index, 0.1 elsewhere :param outputActivation: array of activation values from the output layer :param hiddenActivation: array of activation values from the hidden layer :return: hiddenError: for back propagation hidden -> input layer :return: outputError: for back propagation output -> hidden layer """ # Calculate output error: outputError = np.multiply( outputActivation, np.multiply( np.subtract(np.ones(NUM_OUTPUT_UNITS), outputActivation), np.subtract( targetVector, outputActivation))) # Get hidden-output weights array: feedbackWeights = np.empty(NUM_OUTPUT_UNITS) errorPropagation = np.empty(NUM_HIDDEN_UNITS) for i in range(NUM_HIDDEN_UNITS): for j in range(NUM_OUTPUT_UNITS): feedbackWeights[j] = self.outputLayer[j].weights[i] errorPropagation[i] = np.dot(feedbackWeights, outputError) # Calculate hidden error: hiddenError = np.multiply( hiddenActivation, np.multiply( np.subtract(np.ones(NUM_HIDDEN_UNITS), hiddenActivation), errorPropagation)) return hiddenError, outputError def backPropagate(self, features, outputError, hiddenError, hiddenResponse, hiddenEta, outputEta, lastOut, lastHid): """ :param features: one training example :param outputError: output -> hidden weight update factor :param hiddenError: hidden -> input weight update factor :param hiddenResponse: activation values for hidden->input layer including bias :param hiddenEta: array full of learning rate values for hidden layer :param outputEta: array full of learning rate values for output layer :param lastOut: bigDelta value for last update's momentum (output layer) :param lastHid: bigDelta value for last update's momentum (hidden layer) :return: lastOut: bigDelta value for next update's momentum (output layer) :return: lastHid: bigDelta value for next update's momentum (hidden layer) """ # Update weights in output layer: outputAdjustment = np.multiply(outputEta, outputError) for i in range(NUM_OUTPUT_UNITS): lastOut[i] = self.outputLayer[i].updateWeights( hiddenResponse, outputAdjustment[i], lastOut[i]) # Update weights in hidden layer: hiddenAdjustment = np.multiply(hiddenEta, hiddenError) for i in range(NUM_HIDDEN_UNITS): lastHid[i] = self.hiddenLayer[i].updateWeights( features, hiddenAdjustment[i], lastHid[i]) return lastOut, lastHid