The view of manager announcements.
508128
def announcements_view(request):
    '''  '''
    page_name = "Manager Announcements"
    userProfile = UserProfile.objects.get(user=request.user)
    announcement_form = None
    manager_positions = Manager.objects.filter(incumbent=userProfile)
    if manager_positions:
        announcement_form = AnnouncementForm(
            request.POST if "post_announcement" in request.POST else None,
            profile=userProfile,
            )
    if announcement_form and announcement_form.is_valid():
        announcement_form.save(request)
        return HttpResponseRedirect(reverse('managers:announcements'))

    # A pseudo-dictionary, actually a list with items of form:
    # (announcement, announcement_pin_form)
    announcements_dict = list()
    for a in Announcement.objects.filter(pinned=True):
        pin_form = None
        if (a.manager.incumbent == userProfile) or request.user.is_superuser:
            pin_form = PinForm(
                request.POST if "pin-{0}".format(a.pk) else None,
                instance=a,
                )
            if pin_form.is_valid():
                pin_form.save()
                return HttpResponseRedirect(reverse('managers:announcements'))
        announcements_dict.append((a, pin_form))
    # Oldest genesis of an pinned announcement to be displayed.
    within_life = now() - timedelta(hours=settings.ANNOUNCEMENT_LIFE)
    for a in Announcement.objects.filter(pinned=False, post_date__gte=within_life):
        pin_form = None
        if request.user.is_superuser or (a.manager.incumbent == userProfile):
            pin_form = PinForm(
                request.POST if "pin-{0}".format(a.pk) else None,
                instance=a,
                )
        announcements_dict.append((a, pin_form))
    return render_to_response('announcements.html', {
        'page_name': page_name,
        'manager_positions': manager_positions,
        'announcements_dict': announcements_dict,
        'announcement_form': announcement_form,
        }, context_instance=RequestContext(request))
390069
@Override
    public void onValueSelected(int pickerIndex, int newValue, boolean autoAdvance) {
        if (pickerIndex == HOUR_INDEX) {
            setHour(newValue, false);
            String announcement = String.format("%d", newValue);
            if (mAllowAutoAdvance && autoAdvance) {
                setCurrentItemShowing(MINUTE_INDEX, true, true, false);
                announcement += ". " + mSelectMinutes;
            }
            DateTimePickerUtils.tryAccessibilityAnnounce(mTimePicker, announcement);
        } else if (pickerIndex == MINUTE_INDEX) {
            setMinute(newValue);
        } else if (pickerIndex == AMPM_INDEX) {
            updateAmPmDisplay(newValue);
        } else if (pickerIndex == ENABLE_PICKER_INDEX) {
            if (!isTypedTimeFullyLegal()) {
                mTypedTimes.clear();
            }
            finishKbMode(true);
        }
    }
839882
def announcement_view(request, announcement_pk):
    '''  '''
    announce = get_object_or_404(Announcement, pk=announcement_pk)
    page_name = "View Announcement"
    profile = UserProfile.objects.get(user=request.user)
    pin_form = PinForm(
        request.POST if "pin" in request.POST else None,
        instance=announce,
        )
    can_edit = announce.incumbent == profile or request.user.is_superuser
    if pin_form.is_valid():
        pin_form.save()
        return HttpResponseRedirect(
            reverse('managers:view_announcement', kwargs={"announcement_pk": announcement_pk}),
            )
    return render_to_response('view_announcement.html', {
        'page_name': page_name,
        'pin_form': pin_form,
        'can_edit': can_edit,
        'announcement': announce,
        }, context_instance=RequestContext(request))
32351
private void deliverFoundAnnouncement(final DeviceAnnouncement announcement) {
        for (final DeviceAnnouncementListener listener : getDeviceAnnouncementListeners()) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    try {
                        listener.deviceFound(announcement);
                    } catch (Throwable t) {
                        logger.warn("Problem delivering device found announcement to listener", t);
                    }
                }
            });
        }
    }
1049873
def list_managers_view(request):
    '''  '''
    managerset = Manager.objects.filter(active=True)
    return render_to_response('list_managers.html', {
        'page_name': "Managers",
        'managerset': managerset,
        }, context_instance=RequestContext(request))
452648
@Override
    public void handleNotification(Notification notification, Object handback) {
        String notificationType = notification.getType();
        if (notificationType.equals(JMXConnectionNotification.OPENED)) {
            managementContext.incrementManagementSessionCount();
        } else if (notificationType.equals(JMXConnectionNotification.CLOSED)) {
            managementContext.decrementManagementSessionCount();
        }
    }
1027331
def show_announcement_view(request):
    
    if request.method == "POST":
        announcement_id = request.POST.get("announcement_id")
        if announcement_id:
            announcement = Announcement.objects.get(id=announcement_id)
            announcement.user_map.users_hidden.remove(request.user)
            announcement.user_map.save()
            return http.HttpResponse("Unhidden")
        raise http.Http404
    else:
        return http.HttpResponseNotAllowed(["POST"], "HTTP 405: METHOD NOT ALLOWED")
476827
function _announce($event)
    {
        foreach ($this->_listeners as $id => $listener) {
            if ($event['priority'] <= $this->_listeners[$id]->_priority) {
                $this->_listeners[$id]->notify($event);
            }
        }
    }
432135
private void updateManagementGraph(final JobID jobID, final VertexAssignmentEvent vertexAssignmentEvent) {

		synchronized (this.recentManagementGraphs) {

			final ManagementGraph managementGraph = this.recentManagementGraphs.get(jobID);
			if (managementGraph == null) {
				return;
			}
			final ManagementVertex vertex = managementGraph.getVertexByID(vertexAssignmentEvent.getVertexID());
			if (vertex == null) {
				return;
			}

			vertex.setInstanceName(vertexAssignmentEvent.getInstanceName());
			vertex.setInstanceType(vertexAssignmentEvent.getInstanceType());
		}
	}
373905
def index
      @announcements = Announcement.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @announcements }
      end
    end
604523
def display(self):
        """"""
        if self.title and self.organization:
            disp = self.title + u' at ' + self.organization
        else:
            disp = self.title or self.organization or None
        if disp and self.industry:
            if self.date_range is not None:
                disp += u' (%s, %d-%d)' % ((self.industry,) + \
                                           self.date_range.years_range)
            else:
                disp += u' (%s)' % self.industry
        else:
            disp = ((disp or u'') + u' ' + (self.industry or u'')).strip()
            if disp and self.date_range is not None:
                disp += u' (%d-%d)' % self.date_range.years_range
        return disp
1306650
def announce(version):
    """"""
    # Get our list of authors
    stdout = check_output(["git", "describe", "--abbrev=0", "--tags"])
    stdout = stdout.decode("utf-8")
    last_version = stdout.strip()

    stdout = check_output(
        ["git", "log", "{}..HEAD".format(last_version), "--format=%aN"]
    )
    stdout = stdout.decode("utf-8")

    contributors = set(stdout.splitlines())

    template_name = (
        "release.minor.rst" if version.endswith(".0") else "release.patch.rst"
    )
    template_text = (
        Path(__file__).parent.joinpath(template_name).read_text(encoding="UTF-8")
    )

    contributors_text = (
        "\n".join("* {}".format(name) for name in sorted(contributors)) + "\n"
    )
    text = template_text.format(version=version, contributors=contributors_text)

    target = Path(__file__).parent.joinpath(
        "../doc/en/announce/release-{}.rst".format(version)
    )
    target.write_text(text, encoding="UTF-8")
    print(f"{Fore.CYAN}[generate.announce] {Fore.RESET}Generated {target.name}")

    # Update index with the new release entry
    index_path = Path(__file__).parent.joinpath("../doc/en/announce/index.rst")
    lines = index_path.read_text(encoding="UTF-8").splitlines()
    indent = "   "
    for index, line in enumerate(lines):
        if line.startswith("{}release-".format(indent)):
            new_line = indent + target.stem
            if line != new_line:
                lines.insert(index, new_line)
                index_path.write_text("\n".join(lines) + "\n", encoding="UTF-8")
                print(
                    f"{Fore.CYAN}[generate.announce] {Fore.RESET}Updated {index_path.name}"
                )
            else:
                print(
                    f"{Fore.CYAN}[generate.announce] {Fore.RESET}Skip {index_path.name} (already contains release)"
                )
            break

    check_call(["git", "add", str(target)])
510234
public static function displayNotices()
    {
        if ($notices = get_option('staticwp_deferred_admin_notices')) {
            foreach ($notices as $notice) {
                $message = $notice;
                $type = 'updated';

                if (is_array($notice)) {
                    $message = isset($notice['message']) ? $notice['message'] : '';
                    $type = isset($notice['type']) ? $notice['type'] : $type;
                }

                echo '<div class="' . $type . '"><p>' . $message . '</p></div>';
            }
            delete_option('staticwp_deferred_admin_notices');
        }
    }
320356
def notifySolved(self, identifier, title):
        
        notify(self.workbench, u"Congratulations", u"Congratulations! You "
               "have completed the '{title}' exercise.".format(title=title))
        return {}
205337
private void deliverBeatAnnouncement(final Beat beat) {
        for (final MasterListener listener : getMasterListeners()) {
            try {
                listener.newBeat(beat);
            } catch (Throwable t) {
                logger.warn("Problem delivering master beat announcement to listener", t);
            }
        }
    }
919947
def announce(self, msg):
        
        self.print_if_verbose("{} -> {}".format(self.network_uid, msg.__class__.__name__))
        self.__trigger_event__(
            event_class=self.MessageAnnounced,
            msg=msg,
        )
75316
def handleNotification(self, handle, data):
        """"""
        _LOGGER.debug("Got notification from %s: %s", handle, codecs.encode(data, 'hex'))
        if handle in self._callbacks:
            self._callbacks[handle](data)