code
stringlengths
51
2.34k
docstring
stringlengths
11
171
def invert_dictset(d): result = {} for k, c in d.items(): for v in c: keys = result.setdefault(v, []) keys.append(k) return result
Invert a dictionary with keys matching a set of values, turned into lists.
def show_dependencies(self): from spyder.widgets.dependencies import DependenciesDialog dlg = DependenciesDialog(self) dlg.set_data(dependencies.DEPENDENCIES) dlg.exec_()
Show Spyder's Dependencies dialog box
def ensure_configured(func): @functools.wraps(func) def wrapper(*args, **kwargs): if len(logging.root.handlers) == 0: basicConfig() return func(*args, **kwargs) return wrapper
Modify a function to call ``basicConfig`` first if no handlers exist.
def dovds(data): vds, X = 0, [] for rec in data: X.append(dir2cart(rec)) for k in range(len(X) - 1): xdif = X[k + 1][0] - X[k][0] ydif = X[k + 1][1] - X[k][1] zdif = X[k + 1][2] - X[k][2] vds += np.sqrt(xdif**2 + ydif**2 + zdif**2) vds += np.sqrt(X[-1][0]**2 + X[-...
calculates vector difference sum for demagnetization data
def execute_command_no_results(self, sock_info, generator): full_result = { "writeErrors": [], "writeConcernErrors": [], "nInserted": 0, "nUpserted": 0, "nMatched": 0, "nModified": 0, "nRemoved": 0, "upserted": [], ...
Execute write commands with OP_MSG and w=0 WriteConcern, ordered.
def temperature(self): result = self.i2c_read(2) value = struct.unpack('>H', result)[0] if value < 32768: return value / 256.0 else: return (value - 65536) / 256.0
Get the temperature in degree celcius
def clone(gandi, name, vhost, directory, origin): if vhost != 'default': directory = vhost else: directory = name if not directory else directory return gandi.paas.clone(name, vhost, directory, origin)
Clone a remote vhost in a local git repository.
def current_rolenames(): jwt_data = get_jwt_data_from_app_context() if 'rls' not in jwt_data: return set(['non-empty-but-definitely-not-matching-subset']) else: return set(r.strip() for r in jwt_data['rls'].split(','))
This method returns the names of all roles associated with the current user
def create(client, output_file, revision, paths): graph = Graph(client) outputs = graph.build(paths=paths, revision=revision) output_file.write( yaml.dump( ascwl( graph.ascwl(outputs=outputs), filter=lambda _, x: x is not None and x != [], ...
Create a workflow description for a file.
def _get_co_from_dump(data): current = struct.calcsize(b'iiii') metadata = struct.unpack(b'iiii', data[:current]) logging.info("Magic value: %x", metadata[0]) logging.info("Code bytes length: %d", metadata[3]) arcname = '' while six.indexbytes(data, current) != 0: arcname += chr(six.inde...
Return the code objects from the dump.
def error(self): for item in self: if isinstance(item, WorkItem) and item.error: return item.error return None
Returns the error for this barrier and all work items, if any.
def _compile_rules(self): for state, table in self.RULES.items(): patterns = list() actions = list() nextstates = list() for i, row in enumerate(table): if len(row) == 2: pattern, _action = row nextstate = No...
Compile the rules into the internal lexer state.
def load_json(path: str, encoding: str = "utf-8") -> HistogramBase: with open(path, "r", encoding=encoding) as f: text = f.read() return parse_json(text)
Load histogram from a JSON file.
def _read_stderr(self): output = self._decode(self._process.readAllStandardError().data()) if self._formatter: self._formatter.append_message(output, output_format=OutputFormat.ErrorMessageFormat) else: self.insertPlainText(output)
Reads the child process' stderr and process it.
def write(tsdict, outfile, start=None, end=None, name='gwpy', run=0): if not start: start = list(tsdict.values())[0].xspan[0] if not end: end = list(tsdict.values())[0].xspan[1] duration = end - start detectors = 0 for series in tsdict.values(): try: idx...
Write data to a GWF file using the LALFrame API
def _unpickle_method(func_name, obj, cls): if obj is None: return cls.__dict__[func_name].__get__(obj, cls) for cls in cls.__mro__: try: func = cls.__dict__[func_name] except KeyError: pass else: break return func.__get__(obj, cls)
Unpickle methods properly, including class methods.
def ensure_cfn_bucket(self): if self.bucket_name: ensure_s3_bucket(self.s3_conn, self.bucket_name, self.bucket_region)
The CloudFormation bucket where templates will be stored.
def _update(collection_name, upsert, multi, spec, doc, check_keys, opts): flags = 0 if upsert: flags += 1 if multi: flags += 2 encode = _dict_to_bson encoded_update = encode(doc, check_keys, opts) return b"".join([ _ZERO_32, _make_c_string(collection_name), ...
Get an OP_UPDATE message.
def run_job(args): jm = setup(args) job_id = int(os.environ['JOB_ID']) array_id = int(os.environ['SGE_TASK_ID']) if os.environ['SGE_TASK_ID'] != 'undefined' else None jm.run_job(job_id, array_id)
Starts the wrapper script to execute a job, interpreting the JOB_ID and SGE_TASK_ID keywords that are set by the grid or by us.
def invalidate(self): super(RedisTransport, self).invalidate() for server in self._servers: server['redis'].connection_pool.disconnect() return False
Invalidates the current transport and disconnects all redis connections
def handle_write(self): num_sent = self.send(self.write_buffer) if self.debug: if self.state is not STATE_NOT_STARTED or options.password is None: self.print_debug(b'<== ' + self.write_buffer[:num_sent]) self.write_buffer = self.write_buffer[num_sent:]
Let's write as much as we can
def mark_address(self, addr, size): i = 0 while i < size: self._register_map[addr] = True i += 1
Marks address as being used in simulator
def anonymous_required(func=None, url=None): url = url or "/" def _dec(view_func): @wraps(view_func, assigned=available_attrs(view_func)) def _wrapped_view(request, *args, **kwargs): if request.user.is_authenticated(): return redirect(url) else: ...
Required that the user is not logged in.
def prepare(cls): if cls._ask_openapi(): napp_path = Path() tpl_path = SKEL_PATH / 'napp-structure/username/napp' OpenAPI(napp_path, tpl_path).render_template() print('Please, update your openapi.yml file.') sys.exit()
Prepare NApp to be uploaded by creating openAPI skeleton.
def word(self, position): if 0 <= position < len(self.wordlist): return self.wordlist[position] else: log.warn('position "{}" is not in sentence of length "{}"!'.format(position, len(self.wordlist))) raise IndexError()
Returns the word instance at the given position in the sentence, None if not found.
def p2th_wif(self) -> Optional[str]: if self.id: return Kutil(network=self.network, privkey=bytearray.fromhex(self.id)).wif else: return None
P2TH privkey in WIF format
def link2html(text): match = r'\[([^\]]+)\]\(([^)]+)\)' replace = r'<a href="\2">\1</a>' return re.sub(match, replace, text)
Turns md links to html
def aggregate(self): for report in self.reportset: printtime('Processing {}'.format(report.split('.')[0]), self.start) header = '' if report != 'mlst.csv' else 'Strain,Genus,SequenceType,Matches,1,2,3,4,5,6,7\n' data = '' with open(os.path.join(self.reportpath, re...
Aggregate all reports of the same type into a master report
def span_case(self, i, case): if self.span_stack: self.span_stack.pop() if self.single_stack: self.single_stack.pop() self.span_stack.append(case) count = len(self.span_stack) self.end_found = False try: while not self.end_found: ...
Uppercase or lowercase the next range of characters until end marker is found.
def show_lbaas_l7policy(self, l7policy, **_params): return self.get(self.lbaas_l7policy_path % l7policy, params=_params)
Fetches information of a certain listener's L7 policy.
def pdf_from_post(self): html = self.request.form.get("html") style = self.request.form.get("style") reporthtml = "<html><head>{0}</head><body>{1}</body></html>" reporthtml = reporthtml.format(style, html) reporthtml = safe_unicode(reporthtml).encode("utf-8") pdf_fn = tem...
Returns a pdf stream with the stickers
def find(name): if op.exists(name): return name path = op.dirname(__file__) or '.' paths = [path] + config['include_path'] for path in paths: filename = op.abspath(op.join(path, name)) if op.exists(filename): return filename for d in os.listdir(path): ...
Locate a filename into the shader library.
def reindex(self): for i in range(self.rally_count()): self.rally_points[i].count = self.rally_count() self.rally_points[i].idx = i self.last_change = time.time()
reset counters and indexes
def check_children(self): if self._restart_processes is True: for pid, mapping in six.iteritems(self._process_map): if not mapping['Process'].is_alive(): log.trace('Process restart of %s', pid) self.restart_process(pid)
Check the children once
def stop_listener_thread(self): self.should_listen = False if self.sync_thread: self.sync_thread.kill() self.sync_thread.get() if self._handle_thread is not None: self._handle_thread.get() self.sync_thread = None self._handle_thread = None
Kills sync_thread greenlet before joining it
def watch_activations(self, flag): lib.EnvSetDefruleWatchActivations(self._env, int(flag), self._rule)
Whether or not the Rule Activations are being watched.
def files_ondisk(self, file_objs: models.File) -> set: return set([ file_obj for file_obj in file_objs if Path(file_obj.full_path).is_file() ])
Returns a list of files that are not on disk.
def init(name, *args, **kwargs): if name in _TIMEFRAME_CATALOG: if rapport.config.get_int("rapport", "verbosity") >= 2: print("Initialize timeframe {0}: {1} {2}".format(name, args, kwargs)) try: return _TIMEFRAME_CATALOG[name](*args, **kwargs) except ValueError as e: ...
Instantiate a timeframe from the catalog.
def save(self, fname): out = etree.tostring(self.root, xml_declaration=True, standalone=True, pretty_print=True) with open(fname, 'wb') as fid: fid.write(out)
Save figure to a file
def dragMoveEvent(self, event): if mimedata2url(event.mimeData()): event.setDropAction(Qt.CopyAction) event.accept() else: event.ignore()
Allow user to move files
def render_noderef(self, ontol, n, query_ids=None, **args): if query_ids is None: query_ids = [] marker = "" if n in query_ids: marker = " * " label = ontol.label(n) s = None if label is not None: s = '{} ! {}{}'.format(n, ...
Render a node object
def player_stats(game_id): data = mlbgame.stats.player_stats(game_id) return mlbgame.stats.Stats(data, game_id, True)
Return dictionary of player stats for game matching the game id.
def dedup(seq): seen = set() for item in seq: if item not in seen: seen.add(item) yield item
Remove duplicates from a list while keeping order.
def add_shortcut_to_tooltip(action, context, name): action.setToolTip(action.toolTip() + ' (%s)' % get_shortcut(context=context, name=name))
Add the shortcut associated with a given action to its tooltip
def getDefaultItems(self): return [ RtiRegItem('HDF-5 file', 'argos.repo.rtiplugins.hdf5.H5pyFileRti', extensions=['hdf5', 'h5', 'h5e', 'he5', 'nc']), RtiRegItem('MATLAB file', 'argos.repo.rtiplugins.scipyio.MatlabFileR...
Returns a list with the default plugins in the repo tree item registry.
def DEFINE_string( name, default, help, flag_values=_flagvalues.FLAGS, **args): parser = _argument_parser.ArgumentParser() serializer = _argument_parser.ArgumentSerializer() DEFINE(parser, name, default, help, flag_values, serializer, **args)
Registers a flag whose value can be any string.
def sorted_enums(self) -> List[Tuple[str, int]]: return sorted(self.enum.items(), key=lambda x: x[1])
Return list of enum items sorted by value.
def convert_2_utc(self, datetime_, timezone): datetime_ = self.tz_mapper[timezone].localize(datetime_) return datetime_.astimezone(pytz.UTC)
convert to datetime to UTC offset.
def display_message(self, clear, beep, timeout, line1, line2): self._elk.send( dm_encode(self._index, clear, beep, timeout, line1, line2) )
Display a message on all of the keypads in this area.
def reset_stats(self): self.stats = pstats.Stats(Profile()) self.ncalls = 0 self.skipped = 0
Reset accumulated profiler statistics.
def paste_clipboard(self, event): log.critical("paste clipboard") clipboard = self.root.clipboard_get() for line in clipboard.splitlines(): log.critical("paste line: %s", repr(line)) self.add_user_input(line + "\r")
Send the clipboard content as user input to the CPU.
def delete(self): if self.fullname != "": try: os.remove(self.fullname) except IOError: print("Cant delete ",self.fullname)
delete a file, don't really care if it doesn't exist
def _create_clock(self): trading_o_and_c = self.trading_calendar.schedule.ix[ self.sim_params.sessions] market_closes = trading_o_and_c['market_close'] minutely_emission = False if self.sim_params.data_frequency == 'minute': market_opens = trading_o_and_c['market_...
If the clock property is not set, then create one based on frequency.
def smart_import(mpath): try: rest = __import__(mpath) except ImportError: split = mpath.split('.') rest = smart_import('.'.join(split[:-1])) rest = getattr(rest, split[-1]) return rest
Given a path smart_import will import the module and return the attr reffered to.
def parse_datetime(dt): d = datetime.strptime(dt[:-1], ISOFORMAT) if dt[-1:] == 'Z': return timezone('utc').localize(d) else: return d
Parse an ISO datetime, which Python does buggily.
def main(unusedargv): del unusedargv bt_table = (bigtable .Client(FLAGS.cbt_project, admin=True) .instance(FLAGS.cbt_instance) .table(FLAGS.cbt_table)) assert bt_table.exists(), "Table doesn't exist" last_game = latest_game_number(bt_table) print("eval...
All of the magic together.
def _initialize_non_fluents(self): non_fluents = self.rddl.domain.non_fluents initializer = self.rddl.non_fluents.init_non_fluent self.non_fluents = self._initialize_pvariables( non_fluents, self.rddl.domain.non_fluent_ordering, initializer) return sel...
Returns the non-fluents instantiated.
def __destroyLockedView(self): if self._lockedView: self._lockedView.close() self._lockedView.deleteLater() self._lockedView = None
Destroys the locked view from this widget.
def diff_many(models1, models2, migrator=None, reverse=False): models1 = pw.sort_models(models1) models2 = pw.sort_models(models2) if reverse: models1 = reversed(models1) models2 = reversed(models2) models1 = OrderedDict([(m._meta.name, m) for m in models1]) models2 = OrderedDict([(m...
Calculate changes for migrations from models2 to models1.
def _repr_html_(self): TileServer.run_tileserver(self, self.footprint()) capture = "raster: %s" % self._filename mp = TileServer.folium_client(self, self.footprint(), capture=capture) return mp._repr_html_()
Required for jupyter notebook to show raster as an interactive map.
def resource_of_node(resources, node): for resource in resources: model = getattr(resource, 'model', None) if type(node) == model: return resource return BasePageResource
Returns resource of node.
def check_whitelist(values): import os import tldextract whitelisted = list() for name in ['alexa.txt', 'cisco.txt']: config_path = os.path.expanduser('~/.config/blockade') file_path = os.path.join(config_path, name) whitelisted += [x.strip() for x in open(file_path, 'r').readlin...
Check the indicators against known whitelists.
def update(self, percent=None, text=None): if percent is not None: self.percent = percent if text is not None: self.message = text super().update()
Update the progress bar percentage and message.
def _generate_actual_grp_constraints(network_constraints): if 'constraints' not in network_constraints: return [] constraints = network_constraints['constraints'] actual = [] for desc in constraints: descs = _expand_description(desc) for desc in descs: actual.append(d...
Generate the user specified constraints
def _calc_odds(self): def recur(val, h, dice, combinations): for pip in dice[0]: tot = val + pip if len(dice) > 1: combinations = recur(tot, h, dice[1:], combinations) else: combinations += 1 ...
Calculates the absolute probability of all posible rolls.
def publish(self): if self.published is False: self.published = True else: raise Warning(self.title + ' is already published.')
Mark an episode as published.
def _holiday_entry(self): holidays_list = self.get_holidays_for_year() holidays_list = [ holiday for holiday, holiday_hdate in holidays_list if holiday_hdate.hdate == self.hdate ] assert len(holidays_list) <= 1 return holidays_list[0] if holidays_list else...
Return the abstract holiday information from holidays table.
def log_to_history(logger, name): def log_to_history_decorator(method): def l2h_method(self, ri): history_header = fits.Header() fh = FITSHistoryHandler(history_header) fh.setLevel(logging.INFO) logger.addHandler(fh) try: result = m...
Decorate function, adding a logger handler stored in FITS.
def find(self, text): for key, value in self: if (text in key) or (text in value): print(key, value)
Print all substitutions that include the given text string.
def __identify_user(self, username, csrf): data = { "username": username, "csrf": csrf, "apiClient": "WEB", "bindDevice": "false", "skipLinkAccount": "false", "redirectTo": "", "skipFirstUse": "", "referrerId": "", ...
Returns reusable CSRF code and the auth level as a 2-tuple
def aap_to_bp (ant1, ant2, pol): if ant1 < 0: raise ValueError ('first antenna is below 0: %s' % ant1) if ant2 < ant1: raise ValueError ('second antenna is below first: %s' % ant2) if pol < 1 or pol > 12: raise ValueError ('illegal polarization code %s' % pol) fps = _pol_to_fpol[...
Create a basepol from antenna numbers and a CASA polarization code.
def ServiceAccountCredentialsFromFile(filename, scopes, user_agent=None): filename = os.path.expanduser(filename) if oauth2client.__version__ > '1.5.2': credentials = ( service_account.ServiceAccountCredentials.from_json_keyfile_name( filename, scopes=scopes)) if cred...
Use the credentials in filename to create a token for scopes.
def getContacts(self, only_active=True): contacts = self.objectValues("Contact") if only_active: contacts = filter(api.is_active, contacts) return contacts
Return an array containing the contacts from this Client
def watch(ctx): watcher = Watcher(ctx) watcher.watch_directory( path='{pkg.source_less}', ext='.less', action=lambda e: build(ctx, less=True) ) watcher.watch_directory( path='{pkg.source_js}', ext='.jsx', action=lambda e: build(ctx, js=True) ) watcher.watch_direct...
Automatically run build whenever a relevant file changes.
def close_all(self): for host, conns in self._cm.get_all().items(): for h in conns: self._cm.remove(h) h.close()
close all open connections
def cancel(self): if self.__process.is_alive(): self.__process.terminate() _raise_exception(self.__timeout_exception, self.__exception_message)
Terminate any possible execution of the embedded function.
def lock(self): self.update() self.execute_operations(False) self._lock = True return self
Prepare the installer for locking only.
def write_branch_data(self, file, padding=" "): attrs = ['%s="%s"' % (k,v) for k,v in self.branch_attr.iteritems()] attr_str = ", ".join(attrs) for br in self.case.branches: file.write("%s%s -> %s [%s];\n" % \ (padding, br.from_bus.name, br.to_bus.name, attr_str))
Writes branch data in Graphviz DOT language.
def waitResult(self): self.thread.execute_queue.join() try: e = self.thread.exception_queue[threading.get_ident()].get_nowait() except queue.Empty: return self.thread.result_queue[threading.get_ident()].get_nowait() else: raise e
Wait for the execution of the last enqueued job to be done, and return the result or raise an exception.
def _slice_vcf_chr21(vcf_file, out_dir): tmp_file = os.path.join(out_dir, "chr21_qsignature.vcf") if not utils.file_exists(tmp_file): cmd = ("grep chr21 {vcf_file} > {tmp_file}").format(**locals()) out = subprocess.check_output(cmd, shell=True) return tmp_file
Slice chr21 of qsignature SNPs to reduce computation time
def _generate_html(data, out): print('<html>', file=out) print('<body>', file=out) _generate_html_table(data, out, 0) print('</body>', file=out) print('</html>', file=out)
Generate report data as HTML
def create_default_config(): import codecs config = ConfigParser.SafeConfigParser() config.readfp(StringIO(DEFAULT_CONFIG)) filename = get_user_config_filename() if not os.path.exists(filename): from wizard import setup_wizard setup_wizard(config) else: try: f...
Create default ConfigParser instance
def _get_chart_info(df, vtype, cat, prep, callers): maxval_raw = max(list(df["value.floor"])) curdf = df[(df["variant.type"] == vtype) & (df["category"] == cat) & (df["bamprep"] == prep)] vals = [] labels = [] for c in callers: row = curdf[df["caller"] == c] if len(row...
Retrieve values for a specific variant type, category and prep method.
def target_to_ipv6_long(target): splitted = target.split('-') if len(splitted) != 2: return None try: start_packed = inet_pton(socket.AF_INET6, splitted[0]) end_packed = inet_pton(socket.AF_INET6, splitted[1]) except socket.error: return None if end_packed < start_pac...
Attempt to return a IPv6 long-range list from a target string.
def lgamma(x, context=None): return _apply_function_in_current_context( BigFloat, lambda rop, op, rnd: mpfr.mpfr_lgamma(rop, op, rnd)[0], (BigFloat._implicit_convert(x),), context, )
Return the logarithm of the absolute value of the Gamma function at x.
def _add_zoho_token( self, uri, http_method="GET", body=None, headers=None, token_placement=None ): headers = self.prepare_zoho_headers(self.access_token, headers) return uri, headers, body
Add a zoho token to the request uri, body or authorization header. follows bearer pattern
def _learner_interpret(learn:Learner, ds_type:DatasetType=DatasetType.Valid): "Create a `ClassificationInterpretation` object from `learner` on `ds_type` with `tta`." return ClassificationInterpretation.from_learner(learn, ds_type=ds_type)
Create a `ClassificationInterpretation` object from `learner` on `ds_type` with `tta`.
def import_setting(self): LOGGER.debug('Import button clicked') home_directory = os.path.expanduser('~') file_path, __ = QFileDialog.getOpenFileName( self, self.tr('Import InaSAFE settings'), home_directory, self.tr('JSON File (*.json)')) i...
Import setting to a file.
def calculate_input(self, buffer): if TriggerMode.ABBREVIATION in self.modes: if self._should_trigger_abbreviation(buffer): if self.immediate: return len(self._get_trigger_abbreviation(buffer)) else: return len(self._get_trigger...
Calculate how many keystrokes were used in triggering this phrase.
async def abort(self): state = await self.state() res = await self.call("X_Abort", MasterSessionID=state.MasterSessionID) return res
Abort current group session.
def graph_memoized(func): from ..compat import tfv1 GRAPH_ARG_NAME = '__IMPOSSIBLE_NAME_FOR_YOU__' @memoized def func_with_graph_arg(*args, **kwargs): kwargs.pop(GRAPH_ARG_NAME) return func(*args, **kwargs) @functools.wraps(func) def wrapper(*args, **kwargs): assert GRAPH...
Like memoized, but keep one cache per default graph.
def register( self, app: 'Quart', first_registration: bool, *, url_prefix: Optional[str]=None, ) -> None: state = self.make_setup_state(app, first_registration, url_prefix=url_prefix) if self.has_static_folder: state.add_url_rul...
Register this blueprint on the app given.
def delete_job(self, job_name): logger.debug('Deleting job {0}'.format(job_name)) for idx, job in enumerate(self.jobs): if job.name == job_name: self.backend.delete_job(job.job_id) del self.jobs[idx] self.commit() return ...
Delete a job by name, or error out if no such job exists.
def _clean(c): if isdir(c.sphinx.target): rmtree(c.sphinx.target)
Nuke docs build target directory so next build is clean.
def fmt_account(account, title=None): if title is None: title = account.__class__.__name__ title = '{} ({} causal link{})'.format( title, len(account), '' if len(account) == 1 else 's') body = '' body += 'Irreducible effects\n' body += '\n'.join(fmt_ac_ria(m) for m in account.irreduc...
Format an Account or a DirectedAccount.
def gaussian(freq, freq0, sigma, amp, offset, drift): with warnings.catch_warnings(): warnings.simplefilter("ignore") return (amp * np.exp(- ((freq - freq0)**2) / (sigma**2) ) + drift * freq + offset)
A Gaussian function with flexible offset, drift and amplitude
def _get_from_send_queue(self): try: packet = self.transmit.get(block=False) self.logger.info('Sending packet') self.logger.debug(packet) return packet except queue.Empty: pass return None
Get message from send queue, if one exists
def _write(self, what): try: open(self.pipefile, "a").write(what) except: print("Error writing to %s:" % self.pipefile) traceback.print_exc()
writes something to the Purr pipe
def one_of(*args): "Verifies that only one of the arguments is not None" for i, arg in enumerate(args): if arg is not None: for argh in args[i+1:]: if argh is not None: raise OperationError("Too many parameters") else: return ...
Verifies that only one of the arguments is not None
def heptad_register(self): base_reg = 'abcdefg' exp_base = base_reg * (self.cc_len//7+2) ave_ca_layers = self.calc_average_parameters(self.ca_layers)[0][:-1] reg_fit = fit_heptad_register(ave_ca_layers) hep_pos = reg_fit[0][0] return exp_base[hep_pos:hep_pos+self.cc_len],...
Returns the calculated register of the coiled coil and the fit quality.