text
stringlengths
78
104k
score
float64
0
0.18
def ProgressBar(title="RoboFab...", ticks=None, label=""): """ A progess bar dialog. Optionally a `title`, `ticks` and `label` can be provided. :: from fontParts.ui import ProgressBar bar = ProgressBar() # do something bar.close() """ return dispatcher["Progre...
0.002732
def search_cloud_integration_entities(self, **kwargs): # noqa: E501 """Search over a customer's non-deleted cloud integrations # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True ...
0.002037
def eaf_from_chat(file_path, codec='ascii', extension='wav'): """Reads a .cha file and converts it to an elan object. The functions tries to mimic the CHAT2ELAN program that comes with the CLAN package as close as possible. This function however converts to the latest ELAN file format since the library ...
0.000241
def create_user(username, uid, system=False, no_login=True, no_password=False, group=False, gecos=None): """ Creates a new user with a specific id. :param username: User name. :type username: unicode :param uid: User id. :type uid: int or unicode :param system: Creates a system user. :t...
0.003681
def frames(fname=None,menuWidth=200,launch=False): """create and save a two column frames HTML file.""" html=""" <frameset cols="%dpx,*%%"> <frame name="menu" src="index_menu.html"> <frame name="content" src="index_splash.html"> </frameset>"""%(menuWidth) with open(fname,'w') as f: f...
0.015873
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
0.002564
def _canViewChange(self, proposedViewNo: int) -> (bool, str): """ Return whether there's quorum for view change for the proposed view number and its view is less than or equal to the proposed view """ msg = None quorum = self.quorums.view_change.value if not self....
0.00316
def ValidateSyntax(rdf_artifact): """Validates artifact syntax. This method can be used to validate individual artifacts as they are loaded, without needing all artifacts to be loaded first, as for Validate(). Args: rdf_artifact: RDF object artifact. Raises: ArtifactSyntaxError: If artifact syntax ...
0.010753
def decode(self, bytes, raw=False): """decode(bytearray, raw=False) -> value Decodes the given bytearray and returns the number of (fractional) seconds. If the optional parameter ``raw`` is ``True``, the byte (U8) itself will be returned. """ result = super(Tim...
0.004773
def get_as_array(self, index): """ Converts array element into an AnyValueArray or returns empty AnyValueArray if conversion is not possible. :param index: an index of element to get. :return: AnyValueArray value of the element or empty AnyValueArray if conversion is not supported. ...
0.008834
def _get_lines_from_node_text(cls, node): """ Given an ``lxml`` node, get lines from ``node.text``, where the line separator is ``<br xmlns=... />``. """ # TODO more robust parsing from lxml import etree parts = ([node.text] + list(chain(*([etree.tostring(c, with_...
0.004431
def create_async_sns_topic(self, lambda_name, lambda_arn): """ Create the SNS-based async topic. """ topic_name = get_topic_name(lambda_name) # Create SNS topic topic_arn = self.sns_client.create_topic( Name=topic_name)['TopicArn'] # Create subscriptio...
0.001905
def delete_server(self, datacenter_id, server_id): """ Removes the server from your data center. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server_id: The unique ID of the server. :type server_id: ``...
0.00369
def compute_rollover(self, current_time: int) -> int: """ Work out the rollover time based on the specified time. If we are rolling over at midnight or weekly, then the interval is already known. need to figure out is WHEN the next interval is. In other words, if you are rolling...
0.003759
def read_write( adr, index_group, index_offset, plc_read_datatype, value, plc_write_datatype, return_ctypes=False, ): # type: (AmsAddr, int, int, Type, Any, Type, bool) -> Any """Read and write data synchronous from/to an ADS-device. :param AmsAddr adr: local or remo...
0.001596
def stable_format_dict(d): """A sorted, python2/3 stable formatting of a dictionary. Does not work for dicts with unicode strings as values.""" inner = ', '.join('{}: {}'.format(repr(k)[1:] if repr(k).startswith(u"u'") or repr(k).startswith(u'u"') ...
0.004255
def implicit_locals(self): """Get implicitly defined class definition locals. :returns: the the name and Const pair for each local :rtype: tuple(tuple(str, node_classes.Const), ...) """ locals_ = (("__module__", self.special_attributes.attr___module__),) if sys.version_i...
0.006098
def dbmin_mean(self, value=None): """ Corresponds to IDD Field `dbmin_mean` Mean of extreme annual minimum dry-bulb temperature Args: value (float): value for IDD Field `dbmin_mean` Unit: C if `value` is None it will not be checked against the ...
0.002642
def get_notebook_name(): """ Return the full path of the jupyter notebook. """ kernel_id = re.search('kernel-(.*).json', ipykernel.connect.get_connection_file()).group(1) servers = list_running_servers() for ss in servers: response = requests.get(urljoin(ss['url...
0.003205
def _keyboard_quit(self): """ Cancels the current editing task ala Ctrl-G in Emacs. """ if self._temp_buffer_filled : self._cancel_completion() self._clear_temporary_buffer() else: self.input_buffer = ''
0.01107
def _run_dpkt(self, dpkt): """Call dpkt.pcap.Reader to extract PCAP files.""" # if not self._flag_a: # self._flag_a = True # warnings.warn(f"'Extractor(engine=dpkt)' object is not iterable; " # "so 'auto=False' will be ignored", AttributeWarning, stack...
0.00641
def wait(self, jobs=None, timeout=-1): """waits on one or more `jobs`, for up to `timeout` seconds. Parameters ---------- jobs : int, str, or list of ints and/or strs, or one or more AsyncResult objects ints are indices to self.history strs are msg_ids ...
0.003224
def check_installed_debian(pkgname): """ References: http://www.cyberciti.biz/faq/find-out-if-package-is-installed-in-linux/ """ import utool as ut #pkgname = 'espeak' #pkgname = 'sudo' #ut.cmd('hash ' + pkgname + ' 2>/dev/null') tup = ut.cmd('hash ' + pkgname + ' 2>/dev/null', q...
0.011737
def delete(self, obj): """Required functionality.""" del_id = obj.get_id() if not del_id: return cur = self._conn().cursor() tabname = obj.__class__.get_table_name() query = 'delete from %s where id = ?' % tabname cur.execute(query, (del_id,)) ...
0.005495
def round_mantissa(arg, decimals=0): """ Round floating point number(s) mantissa to given number of digits. Integers are not altered. The mantissa used is that of the floating point number(s) when expressed in `normalized scientific notation <https://en.wikipedia.org/wiki/Scientific_notation#Normal...
0.000839
def print_gpustat(json=False, debug=False, **kwargs): ''' Display the GPU query results into standard output. ''' try: gpu_stats = GPUStatCollection.new_query() except Exception as e: sys.stderr.write('Error on querying NVIDIA devices.' ' Use --debug flag for...
0.001206
def parse_options(): """Specify the command line options to parse. Returns ------- opts : optparse.Values instance Contains the option values in its 'dict' member variable. args[0] : string or file-handler The name of the file storing the data-set submitted for Affi...
0.021725
def prompt_autocomplete(prompt, complete, default=None, contains_spaces=True, show_default=True, prompt_suffix=': ', color=None): """ Prompt a string with autocompletion :param complete: A function that returns a list of possible strings that should be completed on a given ...
0.001991
async def set_focus(self, set_focus_request): """Set focus to a conversation.""" response = hangouts_pb2.SetFocusResponse() await self._pb_request('conversations/setfocus', set_focus_request, response) return response
0.007143
def check(requirements_paths=[], metadata=[], projects=[]): """Return True if all of the specified dependencies have been ported to Python 3. The requirements_paths argument takes a sequence of file paths to requirements files. The 'metadata' argument takes a sequence of strings representing metadata. ...
0.003315
def cloud_browser_media_url(_, token): """Get base media URL for application static media. Correctly handles whether or not the settings variable ``CLOUD_BROWSER_STATIC_MEDIA_DIR`` is set and served. For example:: <link rel="stylesheet" type="text/css" href="{% cloud_browser_media...
0.001821
def translate_js(js, HEADER=DEFAULT_HEADER, use_compilation_plan=False): """js has to be a javascript source code. returns equivalent python code.""" if use_compilation_plan and not '//' in js and not '/*' in js: return translate_js_with_compilation_plan(js, HEADER=HEADER) parser = pyjsparser...
0.00458
def from_api_repr(cls, resource, zone): """Factory: construct a record set given its API representation :type resource: dict :param resource: record sets representation returned from the API :type zone: :class:`google.cloud.dns.zone.ManagedZone` :param zone: A zone which holds...
0.00295
def target_address(self): """Return the authorative target of the link.""" # If link is a receiver, target is determined by the local # value, else use the remote. if self._pn_link.is_receiver: return self._pn_link.target.address else: return self._pn_link...
0.005848
def login(self, subject, authc_token): """ Login authenticates a user using an AuthenticationToken. If authentication is successful AND the Authenticator has determined that authentication is complete for the account, login constructs a Subject instance representing the authenti...
0.003827
def check_dimensional_equality_of_param_list_arrays(param_list): """ Ensures that all arrays in param_list have the same dimension, and that this dimension is either 1 or 2 (i.e. all arrays are 1D arrays or all arrays are 2D arrays.) Raises a helpful ValueError if otherwise. Parameters --------...
0.001145
def insert(self, key, column_parent, column, consistency_level): """ Insert a Column at the given column_parent.column_family and optional column_parent.super_column. Parameters: - key - column_parent - column - consistency_level """ self._seqid += 1 d = self._reqs[self._seq...
0.004728
def Stat(self, ext_attrs=None): """Return a stat of the file.""" del ext_attrs # Unused. return self.MakeStatResponse(self.fd, tsk_attribute=self.tsk_attribute)
0.00578
def authenticate(self, *, scopes, **kwargs): """ Performs the oauth authentication flow resulting in a stored token It uses the credentials passed on instantiation :param list[str] scopes: list of protocol user scopes to be converted by the protocol or scope helpers :param kwar...
0.002963
def preprocess(ops, nlp, rows, get_ids): """Parse the texts with spaCy. Make one-hot vectors for the labels.""" Xs = [] ys = [] for (text1, text2), label in rows: Xs.append((get_ids([nlp(text1)])[0], get_ids([nlp(text2)])[0])) ys.append(label) return Xs, to_categorical(ys, nb_classes...
0.003096
def trim(self, n='all', x=True, y=True): """ This will set xmin and xmax based on the current zoom-level of the figures. n='all' Which figure to use for setting xmin and xmax. 'all' means all figures. You may also specify a list. x=True Trim the x-ra...
0.009637
def viewzen_corr(data, view_zen): """Apply atmospheric correction on the given *data* using the specified satellite zenith angles (*view_zen*). Both input data are given as 2-dimensional Numpy (masked) arrays, and they should have equal shapes. The *data* array will be changed in place and has to be...
0.000927
def verify_rsa_sha1(request, rsa_public_key): """Verify a RSASSA-PKCS #1 v1.5 base64 encoded signature. Per `section 3.4.3`_ of the spec. Note this method requires the jwt and cryptography libraries. .. _`section 3.4.3`: https://tools.ietf.org/html/rfc5849#section-3.4.3 To satisfy `RFC2616 secti...
0.000794
def _AddAttributeNodes(self, attribute_names): """Add the attribute nodes to the graph. For every attribute that is required for the collection of requested artifacts, add a node to the dependency graph. An attribute node will have incoming edges from the artifacts that provide this attribute and outgo...
0.00292
def _connect_su(spec): """ Return ContextService arguments for su as a become method. """ return { 'method': 'su', 'enable_lru': True, 'kwargs': { 'username': spec.become_user(), 'password': spec.become_pass(), 'python_path': spec.python_path()...
0.002101
def split_args_list(tokens, loc): """Splits function definition arguments.""" req_args, def_args, star_arg, kwd_args, dubstar_arg = [], [], None, [], None pos = 0 for arg in tokens: if len(arg) == 1: if arg[0] == "*": # star sep (pos = 3) if pos >= 3: ...
0.004202
def _all_reachable_tables(t): """ A generator that provides all the names of tables that can be reached via merges starting at the given target table. """ for k, v in t.items(): for tname in _all_reachable_tables(v): yield tname yield k
0.003509
def merge_perchrom_mutations(job, chrom, mutations, univ_options): """ Merge the mutation calls for a single chromosome. :param str chrom: Chromosome to process :param dict mutations: dict of dicts of the various mutation caller names as keys, and a dict of per chromosome job store ids for v...
0.004129
def fit(self, X, y, **kwargs): """ Fits the learning curve with the wrapped model to the specified data. Draws training and test score curves and saves the scores to the estimator. Parameters ---------- X : array-like, shape (n_samples, n_features) Tr...
0.002208
def to_array(self): """ Serializes this SuccessfulPayment to a dictionary. :return: dictionary representation of this object. :rtype: dict """ array = super(SuccessfulPayment, self).to_array() array['currency'] = u(self.currency) # py2: type unicode, py3: type s...
0.006924
def create_wish_list(cls, wish_list, **kwargs): """Create WishList Create a new WishList This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.create_wish_list(wish_list, async=True) >>> res...
0.002331
def execute_setup(self): # type: () -> Dict[str,str] """ for really surprising things like a dict foo in setup(**foo) consider python3 setup.py --version :return: """ ver = execute_get_text("python setup.py --version") if not ver: return None ...
0.002497
def insert_completion(self, p_insert): """ Inserts currently chosen completion (p_insert parameter) into proper place in edit_text and adjusts cursor position accordingly. """ start, end = self._surrounding_text final_text = start + p_insert + end self.set_edit_te...
0.005155
def consultar_numero_sessao(self, numero_sessao): """Função ``ConsultarNumeroSessao`` conforme ER SAT, item 6.1.8. Consulta o equipamento SAT por um número de sessão específico. :param int numero_sessao: Número da sessão que se quer consultar. :return: Retorna *verbatim* a resposta da ...
0.006012
def __get_known_node_by_host(self, hostname): ''' Determine if the node is already known by hostname. If it is, return it. ''' for n in self.nodes: if (n.name == hostname): return n return None
0.007435
def get_currency(currency_str): """ Convert an identifier for a currency into a currency object. Parameters ---------- currency_str : str Returns ------- currency : Currency """ path = 'units/currencies.csv' # always use slash in Python packages filepath = pkg_resources.re...
0.000633
def filter_taubin(mesh, lamb=0.5, nu=0.5, iterations=10, laplacian_operator=None): """ Smooth a mesh in-place using laplacian smoothing and taubin filtering. Articles "Improved Laplacian Smoothing of Noisy Surface Meshes" J...
0.000656
def _create_simulated_annealing_expander(schedule): ''' Creates an expander that has a random chance to choose a node that is worse than the current (first) node, but that chance decreases with time. ''' def _expander(fringe, iteration, viewer): T = schedule(iteration) current = frin...
0.001225
def find_container(cid=None, primary_admin_gate_url=None): """ find container according ID or primary admin gate url. If both are defined this will return container according container ID. :param cid: container ID :param primary_admin_gate_url: container primary admin gate url ...
0.004775
def make_sentences(self, stream_item): 'assemble Sentence and Token objects' self.make_label_index(stream_item) sentences = [] token_num = 0 new_mention_id = 0 for sent_start, sent_end, sent_str in self._sentences( stream_item.body.clean_visible): ...
0.000935
def filesize(bytes, format='auto1024'): """ Returns the number of bytes in either the nearest unit or a specific unit (depending on the chosen format method). Acceptable formats are: auto1024, auto1000 convert to the nearest unit, appending the abbreviated unit name to the string (e.g....
0.000306
def get_multisample_vcf(fnames, name, caller, data): """Retrieve a multiple sample VCF file in a standard location. Handles inputs with multiple repeated input files from batches. """ unique_fnames = [] for f in fnames: if f not in unique_fnames: unique_fnames.append(f) out_...
0.003284
def add(self, labels, value): """Add adds a single observation to the summary.""" if type(value) not in (float, int): raise TypeError("Summary only works with digits (int, float)") # We have already a lock for data but not for the estimator with mutex: try: ...
0.003401
def set_border_type(self, clazz, weight=DefaultWeight, color=None, cap=None, dashes=None, join=None, count=None, space=None): """example: set_border_type(BorderTypePartialRows) would set a border above and below each row in the range""" args = locals() args.pop('clazz') ...
0.013263
def _validate_open_params(**params): """ Validate the fql parameters and if invalid, generate exception """ if not params['FilterQueryLanguage'] and params['FilterQuery']: raise CIMError( CIM_ERR_INVALID_PARAMETER, "FilterQuery without FilterQu...
0.001833
def setOverlayAutoCurveDistanceRangeInMeters(self, ulOverlayHandle, fMinDistanceInMeters, fMaxDistanceInMeters): """ For high-quality curved overlays only, sets the distance range in meters from the overlay used to automatically curve the surface around the viewer. Min is distance is when the s...
0.010638
def extractLocalParameters(self, dna, bp, helical=False, frames=None): """Extract the local parameters for calculations .. currentmodule:: dnaMD Parameters ---------- dna : :class:`dnaMD.DNA` Input :class:`dnaMD.DNA` instance. bp : list List of...
0.006946
def add_cause(self, error: Exception): '''Adds cause error to error message''' self.add_info('Cause error', '{0} - {1}'.format(type(error).__name__, error))
0.017442
def get_top_level_categories(parser, token): """ Retrieves an alphabetical list of all the categories that have no parents. Syntax:: {% get_top_level_categories [using "app.Model"] as categories %} Returns an list of categories [<category>, <category>, <category, ...] """ bits = token...
0.000997
def _attachment_uri(self, attachid): """ Returns the URI for the given attachment ID. """ att_uri = self.url.replace('xmlrpc.cgi', 'attachment.cgi') att_uri = att_uri + '?id=%s' % attachid return att_uri
0.007968
def get_subtree(self, name): # noqa: D302 r""" Get all node names in a sub-tree. :param name: Sub-tree root node name :type name: :ref:`NodeName` :rtype: list of :ref:`NodeName` :raises: * RuntimeError (Argument \`name\` is not valid) * RuntimeErro...
0.001608
def advance_past_string_with_gdb_escapes(self, chars_to_remove_gdb_escape=None): """characters that gdb escapes that should not be escaped by this parser """ if chars_to_remove_gdb_escape is None: chars_to_remove_gdb_escape = ['"'] buf = "" while True: ...
0.005093
def getOperationName(id: str): """ This method returns the name representation of an operation given its value as used in the API """ if isinstance(id, str): # Some graphene chains (e.g. steem) do not encode the # operation_type as id but in its string form assert id in opera...
0.002037
def password_attributes_admin_lockout_enable(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") password_attributes = ET.SubElement(config, "password-attributes", xmlns="urn:brocade.com:mgmt:brocade-aaa") admin_lockout_enable = ET.SubElement(password_attrib...
0.009091
def decode_produce_response(cls, response): """ Decode ProduceResponse to ProduceResponsePayload Arguments: response: ProduceResponse Return: list of ProduceResponsePayload """ return [ kafka.structs.ProduceResponsePayload(topic, partition, error...
0.006711
def geo_contains(left, right): """ Check if the first geometry contains the second one Parameters ---------- left : geometry right : geometry Returns ------- contains : bool scalar """ op = ops.GeoContains(left, right) return op.to_expr()
0.003472
def debug_msg(message): """ print a debug message :param message: the message :return: """ message = message or "" if Console.color: Console.cprint('RED', 'DEBUG: ', message) else: print(Console.msg('DEBUG: ' + message))
0.009709
def neighbors(self, node_id): """Find all the nodes where there is an edge from the specified node to that node. Returns a list of node ids.""" node = self.get_node(node_id) flattened_nodes_list = [] for a, b in [self.get_edge(edge_id)['vertices'] for edge_id in node['edges']]: ...
0.007156
def _create_table(db, table_name, columns, overwrite=False): """ Create's `table_name` in `db` if it does not already exist, and adds any missing columns. :param db: An active SQLite3 Connection. :param table_name: The (unicode) name of the table to setup. :param columns: An iterable of column ...
0.000511
def independent(repertoire): """Check whether the repertoire is independent.""" marginals = [marginal(repertoire, i) for i in range(repertoire.ndim)] # TODO: is there a way to do without an explicit iteration? joint = marginals[0] for m in marginals[1:]: joint = joint * m # TODO: shoul...
0.002083
def FindHeader(self, header): """Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before. """ for section_list in self.include_list: for f in section_list: i...
0.008043
def unpack(cls, data): """ Unpack packed data into an instance :param data: Packed data :type data: str :return: Object instance and remaining data :rtype: (APPHeader, str) """ size = struct.calcsize(APPHeader.fmt_header) ( version, ms...
0.001438
def secretbox_encrypt(data, **kwargs): ''' Encrypt data using a secret key generated from `nacl.keygen`. The same secret key can be used to decrypt the data using `nacl.secretbox_decrypt`. CLI Examples: .. code-block:: bash salt-run nacl.secretbox_encrypt datatoenc salt-call --loc...
0.004525
def _translate_symbols(string): """Given a description of a Greek letter or other special character, return the appropriate latex.""" res = [] for s in re.split(r'([,.:\s=]+)', string): tex_str = _TEX_GREEK_DICTIONARY.get(s) if tex_str: res.append(tex_str) elif s.lowe...
0.00158
def __add_annotation_tier(self, docgraph, body, annotation_layer): """ adds a span-based annotation layer as a <tier> to the Exmaralda <body>. Parameter --------- docgraph : DiscourseDocumentGraph the document graph from which the chains will be extracted bod...
0.001341
def main_loop_iteration(timeout=None): """Return the number of RemoteDispatcher.handle_read() calls made by this iteration""" prev_nr_read = nr_handle_read asyncore.loop(count=1, timeout=timeout, use_poll=True) return nr_handle_read - prev_nr_read
0.003745
def visit_ClassDef(self, node): # pylint: disable=invalid-name """Visit top-level classes.""" # Resolve everything as root scope contains everything from the process module. for base in node.bases: # Cover `from resolwe.process import ...`. if isinstance(base, ast.Name) ...
0.00413
def _check_release_cmp(name): ''' Helper function to compare release codename versions to the minion's current Salt version. If release codename isn't found, the function returns None. Otherwise, it returns the results of the version comparison as documented by the ``versions_cmp`` function in ...
0.002577
def _pre_job_handling(self, job): """ Some code executed before actually processing the job. :param VFGJob job: the VFGJob object. :return: None """ # did we reach the final address? if self._final_address is not None and job.addr == self._final_address: ...
0.002909
def manual_control_encode(self, target, x, y, z, r, buttons): ''' This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disab...
0.005081
def _build_params_from_kwargs(self, **kwargs): """Builds parameters from passed arguments Search passed parameters in available methods, prepend specified API key, and return dictionary which can be sent directly to API server. :param kwargs: :type param: dict ...
0.001037
def trace(self, name, chain=-1): """Return the trace of a tallyable object stored in the database. :Parameters: name : string The name of the tallyable object. chain : int The trace index. Setting `chain=i` will return the trace created by the ith call to `...
0.004587
def main(): parser = argparse.ArgumentParser(description='Shuffle columns in a CSV file') parser.add_argument(metavar="FILE", dest='input_file', type=argparse.FileType('r'), nargs='?', default=sys.stdin, help='Input CSV file. If omitted, read standard input.') parser.add_argument('-s...
0.002849
def send_await(self, msg, deadline=None): """ Like :meth:`send_async`, but expect a single reply (`persist=False`) delivered within `deadline` seconds. :param mitogen.core.Message msg: The message. :param float deadline: If not :data:`None`, seconds befor...
0.002829
def Notification(text=None, window_icon=None, **kwargs): """Put an icon in the notification area. This will put an icon in the notification area and return when the user clicks on it. text - The tooltip that will show when the user hovers over it. window_icon - The stock icon ("question", ...
0.006297
def read_sis_ini(fh, byteorder, dtype, count, offsetsize): """Read OlympusSIS INI string and return as dict.""" inistr = fh.read(count) inistr = bytes2str(stripnull(inistr)) try: return olympusini_metadata(inistr) except Exception as exc: log.warning('olympusini_metadata: %s: %s', ex...
0.002747
def aa_frequencies(seq, gap_chars='-.'): """Calculate the amino acid frequencies in a sequence set.""" aa_counts = Counter(seq) # Don't count gaps for gap_char in gap_chars: if gap_char in aa_counts: del aa_counts[gap_char] # Reduce to frequencies scale = 1.0 / sum(aa_counts....
0.002494
def setUpMethods(self, port): '''set up all methods representing the port operations. Parameters: port -- Port that defines the operations. ''' assert isinstance(port, WSDLTools.Port), \ 'expecting WSDLTools.Port not: ' %type(port) sd = self._services.get...
0.013284
def get_assets(cls, lat, lon, begin=None, end=None): """ Returns date and ids of flyovers Args: lat: latitude float lon: longitude float begin: date instance end: date instance Returns: json """ instance = cls(...
0.00381
def printdict(adict): """printdict""" dlist = list(adict.keys()) dlist.sort() for i in range(0, len(dlist)): print(dlist[i], adict[dlist[i]])
0.006061