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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
buildbot/buildbot | worker/buildbot_worker/scripts/create_worker.py | _makeBuildbotTac | def _makeBuildbotTac(basedir, tac_file_contents, quiet):
"""
Create buildbot.tac file. If buildbot.tac file already exists with
different contents, create buildbot.tac.new instead.
@param basedir: worker base directory relative path
@param tac_file_contents: contents of buildbot.tac file to write
... | python | def _makeBuildbotTac(basedir, tac_file_contents, quiet):
"""
Create buildbot.tac file. If buildbot.tac file already exists with
different contents, create buildbot.tac.new instead.
@param basedir: worker base directory relative path
@param tac_file_contents: contents of buildbot.tac file to write
... | [
"def",
"_makeBuildbotTac",
"(",
"basedir",
",",
"tac_file_contents",
",",
"quiet",
")",
":",
"tacfile",
"=",
"os",
".",
"path",
".",
"join",
"(",
"basedir",
",",
"\"buildbot.tac\"",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"tacfile",
")",
":",
... | Create buildbot.tac file. If buildbot.tac file already exists with
different contents, create buildbot.tac.new instead.
@param basedir: worker base directory relative path
@param tac_file_contents: contents of buildbot.tac file to write
@param quiet: if True, don't print info messages
@raise Creat... | [
"Create",
"buildbot",
".",
"tac",
"file",
".",
"If",
"buildbot",
".",
"tac",
"file",
"already",
"exists",
"with",
"different",
"contents",
"create",
"buildbot",
".",
"tac",
".",
"new",
"instead",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/scripts/create_worker.py#L101-L139 | train |
buildbot/buildbot | worker/buildbot_worker/scripts/create_worker.py | _makeInfoFiles | def _makeInfoFiles(basedir, quiet):
"""
Create info/* files inside basedir.
@param basedir: worker base directory relative path
@param quiet: if True, don't print info messages
@raise CreateWorkerError: on error making info directory or
writing info files
"""
... | python | def _makeInfoFiles(basedir, quiet):
"""
Create info/* files inside basedir.
@param basedir: worker base directory relative path
@param quiet: if True, don't print info messages
@raise CreateWorkerError: on error making info directory or
writing info files
"""
... | [
"def",
"_makeInfoFiles",
"(",
"basedir",
",",
"quiet",
")",
":",
"def",
"createFile",
"(",
"path",
",",
"file",
",",
"contents",
")",
":",
"filepath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"path",
",",
"file",
")",
"if",
"os",
".",
"path",
".",... | Create info/* files inside basedir.
@param basedir: worker base directory relative path
@param quiet: if True, don't print info messages
@raise CreateWorkerError: on error making info directory or
writing info files | [
"Create",
"info",
"/",
"*",
"files",
"inside",
"basedir",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/scripts/create_worker.py#L142-L195 | train |
buildbot/buildbot | master/buildbot/reporters/bitbucket.py | BitbucketStatusPush.get_owner_and_repo | def get_owner_and_repo(repourl):
"""
Takes a git repository URL from Bitbucket and tries to determine the owner and repository name
:param repourl: Bitbucket git repo in the form of
git@bitbucket.com:OWNER/REPONAME.git
https://bitbucket.com/OWNER/REPONAME.... | python | def get_owner_and_repo(repourl):
"""
Takes a git repository URL from Bitbucket and tries to determine the owner and repository name
:param repourl: Bitbucket git repo in the form of
git@bitbucket.com:OWNER/REPONAME.git
https://bitbucket.com/OWNER/REPONAME.... | [
"def",
"get_owner_and_repo",
"(",
"repourl",
")",
":",
"parsed",
"=",
"urlparse",
"(",
"repourl",
")",
"if",
"parsed",
".",
"scheme",
":",
"path",
"=",
"parsed",
".",
"path",
"[",
"1",
":",
"]",
"else",
":",
"# we assume git@host:owner/repo.git here",
"path"... | Takes a git repository URL from Bitbucket and tries to determine the owner and repository name
:param repourl: Bitbucket git repo in the form of
git@bitbucket.com:OWNER/REPONAME.git
https://bitbucket.com/OWNER/REPONAME.git
ssh://git@bitbucket.com/OWNER... | [
"Takes",
"a",
"git",
"repository",
"URL",
"from",
"Bitbucket",
"and",
"tries",
"to",
"determine",
"the",
"owner",
"and",
"repository",
"name",
":",
"param",
"repourl",
":",
"Bitbucket",
"git",
"repo",
"in",
"the",
"form",
"of",
"git"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/bitbucket.py#L103-L129 | train |
buildbot/buildbot | master/buildbot/db/changes.py | ChangesConnectorComponent.pruneChanges | def pruneChanges(self, changeHorizon):
"""
Called periodically by DBConnector, this method deletes changes older
than C{changeHorizon}.
"""
if not changeHorizon:
return None
def thd(conn):
changes_tbl = self.db.model.changes
# First,... | python | def pruneChanges(self, changeHorizon):
"""
Called periodically by DBConnector, this method deletes changes older
than C{changeHorizon}.
"""
if not changeHorizon:
return None
def thd(conn):
changes_tbl = self.db.model.changes
# First,... | [
"def",
"pruneChanges",
"(",
"self",
",",
"changeHorizon",
")",
":",
"if",
"not",
"changeHorizon",
":",
"return",
"None",
"def",
"thd",
"(",
"conn",
")",
":",
"changes_tbl",
"=",
"self",
".",
"db",
".",
"model",
".",
"changes",
"# First, get the list of chang... | Called periodically by DBConnector, this method deletes changes older
than C{changeHorizon}. | [
"Called",
"periodically",
"by",
"DBConnector",
"this",
"method",
"deletes",
"changes",
"older",
"than",
"C",
"{",
"changeHorizon",
"}",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/db/changes.py#L309-L341 | train |
buildbot/buildbot | master/buildbot/scripts/base.py | checkPidFile | def checkPidFile(pidfile):
""" mostly comes from _twistd_unix.py which is not twisted public API :-/
except it returns an exception instead of exiting
"""
if os.path.exists(pidfile):
try:
with open(pidfile) as f:
pid = int(f.read())
except ValueError:
... | python | def checkPidFile(pidfile):
""" mostly comes from _twistd_unix.py which is not twisted public API :-/
except it returns an exception instead of exiting
"""
if os.path.exists(pidfile):
try:
with open(pidfile) as f:
pid = int(f.read())
except ValueError:
... | [
"def",
"checkPidFile",
"(",
"pidfile",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"pidfile",
")",
":",
"try",
":",
"with",
"open",
"(",
"pidfile",
")",
"as",
"f",
":",
"pid",
"=",
"int",
"(",
"f",
".",
"read",
"(",
")",
")",
"except... | mostly comes from _twistd_unix.py which is not twisted public API :-/
except it returns an exception instead of exiting | [
"mostly",
"comes",
"from",
"_twistd_unix",
".",
"py",
"which",
"is",
"not",
"twisted",
"public",
"API",
":",
"-",
"/"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/scripts/base.py#L44-L66 | train |
buildbot/buildbot | master/buildbot/scripts/base.py | SubcommandOptions.loadOptionsFile | def loadOptionsFile(self, _here=None):
"""Find the .buildbot/options file. Crawl from the current directory
up towards the root, and also look in ~/.buildbot . The first directory
that's owned by the user and has the file we're looking for wins.
Windows skips the owned-by-user test.
... | python | def loadOptionsFile(self, _here=None):
"""Find the .buildbot/options file. Crawl from the current directory
up towards the root, and also look in ~/.buildbot . The first directory
that's owned by the user and has the file we're looking for wins.
Windows skips the owned-by-user test.
... | [
"def",
"loadOptionsFile",
"(",
"self",
",",
"_here",
"=",
"None",
")",
":",
"here",
"=",
"_here",
"or",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"getcwd",
"(",
")",
")",
"if",
"runtime",
".",
"platformType",
"==",
"'win32'",
":",
"# never t... | Find the .buildbot/options file. Crawl from the current directory
up towards the root, and also look in ~/.buildbot . The first directory
that's owned by the user and has the file we're looking for wins.
Windows skips the owned-by-user test.
@rtype: dict
@return: a dictionary o... | [
"Find",
"the",
".",
"buildbot",
"/",
"options",
"file",
".",
"Crawl",
"from",
"the",
"current",
"directory",
"up",
"towards",
"the",
"root",
"and",
"also",
"look",
"in",
"~",
"/",
".",
"buildbot",
".",
"The",
"first",
"directory",
"that",
"s",
"owned",
... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/scripts/base.py#L205-L264 | train |
buildbot/buildbot | worker/buildbot_worker/pbutil.py | AutoLoginPBFactory.failedToGetPerspective | def failedToGetPerspective(self, why, broker):
"""The login process failed, most likely because of an authorization
failure (bad password), but it is also possible that we lost the new
connection before we managed to send our credentials.
"""
log.msg("ReconnectingPBClientFactory.... | python | def failedToGetPerspective(self, why, broker):
"""The login process failed, most likely because of an authorization
failure (bad password), but it is also possible that we lost the new
connection before we managed to send our credentials.
"""
log.msg("ReconnectingPBClientFactory.... | [
"def",
"failedToGetPerspective",
"(",
"self",
",",
"why",
",",
"broker",
")",
":",
"log",
".",
"msg",
"(",
"\"ReconnectingPBClientFactory.failedToGetPerspective\"",
")",
"# put something useful in the logs",
"if",
"why",
".",
"check",
"(",
"pb",
".",
"PBConnectionLost... | The login process failed, most likely because of an authorization
failure (bad password), but it is also possible that we lost the new
connection before we managed to send our credentials. | [
"The",
"login",
"process",
"failed",
"most",
"likely",
"because",
"of",
"an",
"authorization",
"failure",
"(",
"bad",
"password",
")",
"but",
"it",
"is",
"also",
"possible",
"that",
"we",
"lost",
"the",
"new",
"connection",
"before",
"we",
"managed",
"to",
... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/pbutil.py#L84-L103 | train |
buildbot/buildbot | master/buildbot/reporters/gitlab.py | GitLabStatusPush.createStatus | def createStatus(self,
project_id, branch, sha, state, target_url=None,
description=None, context=None):
"""
:param project_id: Project ID from GitLab
:param branch: Branch name to create the status for.
:param sha: Full sha to create the status ... | python | def createStatus(self,
project_id, branch, sha, state, target_url=None,
description=None, context=None):
"""
:param project_id: Project ID from GitLab
:param branch: Branch name to create the status for.
:param sha: Full sha to create the status ... | [
"def",
"createStatus",
"(",
"self",
",",
"project_id",
",",
"branch",
",",
"sha",
",",
"state",
",",
"target_url",
"=",
"None",
",",
"description",
"=",
"None",
",",
"context",
"=",
"None",
")",
":",
"payload",
"=",
"{",
"'state'",
":",
"state",
",",
... | :param project_id: Project ID from GitLab
:param branch: Branch name to create the status for.
:param sha: Full sha to create the status for.
:param state: one of the following 'pending', 'success', 'failed'
or 'cancelled'.
:param target_url: Target url to associate... | [
":",
"param",
"project_id",
":",
"Project",
"ID",
"from",
"GitLab",
":",
"param",
"branch",
":",
"Branch",
"name",
"to",
"create",
"the",
"status",
"for",
".",
":",
"param",
"sha",
":",
"Full",
"sha",
"to",
"create",
"the",
"status",
"for",
".",
":",
... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/gitlab.py#L63-L91 | train |
buildbot/buildbot | master/buildbot/process/buildrequest.py | BuildRequest.fromBrdict | def fromBrdict(cls, master, brdict):
"""
Construct a new L{BuildRequest} from a dictionary as returned by
L{BuildRequestsConnectorComponent.getBuildRequest}.
This method uses a cache, which may result in return of stale objects;
for the most up-to-date information, use the datab... | python | def fromBrdict(cls, master, brdict):
"""
Construct a new L{BuildRequest} from a dictionary as returned by
L{BuildRequestsConnectorComponent.getBuildRequest}.
This method uses a cache, which may result in return of stale objects;
for the most up-to-date information, use the datab... | [
"def",
"fromBrdict",
"(",
"cls",
",",
"master",
",",
"brdict",
")",
":",
"cache",
"=",
"master",
".",
"caches",
".",
"get_cache",
"(",
"\"BuildRequests\"",
",",
"cls",
".",
"_make_br",
")",
"return",
"cache",
".",
"get",
"(",
"brdict",
"[",
"'buildreques... | Construct a new L{BuildRequest} from a dictionary as returned by
L{BuildRequestsConnectorComponent.getBuildRequest}.
This method uses a cache, which may result in return of stale objects;
for the most up-to-date information, use the database connector
methods.
@param master: cu... | [
"Construct",
"a",
"new",
"L",
"{",
"BuildRequest",
"}",
"from",
"a",
"dictionary",
"as",
"returned",
"by",
"L",
"{",
"BuildRequestsConnectorComponent",
".",
"getBuildRequest",
"}",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/buildrequest.py#L196-L211 | train |
buildbot/buildbot | master/buildbot/process/buildrequest.py | BuildRequest.canBeCollapsed | def canBeCollapsed(master, br1, br2):
"""
Returns true if both buildrequest can be merged, via Deferred.
This implements Buildbot's default collapse strategy.
"""
# short-circuit: if these are for the same buildset, collapse away
if br1['buildsetid'] == br2['buildsetid']... | python | def canBeCollapsed(master, br1, br2):
"""
Returns true if both buildrequest can be merged, via Deferred.
This implements Buildbot's default collapse strategy.
"""
# short-circuit: if these are for the same buildset, collapse away
if br1['buildsetid'] == br2['buildsetid']... | [
"def",
"canBeCollapsed",
"(",
"master",
",",
"br1",
",",
"br2",
")",
":",
"# short-circuit: if these are for the same buildset, collapse away",
"if",
"br1",
"[",
"'buildsetid'",
"]",
"==",
"br2",
"[",
"'buildsetid'",
"]",
":",
"return",
"True",
"# get the buidlsets fo... | Returns true if both buildrequest can be merged, via Deferred.
This implements Buildbot's default collapse strategy. | [
"Returns",
"true",
"if",
"both",
"buildrequest",
"can",
"be",
"merged",
"via",
"Deferred",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/buildrequest.py#L253-L309 | train |
buildbot/buildbot | master/buildbot/process/buildrequest.py | BuildRequest.mergeSourceStampsWith | def mergeSourceStampsWith(self, others):
""" Returns one merged sourcestamp for every codebase """
# get all codebases from all requests
all_codebases = set(self.sources)
for other in others:
all_codebases |= set(other.sources)
all_merged_sources = {}
# walk ... | python | def mergeSourceStampsWith(self, others):
""" Returns one merged sourcestamp for every codebase """
# get all codebases from all requests
all_codebases = set(self.sources)
for other in others:
all_codebases |= set(other.sources)
all_merged_sources = {}
# walk ... | [
"def",
"mergeSourceStampsWith",
"(",
"self",
",",
"others",
")",
":",
"# get all codebases from all requests",
"all_codebases",
"=",
"set",
"(",
"self",
".",
"sources",
")",
"for",
"other",
"in",
"others",
":",
"all_codebases",
"|=",
"set",
"(",
"other",
".",
... | Returns one merged sourcestamp for every codebase | [
"Returns",
"one",
"merged",
"sourcestamp",
"for",
"every",
"codebase"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/buildrequest.py#L311-L334 | train |
buildbot/buildbot | master/buildbot/process/buildrequest.py | BuildRequest.mergeReasons | def mergeReasons(self, others):
"""Return a reason for the merged build request."""
reasons = []
for req in [self] + others:
if req.reason and req.reason not in reasons:
reasons.append(req.reason)
return ", ".join(reasons) | python | def mergeReasons(self, others):
"""Return a reason for the merged build request."""
reasons = []
for req in [self] + others:
if req.reason and req.reason not in reasons:
reasons.append(req.reason)
return ", ".join(reasons) | [
"def",
"mergeReasons",
"(",
"self",
",",
"others",
")",
":",
"reasons",
"=",
"[",
"]",
"for",
"req",
"in",
"[",
"self",
"]",
"+",
"others",
":",
"if",
"req",
".",
"reason",
"and",
"req",
".",
"reason",
"not",
"in",
"reasons",
":",
"reasons",
".",
... | Return a reason for the merged build request. | [
"Return",
"a",
"reason",
"for",
"the",
"merged",
"build",
"request",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/buildrequest.py#L336-L342 | train |
buildbot/buildbot | worker/buildbot_worker/compat.py | bytes2NativeString | def bytes2NativeString(x, encoding='utf-8'):
"""
Convert C{bytes} to a native C{str}.
On Python 3 and higher, str and bytes
are not equivalent. In this case, decode
the bytes, and return a native string.
On Python 2 and lower, str and bytes
are equivalent. In this case, just
just ret... | python | def bytes2NativeString(x, encoding='utf-8'):
"""
Convert C{bytes} to a native C{str}.
On Python 3 and higher, str and bytes
are not equivalent. In this case, decode
the bytes, and return a native string.
On Python 2 and lower, str and bytes
are equivalent. In this case, just
just ret... | [
"def",
"bytes2NativeString",
"(",
"x",
",",
"encoding",
"=",
"'utf-8'",
")",
":",
"if",
"isinstance",
"(",
"x",
",",
"bytes",
")",
"and",
"str",
"!=",
"bytes",
":",
"return",
"x",
".",
"decode",
"(",
"encoding",
")",
"return",
"x"
] | Convert C{bytes} to a native C{str}.
On Python 3 and higher, str and bytes
are not equivalent. In this case, decode
the bytes, and return a native string.
On Python 2 and lower, str and bytes
are equivalent. In this case, just
just return the native string.
@param x: a string of type C{... | [
"Convert",
"C",
"{",
"bytes",
"}",
"to",
"a",
"native",
"C",
"{",
"str",
"}",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/compat.py#L38-L56 | train |
buildbot/buildbot | worker/buildbot_worker/compat.py | unicode2bytes | def unicode2bytes(x, encoding='utf-8', errors='strict'):
"""
Convert a unicode string to C{bytes}.
@param x: a unicode string, of type C{unicode} on Python 2,
or C{str} on Python 3.
@param encoding: an optional codec, default: 'utf-8'
@param errors: error handling scheme, default 'str... | python | def unicode2bytes(x, encoding='utf-8', errors='strict'):
"""
Convert a unicode string to C{bytes}.
@param x: a unicode string, of type C{unicode} on Python 2,
or C{str} on Python 3.
@param encoding: an optional codec, default: 'utf-8'
@param errors: error handling scheme, default 'str... | [
"def",
"unicode2bytes",
"(",
"x",
",",
"encoding",
"=",
"'utf-8'",
",",
"errors",
"=",
"'strict'",
")",
":",
"if",
"isinstance",
"(",
"x",
",",
"text_type",
")",
":",
"x",
"=",
"x",
".",
"encode",
"(",
"encoding",
",",
"errors",
")",
"return",
"x"
] | Convert a unicode string to C{bytes}.
@param x: a unicode string, of type C{unicode} on Python 2,
or C{str} on Python 3.
@param encoding: an optional codec, default: 'utf-8'
@param errors: error handling scheme, default 'strict'
@return: a string of type C{bytes} | [
"Convert",
"a",
"unicode",
"string",
"to",
"C",
"{",
"bytes",
"}",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/compat.py#L59-L71 | train |
buildbot/buildbot | worker/buildbot_worker/compat.py | bytes2unicode | def bytes2unicode(x, encoding='utf-8', errors='strict'):
"""
Convert a C{bytes} to a unicode string.
@param x: a unicode string, of type C{unicode} on Python 2,
or C{str} on Python 3.
@param encoding: an optional codec, default: 'utf-8'
@param errors: error handling scheme, default 's... | python | def bytes2unicode(x, encoding='utf-8', errors='strict'):
"""
Convert a C{bytes} to a unicode string.
@param x: a unicode string, of type C{unicode} on Python 2,
or C{str} on Python 3.
@param encoding: an optional codec, default: 'utf-8'
@param errors: error handling scheme, default 's... | [
"def",
"bytes2unicode",
"(",
"x",
",",
"encoding",
"=",
"'utf-8'",
",",
"errors",
"=",
"'strict'",
")",
":",
"if",
"isinstance",
"(",
"x",
",",
"(",
"text_type",
",",
"type",
"(",
"None",
")",
")",
")",
":",
"return",
"x",
"return",
"text_type",
"(",... | Convert a C{bytes} to a unicode string.
@param x: a unicode string, of type C{unicode} on Python 2,
or C{str} on Python 3.
@param encoding: an optional codec, default: 'utf-8'
@param errors: error handling scheme, default 'strict'
@return: a unicode string of type C{unicode} on Python 2, ... | [
"Convert",
"a",
"C",
"{",
"bytes",
"}",
"to",
"a",
"unicode",
"string",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/compat.py#L74-L87 | train |
buildbot/buildbot | master/buildbot/steps/package/rpm/mock.py | Mock.start | def start(self):
"""
Try to remove the old mock logs first.
"""
if self.resultdir:
for lname in self.mock_logfiles:
self.logfiles[lname] = self.build.path_module.join(self.resultdir,
lname)
... | python | def start(self):
"""
Try to remove the old mock logs first.
"""
if self.resultdir:
for lname in self.mock_logfiles:
self.logfiles[lname] = self.build.path_module.join(self.resultdir,
lname)
... | [
"def",
"start",
"(",
"self",
")",
":",
"if",
"self",
".",
"resultdir",
":",
"for",
"lname",
"in",
"self",
".",
"mock_logfiles",
":",
"self",
".",
"logfiles",
"[",
"lname",
"]",
"=",
"self",
".",
"build",
".",
"path_module",
".",
"join",
"(",
"self",
... | Try to remove the old mock logs first. | [
"Try",
"to",
"remove",
"the",
"old",
"mock",
"logs",
"first",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/package/rpm/mock.py#L87-L110 | train |
buildbot/buildbot | master/buildbot/worker/docker.py | _handle_stream_line | def _handle_stream_line(line):
"""\
Input is the json representation of: {'stream': "Content\ncontent"}
Output is a generator yield "Content", and then "content"
"""
# XXX This necessary processing is probably a bug from docker-py,
# hence, might break if the bug is fixed, i.e. we should get dec... | python | def _handle_stream_line(line):
"""\
Input is the json representation of: {'stream': "Content\ncontent"}
Output is a generator yield "Content", and then "content"
"""
# XXX This necessary processing is probably a bug from docker-py,
# hence, might break if the bug is fixed, i.e. we should get dec... | [
"def",
"_handle_stream_line",
"(",
"line",
")",
":",
"# XXX This necessary processing is probably a bug from docker-py,",
"# hence, might break if the bug is fixed, i.e. we should get decoded JSON",
"# directly from the API.",
"line",
"=",
"json",
".",
"loads",
"(",
"line",
")",
"i... | \
Input is the json representation of: {'stream': "Content\ncontent"}
Output is a generator yield "Content", and then "content" | [
"\\",
"Input",
"is",
"the",
"json",
"representation",
"of",
":",
"{",
"stream",
":",
"Content",
"\\",
"ncontent",
"}",
"Output",
"is",
"a",
"generator",
"yield",
"Content",
"and",
"then",
"content"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/worker/docker.py#L45-L60 | train |
buildbot/buildbot | master/buildbot/reporters/words.py | Contact.shouldReportBuild | def shouldReportBuild(self, builder, buildnum):
"""Returns True if this build should be reported for this contact
(eliminating duplicates), and also records the report for later"""
for w, b, n in self.reported_builds:
if b == builder and n == buildnum:
return False
... | python | def shouldReportBuild(self, builder, buildnum):
"""Returns True if this build should be reported for this contact
(eliminating duplicates), and also records the report for later"""
for w, b, n in self.reported_builds:
if b == builder and n == buildnum:
return False
... | [
"def",
"shouldReportBuild",
"(",
"self",
",",
"builder",
",",
"buildnum",
")",
":",
"for",
"w",
",",
"b",
",",
"n",
"in",
"self",
".",
"reported_builds",
":",
"if",
"b",
"==",
"builder",
"and",
"n",
"==",
"buildnum",
":",
"return",
"False",
"self",
"... | Returns True if this build should be reported for this contact
(eliminating duplicates), and also records the report for later | [
"Returns",
"True",
"if",
"this",
"build",
"should",
"be",
"reported",
"for",
"this",
"contact",
"(",
"eliminating",
"duplicates",
")",
"and",
"also",
"records",
"the",
"report",
"for",
"later"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/words.py#L249-L263 | train |
buildbot/buildbot | master/buildbot/reporters/words.py | Contact.splitArgs | def splitArgs(self, args):
"""Returns list of arguments parsed by shlex.split() or
raise UsageError if failed"""
try:
return shlex.split(args)
except ValueError as e:
raise UsageError(e) | python | def splitArgs(self, args):
"""Returns list of arguments parsed by shlex.split() or
raise UsageError if failed"""
try:
return shlex.split(args)
except ValueError as e:
raise UsageError(e) | [
"def",
"splitArgs",
"(",
"self",
",",
"args",
")",
":",
"try",
":",
"return",
"shlex",
".",
"split",
"(",
"args",
")",
"except",
"ValueError",
"as",
"e",
":",
"raise",
"UsageError",
"(",
"e",
")"
] | Returns list of arguments parsed by shlex.split() or
raise UsageError if failed | [
"Returns",
"list",
"of",
"arguments",
"parsed",
"by",
"shlex",
".",
"split",
"()",
"or",
"raise",
"UsageError",
"if",
"failed"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/words.py#L265-L271 | train |
buildbot/buildbot | master/buildbot/reporters/words.py | StatusBot.getContact | def getContact(self, user=None, channel=None):
""" get a Contact instance for ``user`` on ``channel`` """
try:
return self.contacts[(channel, user)]
except KeyError:
new_contact = self.contactClass(self, user=user, channel=channel)
self.contacts[(channel, user... | python | def getContact(self, user=None, channel=None):
""" get a Contact instance for ``user`` on ``channel`` """
try:
return self.contacts[(channel, user)]
except KeyError:
new_contact = self.contactClass(self, user=user, channel=channel)
self.contacts[(channel, user... | [
"def",
"getContact",
"(",
"self",
",",
"user",
"=",
"None",
",",
"channel",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
".",
"contacts",
"[",
"(",
"channel",
",",
"user",
")",
"]",
"except",
"KeyError",
":",
"new_contact",
"=",
"self",
".",
... | get a Contact instance for ``user`` on ``channel`` | [
"get",
"a",
"Contact",
"instance",
"for",
"user",
"on",
"channel"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/words.py#L1032-L1040 | train |
buildbot/buildbot | master/buildbot/steps/subunit.py | SubunitLogObserver.issue | def issue(self, test, err):
"""An issue - failing, erroring etc test."""
self.step.setProgress('tests failed', len(self.failures) +
len(self.errors)) | python | def issue(self, test, err):
"""An issue - failing, erroring etc test."""
self.step.setProgress('tests failed', len(self.failures) +
len(self.errors)) | [
"def",
"issue",
"(",
"self",
",",
"test",
",",
"err",
")",
":",
"self",
".",
"step",
".",
"setProgress",
"(",
"'tests failed'",
",",
"len",
"(",
"self",
".",
"failures",
")",
"+",
"len",
"(",
"self",
".",
"errors",
")",
")"
] | An issue - failing, erroring etc test. | [
"An",
"issue",
"-",
"failing",
"erroring",
"etc",
"test",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/subunit.py#L79-L82 | train |
buildbot/buildbot | master/buildbot/www/hooks/gitlab.py | GitLabHandler._process_change | def _process_change(self, payload, user, repo, repo_url, event,
codebase=None):
"""
Consumes the JSON as a python object and actually starts the build.
:arguments:
payload
Python Object that represents the JSON sent by GitLab Service
... | python | def _process_change(self, payload, user, repo, repo_url, event,
codebase=None):
"""
Consumes the JSON as a python object and actually starts the build.
:arguments:
payload
Python Object that represents the JSON sent by GitLab Service
... | [
"def",
"_process_change",
"(",
"self",
",",
"payload",
",",
"user",
",",
"repo",
",",
"repo_url",
",",
"event",
",",
"codebase",
"=",
"None",
")",
":",
"changes",
"=",
"[",
"]",
"refname",
"=",
"payload",
"[",
"'ref'",
"]",
"# project name from http header... | Consumes the JSON as a python object and actually starts the build.
:arguments:
payload
Python Object that represents the JSON sent by GitLab Service
Hook. | [
"Consumes",
"the",
"JSON",
"as",
"a",
"python",
"object",
"and",
"actually",
"starts",
"the",
"build",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/gitlab.py#L35-L97 | train |
buildbot/buildbot | master/buildbot/www/hooks/gitlab.py | GitLabHandler._process_merge_request_change | def _process_merge_request_change(self, payload, event, codebase=None):
"""
Consumes the merge_request JSON as a python object and turn it into a buildbot change.
:arguments:
payload
Python Object that represents the JSON sent by GitLab Service
Hook.
... | python | def _process_merge_request_change(self, payload, event, codebase=None):
"""
Consumes the merge_request JSON as a python object and turn it into a buildbot change.
:arguments:
payload
Python Object that represents the JSON sent by GitLab Service
Hook.
... | [
"def",
"_process_merge_request_change",
"(",
"self",
",",
"payload",
",",
"event",
",",
"codebase",
"=",
"None",
")",
":",
"attrs",
"=",
"payload",
"[",
"'object_attributes'",
"]",
"commit",
"=",
"attrs",
"[",
"'last_commit'",
"]",
"when_timestamp",
"=",
"date... | Consumes the merge_request JSON as a python object and turn it into a buildbot change.
:arguments:
payload
Python Object that represents the JSON sent by GitLab Service
Hook. | [
"Consumes",
"the",
"merge_request",
"JSON",
"as",
"a",
"python",
"object",
"and",
"turn",
"it",
"into",
"a",
"buildbot",
"change",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/gitlab.py#L99-L154 | train |
buildbot/buildbot | master/buildbot/www/hooks/gitlab.py | GitLabHandler.getChanges | def getChanges(self, request):
"""
Reponds only to POST events and starts the build process
:arguments:
request
the http request object
"""
expected_secret = isinstance(self.options, dict) and self.options.get('secret')
if expected_secret:
... | python | def getChanges(self, request):
"""
Reponds only to POST events and starts the build process
:arguments:
request
the http request object
"""
expected_secret = isinstance(self.options, dict) and self.options.get('secret')
if expected_secret:
... | [
"def",
"getChanges",
"(",
"self",
",",
"request",
")",
":",
"expected_secret",
"=",
"isinstance",
"(",
"self",
".",
"options",
",",
"dict",
")",
"and",
"self",
".",
"options",
".",
"get",
"(",
"'secret'",
")",
"if",
"expected_secret",
":",
"received_secret... | Reponds only to POST events and starts the build process
:arguments:
request
the http request object | [
"Reponds",
"only",
"to",
"POST",
"events",
"and",
"starts",
"the",
"build",
"process"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/gitlab.py#L157-L202 | train |
buildbot/buildbot | master/buildbot/monkeypatches/__init__.py | onlyOnce | def onlyOnce(fn):
'Set up FN to only run once within an interpreter instance'
def wrap(*args, **kwargs):
if hasattr(fn, 'called'):
return
fn.called = 1
return fn(*args, **kwargs)
util.mergeFunctionMetadata(fn, wrap)
return wrap | python | def onlyOnce(fn):
'Set up FN to only run once within an interpreter instance'
def wrap(*args, **kwargs):
if hasattr(fn, 'called'):
return
fn.called = 1
return fn(*args, **kwargs)
util.mergeFunctionMetadata(fn, wrap)
return wrap | [
"def",
"onlyOnce",
"(",
"fn",
")",
":",
"def",
"wrap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"hasattr",
"(",
"fn",
",",
"'called'",
")",
":",
"return",
"fn",
".",
"called",
"=",
"1",
"return",
"fn",
"(",
"*",
"args",
",",
... | Set up FN to only run once within an interpreter instance | [
"Set",
"up",
"FN",
"to",
"only",
"run",
"once",
"within",
"an",
"interpreter",
"instance"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/monkeypatches/__init__.py#L21-L29 | train |
buildbot/buildbot | master/buildbot/data/connector.py | DataConnector.allEndpoints | def allEndpoints(self):
"""return the full spec of the connector as a list of dicts
"""
paths = []
for k, v in sorted(self.matcher.iterPatterns()):
paths.append(dict(path="/".join(k),
plural=str(v.rtype.plural),
type... | python | def allEndpoints(self):
"""return the full spec of the connector as a list of dicts
"""
paths = []
for k, v in sorted(self.matcher.iterPatterns()):
paths.append(dict(path="/".join(k),
plural=str(v.rtype.plural),
type... | [
"def",
"allEndpoints",
"(",
"self",
")",
":",
"paths",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"sorted",
"(",
"self",
".",
"matcher",
".",
"iterPatterns",
"(",
")",
")",
":",
"paths",
".",
"append",
"(",
"dict",
"(",
"path",
"=",
"\"/\"",
".",... | return the full spec of the connector as a list of dicts | [
"return",
"the",
"full",
"spec",
"of",
"the",
"connector",
"as",
"a",
"list",
"of",
"dicts"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/data/connector.py#L138-L147 | train |
buildbot/buildbot | master/buildbot/scripts/runner.py | validateMasterOption | def validateMasterOption(master):
"""
Validate master (-m, --master) command line option.
Checks that option is a string of the 'hostname:port' form, otherwise
raises an UsageError exception.
@type master: string
@param master: master option
@raise usage.UsageError: on invalid master opt... | python | def validateMasterOption(master):
"""
Validate master (-m, --master) command line option.
Checks that option is a string of the 'hostname:port' form, otherwise
raises an UsageError exception.
@type master: string
@param master: master option
@raise usage.UsageError: on invalid master opt... | [
"def",
"validateMasterOption",
"(",
"master",
")",
":",
"try",
":",
"hostname",
",",
"port",
"=",
"master",
".",
"split",
"(",
"\":\"",
")",
"port",
"=",
"int",
"(",
"port",
")",
"except",
"(",
"TypeError",
",",
"ValueError",
")",
":",
"raise",
"usage"... | Validate master (-m, --master) command line option.
Checks that option is a string of the 'hostname:port' form, otherwise
raises an UsageError exception.
@type master: string
@param master: master option
@raise usage.UsageError: on invalid master option | [
"Validate",
"master",
"(",
"-",
"m",
"--",
"master",
")",
"command",
"line",
"option",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/scripts/runner.py#L38-L54 | train |
buildbot/buildbot | master/buildbot/steps/vstudio.py | addEnvPath | def addEnvPath(env, name, value):
""" concat a path for this name """
try:
oldval = env[name]
if not oldval.endswith(';'):
oldval = oldval + ';'
except KeyError:
oldval = ""
if not value.endswith(';'):
value = value + ';'
env[name] = oldval + value | python | def addEnvPath(env, name, value):
""" concat a path for this name """
try:
oldval = env[name]
if not oldval.endswith(';'):
oldval = oldval + ';'
except KeyError:
oldval = ""
if not value.endswith(';'):
value = value + ';'
env[name] = oldval + value | [
"def",
"addEnvPath",
"(",
"env",
",",
"name",
",",
"value",
")",
":",
"try",
":",
"oldval",
"=",
"env",
"[",
"name",
"]",
"if",
"not",
"oldval",
".",
"endswith",
"(",
"';'",
")",
":",
"oldval",
"=",
"oldval",
"+",
"';'",
"except",
"KeyError",
":",
... | concat a path for this name | [
"concat",
"a",
"path",
"for",
"this",
"name"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/vstudio.py#L29-L39 | train |
buildbot/buildbot | master/buildbot/process/workerforbuilder.py | AbstractWorkerForBuilder.ping | def ping(self, status=None):
"""Ping the worker to make sure it is still there. Returns a Deferred
that fires with True if it is.
@param status: if you point this at a BuilderStatus, a 'pinging'
event will be pushed.
"""
newping = not self.ping_watchers
... | python | def ping(self, status=None):
"""Ping the worker to make sure it is still there. Returns a Deferred
that fires with True if it is.
@param status: if you point this at a BuilderStatus, a 'pinging'
event will be pushed.
"""
newping = not self.ping_watchers
... | [
"def",
"ping",
"(",
"self",
",",
"status",
"=",
"None",
")",
":",
"newping",
"=",
"not",
"self",
".",
"ping_watchers",
"d",
"=",
"defer",
".",
"Deferred",
"(",
")",
"self",
".",
"ping_watchers",
".",
"append",
"(",
"d",
")",
"if",
"newping",
":",
"... | Ping the worker to make sure it is still there. Returns a Deferred
that fires with True if it is.
@param status: if you point this at a BuilderStatus, a 'pinging'
event will be pushed. | [
"Ping",
"the",
"worker",
"to",
"make",
"sure",
"it",
"is",
"still",
"there",
".",
"Returns",
"a",
"Deferred",
"that",
"fires",
"with",
"True",
"if",
"it",
"is",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/workerforbuilder.py#L116-L129 | train |
buildbot/buildbot | master/buildbot/util/httpclientservice.py | HTTPClientService.checkAvailable | def checkAvailable(from_module):
"""Call me at checkConfig time to properly report config error
if neither txrequests or treq is installed
"""
if txrequests is None and treq is None:
config.error("neither txrequests nor treq is installed, but {} is requiring it\n\n{}".form... | python | def checkAvailable(from_module):
"""Call me at checkConfig time to properly report config error
if neither txrequests or treq is installed
"""
if txrequests is None and treq is None:
config.error("neither txrequests nor treq is installed, but {} is requiring it\n\n{}".form... | [
"def",
"checkAvailable",
"(",
"from_module",
")",
":",
"if",
"txrequests",
"is",
"None",
"and",
"treq",
"is",
"None",
":",
"config",
".",
"error",
"(",
"\"neither txrequests nor treq is installed, but {} is requiring it\\n\\n{}\"",
".",
"format",
"(",
"from_module",
"... | Call me at checkConfig time to properly report config error
if neither txrequests or treq is installed | [
"Call",
"me",
"at",
"checkConfig",
"time",
"to",
"properly",
"report",
"config",
"error",
"if",
"neither",
"txrequests",
"or",
"treq",
"is",
"installed"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/util/httpclientservice.py#L107-L113 | train |
buildbot/buildbot | master/buildbot/util/__init__.py | flattened_iterator | def flattened_iterator(l, types=(list, tuple)):
"""
Generator for a list/tuple that potentially contains nested/lists/tuples of arbitrary nesting
that returns every individual non-list/tuple element. In other words, [(5, 6, [8, 3]), 2, [2, 1, (3, 4)]]
will yield 5, 6, 8, 3, 2, 2, 1, 3, 4
This is s... | python | def flattened_iterator(l, types=(list, tuple)):
"""
Generator for a list/tuple that potentially contains nested/lists/tuples of arbitrary nesting
that returns every individual non-list/tuple element. In other words, [(5, 6, [8, 3]), 2, [2, 1, (3, 4)]]
will yield 5, 6, 8, 3, 2, 2, 1, 3, 4
This is s... | [
"def",
"flattened_iterator",
"(",
"l",
",",
"types",
"=",
"(",
"list",
",",
"tuple",
")",
")",
":",
"if",
"not",
"isinstance",
"(",
"l",
",",
"types",
")",
":",
"yield",
"l",
"return",
"for",
"element",
"in",
"l",
":",
"for",
"sub_element",
"in",
"... | Generator for a list/tuple that potentially contains nested/lists/tuples of arbitrary nesting
that returns every individual non-list/tuple element. In other words, [(5, 6, [8, 3]), 2, [2, 1, (3, 4)]]
will yield 5, 6, 8, 3, 2, 2, 1, 3, 4
This is safe to call on something not a list/tuple - the original inp... | [
"Generator",
"for",
"a",
"list",
"/",
"tuple",
"that",
"potentially",
"contains",
"nested",
"/",
"lists",
"/",
"tuples",
"of",
"arbitrary",
"nesting",
"that",
"returns",
"every",
"individual",
"non",
"-",
"list",
"/",
"tuple",
"element",
".",
"In",
"other",
... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/util/__init__.py#L59-L73 | train |
buildbot/buildbot | master/buildbot/util/__init__.py | flatten | def flatten(l, types=(list, )):
"""
Given a list/tuple that potentially contains nested lists/tuples of arbitrary nesting,
flatten into a single dimension. In other words, turn [(5, 6, [8, 3]), 2, [2, 1, (3, 4)]]
into [5, 6, 8, 3, 2, 2, 1, 3, 4]
This is safe to call on something not a list/tuple -... | python | def flatten(l, types=(list, )):
"""
Given a list/tuple that potentially contains nested lists/tuples of arbitrary nesting,
flatten into a single dimension. In other words, turn [(5, 6, [8, 3]), 2, [2, 1, (3, 4)]]
into [5, 6, 8, 3, 2, 2, 1, 3, 4]
This is safe to call on something not a list/tuple -... | [
"def",
"flatten",
"(",
"l",
",",
"types",
"=",
"(",
"list",
",",
")",
")",
":",
"# For backwards compatibility, this returned a list, not an iterable.",
"# Changing to return an iterable could break things.",
"if",
"not",
"isinstance",
"(",
"l",
",",
"types",
")",
":",
... | Given a list/tuple that potentially contains nested lists/tuples of arbitrary nesting,
flatten into a single dimension. In other words, turn [(5, 6, [8, 3]), 2, [2, 1, (3, 4)]]
into [5, 6, 8, 3, 2, 2, 1, 3, 4]
This is safe to call on something not a list/tuple - the original input is returned as a list | [
"Given",
"a",
"list",
"/",
"tuple",
"that",
"potentially",
"contains",
"nested",
"lists",
"/",
"tuples",
"of",
"arbitrary",
"nesting",
"flatten",
"into",
"a",
"single",
"dimension",
".",
"In",
"other",
"words",
"turn",
"[",
"(",
"5",
"6",
"[",
"8",
"3",
... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/util/__init__.py#L76-L88 | train |
buildbot/buildbot | master/buildbot/util/__init__.py | human_readable_delta | def human_readable_delta(start, end):
"""
Return a string of human readable time delta.
"""
start_date = datetime.datetime.fromtimestamp(start)
end_date = datetime.datetime.fromtimestamp(end)
delta = end_date - start_date
result = []
if delta.days > 0:
result.append('%d days' % ... | python | def human_readable_delta(start, end):
"""
Return a string of human readable time delta.
"""
start_date = datetime.datetime.fromtimestamp(start)
end_date = datetime.datetime.fromtimestamp(end)
delta = end_date - start_date
result = []
if delta.days > 0:
result.append('%d days' % ... | [
"def",
"human_readable_delta",
"(",
"start",
",",
"end",
")",
":",
"start_date",
"=",
"datetime",
".",
"datetime",
".",
"fromtimestamp",
"(",
"start",
")",
"end_date",
"=",
"datetime",
".",
"datetime",
".",
"fromtimestamp",
"(",
"end",
")",
"delta",
"=",
"... | Return a string of human readable time delta. | [
"Return",
"a",
"string",
"of",
"human",
"readable",
"time",
"delta",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/util/__init__.py#L274-L298 | train |
buildbot/buildbot | master/buildbot/util/__init__.py | in_reactor | def in_reactor(f):
"""decorate a function by running it with maybeDeferred in a reactor"""
def wrap(*args, **kwargs):
from twisted.internet import reactor, defer
result = []
def _async():
d = defer.maybeDeferred(f, *args, **kwargs)
@d.addErrback
def ... | python | def in_reactor(f):
"""decorate a function by running it with maybeDeferred in a reactor"""
def wrap(*args, **kwargs):
from twisted.internet import reactor, defer
result = []
def _async():
d = defer.maybeDeferred(f, *args, **kwargs)
@d.addErrback
def ... | [
"def",
"in_reactor",
"(",
"f",
")",
":",
"def",
"wrap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"twisted",
".",
"internet",
"import",
"reactor",
",",
"defer",
"result",
"=",
"[",
"]",
"def",
"_async",
"(",
")",
":",
"d",
"=",... | decorate a function by running it with maybeDeferred in a reactor | [
"decorate",
"a",
"function",
"by",
"running",
"it",
"with",
"maybeDeferred",
"in",
"a",
"reactor"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/util/__init__.py#L309-L332 | train |
buildbot/buildbot | master/buildbot/util/__init__.py | dictionary_merge | def dictionary_merge(a, b):
"""merges dictionary b into a
Like dict.update, but recursive
"""
for key, value in b.items():
if key in a and isinstance(a[key], dict) and isinstance(value, dict):
dictionary_merge(a[key], b[key])
continue
a[key] = b[key]
return... | python | def dictionary_merge(a, b):
"""merges dictionary b into a
Like dict.update, but recursive
"""
for key, value in b.items():
if key in a and isinstance(a[key], dict) and isinstance(value, dict):
dictionary_merge(a[key], b[key])
continue
a[key] = b[key]
return... | [
"def",
"dictionary_merge",
"(",
"a",
",",
"b",
")",
":",
"for",
"key",
",",
"value",
"in",
"b",
".",
"items",
"(",
")",
":",
"if",
"key",
"in",
"a",
"and",
"isinstance",
"(",
"a",
"[",
"key",
"]",
",",
"dict",
")",
"and",
"isinstance",
"(",
"va... | merges dictionary b into a
Like dict.update, but recursive | [
"merges",
"dictionary",
"b",
"into",
"a",
"Like",
"dict",
".",
"update",
"but",
"recursive"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/util/__init__.py#L454-L463 | train |
buildbot/buildbot | master/buildbot/steps/package/rpm/rpmlint.py | RpmLint.createSummary | def createSummary(self, log):
"""
Create nice summary logs.
@param log: log to create summary off of.
"""
warnings = self.obs.warnings
errors = []
if warnings:
self.addCompleteLog('%d Warnings' % len(warnings), "\n".join(warnings))
if errors:
... | python | def createSummary(self, log):
"""
Create nice summary logs.
@param log: log to create summary off of.
"""
warnings = self.obs.warnings
errors = []
if warnings:
self.addCompleteLog('%d Warnings' % len(warnings), "\n".join(warnings))
if errors:
... | [
"def",
"createSummary",
"(",
"self",
",",
"log",
")",
":",
"warnings",
"=",
"self",
".",
"obs",
".",
"warnings",
"errors",
"=",
"[",
"]",
"if",
"warnings",
":",
"self",
".",
"addCompleteLog",
"(",
"'%d Warnings'",
"%",
"len",
"(",
"warnings",
")",
",",... | Create nice summary logs.
@param log: log to create summary off of. | [
"Create",
"nice",
"summary",
"logs",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/package/rpm/rpmlint.py#L68-L79 | train |
buildbot/buildbot | master/buildbot/process/builder.py | Builder.getOldestRequestTime | def getOldestRequestTime(self):
"""Returns the submitted_at of the oldest unclaimed build request for
this builder, or None if there are no build requests.
@returns: datetime instance or None, via Deferred
"""
bldrid = yield self.getBuilderId()
unclaimed = yield self.mas... | python | def getOldestRequestTime(self):
"""Returns the submitted_at of the oldest unclaimed build request for
this builder, or None if there are no build requests.
@returns: datetime instance or None, via Deferred
"""
bldrid = yield self.getBuilderId()
unclaimed = yield self.mas... | [
"def",
"getOldestRequestTime",
"(",
"self",
")",
":",
"bldrid",
"=",
"yield",
"self",
".",
"getBuilderId",
"(",
")",
"unclaimed",
"=",
"yield",
"self",
".",
"master",
".",
"data",
".",
"get",
"(",
"(",
"'builders'",
",",
"bldrid",
",",
"'buildrequests'",
... | Returns the submitted_at of the oldest unclaimed build request for
this builder, or None if there are no build requests.
@returns: datetime instance or None, via Deferred | [
"Returns",
"the",
"submitted_at",
"of",
"the",
"oldest",
"unclaimed",
"build",
"request",
"for",
"this",
"builder",
"or",
"None",
"if",
"there",
"are",
"no",
"build",
"requests",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/builder.py#L144-L156 | train |
buildbot/buildbot | master/buildbot/process/builder.py | Builder.getNewestCompleteTime | def getNewestCompleteTime(self):
"""Returns the complete_at of the latest completed build request for
this builder, or None if there are no such build requests.
@returns: datetime instance or None, via Deferred
"""
bldrid = yield self.getBuilderId()
completed = yield sel... | python | def getNewestCompleteTime(self):
"""Returns the complete_at of the latest completed build request for
this builder, or None if there are no such build requests.
@returns: datetime instance or None, via Deferred
"""
bldrid = yield self.getBuilderId()
completed = yield sel... | [
"def",
"getNewestCompleteTime",
"(",
"self",
")",
":",
"bldrid",
"=",
"yield",
"self",
".",
"getBuilderId",
"(",
")",
"completed",
"=",
"yield",
"self",
".",
"master",
".",
"data",
".",
"get",
"(",
"(",
"'builders'",
",",
"bldrid",
",",
"'buildrequests'",
... | Returns the complete_at of the latest completed build request for
this builder, or None if there are no such build requests.
@returns: datetime instance or None, via Deferred | [
"Returns",
"the",
"complete_at",
"of",
"the",
"latest",
"completed",
"build",
"request",
"for",
"this",
"builder",
"or",
"None",
"if",
"there",
"are",
"no",
"such",
"build",
"requests",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/builder.py#L159-L173 | train |
buildbot/buildbot | master/buildbot/process/builder.py | Builder.attached | def attached(self, worker, commands):
"""This is invoked by the Worker when the self.workername bot
registers their builder.
@type worker: L{buildbot.worker.Worker}
@param worker: the Worker that represents the worker as a whole
@type commands: dict: string -> string, or None
... | python | def attached(self, worker, commands):
"""This is invoked by the Worker when the self.workername bot
registers their builder.
@type worker: L{buildbot.worker.Worker}
@param worker: the Worker that represents the worker as a whole
@type commands: dict: string -> string, or None
... | [
"def",
"attached",
"(",
"self",
",",
"worker",
",",
"commands",
")",
":",
"for",
"w",
"in",
"self",
".",
"attaching_workers",
"+",
"self",
".",
"workers",
":",
"if",
"w",
".",
"worker",
"==",
"worker",
":",
"# already attached to them. This is fairly common, s... | This is invoked by the Worker when the self.workername bot
registers their builder.
@type worker: L{buildbot.worker.Worker}
@param worker: the Worker that represents the worker as a whole
@type commands: dict: string -> string, or None
@param commands: provides the worker's ve... | [
"This",
"is",
"invoked",
"by",
"the",
"Worker",
"when",
"the",
"self",
".",
"workername",
"bot",
"registers",
"their",
"builder",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/builder.py#L195-L238 | train |
buildbot/buildbot | master/buildbot/process/builder.py | Builder.detached | def detached(self, worker):
"""This is called when the connection to the bot is lost."""
for wfb in self.attaching_workers + self.workers:
if wfb.worker == worker:
break
else:
log.msg("WEIRD: Builder.detached(%s) (%s)"
" not in attachin... | python | def detached(self, worker):
"""This is called when the connection to the bot is lost."""
for wfb in self.attaching_workers + self.workers:
if wfb.worker == worker:
break
else:
log.msg("WEIRD: Builder.detached(%s) (%s)"
" not in attachin... | [
"def",
"detached",
"(",
"self",
",",
"worker",
")",
":",
"for",
"wfb",
"in",
"self",
".",
"attaching_workers",
"+",
"self",
".",
"workers",
":",
"if",
"wfb",
".",
"worker",
"==",
"worker",
":",
"break",
"else",
":",
"log",
".",
"msg",
"(",
"\"WEIRD: ... | This is called when the connection to the bot is lost. | [
"This",
"is",
"called",
"when",
"the",
"connection",
"to",
"the",
"bot",
"is",
"lost",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/builder.py#L240-L259 | train |
buildbot/buildbot | master/buildbot/process/builder.py | Builder.buildFinished | def buildFinished(self, build, wfb):
"""This is called when the Build has finished (either success or
failure). Any exceptions during the build are reported with
results=FAILURE, not with an errback."""
# by the time we get here, the Build has already released the worker,
# whic... | python | def buildFinished(self, build, wfb):
"""This is called when the Build has finished (either success or
failure). Any exceptions during the build are reported with
results=FAILURE, not with an errback."""
# by the time we get here, the Build has already released the worker,
# whic... | [
"def",
"buildFinished",
"(",
"self",
",",
"build",
",",
"wfb",
")",
":",
"# by the time we get here, the Build has already released the worker,",
"# which will trigger a check for any now-possible build requests",
"# (maybeStartBuilds)",
"results",
"=",
"build",
".",
"build_status"... | This is called when the Build has finished (either success or
failure). Any exceptions during the build are reported with
results=FAILURE, not with an errback. | [
"This",
"is",
"called",
"when",
"the",
"Build",
"has",
"finished",
"(",
"either",
"success",
"or",
"failure",
")",
".",
"Any",
"exceptions",
"during",
"the",
"build",
"are",
"reported",
"with",
"results",
"=",
"FAILURE",
"not",
"with",
"an",
"errback",
"."... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/builder.py#L380-L407 | train |
buildbot/buildbot | master/buildbot/process/builder.py | Builder.getCollapseRequestsFn | def getCollapseRequestsFn(self):
"""Helper function to determine which collapseRequests function to use
from L{_collapseRequests}, or None for no merging"""
# first, seek through builder, global, and the default
collapseRequests_fn = self.config.collapseRequests
if collapseReques... | python | def getCollapseRequestsFn(self):
"""Helper function to determine which collapseRequests function to use
from L{_collapseRequests}, or None for no merging"""
# first, seek through builder, global, and the default
collapseRequests_fn = self.config.collapseRequests
if collapseReques... | [
"def",
"getCollapseRequestsFn",
"(",
"self",
")",
":",
"# first, seek through builder, global, and the default",
"collapseRequests_fn",
"=",
"self",
".",
"config",
".",
"collapseRequests",
"if",
"collapseRequests_fn",
"is",
"None",
":",
"collapseRequests_fn",
"=",
"self",
... | Helper function to determine which collapseRequests function to use
from L{_collapseRequests}, or None for no merging | [
"Helper",
"function",
"to",
"determine",
"which",
"collapseRequests",
"function",
"to",
"use",
"from",
"L",
"{",
"_collapseRequests",
"}",
"or",
"None",
"for",
"no",
"merging"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/process/builder.py#L441-L457 | train |
buildbot/buildbot | worker/buildbot_worker/runprocess.py | RunProcess._spawnProcess | def _spawnProcess(self, processProtocol, executable, args=(), env=None,
path=None, uid=None, gid=None, usePTY=False, childFDs=None):
"""private implementation of reactor.spawnProcess, to allow use of
L{ProcGroupProcess}"""
if env is None:
env = {}
# use... | python | def _spawnProcess(self, processProtocol, executable, args=(), env=None,
path=None, uid=None, gid=None, usePTY=False, childFDs=None):
"""private implementation of reactor.spawnProcess, to allow use of
L{ProcGroupProcess}"""
if env is None:
env = {}
# use... | [
"def",
"_spawnProcess",
"(",
"self",
",",
"processProtocol",
",",
"executable",
",",
"args",
"=",
"(",
")",
",",
"env",
"=",
"None",
",",
"path",
"=",
"None",
",",
"uid",
"=",
"None",
",",
"gid",
"=",
"None",
",",
"usePTY",
"=",
"False",
",",
"chil... | private implementation of reactor.spawnProcess, to allow use of
L{ProcGroupProcess} | [
"private",
"implementation",
"of",
"reactor",
".",
"spawnProcess",
"to",
"allow",
"use",
"of",
"L",
"{",
"ProcGroupProcess",
"}"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/runprocess.py#L589-L607 | train |
buildbot/buildbot | worker/buildbot_worker/runprocess.py | RunProcess._spawnAsBatch | def _spawnAsBatch(self, processProtocol, executable, args, env,
path, usePTY):
"""A cheat that routes around the impedance mismatch between
twisted and cmd.exe with respect to escaping quotes"""
# NamedTemporaryFile differs in PY2 and PY3.
# In PY2, it needs encode... | python | def _spawnAsBatch(self, processProtocol, executable, args, env,
path, usePTY):
"""A cheat that routes around the impedance mismatch between
twisted and cmd.exe with respect to escaping quotes"""
# NamedTemporaryFile differs in PY2 and PY3.
# In PY2, it needs encode... | [
"def",
"_spawnAsBatch",
"(",
"self",
",",
"processProtocol",
",",
"executable",
",",
"args",
",",
"env",
",",
"path",
",",
"usePTY",
")",
":",
"# NamedTemporaryFile differs in PY2 and PY3.",
"# In PY2, it needs encoded str and its encoding cannot be specified.",
"# In PY3, it... | A cheat that routes around the impedance mismatch between
twisted and cmd.exe with respect to escaping quotes | [
"A",
"cheat",
"that",
"routes",
"around",
"the",
"impedance",
"mismatch",
"between",
"twisted",
"and",
"cmd",
".",
"exe",
"with",
"respect",
"to",
"escaping",
"quotes"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/runprocess.py#L609-L643 | train |
buildbot/buildbot | worker/buildbot_worker/runprocess.py | RunProcess._chunkForSend | def _chunkForSend(self, data):
"""
limit the chunks that we send over PB to 128k, since it has a hardwired
string-size limit of 640k.
"""
LIMIT = self.CHUNK_LIMIT
for i in range(0, len(data), LIMIT):
yield data[i:i + LIMIT] | python | def _chunkForSend(self, data):
"""
limit the chunks that we send over PB to 128k, since it has a hardwired
string-size limit of 640k.
"""
LIMIT = self.CHUNK_LIMIT
for i in range(0, len(data), LIMIT):
yield data[i:i + LIMIT] | [
"def",
"_chunkForSend",
"(",
"self",
",",
"data",
")",
":",
"LIMIT",
"=",
"self",
".",
"CHUNK_LIMIT",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"data",
")",
",",
"LIMIT",
")",
":",
"yield",
"data",
"[",
"i",
":",
"i",
"+",
"LIMIT",
... | limit the chunks that we send over PB to 128k, since it has a hardwired
string-size limit of 640k. | [
"limit",
"the",
"chunks",
"that",
"we",
"send",
"over",
"PB",
"to",
"128k",
"since",
"it",
"has",
"a",
"hardwired",
"string",
"-",
"size",
"limit",
"of",
"640k",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/runprocess.py#L645-L652 | train |
buildbot/buildbot | worker/buildbot_worker/runprocess.py | RunProcess._collapseMsg | def _collapseMsg(self, msg):
"""
Take msg, which is a dictionary of lists of output chunks, and
concatenate all the chunks into a single string
"""
retval = {}
for logname in msg:
data = u""
for m in msg[logname]:
m = bytes2unicode(... | python | def _collapseMsg(self, msg):
"""
Take msg, which is a dictionary of lists of output chunks, and
concatenate all the chunks into a single string
"""
retval = {}
for logname in msg:
data = u""
for m in msg[logname]:
m = bytes2unicode(... | [
"def",
"_collapseMsg",
"(",
"self",
",",
"msg",
")",
":",
"retval",
"=",
"{",
"}",
"for",
"logname",
"in",
"msg",
":",
"data",
"=",
"u\"\"",
"for",
"m",
"in",
"msg",
"[",
"logname",
"]",
":",
"m",
"=",
"bytes2unicode",
"(",
"m",
",",
"self",
".",... | Take msg, which is a dictionary of lists of output chunks, and
concatenate all the chunks into a single string | [
"Take",
"msg",
"which",
"is",
"a",
"dictionary",
"of",
"lists",
"of",
"output",
"chunks",
"and",
"concatenate",
"all",
"the",
"chunks",
"into",
"a",
"single",
"string"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/runprocess.py#L654-L669 | train |
buildbot/buildbot | worker/buildbot_worker/runprocess.py | RunProcess._sendMessage | def _sendMessage(self, msg):
"""
Collapse and send msg to the master
"""
if not msg:
return
msg = self._collapseMsg(msg)
self.sendStatus(msg) | python | def _sendMessage(self, msg):
"""
Collapse and send msg to the master
"""
if not msg:
return
msg = self._collapseMsg(msg)
self.sendStatus(msg) | [
"def",
"_sendMessage",
"(",
"self",
",",
"msg",
")",
":",
"if",
"not",
"msg",
":",
"return",
"msg",
"=",
"self",
".",
"_collapseMsg",
"(",
"msg",
")",
"self",
".",
"sendStatus",
"(",
"msg",
")"
] | Collapse and send msg to the master | [
"Collapse",
"and",
"send",
"msg",
"to",
"the",
"master"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/runprocess.py#L671-L678 | train |
buildbot/buildbot | worker/buildbot_worker/runprocess.py | RunProcess._sendBuffers | def _sendBuffers(self):
"""
Send all the content in our buffers.
"""
msg = {}
msg_size = 0
lastlog = None
logdata = []
while self.buffered:
# Grab the next bits from the buffer
logname, data = self.buffered.popleft()
# ... | python | def _sendBuffers(self):
"""
Send all the content in our buffers.
"""
msg = {}
msg_size = 0
lastlog = None
logdata = []
while self.buffered:
# Grab the next bits from the buffer
logname, data = self.buffered.popleft()
# ... | [
"def",
"_sendBuffers",
"(",
"self",
")",
":",
"msg",
"=",
"{",
"}",
"msg_size",
"=",
"0",
"lastlog",
"=",
"None",
"logdata",
"=",
"[",
"]",
"while",
"self",
".",
"buffered",
":",
"# Grab the next bits from the buffer",
"logname",
",",
"data",
"=",
"self",
... | Send all the content in our buffers. | [
"Send",
"all",
"the",
"content",
"in",
"our",
"buffers",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/runprocess.py#L684-L735 | train |
buildbot/buildbot | worker/buildbot_worker/runprocess.py | RunProcess._addToBuffers | def _addToBuffers(self, logname, data):
"""
Add data to the buffer for logname
Start a timer to send the buffers if BUFFER_TIMEOUT elapses.
If adding data causes the buffer size to grow beyond BUFFER_SIZE, then
the buffers will be sent.
"""
n = len(data)
... | python | def _addToBuffers(self, logname, data):
"""
Add data to the buffer for logname
Start a timer to send the buffers if BUFFER_TIMEOUT elapses.
If adding data causes the buffer size to grow beyond BUFFER_SIZE, then
the buffers will be sent.
"""
n = len(data)
... | [
"def",
"_addToBuffers",
"(",
"self",
",",
"logname",
",",
"data",
")",
":",
"n",
"=",
"len",
"(",
"data",
")",
"self",
".",
"buflen",
"+=",
"n",
"self",
".",
"buffered",
".",
"append",
"(",
"(",
"logname",
",",
"data",
")",
")",
"if",
"self",
"."... | Add data to the buffer for logname
Start a timer to send the buffers if BUFFER_TIMEOUT elapses.
If adding data causes the buffer size to grow beyond BUFFER_SIZE, then
the buffers will be sent. | [
"Add",
"data",
"to",
"the",
"buffer",
"for",
"logname",
"Start",
"a",
"timer",
"to",
"send",
"the",
"buffers",
"if",
"BUFFER_TIMEOUT",
"elapses",
".",
"If",
"adding",
"data",
"causes",
"the",
"buffer",
"size",
"to",
"grow",
"beyond",
"BUFFER_SIZE",
"then",
... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/runprocess.py#L737-L752 | train |
buildbot/buildbot | worker/buildbot_worker/base.py | WorkerForBuilderBase.remote_startCommand | def remote_startCommand(self, stepref, stepId, command, args):
"""
This gets invoked by L{buildbot.process.step.RemoteCommand.start}, as
part of various master-side BuildSteps, to start various commands
that actually do the build. I return nothing. Eventually I will call
.command... | python | def remote_startCommand(self, stepref, stepId, command, args):
"""
This gets invoked by L{buildbot.process.step.RemoteCommand.start}, as
part of various master-side BuildSteps, to start various commands
that actually do the build. I return nothing. Eventually I will call
.command... | [
"def",
"remote_startCommand",
"(",
"self",
",",
"stepref",
",",
"stepId",
",",
"command",
",",
"args",
")",
":",
"stepId",
"=",
"decode",
"(",
"stepId",
")",
"command",
"=",
"decode",
"(",
"command",
")",
"args",
"=",
"decode",
"(",
"args",
")",
"self"... | This gets invoked by L{buildbot.process.step.RemoteCommand.start}, as
part of various master-side BuildSteps, to start various commands
that actually do the build. I return nothing. Eventually I will call
.commandComplete() to notify the master-side RemoteCommand that I'm
done. | [
"This",
"gets",
"invoked",
"by",
"L",
"{",
"buildbot",
".",
"process",
".",
"step",
".",
"RemoteCommand",
".",
"start",
"}",
"as",
"part",
"of",
"various",
"master",
"-",
"side",
"BuildSteps",
"to",
"start",
"various",
"commands",
"that",
"actually",
"do",... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/base.py#L126-L156 | train |
buildbot/buildbot | worker/buildbot_worker/base.py | WorkerForBuilderBase.remote_interruptCommand | def remote_interruptCommand(self, stepId, why):
"""Halt the current step."""
log.msg("asked to interrupt current command: {0}".format(why))
self.activity()
if not self.command:
# TODO: just log it, a race could result in their interrupting a
# command that wasn't ... | python | def remote_interruptCommand(self, stepId, why):
"""Halt the current step."""
log.msg("asked to interrupt current command: {0}".format(why))
self.activity()
if not self.command:
# TODO: just log it, a race could result in their interrupting a
# command that wasn't ... | [
"def",
"remote_interruptCommand",
"(",
"self",
",",
"stepId",
",",
"why",
")",
":",
"log",
".",
"msg",
"(",
"\"asked to interrupt current command: {0}\"",
".",
"format",
"(",
"why",
")",
")",
"self",
".",
"activity",
"(",
")",
"if",
"not",
"self",
".",
"co... | Halt the current step. | [
"Halt",
"the",
"current",
"step",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/base.py#L158-L167 | train |
buildbot/buildbot | worker/buildbot_worker/base.py | WorkerForBuilderBase.stopCommand | def stopCommand(self):
"""Make any currently-running command die, with no further status
output. This is used when the worker is shutting down or the
connection to the master has been lost. Interrupt the command,
silence it, and then forget about it."""
if not self.command:
... | python | def stopCommand(self):
"""Make any currently-running command die, with no further status
output. This is used when the worker is shutting down or the
connection to the master has been lost. Interrupt the command,
silence it, and then forget about it."""
if not self.command:
... | [
"def",
"stopCommand",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"command",
":",
"return",
"log",
".",
"msg",
"(",
"\"stopCommand: halting current command {0}\"",
".",
"format",
"(",
"self",
".",
"command",
")",
")",
"self",
".",
"command",
".",
"doI... | Make any currently-running command die, with no further status
output. This is used when the worker is shutting down or the
connection to the master has been lost. Interrupt the command,
silence it, and then forget about it. | [
"Make",
"any",
"currently",
"-",
"running",
"command",
"die",
"with",
"no",
"further",
"status",
"output",
".",
"This",
"is",
"used",
"when",
"the",
"worker",
"is",
"shutting",
"down",
"or",
"the",
"connection",
"to",
"the",
"master",
"has",
"been",
"lost"... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/base.py#L169-L178 | train |
buildbot/buildbot | worker/buildbot_worker/base.py | WorkerForBuilderBase.sendUpdate | def sendUpdate(self, data):
"""This sends the status update to the master-side
L{buildbot.process.step.RemoteCommand} object, giving it a sequence
number in the process. It adds the update to a queue, and asks the
master to acknowledge the update so it can be removed from that
qu... | python | def sendUpdate(self, data):
"""This sends the status update to the master-side
L{buildbot.process.step.RemoteCommand} object, giving it a sequence
number in the process. It adds the update to a queue, and asks the
master to acknowledge the update so it can be removed from that
qu... | [
"def",
"sendUpdate",
"(",
"self",
",",
"data",
")",
":",
"if",
"not",
"self",
".",
"running",
":",
"# .running comes from service.Service, and says whether the",
"# service is running or not. If we aren't running, don't send any",
"# status messages.",
"return",
"# the update[1]=... | This sends the status update to the master-side
L{buildbot.process.step.RemoteCommand} object, giving it a sequence
number in the process. It adds the update to a queue, and asks the
master to acknowledge the update so it can be removed from that
queue. | [
"This",
"sends",
"the",
"status",
"update",
"to",
"the",
"master",
"-",
"side",
"L",
"{",
"buildbot",
".",
"process",
".",
"step",
".",
"RemoteCommand",
"}",
"object",
"giving",
"it",
"a",
"sequence",
"number",
"in",
"the",
"process",
".",
"It",
"adds",
... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/base.py#L181-L201 | train |
buildbot/buildbot | worker/buildbot_worker/base.py | BotBase.remote_getWorkerInfo | def remote_getWorkerInfo(self):
"""This command retrieves data from the files in WORKERDIR/info/* and
sends the contents to the buildmaster. These are used to describe
the worker and its configuration, and should be created and
maintained by the worker administrator. They will be retriev... | python | def remote_getWorkerInfo(self):
"""This command retrieves data from the files in WORKERDIR/info/* and
sends the contents to the buildmaster. These are used to describe
the worker and its configuration, and should be created and
maintained by the worker administrator. They will be retriev... | [
"def",
"remote_getWorkerInfo",
"(",
"self",
")",
":",
"files",
"=",
"{",
"}",
"basedir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"basedir",
",",
"\"info\"",
")",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"basedir",
")",
":",
"for",... | This command retrieves data from the files in WORKERDIR/info/* and
sends the contents to the buildmaster. These are used to describe
the worker and its configuration, and should be created and
maintained by the worker administrator. They will be retrieved each
time the master-worker conn... | [
"This",
"command",
"retrieves",
"data",
"from",
"the",
"files",
"in",
"WORKERDIR",
"/",
"info",
"/",
"*",
"and",
"sends",
"the",
"contents",
"to",
"the",
"buildmaster",
".",
"These",
"are",
"used",
"to",
"describe",
"the",
"worker",
"and",
"its",
"configur... | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/base.py#L307-L337 | train |
buildbot/buildbot | worker/buildbot_worker/base.py | WorkerBase.recordHostname | def recordHostname(self, basedir):
"Record my hostname in twistd.hostname, for user convenience"
log.msg("recording hostname in twistd.hostname")
filename = os.path.join(basedir, "twistd.hostname")
try:
hostname = os.uname()[1] # only on unix
except AttributeError:
... | python | def recordHostname(self, basedir):
"Record my hostname in twistd.hostname, for user convenience"
log.msg("recording hostname in twistd.hostname")
filename = os.path.join(basedir, "twistd.hostname")
try:
hostname = os.uname()[1] # only on unix
except AttributeError:
... | [
"def",
"recordHostname",
"(",
"self",
",",
"basedir",
")",
":",
"log",
".",
"msg",
"(",
"\"recording hostname in twistd.hostname\"",
")",
"filename",
"=",
"os",
".",
"path",
".",
"join",
"(",
"basedir",
",",
"\"twistd.hostname\"",
")",
"try",
":",
"hostname",
... | Record my hostname in twistd.hostname, for user convenience | [
"Record",
"my",
"hostname",
"in",
"twistd",
".",
"hostname",
"for",
"user",
"convenience"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/base.py#L380-L396 | train |
buildbot/buildbot | master/buildbot/clients/tryclient.py | getTopdir | def getTopdir(topfile, start=None):
"""walk upwards from the current directory until we find this topfile"""
if not start:
start = os.getcwd()
here = start
toomany = 20
while toomany > 0:
if os.path.exists(os.path.join(here, topfile)):
return here
next = os.path.d... | python | def getTopdir(topfile, start=None):
"""walk upwards from the current directory until we find this topfile"""
if not start:
start = os.getcwd()
here = start
toomany = 20
while toomany > 0:
if os.path.exists(os.path.join(here, topfile)):
return here
next = os.path.d... | [
"def",
"getTopdir",
"(",
"topfile",
",",
"start",
"=",
"None",
")",
":",
"if",
"not",
"start",
":",
"start",
"=",
"os",
".",
"getcwd",
"(",
")",
"here",
"=",
"start",
"toomany",
"=",
"20",
"while",
"toomany",
">",
"0",
":",
"if",
"os",
".",
"path... | walk upwards from the current directory until we find this topfile | [
"walk",
"upwards",
"from",
"the",
"current",
"directory",
"until",
"we",
"find",
"this",
"topfile"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/clients/tryclient.py#L486-L502 | train |
buildbot/buildbot | master/buildbot/clients/tryclient.py | SourceStampExtractor.dovc | def dovc(self, cmd):
"""This accepts the arguments of a command, without the actual
command itself."""
env = os.environ.copy()
env['LC_ALL'] = "C"
d = utils.getProcessOutputAndValue(self.exe, cmd, env=env,
path=self.treetop)
d.ad... | python | def dovc(self, cmd):
"""This accepts the arguments of a command, without the actual
command itself."""
env = os.environ.copy()
env['LC_ALL'] = "C"
d = utils.getProcessOutputAndValue(self.exe, cmd, env=env,
path=self.treetop)
d.ad... | [
"def",
"dovc",
"(",
"self",
",",
"cmd",
")",
":",
"env",
"=",
"os",
".",
"environ",
".",
"copy",
"(",
")",
"env",
"[",
"'LC_ALL'",
"]",
"=",
"\"C\"",
"d",
"=",
"utils",
".",
"getProcessOutputAndValue",
"(",
"self",
".",
"exe",
",",
"cmd",
",",
"e... | This accepts the arguments of a command, without the actual
command itself. | [
"This",
"accepts",
"the",
"arguments",
"of",
"a",
"command",
"without",
"the",
"actual",
"command",
"itself",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/clients/tryclient.py#L67-L75 | train |
buildbot/buildbot | master/buildbot/clients/tryclient.py | SourceStampExtractor.get | def get(self):
"""Return a Deferred that fires with a SourceStamp instance."""
d = self.getBaseRevision()
d.addCallback(self.getPatch)
d.addCallback(self.done)
return d | python | def get(self):
"""Return a Deferred that fires with a SourceStamp instance."""
d = self.getBaseRevision()
d.addCallback(self.getPatch)
d.addCallback(self.done)
return d | [
"def",
"get",
"(",
"self",
")",
":",
"d",
"=",
"self",
".",
"getBaseRevision",
"(",
")",
"d",
".",
"addCallback",
"(",
"self",
".",
"getPatch",
")",
"d",
".",
"addCallback",
"(",
"self",
".",
"done",
")",
"return",
"d"
] | Return a Deferred that fires with a SourceStamp instance. | [
"Return",
"a",
"Deferred",
"that",
"fires",
"with",
"a",
"SourceStamp",
"instance",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/clients/tryclient.py#L83-L88 | train |
buildbot/buildbot | pkg/buildbot_pkg.py | check_output | def check_output(cmd):
"""Version of check_output which does not throw error"""
popen = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
out = popen.communicate()[0].strip()
if not isinstance(out, str):
out = out.decode(sys.stdout.encoding)
return out | python | def check_output(cmd):
"""Version of check_output which does not throw error"""
popen = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
out = popen.communicate()[0].strip()
if not isinstance(out, str):
out = out.decode(sys.stdout.encoding)
return out | [
"def",
"check_output",
"(",
"cmd",
")",
":",
"popen",
"=",
"subprocess",
".",
"Popen",
"(",
"cmd",
",",
"shell",
"=",
"True",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
")",
"out",
"=",
"popen",
".",
"communicate",
"(",
")",
"[",
"0",
"]",
".",... | Version of check_output which does not throw error | [
"Version",
"of",
"check_output",
"which",
"does",
"not",
"throw",
"error"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/pkg/buildbot_pkg.py#L48-L54 | train |
buildbot/buildbot | pkg/buildbot_pkg.py | getVersionFromArchiveId | def getVersionFromArchiveId(git_archive_id='$Format:%ct %d$'):
""" Extract the tag if a source is from git archive.
When source is exported via `git archive`, the git_archive_id init value is modified
and placeholders are expanded to the "archived" revision:
%ct: committer date, UNIX t... | python | def getVersionFromArchiveId(git_archive_id='$Format:%ct %d$'):
""" Extract the tag if a source is from git archive.
When source is exported via `git archive`, the git_archive_id init value is modified
and placeholders are expanded to the "archived" revision:
%ct: committer date, UNIX t... | [
"def",
"getVersionFromArchiveId",
"(",
"git_archive_id",
"=",
"'$Format:%ct %d$'",
")",
":",
"# mangle the magic string to make sure it is not replaced by git archive",
"if",
"not",
"git_archive_id",
".",
"startswith",
"(",
"'$For'",
"'mat:'",
")",
":",
"# source was modified b... | Extract the tag if a source is from git archive.
When source is exported via `git archive`, the git_archive_id init value is modified
and placeholders are expanded to the "archived" revision:
%ct: committer date, UNIX timestamp
%d: ref names, like the --decorate option of git-l... | [
"Extract",
"the",
"tag",
"if",
"a",
"source",
"is",
"from",
"git",
"archive",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/pkg/buildbot_pkg.py#L89-L114 | train |
buildbot/buildbot | pkg/buildbot_pkg.py | getVersion | def getVersion(init_file):
"""
Return BUILDBOT_VERSION environment variable, content of VERSION file, git
tag or 'latest'
"""
try:
return os.environ['BUILDBOT_VERSION']
except KeyError:
pass
try:
cwd = os.path.dirname(os.path.abspath(init_file))
fn = os.path... | python | def getVersion(init_file):
"""
Return BUILDBOT_VERSION environment variable, content of VERSION file, git
tag or 'latest'
"""
try:
return os.environ['BUILDBOT_VERSION']
except KeyError:
pass
try:
cwd = os.path.dirname(os.path.abspath(init_file))
fn = os.path... | [
"def",
"getVersion",
"(",
"init_file",
")",
":",
"try",
":",
"return",
"os",
".",
"environ",
"[",
"'BUILDBOT_VERSION'",
"]",
"except",
"KeyError",
":",
"pass",
"try",
":",
"cwd",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"a... | Return BUILDBOT_VERSION environment variable, content of VERSION file, git
tag or 'latest' | [
"Return",
"BUILDBOT_VERSION",
"environment",
"variable",
"content",
"of",
"VERSION",
"file",
"git",
"tag",
"or",
"latest"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/pkg/buildbot_pkg.py#L117-L157 | train |
buildbot/buildbot | pkg/buildbot_pkg.py | BuildJsCommand.run | def run(self):
"""Run command."""
if self.already_run:
return
package = self.distribution.packages[0]
if os.path.exists("gulpfile.js") or os.path.exists("webpack.config.js"):
yarn_version = check_output("yarn --version")
npm_version = check_output("npm... | python | def run(self):
"""Run command."""
if self.already_run:
return
package = self.distribution.packages[0]
if os.path.exists("gulpfile.js") or os.path.exists("webpack.config.js"):
yarn_version = check_output("yarn --version")
npm_version = check_output("npm... | [
"def",
"run",
"(",
"self",
")",
":",
"if",
"self",
".",
"already_run",
":",
"return",
"package",
"=",
"self",
".",
"distribution",
".",
"packages",
"[",
"0",
"]",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"\"gulpfile.js\"",
")",
"or",
"os",
".",
... | Run command. | [
"Run",
"command",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/pkg/buildbot_pkg.py#L199-L246 | train |
buildbot/buildbot | master/buildbot/www/hooks/github.py | GitHubEventHandler._get_commit_msg | def _get_commit_msg(self, repo, sha):
'''
:param repo: the repo full name, ``{owner}/{project}``.
e.g. ``buildbot/buildbot``
'''
headers = {
'User-Agent': 'Buildbot'
}
if self._token:
headers['Authorization'] = 'token ' + self._token
... | python | def _get_commit_msg(self, repo, sha):
'''
:param repo: the repo full name, ``{owner}/{project}``.
e.g. ``buildbot/buildbot``
'''
headers = {
'User-Agent': 'Buildbot'
}
if self._token:
headers['Authorization'] = 'token ' + self._token
... | [
"def",
"_get_commit_msg",
"(",
"self",
",",
"repo",
",",
"sha",
")",
":",
"headers",
"=",
"{",
"'User-Agent'",
":",
"'Buildbot'",
"}",
"if",
"self",
".",
"_token",
":",
"headers",
"[",
"'Authorization'",
"]",
"=",
"'token '",
"+",
"self",
".",
"_token",
... | :param repo: the repo full name, ``{owner}/{project}``.
e.g. ``buildbot/buildbot`` | [
":",
"param",
"repo",
":",
"the",
"repo",
"full",
"name",
"{",
"owner",
"}",
"/",
"{",
"project",
"}",
".",
"e",
".",
"g",
".",
"buildbot",
"/",
"buildbot"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/github.py#L225-L243 | train |
buildbot/buildbot | master/buildbot/www/hooks/github.py | GitHubEventHandler._process_change | def _process_change(self, payload, user, repo, repo_url, project, event,
properties):
"""
Consumes the JSON as a python object and actually starts the build.
:arguments:
payload
Python Object that represents the JSON sent by GitHub Service
... | python | def _process_change(self, payload, user, repo, repo_url, project, event,
properties):
"""
Consumes the JSON as a python object and actually starts the build.
:arguments:
payload
Python Object that represents the JSON sent by GitHub Service
... | [
"def",
"_process_change",
"(",
"self",
",",
"payload",
",",
"user",
",",
"repo",
",",
"repo_url",
",",
"project",
",",
"event",
",",
"properties",
")",
":",
"changes",
"=",
"[",
"]",
"refname",
"=",
"payload",
"[",
"'ref'",
"]",
"# We only care about regul... | Consumes the JSON as a python object and actually starts the build.
:arguments:
payload
Python Object that represents the JSON sent by GitHub Service
Hook. | [
"Consumes",
"the",
"JSON",
"as",
"a",
"python",
"object",
"and",
"actually",
"starts",
"the",
"build",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/github.py#L245-L315 | train |
buildbot/buildbot | master/buildbot/www/hooks/github.py | GitHubEventHandler._has_skip | def _has_skip(self, msg):
'''
The message contains the skipping keyword no not.
:return type: Bool
'''
for skip in self.skips:
if re.search(skip, msg):
return True
return False | python | def _has_skip(self, msg):
'''
The message contains the skipping keyword no not.
:return type: Bool
'''
for skip in self.skips:
if re.search(skip, msg):
return True
return False | [
"def",
"_has_skip",
"(",
"self",
",",
"msg",
")",
":",
"for",
"skip",
"in",
"self",
".",
"skips",
":",
"if",
"re",
".",
"search",
"(",
"skip",
",",
"msg",
")",
":",
"return",
"True",
"return",
"False"
] | The message contains the skipping keyword no not.
:return type: Bool | [
"The",
"message",
"contains",
"the",
"skipping",
"keyword",
"no",
"not",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/www/hooks/github.py#L317-L326 | train |
buildbot/buildbot | master/buildbot/steps/package/deb/lintian.py | DebLintian.createSummary | def createSummary(self, log):
"""
Create nice summary logs.
@param log: log to create summary off of.
"""
warnings = self.obs.warnings
errors = self.obs.errors
if warnings:
self.addCompleteLog('%d Warnings' % len(warnings), "\n".join(warnings))
... | python | def createSummary(self, log):
"""
Create nice summary logs.
@param log: log to create summary off of.
"""
warnings = self.obs.warnings
errors = self.obs.errors
if warnings:
self.addCompleteLog('%d Warnings' % len(warnings), "\n".join(warnings))
... | [
"def",
"createSummary",
"(",
"self",
",",
"log",
")",
":",
"warnings",
"=",
"self",
".",
"obs",
".",
"warnings",
"errors",
"=",
"self",
".",
"obs",
".",
"errors",
"if",
"warnings",
":",
"self",
".",
"addCompleteLog",
"(",
"'%d Warnings'",
"%",
"len",
"... | Create nice summary logs.
@param log: log to create summary off of. | [
"Create",
"nice",
"summary",
"logs",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/steps/package/deb/lintian.py#L84-L98 | train |
buildbot/buildbot | worker/buildbot_worker/commands/transfer.py | WorkerFileUploadCommand._writeBlock | def _writeBlock(self):
"""Write a block of data to the remote writer"""
if self.interrupted or self.fp is None:
if self.debug:
log.msg('WorkerFileUploadCommand._writeBlock(): end')
return True
length = self.blocksize
if self.remaining is not None... | python | def _writeBlock(self):
"""Write a block of data to the remote writer"""
if self.interrupted or self.fp is None:
if self.debug:
log.msg('WorkerFileUploadCommand._writeBlock(): end')
return True
length = self.blocksize
if self.remaining is not None... | [
"def",
"_writeBlock",
"(",
"self",
")",
":",
"if",
"self",
".",
"interrupted",
"or",
"self",
".",
"fp",
"is",
"None",
":",
"if",
"self",
".",
"debug",
":",
"log",
".",
"msg",
"(",
"'WorkerFileUploadCommand._writeBlock(): end'",
")",
"return",
"True",
"leng... | Write a block of data to the remote writer | [
"Write",
"a",
"block",
"of",
"data",
"to",
"the",
"remote",
"writer"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/commands/transfer.py#L153-L186 | train |
buildbot/buildbot | worker/buildbot_worker/commands/transfer.py | WorkerFileDownloadCommand._readBlock | def _readBlock(self):
"""Read a block of data from the remote reader."""
if self.interrupted or self.fp is None:
if self.debug:
log.msg('WorkerFileDownloadCommand._readBlock(): end')
return True
length = self.blocksize
if self.bytes_remaining is ... | python | def _readBlock(self):
"""Read a block of data from the remote reader."""
if self.interrupted or self.fp is None:
if self.debug:
log.msg('WorkerFileDownloadCommand._readBlock(): end')
return True
length = self.blocksize
if self.bytes_remaining is ... | [
"def",
"_readBlock",
"(",
"self",
")",
":",
"if",
"self",
".",
"interrupted",
"or",
"self",
".",
"fp",
"is",
"None",
":",
"if",
"self",
".",
"debug",
":",
"log",
".",
"msg",
"(",
"'WorkerFileDownloadCommand._readBlock(): end'",
")",
"return",
"True",
"leng... | Read a block of data from the remote reader. | [
"Read",
"a",
"block",
"of",
"data",
"from",
"the",
"remote",
"reader",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/worker/buildbot_worker/commands/transfer.py#L348-L369 | train |
buildbot/buildbot | master/buildbot/reporters/message.py | MessageFormatter.formatMessageForBuildResults | def formatMessageForBuildResults(self, mode, buildername, buildset, build, master, previous_results, blamelist):
"""Generate a buildbot mail message and return a dictionary
containing the message body, type and subject."""
ss_list = buildset['sourcestamps']
results = build['results']
... | python | def formatMessageForBuildResults(self, mode, buildername, buildset, build, master, previous_results, blamelist):
"""Generate a buildbot mail message and return a dictionary
containing the message body, type and subject."""
ss_list = buildset['sourcestamps']
results = build['results']
... | [
"def",
"formatMessageForBuildResults",
"(",
"self",
",",
"mode",
",",
"buildername",
",",
"buildset",
",",
"build",
",",
"master",
",",
"previous_results",
",",
"blamelist",
")",
":",
"ss_list",
"=",
"buildset",
"[",
"'sourcestamps'",
"]",
"results",
"=",
"bui... | Generate a buildbot mail message and return a dictionary
containing the message body, type and subject. | [
"Generate",
"a",
"buildbot",
"mail",
"message",
"and",
"return",
"a",
"dictionary",
"containing",
"the",
"message",
"body",
"type",
"and",
"subject",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/reporters/message.py#L187-L213 | train |
buildbot/buildbot | master/buildbot/schedulers/forcesched.py | BaseParameter.fullName | def fullName(self):
"""A full name, intended to uniquely identify a parameter"""
# join with '_' if both are set (cannot put '.', because it is used as
# **kwargs)
if self.parentName and self.name:
return self.parentName + '_' + self.name
# otherwise just use the one ... | python | def fullName(self):
"""A full name, intended to uniquely identify a parameter"""
# join with '_' if both are set (cannot put '.', because it is used as
# **kwargs)
if self.parentName and self.name:
return self.parentName + '_' + self.name
# otherwise just use the one ... | [
"def",
"fullName",
"(",
"self",
")",
":",
"# join with '_' if both are set (cannot put '.', because it is used as",
"# **kwargs)",
"if",
"self",
".",
"parentName",
"and",
"self",
".",
"name",
":",
"return",
"self",
".",
"parentName",
"+",
"'_'",
"+",
"self",
".",
... | A full name, intended to uniquely identify a parameter | [
"A",
"full",
"name",
"intended",
"to",
"uniquely",
"identify",
"a",
"parameter"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/schedulers/forcesched.py#L88-L96 | train |
buildbot/buildbot | master/buildbot/schedulers/forcesched.py | BaseParameter.getFromKwargs | def getFromKwargs(self, kwargs):
"""Simple customization point for child classes that do not need the other
parameters supplied to updateFromKwargs. Return the value for the property
named 'self.name'.
The default implementation converts from a list of items, validates using
... | python | def getFromKwargs(self, kwargs):
"""Simple customization point for child classes that do not need the other
parameters supplied to updateFromKwargs. Return the value for the property
named 'self.name'.
The default implementation converts from a list of items, validates using
... | [
"def",
"getFromKwargs",
"(",
"self",
",",
"kwargs",
")",
":",
"args",
"=",
"kwargs",
".",
"get",
"(",
"self",
".",
"fullName",
",",
"[",
"]",
")",
"# delete white space for args",
"for",
"arg",
"in",
"args",
":",
"if",
"isinstance",
"(",
"arg",
",",
"s... | Simple customization point for child classes that do not need the other
parameters supplied to updateFromKwargs. Return the value for the property
named 'self.name'.
The default implementation converts from a list of items, validates using
the optional regex field and calls ... | [
"Simple",
"customization",
"point",
"for",
"child",
"classes",
"that",
"do",
"not",
"need",
"the",
"other",
"parameters",
"supplied",
"to",
"updateFromKwargs",
".",
"Return",
"the",
"value",
"for",
"the",
"property",
"named",
"self",
".",
"name",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/schedulers/forcesched.py#L132-L178 | train |
buildbot/buildbot | master/buildbot/schedulers/forcesched.py | BaseParameter.updateFromKwargs | def updateFromKwargs(self, properties, kwargs, collector, **unused):
"""Primary entry point to turn 'kwargs' into 'properties'"""
properties[self.name] = self.getFromKwargs(kwargs) | python | def updateFromKwargs(self, properties, kwargs, collector, **unused):
"""Primary entry point to turn 'kwargs' into 'properties'"""
properties[self.name] = self.getFromKwargs(kwargs) | [
"def",
"updateFromKwargs",
"(",
"self",
",",
"properties",
",",
"kwargs",
",",
"collector",
",",
"*",
"*",
"unused",
")",
":",
"properties",
"[",
"self",
".",
"name",
"]",
"=",
"self",
".",
"getFromKwargs",
"(",
"kwargs",
")"
] | Primary entry point to turn 'kwargs' into 'properties | [
"Primary",
"entry",
"point",
"to",
"turn",
"kwargs",
"into",
"properties"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/schedulers/forcesched.py#L180-L182 | train |
buildbot/buildbot | master/buildbot/schedulers/forcesched.py | BaseParameter.parse_from_args | def parse_from_args(self, l):
"""Secondary customization point, called from getFromKwargs to turn
a validated value into a single property value"""
if self.multiple:
return [self.parse_from_arg(arg) for arg in l]
return self.parse_from_arg(l[0]) | python | def parse_from_args(self, l):
"""Secondary customization point, called from getFromKwargs to turn
a validated value into a single property value"""
if self.multiple:
return [self.parse_from_arg(arg) for arg in l]
return self.parse_from_arg(l[0]) | [
"def",
"parse_from_args",
"(",
"self",
",",
"l",
")",
":",
"if",
"self",
".",
"multiple",
":",
"return",
"[",
"self",
".",
"parse_from_arg",
"(",
"arg",
")",
"for",
"arg",
"in",
"l",
"]",
"return",
"self",
".",
"parse_from_arg",
"(",
"l",
"[",
"0",
... | Secondary customization point, called from getFromKwargs to turn
a validated value into a single property value | [
"Secondary",
"customization",
"point",
"called",
"from",
"getFromKwargs",
"to",
"turn",
"a",
"validated",
"value",
"into",
"a",
"single",
"property",
"value"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/schedulers/forcesched.py#L184-L189 | train |
buildbot/buildbot | master/buildbot/schedulers/forcesched.py | NestedParameter.collectChildProperties | def collectChildProperties(self, kwargs, properties, collector, **kw):
"""Collapse the child values into a dictionary. This is intended to be
called by child classes to fix up the fullName->name conversions."""
childProperties = {}
for field in self.fields: # pylint: disable=not-an-... | python | def collectChildProperties(self, kwargs, properties, collector, **kw):
"""Collapse the child values into a dictionary. This is intended to be
called by child classes to fix up the fullName->name conversions."""
childProperties = {}
for field in self.fields: # pylint: disable=not-an-... | [
"def",
"collectChildProperties",
"(",
"self",
",",
"kwargs",
",",
"properties",
",",
"collector",
",",
"*",
"*",
"kw",
")",
":",
"childProperties",
"=",
"{",
"}",
"for",
"field",
"in",
"self",
".",
"fields",
":",
"# pylint: disable=not-an-iterable",
"yield",
... | Collapse the child values into a dictionary. This is intended to be
called by child classes to fix up the fullName->name conversions. | [
"Collapse",
"the",
"child",
"values",
"into",
"a",
"dictionary",
".",
"This",
"is",
"intended",
"to",
"be",
"called",
"by",
"child",
"classes",
"to",
"fix",
"up",
"the",
"fullName",
"-",
">",
"name",
"conversions",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/schedulers/forcesched.py#L425-L437 | train |
buildbot/buildbot | master/buildbot/schedulers/forcesched.py | NestedParameter.updateFromKwargs | def updateFromKwargs(self, kwargs, properties, collector, **kw):
"""By default, the child values will be collapsed into a dictionary. If
the parent is anonymous, this dictionary is the top-level properties."""
yield self.collectChildProperties(kwargs=kwargs, properties=properties,
... | python | def updateFromKwargs(self, kwargs, properties, collector, **kw):
"""By default, the child values will be collapsed into a dictionary. If
the parent is anonymous, this dictionary is the top-level properties."""
yield self.collectChildProperties(kwargs=kwargs, properties=properties,
... | [
"def",
"updateFromKwargs",
"(",
"self",
",",
"kwargs",
",",
"properties",
",",
"collector",
",",
"*",
"*",
"kw",
")",
":",
"yield",
"self",
".",
"collectChildProperties",
"(",
"kwargs",
"=",
"kwargs",
",",
"properties",
"=",
"properties",
",",
"collector",
... | By default, the child values will be collapsed into a dictionary. If
the parent is anonymous, this dictionary is the top-level properties. | [
"By",
"default",
"the",
"child",
"values",
"will",
"be",
"collapsed",
"into",
"a",
"dictionary",
".",
"If",
"the",
"parent",
"is",
"anonymous",
"this",
"dictionary",
"is",
"the",
"top",
"-",
"level",
"properties",
"."
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/schedulers/forcesched.py#L440-L453 | train |
buildbot/buildbot | master/buildbot/schedulers/forcesched.py | ForceScheduler.force | def force(self, owner, builderNames=None, builderid=None, **kwargs):
"""
We check the parameters, and launch the build, if everything is correct
"""
builderNames = yield self.computeBuilderNames(builderNames, builderid)
if not builderNames:
raise KeyError("builderName... | python | def force(self, owner, builderNames=None, builderid=None, **kwargs):
"""
We check the parameters, and launch the build, if everything is correct
"""
builderNames = yield self.computeBuilderNames(builderNames, builderid)
if not builderNames:
raise KeyError("builderName... | [
"def",
"force",
"(",
"self",
",",
"owner",
",",
"builderNames",
"=",
"None",
",",
"builderid",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"builderNames",
"=",
"yield",
"self",
".",
"computeBuilderNames",
"(",
"builderNames",
",",
"builderid",
")",
"... | We check the parameters, and launch the build, if everything is correct | [
"We",
"check",
"the",
"parameters",
"and",
"launch",
"the",
"build",
"if",
"everything",
"is",
"correct"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/schedulers/forcesched.py#L799-L845 | train |
buildbot/buildbot | master/buildbot/secrets/manager.py | SecretManager.get | def get(self, secret, *args, **kwargs):
"""
get secrets from the provider defined in the secret using args and
kwargs
@secrets: secrets keys
@type: string
@return type: SecretDetails
"""
for provider in self.services:
value = yield provider.get... | python | def get(self, secret, *args, **kwargs):
"""
get secrets from the provider defined in the secret using args and
kwargs
@secrets: secrets keys
@type: string
@return type: SecretDetails
"""
for provider in self.services:
value = yield provider.get... | [
"def",
"get",
"(",
"self",
",",
"secret",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"provider",
"in",
"self",
".",
"services",
":",
"value",
"=",
"yield",
"provider",
".",
"get",
"(",
"secret",
")",
"source_name",
"=",
"provider",
... | get secrets from the provider defined in the secret using args and
kwargs
@secrets: secrets keys
@type: string
@return type: SecretDetails | [
"get",
"secrets",
"from",
"the",
"provider",
"defined",
"in",
"the",
"secret",
"using",
"args",
"and",
"kwargs"
] | 5df3cfae6d760557d99156633c32b1822a1e130c | https://github.com/buildbot/buildbot/blob/5df3cfae6d760557d99156633c32b1822a1e130c/master/buildbot/secrets/manager.py#L33-L45 | train |
squeaky-pl/japronto | misc/cpu.py | save | def save():
"""
save function
"""
results = {}
cpu_number = 0
while True:
try:
_file = open(
CPU_PREFIX + 'cpu{}/cpufreq/scaling_governor'.format(cpu_number))
except:
break
governor = _file.read().strip()
results.setdefaul... | python | def save():
"""
save function
"""
results = {}
cpu_number = 0
while True:
try:
_file = open(
CPU_PREFIX + 'cpu{}/cpufreq/scaling_governor'.format(cpu_number))
except:
break
governor = _file.read().strip()
results.setdefaul... | [
"def",
"save",
"(",
")",
":",
"results",
"=",
"{",
"}",
"cpu_number",
"=",
"0",
"while",
"True",
":",
"try",
":",
"_file",
"=",
"open",
"(",
"CPU_PREFIX",
"+",
"'cpu{}/cpufreq/scaling_governor'",
".",
"format",
"(",
"cpu_number",
")",
")",
"except",
":",... | save function | [
"save",
"function"
] | a526277a2f59100388c9f39d4ca22bfb4909955b | https://github.com/squeaky-pl/japronto/blob/a526277a2f59100388c9f39d4ca22bfb4909955b/misc/cpu.py#L14-L45 | train |
squeaky-pl/japronto | misc/cpu.py | change | def change(governor, freq=None):
"""
change function
"""
cpu_number = 0
while True:
try:
subprocess.check_output([
"sudo", "bash", "-c",
"echo {governor} > {CPU_PREFIX}cpu{cpu_number}/cpufreq/scaling_governor"
.format(governor=gove... | python | def change(governor, freq=None):
"""
change function
"""
cpu_number = 0
while True:
try:
subprocess.check_output([
"sudo", "bash", "-c",
"echo {governor} > {CPU_PREFIX}cpu{cpu_number}/cpufreq/scaling_governor"
.format(governor=gove... | [
"def",
"change",
"(",
"governor",
",",
"freq",
"=",
"None",
")",
":",
"cpu_number",
"=",
"0",
"while",
"True",
":",
"try",
":",
"subprocess",
".",
"check_output",
"(",
"[",
"\"sudo\"",
",",
"\"bash\"",
",",
"\"-c\"",
",",
"\"echo {governor} > {CPU_PREFIX}cpu... | change function | [
"change",
"function"
] | a526277a2f59100388c9f39d4ca22bfb4909955b | https://github.com/squeaky-pl/japronto/blob/a526277a2f59100388c9f39d4ca22bfb4909955b/misc/cpu.py#L48-L75 | train |
squeaky-pl/japronto | misc/cpu.py | available_freq | def available_freq():
"""
function for checking available frequency
"""
_file = open(CPU_PREFIX + 'cpu0/cpufreq/scaling_available_frequencies')
freq = [int(_file) for _file in _file.read().strip().split()]
_file.close()
return freq | python | def available_freq():
"""
function for checking available frequency
"""
_file = open(CPU_PREFIX + 'cpu0/cpufreq/scaling_available_frequencies')
freq = [int(_file) for _file in _file.read().strip().split()]
_file.close()
return freq | [
"def",
"available_freq",
"(",
")",
":",
"_file",
"=",
"open",
"(",
"CPU_PREFIX",
"+",
"'cpu0/cpufreq/scaling_available_frequencies'",
")",
"freq",
"=",
"[",
"int",
"(",
"_file",
")",
"for",
"_file",
"in",
"_file",
".",
"read",
"(",
")",
".",
"strip",
"(",
... | function for checking available frequency | [
"function",
"for",
"checking",
"available",
"frequency"
] | a526277a2f59100388c9f39d4ca22bfb4909955b | https://github.com/squeaky-pl/japronto/blob/a526277a2f59100388c9f39d4ca22bfb4909955b/misc/cpu.py#L78-L88 | train |
squeaky-pl/japronto | misc/cpu.py | dump | def dump():
"""
dump function
"""
try:
sensors = subprocess.check_output('sensors').decode('utf-8')
except (FileNotFoundError, subprocess.CalledProcessError):
print("Couldn't read CPU temp")
else:
cores = []
for line in sensors.splitlines():
if lin... | python | def dump():
"""
dump function
"""
try:
sensors = subprocess.check_output('sensors').decode('utf-8')
except (FileNotFoundError, subprocess.CalledProcessError):
print("Couldn't read CPU temp")
else:
cores = []
for line in sensors.splitlines():
if lin... | [
"def",
"dump",
"(",
")",
":",
"try",
":",
"sensors",
"=",
"subprocess",
".",
"check_output",
"(",
"'sensors'",
")",
".",
"decode",
"(",
"'utf-8'",
")",
"except",
"(",
"FileNotFoundError",
",",
"subprocess",
".",
"CalledProcessError",
")",
":",
"print",
"("... | dump function | [
"dump",
"function"
] | a526277a2f59100388c9f39d4ca22bfb4909955b | https://github.com/squeaky-pl/japronto/blob/a526277a2f59100388c9f39d4ca22bfb4909955b/misc/cpu.py#L105-L151 | train |
squeaky-pl/japronto | src/japronto/router/route.py | padto8 | def padto8(data):
"""Pads data to the multiplies of 8 bytes.
This makes x86_64 faster and prevents
undefined behavior on other platforms"""
length = len(data)
return data + b'\xdb' * (roundto8(length) - length) | python | def padto8(data):
"""Pads data to the multiplies of 8 bytes.
This makes x86_64 faster and prevents
undefined behavior on other platforms"""
length = len(data)
return data + b'\xdb' * (roundto8(length) - length) | [
"def",
"padto8",
"(",
"data",
")",
":",
"length",
"=",
"len",
"(",
"data",
")",
"return",
"data",
"+",
"b'\\xdb'",
"*",
"(",
"roundto8",
"(",
"length",
")",
"-",
"length",
")"
] | Pads data to the multiplies of 8 bytes.
This makes x86_64 faster and prevents
undefined behavior on other platforms | [
"Pads",
"data",
"to",
"the",
"multiplies",
"of",
"8",
"bytes",
"."
] | a526277a2f59100388c9f39d4ca22bfb4909955b | https://github.com/squeaky-pl/japronto/blob/a526277a2f59100388c9f39d4ca22bfb4909955b/src/japronto/router/route.py#L125-L131 | train |
squeaky-pl/japronto | src/japronto/request/__init__.py | parse_cookie | def parse_cookie(cookie):
"""Parse a ``Cookie`` HTTP header into a dict of name/value pairs.
This function attempts to mimic browser cookie parsing behavior;
it specifically does not follow any of the cookie-related RFCs
(because browsers don't either).
The algorithm used is identical to that used b... | python | def parse_cookie(cookie):
"""Parse a ``Cookie`` HTTP header into a dict of name/value pairs.
This function attempts to mimic browser cookie parsing behavior;
it specifically does not follow any of the cookie-related RFCs
(because browsers don't either).
The algorithm used is identical to that used b... | [
"def",
"parse_cookie",
"(",
"cookie",
")",
":",
"cookiedict",
"=",
"{",
"}",
"for",
"chunk",
"in",
"cookie",
".",
"split",
"(",
"str",
"(",
"';'",
")",
")",
":",
"if",
"str",
"(",
"'='",
")",
"in",
"chunk",
":",
"key",
",",
"val",
"=",
"chunk",
... | Parse a ``Cookie`` HTTP header into a dict of name/value pairs.
This function attempts to mimic browser cookie parsing behavior;
it specifically does not follow any of the cookie-related RFCs
(because browsers don't either).
The algorithm used is identical to that used by Django version 1.9.10. | [
"Parse",
"a",
"Cookie",
"HTTP",
"header",
"into",
"a",
"dict",
"of",
"name",
"/",
"value",
"pairs",
".",
"This",
"function",
"attempts",
"to",
"mimic",
"browser",
"cookie",
"parsing",
"behavior",
";",
"it",
"specifically",
"does",
"not",
"follow",
"any",
"... | a526277a2f59100388c9f39d4ca22bfb4909955b | https://github.com/squeaky-pl/japronto/blob/a526277a2f59100388c9f39d4ca22bfb4909955b/src/japronto/request/__init__.py#L131-L150 | train |
squeaky-pl/japronto | src/japronto/router/analyzer.py | is_simple | def is_simple(fun):
"""A heuristic to find out if a function is simple enough."""
seen_load_fast_0 = False
seen_load_response = False
seen_call_fun = False
for instruction in dis.get_instructions(fun):
if instruction.opname == 'LOAD_FAST' and instruction.arg == 0:
seen_load_fast... | python | def is_simple(fun):
"""A heuristic to find out if a function is simple enough."""
seen_load_fast_0 = False
seen_load_response = False
seen_call_fun = False
for instruction in dis.get_instructions(fun):
if instruction.opname == 'LOAD_FAST' and instruction.arg == 0:
seen_load_fast... | [
"def",
"is_simple",
"(",
"fun",
")",
":",
"seen_load_fast_0",
"=",
"False",
"seen_load_response",
"=",
"False",
"seen_call_fun",
"=",
"False",
"for",
"instruction",
"in",
"dis",
".",
"get_instructions",
"(",
"fun",
")",
":",
"if",
"instruction",
".",
"opname",... | A heuristic to find out if a function is simple enough. | [
"A",
"heuristic",
"to",
"find",
"out",
"if",
"a",
"function",
"is",
"simple",
"enough",
"."
] | a526277a2f59100388c9f39d4ca22bfb4909955b | https://github.com/squeaky-pl/japronto/blob/a526277a2f59100388c9f39d4ca22bfb4909955b/src/japronto/router/analyzer.py#L9-L32 | train |
pandas-profiling/pandas-profiling | pandas_profiling/__init__.py | ProfileReport.get_rejected_variables | def get_rejected_variables(self, threshold=0.9):
"""Return a list of variable names being rejected for high
correlation with one of remaining variables.
Parameters:
----------
threshold : float
Correlation value which is above the threshold are rejected
... | python | def get_rejected_variables(self, threshold=0.9):
"""Return a list of variable names being rejected for high
correlation with one of remaining variables.
Parameters:
----------
threshold : float
Correlation value which is above the threshold are rejected
... | [
"def",
"get_rejected_variables",
"(",
"self",
",",
"threshold",
"=",
"0.9",
")",
":",
"variable_profile",
"=",
"self",
".",
"description_set",
"[",
"'variables'",
"]",
"result",
"=",
"[",
"]",
"if",
"hasattr",
"(",
"variable_profile",
",",
"'correlation'",
")"... | Return a list of variable names being rejected for high
correlation with one of remaining variables.
Parameters:
----------
threshold : float
Correlation value which is above the threshold are rejected
Returns
-------
list
The lis... | [
"Return",
"a",
"list",
"of",
"variable",
"names",
"being",
"rejected",
"for",
"high",
"correlation",
"with",
"one",
"of",
"remaining",
"variables",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/__init__.py#L86-L104 | train |
pandas-profiling/pandas-profiling | pandas_profiling/__init__.py | ProfileReport.to_file | def to_file(self, outputfile=DEFAULT_OUTPUTFILE):
"""Write the report to a file.
By default a name is generated.
Parameters:
----------
outputfile : str
The name or the path of the file to generale including the extension (.html).
"""
if... | python | def to_file(self, outputfile=DEFAULT_OUTPUTFILE):
"""Write the report to a file.
By default a name is generated.
Parameters:
----------
outputfile : str
The name or the path of the file to generale including the extension (.html).
"""
if... | [
"def",
"to_file",
"(",
"self",
",",
"outputfile",
"=",
"DEFAULT_OUTPUTFILE",
")",
":",
"if",
"outputfile",
"!=",
"NO_OUTPUTFILE",
":",
"if",
"outputfile",
"==",
"DEFAULT_OUTPUTFILE",
":",
"outputfile",
"=",
"'profile_'",
"+",
"str",
"(",
"hash",
"(",
"self",
... | Write the report to a file.
By default a name is generated.
Parameters:
----------
outputfile : str
The name or the path of the file to generale including the extension (.html). | [
"Write",
"the",
"report",
"to",
"a",
"file",
".",
"By",
"default",
"a",
"name",
"is",
"generated",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/__init__.py#L106-L122 | train |
pandas-profiling/pandas-profiling | pandas_profiling/templates.py | template | def template(template_name):
"""Return a jinja template ready for rendering. If needed, global variables are initialized.
Parameters
----------
template_name: str, the name of the template as defined in the templates mapping
Returns
-------
The Jinja template ready for rendering
"""
... | python | def template(template_name):
"""Return a jinja template ready for rendering. If needed, global variables are initialized.
Parameters
----------
template_name: str, the name of the template as defined in the templates mapping
Returns
-------
The Jinja template ready for rendering
"""
... | [
"def",
"template",
"(",
"template_name",
")",
":",
"globals",
"=",
"None",
"if",
"template_name",
".",
"startswith",
"(",
"'row_'",
")",
":",
"# This is a row template setting global variable",
"globals",
"=",
"dict",
"(",
")",
"globals",
"[",
"'vartype'",
"]",
... | Return a jinja template ready for rendering. If needed, global variables are initialized.
Parameters
----------
template_name: str, the name of the template as defined in the templates mapping
Returns
-------
The Jinja template ready for rendering | [
"Return",
"a",
"jinja",
"template",
"ready",
"for",
"rendering",
".",
"If",
"needed",
"global",
"variables",
"are",
"initialized",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/templates.py#L44-L60 | train |
pandas-profiling/pandas-profiling | pandas_profiling/report.py | to_html | def to_html(sample, stats_object):
"""Generate a HTML report from summary statistics and a given sample.
Parameters
----------
sample : DataFrame
the sample you want to print
stats_object : dict
Summary statistics. Should be generated with an appropriate describe() function
Ret... | python | def to_html(sample, stats_object):
"""Generate a HTML report from summary statistics and a given sample.
Parameters
----------
sample : DataFrame
the sample you want to print
stats_object : dict
Summary statistics. Should be generated with an appropriate describe() function
Ret... | [
"def",
"to_html",
"(",
"sample",
",",
"stats_object",
")",
":",
"n_obs",
"=",
"stats_object",
"[",
"'table'",
"]",
"[",
"'n'",
"]",
"value_formatters",
"=",
"formatters",
".",
"value_formatters",
"row_formatters",
"=",
"formatters",
".",
"row_formatters",
"if",
... | Generate a HTML report from summary statistics and a given sample.
Parameters
----------
sample : DataFrame
the sample you want to print
stats_object : dict
Summary statistics. Should be generated with an appropriate describe() function
Returns
-------
str
containin... | [
"Generate",
"a",
"HTML",
"report",
"from",
"summary",
"statistics",
"and",
"a",
"given",
"sample",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/report.py#L11-L214 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe_numeric_1d | def describe_numeric_1d(series, **kwargs):
"""Compute summary statistics of a numerical (`TYPE_NUM`) variable (a Series).
Also create histograms (mini an full) of its distribution.
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
T... | python | def describe_numeric_1d(series, **kwargs):
"""Compute summary statistics of a numerical (`TYPE_NUM`) variable (a Series).
Also create histograms (mini an full) of its distribution.
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
T... | [
"def",
"describe_numeric_1d",
"(",
"series",
",",
"*",
"*",
"kwargs",
")",
":",
"# Format a number as a percentage. For example 0.25 will be turned to 25%.",
"_percentile_format",
"=",
"\"{:.0%}\"",
"stats",
"=",
"dict",
"(",
")",
"stats",
"[",
"'type'",
"]",
"=",
"ba... | Compute summary statistics of a numerical (`TYPE_NUM`) variable (a Series).
Also create histograms (mini an full) of its distribution.
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with in... | [
"Compute",
"summary",
"statistics",
"of",
"a",
"numerical",
"(",
"TYPE_NUM",
")",
"variable",
"(",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L15-L56 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe_date_1d | def describe_date_1d(series):
"""Compute summary statistics of a date (`TYPE_DATE`) variable (a Series).
Also create histograms (mini an full) of its distribution.
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of... | python | def describe_date_1d(series):
"""Compute summary statistics of a date (`TYPE_DATE`) variable (a Series).
Also create histograms (mini an full) of its distribution.
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of... | [
"def",
"describe_date_1d",
"(",
"series",
")",
":",
"stats",
"=",
"dict",
"(",
")",
"stats",
"[",
"'type'",
"]",
"=",
"base",
".",
"TYPE_DATE",
"stats",
"[",
"'min'",
"]",
"=",
"series",
".",
"min",
"(",
")",
"stats",
"[",
"'max'",
"]",
"=",
"serie... | Compute summary statistics of a date (`TYPE_DATE`) variable (a Series).
Also create histograms (mini an full) of its distribution.
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index ... | [
"Compute",
"summary",
"statistics",
"of",
"a",
"date",
"(",
"TYPE_DATE",
")",
"variable",
"(",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L59-L82 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe_categorical_1d | def describe_categorical_1d(series):
"""Compute summary statistics of a categorical (`TYPE_CAT`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats ke... | python | def describe_categorical_1d(series):
"""Compute summary statistics of a categorical (`TYPE_CAT`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats ke... | [
"def",
"describe_categorical_1d",
"(",
"series",
")",
":",
"# Only run if at least 1 non-missing value",
"value_counts",
",",
"distinct_count",
"=",
"base",
".",
"get_groupby_statistic",
"(",
"series",
")",
"top",
",",
"freq",
"=",
"value_counts",
".",
"index",
"[",
... | Compute summary statistics of a categorical (`TYPE_CAT`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys. | [
"Compute",
"summary",
"statistics",
"of",
"a",
"categorical",
"(",
"TYPE_CAT",
")",
"variable",
"(",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L84-L107 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe_boolean_1d | def describe_boolean_1d(series):
"""Compute summary statistics of a boolean (`TYPE_BOOL`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys.
... | python | def describe_boolean_1d(series):
"""Compute summary statistics of a boolean (`TYPE_BOOL`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys.
... | [
"def",
"describe_boolean_1d",
"(",
"series",
")",
":",
"value_counts",
",",
"distinct_count",
"=",
"base",
".",
"get_groupby_statistic",
"(",
"series",
")",
"top",
",",
"freq",
"=",
"value_counts",
".",
"index",
"[",
"0",
"]",
",",
"value_counts",
".",
"iloc... | Compute summary statistics of a boolean (`TYPE_BOOL`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys. | [
"Compute",
"summary",
"statistics",
"of",
"a",
"boolean",
"(",
"TYPE_BOOL",
")",
"variable",
"(",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L109-L131 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe_constant_1d | def describe_constant_1d(series):
"""Compute summary statistics of a constant (`S_TYPE_CONST`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys... | python | def describe_constant_1d(series):
"""Compute summary statistics of a constant (`S_TYPE_CONST`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys... | [
"def",
"describe_constant_1d",
"(",
"series",
")",
":",
"return",
"pd",
".",
"Series",
"(",
"[",
"base",
".",
"S_TYPE_CONST",
"]",
",",
"index",
"=",
"[",
"'type'",
"]",
",",
"name",
"=",
"series",
".",
"name",
")"
] | Compute summary statistics of a constant (`S_TYPE_CONST`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys. | [
"Compute",
"summary",
"statistics",
"of",
"a",
"constant",
"(",
"S_TYPE_CONST",
")",
"variable",
"(",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L133-L146 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe_unique_1d | def describe_unique_1d(series):
"""Compute summary statistics of a unique (`S_TYPE_UNIQUE`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys.
... | python | def describe_unique_1d(series):
"""Compute summary statistics of a unique (`S_TYPE_UNIQUE`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys.
... | [
"def",
"describe_unique_1d",
"(",
"series",
")",
":",
"return",
"pd",
".",
"Series",
"(",
"[",
"base",
".",
"S_TYPE_UNIQUE",
"]",
",",
"index",
"=",
"[",
"'type'",
"]",
",",
"name",
"=",
"series",
".",
"name",
")"
] | Compute summary statistics of a unique (`S_TYPE_UNIQUE`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys. | [
"Compute",
"summary",
"statistics",
"of",
"a",
"unique",
"(",
"S_TYPE_UNIQUE",
")",
"variable",
"(",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L148-L161 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe_supported | def describe_supported(series, **kwargs):
"""Compute summary statistics of a supported variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys.
""... | python | def describe_supported(series, **kwargs):
"""Compute summary statistics of a supported variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys.
""... | [
"def",
"describe_supported",
"(",
"series",
",",
"*",
"*",
"kwargs",
")",
":",
"leng",
"=",
"len",
"(",
"series",
")",
"# number of observations in the Series",
"count",
"=",
"series",
".",
"count",
"(",
")",
"# number of non-NaN observations in the Series",
"n_infi... | Compute summary statistics of a supported variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys. | [
"Compute",
"summary",
"statistics",
"of",
"a",
"supported",
"variable",
"(",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L163-L201 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe_unsupported | def describe_unsupported(series, **kwargs):
"""Compute summary statistics of a unsupported (`S_TYPE_UNSUPPORTED`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with ind... | python | def describe_unsupported(series, **kwargs):
"""Compute summary statistics of a unsupported (`S_TYPE_UNSUPPORTED`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with ind... | [
"def",
"describe_unsupported",
"(",
"series",
",",
"*",
"*",
"kwargs",
")",
":",
"leng",
"=",
"len",
"(",
"series",
")",
"# number of observations in the Series",
"count",
"=",
"series",
".",
"count",
"(",
")",
"# number of non-NaN observations in the Series",
"n_in... | Compute summary statistics of a unsupported (`S_TYPE_UNSUPPORTED`) variable (a Series).
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The description of the variable as a Series with index being stats keys. | [
"Compute",
"summary",
"statistics",
"of",
"a",
"unsupported",
"(",
"S_TYPE_UNSUPPORTED",
")",
"variable",
"(",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L203-L233 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe_1d | def describe_1d(data, **kwargs):
"""Compute summary statistics of a variable (a Series).
The description is different according to the type of the variable.
However a set of common stats is also computed.
Parameters
----------
series : Series
The variable to describe.
Returns
... | python | def describe_1d(data, **kwargs):
"""Compute summary statistics of a variable (a Series).
The description is different according to the type of the variable.
However a set of common stats is also computed.
Parameters
----------
series : Series
The variable to describe.
Returns
... | [
"def",
"describe_1d",
"(",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"# Replace infinite values with NaNs to avoid issues with",
"# histograms later.",
"data",
".",
"replace",
"(",
"to_replace",
"=",
"[",
"np",
".",
"inf",
",",
"np",
".",
"NINF",
",",
"np",
"... | Compute summary statistics of a variable (a Series).
The description is different according to the type of the variable.
However a set of common stats is also computed.
Parameters
----------
series : Series
The variable to describe.
Returns
-------
Series
The descripti... | [
"Compute",
"summary",
"statistics",
"of",
"a",
"variable",
"(",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L235-L279 | train |
pandas-profiling/pandas-profiling | pandas_profiling/describe.py | describe | def describe(df, bins=10, check_correlation=True, correlation_threshold=0.9, correlation_overrides=None, check_recoded=False, pool_size=multiprocessing.cpu_count(), **kwargs):
"""Generates a dict containing summary statistics for a given dataset stored as a pandas `DataFrame`.
Used has is it will output its co... | python | def describe(df, bins=10, check_correlation=True, correlation_threshold=0.9, correlation_overrides=None, check_recoded=False, pool_size=multiprocessing.cpu_count(), **kwargs):
"""Generates a dict containing summary statistics for a given dataset stored as a pandas `DataFrame`.
Used has is it will output its co... | [
"def",
"describe",
"(",
"df",
",",
"bins",
"=",
"10",
",",
"check_correlation",
"=",
"True",
",",
"correlation_threshold",
"=",
"0.9",
",",
"correlation_overrides",
"=",
"None",
",",
"check_recoded",
"=",
"False",
",",
"pool_size",
"=",
"multiprocessing",
".",... | Generates a dict containing summary statistics for a given dataset stored as a pandas `DataFrame`.
Used has is it will output its content as an HTML report in a Jupyter notebook.
Parameters
----------
df : DataFrame
Data to be analyzed
bins : int
Number of bins in histogram.
... | [
"Generates",
"a",
"dict",
"containing",
"summary",
"statistics",
"for",
"a",
"given",
"dataset",
"stored",
"as",
"a",
"pandas",
"DataFrame",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/describe.py#L284-L429 | train |
pandas-profiling/pandas-profiling | pandas_profiling/plot.py | _plot_histogram | def _plot_histogram(series, bins=10, figsize=(6, 4), facecolor='#337ab7'):
"""Plot an histogram from the data and return the AxesSubplot object.
Parameters
----------
series : Series
The data to plot
figsize : tuple
The size of the figure (width, height) in inches, default (6,4)
... | python | def _plot_histogram(series, bins=10, figsize=(6, 4), facecolor='#337ab7'):
"""Plot an histogram from the data and return the AxesSubplot object.
Parameters
----------
series : Series
The data to plot
figsize : tuple
The size of the figure (width, height) in inches, default (6,4)
... | [
"def",
"_plot_histogram",
"(",
"series",
",",
"bins",
"=",
"10",
",",
"figsize",
"=",
"(",
"6",
",",
"4",
")",
",",
"facecolor",
"=",
"'#337ab7'",
")",
":",
"if",
"base",
".",
"get_vartype",
"(",
"series",
")",
"==",
"base",
".",
"TYPE_DATE",
":",
... | Plot an histogram from the data and return the AxesSubplot object.
Parameters
----------
series : Series
The data to plot
figsize : tuple
The size of the figure (width, height) in inches, default (6,4)
facecolor : str
The color code.
Returns
-------
matplotlib.A... | [
"Plot",
"an",
"histogram",
"from",
"the",
"data",
"and",
"return",
"the",
"AxesSubplot",
"object",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/plot.py#L26-L56 | train |
pandas-profiling/pandas-profiling | pandas_profiling/plot.py | histogram | def histogram(series, **kwargs):
"""Plot an histogram of the data.
Parameters
----------
series: Series
The data to plot.
Returns
-------
str
The resulting image encoded as a string.
"""
imgdata = BytesIO()
plot = _plot_histogram(series, **kwargs)
plot.figur... | python | def histogram(series, **kwargs):
"""Plot an histogram of the data.
Parameters
----------
series: Series
The data to plot.
Returns
-------
str
The resulting image encoded as a string.
"""
imgdata = BytesIO()
plot = _plot_histogram(series, **kwargs)
plot.figur... | [
"def",
"histogram",
"(",
"series",
",",
"*",
"*",
"kwargs",
")",
":",
"imgdata",
"=",
"BytesIO",
"(",
")",
"plot",
"=",
"_plot_histogram",
"(",
"series",
",",
"*",
"*",
"kwargs",
")",
"plot",
".",
"figure",
".",
"subplots_adjust",
"(",
"left",
"=",
"... | Plot an histogram of the data.
Parameters
----------
series: Series
The data to plot.
Returns
-------
str
The resulting image encoded as a string. | [
"Plot",
"an",
"histogram",
"of",
"the",
"data",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/plot.py#L59-L80 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.