Opt in or out of sharing stuff with plex.
            See: https://www.plex.tv/about/privacy-legal/
974124
def optOut(self, playback=None, library=None):
        
        params = {}
        if playback is not None:
            params['optOutPlayback'] = int(playback)
        if library is not None:
            params['optOutLibraryStats'] = int(library)
        url = 'https://plex.tv/api/v2/user/privacy'
        return self.query(url, method=self._session.put, data=params)
847447
def promote_owner(self, stream_id, user_id):
        '''  '''
        req_hook = 'pod/v1/room/' + stream_id + '/membership/promoteOwner'
        req_args = '{ "id": %s }' % user_id
        status_code, response = self.__rest__.POST_query(req_hook, req_args)
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
1081619
def hide(self):
        
        self.visible = False
        if self.proxy_is_active:
            self.proxy.ensure_hidden()
629038
def UpdateShowDirInTVLibrary(self, showID, showDir):
    
    goodlogging.Log.Info("DB", "Updating TV library for ShowID={0}: ShowDir={1}".format(showID, showDir))
    self._ActionDatabase("UPDATE TVLibrary SET ShowDir=? WHERE ShowID=?", (showDir, showID))
140696
def filter(self, other=None):
        

        if not other:
            other = Fuse.fuseoptref()

        return SubOptsHive.filter(self, other)
105755
def revoke_group_permission(
        self, group_name, source_group_name, source_group_owner_id):
        
        d = self.revoke_security_group(
            group_name,
            source_group_name=source_group_name,
            source_group_owner_id=source_group_owner_id)
        return d
1291645
def mute(ip):
        """"""
        tv_url = 'http://{}:6095/controller?action=keyevent&keycode='.format(ip)

        count = 0
        while count > 30:
            count = count + 1
            request = requests.get(tv_url + 'volumedown')

            if request.status_code != 200:
                return False

        return True
404875
function() {

            // Only do this if we have sharing set up correctly
            if (app.config.sharing.codeDir && app.config.sharing.share) {

              // Share dir
              var share = app.config.sharing.share.split(':') || ['', '/code'];

              return {
                service: 'cli',
                description: 'Run a system command like sudo, ls, rm, chown...',
                mapping: '<config.sharing.codeDir>:' + share[1],
                stripfirst: true
              };

            }
          }
844550
def share(self, with_user, roles=None):
        '''
        
        '''
        return self.proxy.share(table=self.name, with_user=with_user,
                                roles=roles)
743973
def url_for(path, opts = {})
      path = absolute(path)
      (opts[:expires] ? storage.media(path) : storage.shares(path))['url']
    end
68891
def shareable(self, boolean):
        """"""
        if(boolean):
            r = self.flag({
                "flag": "make_shareable"
            })
        else:
            r = self.flag({
                "flag": "make_not_shareable"
            })

        return r
782028
function PeerConnectionChannels (pc) {
    /// Private Data
    var channels = [],
        api = {};


    /// Private API

    var remove = function remove (channel) {
      OT.$.filter(channels, function(c) {
        return channel !== c;
      });
    };

    var add = function add (nativeChannel) {
      var channel = new DataChannel(nativeChannel);
      channels.push(channel);

      channel.on('close', function() {
        remove(channel);
      });

      return channel;
    };


    /// Public API

    api.add = function (label, options) {
      return add(pc.createDataChannel(label, options));
    };

    api.addMany = function (newChannels) {
      for (var label in newChannels) {
        if (newChannels.hasOwnProperty(label)) {
          api.add(label, newChannels[label]);
        }
      }
    };

    api.get = function (label, options) {
      return OT.$.find(channels, function(channel) {
        return channel.equals(label, options);
      });
    };

    api.getOrAdd = function (label, options) {
      var channel = api.get(label, options);
      if (!channel) {
        channel = api.add(label, options);
      }

      return channel;
    };

    api.destroy = function () {
      OT.$.forEach(channels, function(channel) {
        channel.close();
      });

      channels = [];
    };


    /// Init

    pc.addEventListener('datachannel', function(event) {
      add(event.channel);
    }, false);

    return api;
  }
1258136
def share_library(repo_id,user,group_id,permission="rw",share_type="group")
      put_share_library(repo_id,share_type,user,group_id,permission)
    end
36410
def allow(self, privilege):
        """"""
        assert privilege in PERMISSIONS['user'].keys()
        reading = PERMISSIONS['user'][privilege] + PERMISSIONS['group'][privilege] + PERMISSIONS['other'][privilege]
        os.chmod(self.file_path, reading)
455927
def can_share_folder(self, user, folder):
        
        return folder.parent_id is None and folder.author_id == user.id
1273066
def public(self, *args, **kwargs):
        
        kwargs['public'] = True
        return self.filter(*args, **kwargs)
50112
def private(self):
        
        req = self.request(self.mist_client.uri+'/keys/'+self.id+"/private")
        private = req.get().json()
        return private