nwo
stringlengths
5
106
sha
stringlengths
40
40
path
stringlengths
4
174
language
stringclasses
1 value
identifier
stringlengths
1
140
parameters
stringlengths
0
87.7k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
426k
docstring
stringlengths
0
64.3k
docstring_summary
stringlengths
0
26.3k
docstring_tokens
list
function
stringlengths
18
4.83M
function_tokens
list
url
stringlengths
83
304
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/symbolic/callable.py
python
CallableSymbolicExpressionRingFactory.create_key
(self, args, check=True)
return args
EXAMPLES:: sage: x,y = var('x,y') sage: CallableSymbolicExpressionRing.create_key((x,y)) (x, y)
EXAMPLES::
[ "EXAMPLES", "::" ]
def create_key(self, args, check=True): """ EXAMPLES:: sage: x,y = var('x,y') sage: CallableSymbolicExpressionRing.create_key((x,y)) (x, y) """ if check: from sage.symbolic.ring import is_SymbolicVariable if len(args) == 1 and ...
[ "def", "create_key", "(", "self", ",", "args", ",", "check", "=", "True", ")", ":", "if", "check", ":", "from", "sage", ".", "symbolic", ".", "ring", "import", "is_SymbolicVariable", "if", "len", "(", "args", ")", "==", "1", "and", "isinstance", "(", ...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/symbolic/callable.py#L478-L494
tensorlayer/hyperpose
e34c6acb91144e1d090466324f99c521fbf47cdb
hyperpose/Model/openpose/utils.py
python
vis_annos
(image, annos, save_dir ,name='')
Save results for debugging. Parameters ----------- images : single RGB image annos : annotation, list of lists
Save results for debugging.
[ "Save", "results", "for", "debugging", "." ]
def vis_annos(image, annos, save_dir ,name=''): """Save results for debugging. Parameters ----------- images : single RGB image annos : annotation, list of lists """ fig = plt.figure(figsize=(8, 8)) a = fig.add_subplot(1, 1, 1) plt.imshow(image) for people in annos: f...
[ "def", "vis_annos", "(", "image", ",", "annos", ",", "save_dir", ",", "name", "=", "''", ")", ":", "fig", "=", "plt", ".", "figure", "(", "figsize", "=", "(", "8", ",", "8", ")", ")", "a", "=", "fig", ".", "add_subplot", "(", "1", ",", "1", "...
https://github.com/tensorlayer/hyperpose/blob/e34c6acb91144e1d090466324f99c521fbf47cdb/hyperpose/Model/openpose/utils.py#L328-L346
yaqwsx/PcbDraw
09720d46f3fdb8b01c2b0e2eca39d964552e94a0
versioneer.py
python
render_git_describe
(pieces)
return rendered
TAG[-DISTANCE-gHEX][-dirty]. Like 'git describe --tags --dirty --always'. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix)
TAG[-DISTANCE-gHEX][-dirty].
[ "TAG", "[", "-", "DISTANCE", "-", "gHEX", "]", "[", "-", "dirty", "]", "." ]
def render_git_describe(pieces): """TAG[-DISTANCE-gHEX][-dirty]. Like 'git describe --tags --dirty --always'. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered +=...
[ "def", "render_git_describe", "(", "pieces", ")", ":", "if", "pieces", "[", "\"closest-tag\"", "]", ":", "rendered", "=", "pieces", "[", "\"closest-tag\"", "]", "if", "pieces", "[", "\"distance\"", "]", ":", "rendered", "+=", "\"-%d-g%s\"", "%", "(", "pieces...
https://github.com/yaqwsx/PcbDraw/blob/09720d46f3fdb8b01c2b0e2eca39d964552e94a0/versioneer.py#L1326-L1343
roclark/sportsipy
c19f545d3376d62ded6304b137dc69238ac620a9
sportsipy/ncaab/boxscore.py
python
Boxscores.__repr__
(self)
return self.__str__()
Return the string representation of the class.
Return the string representation of the class.
[ "Return", "the", "string", "representation", "of", "the", "class", "." ]
def __repr__(self): """ Return the string representation of the class. """ return self.__str__()
[ "def", "__repr__", "(", "self", ")", ":", "return", "self", ".", "__str__", "(", ")" ]
https://github.com/roclark/sportsipy/blob/c19f545d3376d62ded6304b137dc69238ac620a9/sportsipy/ncaab/boxscore.py#L1612-L1616
plotly/plotly.py
cfad7862594b35965c0e000813bd7805e8494a5b
packages/python/plotly/plotly/graph_objs/histogram2d/legendgrouptitle/_font.py
python
Font.size
(self)
return self["size"]
The 'size' property is a number and may be specified as: - An int or float in the interval [1, inf] Returns ------- int|float
The 'size' property is a number and may be specified as: - An int or float in the interval [1, inf]
[ "The", "size", "property", "is", "a", "number", "and", "may", "be", "specified", "as", ":", "-", "An", "int", "or", "float", "in", "the", "interval", "[", "1", "inf", "]" ]
def size(self): """ The 'size' property is a number and may be specified as: - An int or float in the interval [1, inf] Returns ------- int|float """ return self["size"]
[ "def", "size", "(", "self", ")", ":", "return", "self", "[", "\"size\"", "]" ]
https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/histogram2d/legendgrouptitle/_font.py#L104-L113
lad1337/XDM
0c1b7009fe00f06f102a6f67c793478f515e7efe
site-packages/babel/numbers.py
python
get_decimal_symbol
(locale=LC_NUMERIC)
return Locale.parse(locale).number_symbols.get('decimal', u'.')
Return the symbol used by the locale to separate decimal fractions. >>> get_decimal_symbol('en_US') u'.' :param locale: the `Locale` object or locale identifier
Return the symbol used by the locale to separate decimal fractions.
[ "Return", "the", "symbol", "used", "by", "the", "locale", "to", "separate", "decimal", "fractions", "." ]
def get_decimal_symbol(locale=LC_NUMERIC): """Return the symbol used by the locale to separate decimal fractions. >>> get_decimal_symbol('en_US') u'.' :param locale: the `Locale` object or locale identifier """ return Locale.parse(locale).number_symbols.get('decimal', u'.')
[ "def", "get_decimal_symbol", "(", "locale", "=", "LC_NUMERIC", ")", ":", "return", "Locale", ".", "parse", "(", "locale", ")", ".", "number_symbols", ".", "get", "(", "'decimal'", ",", "u'.'", ")" ]
https://github.com/lad1337/XDM/blob/0c1b7009fe00f06f102a6f67c793478f515e7efe/site-packages/babel/numbers.py#L66-L74
JaniceWuo/MovieRecommend
4c86db64ca45598917d304f535413df3bc9fea65
movierecommend/venv1/Lib/site-packages/django/db/backends/oracle/base.py
python
DatabaseWrapper._connect_string
(self)
return "%s/%s@%s" % (settings_dict['USER'], settings_dict['PASSWORD'], dsn)
[]
def _connect_string(self): settings_dict = self.settings_dict if not settings_dict['HOST'].strip(): settings_dict['HOST'] = 'localhost' if settings_dict['PORT']: dsn = Database.makedsn(settings_dict['HOST'], int(settings_dict['PORT']), ...
[ "def", "_connect_string", "(", "self", ")", ":", "settings_dict", "=", "self", ".", "settings_dict", "if", "not", "settings_dict", "[", "'HOST'", "]", ".", "strip", "(", ")", ":", "settings_dict", "[", "'HOST'", "]", "=", "'localhost'", "if", "settings_dict"...
https://github.com/JaniceWuo/MovieRecommend/blob/4c86db64ca45598917d304f535413df3bc9fea65/movierecommend/venv1/Lib/site-packages/django/db/backends/oracle/base.py#L189-L200
AppScale/gts
46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9
AppServer/google/appengine/api/datastore.py
python
_PopConnection
()
return _thread_local.connection_stack.pop()
Internal method to restores the previous connection. Returns: The current connection.
Internal method to restores the previous connection.
[ "Internal", "method", "to", "restores", "the", "previous", "connection", "." ]
def _PopConnection(): """Internal method to restores the previous connection. Returns: The current connection. """ assert len(_thread_local.connection_stack) >= 2 return _thread_local.connection_stack.pop()
[ "def", "_PopConnection", "(", ")", ":", "assert", "len", "(", "_thread_local", ".", "connection_stack", ")", ">=", "2", "return", "_thread_local", ".", "connection_stack", ".", "pop", "(", ")" ]
https://github.com/AppScale/gts/blob/46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9/AppServer/google/appengine/api/datastore.py#L410-L418
makerbot/ReplicatorG
d6f2b07785a5a5f1e172fb87cb4303b17c575d5d
skein_engines/skeinforge-50/skeinforge_application/skeinforge_plugins/craft_plugins/mill.py
python
getNewRepository
()
return MillRepository()
Get new repository.
Get new repository.
[ "Get", "new", "repository", "." ]
def getNewRepository(): 'Get new repository.' return MillRepository()
[ "def", "getNewRepository", "(", ")", ":", "return", "MillRepository", "(", ")" ]
https://github.com/makerbot/ReplicatorG/blob/d6f2b07785a5a5f1e172fb87cb4303b17c575d5d/skein_engines/skeinforge-50/skeinforge_application/skeinforge_plugins/craft_plugins/mill.py#L95-L97
zopefoundation/Zope
ea04dd670d1a48d4d5c879d3db38fc2e9b4330bb
src/ZPublisher/BeforeTraverse.py
python
unregisterBeforeTraverse
(container, app_handle)
return objects
Unregister a __before_traverse__ hook object, given its 'app_handle'. Returns a list of unregistered objects.
Unregister a __before_traverse__ hook object, given its 'app_handle'.
[ "Unregister", "a", "__before_traverse__", "hook", "object", "given", "its", "app_handle", "." ]
def unregisterBeforeTraverse(container, app_handle): """Unregister a __before_traverse__ hook object, given its 'app_handle'. Returns a list of unregistered objects.""" btr = getattr(container, '__before_traverse__', {}) objects = [] for k in list(btr.keys()): if k[1] == app_handle: ...
[ "def", "unregisterBeforeTraverse", "(", "container", ",", "app_handle", ")", ":", "btr", "=", "getattr", "(", "container", ",", "'__before_traverse__'", ",", "{", "}", ")", "objects", "=", "[", "]", "for", "k", "in", "list", "(", "btr", ".", "keys", "(",...
https://github.com/zopefoundation/Zope/blob/ea04dd670d1a48d4d5c879d3db38fc2e9b4330bb/src/ZPublisher/BeforeTraverse.py#L41-L53
dropbox/dropbox-sdk-python
015437429be224732990041164a21a0501235db1
dropbox/sharing.py
python
GetFileMetadataIndividualResult.is_metadata
(self)
return self._tag == 'metadata'
Check if the union tag is ``metadata``. :rtype: bool
Check if the union tag is ``metadata``.
[ "Check", "if", "the", "union", "tag", "is", "metadata", "." ]
def is_metadata(self): """ Check if the union tag is ``metadata``. :rtype: bool """ return self._tag == 'metadata'
[ "def", "is_metadata", "(", "self", ")", ":", "return", "self", ".", "_tag", "==", "'metadata'" ]
https://github.com/dropbox/dropbox-sdk-python/blob/015437429be224732990041164a21a0501235db1/dropbox/sharing.py#L3096-L3102
log2timeline/plaso
fe2e316b8c76a0141760c0f2f181d84acb83abc2
plaso/storage/time_range.py
python
TimeRange.__init__
(self, start_timestamp, end_timestamp)
Initializes a date and time range. The timestamp are integers containing the number of microseconds since January 1, 1970, 00:00:00 UTC. Args: start_timestamp (int): timestamp that marks the start of the range. end_timestamp (int): timestamp that marks the end of the range. Raises: ...
Initializes a date and time range.
[ "Initializes", "a", "date", "and", "time", "range", "." ]
def __init__(self, start_timestamp, end_timestamp): """Initializes a date and time range. The timestamp are integers containing the number of microseconds since January 1, 1970, 00:00:00 UTC. Args: start_timestamp (int): timestamp that marks the start of the range. end_timestamp (int): tim...
[ "def", "__init__", "(", "self", ",", "start_timestamp", ",", "end_timestamp", ")", ":", "if", "start_timestamp", "is", "None", "or", "end_timestamp", "is", "None", ":", "raise", "ValueError", "(", "'Time range must have either a start and an end timestamp.'", ")", "if...
https://github.com/log2timeline/plaso/blob/fe2e316b8c76a0141760c0f2f181d84acb83abc2/plaso/storage/time_range.py#L17-L41
hugapi/hug
8b5ac00632543addfdcecc326d0475a685a0cba7
hug/use.py
python
Service.options
(self, url, url_params=empty.dict, headers=empty.dict, timeout=None, **params)
return self.request("OPTIONS", url=url, headers=headers, timeout=timeout, **params)
Calls the service at the specified URL using the "OPTIONS" method
Calls the service at the specified URL using the "OPTIONS" method
[ "Calls", "the", "service", "at", "the", "specified", "URL", "using", "the", "OPTIONS", "method" ]
def options(self, url, url_params=empty.dict, headers=empty.dict, timeout=None, **params): """Calls the service at the specified URL using the "OPTIONS" method""" return self.request("OPTIONS", url=url, headers=headers, timeout=timeout, **params)
[ "def", "options", "(", "self", ",", "url", ",", "url_params", "=", "empty", ".", "dict", ",", "headers", "=", "empty", ".", "dict", ",", "timeout", "=", "None", ",", "*", "*", "params", ")", ":", "return", "self", ".", "request", "(", "\"OPTIONS\"", ...
https://github.com/hugapi/hug/blob/8b5ac00632543addfdcecc326d0475a685a0cba7/hug/use.py#L84-L86
paulwinex/pw_Houdini_VEX_Editor
a4b24d79e3cf4823e035b9bd680cf00b5bcd5611
pw_VEX_Editor/autocomplete/vex_parser.py
python
Parser.parse_block
(self, i, index=0)
return i, index
Parse comments
Parse comments
[ "Parse", "comments" ]
def parse_block(self, i, index=0): """ Parse comments """ self.start = index state = S_CODE while True: if not i: return i, index try: c = i.next() index += 1 except StopIteration: ...
[ "def", "parse_block", "(", "self", ",", "i", ",", "index", "=", "0", ")", ":", "self", ".", "start", "=", "index", "state", "=", "S_CODE", "while", "True", ":", "if", "not", "i", ":", "return", "i", ",", "index", "try", ":", "c", "=", "i", ".",...
https://github.com/paulwinex/pw_Houdini_VEX_Editor/blob/a4b24d79e3cf4823e035b9bd680cf00b5bcd5611/pw_VEX_Editor/autocomplete/vex_parser.py#L127-L196
learningequality/kolibri
d056dbc477aaf651ab843caa141a6a1e0a491046
kolibri/core/discovery/utils/network/broadcast.py
python
build_broadcast_instance
(port)
return KolibriInstance( device_info.get("instance_id"), port=port, device_info=device_info, ip=USE_IP_OF_OUTGOING_INTERFACE, )
Builds our instance for broadcasting on the network with current device information
Builds our instance for broadcasting on the network with current device information
[ "Builds", "our", "instance", "for", "broadcasting", "on", "the", "network", "with", "current", "device", "information" ]
def build_broadcast_instance(port): """ Builds our instance for broadcasting on the network with current device information """ device_info = get_device_info() return KolibriInstance( device_info.get("instance_id"), port=port, device_info=device_info, ip=USE_IP_OF_OUT...
[ "def", "build_broadcast_instance", "(", "port", ")", ":", "device_info", "=", "get_device_info", "(", ")", "return", "KolibriInstance", "(", "device_info", ".", "get", "(", "\"instance_id\"", ")", ",", "port", "=", "port", ",", "device_info", "=", "device_info",...
https://github.com/learningequality/kolibri/blob/d056dbc477aaf651ab843caa141a6a1e0a491046/kolibri/core/discovery/utils/network/broadcast.py#L196-L206
goace/personal-file-sharing-center
4a5b903b003f2db1306e77c5e51b6660fc5dbc6a
web/template.py
python
Render._lookup
(self, name)
[]
def _lookup(self, name): path = os.path.join(self._loc, name) if os.path.isdir(path): return 'dir', path else: path = self._findfile(path) if path: return 'file', path else: return 'none', None
[ "def", "_lookup", "(", "self", ",", "name", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "_loc", ",", "name", ")", "if", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "return", "'dir'", ",", "path", "else",...
https://github.com/goace/personal-file-sharing-center/blob/4a5b903b003f2db1306e77c5e51b6660fc5dbc6a/web/template.py#L982-L991
nucleic/enaml
65c2a2a2d765e88f2e1103046680571894bb41ed
enaml/core/parser/base_parser.py
python
BaseEnamlParser.p_and_expr2
(self, p)
and_expr : shift_expr and_expr_list
and_expr : shift_expr and_expr_list
[ "and_expr", ":", "shift_expr", "and_expr_list" ]
def p_and_expr2(self, p): ''' and_expr : shift_expr and_expr_list ''' node = p[1] for op, right in p[2]: node = ast.BinOp(left=node, op=op, right=right) p[0] = node
[ "def", "p_and_expr2", "(", "self", ",", "p", ")", ":", "node", "=", "p", "[", "1", "]", "for", "op", ",", "right", "in", "p", "[", "2", "]", ":", "node", "=", "ast", ".", "BinOp", "(", "left", "=", "node", ",", "op", "=", "op", ",", "right"...
https://github.com/nucleic/enaml/blob/65c2a2a2d765e88f2e1103046680571894bb41ed/enaml/core/parser/base_parser.py#L2323-L2328
replit-archive/empythoned
977ec10ced29a3541a4973dc2b59910805695752
cpython/Lib/hmac.py
python
HMAC.hexdigest
(self)
return h.hexdigest()
Like digest(), but returns a string of hexadecimal digits instead.
Like digest(), but returns a string of hexadecimal digits instead.
[ "Like", "digest", "()", "but", "returns", "a", "string", "of", "hexadecimal", "digits", "instead", "." ]
def hexdigest(self): """Like digest(), but returns a string of hexadecimal digits instead. """ h = self._current() return h.hexdigest()
[ "def", "hexdigest", "(", "self", ")", ":", "h", "=", "self", ".", "_current", "(", ")", "return", "h", ".", "hexdigest", "(", ")" ]
https://github.com/replit-archive/empythoned/blob/977ec10ced29a3541a4973dc2b59910805695752/cpython/Lib/hmac.py#L116-L120
jsvine/spectra
644331717f0320f3dbe6a83efafa729d04303146
spectra/grapefruit.py
python
Color.LighterColor
(self, level)
return Color((h, s, min(l + level, 1)), 'hsl', self.__a, self.__wref)
Create a new instance based on this one but lighter. Parameters: :level: The amount by which the color should be lightened to produce the new one [0...1]. Returns: A grapefruit.Color instance. >>> Color.NewFromHsl(30, 1, 0.5).LighterColor(0.25) (1.0, 0.75, 0.5, 1.0) >>...
Create a new instance based on this one but lighter.
[ "Create", "a", "new", "instance", "based", "on", "this", "one", "but", "lighter", "." ]
def LighterColor(self, level): '''Create a new instance based on this one but lighter. Parameters: :level: The amount by which the color should be lightened to produce the new one [0...1]. Returns: A grapefruit.Color instance. >>> Color.NewFromHsl(30, 1, 0.5).LighterColor(...
[ "def", "LighterColor", "(", "self", ",", "level", ")", ":", "h", ",", "s", ",", "l", "=", "self", ".", "__hsl", "return", "Color", "(", "(", "h", ",", "s", ",", "min", "(", "l", "+", "level", ",", "1", ")", ")", ",", "'hsl'", ",", "self", "...
https://github.com/jsvine/spectra/blob/644331717f0320f3dbe6a83efafa729d04303146/spectra/grapefruit.py#L1685-L1703
gramps-project/gramps
04d4651a43eb210192f40a9f8c2bad8ee8fa3753
gramps/plugins/docgen/svgdrawdoc.py
python
SvgDrawDoc.draw_text
(self, style, text, x, y, mark=None)
@param mark: IndexMark to use for indexing (not supported)
[]
def draw_text(self, style, text, x, y, mark=None): """ @param mark: IndexMark to use for indexing (not supported) """ x += self.paper.get_left_margin() y += self.paper.get_top_margin() style_sheet = self.get_style_sheet() box_style = style_sheet.get_draw_style(style) pa...
[ "def", "draw_text", "(", "self", ",", "style", ",", "text", ",", "x", ",", "y", ",", "mark", "=", "None", ")", ":", "x", "+=", "self", ".", "paper", ".", "get_left_margin", "(", ")", "y", "+=", "self", ".", "paper", ".", "get_top_margin", "(", ")...
https://github.com/gramps-project/gramps/blob/04d4651a43eb210192f40a9f8c2bad8ee8fa3753/gramps/plugins/docgen/svgdrawdoc.py#L280-L312
psychopy/psychopy
01b674094f38d0e0bd51c45a6f66f671d7041696
psychopy/visual/secondorder.py
python
EnvelopeGrating.beat
(self, value)
Beat (True) stimulus or full moduaiton (False) 'The differences is that the spatial frequency components of the carrier are absent in a beat (although the carrier will still be a visible component of the overall image) whereas they are present in a full modulation. Beats will always appear to h...
Beat (True) stimulus or full moduaiton (False)
[ "Beat", "(", "True", ")", "stimulus", "or", "full", "moduaiton", "(", "False", ")" ]
def beat(self, value): """Beat (True) stimulus or full moduaiton (False) 'The differences is that the spatial frequency components of the carrier are absent in a beat (although the carrier will still be a visible component of the overall image) whereas they are present in a full modulat...
[ "def", "beat", "(", "self", ",", "value", ")", ":", "if", "value", "in", "[", "'True'", ",", "'true'", ",", "'Yes'", ",", "'yes'", ",", "'Y'", ",", "'y'", "]", ":", "self", ".", "__dict__", "[", "'beat'", "]", "=", "True", "elif", "value", "in", ...
https://github.com/psychopy/psychopy/blob/01b674094f38d0e0bd51c45a6f66f671d7041696/psychopy/visual/secondorder.py#L291-L307
pypa/pipenv
b21baade71a86ab3ee1429f71fbc14d4f95fb75d
pipenv/vendor/click/types.py
python
Choice.convert
( self, value: t.Any, param: t.Optional["Parameter"], ctx: t.Optional["Context"] )
[]
def convert( self, value: t.Any, param: t.Optional["Parameter"], ctx: t.Optional["Context"] ) -> t.Any: # Match through normalization and case sensitivity # first do token_normalize_func, then lowercase # preserve original `value` to produce an accurate message in # `self.fai...
[ "def", "convert", "(", "self", ",", "value", ":", "t", ".", "Any", ",", "param", ":", "t", ".", "Optional", "[", "\"Parameter\"", "]", ",", "ctx", ":", "t", ".", "Optional", "[", "\"Context\"", "]", ")", "->", "t", ".", "Any", ":", "# Match through...
https://github.com/pypa/pipenv/blob/b21baade71a86ab3ee1429f71fbc14d4f95fb75d/pipenv/vendor/click/types.py#L260-L296
semente/django-smuggler
524b99f1de8cb981ee5a313a605282a6bf29c16e
smuggler/views.py
python
dump_data
(request)
return dump_to_response( request, app_label=app_label, exclude=settings.SMUGGLER_EXCLUDE_LIST )
Exports data from whole project.
Exports data from whole project.
[ "Exports", "data", "from", "whole", "project", "." ]
def dump_data(request): """Exports data from whole project.""" # Try to grab app_label data app_label = request.GET.get("app_label", []) if app_label: app_label = app_label.split(",") return dump_to_response( request, app_label=app_label, exclude=settings.SMUGGLER_EXCLUDE_LIST )
[ "def", "dump_data", "(", "request", ")", ":", "# Try to grab app_label data", "app_label", "=", "request", ".", "GET", ".", "get", "(", "\"app_label\"", ",", "[", "]", ")", "if", "app_label", ":", "app_label", "=", "app_label", ".", "split", "(", "\",\"", ...
https://github.com/semente/django-smuggler/blob/524b99f1de8cb981ee5a313a605282a6bf29c16e/smuggler/views.py#L63-L71
pypa/pip
7f8a6844037fb7255cfd0d34ff8e8cf44f2598d4
src/pip/_vendor/distlib/_backport/tarfile.py
python
TarInfo._create_pax_generic_header
(cls, pax_headers, type, encoding)
return cls._create_header(info, USTAR_FORMAT, "ascii", "replace") + \ cls._create_payload(records)
Return a POSIX.1-2008 extended or global header sequence that contains a list of keyword, value pairs. The values must be strings.
Return a POSIX.1-2008 extended or global header sequence that contains a list of keyword, value pairs. The values must be strings.
[ "Return", "a", "POSIX", ".", "1", "-", "2008", "extended", "or", "global", "header", "sequence", "that", "contains", "a", "list", "of", "keyword", "value", "pairs", ".", "The", "values", "must", "be", "strings", "." ]
def _create_pax_generic_header(cls, pax_headers, type, encoding): """Return a POSIX.1-2008 extended or global header sequence that contains a list of keyword, value pairs. The values must be strings. """ # Check if one of the fields contains surrogate characters and thereby...
[ "def", "_create_pax_generic_header", "(", "cls", ",", "pax_headers", ",", "type", ",", "encoding", ")", ":", "# Check if one of the fields contains surrogate characters and thereby", "# forces hdrcharset=BINARY, see _proc_pax() for more information.", "binary", "=", "False", "for",...
https://github.com/pypa/pip/blob/7f8a6844037fb7255cfd0d34ff8e8cf44f2598d4/src/pip/_vendor/distlib/_backport/tarfile.py#L1169-L1217
mesalock-linux/mesapy
ed546d59a21b36feb93e2309d5c6b75aa0ad95c9
pypy/objspace/std/bytesobject.py
python
W_AbstractBytesObject.descr_endswith
(self, space, w_suffix, w_start=None, w_end=None)
S.endswith(suffix[, start[, end]]) -> bool Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.
S.endswith(suffix[, start[, end]]) -> bool
[ "S", ".", "endswith", "(", "suffix", "[", "start", "[", "end", "]]", ")", "-", ">", "bool" ]
def descr_endswith(self, space, w_suffix, w_start=None, w_end=None): """S.endswith(suffix[, start[, end]]) -> bool Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that positi...
[ "def", "descr_endswith", "(", "self", ",", "space", ",", "w_suffix", ",", "w_start", "=", "None", ",", "w_end", "=", "None", ")", ":" ]
https://github.com/mesalock-linux/mesapy/blob/ed546d59a21b36feb93e2309d5c6b75aa0ad95c9/pypy/objspace/std/bytesobject.py#L173-L180
Pymol-Scripts/Pymol-script-repo
bcd7bb7812dc6db1595953dfa4471fa15fb68c77
modules/ADT/mglutil/gui/BasicWidgets/Tk/trees/tree.py
python
KeySelectable.selectItem
(self, item)
do what has to be done to show what matches the typed string
do what has to be done to show what matches the typed string
[ "do", "what", "has", "to", "be", "done", "to", "show", "what", "matches", "the", "typed", "string" ]
def selectItem(self, item): """do what has to be done to show what matches the typed string""" print 'selecting item', item
[ "def", "selectItem", "(", "self", ",", "item", ")", ":", "print", "'selecting item'", ",", "item" ]
https://github.com/Pymol-Scripts/Pymol-script-repo/blob/bcd7bb7812dc6db1595953dfa4471fa15fb68c77/modules/ADT/mglutil/gui/BasicWidgets/Tk/trees/tree.py#L163-L165
AppScale/gts
46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9
AppServer/google/appengine/_internal/django/template/defaultfilters.py
python
length_is
(value, arg)
Returns a boolean of whether the value's length is the argument.
Returns a boolean of whether the value's length is the argument.
[ "Returns", "a", "boolean", "of", "whether", "the", "value", "s", "length", "is", "the", "argument", "." ]
def length_is(value, arg): """Returns a boolean of whether the value's length is the argument.""" try: return len(value) == int(arg) except (ValueError, TypeError): return ''
[ "def", "length_is", "(", "value", ",", "arg", ")", ":", "try", ":", "return", "len", "(", "value", ")", "==", "int", "(", "arg", ")", "except", "(", "ValueError", ",", "TypeError", ")", ":", "return", "''" ]
https://github.com/AppScale/gts/blob/46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9/AppServer/google/appengine/_internal/django/template/defaultfilters.py#L510-L515
osmr/imgclsmob
f2993d3ce73a2f7ddba05da3891defb08547d504
chainer_/chainercv2/models/mobilenet_cub.py
python
mobilenet_wd2_cub
(classes=200, **kwargs)
return get_mobilenet(classes=classes, width_scale=0.5, model_name="mobilenet_wd2_cub", **kwargs)
0.5 MobileNet-224 model for CUB-200-2011 from 'MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications,' https://arxiv.org/abs/1704.04861. Parameters: ---------- classes : int, default 200 Number of classification classes. pretrained : bool, default False ...
0.5 MobileNet-224 model for CUB-200-2011 from 'MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications,' https://arxiv.org/abs/1704.04861.
[ "0", ".", "5", "MobileNet", "-", "224", "model", "for", "CUB", "-", "200", "-", "2011", "from", "MobileNets", ":", "Efficient", "Convolutional", "Neural", "Networks", "for", "Mobile", "Vision", "Applications", "https", ":", "//", "arxiv", ".", "org", "/", ...
def mobilenet_wd2_cub(classes=200, **kwargs): """ 0.5 MobileNet-224 model for CUB-200-2011 from 'MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications,' https://arxiv.org/abs/1704.04861. Parameters: ---------- classes : int, default 200 Number of classificat...
[ "def", "mobilenet_wd2_cub", "(", "classes", "=", "200", ",", "*", "*", "kwargs", ")", ":", "return", "get_mobilenet", "(", "classes", "=", "classes", ",", "width_scale", "=", "0.5", ",", "model_name", "=", "\"mobilenet_wd2_cub\"", ",", "*", "*", "kwargs", ...
https://github.com/osmr/imgclsmob/blob/f2993d3ce73a2f7ddba05da3891defb08547d504/chainer_/chainercv2/models/mobilenet_cub.py#L50-L64
IntelLabs/nlp-architect
60afd0dd1bfd74f01b4ac8f613cb484777b80284
examples/sparse_gnmt/gnmt/utils/evaluation_utils.py
python
_bleu
(ref_file, trans_file, subword_option=None)
return 100 * bleu_score
Compute BLEU scores and handling BPE.
Compute BLEU scores and handling BPE.
[ "Compute", "BLEU", "scores", "and", "handling", "BPE", "." ]
def _bleu(ref_file, trans_file, subword_option=None): """Compute BLEU scores and handling BPE.""" max_order = 4 smooth = False ref_files = [ref_file] reference_text = [] for reference_filename in ref_files: with codecs.getreader("utf-8")(tf.gfile.GFile(reference_filename, "rb")) as fh: ...
[ "def", "_bleu", "(", "ref_file", ",", "trans_file", ",", "subword_option", "=", "None", ")", ":", "max_order", "=", "4", "smooth", "=", "False", "ref_files", "=", "[", "ref_file", "]", "reference_text", "=", "[", "]", "for", "reference_filename", "in", "re...
https://github.com/IntelLabs/nlp-architect/blob/60afd0dd1bfd74f01b4ac8f613cb484777b80284/examples/sparse_gnmt/gnmt/utils/evaluation_utils.py#L81-L110
andyzsf/TuShare
92787ad0cd492614bdb6389b71a19c80d1c8c9ae
tushare/futures/ctp/futures/__init__.py
python
TraderApi.OnRspUserLogout
(self, pUserLogout, pRspInfo, nRequestID, bIsLast)
登出请求响应
登出请求响应
[ "登出请求响应" ]
def OnRspUserLogout(self, pUserLogout, pRspInfo, nRequestID, bIsLast): """登出请求响应"""
[ "def", "OnRspUserLogout", "(", "self", ",", "pUserLogout", ",", "pRspInfo", ",", "nRequestID", ",", "bIsLast", ")", ":" ]
https://github.com/andyzsf/TuShare/blob/92787ad0cd492614bdb6389b71a19c80d1c8c9ae/tushare/futures/ctp/futures/__init__.py#L394-L395
facebookresearch/hydra
9b2f4d54b328d1551aa70a241a1d638cbe046367
plugins/hydra_rq_launcher/hydra_plugins/hydra_rq_launcher/rq_launcher.py
python
RQLauncher.launch
( self, job_overrides: Sequence[Sequence[str]], initial_job_idx: int )
return _core.launch( launcher=self, job_overrides=job_overrides, initial_job_idx=initial_job_idx )
[]
def launch( self, job_overrides: Sequence[Sequence[str]], initial_job_idx: int ) -> Sequence[JobReturn]: from . import _core return _core.launch( launcher=self, job_overrides=job_overrides, initial_job_idx=initial_job_idx )
[ "def", "launch", "(", "self", ",", "job_overrides", ":", "Sequence", "[", "Sequence", "[", "str", "]", "]", ",", "initial_job_idx", ":", "int", ")", "->", "Sequence", "[", "JobReturn", "]", ":", "from", ".", "import", "_core", "return", "_core", ".", "...
https://github.com/facebookresearch/hydra/blob/9b2f4d54b328d1551aa70a241a1d638cbe046367/plugins/hydra_rq_launcher/hydra_plugins/hydra_rq_launcher/rq_launcher.py#L39-L46
jesparza/peepdf
c74dc65c0ac7e506bae4f2582a2435ec50741f40
PDFCrypto.py
python
computeObjectKey
(id, generationNum, encryptionKey, keyLengthBytes, algorithm = 'RC4')
Compute the key necessary to encrypt each object, depending on the id and generation number. Only necessary with /V < 5. @param id: The object id @param generationNum: The generation number of the object @param encryptionKey: The encryption key @param keyLengthBytes: The length ...
Compute the key necessary to encrypt each object, depending on the id and generation number. Only necessary with /V < 5.
[ "Compute", "the", "key", "necessary", "to", "encrypt", "each", "object", "depending", "on", "the", "id", "and", "generation", "number", ".", "Only", "necessary", "with", "/", "V", "<", "5", "." ]
def computeObjectKey(id, generationNum, encryptionKey, keyLengthBytes, algorithm = 'RC4'): ''' Compute the key necessary to encrypt each object, depending on the id and generation number. Only necessary with /V < 5. @param id: The object id @param generationNum: The generation numbe...
[ "def", "computeObjectKey", "(", "id", ",", "generationNum", ",", "encryptionKey", ",", "keyLengthBytes", ",", "algorithm", "=", "'RC4'", ")", ":", "try", ":", "key", "=", "encryptionKey", "+", "struct", ".", "pack", "(", "'<i'", ",", "id", ")", "[", ":",...
https://github.com/jesparza/peepdf/blob/c74dc65c0ac7e506bae4f2582a2435ec50741f40/PDFCrypto.py#L89-L112
tp4a/teleport
1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad
server/www/packages/packages-windows/x86/ldap3/abstract/cursor.py
python
Writer._refresh_object
(self, entry_dn, attributes=None, tries=4, seconds=2, controls=None)
Performs the LDAP search operation SINGLE_OBJECT scope :return: Entry found in search
Performs the LDAP search operation SINGLE_OBJECT scope
[ "Performs", "the", "LDAP", "search", "operation", "SINGLE_OBJECT", "scope" ]
def _refresh_object(self, entry_dn, attributes=None, tries=4, seconds=2, controls=None): # base must be a single dn """Performs the LDAP search operation SINGLE_OBJECT scope :return: Entry found in search """ if log_enabled(PROTOCOL): log(PROTOCOL, 'refreshing object <%s> ...
[ "def", "_refresh_object", "(", "self", ",", "entry_dn", ",", "attributes", "=", "None", ",", "tries", "=", "4", ",", "seconds", "=", "2", ",", "controls", "=", "None", ")", ":", "# base must be a single dn", "if", "log_enabled", "(", "PROTOCOL", ")", ":", ...
https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-windows/x86/ldap3/abstract/cursor.py#L795-L841
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/components/wiffi/config_flow.py
python
WiffiFlowHandler._async_show_form
(self, errors=None)
return self.async_show_form( step_id="user", data_schema=vol.Schema(data_schema), errors=errors or {} )
Show the config flow form to the user.
Show the config flow form to the user.
[ "Show", "the", "config", "flow", "form", "to", "the", "user", "." ]
def _async_show_form(self, errors=None): """Show the config flow form to the user.""" data_schema = {vol.Required(CONF_PORT, default=DEFAULT_PORT): int} return self.async_show_form( step_id="user", data_schema=vol.Schema(data_schema), errors=errors or {} )
[ "def", "_async_show_form", "(", "self", ",", "errors", "=", "None", ")", ":", "data_schema", "=", "{", "vol", ".", "Required", "(", "CONF_PORT", ",", "default", "=", "DEFAULT_PORT", ")", ":", "int", "}", "return", "self", ".", "async_show_form", "(", "st...
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/wiffi/config_flow.py#L57-L63
nucleic/enaml
65c2a2a2d765e88f2e1103046680571894bb41ed
enaml/core/parser/base_parser.py
python
BaseEnamlParser.p_enamldef_impl1
(self, p)
enamldef_impl : ENAMLDEF NAME LPAR NAME RPAR COLON enamldef_suite
enamldef_impl : ENAMLDEF NAME LPAR NAME RPAR COLON enamldef_suite
[ "enamldef_impl", ":", "ENAMLDEF", "NAME", "LPAR", "NAME", "RPAR", "COLON", "enamldef_suite" ]
def p_enamldef_impl1(self, p): ''' enamldef_impl : ENAMLDEF NAME LPAR NAME RPAR COLON enamldef_suite ''' doc, body = p[7] enamldef = enaml_ast.EnamlDef( typename=p[2], base=p[4], docstring=doc, body=body, lineno=p.lineno(1) ) self._validate_enamldef(enamld...
[ "def", "p_enamldef_impl1", "(", "self", ",", "p", ")", ":", "doc", ",", "body", "=", "p", "[", "7", "]", "enamldef", "=", "enaml_ast", ".", "EnamlDef", "(", "typename", "=", "p", "[", "2", "]", ",", "base", "=", "p", "[", "4", "]", ",", "docstr...
https://github.com/nucleic/enaml/blob/65c2a2a2d765e88f2e1103046680571894bb41ed/enaml/core/parser/base_parser.py#L378-L386
DataBiosphere/toil
2e148eee2114ece8dcc3ec8a83f36333266ece0d
src/toil/cwl/cwltoil.py
python
SelfJob.__init__
(self, j: "CWLWorkflow", v: CWLObjectType)
Record the workflow and dictionary.
Record the workflow and dictionary.
[ "Record", "the", "workflow", "and", "dictionary", "." ]
def __init__(self, j: "CWLWorkflow", v: CWLObjectType): """Record the workflow and dictionary.""" super().__init__(cores=1, memory="1GiB", disk="1MiB") self.j = j self.v = v
[ "def", "__init__", "(", "self", ",", "j", ":", "\"CWLWorkflow\"", ",", "v", ":", "CWLObjectType", ")", ":", "super", "(", ")", ".", "__init__", "(", "cores", "=", "1", ",", "memory", "=", "\"1GiB\"", ",", "disk", "=", "\"1MiB\"", ")", "self", ".", ...
https://github.com/DataBiosphere/toil/blob/2e148eee2114ece8dcc3ec8a83f36333266ece0d/src/toil/cwl/cwltoil.py#L2375-L2379
giantbranch/python-hacker-code
addbc8c73e7e6fb9e4fcadcec022fa1d3da4b96d
我手敲的代码(中文注释)/chapter11/volatility-2.3/volatility/plugins/dumpfiles.py
python
DumpFiles.render_text
(self, outfd, data)
Renders output for the dumpfiles plugin. This includes extracting the file artifacts from memory to the specified dump directory. Args: outfd: The file descriptor to write the text to. data: (summaryinfo)
Renders output for the dumpfiles plugin.
[ "Renders", "output", "for", "the", "dumpfiles", "plugin", "." ]
def render_text(self, outfd, data): """Renders output for the dumpfiles plugin. This includes extracting the file artifacts from memory to the specified dump directory. Args: outfd: The file descriptor to write the text to. data: (summaryinfo) """ ...
[ "def", "render_text", "(", "self", ",", "outfd", ",", "data", ")", ":", "# Summary file object", "summaryfo", "=", "None", "summaryinfo", "=", "data", "if", "self", ".", "_config", ".", "DUMP_DIR", "==", "None", ":", "debug", ".", "error", "(", "\"Please s...
https://github.com/giantbranch/python-hacker-code/blob/addbc8c73e7e6fb9e4fcadcec022fa1d3da4b96d/我手敲的代码(中文注释)/chapter11/volatility-2.3/volatility/plugins/dumpfiles.py#L1001-L1121
korcankaraokcu/PINCE
ecd8d5d92214592d47d46f16112d000c7834fab6
libpince/SysUtils.py
python
get_current_script_directory
()
return sys.path[0]
Get current working directory Returns: str: A string pointing to the current working directory
Get current working directory
[ "Get", "current", "working", "directory" ]
def get_current_script_directory(): """Get current working directory Returns: str: A string pointing to the current working directory """ return sys.path[0]
[ "def", "get_current_script_directory", "(", ")", ":", "return", "sys", ".", "path", "[", "0", "]" ]
https://github.com/korcankaraokcu/PINCE/blob/ecd8d5d92214592d47d46f16112d000c7834fab6/libpince/SysUtils.py#L197-L203
vprusso/youtube_tutorials
a3f2fadfc408aafbf4505bcd5f2f4a41d670b44d
twitter_python/part_5_sentiment_analysis_tweet_data/sentiment_anaylsis_twitter_data.py
python
TwitterStreamer.__init__
(self)
[]
def __init__(self): self.twitter_autenticator = TwitterAuthenticator()
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "twitter_autenticator", "=", "TwitterAuthenticator", "(", ")" ]
https://github.com/vprusso/youtube_tutorials/blob/a3f2fadfc408aafbf4505bcd5f2f4a41d670b44d/twitter_python/part_5_sentiment_analysis_tweet_data/sentiment_anaylsis_twitter_data.py#L60-L61
wxWidgets/Phoenix
b2199e299a6ca6d866aa6f3d0888499136ead9d6
wx/lib/floatcanvas/FCObjects.py
python
Group.Move
(self, Delta)
Moves the object by delta, where delta is a (dx, dy) pair. :param `Delta`: is a (dx, dy) pair ideally a `NumPy <http://www.numpy.org/>`_ array of shape (2, )
Moves the object by delta, where delta is a (dx, dy) pair.
[ "Moves", "the", "object", "by", "delta", "where", "delta", "is", "a", "(", "dx", "dy", ")", "pair", "." ]
def Move(self, Delta): """ Moves the object by delta, where delta is a (dx, dy) pair. :param `Delta`: is a (dx, dy) pair ideally a `NumPy <http://www.numpy.org/>`_ array of shape (2, ) """ for obj in self.ObjectList: obj.Move(Delta) self.BoundingBox...
[ "def", "Move", "(", "self", ",", "Delta", ")", ":", "for", "obj", "in", "self", ".", "ObjectList", ":", "obj", ".", "Move", "(", "Delta", ")", "self", ".", "BoundingBox", "+=", "Delta" ]
https://github.com/wxWidgets/Phoenix/blob/b2199e299a6ca6d866aa6f3d0888499136ead9d6/wx/lib/floatcanvas/FCObjects.py#L2845-L2855
lanmaster53/recon-ng
9e907dfe09fce2997f0301d746796408e01a60b7
recon/core/base.py
python
Recon._do_marketplace_remove
(self, params)
Removes marketplace modules from the framework
Removes marketplace modules from the framework
[ "Removes", "marketplace", "modules", "from", "the", "framework" ]
def _do_marketplace_remove(self, params): '''Removes marketplace modules from the framework''' if not params: self._help_marketplace_remove() return modules = [m for m in self._module_index if m['status'] in ('installed', 'disabled') and (params in m['path'] or params == ...
[ "def", "_do_marketplace_remove", "(", "self", ",", "params", ")", ":", "if", "not", "params", ":", "self", ".", "_help_marketplace_remove", "(", ")", "return", "modules", "=", "[", "m", "for", "m", "in", "self", ".", "_module_index", "if", "m", "[", "'st...
https://github.com/lanmaster53/recon-ng/blob/9e907dfe09fce2997f0301d746796408e01a60b7/recon/core/base.py#L609-L620
ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework
cb692f527e4e819b6c228187c5702d990a180043
external/Scripting Engine/Xenotix Python Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/inspect.py
python
getouterframes
(frame, context=1)
return framelist
Get a list of records for a frame and all higher (calling) frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.
Get a list of records for a frame and all higher (calling) frames.
[ "Get", "a", "list", "of", "records", "for", "a", "frame", "and", "all", "higher", "(", "calling", ")", "frames", "." ]
def getouterframes(frame, context=1): """Get a list of records for a frame and all higher (calling) frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.""" framelist = [] while frame: framelist.append((f...
[ "def", "getouterframes", "(", "frame", ",", "context", "=", "1", ")", ":", "framelist", "=", "[", "]", "while", "frame", ":", "framelist", ".", "append", "(", "(", "frame", ",", ")", "+", "getframeinfo", "(", "frame", ",", "context", ")", ")", "frame...
https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework/blob/cb692f527e4e819b6c228187c5702d990a180043/external/Scripting Engine/Xenotix Python Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/inspect.py#L1023-L1032
mgear-dev/mgear
06ddc26c5adb5eab07ca470c7fafa77404c8a1de
scripts/mgear/maya/shifter/component/spine_ik_01/guide.py
python
Guide.addObjects
(self)
Add the Guide Root, blade and locators
Add the Guide Root, blade and locators
[ "Add", "the", "Guide", "Root", "blade", "and", "locators" ]
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 4, 0]) self.eff = self.addLoc("eff", self.root, vTemp) self.blade = self.addBlade("blade", self.root, self.eff) centers = [se...
[ "def", "addObjects", "(", "self", ")", ":", "self", ".", "root", "=", "self", ".", "addRoot", "(", ")", "vTemp", "=", "transform", ".", "getOffsetPosition", "(", "self", ".", "root", ",", "[", "0", ",", "4", ",", "0", "]", ")", "self", ".", "eff"...
https://github.com/mgear-dev/mgear/blob/06ddc26c5adb5eab07ca470c7fafa77404c8a1de/scripts/mgear/maya/shifter/component/spine_ik_01/guide.py#L48-L57
census-instrumentation/opencensus-python
15c122dd7e0187b35f956f5d3b77b78455a2aadb
opencensus/stats/aggregation.py
python
DistributionAggregation.new_aggregation_data
(self, measure=None)
return aggregation_data.DistributionAggregationData( 0, 0, 0, None, self._boundaries)
Get a new AggregationData for this aggregation.
Get a new AggregationData for this aggregation.
[ "Get", "a", "new", "AggregationData", "for", "this", "aggregation", "." ]
def new_aggregation_data(self, measure=None): """Get a new AggregationData for this aggregation.""" return aggregation_data.DistributionAggregationData( 0, 0, 0, None, self._boundaries)
[ "def", "new_aggregation_data", "(", "self", ",", "measure", "=", "None", ")", ":", "return", "aggregation_data", ".", "DistributionAggregationData", "(", "0", ",", "0", ",", "0", ",", "None", ",", "self", ".", "_boundaries", ")" ]
https://github.com/census-instrumentation/opencensus-python/blob/15c122dd7e0187b35f956f5d3b77b78455a2aadb/opencensus/stats/aggregation.py#L104-L107
python-discord/bot
26c5587ac13e5414361bb6e7ada42983b81014d2
bot/exts/utils/extensions.py
python
Extensions.cog_command_error
(self, ctx: Context, error: Exception)
Handle BadArgument errors locally to prevent the help command from showing.
Handle BadArgument errors locally to prevent the help command from showing.
[ "Handle", "BadArgument", "errors", "locally", "to", "prevent", "the", "help", "command", "from", "showing", "." ]
async def cog_command_error(self, ctx: Context, error: Exception) -> None: """Handle BadArgument errors locally to prevent the help command from showing.""" if isinstance(error, commands.BadArgument): await ctx.send(str(error)) error.handled = True
[ "async", "def", "cog_command_error", "(", "self", ",", "ctx", ":", "Context", ",", "error", ":", "Exception", ")", "->", "None", ":", "if", "isinstance", "(", "error", ",", "commands", ".", "BadArgument", ")", ":", "await", "ctx", ".", "send", "(", "st...
https://github.com/python-discord/bot/blob/26c5587ac13e5414361bb6e7ada42983b81014d2/bot/exts/utils/extensions.py#L218-L222
wenhuchen/HDSA-Dialog
88e2604adb5dc38ae32205410b15b2ac39116ecd
evaluator.py
python
parseGoal
(goal, d, domain)
return goal
Parses user goal into dictionary format.
Parses user goal into dictionary format.
[ "Parses", "user", "goal", "into", "dictionary", "format", "." ]
def parseGoal(goal, d, domain): """Parses user goal into dictionary format.""" goal[domain] = {} goal[domain] = {'informable': [], 'requestable': [], 'booking': []} if 'info' in d['goal'][domain]: if domain == 'train': # we consider dialogues only where train had to be booked! ...
[ "def", "parseGoal", "(", "goal", ",", "d", ",", "domain", ")", ":", "goal", "[", "domain", "]", "=", "{", "}", "goal", "[", "domain", "]", "=", "{", "'informable'", ":", "[", "]", ",", "'requestable'", ":", "[", "]", ",", "'booking'", ":", "[", ...
https://github.com/wenhuchen/HDSA-Dialog/blob/88e2604adb5dc38ae32205410b15b2ac39116ecd/evaluator.py#L17-L42
nosmokingbandit/watcher
dadacd21a5790ee609058a98a17fcc8954d24439
lib/fuzzywuzzy/utils.py
python
intr
(n)
return int(round(n))
Returns a correctly rounded integer
Returns a correctly rounded integer
[ "Returns", "a", "correctly", "rounded", "integer" ]
def intr(n): '''Returns a correctly rounded integer''' return int(round(n))
[ "def", "intr", "(", "n", ")", ":", "return", "int", "(", "round", "(", "n", ")", ")" ]
https://github.com/nosmokingbandit/watcher/blob/dadacd21a5790ee609058a98a17fcc8954d24439/lib/fuzzywuzzy/utils.py#L90-L92
anchore/anchore-engine
bb18b70e0cbcad58beb44cd439d00067d8f7ea8b
anchore_engine/common/models/schemas.py
python
DownloadOperationResult.__init__
( self, started: datetime = None, ended: datetime = None, status: str = None, results: list = None, )
Make sure these are UTC dates :param started: :param ended: :param status: :param results:
Make sure these are UTC dates
[ "Make", "sure", "these", "are", "UTC", "dates" ]
def __init__( self, started: datetime = None, ended: datetime = None, status: str = None, results: list = None, ): """ Make sure these are UTC dates :param started: :param ended: :param status: :param results: """ ...
[ "def", "__init__", "(", "self", ",", "started", ":", "datetime", "=", "None", ",", "ended", ":", "datetime", "=", "None", ",", "status", ":", "str", "=", "None", ",", "results", ":", "list", "=", "None", ",", ")", ":", "self", ".", "started", "=", ...
https://github.com/anchore/anchore-engine/blob/bb18b70e0cbcad58beb44cd439d00067d8f7ea8b/anchore_engine/common/models/schemas.py#L602-L620
llimllib/pymag-trees
61a685089d0888dda13d493a4537450167466dee
reingold_naive.py
python
p
(tree)
[]
def p(tree): level = [tree] while 1: newlevel = [] printrow(level) for t in level: #stdout.write("%s%s%s" % (t.x*"____", str(t)[:3], t.x)) newlevel.extend(t.children[:2]) print if not newlevel: break level = newlevel
[ "def", "p", "(", "tree", ")", ":", "level", "=", "[", "tree", "]", "while", "1", ":", "newlevel", "=", "[", "]", "printrow", "(", "level", ")", "for", "t", "in", "level", ":", "#stdout.write(\"%s%s%s\" % (t.x*\"____\", str(t)[:3], t.x))", "newlevel", ".", ...
https://github.com/llimllib/pymag-trees/blob/61a685089d0888dda13d493a4537450167466dee/reingold_naive.py#L70-L80
AppScale/gts
46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9
AppServer/lib/django-1.2/django/db/backends/__init__.py
python
BaseDatabaseOperations.no_limit_value
(self)
Returns the value to use for the LIMIT when we are wanting "LIMIT infinity". Returns None if the limit clause can be omitted in this case.
Returns the value to use for the LIMIT when we are wanting "LIMIT infinity". Returns None if the limit clause can be omitted in this case.
[ "Returns", "the", "value", "to", "use", "for", "the", "LIMIT", "when", "we", "are", "wanting", "LIMIT", "infinity", ".", "Returns", "None", "if", "the", "limit", "clause", "can", "be", "omitted", "in", "this", "case", "." ]
def no_limit_value(self): """ Returns the value to use for the LIMIT when we are wanting "LIMIT infinity". Returns None if the limit clause can be omitted in this case. """ raise NotImplementedError
[ "def", "no_limit_value", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/AppScale/gts/blob/46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9/AppServer/lib/django-1.2/django/db/backends/__init__.py#L250-L255
AppScale/gts
46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9
AppServer/lib/django-1.3/django/contrib/gis/geos/mutable_list.py
python
ListMixin._assign_simple_slice
(self, start, stop, valueList)
Assign a simple slice; Can assign slice of any length
Assign a simple slice; Can assign slice of any length
[ "Assign", "a", "simple", "slice", ";", "Can", "assign", "slice", "of", "any", "length" ]
def _assign_simple_slice(self, start, stop, valueList): 'Assign a simple slice; Can assign slice of any length' origLen = len(self) stop = max(start, stop) newLen = origLen - stop + start + len(valueList) def newItems(): for i in xrange(origLen + 1): ...
[ "def", "_assign_simple_slice", "(", "self", ",", "start", ",", "stop", ",", "valueList", ")", ":", "origLen", "=", "len", "(", "self", ")", "stop", "=", "max", "(", "start", ",", "stop", ")", "newLen", "=", "origLen", "-", "stop", "+", "start", "+", ...
https://github.com/AppScale/gts/blob/46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9/AppServer/lib/django-1.3/django/contrib/gis/geos/mutable_list.py#L294-L309
joshspeagle/dynesty
2c5f1bbe5a0745c6625876f23ec6aa710c845fd4
py/dynesty/dynamicsampler.py
python
DynamicSampler.results
(self)
return Results(results)
Saved results from the dynamic nested sampling run. All saved bounds are also returned.
Saved results from the dynamic nested sampling run. All saved bounds are also returned.
[ "Saved", "results", "from", "the", "dynamic", "nested", "sampling", "run", ".", "All", "saved", "bounds", "are", "also", "returned", "." ]
def results(self): """Saved results from the dynamic nested sampling run. All saved bounds are also returned.""" d = {} for k in [ 'nc', 'v', 'id', 'batch', 'it', 'u', 'n', 'logwt', 'logl', 'logvol', 'logz', 'logzvar', 'h', 'batch_nlive', 'batch_bounds' ...
[ "def", "results", "(", "self", ")", ":", "d", "=", "{", "}", "for", "k", "in", "[", "'nc'", ",", "'v'", ",", "'id'", ",", "'batch'", ",", "'it'", ",", "'u'", ",", "'n'", ",", "'logwt'", ",", "'logl'", ",", "'logvol'", ",", "'logz'", ",", "'logz...
https://github.com/joshspeagle/dynesty/blob/2c5f1bbe5a0745c6625876f23ec6aa710c845fd4/py/dynesty/dynamicsampler.py#L580-L614
pahaz/sshtunnel
58a46ef8b66be5eded29cd9bda4dccedb46ec586
sshtunnel.py
python
SSHTunnelForwarder._stop_transport
(self, force=False)
Close the underlying transport when nothing more is needed
Close the underlying transport when nothing more is needed
[ "Close", "the", "underlying", "transport", "when", "nothing", "more", "is", "needed" ]
def _stop_transport(self, force=False): """ Close the underlying transport when nothing more is needed """ try: self._check_is_started() except (BaseSSHTunnelForwarderError, HandlerSSHTunnelForwarderError) as e: self.logger.warning(e) if force and ...
[ "def", "_stop_transport", "(", "self", ",", "force", "=", "False", ")", ":", "try", ":", "self", ".", "_check_is_started", "(", ")", "except", "(", "BaseSSHTunnelForwarderError", ",", "HandlerSSHTunnelForwarderError", ")", "as", "e", ":", "self", ".", "logger"...
https://github.com/pahaz/sshtunnel/blob/58a46ef8b66be5eded29cd9bda4dccedb46ec586/sshtunnel.py#L1444-L1477
vlachoudis/bCNC
67126b4894dabf6579baf47af8d0f9b7de35e6e3
bCNC/lib/tkExtra.py
python
PageTab.__init__
(self, parent)
[]
def __init__(self, parent): Frame.__init__(self, parent, borderwidth=2, relief=RIDGE) self.button=Radiobutton(self, padx=5, pady=2, takefocus=FALSE, indicatoron=FALSE, highlightthickness=0, borderwidth=0, selectcolor=self.cget('bg')) self.button.pack(fill=BOTH)
[ "def", "__init__", "(", "self", ",", "parent", ")", ":", "Frame", ".", "__init__", "(", "self", ",", "parent", ",", "borderwidth", "=", "2", ",", "relief", "=", "RIDGE", ")", "self", ".", "button", "=", "Radiobutton", "(", "self", ",", "padx", "=", ...
https://github.com/vlachoudis/bCNC/blob/67126b4894dabf6579baf47af8d0f9b7de35e6e3/bCNC/lib/tkExtra.py#L4624-L4629
nate-parrott/Flashlight
c3a7c7278a1cccf8918e7543faffc68e863ff5ab
PluginDirectories/1/NightFoxAmbient.bundle/requests/utils.py
python
requote_uri
(uri)
Re-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted.
Re-quote the given URI.
[ "Re", "-", "quote", "the", "given", "URI", "." ]
def requote_uri(uri): """Re-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. """ safe_with_percent = "!#$%&'()*+,/:;=?@[]~" safe_without_percent = "!#$&'()*+,/:;=?@[]~" try: # Unquote only the ...
[ "def", "requote_uri", "(", "uri", ")", ":", "safe_with_percent", "=", "\"!#$%&'()*+,/:;=?@[]~\"", "safe_without_percent", "=", "\"!#$&'()*+,/:;=?@[]~\"", "try", ":", "# Unquote only the unreserved characters", "# Then quote only illegal characters (do not quote reserved,", "# unreser...
https://github.com/nate-parrott/Flashlight/blob/c3a7c7278a1cccf8918e7543faffc68e863ff5ab/PluginDirectories/1/NightFoxAmbient.bundle/requests/utils.py#L417-L434
duvenaud/relax
4f3932e16261428a43f86025f8e43f9fc6d1e147
rebar_tf.py
python
REBAROptimizer._create_loss_evaluations
(self)
produces f(b), f(sig(z)), f(sig(z_tilde))
produces f(b), f(sig(z)), f(sig(z_tilde))
[ "produces", "f", "(", "b", ")", "f", "(", "sig", "(", "z", "))", "f", "(", "sig", "(", "z_tilde", "))" ]
def _create_loss_evaluations(self): """ produces f(b), f(sig(z)), f(sig(z_tilde)) """ # relaxed inputs log_alpha = self._log_alpha sig_z = tf.nn.sigmoid(self.z / self.temperature + log_alpha) sig_z_tilde = tf.nn.sigmoid(self.z_tilde / self.temperature + log_alpha)...
[ "def", "_create_loss_evaluations", "(", "self", ")", ":", "# relaxed inputs", "log_alpha", "=", "self", ".", "_log_alpha", "sig_z", "=", "tf", ".", "nn", ".", "sigmoid", "(", "self", ".", "z", "/", "self", ".", "temperature", "+", "log_alpha", ")", "sig_z_...
https://github.com/duvenaud/relax/blob/4f3932e16261428a43f86025f8e43f9fc6d1e147/rebar_tf.py#L139-L153
lsbardel/python-stdnet
78db5320bdedc3f28c5e4f38cda13a4469e35db7
stdnet/utils/dates.py
python
Intervals.append
(self, interval)
[]
def append(self, interval): if not isinstance(interval, Interval): interval = Interval(*interval) for idx, intv in enumerate(self): if interval < intv: self.insert(idx, interval) return elif interval > intv: continue ...
[ "def", "append", "(", "self", ",", "interval", ")", ":", "if", "not", "isinstance", "(", "interval", ",", "Interval", ")", ":", "interval", "=", "Interval", "(", "*", "interval", ")", "for", "idx", ",", "intv", "in", "enumerate", "(", "self", ")", ":...
https://github.com/lsbardel/python-stdnet/blob/78db5320bdedc3f28c5e4f38cda13a4469e35db7/stdnet/utils/dates.py#L54-L66
huntfx/MouseTracks
4dfab6386f9461be77cb19b54c9c498d74fb4ef6
mousetracks/notify.py
python
Notify.output
(self, _delete=True)
return ' | '.join(self._combine(delete=_delete))
Get the output and wipe the class. Use this instead of relying on __str__, as doing that can cause unintended issues.
Get the output and wipe the class. Use this instead of relying on __str__, as doing that can cause unintended issues.
[ "Get", "the", "output", "and", "wipe", "the", "class", ".", "Use", "this", "instead", "of", "relying", "on", "__str__", "as", "doing", "that", "can", "cause", "unintended", "issues", "." ]
def output(self, _delete=True): """Get the output and wipe the class. Use this instead of relying on __str__, as doing that can cause unintended issues. """ return ' | '.join(self._combine(delete=_delete))
[ "def", "output", "(", "self", ",", "_delete", "=", "True", ")", ":", "return", "' | '", ".", "join", "(", "self", ".", "_combine", "(", "delete", "=", "_delete", ")", ")" ]
https://github.com/huntfx/MouseTracks/blob/4dfab6386f9461be77cb19b54c9c498d74fb4ef6/mousetracks/notify.py#L144-L149
Parsely/pykafka
e7665bf36bfe521050fdcb017c68e92365bd89ed
pykafka/protocol/offset.py
python
ListOffsetResponseV1.__init__
(self, buff)
Deserialize into a new Response :param buff: Serialized message :type buff: :class:`bytearray`
Deserialize into a new Response :param buff: Serialized message :type buff: :class:`bytearray`
[ "Deserialize", "into", "a", "new", "Response", ":", "param", "buff", ":", "Serialized", "message", ":", "type", "buff", ":", ":", "class", ":", "bytearray" ]
def __init__(self, buff): """Deserialize into a new Response :param buff: Serialized message :type buff: :class:`bytearray` """ fmt = '[S [ihq [q] ] ]' response = struct_helpers.unpack_from(fmt, buff, 0) self.topics = {} for topic_name, partitions in resp...
[ "def", "__init__", "(", "self", ",", "buff", ")", ":", "fmt", "=", "'[S [ihq [q] ] ]'", "response", "=", "struct_helpers", ".", "unpack_from", "(", "fmt", ",", "buff", ",", "0", ")", "self", ".", "topics", "=", "{", "}", "for", "topic_name", ",", "part...
https://github.com/Parsely/pykafka/blob/e7665bf36bfe521050fdcb017c68e92365bd89ed/pykafka/protocol/offset.py#L193-L206
openstack/cinder
23494a6d6c51451688191e1847a458f1d3cdcaa5
cinder/volume/drivers/dell_emc/powermax/utils.py
python
PowerMaxUtils.get_host_short_name
(self, host_name)
return self.generate_unique_trunc_host(short_host_name)
Returns the short name for a given qualified host name. Checks the host name to see if it is the fully qualified host name and returns part before the dot. If there is no dot in the host name the full host name is returned. :param host_name: the fully qualified host name :return...
Returns the short name for a given qualified host name.
[ "Returns", "the", "short", "name", "for", "a", "given", "qualified", "host", "name", "." ]
def get_host_short_name(self, host_name): """Returns the short name for a given qualified host name. Checks the host name to see if it is the fully qualified host name and returns part before the dot. If there is no dot in the host name the full host name is returned. :param hos...
[ "def", "get_host_short_name", "(", "self", ",", "host_name", ")", ":", "short_host_name", "=", "self", ".", "get_host_short_name_from_fqn", "(", "host_name", ")", "return", "self", ".", "generate_unique_trunc_host", "(", "short_host_name", ")" ]
https://github.com/openstack/cinder/blob/23494a6d6c51451688191e1847a458f1d3cdcaa5/cinder/volume/drivers/dell_emc/powermax/utils.py#L230-L241
akutuzov/webvectors
d5c86d021cf3bd0407a06c54aba078c0d06313f8
preprocessing/modular_processing/helpers.py
python
clean_token
(token, misc)
return out_token
:param token: :param misc: :return:
:param token: :param misc: :return:
[ ":", "param", "token", ":", ":", "param", "misc", ":", ":", "return", ":" ]
def clean_token(token, misc): """ :param token: :param misc: :return: """ out_token = token.strip().replace(' ', '') if token == 'Файл' and 'SpaceAfter=No' in misc: return None return out_token
[ "def", "clean_token", "(", "token", ",", "misc", ")", ":", "out_token", "=", "token", ".", "strip", "(", ")", ".", "replace", "(", "' '", ",", "''", ")", "if", "token", "==", "'Файл' and", "'Sp", "ceAfter=No' in ", "is", ":", "", "return", "None", "r...
https://github.com/akutuzov/webvectors/blob/d5c86d021cf3bd0407a06c54aba078c0d06313f8/preprocessing/modular_processing/helpers.py#L71-L80
autotest/autotest
4614ae5f550cc888267b9a419e4b90deb54f8fae
client/shared/utils_koji.py
python
KojiPkgSpec._is_invalid_neither_tag_or_build
(self)
return (self.tag is None and self.build is None)
Checks if this package is invalid due to not having either a valid tag or build set, that is, both are empty. :return: True if this is invalid and False if it's valid
Checks if this package is invalid due to not having either a valid tag or build set, that is, both are empty.
[ "Checks", "if", "this", "package", "is", "invalid", "due", "to", "not", "having", "either", "a", "valid", "tag", "or", "build", "set", "that", "is", "both", "are", "empty", "." ]
def _is_invalid_neither_tag_or_build(self): ''' Checks if this package is invalid due to not having either a valid tag or build set, that is, both are empty. :return: True if this is invalid and False if it's valid ''' return (self.tag is None and self.build is None)
[ "def", "_is_invalid_neither_tag_or_build", "(", "self", ")", ":", "return", "(", "self", ".", "tag", "is", "None", "and", "self", ".", "build", "is", "None", ")" ]
https://github.com/autotest/autotest/blob/4614ae5f550cc888267b9a419e4b90deb54f8fae/client/shared/utils_koji.py#L646-L653
evennia/evennia
fa79110ba6b219932f22297838e8ac72ebc0be0e
evennia/server/connection_wizard.py
python
ConnectionWizard.ask_choice
(self, prompt=" > ", options=None, default=None)
Ask multiple-choice question, get response inline. Keyword Args: prompt (str): Input prompt. options (list): List of options. Will be indexable by sequence number 1... default (int): The list index+1 of the default choice, if any Returns: reply (str): The...
Ask multiple-choice question, get response inline.
[ "Ask", "multiple", "-", "choice", "question", "get", "response", "inline", "." ]
def ask_choice(self, prompt=" > ", options=None, default=None): """ Ask multiple-choice question, get response inline. Keyword Args: prompt (str): Input prompt. options (list): List of options. Will be indexable by sequence number 1... default (int): The list...
[ "def", "ask_choice", "(", "self", ",", "prompt", "=", "\" > \"", ",", "options", "=", "None", ",", "default", "=", "None", ")", ":", "opt_txt", "=", "\"\\n\"", ".", "join", "(", "f\" {ind + 1}: {desc}\"", "for", "ind", ",", "desc", "in", "enumerate", "("...
https://github.com/evennia/evennia/blob/fa79110ba6b219932f22297838e8ac72ebc0be0e/evennia/server/connection_wizard.py#L82-L111
szad670401/end-to-end-for-chinese-plate-recognition
c110ab3c605f242290c90862c5f19b15e21309d3
genplate_scene.py
python
GenPlateScene.gen_plate_string
(self)
return plate_str
生成车牌号码字符串
生成车牌号码字符串
[ "生成车牌号码字符串" ]
def gen_plate_string(self): '''生成车牌号码字符串''' plate_str = "" for cpos in range(7): if cpos == 0: plate_str += chars[r(31)] elif cpos == 1: plate_str += chars[41+r(24)] else: plate_str += chars[31 + r(34)] r...
[ "def", "gen_plate_string", "(", "self", ")", ":", "plate_str", "=", "\"\"", "for", "cpos", "in", "range", "(", "7", ")", ":", "if", "cpos", "==", "0", ":", "plate_str", "+=", "chars", "[", "r", "(", "31", ")", "]", "elif", "cpos", "==", "1", ":",...
https://github.com/szad670401/end-to-end-for-chinese-plate-recognition/blob/c110ab3c605f242290c90862c5f19b15e21309d3/genplate_scene.py#L35-L45
mit-han-lab/once-for-all
4f6fce3652ee4553ea811d38f32f90ac8b1bc378
ofa/imagenet_classification/elastic_nn/modules/dynamic_layers.py
python
DynamicLinearLayer.module_str
(self)
return 'DyLinear(%d, %d)' % (max(self.in_features_list), self.out_features)
[]
def module_str(self): return 'DyLinear(%d, %d)' % (max(self.in_features_list), self.out_features)
[ "def", "module_str", "(", "self", ")", ":", "return", "'DyLinear(%d, %d)'", "%", "(", "max", "(", "self", ".", "in_features_list", ")", ",", "self", ".", "out_features", ")" ]
https://github.com/mit-han-lab/once-for-all/blob/4f6fce3652ee4553ea811d38f32f90ac8b1bc378/ofa/imagenet_classification/elastic_nn/modules/dynamic_layers.py#L64-L65
prompt-toolkit/pymux
3f66e62b9de4b2251c7f9afad6c516dc5a30ec67
pymux/main.py
python
Pymux.get_window_size
(self)
Get the size to be used for the DynamicBody. This will be the smallest size of all clients.
Get the size to be used for the DynamicBody. This will be the smallest size of all clients.
[ "Get", "the", "size", "to", "be", "used", "for", "the", "DynamicBody", ".", "This", "will", "be", "the", "smallest", "size", "of", "all", "clients", "." ]
def get_window_size(self): """ Get the size to be used for the DynamicBody. This will be the smallest size of all clients. """ def active_window_for_app(app): with set_app(app): return self.arrangement.get_active_window() active_window = self....
[ "def", "get_window_size", "(", "self", ")", ":", "def", "active_window_for_app", "(", "app", ")", ":", "with", "set_app", "(", "app", ")", ":", "return", "self", ".", "arrangement", ".", "get_active_window", "(", ")", "active_window", "=", "self", ".", "ar...
https://github.com/prompt-toolkit/pymux/blob/3f66e62b9de4b2251c7f9afad6c516dc5a30ec67/pymux/main.py#L370-L393
triaquae/triaquae
bbabf736b3ba56a0c6498e7f04e16c13b8b8f2b9
TriAquae/models/Ubuntu_13/paramiko/packet.py
python
Packetizer.get_mac_size_out
(self)
return self.__mac_size_out
[]
def get_mac_size_out(self): return self.__mac_size_out
[ "def", "get_mac_size_out", "(", "self", ")", ":", "return", "self", ".", "__mac_size_out" ]
https://github.com/triaquae/triaquae/blob/bbabf736b3ba56a0c6498e7f04e16c13b8b8f2b9/TriAquae/models/Ubuntu_13/paramiko/packet.py#L165-L166
IronLanguages/ironpython2
51fdedeeda15727717fb8268a805f71b06c0b9f1
Src/StdLib/Lib/fileinput.py
python
input
(files=None, inplace=0, backup="", bufsize=0, mode="r", openhook=None)
return _state
Return an instance of the FileInput class, which can be iterated. The parameters are passed to the constructor of the FileInput class. The returned instance, in addition to being an iterator, keeps global state for the functions of this module,.
Return an instance of the FileInput class, which can be iterated.
[ "Return", "an", "instance", "of", "the", "FileInput", "class", "which", "can", "be", "iterated", "." ]
def input(files=None, inplace=0, backup="", bufsize=0, mode="r", openhook=None): """Return an instance of the FileInput class, which can be iterated. The parameters are passed to the constructor of the FileInput class. The returned instance, in addition to being an iterator, keeps global stat...
[ "def", "input", "(", "files", "=", "None", ",", "inplace", "=", "0", ",", "backup", "=", "\"\"", ",", "bufsize", "=", "0", ",", "mode", "=", "\"r\"", ",", "openhook", "=", "None", ")", ":", "global", "_state", "if", "_state", "and", "_state", ".", ...
https://github.com/IronLanguages/ironpython2/blob/51fdedeeda15727717fb8268a805f71b06c0b9f1/Src/StdLib/Lib/fileinput.py#L85-L97
SteveDoyle2/pyNastran
eda651ac2d4883d95a34951f8a002ff94f642a1a
pyNastran/dev/bdf_vectorized/cards/elements/spring/celas1.py
python
CELAS1.update
(self, maps)
maps = { 'node_id' : nid_map, 'property' : pid_map, }
maps = { 'node_id' : nid_map, 'property' : pid_map, }
[ "maps", "=", "{", "node_id", ":", "nid_map", "property", ":", "pid_map", "}" ]
def update(self, maps): """ maps = { 'node_id' : nid_map, 'property' : pid_map, } """ if self.n: eid_map = maps['element'] pid_map = maps['property'] nid_map = maps['node'] for i, eid, pid, nids in enumerate(...
[ "def", "update", "(", "self", ",", "maps", ")", ":", "if", "self", ".", "n", ":", "eid_map", "=", "maps", "[", "'element'", "]", "pid_map", "=", "maps", "[", "'property'", "]", "nid_map", "=", "maps", "[", "'node'", "]", "for", "i", ",", "eid", "...
https://github.com/SteveDoyle2/pyNastran/blob/eda651ac2d4883d95a34951f8a002ff94f642a1a/pyNastran/dev/bdf_vectorized/cards/elements/spring/celas1.py#L63-L78
10XGenomics/cellranger
a83c753ce641db6409a59ad817328354fbe7187e
lib/python/cellranger/molecule_counter.py
python
MoleculeCounter.get_metric
(self, key)
return value
Get a metric.
Get a metric.
[ "Get", "a", "metric", "." ]
def get_metric(self, key): """Get a metric.""" try: value = cPickle.loads(self.h5[METRICS_GROUP_NAME].attrs[key]) except KeyError: value = None return value
[ "def", "get_metric", "(", "self", ",", "key", ")", ":", "try", ":", "value", "=", "cPickle", ".", "loads", "(", "self", ".", "h5", "[", "METRICS_GROUP_NAME", "]", ".", "attrs", "[", "key", "]", ")", "except", "KeyError", ":", "value", "=", "None", ...
https://github.com/10XGenomics/cellranger/blob/a83c753ce641db6409a59ad817328354fbe7187e/lib/python/cellranger/molecule_counter.py#L349-L355
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/components/point/sensor.py
python
async_setup_entry
( hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: AddEntitiesCallback, )
Set up a Point's sensors based on a config entry.
Set up a Point's sensors based on a config entry.
[ "Set", "up", "a", "Point", "s", "sensors", "based", "on", "a", "config", "entry", "." ]
async def async_setup_entry( hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> None: """Set up a Point's sensors based on a config entry.""" async def async_discover_sensor(device_id): """Discover and add a discovered sensor.""" client = h...
[ "async", "def", "async_setup_entry", "(", "hass", ":", "HomeAssistant", ",", "config_entry", ":", "ConfigEntry", ",", "async_add_entities", ":", "AddEntitiesCallback", ",", ")", "->", "None", ":", "async", "def", "async_discover_sensor", "(", "device_id", ")", ":"...
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/point/sensor.py#L65-L85
bruderstein/PythonScript
df9f7071ddf3a079e3a301b9b53a6dc78cf1208f
PythonLib/min/poplib.py
python
POP3.utf8
(self)
return self._shortcmd('UTF8')
Try to enter UTF-8 mode (see RFC 6856). Returns server response.
Try to enter UTF-8 mode (see RFC 6856). Returns server response.
[ "Try", "to", "enter", "UTF", "-", "8", "mode", "(", "see", "RFC", "6856", ")", ".", "Returns", "server", "response", "." ]
def utf8(self): """Try to enter UTF-8 mode (see RFC 6856). Returns server response. """ return self._shortcmd('UTF8')
[ "def", "utf8", "(", "self", ")", ":", "return", "self", ".", "_shortcmd", "(", "'UTF8'", ")" ]
https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/min/poplib.py#L360-L363
mtianyan/OnlineMooc
51a910e27c8d2808a8a5198b4db31f463e646bf6
tyadmin_api/auto_serializers.py
python
QaCreateUpdateSerializer.get_ty_options_display_txt
(obj)
return str(obj)
[]
def get_ty_options_display_txt(obj): return str(obj)
[ "def", "get_ty_options_display_txt", "(", "obj", ")", ":", "return", "str", "(", "obj", ")" ]
https://github.com/mtianyan/OnlineMooc/blob/51a910e27c8d2808a8a5198b4db31f463e646bf6/tyadmin_api/auto_serializers.py#L1702-L1703
buke/GreenOdoo
3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df
runtime/python/lib/python2.7/lib-tk/Tkinter.py
python
Wm.wm_maxsize
(self, width=None, height=None)
return self._getints(self.tk.call( 'wm', 'maxsize', self._w, width, height))
Set max WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.
Set max WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.
[ "Set", "max", "WIDTH", "and", "HEIGHT", "for", "this", "widget", ".", "If", "the", "window", "is", "gridded", "the", "values", "are", "given", "in", "grid", "units", ".", "Return", "the", "current", "values", "if", "None", "is", "given", "." ]
def wm_maxsize(self, width=None, height=None): """Set max WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.""" return self._getints(self.tk.call( 'wm', 'maxsize', self._w, width, height))
[ "def", "wm_maxsize", "(", "self", ",", "width", "=", "None", ",", "height", "=", "None", ")", ":", "return", "self", ".", "_getints", "(", "self", ".", "tk", ".", "call", "(", "'wm'", ",", "'maxsize'", ",", "self", ".", "_w", ",", "width", ",", "...
https://github.com/buke/GreenOdoo/blob/3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df/runtime/python/lib/python2.7/lib-tk/Tkinter.py#L1651-L1656
oilshell/oil
94388e7d44a9ad879b12615f6203b38596b5a2d3
Python-2.7.13/Tools/webchecker/webchecker.py
python
MyHTMLParser.check_name_id
(self, attributes)
Check the name or id attributes on an element.
Check the name or id attributes on an element.
[ "Check", "the", "name", "or", "id", "attributes", "on", "an", "element", "." ]
def check_name_id(self, attributes): """ Check the name or id attributes on an element. """ # We must rescue the NAME or id (name is deprecated in XHTML) # attributes from the anchor, in order to # cache the internal anchors which are made # available in the page. ...
[ "def", "check_name_id", "(", "self", ",", "attributes", ")", ":", "# We must rescue the NAME or id (name is deprecated in XHTML)", "# attributes from the anchor, in order to", "# cache the internal anchors which are made", "# available in the page.", "for", "name", ",", "value", "in"...
https://github.com/oilshell/oil/blob/94388e7d44a9ad879b12615f6203b38596b5a2d3/Python-2.7.13/Tools/webchecker/webchecker.py#L788-L801
correlation-one/C1GamesStarterKit
6cd9aafc24dd8831c7653b3bb57794923ef5ff49
python-algo/gamelib/game_state.py
python
GameState.attempt_remove
(self, locations)
return removed_units
Attempts to remove existing friendly structures in the given locations. Args: locations: A location or list of locations we want to remove structures from Returns: The number of structures successfully flagged for removal
Attempts to remove existing friendly structures in the given locations.
[ "Attempts", "to", "remove", "existing", "friendly", "structures", "in", "the", "given", "locations", "." ]
def attempt_remove(self, locations): """Attempts to remove existing friendly structures in the given locations. Args: locations: A location or list of locations we want to remove structures from Returns: The number of structures successfully flagged for removal ...
[ "def", "attempt_remove", "(", "self", ",", "locations", ")", ":", "if", "type", "(", "locations", "[", "0", "]", ")", "==", "int", ":", "locations", "=", "[", "locations", "]", "removed_units", "=", "0", "for", "location", "in", "locations", ":", "if",...
https://github.com/correlation-one/C1GamesStarterKit/blob/6cd9aafc24dd8831c7653b3bb57794923ef5ff49/python-algo/gamelib/game_state.py#L394-L414
bruderstein/PythonScript
df9f7071ddf3a079e3a301b9b53a6dc78cf1208f
PythonLib/full/xml/dom/expatbuilder.py
python
ExpatBuilder.install
(self, parser)
Install the callbacks needed to build the DOM into the parser.
Install the callbacks needed to build the DOM into the parser.
[ "Install", "the", "callbacks", "needed", "to", "build", "the", "DOM", "into", "the", "parser", "." ]
def install(self, parser): """Install the callbacks needed to build the DOM into the parser.""" # This creates circular references! parser.StartDoctypeDeclHandler = self.start_doctype_decl_handler parser.StartElementHandler = self.first_element_handler parser.EndElementHandler = ...
[ "def", "install", "(", "self", ",", "parser", ")", ":", "# This creates circular references!", "parser", ".", "StartDoctypeDeclHandler", "=", "self", ".", "start_doctype_decl_handler", "parser", ".", "StartElementHandler", "=", "self", ".", "first_element_handler", "par...
https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/full/xml/dom/expatbuilder.py#L174-L195
hyperledger/aries-cloudagent-python
2f36776e99f6053ae92eed8123b5b1b2e891c02a
aries_cloudagent/transport/inbound/session.py
python
AcceptResult.__init__
(self, accepted: bool, retry: bool = False)
Initialize the `AcceptResult` instance.
Initialize the `AcceptResult` instance.
[ "Initialize", "the", "AcceptResult", "instance", "." ]
def __init__(self, accepted: bool, retry: bool = False): """Initialize the `AcceptResult` instance.""" self.accepted = accepted self.retry = retry
[ "def", "__init__", "(", "self", ",", "accepted", ":", "bool", ",", "retry", ":", "bool", "=", "False", ")", ":", "self", ".", "accepted", "=", "accepted", "self", ".", "retry", "=", "retry" ]
https://github.com/hyperledger/aries-cloudagent-python/blob/2f36776e99f6053ae92eed8123b5b1b2e891c02a/aries_cloudagent/transport/inbound/session.py#L25-L28
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/crypto/sbox.py
python
SBox._repr_
(self)
return "(" + ", ".join(map(str,list(self))) + ")"
EXAMPLES:: sage: from sage.crypto.sbox import SBox sage: SBox(7,6,0,4,2,5,1,3) #indirect doctest (7, 6, 0, 4, 2, 5, 1, 3)
EXAMPLES::
[ "EXAMPLES", "::" ]
def _repr_(self): """ EXAMPLES:: sage: from sage.crypto.sbox import SBox sage: SBox(7,6,0,4,2,5,1,3) #indirect doctest (7, 6, 0, 4, 2, 5, 1, 3) """ return "(" + ", ".join(map(str,list(self))) + ")"
[ "def", "_repr_", "(", "self", ")", ":", "return", "\"(\"", "+", "\", \"", ".", "join", "(", "map", "(", "str", ",", "list", "(", "self", ")", ")", ")", "+", "\")\"" ]
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/crypto/sbox.py#L173-L181
plotly/arduino-api
38ee5b191682532ebee908ceafbc67692730d39c
plotly_yun/Linino/requests/models.py
python
Response.raise_for_status
(self)
Raises stored :class:`HTTPError`, if one occurred.
Raises stored :class:`HTTPError`, if one occurred.
[ "Raises", "stored", ":", "class", ":", "HTTPError", "if", "one", "occurred", "." ]
def raise_for_status(self): """Raises stored :class:`HTTPError`, if one occurred.""" http_error_msg = '' if 400 <= self.status_code < 500: http_error_msg = '%s Client Error: %s' % (self.status_code, self.reason) elif 500 <= self.status_code < 600: http_error_ms...
[ "def", "raise_for_status", "(", "self", ")", ":", "http_error_msg", "=", "''", "if", "400", "<=", "self", ".", "status_code", "<", "500", ":", "http_error_msg", "=", "'%s Client Error: %s'", "%", "(", "self", ".", "status_code", ",", "self", ".", "reason", ...
https://github.com/plotly/arduino-api/blob/38ee5b191682532ebee908ceafbc67692730d39c/plotly_yun/Linino/requests/models.py#L761-L773
gramps-project/gramps
04d4651a43eb210192f40a9f8c2bad8ee8fa3753
gramps/gui/plug/report/_bookdialog.py
python
BookListDisplay.on_booklist_ok_clicked
(self, obj)
Return selected book. Also marks the current list to be saved into the xml file, if needed.
Return selected book. Also marks the current list to be saved into the xml file, if needed.
[ "Return", "selected", "book", ".", "Also", "marks", "the", "current", "list", "to", "be", "saved", "into", "the", "xml", "file", "if", "needed", "." ]
def on_booklist_ok_clicked(self, obj): """ Return selected book. Also marks the current list to be saved into the xml file, if needed. """ store, the_iter = self.blist.get_selected() if the_iter: data = self.blist.get_data(the_iter, [0]) self.selec...
[ "def", "on_booklist_ok_clicked", "(", "self", ",", "obj", ")", ":", "store", ",", "the_iter", "=", "self", ".", "blist", ".", "get_selected", "(", ")", "if", "the_iter", ":", "data", "=", "self", ".", "blist", ".", "get_data", "(", "the_iter", ",", "["...
https://github.com/gramps-project/gramps/blob/04d4651a43eb210192f40a9f8c2bad8ee8fa3753/gramps/gui/plug/report/_bookdialog.py#L216-L226
Rapptz/discord.py
45d498c1b76deaf3b394d17ccf56112fa691d160
discord/ui/select.py
python
Select.options
(self)
return self._underlying.options
List[:class:`discord.SelectOption`]: A list of options that can be selected in this menu.
List[:class:`discord.SelectOption`]: A list of options that can be selected in this menu.
[ "List", "[", ":", "class", ":", "discord", ".", "SelectOption", "]", ":", "A", "list", "of", "options", "that", "can", "be", "selected", "in", "this", "menu", "." ]
def options(self) -> List[SelectOption]: """List[:class:`discord.SelectOption`]: A list of options that can be selected in this menu.""" return self._underlying.options
[ "def", "options", "(", "self", ")", "->", "List", "[", "SelectOption", "]", ":", "return", "self", ".", "_underlying", ".", "options" ]
https://github.com/Rapptz/discord.py/blob/45d498c1b76deaf3b394d17ccf56112fa691d160/discord/ui/select.py#L169-L171
ladybug-tools/honeybee-legacy
bd62af4862fe022801fb87dbc8794fdf1dff73a9
src/Honeybee_Microclimate Map Analysis.py
python
mainUTCI
(HOYs, analysisPeriod, srfTempNumbers, srfTempHeaders, airTempDataNumbers, airTempDataHeaders, flowVolDataHeaders, flowVolDataNumbers, heatGainDataHeaders, heatGainDataNumbers, relHumidDataHeaders, relHumidDataNumbers, zoneSrfNames, testPtsViewFactor, viewFactorMesh, latitude, longitude, timeZone, diffSolarRad, directS...
[]
def mainUTCI(HOYs, analysisPeriod, srfTempNumbers, srfTempHeaders, airTempDataNumbers, airTempDataHeaders, flowVolDataHeaders, flowVolDataNumbers, heatGainDataHeaders, heatGainDataNumbers, relHumidDataHeaders, relHumidDataNumbers, zoneSrfNames, testPtsViewFactor, viewFactorMesh, latitude, longitude, timeZone, diffSolar...
[ "def", "mainUTCI", "(", "HOYs", ",", "analysisPeriod", ",", "srfTempNumbers", ",", "srfTempHeaders", ",", "airTempDataNumbers", ",", "airTempDataHeaders", ",", "flowVolDataHeaders", ",", "flowVolDataNumbers", ",", "heatGainDataHeaders", ",", "heatGainDataNumbers", ",", ...
https://github.com/ladybug-tools/honeybee-legacy/blob/bd62af4862fe022801fb87dbc8794fdf1dff73a9/src/Honeybee_Microclimate Map Analysis.py#L1165-L1368
PaddlePaddle/Research
2da0bd6c72d60e9df403aff23a7802779561c4a1
NLP/Conversational-Recommendation-BASELINE/conversational_recommendation/generative_model/tools/conversation_server.py
python
clientthread
(conn, addr)
client thread
client thread
[ "client", "thread" ]
def clientthread(conn, addr): """ client thread """ logstr = "addr:" + addr[0]+ "_" + str(addr[1]) try: #Receiving from client param = conn.recv(4096).decode() logstr += "\tparam:" + param if param is not None: response = predict(model, param.strip()) ...
[ "def", "clientthread", "(", "conn", ",", "addr", ")", ":", "logstr", "=", "\"addr:\"", "+", "addr", "[", "0", "]", "+", "\"_\"", "+", "str", "(", "addr", "[", "1", "]", ")", "try", ":", "#Receiving from client", "param", "=", "conn", ".", "recv", "...
https://github.com/PaddlePaddle/Research/blob/2da0bd6c72d60e9df403aff23a7802779561c4a1/NLP/Conversational-Recommendation-BASELINE/conversational_recommendation/generative_model/tools/conversation_server.py#L47-L63
edfungus/Crouton
ada98b3930192938a48909072b45cb84b945f875
clients/python_clients/cf_demo_client/cf_env/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py
python
ExFileObject.seek
(self, pos, whence=os.SEEK_SET)
Seek to a position in the file.
Seek to a position in the file.
[ "Seek", "to", "a", "position", "in", "the", "file", "." ]
def seek(self, pos, whence=os.SEEK_SET): """Seek to a position in the file. """ if self.closed: raise ValueError("I/O operation on closed file") if whence == os.SEEK_SET: self.position = min(max(pos, 0), self.size) elif whence == os.SEEK_CUR: ...
[ "def", "seek", "(", "self", ",", "pos", ",", "whence", "=", "os", ".", "SEEK_SET", ")", ":", "if", "self", ".", "closed", ":", "raise", "ValueError", "(", "\"I/O operation on closed file\"", ")", "if", "whence", "==", "os", ".", "SEEK_SET", ":", "self", ...
https://github.com/edfungus/Crouton/blob/ada98b3930192938a48909072b45cb84b945f875/clients/python_clients/cf_demo_client/cf_env/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L884-L903
aws/serverless-application-model
ab6943a340a3f489af62b8c70c1366242b2887fe
samtranslator/parser/parser.py
python
Parser._validate
(self, sam_template, parameter_values)
Validates the template and parameter values and raises exceptions if there's an issue :param dict sam_template: SAM template :param dict parameter_values: Dictionary of parameter values provided by the user
Validates the template and parameter values and raises exceptions if there's an issue
[ "Validates", "the", "template", "and", "parameter", "values", "and", "raises", "exceptions", "if", "there", "s", "an", "issue" ]
def _validate(self, sam_template, parameter_values): """Validates the template and parameter values and raises exceptions if there's an issue :param dict sam_template: SAM template :param dict parameter_values: Dictionary of parameter values provided by the user """ if parameter...
[ "def", "_validate", "(", "self", ",", "sam_template", ",", "parameter_values", ")", ":", "if", "parameter_values", "is", "None", ":", "raise", "ValueError", "(", "\"`parameter_values` argument is required\"", ")", "Parser", ".", "validate_datatypes", "(", "sam_templat...
https://github.com/aws/serverless-application-model/blob/ab6943a340a3f489af62b8c70c1366242b2887fe/samtranslator/parser/parser.py#L56-L74
ales-tsurko/cells
4cf7e395cd433762bea70cdc863a346f3a6fe1d0
packaging/macos/python/lib/python3.7/sysconfig.py
python
get_paths
(scheme=_get_default_scheme(), vars=None, expand=True)
Return a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform.
Return a mapping containing an install scheme.
[ "Return", "a", "mapping", "containing", "an", "install", "scheme", "." ]
def get_paths(scheme=_get_default_scheme(), vars=None, expand=True): """Return a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. """ if expand: return _expand_vars(scheme, vars) els...
[ "def", "get_paths", "(", "scheme", "=", "_get_default_scheme", "(", ")", ",", "vars", "=", "None", ",", "expand", "=", "True", ")", ":", "if", "expand", ":", "return", "_expand_vars", "(", "scheme", ",", "vars", ")", "else", ":", "return", "_INSTALL_SCHE...
https://github.com/ales-tsurko/cells/blob/4cf7e395cd433762bea70cdc863a346f3a6fe1d0/packaging/macos/python/lib/python3.7/sysconfig.py#L496-L505
elastic/elasticsearch-py
6ef1adfa3c840a84afda7369cd8e43ae7dc45cdb
elasticsearch/_sync/client/ml.py
python
MlClient.get_model_snapshots
( self, *, job_id: Any, snapshot_id: Optional[Any] = None, desc: Optional[bool] = None, end: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Optional[Union[List[str], str]] = None, from_: Optional[int] = None, human: ...
return self._perform_request("POST", __target, headers=__headers, body=__body)
Retrieves information about model snapshots. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html>`_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the model snapsh...
Retrieves information about model snapshots.
[ "Retrieves", "information", "about", "model", "snapshots", "." ]
def get_model_snapshots( self, *, job_id: Any, snapshot_id: Optional[Any] = None, desc: Optional[bool] = None, end: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Optional[Union[List[str], str]] = None, from_: Optional[int] ...
[ "def", "get_model_snapshots", "(", "self", ",", "*", ",", "job_id", ":", "Any", ",", "snapshot_id", ":", "Optional", "[", "Any", "]", "=", "None", ",", "desc", ":", "Optional", "[", "bool", "]", "=", "None", ",", "end", ":", "Optional", "[", "Any", ...
https://github.com/elastic/elasticsearch-py/blob/6ef1adfa3c840a84afda7369cd8e43ae7dc45cdb/elasticsearch/_sync/client/ml.py#L1694-L1771
Tautulli/Tautulli
2410eb33805aaac4bd1c5dad0f71e4f15afaf742
plexpy/__init__.py
python
startup_refresh
()
[]
def startup_refresh(): # Get the real PMS urls for SSL and remote access if CONFIG.PMS_TOKEN and CONFIG.PMS_IP and CONFIG.PMS_PORT: plextv.get_server_resources() # Connect server after server resource is refreshed if CONFIG.FIRST_RUN_COMPLETE: activity_pinger.connect_server(log=True, st...
[ "def", "startup_refresh", "(", ")", ":", "# Get the real PMS urls for SSL and remote access", "if", "CONFIG", ".", "PMS_TOKEN", "and", "CONFIG", ".", "PMS_IP", "and", "CONFIG", ".", "PMS_PORT", ":", "plextv", ".", "get_server_resources", "(", ")", "# Connect server af...
https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/plexpy/__init__.py#L588-L603
quantumblacklabs/causalnex
127d9324a3d68c1795299c7522f22cdea880f344
causalnex/structure/structuremodel.py
python
StructureModel.remove_edges_below_threshold
(self, threshold: float)
Remove edges whose absolute weights are less than a defined threshold. Args: threshold: edges whose absolute weight is less than this value are removed.
Remove edges whose absolute weights are less than a defined threshold.
[ "Remove", "edges", "whose", "absolute", "weights", "are", "less", "than", "a", "defined", "threshold", "." ]
def remove_edges_below_threshold(self, threshold: float): """ Remove edges whose absolute weights are less than a defined threshold. Args: threshold: edges whose absolute weight is less than this value are removed. """ self.remove_edges_from( [(u, v) for ...
[ "def", "remove_edges_below_threshold", "(", "self", ",", "threshold", ":", "float", ")", ":", "self", ".", "remove_edges_from", "(", "[", "(", "u", ",", "v", ")", "for", "u", ",", "v", ",", "w", "in", "self", ".", "edges", "(", "data", "=", "\"weight...
https://github.com/quantumblacklabs/causalnex/blob/127d9324a3d68c1795299c7522f22cdea880f344/causalnex/structure/structuremodel.py#L236-L245
shiyanlou/louplus-python
4c61697259e286e3d9116c3299f170d019ba3767
Python 实战大项目 seiya/seiya/seiya/web/app.py
python
job_hot_tags_plot
()
return Response(job.hot_tags_plot(format='png'), content_type='image/png')
热门职位标签图片
热门职位标签图片
[ "热门职位标签图片" ]
def job_hot_tags_plot(): """热门职位标签图片 """ return Response(job.hot_tags_plot(format='png'), content_type='image/png')
[ "def", "job_hot_tags_plot", "(", ")", ":", "return", "Response", "(", "job", ".", "hot_tags_plot", "(", "format", "=", "'png'", ")", ",", "content_type", "=", "'image/png'", ")" ]
https://github.com/shiyanlou/louplus-python/blob/4c61697259e286e3d9116c3299f170d019ba3767/Python 实战大项目 seiya/seiya/seiya/web/app.py#L90-L94
TheHive-Project/Cortex-Analyzers
2a16d0ed86af13c318d488f5ad994ef43940e6ba
analyzers/MaxMind/ipaddr.py
python
_BaseNet.supernet
(self, prefixlen_diff=1, new_prefix=None)
return IPNetwork('%s/%s' % (str(self.network), str(self.prefixlen - prefixlen_diff)), version=self._version)
The supernet containing the current network. Args: prefixlen_diff: An integer, the amount the prefix length of the network should be decreased by. For example, given a /24 network and a prefixlen_diff of 3, a supernet with a /21 netmask is returned. ...
The supernet containing the current network.
[ "The", "supernet", "containing", "the", "current", "network", "." ]
def supernet(self, prefixlen_diff=1, new_prefix=None): """The supernet containing the current network. Args: prefixlen_diff: An integer, the amount the prefix length of the network should be decreased by. For example, given a /24 network and a prefixlen_diff of ...
[ "def", "supernet", "(", "self", ",", "prefixlen_diff", "=", "1", ",", "new_prefix", "=", "None", ")", ":", "if", "self", ".", "_prefixlen", "==", "0", ":", "return", "self", "if", "new_prefix", "is", "not", "None", ":", "if", "new_prefix", ">", "self",...
https://github.com/TheHive-Project/Cortex-Analyzers/blob/2a16d0ed86af13c318d488f5ad994ef43940e6ba/analyzers/MaxMind/ipaddr.py#L1008-L1046
pyvisa/pyvisa
ae8c8b1180851ee4d120bc3527923c944b9623d6
pyvisa/shell.py
python
VisaShell.do_query
(self, args)
Query resource in use: query *IDN?
Query resource in use: query *IDN?
[ "Query", "resource", "in", "use", ":", "query", "*", "IDN?" ]
def do_query(self, args): """Query resource in use: query *IDN?""" if not self.current: print('There are no resources in use. Use the command "open".') return try: print("Response: {}".format(self.current.query(args))) except Exception as e: ...
[ "def", "do_query", "(", "self", ",", "args", ")", ":", "if", "not", "self", ".", "current", ":", "print", "(", "'There are no resources in use. Use the command \"open\".'", ")", "return", "try", ":", "print", "(", "\"Response: {}\"", ".", "format", "(", "self", ...
https://github.com/pyvisa/pyvisa/blob/ae8c8b1180851ee4d120bc3527923c944b9623d6/pyvisa/shell.py#L124-L134
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/site-packages/IPython/core/display.py
python
_safe_exists
(path)
Check path, but don't let exceptions raise
Check path, but don't let exceptions raise
[ "Check", "path", "but", "don", "t", "let", "exceptions", "raise" ]
def _safe_exists(path): """Check path, but don't let exceptions raise""" try: return os.path.exists(path) except Exception: return False
[ "def", "_safe_exists", "(", "path", ")", ":", "try", ":", "return", "os", ".", "path", ".", "exists", "(", "path", ")", "except", "Exception", ":", "return", "False" ]
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/IPython/core/display.py#L32-L37
numenta/nupic
b9ebedaf54f49a33de22d8d44dff7c765cdb5548
src/nupic/encoders/adaptive_scalar.py
python
AdaptiveScalarEncoder.getBucketInfo
(self, buckets)
return super(AdaptiveScalarEncoder, self).getBucketInfo(buckets)
[overrides nupic.encoders.scalar.ScalarEncoder.getBucketInfo]
[overrides nupic.encoders.scalar.ScalarEncoder.getBucketInfo]
[ "[", "overrides", "nupic", ".", "encoders", ".", "scalar", ".", "ScalarEncoder", ".", "getBucketInfo", "]" ]
def getBucketInfo(self, buckets): """ [overrides nupic.encoders.scalar.ScalarEncoder.getBucketInfo] """ if self.minval is None or self.maxval is None: return [EncoderResult(value=0, scalar=0, encoding=numpy.zeros(self.n))] return super(AdaptiveScalarEncoder, self)....
[ "def", "getBucketInfo", "(", "self", ",", "buckets", ")", ":", "if", "self", ".", "minval", "is", "None", "or", "self", ".", "maxval", "is", "None", ":", "return", "[", "EncoderResult", "(", "value", "=", "0", ",", "scalar", "=", "0", ",", "encoding"...
https://github.com/numenta/nupic/blob/b9ebedaf54f49a33de22d8d44dff7c765cdb5548/src/nupic/encoders/adaptive_scalar.py#L184-L193
bwohlberg/sporco
df67462abcf83af6ab1961bcb0d51b87a66483fa
sporco/fista/fista.py
python
FISTADFT.var_x
(self)
return self.Xf
r"""Get :math:`\mathbf{x}` variable in frequency domain.
r"""Get :math:`\mathbf{x}` variable in frequency domain.
[ "r", "Get", ":", "math", ":", "\\", "mathbf", "{", "x", "}", "variable", "in", "frequency", "domain", "." ]
def var_x(self): r"""Get :math:`\mathbf{x}` variable in frequency domain.""" return self.Xf
[ "def", "var_x", "(", "self", ")", ":", "return", "self", ".", "Xf" ]
https://github.com/bwohlberg/sporco/blob/df67462abcf83af6ab1961bcb0d51b87a66483fa/sporco/fista/fista.py#L898-L901
Fallen-Breath/MCDReforged
fdb1d2520b35f916123f265dbd94603981bb2b0c
mcdreforged/plugin/builtin/mcdreforged_plugin/mcdreforged_plugin.py
python
MCDReforgedPlugin.get_help_message
(self, source: CommandSource, translation_key: str)
return lst
[]
def get_help_message(self, source: CommandSource, translation_key: str): lst = RTextList() with source.preferred_language_context(): for line in self.tr(translation_key).to_plain_text().splitlines(keepends=True): prefix = re.search(r'(?<=§7)' + self.control_command_prefix + r'[\w ]*(?=§)', line) if prefi...
[ "def", "get_help_message", "(", "self", ",", "source", ":", "CommandSource", ",", "translation_key", ":", "str", ")", ":", "lst", "=", "RTextList", "(", ")", "with", "source", ".", "preferred_language_context", "(", ")", ":", "for", "line", "in", "self", "...
https://github.com/Fallen-Breath/MCDReforged/blob/fdb1d2520b35f916123f265dbd94603981bb2b0c/mcdreforged/plugin/builtin/mcdreforged_plugin/mcdreforged_plugin.py#L86-L95
inspurer/WorkAttendanceSystem
1221e2d67bdf5bb15fe99517cc3ded58ccb066df
V2.0/venv/Lib/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/ipaddress.py
python
_BaseNetwork.subnets
(self, prefixlen_diff=1, new_prefix=None)
The subnets which join to make the current subnet. In the case that self contains only one IP (self._prefixlen == 32 for IPv4 or self._prefixlen == 128 for IPv6), yield an iterator with just ourself. Args: prefixlen_diff: An integer, the amount the prefix length ...
The subnets which join to make the current subnet.
[ "The", "subnets", "which", "join", "to", "make", "the", "current", "subnet", "." ]
def subnets(self, prefixlen_diff=1, new_prefix=None): """The subnets which join to make the current subnet. In the case that self contains only one IP (self._prefixlen == 32 for IPv4 or self._prefixlen == 128 for IPv6), yield an iterator with just ourself. Args: pre...
[ "def", "subnets", "(", "self", ",", "prefixlen_diff", "=", "1", ",", "new_prefix", "=", "None", ")", ":", "if", "self", ".", "_prefixlen", "==", "self", ".", "_max_prefixlen", ":", "yield", "self", "return", "if", "new_prefix", "is", "not", "None", ":", ...
https://github.com/inspurer/WorkAttendanceSystem/blob/1221e2d67bdf5bb15fe99517cc3ded58ccb066df/V2.0/venv/Lib/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/ipaddress.py#L995-L1046
fake-name/ReadableWebProxy
ed5c7abe38706acc2684a1e6cd80242a03c5f010
WebMirror/management/rss_parser_funcs/feed_parse_extractAgrypniaScans.py
python
extractAgrypniaScans
(item)
return False
Parser for 'Agrypnia Scans'
Parser for 'Agrypnia Scans'
[ "Parser", "for", "Agrypnia", "Scans" ]
def extractAgrypniaScans(item): """ Parser for 'Agrypnia Scans' """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None if 'WATTT' in item['tags']: return buildReleaseMessageWithType(item, 'WATTT', vol, chp, frag=frag...
[ "def", "extractAgrypniaScans", "(", "item", ")", ":", "vol", ",", "chp", ",", "frag", ",", "postfix", "=", "extractVolChapterFragmentPostfix", "(", "item", "[", "'title'", "]", ")", "if", "not", "(", "chp", "or", "vol", ")", "or", "'preview'", "in", "ite...
https://github.com/fake-name/ReadableWebProxy/blob/ed5c7abe38706acc2684a1e6cd80242a03c5f010/WebMirror/management/rss_parser_funcs/feed_parse_extractAgrypniaScans.py#L1-L10
python/mypy
17850b3bd77ae9efb5d21f656c4e4e05ac48d894
mypy/util.py
python
find_python_encoding
(text: bytes, pyversion: Tuple[int, int])
PEP-263 for detecting Python file encoding
PEP-263 for detecting Python file encoding
[ "PEP", "-", "263", "for", "detecting", "Python", "file", "encoding" ]
def find_python_encoding(text: bytes, pyversion: Tuple[int, int]) -> Tuple[str, int]: """PEP-263 for detecting Python file encoding""" result = ENCODING_RE.match(text) if result: line = 2 if result.group(1) else 1 encoding = result.group(3).decode('ascii') # Handle some aliases that ...
[ "def", "find_python_encoding", "(", "text", ":", "bytes", ",", "pyversion", ":", "Tuple", "[", "int", ",", "int", "]", ")", "->", "Tuple", "[", "str", ",", "int", "]", ":", "result", "=", "ENCODING_RE", ".", "match", "(", "text", ")", "if", "result",...
https://github.com/python/mypy/blob/17850b3bd77ae9efb5d21f656c4e4e05ac48d894/mypy/util.py#L93-L105