repo stringlengths 7 54 | 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 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 | Create nice summary logs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Returns the submitted_at of the oldest unclaimed build request for this builder or None if there are no build requests. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Returns the complete_at of the latest completed build request for this builder or None if there are no such build requests. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | This is invoked by the Worker when the self. workername bot is fully attached to a worker. This is invoked by the Worker when the self. workername bot is fully attached to a worker and ready to accept commands. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | This is called when the connection to the bot is lost. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | This is called when the build has finished. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Helper function to determine which collapseRequests function to use for merging | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | private implementation of reactor. spawnProcess to allow use of
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | A wrapper around reactor. spawnProcess that handles the batch command. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Yields the data that we can send over PB. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Take a dictionary of lists of output chunks and concatenate all the chunks into a single string | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Collapse and send the message to the master | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Send all the content in our buffers. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Add data to the buffer for logname | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | This method is called by the master - side RemoteCommand when it actually starts the build. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Halt the current step. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Make any currently - running command die with no further status
output. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | This method sends the status update to the master - side
object and returns the number of the update. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | This command retrieves the contents of the files in WORKERDIR and sends them to the buildmaster. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Record my hostname in twistd. hostname for user convenience | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | walk upwards from the current directory until we find this topfile | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | This accepts the arguments of a command without the actual
command itself. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Return a Deferred that fires with a SourceStamp instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Version of check_output which does not throw error | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Extract the version of a source from git archive. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Return the version of the current build. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Run command. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Get the message of a commit. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Processes a change from GitHub Service and returns a list of dictionaries that represents the changes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Check if the message contains the skipping keyword. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create nice summary logs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Write a block of data to the remote writer | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Read a block of data from the remote reader. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Generate a buildbot mail message and return a dictionary
containing the message body type and subject. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | A full name for the current object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Simple customization point for child classes that do not need the other
parameters supplied to updateFromKwargs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Update the properties dictionary with the values from the kwargs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Secondary customization point called from getFromKwargs to turn
a validated value into a single property value | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Collapse the child values into a dictionary. This is intended to be
called by child classes to fix up the fullName - > name conversions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Update the properties of the object based on the keyword arguments. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create a new buildset for this source stamp. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | get secrets from the provider defined in the secret | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | save function
save function
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | change the neccesary neccesary | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | function for checking available frequency
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | dump function for the
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Pads data to the multiplies of 8 bytes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Parse a cookie string into a dict of name value pairs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | A heuristic to find out if a function is simple enough. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Return a list of variable names being rejected for high
correlation with one of remaining variables. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Write the report to a file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Returns a Jinja template ready for rendering. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Generate a HTML report from summary statistics and a given sample. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Compute summary statistics of a numeric variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Compute summary statistics of a date variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Compute summary statistics of a categorical variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Compute summary statistics of a boolean variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Compute summary statistics of a constant variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Compute summary statistics of a unique variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Compute summary statistics of a supported variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Compute summary statistics of an unsupported variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Compute summary statistics of a single 1D variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Generates a dict containing summary statistics for a given dataset stored as a pandas. DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Plot a histogram from the data and return the AxesSubplot object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Plot an histogram of the data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
pandas-profiling/pandas-profiling | pandas_profiling/plot.py | mini_histogram | def mini_histogram(series, **kwargs):
"""Plot a small (mini) 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, figsize... | python | def mini_histogram(series, **kwargs):
"""Plot a small (mini) 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, figsize... | [
"def",
"mini_histogram",
"(",
"series",
",",
"*",
"*",
"kwargs",
")",
":",
"imgdata",
"=",
"BytesIO",
"(",
")",
"plot",
"=",
"_plot_histogram",
"(",
"series",
",",
"figsize",
"=",
"(",
"2",
",",
"0.75",
")",
",",
"*",
"*",
"kwargs",
")",
"plot",
".... | Plot a small (mini) histogram of the data.
Parameters
----------
series: Series
The data to plot.
Returns
-------
str
The resulting image encoded as a string. | [
"Plot",
"a",
"small",
"(",
"mini",
")",
"histogram",
"of",
"the",
"data",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/plot.py#L83-L116 | train | Plot a small histogram of the data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
pandas-profiling/pandas-profiling | pandas_profiling/plot.py | correlation_matrix | def correlation_matrix(corrdf, title, **kwargs):
"""Plot image of a matrix correlation.
Parameters
----------
corrdf: DataFrame
The matrix correlation to plot.
title: str
The matrix title
Returns
-------
str, The resulting image encoded as a string.
"""
imgdata = ... | python | def correlation_matrix(corrdf, title, **kwargs):
"""Plot image of a matrix correlation.
Parameters
----------
corrdf: DataFrame
The matrix correlation to plot.
title: str
The matrix title
Returns
-------
str, The resulting image encoded as a string.
"""
imgdata = ... | [
"def",
"correlation_matrix",
"(",
"corrdf",
",",
"title",
",",
"*",
"*",
"kwargs",
")",
":",
"imgdata",
"=",
"BytesIO",
"(",
")",
"fig_cor",
",",
"axes_cor",
"=",
"plt",
".",
"subplots",
"(",
"1",
",",
"1",
")",
"labels",
"=",
"corrdf",
".",
"columns... | Plot image of a matrix correlation.
Parameters
----------
corrdf: DataFrame
The matrix correlation to plot.
title: str
The matrix title
Returns
-------
str, The resulting image encoded as a string. | [
"Plot",
"image",
"of",
"a",
"matrix",
"correlation",
".",
"Parameters",
"----------",
"corrdf",
":",
"DataFrame",
"The",
"matrix",
"correlation",
"to",
"plot",
".",
"title",
":",
"str",
"The",
"matrix",
"title",
"Returns",
"-------",
"str",
"The",
"resulting",... | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/plot.py#L118-L145 | train | Plot image of a matrix correlation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
pandas-profiling/pandas-profiling | pandas_profiling/base.py | get_groupby_statistic | def get_groupby_statistic(data):
"""Calculate value counts and distinct count of a variable (technically a Series).
The result is cached by column name in a global variable to avoid recomputing.
Parameters
----------
data : Series
The data type of the Series.
Returns
-------
l... | python | def get_groupby_statistic(data):
"""Calculate value counts and distinct count of a variable (technically a Series).
The result is cached by column name in a global variable to avoid recomputing.
Parameters
----------
data : Series
The data type of the Series.
Returns
-------
l... | [
"def",
"get_groupby_statistic",
"(",
"data",
")",
":",
"if",
"data",
".",
"name",
"is",
"not",
"None",
"and",
"data",
".",
"name",
"in",
"_VALUE_COUNTS_MEMO",
":",
"return",
"_VALUE_COUNTS_MEMO",
"[",
"data",
".",
"name",
"]",
"value_counts_with_nan",
"=",
"... | Calculate value counts and distinct count of a variable (technically a Series).
The result is cached by column name in a global variable to avoid recomputing.
Parameters
----------
data : Series
The data type of the Series.
Returns
-------
list
value count and distinct cou... | [
"Calculate",
"value",
"counts",
"and",
"distinct",
"count",
"of",
"a",
"variable",
"(",
"technically",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/base.py#L29-L60 | train | Calculate value counts and distinct count of a variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
pandas-profiling/pandas-profiling | pandas_profiling/base.py | get_vartype | def get_vartype(data):
"""Infer the type of a variable (technically a Series).
The types supported are split in standard types and special types.
Standard types:
* Categorical (`TYPE_CAT`): the default type if no other one can be determined
* Numerical (`TYPE_NUM`): if it contains numbers
... | python | def get_vartype(data):
"""Infer the type of a variable (technically a Series).
The types supported are split in standard types and special types.
Standard types:
* Categorical (`TYPE_CAT`): the default type if no other one can be determined
* Numerical (`TYPE_NUM`): if it contains numbers
... | [
"def",
"get_vartype",
"(",
"data",
")",
":",
"if",
"data",
".",
"name",
"is",
"not",
"None",
"and",
"data",
".",
"name",
"in",
"_MEMO",
":",
"return",
"_MEMO",
"[",
"data",
".",
"name",
"]",
"vartype",
"=",
"None",
"try",
":",
"distinct_count",
"=",
... | Infer the type of a variable (technically a Series).
The types supported are split in standard types and special types.
Standard types:
* Categorical (`TYPE_CAT`): the default type if no other one can be determined
* Numerical (`TYPE_NUM`): if it contains numbers
* Boolean (`TYPE_BOOL`... | [
"Infer",
"the",
"type",
"of",
"a",
"variable",
"(",
"technically",
"a",
"Series",
")",
"."
] | 003d236daee8b7aca39c62708b18d59bced0bc03 | https://github.com/pandas-profiling/pandas-profiling/blob/003d236daee8b7aca39c62708b18d59bced0bc03/pandas_profiling/base.py#L63-L123 | train | Infer the type of a variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | c7n/filters/core.py | FilterRegistry.factory | def factory(self, data, manager=None):
"""Factory func for filters.
data - policy config for filters
manager - resource type manager (ec2, s3, etc)
"""
# Make the syntax a little nicer for common cases.
if isinstance(data, dict) and len(data) == 1 and 'type' not in data... | python | def factory(self, data, manager=None):
"""Factory func for filters.
data - policy config for filters
manager - resource type manager (ec2, s3, etc)
"""
# Make the syntax a little nicer for common cases.
if isinstance(data, dict) and len(data) == 1 and 'type' not in data... | [
"def",
"factory",
"(",
"self",
",",
"data",
",",
"manager",
"=",
"None",
")",
":",
"# Make the syntax a little nicer for common cases.",
"if",
"isinstance",
"(",
"data",
",",
"dict",
")",
"and",
"len",
"(",
"data",
")",
"==",
"1",
"and",
"'type'",
"not",
"... | Factory func for filters.
data - policy config for filters
manager - resource type manager (ec2, s3, etc) | [
"Factory",
"func",
"for",
"filters",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/filters/core.py#L132-L164 | train | Factory function for filters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | c7n/filters/core.py | Filter.get_block_operator | def get_block_operator(self):
"""Determine the immediate parent boolean operator for a filter"""
# Top level operator is `and`
block_stack = ['and']
for f in self.manager.iter_filters(block_end=True):
if f is None:
block_stack.pop()
continue
... | python | def get_block_operator(self):
"""Determine the immediate parent boolean operator for a filter"""
# Top level operator is `and`
block_stack = ['and']
for f in self.manager.iter_filters(block_end=True):
if f is None:
block_stack.pop()
continue
... | [
"def",
"get_block_operator",
"(",
"self",
")",
":",
"# Top level operator is `and`",
"block_stack",
"=",
"[",
"'and'",
"]",
"for",
"f",
"in",
"self",
".",
"manager",
".",
"iter_filters",
"(",
"block_end",
"=",
"True",
")",
":",
"if",
"f",
"is",
"None",
":"... | Determine the immediate parent boolean operator for a filter | [
"Determine",
"the",
"immediate",
"parent",
"boolean",
"operator",
"for",
"a",
"filter"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/filters/core.py#L198-L210 | train | Determine the immediate parent boolean operator for a filter | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | c7n/filters/core.py | ValueFilter._validate_resource_count | def _validate_resource_count(self):
""" Specific validation for `resource_count` type
The `resource_count` type works a little differently because it operates
on the entire set of resources. It:
- does not require `key`
- `value` must be a number
- supports a subs... | python | def _validate_resource_count(self):
""" Specific validation for `resource_count` type
The `resource_count` type works a little differently because it operates
on the entire set of resources. It:
- does not require `key`
- `value` must be a number
- supports a subs... | [
"def",
"_validate_resource_count",
"(",
"self",
")",
":",
"for",
"field",
"in",
"(",
"'op'",
",",
"'value'",
")",
":",
"if",
"field",
"not",
"in",
"self",
".",
"data",
":",
"raise",
"PolicyValidationError",
"(",
"\"Missing '%s' in value filter %s\"",
"%",
"(",... | Specific validation for `resource_count` type
The `resource_count` type works a little differently because it operates
on the entire set of resources. It:
- does not require `key`
- `value` must be a number
- supports a subset of the OPERATORS list | [
"Specific",
"validation",
"for",
"resource_count",
"type"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/filters/core.py#L387-L411 | train | Specific validation for resource_count type | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_salactus/c7n_salactus/inventory.py | load_manifest_file | def load_manifest_file(client, bucket, schema, versioned, ifilters, key_info):
"""Given an inventory csv file, return an iterator over keys
"""
# To avoid thundering herd downloads, we do an immediate yield for
# interspersed i/o
yield None
# Inline these values to avoid the local var lookup, t... | python | def load_manifest_file(client, bucket, schema, versioned, ifilters, key_info):
"""Given an inventory csv file, return an iterator over keys
"""
# To avoid thundering herd downloads, we do an immediate yield for
# interspersed i/o
yield None
# Inline these values to avoid the local var lookup, t... | [
"def",
"load_manifest_file",
"(",
"client",
",",
"bucket",
",",
"schema",
",",
"versioned",
",",
"ifilters",
",",
"key_info",
")",
":",
"# To avoid thundering herd downloads, we do an immediate yield for",
"# interspersed i/o",
"yield",
"None",
"# Inline these values to avoid... | Given an inventory csv file, return an iterator over keys | [
"Given",
"an",
"inventory",
"csv",
"file",
"return",
"an",
"iterator",
"over",
"keys"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_salactus/c7n_salactus/inventory.py#L32-L62 | train | Given an inventory csv file return an iterator over keys
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_salactus/c7n_salactus/inventory.py | load_bucket_inventory | def load_bucket_inventory(
client, inventory_bucket, inventory_prefix, versioned, ifilters):
"""Given an inventory location for a bucket, return an iterator over keys
on the most recent delivered manifest.
"""
now = datetime.datetime.now()
key_prefix = "%s/%s" % (inventory_prefix, now.strft... | python | def load_bucket_inventory(
client, inventory_bucket, inventory_prefix, versioned, ifilters):
"""Given an inventory location for a bucket, return an iterator over keys
on the most recent delivered manifest.
"""
now = datetime.datetime.now()
key_prefix = "%s/%s" % (inventory_prefix, now.strft... | [
"def",
"load_bucket_inventory",
"(",
"client",
",",
"inventory_bucket",
",",
"inventory_prefix",
",",
"versioned",
",",
"ifilters",
")",
":",
"now",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"key_prefix",
"=",
"\"%s/%s\"",
"%",
"(",
"inventory_pr... | Given an inventory location for a bucket, return an iterator over keys
on the most recent delivered manifest. | [
"Given",
"an",
"inventory",
"location",
"for",
"a",
"bucket",
"return",
"an",
"iterator",
"over",
"keys"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_salactus/c7n_salactus/inventory.py#L75-L102 | train | Given an inventory location for a bucket return an iterator over keys
on the most recent delivered manifest. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_salactus/c7n_salactus/inventory.py | random_chain | def random_chain(generators):
"""Generator to generate a set of keys from
from a set of generators, each generator is selected
at random and consumed to exhaustion.
"""
while generators:
g = random.choice(generators)
try:
v = g.next()
if v is None:
... | python | def random_chain(generators):
"""Generator to generate a set of keys from
from a set of generators, each generator is selected
at random and consumed to exhaustion.
"""
while generators:
g = random.choice(generators)
try:
v = g.next()
if v is None:
... | [
"def",
"random_chain",
"(",
"generators",
")",
":",
"while",
"generators",
":",
"g",
"=",
"random",
".",
"choice",
"(",
"generators",
")",
"try",
":",
"v",
"=",
"g",
".",
"next",
"(",
")",
"if",
"v",
"is",
"None",
":",
"continue",
"yield",
"v",
"ex... | Generator to generate a set of keys from
from a set of generators, each generator is selected
at random and consumed to exhaustion. | [
"Generator",
"to",
"generate",
"a",
"set",
"of",
"keys",
"from",
"from",
"a",
"set",
"of",
"generators",
"each",
"generator",
"is",
"selected",
"at",
"random",
"and",
"consumed",
"to",
"exhaustion",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_salactus/c7n_salactus/inventory.py#L105-L118 | train | Generator to generate a set of keys from a set of generators | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_salactus/c7n_salactus/inventory.py | get_bucket_inventory | def get_bucket_inventory(client, bucket, inventory_id):
"""Check a bucket for a named inventory, and return the destination."""
inventories = client.list_bucket_inventory_configurations(
Bucket=bucket).get('InventoryConfigurationList', [])
inventories = {i['Id']: i for i in inventories}
found = ... | python | def get_bucket_inventory(client, bucket, inventory_id):
"""Check a bucket for a named inventory, and return the destination."""
inventories = client.list_bucket_inventory_configurations(
Bucket=bucket).get('InventoryConfigurationList', [])
inventories = {i['Id']: i for i in inventories}
found = ... | [
"def",
"get_bucket_inventory",
"(",
"client",
",",
"bucket",
",",
"inventory_id",
")",
":",
"inventories",
"=",
"client",
".",
"list_bucket_inventory_configurations",
"(",
"Bucket",
"=",
"bucket",
")",
".",
"get",
"(",
"'InventoryConfigurationList'",
",",
"[",
"]"... | Check a bucket for a named inventory, and return the destination. | [
"Check",
"a",
"bucket",
"for",
"a",
"named",
"inventory",
"and",
"return",
"the",
"destination",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_salactus/c7n_salactus/inventory.py#L121-L133 | train | Check a bucket for a named inventory and return the destination. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/sandbox/c7n_autodoc/c7n-autodoc.py | create_html_file | def create_html_file(config):
""" You can customize the automated documentation by altering
the code directly in this script or the associated jinja2 template
"""
logging.debug("Starting create_html_file")
logging.debug(
"\tjinja2_template_file = {}"
.format(config['jinja2_templa... | python | def create_html_file(config):
""" You can customize the automated documentation by altering
the code directly in this script or the associated jinja2 template
"""
logging.debug("Starting create_html_file")
logging.debug(
"\tjinja2_template_file = {}"
.format(config['jinja2_templa... | [
"def",
"create_html_file",
"(",
"config",
")",
":",
"logging",
".",
"debug",
"(",
"\"Starting create_html_file\"",
")",
"logging",
".",
"debug",
"(",
"\"\\tjinja2_template_file = {}\"",
".",
"format",
"(",
"config",
"[",
"'jinja2_template_filename'",
"]",
")",
")",
... | You can customize the automated documentation by altering
the code directly in this script or the associated jinja2 template | [
"You",
"can",
"customize",
"the",
"automated",
"documentation",
"by",
"altering",
"the",
"code",
"directly",
"in",
"this",
"script",
"or",
"the",
"associated",
"jinja2",
"template"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/sandbox/c7n_autodoc/c7n-autodoc.py#L28-L65 | train | Create a new HTML file for the current language. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/sandbox/c7n_autodoc/c7n-autodoc.py | get_file_url | def get_file_url(path, config):
""" Update this function to help build the link to your file
"""
file_url_regex = re.compile(config['file_url_regex'])
new_path = re.sub(file_url_regex, config['file_url_base'], path)
return new_path | python | def get_file_url(path, config):
""" Update this function to help build the link to your file
"""
file_url_regex = re.compile(config['file_url_regex'])
new_path = re.sub(file_url_regex, config['file_url_base'], path)
return new_path | [
"def",
"get_file_url",
"(",
"path",
",",
"config",
")",
":",
"file_url_regex",
"=",
"re",
".",
"compile",
"(",
"config",
"[",
"'file_url_regex'",
"]",
")",
"new_path",
"=",
"re",
".",
"sub",
"(",
"file_url_regex",
",",
"config",
"[",
"'file_url_base'",
"]"... | Update this function to help build the link to your file | [
"Update",
"this",
"function",
"to",
"help",
"build",
"the",
"link",
"to",
"your",
"file"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/sandbox/c7n_autodoc/c7n-autodoc.py#L68-L73 | train | Update this function to help build the link to your file
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/sandbox/c7n_autodoc/c7n-autodoc.py | gather_file_data | def gather_file_data(config):
""" Gather policy information from files
"""
file_regex = re.compile(config['file_regex'])
category_regex = re.compile(config['category_regex'])
policies = {}
for root, dirs, files in os.walk(config['c7n_policy_directory']):
for file in files:
i... | python | def gather_file_data(config):
""" Gather policy information from files
"""
file_regex = re.compile(config['file_regex'])
category_regex = re.compile(config['category_regex'])
policies = {}
for root, dirs, files in os.walk(config['c7n_policy_directory']):
for file in files:
i... | [
"def",
"gather_file_data",
"(",
"config",
")",
":",
"file_regex",
"=",
"re",
".",
"compile",
"(",
"config",
"[",
"'file_regex'",
"]",
")",
"category_regex",
"=",
"re",
".",
"compile",
"(",
"config",
"[",
"'category_regex'",
"]",
")",
"policies",
"=",
"{",
... | Gather policy information from files | [
"Gather",
"policy",
"information",
"from",
"files"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/sandbox/c7n_autodoc/c7n-autodoc.py#L76-L108 | train | Gather policy information from files
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/sandbox/c7n_autodoc/c7n-autodoc.py | upload_to_s3 | def upload_to_s3(file_path, config):
""" Upload html file to S3
"""
logging.info("Uploading file to S3 bucket: %s", config['s3_bucket_name'])
s3 = boto3.resource('s3')
s3_filename = config['s3_bucket_path'] + config['rendered_filename']
s3.Bucket(config['s3_bucket_name']).upload_file(
fi... | python | def upload_to_s3(file_path, config):
""" Upload html file to S3
"""
logging.info("Uploading file to S3 bucket: %s", config['s3_bucket_name'])
s3 = boto3.resource('s3')
s3_filename = config['s3_bucket_path'] + config['rendered_filename']
s3.Bucket(config['s3_bucket_name']).upload_file(
fi... | [
"def",
"upload_to_s3",
"(",
"file_path",
",",
"config",
")",
":",
"logging",
".",
"info",
"(",
"\"Uploading file to S3 bucket: %s\"",
",",
"config",
"[",
"'s3_bucket_name'",
"]",
")",
"s3",
"=",
"boto3",
".",
"resource",
"(",
"'s3'",
")",
"s3_filename",
"=",
... | Upload html file to S3 | [
"Upload",
"html",
"file",
"to",
"S3"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/sandbox/c7n_autodoc/c7n-autodoc.py#L111-L119 | train | Upload html file to S3 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | github_repos | def github_repos(organization, github_url, github_token):
"""Return all github repositories in an organization."""
# Get github repos
headers = {"Authorization": "token {}".format(github_token)}
next_cursor = None
while next_cursor is not False:
params = {'query': query, 'variables': {
... | python | def github_repos(organization, github_url, github_token):
"""Return all github repositories in an organization."""
# Get github repos
headers = {"Authorization": "token {}".format(github_token)}
next_cursor = None
while next_cursor is not False:
params = {'query': query, 'variables': {
... | [
"def",
"github_repos",
"(",
"organization",
",",
"github_url",
",",
"github_token",
")",
":",
"# Get github repos",
"headers",
"=",
"{",
"\"Authorization\"",
":",
"\"token {}\"",
".",
"format",
"(",
"github_token",
")",
"}",
"next_cursor",
"=",
"None",
"while",
... | Return all github repositories in an organization. | [
"Return",
"all",
"github",
"repositories",
"in",
"an",
"organization",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L671-L696 | train | Return all github repositories in an organization. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | org_stream | def org_stream(ctx, organization, github_url, github_token, clone_dir,
verbose, filter, exclude, stream_uri, assume):
"""Stream changes for repos in a GitHub organization.
"""
logging.basicConfig(
format="%(asctime)s: %(name)s:%(levelname)s %(message)s",
level=(verbose and log... | python | def org_stream(ctx, organization, github_url, github_token, clone_dir,
verbose, filter, exclude, stream_uri, assume):
"""Stream changes for repos in a GitHub organization.
"""
logging.basicConfig(
format="%(asctime)s: %(name)s:%(levelname)s %(message)s",
level=(verbose and log... | [
"def",
"org_stream",
"(",
"ctx",
",",
"organization",
",",
"github_url",
",",
"github_token",
",",
"clone_dir",
",",
"verbose",
",",
"filter",
",",
"exclude",
",",
"stream_uri",
",",
"assume",
")",
":",
"logging",
".",
"basicConfig",
"(",
"format",
"=",
"\... | Stream changes for repos in a GitHub organization. | [
"Stream",
"changes",
"for",
"repos",
"in",
"a",
"GitHub",
"organization",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L716-L744 | train | Stream changes for repos in a GitHub organization. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | org_checkout | def org_checkout(organization, github_url, github_token, clone_dir,
verbose, filter, exclude):
"""Checkout repositories from a GitHub organization."""
logging.basicConfig(
format="%(asctime)s: %(name)s:%(levelname)s %(message)s",
level=(verbose and logging.DEBUG or logging.INFO)... | python | def org_checkout(organization, github_url, github_token, clone_dir,
verbose, filter, exclude):
"""Checkout repositories from a GitHub organization."""
logging.basicConfig(
format="%(asctime)s: %(name)s:%(levelname)s %(message)s",
level=(verbose and logging.DEBUG or logging.INFO)... | [
"def",
"org_checkout",
"(",
"organization",
",",
"github_url",
",",
"github_token",
",",
"clone_dir",
",",
"verbose",
",",
"filter",
",",
"exclude",
")",
":",
"logging",
".",
"basicConfig",
"(",
"format",
"=",
"\"%(asctime)s: %(name)s:%(levelname)s %(message)s\"",
"... | Checkout repositories from a GitHub organization. | [
"Checkout",
"repositories",
"from",
"a",
"GitHub",
"organization",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L758-L801 | train | Checkout repositories from a GitHub organization. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | diff | def diff(repo_uri, source, target, output, verbose):
"""Policy diff between two arbitrary revisions.
Revision specifiers for source and target can use fancy git refspec syntax
for symbolics, dates, etc.
See: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
Default revision selection is... | python | def diff(repo_uri, source, target, output, verbose):
"""Policy diff between two arbitrary revisions.
Revision specifiers for source and target can use fancy git refspec syntax
for symbolics, dates, etc.
See: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
Default revision selection is... | [
"def",
"diff",
"(",
"repo_uri",
",",
"source",
",",
"target",
",",
"output",
",",
"verbose",
")",
":",
"logging",
".",
"basicConfig",
"(",
"format",
"=",
"\"%(asctime)s: %(name)s:%(levelname)s %(message)s\"",
",",
"level",
"=",
"(",
"verbose",
"and",
"logging",
... | Policy diff between two arbitrary revisions.
Revision specifiers for source and target can use fancy git refspec syntax
for symbolics, dates, etc.
See: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
Default revision selection is dependent on current working tree
branch. The intent is... | [
"Policy",
"diff",
"between",
"two",
"arbitrary",
"revisions",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L842-L885 | train | Policy diff between two arbitrary revisions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | stream | def stream(repo_uri, stream_uri, verbose, assume, sort, before=None, after=None):
"""Stream git history policy changes to destination.
Default stream destination is a summary of the policy changes to stdout, one
per line. Also supported for stdout streaming is `jsonline`.
AWS Kinesis and SQS destinat... | python | def stream(repo_uri, stream_uri, verbose, assume, sort, before=None, after=None):
"""Stream git history policy changes to destination.
Default stream destination is a summary of the policy changes to stdout, one
per line. Also supported for stdout streaming is `jsonline`.
AWS Kinesis and SQS destinat... | [
"def",
"stream",
"(",
"repo_uri",
",",
"stream_uri",
",",
"verbose",
",",
"assume",
",",
"sort",
",",
"before",
"=",
"None",
",",
"after",
"=",
"None",
")",
":",
"logging",
".",
"basicConfig",
"(",
"format",
"=",
"\"%(asctime)s: %(name)s:%(levelname)s %(messag... | Stream git history policy changes to destination.
Default stream destination is a summary of the policy changes to stdout, one
per line. Also supported for stdout streaming is `jsonline`.
AWS Kinesis and SQS destinations are specified by providing the ARN.
Database destinations are supported by prov... | [
"Stream",
"git",
"history",
"policy",
"changes",
"to",
"destination",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L901-L949 | train | Stream git history policy changes to a local file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | PolicyCollection.select | def select(self, names):
"""return the named subset of policies"""
return PolicyCollection(
[p for p in self.policies if p.name in names], self.options) | python | def select(self, names):
"""return the named subset of policies"""
return PolicyCollection(
[p for p in self.policies if p.name in names], self.options) | [
"def",
"select",
"(",
"self",
",",
"names",
")",
":",
"return",
"PolicyCollection",
"(",
"[",
"p",
"for",
"p",
"in",
"self",
".",
"policies",
"if",
"p",
".",
"name",
"in",
"names",
"]",
",",
"self",
".",
"options",
")"
] | return the named subset of policies | [
"return",
"the",
"named",
"subset",
"of",
"policies"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L220-L223 | train | return the named subset of policies | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | PolicyRepo.delta_commits | def delta_commits(self, baseline, target):
"""Show policies changes between arbitrary commits.
The common use form is comparing the heads of two branches.
"""
baseline_files = self._get_policy_fents(baseline.tree)
target_files = self._get_policy_fents(target.tree)
basel... | python | def delta_commits(self, baseline, target):
"""Show policies changes between arbitrary commits.
The common use form is comparing the heads of two branches.
"""
baseline_files = self._get_policy_fents(baseline.tree)
target_files = self._get_policy_fents(target.tree)
basel... | [
"def",
"delta_commits",
"(",
"self",
",",
"baseline",
",",
"target",
")",
":",
"baseline_files",
"=",
"self",
".",
"_get_policy_fents",
"(",
"baseline",
".",
"tree",
")",
"target_files",
"=",
"self",
".",
"_get_policy_fents",
"(",
"target",
".",
"tree",
")",... | Show policies changes between arbitrary commits.
The common use form is comparing the heads of two branches. | [
"Show",
"policies",
"changes",
"between",
"arbitrary",
"commits",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L298-L325 | train | Show policies changes between arbitrary commits. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | PolicyRepo.delta_stream | def delta_stream(self, target='HEAD', limit=None,
sort=pygit2.GIT_SORT_TIME | pygit2.GIT_SORT_REVERSE,
after=None, before=None):
"""Return an iterator of policy changes along a commit lineage in a repo.
"""
if target == 'HEAD':
target = self.... | python | def delta_stream(self, target='HEAD', limit=None,
sort=pygit2.GIT_SORT_TIME | pygit2.GIT_SORT_REVERSE,
after=None, before=None):
"""Return an iterator of policy changes along a commit lineage in a repo.
"""
if target == 'HEAD':
target = self.... | [
"def",
"delta_stream",
"(",
"self",
",",
"target",
"=",
"'HEAD'",
",",
"limit",
"=",
"None",
",",
"sort",
"=",
"pygit2",
".",
"GIT_SORT_TIME",
"|",
"pygit2",
".",
"GIT_SORT_REVERSE",
",",
"after",
"=",
"None",
",",
"before",
"=",
"None",
")",
":",
"if"... | Return an iterator of policy changes along a commit lineage in a repo. | [
"Return",
"an",
"iterator",
"of",
"policy",
"changes",
"along",
"a",
"commit",
"lineage",
"in",
"a",
"repo",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L327-L356 | train | Return an iterator of policy changes along a commit lineage in a repo. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | PolicyRepo._process_stream_delta | def _process_stream_delta(self, delta_stream):
"""Bookkeeping on internal data structures while iterating a stream."""
for pchange in delta_stream:
if pchange.kind == ChangeType.ADD:
self.policy_files.setdefault(
pchange.file_path, PolicyCollection()).add(... | python | def _process_stream_delta(self, delta_stream):
"""Bookkeeping on internal data structures while iterating a stream."""
for pchange in delta_stream:
if pchange.kind == ChangeType.ADD:
self.policy_files.setdefault(
pchange.file_path, PolicyCollection()).add(... | [
"def",
"_process_stream_delta",
"(",
"self",
",",
"delta_stream",
")",
":",
"for",
"pchange",
"in",
"delta_stream",
":",
"if",
"pchange",
".",
"kind",
"==",
"ChangeType",
".",
"ADD",
":",
"self",
".",
"policy_files",
".",
"setdefault",
"(",
"pchange",
".",
... | Bookkeeping on internal data structures while iterating a stream. | [
"Bookkeeping",
"on",
"internal",
"data",
"structures",
"while",
"iterating",
"a",
"stream",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L437-L456 | train | Iterates over the delta_stream and adds or removes the new entries. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | Transport.send | def send(self, change):
"""send the given policy change"""
self.buf.append(change)
if len(self.buf) % self.BUF_SIZE == 0:
self.flush() | python | def send(self, change):
"""send the given policy change"""
self.buf.append(change)
if len(self.buf) % self.BUF_SIZE == 0:
self.flush() | [
"def",
"send",
"(",
"self",
",",
"change",
")",
":",
"self",
".",
"buf",
".",
"append",
"(",
"change",
")",
"if",
"len",
"(",
"self",
".",
"buf",
")",
"%",
"self",
".",
"BUF_SIZE",
"==",
"0",
":",
"self",
".",
"flush",
"(",
")"
] | send the given policy change | [
"send",
"the",
"given",
"policy",
"change"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L487-L491 | train | send the given policy change | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_policystream/policystream.py | Transport.flush | def flush(self):
"""flush any buffered messages"""
buf = self.buf
self.buf = []
if buf:
self._flush(buf) | python | def flush(self):
"""flush any buffered messages"""
buf = self.buf
self.buf = []
if buf:
self._flush(buf) | [
"def",
"flush",
"(",
"self",
")",
":",
"buf",
"=",
"self",
".",
"buf",
"self",
".",
"buf",
"=",
"[",
"]",
"if",
"buf",
":",
"self",
".",
"_flush",
"(",
"buf",
")"
] | flush any buffered messages | [
"flush",
"any",
"buffered",
"messages"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_policystream/policystream.py#L493-L498 | train | flush any buffered messages | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_logexporter/c7n_logexporter/flowdeliver.py | process_firehose_archive | def process_firehose_archive(bucket, key):
"""Download firehose archive, aggregate records in memory and write back."""
data = {}
with tempfile.NamedTemporaryFile(mode='w+b') as fh:
s3.download_file(bucket, key, fh.name)
log.warning("Downloaded Key Size:%s Key:%s",
sizeof... | python | def process_firehose_archive(bucket, key):
"""Download firehose archive, aggregate records in memory and write back."""
data = {}
with tempfile.NamedTemporaryFile(mode='w+b') as fh:
s3.download_file(bucket, key, fh.name)
log.warning("Downloaded Key Size:%s Key:%s",
sizeof... | [
"def",
"process_firehose_archive",
"(",
"bucket",
",",
"key",
")",
":",
"data",
"=",
"{",
"}",
"with",
"tempfile",
".",
"NamedTemporaryFile",
"(",
"mode",
"=",
"'w+b'",
")",
"as",
"fh",
":",
"s3",
".",
"download_file",
"(",
"bucket",
",",
"key",
",",
"... | Download firehose archive, aggregate records in memory and write back. | [
"Download",
"firehose",
"archive",
"aggregate",
"records",
"in",
"memory",
"and",
"write",
"back",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_logexporter/c7n_logexporter/flowdeliver.py#L64-L93 | train | Download firehose archive and aggregate records in memory and write back. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/c7n_logexporter/c7n_logexporter/flowdeliver.py | records_iter | def records_iter(fh, buffer_size=1024 * 1024 * 16):
"""Split up a firehose s3 object into records
Firehose cloudwatch log delivery of flow logs does not delimit
record boundaries. We have to use knowledge of content to split
the records on boundaries. In the context of flow logs we're
dealing with ... | python | def records_iter(fh, buffer_size=1024 * 1024 * 16):
"""Split up a firehose s3 object into records
Firehose cloudwatch log delivery of flow logs does not delimit
record boundaries. We have to use knowledge of content to split
the records on boundaries. In the context of flow logs we're
dealing with ... | [
"def",
"records_iter",
"(",
"fh",
",",
"buffer_size",
"=",
"1024",
"*",
"1024",
"*",
"16",
")",
":",
"buf",
"=",
"None",
"while",
"True",
":",
"chunk",
"=",
"fh",
".",
"read",
"(",
"buffer_size",
")",
"if",
"not",
"chunk",
":",
"if",
"buf",
":",
... | Split up a firehose s3 object into records
Firehose cloudwatch log delivery of flow logs does not delimit
record boundaries. We have to use knowledge of content to split
the records on boundaries. In the context of flow logs we're
dealing with delimited records. | [
"Split",
"up",
"a",
"firehose",
"s3",
"object",
"into",
"records"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/c7n_logexporter/c7n_logexporter/flowdeliver.py#L138-L164 | train | Iterate over the records in a firehose s3 object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | tools/sandbox/c7n_sphere11/c7n_sphere11/controller.py | Controller.get_session | def get_session(self, account_id):
"""Get an active session in the target account."""
if account_id not in self.account_sessions:
if account_id not in self.config['accounts']:
raise AccountNotFound("account:%s is unknown" % account_id)
self.account_sessions[accou... | python | def get_session(self, account_id):
"""Get an active session in the target account."""
if account_id not in self.account_sessions:
if account_id not in self.config['accounts']:
raise AccountNotFound("account:%s is unknown" % account_id)
self.account_sessions[accou... | [
"def",
"get_session",
"(",
"self",
",",
"account_id",
")",
":",
"if",
"account_id",
"not",
"in",
"self",
".",
"account_sessions",
":",
"if",
"account_id",
"not",
"in",
"self",
".",
"config",
"[",
"'accounts'",
"]",
":",
"raise",
"AccountNotFound",
"(",
"\"... | Get an active session in the target account. | [
"Get",
"an",
"active",
"session",
"in",
"the",
"target",
"account",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/tools/sandbox/c7n_sphere11/c7n_sphere11/controller.py#L50-L60 | train | Get an active session in the target account. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | c7n/schema.py | policy_error_scope | def policy_error_scope(error, data):
"""Scope a schema error to its policy name and resource."""
err_path = list(error.absolute_path)
if err_path[0] != 'policies':
return error
pdata = data['policies'][err_path[1]]
pdata.get('name', 'unknown')
error.message = "Error on policy:{} resource... | python | def policy_error_scope(error, data):
"""Scope a schema error to its policy name and resource."""
err_path = list(error.absolute_path)
if err_path[0] != 'policies':
return error
pdata = data['policies'][err_path[1]]
pdata.get('name', 'unknown')
error.message = "Error on policy:{} resource... | [
"def",
"policy_error_scope",
"(",
"error",
",",
"data",
")",
":",
"err_path",
"=",
"list",
"(",
"error",
".",
"absolute_path",
")",
"if",
"err_path",
"[",
"0",
"]",
"!=",
"'policies'",
":",
"return",
"error",
"pdata",
"=",
"data",
"[",
"'policies'",
"]",... | Scope a schema error to its policy name and resource. | [
"Scope",
"a",
"schema",
"error",
"to",
"its",
"policy",
"name",
"and",
"resource",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/schema.py#L82-L91 | train | Scope a schema error to its policy name and resource. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | c7n/schema.py | specific_error | def specific_error(error):
"""Try to find the best error for humans to resolve
The jsonschema.exceptions.best_match error is based purely on a
mix of a strong match (ie. not anyOf, oneOf) and schema depth,
this often yields odd results that are semantically confusing,
instead we can use a bit of st... | python | def specific_error(error):
"""Try to find the best error for humans to resolve
The jsonschema.exceptions.best_match error is based purely on a
mix of a strong match (ie. not anyOf, oneOf) and schema depth,
this often yields odd results that are semantically confusing,
instead we can use a bit of st... | [
"def",
"specific_error",
"(",
"error",
")",
":",
"if",
"error",
".",
"validator",
"not",
"in",
"(",
"'anyOf'",
",",
"'oneOf'",
")",
":",
"return",
"error",
"r",
"=",
"t",
"=",
"None",
"if",
"isinstance",
"(",
"error",
".",
"instance",
",",
"dict",
")... | Try to find the best error for humans to resolve
The jsonschema.exceptions.best_match error is based purely on a
mix of a strong match (ie. not anyOf, oneOf) and schema depth,
this often yields odd results that are semantically confusing,
instead we can use a bit of structural knowledge of schema to
... | [
"Try",
"to",
"find",
"the",
"best",
"error",
"for",
"humans",
"to",
"resolve"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/schema.py#L94-L146 | train | Try to find the best error for humans to resolve | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | c7n/manager.py | ResourceManager.get_resource_manager | def get_resource_manager(self, resource_type, data=None):
"""get a resource manager or a given resource type.
assumes the query is for the same underlying cloud provider.
"""
if '.' in resource_type:
provider_name, resource_type = resource_type.split('.', 1)
else:
... | python | def get_resource_manager(self, resource_type, data=None):
"""get a resource manager or a given resource type.
assumes the query is for the same underlying cloud provider.
"""
if '.' in resource_type:
provider_name, resource_type = resource_type.split('.', 1)
else:
... | [
"def",
"get_resource_manager",
"(",
"self",
",",
"resource_type",
",",
"data",
"=",
"None",
")",
":",
"if",
"'.'",
"in",
"resource_type",
":",
"provider_name",
",",
"resource_type",
"=",
"resource_type",
".",
"split",
"(",
"'.'",
",",
"1",
")",
"else",
":"... | get a resource manager or a given resource type.
assumes the query is for the same underlying cloud provider. | [
"get",
"a",
"resource",
"manager",
"or",
"a",
"given",
"resource",
"type",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/manager.py#L76-L95 | train | get a resource manager or a given resource type | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | c7n/resources/elasticbeanstalk.py | _eb_env_tags | def _eb_env_tags(envs, session_factory, retry):
"""Augment ElasticBeanstalk Environments with their tags."""
client = local_session(session_factory).client('elasticbeanstalk')
def process_tags(eb_env):
try:
eb_env['Tags'] = retry(
client.list_tags_for_resource,
... | python | def _eb_env_tags(envs, session_factory, retry):
"""Augment ElasticBeanstalk Environments with their tags."""
client = local_session(session_factory).client('elasticbeanstalk')
def process_tags(eb_env):
try:
eb_env['Tags'] = retry(
client.list_tags_for_resource,
... | [
"def",
"_eb_env_tags",
"(",
"envs",
",",
"session_factory",
",",
"retry",
")",
":",
"client",
"=",
"local_session",
"(",
"session_factory",
")",
".",
"client",
"(",
"'elasticbeanstalk'",
")",
"def",
"process_tags",
"(",
"eb_env",
")",
":",
"try",
":",
"eb_en... | Augment ElasticBeanstalk Environments with their tags. | [
"Augment",
"ElasticBeanstalk",
"Environments",
"with",
"their",
"tags",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/resources/elasticbeanstalk.py#L77-L93 | train | Augment ElasticBeanstalk Environments with their tags. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | c7n/resources/s3.py | assemble_bucket | def assemble_bucket(item):
"""Assemble a document representing all the config state around a bucket.
TODO: Refactor this, the logic here feels quite muddled.
"""
factory, b = item
s = factory()
c = s.client('s3')
# Bucket Location, Current Client Location, Default Location
b_location = ... | python | def assemble_bucket(item):
"""Assemble a document representing all the config state around a bucket.
TODO: Refactor this, the logic here feels quite muddled.
"""
factory, b = item
s = factory()
c = s.client('s3')
# Bucket Location, Current Client Location, Default Location
b_location = ... | [
"def",
"assemble_bucket",
"(",
"item",
")",
":",
"factory",
",",
"b",
"=",
"item",
"s",
"=",
"factory",
"(",
")",
"c",
"=",
"s",
".",
"client",
"(",
"'s3'",
")",
"# Bucket Location, Current Client Location, Default Location",
"b_location",
"=",
"c_location",
"... | Assemble a document representing all the config state around a bucket.
TODO: Refactor this, the logic here feels quite muddled. | [
"Assemble",
"a",
"document",
"representing",
"all",
"the",
"config",
"state",
"around",
"a",
"bucket",
"."
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/resources/s3.py#L406-L473 | train | Assemble a document representing all the config state around a bucket. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
cloud-custodian/cloud-custodian | c7n/resources/s3.py | get_region | def get_region(b):
"""Tries to get the bucket region from Location.LocationConstraint
Special cases:
LocationConstraint EU defaults to eu-west-1
LocationConstraint null defaults to us-east-1
Args:
b (object): A bucket object
Returns:
string: an aws region string
""... | python | def get_region(b):
"""Tries to get the bucket region from Location.LocationConstraint
Special cases:
LocationConstraint EU defaults to eu-west-1
LocationConstraint null defaults to us-east-1
Args:
b (object): A bucket object
Returns:
string: an aws region string
""... | [
"def",
"get_region",
"(",
"b",
")",
":",
"remap",
"=",
"{",
"None",
":",
"'us-east-1'",
",",
"'EU'",
":",
"'eu-west-1'",
"}",
"region",
"=",
"b",
".",
"get",
"(",
"'Location'",
",",
"{",
"}",
")",
".",
"get",
"(",
"'LocationConstraint'",
")",
"return... | Tries to get the bucket region from Location.LocationConstraint
Special cases:
LocationConstraint EU defaults to eu-west-1
LocationConstraint null defaults to us-east-1
Args:
b (object): A bucket object
Returns:
string: an aws region string | [
"Tries",
"to",
"get",
"the",
"bucket",
"region",
"from",
"Location",
".",
"LocationConstraint"
] | 52ef732eb3d7bc939d1579faf519314814695c08 | https://github.com/cloud-custodian/cloud-custodian/blob/52ef732eb3d7bc939d1579faf519314814695c08/c7n/resources/s3.py#L531-L546 | train | Tries to get the region from Location. LocationConstraint EU defaults to us - east - 1 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.