repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
nicolargo/glances
glances/plugins/glances_hddtemp.py
GlancesGrabHDDTemp.fetch
def fetch(self): """Fetch the data from hddtemp daemon.""" # Taking care of sudden deaths/stops of hddtemp daemon try: sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sck.connect((self.host, self.port)) data = b'' while True: ...
python
def fetch(self): """Fetch the data from hddtemp daemon.""" # Taking care of sudden deaths/stops of hddtemp daemon try: sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sck.connect((self.host, self.port)) data = b'' while True: ...
[ "def", "fetch", "(", "self", ")", ":", "# Taking care of sudden deaths/stops of hddtemp daemon", "try", ":", "sck", "=", "socket", ".", "socket", "(", "socket", ".", "AF_INET", ",", "socket", ".", "SOCK_STREAM", ")", "sck", ".", "connect", "(", "(", "self", ...
Fetch the data from hddtemp daemon.
[ "Fetch", "the", "data", "from", "hddtemp", "daemon", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_hddtemp.py#L132-L155
train
tgalal/yowsup
yowsup/axolotl/manager.py
AxolotlManager.set_prekeys_as_sent
def set_prekeys_as_sent(self, prekeyIds): """ :param prekeyIds: :type prekeyIds: list :return: :rtype: """ logger.debug("set_prekeys_as_sent(prekeyIds=[%d prekeyIds])" % len(prekeyIds)) self._store.preKeyStore.setAsSent([prekey.getId() for prekey in prekey...
python
def set_prekeys_as_sent(self, prekeyIds): """ :param prekeyIds: :type prekeyIds: list :return: :rtype: """ logger.debug("set_prekeys_as_sent(prekeyIds=[%d prekeyIds])" % len(prekeyIds)) self._store.preKeyStore.setAsSent([prekey.getId() for prekey in prekey...
[ "def", "set_prekeys_as_sent", "(", "self", ",", "prekeyIds", ")", ":", "logger", ".", "debug", "(", "\"set_prekeys_as_sent(prekeyIds=[%d prekeyIds])\"", "%", "len", "(", "prekeyIds", ")", ")", "self", ".", "_store", ".", "preKeyStore", ".", "setAsSent", "(", "["...
:param prekeyIds: :type prekeyIds: list :return: :rtype:
[ ":", "param", "prekeyIds", ":", ":", "type", "prekeyIds", ":", "list", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/axolotl/manager.py#L86-L94
train
tgalal/yowsup
yowsup/axolotl/manager.py
AxolotlManager.encrypt
def encrypt(self, recipient_id, message): logger.debug("encrypt(recipientid=%s, message=%s)" % (recipient_id, message)) """ :param recipient_id: :type recipient_id: str :param data: :type data: bytes :return: :rtype: """ cipher = self._get_...
python
def encrypt(self, recipient_id, message): logger.debug("encrypt(recipientid=%s, message=%s)" % (recipient_id, message)) """ :param recipient_id: :type recipient_id: str :param data: :type data: bytes :return: :rtype: """ cipher = self._get_...
[ "def", "encrypt", "(", "self", ",", "recipient_id", ",", "message", ")", ":", "logger", ".", "debug", "(", "\"encrypt(recipientid=%s, message=%s)\"", "%", "(", "recipient_id", ",", "message", ")", ")", "cipher", "=", "self", ".", "_get_session_cipher", "(", "r...
:param recipient_id: :type recipient_id: str :param data: :type data: bytes :return: :rtype:
[ ":", "param", "recipient_id", ":", ":", "type", "recipient_id", ":", "str", ":", "param", "data", ":", ":", "type", "data", ":", "bytes", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/axolotl/manager.py#L147-L158
train
tgalal/yowsup
yowsup/axolotl/manager.py
AxolotlManager.group_encrypt
def group_encrypt(self, groupid, message): """ :param groupid: :type groupid: str :param message: :type message: bytes :return: :rtype: """ logger.debug("group_encrypt(groupid=%s, message=%s)" % (groupid, message)) group_cipher = self._get_...
python
def group_encrypt(self, groupid, message): """ :param groupid: :type groupid: str :param message: :type message: bytes :return: :rtype: """ logger.debug("group_encrypt(groupid=%s, message=%s)" % (groupid, message)) group_cipher = self._get_...
[ "def", "group_encrypt", "(", "self", ",", "groupid", ",", "message", ")", ":", "logger", ".", "debug", "(", "\"group_encrypt(groupid=%s, message=%s)\"", "%", "(", "groupid", ",", "message", ")", ")", "group_cipher", "=", "self", ".", "_get_group_cipher", "(", ...
:param groupid: :type groupid: str :param message: :type message: bytes :return: :rtype:
[ ":", "param", "groupid", ":", ":", "type", "groupid", ":", "str", ":", "param", "message", ":", ":", "type", "message", ":", "bytes", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/axolotl/manager.py#L192-L203
train
tgalal/yowsup
yowsup/axolotl/manager.py
AxolotlManager.group_create_session
def group_create_session(self, groupid, participantid, skmsgdata): """ :param groupid: :type groupid: str :param participantid: :type participantid: str :param skmsgdata: :type skmsgdata: bytearray :return: :rtype: """ logger.debug(...
python
def group_create_session(self, groupid, participantid, skmsgdata): """ :param groupid: :type groupid: str :param participantid: :type participantid: str :param skmsgdata: :type skmsgdata: bytearray :return: :rtype: """ logger.debug(...
[ "def", "group_create_session", "(", "self", ",", "groupid", ",", "participantid", ",", "skmsgdata", ")", ":", "logger", ".", "debug", "(", "\"group_create_session(groupid=%s, participantid=%s, skmsgdata=[omitted])\"", "%", "(", "groupid", ",", "participantid", ")", ")",...
:param groupid: :type groupid: str :param participantid: :type participantid: str :param skmsgdata: :type skmsgdata: bytearray :return: :rtype:
[ ":", "param", "groupid", ":", ":", "type", "groupid", ":", "str", ":", "param", "participantid", ":", ":", "type", "participantid", ":", "str", ":", "param", "skmsgdata", ":", ":", "type", "skmsgdata", ":", "bytearray", ":", "return", ":", ":", "rtype", ...
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/axolotl/manager.py#L220-L235
train
tgalal/yowsup
yowsup/axolotl/manager.py
AxolotlManager.create_session
def create_session(self, username, prekeybundle, autotrust=False): """ :param username: :type username: str :param prekeybundle: :type prekeybundle: PreKeyBundle :return: :rtype: """ logger.debug("create_session(username=%s, prekeybunder=[omitted],...
python
def create_session(self, username, prekeybundle, autotrust=False): """ :param username: :type username: str :param prekeybundle: :type prekeybundle: PreKeyBundle :return: :rtype: """ logger.debug("create_session(username=%s, prekeybunder=[omitted],...
[ "def", "create_session", "(", "self", ",", "username", ",", "prekeybundle", ",", "autotrust", "=", "False", ")", ":", "logger", ".", "debug", "(", "\"create_session(username=%s, prekeybunder=[omitted], autotrust=%s)\"", "%", "(", "username", ",", "autotrust", ")", "...
:param username: :type username: str :param prekeybundle: :type prekeybundle: PreKeyBundle :return: :rtype:
[ ":", "param", "username", ":", ":", "type", "username", ":", "str", ":", "param", "prekeybundle", ":", ":", "type", "prekeybundle", ":", "PreKeyBundle", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/axolotl/manager.py#L237-L254
train
tgalal/yowsup
yowsup/axolotl/manager.py
AxolotlManager.session_exists
def session_exists(self, username): """ :param username: :type username: str :return: :rtype: """ logger.debug("session_exists(%s)?" % username) return self._store.containsSession(username, 1)
python
def session_exists(self, username): """ :param username: :type username: str :return: :rtype: """ logger.debug("session_exists(%s)?" % username) return self._store.containsSession(username, 1)
[ "def", "session_exists", "(", "self", ",", "username", ")", ":", "logger", ".", "debug", "(", "\"session_exists(%s)?\"", "%", "username", ")", "return", "self", ".", "_store", ".", "containsSession", "(", "username", ",", "1", ")" ]
:param username: :type username: str :return: :rtype:
[ ":", "param", "username", ":", ":", "type", "username", ":", "str", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/axolotl/manager.py#L256-L264
train
tgalal/yowsup
yowsup/config/transforms/props.py
PropsTransform.transform
def transform(self, data): """ :param data: :type data: dict :return: :rtype: dict """ out = {} for key, val in data.items(): if key in self._transform_map: target = self._transform_map[key] key, val = target(key...
python
def transform(self, data): """ :param data: :type data: dict :return: :rtype: dict """ out = {} for key, val in data.items(): if key in self._transform_map: target = self._transform_map[key] key, val = target(key...
[ "def", "transform", "(", "self", ",", "data", ")", ":", "out", "=", "{", "}", "for", "key", ",", "val", "in", "data", ".", "items", "(", ")", ":", "if", "key", "in", "self", ".", "_transform_map", ":", "target", "=", "self", ".", "_transform_map", ...
:param data: :type data: dict :return: :rtype: dict
[ ":", "param", "data", ":", ":", "type", "data", ":", "dict", ":", "return", ":", ":", "rtype", ":", "dict" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/config/transforms/props.py#L10-L26
train
tgalal/yowsup
yowsup/config/manager.py
ConfigManager.load
def load(self, username): """ :param username: :type username: :return: :rtype: """ config_dir = StorageTools.getStorageForPhone(username) logger.debug("Detecting config for username=%s, dir=%s" % (username, config_dir)) exhausted = [] for ...
python
def load(self, username): """ :param username: :type username: :return: :rtype: """ config_dir = StorageTools.getStorageForPhone(username) logger.debug("Detecting config for username=%s, dir=%s" % (username, config_dir)) exhausted = [] for ...
[ "def", "load", "(", "self", ",", "username", ")", ":", "config_dir", "=", "StorageTools", ".", "getStorageForPhone", "(", "username", ")", "logger", ".", "debug", "(", "\"Detecting config for username=%s, dir=%s\"", "%", "(", "username", ",", "config_dir", ")", ...
:param username: :type username: :return: :rtype:
[ ":", "param", "username", ":", ":", "type", "username", ":", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/config/manager.py#L33-L56
train
tgalal/yowsup
yowsup/config/manager.py
ConfigManager._type_to_str
def _type_to_str(self, type): """ :param type: :type type: int :return: :rtype: """ for key, val in self.TYPE_NAMES.items(): if key == type: return val
python
def _type_to_str(self, type): """ :param type: :type type: int :return: :rtype: """ for key, val in self.TYPE_NAMES.items(): if key == type: return val
[ "def", "_type_to_str", "(", "self", ",", "type", ")", ":", "for", "key", ",", "val", "in", "self", ".", "TYPE_NAMES", ".", "items", "(", ")", ":", "if", "key", "==", "type", ":", "return", "val" ]
:param type: :type type: int :return: :rtype:
[ ":", "param", "type", ":", ":", "type", "type", ":", "int", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/config/manager.py#L58-L67
train
tgalal/yowsup
yowsup/config/manager.py
ConfigManager.load_path
def load_path(self, path): """ :param path: :type path: :return: :rtype: """ logger.debug("load_path(path=%s)" % path) if os.path.isfile(path): configtype = self.guess_type(path) logger.debug("Detected config type: %s" % self._type_...
python
def load_path(self, path): """ :param path: :type path: :return: :rtype: """ logger.debug("load_path(path=%s)" % path) if os.path.isfile(path): configtype = self.guess_type(path) logger.debug("Detected config type: %s" % self._type_...
[ "def", "load_path", "(", "self", ",", "path", ")", ":", "logger", ".", "debug", "(", "\"load_path(path=%s)\"", "%", "path", ")", "if", "os", ".", "path", ".", "isfile", "(", "path", ")", ":", "configtype", "=", "self", ".", "guess_type", "(", "path", ...
:param path: :type path: :return: :rtype:
[ ":", "param", "path", ":", ":", "type", "path", ":", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/config/manager.py#L69-L89
train
tgalal/yowsup
yowsup/layers/axolotl/layer_control.py
AxolotlControlLayer.receive
def receive(self, protocolTreeNode): """ :type protocolTreeNode: ProtocolTreeNode """ if not self.processIqRegistry(protocolTreeNode): if protocolTreeNode.tag == "notification" and protocolTreeNode["type"] == "encrypt": self.onEncryptNotification(protocolTreeN...
python
def receive(self, protocolTreeNode): """ :type protocolTreeNode: ProtocolTreeNode """ if not self.processIqRegistry(protocolTreeNode): if protocolTreeNode.tag == "notification" and protocolTreeNode["type"] == "encrypt": self.onEncryptNotification(protocolTreeN...
[ "def", "receive", "(", "self", ",", "protocolTreeNode", ")", ":", "if", "not", "self", ".", "processIqRegistry", "(", "protocolTreeNode", ")", ":", "if", "protocolTreeNode", ".", "tag", "==", "\"notification\"", "and", "protocolTreeNode", "[", "\"type\"", "]", ...
:type protocolTreeNode: ProtocolTreeNode
[ ":", "type", "protocolTreeNode", ":", "ProtocolTreeNode" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/layers/axolotl/layer_control.py#L24-L32
train
tgalal/yowsup
yowsup/layers/axolotl/layer_control.py
AxolotlControlLayer.flush_keys
def flush_keys(self, signed_prekey, prekeys, reboot_connection=False): """ sends prekeys :return: :rtype: """ preKeysDict = {} for prekey in prekeys: keyPair = prekey.getKeyPair() preKeysDict[self.adjustId(prekey.getId())] = self.adjustArra...
python
def flush_keys(self, signed_prekey, prekeys, reboot_connection=False): """ sends prekeys :return: :rtype: """ preKeysDict = {} for prekey in prekeys: keyPair = prekey.getKeyPair() preKeysDict[self.adjustId(prekey.getId())] = self.adjustArra...
[ "def", "flush_keys", "(", "self", ",", "signed_prekey", ",", "prekeys", ",", "reboot_connection", "=", "False", ")", ":", "preKeysDict", "=", "{", "}", "for", "prekey", "in", "prekeys", ":", "keyPair", "=", "prekey", ".", "getKeyPair", "(", ")", "preKeysDi...
sends prekeys :return: :rtype:
[ "sends", "prekeys", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/layers/axolotl/layer_control.py#L72-L98
train
tgalal/yowsup
yowsup/stacks/yowstack.py
YowStackBuilder.getDefaultStack
def getDefaultStack(layer = None, axolotl = False, groups = True, media = True, privacy = True, profiles = True): """ :param layer: An optional layer to put on top of default stack :param axolotl: E2E encryption enabled/ disabled :return: YowStack """ allLayers = YowStac...
python
def getDefaultStack(layer = None, axolotl = False, groups = True, media = True, privacy = True, profiles = True): """ :param layer: An optional layer to put on top of default stack :param axolotl: E2E encryption enabled/ disabled :return: YowStack """ allLayers = YowStac...
[ "def", "getDefaultStack", "(", "layer", "=", "None", ",", "axolotl", "=", "False", ",", "groups", "=", "True", ",", "media", "=", "True", ",", "privacy", "=", "True", ",", "profiles", "=", "True", ")", ":", "allLayers", "=", "YowStackBuilder", ".", "ge...
:param layer: An optional layer to put on top of default stack :param axolotl: E2E encryption enabled/ disabled :return: YowStack
[ ":", "param", "layer", ":", "An", "optional", "layer", "to", "put", "on", "top", "of", "default", "stack", ":", "param", "axolotl", ":", "E2E", "encryption", "enabled", "/", "disabled", ":", "return", ":", "YowStack" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/stacks/yowstack.py#L82-L94
train
tgalal/yowsup
yowsup/layers/interface/interface.py
YowInterfaceLayer.processIqRegistry
def processIqRegistry(self, entity): """ :type entity: IqProtocolEntity """ if entity.getTag() == "iq": iq_id = entity.getId() if iq_id in self.iqRegistry: originalIq, successClbk, errorClbk = self.iqRegistry[iq_id] del self.iqRegis...
python
def processIqRegistry(self, entity): """ :type entity: IqProtocolEntity """ if entity.getTag() == "iq": iq_id = entity.getId() if iq_id in self.iqRegistry: originalIq, successClbk, errorClbk = self.iqRegistry[iq_id] del self.iqRegis...
[ "def", "processIqRegistry", "(", "self", ",", "entity", ")", ":", "if", "entity", ".", "getTag", "(", ")", "==", "\"iq\"", ":", "iq_id", "=", "entity", ".", "getId", "(", ")", "if", "iq_id", "in", "self", ".", "iqRegistry", ":", "originalIq", ",", "s...
:type entity: IqProtocolEntity
[ ":", "type", "entity", ":", "IqProtocolEntity" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/layers/interface/interface.py#L45-L61
train
tgalal/yowsup
yowsup/config/transforms/dict_keyval.py
DictKeyValTransform.transform
def transform(self, data): """ :param data: :type data: dict :return: :rtype: """ out=[] keys = sorted(data.keys()) for k in keys: out.append("%s=%s" % (k, data[k])) return "\n".join(out)
python
def transform(self, data): """ :param data: :type data: dict :return: :rtype: """ out=[] keys = sorted(data.keys()) for k in keys: out.append("%s=%s" % (k, data[k])) return "\n".join(out)
[ "def", "transform", "(", "self", ",", "data", ")", ":", "out", "=", "[", "]", "keys", "=", "sorted", "(", "data", ".", "keys", "(", ")", ")", "for", "k", "in", "keys", ":", "out", ".", "append", "(", "\"%s=%s\"", "%", "(", "k", ",", "data", "...
:param data: :type data: dict :return: :rtype:
[ ":", "param", "data", ":", ":", "type", "data", ":", "dict", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/config/transforms/dict_keyval.py#L5-L16
train
tgalal/yowsup
yowsup/config/base/serialize.py
ConfigSerialize.serialize
def serialize(self, config): """ :param config: :type config: yowsup.config.base.config.Config :return: :rtype: bytes """ for transform in self._transforms: config = transform.transform(config) return config
python
def serialize(self, config): """ :param config: :type config: yowsup.config.base.config.Config :return: :rtype: bytes """ for transform in self._transforms: config = transform.transform(config) return config
[ "def", "serialize", "(", "self", ",", "config", ")", ":", "for", "transform", "in", "self", ".", "_transforms", ":", "config", "=", "transform", ".", "transform", "(", "config", ")", "return", "config" ]
:param config: :type config: yowsup.config.base.config.Config :return: :rtype: bytes
[ ":", "param", "config", ":", ":", "type", "config", ":", "yowsup", ".", "config", ".", "base", ".", "config", ".", "Config", ":", "return", ":", ":", "rtype", ":", "bytes" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/config/base/serialize.py#L6-L15
train
tgalal/yowsup
yowsup/config/base/serialize.py
ConfigSerialize.deserialize
def deserialize(self, data): """ :type cls: type :param data: :type data: bytes :return: :rtype: yowsup.config.base.config.Config """ for transform in self._transforms[::-1]: data = transform.reverse(data) return data
python
def deserialize(self, data): """ :type cls: type :param data: :type data: bytes :return: :rtype: yowsup.config.base.config.Config """ for transform in self._transforms[::-1]: data = transform.reverse(data) return data
[ "def", "deserialize", "(", "self", ",", "data", ")", ":", "for", "transform", "in", "self", ".", "_transforms", "[", ":", ":", "-", "1", "]", ":", "data", "=", "transform", ".", "reverse", "(", "data", ")", "return", "data" ]
:type cls: type :param data: :type data: bytes :return: :rtype: yowsup.config.base.config.Config
[ ":", "type", "cls", ":", "type", ":", "param", "data", ":", ":", "type", "data", ":", "bytes", ":", "return", ":", ":", "rtype", ":", "yowsup", ".", "config", ".", "base", ".", "config", ".", "Config" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/config/base/serialize.py#L17-L27
train
tgalal/yowsup
yowsup/axolotl/store/sqlite/litesenderkeystore.py
LiteSenderKeyStore.storeSenderKey
def storeSenderKey(self, senderKeyName, senderKeyRecord): """ :type senderKeyName: SenderKeName :type senderKeyRecord: SenderKeyRecord """ q = "INSERT INTO sender_keys (group_id, sender_id, record) VALUES(?,?, ?)" cursor = self.dbConn.cursor() serialized = senderK...
python
def storeSenderKey(self, senderKeyName, senderKeyRecord): """ :type senderKeyName: SenderKeName :type senderKeyRecord: SenderKeyRecord """ q = "INSERT INTO sender_keys (group_id, sender_id, record) VALUES(?,?, ?)" cursor = self.dbConn.cursor() serialized = senderK...
[ "def", "storeSenderKey", "(", "self", ",", "senderKeyName", ",", "senderKeyRecord", ")", ":", "q", "=", "\"INSERT INTO sender_keys (group_id, sender_id, record) VALUES(?,?, ?)\"", "cursor", "=", "self", ".", "dbConn", ".", "cursor", "(", ")", "serialized", "=", "sende...
:type senderKeyName: SenderKeName :type senderKeyRecord: SenderKeyRecord
[ ":", "type", "senderKeyName", ":", "SenderKeName", ":", "type", "senderKeyRecord", ":", "SenderKeyRecord" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/axolotl/store/sqlite/litesenderkeystore.py#L17-L34
train
tgalal/yowsup
yowsup/axolotl/store/sqlite/litesenderkeystore.py
LiteSenderKeyStore.loadSenderKey
def loadSenderKey(self, senderKeyName): """ :type senderKeyName: SenderKeyName """ q = "SELECT record FROM sender_keys WHERE group_id = ? and sender_id = ?" cursor = self.dbConn.cursor() cursor.execute(q, (senderKeyName.getGroupId(), senderKeyName.getSender().getName())) ...
python
def loadSenderKey(self, senderKeyName): """ :type senderKeyName: SenderKeyName """ q = "SELECT record FROM sender_keys WHERE group_id = ? and sender_id = ?" cursor = self.dbConn.cursor() cursor.execute(q, (senderKeyName.getGroupId(), senderKeyName.getSender().getName())) ...
[ "def", "loadSenderKey", "(", "self", ",", "senderKeyName", ")", ":", "q", "=", "\"SELECT record FROM sender_keys WHERE group_id = ? and sender_id = ?\"", "cursor", "=", "self", ".", "dbConn", ".", "cursor", "(", ")", "cursor", ".", "execute", "(", "q", ",", "(", ...
:type senderKeyName: SenderKeyName
[ ":", "type", "senderKeyName", ":", "SenderKeyName" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/axolotl/store/sqlite/litesenderkeystore.py#L36-L47
train
tgalal/yowsup
yowsup/layers/protocol_media/layer.py
YowMediaProtocolLayer.sendIq
def sendIq(self, entity): """ :type entity: IqProtocolEntity """ if entity.getType() == IqProtocolEntity.TYPE_SET and entity.getXmlns() == "w:m": #media upload! self._sendIq(entity, self.onRequestUploadSuccess, self.onRequestUploadError)
python
def sendIq(self, entity): """ :type entity: IqProtocolEntity """ if entity.getType() == IqProtocolEntity.TYPE_SET and entity.getXmlns() == "w:m": #media upload! self._sendIq(entity, self.onRequestUploadSuccess, self.onRequestUploadError)
[ "def", "sendIq", "(", "self", ",", "entity", ")", ":", "if", "entity", ".", "getType", "(", ")", "==", "IqProtocolEntity", ".", "TYPE_SET", "and", "entity", ".", "getXmlns", "(", ")", "==", "\"w:m\"", ":", "#media upload!", "self", ".", "_sendIq", "(", ...
:type entity: IqProtocolEntity
[ ":", "type", "entity", ":", "IqProtocolEntity" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/layers/protocol_media/layer.py#L56-L62
train
tgalal/yowsup
yowsup/layers/axolotl/layer_receive.py
AxolotlReceivelayer.receive
def receive(self, protocolTreeNode): """ :type protocolTreeNode: ProtocolTreeNode """ if not self.processIqRegistry(protocolTreeNode): if protocolTreeNode.tag == "message": self.onMessage(protocolTreeNode) elif not protocolTreeNode.tag == "receipt"...
python
def receive(self, protocolTreeNode): """ :type protocolTreeNode: ProtocolTreeNode """ if not self.processIqRegistry(protocolTreeNode): if protocolTreeNode.tag == "message": self.onMessage(protocolTreeNode) elif not protocolTreeNode.tag == "receipt"...
[ "def", "receive", "(", "self", ",", "protocolTreeNode", ")", ":", "if", "not", "self", ".", "processIqRegistry", "(", "protocolTreeNode", ")", ":", "if", "protocolTreeNode", ".", "tag", "==", "\"message\"", ":", "self", ".", "onMessage", "(", "protocolTreeNode...
:type protocolTreeNode: ProtocolTreeNode
[ ":", "type", "protocolTreeNode", ":", "ProtocolTreeNode" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/layers/axolotl/layer_receive.py#L25-L34
train
tgalal/yowsup
yowsup/layers/noise/layer.py
YowNoiseLayer.send
def send(self, data): """ :param data: :type data: bytearray | bytes :return: :rtype: """ data = bytes(data) if type(data) is not bytes else data self._wa_noiseprotocol.send(data)
python
def send(self, data): """ :param data: :type data: bytearray | bytes :return: :rtype: """ data = bytes(data) if type(data) is not bytes else data self._wa_noiseprotocol.send(data)
[ "def", "send", "(", "self", ",", "data", ")", ":", "data", "=", "bytes", "(", "data", ")", "if", "type", "(", "data", ")", "is", "not", "bytes", "else", "data", "self", ".", "_wa_noiseprotocol", ".", "send", "(", "data", ")" ]
:param data: :type data: bytearray | bytes :return: :rtype:
[ ":", "param", "data", ":", ":", "type", "data", ":", "bytearray", "|", "bytes", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/layers/noise/layer.py#L131-L139
train
tgalal/yowsup
yowsup/layers/noise/layer.py
YowNoiseLayer.receive
def receive(self, data): """ :param data: :type data: bytes :return: :rtype: """ self._incoming_segments_queue.put(data) if not self._in_handshake(): self._flush_incoming_buffer()
python
def receive(self, data): """ :param data: :type data: bytes :return: :rtype: """ self._incoming_segments_queue.put(data) if not self._in_handshake(): self._flush_incoming_buffer()
[ "def", "receive", "(", "self", ",", "data", ")", ":", "self", ".", "_incoming_segments_queue", ".", "put", "(", "data", ")", "if", "not", "self", ".", "_in_handshake", "(", ")", ":", "self", ".", "_flush_incoming_buffer", "(", ")" ]
:param data: :type data: bytes :return: :rtype:
[ ":", "param", "data", ":", ":", "type", "data", ":", "bytes", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/layers/noise/layer.py#L147-L156
train
tgalal/yowsup
yowsup/env/env.py
YowsupEnv.getCurrent
def getCurrent(cls): """ :rtype: YowsupEnv """ if cls.__CURR is None: env = DEFAULT envs = cls.getRegisteredEnvs() if env not in envs: env = envs[0] logger.debug("Env not set, setting it to %s" % env) cls.setEnv(...
python
def getCurrent(cls): """ :rtype: YowsupEnv """ if cls.__CURR is None: env = DEFAULT envs = cls.getRegisteredEnvs() if env not in envs: env = envs[0] logger.debug("Env not set, setting it to %s" % env) cls.setEnv(...
[ "def", "getCurrent", "(", "cls", ")", ":", "if", "cls", ".", "__CURR", "is", "None", ":", "env", "=", "DEFAULT", "envs", "=", "cls", ".", "getRegisteredEnvs", "(", ")", "if", "env", "not", "in", "envs", ":", "env", "=", "envs", "[", "0", "]", "lo...
:rtype: YowsupEnv
[ ":", "rtype", ":", "YowsupEnv" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/env/env.py#L49-L60
train
tgalal/yowsup
yowsup/common/http/warequest.py
WARequest.encryptParams
def encryptParams(self, params, key): """ :param params: :type params: list :param key: :type key: ECPublicKey :return: :rtype: list """ keypair = Curve.generateKeyPair() encodedparams = self.urlencodeParams(params) cipher = AESGCM...
python
def encryptParams(self, params, key): """ :param params: :type params: list :param key: :type key: ECPublicKey :return: :rtype: list """ keypair = Curve.generateKeyPair() encodedparams = self.urlencodeParams(params) cipher = AESGCM...
[ "def", "encryptParams", "(", "self", ",", "params", ",", "key", ")", ":", "keypair", "=", "Curve", ".", "generateKeyPair", "(", ")", "encodedparams", "=", "self", ".", "urlencodeParams", "(", "params", ")", "cipher", "=", "AESGCM", "(", "Curve", ".", "ca...
:param params: :type params: list :param key: :type key: ECPublicKey :return: :rtype: list
[ ":", "param", "params", ":", ":", "type", "params", ":", "list", ":", "param", "key", ":", ":", "type", "key", ":", "ECPublicKey", ":", "return", ":", ":", "rtype", ":", "list" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/common/http/warequest.py#L159-L175
train
tgalal/yowsup
yowsup/axolotl/store/sqlite/liteprekeystore.py
LitePreKeyStore.setAsSent
def setAsSent(self, prekeyIds): """ :param preKeyIds: :type preKeyIds: list :return: :rtype: """ for prekeyId in prekeyIds: q = "UPDATE prekeys SET sent_to_server = ? WHERE prekey_id = ?" cursor = self.dbConn.cursor() cursor.exe...
python
def setAsSent(self, prekeyIds): """ :param preKeyIds: :type preKeyIds: list :return: :rtype: """ for prekeyId in prekeyIds: q = "UPDATE prekeys SET sent_to_server = ? WHERE prekey_id = ?" cursor = self.dbConn.cursor() cursor.exe...
[ "def", "setAsSent", "(", "self", ",", "prekeyIds", ")", ":", "for", "prekeyId", "in", "prekeyIds", ":", "q", "=", "\"UPDATE prekeys SET sent_to_server = ? WHERE prekey_id = ?\"", "cursor", "=", "self", ".", "dbConn", ".", "cursor", "(", ")", "cursor", ".", "exec...
:param preKeyIds: :type preKeyIds: list :return: :rtype:
[ ":", "param", "preKeyIds", ":", ":", "type", "preKeyIds", ":", "list", ":", "return", ":", ":", "rtype", ":" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/axolotl/store/sqlite/liteprekeystore.py#L35-L46
train
tgalal/yowsup
yowsup/config/transforms/config_dict.py
ConfigDictTransform.transform
def transform(self, config): """ :param config: :type config: dict :return: :rtype: yowsup.config.config.Config """ out = {} for prop in vars(config): out[prop] = getattr(config, prop) return out
python
def transform(self, config): """ :param config: :type config: dict :return: :rtype: yowsup.config.config.Config """ out = {} for prop in vars(config): out[prop] = getattr(config, prop) return out
[ "def", "transform", "(", "self", ",", "config", ")", ":", "out", "=", "{", "}", "for", "prop", "in", "vars", "(", "config", ")", ":", "out", "[", "prop", "]", "=", "getattr", "(", "config", ",", "prop", ")", "return", "out" ]
:param config: :type config: dict :return: :rtype: yowsup.config.config.Config
[ ":", "param", "config", ":", ":", "type", "config", ":", "dict", ":", "return", ":", ":", "rtype", ":", "yowsup", ".", "config", ".", "config", ".", "Config" ]
b0739461ba962bf221fc76047d9d60d8ce61bc3e
https://github.com/tgalal/yowsup/blob/b0739461ba962bf221fc76047d9d60d8ce61bc3e/yowsup/config/transforms/config_dict.py#L8-L18
train
darknessomi/musicbox
NEMbox/utils.py
notify
def notify(msg, msg_type=0, t=None): msg = msg.replace('"', '\\"') "Show system notification with duration t (ms)" if platform.system() == "Darwin": command = notify_command_osx(msg, msg_type, t) else: command = notify_command_linux(msg, t) try: subprocess.call(command) ...
python
def notify(msg, msg_type=0, t=None): msg = msg.replace('"', '\\"') "Show system notification with duration t (ms)" if platform.system() == "Darwin": command = notify_command_osx(msg, msg_type, t) else: command = notify_command_linux(msg, t) try: subprocess.call(command) ...
[ "def", "notify", "(", "msg", ",", "msg_type", "=", "0", ",", "t", "=", "None", ")", ":", "msg", "=", "msg", ".", "replace", "(", "'\"'", ",", "'\\\\\"'", ")", "if", "platform", ".", "system", "(", ")", "==", "\"Darwin\"", ":", "command", "=", "no...
Show system notification with duration t (ms)
[ "Show", "system", "notification", "with", "duration", "t", "(", "ms", ")" ]
9d58201fa2fefcee99d34d2c7fcc7a57d1e45937
https://github.com/darknessomi/musicbox/blob/9d58201fa2fefcee99d34d2c7fcc7a57d1e45937/NEMbox/utils.py#L71-L83
train
darknessomi/musicbox
NEMbox/player.py
Player.start_playing
def start_playing(self, on_exit, args): """ Runs the given args in subprocess.Popen, and then calls the function on_exit when the subprocess completes. on_exit is a callable object, and args is a lists/tuple of args that would give to subprocess.Popen. """ # log.d...
python
def start_playing(self, on_exit, args): """ Runs the given args in subprocess.Popen, and then calls the function on_exit when the subprocess completes. on_exit is a callable object, and args is a lists/tuple of args that would give to subprocess.Popen. """ # log.d...
[ "def", "start_playing", "(", "self", ",", "on_exit", ",", "args", ")", ":", "# log.debug(\"%s,%s,%s\" % (args['song_id'], args['song_name'], args['mp3_url']))", "if", "\"cache\"", "in", "args", ".", "keys", "(", ")", "and", "os", ".", "path", ".", "isfile", "(", "...
Runs the given args in subprocess.Popen, and then calls the function on_exit when the subprocess completes. on_exit is a callable object, and args is a lists/tuple of args that would give to subprocess.Popen.
[ "Runs", "the", "given", "args", "in", "subprocess", ".", "Popen", "and", "then", "calls", "the", "function", "on_exit", "when", "the", "subprocess", "completes", ".", "on_exit", "is", "a", "callable", "object", "and", "args", "is", "a", "lists", "/", "tupl...
9d58201fa2fefcee99d34d2c7fcc7a57d1e45937
https://github.com/darknessomi/musicbox/blob/9d58201fa2fefcee99d34d2c7fcc7a57d1e45937/NEMbox/player.py#L309-L348
train
ninja-build/ninja
misc/ninja_syntax.py
expand
def expand(string, vars, local_vars={}): """Expand a string containing $vars as Ninja would. Note: doesn't handle the full Ninja variable syntax, but it's enough to make configure.py's use of it work. """ def exp(m): var = m.group(1) if var == '$': return '$' ret...
python
def expand(string, vars, local_vars={}): """Expand a string containing $vars as Ninja would. Note: doesn't handle the full Ninja variable syntax, but it's enough to make configure.py's use of it work. """ def exp(m): var = m.group(1) if var == '$': return '$' ret...
[ "def", "expand", "(", "string", ",", "vars", ",", "local_vars", "=", "{", "}", ")", ":", "def", "exp", "(", "m", ")", ":", "var", "=", "m", ".", "group", "(", "1", ")", "if", "var", "==", "'$'", ":", "return", "'$'", "return", "local_vars", "."...
Expand a string containing $vars as Ninja would. Note: doesn't handle the full Ninja variable syntax, but it's enough to make configure.py's use of it work.
[ "Expand", "a", "string", "containing", "$vars", "as", "Ninja", "would", "." ]
2e64645749ff91eff2f999f03f55da360ae5913d
https://github.com/ninja-build/ninja/blob/2e64645749ff91eff2f999f03f55da360ae5913d/misc/ninja_syntax.py#L172-L183
train
ninja-build/ninja
misc/ninja_syntax.py
Writer._count_dollars_before_index
def _count_dollars_before_index(self, s, i): """Returns the number of '$' characters right in front of s[i].""" dollar_count = 0 dollar_index = i - 1 while dollar_index > 0 and s[dollar_index] == '$': dollar_count += 1 dollar_index -= 1 return dollar_count
python
def _count_dollars_before_index(self, s, i): """Returns the number of '$' characters right in front of s[i].""" dollar_count = 0 dollar_index = i - 1 while dollar_index > 0 and s[dollar_index] == '$': dollar_count += 1 dollar_index -= 1 return dollar_count
[ "def", "_count_dollars_before_index", "(", "self", ",", "s", ",", "i", ")", ":", "dollar_count", "=", "0", "dollar_index", "=", "i", "-", "1", "while", "dollar_index", ">", "0", "and", "s", "[", "dollar_index", "]", "==", "'$'", ":", "dollar_count", "+="...
Returns the number of '$' characters right in front of s[i].
[ "Returns", "the", "number", "of", "$", "characters", "right", "in", "front", "of", "s", "[", "i", "]", "." ]
2e64645749ff91eff2f999f03f55da360ae5913d
https://github.com/ninja-build/ninja/blob/2e64645749ff91eff2f999f03f55da360ae5913d/misc/ninja_syntax.py#L107-L114
train
ninja-build/ninja
misc/ninja_syntax.py
Writer._line
def _line(self, text, indent=0): """Write 'text' word-wrapped at self.width characters.""" leading_space = ' ' * indent while len(leading_space) + len(text) > self.width: # The text is too wide; wrap if possible. # Find the rightmost space that would obey our width cons...
python
def _line(self, text, indent=0): """Write 'text' word-wrapped at self.width characters.""" leading_space = ' ' * indent while len(leading_space) + len(text) > self.width: # The text is too wide; wrap if possible. # Find the rightmost space that would obey our width cons...
[ "def", "_line", "(", "self", ",", "text", ",", "indent", "=", "0", ")", ":", "leading_space", "=", "' '", "*", "indent", "while", "len", "(", "leading_space", ")", "+", "len", "(", "text", ")", ">", "self", ".", "width", ":", "# The text is too wide; ...
Write 'text' word-wrapped at self.width characters.
[ "Write", "text", "word", "-", "wrapped", "at", "self", ".", "width", "characters", "." ]
2e64645749ff91eff2f999f03f55da360ae5913d
https://github.com/ninja-build/ninja/blob/2e64645749ff91eff2f999f03f55da360ae5913d/misc/ninja_syntax.py#L116-L150
train
ninja-build/ninja
configure.py
Bootstrap._expand_paths
def _expand_paths(self, paths): """Expand $vars in an array of paths, e.g. from a 'build' block.""" paths = ninja_syntax.as_list(paths) return ' '.join(map(self._shell_escape, (map(self._expand, paths))))
python
def _expand_paths(self, paths): """Expand $vars in an array of paths, e.g. from a 'build' block.""" paths = ninja_syntax.as_list(paths) return ' '.join(map(self._shell_escape, (map(self._expand, paths))))
[ "def", "_expand_paths", "(", "self", ",", "paths", ")", ":", "paths", "=", "ninja_syntax", ".", "as_list", "(", "paths", ")", "return", "' '", ".", "join", "(", "map", "(", "self", ".", "_shell_escape", ",", "(", "map", "(", "self", ".", "_expand", "...
Expand $vars in an array of paths, e.g. from a 'build' block.
[ "Expand", "$vars", "in", "an", "array", "of", "paths", "e", ".", "g", ".", "from", "a", "build", "block", "." ]
2e64645749ff91eff2f999f03f55da360ae5913d
https://github.com/ninja-build/ninja/blob/2e64645749ff91eff2f999f03f55da360ae5913d/configure.py#L171-L174
train
ninja-build/ninja
configure.py
Bootstrap._expand
def _expand(self, str, local_vars={}): """Expand $vars in a string.""" return ninja_syntax.expand(str, self.vars, local_vars)
python
def _expand(self, str, local_vars={}): """Expand $vars in a string.""" return ninja_syntax.expand(str, self.vars, local_vars)
[ "def", "_expand", "(", "self", ",", "str", ",", "local_vars", "=", "{", "}", ")", ":", "return", "ninja_syntax", ".", "expand", "(", "str", ",", "self", ".", "vars", ",", "local_vars", ")" ]
Expand $vars in a string.
[ "Expand", "$vars", "in", "a", "string", "." ]
2e64645749ff91eff2f999f03f55da360ae5913d
https://github.com/ninja-build/ninja/blob/2e64645749ff91eff2f999f03f55da360ae5913d/configure.py#L176-L178
train
ninja-build/ninja
configure.py
Bootstrap._run_command
def _run_command(self, cmdline): """Run a subcommand, quietly. Prints the full command on error.""" try: if self.verbose: print(cmdline) subprocess.check_call(cmdline, shell=True) except subprocess.CalledProcessError: print('when running: ', c...
python
def _run_command(self, cmdline): """Run a subcommand, quietly. Prints the full command on error.""" try: if self.verbose: print(cmdline) subprocess.check_call(cmdline, shell=True) except subprocess.CalledProcessError: print('when running: ', c...
[ "def", "_run_command", "(", "self", ",", "cmdline", ")", ":", "try", ":", "if", "self", ".", "verbose", ":", "print", "(", "cmdline", ")", "subprocess", ".", "check_call", "(", "cmdline", ",", "shell", "=", "True", ")", "except", "subprocess", ".", "Ca...
Run a subcommand, quietly. Prints the full command on error.
[ "Run", "a", "subcommand", "quietly", ".", "Prints", "the", "full", "command", "on", "error", "." ]
2e64645749ff91eff2f999f03f55da360ae5913d
https://github.com/ninja-build/ninja/blob/2e64645749ff91eff2f999f03f55da360ae5913d/configure.py#L184-L192
train
ninja-build/ninja
misc/write_fake_manifests.py
paretoint
def paretoint(avg, alpha): """Returns a random integer that's avg on average, following a power law. alpha determines the shape of the power curve. alpha has to be larger than 1. The closer alpha is to 1, the higher the variation of the returned numbers.""" return int(random.paretovariate(alpha) * a...
python
def paretoint(avg, alpha): """Returns a random integer that's avg on average, following a power law. alpha determines the shape of the power curve. alpha has to be larger than 1. The closer alpha is to 1, the higher the variation of the returned numbers.""" return int(random.paretovariate(alpha) * a...
[ "def", "paretoint", "(", "avg", ",", "alpha", ")", ":", "return", "int", "(", "random", ".", "paretovariate", "(", "alpha", ")", "*", "avg", "/", "(", "alpha", "/", "(", "alpha", "-", "1", ")", ")", ")" ]
Returns a random integer that's avg on average, following a power law. alpha determines the shape of the power curve. alpha has to be larger than 1. The closer alpha is to 1, the higher the variation of the returned numbers.
[ "Returns", "a", "random", "integer", "that", "s", "avg", "on", "average", "following", "a", "power", "law", ".", "alpha", "determines", "the", "shape", "of", "the", "power", "curve", ".", "alpha", "has", "to", "be", "larger", "than", "1", ".", "The", "...
2e64645749ff91eff2f999f03f55da360ae5913d
https://github.com/ninja-build/ninja/blob/2e64645749ff91eff2f999f03f55da360ae5913d/misc/write_fake_manifests.py#L25-L30
train
ninja-build/ninja
misc/write_fake_manifests.py
write_master_ninja
def write_master_ninja(master_ninja, targets): """Writes master build.ninja file, referencing all given subninjas.""" master_ninja.variable('cxx', 'c++') master_ninja.variable('ld', '$cxx') if sys.platform == 'darwin': master_ninja.variable('alink', 'libtool -static') else: master_ni...
python
def write_master_ninja(master_ninja, targets): """Writes master build.ninja file, referencing all given subninjas.""" master_ninja.variable('cxx', 'c++') master_ninja.variable('ld', '$cxx') if sys.platform == 'darwin': master_ninja.variable('alink', 'libtool -static') else: master_ni...
[ "def", "write_master_ninja", "(", "master_ninja", ",", "targets", ")", ":", "master_ninja", ".", "variable", "(", "'cxx'", ",", "'c++'", ")", "master_ninja", ".", "variable", "(", "'ld'", ",", "'$cxx'", ")", "if", "sys", ".", "platform", "==", "'darwin'", ...
Writes master build.ninja file, referencing all given subninjas.
[ "Writes", "master", "build", ".", "ninja", "file", "referencing", "all", "given", "subninjas", "." ]
2e64645749ff91eff2f999f03f55da360ae5913d
https://github.com/ninja-build/ninja/blob/2e64645749ff91eff2f999f03f55da360ae5913d/misc/write_fake_manifests.py#L177-L211
train
ninja-build/ninja
misc/write_fake_manifests.py
FileWriter
def FileWriter(path): """Context manager for a ninja_syntax object writing to a file.""" try: os.makedirs(os.path.dirname(path)) except OSError: pass f = open(path, 'w') yield ninja_syntax.Writer(f) f.close()
python
def FileWriter(path): """Context manager for a ninja_syntax object writing to a file.""" try: os.makedirs(os.path.dirname(path)) except OSError: pass f = open(path, 'w') yield ninja_syntax.Writer(f) f.close()
[ "def", "FileWriter", "(", "path", ")", ":", "try", ":", "os", ".", "makedirs", "(", "os", ".", "path", ".", "dirname", "(", "path", ")", ")", "except", "OSError", ":", "pass", "f", "=", "open", "(", "path", ",", "'w'", ")", "yield", "ninja_syntax",...
Context manager for a ninja_syntax object writing to a file.
[ "Context", "manager", "for", "a", "ninja_syntax", "object", "writing", "to", "a", "file", "." ]
2e64645749ff91eff2f999f03f55da360ae5913d
https://github.com/ninja-build/ninja/blob/2e64645749ff91eff2f999f03f55da360ae5913d/misc/write_fake_manifests.py#L215-L223
train
nteract/nteract
applications/jupyter-extension/nteract_on_jupyter/extension.py
load_jupyter_server_extension
def load_jupyter_server_extension(nbapp): """Load the server extension. """ here = PACKAGE_DIR nbapp.log.info('nteract extension loaded from %s' % here) app_dir = here # bundle is part of the python package web_app = nbapp.web_app config = NteractConfig(parent=nbapp) # original #...
python
def load_jupyter_server_extension(nbapp): """Load the server extension. """ here = PACKAGE_DIR nbapp.log.info('nteract extension loaded from %s' % here) app_dir = here # bundle is part of the python package web_app = nbapp.web_app config = NteractConfig(parent=nbapp) # original #...
[ "def", "load_jupyter_server_extension", "(", "nbapp", ")", ":", "here", "=", "PACKAGE_DIR", "nbapp", ".", "log", ".", "info", "(", "'nteract extension loaded from %s'", "%", "here", ")", "app_dir", "=", "here", "# bundle is part of the python package", "web_app", "=",...
Load the server extension.
[ "Load", "the", "server", "extension", "." ]
f63a01c4067b05541ebddd3932345d7102ea3e5b
https://github.com/nteract/nteract/blob/f63a01c4067b05541ebddd3932345d7102ea3e5b/applications/jupyter-extension/nteract_on_jupyter/extension.py#L18-L53
train
nteract/nteract
applications/jupyter-extension/nteract_on_jupyter/handlers.py
add_handlers
def add_handlers(web_app, config): """Add the appropriate handlers to the web app. """ base_url = web_app.settings['base_url'] url = ujoin(base_url, config.page_url) assets_dir = config.assets_dir package_file = os.path.join(assets_dir, 'package.json') with open(package_file) as fid: ...
python
def add_handlers(web_app, config): """Add the appropriate handlers to the web app. """ base_url = web_app.settings['base_url'] url = ujoin(base_url, config.page_url) assets_dir = config.assets_dir package_file = os.path.join(assets_dir, 'package.json') with open(package_file) as fid: ...
[ "def", "add_handlers", "(", "web_app", ",", "config", ")", ":", "base_url", "=", "web_app", ".", "settings", "[", "'base_url'", "]", "url", "=", "ujoin", "(", "base_url", ",", "config", ".", "page_url", ")", "assets_dir", "=", "config", ".", "assets_dir", ...
Add the appropriate handlers to the web app.
[ "Add", "the", "appropriate", "handlers", "to", "the", "web", "app", "." ]
f63a01c4067b05541ebddd3932345d7102ea3e5b
https://github.com/nteract/nteract/blob/f63a01c4067b05541ebddd3932345d7102ea3e5b/applications/jupyter-extension/nteract_on_jupyter/handlers.py#L83-L106
train
nteract/nteract
applications/jupyter-extension/nteract_on_jupyter/semver.py
semver
def semver(version, loose): if isinstance(version, SemVer): if version.loose == loose: return version else: version = version.version elif not isinstance(version, string_type): # xxx: raise ValueError("Invalid Version: {}".format(version)) """ if (!(this...
python
def semver(version, loose): if isinstance(version, SemVer): if version.loose == loose: return version else: version = version.version elif not isinstance(version, string_type): # xxx: raise ValueError("Invalid Version: {}".format(version)) """ if (!(this...
[ "def", "semver", "(", "version", ",", "loose", ")", ":", "if", "isinstance", "(", "version", ",", "SemVer", ")", ":", "if", "version", ".", "loose", "==", "loose", ":", "return", "version", "else", ":", "version", "=", "version", ".", "version", "elif"...
if (!(this instanceof SemVer)) return new SemVer(version, loose);
[ "if", "(", "!", "(", "this", "instanceof", "SemVer", "))", "return", "new", "SemVer", "(", "version", "loose", ")", ";" ]
f63a01c4067b05541ebddd3932345d7102ea3e5b
https://github.com/nteract/nteract/blob/f63a01c4067b05541ebddd3932345d7102ea3e5b/applications/jupyter-extension/nteract_on_jupyter/semver.py#L357-L370
train
cjhutto/vaderSentiment
additional_resources/build_emoji_lexicon.py
get_list_from_file
def get_list_from_file(file_name): """read the lines from a file into a list""" with open(file_name, mode='r', encoding='utf-8') as f1: lst = f1.readlines() return lst
python
def get_list_from_file(file_name): """read the lines from a file into a list""" with open(file_name, mode='r', encoding='utf-8') as f1: lst = f1.readlines() return lst
[ "def", "get_list_from_file", "(", "file_name", ")", ":", "with", "open", "(", "file_name", ",", "mode", "=", "'r'", ",", "encoding", "=", "'utf-8'", ")", "as", "f1", ":", "lst", "=", "f1", ".", "readlines", "(", ")", "return", "lst" ]
read the lines from a file into a list
[ "read", "the", "lines", "from", "a", "file", "into", "a", "list" ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/additional_resources/build_emoji_lexicon.py#L7-L11
train
cjhutto/vaderSentiment
additional_resources/build_emoji_lexicon.py
append_to_file
def append_to_file(file_name, line_data): """append a line of text to a file""" with open(file_name, mode='a', encoding='utf-8') as f1: f1.write(line_data) f1.write("\n")
python
def append_to_file(file_name, line_data): """append a line of text to a file""" with open(file_name, mode='a', encoding='utf-8') as f1: f1.write(line_data) f1.write("\n")
[ "def", "append_to_file", "(", "file_name", ",", "line_data", ")", ":", "with", "open", "(", "file_name", ",", "mode", "=", "'a'", ",", "encoding", "=", "'utf-8'", ")", "as", "f1", ":", "f1", ".", "write", "(", "line_data", ")", "f1", ".", "write", "(...
append a line of text to a file
[ "append", "a", "line", "of", "text", "to", "a", "file" ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/additional_resources/build_emoji_lexicon.py#L14-L18
train
cjhutto/vaderSentiment
vaderSentiment/vaderSentiment.py
negated
def negated(input_words, include_nt=True): """ Determine if input contains negation words """ input_words = [str(w).lower() for w in input_words] neg_words = [] neg_words.extend(NEGATE) for word in neg_words: if word in input_words: return True if include_nt: ...
python
def negated(input_words, include_nt=True): """ Determine if input contains negation words """ input_words = [str(w).lower() for w in input_words] neg_words = [] neg_words.extend(NEGATE) for word in neg_words: if word in input_words: return True if include_nt: ...
[ "def", "negated", "(", "input_words", ",", "include_nt", "=", "True", ")", ":", "input_words", "=", "[", "str", "(", "w", ")", ".", "lower", "(", ")", "for", "w", "in", "input_words", "]", "neg_words", "=", "[", "]", "neg_words", ".", "extend", "(", ...
Determine if input contains negation words
[ "Determine", "if", "input", "contains", "negation", "words" ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L84-L102
train
cjhutto/vaderSentiment
vaderSentiment/vaderSentiment.py
normalize
def normalize(score, alpha=15): """ Normalize the score to be between -1 and 1 using an alpha that approximates the max expected value """ norm_score = score / math.sqrt((score * score) + alpha) if norm_score < -1.0: return -1.0 elif norm_score > 1.0: return 1.0 else: ...
python
def normalize(score, alpha=15): """ Normalize the score to be between -1 and 1 using an alpha that approximates the max expected value """ norm_score = score / math.sqrt((score * score) + alpha) if norm_score < -1.0: return -1.0 elif norm_score > 1.0: return 1.0 else: ...
[ "def", "normalize", "(", "score", ",", "alpha", "=", "15", ")", ":", "norm_score", "=", "score", "/", "math", ".", "sqrt", "(", "(", "score", "*", "score", ")", "+", "alpha", ")", "if", "norm_score", "<", "-", "1.0", ":", "return", "-", "1.0", "e...
Normalize the score to be between -1 and 1 using an alpha that approximates the max expected value
[ "Normalize", "the", "score", "to", "be", "between", "-", "1", "and", "1", "using", "an", "alpha", "that", "approximates", "the", "max", "expected", "value" ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L105-L116
train
cjhutto/vaderSentiment
vaderSentiment/vaderSentiment.py
allcap_differential
def allcap_differential(words): """ Check whether just some words in the input are ALL CAPS :param list words: The words to inspect :returns: `True` if some but not all items in `words` are ALL CAPS """ is_different = False allcap_words = 0 for word in words: if word.isupper(): ...
python
def allcap_differential(words): """ Check whether just some words in the input are ALL CAPS :param list words: The words to inspect :returns: `True` if some but not all items in `words` are ALL CAPS """ is_different = False allcap_words = 0 for word in words: if word.isupper(): ...
[ "def", "allcap_differential", "(", "words", ")", ":", "is_different", "=", "False", "allcap_words", "=", "0", "for", "word", "in", "words", ":", "if", "word", ".", "isupper", "(", ")", ":", "allcap_words", "+=", "1", "cap_differential", "=", "len", "(", ...
Check whether just some words in the input are ALL CAPS :param list words: The words to inspect :returns: `True` if some but not all items in `words` are ALL CAPS
[ "Check", "whether", "just", "some", "words", "in", "the", "input", "are", "ALL", "CAPS", ":", "param", "list", "words", ":", "The", "words", "to", "inspect", ":", "returns", ":", "True", "if", "some", "but", "not", "all", "items", "in", "words", "are",...
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L119-L133
train
cjhutto/vaderSentiment
vaderSentiment/vaderSentiment.py
scalar_inc_dec
def scalar_inc_dec(word, valence, is_cap_diff): """ Check if the preceding words increase, decrease, or negate/nullify the valence """ scalar = 0.0 word_lower = word.lower() if word_lower in BOOSTER_DICT: scalar = BOOSTER_DICT[word_lower] if valence < 0: scalar *=...
python
def scalar_inc_dec(word, valence, is_cap_diff): """ Check if the preceding words increase, decrease, or negate/nullify the valence """ scalar = 0.0 word_lower = word.lower() if word_lower in BOOSTER_DICT: scalar = BOOSTER_DICT[word_lower] if valence < 0: scalar *=...
[ "def", "scalar_inc_dec", "(", "word", ",", "valence", ",", "is_cap_diff", ")", ":", "scalar", "=", "0.0", "word_lower", "=", "word", ".", "lower", "(", ")", "if", "word_lower", "in", "BOOSTER_DICT", ":", "scalar", "=", "BOOSTER_DICT", "[", "word_lower", "]...
Check if the preceding words increase, decrease, or negate/nullify the valence
[ "Check", "if", "the", "preceding", "words", "increase", "decrease", "or", "negate", "/", "nullify", "the", "valence" ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L136-L153
train
cjhutto/vaderSentiment
vaderSentiment/vaderSentiment.py
SentiText._words_plus_punc
def _words_plus_punc(self): """ Returns mapping of form: { 'cat,': 'cat', ',cat': 'cat', } """ no_punc_text = REGEX_REMOVE_PUNCTUATION.sub('', self.text) # removes punctuation (but loses emoticons & contractions) words_only = no_pun...
python
def _words_plus_punc(self): """ Returns mapping of form: { 'cat,': 'cat', ',cat': 'cat', } """ no_punc_text = REGEX_REMOVE_PUNCTUATION.sub('', self.text) # removes punctuation (but loses emoticons & contractions) words_only = no_pun...
[ "def", "_words_plus_punc", "(", "self", ")", ":", "no_punc_text", "=", "REGEX_REMOVE_PUNCTUATION", ".", "sub", "(", "''", ",", "self", ".", "text", ")", "# removes punctuation (but loses emoticons & contractions)", "words_only", "=", "no_punc_text", ".", "split", "(",...
Returns mapping of form: { 'cat,': 'cat', ',cat': 'cat', }
[ "Returns", "mapping", "of", "form", ":", "{", "cat", ":", "cat", "cat", ":", "cat", "}" ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L170-L188
train
cjhutto/vaderSentiment
vaderSentiment/vaderSentiment.py
SentiText._words_and_emoticons
def _words_and_emoticons(self): """ Removes leading and trailing puncutation Leaves contractions and most emoticons Does not preserve punc-plus-letter emoticons (e.g. :D) """ wes = self.text.split() words_punc_dict = self._words_plus_punc() wes = [we f...
python
def _words_and_emoticons(self): """ Removes leading and trailing puncutation Leaves contractions and most emoticons Does not preserve punc-plus-letter emoticons (e.g. :D) """ wes = self.text.split() words_punc_dict = self._words_plus_punc() wes = [we f...
[ "def", "_words_and_emoticons", "(", "self", ")", ":", "wes", "=", "self", ".", "text", ".", "split", "(", ")", "words_punc_dict", "=", "self", ".", "_words_plus_punc", "(", ")", "wes", "=", "[", "we", "for", "we", "in", "wes", "if", "len", "(", "we",...
Removes leading and trailing puncutation Leaves contractions and most emoticons Does not preserve punc-plus-letter emoticons (e.g. :D)
[ "Removes", "leading", "and", "trailing", "puncutation", "Leaves", "contractions", "and", "most", "emoticons", "Does", "not", "preserve", "punc", "-", "plus", "-", "letter", "emoticons", "(", "e", ".", "g", ".", ":", "D", ")" ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L190-L202
train
cjhutto/vaderSentiment
vaderSentiment/vaderSentiment.py
SentimentIntensityAnalyzer.make_lex_dict
def make_lex_dict(self): """ Convert lexicon file to a dictionary """ lex_dict = {} for line in self.lexicon_full_filepath.split('\n'): (word, measure) = line.strip().split('\t')[0:2] lex_dict[word] = float(measure) return lex_dict
python
def make_lex_dict(self): """ Convert lexicon file to a dictionary """ lex_dict = {} for line in self.lexicon_full_filepath.split('\n'): (word, measure) = line.strip().split('\t')[0:2] lex_dict[word] = float(measure) return lex_dict
[ "def", "make_lex_dict", "(", "self", ")", ":", "lex_dict", "=", "{", "}", "for", "line", "in", "self", ".", "lexicon_full_filepath", ".", "split", "(", "'\\n'", ")", ":", "(", "word", ",", "measure", ")", "=", "line", ".", "strip", "(", ")", ".", "...
Convert lexicon file to a dictionary
[ "Convert", "lexicon", "file", "to", "a", "dictionary" ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L222-L230
train
cjhutto/vaderSentiment
vaderSentiment/vaderSentiment.py
SentimentIntensityAnalyzer.make_emoji_dict
def make_emoji_dict(self): """ Convert emoji lexicon file to a dictionary """ emoji_dict = {} for line in self.emoji_full_filepath.split('\n'): (emoji, description) = line.strip().split('\t')[0:2] emoji_dict[emoji] = description return emoji_dict
python
def make_emoji_dict(self): """ Convert emoji lexicon file to a dictionary """ emoji_dict = {} for line in self.emoji_full_filepath.split('\n'): (emoji, description) = line.strip().split('\t')[0:2] emoji_dict[emoji] = description return emoji_dict
[ "def", "make_emoji_dict", "(", "self", ")", ":", "emoji_dict", "=", "{", "}", "for", "line", "in", "self", ".", "emoji_full_filepath", ".", "split", "(", "'\\n'", ")", ":", "(", "emoji", ",", "description", ")", "=", "line", ".", "strip", "(", ")", "...
Convert emoji lexicon file to a dictionary
[ "Convert", "emoji", "lexicon", "file", "to", "a", "dictionary" ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L232-L240
train
cjhutto/vaderSentiment
vaderSentiment/vaderSentiment.py
SentimentIntensityAnalyzer.polarity_scores
def polarity_scores(self, text): """ Return a float for sentiment strength based on the input text. Positive values are positive valence, negative value are negative valence. """ # convert emojis to their textual descriptions text_token_list = text.split() ...
python
def polarity_scores(self, text): """ Return a float for sentiment strength based on the input text. Positive values are positive valence, negative value are negative valence. """ # convert emojis to their textual descriptions text_token_list = text.split() ...
[ "def", "polarity_scores", "(", "self", ",", "text", ")", ":", "# convert emojis to their textual descriptions", "text_token_list", "=", "text", ".", "split", "(", ")", "text_no_emoji_lst", "=", "[", "]", "for", "token", "in", "text_token_list", ":", "if", "token",...
Return a float for sentiment strength based on the input text. Positive values are positive valence, negative value are negative valence.
[ "Return", "a", "float", "for", "sentiment", "strength", "based", "on", "the", "input", "text", ".", "Positive", "values", "are", "positive", "valence", "negative", "value", "are", "negative", "valence", "." ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/vaderSentiment/vaderSentiment.py#L242-L282
train
cjhutto/vaderSentiment
setup.py
read
def read(*parts): """ Build an absolute path from *parts* and and return the contents of the resulting file. Assume UTF-8 encoding. """ with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f: return f.read()
python
def read(*parts): """ Build an absolute path from *parts* and and return the contents of the resulting file. Assume UTF-8 encoding. """ with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f: return f.read()
[ "def", "read", "(", "*", "parts", ")", ":", "with", "codecs", ".", "open", "(", "os", ".", "path", ".", "join", "(", "HERE", ",", "*", "parts", ")", ",", "\"rb\"", ",", "\"utf-8\"", ")", "as", "f", ":", "return", "f", ".", "read", "(", ")" ]
Build an absolute path from *parts* and and return the contents of the resulting file. Assume UTF-8 encoding.
[ "Build", "an", "absolute", "path", "from", "*", "parts", "*", "and", "and", "return", "the", "contents", "of", "the", "resulting", "file", ".", "Assume", "UTF", "-", "8", "encoding", "." ]
cfc2bce747afb2c49799c1de1dcf517358948d71
https://github.com/cjhutto/vaderSentiment/blob/cfc2bce747afb2c49799c1de1dcf517358948d71/setup.py#L6-L12
train
buildbot/buildbot
master/buildbot/changes/mail.py
CVSMaildirSource.parse
def parse(self, m, prefix=None): """Parse messages sent by the 'buildbot-cvs-mail' program. """ # The mail is sent from the person doing the checkin. Assume that the # local username is enough to identify them (this assumes a one-server # cvs-over-rsh environment rather than the ...
python
def parse(self, m, prefix=None): """Parse messages sent by the 'buildbot-cvs-mail' program. """ # The mail is sent from the person doing the checkin. Assume that the # local username is enough to identify them (this assumes a one-server # cvs-over-rsh environment rather than the ...
[ "def", "parse", "(", "self", ",", "m", ",", "prefix", "=", "None", ")", ":", "# The mail is sent from the person doing the checkin. Assume that the", "# local username is enough to identify them (this assumes a one-server", "# cvs-over-rsh environment rather than the server-dirs-shared-o...
Parse messages sent by the 'buildbot-cvs-mail' program.
[ "Parse", "messages", "sent", "by", "the", "buildbot", "-", "cvs", "-", "mail", "program", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/mail.py#L96-L263
train
buildbot/buildbot
master/buildbot/changes/mail.py
SVNCommitEmailMaildirSource.parse
def parse(self, m, prefix=None): """Parse messages sent by the svn 'commit-email.pl' trigger. """ # The mail is sent from the person doing the checkin. Assume that the # local username is enough to identify them (this assumes a one-server # cvs-over-rsh environment rather than t...
python
def parse(self, m, prefix=None): """Parse messages sent by the svn 'commit-email.pl' trigger. """ # The mail is sent from the person doing the checkin. Assume that the # local username is enough to identify them (this assumes a one-server # cvs-over-rsh environment rather than t...
[ "def", "parse", "(", "self", ",", "m", ",", "prefix", "=", "None", ")", ":", "# The mail is sent from the person doing the checkin. Assume that the", "# local username is enough to identify them (this assumes a one-server", "# cvs-over-rsh environment rather than the server-dirs-shared-o...
Parse messages sent by the svn 'commit-email.pl' trigger.
[ "Parse", "messages", "sent", "by", "the", "svn", "commit", "-", "email", ".", "pl", "trigger", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/mail.py#L294-L389
train
buildbot/buildbot
master/buildbot/changes/mail.py
BzrLaunchpadEmailMaildirSource.parse
def parse(self, m, prefix=None): """Parse branch notification messages sent by Launchpad. """ subject = m["subject"] match = re.search(r"^\s*\[Branch\s+([^]]+)\]", subject) if match: repository = match.group(1) else: repository = None # P...
python
def parse(self, m, prefix=None): """Parse branch notification messages sent by Launchpad. """ subject = m["subject"] match = re.search(r"^\s*\[Branch\s+([^]]+)\]", subject) if match: repository = match.group(1) else: repository = None # P...
[ "def", "parse", "(", "self", ",", "m", ",", "prefix", "=", "None", ")", ":", "subject", "=", "m", "[", "\"subject\"", "]", "match", "=", "re", ".", "search", "(", "r\"^\\s*\\[Branch\\s+([^]]+)\\]\"", ",", "subject", ")", "if", "match", ":", "repository",...
Parse branch notification messages sent by Launchpad.
[ "Parse", "branch", "notification", "messages", "sent", "by", "Launchpad", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/mail.py#L430-L531
train
buildbot/buildbot
master/buildbot/process/remotetransfer.py
FileWriter.remote_write
def remote_write(self, data): """ Called from remote worker to write L{data} to L{fp} within boundaries of L{maxsize} @type data: C{string} @param data: String of data to write """ data = unicode2bytes(data) if self.remaining is not None: if ...
python
def remote_write(self, data): """ Called from remote worker to write L{data} to L{fp} within boundaries of L{maxsize} @type data: C{string} @param data: String of data to write """ data = unicode2bytes(data) if self.remaining is not None: if ...
[ "def", "remote_write", "(", "self", ",", "data", ")", ":", "data", "=", "unicode2bytes", "(", "data", ")", "if", "self", ".", "remaining", "is", "not", "None", ":", "if", "len", "(", "data", ")", ">", "self", ".", "remaining", ":", "data", "=", "da...
Called from remote worker to write L{data} to L{fp} within boundaries of L{maxsize} @type data: C{string} @param data: String of data to write
[ "Called", "from", "remote", "worker", "to", "write", "L", "{", "data", "}", "to", "L", "{", "fp", "}", "within", "boundaries", "of", "L", "{", "maxsize", "}" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/remotetransfer.py#L51-L66
train
buildbot/buildbot
master/buildbot/process/remotetransfer.py
FileWriter.remote_close
def remote_close(self): """ Called by remote worker to state that no more data will be transferred """ self.fp.close() self.fp = None # on windows, os.rename does not automatically unlink, so do it # manually if os.path.exists(self.destfile): o...
python
def remote_close(self): """ Called by remote worker to state that no more data will be transferred """ self.fp.close() self.fp = None # on windows, os.rename does not automatically unlink, so do it # manually if os.path.exists(self.destfile): o...
[ "def", "remote_close", "(", "self", ")", ":", "self", ".", "fp", ".", "close", "(", ")", "self", ".", "fp", "=", "None", "# on windows, os.rename does not automatically unlink, so do it", "# manually", "if", "os", ".", "path", ".", "exists", "(", "self", ".", ...
Called by remote worker to state that no more data will be transferred
[ "Called", "by", "remote", "worker", "to", "state", "that", "no", "more", "data", "will", "be", "transferred" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/remotetransfer.py#L71-L84
train
buildbot/buildbot
master/buildbot/process/remotetransfer.py
DirectoryWriter.remote_unpack
def remote_unpack(self): """ Called by remote worker to state that no more data will be transferred """ # Make sure remote_close is called, otherwise atomic rename won't happen self.remote_close() # Map configured compression to a TarFile setting if self.compress...
python
def remote_unpack(self): """ Called by remote worker to state that no more data will be transferred """ # Make sure remote_close is called, otherwise atomic rename won't happen self.remote_close() # Map configured compression to a TarFile setting if self.compress...
[ "def", "remote_unpack", "(", "self", ")", ":", "# Make sure remote_close is called, otherwise atomic rename won't happen", "self", ".", "remote_close", "(", ")", "# Map configured compression to a TarFile setting", "if", "self", ".", "compress", "==", "'bz2'", ":", "mode", ...
Called by remote worker to state that no more data will be transferred
[ "Called", "by", "remote", "worker", "to", "state", "that", "no", "more", "data", "will", "be", "transferred" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/remotetransfer.py#L114-L133
train
buildbot/buildbot
master/buildbot/process/remotetransfer.py
FileReader.remote_read
def remote_read(self, maxlength): """ Called from remote worker to read at most L{maxlength} bytes of data @type maxlength: C{integer} @param maxlength: Maximum number of data bytes that can be returned @return: Data read from L{fp} @rtype: C{string} of bytes read from...
python
def remote_read(self, maxlength): """ Called from remote worker to read at most L{maxlength} bytes of data @type maxlength: C{integer} @param maxlength: Maximum number of data bytes that can be returned @return: Data read from L{fp} @rtype: C{string} of bytes read from...
[ "def", "remote_read", "(", "self", ",", "maxlength", ")", ":", "if", "self", ".", "fp", "is", "None", ":", "return", "''", "data", "=", "self", ".", "fp", ".", "read", "(", "maxlength", ")", "return", "data" ]
Called from remote worker to read at most L{maxlength} bytes of data @type maxlength: C{integer} @param maxlength: Maximum number of data bytes that can be returned @return: Data read from L{fp} @rtype: C{string} of bytes read from file
[ "Called", "from", "remote", "worker", "to", "read", "at", "most", "L", "{", "maxlength", "}", "bytes", "of", "data" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/remotetransfer.py#L145-L159
train
buildbot/buildbot
master/buildbot/steps/cmake.py
CMake.run
def run(self): """ run CMake """ command = [self.cmake] if self.generator: command.extend([ '-G', self.generator ]) if self.path: command.append(self.path) if self.definitions is not None: for item...
python
def run(self): """ run CMake """ command = [self.cmake] if self.generator: command.extend([ '-G', self.generator ]) if self.path: command.append(self.path) if self.definitions is not None: for item...
[ "def", "run", "(", "self", ")", ":", "command", "=", "[", "self", ".", "cmake", "]", "if", "self", ".", "generator", ":", "command", ".", "extend", "(", "[", "'-G'", ",", "self", ".", "generator", "]", ")", "if", "self", ".", "path", ":", "comman...
run CMake
[ "run", "CMake" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/cmake.py#L62-L87
train
buildbot/buildbot
master/buildbot/process/remotecommand.py
RemoteCommand.remote_update
def remote_update(self, updates): """ I am called by the worker's L{buildbot_worker.base.WorkerForBuilderBase.sendUpdate} so I can receive updates from the running remote command. @type updates: list of [object, int] @param updates: list of updates from the remote comma...
python
def remote_update(self, updates): """ I am called by the worker's L{buildbot_worker.base.WorkerForBuilderBase.sendUpdate} so I can receive updates from the running remote command. @type updates: list of [object, int] @param updates: list of updates from the remote comma...
[ "def", "remote_update", "(", "self", ",", "updates", ")", ":", "updates", "=", "decode", "(", "updates", ")", "self", ".", "worker", ".", "messageReceivedFromWorker", "(", ")", "max_updatenum", "=", "0", "for", "(", "update", ",", "num", ")", "in", "upda...
I am called by the worker's L{buildbot_worker.base.WorkerForBuilderBase.sendUpdate} so I can receive updates from the running remote command. @type updates: list of [object, int] @param updates: list of updates from the remote command
[ "I", "am", "called", "by", "the", "worker", "s", "L", "{", "buildbot_worker", ".", "base", ".", "WorkerForBuilderBase", ".", "sendUpdate", "}", "so", "I", "can", "receive", "updates", "from", "the", "running", "remote", "command", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/remotecommand.py#L178-L202
train
buildbot/buildbot
master/buildbot/process/remotecommand.py
RemoteCommand.remote_complete
def remote_complete(self, failure=None): """ Called by the worker's L{buildbot_worker.base.WorkerForBuilderBase.commandComplete} to notify me the remote command has finished. @type failure: L{twisted.python.failure.Failure} or None @rtype: None """ self...
python
def remote_complete(self, failure=None): """ Called by the worker's L{buildbot_worker.base.WorkerForBuilderBase.commandComplete} to notify me the remote command has finished. @type failure: L{twisted.python.failure.Failure} or None @rtype: None """ self...
[ "def", "remote_complete", "(", "self", ",", "failure", "=", "None", ")", ":", "self", ".", "worker", ".", "messageReceivedFromWorker", "(", ")", "# call the real remoteComplete a moment later, but first return an", "# acknowledgement so the worker can retire the completion messag...
Called by the worker's L{buildbot_worker.base.WorkerForBuilderBase.commandComplete} to notify me the remote command has finished. @type failure: L{twisted.python.failure.Failure} or None @rtype: None
[ "Called", "by", "the", "worker", "s", "L", "{", "buildbot_worker", ".", "base", ".", "WorkerForBuilderBase", ".", "commandComplete", "}", "to", "notify", "me", "the", "remote", "command", "has", "finished", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/remotecommand.py#L204-L219
train
buildbot/buildbot
master/buildbot/steps/source/base.py
Source._hasAttrGroupMember
def _hasAttrGroupMember(self, attrGroup, attr): """ The hasattr equivalent for attribute groups: returns whether the given member is in the attribute group. """ method_name = '%s_%s' % (attrGroup, attr) return hasattr(self, method_name)
python
def _hasAttrGroupMember(self, attrGroup, attr): """ The hasattr equivalent for attribute groups: returns whether the given member is in the attribute group. """ method_name = '%s_%s' % (attrGroup, attr) return hasattr(self, method_name)
[ "def", "_hasAttrGroupMember", "(", "self", ",", "attrGroup", ",", "attr", ")", ":", "method_name", "=", "'%s_%s'", "%", "(", "attrGroup", ",", "attr", ")", "return", "hasattr", "(", "self", ",", "method_name", ")" ]
The hasattr equivalent for attribute groups: returns whether the given member is in the attribute group.
[ "The", "hasattr", "equivalent", "for", "attribute", "groups", ":", "returns", "whether", "the", "given", "member", "is", "in", "the", "attribute", "group", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/base.py#L135-L141
train
buildbot/buildbot
master/buildbot/steps/source/base.py
Source._getAttrGroupMember
def _getAttrGroupMember(self, attrGroup, attr): """ The getattr equivalent for attribute groups: gets and returns the attribute group member. """ method_name = '%s_%s' % (attrGroup, attr) return getattr(self, method_name)
python
def _getAttrGroupMember(self, attrGroup, attr): """ The getattr equivalent for attribute groups: gets and returns the attribute group member. """ method_name = '%s_%s' % (attrGroup, attr) return getattr(self, method_name)
[ "def", "_getAttrGroupMember", "(", "self", ",", "attrGroup", ",", "attr", ")", ":", "method_name", "=", "'%s_%s'", "%", "(", "attrGroup", ",", "attr", ")", "return", "getattr", "(", "self", ",", "method_name", ")" ]
The getattr equivalent for attribute groups: gets and returns the attribute group member.
[ "The", "getattr", "equivalent", "for", "attribute", "groups", ":", "gets", "and", "returns", "the", "attribute", "group", "member", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/base.py#L143-L149
train
buildbot/buildbot
master/buildbot/steps/source/base.py
Source._listAttrGroupMembers
def _listAttrGroupMembers(self, attrGroup): """ Returns a list of all members in the attribute group. """ from inspect import getmembers, ismethod methods = getmembers(self, ismethod) group_prefix = attrGroup + '_' group_len = len(group_prefix) group_membe...
python
def _listAttrGroupMembers(self, attrGroup): """ Returns a list of all members in the attribute group. """ from inspect import getmembers, ismethod methods = getmembers(self, ismethod) group_prefix = attrGroup + '_' group_len = len(group_prefix) group_membe...
[ "def", "_listAttrGroupMembers", "(", "self", ",", "attrGroup", ")", ":", "from", "inspect", "import", "getmembers", ",", "ismethod", "methods", "=", "getmembers", "(", "self", ",", "ismethod", ")", "group_prefix", "=", "attrGroup", "+", "'_'", "group_len", "="...
Returns a list of all members in the attribute group.
[ "Returns", "a", "list", "of", "all", "members", "in", "the", "attribute", "group", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/base.py#L151-L162
train
buildbot/buildbot
master/buildbot/steps/source/base.py
Source.updateSourceProperty
def updateSourceProperty(self, name, value, source=''): """ Update a property, indexing the property by codebase if codebase is not ''. Source steps should generally use this instead of setProperty. """ # pick a decent source name if source == '': source = se...
python
def updateSourceProperty(self, name, value, source=''): """ Update a property, indexing the property by codebase if codebase is not ''. Source steps should generally use this instead of setProperty. """ # pick a decent source name if source == '': source = se...
[ "def", "updateSourceProperty", "(", "self", ",", "name", ",", "value", ",", "source", "=", "''", ")", ":", "# pick a decent source name", "if", "source", "==", "''", ":", "source", "=", "self", ".", "__class__", ".", "__name__", "if", "self", ".", "codebas...
Update a property, indexing the property by codebase if codebase is not ''. Source steps should generally use this instead of setProperty.
[ "Update", "a", "property", "indexing", "the", "property", "by", "codebase", "if", "codebase", "is", "not", ".", "Source", "steps", "should", "generally", "use", "this", "instead", "of", "setProperty", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/source/base.py#L164-L184
train
buildbot/buildbot
master/buildbot/changes/gerritchangesource.py
_gerrit_user_to_author
def _gerrit_user_to_author(props, username="unknown"): """ Convert Gerrit account properties to Buildbot format Take into account missing values """ username = props.get("username", username) username = props.get("name", username) if "email" in props: username += " <%(email)s>" % pr...
python
def _gerrit_user_to_author(props, username="unknown"): """ Convert Gerrit account properties to Buildbot format Take into account missing values """ username = props.get("username", username) username = props.get("name", username) if "email" in props: username += " <%(email)s>" % pr...
[ "def", "_gerrit_user_to_author", "(", "props", ",", "username", "=", "\"unknown\"", ")", ":", "username", "=", "props", ".", "get", "(", "\"username\"", ",", "username", ")", "username", "=", "props", ".", "get", "(", "\"name\"", ",", "username", ")", "if"...
Convert Gerrit account properties to Buildbot format Take into account missing values
[ "Convert", "Gerrit", "account", "properties", "to", "Buildbot", "format" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/gerritchangesource.py#L51-L61
train
buildbot/buildbot
master/buildbot/buildbot_net_usage_data.py
getName
def getName(obj): """This method finds the first parent class which is within the buildbot namespace it prepends the name with as many ">" as the class is subclassed """ # elastic search does not like '.' in dict keys, so we replace by / def sanitize(name): return name.replace(".", "/") ...
python
def getName(obj): """This method finds the first parent class which is within the buildbot namespace it prepends the name with as many ">" as the class is subclassed """ # elastic search does not like '.' in dict keys, so we replace by / def sanitize(name): return name.replace(".", "/") ...
[ "def", "getName", "(", "obj", ")", ":", "# elastic search does not like '.' in dict keys, so we replace by /", "def", "sanitize", "(", "name", ")", ":", "return", "name", ".", "replace", "(", "\".\"", ",", "\"/\"", ")", "if", "isinstance", "(", "obj", ",", "_Bui...
This method finds the first parent class which is within the buildbot namespace it prepends the name with as many ">" as the class is subclassed
[ "This", "method", "finds", "the", "first", "parent", "class", "which", "is", "within", "the", "buildbot", "namespace", "it", "prepends", "the", "name", "with", "as", "many", ">", "as", "the", "class", "is", "subclassed" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/buildbot_net_usage_data.py#L75-L93
train
buildbot/buildbot
master/buildbot/buildbot_net_usage_data.py
fullData
def fullData(master): """ Send the actual configuration of the builders, how the steps are agenced. Note that full data will never send actual detail of what command is run, name of servers, etc. """ builders = [] for b in master.config.builders: steps = [] for step in b...
python
def fullData(master): """ Send the actual configuration of the builders, how the steps are agenced. Note that full data will never send actual detail of what command is run, name of servers, etc. """ builders = [] for b in master.config.builders: steps = [] for step in b...
[ "def", "fullData", "(", "master", ")", ":", "builders", "=", "[", "]", "for", "b", "in", "master", ".", "config", ".", "builders", ":", "steps", "=", "[", "]", "for", "step", "in", "b", ".", "factory", ".", "steps", ":", "steps", ".", "append", "...
Send the actual configuration of the builders, how the steps are agenced. Note that full data will never send actual detail of what command is run, name of servers, etc.
[ "Send", "the", "actual", "configuration", "of", "the", "builders", "how", "the", "steps", "are", "agenced", ".", "Note", "that", "full", "data", "will", "never", "send", "actual", "detail", "of", "what", "command", "is", "run", "name", "of", "servers", "et...
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/buildbot_net_usage_data.py#L147-L159
train
buildbot/buildbot
master/setup.py
include
def include(d, e): """Generate a pair of (directory, file-list) for installation. 'd' -- A directory 'e' -- A glob pattern""" return (d, [f for f in glob.glob('%s/%s' % (d, e)) if os.path.isfile(f)])
python
def include(d, e): """Generate a pair of (directory, file-list) for installation. 'd' -- A directory 'e' -- A glob pattern""" return (d, [f for f in glob.glob('%s/%s' % (d, e)) if os.path.isfile(f)])
[ "def", "include", "(", "d", ",", "e", ")", ":", "return", "(", "d", ",", "[", "f", "for", "f", "in", "glob", ".", "glob", "(", "'%s/%s'", "%", "(", "d", ",", "e", ")", ")", "if", "os", ".", "path", ".", "isfile", "(", "f", ")", "]", ")" ]
Generate a pair of (directory, file-list) for installation. 'd' -- A directory 'e' -- A glob pattern
[ "Generate", "a", "pair", "of", "(", "directory", "file", "-", "list", ")", "for", "installation", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/setup.py#L42-L48
train
buildbot/buildbot
master/setup.py
define_plugin_entry
def define_plugin_entry(name, module_name): """ helper to produce lines suitable for setup.py's entry_points """ if isinstance(name, tuple): entry, name = name else: entry = name return '%s = %s:%s' % (entry, module_name, name)
python
def define_plugin_entry(name, module_name): """ helper to produce lines suitable for setup.py's entry_points """ if isinstance(name, tuple): entry, name = name else: entry = name return '%s = %s:%s' % (entry, module_name, name)
[ "def", "define_plugin_entry", "(", "name", ",", "module_name", ")", ":", "if", "isinstance", "(", "name", ",", "tuple", ")", ":", "entry", ",", "name", "=", "name", "else", ":", "entry", "=", "name", "return", "'%s = %s:%s'", "%", "(", "entry", ",", "m...
helper to produce lines suitable for setup.py's entry_points
[ "helper", "to", "produce", "lines", "suitable", "for", "setup", ".", "py", "s", "entry_points" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/setup.py#L99-L107
train
buildbot/buildbot
master/setup.py
define_plugin_entries
def define_plugin_entries(groups): """ helper to all groups for plugins """ result = dict() for group, modules in groups: tempo = [] for module_name, names in modules: tempo.extend([define_plugin_entry(name, module_name) for name in names]) ...
python
def define_plugin_entries(groups): """ helper to all groups for plugins """ result = dict() for group, modules in groups: tempo = [] for module_name, names in modules: tempo.extend([define_plugin_entry(name, module_name) for name in names]) ...
[ "def", "define_plugin_entries", "(", "groups", ")", ":", "result", "=", "dict", "(", ")", "for", "group", ",", "modules", "in", "groups", ":", "tempo", "=", "[", "]", "for", "module_name", ",", "names", "in", "modules", ":", "tempo", ".", "extend", "("...
helper to all groups for plugins
[ "helper", "to", "all", "groups", "for", "plugins" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/setup.py#L117-L130
train
buildbot/buildbot
master/buildbot/changes/filter.py
ChangeFilter.fromSchedulerConstructorArgs
def fromSchedulerConstructorArgs(change_filter=None, branch=NotABranch, categories=None): """ Static method to create a filter based on constructor args change_filter, branch, and categories; use default values @code{None}, @code{NotABranch}, and @cod...
python
def fromSchedulerConstructorArgs(change_filter=None, branch=NotABranch, categories=None): """ Static method to create a filter based on constructor args change_filter, branch, and categories; use default values @code{None}, @code{NotABranch}, and @cod...
[ "def", "fromSchedulerConstructorArgs", "(", "change_filter", "=", "None", ",", "branch", "=", "NotABranch", ",", "categories", "=", "None", ")", ":", "# use a change_filter, if given one", "if", "change_filter", ":", "if", "(", "branch", "is", "not", "NotABranch", ...
Static method to create a filter based on constructor args change_filter, branch, and categories; use default values @code{None}, @code{NotABranch}, and @code{None}, respectively. These arguments are interpreted as documented for the L{buildbot.schedulers.basic.Scheduler} class. ...
[ "Static", "method", "to", "create", "a", "filter", "based", "on", "constructor", "args", "change_filter", "branch", "and", "categories", ";", "use", "default", "values", "@code", "{", "None", "}", "@code", "{", "NotABranch", "}", "and", "@code", "{", "None",...
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/filter.py#L111-L139
train
buildbot/buildbot
master/buildbot/changes/gitpoller.py
GitPoller._process_changes
def _process_changes(self, newRev, branch): """ Read changes since last change. - Read list of commit hashes. - Extract details from each commit. - Add changes to database. """ # initial run, don't parse all history if not self.lastRev: retur...
python
def _process_changes(self, newRev, branch): """ Read changes since last change. - Read list of commit hashes. - Extract details from each commit. - Add changes to database. """ # initial run, don't parse all history if not self.lastRev: retur...
[ "def", "_process_changes", "(", "self", ",", "newRev", ",", "branch", ")", ":", "# initial run, don't parse all history", "if", "not", "self", ".", "lastRev", ":", "return", "rebuild", "=", "False", "if", "newRev", "in", "self", ".", "lastRev", ".", "values", ...
Read changes since last change. - Read list of commit hashes. - Extract details from each commit. - Add changes to database.
[ "Read", "changes", "since", "last", "change", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/changes/gitpoller.py#L289-L367
train
buildbot/buildbot
master/buildbot/process/botmaster.py
BotMaster.cleanShutdown
def cleanShutdown(self, quickMode=False, stopReactor=True, _reactor=reactor): """Shut down the entire process, once all currently-running builds are complete. quickMode will mark all builds as retry (except the ones that were triggered) """ if self.shuttingDown: retur...
python
def cleanShutdown(self, quickMode=False, stopReactor=True, _reactor=reactor): """Shut down the entire process, once all currently-running builds are complete. quickMode will mark all builds as retry (except the ones that were triggered) """ if self.shuttingDown: retur...
[ "def", "cleanShutdown", "(", "self", ",", "quickMode", "=", "False", ",", "stopReactor", "=", "True", ",", "_reactor", "=", "reactor", ")", ":", "if", "self", ".", "shuttingDown", ":", "return", "log", ".", "msg", "(", "\"Initiating clean shutdown\"", ")", ...
Shut down the entire process, once all currently-running builds are complete. quickMode will mark all builds as retry (except the ones that were triggered)
[ "Shut", "down", "the", "entire", "process", "once", "all", "currently", "-", "running", "builds", "are", "complete", ".", "quickMode", "will", "mark", "all", "builds", "as", "retry", "(", "except", "the", "ones", "that", "were", "triggered", ")" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/botmaster.py#L63-L132
train
buildbot/buildbot
master/buildbot/process/botmaster.py
BotMaster.getLockByID
def getLockByID(self, lockid): """Convert a Lock identifier into an actual Lock instance. @param lockid: a locks.MasterLock or locks.WorkerLock instance @return: a locks.RealMasterLock or locks.RealWorkerLock instance """ assert isinstance(lockid, (locks.MasterLock, locks.WorkerL...
python
def getLockByID(self, lockid): """Convert a Lock identifier into an actual Lock instance. @param lockid: a locks.MasterLock or locks.WorkerLock instance @return: a locks.RealMasterLock or locks.RealWorkerLock instance """ assert isinstance(lockid, (locks.MasterLock, locks.WorkerL...
[ "def", "getLockByID", "(", "self", ",", "lockid", ")", ":", "assert", "isinstance", "(", "lockid", ",", "(", "locks", ".", "MasterLock", ",", "locks", ".", "WorkerLock", ")", ")", "if", "lockid", "not", "in", "self", ".", "locks", ":", "self", ".", "...
Convert a Lock identifier into an actual Lock instance. @param lockid: a locks.MasterLock or locks.WorkerLock instance @return: a locks.RealMasterLock or locks.RealWorkerLock instance
[ "Convert", "a", "Lock", "identifier", "into", "an", "actual", "Lock", "instance", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/botmaster.py#L259-L271
train
buildbot/buildbot
master/buildbot/process/botmaster.py
BotMaster.maybeStartBuildsForWorker
def maybeStartBuildsForWorker(self, worker_name): """ Call this when something suggests that a particular worker may now be available to start a build. @param worker_name: the name of the worker """ builders = self.getBuildersForWorker(worker_name) self.brd.maybe...
python
def maybeStartBuildsForWorker(self, worker_name): """ Call this when something suggests that a particular worker may now be available to start a build. @param worker_name: the name of the worker """ builders = self.getBuildersForWorker(worker_name) self.brd.maybe...
[ "def", "maybeStartBuildsForWorker", "(", "self", ",", "worker_name", ")", ":", "builders", "=", "self", ".", "getBuildersForWorker", "(", "worker_name", ")", "self", ".", "brd", ".", "maybeStartBuildsOn", "(", "[", "b", ".", "name", "for", "b", "in", "builde...
Call this when something suggests that a particular worker may now be available to start a build. @param worker_name: the name of the worker
[ "Call", "this", "when", "something", "suggests", "that", "a", "particular", "worker", "may", "now", "be", "available", "to", "start", "a", "build", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/botmaster.py#L290-L298
train
buildbot/buildbot
worker/buildbot_worker/util/__init__.py
rewrap
def rewrap(text, width=None): """ Rewrap text for output to the console. Removes common indentation and rewraps paragraphs according to the console width. Line feeds between paragraphs preserved. Formatting of paragraphs that starts with additional indentation preserved. """ if wi...
python
def rewrap(text, width=None): """ Rewrap text for output to the console. Removes common indentation and rewraps paragraphs according to the console width. Line feeds between paragraphs preserved. Formatting of paragraphs that starts with additional indentation preserved. """ if wi...
[ "def", "rewrap", "(", "text", ",", "width", "=", "None", ")", ":", "if", "width", "is", "None", ":", "width", "=", "80", "# Remove common indentation.", "text", "=", "textwrap", ".", "dedent", "(", "text", ")", "def", "needs_wrapping", "(", "line", ")", ...
Rewrap text for output to the console. Removes common indentation and rewraps paragraphs according to the console width. Line feeds between paragraphs preserved. Formatting of paragraphs that starts with additional indentation preserved.
[ "Rewrap", "text", "for", "output", "to", "the", "console", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/util/__init__.py#L102-L135
train
buildbot/buildbot
master/buildbot/www/hooks/base.py
BaseHookHandler.getChanges
def getChanges(self, request): """ Consumes a naive build notification (the default for now) basically, set POST variables to match commit object parameters: revision, revlink, comments, branch, who, files, links files, links and properties will be de-json'd, the rest are interp...
python
def getChanges(self, request): """ Consumes a naive build notification (the default for now) basically, set POST variables to match commit object parameters: revision, revlink, comments, branch, who, files, links files, links and properties will be de-json'd, the rest are interp...
[ "def", "getChanges", "(", "self", ",", "request", ")", ":", "def", "firstOrNothing", "(", "value", ")", ":", "\"\"\"\n Small helper function to return the first value (if value is a list)\n or return the whole thing otherwise.\n\n Make sure to properly de...
Consumes a naive build notification (the default for now) basically, set POST variables to match commit object parameters: revision, revlink, comments, branch, who, files, links files, links and properties will be de-json'd, the rest are interpreted as strings
[ "Consumes", "a", "naive", "build", "notification", "(", "the", "default", "for", "now", ")", "basically", "set", "POST", "variables", "to", "match", "commit", "object", "parameters", ":", "revision", "revlink", "comments", "branch", "who", "files", "links" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/base.py#L32-L88
train
buildbot/buildbot
master/docs/bbdocs/ext.py
make_ref_target_directive
def make_ref_target_directive(ref_type, indextemplates=None, **kwargs): """ Create and return a L{BBRefTargetDirective} subclass. """ class_vars = dict(ref_type=ref_type, indextemplates=indextemplates) class_vars.update(kwargs) return type("BB%sRefTargetDirective" % (ref_type.capitalize(),), ...
python
def make_ref_target_directive(ref_type, indextemplates=None, **kwargs): """ Create and return a L{BBRefTargetDirective} subclass. """ class_vars = dict(ref_type=ref_type, indextemplates=indextemplates) class_vars.update(kwargs) return type("BB%sRefTargetDirective" % (ref_type.capitalize(),), ...
[ "def", "make_ref_target_directive", "(", "ref_type", ",", "indextemplates", "=", "None", ",", "*", "*", "kwargs", ")", ":", "class_vars", "=", "dict", "(", "ref_type", "=", "ref_type", ",", "indextemplates", "=", "indextemplates", ")", "class_vars", ".", "upda...
Create and return a L{BBRefTargetDirective} subclass.
[ "Create", "and", "return", "a", "L", "{", "BBRefTargetDirective", "}", "subclass", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/docs/bbdocs/ext.py#L123-L130
train
buildbot/buildbot
master/docs/bbdocs/ext.py
make_index
def make_index(name, localname): """ Create and return a L{BBIndex} subclass, for use in the domain's C{indices} """ return type("BB%sIndex" % (name.capitalize(),), (BBIndex,), dict(name=name, localname=localname))
python
def make_index(name, localname): """ Create and return a L{BBIndex} subclass, for use in the domain's C{indices} """ return type("BB%sIndex" % (name.capitalize(),), (BBIndex,), dict(name=name, localname=localname))
[ "def", "make_index", "(", "name", ",", "localname", ")", ":", "return", "type", "(", "\"BB%sIndex\"", "%", "(", "name", ".", "capitalize", "(", ")", ",", ")", ",", "(", "BBIndex", ",", ")", ",", "dict", "(", "name", "=", "name", ",", "localname", "...
Create and return a L{BBIndex} subclass, for use in the domain's C{indices}
[ "Create", "and", "return", "a", "L", "{", "BBIndex", "}", "subclass", "for", "use", "in", "the", "domain", "s", "C", "{", "indices", "}" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/docs/bbdocs/ext.py#L170-L176
train
buildbot/buildbot
master/docs/bbdocs/ext.py
BBRefTargetDirective.resolve_ref
def resolve_ref(cls, domain, env, fromdocname, builder, typ, target, node, contnode): """ Resolve a reference to a directive of this class """ targets = domain.data['targets'].get(cls.ref_type, {}) try: todocname, targetname = targets[target] ...
python
def resolve_ref(cls, domain, env, fromdocname, builder, typ, target, node, contnode): """ Resolve a reference to a directive of this class """ targets = domain.data['targets'].get(cls.ref_type, {}) try: todocname, targetname = targets[target] ...
[ "def", "resolve_ref", "(", "cls", ",", "domain", ",", "env", ",", "fromdocname", ",", "builder", ",", "typ", ",", "target", ",", "node", ",", "contnode", ")", ":", "targets", "=", "domain", ".", "data", "[", "'targets'", "]", ".", "get", "(", "cls", ...
Resolve a reference to a directive of this class
[ "Resolve", "a", "reference", "to", "a", "directive", "of", "this", "class" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/docs/bbdocs/ext.py#L105-L120
train
buildbot/buildbot
master/docs/bbdocs/ext.py
BBIndex.resolve_ref
def resolve_ref(cls, domain, env, fromdocname, builder, typ, target, node, contnode): """ Resolve a reference to an index to the document containing the index, using the index's C{localname} as the content of the link. """ # indexes appear to be automatically ...
python
def resolve_ref(cls, domain, env, fromdocname, builder, typ, target, node, contnode): """ Resolve a reference to an index to the document containing the index, using the index's C{localname} as the content of the link. """ # indexes appear to be automatically ...
[ "def", "resolve_ref", "(", "cls", ",", "domain", ",", "env", ",", "fromdocname", ",", "builder", ",", "typ", ",", "target", ",", "node", ",", "contnode", ")", ":", "# indexes appear to be automatically generated at doc DOMAIN-NAME", "todocname", "=", "\"bb-%s\"", ...
Resolve a reference to an index to the document containing the index, using the index's C{localname} as the content of the link.
[ "Resolve", "a", "reference", "to", "an", "index", "to", "the", "document", "containing", "the", "index", "using", "the", "index", "s", "C", "{", "localname", "}", "as", "the", "content", "of", "the", "link", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/docs/bbdocs/ext.py#L154-L167
train
buildbot/buildbot
master/buildbot/steps/package/rpm/rpmspec.py
RpmSpec.load
def load(self): """ call this function after the file exists to populate properties """ # If we are given a string, open it up else assume it's something we # can call read on. if isinstance(self.specfile, str): f = open(self.specfile, 'r') else: ...
python
def load(self): """ call this function after the file exists to populate properties """ # If we are given a string, open it up else assume it's something we # can call read on. if isinstance(self.specfile, str): f = open(self.specfile, 'r') else: ...
[ "def", "load", "(", "self", ")", ":", "# If we are given a string, open it up else assume it's something we", "# can call read on.", "if", "isinstance", "(", "self", ".", "specfile", ",", "str", ")", ":", "f", "=", "open", "(", "self", ".", "specfile", ",", "'r'",...
call this function after the file exists to populate properties
[ "call", "this", "function", "after", "the", "file", "exists", "to", "populate", "properties" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/package/rpm/rpmspec.py#L54-L71
train
buildbot/buildbot
master/buildbot/statistics/capture.py
CapturePropertyBase.consume
def consume(self, routingKey, msg): """ Consumer for this (CaptureProperty) class. Gets the properties from data api and send them to the storage backends. """ builder_info = yield self.master.data.get(("builders", msg['builderid'])) if self._builder_name_matches(builder...
python
def consume(self, routingKey, msg): """ Consumer for this (CaptureProperty) class. Gets the properties from data api and send them to the storage backends. """ builder_info = yield self.master.data.get(("builders", msg['builderid'])) if self._builder_name_matches(builder...
[ "def", "consume", "(", "self", ",", "routingKey", ",", "msg", ")", ":", "builder_info", "=", "yield", "self", ".", "master", ".", "data", ".", "get", "(", "(", "\"builders\"", ",", "msg", "[", "'builderid'", "]", ")", ")", "if", "self", ".", "_builde...
Consumer for this (CaptureProperty) class. Gets the properties from data api and send them to the storage backends.
[ "Consumer", "for", "this", "(", "CaptureProperty", ")", "class", ".", "Gets", "the", "properties", "from", "data", "api", "and", "send", "them", "to", "the", "storage", "backends", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/statistics/capture.py#L80-L113
train
buildbot/buildbot
master/buildbot/statistics/capture.py
CaptureBuildTimes.consume
def consume(self, routingKey, msg): """ Consumer for CaptureBuildStartTime. Gets the build start time. """ builder_info = yield self.master.data.get(("builders", msg['builderid'])) if self._builder_name_matches(builder_info): try: ret_val = self._callb...
python
def consume(self, routingKey, msg): """ Consumer for CaptureBuildStartTime. Gets the build start time. """ builder_info = yield self.master.data.get(("builders", msg['builderid'])) if self._builder_name_matches(builder_info): try: ret_val = self._callb...
[ "def", "consume", "(", "self", ",", "routingKey", ",", "msg", ")", ":", "builder_info", "=", "yield", "self", ".", "master", ".", "data", ".", "get", "(", "(", "\"builders\"", ",", "msg", "[", "'builderid'", "]", ")", ")", "if", "self", ".", "_builde...
Consumer for CaptureBuildStartTime. Gets the build start time.
[ "Consumer", "for", "CaptureBuildStartTime", ".", "Gets", "the", "build", "start", "time", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/statistics/capture.py#L160-L183
train
buildbot/buildbot
master/buildbot/statistics/capture.py
CaptureDataBase.consume
def consume(self, routingKey, msg): """ Consumer for this (CaptureData) class. Gets the data sent from yieldMetricsValue and sends it to the storage backends. """ build_data = msg['build_data'] builder_info = yield self.master.data.get(("builders", build_data['builderid']...
python
def consume(self, routingKey, msg): """ Consumer for this (CaptureData) class. Gets the data sent from yieldMetricsValue and sends it to the storage backends. """ build_data = msg['build_data'] builder_info = yield self.master.data.get(("builders", build_data['builderid']...
[ "def", "consume", "(", "self", ",", "routingKey", ",", "msg", ")", ":", "build_data", "=", "msg", "[", "'build_data'", "]", "builder_info", "=", "yield", "self", ".", "master", ".", "data", ".", "get", "(", "(", "\"builders\"", ",", "build_data", "[", ...
Consumer for this (CaptureData) class. Gets the data sent from yieldMetricsValue and sends it to the storage backends.
[ "Consumer", "for", "this", "(", "CaptureData", ")", "class", ".", "Gets", "the", "data", "sent", "from", "yieldMetricsValue", "and", "sends", "it", "to", "the", "storage", "backends", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/statistics/capture.py#L339-L358
train
buildbot/buildbot
master/buildbot/reporters/github.py
GitHubStatusPush.createStatus
def createStatus(self, repo_user, repo_name, sha, state, target_url=None, context=None, issue=None, description=None): """ :param repo_user: GitHub user or organization :param repo_name: Name of the repository :param sha: Full sha to create the s...
python
def createStatus(self, repo_user, repo_name, sha, state, target_url=None, context=None, issue=None, description=None): """ :param repo_user: GitHub user or organization :param repo_name: Name of the repository :param sha: Full sha to create the s...
[ "def", "createStatus", "(", "self", ",", "repo_user", ",", "repo_name", ",", "sha", ",", "state", ",", "target_url", "=", "None", ",", "context", "=", "None", ",", "issue", "=", "None", ",", "description", "=", "None", ")", ":", "payload", "=", "{", ...
:param repo_user: GitHub user or organization :param repo_name: Name of the repository :param sha: Full sha to create the status for. :param state: one of the following 'pending', 'success', 'error' or 'failure'. :param target_url: Target url to associate with this ...
[ ":", "param", "repo_user", ":", "GitHub", "user", "or", "organization", ":", "param", "repo_name", ":", "Name", "of", "the", "repository", ":", "param", "sha", ":", "Full", "sha", "to", "create", "the", "status", "for", ".", ":", "param", "state", ":", ...
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/github.py#L68-L99
train
buildbot/buildbot
master/buildbot/reporters/github.py
GitHubCommentPush.createStatus
def createStatus(self, repo_user, repo_name, sha, state, target_url=None, context=None, issue=None, description=None): """ :param repo_user: GitHub user or organization :param repo_name: Name of the repository :param issue: Pull request number ...
python
def createStatus(self, repo_user, repo_name, sha, state, target_url=None, context=None, issue=None, description=None): """ :param repo_user: GitHub user or organization :param repo_name: Name of the repository :param issue: Pull request number ...
[ "def", "createStatus", "(", "self", ",", "repo_user", ",", "repo_name", ",", "sha", ",", "state", ",", "target_url", "=", "None", ",", "context", "=", "None", ",", "issue", "=", "None", ",", "description", "=", "None", ")", ":", "payload", "=", "{", ...
:param repo_user: GitHub user or organization :param repo_name: Name of the repository :param issue: Pull request number :param state: one of the following 'pending', 'success', 'error' or 'failure'. :param description: Short description of the status. :retu...
[ ":", "param", "repo_user", ":", "GitHub", "user", "or", "organization", ":", "param", "repo_name", ":", "Name", "of", "the", "repository", ":", "param", "issue", ":", "Pull", "request", "number", ":", "param", "state", ":", "one", "of", "the", "following",...
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/github.py#L197-L217
train
buildbot/buildbot
worker/buildbot_worker/scripts/stop.py
stopWorker
def stopWorker(basedir, quiet, signame="TERM"): """ Stop worker process by sending it a signal. Using the specified basedir path, read worker process's pid file and try to terminate that process with specified signal. @param basedir: worker's basedir path @param quite: if False, don't print ...
python
def stopWorker(basedir, quiet, signame="TERM"): """ Stop worker process by sending it a signal. Using the specified basedir path, read worker process's pid file and try to terminate that process with specified signal. @param basedir: worker's basedir path @param quite: if False, don't print ...
[ "def", "stopWorker", "(", "basedir", ",", "quiet", ",", "signame", "=", "\"TERM\"", ")", ":", "import", "signal", "os", ".", "chdir", "(", "basedir", ")", "try", ":", "f", "=", "open", "(", "\"twistd.pid\"", ",", "\"rt\"", ")", "except", "IOError", ":"...
Stop worker process by sending it a signal. Using the specified basedir path, read worker process's pid file and try to terminate that process with specified signal. @param basedir: worker's basedir path @param quite: if False, don't print any messages to stdout @param signame: signal to send to...
[ "Stop", "worker", "process", "by", "sending", "it", "a", "signal", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/scripts/stop.py#L33-L76
train
buildbot/buildbot
master/buildbot/process/factory.py
BuildFactory.newBuild
def newBuild(self, requests): """Create a new Build instance. @param requests: a list of buildrequest dictionaries describing what is to be built """ b = self.buildClass(requests) b.useProgress = self.useProgress b.workdir = self.workdir b.setStepFactorie...
python
def newBuild(self, requests): """Create a new Build instance. @param requests: a list of buildrequest dictionaries describing what is to be built """ b = self.buildClass(requests) b.useProgress = self.useProgress b.workdir = self.workdir b.setStepFactorie...
[ "def", "newBuild", "(", "self", ",", "requests", ")", ":", "b", "=", "self", ".", "buildClass", "(", "requests", ")", "b", ".", "useProgress", "=", "self", ".", "useProgress", "b", ".", "workdir", "=", "self", ".", "workdir", "b", ".", "setStepFactorie...
Create a new Build instance. @param requests: a list of buildrequest dictionaries describing what is to be built
[ "Create", "a", "new", "Build", "instance", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/factory.py#L62-L72
train
buildbot/buildbot
master/buildbot/steps/shell.py
WarningCountingShellCommand.addSuppression
def addSuppression(self, suppressionList): """ This method can be used to add patters of warnings that should not be counted. It takes a single argument, a list of patterns. Each pattern is a 4-tuple (FILE-RE, WARN-RE, START, END). FILE-RE is a regular expression (stri...
python
def addSuppression(self, suppressionList): """ This method can be used to add patters of warnings that should not be counted. It takes a single argument, a list of patterns. Each pattern is a 4-tuple (FILE-RE, WARN-RE, START, END). FILE-RE is a regular expression (stri...
[ "def", "addSuppression", "(", "self", ",", "suppressionList", ")", ":", "for", "fileRe", ",", "warnRe", ",", "start", ",", "end", "in", "suppressionList", ":", "if", "fileRe", "is", "not", "None", "and", "isinstance", "(", "fileRe", ",", "str", ")", ":",...
This method can be used to add patters of warnings that should not be counted. It takes a single argument, a list of patterns. Each pattern is a 4-tuple (FILE-RE, WARN-RE, START, END). FILE-RE is a regular expression (string or compiled regexp), or None. If None, the pattern m...
[ "This", "method", "can", "be", "used", "to", "add", "patters", "of", "warnings", "that", "should", "not", "be", "counted", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/shell.py#L446-L472
train
buildbot/buildbot
master/buildbot/steps/shell.py
WarningCountingShellCommand.warnExtractFromRegexpGroups
def warnExtractFromRegexpGroups(self, line, match): """ Extract file name, line number, and warning text as groups (1,2,3) of warningPattern match.""" file = match.group(1) lineNo = match.group(2) if lineNo is not None: lineNo = int(lineNo) text = matc...
python
def warnExtractFromRegexpGroups(self, line, match): """ Extract file name, line number, and warning text as groups (1,2,3) of warningPattern match.""" file = match.group(1) lineNo = match.group(2) if lineNo is not None: lineNo = int(lineNo) text = matc...
[ "def", "warnExtractFromRegexpGroups", "(", "self", ",", "line", ",", "match", ")", ":", "file", "=", "match", ".", "group", "(", "1", ")", "lineNo", "=", "match", ".", "group", "(", "2", ")", "if", "lineNo", "is", "not", "None", ":", "lineNo", "=", ...
Extract file name, line number, and warning text as groups (1,2,3) of warningPattern match.
[ "Extract", "file", "name", "line", "number", "and", "warning", "text", "as", "groups", "(", "1", "2", "3", ")", "of", "warningPattern", "match", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/shell.py#L480-L489
train
buildbot/buildbot
master/buildbot/steps/shell.py
WarningCountingShellCommand.createSummary
def createSummary(self, log): """ Match log lines against warningPattern. Warnings are collected into another log for this step, and the build-wide 'warnings-count' is updated.""" # If there were any warnings, make the log if lines with warnings # available if s...
python
def createSummary(self, log): """ Match log lines against warningPattern. Warnings are collected into another log for this step, and the build-wide 'warnings-count' is updated.""" # If there were any warnings, make the log if lines with warnings # available if s...
[ "def", "createSummary", "(", "self", ",", "log", ")", ":", "# If there were any warnings, make the log if lines with warnings", "# available", "if", "self", ".", "warnCount", ":", "self", ".", "addCompleteLog", "(", "\"warnings (%d)\"", "%", "self", ".", "warnCount", ...
Match log lines against warningPattern. Warnings are collected into another log for this step, and the build-wide 'warnings-count' is updated.
[ "Match", "log", "lines", "against", "warningPattern", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/shell.py#L584-L602
train
buildbot/buildbot
master/buildbot/steps/cppcheck.py
Cppcheck.evaluateCommand
def evaluateCommand(self, cmd): """ cppcheck always return 0, unless a special parameter is given """ for msg in self.flunkingIssues: if self.counts[msg] != 0: return FAILURE if self.getProperty('cppcheck-total') != 0: return WARNINGS return SUCCES...
python
def evaluateCommand(self, cmd): """ cppcheck always return 0, unless a special parameter is given """ for msg in self.flunkingIssues: if self.counts[msg] != 0: return FAILURE if self.getProperty('cppcheck-total') != 0: return WARNINGS return SUCCES...
[ "def", "evaluateCommand", "(", "self", ",", "cmd", ")", ":", "for", "msg", "in", "self", ".", "flunkingIssues", ":", "if", "self", ".", "counts", "[", "msg", "]", "!=", "0", ":", "return", "FAILURE", "if", "self", ".", "getProperty", "(", "'cppcheck-to...
cppcheck always return 0, unless a special parameter is given
[ "cppcheck", "always", "return", "0", "unless", "a", "special", "parameter", "is", "given" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/cppcheck.py#L88-L95
train
buildbot/buildbot
master/buildbot/secrets/providers/passwordstore.py
SecretInPass.get
def get(self, entry): """ get the value from pass identified by 'entry' """ try: output = yield utils.getProcessOutput( "pass", args=[entry], env=self._env ) return output.decode("utf-8", "ignore").splitl...
python
def get(self, entry): """ get the value from pass identified by 'entry' """ try: output = yield utils.getProcessOutput( "pass", args=[entry], env=self._env ) return output.decode("utf-8", "ignore").splitl...
[ "def", "get", "(", "self", ",", "entry", ")", ":", "try", ":", "output", "=", "yield", "utils", ".", "getProcessOutput", "(", "\"pass\"", ",", "args", "=", "[", "entry", "]", ",", "env", "=", "self", ".", "_env", ")", "return", "output", ".", "deco...
get the value from pass identified by 'entry'
[ "get", "the", "value", "from", "pass", "identified", "by", "entry" ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/secrets/providers/passwordstore.py#L56-L68
train
buildbot/buildbot
master/buildbot/monkeypatches/servicechecks.py
patch
def patch(): """ Patch startService and stopService so that they check the previous state first. (used for debugging only) """ from twisted.application.service import Service old_startService = Service.startService old_stopService = Service.stopService def startService(self): ...
python
def patch(): """ Patch startService and stopService so that they check the previous state first. (used for debugging only) """ from twisted.application.service import Service old_startService = Service.startService old_stopService = Service.stopService def startService(self): ...
[ "def", "patch", "(", ")", ":", "from", "twisted", ".", "application", ".", "service", "import", "Service", "old_startService", "=", "Service", ".", "startService", "old_stopService", "=", "Service", ".", "stopService", "def", "startService", "(", "self", ")", ...
Patch startService and stopService so that they check the previous state first. (used for debugging only)
[ "Patch", "startService", "and", "stopService", "so", "that", "they", "check", "the", "previous", "state", "first", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/monkeypatches/servicechecks.py#L17-L36
train
buildbot/buildbot
master/buildbot/db/connector.py
DBConnector._doCleanup
def _doCleanup(self): """ Perform any periodic database cleanup tasks. @returns: Deferred """ # pass on this if we're not configured yet if not self.configured_url: return d = self.changes.pruneChanges(self.master.config.changeHorizon) d.addE...
python
def _doCleanup(self): """ Perform any periodic database cleanup tasks. @returns: Deferred """ # pass on this if we're not configured yet if not self.configured_url: return d = self.changes.pruneChanges(self.master.config.changeHorizon) d.addE...
[ "def", "_doCleanup", "(", "self", ")", ":", "# pass on this if we're not configured yet", "if", "not", "self", ".", "configured_url", ":", "return", "d", "=", "self", ".", "changes", ".", "pruneChanges", "(", "self", ".", "master", ".", "config", ".", "changeH...
Perform any periodic database cleanup tasks. @returns: Deferred
[ "Perform", "any", "periodic", "database", "cleanup", "tasks", "." ]
5df3cfae6d760557d99156633c32b1822a1e130c
https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/db/connector.py#L142-L154
train