Callback for when the version selection has changed

        :param tf: the selected taskfileinfo
        :type tf: :class:`TaskFileInfo` | None
        :returns: None
        :rtype: None
        :raises: None
960165
def asset_taskfile_sel_changed(self, tf):
        
        self.asset_open_pb.setEnabled(bool(tf))
        # only allow new, when there is an asset. if there is an asset, there should always be a task
        enablenew = bool(self.browser.assetbrws.selected_indexes(1)) and self.browser.get_releasetype() == djadapter.RELEASETYPES['work']
        self.asset_save_pb.setEnabled(enablenew)
        self.asset_descriptor_le.setEnabled(enablenew)
        self.asset_comment_pte.setEnabled(enablenew)
        self.update_descriptor_le(self.asset_descriptor_le, tf)
292526
def _is_toc_changed(self, toc_file):
        '''
        
        '''
        fname = '%s.toc' % self.project_name
        if os.path.isfile(fname):
            with open(fname) as fobj:
                if fobj.read() != toc_file:
                    return True
538713
def _update(self, **kwargs):
        '''
        '''

        legacy = kwargs.pop('legacy', False)
        tmos_ver = self._meta_data['bigip']._meta_data['tmos_version']
        self._filter_version_specific_options(tmos_ver, **kwargs)
        if 'Drafts' not in self._meta_data['uri'] and \
                LooseVersion(tmos_ver) >= LooseVersion('12.1.0') and \
                not legacy:
            msg = 'Update operation not allowed on a published policy.'
            raise OperationNotSupportedOnPublishedPolicy(msg)
        super(Policy, self)._update(**kwargs)
115299
def update_changes(changes,newtext,change):
  ""
  # the criteria for a new version are:
  # 1. mode change (modes are adding to end, deleting from end, internal edits)
  # 2. length changed by more than 256 chars (why power of 2? why not)
  # 3. time delta > COMPACTION_TIME_THRESH
  if not changes: return [change] # todo(awinter): needs test case
  if change.utc-changes[-1].utc>COMPACTION_TIME_THRESH:
    changes.append(change)
    return changes
  base=reduce(apply_change,changes[:-1],'')
  final=apply_change(base,changes[-1])
  prev_mode=detect_change_mode(base,changes[-1])
  cur_mode=detect_change_mode(final,change)
  if prev_mode==cur_mode and abs(len(newtext)-len(final)<COMPACTION_LEN_THRESH):
    changes[-1]=mkchange(base,newtext,change.version,change.utc)
  else: changes.append(change)
  return changes
813284
def rollback_lambda_function_version(self, function_name, versions_back=1, publish=True):
        
        response = self.lambda_client.list_versions_by_function(FunctionName=function_name)

        # Take into account $LATEST
        if len(response['Versions']) < versions_back + 1:
            print("We do not have {} revisions. Aborting".format(str(versions_back)))
            return False

        revisions = [int(revision['Version']) for revision in response['Versions'] if revision['Version'] != '$LATEST']
        revisions.sort(reverse=True)

        response = self.lambda_client.get_function(FunctionName='function:{}:{}'.format(function_name, revisions[versions_back]))
        response = requests.get(response['Code']['Location'])

        if response.status_code != 200:
            print("Failed to get version {} of {} code".format(versions_back, function_name))
            return False

        response = self.lambda_client.update_function_code(FunctionName=function_name, ZipFile=response.content, Publish=publish)  # pragma: no cover

        return response['FunctionArn']
755086
private void determineChangesSince(File file, long lastScanTime) {
		try {
			if (GlobalConfiguration.verboseMode && log.isLoggable(Level.INFO)) {
				log.info("Firing file changed event " + file);
			}
			listener.fileChanged(file);
			if (file.isDirectory()) {
				File[] filesOfInterest = file.listFiles(new RecentChangeFilter(lastScanTime));
				for (File f : filesOfInterest) {
					if (f.isDirectory()) {
						determineChangesSince(f, lastScanTime);
					}
					else {
						if (GlobalConfiguration.verboseMode && log.isLoggable(Level.INFO)) {
							log.info("Observed last modification time change for " + f + "  (lastScanTime="
									+ lastScanTime + ")");
							log.info("Firing file changed event " + file);
						}
						listener.fileChanged(f);
					}
				}
			}
		}
		catch (Throwable t) {
			if (log.isLoggable(Level.SEVERE)) {
				log.log(Level.SEVERE, "FileWatcher caught serious error, see cause", t);
			}
		}
	}
986451
def set_version(new_version_number=None, old_version_number=''):
    
    if new_version_number is None:
        return ValueError

    import fileinput
    import sys

    file = join('timezonefinder', '__init__.py')

    for line in fileinput.input(file, inplace=1):
        if old_version_number in line:
            line = line.replace(old_version_number, new_version_number)
        sys.stdout.write(line)
1293614
def _ParseFileVersion(file_version):
  
  tokens = file_version.split('brain.Event:')
  try:
    return float(tokens[-1])
  except ValueError:
    ## This should never happen according to the definition of file_version
    ## specified in event.proto.
    logger.warn(
        ('Invalid event.proto file_version. Defaulting to use of '
         'out-of-order event.step logic for purging expired events.'))
    return -1
962601
def changes_to(time: nil, version: nil, data: {}, from: 0)
      raise ArgumentError, "Time or version must be specified" if time.nil? && version.nil?

      filter = time.nil? ? method(:version_filter) : method(:time_filter)
      versions.each_with_object(data.dup) do |v, acc|
        next if v.version < from
        break acc if filter.call(v, version, time)

        acc.merge!(v.changes)
      end
    end
1262201
def version(self, path, postmap=None, **params):
        
        q = httpd.merge_query(path, postmap)

        ans = {
            'taskforce': taskforce_version,
            'python': '.'.join(str(x) for x in sys.version_info[:3]),
        }
        ans['platform'] = {
            'system': platform.system(),
        }

        #  Add in some extra details if this is a control path.
        #  These might give away too many details on a public
        #  path.
        #
        if self._httpd.allow_control:
            ans['platform']['platform'] = platform.platform()
            ans['platform']['release'] = platform.release()

        return self._format(ans, q)
715233
def do_changed(self, subcmd, opts, component):
        

        releases = get_released_versions(component)
        latest = releases[0]

        filter_dir = components.comp_names[component].path

        latest_tag = '-'.join(latest)
        data = get_changed_since_tag(latest_tag, filter_dir)

        if len(data) > 0:
            print(data)
304386
def p_version_def(t):
    """"""
    global name_dict
    id = t[2]
    value = t[8]
    lineno = t.lineno(1)
    if id_unique(id, 'version', lineno):
        name_dict[id] = const_info(id, value, lineno)
692647
def is_changed(obj):
    
    revision_field = get_version_fieldname(obj)
    version = get_revision_of_object(obj)
    return not obj.__class__.objects.filter(**{obj._meta.pk.name: obj.pk,
                                               revision_field: version}).exists()
954079
def for_version(self, version_guid):
        
        return self.replace(library_key=self.library_key.for_version(version_guid))
327168
def version(self, v):
        
        if not isinstance(v, int) or v != 1:
            raise AttributeError
        self._version = v
1372394
def get_version_requested(path):
    """"""
    tf_version_path = os.path.join(path,
                                   TF_VERSION_FILENAME)
    if not os.path.isfile(tf_version_path):
        LOGGER.error("Terraform install attempted and no %s file present to "
                     "dictate the version. Please create it (e.g.  write "
                     "\"0.11.13\" (without quotes) to the file and try again",
                     TF_VERSION_FILENAME)
        sys.exit(1)
    with open(tf_version_path, 'r') as stream:
        ver = stream.read().rstrip()
    return ver
929338
def _patch_tf(tf):
  """"""
  global TF_PATCH
  if TF_PATCH:
    return

  v_1_12 = distutils.version.LooseVersion("1.12.0")
  v_1_13 = distutils.version.LooseVersion("1.13.0")
  v_2 = distutils.version.LooseVersion("2.0.0")
  tf_version = distutils.version.LooseVersion(tf.__version__)
  if v_1_12 <= tf_version < v_1_13:
    # TODO(b/123930850): remove when 1.13 is stable.
    TF_PATCH = "tf1_12"
    _patch_for_tf1_12(tf)
  elif v_1_13 <= tf_version < v_2:
    TF_PATCH = "tf1_13"
    _patch_for_tf1_13(tf)
  else:
    TF_PATCH = "tf2"
    _patch_for_tf2(tf)