function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def update(self, pkg=None):
ayum = yum.YumBase()
ayum.doGenericSetup()
ayum.doRepoSetup()
try:
ayum.doLock()
if pkg != None:
tx_result = ayum.update(pattern=pkg)
else:
tx_result = ayum.update()
ayum.buildTra... | kadamski/func | [
9,
2,
9,
1,
1211919894
] |
def init_state(env, startPos):
# declare events
env.memory.declareEvent(EVENT_LOOK_FOR_PEOPLE); | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def shutdown(env):
planner = get_planner_instance(env)
planner.shutdown()
executor = get_executor_instance(env, None)
executor.shutdown()
mapper = get_mapper_instance(env)
mapper.shutdown()
updater_instances = get_updaters(env)
for updater in updater_instances:
updater.shutdow... | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def __init__(self, env_):
super(Planner, self).__init__()
self.env = env_ | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def does_event_interrupt_plan(self, event, state):
return True | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def shutdown(self):
pass | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def __init__(self, env, actionExecutor):
super(PlanExecutor, self).__init__()
self.env = env
self.actionExecutor = actionExecutor | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def _have_moved_wrapper(self):
self.env.log("Have moved")
pos = get_position(self.env)
lastPos = get_last_position(self.env)
self.have_moved(lastPos, pos)
save_waypoint(self.env, pos) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def have_moved(self, previousPos, currentPos):
pass | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def shutdown(self):
pass | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def __init__(self, env):
super(AbstractMapper, self).__init__()
self.env = env | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def update(self, position, sensors):
pass | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def get_map(self):
return None | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def __init__(self, env):
super(NullMapper, self).__init__(env) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def __init__(self, env, save_data=True):
super(FileLoggingMapper, self).__init__(env)
self.save_data = save_data
if self.save_data:
self.open_data_file() | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def update(self, position, sensors):
if self.save_data:
self.save_update_data(position, sensors) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def open_data_file(self):
self.logFilename = tempfile.mktemp()
self.env.log("Saving sensor data to {}".format(self.logFilename))
self.first_write = True
try:
self.logFile = open(self.logFilename, 'r+')
except IOError:
self.env.log("Failed to open file: {}"... | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def save_update_data(self, position, sensors):
if self.logFile:
data = { 'timestamp' : self.timestamp(),
'position' : position,
'leftSonar' : sensors.get_sensor('LeftSonar'),
'rightSonar' : sensors.get_sensor('RightSonar') }
... | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def write_sensor_data_to_file(self, fp, buffer_size=1024):
if self.logFile:
self.logFile.seek(0)
fp.write('[\n')
while 1:
copy_buffer = self.logFile.read(buffer_size)
if copy_buffer:
fp.write(copy_buffer)
els... | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def get_planner_instance(env):
global planner_instance
if not planner_instance:
fqcn = env.get_property(DEFAULT_CONFIG_FILE, PROPERTY_PLANNER_CLASS, DEFAULT_PLANNER_CLASS)
env.log("Creating a new planner instance of {}".format(fqcn))
klass = find_class(fqcn)
planner_instance = kl... | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def get_executor_instance(env, actionExecutor):
global executor_instance
if not executor_instance:
fqcn = env.get_property(DEFAULT_CONFIG_FILE, PROPERTY_EXECUTOR_CLASS, DEFAULT_EXECUTOR_CLASS)
env.log("Creating a new executor instance of {}".format(fqcn))
klass = find_class(fqcn)
... | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def get_mapper_instance(env):
global mapper_instance
if not mapper_instance:
fqcn = env.get_property(DEFAULT_CONFIG_FILE, PROPERTY_MAPPER_CLASS, DEFAULT_MAPPER_CLASS)
env.log("Creating a new mapper instance of {}".format(fqcn))
klass = find_class(fqcn)
mapper_instance = klass(env... | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def get_updaters(env):
global updater_instances
if not updater_instances:
updater_instances = []
fqcns = env.get_property(DEFAULT_CONFIG_FILE, PROPERTY_UPDATER_CLASSES)
if fqcns:
for fqcn in fqcns:
env.log("Creating a new updater instance of {}".format(fqcn))
... | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def make_wanderer_environment(box_):
env = make_environment(box_)
env.set_application_name(WANDERER_NAME)
return env | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def save_event(env, event):
env.memory.insertData(MEM_CURRENT_EVENT, to_json_string(event)) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def save_plan(env, plan):
env.memory.insertData(MEM_PLANNED_ACTIONS, to_json_string(plan)) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def save_completed_actions(env, actions):
env.memory.insertData(MEM_COMPLETED_ACTIONS, to_json_string(actions)) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def get_current_action(env):
return from_json_string(env.memory.getData(MEM_CURRENT_ACTIONS)) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def push_completed_action(env, action):
actions = load_completed_actions(env)
if actions is None:
actions = []
actions.append(action)
save_completed_actions(env, actions) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def save_direction(env, hRad):
env.memory.insertData(MEM_HEADING, hRad) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def get_path(env):
return env.memory.getData(MEM_WALK_PATH) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def get_last_position(env):
path = get_path(env)
pos = None
if not path is None:
try:
pos = path[-1]
except IndexError:
pass
return pos | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def get_position(env):
# 1 = FRAME_WORLD
return env.motion.getPosition("Torso", 1, True) | davesnowdon/nao-wanderer | [
7,
14,
7,
13,
1358257635
] |
def read_class_path(class_path):
'''Cache content of all jars.
Begin with rt.jar
'''
# folders for lookup for class files
lookup_paths = []
# content of all jars (name->path to jar)
jars = {}
# content of rt.jar
rt = {}
# first check local rt.jar
local_path = os.path.dirnam... | andrewromanenco/pyjvm | [
233,
25,
233,
3,
1396823002
] |
def __init__(self, bodies, **kwargs):
""" data is a from Load.BodyData """
# Performance data | Qirky/PyKinectTk | [
30,
14,
30,
4,
1455203905
] |
def update(self, frame):
""" Used to animate the drawing - passes a blitting=True argument to draw() """
self.draw(frame, blitting=True)
return self.lines | Qirky/PyKinectTk | [
30,
14,
30,
4,
1455203905
] |
def display():
plt.show() | Qirky/PyKinectTk | [
30,
14,
30,
4,
1455203905
] |
def draw_bone(self, body, a, b, i):
""" Draws update line i to draw a line between a and b """
# Re-order axes
# Kinect Axis Z is depth (matplot X)
# Kinect Axis Y is height (matplot Z)
# Kinect Axis X is width (matplot y) | Qirky/PyKinectTk | [
30,
14,
30,
4,
1455203905
] |
def animate(view):
""" Takes a 3D.View object and 'plays' the frames """
try:
mov = animation.FuncAnimation(view.fig, view.update, interval=view.rate, blit=False)
view.display()
except:
pass | Qirky/PyKinectTk | [
30,
14,
30,
4,
1455203905
] |
def setUpClass(cls):
cls.conf = load_test_config() | partofthething/infopanel | [
31,
10,
31,
10,
1486934002
] |
def test_connect(self):
"""
Make sure we can connect.
This relies on the test.mosquitto.org test server.
"""
self.client.start()
self.client.stop() | partofthething/infopanel | [
31,
10,
31,
10,
1486934002
] |
def __init__(self, filename, gdal_dataset, gdal_metadata, date=None,
ds=None, bands=None, cachedir=None, *args, **kwargs):
self.test_mapper(filename)
if not IMPORT_SCIPY:
raise NansatReadError('Sentinel-1 data cannot be read because scipy is not installed')
timest... | nansencenter/nansat | [
169,
65,
169,
91,
1374067434
] |
def add_nrcs_VV_from_HH(self, filename):
if not 'Amplitude_HH' in self.ds.variables.keys():
return
layer_time_id, layer_date = Opendap.get_layer_datetime(None,
self.convert_dstime_datetimes(self.get_dataset_time()))
dims = list(self.ds.variables['dn_HH'].dimensions)
... | nansencenter/nansat | [
169,
65,
169,
91,
1374067434
] |
def get_date(filename):
"""Extract date and time parameters from filename and return
it as a formatted (isoformat) string
Parameters
----------
filename: str
nn
Returns
-------
str, YYYY-mm-ddThh:MMZ
"""
_, filename = os... | nansencenter/nansat | [
169,
65,
169,
91,
1374067434
] |
def __init__(self, interval=1):
print "init flogger3"
print "flogger3 initialized"
return | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def flogger_run(self, settings):
print "flogger_run called"
print "settings.FLOGGER_SMTP_SERVER_URL: ", settings.FLOGGER_SMTP_SERVER_URL | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def floggerStop(self):
print "floggerStop called" | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def flogger_start(self, local_settings):
print "flogger_start called\n"
settings = local_settings | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def CheckPrev(callsignKey, dataKey, value):
print "CheckPrev if callsign in nprev_vals: ", callsignKey, " key: ", dataKey, " Value: ", value
if nprev_vals.has_key(callsignKey) == 1:
print "nprev_vals already has entry: ", callsignKey
else:
print "npre... | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def CheckVals(callsignKey, dataKey, value):
print "CheckVals if callsign in nvalues: ", callsignKey, " key: ", dataKey, " Value: ", value
if nvalues.has_key(callsignKey) == 1:
print "nvalues already has entry: ", callsignKey
else:
print "nvalues doesn... | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def isDayLight ():
return True | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def fleet_check(call_sign):
if aircraft.has_key(call_sign):
return True
else:
return False | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def comp_vals(set1, set2):
# Works out if the difference in positions is small and both speeds are close to zero
# Return True is yes and False if no
# Set1 are new values, set2 old values
print "Set1 value for key latitude is: ", set1["latitude"], " value: ", float(set1[... | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def set_keepalive(sock, after_idle_sec=1, interval_sec=3, max_fails=5):
"""Set TCP keepalive on an open socket. | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def is_dst(zonename):
# Determine if in daylight
tz = pytz.timezone(zonename)
now = pytz.utc.localize(datetime.utcnow())
return now.astimezone(tz).dst() != timedelta(0) | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def fleet_check_new(callsign):
#
# This has become a little confusing! If FLOGGER_FLEET_CHECK == n|N then FLOGGER_AIRFIELD_NAME is not used in
# the flarm_db search so a non-fleet aircraft can be found, but the later code checks whether the aircraft
# has taken off at FLO... | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def callsign_trans(callsign):
# Translates a callsign supplied as a flarm_id
# into the aircraft registration using a local db based on flarmnet or OGN
# Note if OGN db is being used then callsigns don't start with FLR or ICA, this is denoted by the 'Type' field | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def APRS_connect (settings):
#
#-----------------------------------------------------------------
# Connect to the APRS server to receive flarm data
#-----------------------------------------------------------------
# | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def addTrack(cursor,flight_no,track_no,longitude,latitude,altitude,course,speed,timeStamp):
#
#-----------------------------------------------------------------
# Add gps track data to track record if settings.FLOGGER_TRACK is "Y" ie yes
# and if flight_no != None wh... | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def endTrack():
return | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def CheckTrackData(cursor, flight_no, track_no, callsignKey): | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def check_position_packet (packet_str):
#
#-----------------------------------------------------------------
# This function determines if airfield is in the list of APRS
# base stations used for receiving position fixes.
#
# base_list shoul... | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def delete_table (table):
#
#-----------------------------------------------------------------
# This function deletes the SQLite3 table
# with the name supplied by "table".
#-----------------------------------------------------------------
# | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def delete_flogger_file(folder, filename, days):
#
#-----------------------------------------------------------------
# This function deletes the files whose name contain filename in folder folder
# if they were created up to and including the number of days in the pa... | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def connect_APRS(sock):
#
#-----------------------------------------------------------------
#
# This function tries to shutdown the specified sock and if it
# fails closes it and then creates a new one and reconnects to the APRS system
#
... | tobiz/OGN-Flight-Logger_V3 | [
1,
2,
1,
2,
1489363723
] |
def _disassemble_word(word):
i = struct.pack(">I", word)
r = md.disasm(i, 4).next()
return "%s %s" % (r.mnemonic, r.op_str) | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def __init__(self):
self._references = []
self._scopes = []
self._fixed_reference_end = None
self._fixed_scope_end = None
self._known_frame_levels = [] | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _add_variables_references(self, v):
if hasattr(v, "children") and isinstance(v.children, list) and len(v.children) > 0:
self._assign_variablesReference(v)
for c in v.children:
c.scope = v.scope
self._add_variables_references(c) | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _add_scope(self, s, fl=0):
print "adding scope %s" % s.name
s.fl = fl
self._assign_variablesReference(s)
self._scopes += [s]
for c in s.children:
c.scope = s
self._add_variables_references(c)
if not fl in self._known_frame_levels:
s... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def clear_dynamic_scopes(self):
self._scopes = self._scopes[:self._fixed_scope_end]
self._references = self._references[:self._fixed_reference_end]
self._fixed_scope_end = None
self._fixed_reference_end = None
self._known_frame_levels = [] | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def dereference(self, ref_no):
return self._references[ref_no - 1] | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def __init__(self, dev, di, do):
self.data_in = di
self.data_out = do
self.dev = dev
self._monitor = ExecutionMonitor(dev, functools.partial(CDPServer._evt_stopped, self))
self.__dispatch_setup()
self._register_model = model_registers(dev)
self._register_model.acc... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def __enter__(self):
return self | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def __dispatch_setup(self):
self.__dispatch_tbl = {}
for i in self.__class__.__dict__:
if len(i) > 5 and i[0:5] == "_cmd_":
self.__dispatch_tbl[unicode(i[5:])] = getattr(self, i) | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _cmd_initialize(self, cmd):
self._seq = 1
ex = {}
ex["supportsConfigurationDoneRequest"] = True
ex["supportEvaluateForHovers"] = False
self._respond(cmd, True, ex=ex) | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _cmd_setExceptionBreakpoints(self, cmd):
self._respond(cmd, False) | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def __advance_to_next_line(self):
while True:
self.dev.rxcpu.mode.single_step = 1
count = 0
while self.dev.rxcpu.mode.single_step:
count += 1
if count > 500:
raise Exception("single step bit failed to clear")
cur... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _cmd_next(self, cmd):
self._respond(cmd, True)
pc = self.dev.rxcpu.pc
cl = self._image.addr2line(pc)
self._log_write("single step began at pc: %x, cl: %s" % (pc, cl))
self.__advance_to_next_line()
pc = self.dev.rxcpu.pc
cl = self._image.addr2line(pc)
s... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _cmd_disconnect(self, cmd):
self._running = False
self._respond(cmd, True) | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _cmd_pause(self, cmd):
self._respond(cmd, True)
self.dev.rxcpu.halt() | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def __stack_unwind(self):
frame_state_attrs = ["r%d" % x for x in range(32)] + ["pc"]
frame_state = {}
for a in frame_state_attrs:
frame_state[a] = getattr(self.dev.rxcpu, a)
if 0x8008000 <= frame_state["pc"] and 0x8008010 > frame_state["pc"]:
return [frame_state]... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def __find_cfa_tbl_line_for(self, pc):
result = None
for entry in sorted(self._image._cfa_rule.keys(), reverse=True):
if pc >= entry and entry != 0:
result = self._image._cfa_rule[entry]
break
return result | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _collect_scopes(self, frame):
loc = self._image.loc_at(frame["pc"])
func_name, cu_name, cu_line, source_dir = loc
scopes = []
if len(self._image._compile_units[cu_name]["variables"]) > 0:
global_scope = ScopeModel("global variables")
global_scope.children = s... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _var_pp(v):
try: return "%x" % v
except: return str(v) | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _cmd_scopes(self, cmd): | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _cmd_variables(self, cmd):
members = self._vt.dereference(cmd["arguments"]["variablesReference"])
b = {}
b["variables"] = []
for child in members.children:
o = {}
try: o["name"] = child.display_name
except: o["name"] = child.name
if h... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _log_write(self, data):
print data.strip()
sys.stdout.flush() | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _event(self, event, body = None):
r = {}
r["type"] = "event"
r["seq"] = self._seq
self._seq += 1
r["event"] = event
if body is not None:
r["body"] = body
self.send(r) | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def __insn_repl(self, addr, replacement):
original_insn = struct.unpack("!I", self.dev.rxcpu.tr_read(addr, 1))[0]
self.dev.rxcpu.tr_write_dword(addr, replacement)
return original_insn
try:
self._breakpoints[addr] = original_insn
except:
self._breakpoints ... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def _clear_breakpoint(self, filename, line_no = None):
try:
current_breakpoints = self._breakpoints[filename]
except:
return
if line_no is None:
lines = current_breakpoints.keys()
else:
lines = [line_no]
for line in lines:
... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def send(self, resp):
r = json.dumps(resp, separators=(",",":"))
cl = len(r)
txt = "Content-Length: %d%s%s" % (cl, LINE_SEP + LINE_SEP, r) | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def recv(self):
h = self.data_in.readline()
content_length = int(h.split(" ")[1])
d = self.data_in.readline()
d = self.data_in.read(content_length)
self._log_write("rcvd: %s\n" % repr(d))
try:
j = json.loads(d)
except:
self._log_write("EXCE... | sstjohn/thundergate | [
69,
10,
69,
2,
1430539071
] |
def __init__(self, cred, controller):
super(CredEntry, self).__init__()
self.cred = cred
self._controller = controller
self._code = Code('', 0, 0) | Yubico/yubioath-desktop-dpkg | [
6,
6,
6,
1,
1434464093
] |
def code(self):
return self._code | Yubico/yubioath-desktop-dpkg | [
6,
6,
6,
1,
1434464093
] |
def code(self, value):
self._code = value
self.changed.emit() | Yubico/yubioath-desktop-dpkg | [
6,
6,
6,
1,
1434464093
] |
def manual(self):
return self.cred.touch or self.cred.oath_type == TYPE_HOTP | Yubico/yubioath-desktop-dpkg | [
6,
6,
6,
1,
1434464093
] |
def cb(code):
if timer:
timer.stop()
dialog.accept()
if isinstance(code, Exception):
QtGui.QMessageBox.warning(window, m.error,
code.message)
else:
self.code = code | Yubico/yubioath-desktop-dpkg | [
6,
6,
6,
1,
1434464093
] |
def delete(self):
if self.cred.name in ['YubiKey slot 1', 'YubiKey slot 2']:
self._controller.delete_cred_legacy(int(self.cred.name[-1]))
else:
self._controller.delete_cred(self.cred.name) | Yubico/yubioath-desktop-dpkg | [
6,
6,
6,
1,
1434464093
] |
def names(creds):
return set(c.cred.name for c in creds) | Yubico/yubioath-desktop-dpkg | [
6,
6,
6,
1,
1434464093
] |
def __init__(self, interval):
super(Timer, self).__init__()
self._interval = interval
now = time()
rem = now % interval
self._time = int(now - rem)
QtCore.QTimer.singleShot((self._interval - rem) * 1000, self._tick) | Yubico/yubioath-desktop-dpkg | [
6,
6,
6,
1,
1434464093
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.