Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main(curses_screen):
G.screen = Screen(curses_screen)
G.screen.Initialize()
C.ConfigureRuntime(curses_screen)
G.reqManager = RM.RequestManager()
G.reqManager.FetchData()
G.intf = I.Interface()
G.intf.Init()
bookThread = threading.Thread(target=BookKeepingThread)
bookThread.start()
#inputThread = threading.Thread(target=G.intf.Input)
#inputThread.start()
try:
G.intf.Input()
except:
DEBUG.Display("Cleaning up...")
bookThread.join()
def __init__(self, parent, filename, id_, standard, rule):
self.original_values = self._compute_values(standard, rule)
self.ui = interface.Interface(parent, filename, id_,
(interface.StartNthWeekDay,
interface.EndTime,
interface.AlarmTime,
interface.Standard),
self.original_values)
def init_interface():
user_interface = Interface()
container.add('interface', user_interface)
def __init__(self, parent, filename, id_, standard, rule):
self.original_values = self._compute_values(standard, rule)
self.ui = interface.Interface(parent, filename, id_,
(interface.StartDateSample,
interface.Interval,
interface.EndDateSample,
interface.AlarmDateSample,
interface.Standard),
self.original_values)
class Link(Document):
"""
Network links.
Always contains a list of 2*N references.
2 - for fully resolved links
2*N for unresolved N-link portchannel
N, N > 2 - broadcast media
"""
meta = {
"collection": "noc.links",
"allow_inheritance": False,
"indexes": ["interfaces"]
}
interfaces = PlainReferenceListField(Interface)
discovery_method = StringField()
def __unicode__(self):
return u"(%s)" % ", ".join([unicode(i) for i in self.interfaces])
def contains(self, iface):
"""
Check link contains interface
:return: boolean
"""
return iface in self.interfaces
@property
def is_ptp(self):
"""
Check link is point-to-point link
from typing import List
from interface import Interface
from liteflow.core.models import WorkflowDefinition, Workflow
class IWorkflowRegistry(Interface):
def get_definition(self, id, version) -> WorkflowDefinition:
pass
def register_workflow(self, workflow: Workflow):
pass
def object_links_count(cls, object):
ifaces = Interface.objects.filter(managed_object=object.id).values_list("id")
return cls.objects.filter(interfaces__in=ifaces).count()
"""Main function to get and respond to user input."""
puzzle = 'solvable_sliding_tile'
solver = 'A*'
if len(sys.argv) > 1:
if sys.argv[1] in Interface.PUZZLES.keys():
puzzle = sys.argv[1]
else:
print('Error: invalid puzzle name')
return
if len(sys.argv) > 2:
if sys.argv[2] in Interface.SOLVERS.keys():
solver = sys.argv[2]
else:
print('Error: invalid solver name')
return
interface = Interface(puzzle, solver)
interface.prompt = '\n'
interface.cmdloop()
def __init__(self, parent, filename, id_, standard, rule):
self.original_values = self._compute_values(standard, rule)
self.ui = interface.Interface(parent, filename, id_,
(interface.WeekDays,
interface.StartTime,
interface.EndTime,
interface.AlarmTime,
interface.Standard),
self.original_values)
import os
import matplotlib.pyplot as plt
import interface
import heatmap
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("port", help="serial port identifier")
parser.add_argument("-g", "--grid_data", help="Apply griddata filter", action='store_true')
args = parser.parse_args()
if __name__ == '__main__':
itfc = interface.Interface(port = args.port)
gui = heatmap.GUI(interface=itfc, grid_data=args.grid_data)
PADX = 6
PADX_GRID = 2
PADY_GRID = 2
root = Tk.Tk()
root.wm_title("Thermography for ML with Keras/TensorFlow")
if args.grid_data:
fig, axes = plt.subplots(1, 2, figsize=(6, 5), gridspec_kw = {'width_ratios':[20, 1]})
else:
fig, axes = plt.subplots(1, 2, figsize=(10, 5))
fig.subplots_adjust(bottom=0.15)