prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
"""Event to indicate the file is completely read. This event will be caught by the FindLogJob that is watching it. The file will continue to be checked for modifications""" pass
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
"""Event to indicate we should continue reading the file. Log file processing will be done in chunks so as not to block the agent for too long.""" pass
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
def __init__(self, agent_obj, logfile): job.Job.__init__(self, agent_obj) assert os.path.isfile(logfile), "Not a file: %s" % str(logfile) self._log_size = os.stat(logfile).st_size log.debug("Log size is %d" % self._log_size) self._logfile_path = logfile self._logfile...
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
job.Job.__init__(self, agent_obj) assert os.path.isfile(logfile), "Not a file: %s" % str(logfile) self._log_size = os.stat(logfile).st_size log.debug("Log size is %d" % self._log_size) self._logfile_path = logfile self._logfile_hndl = open(logfile, 'r') self._pr...
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
return self._logfile_path
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
return self._progress
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
return self._log_size
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
evt = ReadLogContinueEvent(self) self.getAgent().addEvent(evt)
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
job.Job.notify(self, evt) if isinstance(evt, ReadLogContinueEvent) and evt.getSource() == self: log.debug("Continuing read of file") # Continue to read the log try: self._progress += log_parser.read_log( self._logf...
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
"""Update the entry in the database for this logfile""" log.debug("Updating file %s" % self._logfile_path) pass
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
"""Update the database to indicate that this is not a valid log file""" log.debug("Marking file %s invalid" % self._logfile_path) pass
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
log.debug("Marking file %s complete" % self._logfile_path) pass
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
"""Return a percentage complete value""" if self._log_size == 0: return 0 return int((float(self._progress) / self._log_size) * 100)
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
log.debug("Continuing read of file") # Continue to read the log try: self._progress += log_parser.read_log( self._logfile_hndl, self._db, LINEINCR) log.debug("Read %d %% of file (%d / %d)" % (self.getProgress(), ...
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
new_evt = ReadLogContinueEvent(self) self.getAgent().addEvent(new_evt)
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
return 0
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
__init__
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
getFilePath
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
getBytesRead
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
getBytesTotal
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
run
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
notify
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
_update_db
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
_mark_invalid
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
_mark_complete
<|file_name|>read_job.py<|end_file_name|><|fim▁begin|># JoeTraffic - Web-Log Analysis Application utilizing the JoeAgent Framework. # Copyright (C) 2004 Rhett Garber # 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 th...
getProgress
<|file_name|>test_logging_support.py<|end_file_name|><|fim▁begin|># # LMirror is Copyright (C) 2010 Robert Collins <robertc@robertcollins.net> # # LMirror 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, eithe...
<|file_name|>test_logging_support.py<|end_file_name|><|fim▁begin|># # LMirror is Copyright (C) 2010 Robert Collins <robertc@robertcollins.net> # # LMirror 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, eithe...
resources = [('logging', LoggingResourceManager())] def test_configure_logging_sets_converter(self): out = StringIO() c_log, f_log, formatter = logging_support.configure_logging(out) self.assertEqual(c_log, logging.root.handlers[0]) self.assertEqual(f_log, logging.root.handlers[...
<|file_name|>test_logging_support.py<|end_file_name|><|fim▁begin|># # LMirror is Copyright (C) 2010 Robert Collins <robertc@robertcollins.net> # # LMirror 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, eithe...
out = StringIO() c_log, f_log, formatter = logging_support.configure_logging(out) self.assertEqual(c_log, logging.root.handlers[0]) self.assertEqual(f_log, logging.root.handlers[1]) self.assertEqual(None, c_log.formatter) self.assertEqual(formatter, f_log.formatter) ...
<|file_name|>test_logging_support.py<|end_file_name|><|fim▁begin|># # LMirror is Copyright (C) 2010 Robert Collins <robertc@robertcollins.net> # # LMirror 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, eithe...
out = StringIO() c_log, f_log, formatter = logging_support.configure_logging(out, None) self.assertEqual(None, f_log)
<|file_name|>test_logging_support.py<|end_file_name|><|fim▁begin|># # LMirror is Copyright (C) 2010 Robert Collins <robertc@robertcollins.net> # # LMirror 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, eithe...
test_configure_logging_sets_converter
<|file_name|>test_logging_support.py<|end_file_name|><|fim▁begin|># # LMirror is Copyright (C) 2010 Robert Collins <robertc@robertcollins.net> # # LMirror 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, eithe...
test_can_supply_filename_None
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2019 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify i...
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2019 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify i...
""" load map file and get (an optional) callback if major stuff is done: - map creation - parsed imports - parsed layers - parsed cameras the callback will send both a string and a float (which shows the overall process), callback(string, float) @type engine: object @param engine: FIFE engine instan...
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2019 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify i...
"""Add a new loader for fileextension @type fileExtension: string @param fileExtension: The file extension the loader is registered for @type loaderClass: object @param loaderClass: A fife.ResourceLoader implementation that loads maps from files with the given fileExtension """ ...
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2019 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify i...
global fileExtensions fileExtensions = set(mapFileMapping.keys())
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2019 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify i...
print("--- Loading map took: ", map_loader.time_to_load, " seconds.")
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2019 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify i...
loadMapFile
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2019 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify i...
addMapLoader
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2019 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify i...
_updateMapFileExtensions
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
self.TIMEOUT = 2
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
def __init__(self): super(LILACSChatbotSkill, self).__init__(name="ChatbotSkill") # initialize your variables self.reload_skill = False self.active = True self.parser = None self.service = None self.TIMEOUT = 2 def initialize(self): # register int...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
super(LILACSChatbotSkill, self).__init__(name="ChatbotSkill") # initialize your variables self.reload_skill = False self.active = True self.parser = None self.service = None self.TIMEOUT = 2
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
self.parser = LILACSQuestionParser() self.service = KnowledgeService(self.emitter) self.build_intents() # make thread to keep active self.make_bump_thread()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
while True: i = 0 if self.active: self.emitter.emit(Message("recognizer_loop:utterance", {"source": "LILACS_chatbot_skill", "utterances": [ ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
timer_thread = Thread(target=self.ping) timer_thread.setDaemon(True) timer_thread.start()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
deactivate_intent = IntentBuilder("DeactivateChatbotIntent") \ .require("deactivateChatBotKeyword").build() activate_intent=IntentBuilder("ActivateChatbotIntent") \ .require("activateChatBotKeyword").build() bump_intent = IntentBuilder("BumpChatBotSkillIntent"). \ ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
pass
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
self.active = False self.speak_dialog("chatbot_off")
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
self.active = True self.speak_dialog("chatbot_on")
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
self.handle_deactivate_intent("global stop")
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
if self.active and "bump chat" not in transcript[0] and "bump curiosity" not in transcript[0]: nodes, parents, synonims = self.parser.tag_from_dbpedia(transcript[0]) self.log.info("nodes: " + str(nodes)) self.log.info("parents: " + str(parents)) self.log.info("syn...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
return LILACSChatbotSkill()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
self.emitter.emit(Message("recognizer_loop:utterance", {"source": "LILACS_chatbot_skill", "utterances": [ "bump chat to active skill list"]}))
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
nodes, parents, synonims = self.parser.tag_from_dbpedia(transcript[0]) self.log.info("nodes: " + str(nodes)) self.log.info("parents: " + str(parents)) self.log.info("synonims: " + str(synonims)) # get concept net , talk possible_responses = [] ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
__init__
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
initialize
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
ping
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
make_bump_thread
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
build_intents
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
handle_set_on_top_active_list
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
handle_deactivate_intent
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
handle_activate_intent
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
stop
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
converse
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 3 ...
create_skill
<|file_name|>test_run_info.py<|end_file_name|><|fim▁begin|>from unittest import TestCase from micall.drivers.run_info import RunInfo from micall.drivers.sample import Sample from micall.drivers.sample_group import SampleGroup class RunInfoTest(TestCase): def test_get_all_samples(self): expected_fastq_pat...
'2_R1_001.fastq']
<|file_name|>test_run_info.py<|end_file_name|><|fim▁begin|>from unittest import TestCase from micall.drivers.run_info import RunInfo from micall.drivers.sample import Sample from micall.drivers.sample_group import SampleGroup class RunInfoTest(TestCase): <|fim_middle|> <|fim▁end|>
def test_get_all_samples(self): expected_fastq_paths = ['1a_R1_001.fastq', '1b_R1_001.fastq', '2_R1_001.fastq'] run_info = RunInfo( sample_groups=[SampleGroup(Sample(fastq1='1a_R1_001.fastq'), ...
<|file_name|>test_run_info.py<|end_file_name|><|fim▁begin|>from unittest import TestCase from micall.drivers.run_info import RunInfo from micall.drivers.sample import Sample from micall.drivers.sample_group import SampleGroup class RunInfoTest(TestCase): def test_get_all_samples(self): <|fim_middle|> <|...
expected_fastq_paths = ['1a_R1_001.fastq', '1b_R1_001.fastq', '2_R1_001.fastq'] run_info = RunInfo( sample_groups=[SampleGroup(Sample(fastq1='1a_R1_001.fastq'), Sample(fastq1='1b_R1_001.fa...
<|file_name|>test_run_info.py<|end_file_name|><|fim▁begin|>from unittest import TestCase from micall.drivers.run_info import RunInfo from micall.drivers.sample import Sample from micall.drivers.sample_group import SampleGroup class RunInfoTest(TestCase): def <|fim_middle|>(self): expected_fastq_paths = [...
test_get_all_samples
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
""" Login as specified user and return handle. loginString: 'Domain\nUser\nPassword'; for local login use . or empty string as domain e.g. '.\nadministrator\nsecret_password' """ domain, user, passwd = loginString.split('\n') return win32security.LogonUser( user, ...
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
""" A Windows process. """ def __init__(self, cmd, login=None, hStdin=None, hStdout=None, hStderr=None, show=1, xy=None, xySize=None, desktop=None): """ Create a Windows process. cmd: command to run login: run as u...
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
""" Create a Windows process. cmd: command to run login: run as user 'Domain\nUser\nPassword' hStdin, hStdout, hStderr: handles for process I/O; default is caller's stdin, stdout & stderr show: wShowWindow (0=SW_HIDE, 1=SW_NORMAL...
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
""" Wait for process to finish or for specified number of milliseconds to elapse. """ if mSec is None: mSec = win32event.INFINITE return win32event.WaitForSingleObject(self.hProcess, mSec)
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
""" Kill process. Try for an orderly shutdown via WM_CLOSE. If still running after gracePeriod (5 sec. default), terminate. """ win32gui.EnumWindows(self.__close__, 0) if self.wait(gracePeriod) != win32event.WAIT_OBJECT_0: win32process.TerminateProcess(self.h...
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
""" EnumWindows callback - sends WM_CLOSE to any window owned by this process. """ TId, PId = win32process.GetWindowThreadProcessId(hwnd) if PId == self.PId: win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
""" Return process exit code. """ return win32process.GetExitCodeProcess(self.hProcess)
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
""" Run cmd as a child process and return exit code. mSec: terminate cmd after specified number of milliseconds stdin, stdout, stderr: file objects for child I/O (use hStdin etc. to attach handles instead of files); default is caller's stdin, stdout & stderr; kw: ...
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
si.hStdInput = win32api.GetStdHandle(win32api.STD_INPUT_HANDLE)
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
si.hStdInput = hStdin
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
si.hStdOutput = win32api.GetStdHandle(win32api.STD_OUTPUT_HANDLE)
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
si.hStdOutput = hStdout
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
si.hStdError = win32api.GetStdHandle(win32api.STD_ERROR_HANDLE)
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
si.hStdError = hStderr
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
si.dwX, si.dwY = xy si.dwFlags ^= win32con.STARTF_USEPOSITION
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
si.dwXSize, si.dwYSize = xySize si.dwFlags ^= win32con.STARTF_USESIZE
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
si.lpDesktop = desktop
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
hUser = logonUser(login) win32security.ImpersonateLoggedOnUser(hUser) procHandles = win32process.CreateProcessAsUser(hUser, *procArgs) win32security.RevertToSelf()
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
procHandles = win32process.CreateProcess(*procArgs)
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
mSec = win32event.INFINITE
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
win32process.TerminateProcess(self.hProcess, 0) win32api.Sleep(100) # wait for resources to be released
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
kw['hStdin'] = msvcrt.get_osfhandle(stdin.fileno())
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
kw['hStdout'] = msvcrt.get_osfhandle(stdout.fileno())
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
kw['hStderr'] = msvcrt.get_osfhandle(stderr.fileno())
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
child.kill() raise WindowsError, 'process timeout exceeded'
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
print 'Testing winprocess.py...' import tempfile timeoutSeconds = 15 cmdString = """\ REM Test of winprocess.py piping commands to a shell.\r REM This window will close in %d seconds.\r vol\r net user\r _this_is_a_test_of_stderr_\r """ % timeoutSeconds cmd, out = tempfile.TemporaryFile(...
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
logonUser
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>""" Windows Process Control winprocess.run launches a child process and returns the exit code. Optionally, it can: redirect stdin, stdout & stderr to files run the command as another user limit the process's running time control the process window (locati...
__init__