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
zatosource/zato
2a9d273f06f9d776fbfeb53e73855af6e40fa208
code/zato-server/src/zato/server/connection/cache.py
python
CacheAPI.sync_after_delete_by_suffix
(self, cache_type, data)
Synchronizes the state of this worker's cache after a .delete_by_suffix operation in another worker process.
Synchronizes the state of this worker's cache after a .delete_by_suffix operation in another worker process.
[ "Synchronizes", "the", "state", "of", "this", "worker", "s", "cache", "after", "a", ".", "delete_by_suffix", "operation", "in", "another", "worker", "process", "." ]
def sync_after_delete_by_suffix(self, cache_type, data): """ Synchronizes the state of this worker's cache after a .delete_by_suffix operation in another worker process. """ self.caches[cache_type][data.cache_name].sync_after_delete_by_suffix(data)
[ "def", "sync_after_delete_by_suffix", "(", "self", ",", "cache_type", ",", "data", ")", ":", "self", ".", "caches", "[", "cache_type", "]", "[", "data", ".", "cache_name", "]", ".", "sync_after_delete_by_suffix", "(", "data", ")" ]
https://github.com/zatosource/zato/blob/2a9d273f06f9d776fbfeb53e73855af6e40fa208/code/zato-server/src/zato/server/connection/cache.py#L1054-L1057
DamnWidget/anaconda
a9998fb362320f907d5ccbc6fcf5b62baca677c0
anaconda_server/commands/complete_parameters.py
python
CompleteParameters.run
(self)
Run the command
Run the command
[ "Run", "the", "command" ]
def run(self): """Run the command """ completions = [] complete_all = self.settings.get('complete_all_parameters', False) try: signatures = self.script.call_signatures()[0] except IndexError: signatures = None params = get_function_param...
[ "def", "run", "(", "self", ")", ":", "completions", "=", "[", "]", "complete_all", "=", "self", ".", "settings", ".", "get", "(", "'complete_all_parameters'", ",", "False", ")", "try", ":", "signatures", "=", "self", ".", "script", ".", "call_signatures", ...
https://github.com/DamnWidget/anaconda/blob/a9998fb362320f907d5ccbc6fcf5b62baca677c0/anaconda_server/commands/complete_parameters.py#L18-L49
chipmuenk/pyfda
665310b8548a940a575c0e5ff4bba94608d9ac26
pyfda/input_widgets/freq_specs.py
python
FreqSpecs.sort_dict_freqs
(self)
- Sort visible filter dict frequency spec entries with ascending frequency if the sort button is activated - Update the visible QLineEdit frequency widgets The method is called when: - update_UI has been called after changing the filter design algorithm that the response ...
- Sort visible filter dict frequency spec entries with ascending frequency if the sort button is activated - Update the visible QLineEdit frequency widgets
[ "-", "Sort", "visible", "filter", "dict", "frequency", "spec", "entries", "with", "ascending", "frequency", "if", "the", "sort", "button", "is", "activated", "-", "Update", "the", "visible", "QLineEdit", "frequency", "widgets" ]
def sort_dict_freqs(self): """ - Sort visible filter dict frequency spec entries with ascending frequency if the sort button is activated - Update the visible QLineEdit frequency widgets The method is called when: - update_UI has been called after changing the filte...
[ "def", "sort_dict_freqs", "(", "self", ")", ":", "f_specs", "=", "[", "fb", ".", "fil", "[", "0", "]", "[", "str", "(", "self", ".", "qlineedit", "[", "i", "]", ".", "objectName", "(", ")", ")", "]", "for", "i", "in", "range", "(", "self", ".",...
https://github.com/chipmuenk/pyfda/blob/665310b8548a940a575c0e5ff4bba94608d9ac26/pyfda/input_widgets/freq_specs.py#L334-L376
insarlab/MintPy
4357b8c726dec8a3f936770e3f3dda92882685b7
mintpy/simulation/simulation.py
python
sim_variable_timeseries_v1
(tbase, scale=3., display=False)
return ts_sim
Simulate time variable displacement time-series Parameters: tbase - 1D np.ndarray in size of (num_date,), temporal baseline in days Returns: ts_sim - 1D np.ndarray in size of (num_date,), displacement time-series in meters
Simulate time variable displacement time-series
[ "Simulate", "time", "variable", "displacement", "time", "-", "series" ]
def sim_variable_timeseries_v1(tbase, scale=3., display=False): """Simulate time variable displacement time-series Parameters: tbase - 1D np.ndarray in size of (num_date,), temporal baseline in days Returns: ts_sim - 1D np.ndarray in size of (num_date,), displacement time-series in meters """ ...
[ "def", "sim_variable_timeseries_v1", "(", "tbase", ",", "scale", "=", "3.", ",", "display", "=", "False", ")", ":", "# Opt 2 - Time variable", "num_date", "=", "len", "(", "tbase", ")", "ts_sim", "=", "np", ".", "zeros", "(", "num_date", ",", "np", ".", ...
https://github.com/insarlab/MintPy/blob/4357b8c726dec8a3f936770e3f3dda92882685b7/mintpy/simulation/simulation.py#L97-L134
BigBrotherBot/big-brother-bot
848823c71413c86e7f1ff9584f43e08d40a7f2c0
b3/parsers/frontline/protocol.py
python
Client.login
(self, challenge)
Authenticate to the server from Frontline documentation : Open a TCP/IP streaming socket to the remote console port of the server All commands sent and received are separated with new line characters '\n' or 0x04 The server will send back a...
Authenticate to the server from Frontline documentation : Open a TCP/IP streaming socket to the remote console port of the server All commands sent and received are separated with new line characters '\n' or 0x04 The server will send back a...
[ "Authenticate", "to", "the", "server", "from", "Frontline", "documentation", ":", "Open", "a", "TCP", "/", "IP", "streaming", "socket", "to", "the", "remote", "console", "port", "of", "the", "server", "All", "commands", "sent", "and", "received", "are", "sep...
def login(self, challenge): """ Authenticate to the server from Frontline documentation : Open a TCP/IP streaming socket to the remote console port of the server All commands sent and received are separated with new line characters '\n' or 0x04 ...
[ "def", "login", "(", "self", ",", "challenge", ")", ":", "self", ".", "console", ".", "info", "(", "\"logging to Frontline server with username %r\"", "%", "self", ".", "_username", ")", "hashed_password", "=", "md5", ".", "new", "(", "\"%s%s\"", "%", "(", "...
https://github.com/BigBrotherBot/big-brother-bot/blob/848823c71413c86e7f1ff9584f43e08d40a7f2c0/b3/parsers/frontline/protocol.py#L103-L136
machawk1/wail
199bd1bfbd5d1126f83b113ce5261c3312a7b9ef
bundledApps/WAIL.py
python
WAILStatusBar.__init__
(self, parent)
[]
def __init__(self, parent): wx.StatusBar.__init__(self, parent, -1) self.parent = parent self.SetFieldsCount(2) self.SetStatusWidths([-2, 30]) self.sb_button = wx.Button( self, wx.ID_ANY, "", style=wx.BU_EXACTFIT | wx.BORDER_NONE ) self.msg = '' ...
[ "def", "__init__", "(", "self", ",", "parent", ")", ":", "wx", ".", "StatusBar", ".", "__init__", "(", "self", ",", "parent", ",", "-", "1", ")", "self", ".", "parent", "=", "parent", "self", ".", "SetFieldsCount", "(", "2", ")", "self", ".", "SetS...
https://github.com/machawk1/wail/blob/199bd1bfbd5d1126f83b113ce5261c3312a7b9ef/bundledApps/WAIL.py#L2459-L2471
wistbean/learn_python3_spider
73c873f4845f4385f097e5057407d03dd37a117b
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/util.py
python
untilConcludes
(f, *a, **kw)
Call C{f} with the given arguments, handling C{EINTR} by retrying. @param f: A function to call. @param *a: Positional arguments to pass to C{f}. @param **kw: Keyword arguments to pass to C{f}. @return: Whatever C{f} returns. @raise: Whatever C{f} raises, except for C{IOError} or C{OSError} wit...
Call C{f} with the given arguments, handling C{EINTR} by retrying.
[ "Call", "C", "{", "f", "}", "with", "the", "given", "arguments", "handling", "C", "{", "EINTR", "}", "by", "retrying", "." ]
def untilConcludes(f, *a, **kw): """ Call C{f} with the given arguments, handling C{EINTR} by retrying. @param f: A function to call. @param *a: Positional arguments to pass to C{f}. @param **kw: Keyword arguments to pass to C{f}. @return: Whatever C{f} returns. @raise: Whatever C{f} ra...
[ "def", "untilConcludes", "(", "f", ",", "*", "a", ",", "*", "*", "kw", ")", ":", "while", "True", ":", "try", ":", "return", "f", "(", "*", "a", ",", "*", "*", "kw", ")", "except", "(", "IOError", ",", "OSError", ")", "as", "e", ":", "if", ...
https://github.com/wistbean/learn_python3_spider/blob/73c873f4845f4385f097e5057407d03dd37a117b/stackoverflow/venv/lib/python3.6/site-packages/twisted/python/util.py#L798-L819
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_hxb2/lib/python3.5/site-packages/django/contrib/gis/gdal/field.py
python
OFTInteger.type
(self)
return 0
GDAL uses OFTReals to represent OFTIntegers in created shapefiles -- forcing the type here since the underlying field type may actually be OFTReal.
GDAL uses OFTReals to represent OFTIntegers in created shapefiles -- forcing the type here since the underlying field type may actually be OFTReal.
[ "GDAL", "uses", "OFTReals", "to", "represent", "OFTIntegers", "in", "created", "shapefiles", "--", "forcing", "the", "type", "here", "since", "the", "underlying", "field", "type", "may", "actually", "be", "OFTReal", "." ]
def type(self): """ GDAL uses OFTReals to represent OFTIntegers in created shapefiles -- forcing the type here since the underlying field type may actually be OFTReal. """ return 0
[ "def", "type", "(", "self", ")", ":", "return", "0" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/django/contrib/gis/gdal/field.py#L125-L131
Tautulli/Tautulli
2410eb33805aaac4bd1c5dad0f71e4f15afaf742
lib/musicbrainzngs/mbxml.py
python
parse_alias
(alias)
return result
[]
def parse_alias(alias): result = {} attribs = ["locale", "sort-name", "type", "primary", "begin-date", "end-date"] result.update(parse_attributes(attribs, alias)) result["alias"] = alias.text return result
[ "def", "parse_alias", "(", "alias", ")", ":", "result", "=", "{", "}", "attribs", "=", "[", "\"locale\"", ",", "\"sort-name\"", ",", "\"type\"", ",", "\"primary\"", ",", "\"begin-date\"", ",", "\"end-date\"", "]", "result", ".", "update", "(", "parse_attribu...
https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/musicbrainzngs/mbxml.py#L735-L743
SpaceNetChallenge/SpaceNet_Off_Nadir_Solutions
014c4ca27a70b5907a183e942228004c989dcbe4
selim_sef/zoo/senet.py
python
SEBottleneck.__init__
(self, inplanes, planes, groups, reduction, stride=1, downsample=None)
[]
def __init__(self, inplanes, planes, groups, reduction, stride=1, downsample=None): super(SEBottleneck, self).__init__() self.conv1 = nn.Conv2d(inplanes, planes * 2, kernel_size=1, bias=False) self.bn1 = BatchNorm2d(planes * 2) self.conv2 = nn.Conv2d(planes * 2, planes *...
[ "def", "__init__", "(", "self", ",", "inplanes", ",", "planes", ",", "groups", ",", "reduction", ",", "stride", "=", "1", ",", "downsample", "=", "None", ")", ":", "super", "(", "SEBottleneck", ",", "self", ")", ".", "__init__", "(", ")", "self", "."...
https://github.com/SpaceNetChallenge/SpaceNet_Off_Nadir_Solutions/blob/014c4ca27a70b5907a183e942228004c989dcbe4/selim_sef/zoo/senet.py#L179-L194
hahwul/a2sv
cb24c4e8bd7c9f06eb74658039c20bbed4f8b2ef
module/M_heartbleed.py
python
parseresp
(s)
[]
def parseresp(s): while True: typ, ver, pay = recvmsg(s) if typ == None: zzzzz=1#showDisplay(displayMode,'Server closed connection without sending Server Hello.') return 0 # Look for server hello done message. if typ == 22 and ord(pay[0]) == 0x0E: return ver
[ "def", "parseresp", "(", "s", ")", ":", "while", "True", ":", "typ", ",", "ver", ",", "pay", "=", "recvmsg", "(", "s", ")", "if", "typ", "==", "None", ":", "zzzzz", "=", "1", "#showDisplay(displayMode,'Server closed connection without sending Server Hello.')", ...
https://github.com/hahwul/a2sv/blob/cb24c4e8bd7c9f06eb74658039c20bbed4f8b2ef/module/M_heartbleed.py#L134-L142
tweecode/twine
45e6350a2b813ec4282440b78f901cf377ead1a9
storyframe.py
python
StoryFrame.importFontDialog
(self, event=None)
Asks the user to choose a font file to import, then imports into the current story.
Asks the user to choose a font file to import, then imports into the current story.
[ "Asks", "the", "user", "to", "choose", "a", "font", "file", "to", "import", "then", "imports", "into", "the", "current", "story", "." ]
def importFontDialog(self, event=None): """Asks the user to choose a font file to import, then imports into the current story.""" dialog = wx.FileDialog(self, 'Import Font File', os.getcwd(), '', \ 'Web Font File (.ttf, .otf, .woff, .woff2, .svg)|*.ttf;*.otf;*.woff;*.woff2...
[ "def", "importFontDialog", "(", "self", ",", "event", "=", "None", ")", ":", "dialog", "=", "wx", ".", "FileDialog", "(", "self", ",", "'Import Font File'", ",", "os", ".", "getcwd", "(", ")", ",", "''", ",", "'Web Font File (.ttf, .otf, .woff, .woff2, .svg)|*...
https://github.com/tweecode/twine/blob/45e6350a2b813ec4282440b78f901cf377ead1a9/storyframe.py#L706-L712
dimagi/commcare-hq
d67ff1d3b4c51fa050c19e60c3253a79d3452a39
corehq/ex-submodules/pillowtop/reindexer/reindexer.py
python
ElasticPillowReindexer.__init__
(self, pillow_or_processor, change_provider, elasticsearch, index_info, in_place=False)
[]
def __init__(self, pillow_or_processor, change_provider, elasticsearch, index_info, in_place=False): super(ElasticPillowReindexer, self).__init__(pillow_or_processor, change_provider) self.es = elasticsearch self.index_info = index_info self.in_place = in_place
[ "def", "__init__", "(", "self", ",", "pillow_or_processor", ",", "change_provider", ",", "elasticsearch", ",", "index_info", ",", "in_place", "=", "False", ")", ":", "super", "(", "ElasticPillowReindexer", ",", "self", ")", ".", "__init__", "(", "pillow_or_proce...
https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/ex-submodules/pillowtop/reindexer/reindexer.py#L167-L171
tensorflow/benchmarks
16af178ad312e8c1213efb27a5f227044228bfdf
scripts/tf_cnn_benchmarks/variable_mgr.py
python
VariableMgr.create_outer_variable_scope
(self, device_num)
Create the tf.variable_scope around all model graph operations.
Create the tf.variable_scope around all model graph operations.
[ "Create", "the", "tf", ".", "variable_scope", "around", "all", "model", "graph", "operations", "." ]
def create_outer_variable_scope(self, device_num): """Create the tf.variable_scope around all model graph operations.""" del device_num # unused by this implementation assert False, 'Must be implemented in subclass'
[ "def", "create_outer_variable_scope", "(", "self", ",", "device_num", ")", ":", "del", "device_num", "# unused by this implementation", "assert", "False", ",", "'Must be implemented in subclass'" ]
https://github.com/tensorflow/benchmarks/blob/16af178ad312e8c1213efb27a5f227044228bfdf/scripts/tf_cnn_benchmarks/variable_mgr.py#L58-L61
caiiiac/Machine-Learning-with-Python
1a26c4467da41ca4ebc3d5bd789ea942ef79422f
MachineLearning/venv/lib/python3.5/site-packages/sklearn/svm/classes.py
python
LinearSVC.fit
(self, X, y, sample_weight=None)
return self
Fit the model according to the given training data. Parameters ---------- X : {array-like, sparse matrix}, shape = [n_samples, n_features] Training vector, where n_samples in the number of samples and n_features is the number of features. y : array-like, shape =...
Fit the model according to the given training data.
[ "Fit", "the", "model", "according", "to", "the", "given", "training", "data", "." ]
def fit(self, X, y, sample_weight=None): """Fit the model according to the given training data. Parameters ---------- X : {array-like, sparse matrix}, shape = [n_samples, n_features] Training vector, where n_samples in the number of samples and n_features is the ...
[ "def", "fit", "(", "self", ",", "X", ",", "y", ",", "sample_weight", "=", "None", ")", ":", "# FIXME Remove l1/l2 support in 1.0 -----------------------------------", "msg", "=", "(", "\"loss='%s' has been deprecated in favor of \"", "\"loss='%s' as of 0.16. Backward compatibil...
https://github.com/caiiiac/Machine-Learning-with-Python/blob/1a26c4467da41ca4ebc3d5bd789ea942ef79422f/MachineLearning/venv/lib/python3.5/site-packages/sklearn/svm/classes.py#L168-L223
cuthbertLab/music21
bd30d4663e52955ed922c10fdf541419d8c67671
music21/meter/tools.py
python
slashMixedToFraction
(valueSrc: str)
return tuple(post), summedNumerator
Given a mixture if possible meter fraction representations, return a list of pairs. If originally given as a summed numerator; break into separate fractions and return True as the second element of the tuple >>> meter.tools.slashMixedToFraction('4/4') (((4, 4),), False) >>> meter.tools.slashMixedT...
Given a mixture if possible meter fraction representations, return a list of pairs. If originally given as a summed numerator; break into separate fractions and return True as the second element of the tuple
[ "Given", "a", "mixture", "if", "possible", "meter", "fraction", "representations", "return", "a", "list", "of", "pairs", ".", "If", "originally", "given", "as", "a", "summed", "numerator", ";", "break", "into", "separate", "fractions", "and", "return", "True",...
def slashMixedToFraction(valueSrc: str) -> Tuple[NumDenomTuple, bool]: ''' Given a mixture if possible meter fraction representations, return a list of pairs. If originally given as a summed numerator; break into separate fractions and return True as the second element of the tuple >>> meter.tools....
[ "def", "slashMixedToFraction", "(", "valueSrc", ":", "str", ")", "->", "Tuple", "[", "NumDenomTuple", ",", "bool", "]", ":", "pre", "=", "[", "]", "post", "=", "[", "]", "summedNumerator", "=", "False", "value", "=", "valueSrc", ".", "strip", "(", ")",...
https://github.com/cuthbertLab/music21/blob/bd30d4663e52955ed922c10fdf541419d8c67671/music21/meter/tools.py#L98-L173
openstack/tempest
fe0ac89a5a1c43fa908a76759cd99eea3b1f9853
tempest/lib/services/placement/resource_providers_client.py
python
ResourceProvidersClient.list_resource_providers
(self, **params)
return rest_client.ResponseBody(resp, body)
List resource providers. For full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/placement/#list-resource-providers
List resource providers.
[ "List", "resource", "providers", "." ]
def list_resource_providers(self, **params): """List resource providers. For full list of available parameters, please refer to the official API reference: https://docs.openstack.org/api-ref/placement/#list-resource-providers """ url = '/resource_providers' if pa...
[ "def", "list_resource_providers", "(", "self", ",", "*", "*", "params", ")", ":", "url", "=", "'/resource_providers'", "if", "params", ":", "url", "+=", "'?%s'", "%", "urllib", ".", "urlencode", "(", "params", ")", "resp", ",", "body", "=", "self", ".", ...
https://github.com/openstack/tempest/blob/fe0ac89a5a1c43fa908a76759cd99eea3b1f9853/tempest/lib/services/placement/resource_providers_client.py#L32-L45
pymedusa/Medusa
1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
ext/attr/_make.py
python
_ClassBuilder._patch_original_class
(self)
return cls
Apply accumulated methods and return the class.
Apply accumulated methods and return the class.
[ "Apply", "accumulated", "methods", "and", "return", "the", "class", "." ]
def _patch_original_class(self): """ Apply accumulated methods and return the class. """ cls = self._cls base_names = self._base_names # Clean class of attribute definitions (`attr.ib()`s). if self._delete_attribs: for name in self._attr_names: ...
[ "def", "_patch_original_class", "(", "self", ")", ":", "cls", "=", "self", ".", "_cls", "base_names", "=", "self", ".", "_base_names", "# Clean class of attribute definitions (`attr.ib()`s).", "if", "self", ".", "_delete_attribs", ":", "for", "name", "in", "self", ...
https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/ext/attr/_make.py#L507-L533
marcusva/py-sdl2
d549fc58de7aa204a119dc8dedef81b3cc888fb9
sdl2/ext/window.py
python
Window.refresh
(self)
Updates the window to reflect any changes made to its surface. .. note:: This only needs to be called if the window surface was acquired and modified using :meth:`get_surface`.
Updates the window to reflect any changes made to its surface.
[ "Updates", "the", "window", "to", "reflect", "any", "changes", "made", "to", "its", "surface", "." ]
def refresh(self): """Updates the window to reflect any changes made to its surface. .. note:: This only needs to be called if the window surface was acquired and modified using :meth:`get_surface`. """ video.SDL_UpdateWindowSurface(self.window)
[ "def", "refresh", "(", "self", ")", ":", "video", ".", "SDL_UpdateWindowSurface", "(", "self", ".", "window", ")" ]
https://github.com/marcusva/py-sdl2/blob/d549fc58de7aa204a119dc8dedef81b3cc888fb9/sdl2/ext/window.py#L215-L223
TryCatchHCF/DumpsterFire
43b46a274663ff694763db6e627975e160bc3597
FireModules/OSCommand/os_win_powershell_script.py
python
os_win_powershell_script.__init__
(self, moofStr)
return
[]
def __init__(self, moofStr): self.moofStr = moofStr self.commentsStr = "OSCommand/os_win_powershell_script" self.psScriptFilepathStr = "" return;
[ "def", "__init__", "(", "self", ",", "moofStr", ")", ":", "self", ".", "moofStr", "=", "moofStr", "self", ".", "commentsStr", "=", "\"OSCommand/os_win_powershell_script\"", "self", ".", "psScriptFilepathStr", "=", "\"\"", "return" ]
https://github.com/TryCatchHCF/DumpsterFire/blob/43b46a274663ff694763db6e627975e160bc3597/FireModules/OSCommand/os_win_powershell_script.py#L30-L34
kuri65536/python-for-android
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
python3-alpha/python-libs/gdata/apps/emailsettings/client.py
python
EmailSettingsClient.update_imap
(self, username, enable, **kwargs)
return self.update(new_imap, **kwargs)
Update Google Mail IMAP settings. Args: username: string The name of the user. enable: Boolean Whether to enable IMAP access.language kwargs: The other parameters to pass to the update method. Returns: gdata.apps.emailsettings.data.EmailSettingsImap of the updated resource.
Update Google Mail IMAP settings. Args: username: string The name of the user. enable: Boolean Whether to enable IMAP access.language kwargs: The other parameters to pass to the update method.
[ "Update", "Google", "Mail", "IMAP", "settings", ".", "Args", ":", "username", ":", "string", "The", "name", "of", "the", "user", ".", "enable", ":", "Boolean", "Whether", "to", "enable", "IMAP", "access", ".", "language", "kwargs", ":", "The", "other", "...
def update_imap(self, username, enable, **kwargs): """Update Google Mail IMAP settings. Args: username: string The name of the user. enable: Boolean Whether to enable IMAP access.language kwargs: The other parameters to pass to the update method. Returns: gdata.apps.emailsettings....
[ "def", "update_imap", "(", "self", ",", "username", ",", "enable", ",", "*", "*", "kwargs", ")", ":", "uri", "=", "self", ".", "MakeEmailSettingsUri", "(", "username", "=", "username", ",", "setting_id", "=", "SETTING_ID_IMAP", ")", "new_imap", "=", "gdata...
https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python3-alpha/python-libs/gdata/apps/emailsettings/client.py#L391-L406
JiYou/openstack
8607dd488bde0905044b303eb6e52bdea6806923
packages/source/cinder/cinder/image/glance.py
python
GlanceClientWrapper.call
(self, context, method, *args, **kwargs)
Call a glance client method. If we get a connection error, retry the request according to FLAGS.glance_num_retries.
Call a glance client method. If we get a connection error, retry the request according to FLAGS.glance_num_retries.
[ "Call", "a", "glance", "client", "method", ".", "If", "we", "get", "a", "connection", "error", "retry", "the", "request", "according", "to", "FLAGS", ".", "glance_num_retries", "." ]
def call(self, context, method, *args, **kwargs): """ Call a glance client method. If we get a connection error, retry the request according to FLAGS.glance_num_retries. """ version = self.version if version in kwargs: version = kwargs['version'] ret...
[ "def", "call", "(", "self", ",", "context", ",", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "version", "=", "self", ".", "version", "if", "version", "in", "kwargs", ":", "version", "=", "kwargs", "[", "'version'", "]", "retry_excs...
https://github.com/JiYou/openstack/blob/8607dd488bde0905044b303eb6e52bdea6806923/packages/source/cinder/cinder/image/glance.py#L128-L161
google-research/language
61fa7260ac7d690d11ef72ca863e45a37c0bdc80
language/conpono/create_pretrain_data/books_preproc_pipeline.py
python
books_pipeline
()
return pipeline
Read Books Corpus filenames and create Beam pipeline.
Read Books Corpus filenames and create Beam pipeline.
[ "Read", "Books", "Corpus", "filenames", "and", "create", "Beam", "pipeline", "." ]
def books_pipeline(): """Read Books Corpus filenames and create Beam pipeline.""" # set a random seed for reproducability rng = random.Random(FLAGS.random_seed) # BooksCorpus is organized into directories of genre and files of books # adventure-all.txt seems to contain all the adventure books in 1 file # ...
[ "def", "books_pipeline", "(", ")", ":", "# set a random seed for reproducability", "rng", "=", "random", ".", "Random", "(", "FLAGS", ".", "random_seed", ")", "# BooksCorpus is organized into directories of genre and files of books", "# adventure-all.txt seems to contain all the ad...
https://github.com/google-research/language/blob/61fa7260ac7d690d11ef72ca863e45a37c0bdc80/language/conpono/create_pretrain_data/books_preproc_pipeline.py#L156-L234
oracle/oci-python-sdk
3c1604e4e212008fb6718e2f68cdb5ef71fd5793
examples/load_balancer_path_route_sets_example.py
python
create_vcn_and_subnets
(virtual_network, compartment_id, first_ad, second_ad)
return {'vcn': vcn, 'subnets': [subnet_one, subnet_two]}
[]
def create_vcn_and_subnets(virtual_network, compartment_id, first_ad, second_ad): # Create a VCN vcn_name = 'python_sdk_test_lb_vcn' cidr_block = "10.0.0.0/16" result = virtual_network.create_vcn( oci.core.models.CreateVcnDetails( cidr_block=cidr_block, display_name=vcn_n...
[ "def", "create_vcn_and_subnets", "(", "virtual_network", ",", "compartment_id", ",", "first_ad", ",", "second_ad", ")", ":", "# Create a VCN", "vcn_name", "=", "'python_sdk_test_lb_vcn'", "cidr_block", "=", "\"10.0.0.0/16\"", "result", "=", "virtual_network", ".", "crea...
https://github.com/oracle/oci-python-sdk/blob/3c1604e4e212008fb6718e2f68cdb5ef71fd5793/examples/load_balancer_path_route_sets_example.py#L23-L86
plaid/plaid-python
8c60fca608e426f3ff30da8857775946d29e122c
plaid/model/deductions.py
python
Deductions.__init__
(self, breakdown, total, *args, **kwargs)
Deductions - a model defined in OpenAPI Args: breakdown ([DeductionsBreakdown]): total (DeductionsTotal): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be ...
Deductions - a model defined in OpenAPI
[ "Deductions", "-", "a", "model", "defined", "in", "OpenAPI" ]
def __init__(self, breakdown, total, *args, **kwargs): # noqa: E501 """Deductions - a model defined in OpenAPI Args: breakdown ([DeductionsBreakdown]): total (DeductionsTotal): Keyword Args: _check_type (bool): if True, values for parameters in openapi_type...
[ "def", "__init__", "(", "self", ",", "breakdown", ",", "total", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# noqa: E501", "_check_type", "=", "kwargs", ".", "pop", "(", "'_check_type'", ",", "True", ")", "_spec_property_naming", "=", "kwargs", ...
https://github.com/plaid/plaid-python/blob/8c60fca608e426f3ff30da8857775946d29e122c/plaid/model/deductions.py#L119-L193
karanchahal/distiller
a17ec06cbeafcdd2aea19d7c7663033c951392f5
models/vision/inception.py
python
Inception3.forward
(self, x)
[]
def forward(self, x): x = self._transform_input(x) x, aux = self._forward(x) aux_defined = self.training and self.aux_logits if torch.jit.is_scripting(): if not aux_defined: warnings.warn("Scripted Inception3 always returns Inception3 Tuple") retur...
[ "def", "forward", "(", "self", ",", "x", ")", ":", "x", "=", "self", ".", "_transform_input", "(", "x", ")", "x", ",", "aux", "=", "self", ".", "_forward", "(", "x", ")", "aux_defined", "=", "self", ".", "training", "and", "self", ".", "aux_logits"...
https://github.com/karanchahal/distiller/blob/a17ec06cbeafcdd2aea19d7c7663033c951392f5/models/vision/inception.py#L190-L199
alexmic/microtemplates
c45896b95bb577fdd831b54c7698e9856af7b170
microtemplates/base.py
python
_Variable.render
(self, context)
return resolve(self.name, context)
[]
def render(self, context): return resolve(self.name, context)
[ "def", "render", "(", "self", ",", "context", ")", ":", "return", "resolve", "(", "self", ".", "name", ",", "context", ")" ]
https://github.com/alexmic/microtemplates/blob/c45896b95bb577fdd831b54c7698e9856af7b170/microtemplates/base.py#L136-L137
plotly/plotly.py
cfad7862594b35965c0e000813bd7805e8494a5b
packages/python/plotly/plotly/graph_objs/scattergl/_error_y.py
python
ErrorY.array
(self)
return self["array"]
Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data. The 'array' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns ------- numpy.ndarray
Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data. The 'array' property is an array that may be specified as a tuple, list, numpy array, or pandas Series
[ "Sets", "the", "data", "corresponding", "the", "length", "of", "each", "error", "bar", ".", "Values", "are", "plotted", "relative", "to", "the", "underlying", "data", ".", "The", "array", "property", "is", "an", "array", "that", "may", "be", "specified", "...
def array(self): """ Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data. The 'array' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns ------- ...
[ "def", "array", "(", "self", ")", ":", "return", "self", "[", "\"array\"", "]" ]
https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/scattergl/_error_y.py#L31-L43
keiffster/program-y
8c99b56f8c32f01a7b9887b5daae9465619d0385
src/programy/parser/exceptions.py
python
MatcherException.__init__
(self, message)
[]
def __init__(self, message): Exception.__init__(self, message) self.message = message
[ "def", "__init__", "(", "self", ",", "message", ")", ":", "Exception", ".", "__init__", "(", "self", ",", "message", ")", "self", ".", "message", "=", "message" ]
https://github.com/keiffster/program-y/blob/8c99b56f8c32f01a7b9887b5daae9465619d0385/src/programy/parser/exceptions.py#L83-L85
carpedm20/LINE
501d1515cb84dc0c353ef33e345901de5bf5427c
line/client.py
python
LineClient.longPoll
(self, count=50, debug=False)
Receive a list of operations that have to be processed by original Line cleint. :param count: number of operations to get from :returns: a generator which returns operations >>> for op in client.longPoll(): sender = op[0] receiver = op[1] ...
Receive a list of operations that have to be processed by original Line cleint.
[ "Receive", "a", "list", "of", "operations", "that", "have", "to", "be", "processed", "by", "original", "Line", "cleint", "." ]
def longPoll(self, count=50, debug=False): """Receive a list of operations that have to be processed by original Line cleint. :param count: number of operations to get from :returns: a generator which returns operations >>> for op in client.longPoll(): sender ...
[ "def", "longPoll", "(", "self", ",", "count", "=", "50", ",", "debug", "=", "False", ")", ":", "\"\"\"Check is there any operations from LINE server\"\"\"", "OT", "=", "OperationType", "try", ":", "operations", "=", "self", ".", "_fetchOperations", "(", "self", ...
https://github.com/carpedm20/LINE/blob/501d1515cb84dc0c353ef33e345901de5bf5427c/line/client.py#L490-L574
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/site-packages/mistune.py
python
InlineGrammar.hard_wrap
(self)
Grammar for hard wrap linebreak. You don't need to add two spaces at the end of a line.
Grammar for hard wrap linebreak. You don't need to add two spaces at the end of a line.
[ "Grammar", "for", "hard", "wrap", "linebreak", ".", "You", "don", "t", "need", "to", "add", "two", "spaces", "at", "the", "end", "of", "a", "line", "." ]
def hard_wrap(self): """Grammar for hard wrap linebreak. You don't need to add two spaces at the end of a line. """ self.linebreak = re.compile(r'^ *\n(?!\s*$)') self.text = re.compile( r'^[\s\S]+?(?=[\\<!\[_*`~]|https?://| *\n|$)' )
[ "def", "hard_wrap", "(", "self", ")", ":", "self", ".", "linebreak", "=", "re", ".", "compile", "(", "r'^ *\\n(?!\\s*$)'", ")", "self", ".", "text", "=", "re", ".", "compile", "(", "r'^[\\s\\S]+?(?=[\\\\<!\\[_*`~]|https?://| *\\n|$)'", ")" ]
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/mistune.py#L509-L516
wistbean/fxxkpython
88e16d79d8dd37236ba6ecd0d0ff11d63143968c
vip/qyxuan/projects/venv/lib/python3.6/site-packages/pygame/midi.py
python
Input.read
(self, num_events)
return self._input.Read(num_events)
reads num_events midi events from the buffer. Input.read(num_events): return midi_event_list Reads from the Input buffer and gives back midi events. [[[status,data1,data2,data3],timestamp], [[status,data1,data2,data3],timestamp],...]
reads num_events midi events from the buffer. Input.read(num_events): return midi_event_list
[ "reads", "num_events", "midi", "events", "from", "the", "buffer", ".", "Input", ".", "read", "(", "num_events", ")", ":", "return", "midi_event_list" ]
def read(self, num_events): """reads num_events midi events from the buffer. Input.read(num_events): return midi_event_list Reads from the Input buffer and gives back midi events. [[[status,data1,data2,data3],timestamp], [[status,data1,data2,data3],timestamp],...] """ ...
[ "def", "read", "(", "self", ",", "num_events", ")", ":", "_check_init", "(", ")", "self", ".", "_check_open", "(", ")", "return", "self", ".", "_input", ".", "Read", "(", "num_events", ")" ]
https://github.com/wistbean/fxxkpython/blob/88e16d79d8dd37236ba6ecd0d0ff11d63143968c/vip/qyxuan/projects/venv/lib/python3.6/site-packages/pygame/midi.py#L315-L325
vincentbernat/snimpy
edfb4978fe3d1cbca15e98ebc1e0f009c613c9de
snimpy/mib.py
python
path
(path=None)
Set or get a search path to libsmi. When no path is provided, return the current path, unmodified. Otherwise, set the path to the specified value. :param path: The string to be used to change the search path or `None`
Set or get a search path to libsmi.
[ "Set", "or", "get", "a", "search", "path", "to", "libsmi", "." ]
def path(path=None): """Set or get a search path to libsmi. When no path is provided, return the current path, unmodified. Otherwise, set the path to the specified value. :param path: The string to be used to change the search path or `None` """ if path is None: # Get...
[ "def", "path", "(", "path", "=", "None", ")", ":", "if", "path", "is", "None", ":", "# Get the path", "path", "=", "_smi", ".", "smiGetPath", "(", ")", "if", "path", "==", "ffi", ".", "NULL", ":", "raise", "SMIException", "(", "\"unable to get current li...
https://github.com/vincentbernat/snimpy/blob/edfb4978fe3d1cbca15e98ebc1e0f009c613c9de/snimpy/mib.py#L477-L500
sympy/sympy
d822fcba181155b85ff2b29fe525adbafb22b448
sympy/liealgebras/type_e.py
python
TypeE.basic_root
(self, i, j)
return root
This is a method just to generate roots with a -1 in the ith position and a 1 in the jth position.
This is a method just to generate roots with a -1 in the ith position and a 1 in the jth position.
[ "This", "is", "a", "method", "just", "to", "generate", "roots", "with", "a", "-", "1", "in", "the", "ith", "position", "and", "a", "1", "in", "the", "jth", "position", "." ]
def basic_root(self, i, j): """ This is a method just to generate roots with a -1 in the ith position and a 1 in the jth position. """ root = [0]*8 root[i] = -1 root[j] = 1 return root
[ "def", "basic_root", "(", "self", ",", "i", ",", "j", ")", ":", "root", "=", "[", "0", "]", "*", "8", "root", "[", "i", "]", "=", "-", "1", "root", "[", "j", "]", "=", "1", "return", "root" ]
https://github.com/sympy/sympy/blob/d822fcba181155b85ff2b29fe525adbafb22b448/sympy/liealgebras/type_e.py#L26-L37
plotly/plotly.py
cfad7862594b35965c0e000813bd7805e8494a5b
packages/python/plotly/plotly/graph_objs/layout/polar/_radialaxis.py
python
RadialAxis.ticksuffix
(self)
return self["ticksuffix"]
Sets a tick label suffix. The 'ticksuffix' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ------- str
Sets a tick label suffix. The 'ticksuffix' property is a string and must be specified as: - A string - A number that will be converted to a string
[ "Sets", "a", "tick", "label", "suffix", ".", "The", "ticksuffix", "property", "is", "a", "string", "and", "must", "be", "specified", "as", ":", "-", "A", "string", "-", "A", "number", "that", "will", "be", "converted", "to", "a", "string" ]
def ticksuffix(self): """ Sets a tick label suffix. The 'ticksuffix' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ------- str """ return self["ticksuffix"]
[ "def", "ticksuffix", "(", "self", ")", ":", "return", "self", "[", "\"ticksuffix\"", "]" ]
https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/layout/polar/_radialaxis.py#L1222-L1234
NVIDIA/NeMo
5b0c0b4dec12d87d3cd960846de4105309ce938e
nemo/collections/asr/parts/submodules/conformer_modules.py
python
ConformerLayer.forward
(self, x, att_mask=None, pos_emb=None, pad_mask=None)
return x
Args: x (torch.Tensor): input signals (B, T, d_model) att_mask (torch.Tensor): attention masks(B, T, T) pos_emb (torch.Tensor): (L, 1, d_model) pad_mask (torch.tensor): padding mask Returns: x (torch.Tensor): (B, T, d_model)
Args: x (torch.Tensor): input signals (B, T, d_model) att_mask (torch.Tensor): attention masks(B, T, T) pos_emb (torch.Tensor): (L, 1, d_model) pad_mask (torch.tensor): padding mask Returns: x (torch.Tensor): (B, T, d_model)
[ "Args", ":", "x", "(", "torch", ".", "Tensor", ")", ":", "input", "signals", "(", "B", "T", "d_model", ")", "att_mask", "(", "torch", ".", "Tensor", ")", ":", "attention", "masks", "(", "B", "T", "T", ")", "pos_emb", "(", "torch", ".", "Tensor", ...
def forward(self, x, att_mask=None, pos_emb=None, pad_mask=None): """ Args: x (torch.Tensor): input signals (B, T, d_model) att_mask (torch.Tensor): attention masks(B, T, T) pos_emb (torch.Tensor): (L, 1, d_model) pad_mask (torch.tensor): padding mask ...
[ "def", "forward", "(", "self", ",", "x", ",", "att_mask", "=", "None", ",", "pos_emb", "=", "None", ",", "pad_mask", "=", "None", ")", ":", "residual", "=", "x", "x", "=", "self", ".", "norm_feed_forward1", "(", "x", ")", "x", "=", "self", ".", "...
https://github.com/NVIDIA/NeMo/blob/5b0c0b4dec12d87d3cd960846de4105309ce938e/nemo/collections/asr/parts/submodules/conformer_modules.py#L87-L123
deepmind/dm_control
806a10e896e7c887635328bfa8352604ad0fedae
dm_control/suite/dog.py
python
Physics.joint_velocities
(self)
return self.data.qvel[qvel_index].copy()
Returns the velocity of all hinge joints (skipping free joints).
Returns the velocity of all hinge joints (skipping free joints).
[ "Returns", "the", "velocity", "of", "all", "hinge", "joints", "(", "skipping", "free", "joints", ")", "." ]
def joint_velocities(self): """Returns the velocity of all hinge joints (skipping free joints).""" hinge_joints = self.model.jnt_type == _HINGE_TYPE qvel_index = self.model.jnt_dofadr[hinge_joints] return self.data.qvel[qvel_index].copy()
[ "def", "joint_velocities", "(", "self", ")", ":", "hinge_joints", "=", "self", ".", "model", ".", "jnt_type", "==", "_HINGE_TYPE", "qvel_index", "=", "self", ".", "model", ".", "jnt_dofadr", "[", "hinge_joints", "]", "return", "self", ".", "data", ".", "qv...
https://github.com/deepmind/dm_control/blob/806a10e896e7c887635328bfa8352604ad0fedae/dm_control/suite/dog.py#L195-L199
qiucheng025/zao-
3a5edf3607b3a523f95746bc69b688090c76d89a
tools/sort.py
python
Sort.splice_lists
(sorted_list, new_vals_list)
return new_list
This method replaces the value at index 1 in each sub-list in the sorted_list with the value that is calculated for the same img_path, but found in new_vals_list. Format of lists: [[img_path, value], [img_path2, value2], ...] :param sorted_list: list that has been sorted by one of the ...
This method replaces the value at index 1 in each sub-list in the sorted_list with the value that is calculated for the same img_path, but found in new_vals_list.
[ "This", "method", "replaces", "the", "value", "at", "index", "1", "in", "each", "sub", "-", "list", "in", "the", "sorted_list", "with", "the", "value", "that", "is", "calculated", "for", "the", "same", "img_path", "but", "found", "in", "new_vals_list", "."...
def splice_lists(sorted_list, new_vals_list): """ This method replaces the value at index 1 in each sub-list in the sorted_list with the value that is calculated for the same img_path, but found in new_vals_list. Format of lists: [[img_path, value], [img_path2, value2], ...] ...
[ "def", "splice_lists", "(", "sorted_list", ",", "new_vals_list", ")", ":", "new_list", "=", "[", "]", "# Make new list of just image paths to serve as an index", "val_index_list", "=", "[", "i", "[", "0", "]", "for", "i", "in", "new_vals_list", "]", "for", "i", ...
https://github.com/qiucheng025/zao-/blob/3a5edf3607b3a523f95746bc69b688090c76d89a/tools/sort.py#L616-L641
huggingface/transformers
623b4f7c63f60cce917677ee704d6c93ee960b4b
src/transformers/models/roformer/modeling_flax_roformer.py
python
FlaxRoFormerOnlyMLMHead.__call__
(self, hidden_states, shared_embedding=None)
return hidden_states
[]
def __call__(self, hidden_states, shared_embedding=None): hidden_states = self.predictions(hidden_states, shared_embedding=shared_embedding) return hidden_states
[ "def", "__call__", "(", "self", ",", "hidden_states", ",", "shared_embedding", "=", "None", ")", ":", "hidden_states", "=", "self", ".", "predictions", "(", "hidden_states", ",", "shared_embedding", "=", "shared_embedding", ")", "return", "hidden_states" ]
https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/models/roformer/modeling_flax_roformer.py#L576-L578
rspivak/lsbasi
07e1a14516156a21ebe2d82e0bae4bba5ad73dd6
part4/calc4.py
python
Token.__str__
(self)
return 'Token({type}, {value})'.format( type=self.type, value=repr(self.value) )
String representation of the class instance. Examples: Token(INTEGER, 3) Token(MUL, '*')
String representation of the class instance.
[ "String", "representation", "of", "the", "class", "instance", "." ]
def __str__(self): """String representation of the class instance. Examples: Token(INTEGER, 3) Token(MUL, '*') """ return 'Token({type}, {value})'.format( type=self.type, value=repr(self.value) )
[ "def", "__str__", "(", "self", ")", ":", "return", "'Token({type}, {value})'", ".", "format", "(", "type", "=", "self", ".", "type", ",", "value", "=", "repr", "(", "self", ".", "value", ")", ")" ]
https://github.com/rspivak/lsbasi/blob/07e1a14516156a21ebe2d82e0bae4bba5ad73dd6/part4/calc4.py#L15-L25
Lotayou/everybody_dance_now_pytorch
41144e9b5a47d70d0fe9101ca6c748ecded27fd1
util/util.py
python
uint82bin
(n, count=8)
return ''.join([str((n >> y) & 1) for y in range(count-1, -1, -1)])
returns the binary of integer n, count refers to amount of bits
returns the binary of integer n, count refers to amount of bits
[ "returns", "the", "binary", "of", "integer", "n", "count", "refers", "to", "amount", "of", "bits" ]
def uint82bin(n, count=8): """returns the binary of integer n, count refers to amount of bits""" return ''.join([str((n >> y) & 1) for y in range(count-1, -1, -1)])
[ "def", "uint82bin", "(", "n", ",", "count", "=", "8", ")", ":", "return", "''", ".", "join", "(", "[", "str", "(", "(", "n", ">>", "y", ")", "&", "1", ")", "for", "y", "in", "range", "(", "count", "-", "1", ",", "-", "1", ",", "-", "1", ...
https://github.com/Lotayou/everybody_dance_now_pytorch/blob/41144e9b5a47d70d0fe9101ca6c748ecded27fd1/util/util.py#L57-L59
RasaHQ/rasa
54823b68c1297849ba7ae841a4246193cd1223a1
rasa/core/processor.py
python
MessageProcessor.get_tracker
(self, conversation_id: Text)
return tracker
Get the tracker for a conversation. In contrast to `fetch_tracker_and_update_session` this does not add any `action_session_start` or `session_start` events at the beginning of a conversation. Args: conversation_id: The ID of the conversation for which the history should be...
Get the tracker for a conversation.
[ "Get", "the", "tracker", "for", "a", "conversation", "." ]
def get_tracker(self, conversation_id: Text) -> DialogueStateTracker: """Get the tracker for a conversation. In contrast to `fetch_tracker_and_update_session` this does not add any `action_session_start` or `session_start` events at the beginning of a conversation. Args: ...
[ "def", "get_tracker", "(", "self", ",", "conversation_id", ":", "Text", ")", "->", "DialogueStateTracker", ":", "conversation_id", "=", "conversation_id", "or", "DEFAULT_SENDER_ID", "tracker", "=", "self", ".", "tracker_store", ".", "get_or_create_tracker", "(", "co...
https://github.com/RasaHQ/rasa/blob/54823b68c1297849ba7ae841a4246193cd1223a1/rasa/core/processor.py#L326-L347
Esri/ArcREST
ab240fde2b0200f61d4a5f6df033516e53f2f416
src/arcrest/manageorg/_parameters.py
python
PublishCSVParameters.description
(self, value)
gets/sets the description
gets/sets the description
[ "gets", "/", "sets", "the", "description" ]
def description(self, value): """ gets/sets the description """ if self._description != value: self._description = value
[ "def", "description", "(", "self", ",", "value", ")", ":", "if", "self", ".", "_description", "!=", "value", ":", "self", ".", "_description", "=", "value" ]
https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/manageorg/_parameters.py#L1878-L1881
openelections/openelections-core
3c516d8c4cf1166b1868b738a248d48f3378c525
openelex/us/vt/transform/transforms.py
python
CreateResultsTransform.get_candidate
(self, raw_resultDict, extra={})
Get the Candidate model for a RawResult Keyword arguments: * extra - Dictionary of extra query parameters that will be used to select the candidate.
Get the Candidate model for a RawResult
[ "Get", "the", "Candidate", "model", "for", "a", "RawResult" ]
def get_candidate(self, raw_resultDict, extra={}): """ Get the Candidate model for a RawResult Keyword arguments: * extra - Dictionary of extra query parameters that will be used to select the candidate. """ key = self._candidate_key(raw_resultDict) ...
[ "def", "get_candidate", "(", "self", ",", "raw_resultDict", ",", "extra", "=", "{", "}", ")", ":", "key", "=", "self", ".", "_candidate_key", "(", "raw_resultDict", ")", "try", ":", "return", "self", ".", "_candidate_cache", "[", "key", "]", "except", "K...
https://github.com/openelections/openelections-core/blob/3c516d8c4cf1166b1868b738a248d48f3378c525/openelex/us/vt/transform/transforms.py#L449-L472
pycollada/pycollada
5b2d53333f03047b0fdfc25e394f8b77b57b62fc
collada/material.py
python
Material.__init__
(self, id, name, effect, xmlnode=None)
Creates a material. :param str id: A unique string identifier for the material :param str name: A name for the material :param collada.material.Effect effect: The effect instantiated in this material :param xmlnode: If loaded from xml, the xml nod...
Creates a material.
[ "Creates", "a", "material", "." ]
def __init__(self, id, name, effect, xmlnode=None): """Creates a material. :param str id: A unique string identifier for the material :param str name: A name for the material :param collada.material.Effect effect: The effect instantiated in this material ...
[ "def", "__init__", "(", "self", ",", "id", ",", "name", ",", "effect", ",", "xmlnode", "=", "None", ")", ":", "self", ".", "id", "=", "id", "\"\"\"The unique string identifier for the material\"\"\"", "self", ".", "name", "=", "name", "\"\"\"The name for the mat...
https://github.com/pycollada/pycollada/blob/5b2d53333f03047b0fdfc25e394f8b77b57b62fc/collada/material.py#L831-L858
pydata/xarray
9226c7ac87b3eb246f7a7e49f8f0f23d68951624
xarray/core/dataarray.py
python
DataArray.swap_dims
( self, dims_dict: Mapping[Any, Hashable] = None, **dims_kwargs )
return self._from_temp_dataset(ds)
Returns a new DataArray with swapped dimensions. Parameters ---------- dims_dict : dict-like Dictionary whose keys are current dimension names and whose values are new names. **dims_kwargs : {existing_dim: new_dim, ...}, optional The keyword arguments...
Returns a new DataArray with swapped dimensions.
[ "Returns", "a", "new", "DataArray", "with", "swapped", "dimensions", "." ]
def swap_dims( self, dims_dict: Mapping[Any, Hashable] = None, **dims_kwargs ) -> "DataArray": """Returns a new DataArray with swapped dimensions. Parameters ---------- dims_dict : dict-like Dictionary whose keys are current dimension names and whose values ...
[ "def", "swap_dims", "(", "self", ",", "dims_dict", ":", "Mapping", "[", "Any", ",", "Hashable", "]", "=", "None", ",", "*", "*", "dims_kwargs", ")", "->", "\"DataArray\"", ":", "dims_dict", "=", "either_dict_or_kwargs", "(", "dims_dict", ",", "dims_kwargs", ...
https://github.com/pydata/xarray/blob/9226c7ac87b3eb246f7a7e49f8f0f23d68951624/xarray/core/dataarray.py#L1853-L1908
scikit-learn-contrib/lightning
3afcb4a9967a0d9e3961acd967705e42a593e448
lightning/impl/datasets/samples_generator.py
python
make_classification
(n_samples=100, n_features=20, n_informative=2, n_redundant=2, n_repeated=0, n_classes=2, n_clusters_per_class=2, weights=None, flip_y=0.01, class_sep=1.0, hypercube=True, shift=0.0, scale=1.0, shuffle=True, random_state=Non...
return X, y
Generate a random n-class classification problem. Parameters ---------- n_samples : int, optional (default=100) The number of samples. n_features : int, optional (default=20) The total number of features. These comprise `n_informative` informative features, `n_redundant` redund...
Generate a random n-class classification problem.
[ "Generate", "a", "random", "n", "-", "class", "classification", "problem", "." ]
def make_classification(n_samples=100, n_features=20, n_informative=2, n_redundant=2, n_repeated=0, n_classes=2, n_clusters_per_class=2, weights=None, flip_y=0.01, class_sep=1.0, hypercube=True, shift=0.0, scale=1.0, shuffle...
[ "def", "make_classification", "(", "n_samples", "=", "100", ",", "n_features", "=", "20", ",", "n_informative", "=", "2", ",", "n_redundant", "=", "2", ",", "n_repeated", "=", "0", ",", "n_classes", "=", "2", ",", "n_clusters_per_class", "=", "2", ",", "...
https://github.com/scikit-learn-contrib/lightning/blob/3afcb4a9967a0d9e3961acd967705e42a593e448/lightning/impl/datasets/samples_generator.py#L108-L315
LabPy/lantz
3e878e3f765a4295b0089d04e241d4beb7b8a65b
lantz/action.py
python
_dget
(adict, instance=MISSING)
Helper function to get an element by key from a dictionary defaulting to key=MISSING
Helper function to get an element by key from a dictionary defaulting to key=MISSING
[ "Helper", "function", "to", "get", "an", "element", "by", "key", "from", "a", "dictionary", "defaulting", "to", "key", "=", "MISSING" ]
def _dget(adict, instance=MISSING): """Helper function to get an element by key from a dictionary defaulting to key=MISSING """ try: return adict[instance] except KeyError: return adict[MISSING]
[ "def", "_dget", "(", "adict", ",", "instance", "=", "MISSING", ")", ":", "try", ":", "return", "adict", "[", "instance", "]", "except", "KeyError", ":", "return", "adict", "[", "MISSING", "]" ]
https://github.com/LabPy/lantz/blob/3e878e3f765a4295b0089d04e241d4beb7b8a65b/lantz/action.py#L26-L34
linnanwang/AlphaX-NASBench101
87eb0d403def6dee43be7eb73520de074a2f9f03
alphax-1-net/model.py
python
AuxiliaryHeadCIFAR.__init__
(self, C, num_classes)
assuming input size 8x8
assuming input size 8x8
[ "assuming", "input", "size", "8x8" ]
def __init__(self, C, num_classes): """assuming input size 8x8""" super(AuxiliaryHeadCIFAR, self).__init__() self.features = nn.Sequential( nn.ReLU(inplace=True), nn.AvgPool2d(5, stride=3, padding=0, count_include_pad=False), # image size = 2 x 2 nn.Conv2d(C...
[ "def", "__init__", "(", "self", ",", "C", ",", "num_classes", ")", ":", "super", "(", "AuxiliaryHeadCIFAR", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "features", "=", "nn", ".", "Sequential", "(", "nn", ".", "ReLU", "(", "inplace", "=...
https://github.com/linnanwang/AlphaX-NASBench101/blob/87eb0d403def6dee43be7eb73520de074a2f9f03/alphax-1-net/model.py#L84-L98
pymedusa/Medusa
1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
medusa/providers/generic_provider.py
python
GenericProvider.create_magnet
(self, filename, result)
return False
Create a .magnet file containing the Magnet URI. :param filename: base filename (without extension). :param result: SearchResult object. :returns: True if the magnet file is created and verified.
Create a .magnet file containing the Magnet URI.
[ "Create", "a", ".", "magnet", "file", "containing", "the", "Magnet", "URI", "." ]
def create_magnet(self, filename, result): """ Create a .magnet file containing the Magnet URI. :param filename: base filename (without extension). :param result: SearchResult object. :returns: True if the magnet file is created and verified. """ filename_ext = '...
[ "def", "create_magnet", "(", "self", ",", "filename", ",", "result", ")", ":", "filename_ext", "=", "'{filename}.magnet'", ".", "format", "(", "filename", "=", "filename", ")", "log", ".", "info", "(", "'Saving magnet file {result} to {location}'", ",", "{", "'r...
https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/medusa/providers/generic_provider.py#L119-L139
PyHDI/veriloggen
2382d200deabf59cfcfd741f5eba371010aaf2bb
veriloggen/thread/fifo.py
python
FIFO.empty
(self)
return self.rif.empty
[]
def empty(self): return self.rif.empty
[ "def", "empty", "(", "self", ")", ":", "return", "self", ".", "rif", ".", "empty" ]
https://github.com/PyHDI/veriloggen/blob/2382d200deabf59cfcfd741f5eba371010aaf2bb/veriloggen/thread/fifo.py#L123-L124
MaybeShewill-CV/lanenet-lane-detection
94be8d9a66c7bbda5ad99b10492bc406c8aee45f
semantic_segmentation_zoo/vgg16_based_fcn.py
python
VGG16FCN._vgg16_fcn_encode
(self, input_tensor, name)
return
:param input_tensor: :param name: :return:
[]
def _vgg16_fcn_encode(self, input_tensor, name): """ :param input_tensor: :param name: :return: """ with tf.variable_scope(name_or_scope=name): # encode stage 1 conv_1_1 = self._vgg16_conv_stage( input_tensor=input_tensor, k_size=3...
[ "def", "_vgg16_fcn_encode", "(", "self", ",", "input_tensor", ",", "name", ")", ":", "with", "tf", ".", "variable_scope", "(", "name_or_scope", "=", "name", ")", ":", "# encode stage 1", "conv_1_1", "=", "self", ".", "_vgg16_conv_stage", "(", "input_tensor", "...
https://github.com/MaybeShewill-CV/lanenet-lane-detection/blob/94be8d9a66c7bbda5ad99b10492bc406c8aee45f/semantic_segmentation_zoo/vgg16_based_fcn.py#L125-L265
inspurer/WorkAttendanceSystem
1221e2d67bdf5bb15fe99517cc3ded58ccb066df
V2.0/venv/Lib/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/distro.py
python
version
(pretty=False, best=False)
return _distro.version(pretty, best)
Return the version of the current Linux distribution, as a human-readable string. If *pretty* is false, the version is returned without codename (e.g. "7.0"). If *pretty* is true, the codename in parenthesis is appended, if the codename is non-empty (e.g. "7.0 (Maipo)"). Some distributions pr...
Return the version of the current Linux distribution, as a human-readable string.
[ "Return", "the", "version", "of", "the", "current", "Linux", "distribution", "as", "a", "human", "-", "readable", "string", "." ]
def version(pretty=False, best=False): """ Return the version of the current Linux distribution, as a human-readable string. If *pretty* is false, the version is returned without codename (e.g. "7.0"). If *pretty* is true, the codename in parenthesis is appended, if the codename is non-emp...
[ "def", "version", "(", "pretty", "=", "False", ",", "best", "=", "False", ")", ":", "return", "_distro", ".", "version", "(", "pretty", ",", "best", ")" ]
https://github.com/inspurer/WorkAttendanceSystem/blob/1221e2d67bdf5bb15fe99517cc3ded58ccb066df/V2.0/venv/Lib/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/distro.py#L238-L279
Chaffelson/nipyapi
d3b186fd701ce308c2812746d98af9120955e810
nipyapi/nifi/models/access_policy_summary_dto.py
python
AccessPolicySummaryDTO.versioned_component_id
(self, versioned_component_id)
Sets the versioned_component_id of this AccessPolicySummaryDTO. The ID of the corresponding component that is under version control :param versioned_component_id: The versioned_component_id of this AccessPolicySummaryDTO. :type: str
Sets the versioned_component_id of this AccessPolicySummaryDTO. The ID of the corresponding component that is under version control
[ "Sets", "the", "versioned_component_id", "of", "this", "AccessPolicySummaryDTO", ".", "The", "ID", "of", "the", "corresponding", "component", "that", "is", "under", "version", "control" ]
def versioned_component_id(self, versioned_component_id): """ Sets the versioned_component_id of this AccessPolicySummaryDTO. The ID of the corresponding component that is under version control :param versioned_component_id: The versioned_component_id of this AccessPolicySummaryDTO. ...
[ "def", "versioned_component_id", "(", "self", ",", "versioned_component_id", ")", ":", "self", ".", "_versioned_component_id", "=", "versioned_component_id" ]
https://github.com/Chaffelson/nipyapi/blob/d3b186fd701ce308c2812746d98af9120955e810/nipyapi/nifi/models/access_policy_summary_dto.py#L121-L130
reddit-archive/reddit
753b17407e9a9dca09558526805922de24133d53
r2/r2/models/query_cache.py
python
CachedQueryMutator.send
(self)
Commit the mutations batched up so far and potentially do pruning. This is automatically called by __exit__ when used as a context manager.
Commit the mutations batched up so far and potentially do pruning.
[ "Commit", "the", "mutations", "batched", "up", "so", "far", "and", "potentially", "do", "pruning", "." ]
def send(self): """Commit the mutations batched up so far and potentially do pruning. This is automatically called by __exit__ when used as a context manager. """ self.mutator.send() if self.to_prune: LOG.debug("Pruning queries %r", self.to_prune) ...
[ "def", "send", "(", "self", ")", ":", "self", ".", "mutator", ".", "send", "(", ")", "if", "self", ".", "to_prune", ":", "LOG", ".", "debug", "(", "\"Pruning queries %r\"", ",", "self", ".", "to_prune", ")", "CachedQuery", ".", "_prune_multi", "(", "se...
https://github.com/reddit-archive/reddit/blob/753b17407e9a9dca09558526805922de24133d53/r2/r2/models/query_cache.py#L378-L389
lightkurve/lightkurve
70d1c4cd1ab30f24c83e54bdcea4dd16624bfd9c
src/lightkurve/targetpixelfile.py
python
TargetPixelFileFactory._make_aperture_extension
(self)
return hdu
Create the aperture mask extension (i.e. extension #2).
Create the aperture mask extension (i.e. extension #2).
[ "Create", "the", "aperture", "mask", "extension", "(", "i", ".", "e", ".", "extension", "#2", ")", "." ]
def _make_aperture_extension(self): """Create the aperture mask extension (i.e. extension #2).""" mask = 3 * np.ones((self.n_rows, self.n_cols), dtype="int32") hdu = fits.ImageHDU(mask) # Set the header from the template TPF again template = self._header_template(2) for ...
[ "def", "_make_aperture_extension", "(", "self", ")", ":", "mask", "=", "3", "*", "np", ".", "ones", "(", "(", "self", ".", "n_rows", ",", "self", ".", "n_cols", ")", ",", "dtype", "=", "\"int32\"", ")", "hdu", "=", "fits", ".", "ImageHDU", "(", "ma...
https://github.com/lightkurve/lightkurve/blob/70d1c4cd1ab30f24c83e54bdcea4dd16624bfd9c/src/lightkurve/targetpixelfile.py#L2658-L2691
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/benchmarks/src/benchmarks/whoosh/src/whoosh/writing.py
python
SegmentWriter._merge_segments
(self, mergetype, optimize, merge)
return mergetype(self, self.segments)
[]
def _merge_segments(self, mergetype, optimize, merge): # The writer supports two ways of setting mergetype/optimize/merge: # as attributes or as keyword arguments to commit(). Originally there # were just the keyword arguments, but then I added the ability to use # the writer as a contex...
[ "def", "_merge_segments", "(", "self", ",", "mergetype", ",", "optimize", ",", "merge", ")", ":", "# The writer supports two ways of setting mergetype/optimize/merge:", "# as attributes or as keyword arguments to commit(). Originally there", "# were just the keyword arguments, but then I...
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/whoosh/src/whoosh/writing.py#L809-L830
vertexproject/synapse
8173f43cb5fba5ca2648d12a659afb432139b0a7
synapse/lib/agenda.py
python
Agenda._addappt
(self, iden, appt)
Updates the data structures to add an appointment
Updates the data structures to add an appointment
[ "Updates", "the", "data", "structures", "to", "add", "an", "appointment" ]
def _addappt(self, iden, appt): ''' Updates the data structures to add an appointment ''' if appt.nexttime: heapq.heappush(self.apptheap, appt) self.appts[iden] = appt if self.apptheap and self.apptheap[0] is appt: self._wake_event.set()
[ "def", "_addappt", "(", "self", ",", "iden", ",", "appt", ")", ":", "if", "appt", ".", "nexttime", ":", "heapq", ".", "heappush", "(", "self", ".", "apptheap", ",", "appt", ")", "self", ".", "appts", "[", "iden", "]", "=", "appt", "if", "self", "...
https://github.com/vertexproject/synapse/blob/8173f43cb5fba5ca2648d12a659afb432139b0a7/synapse/lib/agenda.py#L553-L561
lovelylain/pyctp
fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d
example/ctp/futures/ApiStruct.py
python
ExchangeExecOrder.__init__
(self, Volume=0, RequestID=0, BusinessUnit='', OffsetFlag=OF_Open, HedgeFlag=HF_Speculation, ActionType=ACTP_Exec, PosiDirection=PD_Net, ReservePositionFlag=EOPF_Reserve, CloseFlag=EOCF_AutoClose, ExecOrderLocalID='', ExchangeID='', ParticipantID='', ClientID='', ExchangeInstID='', TraderID='', InstallID=0, OrderSubmit...
[]
def __init__(self, Volume=0, RequestID=0, BusinessUnit='', OffsetFlag=OF_Open, HedgeFlag=HF_Speculation, ActionType=ACTP_Exec, PosiDirection=PD_Net, ReservePositionFlag=EOPF_Reserve, CloseFlag=EOCF_AutoClose, ExecOrderLocalID='', ExchangeID='', ParticipantID='', ClientID='', ExchangeInstID='', TraderID='', InstallID=0,...
[ "def", "__init__", "(", "self", ",", "Volume", "=", "0", ",", "RequestID", "=", "0", ",", "BusinessUnit", "=", "''", ",", "OffsetFlag", "=", "OF_Open", ",", "HedgeFlag", "=", "HF_Speculation", ",", "ActionType", "=", "ACTP_Exec", ",", "PosiDirection", "=",...
https://github.com/lovelylain/pyctp/blob/fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d/example/ctp/futures/ApiStruct.py#L3400-L3427
bendmorris/static-python
2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473
Lib/http/cookies.py
python
BaseCookie.value_decode
(self, val)
return val, val
real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation. The VALUE is the value read from HTTP header. Override this function to modify the behavior of cookies.
real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation. The VALUE is the value read from HTTP header. Override this function to modify the behavior of cookies.
[ "real_value", "coded_value", "=", "value_decode", "(", "STRING", ")", "Called", "prior", "to", "setting", "a", "cookie", "s", "value", "from", "the", "network", "representation", ".", "The", "VALUE", "is", "the", "value", "read", "from", "HTTP", "header", "....
def value_decode(self, val): """real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation. The VALUE is the value read from HTTP header. Override this function to modify the behavior of cookies. """ re...
[ "def", "value_decode", "(", "self", ",", "val", ")", ":", "return", "val", ",", "val" ]
https://github.com/bendmorris/static-python/blob/2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473/Lib/http/cookies.py#L461-L468
AmesCornish/buttersink
5cc37e30d9f8071fcf3497dca8b8a91b910321ea
buttersink/send.py
python
TLV_PUT_BYTES
(attrs, attrNum, value)
Put a tag-length-value encoded attribute as bytes.
Put a tag-length-value encoded attribute as bytes.
[ "Put", "a", "tag", "-", "length", "-", "value", "encoded", "attribute", "as", "bytes", "." ]
def TLV_PUT_BYTES(attrs, attrNum, value): """ Put a tag-length-value encoded attribute as bytes. """ TLV_PUT(attrs, attrNum, 's', value)
[ "def", "TLV_PUT_BYTES", "(", "attrs", ",", "attrNum", ",", "value", ")", ":", "TLV_PUT", "(", "attrs", ",", "attrNum", ",", "'s'", ",", "value", ")" ]
https://github.com/AmesCornish/buttersink/blob/5cc37e30d9f8071fcf3497dca8b8a91b910321ea/buttersink/send.py#L153-L155
Anaconda-Platform/anaconda-project
df5ec33c12591e6512436d38d36c6132fa2e9618
anaconda_project/requirements_registry/registry.py
python
RequirementsRegistry.find_requirement_by_env_var
(self, env_var, options)
return EnvVarRequirement(registry=self, env_var=env_var, options=options)
Create a requirement instance given an environment variable name. Args: env_var (str): environment variable name options (dict): options from the project file for this requirement Returns: instance of Requirement
Create a requirement instance given an environment variable name.
[ "Create", "a", "requirement", "instance", "given", "an", "environment", "variable", "name", "." ]
def find_requirement_by_env_var(self, env_var, options): """Create a requirement instance given an environment variable name. Args: env_var (str): environment variable name options (dict): options from the project file for this requirement Returns: instance ...
[ "def", "find_requirement_by_env_var", "(", "self", ",", "env_var", ",", "options", ")", ":", "from", ".", "requirement", "import", "EnvVarRequirement", "return", "EnvVarRequirement", "(", "registry", "=", "self", ",", "env_var", "=", "env_var", ",", "options", "...
https://github.com/Anaconda-Platform/anaconda-project/blob/df5ec33c12591e6512436d38d36c6132fa2e9618/anaconda_project/requirements_registry/registry.py#L18-L29
JaniceWuo/MovieRecommend
4c86db64ca45598917d304f535413df3bc9fea65
movierecommend/venv1/Lib/site-packages/django/forms/fields.py
python
DecimalField.validate
(self, value)
[]
def validate(self, value): super(DecimalField, self).validate(value) if value in self.empty_values: return # Check for NaN, Inf and -Inf values. We can't compare directly for NaN, # since it is never equal to itself. However, NaN is the only value that # isn't equal t...
[ "def", "validate", "(", "self", ",", "value", ")", ":", "super", "(", "DecimalField", ",", "self", ")", ".", "validate", "(", "value", ")", "if", "value", "in", "self", ".", "empty_values", ":", "return", "# Check for NaN, Inf and -Inf values. We can't compare d...
https://github.com/JaniceWuo/MovieRecommend/blob/4c86db64ca45598917d304f535413df3bc9fea65/movierecommend/venv1/Lib/site-packages/django/forms/fields.py#L366-L374
replit-archive/empythoned
977ec10ced29a3541a4973dc2b59910805695752
cpython/Lib/lib-tk/ttk.py
python
Treeview.delete
(self, *items)
Delete all specified items and all their descendants. The root item may not be deleted.
Delete all specified items and all their descendants. The root item may not be deleted.
[ "Delete", "all", "specified", "items", "and", "all", "their", "descendants", ".", "The", "root", "item", "may", "not", "be", "deleted", "." ]
def delete(self, *items): """Delete all specified items and all their descendants. The root item may not be deleted.""" self.tk.call(self._w, "delete", items)
[ "def", "delete", "(", "self", ",", "*", "items", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "\"delete\"", ",", "items", ")" ]
https://github.com/replit-archive/empythoned/blob/977ec10ced29a3541a4973dc2b59910805695752/cpython/Lib/lib-tk/ttk.py#L1240-L1243
mitre-attack/attack-scripts
b94e05c0a29a6fdfc9701c721fcf03cdf9f7945b
scripts/techniques_data_sources_vis.py
python
write_DPT
(output_directory)
writes a CSV that links techniques, defenses, permissions, and tactics. specifically, the output will link: a specific technique, to a defense the technique bypassess, to the permissions needed to run the technique, repeated for each defense and tactic that is linked to the tech...
writes a CSV that links techniques, defenses, permissions, and tactics. specifically, the output will link: a specific technique, to a defense the technique bypassess, to the permissions needed to run the technique, repeated for each defense and tactic that is linked to the tech...
[ "writes", "a", "CSV", "that", "links", "techniques", "defenses", "permissions", "and", "tactics", ".", "specifically", "the", "output", "will", "link", ":", "a", "specific", "technique", "to", "a", "defense", "the", "technique", "bypassess", "to", "the", "perm...
def write_DPT(output_directory): """writes a CSV that links techniques, defenses, permissions, and tactics. specifically, the output will link: a specific technique, to a defense the technique bypassess, to the permissions needed to run the technique, repeated for each defen...
[ "def", "write_DPT", "(", "output_directory", ")", ":", "output_file", "=", "os", ".", "path", ".", "join", "(", "output_directory", ",", "\"dpt.csv\"", ")", "# Make sure the directory exists", "if", "not", "os", ".", "path", ".", "exists", "(", "output_directory...
https://github.com/mitre-attack/attack-scripts/blob/b94e05c0a29a6fdfc9701c721fcf03cdf9f7945b/scripts/techniques_data_sources_vis.py#L242-L267
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/limits/storage.py
python
RedisSentinelStorage.get
(self, key)
return super(RedisStorage, self).get(key, self.storage_slave)
:param str key: the key to get the counter value for
:param str key: the key to get the counter value for
[ ":", "param", "str", "key", ":", "the", "key", "to", "get", "the", "counter", "value", "for" ]
def get(self, key): """ :param str key: the key to get the counter value for """ return super(RedisStorage, self).get(key, self.storage_slave)
[ "def", "get", "(", "self", ",", "key", ")", ":", "return", "super", "(", "RedisStorage", ",", "self", ")", ".", "get", "(", "key", ",", "self", ".", "storage_slave", ")" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/limits/storage.py#L517-L521
jodal/pyspotify
770aee08de274951b63e60bdd8835188b58e7862
spotify/track.py
python
Track.album
(self)
return spotify.Album(self._session, sp_album=sp_album, add_ref=True)
The album of the track. Will always return :class:`None` if the track isn't loaded.
The album of the track.
[ "The", "album", "of", "the", "track", "." ]
def album(self): """The album of the track. Will always return :class:`None` if the track isn't loaded. """ spotify.Error.maybe_raise(self.error, ignores=[spotify.ErrorType.IS_LOADING]) if not self.is_loaded: return None sp_album = lib.sp_track_album(self._sp...
[ "def", "album", "(", "self", ")", ":", "spotify", ".", "Error", ".", "maybe_raise", "(", "self", ".", "error", ",", "ignores", "=", "[", "spotify", ".", "ErrorType", ".", "IS_LOADING", "]", ")", "if", "not", "self", ".", "is_loaded", ":", "return", "...
https://github.com/jodal/pyspotify/blob/770aee08de274951b63e60bdd8835188b58e7862/spotify/track.py#L227-L236
jerryli27/TwinGAN
4e5593445778dfb77af9f815b3f4fcafc35758dc
nets/nasnet/nasnet.py
python
nasnet_cifar_arg_scope
(weight_decay=5e-4, batch_norm_decay=0.9, batch_norm_epsilon=1e-5)
Defines the default arg scope for the NASNet-A Cifar model. Args: weight_decay: The weight decay to use for regularizing the model. batch_norm_decay: Decay for batch norm moving average. batch_norm_epsilon: Small float added to variance to avoid dividing by zero in batch norm. Returns: An `a...
Defines the default arg scope for the NASNet-A Cifar model.
[ "Defines", "the", "default", "arg", "scope", "for", "the", "NASNet", "-", "A", "Cifar", "model", "." ]
def nasnet_cifar_arg_scope(weight_decay=5e-4, batch_norm_decay=0.9, batch_norm_epsilon=1e-5): """Defines the default arg scope for the NASNet-A Cifar model. Args: weight_decay: The weight decay to use for regularizing the model. batch_norm_decay: Decay ...
[ "def", "nasnet_cifar_arg_scope", "(", "weight_decay", "=", "5e-4", ",", "batch_norm_decay", "=", "0.9", ",", "batch_norm_epsilon", "=", "1e-5", ")", ":", "batch_norm_params", "=", "{", "# Decay for the moving averages.", "'decay'", ":", "batch_norm_decay", ",", "# eps...
https://github.com/jerryli27/TwinGAN/blob/4e5593445778dfb77af9f815b3f4fcafc35758dc/nets/nasnet/nasnet.py#L111-L144
thatmattlove/hyperglass
c52a6f609843177671d38bcad59b8bd658f46b64
hyperglass/models/config/devices.py
python
Device.__hash__
(self)
return hash((self.name,))
Make device object hashable so the object can be deduplicated with set().
Make device object hashable so the object can be deduplicated with set().
[ "Make", "device", "object", "hashable", "so", "the", "object", "can", "be", "deduplicated", "with", "set", "()", "." ]
def __hash__(self) -> int: """Make device object hashable so the object can be deduplicated with set().""" return hash((self.name,))
[ "def", "__hash__", "(", "self", ")", "->", "int", ":", "return", "hash", "(", "(", "self", ".", "name", ",", ")", ")" ]
https://github.com/thatmattlove/hyperglass/blob/c52a6f609843177671d38bcad59b8bd658f46b64/hyperglass/models/config/devices.py#L105-L107
HymanLiuTS/flaskTs
286648286976e85d9b9a5873632331efcafe0b21
flasky/lib/python2.7/site-packages/werkzeug/datastructures.py
python
ETags.to_header
(self)
return ', '.join( ['"%s"' % x for x in self._strong] + ['W/"%s"' % x for x in self._weak] )
Convert the etags set into a HTTP header string.
Convert the etags set into a HTTP header string.
[ "Convert", "the", "etags", "set", "into", "a", "HTTP", "header", "string", "." ]
def to_header(self): """Convert the etags set into a HTTP header string.""" if self.star_tag: return '*' return ', '.join( ['"%s"' % x for x in self._strong] + ['W/"%s"' % x for x in self._weak] )
[ "def", "to_header", "(", "self", ")", ":", "if", "self", ".", "star_tag", ":", "return", "'*'", "return", "', '", ".", "join", "(", "[", "'\"%s\"'", "%", "x", "for", "x", "in", "self", ".", "_strong", "]", "+", "[", "'W/\"%s\"'", "%", "x", "for", ...
https://github.com/HymanLiuTS/flaskTs/blob/286648286976e85d9b9a5873632331efcafe0b21/flasky/lib/python2.7/site-packages/werkzeug/datastructures.py#L2161-L2168
BMW-InnovationLab/BMW-TensorFlow-Training-GUI
4f10d1f00f9ac312ca833e5b28fd0f8952cfee17
training_api/research/object_detection/inputs.py
python
create_eval_input_fn
(eval_config, eval_input_config, model_config)
return _eval_input_fn
Creates an eval `input` function for `Estimator`. # TODO(ronnyvotel,rathodv): Allow batch sizes of more than 1 for eval. Args: eval_config: An eval_pb2.EvalConfig. eval_input_config: An input_reader_pb2.InputReader. model_config: A model_pb2.DetectionModel. Returns: `input_fn` for `Estimator` i...
Creates an eval `input` function for `Estimator`.
[ "Creates", "an", "eval", "input", "function", "for", "Estimator", "." ]
def create_eval_input_fn(eval_config, eval_input_config, model_config): """Creates an eval `input` function for `Estimator`. # TODO(ronnyvotel,rathodv): Allow batch sizes of more than 1 for eval. Args: eval_config: An eval_pb2.EvalConfig. eval_input_config: An input_reader_pb2.InputReader. model_con...
[ "def", "create_eval_input_fn", "(", "eval_config", ",", "eval_input_config", ",", "model_config", ")", ":", "def", "_eval_input_fn", "(", "params", "=", "None", ")", ":", "\"\"\"Returns `features` and `labels` tensor dictionaries for evaluation.\n\n Args:\n params: Parame...
https://github.com/BMW-InnovationLab/BMW-TensorFlow-Training-GUI/blob/4f10d1f00f9ac312ca833e5b28fd0f8952cfee17/training_api/research/object_detection/inputs.py#L414-L504
oracle/graalpython
577e02da9755d916056184ec441c26e00b70145c
graalpython/lib-python/3/stringprep.py
python
in_table_c21_c22
(code)
return unicodedata.category(code) == "Cc" or \ ord(code) in c22_specials
[]
def in_table_c21_c22(code): return unicodedata.category(code) == "Cc" or \ ord(code) in c22_specials
[ "def", "in_table_c21_c22", "(", "code", ")", ":", "return", "unicodedata", ".", "category", "(", "code", ")", "==", "\"Cc\"", "or", "ord", "(", "code", ")", "in", "c22_specials" ]
https://github.com/oracle/graalpython/blob/577e02da9755d916056184ec441c26e00b70145c/graalpython/lib-python/3/stringprep.py#L227-L229
fablabnbg/inkscape-silhouette
e0ad65115b4b2b0a5b60dfecd9a3ca03ec1d6bec
silhouette/pyusb-1.0.2/usb/_objfinalizer.py
python
_AutoFinalizedObjectBase.finalize
(self)
Finalizes the object if not already done. Returns: None
Finalizes the object if not already done.
[ "Finalizes", "the", "object", "if", "not", "already", "done", "." ]
def finalize(self): """Finalizes the object if not already done. Returns: None """ # this is the "public" finalize method raise NotImplementedError( "finalize() must be implemented by AutoFinalizedObject." )
[ "def", "finalize", "(", "self", ")", ":", "# this is the \"public\" finalize method", "raise", "NotImplementedError", "(", "\"finalize() must be implemented by AutoFinalizedObject.\"", ")" ]
https://github.com/fablabnbg/inkscape-silhouette/blob/e0ad65115b4b2b0a5b60dfecd9a3ca03ec1d6bec/silhouette/pyusb-1.0.2/usb/_objfinalizer.py#L73-L81
misterch0c/shadowbroker
e3a069bea47a2c1009697941ac214adc6f90aa8d
windows/Resources/Python/Core/Lib/logging/__init__.py
python
BufferingFormatter.__init__
(self, linefmt=None)
Optionally specify a formatter which will be used to format each individual record.
Optionally specify a formatter which will be used to format each individual record.
[ "Optionally", "specify", "a", "formatter", "which", "will", "be", "used", "to", "format", "each", "individual", "record", "." ]
def __init__(self, linefmt=None): """ Optionally specify a formatter which will be used to format each individual record. """ if linefmt: self.linefmt = linefmt else: self.linefmt = _defaultFormatter
[ "def", "__init__", "(", "self", ",", "linefmt", "=", "None", ")", ":", "if", "linefmt", ":", "self", ".", "linefmt", "=", "linefmt", "else", ":", "self", ".", "linefmt", "=", "_defaultFormatter" ]
https://github.com/misterch0c/shadowbroker/blob/e3a069bea47a2c1009697941ac214adc6f90aa8d/windows/Resources/Python/Core/Lib/logging/__init__.py#L405-L413
ProjectQ-Framework/ProjectQ
0d32c1610ba4e9aefd7f19eb52dadb4fbe5f9005
projectq/ops/_gates.py
python
BarrierGate.__str__
(self)
return "Barrier"
Return a string representation of the object.
Return a string representation of the object.
[ "Return", "a", "string", "representation", "of", "the", "object", "." ]
def __str__(self): """Return a string representation of the object.""" return "Barrier"
[ "def", "__str__", "(", "self", ")", ":", "return", "\"Barrier\"" ]
https://github.com/ProjectQ-Framework/ProjectQ/blob/0d32c1610ba4e9aefd7f19eb52dadb4fbe5f9005/projectq/ops/_gates.py#L475-L477
bashtage/linearmodels
9256269f01ff8c5f85e65342d66149a5636661b6
linearmodels/panel/results.py
python
PanelResults._out_of_sample
( self, exog: OptionalArrayLike, data: Optional[DataFrame], missing: bool )
return pred
Interface between model predict and predict for OOS fits
Interface between model predict and predict for OOS fits
[ "Interface", "between", "model", "predict", "and", "predict", "for", "OOS", "fits" ]
def _out_of_sample( self, exog: OptionalArrayLike, data: Optional[DataFrame], missing: bool ) -> DataFrame: """Interface between model predict and predict for OOS fits""" if exog is not None and data is not None: raise ValueError( "Predictions can only be construc...
[ "def", "_out_of_sample", "(", "self", ",", "exog", ":", "OptionalArrayLike", ",", "data", ":", "Optional", "[", "DataFrame", "]", ",", "missing", ":", "bool", ")", "->", "DataFrame", ":", "if", "exog", "is", "not", "None", "and", "data", "is", "not", "...
https://github.com/bashtage/linearmodels/blob/9256269f01ff8c5f85e65342d66149a5636661b6/linearmodels/panel/results.py#L473-L485
replit-archive/empythoned
977ec10ced29a3541a4973dc2b59910805695752
dist/lib/python2.7/fractions.py
python
Fraction.__le__
(a, b)
return a._richcmp(b, operator.le)
a <= b
a <= b
[ "a", "<", "=", "b" ]
def __le__(a, b): """a <= b""" return a._richcmp(b, operator.le)
[ "def", "__le__", "(", "a", ",", "b", ")", ":", "return", "a", ".", "_richcmp", "(", "b", ",", "operator", ".", "le", ")" ]
https://github.com/replit-archive/empythoned/blob/977ec10ced29a3541a4973dc2b59910805695752/dist/lib/python2.7/fractions.py#L580-L582
aliyun/aliyun-oss-python-sdk
5f2afa0928a58c7c1cc6317ac147f3637481f6fd
oss2/models.py
python
TaggingRule.len
(self)
return len(self.tagging_rule)
[]
def len(self): return len(self.tagging_rule)
[ "def", "len", "(", "self", ")", ":", "return", "len", "(", "self", ".", "tagging_rule", ")" ]
https://github.com/aliyun/aliyun-oss-python-sdk/blob/5f2afa0928a58c7c1cc6317ac147f3637481f6fd/oss2/models.py#L1462-L1463
cal-pratt/SheetVision
f1ce1c9c97d5c922aa95b9120152f9c62fab829d
MIDIUtil-0.89/MIDIUtil-0.89/src/midiutil/MidiFile.py
python
MIDIFile.shiftTracks
(self, offset=0)
Shift tracks to be zero-origined, or origined at offset. Note that the shifting of the time in the tracks uses the MIDIEventList -- in other words it is assumed to be called in the stage where the MIDIEventList has been created. This function, however, it meant to operate on the eventLi...
Shift tracks to be zero-origined, or origined at offset. Note that the shifting of the time in the tracks uses the MIDIEventList -- in other words it is assumed to be called in the stage where the MIDIEventList has been created. This function, however, it meant to operate on the eventLi...
[ "Shift", "tracks", "to", "be", "zero", "-", "origined", "or", "origined", "at", "offset", ".", "Note", "that", "the", "shifting", "of", "the", "time", "in", "the", "tracks", "uses", "the", "MIDIEventList", "--", "in", "other", "words", "it", "is", "assum...
def shiftTracks(self, offset=0): """Shift tracks to be zero-origined, or origined at offset. Note that the shifting of the time in the tracks uses the MIDIEventList -- in other words it is assumed to be called in the stage where the MIDIEventList has been created. This function...
[ "def", "shiftTracks", "(", "self", ",", "offset", "=", "0", ")", ":", "origin", "=", "1000000", "# A little silly, but we'll assume big enough", "for", "track", "in", "self", ".", "tracks", ":", "if", "len", "(", "track", ".", "eventList", ")", ">", "0", "...
https://github.com/cal-pratt/SheetVision/blob/f1ce1c9c97d5c922aa95b9120152f9c62fab829d/MIDIUtil-0.89/MIDIUtil-0.89/src/midiutil/MidiFile.py#L892-L918
demisto/content
5c664a65b992ac8ca90ac3f11b1b2cdf11ee9b07
Packs/SailPointIdentityNow/Integrations/SailPointIdentityNow/SailPointIdentityNow.py
python
Client.send_request
(self, url_suffix: str, method: str, params=None, json_data=None)
return self._http_request(url_suffix=url_suffix, method=method, json_data=json_data, params=params, timeout=self.request_timeout, resp_type='response')
Perform a HTTP request to IdentityNow API. :type url_suffix: ``str`` :param url_suffix: IdentityNow API endpoint ext suffix. :type method: ``str`` :param method: HTTP method, e.g. 'GET', 'POST', 'PUT', 'DELETE'. :type params: ``JSON`` :param params: URL parameters to s...
Perform a HTTP request to IdentityNow API.
[ "Perform", "a", "HTTP", "request", "to", "IdentityNow", "API", "." ]
def send_request(self, url_suffix: str, method: str, params=None, json_data=None): """ Perform a HTTP request to IdentityNow API. :type url_suffix: ``str`` :param url_suffix: IdentityNow API endpoint ext suffix. :type method: ``str`` :param method: HTTP method, e.g. 'GE...
[ "def", "send_request", "(", "self", ",", "url_suffix", ":", "str", ",", "method", ":", "str", ",", "params", "=", "None", ",", "json_data", "=", "None", ")", ":", "if", "url_suffix", "is", "None", "or", "method", "is", "None", ":", "return", "None", ...
https://github.com/demisto/content/blob/5c664a65b992ac8ca90ac3f11b1b2cdf11ee9b07/Packs/SailPointIdentityNow/Integrations/SailPointIdentityNow/SailPointIdentityNow.py#L51-L73
oilshell/oil
94388e7d44a9ad879b12615f6203b38596b5a2d3
Python-2.7.13/Lib/compiler/ast.py
python
Break.getChildren
(self)
return ()
[]
def getChildren(self): return ()
[ "def", "getChildren", "(", "self", ")", ":", "return", "(", ")" ]
https://github.com/oilshell/oil/blob/94388e7d44a9ad879b12615f6203b38596b5a2d3/Python-2.7.13/Lib/compiler/ast.py#L272-L273
intuition-io/intuition
cd517e6b3b315a743eb4d0d0dc294e264ab913ce
intuition/data/remote.py
python
lookup_symbol
(company)
return json.loads(request.text[39:-1])["ResultSet"]["Result"] \ if request.ok else {'error': request.reason}
Fetch company info >>> lookup_symbol("Apple Inc.") {u'exch': u'NMS', u'market': u'NASDAQ', u'name': u'Apple Inc.', u'symbol': u'AAPL', u'type': u'Equity'}
Fetch company info >>> lookup_symbol("Apple Inc.") {u'exch': u'NMS', u'market': u'NASDAQ', u'name': u'Apple Inc.', u'symbol': u'AAPL', u'type': u'Equity'}
[ "Fetch", "company", "info", ">>>", "lookup_symbol", "(", "Apple", "Inc", ".", ")", "{", "u", "exch", ":", "u", "NMS", "u", "market", ":", "u", "NASDAQ", "u", "name", ":", "u", "Apple", "Inc", ".", "u", "symbol", ":", "u", "AAPL", "u", "type", ":"...
def lookup_symbol(company): ''' Fetch company info >>> lookup_symbol("Apple Inc.") {u'exch': u'NMS', u'market': u'NASDAQ', u'name': u'Apple Inc.', u'symbol': u'AAPL', u'type': u'Equity'} ''' request = requests.get(FINANCE_URLS['info_lookup'].format(c...
[ "def", "lookup_symbol", "(", "company", ")", ":", "request", "=", "requests", ".", "get", "(", "FINANCE_URLS", "[", "'info_lookup'", "]", ".", "format", "(", "company", ")", ")", "return", "json", ".", "loads", "(", "request", ".", "text", "[", "39", "...
https://github.com/intuition-io/intuition/blob/cd517e6b3b315a743eb4d0d0dc294e264ab913ce/intuition/data/remote.py#L97-L108
karlch/vimiv
acbb83e003805e5304131be1f73d7f66528606d6
vimiv/transform.py
python
Transform.rotate_auto
(self)
Autorotate all pictures in the current pathlist.
Autorotate all pictures in the current pathlist.
[ "Autorotate", "all", "pictures", "in", "the", "current", "pathlist", "." ]
def rotate_auto(self): """Autorotate all pictures in the current pathlist.""" autorotate = imageactions.Autorotate(self._app.get_paths()) self.threads_running = True autorotate.connect("completed", self._on_autorotate_completed) autorotate.run()
[ "def", "rotate_auto", "(", "self", ")", ":", "autorotate", "=", "imageactions", ".", "Autorotate", "(", "self", ".", "_app", ".", "get_paths", "(", ")", ")", "self", ".", "threads_running", "=", "True", "autorotate", ".", "connect", "(", "\"completed\"", "...
https://github.com/karlch/vimiv/blob/acbb83e003805e5304131be1f73d7f66528606d6/vimiv/transform.py#L223-L228
yuantailing/ctw-baseline
081c8361b0ed0675bf619ab6316ebf8415e93f46
classification/slim/nets/inception_resnet_v2.py
python
inception_resnet_v2_base
(inputs, final_endpoint='Conv2d_7b_1x1', output_stride=16, align_feature_maps=False, scope=None)
Inception model from http://arxiv.org/abs/1602.07261. Constructs an Inception Resnet v2 network from inputs to the given final endpoint. This method can construct the network up to the final inception block Conv2d_7b_1x1. Args: inputs: a tensor of size [batch_size, height, width, channels]. final_end...
Inception model from http://arxiv.org/abs/1602.07261.
[ "Inception", "model", "from", "http", ":", "//", "arxiv", ".", "org", "/", "abs", "/", "1602", ".", "07261", "." ]
def inception_resnet_v2_base(inputs, final_endpoint='Conv2d_7b_1x1', output_stride=16, align_feature_maps=False, scope=None): """Inception model from http://arxiv.org/abs/1602.07261. Constructs an I...
[ "def", "inception_resnet_v2_base", "(", "inputs", ",", "final_endpoint", "=", "'Conv2d_7b_1x1'", ",", "output_stride", "=", "16", ",", "align_feature_maps", "=", "False", ",", "scope", "=", "None", ")", ":", "if", "output_stride", "!=", "8", "and", "output_strid...
https://github.com/yuantailing/ctw-baseline/blob/081c8361b0ed0675bf619ab6316ebf8415e93f46/classification/slim/nets/inception_resnet_v2.py#L94-L267
OpenCobolIDE/OpenCobolIDE
c78d0d335378e5fe0a5e74f53c19b68b55e85388
open_cobol_ide/extlibs/pygments/lexers/templates.py
python
CssDjangoLexer.__init__
(self, **options)
[]
def __init__(self, **options): super(CssDjangoLexer, self).__init__(CssLexer, DjangoLexer, **options)
[ "def", "__init__", "(", "self", ",", "*", "*", "options", ")", ":", "super", "(", "CssDjangoLexer", ",", "self", ")", ".", "__init__", "(", "CssLexer", ",", "DjangoLexer", ",", "*", "*", "options", ")" ]
https://github.com/OpenCobolIDE/OpenCobolIDE/blob/c78d0d335378e5fe0a5e74f53c19b68b55e85388/open_cobol_ide/extlibs/pygments/lexers/templates.py#L1323-L1324
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
DistInfoDistribution._parsed_pkg_info
(self)
Parse and cache metadata
Parse and cache metadata
[ "Parse", "and", "cache", "metadata" ]
def _parsed_pkg_info(self): """Parse and cache metadata""" try: return self._pkg_info except AttributeError: metadata = self.get_metadata(self.PKG_INFO) self._pkg_info = email.parser.Parser().parsestr(metadata) return self._pkg_info
[ "def", "_parsed_pkg_info", "(", "self", ")", ":", "try", ":", "return", "self", ".", "_pkg_info", "except", "AttributeError", ":", "metadata", "=", "self", ".", "get_metadata", "(", "self", ".", "PKG_INFO", ")", "self", ".", "_pkg_info", "=", "email", ".",...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L2857-L2864
Tencent/bk-bcs-saas
2b437bf2f5fd5ce2078f7787c3a12df609f7679d
bcs-app/backend/container_service/clusters/flow_views/node.py
python
CreateNode.create
(self)
return Response({})
添加节点 1. 检查节点是否可用 2. 触发OPS api
添加节点 1. 检查节点是否可用 2. 触发OPS api
[ "添加节点", "1", ".", "检查节点是否可用", "2", ".", "触发OPS", "api" ]
def create(self): """添加节点 1. 检查节点是否可用 2. 触发OPS api """ # 校验集群edit权限 self.check_perm() # 校验数据 self.check_data() self.ip_list = [ip.split(',')[0] for ip in self.data['ip']] # 检测IP是否被占用 can_use_hosts(self.project_info["cc_app_id"], sel...
[ "def", "create", "(", "self", ")", ":", "# 校验集群edit权限", "self", ".", "check_perm", "(", ")", "# 校验数据", "self", ".", "check_data", "(", ")", "self", ".", "ip_list", "=", "[", "ip", ".", "split", "(", "','", ")", "[", "0", "]", "for", "ip", "in", "...
https://github.com/Tencent/bk-bcs-saas/blob/2b437bf2f5fd5ce2078f7787c3a12df609f7679d/bcs-app/backend/container_service/clusters/flow_views/node.py#L242-L279
Scalsol/mega.pytorch
a6aa6e0537b82d70da94228100a51e6a53d98f82
mega_core/modeling/balanced_positive_negative_sampler.py
python
BalancedPositiveNegativeSampler.__init__
(self, batch_size_per_image, positive_fraction)
Arguments: batch_size_per_image (int): number of elements to be selected per image positive_fraction (float): percentage of positive elements per batch
Arguments: batch_size_per_image (int): number of elements to be selected per image positive_fraction (float): percentage of positive elements per batch
[ "Arguments", ":", "batch_size_per_image", "(", "int", ")", ":", "number", "of", "elements", "to", "be", "selected", "per", "image", "positive_fraction", "(", "float", ")", ":", "percentage", "of", "positive", "elements", "per", "batch" ]
def __init__(self, batch_size_per_image, positive_fraction): """ Arguments: batch_size_per_image (int): number of elements to be selected per image positive_fraction (float): percentage of positive elements per batch """ self.batch_size_per_image = batch_size_per_...
[ "def", "__init__", "(", "self", ",", "batch_size_per_image", ",", "positive_fraction", ")", ":", "self", ".", "batch_size_per_image", "=", "batch_size_per_image", "self", ".", "positive_fraction", "=", "positive_fraction" ]
https://github.com/Scalsol/mega.pytorch/blob/a6aa6e0537b82d70da94228100a51e6a53d98f82/mega_core/modeling/balanced_positive_negative_sampler.py#L10-L17
facebookresearch/hydra
9b2f4d54b328d1551aa70a241a1d638cbe046367
build_helpers/build_helpers.py
python
ANTLRCommand.run
(self)
Run command.
Run command.
[ "Run", "command", "." ]
def run(self) -> None: """Run command.""" root_dir = abspath(dirname(__file__)) project_root = abspath(dirname(basename(__file__))) for grammar in [ "hydra/grammar/OverrideLexer.g4", "hydra/grammar/OverrideParser.g4", ]: command = [ ...
[ "def", "run", "(", "self", ")", "->", "None", ":", "root_dir", "=", "abspath", "(", "dirname", "(", "__file__", ")", ")", "project_root", "=", "abspath", "(", "dirname", "(", "basename", "(", "__file__", ")", ")", ")", "for", "grammar", "in", "[", "\...
https://github.com/facebookresearch/hydra/blob/9b2f4d54b328d1551aa70a241a1d638cbe046367/build_helpers/build_helpers.py#L175-L199
mahmoud/boltons
270e974975984f662f998c8f6eb0ebebd964de82
boltons/ioutils.py
python
SpooledBytesIO.seek
(self, pos, mode=0)
return self.buffer.seek(pos, mode)
[]
def seek(self, pos, mode=0): return self.buffer.seek(pos, mode)
[ "def", "seek", "(", "self", ",", "pos", ",", "mode", "=", "0", ")", ":", "return", "self", ".", "buffer", ".", "seek", "(", "pos", ",", "mode", ")" ]
https://github.com/mahmoud/boltons/blob/270e974975984f662f998c8f6eb0ebebd964de82/boltons/ioutils.py#L269-L270
BillBillBillBill/Tickeys-linux
2df31b8665004c58a5d4ab05277f245267d96364
tickeys/kivy_32/kivy/core/window/__init__.py
python
WindowBase.toggle_fullscreen
(self)
Toggle between fullscreen and windowed mode. .. deprecated:: 1.9.0 Use :attr:`fullscreen` instead.
Toggle between fullscreen and windowed mode.
[ "Toggle", "between", "fullscreen", "and", "windowed", "mode", "." ]
def toggle_fullscreen(self): '''Toggle between fullscreen and windowed mode. .. deprecated:: 1.9.0 Use :attr:`fullscreen` instead. ''' pass
[ "def", "toggle_fullscreen", "(", "self", ")", ":", "pass" ]
https://github.com/BillBillBillBill/Tickeys-linux/blob/2df31b8665004c58a5d4ab05277f245267d96364/tickeys/kivy_32/kivy/core/window/__init__.py#L645-L651
softlayer/softlayer-python
cdef7d63c66413197a9a97b0414de9f95887a82a
SoftLayer/CLI/block/set_note.py
python
cli
(env, volume_id, note)
Set note for an existing block storage volume.
Set note for an existing block storage volume.
[ "Set", "note", "for", "an", "existing", "block", "storage", "volume", "." ]
def cli(env, volume_id, note): """Set note for an existing block storage volume.""" block_manager = SoftLayer.BlockStorageManager(env.client) block_volume_id = helpers.resolve_id(block_manager.resolve_ids, volume_id, 'Block Volume') result = block_manager.volume_set_note(block_volume_id, note) if ...
[ "def", "cli", "(", "env", ",", "volume_id", ",", "note", ")", ":", "block_manager", "=", "SoftLayer", ".", "BlockStorageManager", "(", "env", ".", "client", ")", "block_volume_id", "=", "helpers", ".", "resolve_id", "(", "block_manager", ".", "resolve_ids", ...
https://github.com/softlayer/softlayer-python/blob/cdef7d63c66413197a9a97b0414de9f95887a82a/SoftLayer/CLI/block/set_note.py#L17-L28
akkana/scripts
bb59210acd3cef9a7eaccf5e082feff9d2b1b97d
gitbranchsync.py
python
check_push_status
(repo, silent=False)
return modfiles, alllocaldiffs, allremotediffs
Does this repo have changes that haven't been pushed upstream? Print any info, but also return the number of changes that differ. If silent is set, don't print anything, just calculate and return.
Does this repo have changes that haven't been pushed upstream? Print any info, but also return the number of changes that differ. If silent is set, don't print anything, just calculate and return.
[ "Does", "this", "repo", "have", "changes", "that", "haven", "t", "been", "pushed", "upstream?", "Print", "any", "info", "but", "also", "return", "the", "number", "of", "changes", "that", "differ", ".", "If", "silent", "is", "set", "don", "t", "print", "a...
def check_push_status(repo, silent=False): """Does this repo have changes that haven't been pushed upstream? Print any info, but also return the number of changes that differ. If silent is set, don't print anything, just calculate and return. """ modfiles = 0 # git status --porcelain -uno ...
[ "def", "check_push_status", "(", "repo", ",", "silent", "=", "False", ")", ":", "modfiles", "=", "0", "# git status --porcelain -uno", "porcelain", "=", "repo", ".", "git", ".", "status", "(", "porcelain", "=", "True", ")", ".", "splitlines", "(", ")", "fo...
https://github.com/akkana/scripts/blob/bb59210acd3cef9a7eaccf5e082feff9d2b1b97d/gitbranchsync.py#L62-L131
bookwyrm-social/bookwyrm
0c2537e27a2cdbc0136880dfbbf170d5fec72986
bookwyrm/models/import_job.py
python
ImportItem.rating
(self)
return None
x/5 star rating for a book
x/5 star rating for a book
[ "x", "/", "5", "star", "rating", "for", "a", "book" ]
def rating(self): """x/5 star rating for a book""" if self.normalized_data.get("rating"): return float(self.normalized_data.get("rating")) return None
[ "def", "rating", "(", "self", ")", ":", "if", "self", ".", "normalized_data", ".", "get", "(", "\"rating\"", ")", ":", "return", "float", "(", "self", ".", "normalized_data", ".", "get", "(", "\"rating\"", ")", ")", "return", "None" ]
https://github.com/bookwyrm-social/bookwyrm/blob/0c2537e27a2cdbc0136880dfbbf170d5fec72986/bookwyrm/models/import_job.py#L168-L172
vslavik/bakefile
0757295c3e4ac23cd1e0767c77c14c2256ed16e1
3rdparty/antlr3/python-runtime/antlr3/recognizers.py
python
BaseRecognizer.endResync
(self)
A hook to listen in on the token consumption during error recovery. The DebugParser subclasses this to fire events to the listenter.
A hook to listen in on the token consumption during error recovery. The DebugParser subclasses this to fire events to the listenter.
[ "A", "hook", "to", "listen", "in", "on", "the", "token", "consumption", "during", "error", "recovery", ".", "The", "DebugParser", "subclasses", "this", "to", "fire", "events", "to", "the", "listenter", "." ]
def endResync(self): """ A hook to listen in on the token consumption during error recovery. The DebugParser subclasses this to fire events to the listenter. """ pass
[ "def", "endResync", "(", "self", ")", ":", "pass" ]
https://github.com/vslavik/bakefile/blob/0757295c3e4ac23cd1e0767c77c14c2256ed16e1/3rdparty/antlr3/python-runtime/antlr3/recognizers.py#L485-L491
dimagi/commcare-hq
d67ff1d3b4c51fa050c19e60c3253a79d3452a39
corehq/apps/groups/models.py
python
Group.user_in_group
(cls, user_id, group_id)
[]
def user_in_group(cls, user_id, group_id): if not user_id or not group_id: return False c = cls.get_db().view( 'groups/by_user', key=user_id, startkey_docid=group_id, endkey_docid=group_id ).count() if c == 0: return...
[ "def", "user_in_group", "(", "cls", ",", "user_id", ",", "group_id", ")", ":", "if", "not", "user_id", "or", "not", "group_id", ":", "return", "False", "c", "=", "cls", ".", "get_db", "(", ")", ".", "view", "(", "'groups/by_user'", ",", "key", "=", "...
https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/groups/models.py#L255-L272
ztosec/hunter
4ee5cca8dc5fc5d7e631e935517bd0f493c30a37
HunterCelery/common/http_util.py
python
get_parent_route
(url)
return result
获得父级路由 :param url: :return:
获得父级路由 :param url: :return:
[ "获得父级路由", ":", "param", "url", ":", ":", "return", ":" ]
def get_parent_route(url): """ 获得父级路由 :param url: :return: """ parameter = re.split(r'/[^/]*$', url, re.S) try: result = parameter[0] + "/" except IndexError: result = url + "/" if result == "https://" or result == "http://": result = url + "/" return re...
[ "def", "get_parent_route", "(", "url", ")", ":", "parameter", "=", "re", ".", "split", "(", "r'/[^/]*$'", ",", "url", ",", "re", ".", "S", ")", "try", ":", "result", "=", "parameter", "[", "0", "]", "+", "\"/\"", "except", "IndexError", ":", "result"...
https://github.com/ztosec/hunter/blob/4ee5cca8dc5fc5d7e631e935517bd0f493c30a37/HunterCelery/common/http_util.py#L135-L148
zzzeek/sqlalchemy
fc5c54fcd4d868c2a4c7ac19668d72f506fe821e
lib/sqlalchemy/sql/compiler.py
python
IdentifierPreparer._requires_quotes_illegal_chars
(self, value)
return not self.legal_characters.match(util.text_type(value))
Return True if the given identifier requires quoting, but not taking case convention into account.
Return True if the given identifier requires quoting, but not taking case convention into account.
[ "Return", "True", "if", "the", "given", "identifier", "requires", "quoting", "but", "not", "taking", "case", "convention", "into", "account", "." ]
def _requires_quotes_illegal_chars(self, value): """Return True if the given identifier requires quoting, but not taking case convention into account.""" return not self.legal_characters.match(util.text_type(value))
[ "def", "_requires_quotes_illegal_chars", "(", "self", ",", "value", ")", ":", "return", "not", "self", ".", "legal_characters", ".", "match", "(", "util", ".", "text_type", "(", "value", ")", ")" ]
https://github.com/zzzeek/sqlalchemy/blob/fc5c54fcd4d868c2a4c7ac19668d72f506fe821e/lib/sqlalchemy/sql/compiler.py#L5124-L5127
veusz/veusz
5a1e2af5f24df0eb2a2842be51f2997c4999c7fb
veusz/windows/mainwindow.py
python
MainWindow.dropEvent
(self, event)
Respond to a drop event on the current window
Respond to a drop event on the current window
[ "Respond", "to", "a", "drop", "event", "on", "the", "current", "window" ]
def dropEvent(self, event): """Respond to a drop event on the current window""" if event.mimeData().hasUrls(): files = self._getVeuszDropFiles(event) if files: if self.document.isBlank(): self.openFileInWindow(files[0]) else: ...
[ "def", "dropEvent", "(", "self", ",", "event", ")", ":", "if", "event", ".", "mimeData", "(", ")", ".", "hasUrls", "(", ")", ":", "files", "=", "self", ".", "_getVeuszDropFiles", "(", "event", ")", "if", "files", ":", "if", "self", ".", "document", ...
https://github.com/veusz/veusz/blob/5a1e2af5f24df0eb2a2842be51f2997c4999c7fb/veusz/windows/mainwindow.py#L254-L264
googlearchive/appengine-flask-skeleton
8c25461d003a0bd99a9ff3b339c2791ee6919242
lib/jinja2/parser.py
python
Parser.parse_assign_target
(self, with_tuple=True, name_only=False, extra_end_rules=None)
return target
Parse an assignment target. As Jinja2 allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that can be disable however by setting `with_tuple` to `False`. If only assignments to names are wanted `name_only`...
Parse an assignment target. As Jinja2 allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that can be disable however by setting `with_tuple` to `False`. If only assignments to names are wanted `name_only`...
[ "Parse", "an", "assignment", "target", ".", "As", "Jinja2", "allows", "assignments", "to", "tuples", "this", "function", "can", "parse", "all", "allowed", "assignment", "targets", ".", "Per", "default", "assignments", "to", "tuples", "are", "parsed", "that", "...
def parse_assign_target(self, with_tuple=True, name_only=False, extra_end_rules=None): """Parse an assignment target. As Jinja2 allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that c...
[ "def", "parse_assign_target", "(", "self", ",", "with_tuple", "=", "True", ",", "name_only", "=", "False", ",", "extra_end_rules", "=", "None", ")", ":", "if", "name_only", ":", "token", "=", "self", ".", "stream", ".", "expect", "(", "'name'", ")", "tar...
https://github.com/googlearchive/appengine-flask-skeleton/blob/8c25461d003a0bd99a9ff3b339c2791ee6919242/lib/jinja2/parser.py#L360-L382