partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
test
NNTPClient.list
LIST command. A wrapper for all of the other list commands. The output of this command depends on the keyword specified. The output format for each keyword can be found in the list function that corresponds to the keyword. Args: keyword: Information requested. a...
nntp/nntp.py
def list(self, keyword=None, arg=None): """LIST command. A wrapper for all of the other list commands. The output of this command depends on the keyword specified. The output format for each keyword can be found in the list function that corresponds to the keyword. Args: ...
def list(self, keyword=None, arg=None): """LIST command. A wrapper for all of the other list commands. The output of this command depends on the keyword specified. The output format for each keyword can be found in the list function that corresponds to the keyword. Args: ...
[ "LIST", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L931-L949
[ "def", "list", "(", "self", ",", "keyword", "=", "None", ",", "arg", "=", "None", ")", ":", "return", "[", "x", "for", "x", "in", "self", ".", "list_gen", "(", "keyword", ",", "arg", ")", "]" ]
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.group
GROUP command.
nntp/nntp.py
def group(self, name): """GROUP command. """ args = name code, message = self.command("GROUP", args) if code != 211: raise NNTPReplyError(code, message) parts = message.split(None, 4) try: total = int(parts[0]) first = int(par...
def group(self, name): """GROUP command. """ args = name code, message = self.command("GROUP", args) if code != 211: raise NNTPReplyError(code, message) parts = message.split(None, 4) try: total = int(parts[0]) first = int(par...
[ "GROUP", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L951-L969
[ "def", "group", "(", "self", ",", "name", ")", ":", "args", "=", "name", "code", ",", "message", "=", "self", ".", "command", "(", "\"GROUP\"", ",", "args", ")", "if", "code", "!=", "211", ":", "raise", "NNTPReplyError", "(", "code", ",", "message", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.next
NEXT command.
nntp/nntp.py
def next(self): """NEXT command. """ code, message = self.command("NEXT") if code != 223: raise NNTPReplyError(code, message) parts = message.split(None, 3) try: article = int(parts[0]) ident = parts[1] except (IndexError, Valu...
def next(self): """NEXT command. """ code, message = self.command("NEXT") if code != 223: raise NNTPReplyError(code, message) parts = message.split(None, 3) try: article = int(parts[0]) ident = parts[1] except (IndexError, Valu...
[ "NEXT", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L971-L985
[ "def", "next", "(", "self", ")", ":", "code", ",", "message", "=", "self", ".", "command", "(", "\"NEXT\"", ")", "if", "code", "!=", "223", ":", "raise", "NNTPReplyError", "(", "code", ",", "message", ")", "parts", "=", "message", ".", "split", "(", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.article
ARTICLE command.
nntp/nntp.py
def article(self, msgid_article=None, decode=None): """ARTICLE command. """ args = None if msgid_article is not None: args = utils.unparse_msgid_article(msgid_article) code, message = self.command("ARTICLE", args) if code != 220: raise NNTPReplyEr...
def article(self, msgid_article=None, decode=None): """ARTICLE command. """ args = None if msgid_article is not None: args = utils.unparse_msgid_article(msgid_article) code, message = self.command("ARTICLE", args) if code != 220: raise NNTPReplyEr...
[ "ARTICLE", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1004-L1042
[ "def", "article", "(", "self", ",", "msgid_article", "=", "None", ",", "decode", "=", "None", ")", ":", "args", "=", "None", "if", "msgid_article", "is", "not", "None", ":", "args", "=", "utils", ".", "unparse_msgid_article", "(", "msgid_article", ")", "...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.head
HEAD command.
nntp/nntp.py
def head(self, msgid_article=None): """HEAD command. """ args = None if msgid_article is not None: args = utils.unparse_msgid_article(msgid_article) code, message = self.command("HEAD", args) if code != 221: raise NNTPReplyError(code, message) ...
def head(self, msgid_article=None): """HEAD command. """ args = None if msgid_article is not None: args = utils.unparse_msgid_article(msgid_article) code, message = self.command("HEAD", args) if code != 221: raise NNTPReplyError(code, message) ...
[ "HEAD", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1044-L1055
[ "def", "head", "(", "self", ",", "msgid_article", "=", "None", ")", ":", "args", "=", "None", "if", "msgid_article", "is", "not", "None", ":", "args", "=", "utils", ".", "unparse_msgid_article", "(", "msgid_article", ")", "code", ",", "message", "=", "se...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.body
BODY command.
nntp/nntp.py
def body(self, msgid_article=None, decode=False): """BODY command. """ args = None if msgid_article is not None: args = utils.unparse_msgid_article(msgid_article) code, message = self.command("BODY", args) if code != 222: raise NNTPReplyError(code...
def body(self, msgid_article=None, decode=False): """BODY command. """ args = None if msgid_article is not None: args = utils.unparse_msgid_article(msgid_article) code, message = self.command("BODY", args) if code != 222: raise NNTPReplyError(code...
[ "BODY", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1058-L1084
[ "def", "body", "(", "self", ",", "msgid_article", "=", "None", ",", "decode", "=", "False", ")", ":", "args", "=", "None", "if", "msgid_article", "is", "not", "None", ":", "args", "=", "utils", ".", "unparse_msgid_article", "(", "msgid_article", ")", "co...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.xgtitle
XGTITLE command.
nntp/nntp.py
def xgtitle(self, pattern=None): """XGTITLE command. """ args = pattern code, message = self.command("XGTITLE", args) if code != 282: raise NNTPReplyError(code, message) return self.info(code, message)
def xgtitle(self, pattern=None): """XGTITLE command. """ args = pattern code, message = self.command("XGTITLE", args) if code != 282: raise NNTPReplyError(code, message) return self.info(code, message)
[ "XGTITLE", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1086-L1095
[ "def", "xgtitle", "(", "self", ",", "pattern", "=", "None", ")", ":", "args", "=", "pattern", "code", ",", "message", "=", "self", ".", "command", "(", "\"XGTITLE\"", ",", "args", ")", "if", "code", "!=", "282", ":", "raise", "NNTPReplyError", "(", "...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.xhdr
XHDR command.
nntp/nntp.py
def xhdr(self, header, msgid_range=None): """XHDR command. """ args = header if range is not None: args += " " + utils.unparse_msgid_range(msgid_range) code, message = self.command("XHDR", args) if code != 221: raise NNTPReplyError(code, message) ...
def xhdr(self, header, msgid_range=None): """XHDR command. """ args = header if range is not None: args += " " + utils.unparse_msgid_range(msgid_range) code, message = self.command("XHDR", args) if code != 221: raise NNTPReplyError(code, message) ...
[ "XHDR", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1097-L1108
[ "def", "xhdr", "(", "self", ",", "header", ",", "msgid_range", "=", "None", ")", ":", "args", "=", "header", "if", "range", "is", "not", "None", ":", "args", "+=", "\" \"", "+", "utils", ".", "unparse_msgid_range", "(", "msgid_range", ")", "code", ",",...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.xzhdr
XZHDR command. Args: msgid_range: A message-id as a string, or an article number as an integer, or a tuple of specifying a range of article numbers in the form (first, [last]) - if last is omitted then all articles after first are included. A msgid_ra...
nntp/nntp.py
def xzhdr(self, header, msgid_range=None): """XZHDR command. Args: msgid_range: A message-id as a string, or an article number as an integer, or a tuple of specifying a range of article numbers in the form (first, [last]) - if last is omitted then all article...
def xzhdr(self, header, msgid_range=None): """XZHDR command. Args: msgid_range: A message-id as a string, or an article number as an integer, or a tuple of specifying a range of article numbers in the form (first, [last]) - if last is omitted then all article...
[ "XZHDR", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1110-L1128
[ "def", "xzhdr", "(", "self", ",", "header", ",", "msgid_range", "=", "None", ")", ":", "args", "=", "header", "if", "msgid_range", "is", "not", "None", ":", "args", "+=", "\" \"", "+", "utils", ".", "unparse_msgid_range", "(", "msgid_range", ")", "code",...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.xover_gen
Generator for the XOVER command. The XOVER command returns information from the overview database for the article(s) specified. <http://tools.ietf.org/html/rfc2980#section-2.8> Args: range: An article number as an integer, or a tuple of specifying a range o...
nntp/nntp.py
def xover_gen(self, range=None): """Generator for the XOVER command. The XOVER command returns information from the overview database for the article(s) specified. <http://tools.ietf.org/html/rfc2980#section-2.8> Args: range: An article number as an integer, or a t...
def xover_gen(self, range=None): """Generator for the XOVER command. The XOVER command returns information from the overview database for the article(s) specified. <http://tools.ietf.org/html/rfc2980#section-2.8> Args: range: An article number as an integer, or a t...
[ "Generator", "for", "the", "XOVER", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1130-L1163
[ "def", "xover_gen", "(", "self", ",", "range", "=", "None", ")", ":", "args", "=", "None", "if", "range", "is", "not", "None", ":", "args", "=", "utils", ".", "unparse_range", "(", "range", ")", "code", ",", "message", "=", "self", ".", "command", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.xpat_gen
Generator for the XPAT command.
nntp/nntp.py
def xpat_gen(self, header, msgid_range, *pattern): """Generator for the XPAT command. """ args = " ".join( [header, utils.unparse_msgid_range(msgid_range)] + list(pattern) ) code, message = self.command("XPAT", args) if code != 221: raise NNTPRepl...
def xpat_gen(self, header, msgid_range, *pattern): """Generator for the XPAT command. """ args = " ".join( [header, utils.unparse_msgid_range(msgid_range)] + list(pattern) ) code, message = self.command("XPAT", args) if code != 221: raise NNTPRepl...
[ "Generator", "for", "the", "XPAT", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1258-L1270
[ "def", "xpat_gen", "(", "self", ",", "header", ",", "msgid_range", ",", "*", "pattern", ")", ":", "args", "=", "\" \"", ".", "join", "(", "[", "header", ",", "utils", ".", "unparse_msgid_range", "(", "msgid_range", ")", "]", "+", "list", "(", "pattern"...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.xpat
XPAT command.
nntp/nntp.py
def xpat(self, header, id_range, *pattern): """XPAT command. """ return [x for x in self.xpat_gen(header, id_range, *pattern)]
def xpat(self, header, id_range, *pattern): """XPAT command. """ return [x for x in self.xpat_gen(header, id_range, *pattern)]
[ "XPAT", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1272-L1275
[ "def", "xpat", "(", "self", ",", "header", ",", "id_range", ",", "*", "pattern", ")", ":", "return", "[", "x", "for", "x", "in", "self", ".", "xpat_gen", "(", "header", ",", "id_range", ",", "*", "pattern", ")", "]" ]
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.xfeature_compress_gzip
XFEATURE COMPRESS GZIP command.
nntp/nntp.py
def xfeature_compress_gzip(self, terminator=False): """XFEATURE COMPRESS GZIP command. """ args = "TERMINATOR" if terminator else None code, message = self.command("XFEATURE COMPRESS GZIP", args) if code != 290: raise NNTPReplyError(code, message) return Tru...
def xfeature_compress_gzip(self, terminator=False): """XFEATURE COMPRESS GZIP command. """ args = "TERMINATOR" if terminator else None code, message = self.command("XFEATURE COMPRESS GZIP", args) if code != 290: raise NNTPReplyError(code, message) return Tru...
[ "XFEATURE", "COMPRESS", "GZIP", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1277-L1286
[ "def", "xfeature_compress_gzip", "(", "self", ",", "terminator", "=", "False", ")", ":", "args", "=", "\"TERMINATOR\"", "if", "terminator", "else", "None", "code", ",", "message", "=", "self", ".", "command", "(", "\"XFEATURE COMPRESS GZIP\"", ",", "args", ")"...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
NNTPClient.post
POST command. Args: headers: A dictionary of headers. body: A string or file like object containing the post content. Raises: NNTPDataError: If binary characters are detected in the message body. Returns: A value that evaluates t...
nntp/nntp.py
def post(self, headers={}, body=""): """POST command. Args: headers: A dictionary of headers. body: A string or file like object containing the post content. Raises: NNTPDataError: If binary characters are detected in the message body. ...
def post(self, headers={}, body=""): """POST command. Args: headers: A dictionary of headers. body: A string or file like object containing the post content. Raises: NNTPDataError: If binary characters are detected in the message body. ...
[ "POST", "command", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/nntp.py#L1288-L1364
[ "def", "post", "(", "self", ",", "headers", "=", "{", "}", ",", "body", "=", "\"\"", ")", ":", "code", ",", "message", "=", "self", ".", "command", "(", "\"POST\"", ")", "if", "code", "!=", "340", ":", "raise", "NNTPReplyError", "(", "code", ",", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
_lower
assumes that classes that inherit list, tuple or dict have a constructor that is compatible with those base classes. If you are using classes that don't satisfy this requirement you can subclass them and add a lower() method for the class
nntp/iodict.py
def _lower(v): """assumes that classes that inherit list, tuple or dict have a constructor that is compatible with those base classes. If you are using classes that don't satisfy this requirement you can subclass them and add a lower() method for the class""" if hasattr(v, "lower"): return v...
def _lower(v): """assumes that classes that inherit list, tuple or dict have a constructor that is compatible with those base classes. If you are using classes that don't satisfy this requirement you can subclass them and add a lower() method for the class""" if hasattr(v, "lower"): return v...
[ "assumes", "that", "classes", "that", "inherit", "list", "tuple", "or", "dict", "have", "a", "constructor", "that", "is", "compatible", "with", "those", "base", "classes", ".", "If", "you", "are", "using", "classes", "that", "don", "t", "satisfy", "this", ...
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/iodict.py#L24-L35
[ "def", "_lower", "(", "v", ")", ":", "if", "hasattr", "(", "v", ",", "\"lower\"", ")", ":", "return", "v", ".", "lower", "(", ")", "if", "isinstance", "(", "v", ",", "(", "list", ",", "tuple", ")", ")", ":", "return", "v", ".", "__class__", "("...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
I
The standard quadratic limb darkening law. :param ndarray r: The radius vector :param limbdark: A :py:class:`pysyzygy.transit.LIMBDARK` instance containing the limb darkening law information :returns: The stellar intensity as a function of `r`
pysyzygy/plot.py
def I(r, limbdark): ''' The standard quadratic limb darkening law. :param ndarray r: The radius vector :param limbdark: A :py:class:`pysyzygy.transit.LIMBDARK` instance containing the limb darkening law information :returns: The stellar intensity as a function of `r` ''' if...
def I(r, limbdark): ''' The standard quadratic limb darkening law. :param ndarray r: The radius vector :param limbdark: A :py:class:`pysyzygy.transit.LIMBDARK` instance containing the limb darkening law information :returns: The stellar intensity as a function of `r` ''' if...
[ "The", "standard", "quadratic", "limb", "darkening", "law", ".", ":", "param", "ndarray", "r", ":", "The", "radius", "vector", ":", "param", "limbdark", ":", "A", ":", "py", ":", "class", ":", "pysyzygy", ".", "transit", ".", "LIMBDARK", "instance", "con...
rodluger/pysyzygy
python
https://github.com/rodluger/pysyzygy/blob/d2b64251047cc0f0d0adeb6feab4054e7fce4b7a/pysyzygy/plot.py#L30-L55
[ "def", "I", "(", "r", ",", "limbdark", ")", ":", "if", "limbdark", ".", "ldmodel", "==", "QUADRATIC", ":", "u1", "=", "limbdark", ".", "u1", "u2", "=", "limbdark", ".", "u2", "return", "(", "1", "-", "u1", "*", "(", "1", "-", "np", ".", "sqrt",...
d2b64251047cc0f0d0adeb6feab4054e7fce4b7a
test
PlotTransit
Plots a light curve described by `kwargs` :param bool compact: Display the compact version of the plot? Default `False` :param bool ldplot: Displat the limb darkening inset? Default `True` :param str plottitle: The title of the plot. Default `""` :param float xlim: The half-width of the orbit plot in stellar...
pysyzygy/plot.py
def PlotTransit(compact = False, ldplot = True, plottitle = "", xlim = None, binned = True, **kwargs): ''' Plots a light curve described by `kwargs` :param bool compact: Display the compact version of the plot? Default `False` :param bool ldplot: Displat the limb darkening inset? Default `Tr...
def PlotTransit(compact = False, ldplot = True, plottitle = "", xlim = None, binned = True, **kwargs): ''' Plots a light curve described by `kwargs` :param bool compact: Display the compact version of the plot? Default `False` :param bool ldplot: Displat the limb darkening inset? Default `Tr...
[ "Plots", "a", "light", "curve", "described", "by", "kwargs", ":", "param", "bool", "compact", ":", "Display", "the", "compact", "version", "of", "the", "plot?", "Default", "False", ":", "param", "bool", "ldplot", ":", "Displat", "the", "limb", "darkening", ...
rodluger/pysyzygy
python
https://github.com/rodluger/pysyzygy/blob/d2b64251047cc0f0d0adeb6feab4054e7fce4b7a/pysyzygy/plot.py#L57-L256
[ "def", "PlotTransit", "(", "compact", "=", "False", ",", "ldplot", "=", "True", ",", "plottitle", "=", "\"\"", ",", "xlim", "=", "None", ",", "binned", "=", "True", ",", "*", "*", "kwargs", ")", ":", "# Plotting", "fig", "=", "pl", ".", "figure", "...
d2b64251047cc0f0d0adeb6feab4054e7fce4b7a
test
_offset
Parse timezone to offset in seconds. Args: value: A timezone in the '+0000' format. An integer would also work. Returns: The timezone offset from GMT in seconds as an integer.
nntp/date.py
def _offset(value): """Parse timezone to offset in seconds. Args: value: A timezone in the '+0000' format. An integer would also work. Returns: The timezone offset from GMT in seconds as an integer. """ o = int(value) if o == 0: return 0 a = abs(o) s = a*36+(a%1...
def _offset(value): """Parse timezone to offset in seconds. Args: value: A timezone in the '+0000' format. An integer would also work. Returns: The timezone offset from GMT in seconds as an integer. """ o = int(value) if o == 0: return 0 a = abs(o) s = a*36+(a%1...
[ "Parse", "timezone", "to", "offset", "in", "seconds", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L51-L65
[ "def", "_offset", "(", "value", ")", ":", "o", "=", "int", "(", "value", ")", "if", "o", "==", "0", ":", "return", "0", "a", "=", "abs", "(", "o", ")", "s", "=", "a", "*", "36", "+", "(", "a", "%", "100", ")", "*", "24", "return", "(", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
timestamp_d_b_Y_H_M_S
Convert timestamp string to time in seconds since epoch. Timestamps strings like '18 Jun 2013 12:00:00 GMT' are able to be converted by this function. Args: value: A timestamp string in the format '%d %b %Y %H:%M:%S GMT'. Returns: The time in seconds since epoch as an integer. Ra...
nntp/date.py
def timestamp_d_b_Y_H_M_S(value): """Convert timestamp string to time in seconds since epoch. Timestamps strings like '18 Jun 2013 12:00:00 GMT' are able to be converted by this function. Args: value: A timestamp string in the format '%d %b %Y %H:%M:%S GMT'. Returns: The time in s...
def timestamp_d_b_Y_H_M_S(value): """Convert timestamp string to time in seconds since epoch. Timestamps strings like '18 Jun 2013 12:00:00 GMT' are able to be converted by this function. Args: value: A timestamp string in the format '%d %b %Y %H:%M:%S GMT'. Returns: The time in s...
[ "Convert", "timestamp", "string", "to", "time", "in", "seconds", "since", "epoch", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L67-L89
[ "def", "timestamp_d_b_Y_H_M_S", "(", "value", ")", ":", "d", ",", "b", ",", "Y", ",", "t", ",", "Z", "=", "value", ".", "split", "(", ")", "H", ",", "M", ",", "S", "=", "t", ".", "split", "(", "\":\"", ")", "return", "int", "(", "calendar", "...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
datetimeobj_d_b_Y_H_M_S
Convert timestamp string to a datetime object. Timestamps strings like '18 Jun 2013 12:00:00 GMT' are able to be converted by this function. Args: value: A timestamp string in the format '%d %b %Y %H:%M:%S GMT'. Returns: A datetime object. Raises: ValueError: If timestamp...
nntp/date.py
def datetimeobj_d_b_Y_H_M_S(value): """Convert timestamp string to a datetime object. Timestamps strings like '18 Jun 2013 12:00:00 GMT' are able to be converted by this function. Args: value: A timestamp string in the format '%d %b %Y %H:%M:%S GMT'. Returns: A datetime object. ...
def datetimeobj_d_b_Y_H_M_S(value): """Convert timestamp string to a datetime object. Timestamps strings like '18 Jun 2013 12:00:00 GMT' are able to be converted by this function. Args: value: A timestamp string in the format '%d %b %Y %H:%M:%S GMT'. Returns: A datetime object. ...
[ "Convert", "timestamp", "string", "to", "a", "datetime", "object", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L91-L113
[ "def", "datetimeobj_d_b_Y_H_M_S", "(", "value", ")", ":", "d", ",", "b", ",", "Y", ",", "t", ",", "Z", "=", "value", ".", "split", "(", ")", "H", ",", "M", ",", "S", "=", "t", ".", "split", "(", "\":\"", ")", "return", "datetime", ".", "datetim...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
timestamp_a__d_b_Y_H_M_S_z
Convert timestamp string to time in seconds since epoch. Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be converted by this function. Args: value: A timestamp string in the format '%a, %d %b %Y %H:%M:%S %z'. Returns: The time in seconds since epoch as an intege...
nntp/date.py
def timestamp_a__d_b_Y_H_M_S_z(value): """Convert timestamp string to time in seconds since epoch. Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be converted by this function. Args: value: A timestamp string in the format '%a, %d %b %Y %H:%M:%S %z'. Returns: ...
def timestamp_a__d_b_Y_H_M_S_z(value): """Convert timestamp string to time in seconds since epoch. Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be converted by this function. Args: value: A timestamp string in the format '%a, %d %b %Y %H:%M:%S %z'. Returns: ...
[ "Convert", "timestamp", "string", "to", "time", "in", "seconds", "since", "epoch", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L115-L135
[ "def", "timestamp_a__d_b_Y_H_M_S_z", "(", "value", ")", ":", "a", ",", "d", ",", "b", ",", "Y", ",", "t", ",", "z", "=", "value", ".", "split", "(", ")", "H", ",", "M", ",", "S", "=", "t", ".", "split", "(", "\":\"", ")", "return", "int", "("...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
datetimeobj_a__d_b_Y_H_M_S_z
Convert timestamp string to a datetime object. Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be converted by this function. Args: value: A timestamp string in the format '%a, %d %b %Y %H:%M:%S %z'. Returns: A datetime object. Raises: ValueError: If...
nntp/date.py
def datetimeobj_a__d_b_Y_H_M_S_z(value): """Convert timestamp string to a datetime object. Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be converted by this function. Args: value: A timestamp string in the format '%a, %d %b %Y %H:%M:%S %z'. Returns: A date...
def datetimeobj_a__d_b_Y_H_M_S_z(value): """Convert timestamp string to a datetime object. Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be converted by this function. Args: value: A timestamp string in the format '%a, %d %b %Y %H:%M:%S %z'. Returns: A date...
[ "Convert", "timestamp", "string", "to", "a", "datetime", "object", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L137-L158
[ "def", "datetimeobj_a__d_b_Y_H_M_S_z", "(", "value", ")", ":", "a", ",", "d", ",", "b", ",", "Y", ",", "t", ",", "z", "=", "value", ".", "split", "(", ")", "H", ",", "M", ",", "S", "=", "t", ".", "split", "(", "\":\"", ")", "return", "datetime"...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
timestamp_YmdHMS
Convert timestamp string to time in seconds since epoch. Timestamps strings like '20130618120000' are able to be converted by this function. Args: value: A timestamp string in the format '%Y%m%d%H%M%S'. Returns: The time in seconds since epoch as an integer. Raises: Value...
nntp/date.py
def timestamp_YmdHMS(value): """Convert timestamp string to time in seconds since epoch. Timestamps strings like '20130618120000' are able to be converted by this function. Args: value: A timestamp string in the format '%Y%m%d%H%M%S'. Returns: The time in seconds since epoch as an...
def timestamp_YmdHMS(value): """Convert timestamp string to time in seconds since epoch. Timestamps strings like '20130618120000' are able to be converted by this function. Args: value: A timestamp string in the format '%Y%m%d%H%M%S'. Returns: The time in seconds since epoch as an...
[ "Convert", "timestamp", "string", "to", "time", "in", "seconds", "since", "epoch", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L160-L186
[ "def", "timestamp_YmdHMS", "(", "value", ")", ":", "i", "=", "int", "(", "value", ")", "S", "=", "i", "M", "=", "S", "//", "100", "H", "=", "M", "//", "100", "d", "=", "H", "//", "100", "m", "=", "d", "//", "100", "Y", "=", "m", "//", "10...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
datetimeobj_YmdHMS
Convert timestamp string to a datetime object. Timestamps strings like '20130618120000' are able to be converted by this function. Args: value: A timestamp string in the format '%Y%m%d%H%M%S'. Returns: A datetime object. Raises: ValueError: If timestamp is invalid. N...
nntp/date.py
def datetimeobj_YmdHMS(value): """Convert timestamp string to a datetime object. Timestamps strings like '20130618120000' are able to be converted by this function. Args: value: A timestamp string in the format '%Y%m%d%H%M%S'. Returns: A datetime object. Raises: Value...
def datetimeobj_YmdHMS(value): """Convert timestamp string to a datetime object. Timestamps strings like '20130618120000' are able to be converted by this function. Args: value: A timestamp string in the format '%Y%m%d%H%M%S'. Returns: A datetime object. Raises: Value...
[ "Convert", "timestamp", "string", "to", "a", "datetime", "object", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L188-L214
[ "def", "datetimeobj_YmdHMS", "(", "value", ")", ":", "i", "=", "int", "(", "value", ")", "S", "=", "i", "M", "=", "S", "//", "100", "H", "=", "M", "//", "100", "d", "=", "H", "//", "100", "m", "=", "d", "//", "100", "Y", "=", "m", "//", "...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
datetimeobj_epoch
Convert timestamp string to a datetime object. Timestamps strings like '1383470155' are able to be converted by this function. Args: value: A timestamp string as seconds since epoch. Returns: A datetime object. Raises: ValueError: If timestamp is invalid.
nntp/date.py
def datetimeobj_epoch(value): """Convert timestamp string to a datetime object. Timestamps strings like '1383470155' are able to be converted by this function. Args: value: A timestamp string as seconds since epoch. Returns: A datetime object. Raises: ValueError: If t...
def datetimeobj_epoch(value): """Convert timestamp string to a datetime object. Timestamps strings like '1383470155' are able to be converted by this function. Args: value: A timestamp string as seconds since epoch. Returns: A datetime object. Raises: ValueError: If t...
[ "Convert", "timestamp", "string", "to", "a", "datetime", "object", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L230-L245
[ "def", "datetimeobj_epoch", "(", "value", ")", ":", "return", "datetime", ".", "datetime", ".", "utcfromtimestamp", "(", "int", "(", "value", ")", ")", ".", "replace", "(", "tzinfo", "=", "TZ_GMT", ")" ]
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
timestamp_fmt
Convert timestamp string to time in seconds since epoch. Wraps the datetime.datetime.strptime(). This is slow use the other timestamp_*() functions if possible. Args: value: A timestamp string. fmt: A timestamp format string. Returns: The time in seconds since epoch as an inte...
nntp/date.py
def timestamp_fmt(value, fmt): """Convert timestamp string to time in seconds since epoch. Wraps the datetime.datetime.strptime(). This is slow use the other timestamp_*() functions if possible. Args: value: A timestamp string. fmt: A timestamp format string. Returns: The ...
def timestamp_fmt(value, fmt): """Convert timestamp string to time in seconds since epoch. Wraps the datetime.datetime.strptime(). This is slow use the other timestamp_*() functions if possible. Args: value: A timestamp string. fmt: A timestamp format string. Returns: The ...
[ "Convert", "timestamp", "string", "to", "time", "in", "seconds", "since", "epoch", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L247-L262
[ "def", "timestamp_fmt", "(", "value", ",", "fmt", ")", ":", "return", "int", "(", "calendar", ".", "timegm", "(", "datetime", ".", "datetime", ".", "strptime", "(", "value", ",", "fmt", ")", ".", "utctimetuple", "(", ")", ")", ")" ]
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
timestamp_any
Convert timestamp string to time in seconds since epoch. Most timestamps strings are supported in fact this wraps the dateutil.parser.parse() method. This is SLOW use the other timestamp_*() functions if possible. Args: value: A timestamp string. Returns: The time in seconds since...
nntp/date.py
def timestamp_any(value): """Convert timestamp string to time in seconds since epoch. Most timestamps strings are supported in fact this wraps the dateutil.parser.parse() method. This is SLOW use the other timestamp_*() functions if possible. Args: value: A timestamp string. Returns: ...
def timestamp_any(value): """Convert timestamp string to time in seconds since epoch. Most timestamps strings are supported in fact this wraps the dateutil.parser.parse() method. This is SLOW use the other timestamp_*() functions if possible. Args: value: A timestamp string. Returns: ...
[ "Convert", "timestamp", "string", "to", "time", "in", "seconds", "since", "epoch", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L279-L292
[ "def", "timestamp_any", "(", "value", ")", ":", "return", "int", "(", "calendar", ".", "timegm", "(", "dateutil", ".", "parser", ".", "parse", "(", "value", ")", ".", "utctimetuple", "(", ")", ")", ")" ]
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
timestamp
Parse a datetime to a unix timestamp. Uses fast custom parsing for common datetime formats or the slow dateutil parser for other formats. This is a trade off between ease of use and speed and is very useful for fast parsing of timestamp strings whose format may standard but varied or unknown prior to p...
nntp/date.py
def timestamp(value, fmt=None): """Parse a datetime to a unix timestamp. Uses fast custom parsing for common datetime formats or the slow dateutil parser for other formats. This is a trade off between ease of use and speed and is very useful for fast parsing of timestamp strings whose format may st...
def timestamp(value, fmt=None): """Parse a datetime to a unix timestamp. Uses fast custom parsing for common datetime formats or the slow dateutil parser for other formats. This is a trade off between ease of use and speed and is very useful for fast parsing of timestamp strings whose format may st...
[ "Parse", "a", "datetime", "to", "a", "unix", "timestamp", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L316-L374
[ "def", "timestamp", "(", "value", ",", "fmt", "=", "None", ")", ":", "if", "fmt", ":", "return", "_timestamp_formats", ".", "get", "(", "fmt", ",", "lambda", "v", ":", "timestamp_fmt", "(", "v", ",", "fmt", ")", ")", "(", "value", ")", "l", "=", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
datetimeobj
Parse a datetime to a datetime object. Uses fast custom parsing for common datetime formats or the slow dateutil parser for other formats. This is a trade off between ease of use and speed and is very useful for fast parsing of timestamp strings whose format may standard but varied or unknown prior to ...
nntp/date.py
def datetimeobj(value, fmt=None): """Parse a datetime to a datetime object. Uses fast custom parsing for common datetime formats or the slow dateutil parser for other formats. This is a trade off between ease of use and speed and is very useful for fast parsing of timestamp strings whose format may ...
def datetimeobj(value, fmt=None): """Parse a datetime to a datetime object. Uses fast custom parsing for common datetime formats or the slow dateutil parser for other formats. This is a trade off between ease of use and speed and is very useful for fast parsing of timestamp strings whose format may ...
[ "Parse", "a", "datetime", "to", "a", "datetime", "object", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/date.py#L383-L440
[ "def", "datetimeobj", "(", "value", ",", "fmt", "=", "None", ")", ":", "if", "fmt", ":", "return", "_datetimeobj_formats", ".", "get", "(", "fmt", ",", "lambda", "v", ":", "datetimeobj_fmt", "(", "v", ",", "fmt", ")", ")", "(", "value", ")", "l", "...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
AlertReportConfig._fix_alert_config_dict
Fix the alert config .args() dict for the correct key name
logentries_api/special_alerts.py
def _fix_alert_config_dict(alert_config): """ Fix the alert config .args() dict for the correct key name """ data = alert_config.args() data['params_set'] = data.get('args') del data['args'] return data
def _fix_alert_config_dict(alert_config): """ Fix the alert config .args() dict for the correct key name """ data = alert_config.args() data['params_set'] = data.get('args') del data['args'] return data
[ "Fix", "the", "alert", "config", ".", "args", "()", "dict", "for", "the", "correct", "key", "name" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L165-L172
[ "def", "_fix_alert_config_dict", "(", "alert_config", ")", ":", "data", "=", "alert_config", ".", "args", "(", ")", "data", "[", "'params_set'", "]", "=", "data", ".", "get", "(", "'args'", ")", "del", "data", "[", "'args'", "]", "return", "data" ]
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
SpecialAlertBase._get_login_payload
returns the payload the login page expects :rtype: dict
logentries_api/special_alerts.py
def _get_login_payload(self, username, password): """ returns the payload the login page expects :rtype: dict """ payload = { 'csrfmiddlewaretoken': self._get_csrf_token(), 'ajax': '1', 'next': '/app/', 'username': username, ...
def _get_login_payload(self, username, password): """ returns the payload the login page expects :rtype: dict """ payload = { 'csrfmiddlewaretoken': self._get_csrf_token(), 'ajax': '1', 'next': '/app/', 'username': username, ...
[ "returns", "the", "payload", "the", "login", "page", "expects", ":", "rtype", ":", "dict" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L246-L258
[ "def", "_get_login_payload", "(", "self", ",", "username", ",", "password", ")", ":", "payload", "=", "{", "'csrfmiddlewaretoken'", ":", "self", ".", "_get_csrf_token", "(", ")", ",", "'ajax'", ":", "'1'", ",", "'next'", ":", "'/app/'", ",", "'username'", ...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
SpecialAlertBase._api_post
Convenience method for posting
logentries_api/special_alerts.py
def _api_post(self, url, **kwargs): """ Convenience method for posting """ response = self.session.post( url=url, headers=self._get_api_headers(), **kwargs ) if not response.ok: raise ServerException( '{0}: {...
def _api_post(self, url, **kwargs): """ Convenience method for posting """ response = self.session.post( url=url, headers=self._get_api_headers(), **kwargs ) if not response.ok: raise ServerException( '{0}: {...
[ "Convenience", "method", "for", "posting" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L274-L289
[ "def", "_api_post", "(", "self", ",", "url", ",", "*", "*", "kwargs", ")", ":", "response", "=", "self", ".", "session", ".", "post", "(", "url", "=", "url", ",", "headers", "=", "self", ".", "_get_api_headers", "(", ")", ",", "*", "*", "kwargs", ...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
SpecialAlertBase._api_delete
Convenience method for deleting
logentries_api/special_alerts.py
def _api_delete(self, url, **kwargs): """ Convenience method for deleting """ response = self.session.delete( url=url, headers=self._get_api_headers(), **kwargs ) if not response.ok: raise ServerException( '{...
def _api_delete(self, url, **kwargs): """ Convenience method for deleting """ response = self.session.delete( url=url, headers=self._get_api_headers(), **kwargs ) if not response.ok: raise ServerException( '{...
[ "Convenience", "method", "for", "deleting" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L291-L306
[ "def", "_api_delete", "(", "self", ",", "url", ",", "*", "*", "kwargs", ")", ":", "response", "=", "self", ".", "session", ".", "delete", "(", "url", "=", "url", ",", "headers", "=", "self", ".", "_get_api_headers", "(", ")", ",", "*", "*", "kwargs...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
SpecialAlertBase._api_get
Convenience method for getting
logentries_api/special_alerts.py
def _api_get(self, url, **kwargs): """ Convenience method for getting """ response = self.session.get( url=url, headers=self._get_api_headers(), **kwargs ) if not response.ok: raise ServerException( '{0}: {1}...
def _api_get(self, url, **kwargs): """ Convenience method for getting """ response = self.session.get( url=url, headers=self._get_api_headers(), **kwargs ) if not response.ok: raise ServerException( '{0}: {1}...
[ "Convenience", "method", "for", "getting" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L308-L323
[ "def", "_api_get", "(", "self", ",", "url", ",", "*", "*", "kwargs", ")", ":", "response", "=", "self", ".", "session", ".", "get", "(", "url", "=", "url", ",", "headers", "=", "self", ".", "_get_api_headers", "(", ")", ",", "*", "*", "kwargs", "...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
SpecialAlertBase._login
._login() makes three requests: * One to the /login/ page to get a CSRF cookie * One to /login/ajax/ to get a logged-in session cookie * One to /app/ to get the beginning of the account id :param username: A valid username (email) :type username: str :param ...
logentries_api/special_alerts.py
def _login(self, username, password): """ ._login() makes three requests: * One to the /login/ page to get a CSRF cookie * One to /login/ajax/ to get a logged-in session cookie * One to /app/ to get the beginning of the account id :param username: A valid us...
def _login(self, username, password): """ ._login() makes three requests: * One to the /login/ page to get a CSRF cookie * One to /login/ajax/ to get a logged-in session cookie * One to /app/ to get the beginning of the account id :param username: A valid us...
[ ".", "_login", "()", "makes", "three", "requests", ":" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L325-L362
[ "def", "_login", "(", "self", ",", "username", ",", "password", ")", ":", "login_url", "=", "'https://logentries.com/login/'", "login_page_response", "=", "self", ".", "session", ".", "get", "(", "url", "=", "login_url", ",", "headers", "=", "self", ".", "de...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
SpecialAlertBase.list_scheduled_queries
List all scheduled_queries :return: A list of all scheduled query dicts :rtype: list of dict :raises: This will raise a :class:`ServerException<logentries_api.exceptions.ServerException>` if there is an error from Logentries
logentries_api/special_alerts.py
def list_scheduled_queries(self): """ List all scheduled_queries :return: A list of all scheduled query dicts :rtype: list of dict :raises: This will raise a :class:`ServerException<logentries_api.exceptions.ServerException>` if there is an error from Lo...
def list_scheduled_queries(self): """ List all scheduled_queries :return: A list of all scheduled query dicts :rtype: list of dict :raises: This will raise a :class:`ServerException<logentries_api.exceptions.ServerException>` if there is an error from Lo...
[ "List", "all", "scheduled_queries" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L364-L377
[ "def", "list_scheduled_queries", "(", "self", ")", ":", "url", "=", "'https://logentries.com/rest/{account_id}/api/scheduled_queries/'", ".", "format", "(", "account_id", "=", "self", ".", "account_id", ")", "return", "self", ".", "_api_get", "(", "url", "=", "url",...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
SpecialAlertBase.list_tags
List all tags for the account. The response differs from ``Hooks().list()``, in that tag dicts for anomaly alerts include a 'scheduled_query_id' key with the value being the UUID for the associated scheduled query :return: A list of all tag dicts :rtype: list of dict :...
logentries_api/special_alerts.py
def list_tags(self): """ List all tags for the account. The response differs from ``Hooks().list()``, in that tag dicts for anomaly alerts include a 'scheduled_query_id' key with the value being the UUID for the associated scheduled query :return: A list of all tag dict...
def list_tags(self): """ List all tags for the account. The response differs from ``Hooks().list()``, in that tag dicts for anomaly alerts include a 'scheduled_query_id' key with the value being the UUID for the associated scheduled query :return: A list of all tag dict...
[ "List", "all", "tags", "for", "the", "account", "." ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L379-L396
[ "def", "list_tags", "(", "self", ")", ":", "url", "=", "'https://logentries.com/rest/{account_id}/api/tags/'", ".", "format", "(", "account_id", "=", "self", ".", "account_id", ")", "return", "self", ".", "_api_get", "(", "url", "=", "url", ")", ".", "get", ...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
SpecialAlertBase.get
Get alert by name or id :param name_or_id: The alert's name or id :type name_or_id: str :return: A list of matching tags. An empty list is returned if there are not any matches :rtype: list of dict :raises: This will raise a :class:`ServerException<loge...
logentries_api/special_alerts.py
def get(self, name_or_id): """ Get alert by name or id :param name_or_id: The alert's name or id :type name_or_id: str :return: A list of matching tags. An empty list is returned if there are not any matches :rtype: list of dict :raises: This will r...
def get(self, name_or_id): """ Get alert by name or id :param name_or_id: The alert's name or id :type name_or_id: str :return: A list of matching tags. An empty list is returned if there are not any matches :rtype: list of dict :raises: This will r...
[ "Get", "alert", "by", "name", "or", "id" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L398-L419
[ "def", "get", "(", "self", ",", "name_or_id", ")", ":", "return", "[", "tag", "for", "tag", "in", "self", ".", "list_tags", "(", ")", "if", "name_or_id", "==", "tag", ".", "get", "(", "'id'", ")", "or", "name_or_id", "==", "tag", ".", "get", "(", ...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
InactivityAlert.create
Create an inactivity alert :param name: A name for the inactivity alert :type name: str :param patterns: A list of regexes to match :type patterns: list of str :param logs: A list of log UUID's. (The 'key' key of a log) :type logs: list of str :param trigger_c...
logentries_api/special_alerts.py
def create(self, name, patterns, logs, trigger_config, alert_reports): """ Create an inactivity alert :param name: A name for the inactivity alert :type name: str :param patterns: A list of regexes to match :type patterns: list of str :param logs: A list of log...
def create(self, name, patterns, logs, trigger_config, alert_reports): """ Create an inactivity alert :param name: A name for the inactivity alert :type name: str :param patterns: A list of regexes to match :type patterns: list of str :param logs: A list of log...
[ "Create", "an", "inactivity", "alert" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L429-L480
[ "def", "create", "(", "self", ",", "name", ",", "patterns", ",", "logs", ",", "trigger_config", ",", "alert_reports", ")", ":", "data", "=", "{", "'tag'", ":", "{", "'actions'", ":", "[", "alert_report", ".", "to_dict", "(", ")", "for", "alert_report", ...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
InactivityAlert.delete
Delete the specified InactivityAlert :param tag_id: The tag ID to delete :type tag_id: str :raises: This will raise a :class:`ServerException <logentries_api.exceptions.ServerException>` if there is an error from Logentries
logentries_api/special_alerts.py
def delete(self, tag_id): """ Delete the specified InactivityAlert :param tag_id: The tag ID to delete :type tag_id: str :raises: This will raise a :class:`ServerException <logentries_api.exceptions.ServerException>` if there is an error from Logentries ...
def delete(self, tag_id): """ Delete the specified InactivityAlert :param tag_id: The tag ID to delete :type tag_id: str :raises: This will raise a :class:`ServerException <logentries_api.exceptions.ServerException>` if there is an error from Logentries ...
[ "Delete", "the", "specified", "InactivityAlert" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L482-L500
[ "def", "delete", "(", "self", ",", "tag_id", ")", ":", "tag_url", "=", "'https://logentries.com/rest/{account_id}/api/tags/{tag_id}'", "self", ".", "_api_delete", "(", "url", "=", "tag_url", ".", "format", "(", "account_id", "=", "self", ".", "account_id", ",", ...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
AnomalyAlert._create_scheduled_query
Create the scheduled query
logentries_api/special_alerts.py
def _create_scheduled_query(self, query, change, scope_unit, scope_count): """ Create the scheduled query """ query_data = { 'scheduled_query': { 'name': 'ForAnomalyReport', 'query': query, 'threshold_type': '%', ...
def _create_scheduled_query(self, query, change, scope_unit, scope_count): """ Create the scheduled query """ query_data = { 'scheduled_query': { 'name': 'ForAnomalyReport', 'query': query, 'threshold_type': '%', ...
[ "Create", "the", "scheduled", "query" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L508-L528
[ "def", "_create_scheduled_query", "(", "self", ",", "query", ",", "change", ",", "scope_unit", ",", "scope_count", ")", ":", "query_data", "=", "{", "'scheduled_query'", ":", "{", "'name'", ":", "'ForAnomalyReport'", ",", "'query'", ":", "query", ",", "'thresh...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
AnomalyAlert.create
Create an anomaly alert. This call makes 2 requests, one to create a "scheduled_query", and another to create the alert. :param name: The name for the alert :type name: str :param query: The `LEQL`_ query to use for detecting anomalies. Must result in a numerical value, so ...
logentries_api/special_alerts.py
def create(self, name, query, scope_count, scope_unit, increase_positive, percentage_change, trigger_config, logs, alert_reports): """ Create an anomaly alert. This call...
def create(self, name, query, scope_count, scope_unit, increase_positive, percentage_change, trigger_config, logs, alert_reports): """ Create an anomaly alert. This call...
[ "Create", "an", "anomaly", "alert", ".", "This", "call", "makes", "2", "requests", "one", "to", "create", "a", "scheduled_query", "and", "another", "to", "create", "the", "alert", "." ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L530-L630
[ "def", "create", "(", "self", ",", "name", ",", "query", ",", "scope_count", ",", "scope_unit", ",", "increase_positive", ",", "percentage_change", ",", "trigger_config", ",", "logs", ",", "alert_reports", ")", ":", "change", "=", "'{pos}{change}'", ".", "form...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
AnomalyAlert.delete
Delete a specified anomaly alert tag and its scheduled query This method makes 3 requests: * One to get the associated scheduled_query_id * One to delete the alert * One to delete get scheduled query :param tag_id: The tag ID to delete :type tag_id: str ...
logentries_api/special_alerts.py
def delete(self, tag_id): """ Delete a specified anomaly alert tag and its scheduled query This method makes 3 requests: * One to get the associated scheduled_query_id * One to delete the alert * One to delete get scheduled query :param tag_id: The ...
def delete(self, tag_id): """ Delete a specified anomaly alert tag and its scheduled query This method makes 3 requests: * One to get the associated scheduled_query_id * One to delete the alert * One to delete get scheduled query :param tag_id: The ...
[ "Delete", "a", "specified", "anomaly", "alert", "tag", "and", "its", "scheduled", "query" ]
ambitioninc/python-logentries-api
python
https://github.com/ambitioninc/python-logentries-api/blob/77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc/logentries_api/special_alerts.py#L632-L671
[ "def", "delete", "(", "self", ",", "tag_id", ")", ":", "this_alert", "=", "[", "tag", "for", "tag", "in", "self", ".", "list_tags", "(", ")", "if", "tag", ".", "get", "(", "'id'", ")", "==", "tag_id", "]", "if", "len", "(", "this_alert", ")", "<"...
77ff1a7a2995d7ea2725b74e34c0f880f4ee23bc
test
unparse_range
Unparse a range argument. Args: obj: An article range. There are a number of valid formats; an integer specifying a single article or a tuple specifying an article range. If the range doesn't give a start article then all articles up to the specified last article are inc...
nntp/utils.py
def unparse_range(obj): """Unparse a range argument. Args: obj: An article range. There are a number of valid formats; an integer specifying a single article or a tuple specifying an article range. If the range doesn't give a start article then all articles up to the...
def unparse_range(obj): """Unparse a range argument. Args: obj: An article range. There are a number of valid formats; an integer specifying a single article or a tuple specifying an article range. If the range doesn't give a start article then all articles up to the...
[ "Unparse", "a", "range", "argument", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/utils.py#L49-L78
[ "def", "unparse_range", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "(", "int", ",", "long", ")", ")", ":", "return", "str", "(", "obj", ")", "if", "isinstance", "(", "obj", ",", "tuple", ")", ":", "arg", "=", "str", "(", "obj", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
parse_newsgroup
Parse a newsgroup info line to python types. Args: line: An info response line containing newsgroup info. Returns: A tuple of group name, low-water as integer, high-water as integer and posting status. Raises: ValueError: If the newsgroup info cannot be parsed. Note: ...
nntp/utils.py
def parse_newsgroup(line): """Parse a newsgroup info line to python types. Args: line: An info response line containing newsgroup info. Returns: A tuple of group name, low-water as integer, high-water as integer and posting status. Raises: ValueError: If the newsgroup ...
def parse_newsgroup(line): """Parse a newsgroup info line to python types. Args: line: An info response line containing newsgroup info. Returns: A tuple of group name, low-water as integer, high-water as integer and posting status. Raises: ValueError: If the newsgroup ...
[ "Parse", "a", "newsgroup", "info", "line", "to", "python", "types", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/utils.py#L128-L155
[ "def", "parse_newsgroup", "(", "line", ")", ":", "parts", "=", "line", ".", "split", "(", ")", "try", ":", "group", "=", "parts", "[", "0", "]", "low", "=", "int", "(", "parts", "[", "1", "]", ")", "high", "=", "int", "(", "parts", "[", "2", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
parse_header
Parse a header line. Args: line: A header line as a string. Returns: None if end of headers is found. A string giving the continuation line if a continuation is found. A tuple of name, value when a header line is found. Raises: ValueError: If the line cannot be par...
nntp/utils.py
def parse_header(line): """Parse a header line. Args: line: A header line as a string. Returns: None if end of headers is found. A string giving the continuation line if a continuation is found. A tuple of name, value when a header line is found. Raises: ValueE...
def parse_header(line): """Parse a header line. Args: line: A header line as a string. Returns: None if end of headers is found. A string giving the continuation line if a continuation is found. A tuple of name, value when a header line is found. Raises: ValueE...
[ "Parse", "a", "header", "line", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/utils.py#L157-L176
[ "def", "parse_header", "(", "line", ")", ":", "if", "not", "line", "or", "line", "==", "\"\\r\\n\"", ":", "return", "None", "if", "line", "[", "0", "]", "in", "\" \\t\"", ":", "return", "line", "[", "1", ":", "]", ".", "rstrip", "(", ")", "name", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
parse_headers
Parse a string a iterable object (including file like objects) to a python dictionary. Args: obj: An iterable object including file-like objects. Returns: An dictionary of headers. If a header is repeated then the last value for that header is given. Raises: ValueError...
nntp/utils.py
def parse_headers(obj): """Parse a string a iterable object (including file like objects) to a python dictionary. Args: obj: An iterable object including file-like objects. Returns: An dictionary of headers. If a header is repeated then the last value for that header is given. ...
def parse_headers(obj): """Parse a string a iterable object (including file like objects) to a python dictionary. Args: obj: An iterable object including file-like objects. Returns: An dictionary of headers. If a header is repeated then the last value for that header is given. ...
[ "Parse", "a", "string", "a", "iterable", "object", "(", "including", "file", "like", "objects", ")", "to", "a", "python", "dictionary", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/utils.py#L178-L206
[ "def", "parse_headers", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "basestring", ")", ":", "obj", "=", "cStringIO", ".", "StringIO", "(", "obj", ")", "hdrs", "=", "[", "]", "for", "line", "in", "obj", ":", "hdr", "=", "parse_header", ...
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
unparse_headers
Parse a dictionary of headers to a string. Args: hdrs: A dictionary of headers. Returns: The headers as a string that can be used in an NNTP POST.
nntp/utils.py
def unparse_headers(hdrs): """Parse a dictionary of headers to a string. Args: hdrs: A dictionary of headers. Returns: The headers as a string that can be used in an NNTP POST. """ return "".join([unparse_header(n, v) for n, v in hdrs.items()]) + "\r\n"
def unparse_headers(hdrs): """Parse a dictionary of headers to a string. Args: hdrs: A dictionary of headers. Returns: The headers as a string that can be used in an NNTP POST. """ return "".join([unparse_header(n, v) for n, v in hdrs.items()]) + "\r\n"
[ "Parse", "a", "dictionary", "of", "headers", "to", "a", "string", "." ]
greenbender/pynntp
python
https://github.com/greenbender/pynntp/blob/991a76331cdf5d8f9dbf5b18f6e29adc80749a2f/nntp/utils.py#L220-L229
[ "def", "unparse_headers", "(", "hdrs", ")", ":", "return", "\"\"", ".", "join", "(", "[", "unparse_header", "(", "n", ",", "v", ")", "for", "n", ",", "v", "in", "hdrs", ".", "items", "(", ")", "]", ")", "+", "\"\\r\\n\"" ]
991a76331cdf5d8f9dbf5b18f6e29adc80749a2f
test
WebHookHandler.do_POST
Handles the POST request sent by Boundary Url Action
boundary/webhook_handler.py
def do_POST(self): """ Handles the POST request sent by Boundary Url Action """ self.send_response(urllib2.httplib.OK) self.end_headers() content_length = int(self.headers['Content-Length']) body = self.rfile.read(content_length) print("Client: {0}".format...
def do_POST(self): """ Handles the POST request sent by Boundary Url Action """ self.send_response(urllib2.httplib.OK) self.end_headers() content_length = int(self.headers['Content-Length']) body = self.rfile.read(content_length) print("Client: {0}".format...
[ "Handles", "the", "POST", "request", "sent", "by", "Boundary", "Url", "Action" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/webhook_handler.py#L182-L193
[ "def", "do_POST", "(", "self", ")", ":", "self", ".", "send_response", "(", "urllib2", ".", "httplib", ".", "OK", ")", "self", ".", "end_headers", "(", ")", "content_length", "=", "int", "(", "self", ".", "headers", "[", "'Content-Length'", "]", ")", "...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
run
Run the tests that are loaded by each of the strings provided. Arguments: tests (iterable): the collection of tests (specified as `str` s) to run reporter (Reporter): a `Reporter` to use for the run. If unprovided, the default is to return a `virtue.reporters...
virtue/runner.py
def run(tests=(), reporter=None, stop_after=None): """ Run the tests that are loaded by each of the strings provided. Arguments: tests (iterable): the collection of tests (specified as `str` s) to run reporter (Reporter): a `Reporter` to use for the run. If unpro...
def run(tests=(), reporter=None, stop_after=None): """ Run the tests that are loaded by each of the strings provided. Arguments: tests (iterable): the collection of tests (specified as `str` s) to run reporter (Reporter): a `Reporter` to use for the run. If unpro...
[ "Run", "the", "tests", "that", "are", "loaded", "by", "each", "of", "the", "strings", "provided", "." ]
Julian/Virtue
python
https://github.com/Julian/Virtue/blob/d08be37d759c38c94a160bc13fe8f51bb2aeeedd/virtue/runner.py#L8-L46
[ "def", "run", "(", "tests", "=", "(", ")", ",", "reporter", "=", "None", ",", "stop_after", "=", "None", ")", ":", "if", "reporter", "is", "None", ":", "reporter", "=", "Counter", "(", ")", "if", "stop_after", "is", "not", "None", ":", "reporter", ...
d08be37d759c38c94a160bc13fe8f51bb2aeeedd
test
defaults_docstring
Return a docstring from a list of defaults.
pymodeler/parameter.py
def defaults_docstring(defaults, header=None, indent=None, footer=None): """Return a docstring from a list of defaults. """ if indent is None: indent = '' if header is None: header = '' if footer is None: footer = '' width = 60 #hbar = indent + width * '=' + '\n' # ...
def defaults_docstring(defaults, header=None, indent=None, footer=None): """Return a docstring from a list of defaults. """ if indent is None: indent = '' if header is None: header = '' if footer is None: footer = '' width = 60 #hbar = indent + width * '=' + '\n' # ...
[ "Return", "a", "docstring", "from", "a", "list", "of", "defaults", "." ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L44-L70
[ "def", "defaults_docstring", "(", "defaults", ",", "header", "=", "None", ",", "indent", "=", "None", ",", "footer", "=", "None", ")", ":", "if", "indent", "is", "None", ":", "indent", "=", "''", "if", "header", "is", "None", ":", "header", "=", "''"...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
defaults_decorator
Decorator to append default kwargs to a function.
pymodeler/parameter.py
def defaults_decorator(defaults): """Decorator to append default kwargs to a function. """ def decorator(func): """Function that appends default kwargs to a function. """ kwargs = dict(header='Keyword arguments\n-----------------\n', indent=' ', ...
def defaults_decorator(defaults): """Decorator to append default kwargs to a function. """ def decorator(func): """Function that appends default kwargs to a function. """ kwargs = dict(header='Keyword arguments\n-----------------\n', indent=' ', ...
[ "Decorator", "to", "append", "default", "kwargs", "to", "a", "function", "." ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L73-L88
[ "def", "defaults_decorator", "(", "defaults", ")", ":", "def", "decorator", "(", "func", ")", ":", "\"\"\"Function that appends default kwargs to a function.\n \"\"\"", "kwargs", "=", "dict", "(", "header", "=", "'Keyword arguments\\n-----------------\\n'", ",", "ind...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Property._load
Load kwargs key,value pairs into __dict__
pymodeler/parameter.py
def _load(self, **kwargs): """Load kwargs key,value pairs into __dict__ """ defaults = dict([(d[0], d[1]) for d in self.defaults]) # Require kwargs are in defaults for k in kwargs: if k not in defaults: msg = "Unrecognized attribute of %s: %s" % ( ...
def _load(self, **kwargs): """Load kwargs key,value pairs into __dict__ """ defaults = dict([(d[0], d[1]) for d in self.defaults]) # Require kwargs are in defaults for k in kwargs: if k not in defaults: msg = "Unrecognized attribute of %s: %s" % ( ...
[ "Load", "kwargs", "key", "value", "pairs", "into", "__dict__" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L147-L166
[ "def", "_load", "(", "self", ",", "*", "*", "kwargs", ")", ":", "defaults", "=", "dict", "(", "[", "(", "d", "[", "0", "]", ",", "d", "[", "1", "]", ")", "for", "d", "in", "self", ".", "defaults", "]", ")", "# Require kwargs are in defaults", "fo...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Property.defaults_docstring
Add the default values to the class docstring
pymodeler/parameter.py
def defaults_docstring(cls, header=None, indent=None, footer=None): """Add the default values to the class docstring""" return defaults_docstring(cls.defaults, header=header, indent=indent, footer=footer)
def defaults_docstring(cls, header=None, indent=None, footer=None): """Add the default values to the class docstring""" return defaults_docstring(cls.defaults, header=header, indent=indent, footer=footer)
[ "Add", "the", "default", "values", "to", "the", "class", "docstring" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L169-L172
[ "def", "defaults_docstring", "(", "cls", ",", "header", "=", "None", ",", "indent", "=", "None", ",", "footer", "=", "None", ")", ":", "return", "defaults_docstring", "(", "cls", ".", "defaults", ",", "header", "=", "header", ",", "indent", "=", "indent"...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Property.set_value
Set the value This invokes hooks for type-checking and bounds-checking that may be implemented by sub-classes.
pymodeler/parameter.py
def set_value(self, value): """Set the value This invokes hooks for type-checking and bounds-checking that may be implemented by sub-classes. """ self.check_bounds(value) self.check_type(value) self.__value__ = value
def set_value(self, value): """Set the value This invokes hooks for type-checking and bounds-checking that may be implemented by sub-classes. """ self.check_bounds(value) self.check_type(value) self.__value__ = value
[ "Set", "the", "value" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L209-L217
[ "def", "set_value", "(", "self", ",", "value", ")", ":", "self", ".", "check_bounds", "(", "value", ")", "self", ".", "check_type", "(", "value", ")", "self", ".", "__value__", "=", "value" ]
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Property.check_type
Hook for type-checking, invoked during assignment. raises TypeError if neither value nor self.dtype are None and they do not match. will not raise an exception if either value or self.dtype is None
pymodeler/parameter.py
def check_type(self, value): """Hook for type-checking, invoked during assignment. raises TypeError if neither value nor self.dtype are None and they do not match. will not raise an exception if either value or self.dtype is None """ if self.__dict__['dtype'] is None: ...
def check_type(self, value): """Hook for type-checking, invoked during assignment. raises TypeError if neither value nor self.dtype are None and they do not match. will not raise an exception if either value or self.dtype is None """ if self.__dict__['dtype'] is None: ...
[ "Hook", "for", "type", "-", "checking", "invoked", "during", "assignment", "." ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L252-L268
[ "def", "check_type", "(", "self", ",", "value", ")", ":", "if", "self", ".", "__dict__", "[", "'dtype'", "]", "is", "None", ":", "return", "elif", "value", "is", "None", ":", "return", "elif", "isinstance", "(", "value", ",", "self", ".", "__dict__", ...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Derived.value
Return the current value. This first checks if the value is cached (i.e., if `self.__value__` is not None) If it is not cached then it invokes the `loader` function to compute the value, and caches the computed value
pymodeler/parameter.py
def value(self): """Return the current value. This first checks if the value is cached (i.e., if `self.__value__` is not None) If it is not cached then it invokes the `loader` function to compute the value, and caches the computed value """ if self.__value__ i...
def value(self): """Return the current value. This first checks if the value is cached (i.e., if `self.__value__` is not None) If it is not cached then it invokes the `loader` function to compute the value, and caches the computed value """ if self.__value__ i...
[ "Return", "the", "current", "value", "." ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L290-L317
[ "def", "value", "(", "self", ")", ":", "if", "self", ".", "__value__", "is", "None", ":", "try", ":", "loader", "=", "self", ".", "__dict__", "[", "'loader'", "]", "except", "KeyError", ":", "raise", "AttributeError", "(", "\"Loader is not defined\"", ")",...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Parameter.check_type
Hook for type-checking, invoked during assignment. Allows size 1 numpy arrays and lists, but raises TypeError if value can not be cast to a scalar.
pymodeler/parameter.py
def check_type(self, value): """Hook for type-checking, invoked during assignment. Allows size 1 numpy arrays and lists, but raises TypeError if value can not be cast to a scalar. """ try: scalar = asscalar(value) except ValueError as e: raise Typ...
def check_type(self, value): """Hook for type-checking, invoked during assignment. Allows size 1 numpy arrays and lists, but raises TypeError if value can not be cast to a scalar. """ try: scalar = asscalar(value) except ValueError as e: raise Typ...
[ "Hook", "for", "type", "-", "checking", "invoked", "during", "assignment", ".", "Allows", "size", "1", "numpy", "arrays", "and", "lists", "but", "raises", "TypeError", "if", "value", "can", "not", "be", "cast", "to", "a", "scalar", "." ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L349-L360
[ "def", "check_type", "(", "self", ",", "value", ")", ":", "try", ":", "scalar", "=", "asscalar", "(", "value", ")", "except", "ValueError", "as", "e", ":", "raise", "TypeError", "(", "e", ")", "super", "(", "Parameter", ",", "self", ")", ".", "check_...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Parameter.symmetric_error
Return the symmertic error Similar to above, but zero implies no error estimate, and otherwise this will either be the symmetric error, or the average of the low,high asymmetric errors.
pymodeler/parameter.py
def symmetric_error(self): """Return the symmertic error Similar to above, but zero implies no error estimate, and otherwise this will either be the symmetric error, or the average of the low,high asymmetric errors. """ # ADW: Should this be `np.nan`? if self.__e...
def symmetric_error(self): """Return the symmertic error Similar to above, but zero implies no error estimate, and otherwise this will either be the symmetric error, or the average of the low,high asymmetric errors. """ # ADW: Should this be `np.nan`? if self.__e...
[ "Return", "the", "symmertic", "error" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L575-L587
[ "def", "symmetric_error", "(", "self", ")", ":", "# ADW: Should this be `np.nan`?", "if", "self", ".", "__errors__", "is", "None", ":", "return", "0.", "if", "np", ".", "isscalar", "(", "self", ".", "__errors__", ")", ":", "return", "self", ".", "__errors__"...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Parameter.set_free
Set free/fixed status
pymodeler/parameter.py
def set_free(self, free): """Set free/fixed status """ if free is None: self.__free__ = False return self.__free__ = bool(free)
def set_free(self, free): """Set free/fixed status """ if free is None: self.__free__ = False return self.__free__ = bool(free)
[ "Set", "free", "/", "fixed", "status" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L613-L618
[ "def", "set_free", "(", "self", ",", "free", ")", ":", "if", "free", "is", "None", ":", "self", ".", "__free__", "=", "False", "return", "self", ".", "__free__", "=", "bool", "(", "free", ")" ]
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Parameter.set_errors
Set parameter error estimate
pymodeler/parameter.py
def set_errors(self, errors): """Set parameter error estimate """ if errors is None: self.__errors__ = None return self.__errors__ = [asscalar(e) for e in errors]
def set_errors(self, errors): """Set parameter error estimate """ if errors is None: self.__errors__ = None return self.__errors__ = [asscalar(e) for e in errors]
[ "Set", "parameter", "error", "estimate" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L620-L625
[ "def", "set_errors", "(", "self", ",", "errors", ")", ":", "if", "errors", "is", "None", ":", "self", ".", "__errors__", "=", "None", "return", "self", ".", "__errors__", "=", "[", "asscalar", "(", "e", ")", "for", "e", "in", "errors", "]" ]
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Parameter.set
Set the value,bounds,free,errors based on corresponding kwargs The invokes hooks for type-checking and bounds-checking that may be implemented by sub-classes.
pymodeler/parameter.py
def set(self, **kwargs): """Set the value,bounds,free,errors based on corresponding kwargs The invokes hooks for type-checking and bounds-checking that may be implemented by sub-classes. """ # Probably want to reset bounds if set fails if 'bounds' in kwargs: ...
def set(self, **kwargs): """Set the value,bounds,free,errors based on corresponding kwargs The invokes hooks for type-checking and bounds-checking that may be implemented by sub-classes. """ # Probably want to reset bounds if set fails if 'bounds' in kwargs: ...
[ "Set", "the", "value", "bounds", "free", "errors", "based", "on", "corresponding", "kwargs" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/parameter.py#L627-L641
[ "def", "set", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# Probably want to reset bounds if set fails", "if", "'bounds'", "in", "kwargs", ":", "self", ".", "set_bounds", "(", "kwargs", ".", "pop", "(", "'bounds'", ")", ")", "if", "'free'", "in", "kwa...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
MetricCreateBulk.load_and_parse
Load the metrics file from the given path
boundary/metric_create_bulk.py
def load_and_parse(self): """ Load the metrics file from the given path """ f = open(self.file_path, "r") metrics_json = f.read() self.metrics = json.loads(metrics_json)
def load_and_parse(self): """ Load the metrics file from the given path """ f = open(self.file_path, "r") metrics_json = f.read() self.metrics = json.loads(metrics_json)
[ "Load", "the", "metrics", "file", "from", "the", "given", "path" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/metric_create_bulk.py#L55-L61
[ "def", "load_and_parse", "(", "self", ")", ":", "f", "=", "open", "(", "self", ".", "file_path", ",", "\"r\"", ")", "metrics_json", "=", "f", ".", "read", "(", ")", "self", ".", "metrics", "=", "json", ".", "loads", "(", "metrics_json", ")" ]
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
MetricCreateBulk.import_metrics
1) Get command line arguments 2) Read the JSON file 3) Parse into a dictionary 4) Create or update definitions using API call
boundary/metric_create_bulk.py
def import_metrics(self): """ 1) Get command line arguments 2) Read the JSON file 3) Parse into a dictionary 4) Create or update definitions using API call """ self.v2Metrics = self.metricDefinitionV2(self.metrics) if self.v2Metrics: metrics =...
def import_metrics(self): """ 1) Get command line arguments 2) Read the JSON file 3) Parse into a dictionary 4) Create or update definitions using API call """ self.v2Metrics = self.metricDefinitionV2(self.metrics) if self.v2Metrics: metrics =...
[ "1", ")", "Get", "command", "line", "arguments", "2", ")", "Read", "the", "JSON", "file", "3", ")", "Parse", "into", "a", "dictionary", "4", ")", "Create", "or", "update", "definitions", "using", "API", "call" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/metric_create_bulk.py#L63-L86
[ "def", "import_metrics", "(", "self", ")", ":", "self", ".", "v2Metrics", "=", "self", ".", "metricDefinitionV2", "(", "self", ".", "metrics", ")", "if", "self", ".", "v2Metrics", ":", "metrics", "=", "self", ".", "metrics", "else", ":", "metrics", "=", ...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
TzDescriptor.create_from_pytz
Create an instance using the result of the timezone() call in "pytz".
pytzpure/tz_descriptor.py
def create_from_pytz(cls, tz_info): """Create an instance using the result of the timezone() call in "pytz". """ zone_name = tz_info.zone utc_transition_times_list_raw = getattr(tz_info, '_utc_transition_times', ...
def create_from_pytz(cls, tz_info): """Create an instance using the result of the timezone() call in "pytz". """ zone_name = tz_info.zone utc_transition_times_list_raw = getattr(tz_info, '_utc_transition_times', ...
[ "Create", "an", "instance", "using", "the", "result", "of", "the", "timezone", "()", "call", "in", "pytz", "." ]
dsoprea/pytzPure
python
https://github.com/dsoprea/pytzPure/blob/ec8f7803ca1025d363ba954905ae7717a0524a0e/pytzpure/tz_descriptor.py#L36-L76
[ "def", "create_from_pytz", "(", "cls", ",", "tz_info", ")", ":", "zone_name", "=", "tz_info", ".", "zone", "utc_transition_times_list_raw", "=", "getattr", "(", "tz_info", ",", "'_utc_transition_times'", ",", "None", ")", "utc_transition_times_list", "=", "[", "tu...
ec8f7803ca1025d363ba954905ae7717a0524a0e
test
MetricExport.extract_dictionary
Extract required fields from an array
boundary/metric_export.py
def extract_dictionary(self, metrics): """ Extract required fields from an array """ new_metrics = {} for m in metrics: metric = self.extract_fields(m) new_metrics[m['name']] = metric return new_metrics
def extract_dictionary(self, metrics): """ Extract required fields from an array """ new_metrics = {} for m in metrics: metric = self.extract_fields(m) new_metrics[m['name']] = metric return new_metrics
[ "Extract", "required", "fields", "from", "an", "array" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/metric_export.py#L59-L67
[ "def", "extract_dictionary", "(", "self", ",", "metrics", ")", ":", "new_metrics", "=", "{", "}", "for", "m", "in", "metrics", ":", "metric", "=", "self", ".", "extract_fields", "(", "m", ")", "new_metrics", "[", "m", "[", "'name'", "]", "]", "=", "m...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
MetricExport.filter
Apply the criteria to filter out on the metrics required
boundary/metric_export.py
def filter(self): """ Apply the criteria to filter out on the metrics required """ if self.filter_expression is not None: new_metrics = [] metrics = self.metrics['result'] for m in metrics: if self.filter_expression.search(m['name']): ...
def filter(self): """ Apply the criteria to filter out on the metrics required """ if self.filter_expression is not None: new_metrics = [] metrics = self.metrics['result'] for m in metrics: if self.filter_expression.search(m['name']): ...
[ "Apply", "the", "criteria", "to", "filter", "out", "on", "the", "metrics", "required" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/metric_export.py#L69-L82
[ "def", "filter", "(", "self", ")", ":", "if", "self", ".", "filter_expression", "is", "not", "None", ":", "new_metrics", "=", "[", "]", "metrics", "=", "self", ".", "metrics", "[", "'result'", "]", "for", "m", "in", "metrics", ":", "if", "self", ".",...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
HostgroupGet.get_arguments
Extracts the specific arguments of this CLI
boundary/hostgroup_get.py
def get_arguments(self): """ Extracts the specific arguments of this CLI """ ApiCli.get_arguments(self) if self.args.hostGroupId is not None: self.hostGroupId = self.args.hostGroupId self.path = "v1/hostgroup/{0}".format(str(self.hostGroupId))
def get_arguments(self): """ Extracts the specific arguments of this CLI """ ApiCli.get_arguments(self) if self.args.hostGroupId is not None: self.hostGroupId = self.args.hostGroupId self.path = "v1/hostgroup/{0}".format(str(self.hostGroupId))
[ "Extracts", "the", "specific", "arguments", "of", "this", "CLI" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/hostgroup_get.py#L36-L44
[ "def", "get_arguments", "(", "self", ")", ":", "ApiCli", ".", "get_arguments", "(", "self", ")", "if", "self", ".", "args", ".", "hostGroupId", "is", "not", "None", ":", "self", ".", "hostGroupId", "=", "self", ".", "args", ".", "hostGroupId", "self", ...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
EventCreate.get_arguments
Extracts the specific arguments of this CLI
boundary/event_create.py
def get_arguments(self): """ Extracts the specific arguments of this CLI """ ApiCli.get_arguments(self) if self.args.tenant_id is not None: self._tenant_id = self.args.tenant_id if self.args.fingerprint_fields is not None: self._fingerprint_field...
def get_arguments(self): """ Extracts the specific arguments of this CLI """ ApiCli.get_arguments(self) if self.args.tenant_id is not None: self._tenant_id = self.args.tenant_id if self.args.fingerprint_fields is not None: self._fingerprint_field...
[ "Extracts", "the", "specific", "arguments", "of", "this", "CLI" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/event_create.py#L94-L145
[ "def", "get_arguments", "(", "self", ")", ":", "ApiCli", ".", "get_arguments", "(", "self", ")", "if", "self", ".", "args", ".", "tenant_id", "is", "not", "None", ":", "self", ".", "_tenant_id", "=", "self", ".", "args", ".", "tenant_id", "if", "self",...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
MeterClient._call_api
Make a call to the meter via JSON RPC
boundary/meter_client.py
def _call_api(self): """ Make a call to the meter via JSON RPC """ # Allocate a socket and connect to the meter sockobj = socket(AF_INET, SOCK_STREAM) sockobj.connect((self.rpc_host, self.rpc_port)) self.get_json() message = [self.rpc_message.encode('utf-...
def _call_api(self): """ Make a call to the meter via JSON RPC """ # Allocate a socket and connect to the meter sockobj = socket(AF_INET, SOCK_STREAM) sockobj.connect((self.rpc_host, self.rpc_port)) self.get_json() message = [self.rpc_message.encode('utf-...
[ "Make", "a", "call", "to", "the", "meter", "via", "JSON", "RPC" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/meter_client.py#L122-L139
[ "def", "_call_api", "(", "self", ")", ":", "# Allocate a socket and connect to the meter", "sockobj", "=", "socket", "(", "AF_INET", ",", "SOCK_STREAM", ")", "sockobj", ".", "connect", "(", "(", "self", ".", "rpc_host", ",", "self", ".", "rpc_port", ")", ")", ...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
HostgroupUpdate.get_arguments
Extracts the specific arguments of this CLI
boundary/hostgroup_update.py
def get_arguments(self): """ Extracts the specific arguments of this CLI """ HostgroupModify.get_arguments(self) if self.args.host_group_id is not None: self.host_group_id = self.args.host_group_id self.path = "v1/hostgroup/" + str(self.host_group_id)
def get_arguments(self): """ Extracts the specific arguments of this CLI """ HostgroupModify.get_arguments(self) if self.args.host_group_id is not None: self.host_group_id = self.args.host_group_id self.path = "v1/hostgroup/" + str(self.host_group_id)
[ "Extracts", "the", "specific", "arguments", "of", "this", "CLI" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/hostgroup_update.py#L38-L47
[ "def", "get_arguments", "(", "self", ")", ":", "HostgroupModify", ".", "get_arguments", "(", "self", ")", "if", "self", ".", "args", ".", "host_group_id", "is", "not", "None", ":", "self", ".", "host_group_id", "=", "self", ".", "args", ".", "host_group_id...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
Parser.identifier
identifier = alpha_character | "_" . {alpha_character | "_" | digit} ;
pyebnf/_hand_written_parser.py
def identifier(self, text): """identifier = alpha_character | "_" . {alpha_character | "_" | digit} ;""" self._attempting(text) return concatenation([ alternation([ self.alpha_character, "_" ]), zero_or_more( alternation([ self.alpha_character, "...
def identifier(self, text): """identifier = alpha_character | "_" . {alpha_character | "_" | digit} ;""" self._attempting(text) return concatenation([ alternation([ self.alpha_character, "_" ]), zero_or_more( alternation([ self.alpha_character, "...
[ "identifier", "=", "alpha_character", "|", "_", ".", "{", "alpha_character", "|", "_", "|", "digit", "}", ";" ]
treycucco/pyebnf
python
https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/_hand_written_parser.py#L76-L91
[ "def", "identifier", "(", "self", ",", "text", ")", ":", "self", ".", "_attempting", "(", "text", ")", "return", "concatenation", "(", "[", "alternation", "(", "[", "self", ".", "alpha_character", ",", "\"_\"", "]", ")", ",", "zero_or_more", "(", "altern...
3634ddabbe5d73508bcc20f4a591f86a46634e1d
test
Parser.expression
expression = number , op_mult , expression | expression_terminal , op_mult , number , [operator , expression] | expression_terminal , op_add , [operator , expression] | expression_terminal , [operator , expression] ;
pyebnf/_hand_written_parser.py
def expression(self, text): """expression = number , op_mult , expression | expression_terminal , op_mult , number , [operator , expression] | expression_terminal , op_add , [operator , expression] | expression_terminal , [operator , expression] ; """ se...
def expression(self, text): """expression = number , op_mult , expression | expression_terminal , op_mult , number , [operator , expression] | expression_terminal , op_add , [operator , expression] | expression_terminal , [operator , expression] ; """ se...
[ "expression", "=", "number", "op_mult", "expression", "|", "expression_terminal", "op_mult", "number", "[", "operator", "expression", "]", "|", "expression_terminal", "op_add", "[", "operator", "expression", "]", "|", "expression_terminal", "[", "operator", "expressio...
treycucco/pyebnf
python
https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/_hand_written_parser.py#L93-L140
[ "def", "expression", "(", "self", ",", "text", ")", ":", "self", ".", "_attempting", "(", "text", ")", "return", "alternation", "(", "[", "# number , op_mult , expression", "concatenation", "(", "[", "self", ".", "number", ",", "self", ".", "op_mult", ",", ...
3634ddabbe5d73508bcc20f4a591f86a46634e1d
test
Parser.expression_terminal
expression_terminal = identifier | terminal | option_group | repetition_group | grouping_group | special_handling ;
pyebnf/_hand_written_parser.py
def expression_terminal(self, text): """expression_terminal = identifier | terminal | option_group | repetition_group | grouping_group | special_handling ; """ self._attempt...
def expression_terminal(self, text): """expression_terminal = identifier | terminal | option_group | repetition_group | grouping_group | special_handling ; """ self._attempt...
[ "expression_terminal", "=", "identifier", "|", "terminal", "|", "option_group", "|", "repetition_group", "|", "grouping_group", "|", "special_handling", ";" ]
treycucco/pyebnf
python
https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/_hand_written_parser.py#L142-L158
[ "def", "expression_terminal", "(", "self", ",", "text", ")", ":", "self", ".", "_attempting", "(", "text", ")", "return", "alternation", "(", "[", "self", ".", "identifier", ",", "self", ".", "terminal", ",", "self", ".", "option_group", ",", "self", "."...
3634ddabbe5d73508bcc20f4a591f86a46634e1d
test
Parser.option_group
option_group = "[" , expression , "]" ;
pyebnf/_hand_written_parser.py
def option_group(self, text): """option_group = "[" , expression , "]" ;""" self._attempting(text) return concatenation([ "[", self.expression, "]" ], ignore_whitespace=True)(text).retyped(TokenType.option_group)
def option_group(self, text): """option_group = "[" , expression , "]" ;""" self._attempting(text) return concatenation([ "[", self.expression, "]" ], ignore_whitespace=True)(text).retyped(TokenType.option_group)
[ "option_group", "=", "[", "expression", "]", ";" ]
treycucco/pyebnf
python
https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/_hand_written_parser.py#L160-L167
[ "def", "option_group", "(", "self", ",", "text", ")", ":", "self", ".", "_attempting", "(", "text", ")", "return", "concatenation", "(", "[", "\"[\"", ",", "self", ".", "expression", ",", "\"]\"", "]", ",", "ignore_whitespace", "=", "True", ")", "(", "...
3634ddabbe5d73508bcc20f4a591f86a46634e1d
test
Parser.terminal
terminal = '"' . (printable - '"') + . '"' | "'" . (printable - "'") + . "'" ;
pyebnf/_hand_written_parser.py
def terminal(self, text): """terminal = '"' . (printable - '"') + . '"' | "'" . (printable - "'") + . "'" ; """ self._attempting(text) return alternation([ concatenation([ '"', one_or_more( exclusion(self.printable, '"') ), '"' ], ign...
def terminal(self, text): """terminal = '"' . (printable - '"') + . '"' | "'" . (printable - "'") + . "'" ; """ self._attempting(text) return alternation([ concatenation([ '"', one_or_more( exclusion(self.printable, '"') ), '"' ], ign...
[ "terminal", "=", ".", "(", "printable", "-", ")", "+", ".", "|", ".", "(", "printable", "-", ")", "+", ".", ";" ]
treycucco/pyebnf
python
https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/_hand_written_parser.py#L204-L224
[ "def", "terminal", "(", "self", ",", "text", ")", ":", "self", ".", "_attempting", "(", "text", ")", "return", "alternation", "(", "[", "concatenation", "(", "[", "'\"'", ",", "one_or_more", "(", "exclusion", "(", "self", ".", "printable", ",", "'\"'", ...
3634ddabbe5d73508bcc20f4a591f86a46634e1d
test
Parser.operator
operator = "|" | "." | "," | "-";
pyebnf/_hand_written_parser.py
def operator(self, text): """operator = "|" | "." | "," | "-";""" self._attempting(text) return alternation([ "|", ".", ",", "-" ])(text).retyped(TokenType.operator)
def operator(self, text): """operator = "|" | "." | "," | "-";""" self._attempting(text) return alternation([ "|", ".", ",", "-" ])(text).retyped(TokenType.operator)
[ "operator", "=", "|", "|", ".", "|", "|", "-", ";" ]
treycucco/pyebnf
python
https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/_hand_written_parser.py#L226-L234
[ "def", "operator", "(", "self", ",", "text", ")", ":", "self", ".", "_attempting", "(", "text", ")", "return", "alternation", "(", "[", "\"|\"", ",", "\".\"", ",", "\",\"", ",", "\"-\"", "]", ")", "(", "text", ")", ".", "retyped", "(", "TokenType", ...
3634ddabbe5d73508bcc20f4a591f86a46634e1d
test
Parser.op_mult
op_mult = "*" ;
pyebnf/_hand_written_parser.py
def op_mult(self, text): """op_mult = "*" ;""" self._attempting(text) return terminal("*")(text).retyped(TokenType.op_mult)
def op_mult(self, text): """op_mult = "*" ;""" self._attempting(text) return terminal("*")(text).retyped(TokenType.op_mult)
[ "op_mult", "=", "*", ";" ]
treycucco/pyebnf
python
https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/_hand_written_parser.py#L236-L239
[ "def", "op_mult", "(", "self", ",", "text", ")", ":", "self", ".", "_attempting", "(", "text", ")", "return", "terminal", "(", "\"*\"", ")", "(", "text", ")", ".", "retyped", "(", "TokenType", ".", "op_mult", ")" ]
3634ddabbe5d73508bcc20f4a591f86a46634e1d
test
Parser.op_add
op_add = "+" ;
pyebnf/_hand_written_parser.py
def op_add(self, text): """op_add = "+" ;""" self._attempting(text) return terminal("+")(text).retyped(TokenType.op_add)
def op_add(self, text): """op_add = "+" ;""" self._attempting(text) return terminal("+")(text).retyped(TokenType.op_add)
[ "op_add", "=", "+", ";" ]
treycucco/pyebnf
python
https://github.com/treycucco/pyebnf/blob/3634ddabbe5d73508bcc20f4a591f86a46634e1d/pyebnf/_hand_written_parser.py#L241-L244
[ "def", "op_add", "(", "self", ",", "text", ")", ":", "self", ".", "_attempting", "(", "text", ")", "return", "terminal", "(", "\"+\"", ")", "(", "text", ")", ".", "retyped", "(", "TokenType", ".", "op_add", ")" ]
3634ddabbe5d73508bcc20f4a591f86a46634e1d
test
Model.setp
Set the value (and bounds) of the named parameter. Parameters ---------- name : str The parameter name. clear_derived : bool Flag to clear derived objects in this model value: The value of the parameter, if None, it is not changed bou...
pymodeler/model.py
def setp(self, name, clear_derived=True, value=None, bounds=None, free=None, errors=None): """ Set the value (and bounds) of the named parameter. Parameters ---------- name : str The parameter name. clear_derived : bool Flag to clear...
def setp(self, name, clear_derived=True, value=None, bounds=None, free=None, errors=None): """ Set the value (and bounds) of the named parameter. Parameters ---------- name : str The parameter name. clear_derived : bool Flag to clear...
[ "Set", "the", "value", "(", "and", "bounds", ")", "of", "the", "named", "parameter", "." ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/model.py#L222-L256
[ "def", "setp", "(", "self", ",", "name", ",", "clear_derived", "=", "True", ",", "value", "=", "None", ",", "bounds", "=", "None", ",", "free", "=", "None", ",", "errors", "=", "None", ")", ":", "name", "=", "self", ".", "_mapping", ".", "get", "...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Model.set_attributes
Set a group of attributes (parameters and members). Calls `setp` directly, so kwargs can include more than just the parameter value (e.g., bounds, free, etc.).
pymodeler/model.py
def set_attributes(self, **kwargs): """ Set a group of attributes (parameters and members). Calls `setp` directly, so kwargs can include more than just the parameter value (e.g., bounds, free, etc.). """ self.clear_derived() kwargs = dict(kwargs) for name...
def set_attributes(self, **kwargs): """ Set a group of attributes (parameters and members). Calls `setp` directly, so kwargs can include more than just the parameter value (e.g., bounds, free, etc.). """ self.clear_derived() kwargs = dict(kwargs) for name...
[ "Set", "a", "group", "of", "attributes", "(", "parameters", "and", "members", ")", ".", "Calls", "setp", "directly", "so", "kwargs", "can", "include", "more", "than", "just", "the", "parameter", "value", "(", "e", ".", "g", ".", "bounds", "free", "etc", ...
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/model.py#L258-L290
[ "def", "set_attributes", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "clear_derived", "(", ")", "kwargs", "=", "dict", "(", "kwargs", ")", "for", "name", ",", "value", "in", "kwargs", ".", "items", "(", ")", ":", "# Raise AttributeErro...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Model._init_properties
Loop through the list of Properties, extract the derived and required properties and do the appropriate book-keeping
pymodeler/model.py
def _init_properties(self): """ Loop through the list of Properties, extract the derived and required properties and do the appropriate book-keeping """ self._missing = {} for k, p in self.params.items(): if p.required: self._missing[k] = p ...
def _init_properties(self): """ Loop through the list of Properties, extract the derived and required properties and do the appropriate book-keeping """ self._missing = {} for k, p in self.params.items(): if p.required: self._missing[k] = p ...
[ "Loop", "through", "the", "list", "of", "Properties", "extract", "the", "derived", "and", "required", "properties", "and", "do", "the", "appropriate", "book", "-", "keeping" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/model.py#L292-L306
[ "def", "_init_properties", "(", "self", ")", ":", "self", ".", "_missing", "=", "{", "}", "for", "k", ",", "p", "in", "self", ".", "params", ".", "items", "(", ")", ":", "if", "p", ".", "required", ":", "self", ".", "_missing", "[", "k", "]", "...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Model.get_params
Return a list of Parameter objects Parameters ---------- pname : list or None If a list get the Parameter objects with those names If none, get all the Parameter objects Returns ------- params : list list of Parameters
pymodeler/model.py
def get_params(self, pnames=None): """ Return a list of Parameter objects Parameters ---------- pname : list or None If a list get the Parameter objects with those names If none, get all the Parameter objects Returns ------- params : lis...
def get_params(self, pnames=None): """ Return a list of Parameter objects Parameters ---------- pname : list or None If a list get the Parameter objects with those names If none, get all the Parameter objects Returns ------- params : lis...
[ "Return", "a", "list", "of", "Parameter", "objects" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/model.py#L308-L333
[ "def", "get_params", "(", "self", ",", "pnames", "=", "None", ")", ":", "l", "=", "[", "]", "if", "pnames", "is", "None", ":", "pnames", "=", "self", ".", "params", ".", "keys", "(", ")", "for", "pname", "in", "pnames", ":", "p", "=", "self", "...
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Model.param_values
Return an array with the parameter values Parameters ---------- pname : list or None If a list, get the values of the `Parameter` objects with those names If none, get all values of all the `Parameter` objects Returns ------- values : `np.array`...
pymodeler/model.py
def param_values(self, pnames=None): """ Return an array with the parameter values Parameters ---------- pname : list or None If a list, get the values of the `Parameter` objects with those names If none, get all values of all the `Parameter` objects Ret...
def param_values(self, pnames=None): """ Return an array with the parameter values Parameters ---------- pname : list or None If a list, get the values of the `Parameter` objects with those names If none, get all values of all the `Parameter` objects Ret...
[ "Return", "an", "array", "with", "the", "parameter", "values" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/model.py#L335-L355
[ "def", "param_values", "(", "self", ",", "pnames", "=", "None", ")", ":", "l", "=", "self", ".", "get_params", "(", "pnames", ")", "v", "=", "[", "p", ".", "value", "for", "p", "in", "l", "]", "return", "np", ".", "array", "(", "v", ")" ]
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Model.param_errors
Return an array with the parameter errors Parameters ---------- pname : list of string or none If a list of strings, get the Parameter objects with those names If none, get all the Parameter objects Returns ------- ~numpy.array of parameter errors...
pymodeler/model.py
def param_errors(self, pnames=None): """ Return an array with the parameter errors Parameters ---------- pname : list of string or none If a list of strings, get the Parameter objects with those names If none, get all the Parameter objects Returns ...
def param_errors(self, pnames=None): """ Return an array with the parameter errors Parameters ---------- pname : list of string or none If a list of strings, get the Parameter objects with those names If none, get all the Parameter objects Returns ...
[ "Return", "an", "array", "with", "the", "parameter", "errors" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/model.py#L357-L375
[ "def", "param_errors", "(", "self", ",", "pnames", "=", "None", ")", ":", "l", "=", "self", ".", "get_params", "(", "pnames", ")", "v", "=", "[", "p", ".", "errors", "for", "p", "in", "l", "]", "return", "np", ".", "array", "(", "v", ")" ]
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
Model.clear_derived
Reset the value of all Derived properties to None This is called by setp (and by extension __setattr__)
pymodeler/model.py
def clear_derived(self): """ Reset the value of all Derived properties to None This is called by setp (and by extension __setattr__) """ for p in self.params.values(): if isinstance(p, Derived): p.clear_value()
def clear_derived(self): """ Reset the value of all Derived properties to None This is called by setp (and by extension __setattr__) """ for p in self.params.values(): if isinstance(p, Derived): p.clear_value()
[ "Reset", "the", "value", "of", "all", "Derived", "properties", "to", "None" ]
kadrlica/pymodeler
python
https://github.com/kadrlica/pymodeler/blob/f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3/pymodeler/model.py#L377-L384
[ "def", "clear_derived", "(", "self", ")", ":", "for", "p", "in", "self", ".", "params", ".", "values", "(", ")", ":", "if", "isinstance", "(", "p", ",", "Derived", ")", ":", "p", ".", "clear_value", "(", ")" ]
f426c01416fd4b8fc3afeeb6d3b5d1cb0cb8f8e3
test
PluginGetComponents.get_arguments
Extracts the specific arguments of this CLI
boundary/plugin_get_components.py
def get_arguments(self): """ Extracts the specific arguments of this CLI """ ApiCli.get_arguments(self) if self.args.pluginName is not None: self.pluginName = self.args.pluginName self.path = "v1/plugins/{0}/components".format(self.pluginName)
def get_arguments(self): """ Extracts the specific arguments of this CLI """ ApiCli.get_arguments(self) if self.args.pluginName is not None: self.pluginName = self.args.pluginName self.path = "v1/plugins/{0}/components".format(self.pluginName)
[ "Extracts", "the", "specific", "arguments", "of", "this", "CLI" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/plugin_get_components.py#L31-L39
[ "def", "get_arguments", "(", "self", ")", ":", "ApiCli", ".", "get_arguments", "(", "self", ")", "if", "self", ".", "args", ".", "pluginName", "is", "not", "None", ":", "self", ".", "pluginName", "=", "self", ".", "args", ".", "pluginName", "self", "."...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
ApiCall.method
Before assigning the value validate that is in one of the HTTP methods we implement
boundary/api_call.py
def method(self, value): """ Before assigning the value validate that is in one of the HTTP methods we implement """ keys = self._methods.keys() if value not in keys: raise AttributeError("Method value not in " + str(keys)) else: self._meth...
def method(self, value): """ Before assigning the value validate that is in one of the HTTP methods we implement """ keys = self._methods.keys() if value not in keys: raise AttributeError("Method value not in " + str(keys)) else: self._meth...
[ "Before", "assigning", "the", "value", "validate", "that", "is", "in", "one", "of", "the", "HTTP", "methods", "we", "implement" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/api_call.py#L111-L120
[ "def", "method", "(", "self", ",", "value", ")", ":", "keys", "=", "self", ".", "_methods", ".", "keys", "(", ")", "if", "value", "not", "in", "keys", ":", "raise", "AttributeError", "(", "\"Method value not in \"", "+", "str", "(", "keys", ")", ")", ...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
ApiCall._get_environment
Gets the configuration stored in environment variables
boundary/api_call.py
def _get_environment(self): """ Gets the configuration stored in environment variables """ if 'TSP_EMAIL' in os.environ: self._email = os.environ['TSP_EMAIL'] if 'TSP_API_TOKEN' in os.environ: self._api_token = os.environ['TSP_API_TOKEN'] if 'TSP_A...
def _get_environment(self): """ Gets the configuration stored in environment variables """ if 'TSP_EMAIL' in os.environ: self._email = os.environ['TSP_EMAIL'] if 'TSP_API_TOKEN' in os.environ: self._api_token = os.environ['TSP_API_TOKEN'] if 'TSP_A...
[ "Gets", "the", "configuration", "stored", "in", "environment", "variables" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/api_call.py#L146-L157
[ "def", "_get_environment", "(", "self", ")", ":", "if", "'TSP_EMAIL'", "in", "os", ".", "environ", ":", "self", ".", "_email", "=", "os", ".", "environ", "[", "'TSP_EMAIL'", "]", "if", "'TSP_API_TOKEN'", "in", "os", ".", "environ", ":", "self", ".", "_...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
ApiCall._get_url_parameters
Encode URL parameters
boundary/api_call.py
def _get_url_parameters(self): """ Encode URL parameters """ url_parameters = '' if self._url_parameters is not None: url_parameters = '?' + urllib.urlencode(self._url_parameters) return url_parameters
def _get_url_parameters(self): """ Encode URL parameters """ url_parameters = '' if self._url_parameters is not None: url_parameters = '?' + urllib.urlencode(self._url_parameters) return url_parameters
[ "Encode", "URL", "parameters" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/api_call.py#L159-L166
[ "def", "_get_url_parameters", "(", "self", ")", ":", "url_parameters", "=", "''", "if", "self", ".", "_url_parameters", "is", "not", "None", ":", "url_parameters", "=", "'?'", "+", "urllib", ".", "urlencode", "(", "self", ".", "_url_parameters", ")", "return...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
ApiCall.metric_get
Returns a metric definition identified by name :param enabled: Return only enabled metrics :param custom: Return only custom metrics :return Metrics:
boundary/api_call.py
def metric_get(self, enabled=False, custom=False): """ Returns a metric definition identified by name :param enabled: Return only enabled metrics :param custom: Return only custom metrics :return Metrics: """ self.path = 'v1/metrics?enabled={0}&{1}'.format(enabled...
def metric_get(self, enabled=False, custom=False): """ Returns a metric definition identified by name :param enabled: Return only enabled metrics :param custom: Return only custom metrics :return Metrics: """ self.path = 'v1/metrics?enabled={0}&{1}'.format(enabled...
[ "Returns", "a", "metric", "definition", "identified", "by", "name", ":", "param", "enabled", ":", "Return", "only", "enabled", "metrics", ":", "param", "custom", ":", "Return", "only", "custom", "metrics", ":", "return", "Metrics", ":" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/api_call.py#L168-L178
[ "def", "metric_get", "(", "self", ",", "enabled", "=", "False", ",", "custom", "=", "False", ")", ":", "self", ".", "path", "=", "'v1/metrics?enabled={0}&{1}'", ".", "format", "(", "enabled", ",", "custom", ")", "self", ".", "_call_api", "(", ")", "self"...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
ApiCall._do_get
HTTP Get Request
boundary/api_call.py
def _do_get(self): """ HTTP Get Request """ return requests.get(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token))
def _do_get(self): """ HTTP Get Request """ return requests.get(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token))
[ "HTTP", "Get", "Request" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/api_call.py#L186-L190
[ "def", "_do_get", "(", "self", ")", ":", "return", "requests", ".", "get", "(", "self", ".", "_url", ",", "data", "=", "self", ".", "_data", ",", "headers", "=", "self", ".", "_headers", ",", "auth", "=", "(", "self", ".", "_email", ",", "self", ...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
ApiCall._do_delete
HTTP Delete Request
boundary/api_call.py
def _do_delete(self): """ HTTP Delete Request """ return requests.delete(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token))
def _do_delete(self): """ HTTP Delete Request """ return requests.delete(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token))
[ "HTTP", "Delete", "Request" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/api_call.py#L192-L196
[ "def", "_do_delete", "(", "self", ")", ":", "return", "requests", ".", "delete", "(", "self", ".", "_url", ",", "data", "=", "self", ".", "_data", ",", "headers", "=", "self", ".", "_headers", ",", "auth", "=", "(", "self", ".", "_email", ",", "sel...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
ApiCall._do_post
HTTP Post Request
boundary/api_call.py
def _do_post(self): """ HTTP Post Request """ return requests.post(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token))
def _do_post(self): """ HTTP Post Request """ return requests.post(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token))
[ "HTTP", "Post", "Request" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/api_call.py#L198-L202
[ "def", "_do_post", "(", "self", ")", ":", "return", "requests", ".", "post", "(", "self", ".", "_url", ",", "data", "=", "self", ".", "_data", ",", "headers", "=", "self", ".", "_headers", ",", "auth", "=", "(", "self", ".", "_email", ",", "self", ...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
ApiCall._do_put
HTTP Put Request
boundary/api_call.py
def _do_put(self): """ HTTP Put Request """ return requests.put(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token))
def _do_put(self): """ HTTP Put Request """ return requests.put(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token))
[ "HTTP", "Put", "Request" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/api_call.py#L204-L208
[ "def", "_do_put", "(", "self", ")", ":", "return", "requests", ".", "put", "(", "self", ".", "_url", ",", "data", "=", "self", ".", "_data", ",", "headers", "=", "self", ".", "_headers", ",", "auth", "=", "(", "self", ".", "_email", ",", "self", ...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
ApiCall._call_api
Make an API call to get the metric definition
boundary/api_call.py
def _call_api(self): """ Make an API call to get the metric definition """ self._url = self.form_url() if self._headers is not None: logging.debug(self._headers) if self._data is not None: logging.debug(self._data) if len(self._get_url_par...
def _call_api(self): """ Make an API call to get the metric definition """ self._url = self.form_url() if self._headers is not None: logging.debug(self._headers) if self._data is not None: logging.debug(self._data) if len(self._get_url_par...
[ "Make", "an", "API", "call", "to", "get", "the", "metric", "definition" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/api_call.py#L241-L262
[ "def", "_call_api", "(", "self", ")", ":", "self", ".", "_url", "=", "self", ".", "form_url", "(", ")", "if", "self", ".", "_headers", "is", "not", "None", ":", "logging", ".", "debug", "(", "self", ".", "_headers", ")", "if", "self", ".", "_data",...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
MeasurementPlot.get_arguments
Extracts the specific arguments of this CLI
boundary/measurement_plot.py
def get_arguments(self): """ Extracts the specific arguments of this CLI """ # ApiCli.get_arguments(self) if self.args.file_name is not None: self.file_name = self.args.file_name
def get_arguments(self): """ Extracts the specific arguments of this CLI """ # ApiCli.get_arguments(self) if self.args.file_name is not None: self.file_name = self.args.file_name
[ "Extracts", "the", "specific", "arguments", "of", "this", "CLI" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/measurement_plot.py#L115-L121
[ "def", "get_arguments", "(", "self", ")", ":", "# ApiCli.get_arguments(self)", "if", "self", ".", "args", ".", "file_name", "is", "not", "None", ":", "self", ".", "file_name", "=", "self", ".", "args", ".", "file_name" ]
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
MeasurementPlot.execute
Run the steps to execute the CLI
boundary/measurement_plot.py
def execute(self): """ Run the steps to execute the CLI """ # self._get_environment() self.add_arguments() self._parse_args() self.get_arguments() if self._validate_arguments(): self._plot_data() else: print(self._message)
def execute(self): """ Run the steps to execute the CLI """ # self._get_environment() self.add_arguments() self._parse_args() self.get_arguments() if self._validate_arguments(): self._plot_data() else: print(self._message)
[ "Run", "the", "steps", "to", "execute", "the", "CLI" ]
boundary/pulse-api-cli
python
https://github.com/boundary/pulse-api-cli/blob/b01ca65b442eed19faac309c9d62bbc3cb2c098f/boundary/measurement_plot.py#L169-L180
[ "def", "execute", "(", "self", ")", ":", "# self._get_environment()", "self", ".", "add_arguments", "(", ")", "self", ".", "_parse_args", "(", ")", "self", ".", "get_arguments", "(", ")", "if", "self", ".", "_validate_arguments", "(", ")", ":", "self", "."...
b01ca65b442eed19faac309c9d62bbc3cb2c098f
test
USGSDownload.validate_sceneInfo
Check scene name and whether remote file exists. Raises WrongSceneNameError if the scene name is wrong.
usgsdownload/usgs.py
def validate_sceneInfo(self): """Check scene name and whether remote file exists. Raises WrongSceneNameError if the scene name is wrong. """ if self.sceneInfo.prefix not in self.__satellitesMap: raise WrongSceneNameError('USGS Downloader: Prefix of %s (%s) is invalid' ...
def validate_sceneInfo(self): """Check scene name and whether remote file exists. Raises WrongSceneNameError if the scene name is wrong. """ if self.sceneInfo.prefix not in self.__satellitesMap: raise WrongSceneNameError('USGS Downloader: Prefix of %s (%s) is invalid' ...
[ "Check", "scene", "name", "and", "whether", "remote", "file", "exists", ".", "Raises", "WrongSceneNameError", "if", "the", "scene", "name", "is", "wrong", "." ]
lucaslamounier/USGSDownload
python
https://github.com/lucaslamounier/USGSDownload/blob/0969483ea9f9648aa17b099f36d2e1010488b2a4/usgsdownload/usgs.py#L86-L92
[ "def", "validate_sceneInfo", "(", "self", ")", ":", "if", "self", ".", "sceneInfo", ".", "prefix", "not", "in", "self", ".", "__satellitesMap", ":", "raise", "WrongSceneNameError", "(", "'USGS Downloader: Prefix of %s (%s) is invalid'", "%", "(", "self", ".", "sce...
0969483ea9f9648aa17b099f36d2e1010488b2a4
test
USGSDownload.verify_type_product
Gets satellite id
usgsdownload/usgs.py
def verify_type_product(self, satellite): """Gets satellite id """ if satellite == 'L5': id_satellite = '3119' stations = ['GLC', 'ASA', 'KIR', 'MOR', 'KHC', 'PAC', 'KIS', 'CHM', 'LGS', 'MGR', 'COA', 'MPS'] elif satellite == 'L7': id_satellite = '3373' ...
def verify_type_product(self, satellite): """Gets satellite id """ if satellite == 'L5': id_satellite = '3119' stations = ['GLC', 'ASA', 'KIR', 'MOR', 'KHC', 'PAC', 'KIS', 'CHM', 'LGS', 'MGR', 'COA', 'MPS'] elif satellite == 'L7': id_satellite = '3373' ...
[ "Gets", "satellite", "id" ]
lucaslamounier/USGSDownload
python
https://github.com/lucaslamounier/USGSDownload/blob/0969483ea9f9648aa17b099f36d2e1010488b2a4/usgsdownload/usgs.py#L98-L112
[ "def", "verify_type_product", "(", "self", ",", "satellite", ")", ":", "if", "satellite", "==", "'L5'", ":", "id_satellite", "=", "'3119'", "stations", "=", "[", "'GLC'", ",", "'ASA'", ",", "'KIR'", ",", "'MOR'", ",", "'KHC'", ",", "'PAC'", ",", "'KIS'",...
0969483ea9f9648aa17b099f36d2e1010488b2a4