text
stringlengths
78
104k
score
float64
0
0.18
def authorized_create_user(self, identities=None, primary=None, permissions=None): """Creates Vingd user (profile & account), links it with the provided identities (to be verified later), and sets the delegate-user permissions (creator being the delegate). Returns Vingd user's `huid` (ha...
0.007235
def rename(self, new_folder_name): """Renames the Folder to the provided name. Args: new_folder_name: A string of the replacement name. Raises: AuthError: Raised if Outlook returns a 401, generally caused by an invalid or expired access token. Returns: ...
0.005083
def _get_default_mapping(self, obj): """Return default mapping if there are no special needs.""" mapping = {v: k for k, v in obj.TYPE_MAPPING.items()} mapping.update({ fields.Email: text_type, fields.Dict: dict, fields.Url: text_type, fields.List: ...
0.004329
def between(start, delta, end=None): """Return an iterator between this date till given end point. Example usage: >>> d = datetime_tz.smartparse("5 days ago") 2008/05/12 11:45 >>> for i in d.between(timedelta(days=1), datetime_tz.now()): >>> print i 2008/05/12 11:45 2008/...
0.004071
def set(self, key, value): """ Sets the value for a specific requirement. :param key: Name of requirement to be set :param value: Value to set for requirement key :return: Nothing, modifies requirement """ if key == "tags": self._set_tag(tags=value) ...
0.004878
def fields(self): '''Return a tuple of ordered fields for this :class:`ColumnTS`.''' key = self.id + ':fields' encoding = self.client.encoding return tuple(sorted((f.decode(encoding) for f in self.client.smembers(key))))
0.006993
def replace_version_string(content, variable, new_version): """ Given the content of a file, finds the version string and updates it. :param content: The file contents :param variable: The version variable name as a string :param new_version: The new version number as a string :return: A string...
0.001934
def get_abs_filename_with_sub_path(sub_path, filename): """ 生成当前路径下一级路径某文件的完整文件名; :param: * sub_path: (string) 下一级的某路径名称 * filename: (string) 下一级路径的某个文件名 :returns: * 返回类型 (tuple),有两个值,第一个为 flag,第二个为文件名,说明见下 * flag: (bool) 如果文件存在,返回 True,文件不存在...
0.004326
def FileEntryExistsByPathSpec(self, path_spec): """Determines if a file entry for a path specification exists. Args: path_spec (PathSpec): a path specification. Returns: bool: True if the file entry exists, false otherwise. """ location = getattr(path_spec, 'location', None) if lo...
0.005768
def GET_name_history(self, path_info, name): """ Get the history of a name or subdomain. Requires 'page' in the query string return the history on success return 400 on invalid start_block or end_block return 502 on failure to query blockstack server """ i...
0.00602
def _check_dep_time_is_valid(self, dep_time): """ A simple checker, that connections are coming in descending order of departure time and that no departure time has been "skipped". Parameters ---------- dep_time Returns ------- None """ ...
0.006349
def delete(filename, conn=None): """ deletes a file filename being a value in the "id" key :param filename: <str> :param conn: <rethinkdb.DefaultConnection> :return: <dict> """ return RBF.filter((r.row[PRIMARY_FIELD] == filename) | (r.row[PARENT_FIELD] == filename)).delete().run(conn)
0.006309
def mainloop(self): """ The main loop. """ self._validate_config() config.engine.load_config() # Defaults for process control paths if not self.options.no_fork and not self.options.guard_file: self.options.guard_file = os.path.join(config.config_dir, "run/pyr...
0.003705
def switch_delete_record_for_nic(self, userid, interface): """Remove userid switch record from switch table.""" with get_network_conn() as conn: conn.execute("DELETE FROM switch WHERE userid=? and interface=?", (userid, interface)) LOG.debug("Switch recor...
0.004728
async def remember(request, response, identity, **kwargs): """Remember identity into response. The action is performed by identity_policy.remember() Usually the identity is stored in user cookies somehow but may be pushed into custom header also. """ assert isinstance(identity, str), identity ...
0.001166
def compact(*args): """Returns a new list after removing any non-true values""" use_comma = True if len(args) == 1 and isinstance(args[0], List): use_comma = args[0].use_comma args = args[0] return List( [arg for arg in args if arg], use_comma=use_comma, )
0.003236
def parse_spss_datafile(path, **kwargs): """ Parse spss data file Arguments: path {str} -- path al fichero de cabecera. **kwargs {[dict]} -- otros argumentos que puedan llegar """ data_clean = [] with codecs.open(path, 'r', kwargs.get('encoding', 'latin-1')) as file_: ra...
0.002331
def servicegroup_exists(sg_name, sg_type=None, **connection_args): ''' Checks if a service group exists CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_exists 'serviceGroupName' ''' sg = _servicegroup_get(sg_name, **connection_args) if sg is None: return ...
0.002304
def main(): """ NAME basemap_magic.py NB: this program no longer maintained - use plot_map_pts.py for greater functionality DESCRIPTION makes a map of locations in er_sites.txt SYNTAX basemap_magic.py [command line options] OPTIONS -h prints help message ...
0.00155
def get_groups(self, username): """ Get a user's groups :param username: 'key' attribute of the user :type username: string :rtype: list of groups """ try: return self.users[username]['groups'] except Exception as e: raise UserDoesntExist(...
0.005747
def _json_clean(d): """Cleans the specified python `dict` by converting any tuple keys to strings so that they can be serialized by JSON. Args: d (dict): python dictionary to clean up. Returns: dict: cleaned-up dictionary. """ result = {} compkeys = {} for k, v in d.ite...
0.006831
def isHcl(s): ''' Detects whether a string is JSON or HCL :param s: String that may contain HCL or JSON :returns: True if HCL, False if JSON, raises ValueError if neither ''' for c in s: if c.isspace(): continue if c ==...
0.006757
def _expand_alts_and_remove_duplicates_in_list(cls, vcf_records, ref_seq, indel_gap=100): '''Input: list of VCF records, all from the same CHROM. ref_seq = sequence of that CHROM. Expands any record in the list that has >ALT, into one record per ALT. Removes duplicated records, where REF and ALT...
0.006093
def parsedeglat (latstr): """Parse a latitude formatted as sexagesimal degrees into an angle. This function converts a textual representation of a latitude, measured in degrees, into a floating point value measured in radians. The format of *latstr* is very limited: it may not have leading or trailing ...
0.006031
def cable_page_by_id(reference_id): """\ Experimental: Returns the HTML page of the cable identified by `reference_id`. >>> cable_page_by_id('09BERLIN1167') is not None True >>> cable_page_by_id('22BERLIN1167') is None True >>> cable_page_by_id('09MOSCOW3010') is not None True >>> c...
0.002548
def from_es(self, hit): """Returns a Django model instance, using a document from Elasticsearch""" doc = hit.copy() klass = shallow_class_factory(self.model) # We can pass in the entire source, except when we have a non-indexable many-to-many for field in self.model._meta.get_fi...
0.003876
async def fetch_webhook(self, webhook_id): """|coro| Retrieves a :class:`.Webhook` with the specified ID. Raises -------- HTTPException Retrieving the webhook failed. NotFound Invalid webhook ID. Forbidden You do not have perm...
0.003448
def tag_and_push_image(self, image, target_image, insecure=False, force=False, dockercfg=None): """ tag provided image and push it to registry :param image: str or ImageName, image id or name :param target_image: ImageName, img :param insecure: bool, a...
0.005549
def F(self, **kwargs): ''' Returns the Kane remote-band parameter, `F`, calculated from `Eg_Gamma_0`, `Delta_SO`, `Ep`, and `meff_e_Gamma_0`. ''' Eg = self.Eg_Gamma_0(**kwargs) Delta_SO = self.Delta_SO(**kwargs) Ep = self.Ep(**kwargs) meff = self.meff_e_Ga...
0.004902
def Cvgm(self): r'''Gas-phase ideal-gas contant-volume heat capacity of the mixture at its current temperature and composition, in units of [J/mol/K]. Subtracts R from the ideal-gas heat capacity; does not include pressure-compensation from an equation of state. Examples ...
0.005357
def _decompose_(self, qubits): """See base class.""" a, b = qubits yield CNOT(a, b) yield CNOT(b, a) ** self._exponent yield CNOT(a, b)
0.011429
def _auto_client_files(cls, client, ca_path=None, ca_contents=None, cert_path=None, cert_contents=None, key_path=None, key_contents=None): """ returns a list of NetJSON extra files for automatically generated clients produces side effects in ``client`` dictionary ...
0.005709
def _compute_distance_scaling(self, C, mag, rrup): """ Compute distance scaling term (eq.3, page 319). The distance scaling assumes the near-source effect of local site conditions due to 50% very firm soil and soft rock and 50% firm rock. """ g = C['c5'] + C['c6'] * 0.5 ...
0.004338
def version_cmp(pkg1, pkg2, **kwargs): ''' Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem making the comparison. CLI Example: .. code-block:: bash salt '*' pkg.version_cmp '0.2.4-0' '0.2....
0.000967
def _getWSAddressTypeCodes(self, **kw): '''kw -- namespaceURI keys with sequence of element names. ''' typecodes = [] try: for nsuri,elements in kw.items(): for el in elements: typecode = GED(nsuri, el) if typecode is No...
0.012931
def record_udp_port(self, port): """ Associate a reserved UDP port number with this project. :param port: UDP port number """ if port not in self._used_udp_ports: self._used_udp_ports.add(port)
0.008097
def pixel_to_utm(row, column, transform): """ Convert pixel coordinate to UTM coordinate given a transform :param row: row pixel coordinate :type row: int or float :param column: column pixel coordinate :type column: int or float :param transform: georeferencing transform of the image, e.g. `(x...
0.003367
def send_media_group(self, chat_id, media, disable_notification=None, reply_to_message_id=None): """ Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned. https://core.telegram.org/bots/api#sendmediagroup Parameters: ...
0.006487
def _vmomentsurfaceIntegrand(vR,vT,R,az,df,n,m,sigmaR1,sigmaT1,t,initvmoment): """Internal function that is the integrand for the velocity moment times surface mass integration""" o= Orbit([R,vR*sigmaR1,vT*sigmaT1,az]) return vR**n*vT**m*df(o,t)/initvmoment
0.058608
def margin_logit_loss(model_logits, label, nb_classes=10, num_classes=None): """Computes difference between logit for `label` and next highest logit. The loss is high when `label` is unlikely (targeted by default). This follows the same interface as `loss_fn` for TensorOptimizer and projected_optimization, i.e...
0.008935
def get_masked_cnv_manifest(tcga_id): """Get manifest for masked TCGA copy-number variation data. Params ------ tcga_id : str The TCGA project ID. download_file : str The path of the download file. Returns ------- `pandas.DataFrame` The manifest. ...
0.014855
def check_auth(username, pwd): """This function is called to check if a username / password combination is valid. """ cfg = get_current_config() return username == cfg["dashboard_httpauth"].split( ":")[0] and pwd == cfg["dashboard_httpauth"].split(":")[1]
0.003534
def process_pad_frame(self, id=None, msg=None): """process_pad_frame Convert a complex nested json dictionary to a flattened dictionary and capture all unique keys for table construction :param id: key for this msg :pa...
0.004061
def filter_keys(cls, data): """Filter GELF record keys using exclude_patterns :param dict data: Log record has dict :return: the filtered log record :rtype: dict """ keys = list(data.keys()) for pattern in cls.EXCLUDE_PATTERNS: for key in keys: ...
0.004357
def _parse_metadatas(self, text_lines): """ From a given Org text, return the metadatas Keyword Arguments: text_lines -- A list, each item is a line of the texte Return: A dict containing metadatas """ if not text_lines: return {} expr...
0.007394
def reverseCommit(self): """ Remove the inserted character(s). """ # Move the cursor to the right of the text to delete. tc = self.qteWidget.textCursor() # Delete as many characters as necessary. For an image that would # be exactly 1 even though the HTML code t...
0.002389
def create(cls, name, ip_range, comment=None): """ Create an AddressRange element :param str name: Name of element :param str iprange: iprange of element :param str comment: comment (optional) :raises CreateElementFailed: element creation failed with reason :retu...
0.003781
def draw(self, y_pred, residuals, train=False, **kwargs): """ Draw the residuals against the predicted value for the specified split. It is best to draw the training split first, then the test split so that the test split (usually smaller) is above the training split; particularl...
0.002456
def _escape(value): """Escape a string (key or value) for InfluxDB's line protocol. :param str|int|float|bool value: The value to be escaped :rtype: str """ value = str(value) for char, escaped in {' ': '\ ', ',': '\,', '"': '\"'}.items(): value = value.repl...
0.011142
def superkey(self): """Returns a set of column names that together constitute the superkey.""" sorted_list = [] for header in self.header: if header in self._keys: sorted_list.append(header) return sorted_list
0.011152
def transform(self, data): """ Transforms the data. """ if not self._get("fitted"): raise RuntimeError("`transform` called before `fit` or `fit_transform`.") data = data.copy() output_column_prefix = self._get("output_column_prefix") if output_colum...
0.005435
def IIR_filter_design(CentralFreq, bandwidth, transitionWidth, SampleFreq, GainStop=40, GainPass=0.01): """ Function to calculate the coefficients of an IIR filter, IMPORTANT NOTE: make_butterworth_bandpass_b_a and make_butterworth_b_a can produce IIR filters with higher sample rates and are prefereabl...
0.004044
def DbGetDeviceList(self, argin): """ Get a list of devices for specified server and class. :param argin: argin[0] : server name argin[1] : class name :type: tango.DevVarStringArray :return: The list of devices for specified server and class. :rtype: tango.DevVarStringAr...
0.003731
def owner(*paths, **kwargs): ''' .. versionadded:: 2014.7.0 Return the name of the package that owns the file. Multiple file paths can be passed. Like :mod:`pkg.version <salt.modules.yumpkg.version>`, if a single path is passed, a string will be returned, and if multiple paths are passed, a dic...
0.000893
def drawFile(dataset, matrix, patterns, cells, w, fnum): '''The similarity of two patterns in the bit-encoding space is displayed alongside their similarity in the sp-coinc space.''' score=0 count = 0 assert len(patterns)==len(cells) for p in xrange(len(patterns)-1): matrix[p+1:,p] = [len(set(patterns[p...
0.036626
def date(self): """DATE command. Coordinated Universal time from the perspective of the usenet server. It can be used to provide information that might be useful when using the NEWNEWS command. See <http://tools.ietf.org/html/rfc3977#section-7.1> Returns: T...
0.003017
def paint( self, painter, option, index ): """ Overloads the paint method from Qt to perform some additional painting on items. :param painter | <QPainter> option | <QStyleOption> index | <QModelIndex> """ ...
0.010784
def memory_map(self): """! @brief MemoryMap object.""" # Lazily construct the memory map. if self._memory_map is None: self._build_memory_regions() self._build_flash_regions() # Warn if there was no boot memory. if not self._saw_startup: ...
0.011321
def get_module_logger(moduleName, defaultToVerbose=False): """Create a module logger, that can be en/disabled by configuration. @see: unit.init_logging """ # moduleName = moduleName.split(".")[-1] if not moduleName.startswith(BASE_LOGGER_NAME + "."): moduleName = BASE_LOGGER_NAME + "." + mo...
0.00188
def tell_sender_to_start(self): '''send a start packet (if we haven't sent one in the last second)''' now = time.time() if now - self.time_last_start_packet_sent < 1: return self.time_last_start_packet_sent = now if self.log_settings.verbose: print("DFLog...
0.00311
def pretty_dict_string(d, indent=0): """Pretty output of nested dictionaries. """ s = '' for key, value in sorted(d.items()): s += ' ' * indent + str(key) if isinstance(value, dict): s += '\n' + pretty_dict_string(value, indent+1) else: s += '=' + str...
0.014409
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ generator = datagen.DataGenerator.make_copy(self.resolve_option("setup")) generator.dataset_format = generator.define_data_format() ...
0.00607
def swo_speed_info(self): """Retrieves information about the supported SWO speeds. Args: self (JLink): the ``JLink`` instance Returns: A ``JLinkSWOSpeedInfo`` instance describing the target's supported SWO speeds. Raises: JLinkException: on erro...
0.00491
def includeme(configurator): """ Add yaml configuration utilities. :param pyramid.config.Configurator configurator: pyramid's app configurator """ settings = configurator.registry.settings # lets default it to running path yaml_locations = settings.get('yaml.location', ...
0.000903
def get_isa(self, oneq_type='Xhalves', twoq_type='CZ') -> ISA: """ Construct an ISA suitable for targeting by compilation. This will raise an exception if the requested ISA is not supported by the device. :param oneq_type: The family of one-qubit gates to target :param twoq_typ...
0.008432
def jsonarrlen(self, name, path=Path.rootPath()): """ Returns the length of the array JSON value under ``path`` at key ``name`` """ return self.execute_command('JSON.ARRLEN', name, str_path(path))
0.008475
def downsample_trajectories(trajectories, downsampler, *args, **kwargs): '''Downsamples all points together, then re-splits into original trajectories. trajectories : list of 2-d arrays, each representing a trajectory downsampler(X, *args, **kwargs) : callable that returns indices into X ''' X = np.vstack(tr...
0.01528
def resolve_movie(self, title, year=None): """Tries to find a movie with a given title and year""" r = self.search_movie(title) return self._match_results(r, title, year)
0.010256
def minizinc_version(): """Returns the version of the found minizinc executable.""" vs = _run_minizinc('--version') m = re.findall('version ([\d\.]+)', vs) if not m: raise RuntimeError('MiniZinc executable not found.') return m[0]
0.011628
def _break_reads(self, contig, position, fout, min_read_length=250): '''Get all reads from contig, but breaks them all at given position (0-based) in the reference. Writes to fout. Currently pproximate where it breaks (ignores indels in the alignment)''' sam_reader = pysam.Samfile(self.bam, "rb") ...
0.004435
def get_address(customer_id, data): """ Easier to fetch the addresses of customer and then check one by one. You can get fancy by using some validation mechanism too """ Address = client.model('party.address') addresses = Address.find( [('party', '=', customer_id)], fields=[ ...
0.001085
def _getOutputElegant(self, **kws): """ get results from elegant output according to the given keywords, input parameter format: key = sdds field name tuple, e.g.: available keywords are: - 'file': sdds fielname, file = test.sig - 'data': data array, data = (...
0.002217
def fetchall(self): """Fetch all available rows from select result set. :returns: list of row tuples """ result = r = self.fetchmany(size=self.FETCHALL_BLOCKSIZE) while len(r) == self.FETCHALL_BLOCKSIZE or not self._received_last_resultset_part: r = self.fetchmany(siz...
0.007557
def _get_data_segments(channels, start, end, connection): """Get available data segments for the given channels """ allsegs = io_nds2.get_availability(channels, start, end, connection=connection) return allsegs.intersection(allsegs.keys())
0.003401
def scale(text="", value=0, min=0 ,max=100, step=1, draw_value=True, title="", width=DEFAULT_WIDTH, height=DEFAULT_HEIGHT, timeout=None): """ Select a number with a range widget :param text: text inside window :type text: str :param value: current value :type value: int :param min...
0.002994
def parse(self): """ parse geojson and ensure is collection """ try: self.parsed_data = json.loads(self.data) except UnicodeError as e: self.parsed_data = json.loads(self.data.decode('latin1')) except Exception as e: raise Exception('Error while conver...
0.00678
def create_grupo_l3(self): """Get an instance of grupo_l3 services facade.""" return GrupoL3( self.networkapi_url, self.user, self.password, self.user_ldap)
0.009091
def merge_vertical_lines(lines, tol=TOLERANCE): """ This function merges lines segment when they are vertically aligned :param lines: list of lines coordinates (top, left, bottom, right) :return: list of merged lines coordinates """ if len(lines) == 0: return [] merged_lines = [lines...
0.00117
def get_all_submissions(course_id, item_id, item_type, read_replica=True): """For the given item, get the most recent submission for every student who has submitted. This may return a very large result set! It is implemented as a generator for efficiency. Args: course_id, item_id, item_type (strin...
0.00523
def create_integer(self, value: int) -> Integer: """ Creates a new :class:`ConstantInteger`, adding it to the pool and returning it. :param value: The value of the new integer. """ self.append((3, value)) return self.get(self.raw_count - 1)
0.006734
def _ctab_property_block(stream): """Process properties block of ``Ctab``. :param stream: Queue containing lines of text. :type stream: :py:class:`collections.deque` :return: Tuples of data. :rtype: :class:`~ctfile.tokenizer.CtabPropertiesBlockLine` """ line = stream.popleft() while lin...
0.002237
def _parse_entity(self): """Parse an HTML entity at the head of the wikicode string.""" reset = self._head try: self._push(contexts.HTML_ENTITY) self._really_parse_entity() except BadRoute: self._head = reset self._emit_text(self._read()) ...
0.005376
def shift(txt, indent = ' ', prepend = ''): """Return a list corresponding to the lines of text in the `txt` list indented by `indent`. Prepend instead the string given in `prepend` to the beginning of the first line. Note that if len(prepend) > len(indent), then `prepend` will be truncated (doing be...
0.007495
def effective_value(self): """ Read/write |float| representing normalized adjustment value for this adjustment. Actual values are a large-ish integer expressed in shape coordinates, nominally between 0 and 100,000. The effective value is normalized to a corresponding value nomina...
0.002144
def osm_polygon_download(query, limit=1, polygon_geojson=1): """ Geocode a place and download its boundary geometry from OSM's Nominatim API. Parameters ---------- query : string or dict query string or structured query dict to geocode/download limit : int max number of results ...
0.004389
def ensure_local_files(): """ Ensure that filesystem is setup/filled out in a valid way """ if _file_permissions: if not os.path.isdir(AUTH_DIR): os.mkdir(AUTH_DIR) for fn in [CONFIG_FILE]: contents = load_json_dict(fn) for key, val in list(_FILE_CONTENT[fn].items()): if key not in contents: c...
0.035656
def queue_purge(self, queue, **kwargs): """Discard all messages in the queue.""" qsize = mqueue.qsize() mqueue.queue.clear() return qsize
0.011834
def debugDumpOneNode(self, output, depth): """Dumps debug information for the element node, it is not recursive """ libxml2mod.xmlDebugDumpOneNode(output, self._o, depth)
0.010152
def get_stp_mst_detail_output_cist_port_edge_port(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_stp_mst_detail = ET.Element("get_stp_mst_detail") config = get_stp_mst_detail output = ET.SubElement(get_stp_mst_detail, "output") cist ...
0.003407
def cancel(self, session): '''taobao.crm.shopvip.cancel 卖家取消店铺vip的优惠 此接口用于取消VIP优惠''' request = TOPRequest('taobao.crm.shopvip.cancel') self.create(self.execute(request, session)) return self.is_success
0.012
def pushd(directory): """Change working directories in style and stay organized! :param directory: Where do you want to go and remember? :return: saved directory stack """ directory = os.path.expanduser(directory) _saved_paths.insert(0, os.path.abspath(os.getcwd())) os.chdir(directory) ...
0.002833
def LT(self, a, b): """Less-than comparison""" return Operators.ITEBV(256, Operators.ULT(a, b), 1, 0)
0.017094
def parse_string_field(self, field_data): """ Parse a string field to dict with options String value is used as field name. Options can be given after = symbol. Where key value is separated by : and different options by ;, when no : is used then the value becomes True. **Exampl...
0.002819
def asDictionary(self): """ converts the object to a dictionary """ template = {"type" : self._type, "mapLayerId" : self._mapLayerId} if not self._gdbVersion is None and\ self._gdbVersion != "": template['gdbVersion'] = self._gdbVersion return t...
0.015291
def store_json(obj, destination): """store_json Takes in a json-portable object and a filesystem-based destination and stores the json-portable object as JSON into the filesystem-based destination. This is blind, dumb, and stupid; thus, it can fail if the object is more complex than simple dict, list, int, str, e...
0.001481
def query_recent_most(num=8, recent=30): ''' Query the records from database that recently updated. :param num: the number that will returned. :param recent: the number of days recent. ''' time_that = int(time.time()) - recent * 24 * 3600 return TabPost.select().w...
0.004464
def clone(self, instance): ''' Create a shallow clone of an *instance*. **Note:** the clone and the original instance **does not** have to be part of the same metaclass. ''' metaclass = get_metaclass(instance) metaclass = self.find_metaclass(metaclass.ki...
0.010989
def get_mean_width(self): """ Calculate and return (weighted) mean width (km) of a mesh surface. The length of each mesh column is computed (summing up the cell widths in a same column), and the mean value (weighted by the mean cell length in each column) is returned. ""...
0.001957
def check_element(self, elem, check_children=False, next_to_elem=None): """ Given an element, check its attributes for references to the three proton attributes ('eid', 'aid' and 'rid'). """ self.__add_element('eid', elem.attribs, self.__element_ids, elem, next_to_elem) self.__ad...
0.009631
def idna_encode (host): """Encode hostname as internationalized domain name (IDN) according to RFC 3490. @raise: UnicodeError if hostname is not properly IDN encoded. """ if host and isinstance(host, unicode): try: host.encode('ascii') return host, False excep...
0.004405