text:
""" Read in and access data from external resources such as gender lists."""

import os
import pickle

import cort
from cort.core import singletons
from cort.core import util

__author__ = 'smartschat'

@singletons.Singleton
class GenderData:
    """ Read in and access data from lists with gender information.

    Attributes:
        word_to_gender (dict(str, str)): A mapping from lower-case strings
            to one of four genders: 'MALE', 'FEMALE', 'NEUTRAL' and 'PLURAL'.
    """
    def __init__(self):
        """ Initialize the word-to-gender mapping from gender lists.
        """
        self.word_to_gender = {}

        directory = cort.__path__[0] + "/resources/"

        lists = [
            open(directory + "male.list"),
            open(directory + "female.list"),
            open(directory + "neutral.list"),
            open(directory + "plural.list")
        ]

        genders = ["MALE", "FEMALE", "NEUTRAL", "PLURAL"]

        for gender, gender_list in zip(genders, lists):
            for word in gender_list.readlines():
                self.word_to_gender[word.strip()] = gender

    def look_up(self, attributes):
        """ Look up the gender of a mention described by the input attributes.

        Args:
            attributes (dict(str,object)): A dict describing attributes of
                mentions. Must contain "tokens" and "head", which have lists
                of strings as values.

        Returns:
            (str): None or one of the four genders 'MALE', 'FEMALE',
            'NEUTRAL' or 'PLURAL'.
        """
        # whole string
        if " ".join(attributes["tokens"]).lower() in self.word_to_gender:
            return self.word_to_gender[" ".join(attributes["tokens"]).lower()]
        # head
        elif " ".join(attributes["head"]).lower() in self.word_to_gender:
            return self.word_to_gender[" ".join(attributes["head"]).lower()]
        # head token by token
        elif self.__look_up_token_by_token(attributes["head"]):
            return self.__look_up_token_by_token(attributes["head"])

    def __look_up_token_by_token(self, tokens):
        for token in tokens:
            if token[0].isupper() and token.lower() in self.word_to_gender:
                return self.word_to_gender[token.lower()]

@singletons.Singleton
class LexicalData:
    """ Read in and access data containing pairs of coreferent mention strings.

    Attributes:
        pairs (set((str, str))): A set of string pairs, which represent strings
            of potentially coreferent mentions.
    """
    def __init__(self):
        """ Initialize the set of pairs from
            package_root/resources/coreferent_pairs.obj.
        """
        directory = cort.__path__[0] + "/resources/"

        self.pairs = pickle.load(
            open(directory + "coreferent_pairs.obj", "rb"))

    def look_up(self, anaphor, antecedent):
        """ Look up strings of the mentions in the pair list.

        Args:
            anaphor (Mention): A mention.
            antecedent (Mention): Another mention, the candidate antecedent
                for anaphor.

        Returns:
            True if the pair of strings corresponding to anaphor of
            antecedent, stripped determiners and possessive s, can be found
            in the list of pairs.
        """
        # whole string
        anaphor_cleaned = " ".join(
            util.clean_via_pos(anaphor.attributes["tokens"],
                          anaphor.attributes["pos"]))
        antecedent_cleaned = " ".join(
            util.clean_via_pos(antecedent.attributes["tokens"],
                               antecedent.attributes["pos"]))

        return (
            (anaphor_cleaned, antecedent_cleaned) in self.pairs
            or (antecedent_cleaned, anaphor_cleaned) in self.pairs
        )

@singletons.Singleton
class SingletonMentions:
    """ Read in and access data strings of singleton mentions.

    Attributes:
        singletons (set(str)): A set of strings, which represent strings of
            of potential singleton mentions.
    """
    def __init__(self):
        """ Initialize the set of pairs from
            package_root/resources/singletons_not_cleaned.obj.
        """
        directory = cort.__path__[0] + "/resources/"

        self.singletons = pickle.load(
            open(directory + "singletons_not_cleaned.obj", "rb"))


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.cmmn.converter.export;

import org.flowable.cmmn.model.UserEventListener;

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

/**
 * @author Dennis Federico
 */
public class UserEventListenerExport extends AbstractPlanItemDefinitionExport<UserEventListener> {

    @Override
    protected Class<? extends UserEventListener> getExportablePlanItemDefinitionClass() {
        return UserEventListener.class;
    }

    @Override
    protected String getPlanItemDefinitionXmlElementValue(UserEventListener planItemDefinition) {
        return ELEMENT_USER_EVENT_LISTENER;
    }

    @Override
    protected void writePlanItemDefinitionSpecificAttributes(UserEventListener userEventListener, XMLStreamWriter xtw) throws Exception {
        super.writePlanItemDefinitionSpecificAttributes(userEventListener, xtw);
        String[] authorizedRoleRefs = userEventListener.getAuthorizedRoleRefs();
        if (authorizedRoleRefs != null && authorizedRoleRefs.length > 0) {
            xtw.writeAttribute(ATTRIBUTE_AUTHORIZED_ROLE_REFS, String.join(",", authorizedRoleRefs));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<html>
<head>
    <script src="/js-test-resources/js-test.js"></script>
    <script src="../../resources/frame-ancestors-test.js"></script>
</head>
<body>
    <script>
        description("A 'frame-ancestors' CSP directive with a URL value should compare against each frame's origin rather than URL, " +
		    "so a nested frame with a sandboxed parent frame should be blocked due to the parent having a unique origin.");

	testNestedSandboxedIFrame(SAMEORIGIN_ORIGIN + " " + CROSSORIGIN_ORIGIN, CROSS_ORIGIN, CROSS_ORIGIN, EXPECT_BLOCK);
    </script>
</body>
</html>


text:
namespace sandbox {

// The current process will fork(). The parent will become a process reaper
// like init(1). The child will continue normally (after this function
// returns).
// If not NULL, |post_fork_parent_callback| will run in the parent almost
// immediately after fork().
// Since this function calls fork(), it's very important that the caller has
// only one thread running.
SANDBOX_EXPORT bool CreateInitProcessReaper(
    base::Closure* post_fork_parent_callback);

}  // namespace sandbox.

#endif  // SANDBOX_LINUX_SERVICES_INIT_PROCESS_REAPER_H_


text:
#include <linux/fs.h>
#include <linux/audit.h>
#include <linux/skbuff.h>
#include <uapi/linux/mqueue.h>

/* 0 = no checking
   1 = put_count checking
   2 = verbose put_count checking
*/
#define AUDIT_DEBUG 0

/* AUDIT_NAMES is the number of slots we reserve in the audit_context
 * for saving names from getname().  If we get more names we will allocate
 * a name dynamically and also add those to the list anchored by names_list. */
#define AUDIT_NAMES	5

/* At task start time, the audit_state is set in the audit_context using
   a per-task filter.  At syscall entry, the audit_state is augmented by
   the syscall filter. */
enum audit_state {
	AUDIT_DISABLED,		/* Do not create per-task audit_context.
				 * No syscall-specific audit records can
				 * be generated. */
	AUDIT_BUILD_CONTEXT,	/* Create the per-task audit_context,
				 * and fill it in at syscall
				 * entry time.  This makes a full
				 * syscall record available if some
				 * other part of the kernel decides it
				 * should be recorded. */
	AUDIT_RECORD_CONTEXT	/* Create the per-task audit_context,
				 * always fill it in at syscall entry
				 * time, and always write out the audit
				 * record at syscall exit time.  */
};

/* Rule lists */
struct audit_watch;
struct audit_tree;
struct audit_chunk;

struct audit_entry {
	struct list_head	list;
	struct rcu_head		rcu;
	struct audit_krule	rule;
};

struct audit_cap_data {
	kernel_cap_t		permitted;
	kernel_cap_t		inheritable;
	union {
		unsigned int	fE;		/* effective bit of file cap */
		kernel_cap_t	effective;	/* effective set of process */
	};
};

/* When fs/namei.c:getname() is called, we store the pointer in name and
 * we don't let putname() free it (instead we free all of the saved
 * pointers at syscall exit time).
 *
 * Further, in fs/namei.c:path_lookup() we store the inode and device.
 */
struct audit_names {
	struct list_head	list;		/* audit_context->names_list */

	struct filename		*name;
	int			name_len;	/* number of chars to log */
	bool			hidden;		/* don't log this record */
	bool			name_put;	/* call __putname()? */

	unsigned long		ino;
	dev_t			dev;
	umode_t			mode;
	kuid_t			uid;
	kgid_t			gid;
	dev_t			rdev;
	u32			osid;
	struct audit_cap_data	fcap;
	unsigned int		fcap_ver;
	unsigned char		type;		/* record type */
	/*
	 * This was an allocated audit_names and not from the array of
	 * names allocated in the task audit context.  Thus this name
	 * should be freed on syscall exit.
	 */
	bool			should_free;
};

/* The per-task audit context. */
struct audit_context {
	int		    dummy;	/* must be the first element */
	int		    in_syscall;	/* 1 if task is in a syscall */
	enum audit_state    state, current_state;
	unsigned int	    serial;     /* serial number for record */
	int		    major;      /* syscall number */
	struct timespec	    ctime;      /* time of syscall entry */
	unsigned long	    argv[4];    /* syscall arguments */
	long		    return_code;/* syscall return code */
	u64		    prio;
	int		    return_valid; /* return code is valid */
	/*
	 * The names_list is the list of all audit_names collected during this
	 * syscall.  The first AUDIT_NAMES entries in the names_list will
	 * actually be from the preallocated_names array for performance
	 * reasons.  Except during allocation they should never be referenced
	 * through the preallocated_names array and should only be found/used
	 * by running the names_list.
	 */
	struct audit_names  preallocated_names[AUDIT_NAMES];
	int		    name_count; /* total records in names_list */
	struct list_head    names_list;	/* struct audit_names->list anchor */
	char		    *filterkey;	/* key for rule that triggered record */
	struct path	    pwd;
	struct audit_aux_data *aux;
	struct audit_aux_data *aux_pids;
	struct sockaddr_storage *sockaddr;
	size_t sockaddr_len;
				/* Save things to print about task_struct */
	pid_t		    pid, ppid;
	kuid_t		    uid, euid, suid, fsuid;
	kgid_t		    gid, egid, sgid, fsgid;
	unsigned long	    personality;
	int		    arch;

	pid_t		    target_pid;
	kuid_t		    target_auid;
	kuid_t		    target_uid;
	unsigned int	    target_sessionid;
	u32		    target_sid;
	char		    target_comm[TASK_COMM_LEN];

	struct audit_tree_refs *trees, *first_trees;
	struct list_head killed_trees;
	int tree_count;

	int type;
	union {
		struct {
			int nargs;
			long args[6];
		} socketcall;
		struct {
			kuid_t			uid;
			kgid_t			gid;
			umode_t			mode;
			u32			osid;
			int			has_perm;
			uid_t			perm_uid;
			gid_t			perm_gid;
			umode_t			perm_mode;
			unsigned long		qbytes;
		} ipc;
		struct {
			mqd_t			mqdes;
			struct mq_attr		mqstat;
		} mq_getsetattr;
		struct {
			mqd_t			mqdes;
			int			sigev_signo;
		} mq_notify;
		struct {
			mqd_t			mqdes;
			size_t			msg_len;
			unsigned int		msg_prio;
			struct timespec		abs_timeout;
		} mq_sendrecv;
		struct {
			int			oflag;
			umode_t			mode;
			struct mq_attr		attr;
		} mq_open;
		struct {
			pid_t			pid;
			struct audit_cap_data	cap;
		} capset;
		struct {
			int			fd;
			int			flags;
		} mmap;
		struct {
			int			argc;
		} execve;
	};
	int fds[2];

#if AUDIT_DEBUG
	int		    put_count;
	int		    ino_count;
#endif
};

extern u32 audit_ever_enabled;

extern void audit_copy_inode(struct audit_names *name,
			     const struct dentry *dentry,
			     const struct inode *inode);
extern void audit_log_cap(struct audit_buffer *ab, char *prefix,
			  kernel_cap_t *cap);
extern void audit_log_fcaps(struct audit_buffer *ab, struct audit_names *name);
extern void audit_log_name(struct audit_context *context,
			   struct audit_names *n, struct path *path,
			   int record_num, int *call_panic);

extern int audit_pid;

#define AUDIT_INODE_BUCKETS	32
extern struct list_head audit_inode_hash[AUDIT_INODE_BUCKETS];

static inline int audit_hash_ino(u32 ino)
{
	return (ino & (AUDIT_INODE_BUCKETS-1));
}

/* Indicates that audit should log the full pathname. */
#define AUDIT_NAME_FULL -1

extern int audit_match_class(int class, unsigned syscall);
extern int audit_comparator(const u32 left, const u32 op, const u32 right);
extern int audit_uid_comparator(kuid_t left, u32 op, kuid_t right);
extern int audit_gid_comparator(kgid_t left, u32 op, kgid_t right);
extern int parent_len(const char *path);
extern int audit_compare_dname_path(const char *dname, const char *path, int plen);
extern struct sk_buff *audit_make_reply(__u32 portid, int seq, int type,
					int done, int multi,
					const void *payload, int size);
extern void		    audit_panic(const char *message);

struct audit_netlink_list {
	__u32 portid;
	struct net *net;
	struct sk_buff_head q;
};

int audit_send_list(void *);

struct audit_net {
	struct sock *nlsk;
};

extern int selinux_audit_rule_update(void);

extern struct mutex audit_filter_mutex;
extern void audit_free_rule_rcu(struct rcu_head *);
extern struct list_head audit_filter_list[];

extern struct audit_entry *audit_dupe_rule(struct audit_krule *old);

/* audit watch functions */
#ifdef CONFIG_AUDIT_WATCH
extern void audit_put_watch(struct audit_watch *watch);
extern void audit_get_watch(struct audit_watch *watch);
extern int audit_to_watch(struct audit_krule *krule, char *path, int len, u32 op);
extern int audit_add_watch(struct audit_krule *krule, struct list_head **list);
extern void audit_remove_watch_rule(struct audit_krule *krule);
extern char *audit_watch_path(struct audit_watch *watch);
extern int audit_watch_compare(struct audit_watch *watch, unsigned long ino, dev_t dev);
#else
#define audit_put_watch(w) {}
#define audit_get_watch(w) {}
#define audit_to_watch(k, p, l, o) (-EINVAL)
#define audit_add_watch(k, l) (-EINVAL)
#define audit_remove_watch_rule(k) BUG()
#define audit_watch_path(w) ""
#define audit_watch_compare(w, i, d) 0

#endif /* CONFIG_AUDIT_WATCH */

#ifdef CONFIG_AUDIT_TREE
extern struct audit_chunk *audit_tree_lookup(const struct inode *);
extern void audit_put_chunk(struct audit_chunk *);
extern int audit_tree_match(struct audit_chunk *, struct audit_tree *);
extern int audit_make_tree(struct audit_krule *, char *, u32);
extern int audit_add_tree_rule(struct audit_krule *);
extern int audit_remove_tree_rule(struct audit_krule *);
extern void audit_trim_trees(void);
extern int audit_tag_tree(char *old, char *new);
extern const char *audit_tree_path(struct audit_tree *);
extern void audit_put_tree(struct audit_tree *);
extern void audit_kill_trees(struct list_head *);
#else
#define audit_remove_tree_rule(rule) BUG()
#define audit_add_tree_rule(rule) -EINVAL
#define audit_make_tree(rule, str, op) -EINVAL
#define audit_trim_trees() (void)0
#define audit_put_tree(tree) (void)0
#define audit_tag_tree(old, new) -EINVAL
#define audit_tree_path(rule) ""	/* never called */
#define audit_kill_trees(list) BUG()
#endif

extern char *audit_unpack_string(void **, size_t *, size_t);

extern pid_t audit_sig_pid;
extern kuid_t audit_sig_uid;
extern u32 audit_sig_sid;

#ifdef CONFIG_AUDITSYSCALL
extern int __audit_signal_info(int sig, struct task_struct *t);
static inline int audit_signal_info(int sig, struct task_struct *t)
{
	if (unlikely((audit_pid && t->tgid == audit_pid) ||
		     (audit_signals && !audit_dummy_context())))
		return __audit_signal_info(sig, t);
	return 0;
}
extern void audit_filter_inodes(struct task_struct *, struct audit_context *);
extern struct list_head *audit_killed_trees(void);
#else
#define audit_signal_info(s,t) AUDIT_DISABLED
#define audit_filter_inodes(t,c) AUDIT_DISABLED
#endif

extern struct mutex audit_cmd_mutex;


text:
$r.translate("chelp.statistic_homeorg.text")

$r.translateWithPackage("org.olat.course.statistic", "chelp.statistic.alldates")


text:
package ap2014.t1;

/**
 * Created by acorn on 12/7/14.
 */
public class Lesson_30_Activity {
  public static String [] list = {"every", " near ing ", " checking", "food ", "stand", "value "};
  public static void main(String [] params) {
    for(int i=0; i<list.length; i++) {
      list[i] = list[i].trim().replace(" ","");
    }
  }
}


text:
package cromwell.backend.standard

import cromwell.core.path.Path
import wom.callable.AdHocValue

/**
  * Represents an adhoc value that was moved to another location before the command is instantiated
  */
final case class LocalizedAdHocValue(originalValue: AdHocValue, localizedLocation: Path)


text:
package com.nepxion.thunder.console.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import org.apache.commons.collections4.CollectionUtils;

import com.nepxion.thunder.common.config.ServiceConfig;
import com.nepxion.thunder.common.constant.ThunderConstant;
import com.nepxion.thunder.common.entity.ApplicationEntity;
import com.nepxion.thunder.common.entity.ApplicationType;
import com.nepxion.thunder.common.entity.ProtocolType;
import com.nepxion.thunder.common.entity.SummaryEntity;
import com.nepxion.thunder.console.context.RegistryContext;
import com.nepxion.thunder.console.locale.ConsoleLocale;
import com.nepxion.thunder.registry.RegistryExecutor;

public class SummaryController {
    public static List<SummaryEntity> getServiceSummaries(ProtocolType protocolType) throws Exception {
        RegistryExecutor registryExecutor = RegistryContext.getRegistryExecutor(protocolType);

        List<SummaryEntity> summaryEntities = new ArrayList<SummaryEntity>();
        List<String> groups = registryExecutor.getGroupList();
        for (String group : groups) {
            List<String> applications = registryExecutor.getApplicationList(group);
            for (String application : applications) {
                ApplicationEntity applicationEntity = new ApplicationEntity();
                applicationEntity.setApplication(application);
                applicationEntity.setGroup(group);
                List<String> services = registryExecutor.getServiceList(application, group);
                for (String service : services) {
                    SummaryEntity summaryEntity = getServiceSummary(service, applicationEntity, protocolType);
                    if (summaryEntity != null) {
                        summaryEntities.add(summaryEntity);
                    }
                }
            }
        }

        return summaryEntities;
    }

    public static List<SummaryEntity> getReferenceSummaries(ProtocolType protocolType) throws Exception {
        RegistryExecutor registryExecutor = RegistryContext.getRegistryExecutor(protocolType);

        List<SummaryEntity> summaryEntities = new ArrayList<SummaryEntity>();
        List<String> groups = registryExecutor.getGroupList();
        for (String group : groups) {
            List<String> applications = registryExecutor.getApplicationList(group);
            for (String application : applications) {
                ApplicationEntity applicationEntity = new ApplicationEntity();
                applicationEntity.setApplication(application);
                applicationEntity.setGroup(group);
                List<String> references = registryExecutor.getReferenceList(application, group);
                for (String reference : references) {
                    SummaryEntity summaryEntity = getReferenceSummary(reference, applicationEntity, protocolType);
                    if (summaryEntity != null) {
                        summaryEntities.add(summaryEntity);
                    }
                }
            }
        }

        return summaryEntities;
    }

    public static SummaryEntity getServiceSummary(String interfaze, ApplicationEntity applicationEntity, ProtocolType protocolType) throws Exception {
        RegistryExecutor registryExecutor = RegistryContext.getRegistryExecutor(protocolType);

        List<ApplicationEntity> serviceInstanceList = registryExecutor.getServiceInstanceList(interfaze, applicationEntity);
        ServiceConfig serviceConfig = registryExecutor.retrieveService(interfaze, applicationEntity);

        SummaryEntity summaryEntity = new SummaryEntity();
        summaryEntity.setProtocolType(protocolType);
        summaryEntity.setApplicationType(ApplicationType.SERVICE);
        summaryEntity.setApplication(applicationEntity.getApplication());
        summaryEntity.setGroup(applicationEntity.getGroup());
        summaryEntity.setInterface(interfaze);
        if (serviceConfig != null) {
            summaryEntity.setMethods(serviceConfig.getMethods());
        }
        summaryEntity.setNotStartedDescription(ConsoleLocale.getString("not_start"));
        summaryEntity.setNotConnectedDescription(ConsoleLocale.getString("not_connect"));

        List<String> addresses = new ArrayList<String>();
        for (ApplicationEntity serviceInstance : serviceInstanceList) {
            addresses.add(serviceInstance.getHost() + ":" + serviceInstance.getPort());
        }
        summaryEntity.setAddresses(addresses);

        List<String> times = new ArrayList<String>();
        for (ApplicationEntity serviceInstance : serviceInstanceList) {
            times.add(new SimpleDateFormat(ThunderConstant.DATE_FORMAT).format(new Date(serviceInstance.getTime())));
        }
        summaryEntity.setTimes(times);

        return summaryEntity;
    }

    public static SummaryEntity getReferenceSummary(String interfaze, ApplicationEntity applicationEntity, ProtocolType protocolType) throws Exception {
        RegistryExecutor registryExecutor = RegistryContext.getRegistryExecutor(protocolType);

        List<ApplicationEntity> referenceInstanceList = registryExecutor.getReferenceInstanceList(interfaze, applicationEntity);

        SummaryEntity summaryEntity = new SummaryEntity();
        summaryEntity.setProtocolType(protocolType);
        summaryEntity.setApplicationType(ApplicationType.REFERENCE);
        summaryEntity.setApplication(applicationEntity.getApplication());
        summaryEntity.setGroup(applicationEntity.getGroup());
        summaryEntity.setInterface(interfaze);
        summaryEntity.setNotStartedDescription(ConsoleLocale.getString("not_start"));
        summaryEntity.setNotConnectedDescription(ConsoleLocale.getString("not_connect"));

        List<String> addresses = new ArrayList<String>();
        for (ApplicationEntity referenceInstance : referenceInstanceList) {
            addresses.add(referenceInstance.getHost() + ":" + referenceInstance.getPort());
        }
        summaryEntity.setAddresses(addresses);

        List<String> times = new ArrayList<String>();
        for (ApplicationEntity referenceInstance : referenceInstanceList) {
            times.add(new SimpleDateFormat(ThunderConstant.DATE_FORMAT).format(new Date(referenceInstance.getTime())));
        }
        summaryEntity.setTimes(times);

        return summaryEntity;
    }

    public static List<SummaryEntity> getMonitorSummaries() throws Exception {
        List<String> monitorInstanceList = RegistryContext.getDefaultRegistryExecutor().getMonitorInstanceList();

        List<SummaryEntity> summaryEntities = new ArrayList<SummaryEntity>();
        if (CollectionUtils.isEmpty(monitorInstanceList)) {
            return summaryEntities;
        }

        for (String monitorInstance : monitorInstanceList) {
            SummaryEntity summaryEntity = new SummaryEntity();
            summaryEntity.setHtmlStyle(false);
            summaryEntity.setAddresses(Arrays.asList(monitorInstance));
            summaryEntities.add(summaryEntity);
        }

        return summaryEntities;
    }
}


text:
import { createRef, PureComponent } from "react";
import PropTypes from "prop-types";
import Immutable from "immutable";

import FontIcon from "components/Icon/FontIcon";

import "./DropDownWithFilter.less";

// todo: loc

class DropDownWithFilter extends PureComponent {
  static propTypes = {
    availableOptions: PropTypes.instanceOf(Immutable.List).isRequired,
    filterPattern: PropTypes.string.isRequired,
    resetSelection: PropTypes.func.isRequired,
    onChange: PropTypes.func.isRequired,
    onCustomFilterChange: PropTypes.func.isRequired,
    options: PropTypes.instanceOf(Immutable.List).isRequired,
    selectedOptions: PropTypes.instanceOf(Immutable.List).isRequired,
  };

  constructor(props) {
    super(props);
    this.onCustomFilterChange = this.onCustomFilterChange.bind(this);
    this.customFilterInputRef = createRef();
  }

  onCustomFilterChange() {
    this.props.onCustomFilterChange(this.customFilterInputRef.current);
  }

  render() {
    const {
      availableOptions,
      filterPattern,
      resetSelection,
      selectedOptions,
      onChange,
    } = this.props;
    const selectOptions = selectedOptions.map((item, index) => {
      return (
        <div
          className="drop-option"
          key={`selected${index}`}
          style={styles.dropOption}
        >
          <input
            type="checkbox"
            onChange={onChange}
            className="drop-down-checkbox"
            value={item}
            checked
          />
          {item}

      );
    });
    const filteredOptions = filterPattern
      ? availableOptions.filter((item) => {
          return item.startsWith(filterPattern);
        })
      : availableOptions;
    const nonSelectedOptions = filteredOptions.map((item, index) => {
      return (
        <div
          className="drop-option"
          key={`nonSelected${index}`}
          style={styles.dropOption}
        >
          <input
            type="checkbox"
            className="drop-down-checkbox"
            onChange={onChange}
            value={item}
            checked={false}
          />
          {item}

      );
    });
    const allLabel =
      selectOptions.size !== 0 ? (

          {la("All")}

      ) : null;
    const filter =
      availableOptions.size !== 0 ? (

          <input
            placeholder="Filter…"
            className="custom-filter-input"
            ref={this.customFilterInputRef}
            onChange={this.onCustomFilterChange}
          />
          <FontIcon type="Search" theme={styles.iconSearch} />

      ) : null;
    return (

        {allLabel}

{selectOptions}

        {filter}

{nonSelectedOptions}

    );
  }
}

const styles = {
  base: {
    background: "#fff",
    boxShadow: "var(--dremio--shadow--layer-1)",
    borderRadius: "2px",
    width: "200px",
    zIndex: "99",
  },
  customFilter: {
    position: "relative",
    padding: "4px",
    background: "rgb(241,241,241)",
  },
  iconSearch: {
    Container: {
      position: "absolute",
      right: 8,
      top: 0,
      bottom: 0,
    },
  },
  dropOption: {
    padding: "3px 6px",
  },
  allLabels: {
    borderBottom: "1px solid rgba(0,0,0,.1)",
    padding: "8px 6px",
    margin: "0",
  },
};
export default DropDownWithFilter;


text:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

   <title>LabelMe Matlab Toolbox</title>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
 <LINK REL="SHORTCUT ICON" HREF="http://people.csail.mit.edu/brussell/research/LabelMe/favicon16.ico">
 <META NAME="KEYWORDS"
 CONTENT="LabelMe, open annotation tool, images, database, matlab, object">

       Release April 15, 2008

MATLAB Toolbox for the LabelMe Image
        Database

          written by Antonio Torralba, Bryan Russell
        and William Freeman

        (c) 2008 MIT, Computer Science and Artificial Intelligence Laboratory.

        LabelMe
        is a WEB-based image annotation tool that allows researchers to label
        images and share the annotations with the rest of the community. If you
        use this toolbox, we only ask you to contribute to the database, from
        time to time, by using the labeling tool.

      Citation
If you use this dataset
        or the functions on this toolbox, we would appreciate if you cite:

B. C. Russell, A. Torralba, K. P. Murphy, W. T. Freeman, LabelMe:
        a database and web-based tool for image annotation. International
        Journal of Computer Vision, pages 157-173, Volume 77, Numbers 1-3, May,
        2008. (PDF)

Contribute to the dataset

If you find this dataset useful, you can help us to make it larger by
        visiting the annotation tool and labeling several objects. Even if your
        contribution seems small compared to the size of the dataset, everything
        counts! We also welcome submissions of copyright free images.
        Your annotations and images will be made available for download inmediately.

Here there are some examples of annotated images:

Content

1. Download

          2. A quick look into the dataset

          3. List of functions in the toolbox

          4. Using the toolbox

          4.1. Basic functions: indexing, queries

          4.2. Searching objects by viewpoint

          4.3. Depth ordering of polygons

          4.4. Object part hierarchies

          5. Communcation with the online tool

       Download the LabelMe toolbox

      Download the toolbox and add it to the
      Matlab path.

 A quick look into the dataset

The toolbox allows you using the dataset online without needing to download
        it first. Just execute the next lines to visualize the content of one
        of the folders of the collection:

        HOMEANNOTATIONS = 'http://labelme.csail.mit.edu/Annotations';

        HOMEIMAGES = 'http://labelme.csail.mit.edu/Images';

        D = LMdatabase(HOMEANNOTATIONS, {'static_street_statacenter_cambridge_outdoor_2005'});

        LMdbshowscenes(D, HOMEIMAGES);

        (Installing a
        local copy of the database will allow you a faster access and will reduce
        the load on our server).

 3. List of functions in the toolbox

Introduction

        demo - contains examples of how to use several functions.
        To see more examples visit our FAQ
        page.

      LabelMe tools for reading and ploting the annotations of individual files

      LMread - reads one image and the corresponding annotation
      XML file

      LMplot - image and polygons visualization

      LabelMe Database tools

      LMdatabase - loads all the annotations into a
      big database struct

      LMdbshowscenes - shows thumbnails for the
      all the images in the database

      LMdbshowobjects - shows crops of the objects
      in the database.

      LMobjectnames - returns a list with the name
      of all the objects in the database

      LMobjectindex - retuns the indices of an object
      class within the annotation struct

      LMcountobject - counts the number of instances
      of an object class in every image

       Search tools

      LMquery - performs a query on the database using
      any field

      LMobjectpolygon - search for objects using
      shape matching

      qLabelme - search using the online search tool
      (it does not use the local index)

      Image manipulation

      LMimread - reads one image from the database

      LMimscale - scales the image and the corresponding
      annotation

      LMimcrop - crops the image and the corresponding
      annotation

      LMimpad - pads an image with PADVAL and modifies
      the annotation

      Annotation consistency and synonym lists

      LMreplaceobjectname - replaces object
      names

      LMaddtags - Replaces LabelMe object descriptions
      with the names in the list tags.txt. You can extend
      this list to include more synonyms. Use this function to reduce the variability
      on object labels used to describe the same object class. However, the original
      labelme descriptions contain information that is more specific and you might
      want to generate other tag files to account for a specific level of description.

        Objects, polygons and segmentation

        LMobjectpolygon - returns all the polygons
        for an object class within an image

		LMobjectboundingbox - returns bounding
      boxes

        LMobjectmask - returns the segmentation mask
        for all object instances of one class within an image

      LMobjectsinsideimage - removes polygons
      outside the image boundary

      LMobjectcrop - crops one selected object

      LM2segments - transforms all the labelme labels
      into segmentation masks (it takes into account occlusions).

      LMsortlayers - returns the same annotation
      file, but the objects are sorted by depth.

      Creation of training and test images and databases

      LMcookimage - reformat an image and annotation
      to fit certain requirements.

      LMcookdatabase - create tuned databases (you
      can control the difficulty, the object size, ...)

      Communication with online annotation tool

      LMphotoalbum - creates a web page with thumbnails
      and connected to LabelMe online.

      LMthumbnailsbar - creates a bar of thumbnails
      connected to LabelMe online

      urldir - like 'dir' but takes as argument a web address

      LMgetfolderlist - returns the list of folders
      from the online database

      Install and update images and annotations

      LMinstall - installs the database

      LMupdate - authomatic update of the annotations
      for specific files

      LMprogressiveinstall - will update
      your local copy of the images with only the new images and also download
      all of the annotations

      Translation from/to other formats

      PAS2LM - Translates PASCAL format to LabelMe

      LM2OpenCV - will output a query in format usable
      for OpenCV Haar

      Evaluation for object detection

      LMrecallPrecision - Precision-recall curve

      XML tools (translates the XML files into MATLAB struct arrays)

      writeXML - translates a struct array into a XML
      file

      loadXML - read XML file

      drawXML - shows the image and plots the polygons

      xml2struct - translates a XML string into a matlab
      struct

      struct2xml - translates a matlab struct into
      a XML string

       Object detection code

      A
      simple object detector using boosting - object detection with boosting
      trained with this dataset

4. Using the toolbox

First, you need to download the LabelMe
        database or you need to provide the url of the images and annotations
        online. If you are going to use the dataset frequently, it is better that
        you get a local copy.

Define the root folder for the images

        HOMEIMAGES = 'C:\yourpath\Images'; % you can set here your default folder

        HOMEANNOTATIONS = 'C:\yourpath\Annotations'; % you can set here your default
        folder

4.1 - Basic functions: indexing, queries

The most common functions are LMdatabase, LMimread, and LMquery.

        % This line reads the entire database into a Matlab struct

        Dlabelme = LMdatabase(HOMEANNOTATIONS);

        % Street scenes

        % To get images that have trees, buildings and roads:

        [D,j1] = LMquery(Dlabelme, 'object.name', 'building');

        [D,j2] = LMquery(Dlabelme, 'object.name', 'road');

        [D,j3] = LMquery(Dlabelme, 'object.name', 'tree');

        j = intersect(intersect(j1,j2),j3);

        LMdbshowscenes(LMquery(Dlabelme(j), 'object.name', 'car,building,road,tree'),
        HOMEIMAGES);

% You can query the database looking for specific objects and visualize each instance in isolation:

LMdbshowobjects(LMquery(database, 'object.name', 'bottle'), HOMEIMAGES);

        4.2 - Synonyms and unification of the LabelMe descriptions

As there are not specific instructions about how labels should be introduced
        when using the online annotation tool, this results in different text
        descriptions used for the same object category. For instace, a person
        can be described as a "person", "pedestrian", "person
        walking", "kid", etc.

The function LMaddtags replaces
        LabelMe object descriptions with the names in the list tags.txt.
        You can extend this list to include more synonyms. Use this function to
        reduce the variability on object labels used to describe the same object
        class. However, the original labelme descriptions contain information
        that is more specific and you might want to generate other tag files to
        account for a specific level of description.

4.3 - Searching objects by viewpoint

Some objects have information related to viewpoint in the annotation
        file. In the current setup, viewpoints are discretized in 12 different
        orientations. For instance, for cars we have:

In order to get all the frontal cars you can use the query:

D = LMquery(Dlabelme, 'object.name', 'car+az270deg'');

We have a tool that allows labeling viewpoints for new objects. If you
        want to add viewpoint information for new objects send us an email and
        we will send you a link to the tool. By using the online tool, the data
        that you will provide can be used in the future by other researchers.

4.3 Searching fully annotated images

4.4 - Depth ordering

Frequently, an image will contain many partially overlapping polygons.
        This situation arises when users complete an occluded boundary or when
        labeling large regions containing small occluding objects. In these situations
        we need to know which polygon is on top in order to assign the image pixels
        to the correct object label.

The function LMsortlayers will sort the polygons accorting to
        their relative depth ordering. The function uses some heuristics (see
        paper) and it will not be correct all the time.

4.5 - Object part hierarchies

Despite that object parts are not explicitly labeled as such by the annotation
        tool, it is posible to authomatically discover object-part hierarchies.
        When two polygons have a high degree of overlap across many images, this
        provides evidence for an object-part hierarchy. The toolbox provides a
        set of functions to suggest parts for an object category. The function
        partsof will add a new field to each object.

The online query tool shows object parts whenever they are labeled. Here
        there are some examples:

In order to add parts to the object 'car', run the next line:

D = partsof(Dlabelme, 'car', 'wheel,door,window,tire,mirror,license+plate,windshield,headlight,light');

5 - Communication with the
        online tool

You can look in the demo.m file, at the end there is a description that
        explains how can you talk, using Matlab, with the online annotation tool
        to label only the images that you want and how to get back just those
        labels and update you annotation file. The effect is like if the annotation
        tool was just working for you, but still all the annotations that you
        will enter will be shared and stored online.

        The first function you have to look at is:

        LMphotoalbum(folderlist, filelist, webpagename, HOMEIMAGES);

        This function will create a web page with thumbnails with the images that
        you want (look at demo.m to see how to use this with LMquery).
        If you click in any thumbnail it will open LabelMe online showing that
        image and allowing you to add polygons to it.

        Once you are done labeling images, you can update the annotations using:

        LMupdate(folderlist, filelist, HOMEIMAGES, HOMEANNOTATIONS);

        This function reads the annotations from the web and replaces your local
        files with the new ones. So, you can get inmediately all the labels you
        enter.

        The result is that the system will behave as if you had a local copy of
        the annotation tool. And still, everything that you will label, will be
        shared.

        The next command creates a web page that adds thumbnails to the LabelMe
        annotation tool:

        LMthumbnailsbar(folderlist, filelist, 'myphotoalbum.html', HOMEIMAGES);

        The web page created will look like this:

(c) 2008 MIT, Computer Science and Artificial Intelligence Laboratory.


text:
/**
 *
 */
package org.hamster.weixinmp.dao.entity.resp;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemMusicEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemThumbEntity;

/**
 * @author honey.zhao@aliyun.com
 * @version Jul 28, 2013
 *
 */
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "resp_music")
public class WxRespMusicEntity extends WxBaseRespEntity {
	@ManyToOne
	@JoinColumn(name = "music_id", nullable = false)
	private WxItemMusicEntity music;
	@ManyToOne
	@JoinColumn(name = "thumb_id", nullable = false)
	private WxItemThumbEntity thumb;
	public WxItemMusicEntity getMusic() {
		return music;
	}
	public void setMusic(WxItemMusicEntity music) {
		this.music = music;
	}
	public WxItemThumbEntity getThumb() {
		return thumb;
	}
	public void setThumb(WxItemThumbEntity thumb) {
		this.thumb = thumb;
	}
	public WxRespMusicEntity() {
		super();
		// TODO Auto-generated constructor stub
	}
	public WxRespMusicEntity(WxItemMusicEntity music, WxItemThumbEntity thumb) {
		super();
		this.music = music;
		this.thumb = thumb;
	}
	@Override
	public String toString() {
		return "WxRespMusicEntity [music=" + music + ", thumb=" + thumb + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((music == null) ? 0 : music.hashCode());
		result = prime * result + ((thumb == null) ? 0 : thumb.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		WxRespMusicEntity other = (WxRespMusicEntity) obj;
		if (music == null) {
			if (other.music != null)
				return false;
		} else if (!music.equals(other.music))
			return false;
		if (thumb == null) {
			if (other.thumb != null)
				return false;
		} else if (!thumb.equals(other.thumb))
			return false;
		return true;
	}

}


text:
[![Build Status](https://travis-ci.org/phpbadge/phpbadge.svg?branch=master)](https://travis-ci.org/phpbadge/phpbadge)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phpbadge/phpbadge/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phpbadge/phpbadge/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/phpbadge/phpbadge/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/phpbadge/phpbadge/?branch=master)
[![Dependency Status](https://www.versioneye.com/user/projects/55394d401d2989cb7800001d/badge.svg?style=flat)](https://www.versioneye.com/user/projects/55394d401d2989cb7800001d)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/1c61e728-9b88-4e82-9d95-f91dc4cd6b93/mini.png)](https://insight.sensiolabs.com/projects/1c61e728-9b88-4e82-9d95-f91dc4cd6b93)

A PHP library to build badges as seen in README's of many open source libraries.

## Getting started

It's recommended to install this library via [Composer](https://getcomposer.org).

```bash
composer require phpbadge/phpbadge
```

The current master branch is considered stable. The badges on top of this document should confirm this.

## Requirements

As from version 2.0.0 this library needs a PHP version >= 7.1.

Older version of the library run on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7 and HHVM.

## Example

```php
<?php

use PHP\Badge\Badge;
use PHP\Badge\Font\Font;
use PHP\Badge\Font\GdDimensionCalculator;
use PHP\Badge\Part;
use PHP\Badge\Renderer\SvgRenderer;

require 'vendor/autoload.php';

$badge = new Badge();
$badge->setBorderRadius(3);
$badge->addPart(new Part('build', '#555', '#fff', new Font(11, 'verdana', 'fonts/verdana.ttf')));
$badge->addPart(new Part('passing', '#4c1', '#fff', new Font(11, 'verdana', 'fonts/verdana.ttf')));

$renderer = new SvgRenderer(new GdDimensionCalculator());

echo $renderer->render($badge);
```


text:
import DS from 'ember-data';
import Ember from 'ember';
import Page from 'ember-cli-static/models/page';
import moment from 'moment';

export default Page.extend({
  date: DS.attr('date'),
  category: DS.attr('string'),
  tags: DS.attr('array'),

  splitID: Ember.computed('id', function() {
    return this.get('id').split('-');
  }),

  dateFromID: Ember.computed('splitID', function() {
    var splitID = this.get('splitID');
    return [splitID[0], splitID[1], splitID[2]].join('-');
  }),

  year: Ember.computed('dateFromID', function() {
    return moment(this.get('dateFromID')).format('YYYY');
  }),

  month: Ember.computed('dateFromID', function() {
    return moment(this.get('dateFromID')).format('MM');
  }),

  day: Ember.computed('dateFromID', function() {
    return moment(this.get('dateFromID')).format('DD');
  }),

  formattedDate: function() {
    return moment(this.get('date')).fromNow();
  }.property('date'),

  name: Ember.computed('id,dateFromID', function() {
    return this
    return this.get('id').split(this.get('dateFromID')+'-').join('');
  })
});