Example #1
0
 def __init__(self, inputs=None, outputs=None, model=None, sim=None, name=None):
     self.model = model
     self.sim = sim
     self.outputs = outputs
     self.name = name
     self.results = Results()
     deque.__init__(self)
Example #2
0
    def __init__(self, qname):
        deque.__init__(self)

        self.qname = qname
        self.openLog()

        self.initialBytes = self.__replayTransactions()  
Example #3
0
File: __init__.py Project: faph/MRU
 def __init__(self, app, org=None, maxlen=20):
     """
     :param app: Application name
     :type app: str
     :param org: Organisation name (default: ``None``)
     :type org: str
     :param maxlen: Maxium number of paths to remember
     :type maxlen: int
     :return: Iterable collection of MRU paths
     """
     self.app = app
     self.org = org
     #: Full path of file for saving MRU paths
     self.file_path = os.path.join(appdirs.user_config_dir(app, org), self.FILE_NAME)
     try:
         os.makedirs(os.path.dirname(self.file_path))  # create folder in advance
     except OSError:
         if not os.path.isdir(os.path.dirname(self.file_path)):
             raise
     try:
         # Load paths from file if possible
         with open(self.file_path, 'r', encoding='utf-8') as f:
             data = [line.rstrip('\n') for line in f]
     except OSError:
         data = []
     deque.__init__(self, data, maxlen=maxlen)
Example #4
0
    def __init__(self, name='trajectory', frame=[], reference=None, as_copy=True):
        self.name = name
        if isinstance(frame, list) and \
                all([isinstance(F, Transformation) for F in frame]):

            if not all([F.reference == frame[0].reference for F in frame]):
                raise Exception("Invalid arguments: Frames must all have the same reference")

            if reference is not None:
                if len(frame) > 0 and frame[0].reference != reference:
                    raise Exception("Invalid arguments: Frames references must equal reference argument")
            else:
                if len(frame) > 0:
                    reference = frame[0].reference

            if as_copy:
                deque.__init__(self, copy.deepcopy(frame))
                if reference is None:
                    self._reference = None
                else:
                    self._reference = copy.deepcopy(reference)
            else:
                deque.__init__(self, frame)
                if reference is None:
                    self._reference = None
                else:
                    self._reference = reference

            for F in self:
                F.reference = self._reference

        else:
            raise Exception("Invalid argument: " + str(frame) + "\n" + \
                            "Valid types: list of rigid.Transformation")
Example #5
0
    def __init__(self, qname):
        deque.__init__(self)

        self.qname = qname
        self.openLog()

        self.initialBytes = self.__replayTransactions()
Example #6
0
 def __init__(self, iterable, allowedTypes=None):
     types = allowedTypes if isinstance(allowedTypes,
                                        tuple) else (allowedTypes, )
     for item in types:
         if not isinstance(item, type):
             raise TypeError("%s is not a type" % repr(item))
     deque.__init__(self, iterable)
Example #7
0
    def __init__(self):
        deque.__init__(self)

        self.currentTime = 0
        self.nextAvailable = 0
        self.lastPlane = Aircraft('nil', 0, 0, 0, 0)
        self.totalFuelBurned = 0
        self.totalDelayCost = 0
Example #8
0
 def __init__(self, iterable=[], maxlen=None, buffersize=timedelta(seconds=5)):
     self.counts = Counter()
     self.buffersize = buffersize
     
     try:
         deque.__init__(self, iterable, maxlen)
     except TypeError:
         deque.__init__(self, iterable)
Example #9
0
    def __init__(self, maxdepth=None):

        if maxdepth:
            self.maxdepth = maxdepth
        else:
            self.maxdepth = self.default_maxdepth

        deque.__init__(self)
Example #10
0
 def __init__(self):
     deque.__init__(self)
     self.pointer = 0
     # dir = os.path.expanduser('~')
     dir = os.getcwd()
     fileName = "pschem.history"
     self.filePath = os.path.join(dir, fileName)
     self.restore()
Example #11
0
 def __init__(
         self, mode=None,
         file_format='json', home_dir='.', maxlen=None,
         *args, **kwds
 ):
     deque.__init__(self, *args, **kwds)
     self.mode = mode         # None or an octal triple like 0644
     self.file_format = file_format     # 'csv', 'json', or 'pickle'
     self.home_dir = home_dir
Example #12
0
 def __init__(self, word, alphabet=ABC):
     deque.__init__(self)
     if isinstance(word, str):
         for char in word:
             self.append(alphabet(char))
     else:
         self.extend(word)
     self.letters = set(map(abs, self))
     self.alphabet = alphabet
     self.cancel()
Example #13
0
 def __init__(self, arg=None):
   if arg:
     deque.__init__(self, arg)
     return
   for color in Card.colors:
     if color==TAROKK:
       for tarock in Card.tarocks:
         self.append(Card(tarock))
     else:
       for figure in Card.figures:
         self.append(Card(figure, color))
Example #14
0
    def __init__(self, executor, maxdepth=None):
        self.executor = executor
        self.refstack = executor.refstack

        if maxdepth:
            self.maxdepth = maxdepth
        else:
            self.maxdepth = self.default_maxdepth

        self.counter = 0
        deque.__init__(self)
Example #15
0
 def __init__(self, arg=None):
     if arg:
         deque.__init__(self, arg)
         return
     for color in Card.colors:
         if color == TAROKK:
             for tarock in Card.tarocks:
                 self.append(Card(tarock))
         else:
             for figure in Card.figures:
                 self.append(Card(figure, color))
Example #16
0
 def __init__(self,
              mode=None,
              file_format='json',
              home_dir='.',
              maxlen=None,
              *args,
              **kwds):
     deque.__init__(self, *args, **kwds)
     self.mode = mode  # None or an octal triple like 0644
     self.file_format = file_format  # 'csv', 'json', or 'pickle'
     self.home_dir = home_dir
Example #17
0
    def __init__(self, exception, rolledback):
        deque.__init__(self)
        tbexc = traceback.TracebackException.from_exception(exception)
        self.on_eval_flag = False

        mxdir = os.path.dirname(modelx.__file__)

        for frame in tbexc.stack:
            if mxdir in frame.filename and frame.name == "on_eval_formula":
                self.on_eval_flag = True
            elif not mxdir in frame.filename and self.on_eval_flag:
                node = rolledback.pop()
                self.append((node, frame.lineno))
                self.on_eval_flag = False

        while rolledback:
            node = rolledback.pop()
            self.append((node, 0))
Example #18
0
 def __init__(self):
     deque.__init__(self)
     self.mins = deque()
Example #19
0
 def __init__(self, max_size=20000):
     deque.__init__(self)
     self.max_size = max_size
Example #20
0
 def __init__(self, size_max):
     deque.__init__(self)
     self.size_max = size_max
Example #21
0
    def __init__(self, capacity):
        deque.__init__(self)

        assert capacity > 0
        self.capacity = capacity
        self.lastTimer= 999;
Example #22
0
 def __init__(self, limit=10, iterable=[]):
     self._limit = limit
     deque.__init__(self, iterable)
 def __init__(self, iterable=[], maxlen=None):
     _deque.__init__(self, iterable, maxlen)
     self._maxlen = maxlen
Example #24
0
 def __init__(self, size=1024):
     deque.__init__(self, maxlen=size)
     self._size = size
Example #25
0
 def __init__(self):
     deque.__init__(self)
Example #26
0
 def __init__(self, limit, outfp):
     deque.__init__(self)
     self.outfp = outfp
     self.limit = limit
Example #27
0
 def __init__(self,alist=[]):
     deque.__init__(self,alist)
 def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'):
     deque.__init__(self, initial_iterable, max_length)
     NakedObject.__init__(self, attributes, naked_type)
Example #29
0
 def __init__(self, *args, **keywords):
     deque.__init__(self, *args, **keywords)
     self.limit = 5
Example #30
0
 def __init__(self, size=SECONDS):
     self.size = size
     deque.__init__(self)
Example #31
0
 def __init__(self, response, parent):
     super(ApiResultList, self).__init__(response, parent)
     deque.__init__(self, self._make_list(response))
Example #32
0
 def __init__(self, size):
     deque.__init__(self)
     self.size = size
     self.offset = 0
Example #33
0
 def __init__(self,alist=[]):
     deque.__init__(self,alist)
Example #34
0
 def __init__(self, size):
     deque.__init__(self)
     self.size = size
     print("## RingBuffer created ##")
Example #35
0
 def __init__(self, owner, type):
     self.owner = owner
     self.type = type
     deque.__init__(self)
Example #36
0
 def __init__(self):
     deque.__init__(self, maxlen=1048576)
Example #37
0
 def __init__(self, owner, type):
     self.owner = owner
     self.type = type
     deque.__init__(self)
Example #38
0
 def __init__(self, size):
     deque.__init__(self)
     self.size = size
Example #39
0
 def __init__(self, *args):
     deque.__init__(self, args, maxlen=64)
	def __init__(self,HISTSIZE=500):
		self.HISTSIZE = HISTSIZE
		deque.__init__(self, maxlen=HISTSIZE)
Example #41
0
 def __init__(self):
     deque.__init__(self, [], self.WINDOW)
Example #42
0
 def __init__( self, iterable, allowedTypes = None ):
   types = allowedTypes if isinstance( allowedTypes, tuple ) else ( allowedTypes, )
   for item in types:
     if not isinstance( item, type ):
       raise TypeError("%s is not a type" % repr(item) )
   deque.__init__( self, iterable )
Example #43
0
 def __init__(self, maxlen):
     deque.__init__(self, maxlen=maxlen)
Example #44
0
 def __init__(self, limit, outfp):
     deque.__init__(self)
     self.outfp = outfp
     self.limit = limit
Example #45
0
 def __init__(self, iterable=[]):
     self.__size_sema = Semaphore(len(iterable))
     deque.__init__(self, iterable)
Example #46
0
 def __init__(self, maxlen=10):
     self._maxlen = maxlen
     deque.__init__(self)
Example #47
0
 def __init__(self, size):
     deque.__init__(self)
     self.size = size
Example #48
0
 def __init__(self, maxlen):
     deque.__init__(self)
     self._maxlen = maxlen
Example #49
0
 def __init__(self, maxlen=10):
     self._maxlen = maxlen
     deque.__init__(self)
Example #50
0
File: irc.py Project: GUIpsp/wololo
 def __init__(self, *args, **keywords):
     deque.__init__(self, *args, **keywords)
     self.limit = 5
Example #51
0
 def __init__(self, newarg=1):
     deque.__init__(self)
Example #52
0
 def __init__(self,length = 0,posi = ar([0,0]) , direc = ar([0,1])):
     deque.__init__(self)
     self.ini_snake(length,posi,direc)
Example #53
0
 def __init__(self, newarg=1):
     deque.__init__(self)
Example #54
0
 def __init__(self):
     deque.__init__(self)
     self._log = logging.getLogger('sent.q')