function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def get_pipeline_run_config(self, pipe_name, pipe_version): """Return a filepath for the config to be used or None.""" return None
MetaSUB/ModuleUltra
[ 1, 1, 1, 1, 1506196367 ]
def get_daemon_config_filename(ctype): try: return environ['MODULE_ULTRA_DAEMON_CONFIG'] except KeyError: config_dir = ModuleUltraConfig.getConfigDir() config_filename = join(config_dir, 'daemon_config.yaml') if isfile(config_filename): return config_filename assert False, "No daemon config found"
MetaSUB/ModuleUltra
[ 1, 1, 1, 1, 1506196367 ]
def gpio_init(pin, output): try: with open(f"/sys/class/gpio/gpio{pin}/direction", 'wb') as f: f.write(b"out" if output else b"in") except Exception as e: print(f"Failed to set gpio {pin} direction: {e}")
commaai/openpilot
[ 38913, 7077, 38913, 364, 1479951210 ]
def setUp(self): self.user = 'leo' self.core_url = "https://api.navitia.io/v1/" self.client = navitia_client.Client(self.user) self.coords = '2.333333;48.866667'
leonardbinet/navitia_client
[ 9, 3, 9, 2, 1481535827 ]
def initAlgorithm(self, config): """ Parameter setting. """ self.addParameter( QgsProcessingParameterMultipleLayers( self.INPUT_LAYERS, self.tr('Input Layers'), QgsProcessing.TypeVector ) ) self.addParameter( QgsProcessingParameterExpression( self.CATEGORY_EXPRESSION, self.tr('Expression used to find out the category'), defaultValue="regexp_substr(@layer_name ,'([^_]+)')" ) ) self.addOutput( QgsProcessingOutputMultipleLayers( self.OUTPUT, self.tr('Original reorganized layers') ) )
lcoandrade/DsgTools
[ 42, 22, 42, 15, 1412914139 ]
def getLayerRootNode(self, lyr, rootNode): """ Finds the database name of the layer and creates (if not exists) a node with the found name. lyr: (QgsVectorLayer) rootNode: (node item) """ uriText = lyr.dataProvider().dataSourceUri() candidateUri = QgsDataSourceUri(uriText) rootNodeName = candidateUri.database() if not rootNodeName: rootNodeName = self.getRootNodeName(uriText) #creates database root return self.createGroup(rootNodeName, rootNode)
lcoandrade/DsgTools
[ 42, 22, 42, 15, 1412914139 ]
def getLayerCategoryNode(self, lyr, rootNode, categoryExpression): """ Finds category node based on category expression and creates it (if not exists a node) """ exp = QgsExpression(categoryExpression) context = QgsExpressionContext() context.appendScopes( QgsExpressionContextUtils.globalProjectLayerScopes(lyr) ) if exp.hasParserError(): raise Exception(exp.parserErrorString()) if exp.hasEvalError(): raise ValueError(exp.evalErrorString()) categoryText = exp.evaluate(context) return self.createGroup(categoryText, rootNode)
lcoandrade/DsgTools
[ 42, 22, 42, 15, 1412914139 ]
def name(self): """ Returns the algorithm name, used for identifying the algorithm. This string should be fixed for the algorithm, and must not be localised. The name should be unique within each provider. Names should contain lowercase alphanumeric characters only and no spaces or other formatting characters. """ return 'grouplayers'
lcoandrade/DsgTools
[ 42, 22, 42, 15, 1412914139 ]
def group(self): """ Returns the name of the group this algorithm belongs to. This string should be localised. """ return self.tr('Layer Management Algorithms')
lcoandrade/DsgTools
[ 42, 22, 42, 15, 1412914139 ]
def tr(self, string): """ Translates input string. """ return QCoreApplication.translate('GroupLayersAlgorithm', string)
lcoandrade/DsgTools
[ 42, 22, 42, 15, 1412914139 ]
def doc_root(port_obj): doc_root = port_obj.get_option("wptserver_doc_root") if doc_root is None: return port_obj.host.filesystem.join("imported", "w3c", "web-platform-tests") return doc_root
teamfx/openjfx-9-dev-rt
[ 1, 2, 1, 2, 1494141092 ]
def __init__(self, port_obj, name, pidfile=None): http_server_base.HttpServerBase.__init__(self, port_obj) self._output_dir = port_obj.results_directory() self._name = name self._log_file_name = '%s_process_log.out.txt' % (self._name) self._wsout = None self._process = None self._pid_file = pidfile if not self._pid_file: self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % self._name) self._servers_file = self._filesystem.join(self._runtime_path, '%s_servers.json' % (self._name)) self._stdout_data = None self._stderr_data = None self._filesystem = port_obj.host.filesystem self._layout_root = port_obj.layout_tests_dir() self._doc_root = self._filesystem.join(self._layout_root, doc_root(port_obj)) self._resources_files_to_copy = ['testharness.css', 'testharnessreport.js'] current_dir_path = self._filesystem.abspath(self._filesystem.split(__file__)[0]) self._start_cmd = ["python", self._filesystem.join(current_dir_path, "web_platform_test_launcher.py"), self._servers_file] self._doc_root_path = self._filesystem.join(self._layout_root, self._doc_root)
teamfx/openjfx-9-dev-rt
[ 1, 2, 1, 2, 1494141092 ]
def _copy_webkit_test_files(self): _log.debug('Copying WebKit resources files') for f in self._resources_files_to_copy: webkit_filename = self._filesystem.join(self._layout_root, "resources", f) if self._filesystem.isfile(webkit_filename): self._filesystem.copyfile(webkit_filename, self._filesystem.join(self._doc_root, "resources", f)) _log.debug('Copying WebKit web platform server config.json') config_wk_filename = self._filesystem.join(self._layout_root, "imported", "w3c", "resources", "config.json") if self._filesystem.isfile(config_wk_filename): config_json = self._filesystem.read_text_file(config_wk_filename).replace("%CERTS_DIR%", self._filesystem.join(self._output_dir, "_wpt_certs")) self._filesystem.write_text_file(self._filesystem.join(self._doc_root, "config.json"), config_json) wpt_testharnessjs_file = self._filesystem.join(self._doc_root, "resources", "testharness.js") layout_tests_testharnessjs_file = self._filesystem.join(self._layout_root, "resources", "testharness.js") # FIXME: Next line to be removed once all bots have wpt_testharnessjs_file updated correctly. See https://bugs.webkit.org/show_bug.cgi?id=152257. self._filesystem.copyfile(layout_tests_testharnessjs_file, wpt_testharnessjs_file) if (not self._filesystem.compare(wpt_testharnessjs_file, layout_tests_testharnessjs_file)): _log.warning("\n//////////\nWPT tests are not using the same testharness.js file as other WebKit Layout tests.\nWebKit testharness.js might need to be updated according WPT testharness.js.\n//////////\n")
teamfx/openjfx-9-dev-rt
[ 1, 2, 1, 2, 1494141092 ]
def _prepare_config(self): if self._filesystem.exists(self._output_dir): output_log = self._filesystem.join(self._output_dir, self._log_file_name) self._wsout = self._filesystem.open_text_file_for_writing(output_log) self._install_modules() self._copy_webkit_test_files()
teamfx/openjfx-9-dev-rt
[ 1, 2, 1, 2, 1494141092 ]
def _stop_running_subservers(self): if self._filesystem.exists(self._servers_file): try: json_data = self._filesystem.read_text_file(self._servers_file) started_servers = json.loads(json_data) for server in started_servers: if self._executive.check_running_pid(server['pid']): _log.warning('Killing server process (protocol: %s , port: %d, pid: %d).' % (server['protocol'], server['port'], server['pid'])) self._executive.kill_process(server['pid']) finally: self._filesystem.remove(self._servers_file)
teamfx/openjfx-9-dev-rt
[ 1, 2, 1, 2, 1494141092 ]
def __init__(self): self.net = common.Net()
felipenaselva/felipe.repository
[ 2, 6, 2, 1, 1474110890 ]
def __replaceQuality(self, qual): return self.qual_map.get(qual.lower(), '000')
felipenaselva/felipe.repository
[ 2, 6, 2, 1, 1474110890 ]
def __init__(self): """Init the effect library and get options from gui.""" inkex.Effect.__init__(self) self.OptionParser.add_option("-t", "--width", action="store", type="int", dest="width", default=200, help="this variable will be used to resize the original selected image to a width of whatever \ you enter and height proportional to the new width, thus maintaining the aspect ratio") self.OptionParser.add_option("--inkscape_path", action="store", type="string", dest="inkscape_path", default="", help="") self.OptionParser.add_option("--temp_path", action="store", type="string", dest="temp_path", default="", help="")
abhishek-sehgal954/Inkscape_extensions_for_halftone_filters
[ 9, 2, 9, 2, 1501822197 ]
def draw_rectangle(self,(x, y), (l,b), color, parent, id_):
abhishek-sehgal954/Inkscape_extensions_for_halftone_filters
[ 9, 2, 9, 2, 1501822197 ]
def draw_circle(self,(x, y), r, color, parent, id_):
abhishek-sehgal954/Inkscape_extensions_for_halftone_filters
[ 9, 2, 9, 2, 1501822197 ]
def draw_ellipse(self,(x, y), (r1,r2), color, parent, id_,transform):
abhishek-sehgal954/Inkscape_extensions_for_halftone_filters
[ 9, 2, 9, 2, 1501822197 ]
def draw_svg(self,output,parent): startu = 0 endu = 0 for i in range(len(output)): for j in range(len(output[i])): if (output[i][j]==0): self.draw_circle((int((startu+startu+1)/2),int((endu+endu+1)/2)),1,'black',parent,'id') #dwg.add(dwg.circle((int((startu+startu+1)/2),int((endu+endu+1)/2)),1,fill='black')) startu = startu+2 endu = endu+2 startu = 0
abhishek-sehgal954/Inkscape_extensions_for_halftone_filters
[ 9, 2, 9, 2, 1501822197 ]
def intensity(self,arr):
abhishek-sehgal954/Inkscape_extensions_for_halftone_filters
[ 9, 2, 9, 2, 1501822197 ]
def order_dither(self,image): arr = np.asarray(image) brr = self.intensity(arr) crr = [[8, 3, 4], [6, 1, 2], [7, 5, 9]] drr = np.zeros((len(arr),len(arr[0]))) for i in range(len(arr)): for j in range(len(arr[0])): if(brr[i][j] > crr[i%3][j%3]): drr[i][j] = 255 else: drr[i][j] = 0 return drr
abhishek-sehgal954/Inkscape_extensions_for_halftone_filters
[ 9, 2, 9, 2, 1501822197 ]
def exportPage(self, curfile, outfile): command = "%s %s --export-png %s" %(self.options.inkscape_path,curfile,outfile) p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) return_code = p.wait() f = p.stdout err = p.stderr img = Image.open(outfile)
abhishek-sehgal954/Inkscape_extensions_for_halftone_filters
[ 9, 2, 9, 2, 1501822197 ]
def main(): e = ordered_dithering() e.affect() exit()
abhishek-sehgal954/Inkscape_extensions_for_halftone_filters
[ 9, 2, 9, 2, 1501822197 ]
def Riffle(filenames,vb=False): if vb: print "Looking at",len(filenames),"files: ",filenames # Break down file names. Naming convention: fruit_flavor.fits fruits = [] flavors = [] for filename in set(filenames): pieces = string.split(filename,'_') fruits.append(string.join(pieces[0:-1],'_')) flavors.append(string.split(pieces[-1],'.')[0]) if len(set(flavors)) > 2: raise ValueError("ERROR: expecting 1 or 2 flavors of datafile, got more") elif len(set(flavors)) == 0: raise ValueError("ERROR: expecting 1 or 2 flavors of datafile, got none") if 'sci' not in set(flavors): raise ValueError("ERROR: expecting at least some files to be xxx_sci.fits") if len(set(flavors)) == 1: whttype = 'No-one_will_ever_choose_this_flavor' else: for x in (set(flavors) - set(['sci'])): whttype = x number = len(set(fruits)) scifiles = [] whtfiles = [] for fruit in set(fruits): x = fruit+'_sci.fits' if os.path.exists(x): scifiles.append(x) else: scifiles.append(None) x = fruit+'_'+whttype+'.fits' if os.path.exists(x): whtfiles.append(x) else: whtfiles.append(None) if vb: print "Riffled files into",number,"pair(s)" if len(set(flavors)) == 1: print "Only 1 flavor of file found, sci" else: print "2 flavors of file found: sci and",whttype for i in range(number): print " ",i+1,"th pair:",[scifiles[i],whtfiles[i]] return scifiles,whtfiles
davidwhogg/LensTractor
[ 5, 4, 5, 15, 1330532514 ]
def Deal(scifiles,varfiles,SURVEY='PS1',vb=False): images = [] bands = [] epochs = [] centroids = [] total_mags = []
davidwhogg/LensTractor
[ 5, 4, 5, 15, 1330532514 ]
def Read_in_data(scifile,varfile,SURVEY='PS1',vb=False): hdulist = pyfits.open(scifile) sci = hdulist[0].data hdr = hdulist[0].header hdulist.close() NX,NY = sci.shape if (varfile is not None): hdulist = pyfits.open(varfile) var = hdulist[0].data hdulist.close() else: # Make a var image from the sci image... background = np.median(sci) diffimage = sci - background # Get the flux-to-count conversion factor from header, at least in SDSS: try: tmpsurvey = hdr['ORIGIN'] if (tmpsurvey == 'SDSS'): tempmtoc = hdr['NMGY'] else: tempmtoc = 1. except: tempmtoc = 1.
davidwhogg/LensTractor
[ 5, 4, 5, 15, 1330532514 ]
def Initial_PSF(FWHM,double=False): # NB. FWHM of PSF is given in pixels. if not double: # Single Gaussian default: w = np.array([1.0]) # amplitude at peak mu = np.array([[0.0,0.0]]) # centroid position in pixels var = (FWHM/2.35)**2.0 cov = np.array([[[var,0.0],[0.0,var]]]) # pixels^2, covariance matrix else: # Double Gaussian alternative: w = np.array([1.0,1.0]) mu = np.array([[0.0,0.0],[0.0,0.0]]) var = (FWHM/2.35)**2.0 cov = np.array([[[1.0,0.0],[0.0,1.0]],[[var,0.0],[0.0,var]]])
davidwhogg/LensTractor
[ 5, 4, 5, 15, 1330532514 ]
def Turnover(allbands,allmagnitudes,allcentroids,vb=False): # Models need good initial fluxes to avoid wasting time getting these # right. Take a quick look at the data to do this: # 1) Get rough idea of object position from wcs of first image - works # OK if all images are the same size and well registered, and the # target is in the center of the field... ra, dec = 0.0, 0.0 for radec in allcentroids: ra += radec.ra dec += radec.dec ra, dec = ra/len(allcentroids), dec/len(allcentroids) centroid = tractor.RaDecPos(ra,dec) print "Mean flux-weighted centroid: ",centroid # 2) Get rough idea of total object magnitudes from median of images # in each filter. (Models have non-variable flux, by assumption!) bandnames = np.unique(allbands) magnitudes = np.zeros(len(bandnames)) for i,bandname in enumerate(bandnames): index = np.where(allbands == bandname) magnitudes[i] = np.median(allmagnitudes[index]) SED = tractor.Mags(order=bandnames, **dict(zip(bandnames,magnitudes))) if vb: print "Mean SED: ",SED return centroid,SED
davidwhogg/LensTractor
[ 5, 4, 5, 15, 1330532514 ]
def __init__(self, editor): """ Constructor. Arguments: editor -- A qtquiedit object. """ self.editor = editor self.themeDict = yaml.load(open(self.editor.get_resource( \ u'themes.yaml')).read()) self.theme = self.recTheme(self.editor.theme)
smathot/quiedit
[ 6, 3, 6, 1, 1310495698 ]
def font(self): """ Gives the theme font. Returns: A QFont. """ font = QtGui.QFont() font.setPointSize(int(self.theme[u'font_size'])) font.setFamily(self.theme[u'font_family']) return font
smathot/quiedit
[ 6, 3, 6, 1, 1310495698 ]
def forwards(self, orm): # Adding model 'FormPlugin' db.create_table(u'cmsplugin_formplugin', ( (u'cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)), ('form_class', self.gf('django.db.models.fields.CharField')(max_length=200)), ('success_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True)), ('post_to_url', self.gf('django.db.models.fields.URLField')(max_length=200)), )) db.send_create_signal(u'cms_form_plugin', ['FormPlugin'])
metzlar/cms-form-plugin
[ 4, 5, 4, 1, 1390944245 ]
def main(): goToLineCol(bRepeatPrompt = True, iEdgeBuffer = 5, iCaretHiliteDuration = 5, bCallTipAutoHide = False, bBraceHilite = True)
bruderstein/PythonScript
[ 310, 62, 310, 74, 1280013973 ]
def promptValue(sInfoText, sTitleText, sDefaultVal, iMinVal, iMaxVal, sRangeError, bRepeatPrompt): while True: sNewVal = notepad.prompt(sInfoText, sTitleText, sDefaultVal) if sNewVal == None: return None try: iNewVal = int(sNewVal) if iMinVal <= iNewVal <= iMaxVal: return iNewVal else: raise except: notepad.messageBox(sRangeError + '.\n\nYou specified: ' + sNewVal + '\n\nPlease specify a number between ' + str(iMinVal) + ' and ' + str(iMaxVal) + '.', 'Specified value is out of range') if not bRepeatPrompt: return None
bruderstein/PythonScript
[ 310, 62, 310, 74, 1280013973 ]
def __init__(self, applet): self.applet = applet self.dialog = Gtk.Dialog("Workspace Name Applet Preferences", None, Gtk.DialogFlags.DESTROY_WITH_PARENT, (Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)) self.dialog.set_border_width(10) width_spin_label = Gtk.Label(label=_("Applet width in pixels:")) width_adj = Gtk.Adjustment(lower=30, upper=500, step_incr=1) self.width_spin_button = Gtk.SpinButton.new(width_adj, 0.0, 0) self.applet.settings.bind("width", self.width_spin_button, "value", Gio.SettingsBindFlags.DEFAULT) width_spin_hbox = Gtk.HBox() width_spin_hbox.pack_start(width_spin_label, True, True, 0) width_spin_hbox.pack_start(self.width_spin_button, True, True, 0) self.dialog.vbox.add(width_spin_hbox)
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def __init__(self, applet): Gtk.Widget.__init__(self) self.connect("activate", self._on_activate) self.connect("key-release-event", self._on_key_release) self.applet = applet
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def _on_key_release(self, widget, event): if event.keyval == Gdk.KEY_Escape: self.applet.exit_editing()
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def __init__(self, applet): self.applet = applet; menuxml = """ <menuitem name="Prefs" action="Prefs" /> <menuitem name="About" action="About" />
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def _display_about(self, action): about = Gtk.AboutDialog() about.set_program_name("Workspace Name Applet") about.set_version(wsnamelet_globals.version) about.set_copyright("© 2006 - 2015 Alexandre Muñiz") about.set_comments("View and change the name of the current workspace.\n\nTo change the workspace name, click on the applet, type the new name, and press Enter.") about.set_website("https://github.com/munizao/mate-workspace-name-applet") about.connect ("response", lambda self, *args: self.destroy ()) about.show_all()
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def set_width(self, width): self.width = width self.button.set_size_request(width, -1) self.button.queue_resize() self.entry.set_size_request(width, -1) self.entry.queue_resize()
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def init(self): self.button = Gtk.Button() self.button.connect("button-press-event", self._on_button_press) self.button.connect("button-release-event", self._on_button_release) self.label = Gtk.Label() self.label.set_ellipsize(Pango.EllipsizeMode.END) self.applet.add(self.button) self.button.add(self.label) self.entry = WSNameEntry(self) self.entry.connect("button-press-event", self._on_entry_button_press) try: self.settings = Gio.Settings.new("com.puzzleapper.wsname-applet-py") self.set_width(self.settings.get_int("width")) self.settings.connect("changed::width", self.on_width_changed) except: self.set_width(100) self.screen = Wnck.Screen.get_default() self.workspace = really_get_active_workspace(self.screen) self.screen.connect("active_workspace_changed", self._on_workspace_changed) self.button.set_tooltip_text(_("Click to change the name of the current workspace")) self._name_change_handler_id = None self.prefs = WSNamePrefs(self) self.show_workspace_name() self.applet.show_all() return True
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def _on_button_release(self, button, event, data=None): if event.type == Gdk.EventType.BUTTON_RELEASE and event.button == 1: self.editing = True self.applet.remove(self.button) self.applet.add(self.entry) self.entry.set_text(self.workspace.get_name()) self.entry.set_position(-1) self.entry.select_region(0, -1) self.applet.request_focus(event.time) GObject.timeout_add(0, self.entry.grab_focus) self.applet.show_all()
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def _on_workspace_changed(self, event, old_workspace): if self.editing: self.exit_editing() if (self._name_change_handler_id): self.workspace.disconnect(self._name_change_handler_id) self.workspace = really_get_active_workspace(self.screen) self._name_change_handler_id = self.workspace.connect("name-changed", self._on_workspace_name_changed) self.show_workspace_name()
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def show_workspace_name(self): if self.workspace: self.label.set_text(self.workspace.get_name()) self.applet.show_all()
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def really_get_active_workspace(screen): # This bit is needed because wnck is asynchronous. while Gtk.events_pending(): Gtk.main_iteration() return screen.get_active_workspace()
munizao/mate-workspace-name-applet
[ 1, 1, 1, 2, 1424054871 ]
def __init__(self, group_paths=ALL_GROUP_PATHS): self.locale = Locale.get_locale() self.translator = CustomTranslator() self.paths = group_paths self.groups = {} self._fill_groups_list()
nextgis/quickmapservices
[ 143, 44, 143, 33, 1416824373 ]
def _read_ini_file(self, root, ini_file_path, category): try: ini_full_path = os.path.join(root, ini_file_path) parser = configparser.ConfigParser() with codecs.open(ini_full_path, 'r', 'utf-8') as ini_file:
nextgis/quickmapservices
[ 143, 44, 143, 33, 1416824373 ]
def get_group_menu(self, group_id): if group_id in self.groups: return self.groups[group_id].menu else: info = GroupInfo(group_id=group_id, menu=QMenu(group_id)) self.groups[group_id] = info return info.menu
nextgis/quickmapservices
[ 143, 44, 143, 33, 1416824373 ]
def wait_for_ansible(appliance): appliance.server.settings.enable_server_roles("embedded_ansible") appliance.wait_for_embedded_ansible() yield appliance.server.settings.disable_server_roles("embedded_ansible")
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def ansible_repository(appliance, wait_for_ansible): repositories = appliance.collections.ansible_repositories try: repository = repositories.create( name=fauxfactory.gen_alpha(), url=cfme_data.ansible_links.playbook_repositories.embedded_ansible, description=fauxfactory.gen_alpha()) except KeyError: pytest.skip("Skipping since no such key found in yaml") view = navigate_to(repository, "Details") wait_for( lambda: view.entities.summary("Properties").get_text_of("Status") == "successful", timeout=60, fail_func=view.toolbar.refresh.click ) yield repository repository.delete_if_exists()
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def ansible_catalog_item(appliance, ansible_repository): cat_item = appliance.collections.catalog_items.create( appliance.collections.catalog_items.ANSIBLE_PLAYBOOK, fauxfactory.gen_alphanumeric(), fauxfactory.gen_alphanumeric(), display_in_catalog=True, provisioning={ "repository": ansible_repository.name, "playbook": "dump_all_variables.yml", "machine_credential": "CFME Default Credential", "create_new": True, "provisioning_dialog_name": fauxfactory.gen_alphanumeric() } ) yield cat_item cat_item.delete_if_exists()
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def ansible_action(appliance, ansible_catalog_item): action_collection = appliance.collections.actions action = action_collection.create( fauxfactory.gen_alphanumeric(), action_type="Run Ansible Playbook", action_values={ "run_ansible_playbook": { "playbook_catalog_item": ansible_catalog_item.name } } ) yield action action.delete_if_exists()
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def policy_for_testing(appliance, full_template_vm_modscope, provider, ansible_action): vm = full_template_vm_modscope policy = appliance.collections.policies.create( VMControlPolicy, fauxfactory.gen_alpha(), scope="fill_field(VM and Instance : Name, INCLUDES, {})".format(vm.name) ) policy.assign_actions_to_event("Tag Complete", [ansible_action.description]) policy_profile = appliance.collections.policy_profiles.create( fauxfactory.gen_alpha(), policies=[policy]) provider.assign_policy_profiles(policy_profile.description) yield if policy.exists: policy.assign_events() provider.unassign_policy_profiles(policy_profile.description) policy_profile.delete() policy.delete()
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def ansible_credential(wait_for_ansible, appliance, full_template_modscope): credential = appliance.collections.ansible_credentials.create( fauxfactory.gen_alpha(), "Machine", username=credentials[full_template_modscope.creds]["username"], password=credentials[full_template_modscope.creds]["password"] ) yield credential credential.delete_if_exists()
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def service_request(appliance, ansible_catalog_item): request_desc = "Provisioning Service [{0}] from [{0}]".format(ansible_catalog_item.name) _service_request = appliance.collections.requests.instantiate(request_desc) yield _service_request _service_request.delete_if_exists()
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def service(appliance, ansible_catalog_item): service_ = MyService(appliance, ansible_catalog_item.name) yield service_ if service_.exists: service_.delete()
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def test_action_run_ansible_playbook_localhost(request, ansible_catalog_item, ansible_action, policy_for_testing, full_template_vm_modscope, ansible_credential, service_request, service): """Tests a policy with ansible playbook action against localhost. Polarion: assignee: sbulage initialEstimate: 1/6h casecomponent: Ansible """ with update(ansible_action): ansible_action.run_ansible_playbook = {"inventory": {"localhost": True}} added_tag = full_template_vm_modscope.add_tag() request.addfinalizer(lambda: full_template_vm_modscope.remove_tag(added_tag)) wait_for(service_request.exists, num_sec=600) service_request.wait_for_request() view = navigate_to(service, "Details") assert view.provisioning.details.get_text_of("Hosts") == "localhost" assert view.provisioning.results.get_text_of("Status") == "successful"
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def test_action_run_ansible_playbook_manual_address(request, ansible_catalog_item, ansible_action, policy_for_testing, full_template_vm_modscope, ansible_credential, service_request, service): """Tests a policy with ansible playbook action against manual address. Polarion: assignee: sbulage initialEstimate: 1/6h casecomponent: Ansible """ vm = full_template_vm_modscope with update(ansible_catalog_item): ansible_catalog_item.provisioning = {"machine_credential": ansible_credential.name} with update(ansible_action): ansible_action.run_ansible_playbook = { "inventory": { "specific_hosts": True, "hosts": vm.ip_address } } added_tag = vm.add_tag() request.addfinalizer(lambda: vm.remove_tag(added_tag)) wait_for(service_request.exists, num_sec=600) service_request.wait_for_request() view = navigate_to(service, "Details") assert view.provisioning.details.get_text_of("Hosts") == vm.ip_address assert view.provisioning.results.get_text_of("Status") == "successful"
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def test_action_run_ansible_playbook_target_machine(request, ansible_catalog_item, ansible_action, policy_for_testing, full_template_vm_modscope, ansible_credential, service_request, service): """Tests a policy with ansible playbook action against target machine. Polarion: assignee: sbulage initialEstimate: 1/6h casecomponent: Ansible """ vm = full_template_vm_modscope with update(ansible_action): ansible_action.run_ansible_playbook = {"inventory": {"target_machine": True}} added_tag = vm.add_tag() request.addfinalizer(lambda: vm.remove_tag(added_tag)) wait_for(service_request.exists, num_sec=600) service_request.wait_for_request() view = navigate_to(service, "Details") assert view.provisioning.details.get_text_of("Hosts") == vm.ip_address assert view.provisioning.results.get_text_of("Status") == "successful"
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def test_action_run_ansible_playbook_unavailable_address(request, ansible_catalog_item, full_template_vm_modscope, ansible_action, policy_for_testing, ansible_credential, service_request, service): """Tests a policy with ansible playbook action against unavailable address. Polarion: assignee: sbulage initialEstimate: 1/6h casecomponent: Ansible """ vm = full_template_vm_modscope with update(ansible_catalog_item): ansible_catalog_item.provisioning = {"machine_credential": ansible_credential.name} with update(ansible_action): ansible_action.run_ansible_playbook = { "inventory": { "specific_hosts": True, "hosts": "unavailable_address" } } added_tag = vm.add_tag() request.addfinalizer(lambda: vm.remove_tag(added_tag)) wait_for(service_request.exists, num_sec=600) service_request.wait_for_request() view = navigate_to(service, "Details") assert view.provisioning.details.get_text_of("Hosts") == "unavailable_address" assert view.provisioning.results.get_text_of("Status") == "failed"
RedHatQE/cfme_tests
[ 69, 165, 69, 133, 1360187957 ]
def call_3dfier(db, tile, schema_tiles, pc_file_name, pc_tile_case, pc_dir, table_index_pc, fields_index_pc, table_index_footprint, fields_index_footprint, uniqueid, extent_ewkb, clip_prefix, prefix_tile_footprint, yml_dir, tile_out, output_format, output_dir, path_3dfier, thread): """Call 3dfier with the YAML config created by yamlr(). Note ---- For the rest of the parameters see batch3dfier_config.yml. Parameters ---------- db : db Class instance tile : str Name of of the 2D tile. schema_tiles : str Schema of the footprint tiles. pc_file_name : str Naming convention for the pointcloud files. See 'dataset_name' in batch3dfier_config.yml. pc_tile_case : str How the string matching is done for pc_file_name. See 'tile_case' in batch3dfier_config.yml. pc_dir : str Directory of the pointcloud files. See 'dataset_dir' in batch3dfier_config.yml. thread : str Name/ID of the active thread. extent_ewkb : str EWKB representation of 'extent' in batch3dfier_config.yml. clip_prefix : str Prefix for naming the clipped/united views. This value shouldn't be a substring of the pointcloud file names. prefix_tile_footprint : str or None Prefix prepended to the footprint tile view names. If None, the views are named as the values in fields_index_fooptrint['unit_name']. Returns ------- list The tiles that are skipped because no corresponding pointcloud file was found in 'dataset_dir' (YAML) """ pc_tiles = find_pc_tiles(db, table_index_pc, fields_index_pc, table_index_footprint, fields_index_footprint, extent_ewkb, tile_footprint=tile, prefix_tile_footprint=prefix_tile_footprint) pc_path = find_pc_files(pc_tiles, pc_dir, pc_file_name, pc_tile_case) # prepare output file name if not tile_out: tile_out = tile.replace(clip_prefix, '', 1) # Call 3dfier ------------------------------------------------------------ if pc_path: # Needs a YAML per thread so one doesn't overwrite it while the other # uses it yml_name = thread + "_config.yml" yml_path = os.path.join(yml_dir, yml_name) config = yamlr(dbname=db.dbname, host=db.host, user=db.user, pw=db.password, schema_tiles=schema_tiles, bag_tile=tile, pc_path=pc_path, output_format=output_format, uniqueid=uniqueid) # Write temporary config file try: with open(yml_path, "w") as text_file: text_file.write(config) except BaseException: print("Error: cannot write _config.yml") # Prep output file name if "obj" in output_format.lower(): o = tile_out + ".obj" output_path = os.path.join(output_dir, o) elif "csv" in output_format.lower(): o = tile_out + ".csv" output_path = os.path.join(output_dir, o) else: output_path = os.path.join(output_dir, tile_out) # Run 3dfier command = (path_3dfier + " {yml} -o {out}").format( yml=yml_path, out=output_path) try: call(command, shell=True) except BaseException: print("\nCannot run 3dfier on tile " + tile) tile_skipped = tile else: print( "\nPointcloud file(s) " + str(pc_tiles) + " not available. Skipping tile.\n") tile_skipped = tile return({'tile_skipped': tile_skipped, 'out_path': None}) return({'tile_skipped': None, 'out_path': output_path})
balazsdukai/batch3dfier
[ 3, 1, 3, 7, 1498038705 ]
def find_pc_files(pc_tiles, pc_dir, pc_file_name, pc_tile_case): """Find pointcloud files in the file system when given a list of pointcloud tile names """ # Prepare AHN file names ------------------------------------------------- if pc_tile_case == "upper": tiles = [pc_file_name.format(tile=t.upper()) for t in pc_tiles] elif pc_tile_case == "lower": tiles = [pc_file_name.format(tile=t.lower()) for t in pc_tiles] elif pc_tile_case == "mixed": tiles = [pc_file_name.format(tile=t) for t in pc_tiles] else: raise "Please provide one of the allowed values for pc_tile_case." # use the tile list in tiles to parse the pointcloud file names pc_path = [os.path.join(pc_dir, pc_tile) for pc_tile in tiles] if all([os.path.isfile(p) for p in pc_path]): return(pc_path) else: return(None)
balazsdukai/batch3dfier
[ 3, 1, 3, 7, 1498038705 ]
def extent_to_ewkb(db, table_index, file): """Reads a polygon from a file and returns its EWKB. I didn't find a simple way to safely get SRIDs from the input geometry with Shapely, therefore it is obtained from the database and the CRS of the polygon is assumed to be the same as of the tile indexes. Parameters ---------- db : db Class instance table_index : dict {'schema' : str, 'table' : str} of the table of tile index. file : str Path to the polygon for clipping the input. Must be in the same CRS as the table_index. Returns ------- [Shapely polygon, EWKB str] """ schema = sql.Identifier(table_index['schema']) table = sql.Identifier(table_index['table']) query = sql.SQL("""SELECT st_srid(geom) AS srid FROM {schema}.{table} LIMIT 1;""").format(schema=schema, table=table) srid = db.getQuery(query)[0][0] assert srid is not None # Get clip polygon and set SRID with fiona.open(file, 'r') as src: poly = shape(src[0]['geometry']) # Change a the default mode to add this, if SRID is set geos.WKBWriter.defaults['include_srid'] = True # set SRID for polygon geos.lgeos.GEOSSetSRID(poly._geom, srid) ewkb = poly.wkb_hex return([poly, ewkb])
balazsdukai/batch3dfier
[ 3, 1, 3, 7, 1498038705 ]
def get_2Dtile_area(db, table_index): """Get the area of a 2D tile. Note ---- Assumes that all tiles have equal area. Area is in units of the tile CRS. Parameters ---------- db : db Class instance table_index : list of str {'schema' : str, 'table' : str} of the table of tile index. Returns ------- float """ schema = sql.Identifier(table_index['schema']) table = sql.Identifier(table_index['table']) query = sql.SQL(""" SELECT public.st_area(geom) AS area FROM {schema}.{table} LIMIT 1; """).format(schema=schema, table=table) area = db.getQuery(query)[0][0] return(area)
balazsdukai/batch3dfier
[ 3, 1, 3, 7, 1498038705 ]
def clip_2Dtiles(db, user_schema, schema_tiles, tiles, poly, clip_prefix, fields_view): """Creates views for the clipped tiles. Parameters ---------- db : db Class instance user_schema: str schema_tiles : str tiles : list poly : Shapely polygon clip_prefix : str Returns ------- list Name of the views of the clipped tiles. """ user_schema = sql.Identifier(user_schema) schema_tiles = sql.Identifier(schema_tiles) tiles_clipped = [] fields_all = fields_view['all'] field_geom_q = sql.Identifier(fields_view['geometry']) for tile in tiles: t = clip_prefix + tile tiles_clipped.append(t) view = sql.Identifier(t) tile_view = sql.Identifier(tile) fields_q = parse_sql_select_fields(tile, fields_all) wkb = sql.Literal(poly.wkb_hex) query = sql.SQL(""" CREATE OR REPLACE VIEW {user_schema}.{view} AS SELECT {fields} FROM {schema_tiles}.{tile_view} WHERE st_within({tile_view}.{geom}, {wkb}::geometry)""" ).format(user_schema=user_schema, schema_tiles=schema_tiles, view=view, fields=fields_q, tile_view=tile_view, geom=field_geom_q, wkb=wkb) db.sendQuery(query) try: db.conn.commit() print( str( len(tiles_clipped)) + " views with prefix '{}' are created in schema {}.".format( clip_prefix, user_schema)) except BaseException: print("Cannot create view {user_schema}.{clip_prefix}{tile}".format( schema_tiles=schema_tiles, clip_prefix=clip_prefix)) db.conn.rollback() return(tiles_clipped)
balazsdukai/batch3dfier
[ 3, 1, 3, 7, 1498038705 ]
def get_view_fields(db, user_schema, tile_views): """Get the fields in a 2D tile view Parameters ---------- tile_views : list of str Returns ------- {'all' : list, 'geometry' : str} """ if len(tile_views) > 0: schema_q = sql.Literal(user_schema) view_q = sql.Literal(tile_views[0]) resultset = db.getQuery(sql.SQL(""" SELECT column_name FROM information_schema.columns WHERE table_schema = {schema} AND table_name = {view}; """).format(schema=schema_q, view=view_q)) f = [field[0] for field in resultset] geom_res = db.getQuery(sql.SQL(""" SELECT f_geometry_column FROM public.geometry_columns WHERE f_table_schema = {schema} AND f_table_name = {view}; """).format(schema=schema_q, view=view_q)) f_geom = geom_res[0][0] fields = {} fields['all'] = f fields['geometry'] = f_geom return(fields) else: return(None)
balazsdukai/batch3dfier
[ 3, 1, 3, 7, 1498038705 ]
def enumerate_ground_sensors(bones): bone = bones.get('GroundSensor.Axle.Ft') if bone is not None: yield bone for bone in bones: if bone.name.startswith('GroundSensor.Ft'): yield bone bone = bones.get('GroundSensor.Axle.Bk') if bone is not None: yield bone for bone in bones: if bone.name.startswith('GroundSensor.Bk'): yield bone
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def __init__(self): self.layout.use_property_split = True self.layout.use_property_decorate = False
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def is_car_rig(cls, context): return context.object is not None and context.object.data is not None and 'Car Rig' in context.object.data
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def is_car_rig_generated(cls, context): return cls.is_car_rig(context) and context.object.data['Car Rig']
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def display_bake_section(self, context): self.layout.operator(bake_operators.ANIM_OT_carSteeringBake.bl_idname) self.layout.operator(bake_operators.ANIM_OT_carWheelsRotationBake.bl_idname) self.layout.operator(bake_operators.ANIM_OT_carClearSteeringWheelsRotation.bl_idname)
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def display_ground_sensors_section(self, context): for ground_sensor in enumerate_ground_sensors(context.object.pose.bones): ground_projection_constraint = ground_sensor.constraints.get('Ground projection') self.layout.label(text=ground_sensor.name, icon='BONE_DATA') if ground_projection_constraint is not None: self.layout.prop(ground_projection_constraint, 'target', text='Ground') if ground_projection_constraint.target is not None: self.layout.prop(ground_projection_constraint, 'shrinkwrap_type') if ground_projection_constraint.shrinkwrap_type == 'PROJECT': self.layout.prop(ground_projection_constraint, 'project_limit') self.layout.prop(ground_projection_constraint, 'influence') ground_projection_limit_constraint = ground_sensor.constraints.get('Ground projection limitation') if ground_projection_limit_constraint is not None: self.layout.prop(ground_projection_limit_constraint, 'min_z', text='Min local Z') self.layout.prop(ground_projection_limit_constraint, 'max_z', text='Max local Z') self.layout.separator()
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def poll(cls, context): return RIGACAR_PT_mixin.is_car_rig(context)
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def poll(cls, context): return RIGACAR_PT_mixin.is_car_rig_generated(context)
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def poll(cls, context): return RIGACAR_PT_mixin.is_car_rig(context)
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def poll(cls, context): return RIGACAR_PT_mixin.is_car_rig_generated(context)
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def poll(cls, context): return RIGACAR_PT_mixin.is_car_rig_generated(context)
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def menu_entries(menu, context): menu.layout.operator(car_rig.OBJECT_OT_armatureCarDeformationRig.bl_idname, text="Car (deformation rig)", icon='AUTO')
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def register(): bpy.types.VIEW3D_MT_armature_add.append(menu_entries) for c in classes: bpy.utils.register_class(c) car_rig.register() bake_operators.register()
digicreatures/rigacar
[ 308, 41, 308, 35, 1506497977 ]
def __init__(self, json): self.id = json['id'] self.slug = json['slug'] self.title = json['title'] self.presenters = json['presenters'] self.host = json['host'] self.embed_code = json['embed_code']
watsonbox/xbmc-confreaks
[ 14, 1, 14, 4, 1337444066 ]
def url(self): return 'plugin://plugin.video.%s/?action=play_video&videoid=%s' % (self.host, self.embed_code)
watsonbox/xbmc-confreaks
[ 14, 1, 14, 4, 1337444066 ]
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1161, 620) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.channel1Check = QtWidgets.QCheckBox(self.centralwidget) self.channel1Check.setGeometry(QtCore.QRect(10, 10, 161, 17)) self.channel1Check.setChecked(True) self.channel1Check.setObjectName("channel1Check") self.channel2Check = QtWidgets.QCheckBox(self.centralwidget) self.channel2Check.setGeometry(QtCore.QRect(10, 30, 151, 17)) self.channel2Check.setChecked(True) self.channel2Check.setObjectName("channel2Check") self.modeWidget = QtWidgets.QTabWidget(self.centralwidget) self.modeWidget.setGeometry(QtCore.QRect(10, 60, 1131, 451)) self.modeWidget.setObjectName("modeWidget") self.presetTab = QtWidgets.QWidget() self.presetTab.setObjectName("presetTab") self.presetModeWidget = QtWidgets.QTabWidget(self.presetTab) self.presetModeWidget.setGeometry(QtCore.QRect(6, 10, 1101, 411)) self.presetModeWidget.setLayoutDirection(QtCore.Qt.LeftToRight) self.presetModeWidget.setObjectName("presetModeWidget") self.fixedTab = QtWidgets.QWidget() self.fixedTab.setObjectName("fixedTab") self.groupBox = QtWidgets.QGroupBox(self.fixedTab) self.groupBox.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox.setObjectName("groupBox") self.fixedList = QtWidgets.QListWidget(self.groupBox) self.fixedList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.fixedList.setObjectName("fixedList") self.fixedAdd = QtWidgets.QPushButton(self.groupBox) self.fixedAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.fixedAdd.setObjectName("fixedAdd") self.fixedDelete = QtWidgets.QPushButton(self.groupBox) self.fixedDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.fixedDelete.setObjectName("fixedDelete") self.presetModeWidget.addTab(self.fixedTab, "") self.breathingTab = QtWidgets.QWidget() self.breathingTab.setObjectName("breathingTab") self.groupBox_2 = QtWidgets.QGroupBox(self.breathingTab) self.groupBox_2.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox_2.setObjectName("groupBox_2") self.breathingList = QtWidgets.QListWidget(self.groupBox_2) self.breathingList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.breathingList.setObjectName("breathingList") self.breathingAdd = QtWidgets.QPushButton(self.groupBox_2) self.breathingAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.breathingAdd.setObjectName("breathingAdd") self.breathingDelete = QtWidgets.QPushButton(self.groupBox_2) self.breathingDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.breathingDelete.setObjectName("breathingDelete") self.groupBox_11 = QtWidgets.QGroupBox(self.breathingTab) self.groupBox_11.setGeometry(QtCore.QRect(240, 0, 321, 361)) self.groupBox_11.setObjectName("groupBox_11") self.breathingSpeed = QtWidgets.QSlider(self.groupBox_11) self.breathingSpeed.setGeometry(QtCore.QRect(15, 70, 31, 160)) self.breathingSpeed.setMaximum(4) self.breathingSpeed.setProperty("value", 2) self.breathingSpeed.setOrientation(QtCore.Qt.Vertical) self.breathingSpeed.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.breathingSpeed.setObjectName("breathingSpeed") self.label_2 = QtWidgets.QLabel(self.groupBox_11) self.label_2.setGeometry(QtCore.QRect(10, 40, 62, 20)) self.label_2.setObjectName("label_2") self.label_4 = QtWidgets.QLabel(self.groupBox_11) self.label_4.setGeometry(QtCore.QRect(70, 60, 62, 20)) self.label_4.setObjectName("label_4") self.label_5 = QtWidgets.QLabel(self.groupBox_11) self.label_5.setGeometry(QtCore.QRect(70, 210, 62, 20)) self.label_5.setObjectName("label_5") self.presetModeWidget.addTab(self.breathingTab, "") self.fadingTab = QtWidgets.QWidget() self.fadingTab.setObjectName("fadingTab") self.groupBox_3 = QtWidgets.QGroupBox(self.fadingTab) self.groupBox_3.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox_3.setObjectName("groupBox_3") self.fadingList = QtWidgets.QListWidget(self.groupBox_3) self.fadingList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.fadingList.setObjectName("fadingList") self.fadingAdd = QtWidgets.QPushButton(self.groupBox_3) self.fadingAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.fadingAdd.setObjectName("fadingAdd") self.fadingDelete = QtWidgets.QPushButton(self.groupBox_3) self.fadingDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.fadingDelete.setObjectName("fadingDelete") self.groupBox_12 = QtWidgets.QGroupBox(self.fadingTab) self.groupBox_12.setGeometry(QtCore.QRect(240, 0, 321, 361)) self.groupBox_12.setObjectName("groupBox_12") self.fadingSpeed = QtWidgets.QSlider(self.groupBox_12) self.fadingSpeed.setGeometry(QtCore.QRect(15, 70, 31, 160)) self.fadingSpeed.setMaximum(4) self.fadingSpeed.setProperty("value", 2) self.fadingSpeed.setOrientation(QtCore.Qt.Vertical) self.fadingSpeed.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.fadingSpeed.setObjectName("fadingSpeed") self.label_9 = QtWidgets.QLabel(self.groupBox_12) self.label_9.setGeometry(QtCore.QRect(10, 40, 62, 20)) self.label_9.setObjectName("label_9") self.label_10 = QtWidgets.QLabel(self.groupBox_12) self.label_10.setGeometry(QtCore.QRect(70, 60, 62, 20)) self.label_10.setObjectName("label_10") self.label_11 = QtWidgets.QLabel(self.groupBox_12) self.label_11.setGeometry(QtCore.QRect(70, 210, 62, 20)) self.label_11.setObjectName("label_11") self.presetModeWidget.addTab(self.fadingTab, "") self.marqueeTab = QtWidgets.QWidget() self.marqueeTab.setObjectName("marqueeTab") self.groupBox_4 = QtWidgets.QGroupBox(self.marqueeTab) self.groupBox_4.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox_4.setObjectName("groupBox_4") self.marqueeList = QtWidgets.QListWidget(self.groupBox_4) self.marqueeList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.marqueeList.setObjectName("marqueeList") self.marqueeAdd = QtWidgets.QPushButton(self.groupBox_4) self.marqueeAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.marqueeAdd.setObjectName("marqueeAdd") self.marqueeDelete = QtWidgets.QPushButton(self.groupBox_4) self.marqueeDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.marqueeDelete.setObjectName("marqueeDelete") self.groupBox_13 = QtWidgets.QGroupBox(self.marqueeTab) self.groupBox_13.setGeometry(QtCore.QRect(240, 0, 321, 361)) self.groupBox_13.setObjectName("groupBox_13") self.marqueeSpeed = QtWidgets.QSlider(self.groupBox_13) self.marqueeSpeed.setGeometry(QtCore.QRect(15, 70, 31, 160)) self.marqueeSpeed.setMaximum(4) self.marqueeSpeed.setProperty("value", 2) self.marqueeSpeed.setOrientation(QtCore.Qt.Vertical) self.marqueeSpeed.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.marqueeSpeed.setObjectName("marqueeSpeed") self.label_15 = QtWidgets.QLabel(self.groupBox_13) self.label_15.setGeometry(QtCore.QRect(10, 40, 62, 20)) self.label_15.setObjectName("label_15") self.label_16 = QtWidgets.QLabel(self.groupBox_13) self.label_16.setGeometry(QtCore.QRect(70, 60, 62, 20)) self.label_16.setObjectName("label_16") self.label_17 = QtWidgets.QLabel(self.groupBox_13) self.label_17.setGeometry(QtCore.QRect(70, 210, 62, 20)) self.label_17.setObjectName("label_17") self.marqueeSize = QtWidgets.QSlider(self.groupBox_13) self.marqueeSize.setGeometry(QtCore.QRect(185, 70, 31, 160)) self.marqueeSize.setMaximum(3) self.marqueeSize.setProperty("value", 2) self.marqueeSize.setOrientation(QtCore.Qt.Vertical) self.marqueeSize.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.marqueeSize.setObjectName("marqueeSize") self.label_18 = QtWidgets.QLabel(self.groupBox_13) self.label_18.setGeometry(QtCore.QRect(240, 210, 62, 20)) self.label_18.setObjectName("label_18") self.label_19 = QtWidgets.QLabel(self.groupBox_13) self.label_19.setGeometry(QtCore.QRect(180, 40, 62, 20)) self.label_19.setObjectName("label_19") self.label_20 = QtWidgets.QLabel(self.groupBox_13) self.label_20.setGeometry(QtCore.QRect(240, 60, 62, 20)) self.label_20.setObjectName("label_20") self.marqueeBackwards = QtWidgets.QCheckBox(self.groupBox_13) self.marqueeBackwards.setGeometry(QtCore.QRect(20, 260, 89, 26)) self.marqueeBackwards.setObjectName("marqueeBackwards") self.presetModeWidget.addTab(self.marqueeTab, "") self.coverMarqueeTab = QtWidgets.QWidget() self.coverMarqueeTab.setObjectName("coverMarqueeTab") self.groupBox_5 = QtWidgets.QGroupBox(self.coverMarqueeTab) self.groupBox_5.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox_5.setObjectName("groupBox_5") self.coverMarqueeList = QtWidgets.QListWidget(self.groupBox_5) self.coverMarqueeList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.coverMarqueeList.setObjectName("coverMarqueeList") self.coverMarqueeAdd = QtWidgets.QPushButton(self.groupBox_5) self.coverMarqueeAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.coverMarqueeAdd.setObjectName("coverMarqueeAdd") self.coverMarqueeDelete = QtWidgets.QPushButton(self.groupBox_5) self.coverMarqueeDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.coverMarqueeDelete.setObjectName("coverMarqueeDelete") self.groupBox_15 = QtWidgets.QGroupBox(self.coverMarqueeTab) self.groupBox_15.setGeometry(QtCore.QRect(240, 0, 321, 361)) self.groupBox_15.setObjectName("groupBox_15") self.coverMarqueeSpeed = QtWidgets.QSlider(self.groupBox_15) self.coverMarqueeSpeed.setGeometry(QtCore.QRect(15, 70, 31, 160)) self.coverMarqueeSpeed.setMaximum(4) self.coverMarqueeSpeed.setProperty("value", 2) self.coverMarqueeSpeed.setOrientation(QtCore.Qt.Vertical) self.coverMarqueeSpeed.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.coverMarqueeSpeed.setObjectName("coverMarqueeSpeed") self.label_27 = QtWidgets.QLabel(self.groupBox_15) self.label_27.setGeometry(QtCore.QRect(10, 40, 62, 20)) self.label_27.setObjectName("label_27") self.label_28 = QtWidgets.QLabel(self.groupBox_15) self.label_28.setGeometry(QtCore.QRect(70, 60, 62, 20)) self.label_28.setObjectName("label_28") self.label_29 = QtWidgets.QLabel(self.groupBox_15) self.label_29.setGeometry(QtCore.QRect(70, 210, 62, 20)) self.label_29.setObjectName("label_29") self.coverMarqueeBackwards = QtWidgets.QCheckBox(self.groupBox_15) self.coverMarqueeBackwards.setGeometry(QtCore.QRect(20, 260, 89, 26)) self.coverMarqueeBackwards.setObjectName("coverMarqueeBackwards") self.presetModeWidget.addTab(self.coverMarqueeTab, "") self.pulseTab = QtWidgets.QWidget() self.pulseTab.setObjectName("pulseTab") self.groupBox_6 = QtWidgets.QGroupBox(self.pulseTab) self.groupBox_6.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox_6.setObjectName("groupBox_6") self.pulseList = QtWidgets.QListWidget(self.groupBox_6) self.pulseList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.pulseList.setObjectName("pulseList") self.pulseAdd = QtWidgets.QPushButton(self.groupBox_6) self.pulseAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.pulseAdd.setObjectName("pulseAdd") self.pulseDelete = QtWidgets.QPushButton(self.groupBox_6) self.pulseDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.pulseDelete.setObjectName("pulseDelete") self.groupBox_16 = QtWidgets.QGroupBox(self.pulseTab) self.groupBox_16.setGeometry(QtCore.QRect(240, 0, 321, 361)) self.groupBox_16.setObjectName("groupBox_16") self.pulseSpeed = QtWidgets.QSlider(self.groupBox_16) self.pulseSpeed.setGeometry(QtCore.QRect(15, 70, 31, 160)) self.pulseSpeed.setMaximum(4) self.pulseSpeed.setProperty("value", 2) self.pulseSpeed.setOrientation(QtCore.Qt.Vertical) self.pulseSpeed.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.pulseSpeed.setObjectName("pulseSpeed") self.label_33 = QtWidgets.QLabel(self.groupBox_16) self.label_33.setGeometry(QtCore.QRect(10, 40, 62, 20)) self.label_33.setObjectName("label_33") self.label_34 = QtWidgets.QLabel(self.groupBox_16) self.label_34.setGeometry(QtCore.QRect(70, 60, 62, 20)) self.label_34.setObjectName("label_34") self.label_35 = QtWidgets.QLabel(self.groupBox_16) self.label_35.setGeometry(QtCore.QRect(70, 210, 62, 20)) self.label_35.setObjectName("label_35") self.presetModeWidget.addTab(self.pulseTab, "") self.spectrumTab = QtWidgets.QWidget() self.spectrumTab.setObjectName("spectrumTab") self.groupBox_17 = QtWidgets.QGroupBox(self.spectrumTab) self.groupBox_17.setGeometry(QtCore.QRect(0, 0, 321, 361)) self.groupBox_17.setObjectName("groupBox_17") self.spectrumSpeed = QtWidgets.QSlider(self.groupBox_17) self.spectrumSpeed.setGeometry(QtCore.QRect(15, 70, 31, 160)) self.spectrumSpeed.setMaximum(4) self.spectrumSpeed.setProperty("value", 2) self.spectrumSpeed.setOrientation(QtCore.Qt.Vertical) self.spectrumSpeed.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.spectrumSpeed.setObjectName("spectrumSpeed") self.label_39 = QtWidgets.QLabel(self.groupBox_17) self.label_39.setGeometry(QtCore.QRect(10, 40, 62, 20)) self.label_39.setObjectName("label_39") self.label_40 = QtWidgets.QLabel(self.groupBox_17) self.label_40.setGeometry(QtCore.QRect(70, 60, 62, 20)) self.label_40.setObjectName("label_40") self.label_41 = QtWidgets.QLabel(self.groupBox_17) self.label_41.setGeometry(QtCore.QRect(70, 210, 62, 20)) self.label_41.setObjectName("label_41") self.spectrumBackwards = QtWidgets.QCheckBox(self.groupBox_17) self.spectrumBackwards.setGeometry(QtCore.QRect(20, 260, 89, 26)) self.spectrumBackwards.setObjectName("spectrumBackwards") self.presetModeWidget.addTab(self.spectrumTab, "") self.alternatingTab = QtWidgets.QWidget() self.alternatingTab.setObjectName("alternatingTab") self.groupBox_7 = QtWidgets.QGroupBox(self.alternatingTab) self.groupBox_7.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox_7.setObjectName("groupBox_7") self.alternatingList = QtWidgets.QListWidget(self.groupBox_7) self.alternatingList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.alternatingList.setObjectName("alternatingList") self.alternatingAdd = QtWidgets.QPushButton(self.groupBox_7) self.alternatingAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.alternatingAdd.setObjectName("alternatingAdd") self.alternatingDelete = QtWidgets.QPushButton(self.groupBox_7) self.alternatingDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.alternatingDelete.setObjectName("alternatingDelete") self.groupBox_18 = QtWidgets.QGroupBox(self.alternatingTab) self.groupBox_18.setGeometry(QtCore.QRect(240, 0, 321, 361)) self.groupBox_18.setObjectName("groupBox_18") self.alternatingSpeed = QtWidgets.QSlider(self.groupBox_18) self.alternatingSpeed.setGeometry(QtCore.QRect(15, 70, 31, 160)) self.alternatingSpeed.setMaximum(4) self.alternatingSpeed.setProperty("value", 2) self.alternatingSpeed.setOrientation(QtCore.Qt.Vertical) self.alternatingSpeed.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.alternatingSpeed.setObjectName("alternatingSpeed") self.label_45 = QtWidgets.QLabel(self.groupBox_18) self.label_45.setGeometry(QtCore.QRect(10, 40, 62, 20)) self.label_45.setObjectName("label_45") self.label_46 = QtWidgets.QLabel(self.groupBox_18) self.label_46.setGeometry(QtCore.QRect(70, 60, 62, 20)) self.label_46.setObjectName("label_46") self.label_47 = QtWidgets.QLabel(self.groupBox_18) self.label_47.setGeometry(QtCore.QRect(70, 210, 62, 20)) self.label_47.setObjectName("label_47") self.alternatingSize = QtWidgets.QSlider(self.groupBox_18) self.alternatingSize.setGeometry(QtCore.QRect(185, 70, 31, 160)) self.alternatingSize.setMaximum(3) self.alternatingSize.setProperty("value", 2) self.alternatingSize.setOrientation(QtCore.Qt.Vertical) self.alternatingSize.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.alternatingSize.setObjectName("alternatingSize") self.label_48 = QtWidgets.QLabel(self.groupBox_18) self.label_48.setGeometry(QtCore.QRect(240, 210, 62, 20)) self.label_48.setObjectName("label_48") self.label_49 = QtWidgets.QLabel(self.groupBox_18) self.label_49.setGeometry(QtCore.QRect(180, 40, 62, 20)) self.label_49.setObjectName("label_49") self.label_50 = QtWidgets.QLabel(self.groupBox_18) self.label_50.setGeometry(QtCore.QRect(240, 60, 62, 20)) self.label_50.setObjectName("label_50") self.alternatingBackwards = QtWidgets.QCheckBox(self.groupBox_18) self.alternatingBackwards.setGeometry(QtCore.QRect(20, 260, 89, 26)) self.alternatingBackwards.setObjectName("alternatingBackwards") self.alternatingMoving = QtWidgets.QCheckBox(self.groupBox_18) self.alternatingMoving.setGeometry(QtCore.QRect(20, 290, 89, 26)) self.alternatingMoving.setObjectName("alternatingMoving") self.presetModeWidget.addTab(self.alternatingTab, "") self.candleTab = QtWidgets.QWidget() self.candleTab.setObjectName("candleTab") self.groupBox_8 = QtWidgets.QGroupBox(self.candleTab) self.groupBox_8.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox_8.setObjectName("groupBox_8") self.candleList = QtWidgets.QListWidget(self.groupBox_8) self.candleList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.candleList.setObjectName("candleList") self.candleAdd = QtWidgets.QPushButton(self.groupBox_8) self.candleAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.candleAdd.setObjectName("candleAdd") self.candleDelete = QtWidgets.QPushButton(self.groupBox_8) self.candleDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.candleDelete.setObjectName("candleDelete") self.presetModeWidget.addTab(self.candleTab, "") self.wingsTab = QtWidgets.QWidget() self.wingsTab.setObjectName("wingsTab") self.groupBox_9 = QtWidgets.QGroupBox(self.wingsTab) self.groupBox_9.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox_9.setObjectName("groupBox_9") self.wingsList = QtWidgets.QListWidget(self.groupBox_9) self.wingsList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.wingsList.setObjectName("wingsList") self.wingsAdd = QtWidgets.QPushButton(self.groupBox_9) self.wingsAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.wingsAdd.setObjectName("wingsAdd") self.wingsDelete = QtWidgets.QPushButton(self.groupBox_9) self.wingsDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.wingsDelete.setObjectName("wingsDelete") self.groupBox_20 = QtWidgets.QGroupBox(self.wingsTab) self.groupBox_20.setGeometry(QtCore.QRect(240, 0, 321, 361)) self.groupBox_20.setObjectName("groupBox_20") self.wingsSpeed = QtWidgets.QSlider(self.groupBox_20) self.wingsSpeed.setGeometry(QtCore.QRect(15, 70, 31, 160)) self.wingsSpeed.setMaximum(4) self.wingsSpeed.setProperty("value", 2) self.wingsSpeed.setOrientation(QtCore.Qt.Vertical) self.wingsSpeed.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.wingsSpeed.setObjectName("wingsSpeed") self.label_57 = QtWidgets.QLabel(self.groupBox_20) self.label_57.setGeometry(QtCore.QRect(10, 40, 62, 20)) self.label_57.setObjectName("label_57") self.label_58 = QtWidgets.QLabel(self.groupBox_20) self.label_58.setGeometry(QtCore.QRect(70, 60, 62, 20)) self.label_58.setObjectName("label_58") self.label_59 = QtWidgets.QLabel(self.groupBox_20) self.label_59.setGeometry(QtCore.QRect(70, 210, 62, 20)) self.label_59.setObjectName("label_59") self.presetModeWidget.addTab(self.wingsTab, "") self.audioLevelTab = QtWidgets.QWidget() self.audioLevelTab.setObjectName("audioLevelTab") self.groupBox_21 = QtWidgets.QGroupBox(self.audioLevelTab) self.groupBox_21.setGeometry(QtCore.QRect(240, 0, 321, 361)) self.groupBox_21.setObjectName("groupBox_21") self.label_60 = QtWidgets.QLabel(self.groupBox_21) self.label_60.setGeometry(QtCore.QRect(10, 30, 62, 20)) self.label_60.setObjectName("label_60") self.label_61 = QtWidgets.QLabel(self.groupBox_21) self.label_61.setGeometry(QtCore.QRect(10, 80, 81, 20)) self.label_61.setObjectName("label_61") self.audioLevelTolerance = QtWidgets.QDoubleSpinBox(self.groupBox_21) self.audioLevelTolerance.setGeometry(QtCore.QRect(10, 50, 68, 23)) self.audioLevelTolerance.setDecimals(1) self.audioLevelTolerance.setProperty("value", 1.0) self.audioLevelTolerance.setObjectName("audioLevelTolerance") self.audioLevelSmooth = QtWidgets.QDoubleSpinBox(self.groupBox_21) self.audioLevelSmooth.setGeometry(QtCore.QRect(10, 100, 68, 23)) self.audioLevelSmooth.setDecimals(0) self.audioLevelSmooth.setProperty("value", 3.0) self.audioLevelSmooth.setObjectName("audioLevelSmooth") self.groupBox_10 = QtWidgets.QGroupBox(self.audioLevelTab) self.groupBox_10.setGeometry(QtCore.QRect(0, 0, 231, 361)) self.groupBox_10.setObjectName("groupBox_10") self.audioLevelList = QtWidgets.QListWidget(self.groupBox_10) self.audioLevelList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.audioLevelList.setObjectName("audioLevelList") self.audioLevelAdd = QtWidgets.QPushButton(self.groupBox_10) self.audioLevelAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.audioLevelAdd.setObjectName("audioLevelAdd") self.audioLevelDelete = QtWidgets.QPushButton(self.groupBox_10) self.audioLevelDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.audioLevelDelete.setObjectName("audioLevelDelete") self.presetModeWidget.addTab(self.audioLevelTab, "") self.customTab = QtWidgets.QWidget() self.customTab.setObjectName("customTab") self.groupBox_22 = QtWidgets.QGroupBox(self.customTab) self.groupBox_22.setGeometry(QtCore.QRect(630, 0, 321, 371)) self.groupBox_22.setObjectName("groupBox_22") self.customSpeed = QtWidgets.QSlider(self.groupBox_22) self.customSpeed.setGeometry(QtCore.QRect(15, 70, 31, 160)) self.customSpeed.setMaximum(4) self.customSpeed.setProperty("value", 2) self.customSpeed.setOrientation(QtCore.Qt.Vertical) self.customSpeed.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.customSpeed.setObjectName("customSpeed") self.label_62 = QtWidgets.QLabel(self.groupBox_22) self.label_62.setGeometry(QtCore.QRect(10, 40, 62, 20)) self.label_62.setObjectName("label_62") self.label_63 = QtWidgets.QLabel(self.groupBox_22) self.label_63.setGeometry(QtCore.QRect(70, 60, 62, 20)) self.label_63.setObjectName("label_63") self.label_64 = QtWidgets.QLabel(self.groupBox_22) self.label_64.setGeometry(QtCore.QRect(70, 210, 62, 20)) self.label_64.setObjectName("label_64") self.customMode = QtWidgets.QComboBox(self.groupBox_22) self.customMode.setGeometry(QtCore.QRect(190, 70, 86, 25)) self.customMode.setObjectName("customMode") self.customMode.addItem("") self.customMode.addItem("") self.customMode.addItem("") self.label_65 = QtWidgets.QLabel(self.groupBox_22) self.label_65.setGeometry(QtCore.QRect(190, 40, 62, 20)) self.label_65.setObjectName("label_65") self.groupBox_19 = QtWidgets.QGroupBox(self.customTab) self.groupBox_19.setGeometry(QtCore.QRect(0, 0, 611, 371)) self.groupBox_19.setObjectName("groupBox_19") self.customTable = QtWidgets.QTableWidget(self.groupBox_19) self.customTable.setGeometry(QtCore.QRect(10, 30, 471, 331)) self.customTable.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.customTable.setDragDropOverwriteMode(False) self.customTable.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.customTable.setRowCount(40) self.customTable.setColumnCount(2) self.customTable.setObjectName("customTable") item = QtWidgets.QTableWidgetItem() self.customTable.setHorizontalHeaderItem(0, item) item = QtWidgets.QTableWidgetItem() self.customTable.setHorizontalHeaderItem(1, item) self.customTable.verticalHeader().setVisible(False) self.customEdit = QtWidgets.QPushButton(self.groupBox_19) self.customEdit.setGeometry(QtCore.QRect(500, 40, 83, 28)) self.customEdit.setObjectName("customEdit") self.presetModeWidget.addTab(self.customTab, "") self.profileTab = QtWidgets.QWidget() self.profileTab.setObjectName("profileTab") self.groupBox_14 = QtWidgets.QGroupBox(self.profileTab) self.groupBox_14.setGeometry(QtCore.QRect(0, 0, 421, 361)) self.groupBox_14.setObjectName("groupBox_14") self.profileList = QtWidgets.QListWidget(self.groupBox_14) self.profileList.setGeometry(QtCore.QRect(10, 50, 111, 291)) self.profileList.setObjectName("profileList") self.profileAdd = QtWidgets.QPushButton(self.groupBox_14) self.profileAdd.setGeometry(QtCore.QRect(130, 50, 83, 28)) self.profileAdd.setObjectName("profileAdd") self.profileDelete = QtWidgets.QPushButton(self.groupBox_14) self.profileDelete.setGeometry(QtCore.QRect(130, 90, 83, 28)) self.profileDelete.setObjectName("profileDelete") self.profileRefresh = QtWidgets.QPushButton(self.groupBox_14) self.profileRefresh.setGeometry(QtCore.QRect(130, 130, 83, 28)) self.profileRefresh.setObjectName("profileRefresh") self.profileName = QtWidgets.QLineEdit(self.groupBox_14) self.profileName.setGeometry(QtCore.QRect(300, 50, 113, 28)) self.profileName.setObjectName("profileName") self.label_3 = QtWidgets.QLabel(self.groupBox_14) self.label_3.setGeometry(QtCore.QRect(220, 50, 62, 20)) self.label_3.setObjectName("label_3") self.presetModeWidget.addTab(self.profileTab, "") self.animatedTab = QtWidgets.QWidget() self.animatedTab.setObjectName("animatedTab") self.groupBox_23 = QtWidgets.QGroupBox(self.animatedTab) self.groupBox_23.setGeometry(QtCore.QRect(0, 0, 721, 371)) self.groupBox_23.setObjectName("groupBox_23") self.animatedTable = QtWidgets.QTableWidget(self.groupBox_23) self.animatedTable.setGeometry(QtCore.QRect(230, 30, 361, 331)) self.animatedTable.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.animatedTable.setDragDropOverwriteMode(False) self.animatedTable.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.animatedTable.setRowCount(40) self.animatedTable.setColumnCount(2) self.animatedTable.setObjectName("animatedTable") item = QtWidgets.QTableWidgetItem() self.animatedTable.setHorizontalHeaderItem(0, item) item = QtWidgets.QTableWidgetItem() self.animatedTable.setHorizontalHeaderItem(1, item) self.animatedTable.verticalHeader().setVisible(False) self.animatedEdit = QtWidgets.QPushButton(self.groupBox_23) self.animatedEdit.setGeometry(QtCore.QRect(610, 40, 83, 28)) self.animatedEdit.setObjectName("animatedEdit") self.animatedList = QtWidgets.QListWidget(self.groupBox_23) self.animatedList.setGeometry(QtCore.QRect(10, 40, 111, 291)) self.animatedList.setObjectName("animatedList") self.animatedDelete = QtWidgets.QPushButton(self.groupBox_23) self.animatedDelete.setGeometry(QtCore.QRect(130, 80, 83, 28)) self.animatedDelete.setObjectName("animatedDelete") self.animatedAdd = QtWidgets.QPushButton(self.groupBox_23) self.animatedAdd.setGeometry(QtCore.QRect(130, 40, 83, 28)) self.animatedAdd.setObjectName("animatedAdd") self.animatedRoundName = QtWidgets.QLineEdit(self.groupBox_23) self.animatedRoundName.setGeometry(QtCore.QRect(130, 120, 81, 25)) self.animatedRoundName.setObjectName("animatedRoundName") self.groupBox_24 = QtWidgets.QGroupBox(self.animatedTab) self.groupBox_24.setGeometry(QtCore.QRect(740, 0, 331, 371)) self.groupBox_24.setObjectName("groupBox_24") self.label_66 = QtWidgets.QLabel(self.groupBox_24) self.label_66.setGeometry(QtCore.QRect(10, 40, 201, 20)) self.label_66.setObjectName("label_66") self.animatedSpeed = QtWidgets.QDoubleSpinBox(self.groupBox_24) self.animatedSpeed.setGeometry(QtCore.QRect(10, 70, 68, 26)) self.animatedSpeed.setDecimals(0) self.animatedSpeed.setMinimum(15.0) self.animatedSpeed.setMaximum(5000.0) self.animatedSpeed.setSingleStep(10.0) self.animatedSpeed.setProperty("value", 50.0) self.animatedSpeed.setObjectName("animatedSpeed") self.label_21 = QtWidgets.QLabel(self.groupBox_24) self.label_21.setGeometry(QtCore.QRect(40, 130, 261, 71)) self.label_21.setWordWrap(True) self.label_21.setObjectName("label_21") self.presetModeWidget.addTab(self.animatedTab, "") self.modeWidget.addTab(self.presetTab, "") self.timesTab = QtWidgets.QWidget() self.timesTab.setObjectName("timesTab") self.label_7 = QtWidgets.QLabel(self.timesTab) self.label_7.setGeometry(QtCore.QRect(30, 20, 461, 17)) self.label_7.setObjectName("label_7") self.offTime = QtWidgets.QLineEdit(self.timesTab) self.offTime.setGeometry(QtCore.QRect(30, 40, 113, 25)) self.offTime.setObjectName("offTime") self.onTime = QtWidgets.QLineEdit(self.timesTab) self.onTime.setGeometry(QtCore.QRect(30, 100, 113, 25)) self.onTime.setObjectName("onTime") self.label_8 = QtWidgets.QLabel(self.timesTab) self.label_8.setGeometry(QtCore.QRect(30, 80, 461, 17)) self.label_8.setObjectName("label_8") self.label_12 = QtWidgets.QLabel(self.timesTab) self.label_12.setGeometry(QtCore.QRect(160, 50, 131, 17)) self.label_12.setObjectName("label_12") self.label_13 = QtWidgets.QLabel(self.timesTab) self.label_13.setGeometry(QtCore.QRect(160, 110, 131, 17)) self.label_13.setObjectName("label_13") self.label_14 = QtWidgets.QLabel(self.timesTab) self.label_14.setGeometry(QtCore.QRect(30, 140, 341, 111)) font = QtGui.QFont() font.setPointSize(11) self.label_14.setFont(font) self.label_14.setWordWrap(True) self.label_14.setObjectName("label_14") self.timeSave = QtWidgets.QPushButton(self.timesTab) self.timeSave.setGeometry(QtCore.QRect(40, 290, 82, 25)) self.timeSave.setObjectName("timeSave") self.modeWidget.addTab(self.timesTab, "") self.applyBtn = QtWidgets.QPushButton(self.centralwidget) self.applyBtn.setGeometry(QtCore.QRect(490, 530, 101, 41)) self.applyBtn.setObjectName("applyBtn") self.label = QtWidgets.QLabel(self.centralwidget) self.label.setGeometry(QtCore.QRect(940, 20, 62, 20)) self.label.setObjectName("label") self.portTxt = QtWidgets.QLineEdit(self.centralwidget) self.portTxt.setGeometry(QtCore.QRect(1000, 20, 113, 28)) self.portTxt.setObjectName("portTxt") self.label_6 = QtWidgets.QLabel(self.centralwidget) self.label_6.setGeometry(QtCore.QRect(180, -10, 741, 91)) font = QtGui.QFont() font.setPointSize(13) self.label_6.setFont(font) self.label_6.setWordWrap(True) self.label_6.setObjectName("label_6") self.unitLEDBtn = QtWidgets.QPushButton(self.centralwidget) self.unitLEDBtn.setGeometry(QtCore.QRect(840, 50, 121, 21)) self.unitLEDBtn.setObjectName("unitLEDBtn") MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) self.modeWidget.setCurrentIndex(0) self.presetModeWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow) MainWindow.setTabOrder(self.channel1Check, self.channel2Check) MainWindow.setTabOrder(self.channel2Check, self.modeWidget)
kusti8/hue-plus
[ 234, 20, 234, 32, 1471624891 ]
def __init__( self, tokenizer: Optional[_Tokenizer] = None, **kwargs: Any
chrislit/abydos
[ 154, 26, 154, 63, 1398235847 ]
def sim(self, src: str, tar: str) -> float: """Return the Roberts similarity of two strings. Parameters ---------- src : str Source string (or QGrams/Counter objects) for comparison tar : str Target string (or QGrams/Counter objects) for comparison Returns ------- float Roberts similarity Examples -------- >>> cmp = Roberts() >>> cmp.sim('cat', 'hat') 0.5 >>> cmp.sim('Niall', 'Neil') 0.36363636363636365 >>> cmp.sim('aluminum', 'Catalan') 0.11764705882352941 >>> cmp.sim('ATCG', 'TAGC') 0.0 .. versionadded:: 0.4.0 """ if src == tar: return 1.0 self._tokenize(src, tar) alphabet = self._total().keys() return sum( (self._src_tokens[i] + self._tar_tokens[i]) * min(self._src_tokens[i], self._tar_tokens[i]) / max(self._src_tokens[i], self._tar_tokens[i]) for i in alphabet ) / sum((self._src_tokens[i] + self._tar_tokens[i]) for i in alphabet)
chrislit/abydos
[ 154, 26, 154, 63, 1398235847 ]
def forwards(self, orm): # Changing field 'Graph.slug' db.alter_column('muparse_graph', 'slug', self.gf('django.db.models.fields.SlugField')(max_length=128, null=True)) # Adding index on 'Graph', fields ['slug'] db.create_index('muparse_graph', ['slug']) # Changing field 'Graph.name' db.alter_column('muparse_graph', 'name', self.gf('django.db.models.fields.CharField')(max_length=255)) # Removing index on 'Graph', fields ['name'] db.delete_index('muparse_graph', ['name'])
grnet/mupy
[ 7, 3, 7, 2, 1410258462 ]
def format_component_title(name): return name.replace('_', ' ').capitalize()
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def get_zip_content(path): file_names = None try: zf = zipfile.ZipFile(path, 'r') file_names = zf.namelist() return file_names except Exception as e: return False
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def get_review_status_list(key): status_list = ['Pending', 'Waiting for Admin Review', 'Waiting for Domain Review', 'Waiting for Quality Review', 'Accepted', 'Need Improvement', 'Not Required'] return status_list[key];
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def get_review_status_symbol(key): status_list = ['fa fa-1 fa-minus-circle review-pending-upload', 'fa fa-1 fa-check-circle review-admin-review', 'fa fa-1 fa-check-circle review-domain-review', 'fa fa-1 fa-check-circle review-quality-review', 'fa fa-1 fa-check-circle review-accepted', 'fa fa-1 fa-times-circle review-pending-upload', 'fa fa-1 fa-ban review-accepted'] return status_list[key];
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def get_last_video_upload_time(key): rec = None try: rec = ContributorLog.objects.filter(tutorial_resource_id = key.id).order_by('-created')[0] tmpdt = key.updated for tmp in rec: tmpdt = rec.created return tmpdt except: return key.updated
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def get_missing_component_reply(mcid): rows = TutorialMissingComponentReply.objects.filter(missing_component_id = mcid) replies = '' for row in rows: replies += '<p>' + row.reply_message + '<b> -' + row.user.username + '</b></p>' if replies: replies = '<br /><b>Replies:</b>' + replies return replies
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def instruction_sheet(foss, lang): file_path = settings.MEDIA_ROOT + 'videos/' + str(foss.id) + '/' + foss.foss.replace(' ', '-') + '-Instruction-Sheet-' + lang.name + '.pdf' if lang.name != 'English': if os.path.isfile(file_path): file_path = settings.MEDIA_URL + 'videos/' + str(foss.id) + '/' + foss.foss.replace(' ', '-') + '-Instruction-Sheet-' + lang.name + '.pdf' return file_path
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def installation_sheet(foss, lang): file_path = settings.MEDIA_ROOT + 'videos/' + str(foss.id) + '/' + foss.foss.replace(' ', '-') + '-Installation-Sheet-' + lang.name + '.pdf' if lang.name != 'English': if os.path.isfile(file_path): file_path = settings.MEDIA_URL + 'videos/' + str(foss.id) + '/' + foss.foss.replace(' ', '-') + '-Installation-Sheet-' + lang.name + '.pdf' return file_path
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def brochure(foss, lang): file_path = settings.MEDIA_ROOT + 'videos/' + str(foss.id) + '/' + foss.foss.replace(' ', '-') + '-Brochure-' + lang.name + '.pdf' if lang.name != 'English': if os.path.isfile(file_path): file_path = settings.MEDIA_URL + 'videos/' + str(foss.id) + '/' + foss.foss.replace(' ', '-') + '-Brochure-' + lang.name + '.pdf' return file_path
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def get_thumb_path(row, append_str): path = settings.MEDIA_URL + 'videos/' + str(row.foss_id) + '/' + str(row.id) + '/' + row.tutorial.replace(' ', '-') + '-' + append_str + '.png' return path
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def get_video_visits(tr): tr.hit_count = tr.hit_count + 1 tr.save() return tr.hit_count
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def get_prerequisite_from_td(td, lang): try: tr_rec = TutorialResource.objects.get(Q(status = 1) | Q(status = 2), tutorial_detail = td, language_id = lang.id) return tr_rec.id except: if lang.name != 'English': try: tr_rec = TutorialResource.objects.get(Q(status = 1) | Q(status = 2), tutorial_detail = td, language__name = 'English') return tr_rec.id except: pass return None
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]
def tutorialsearch(): context = { 'form': TutorialSearchForm() } return context
Spoken-tutorial/spoken-website
[ 9, 44, 9, 83, 1393308162 ]