function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def _check_main_disease(self, cr, uid, ids, context=None): ''' verify there's only one main disease ''' for r in self.browse(cr, uid, ids, context=context): diseases_ids = self.search(cr,uid,[('attentiont_id','=',r.attentiont_id.id),('diseases_type','=','main')]) ...
hivam/l10n_co_doctor
[ 2, 3, 2, 3, 1403128853 ]
def do_create(self, cr, uid, ids, context=None): holiday_obj = self.pool.get("official.holiday") template_obj = self.pool.get("official.holiday.template") user_obj = self.pool.get("res.users") template_ids = template_obj.search(cr,uid,[("id","in",util.active_ids(context))]) comp...
funkring/fdoo
[ 1, 5, 1, 8, 1400249085 ]
def print_wrapped(text): paras = text.split("\n") for i in paras: print(*cjkwrap.wrap(i), sep="\n")
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def __init__(self, profile): self.profile = profile self.yaml = YAML() self.config = None self.modules: Dict[str, Module] = {}
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def default_config(): # TRANSLATORS: This part of text must be formatted in a monospaced font, and all lines must not exceed the width of a 70-cell-wide terminal. config = _( "# ===================================\n" "# EH Forwarder Bot Configuration File\n" "# ======...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def save_config(self): coordinator.profile = self.profile conf_path = utils.get_config_path() if not conf_path.exists(): conf_path.parent.mkdir(parents=True, exist_ok=True) with open(conf_path, 'w') as f: self.yaml.dump(self.config, f)
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def get_master_lists(self): names = [] ids = [] for i in self.modules.values(): if i.type == "master": names.append(i.name) ids.append(i.id) return names, ids
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def split_cid(cid): if "#" in cid: mid, iid = cid.split("#") else: mid = cid iid = None return mid, iid
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def has_wizard(self, cid): mid, _ = self.split_cid(cid) if mid not in self.modules: return False return callable(self.modules[mid].wizard)
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def get_middleware_lists(self): names = [] ids = [] for i in self.modules.values(): if i.type == "middleware": names.append(i.name) ids.append(i.id) return names, ids
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def __init__(self, prompt: str = "", choices: list = [], choices_id: list = [], bullet: str = "●", bullet_color: str = colors.foreground["default"], word_color: str = colors.foreground["default"], word_on_switch: str = colors.REVERSE, background_color: str = colors.background["default"...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def accept(self, *args): pos = self.pos bullet.utils.moveCursorDown(len(self.choices) - pos) self.pos = 0 return self.choices[pos], self.choices_id[pos]
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def __init__(self, prompt: str = "", choices: list = None, choices_id: list = None, bullet: str = "●", bullet_color: str = colors.foreground["default"], word_color: str = colors.foreground["default"], word_on_switch: str = colors.REVERSE, background_color: str = colors.background["defa...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def shift_up(self): choices = len(self.choices) if self.pos - 1 < 0 or self.pos >= choices - 2: return else: self.choices[self.pos - 1], self.choices[self.pos] = self.choices[self.pos], self.choices[self.pos - 1] bullet.utils.clearLine() old_pos = ...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def shift_down(self): choices = len(self.choices) if self.pos >= choices - 3: return else: self.choices[self.pos + 1], self.choices[self.pos] = self.choices[self.pos], self.choices[self.pos + 1] bullet.utils.clearLine() old_pos = self.pos ...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def delete_item(self): choices = len(self.choices) if self.pos >= choices - 2: return self.choices.pop(self.pos) self.choices_id.pop(self.pos) bullet.utils.moveCursorUp(self.pos - 1) bullet.utils.clearConsoleDown(choices) bullet.utils.moveCursorUp(1) ...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def accept_fork(self): choices = len(self.choices) if self.required and self.pos == choices - 1 and choices <= 2: # Reject empty list return None if self.pos >= choices - 2: # Add / Submit pos = self.pos bullet.utils.moveCursorDown(len(self.choice...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def build_search_query(query): return "https://google.com/search?q=" + quote(query)
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def choose_master_channel(data: DataModel): channel_names, channel_ids = data.get_master_lists() list_widget = KeyValueBullet(prompt=_("1. Choose master channel"), choices=channel_names, choices_id=channel_ids) default_idx = None defaul...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def choose_middlewares(data: DataModel): chosen_middlewares_names, chosen_middlewares_ids = data.get_selected_middleware_lists() widget = ReorderBullet(_("3. Choose middlewares (optional)."), choices=chosen_middlewares_names, choices_id=chosen_middlewares_id...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def main(): parser = argparse.ArgumentParser() parser.add_argument("-p", "--profile", help=_("Choose a profile to start with."), default="default") parser.add_argument("-m", "--module", help=_("Start the wizard of a module manually, ski...
blueset/ehForwarderBot
[ 2891, 274, 2891, 9, 1464585956 ]
def __str__(self): """ Return a string that can be used as a command line argument to nose. """ return "%s:%s.%s" % (inspect.getfile(self.__class__), self.__class__.__name__, self._testMethodName)
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def _enter_atomics(cls): # Prevent rollbacks. pass
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def _rollback_atomics(cls, atomics): # Prevent rollbacks. pass
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def setUpClass(self): super().setUpClass() self.runner = django.test.runner.DiscoverRunner(interactive=False) django.test.utils.setup_test_environment() self.old_config = self.runner.setup_databases() self.db = Db()
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def tearDownClass(self): if 'KEEP_DATA' in os.environ: print("\nkeeping test database: %r." % self.db.db_name, file=sys.stderr) else: self.db.delete_all() self.runner.teardown_databases(self.old_config) django.test.utils.teardown_test_environment() ...
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def load(self): self.cpp = sc2.RankingData(self.db.db_name, Enums.INFO) self.cpp.load(self.db.ranking.id)
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def save_to_ranking(self): self.cpp.save_data(self.db.ranking.id, self.db.ranking.season_id, to_unix(utcnow()))
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def date(self, **kwargs): return self.today + timedelta(**kwargs)
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def datetime(self, **kwargs): return self.now + timedelta(**kwargs)
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def unix_time(self, **kwargs): return to_unix(self.now + timedelta(**kwargs))
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def setUp(self): super().setUp() self.bnet = BnetClient()
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def mock_current_season(self, status=200, season_id=None, start_time=None, fetch_time=None): self.bnet.fetch_current_season = \ Mock(return_value=SeasonResponse(status, ApiSeason({'seasonId': season_id or self.db.season.id, ...
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def mock_fetch_ladder(self, status=200, fetch_time=None, members=None, **kwargs): self.bnet.fetch_ladder = \ Mock(return_value=LadderResponse(status, gen_api_ladder(members, **kwargs), fetch_time or utcnow(), 0))
andersroos/rankedftw
[ 61, 6, 61, 14, 1480368416 ]
def basename(value): return os.path.basename(value)
troeger/opensubmit
[ 30, 18, 30, 45, 1411388038 ]
def replace_macros(value, user_dict): return value.replace("#FIRSTNAME#", user_dict['first_name'].strip()) \ .replace("#LASTNAME#", user_dict['last_name'].strip())
troeger/opensubmit
[ 30, 18, 30, 45, 1411388038 ]
def state_label_css(subm): green_label = "badge label label-success" red_label = "badge label label-important" grey_label = "badge label label-info" # We expect a submission as input if subm.is_closed() and subm.grading: if subm.grading.means_passed: return green_label el...
troeger/opensubmit
[ 30, 18, 30, 45, 1411388038 ]
def setting(name): return getattr(settings, name, "")
troeger/opensubmit
[ 30, 18, 30, 45, 1411388038 ]
def details_table(submission): return {'submission': submission}
troeger/opensubmit
[ 30, 18, 30, 45, 1411388038 ]
def deadline_timeout(assignment): return {'assignment': assignment, 'show_timeout': True}
troeger/opensubmit
[ 30, 18, 30, 45, 1411388038 ]
def deadline(assignment): return {'assignment': assignment, 'show_timeout': False}
troeger/opensubmit
[ 30, 18, 30, 45, 1411388038 ]
def get_main_user(): """Return the only user remaining in the DB""" return User.objects.first()
lutris/website
[ 107, 124, 107, 33, 1385593889 ]
def delete_tokens(): """Remove all auth tokens (OpenID, DRF, ...)""" res = UserOpenID.objects.all().delete() print("Deleted %s openids" % res[0]) res = Token.objects.all().delete() print("Deleted %s tokens" % res[0]) res = LogEntry.objects.all().delete() print("...
lutris/website
[ 107, 124, 107, 33, 1385593889 ]
def main(argv): parser = _stbt.core.argparser() parser.prog = 'stbt run' parser.description = 'Run an stb-tester test script' parser.add_argument( '--cache', default=imgproc_cache.default_filename, help="Path for image-processing cache (default: %(default)s") parser.add_argument( ...
stb-tester/stb-tester
[ 171, 100, 171, 34, 1340284288 ]
def get_submit_string(self,time_limit,duration): """ Функция генерирует строку для submit задачи в очередь slurm """ s=list() s.append("sbatch") # # Uncomment for debug slurm # #s.append("-vv") s.append("--account=%s" % self.task_class) s.append("--comment=\"Pseudo cluste...
pseudo-cluster/pseudo-cluster
[ 1, 2, 1, 2, 1414075320 ]
def get_cancel_string(self): return [ "scancel" , str(self.actual_task_id) ]
pseudo-cluster/pseudo-cluster
[ 1, 2, 1, 2, 1414075320 ]
def main(argv=None): """ То, с чего начинается программа """ if argv == None: argv=sys.argv gettext.install('pseudo-cluster')
pseudo-cluster/pseudo-cluster
[ 1, 2, 1, 2, 1414075320 ]
def __init__(self, config, logger, readq): super(MapReduce, self).__init__(config, logger, readq) self.port = self.get_config('port', 8080) self.host = self.get_config('host', "localhost") self.http_prefix = 'http://%s:%s' % (self.host, self.port)
wangy1931/tcollector
[ 1, 2, 1, 3, 1439667326 ]
def _get_running_app_ids(self): try: running_apps = {} metrics_json = self.request("/%s?%s" % (REST_API['YARN_APPS_PATH'], "states=RUNNING&applicationTypes=MAPREDUCE")) if metrics_json.get('apps'): if metrics_json['apps'].get('app') is not None: ...
wangy1931/tcollector
[ 1, 2, 1, 3, 1439667326 ]
def _mapreduce_job_counters_metrics(self, running_jobs): ''' Get custom metrics specified for each counter ''' try: for job_id, job_metrics in running_jobs.iteritems(): ts = time.time() job_name = job_metrics['job_name'] if job_...
wangy1931/tcollector
[ 1, 2, 1, 3, 1439667326 ]
def request(self,uri): resp = requests.get('%s%s' % (self.http_prefix, uri)) if resp.status_code != 200: raise HTTPError('%s%s' % (self.http_prefix, uri)) return resp.json()
wangy1931/tcollector
[ 1, 2, 1, 3, 1439667326 ]
def execute(code): ctx = zmq.Context.instance() ctx.setsockopt(zmq.LINGER, 50) repl_in = ctx.socket(zmq.PUSH) repl_in.connect('tcp://127.0.0.1:2000') repl_out = ctx.socket(zmq.PULL) repl_out.connect('tcp://127.0.0.1:2001') with repl_in, repl_out: msg = (b'xcode1', code.encode('utf8')...
lablup/sorna-repl
[ 26, 13, 26, 92, 1445502133 ]
def x(): raise RuntimeError('asdf')
lablup/sorna-repl
[ 26, 13, 26, 92, 1445502133 ]
def main(): parser = argparse.ArgumentParser() parser.add_argument('program_name') args =parser.parse_args() src = sources[args.program_name] print('Test code:') print(textwrap.indent(src, ' ')) print() print('Execution log:') execute(src)
lablup/sorna-repl
[ 26, 13, 26, 92, 1445502133 ]
def __init__(self, gpio, spi, dc_pin="P9_15", reset_pin="P9_13", buffer_rows=64, buffer_cols=128, rows=32, cols=128): self.gpio = gpio self.spi = spi self.cols = cols self.rows = rows self.buffer_rows = buffer_rows self.mem_bytes = self.buffer_rows * self.cols >> 3 # tota...
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def command(self, *bytes): # already low # self.gpio.output(self.dc_pin, self.gpio.LOW) self.spi.writebytes(list(bytes))
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def begin(self, vcc_state=SWITCH_CAP_VCC): time.sleep(0.001) # 1ms self.reset() self.command(self.DISPLAY_OFF) self.command(self.SET_DISPLAY_CLOCK_DIV, 0x80) # support for 128x32 and 128x64 line models if self.rows == 64: self.command(self.SET_MULTIPLEX, 0x3F...
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def invert_display(self): self.command(self.INVERT_DISPLAY)
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def normal_display(self): self.command(self.NORMAL_DISPLAY)
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def display(self): self.display_block(self.bitmap, 0, 0, self.cols, self.col_offset)
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def display_block(self, bitmap, row, col, col_count, col_offset=0): page_count = bitmap.rows >> 3 page_start = row >> 3 page_end = page_start + page_count - 1 col_start = col col_end = col + col_count - 1 self.command(self.SET_MEMORY_MODE, self.MEMORY_MODE_VERT) ...
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def dump_buffer(self): self.bitmap.dump()
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def draw_text(self, x, y, string): font_bytes = self.font.bytes font_rows = self.font.rows font_cols = self.font.cols for c in string: p = ord(c) * font_cols for col in range(0, font_cols): mask = font_bytes[p] p += 1 ...
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def clear_block(self, x0, y0, dx, dy): self.bitmap.clear_block(x0, y0, dx, dy)
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def text_width(self, string, font): return self.bitmap.text_width(string, font)
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def __init__(self, cols, rows): self.rows = rows self.cols = cols self.bytes_per_col = rows >> 3 self.data = [0] * (self.cols * self.bytes_per_col)
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def dump(self): for y in range(0, self.rows): mem_row = y >> 3 bit_mask = 1 << (y % 8) line = "" for x in range(0, self.cols): mem_col = x offset = mem_row + (self.rows >> 3) * mem_col ...
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def clear_block(self, x0, y0, dx, dy): for x in range(x0, x0 + dx): for y in range(y0, y0 + dy): self.draw_pixel(x, y, 0)
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def text_width(self, string, font): x = 0 prev_char = None for c in string: if c < font.start_char or c > font.end_char: if prev_char != None: x += font.space_width + prev_width + font.gap_width prev_char...
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def __init__(self, ssd1306, list, font): self.ssd1306 = ssd1306 self.list = list self.font = font self.position = 0 # row index into list, 0 to len(list) * self.rows - 1 self.offset = 0 # led hardware scroll offset self.pan_row = -1 s...
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def align_offset(self): pos = self.position % self.rows midway = self.rows >> 1 delta = (pos + midway) % self.rows - midway return -delta
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def scroll(self, delta): if delta == 0: return count = len(self.list) step = (delta > 0) - (delta < 0) # step = 1 or -1 for i in range(0, delta, step): if (self.position % self.rows) == 0: n = self.position // self.rows...
guyc/py-gaugette
[ 120, 43, 120, 9, 1352169832 ]
def __init__(self, name, experiment, description=''): super(Counters, self).__init__(name, experiment, description) # start with a blank list of counters self.counters = ListProp('counters', experiment, listElementType=Counter, listElementName='counter') self.properties += ['version'...
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def __init__(self, name, experiment, description=''): super(Counter, self).__init__(name, experiment, description) self.properties += ['counter_source', 'clock_source', 'clock_rate']
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def __init__(self, name, experiment, description=''): super(CounterAnalysis, self).__init__(name, experiment, description) self.meas_analysis_path = 'analysis/counter_data' self.meas_data_path = 'data/counter/data' self.iter_analysis_path = 'shotData' self.properties += ['en...
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def preIteration(self, iterationResults, experimentResults): self.counter_array = [] self.binned_array = None
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def format_data(self, array): """Formats raw 2D counter data into the required 4D format.
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def analyzeMeasurement(self, measurementResults, iterationResults, experimentResults): if self.enable:
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def analyzeIteration(self, iterationResults, experimentResults): if self.enable: # recalculate binned_array to get rid of cut data # iterationResults[self.iter_analysis_path] = self.binned_array meas = map(int, iterationResults['measurements'].keys()) meas.so...
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def updateFigure(self): if self.draw_fig: if self.enable: if not self.update_lock: try: self.update_lock = True
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def intersection(self, A0,A1,m0,m1,s0,s1): return (m1*s0**2-m0*s1**2-np.sqrt(s0**2*s1**2*(m0**2-2*m0*m1+m1**2+2*np.log(A0/A1)*(s1**2-s0**2))))/(s0**2-s1**2)
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def area(self,A0,A1,m0,m1,s0,s1): return np.sqrt(np.pi/2)*(A0*s0+A0*s0*erf(m0/np.sqrt(2)/s0)+A1*s1+A1*s1*erf(m1/np.sqrt(2)/s1))
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def overlap(self,xc,A0,A1,m0,m1,s0,s1): err0=A0*np.sqrt(np.pi/2)*s0*(1-erf((xc-m0)/np.sqrt(2)/s0)) err1=A1*np.sqrt(np.pi/2)*s1*(erf((xc-m1)/np.sqrt(2)/s1)+erf(m1/np.sqrt(2)/s1)) return (err0+err1)/self.area(A0,A1,m0,m1,s0,s1)
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def frac(self, A0,A1,m0,m1,s0,s1): return 1/(1+A0*s0*(1+erf(m0/np.sqrt(2)/s0))/A1/s1/(1+erf(m1/np.sqrt(2)/s1)))
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def dblgauss(self, x,A0,A1,m0,m1,s0,s1): return A0*np.exp(-(x-m0)**2 / (2*s0**2)) + A1*np.exp(-(x-m1)**2 / (2*s1**2))
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def __init__(self, name, experiment, description=''): super(CounterHistogramAnalysis, self).__init__(name, experiment, description) self.properties += ['enable']
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def preExperiment(self, experimentResults): # self.hist_rec = np.recarray(1,) return
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def analyzeMeasurement(self, measurementResults, iterationResults, experimentResults): return
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def analyzeIteration(self, iterationResults, experimentResults): if self.enable: histout = [] # amplitudes, edges # Overlap, fraction, cutoff fitout = np.recarray(2, [('overlap', float), ('fraction', float), ('cutoff', float)]) optout = np.recarray(2, [('A0'...
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def updateFigure(self, iterationResults): if self.draw_fig: if self.enable: if not self.update_lock: try: self.update_lock = True
QuantumQuadrate/CsPyController
[ 3, 2, 3, 24, 1492572590 ]
def importpyqt(): ''' Try to import pyqt, either PyQt4 or PyQt5, but allow it to fail ''' try: from PyQt4 import QtGui as pyqt except: try: from PyQt5 import QtWidgets as pyqt except: pyqt = Exception('QtGui could not be imported') return pyqt
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]
def plotresults(results, toplot=None, fig=None, figargs=None, **kwargs): ''' Does the hard work for updateplots() for pygui() Keyword arguments if supplied are passed on to figure().
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]
def pygui(tmpresults, toplot=None, advanced=False, verbose=2, figargs=None, **kwargs): ''' PYGUI
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]
def manualfit(project=None, parsubset=None, name=-1, ind=0, maxrows=25, verbose=2, advanced=False, figargs=None, **kwargs): ''' Create a GUI for doing manual fitting via the backend. Opens up three windows: results, results selection, and edit boxes.
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]
def closewindows(): ''' Close all three open windows ''' closegui() panel.close()
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]
def manualupdate(): ''' Update GUI with new results ''' global results, tmppars, fullkeylist, fullsubkeylist, fulltypelist, fullvallist
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]
def keeppars(): ''' Little function to reset origpars and update the project ''' global origpars, tmppars, parset origpars = dcp(tmppars) parset.pars = tmppars project.parsets[name].pars = tmppars print('Parameters kept') return None
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]
def resetpars(): ''' Reset the parameters to the last saved version -- WARNING, doesn't work ''' global origpars, tmppars, parset tmppars = dcp(origpars) parset.pars = tmppars for i in range(nfull): boxes[i].setText(sigfig(fullvallist[i], sigfigs=nsigfigs)) simparslist = ...
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]
def plotpeople(project=None, people=None, tvec=None, ind=None, simind=None, start=2, end=None, pops=None, animate=False, skipempty=True, verbose=2, toplot=None, **kwargs): ''' A function to plot all people as a stacked plot
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]
def plotpars(parslist=None, start=None, end=None, verbose=2, rows=6, cols=5, figsize=(16,12), fontsize=8, die=True, **kwargs): ''' A function to plot all parameters. 'pars' can be an odict or a list of pars odicts.
optimamodel/Optima
[ 7, 1, 7, 8, 1406655820 ]