code
stringlengths
51
2.34k
docstring
stringlengths
11
171
def _get_block(self): b = self._fh.read(4) if not b: raise StopIteration block_size = struct.unpack('<i',b)[0] return self._fh.read(block_size)
Just read a single block from your current location in _fh
def modelrepr(instance) -> str: elements = [] for f in instance._meta.get_fields(): if f.auto_created: continue if f.is_relation and f.related_model is None: continue fieldname = f.name try: value = repr(getattr(instance, fieldname)) ex...
Default ``repr`` version of a Django model object, for debugging.
def latch_file_info(self, args): self.file_dict.clear() for key, val in self.file_args.items(): try: file_path = args[key] if file_path is None: continue if key[0:4] == 'args': if isinstance(file_path, li...
Extract the file paths from a set of arguments
def del_qos(self, port_name): command = ovs_vsctl.VSCtlCommand( 'del-qos', [port_name]) self.run_command([command])
Deletes the Qos rule on the given port.
def _make_request_to_server(self, query_function, raise_for_status=True, time_limit_seconds=2, retry_delay_seconds=0.2): start_time = datetime.datetime.now() while datetime.datetime.now() - start_time < datetime.timedelta( 0, time_limit_seconds): ...
Retry sending request until timeout or until receiving a response.
def _handleLegacyResult(result): if not isinstance(result, dict): warnings.warn('The Gerrit status callback uses the old way to ' 'communicate results. The outcome might be not what is ' 'expected.') message, verified, reviewed = result result = m...
make sure the result is backward compatible
def filename( self, node ): if not node.directory: return None if node.filename == '~': return None return os.path.join(node.directory, node.filename)
Extension to squaremap api to provide "what file is this" information
def as_hex(self): hex = [mpl.colors.rgb2hex(rgb) for rgb in self] return ColorPalette(hex)
Return a color palette with hex codes instead of RGB values.
def generate(self): inter_arrival_time = 0.0 while True: try: yield self._env.timeout(inter_arrival_time) except TypeError: error_msg = ( "arrival time '{}' has wrong type '{}'".format( inter_arrival_time...
Source generates jobs according to the interarrival time distribution
def pass_time(self, t): cont = time.time() + t while time.time() < cont: time.sleep(0)
Non-blocking time-out for ``t`` seconds.
def fasta_idx(in_file, config=None): fasta_index = in_file + ".fai" if not utils.file_exists(fasta_index): samtools = config_utils.get_program("samtools", config) if config else "samtools" cmd = "{samtools} faidx {in_file}" do.run(cmd.format(**locals()), "samtools faidx") return fast...
Retrieve samtools style fasta index.
def replace_argument(self, name, *args, **kwargs): new_arg = self.argument_class(name, *args, **kwargs) for index, arg in enumerate(self.args[:]): if new_arg.name == arg.name: del self.args[index] self.args.append(new_arg) break return ...
Replace the argument matching the given name with a new version.
def _display_data(self, index): return to_qvariant(self._data[index.row()][index.column()])
Return a data element
def read_sensor(self, device_id, sensor_uri): url = MINUT_DEVICES_URL + "/{device_id}/{sensor_uri}".format( device_id=device_id, sensor_uri=sensor_uri) res = self._request(url, request_type='GET', data={'limit': 1}) if not res.get('values'): return None return res...
Return sensor value based on sensor_uri.
def highlight_differences(s1, s2, color): ls1, ls2 = len(s1), len(s2) diff_indices = [i for i, (a, b) in enumerate(zip(s1, s2)) if a != b] print(s1) if ls2 > ls1: colorise.cprint('_' * (ls2-ls1), fg=color) else: print() colorise.highlight(s2, indices=diff_indices, fg=color, end='...
Highlight the characters in s2 that differ from those in s1.
def draw_peaks_inverted(self, x, peaks, line_color): y1 = self.image_height * 0.5 - peaks[0] * (self.image_height - 4) * 0.5 y2 = self.image_height * 0.5 - peaks[1] * (self.image_height - 4) * 0.5 if self.previous_y and x < self.image_width - 1: if y1 < y2: self.draw....
Draw 2 inverted peaks at x
def update(self, of): for p in ('mime_type', 'preference', 'state', 'hash', 'modified', 'size', 'contents', 'source_hash', 'data'): setattr(self, p, getattr(of, p)) return self
Update a file from another file, for copying
def scale_rc(self, servo, min, max, param): min_pwm = self.get_mav_param('%s_MIN' % param, 0) max_pwm = self.get_mav_param('%s_MAX' % param, 0) if min_pwm == 0 or max_pwm == 0: return 0 if max_pwm == min_pwm: p = 0.0 else: p = (servo-min_pw...
scale a PWM value
def decamelise(text): s = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', text) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s).lower()
Convert CamelCase to lower_and_underscore.
def triangle_wave(frequency): xs = tf.reshape(tf.range(_samples(), dtype=tf.float32), [1, _samples(), 1]) ts = xs / FLAGS.sample_rate half_pulse_index = ts * (frequency * 2) half_pulse_angle = half_pulse_index % 1.0 absolute_amplitude = (0.5 - tf.abs(half_pulse_angle - 0.5)) / 0.5 half_pulse_parity = tf.sig...
Emit a triangle wave at the given frequency.
def param(self,key,default=None): if key in self.parameters: return self.parameters[key] return default
for accessing global parameters
def derive_container_context(self, ion_type, whence): if ion_type is IonType.STRUCT: container = _C_STRUCT elif ion_type is IonType.LIST: container = _C_LIST elif ion_type is IonType.SEXP: container = _C_SEXP else: raise TypeError('Cannot d...
Derives a container context as a child of the current context.
def _patched_pep257(): import pep257 if getattr(pep257, "log", None): def _dummy(*args, **kwargs): del args del kwargs old_log_info = pep257.log.info pep257.log.info = _dummy try: yield finally: if getattr(pep257, "log", None): ...
Monkey-patch pep257 after imports to avoid info logging.
def _setup_user_dir(self): user_dir = self._get_user_dir_path() rules_dir = user_dir.joinpath('rules') if not rules_dir.is_dir(): rules_dir.mkdir(parents=True) self.user_dir = user_dir
Returns user config dir, create it when it doesn't exist.
def reversal_circuit(qubits: Qubits) -> Circuit: N = len(qubits) circ = Circuit() for n in range(N // 2): circ += SWAP(qubits[n], qubits[N-1-n]) return circ
Returns a circuit to reverse qubits
def create_web_element(self, element_id): return self._web_element_cls(self, element_id, w3c=self.w3c)
Creates a web element with the specified `element_id`.
def classify(self, peer_dir_meta): assert self.classification is None peer_entry_meta = None if peer_dir_meta: peer_entry_meta = peer_dir_meta.get(self.name, False) if self.is_dir(): if peer_entry_meta: self.classification = "unmodified...
Classify this entry as 'new', 'unmodified', or 'modified'.
def contrast_rms(data, *kwargs): av = np.average(data, *kwargs) mal = 1 / (data.shape[0] * data.shape[1]) return np.sqrt(mal * np.sum(np.square(data - av)))
Compute RMS contrast norm of an image
def red_workshift(request, message=None): if message: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('workshift:view_semester'))
Redirects to the base workshift page for users who are logged in
def enter_config_value(self, key, default=""): value = input('Please enter a value for ' + key + ': ') if value: return value else: return default
Prompts user for a value
def select_subprotocol(self, subprotocols): if isinstance(subprotocols, list) and subprotocols: self.log.info('Client sent subprotocols: {}'.format(subprotocols)) return subprotocols[0] return super().select_subprotocol(subprotocols)
Select a single Sec-WebSocket-Protocol during handshake.
def check_python_architecture(pythondir, target_arch_str): pyth_str = subprocess.check_output( [pythondir + 'python', '-c', 'import platform; print platform.architecture()[0]']) if pyth_str[:2] != target_arch_str: raise Exception( "Wrong architecture of target python. Expect...
functions check architecture of target python
def send(self, obj): assert isinstance(obj, ProtocolBase) string = pickle.dumps(obj) length = len(string) self.sock.sendall(struct.pack("<I", length) + string)
Prepend a 4-byte length to the string
def creep_data(data_set='creep_rupture'): if not data_available(data_set): download_data(data_set) path = os.path.join(data_path, data_set) tar_file = os.path.join(path, 'creeprupt.tar') tar = tarfile.open(tar_file) print('Extracting file.') tar.extractall(path=path) ...
Brun and Yoshida's metal creep rupture data.
def progress(byte, total, extra=""): if total == 0: progresstr = "Downloaded %dkB bytes" % (byte >> 10) progress_stream.write(progresstr + '\r') return progressbar(total, byte, extra)
Print some info about how much we have downloaded
def write_tsv_line_from_list(linelist, outfp): line = '\t'.join(linelist) outfp.write(line) outfp.write('\n')
Utility method to convert list to tsv line with carriage return
def pack_ihex(type_, address, size, data): line = '{:02X}{:04X}{:02X}'.format(size, address, type_) if data: line += binascii.hexlify(data).decode('ascii').upper() return ':{}{:02X}'.format(line, crc_ihex(line))
Create a Intel HEX record of given data.
def _parseSections(self, data, elfHeader): offset = elfHeader.header.e_shoff shdrs = [] for i in range(elfHeader.header.e_shnum): shdr = self.__classes.SHDR.from_buffer(data, offset) section_bytes = None ba_section_bytes = None if shdr.sh_type != S...
Returns a list of sections
def ifdel(self, iff): new_routes = [] for rt in self.routes: if rt[3] != iff: new_routes.append(rt) self.invalidate_cache() self.routes = new_routes
removes all route entries that uses 'iff' interface.
def attach(self, stdout=True, stderr=True, stream=True, logs=False): try: data = parse_stream(self.client.attach(self.id, stdout, stderr, stream, logs)) except KeyboardInterrupt: logger.warning( "service container: {0} has been interrupted. " "The ...
Keeping this simple until we need to extend later.
def create_uinput_device(mapping): if mapping not in _mappings: raise DeviceError("Unknown device mapping: {0}".format(mapping)) try: mapping = _mappings[mapping] device = UInputDevice(mapping) except UInputError as err: raise DeviceError(err) return device
Creates a uinput device.
def target_timestamp(self) -> datetime: timestamp = DB.get_hash_value(self._key, 'target_timestamp') return datetime_from_isoformat(timestamp)
Get the target state timestamp.
def append(self, el): if self.value is None: self.value = [el] else: self.value.append(el)
Idiosynractic method for adding an element to a list
def _get_command_templates(command_tokens, files=[], paths=[], job_options=[], count=1): if not command_tokens: return [] comment_tokens, command_token = command_tokens.pop() parts = [] parts += job_options + _get_comments(comment_tokens) for part in command_token[0]: try: ...
Reversivly create command templates.
def getAllSecrets(version="", region=None, table="credential-store", context=None, credential=None, session=None, **kwargs): if session is None: session = get_session(**kwargs) dynamodb = session.resource('dynamodb', region_name=region) kms = session.client('kms', region_name=regio...
fetch and decrypt all secrets
def spread_value(value: Decimal, spread_p: Decimal) -> Tuple[Decimal, Decimal]: upper = value * (1 + spread_p) lower = value / (1 + spread_p) return lower, upper
Returns a lower and upper value separated by a spread percentage
def preprocess(net, image): return np.float32(np.rollaxis(image, 2)[::-1]) - net.transformer.mean["data"]
convert to Caffe input image layout
def redirect_logging(tqdm_obj, logger=logging.getLogger()): assert(len(logger.handlers) == 1) prev_handler = logger.handlers[0] logger.removeHandler(prev_handler) tqdm_handler = TqdmLoggingHandler(tqdm_obj) if prev_handler.formatter is not None: tqdm_handler.setFormatter(prev_handler.formatter) logger.a...
Context manager to redirect logging to a TqdmLoggingHandler object and then restore the original.
def describe(self): for stage, corunners in self.get_deployers(): print self.name, "STAGE ", stage for d in corunners: print d.__class__.__name__, ",".join( [p[1].__name__ for p in d.phases] )
Iterates through the deployers but doesn't run anything
def start(self): while not self.is_start(self.current_tag): self.next() self.new_entry()
Find the first data entry and prepare to parse.
def _check_format(format_str): if not isinstance(format_str, (_unicode, str)): raise TypeError("Invalid format: {0!r}".format(format_str)) try: format_int = _formats[format_str.upper()] except KeyError: raise ValueError("Unknown format: {0!r}".format(format_str)) return format_in...
Check if `format_str` is valid and return format ID.
def stop(cls): if any(cls.streams): sys.stdout = cls.streams.pop(-1) else: sys.stdout = sys.__stdout__
Change back the normal stdout after the end
def _validate_install(self): from subprocess import check_output, STDOUT sys_command = 'docker --help' try: check_output(sys_command, shell=True, stderr=STDOUT).decode('utf-8') except Exception as err: raise Exception('"docker" not installed. GoTo: https://w...
a method to validate docker is installed
def update_progress(opts, progress, progress_iter, out): try: progress_outputter = salt.loader.outputters(opts)[out] except KeyError: log.warning('Progress outputter not available.') return False progress_outputter(progress, progress_iter)
Update the progress iterator for the given outputter
def remove_draft_child(self): if self.draft_child: with db.session.begin_nested(): super(PIDNodeVersioning, self).remove_child(self.draft_child, reorder=True)
Remove the draft child from versioning.
def _tryMatch(self, textToMatchObject): if self.wordStart and \ (not textToMatchObject.isWordStart): return None if self.lineStart and \ textToMatchObject.currentColumnIndex > 0: return None if self.dynamic: string = self._makeDynamic...
Tries to parse text. If matched - saves data for dynamic context
def save(self): while True: username = sha1(str(random.random()).encode('utf-8')).hexdigest()[:5] try: get_user_model().objects.get(username__iexact=username) except get_user_model().DoesNotExist: break self.cleaned_data['username'] = username ...
Generate a random username before falling back to parent signup form
def _parse_engine(engine): engine = (engine or '').strip() backend, path = URI_RE.match(engine).groups() if backend not in SUPPORTED_BACKENDS: raise NotImplementedError( "Logg supports only {0} for now.".format(SUPPORTED_BACKENDS)) log.debug('Found engine: {0}...
Parse the engine uri to determine where to store loggs
def paths_in_directory(input_directory): paths = [] for base_path, directories, filenames in os.walk(input_directory): relative_path = os.path.relpath(base_path, input_directory) path_components = relative_path.split(os.sep) if path_components[0] == ".": path_components = pat...
Generate a list of all files in input_directory, each as a list containing path components.
def request(self, *args, **kwargs): func = partial(super().request, *args, **kwargs) return self.loop.run_in_executor(self.thread_pool, func)
Partial original request func and run it in a thread.
def parse_db_url(db_url): u = urlparse(db_url) db = {} db["database"] = u.path[1:] db["user"] = u.username db["password"] = u.password db["host"] = u.hostname db["port"] = u.port return db
provided a db url, return a dict with connection properties
def change_default_radii(def_map): s = current_system() rep = current_representation() rep.radii_state.default = [def_map[t] for t in s.type_array] rep.radii_state.reset()
Change the default radii
def feed_batch(self, batch_info, data, target): data, target = data.to(self.device), target.to(self.device) output, loss = self.model.loss(data, target) batch_info['data'] = data batch_info['target'] = target batch_info['output'] = output batch_info['loss'] = loss ...
Run single batch of data
def handle_event(self, message): needs_update = 0 for zone in self.zones: if zone in message: _LOGGER.debug("Received message for zone: %s", zone) self.zones[zone].update_status(message[zone]) if 'netusb' in message: needs_update += self.ha...
Dispatch all event messages
def _get_bridge_name(self): command = ovs_vsctl.VSCtlCommand( 'find', ('Bridge', 'datapath_id=%s' % dpid_lib.dpid_to_str(self.datapath_id))) self.run_command([command]) if not isinstance(command.result, list) or len(command.result) != 1: raise OVS...
get Bridge name of a given 'datapath_id'
def _get_desktop_size(): if platform.system() == "Linux": try: xrandr_query = subprocess.check_output(["xrandr", "--query"]) sizes = re.findall(r"\bconnected primary (\d+)x(\d+)", str(xrandr_query)) if sizes[0]: return point.Point(int(sizes[0][0]), int(sizes[0][1])) except: log...
Get the desktop size.
def delete_ipsec_site_connection(self, ipsec_site_connection): ipsec_site_connection_id = self._find_ipsec_site_connection_id( ipsec_site_connection) ret = self.network_conn.delete_ipsec_site_connection( ipsec_site_connection_id) return ret if ret else True
Deletes the specified IPsecSiteConnection
async def async_current_transfer_human_readable( self, use_cache=True): rx, tx = await self.async_get_current_transfer_rates(use_cache) return "%s/s" % convert_size(rx), "%s/s" % convert_size(tx)
Gets current transfer rates in a human readable format.
def execute(self): def is_cc(source): _, ext = os.path.splitext(source) return ext in self.get_options().cc_extensions targets = self.context.targets(self.is_cpp) with self.invalidated(targets, invalidate_dependents=True) as invalidation_check: obj_mapping = self.context.products.get('objs...
Compile all sources in a given target to object files.
def __could_edit(self, slug): page_rec = MWiki.get_by_uid(slug) if not page_rec: return False if self.check_post_role()['EDIT']: return True elif page_rec.user_name == self.userinfo.user_name: return True else: return False
Test if the user could edit the page.
def decode(self, data, delimiter=';'): try: list_data = data.rstrip().split(delimiter) self.payload = list_data.pop() (self.node_id, self.child_id, self.type, self.ack, self.sub_type) = [int(f) for f in list_data] ex...
Decode a message from command string.
def free_processed_queue(self): with self._lock: if len(self._processed_coordinators) > 0: for _coordinator in self._processed_coordinators: _coordinator.free_resources() self._processed_coordinators = []
call the Aspera sdk to freeup resources
def _cli_helper_dedicated_host(env, result, table): dedicated_host_id = utils.lookup(result, 'dedicatedHost', 'id') if dedicated_host_id: table.add_row(['dedicated_host_id', dedicated_host_id]) try: dedicated_host = env.client.call('Virtual_DedicatedHost', 'getObject', ...
Get details on dedicated host for a virtual server.
def safe_json_response(method): def _safe_document(document): assert isinstance(document, dict), 'Error: provided document is not of DICT type: {0}' \ .format(document.__class__.__name__) for key, value in document.items(): if isinstance(value, dict): document...
makes sure the response' document has all leaf-fields converted to string
def i3(): install_package('i3') install_file_legacy(path='~/.i3/config', username=env.user, repos_dir='repos') install_packages(['make', 'pkg-config', 'gcc', 'libc6-dev', 'libx11-dev']) checkup_git_repo_legacy(url='https://github.com/aktau/hhpc.git') run('cd ~/repos/hhpc && make')
Install and customize the tiling window manager i3.
def task_property_present_predicate(service, task, prop): try: response = get_service_task(service, task) except Exception as e: pass return (response is not None) and (prop in response)
True if the json_element passed is present for the task specified.
def _start_dequeue_thread(self): self._dequeueThread = Thread(target=self._dequeue_function) self._dequeueThread.daemon = True self._dequeueThread.start()
Internal method to start dequeue thread.
def plot_data(self): self.ax.cla() if self.sample is None: return if self.current_channels is None: self.current_channels = self.sample.channel_names[:2] channels = self.current_channels channels_to_plot = channels[0] if len(channels) == 1 else channels ...
Plots the loaded data
def register(self, collector): with self._lock: names = self._get_names(collector) duplicates = set(self._names_to_collectors).intersection(names) if duplicates: raise ValueError( 'Duplicated timeseries in CollectorRegistry: {0}'.format( ...
Add a collector to the registry.
def tfms_from_stats(stats, sz, aug_tfms=None, max_zoom=None, pad=0, crop_type=CropType.RANDOM, tfm_y=None, sz_y=None, pad_mode=cv2.BORDER_REFLECT, norm_y=True, scale=None): if aug_tfms is None: aug_tfms=[] tfm_norm = Normalize(*stats, tfm_y=tfm_y if norm_y else TfmType.NO) if stats is not No...
Given the statistics of the training image sets, returns separate training and validation transform functions
def stop(self, reason=''): key = '/status/sessions/terminate?sessionId=%s&reason=%s' % (self.session[0].id, quote_plus(reason)) return self._server.query(key)
Stop playback for a media item.
def CheckEmails(self, checkTypo=False, fillWrong=True): self.wrong_emails = [] for email in self.emails: if self.CheckEmail(email, checkTypo) is False: self.wrong_emails.append(email)
Checks Emails in List Wether they are Correct or not
def decimal_to_dms(value, precision): deg = math.floor(value) min = math.floor((value - deg) * 60) sec = math.floor((value - deg - min / 60) * 3600 * precision) return ((deg, 1), (min, 1), (sec, precision))
Convert decimal position to degrees, minutes, seconds in a fromat supported by EXIF
def addEmptyTab(self, text=''): tab = self.defaultTabWidget() c = self.count() self.addTab(tab, text) self.setCurrentIndex(c) if not text: self.tabBar().editTab(c) self.sigTabAdded.emit(tab) return tab
Add a new DEFAULT_TAB_WIDGET, open editor to set text if no text is given
def insertFeatureSet(self, featureSet): try: models.Featureset.create( id=featureSet.getId(), datasetid=featureSet.getParentContainer().getId(), referencesetid=featureSet.getReferenceSet().getId(), ontologyid=featureSet.getOntology().ge...
Inserts a the specified featureSet into this repository.
def schedule(self, node_key, parent, depth, leaf_callback, is_raw=False): if node_key in self._existing_nodes: self.logger.debug("Node %s already exists in db" % encode_hex(node_key)) return if node_key in self.db: self._existing_nodes.add(node_key) self.l...
Schedule a request for the node with the given key.
def filter(self, criteria: Q, offset: int = 0, limit: int = 10, order_by: list = ()): if criteria.children: items = list(self._filter(criteria, self.conn['data'][self.schema_name]).values()) else: items = list(self.conn['data'][self.schema_name].values()) for o_key in ord...
Read the repository and return results as per the filer
def _makeResult(self): return [reporter(self.stream, self.descriptions, self.verbosity) for reporter in self.resultclass]
instantiates the result class reporters
def add_site_states(self, site, states): for state in states: if state not in self.site_states[site]: self.site_states[site].append(state)
Create new states on an agent site if the state doesn't exist.
def save_image_as_pdf(self, filename, data=None, max_levels=None): "Write the heap as PDF file." assert (max_levels is None) or (max_levels >= 0) import os if not filename.endswith('.pdf'): filename = filename+'.pdf' tmpfd, tmpname = tempfile.mkstemp(suffix='dot') ...
Write the heap as PDF file.
def _check_input(image, init_level_set): if not image.ndim in [2, 3]: raise ValueError("`image` must be a 2 or 3-dimensional array.") if len(image.shape) != len(init_level_set.shape): raise ValueError("The dimensions of the initial level set do not " "match the dimension...
Check that shapes of `image` and `init_level_set` match.
def _pretty_print_event(event, colored): event.timestamp = colored.yellow(event.timestamp) event.log_stream_name = colored.cyan(event.log_stream_name) return ' '.join([event.log_stream_name, event.timestamp, event.message])
Basic formatter to convert an event object to string
def hasnew(self,allowempty=False): for e in self.select(New,None,False, False): if not allowempty and len(e) == 0: continue return True return False
Does the correction define new corrected annotations?
def strip_datetime(value): if isinstance(value, basestring): try: return parse_datetime(value) except ValueError: return elif isinstance(value, integer_types): try: return datetime.datetime.utcfromtimestamp(value / 1e3) ...
Converts value to datetime if string or int.
def arc_negative(self, x, y, radius, start_angle, end_angle): self._add_instruction("arc_negative", x, y, radius, start_angle, end_angle)
draw arc going clockwise from start_angle to end_angle
def echo(self, message, *, encoding=_NOTSET): return self.execute('ECHO', message, encoding=encoding)
Echo the given string.
def run_validators(self, value): errors = [] for validator in self.validators: try: validator(value) except ValidationError as error: errors.extend(error.messages) if errors: raise ValidationError(errors)
Run the validators on the setting value.
def pause(env, identifier): vsi = SoftLayer.VSManager(env.client) vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS') if not (env.skip_confirmations or formatting.confirm('This will pause the VS with id %s. Continue?' % vs_id)): raise exceptions.C...
Pauses an active virtual server.
def central_vertices(self): max_distances = self.distances.max(0) max_distances_min = max_distances[max_distances > 0].min() return (max_distances == max_distances_min).nonzero()[0]
Vertices that have the lowest maximum distance to any other vertex
def update_request_setting(self, service_id, version_number, name_key, **kwargs): body = self._formdata(kwargs, FastlyHealthCheck.FIELDS) content = self._fetch("/service/%s/version/%d/request_settings/%s" % (service_id, version_number, name_key), method="PUT", body=body) return FastlyRequestSetting(self, content)
Updates the specified Request Settings object.