Gets the preview of manual and automatic updates required to make the server profile
        consistent with its template.

        Returns:
            dict: Server profile compliance preview.
179392
def get_compliance_preview(self):
        
        uri = '{}/compliance-preview'.format(self.data["uri"])
        return self._helper.do_get(uri)
714103
def format_server_configuration_management_settings(result):
    '''
    
    '''
    from collections import OrderedDict
    order_dict = OrderedDict([('sqlConnectivityUpdateSettings',
                               format_sql_connectivity_update_settings(result.sql_connectivity_update_settings)),
                              ('sqlWorkloadTypeUpdateSettings', format_sql_workload_type_update_settings(result.sql_workload_type_update_settings)),
                              ('sqlStorageUpdateSettings', format_sql_storage_update_settings(result.sql_storage_update_settings)),
                              ('additionalFeaturesServerConfigurations',
                               format_additional_features_server_configurations(result.additional_features_server_configurations))])

    return order_dict
995262
function getPreviewStatus(statuses, config) {
  const previewContext = config.getIn(['backend', 'preview_context']);
  return statuses.find(({ context }) => {
    return isPreviewContext(context, previewContext);
  });
}
603086
def network_profiles(self):
        
        api_version = self._get_api_version('network_profiles')
        if api_version == '2018-08-01':
            from .v2018_08_01.operations import NetworkProfilesOperations as OperationClass
        else:
            raise NotImplementedError("APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
872972
def _prep(e):
        
        if 'lastupdate' in e:
            e['lastupdate'] = datetime.datetime.fromtimestamp(int(e['lastupdate']))
        for k in ['farm', 'server', 'id', 'secret']:
            if not k in e:
                return e
        e["url"] = "https://farm%s.staticflickr.com/%s/%s_%s_b.jpg" % (e["farm"], e["server"], e["id"], e["secret"])
        return e
1198348
def preview(self, request):
        
        recurrence_rule = request.POST.get('recurrence_rule')
        limit = int(request.POST.get('limit', 10))
        try:
            rruleset = rrule.rrulestr(
                recurrence_rule, dtstart=djtz.now(), forceset=True)
        except ValueError as e:
            data = {
                'error': six.text_type(e),
            }
        else:
            data = {
                'occurrences': rruleset[:limit]
            }
        return JsonResponse(data)
1282121
def preview(directory=None, host=None, port=None, watch=True):
    """"""
    directory = directory or '.'
    host = host or '127.0.0.1'
    port = port or 5000

    # TODO: admin interface

    # TODO: use cache_only to keep from modifying output directly
    out_directory = build(directory)

    # Serve generated site
    os.chdir(out_directory)
    Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
    httpd = SocketServer.TCPServer((host, port), Handler)
    print ' * Serving on http://%s:%s/' % (host, port)
    httpd.serve_forever()
230826
def version(self):
        '''
        
        '''
        url = "http://{master_addr}:{master_port}/dir/status".format(
            master_addr=self.master_addr,
            master_port=self.master_port)
        data = self.conn.get_data(url)
        response_data = json.loads(data)
        return response_data.get("Version")
16993
def _update(self, **kwargs):
        
        updated = False
        if 'proxy_server' in kwargs:
            proxy_server = kwargs.get('proxy_server')
            if not proxy_server and self._inspected_service_ref:
                self.protocol_agent_values.pop('inspected_service_ref', None)
                updated = True
            elif isinstance(proxy_server, ProxyServer):
                # Need the inspected service reference for the protocol
                enabled_services = {svc.name:svc.href for svc in proxy_server.inspected_services}
                
                if self.protocol_agent.name not in enabled_services:
                    raise MissingDependency('The specified ProxyServer %r does not enable '
                        'the required protocol %s' % (proxy_server.name, self.protocol_agent.name))
                
                if self._inspected_service_ref != enabled_services.get(self.protocol_agent.name):
                    self.protocol_agent_values['inspected_service_ref'] = enabled_services.get(
                        self.protocol_agent.name)
                    updated = True
        return updated
438940
def get_preview(path)
      resp, body = content_request('/files/get_preview', path: path)
      return FileMetadata.new(resp), body
    end
1006632
def server_info(self, session=None):
        
        return self.admin.command("buildinfo",
                                  read_preference=ReadPreference.PRIMARY,
                                  session=session)
365969
def refresh(self):
      '''
      '''
      response = requests.get('%s/guides/%s' % (API_BASE_URL, self.id))
      attributes = response.json()
      
      self.category = Category(attributes['category'])
      self.url = attributes['url']
      
      self.title = attributes['title']
      if attributes['image']:
         self.image = Image(attributes['image']['id'])
      else:
         self.image = None
      self.locale = attributes['locale']
      self.introduction = WikiText(attributes['introduction_raw'],
                                   attributes['introduction_rendered'])
      self.conclusion = WikiText(attributes['conclusion_raw'],
                                 attributes['conclusion_rendered'])
      #self.tools = attributes['tools']
      #self.parts = attributes['parts']
      self.subject = attributes['subject']
      self.modifiedDate = datetime.utcfromtimestamp(attributes['modified_date'])
      self.createdDate = datetime.utcfromtimestamp(attributes['created_date'])
      self.publishedDate = datetime.utcfromtimestamp(attributes['published_date'])
      #self.documents = attributes['documents']
      author = attributes['author']
      #self.author = User(author['userid'], name=author['text'])
      #self.timeRequired = attributes['timeRequired']
      self.steps = [Step(step['guideid'], step['stepid'], data=step) for step in attributes['steps']]
      self.type = attributes['type']
      self.public = attributes['public']
      self.revision = attributes['revisionid']
      self.difficulty = attributes['difficulty']
      self.prerequisites = [Guide(guide['guideid']) for guide in attributes['prerequisites']]
      #                     attributes['prereq_modified_date']
      #self.summary = attributes['summary']
      self.flags = [Flag.from_id(flag['flagid']) for flag in attributes['flags']]
135881
def get_info(self):
        
        return {
            self.get_plugin_name() : {
                "version" : self.get_version(),
                "params" : {
                    "file" : self.conf['file']
                },
                "stats" : {
                    "last_route_spec_update" :
                        self.last_route_spec_update.isoformat()
                        if self.last_route_spec_update else "(no update, yet)"
                }
            }
        }
564964
def getstatus():
    
    if exists(RUNFILE):
        mtime = os.stat(RUNFILE).st_mtime
        with open(SECTIONFILE) as f:
            section = f.read().strip()
        # what section?
        return UpdateStatus.RUNNING, mtime, section
    if exists(PAUSEFILE):
        return UpdateStatus.PAUSED, None, None

    mtime = None
    if exists(TIMEFILE):
        mtime = os.stat(TIMEFILE).st_mtime

    if exists(FAILFILE):
        if not mtime:
            mtime = os.stat(FAILFILE).st_mtime
        # TODO: return a different error code when the error was inability to
        # contact one or more remote servers
        with open(FAILFILE) as f:
            content = f.read().strip()
            if content == UpdateStatus.NOCONN:
                return UpdateStatus.NOCONN, mtime, None
            elif content == UpdateStatus.DIRTY:
                return UpdateStatus.DIRTY, mtime, None
        return UpdateStatus.FAILED, mtime, None

    if mtime is None:
        return UpdateStatus.NEVER, None, None

    return UpdateStatus.OK, mtime, None
1056157
def get_enabled_plugins():
    '''
    
    '''
    plugins = entrypoints.get_enabled('udata.preview', current_app).values()
    valid = [p for p in plugins if issubclass(p, PreviewPlugin)]
    for plugin in plugins:
        if plugin not in valid:
            clsname = plugin.__name__
            msg = '{0} is not a valid preview plugin'.format(clsname)
            warnings.warn(msg, PreviewWarning)
    return [p() for p in sorted(valid, key=lambda p: 1 if p.fallback else 0)]
208385
def get_version(self):
        
        return Version.objects.get(
            content_type=self.content_type,
            object_id=self.object_id,
            version_number=self.publish_version,
        )
1231771
def getProfile(self):
        
        if self._create:
            return ObjectProfile()
        else:
            if self._profile is None:
                r = self.api.getObjectProfile(self.pid)
                self._profile = parse_xml_object(ObjectProfile, r.content, r.url)
            return self._profile