code
stringlengths
1
18.2k
def contains_repository(cls, context, directory): """Check whether the given directory contains a local repository.""" directory = cls.get_vcs_directory(context, directory) return context.is_file(os.path.join(directory, 'config'))
def get_vcs_directory(context, directory): """Get the pathname of the directory containing the version control metadata files.""" nested = os.path.join(directory, '.git') return nested if context.is_directory(nested) else directory
def current_branch(self): """The name of the branch that's currently checked out in the working tree (a string or :data:`None`).""" output = self.context.capture('git', 'rev-parse', '--abbrev-ref', 'HEAD', check=False, silent=True) return output if output != 'HEAD' else None
def is_clean(self): """ :data:`True` if the working tree (and index) is clean, :data:`False` otherwise. The implementation of :attr:`GitRepo.is_clean` checks whether ``git diff`` reports any differences. This command has several variants: 1. ``git diff`` shows the difference between the index and working tree. 2. ``git...
listing = self.context.capture('git', 'diff', 'HEAD', check=False, silent=True) return len(listing.splitlines()) == 0
def known_remotes(self): """The names of the configured remote repositories (a list of :class:`.Remote` objects).""" objects = [] for line in self.context.capture('git', 'remote', '--verbose').splitlines(): tokens = line.split() if len(tokens) >= 2: name = tokens[0] objects.append(Remote( default=(name == 'origin'), lo...
def merge_conflicts(self): """The filenames of any files with merge conflicts (a list of strings).""" filenames = set() listing = self.context.capture('git', 'ls-files', '--unmerged', '-z') for entry in split(listing, '\0'): # The output of `git ls-files --unmerged -z' consists of two # tab-delimited fields per zero-by...
def expand_branch_name(self, name): """ Expand branch names to their unambiguous form. :param name: The name of a local or remote branch (a string). :returns: The unambiguous form of the branch name (a string). This internal method is used by methods like :func:`find_revision_id()` and :func:`find_revision_number()` to...
name exactly matches the name # given by the caller then we consider the argument given by # the caller unambiguous. logger.debug("Branch name %r matches local branch.", name) return name # Check for an exact match against a remote branch. for prefix, other_name, revision_id in branches: if prefix.startswith('refs/remo...
out of # conservativeness, with the goal of trying to guarantee # backwards compatibility. logger.debug("Failed to expand branch name %r.", name) return name
def find_author(self): """Get the author information from the version control system.""" return Author(name=self.context.capture('git', 'config', 'user.name', check=False, silent=True), email=self.context.capture('git', 'config', 'user.email', check=False, silent=True))
def find_branches(self): """Find information about the branches in the repository.""" for prefix, name, revision_id in self.find_branches_raw(): yield Revision( branch=name, repository=self, revision_id=revision_id, )
def find_branches_raw(self): """Find information about the branches in the repository.""" listing = self.context.capture('git', 'for-each-ref', '--format=%(refname)\t%(objectname)') for line in listing.splitlines(): match = FOR_EACH_REF_PATTERN.match(line) if match and match.group('name') != 'HEAD': yield (match.group(...
def find_revision_id(self, revision=None): """Find the global revision id of the given revision.""" # Make sure the local repository exists. self.create() # Try to find the revision id of the specified revision. revision = self.expand_branch_name(revision) output = self.context.capture('git', 'rev-parse', revision) # V...
def find_revision_number(self, revision=None): """Find the local revision number of the given revision.""" # Make sure the local repository exists. self.create() # Try to find the revision number of the specified revision. revision = self.expand_branch_name(revision) output = self.context.capture('git', 'rev-list', rev...
def find_tags(self): """Find information about the tags in the repository.""" listing = self.context.capture('git', 'show-ref', '--tags', check=False) for line in listing.splitlines(): tokens = line.split() if len(tokens) >= 2 and tokens[1].startswith('refs/tags/'): yield Revision( repository=self, revision_id=tokens[0...
def get_add_files_command(self, *filenames): """Get the command to include added and/or removed files in the working tree in the next commit.""" command = ['git', 'add'] if filenames: command.append('--') command.extend(filenames) else: command.extend(('--all', '.')) return command
def get_commit_command(self, message, author=None): """Get the command to commit changes to tracked files in the working tree.""" command = ['git'] if author: command.extend(('-c', 'user.name=%s' % author.name)) command.extend(('-c', 'user.email=%s' % author.email)) command.append('commit') command.append('--all') comm...
def get_create_command(self): """Get the command to create the local repository.""" command = ['git', 'clone' if self.remote else 'init'] if self.bare: command.append('--bare') if self.remote: command.append(self.remote) command.append(self.local) return command
def get_export_command(self, directory, revision): """Get the command to export the complete tree from the local repository.""" shell_command = 'git archive %s | tar --extract --directory=%s' return [shell_command % (quote(revision), quote(directory))]
def get_merge_command(self, revision): """Get the command to merge a revision into the current branch (without committing the result).""" return [ 'git', '-c', 'user.name=%s' % self.author.name, '-c', 'user.email=%s' % self.author.email, 'merge', '--no-commit', '--no-ff', revision, ]
def get_pull_command(self, remote=None, revision=None): """ Get the command to pull changes from a remote repository into the local repository. When you pull a specific branch using git, the default behavior is to pull the change sets from the remote branch into the local repository and merge them into the *currently c...
assumed to be a branch name and git is instructed to pull the change sets from the remote branch into a local branch with the same name. .. warning:: The logic described above will undoubtedly break when `revision` is given but is not a branch name. I'd fix this if I knew how to, but I don't... """ if revision: revisio...
def get_push_command(self, remote=None, revision=None): """Get the command to push changes from the local repository to a remote repository.""" # TODO What about tags? command = ['git', '-c', 'push.default=matching', 'push'] if remote or revision: command.append(remote or 'origin') if revision: command.append(revision)...
def new(cls, settings, *args, **kwargs): """ Create a new Cloud instance based on the Settings """ logger.debug('Initializing new "%s" Instance object' % settings['CLOUD']) cloud = settings['CLOUD'] if cloud == 'bare': self = BareInstance(settings=settings, *args, **kwargs) elif cloud == 'aws': self = AWSInstance(setti...
def initialise_loggers(names, log_level=_builtin_logging.WARNING, handler_class=SplitStreamHandler): """ Initialises specified loggers to generate output at the specified logging level. If the specified named loggers do not exist, they are created. :type names: :obj:`list` of :obj:`str` :param names: List of logger nam...
def emit(self, record): """ Mostly copy-paste from :obj:`logging.StreamHandler`. """ try: msg = self.format(record) if record.levelno < self.splitLevel: stream = self.outStream else: stream = self.errStream fs = "%s\n" try: if (isinstance(msg, unicode) and # noqa: F405 getattr(stream, 'encoding', None)): ufs = fs.decod...
def flush(self): """ Flushes the stream. """ self.acquire() try: if self.outStream and hasattr(self.outStream, "flush"): self.outStream.flush() if self.errStream and hasattr(self.errStream, "flush"): self.errStream.flush() finally: self.release()
def emit(self, record): """ Emit a record. If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an 'encoding' attr...
def close(self): """Shut down the socket connection, client and controller""" self._sock = None self._controller = None if hasattr(self, "_port") and self._port: portpicker.return_port(self._port) self._port = None
def connect(self, url=c.LOCALHOST, port=None, timeout=c.INITIAL_TIMEOUT, debug=False): """socket connect to an already running starcraft2 process""" if port != None: # force a selection to a new port if self._port!=None: # if previously allocated port, return it portpicker.return_port(self._port) self._port = port elif...
# data_build: 60604 # base_build: 60321 return self except socket.error: pass # SC2 hasn't started listening yet. except websocket.WebSocketException as err: print(err, type(err)) if "Handshake Status 404" in str(err): pass # SC2 is listening, but hasn't set up the /sc2api endpoint yet. else: raise except Exception as ...
def debug(self, *debugReqs): """send a debug command to control the game state's setup""" return self._client.send(debug=sc2api_pb2.RequestDebug(debug=debugReqs))
def submit(self, command="", blocksize=1, job_name="parsl.auto"): ''' The submit method takes the command string to be executed upon instantiation of a resource most often to start a pilot. Args : - command (str) : The bash command string to be executed. - blocksize (int) : Blocksize to be requested KWargs: - job_name ...
def unpack(rv): """Unpack the response from a view. :param rv: the view response :type rv: either a :class:`werkzeug.wrappers.Response` or a tuple of (data, status_code, headers) """ if isinstance(rv, ResponseBase): return rv status = headers = None if isinstance(rv, tuple): rv, status, headers = rv + (None,) * (3 - le...
def init_app(self, app): """Initialize actions with the app or blueprint. :param app: the Flask application or blueprint object :type app: :class:`~flask.Flask` or :class:`~flask.Blueprint` Examples:: api = Api() api.add_resource(...) api.init_app(blueprint) """ try: # Assume this is a blueprint and defer initializatio...
def _init_app(self, app): """Initialize actions with the given :class:`flask.Flask` object. :param app: The flask application object :type app: :class:`~flask.Flask` """ for resource, urls, kwargs in self.resources: self._register_view(app, resource, *urls, **kwargs)
def _deferred_blueprint_init(self, setup_state): """Bind resources to the app as recorded in blueprint. Synchronize prefix between blueprint/api and registration options, then perform initialization with setup_state.app :class:`flask.Flask` object. When a :class:`flask.ext.resteasy.Api` object is initialized with a blu...
def _register_view(self, app, resource, *urls, **kwargs): """Bind resources to the app. :param app: an actual :class:`flask.Flask` app :param resource: :param urls: :param endpoint: endpoint name (defaults to :meth:`Resource.__name__.lower` Can be used to reference this route in :meth:`flask.url_for` :type endpoint: st...
self.decorators): resource_func = decorator(resource_func) for url in urls: rule = self._make_url(url, self.blueprint.url_prefix if self.blueprint else None) # If this Api has a blueprint if self.blueprint: # And this Api has been setup if self.blueprint_setup: # Set the rule to a string directly, as the blueprint # is...
the url to the application or blueprint app.add_url_rule(rule, view_func=resource_func, **kwargs)
def _add_url_rule_patch(blueprint_setup, rule, endpoint=None, view_func=None, **options): """Patch BlueprintSetupState.add_url_rule for delayed creation. Method used for setup state instance corresponding to this Api instance. Exists primarily to enable _make_url's function. :param blueprint_setup: The BlueprintSetupSt...
def output(self, resource): """Wrap a resource (as a flask view function). This is for cases where the resource does not directly return a response object. Now everything should be a Response object. :param resource: The resource as a flask view function """ @wraps(resource) def wrapper(*args, **kwargs): rv = resource(...
def _make_url(self, url_part, blueprint_prefix): """Create URL from blueprint_prefix, api prefix and resource url. This method is used to defer the construction of the final url in the case that the Api is created with a Blueprint. :param url_part: The part of the url the endpoint is registered with :param blueprint_pr...
def url_for(self, resource, **kwargs): """Create a url for the given resource. :param resource: The resource :type resource: :class:`Resource` :param kwargs: Same arguments you would give :class:`flask.url_for` """ if self.blueprint: return flask.url_for('.' + resource.endpoint, **kwargs) return flask.url_for(resource....
def emit(only=None, return_vars=None, namespace=None, sender=None, post_result_name='result', capture_result=True): """Decorator to mark a method or function as a signal emitter:: @blinker_herald.emit() def create(self, value1, value2): return client.do.a.create.post.return.object() The above will cause that method to ...
'post': ['var2']} if variable is not found it defaults to None :param namespace: If not specified namespace will be default :param sender: Object or String to be the sender, if not specified the first method parameter will be used (commonly self) :param post_result_name: the name of the result variable e.g: result :par...
None and action != only: return sig_name = '{0}_{1}'.format(action, fname) send_return_vars = return_vars.get(action) result = kw.pop(post_result_name, None) kw.update(inspect.getcallargs(fn, *a, **kw)) sendkw = {k: v for k, v in kw.items() if k in (send_return_vars or kw.keys())} sendkw['signal_emitter'] = sendkw.pop(...
def deploy(self, job_name, command='', blocksize=1): instances = [] """Deploy the template to a resource group.""" self.client.resource_groups.create_or_update( self.resource_group, { 'location': self.location, } ) template_path = os.path.join(os.path.dirname( __file__), 'templates', 'template.json') with open(template...
def destroy(self, job_ids): """Destroy the given resource group""" for job_id in job_ids: self.client.resource_groups.delete(self.resource_group)
def get_vm(self, resource_group_name, vm_name): ''' you need to retry this just in case the credentials token expires, that's where the decorator comes in this will return all the data about the virtual machine ''' return self.client.virtual_machines.get( resource_group_name, vm_name, expand='instanceView')
def get_vm_status(self, vm_name, rgn): ''' this will just return the status of the virtual machine sometime the status may be unknown as shown by the azure portal; in that case statuses[1] doesn't exist, hence retrying on IndexError also, it may take on the order of minutes for the status to become available so the dec...
def _retrieve_cached_zone_variable(self, zone_id, name): """ Retrieves the cache state of the named variable for a particular zone. If the variable has not been cached then the UncachedVariable exception is raised. """ try: s = self._zone_state[zone_id][name.lower()] logger.debug("Zone Cache retrieve %s.%s = %s", zone_...
def _store_cached_zone_variable(self, zone_id, name, value): """ Stores the current known value of a zone variable into the cache. Calls any zone callbacks. """ zone_state = self._zone_state.setdefault(zone_id, {}) name = name.lower() zone_state[name] = value logger.debug("Zone Cache store %s.%s = %s", zone_id.device_s...
def _retrieve_cached_source_variable(self, source_id, name): """ Retrieves the cache state of the named variable for a particular source. If the variable has not been cached then the UncachedVariable exception is raised. """ try: s = self._source_state[source_id][name.lower()] logger.debug("Source Cache retrieve S[%d]....
def _store_cached_source_variable(self, source_id, name, value): """ Stores the current known value of a source variable into the cache. Calls any source callbacks. """ source_state = self._source_state.setdefault(source_id, {}) name = name.lower() source_state[name] = value logger.debug("Source Cache store S[%d].%s = ...
def connect(self): """ Connect to the controller and start processing responses. """ logger.info("Connecting to %s:%s", self._host, self._port) reader, writer = yield from asyncio.open_connection( self._host, self._port, loop=self._loop) self._ioloop_future = ensure_future( self._ioloop(reader, writer), loop=self._loop...
def close(self): """ Disconnect from the controller. """ logger.info("Closing connection to %s:%s", self._host, self._port) self._ioloop_future.cancel() try: yield from self._ioloop_future except asyncio.CancelledError: pass
def set_zone_variable(self, zone_id, variable, value): """ Set a zone variable to a new value. """ return self._send_cmd("SET %s.%s=\"%s\"" % ( zone_id.device_str(), variable, value))
def get_zone_variable(self, zone_id, variable): """ Retrieve the current value of a zone variable. If the variable is not found in the local cache then the value is requested from the controller. """ try: return self._retrieve_cached_zone_variable(zone_id, variable) except UncachedVariable: return (yield from self._sen...
def get_cached_zone_variable(self, zone_id, variable, default=None): """ Retrieve the current value of a zone variable from the cache or return the default value if the variable is not present. """ try: return self._retrieve_cached_zone_variable(zone_id, variable) except UncachedVariable: return default
def watch_zone(self, zone_id): """ Add a zone to the watchlist. Zones on the watchlist will push all state changes (and those of the source they are currently connected to) back to the client """ r = yield from self._send_cmd( "WATCH %s ON" % (zone_id.device_str(), )) self._watched_zones.add(zone_id) return r
def unwatch_zone(self, zone_id): """ Remove a zone from the watchlist. """ self._watched_zones.remove(zone_id) return (yield from self._send_cmd("WATCH %s OFF" % (zone_id.device_str(), )))
def send_zone_event(self, zone_id, event_name, *args): """ Send an event to a zone. """ cmd = "EVENT %s!%s %s" % ( zone_id.device_str(), event_name, " ".join(str(x) for x in args)) return (yield from self._send_cmd(cmd))
def enumerate_zones(self): """ Return a list of (zone_id, zone_name) tuples """ zones = [] for controller in range(1, 8): for zone in range(1, 17): zone_id = ZoneID(zone, controller) try: name = yield from self.get_zone_variable(zone_id, 'name') if name: zones.append((zone_id, name)) except CommandException: break retu...
def set_source_variable(self, source_id, variable, value): """ Change the value of a source variable. """ source_id = int(source_id) return self._send_cmd("SET S[%d].%s=\"%s\"" % ( source_id, variable, value))
def get_source_variable(self, source_id, variable): """ Get the current value of a source variable. If the variable is not in the cache it will be retrieved from the controller. """ source_id = int(source_id) try: return self._retrieve_cached_source_variable( source_id, variable) except UncachedVariable: return (yield ...
def get_cached_source_variable(self, source_id, variable, default=None): """ Get the cached value of a source variable. If the variable is not cached return the default value. """ source_id = int(source_id) try: return self._retrieve_cached_source_variable( source_id, variable) except UncachedVariable: return default
def watch_source(self, source_id): """ Add a souce to the watchlist. """ source_id = int(source_id) r = yield from self._send_cmd( "WATCH S[%d] ON" % (source_id, )) self._watched_source.add(source_id) return r
def unwatch_source(self, source_id): """ Remove a souce from the watchlist. """ source_id = int(source_id) self._watched_sources.remove(source_id) return (yield from self._send_cmd("WATCH S[%d] OFF" % ( source_id, )))
def enumerate_sources(self): """ Return a list of (source_id, source_name) tuples """ sources = [] for source_id in range(1, 17): try: name = yield from self.get_source_variable(source_id, 'name') if name: sources.append((source_id, name)) except CommandException: break return sources
def from_time(cls, other): """Construct an :class:`nptime` object from a :class:`datetime.time` .. note:: This *ignores* the :class:`datetime.tzinfo` that may be part of the ``time`` object. """ return cls(other.hour, other.minute, other.second, other.microsecond)
def to_timedelta(self): """Construct a :class:`timedelta` object from an :class:`nptime`. The timedelta gives the number of seconds (and microseconds) since midnight.""" return timedelta(hours=self.hour, minutes=self.minute, seconds=self.second, microseconds=self.microsecond)
def set_renderers(self, request=None, context=None, template_name=None, early=False): """ Makes sure that the renderers attribute on the request is up to date. renderers_for_view keeps track of the view that is attempting to render the request, so that if the request has been delegated to another view we know to recalc...
def render(self, request=None, context=None, template_name=None): """ Returns a HttpResponse of the right media type as specified by the request. context can contain status_code and additional_headers members, to set the HTTP status code and headers of the request, respectively. template_name should lack a file-type su...
depending on the accept header. patch_vary_headers(response, ('Accept',)) return response
def join_template_name(self, template_name, extension): """ Appends an extension to a template_name or list of template_names. """ if template_name is None: return None if isinstance(template_name, (list, tuple)): return tuple('.'.join([n, extension]) for n in template_name) if isinstance(template_name, str_types): ret...
def submit(self, command='sleep 1', blocksize=1, job_name="parsl.auto"): """Submit command to an Azure instance. Submit returns an ID that corresponds to the task that was just submitted. Parameters ---------- command : str Command to be invoked on the remote side. blocksize : int Number of blocks requested. job_name :...
def status(self, job_ids): """Get the status of a list of jobs identified by their ids. Parameters ---------- job_ids : list of str Identifiers for the jobs. Returns ------- list of int Status codes for each requested job. """ states = [] statuses = self.deployer.get_vm_status([self.resources.get(job_id) for job_id in ...
def cancel(self, job_ids): """Cancel jobs specified by a list of job ids. Parameters ---------- list of str List of identifiers of jobs which should be canceled. Returns ------- list of bool For each entry, True if the cancel operation is successful, otherwise False. """ for job_id in job_ids: try: self.deployer.destro...
def save_positions(post_data, queryset=None): """ Function to update a queryset of position objects with a post data dict. :post_data: Typical post data dictionary like ``request.POST``, which contains the keys of the position inputs. :queryset: Queryset of the model ``ObjectPosition``. """ if not queryset: queryset = ...
def order_by_position(qs, reverse=False): """Template filter to return a position-ordered queryset.""" if qs: # ATTENTION: Django creates an invalid sql statement if two related # models have both generic positions, so we cannot use # qs.oder_by('generic_position__position') position = 'position' if reverse: position =...
def position_input(obj, visible=False): """Template tag to return an input field for the position of the object.""" if not obj.generic_position.all(): ObjectPosition.objects.create(content_object=obj) return {'obj': obj, 'visible': visible, 'object_position': obj.generic_position.all()[0]}
def position_result_list(change_list): """ Returns a template which iters through the models and appends a new position column. """ result = result_list(change_list) # Remove sortable attributes for x in range(0, len(result['result_headers'])): result['result_headers'][x]['sorted'] = False if result['result_headers'][x...
def register_model_converter(model, name=None, field='pk', base=IntConverter, queryset=None): """ Registers a custom path converter for a model. :param model: a Django model :param str name: name to register the converter as :param str field: name of the lookup field :param base: base path converter, either by name or ...
def login(): " View function which handles an authentication request. " form = LoginForm(request.form) # make sure data are valid, but doesn't validate password is right if form.validate_on_submit(): user = User.query.filter_by(email=form.email.data).first() # we use werzeug to validate user's password if user and user...
def logout(): " View function which handles a logout request. " users.logout() return redirect(request.referrer or url_for(users._login_manager.login_view))
def register(): " Registration Form. " form = RegisterForm(request.form) if form.validate_on_submit(): # create an user instance not yet stored in the database user = User( username=form.username.data, email=form.email.data, pw_hash=form.password.data) # Insert the record in our database and commit it db.session.add(us...
def settings_dir(self): """ Directory that contains the the settings for the project """ path = os.path.join(self.dir, '.dsb') utils.create_dir(path) return os.path.realpath(path)
def read_settings(self): """ Read the "dsbfile" file Populates `self.settings` """ logger.debug('Reading settings from: %s', self.settings_path) self.settings = Settings.from_dsbfile(self.settings_path)
def read_instances(self): """ Read `.dsb/instances.yaml` Populates `self.cluster` """ logger.debug('Reading instances from: %s', self.instances_path) if os.path.exists(self.instances_path): with open(self.instances_path, 'r') as f: list_ = yaml.load(f.read()) self.cluster = Cluster.from_list(list_, settings=self.settin...
def salt(self, module, target='*', args=None, kwargs=None, ssh=False): """ Execute a salt (or salt-ssh) command """ if ssh: return salt.salt_ssh(self, target, module, args, kwargs) else: return salt.salt_master(self, target, module, args, kwargs)
def setup_salt_ssh(self): """ Setup `salt-ssh` """ self.copy_salt_and_pillar() self.create_roster_file() self.salt_ssh_create_dirs() self.salt_ssh_create_master_file()
def salt_ssh_create_dirs(self): """ Creates the `salt-ssh` required directory structure """ logger.debug('Creating salt-ssh dirs into: %s', self.settings_dir) utils.create_dir(os.path.join(self.settings_dir, 'salt')) utils.create_dir(os.path.join(self.settings_dir, 'pillar')) utils.create_dir(os.path.join(self.settings...
def tabulate(json_model): ''' a function to add the tabulate method to a jsonModel object :param json_model: jsonModel object :return: jsonModel object ''' import types from jsonmodel._extensions import tabulate as _tabulate try: from tabulate import tabulate except: import sys print('jsonmodel.extensions.tabulate requ...
def update_xml_element(self): """ Updates the xml element contents to matches the instance contents. :returns: Updated XML element. :rtype: lxml.etree._Element """ if not hasattr(self, 'xml_element'): self.xml_element = etree.Element(self.name, nsmap=NSMAP) if hasattr(self, 'idref'): self.xml_element.set('idref', self....
def update_xml_element(self): """ Updates the xml element contents to matches the instance contents. :returns: Updated XML element. :rtype: lxml.etree._Element """ super(Description, self).update_xml_element() if hasattr(self, 'lang'): self.xml_element.set( '{http://www.w3.org/XML/1998/namespace}lang', self.lang) if ha...
def create(*units): """create this unit within the game as specified""" ret = [] for unit in units: # implemented using sc2simulator.ScenarioUnit x, y = unit.position[:2] pt = Point2D(x=x, y=y) unit.tag = 0 # forget any tag because a new unit will be created new = DebugCommand(create_unit=DebugCreateUnit( unit_type = u...
def modify(*units): """set the unit defined by in-game tag with desired properties NOTE: all units must be owned by the same player or the command fails.""" ret = [] for unit in units: # add one command for each attribute for attr, idx in [("energy", 1), ("life", 2), ("shields", 3)]: # see debug_pb2.UnitValue for enum ...
def wtime_to_minutes(time_string): ''' wtime_to_minutes Convert standard wallclock time string to minutes. Args: - Time_string in HH:MM:SS format Returns: (int) minutes ''' hours, mins, seconds = time_string.split(':') return int(hours) * 60 + int(mins) + 1