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
quip/quip-api
19f3b32a05ed092a70dc2c616e214aaff8a06de2
samples/baqup/quip.py
python
QuipClient.remove_folder_members
(self, folder_id, member_ids)
return self._fetch_json("folders/remove-members", post_data={ "folder_id": folder_id, "member_ids": ",".join(member_ids), })
Removes the given users from the given folder.
Removes the given users from the given folder.
[ "Removes", "the", "given", "users", "from", "the", "given", "folder", "." ]
def remove_folder_members(self, folder_id, member_ids): """Removes the given users from the given folder.""" return self._fetch_json("folders/remove-members", post_data={ "folder_id": folder_id, "member_ids": ",".join(member_ids), })
[ "def", "remove_folder_members", "(", "self", ",", "folder_id", ",", "member_ids", ")", ":", "return", "self", ".", "_fetch_json", "(", "\"folders/remove-members\"", ",", "post_data", "=", "{", "\"folder_id\"", ":", "folder_id", ",", "\"member_ids\"", ":", "\",\"",...
https://github.com/quip/quip-api/blob/19f3b32a05ed092a70dc2c616e214aaff8a06de2/samples/baqup/quip.py#L212-L217
playframework/play1
0ecac3bc2421ae2dbec27a368bf671eda1c9cba5
python/Lib/cookielib.py
python
CookieJar._cookies_for_request
(self, request)
return cookies
Return a list of cookies to be returned to server.
Return a list of cookies to be returned to server.
[ "Return", "a", "list", "of", "cookies", "to", "be", "returned", "to", "server", "." ]
def _cookies_for_request(self, request): """Return a list of cookies to be returned to server.""" cookies = [] for domain in self._cookies.keys(): cookies.extend(self._cookies_for_domain(domain, request)) return cookies
[ "def", "_cookies_for_request", "(", "self", ",", "request", ")", ":", "cookies", "=", "[", "]", "for", "domain", "in", "self", ".", "_cookies", ".", "keys", "(", ")", ":", "cookies", ".", "extend", "(", "self", ".", "_cookies_for_domain", "(", "domain", ...
https://github.com/playframework/play1/blob/0ecac3bc2421ae2dbec27a368bf671eda1c9cba5/python/Lib/cookielib.py#L1262-L1267
SymbiFlow/symbiflow-arch-defs
f38793112ff78a06de9f1e3269bd22543e29729f
quicklogic/common/utils/repacker/repack.py
python
load_pcf_constraints
(pcf)
return constraints
Loads constraints for the repacker from a parsed PCF file
Loads constraints for the repacker from a parsed PCF file
[ "Loads", "constraints", "for", "the", "repacker", "from", "a", "parsed", "PCF", "file" ]
def load_pcf_constraints(pcf): """ Loads constraints for the repacker from a parsed PCF file """ logging.debug(" Repacking constraints:") constraints = [] for pcf_constr in parse_simple_pcf(pcf): if (type(pcf_constr).__name__ == 'PcfClkConstraint'): # There are only "clb" ...
[ "def", "load_pcf_constraints", "(", "pcf", ")", ":", "logging", ".", "debug", "(", "\" Repacking constraints:\"", ")", "constraints", "=", "[", "]", "for", "pcf_constr", "in", "parse_simple_pcf", "(", "pcf", ")", ":", "if", "(", "type", "(", "pcf_constr", ")...
https://github.com/SymbiFlow/symbiflow-arch-defs/blob/f38793112ff78a06de9f1e3269bd22543e29729f/quicklogic/common/utils/repacker/repack.py#L933-L969
replit-archive/empythoned
977ec10ced29a3541a4973dc2b59910805695752
cpython/Tools/gdb/libpython.py
python
PyObjectPtr.subclass_from_type
(cls, t)
return cls
Given a PyTypeObjectPtr instance wrapping a gdb.Value that's a (PyTypeObject*), determine the corresponding subclass of PyObjectPtr to use Ideally, we would look up the symbols for the global types, but that isn't working yet: (gdb) python print gdb.lookup_symbol('PyList_Type'...
Given a PyTypeObjectPtr instance wrapping a gdb.Value that's a (PyTypeObject*), determine the corresponding subclass of PyObjectPtr to use
[ "Given", "a", "PyTypeObjectPtr", "instance", "wrapping", "a", "gdb", ".", "Value", "that", "s", "a", "(", "PyTypeObject", "*", ")", "determine", "the", "corresponding", "subclass", "of", "PyObjectPtr", "to", "use" ]
def subclass_from_type(cls, t): ''' Given a PyTypeObjectPtr instance wrapping a gdb.Value that's a (PyTypeObject*), determine the corresponding subclass of PyObjectPtr to use Ideally, we would look up the symbols for the global types, but that isn't working yet: ...
[ "def", "subclass_from_type", "(", "cls", ",", "t", ")", ":", "try", ":", "tp_name", "=", "t", ".", "field", "(", "'tp_name'", ")", ".", "string", "(", ")", "tp_flags", "=", "int", "(", "t", ".", "field", "(", "'tp_flags'", ")", ")", "except", "Runt...
https://github.com/replit-archive/empythoned/blob/977ec10ced29a3541a4973dc2b59910805695752/cpython/Tools/gdb/libpython.py#L270-L334
mrlesmithjr/Ansible
d44f0dc0d942bdf3bf7334b307e6048f0ee16e36
roles/ansible-vsphere-management/scripts/pdns/lib/python2.7/site-packages/pkg_resources/_vendor/pyparsing.py
python
ParserElement.parseWithTabs
( self )
return self
Overrides default behavior to expand C{<TAB>}s to spaces before parsing the input string. Must be called before C{parseString} when the input grammar contains elements that match C{<TAB>} characters.
Overrides default behavior to expand C{<TAB>}s to spaces before parsing the input string. Must be called before C{parseString} when the input grammar contains elements that match C{<TAB>} characters.
[ "Overrides", "default", "behavior", "to", "expand", "C", "{", "<TAB", ">", "}", "s", "to", "spaces", "before", "parsing", "the", "input", "string", ".", "Must", "be", "called", "before", "C", "{", "parseString", "}", "when", "the", "input", "grammar", "c...
def parseWithTabs( self ): """ Overrides default behavior to expand C{<TAB>}s to spaces before parsing the input string. Must be called before C{parseString} when the input grammar contains elements that match C{<TAB>} characters. """ self.keepTabs = True return s...
[ "def", "parseWithTabs", "(", "self", ")", ":", "self", ".", "keepTabs", "=", "True", "return", "self" ]
https://github.com/mrlesmithjr/Ansible/blob/d44f0dc0d942bdf3bf7334b307e6048f0ee16e36/roles/ansible-vsphere-management/scripts/pdns/lib/python2.7/site-packages/pkg_resources/_vendor/pyparsing.py#L2029-L2036
TobiasLee/Text-Classification
21229709953b6c1c8f3bbb923883092b217ef023
models/adversarial_abblstm.py
python
AdversarialClassifier._get_freq
(self, vocab_freq, word2idx)
return freq
get a frequency dict format as {word_idx: word_freq}
get a frequency dict format as {word_idx: word_freq}
[ "get", "a", "frequency", "dict", "format", "as", "{", "word_idx", ":", "word_freq", "}" ]
def _get_freq(self, vocab_freq, word2idx): """get a frequency dict format as {word_idx: word_freq}""" words = vocab_freq.keys() freq = [0] * self.vocab_size for word in words: word_idx = word2idx.get(word) word_freq = vocab_freq[word] freq[word_idx] = ...
[ "def", "_get_freq", "(", "self", ",", "vocab_freq", ",", "word2idx", ")", ":", "words", "=", "vocab_freq", ".", "keys", "(", ")", "freq", "=", "[", "0", "]", "*", "self", ".", "vocab_size", "for", "word", "in", "words", ":", "word_idx", "=", "word2id...
https://github.com/TobiasLee/Text-Classification/blob/21229709953b6c1c8f3bbb923883092b217ef023/models/adversarial_abblstm.py#L54-L62
edisonlz/fastor
342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3
base/site-packages/tencentcloud/vpc/v20170312/models.py
python
AttachClassicLinkVpcRequest.__init__
(self)
:param VpcId: VPC实例ID :type VpcId: str :param InstanceIds: CVM实例ID :type InstanceIds: list of str
:param VpcId: VPC实例ID :type VpcId: str :param InstanceIds: CVM实例ID :type InstanceIds: list of str
[ ":", "param", "VpcId", ":", "VPC实例ID", ":", "type", "VpcId", ":", "str", ":", "param", "InstanceIds", ":", "CVM实例ID", ":", "type", "InstanceIds", ":", "list", "of", "str" ]
def __init__(self): """ :param VpcId: VPC实例ID :type VpcId: str :param InstanceIds: CVM实例ID :type InstanceIds: list of str """ self.VpcId = None self.InstanceIds = None
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "VpcId", "=", "None", "self", ".", "InstanceIds", "=", "None" ]
https://github.com/edisonlz/fastor/blob/342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3/base/site-packages/tencentcloud/vpc/v20170312/models.py#L280-L288
CedricGuillemet/Imogen
ee417b42747ed5b46cb11b02ef0c3630000085b3
bin/Lib/pty.py
python
master_open
()
return _open_terminal()
master_open() -> (master_fd, slave_name) Open a pty master and return the fd, and the filename of the slave end. Deprecated, use openpty() instead.
master_open() -> (master_fd, slave_name) Open a pty master and return the fd, and the filename of the slave end. Deprecated, use openpty() instead.
[ "master_open", "()", "-", ">", "(", "master_fd", "slave_name", ")", "Open", "a", "pty", "master", "and", "return", "the", "fd", "and", "the", "filename", "of", "the", "slave", "end", ".", "Deprecated", "use", "openpty", "()", "instead", "." ]
def master_open(): """master_open() -> (master_fd, slave_name) Open a pty master and return the fd, and the filename of the slave end. Deprecated, use openpty() instead.""" try: master_fd, slave_fd = os.openpty() except (AttributeError, OSError): pass else: slave_name = ...
[ "def", "master_open", "(", ")", ":", "try", ":", "master_fd", ",", "slave_fd", "=", "os", ".", "openpty", "(", ")", "except", "(", "AttributeError", ",", "OSError", ")", ":", "pass", "else", ":", "slave_name", "=", "os", ".", "ttyname", "(", "slave_fd"...
https://github.com/CedricGuillemet/Imogen/blob/ee417b42747ed5b46cb11b02ef0c3630000085b3/bin/Lib/pty.py#L33-L47
plotly/plotly.py
cfad7862594b35965c0e000813bd7805e8494a5b
packages/python/plotly/plotly/graph_objs/_scatter.py
python
Scatter.metasrc
(self)
return self["metasrc"]
Sets the source reference on Chart Studio Cloud for `meta`. The 'metasrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for `meta`. The 'metasrc' property must be specified as a string or as a plotly.grid_objs.Column object
[ "Sets", "the", "source", "reference", "on", "Chart", "Studio", "Cloud", "for", "meta", ".", "The", "metasrc", "property", "must", "be", "specified", "as", "a", "string", "or", "as", "a", "plotly", ".", "grid_objs", ".", "Column", "object" ]
def metasrc(self): """ Sets the source reference on Chart Studio Cloud for `meta`. The 'metasrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["metasrc"]
[ "def", "metasrc", "(", "self", ")", ":", "return", "self", "[", "\"metasrc\"", "]" ]
https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/_scatter.py#L1095-L1106
swook/GazeML
5466f59be70583e7e8c343bda91c8df539aef13a
src/core/model.py
python
BaseModel._build_optimizers
(self)
Based on learning schedule, create optimizer instances.
Based on learning schedule, create optimizer instances.
[ "Based", "on", "learning", "schedule", "create", "optimizer", "instances", "." ]
def _build_optimizers(self): """Based on learning schedule, create optimizer instances.""" self._optimize_ops = [] all_trainable_variables = tf.trainable_variables() all_update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS) all_reg_losses = tf.losses.get_regularization_losses()...
[ "def", "_build_optimizers", "(", "self", ")", ":", "self", ".", "_optimize_ops", "=", "[", "]", "all_trainable_variables", "=", "tf", ".", "trainable_variables", "(", ")", "all_update_ops", "=", "tf", ".", "get_collection", "(", "tf", ".", "GraphKeys", ".", ...
https://github.com/swook/GazeML/blob/5466f59be70583e7e8c343bda91c8df539aef13a/src/core/model.py#L238-L286
CouchPotato/CouchPotatoServer
7260c12f72447ddb6f062367c6dfbda03ecd4e9c
libs/tornado/template.py
python
BaseLoader.resolve_path
(self, name, parent_path=None)
Converts a possibly-relative path to absolute (used internally).
Converts a possibly-relative path to absolute (used internally).
[ "Converts", "a", "possibly", "-", "relative", "path", "to", "absolute", "(", "used", "internally", ")", "." ]
def resolve_path(self, name, parent_path=None): """Converts a possibly-relative path to absolute (used internally).""" raise NotImplementedError()
[ "def", "resolve_path", "(", "self", ",", "name", ",", "parent_path", "=", "None", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/CouchPotato/CouchPotatoServer/blob/7260c12f72447ddb6f062367c6dfbda03ecd4e9c/libs/tornado/template.py#L334-L336
deepmind/dm_control
806a10e896e7c887635328bfa8352604ad0fedae
dm_control/rl/control.py
python
Task.initialize_episode
(self, physics)
Sets the state of the environment at the start of each episode. Called by `control.Environment` at the start of each episode *within* `physics.reset_context()` (see the documentation for `base.Physics`). Args: physics: Instance of `Physics`.
Sets the state of the environment at the start of each episode.
[ "Sets", "the", "state", "of", "the", "environment", "at", "the", "start", "of", "each", "episode", "." ]
def initialize_episode(self, physics): """Sets the state of the environment at the start of each episode. Called by `control.Environment` at the start of each episode *within* `physics.reset_context()` (see the documentation for `base.Physics`). Args: physics: Instance of `Physics`. """
[ "def", "initialize_episode", "(", "self", ",", "physics", ")", ":" ]
https://github.com/deepmind/dm_control/blob/806a10e896e7c887635328bfa8352604ad0fedae/dm_control/rl/control.py#L272-L280
vmware/pyvcloud
d72c615fa41b8ea5ab049a929e18d8ba6460fc59
pyvcloud/vcd/acl.py
python
Acl.convert_access_settings_list_to_params
(self, access_settings_list)
return access_settings_params
Convert access settings from one format to other. Convert dictionary representation of access settings to AccessSettings XML element. Please refer to schema definition of EntityType.CONTROL_ACCESS_PARAMS for more details. :param list access_settings_list: list of dictionaries, where ea...
Convert access settings from one format to other.
[ "Convert", "access", "settings", "from", "one", "format", "to", "other", "." ]
def convert_access_settings_list_to_params(self, access_settings_list): """Convert access settings from one format to other. Convert dictionary representation of access settings to AccessSettings XML element. Please refer to schema definition of EntityType.CONTROL_ACCESS_PARAMS for more...
[ "def", "convert_access_settings_list_to_params", "(", "self", ",", "access_settings_list", ")", ":", "access_settings_params", "=", "E", ".", "AccessSettings", "(", ")", "for", "access_setting", "in", "access_settings_list", ":", "if", "access_setting", "[", "\"type\"",...
https://github.com/vmware/pyvcloud/blob/d72c615fa41b8ea5ab049a929e18d8ba6460fc59/pyvcloud/vcd/acl.py#L282-L328
mchristopher/PokemonGo-DesktopMap
ec37575f2776ee7d64456e2a1f6b6b78830b4fe0
app/pywin/Lib/socket.py
python
_socketobject.dup
(self)
return _socketobject(_sock=self._sock)
dup() -> socket object Return a new socket object connected to the same system resource.
dup() -> socket object
[ "dup", "()", "-", ">", "socket", "object" ]
def dup(self): """dup() -> socket object Return a new socket object connected to the same system resource.""" return _socketobject(_sock=self._sock)
[ "def", "dup", "(", "self", ")", ":", "return", "_socketobject", "(", "_sock", "=", "self", ".", "_sock", ")" ]
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/ec37575f2776ee7d64456e2a1f6b6b78830b4fe0/app/pywin/Lib/socket.py#L210-L214
poppy-project/pypot
c5d384fe23eef9f6ec98467f6f76626cdf20afb9
pypot/server/zmqserver.py
python
ZMQRobotServer.run
(self)
Run an infinite REQ/REP loop.
Run an infinite REQ/REP loop.
[ "Run", "an", "infinite", "REQ", "/", "REP", "loop", "." ]
def run(self): """ Run an infinite REQ/REP loop. """ while True: req = self.socket.recv_json() try: answer = self.handle_request(req) self.socket.send(json.dumps(answer)) except (AttributeError, TypeError) as e: self.s...
[ "def", "run", "(", "self", ")", ":", "while", "True", ":", "req", "=", "self", ".", "socket", ".", "recv_json", "(", ")", "try", ":", "answer", "=", "self", ".", "handle_request", "(", "req", ")", "self", ".", "socket", ".", "send", "(", "json", ...
https://github.com/poppy-project/pypot/blob/c5d384fe23eef9f6ec98467f6f76626cdf20afb9/pypot/server/zmqserver.py#L26-L36
OneDrive/onedrive-sdk-python
e5642f8cad8eea37a4f653c1a23dfcfc06c37110
src/onedrivesdk/model/children_collection_page.py
python
ChildrenCollectionPage.__getitem__
(self, index)
return Item(self._prop_list[index])
Get the Item at the index specified Args: index (int): The index of the item to get from the ChildrenCollectionPage Returns: :class:`Item<onedrivesdk.model.item.Item>`: The Item at the index
Get the Item at the index specified Args: index (int): The index of the item to get from the ChildrenCollectionPage
[ "Get", "the", "Item", "at", "the", "index", "specified", "Args", ":", "index", "(", "int", ")", ":", "The", "index", "of", "the", "item", "to", "get", "from", "the", "ChildrenCollectionPage" ]
def __getitem__(self, index): """Get the Item at the index specified Args: index (int): The index of the item to get from the ChildrenCollectionPage Returns: :class:`Item<onedrivesdk.model.item.Item>`: The Item at the index """ re...
[ "def", "__getitem__", "(", "self", ",", "index", ")", ":", "return", "Item", "(", "self", ".", "_prop_list", "[", "index", "]", ")" ]
https://github.com/OneDrive/onedrive-sdk-python/blob/e5642f8cad8eea37a4f653c1a23dfcfc06c37110/src/onedrivesdk/model/children_collection_page.py#L15-L25
pyqt/examples
843bb982917cecb2350b5f6d7f42c9b7fb142ec1
src/pyqt-official/dialogs/classwizard/classwizard.py
python
OutputFilesPage.initializePage
(self)
[]
def initializePage(self): className = self.field('className') self.headerLineEdit.setText(className.lower() + '.h') self.implementationLineEdit.setText(className.lower() + '.cpp') self.outputDirLineEdit.setText(QDir.toNativeSeparators(QDir.tempPath()))
[ "def", "initializePage", "(", "self", ")", ":", "className", "=", "self", ".", "field", "(", "'className'", ")", "self", ".", "headerLineEdit", ".", "setText", "(", "className", ".", "lower", "(", ")", "+", "'.h'", ")", "self", ".", "implementationLineEdit...
https://github.com/pyqt/examples/blob/843bb982917cecb2350b5f6d7f42c9b7fb142ec1/src/pyqt-official/dialogs/classwizard/classwizard.py#L368-L372
bitcoin-abe/bitcoin-abe
33513dc8025cb08df85fc6bf41fa35eb9daa1a33
Abe/abe.py
python
Abe.search_general
(abe, q)
return ret
Search for something that is not an address, hash, or block number. Currently, this is limited to chain names and currency codes.
Search for something that is not an address, hash, or block number. Currently, this is limited to chain names and currency codes.
[ "Search", "for", "something", "that", "is", "not", "an", "address", "hash", "or", "block", "number", ".", "Currently", "this", "is", "limited", "to", "chain", "names", "and", "currency", "codes", "." ]
def search_general(abe, q): """Search for something that is not an address, hash, or block number. Currently, this is limited to chain names and currency codes.""" def process(row): (name, code3) = row return { 'name': name + ' (' + code3 + ')', 'uri'...
[ "def", "search_general", "(", "abe", ",", "q", ")", ":", "def", "process", "(", "row", ")", ":", "(", "name", ",", "code3", ")", "=", "row", "return", "{", "'name'", ":", "name", "+", "' ('", "+", "code3", "+", "')'", ",", "'uri'", ":", "'chain/'...
https://github.com/bitcoin-abe/bitcoin-abe/blob/33513dc8025cb08df85fc6bf41fa35eb9daa1a33/Abe/abe.py#L1109-L1122
qiucheng025/zao-
3a5edf3607b3a523f95746bc69b688090c76d89a
plugins/convert/mask/mask_blend.py
python
Mask.get_erosion_kernel
(self, mask)
return erosion_kernel
Get the erosion kernel
Get the erosion kernel
[ "Get", "the", "erosion", "kernel" ]
def get_erosion_kernel(self, mask): """ Get the erosion kernel """ erosion_ratio = self.config["erosion"] / 100 mask_radius = np.sqrt(np.sum(mask)) / 2 kernel_size = max(1, int(abs(erosion_ratio * mask_radius))) erosion_kernel = cv2.getStructuringElement( # pylint: disable=no-me...
[ "def", "get_erosion_kernel", "(", "self", ",", "mask", ")", ":", "erosion_ratio", "=", "self", ".", "config", "[", "\"erosion\"", "]", "/", "100", "mask_radius", "=", "np", ".", "sqrt", "(", "np", ".", "sum", "(", "mask", ")", ")", "/", "2", "kernel_...
https://github.com/qiucheng025/zao-/blob/3a5edf3607b3a523f95746bc69b688090c76d89a/plugins/convert/mask/mask_blend.py#L57-L66
seppius-xbmc-repo/ru
d0879d56ec8243b2c7af44fda5cf3d1ff77fd2e2
script.module.simple.downloader/lib/DialogDownloadProgress.py
python
Window.setupWindow
(self)
[]
def setupWindow(self): error = 0 # get the id for the current 'active' window as an integer. # http://wiki.xbmc.org/index.php?title=Window_IDs try: currentWindowId = xbmcgui.getCurrentWindowId() except: currentWindowId = self.window if hasattr(cur...
[ "def", "setupWindow", "(", "self", ")", ":", "error", "=", "0", "# get the id for the current 'active' window as an integer.", "# http://wiki.xbmc.org/index.php?title=Window_IDs", "try", ":", "currentWindowId", "=", "xbmcgui", ".", "getCurrentWindowId", "(", ")", "except", ...
https://github.com/seppius-xbmc-repo/ru/blob/d0879d56ec8243b2c7af44fda5cf3d1ff77fd2e2/script.module.simple.downloader/lib/DialogDownloadProgress.py#L204-L223
21dotco/two1-python
4e833300fd5a58363e3104ed4c097631e5d296d3
two1/sell/util/cli_helpers.py
python
get_earnings
(services)
return { service: get_earning(service, db) for service in services }
Gets earnings of given services.
Gets earnings of given services.
[ "Gets", "earnings", "of", "given", "services", "." ]
def get_earnings(services): """ Gets earnings of given services. """ db = Two1SellDB() return { service: get_earning(service, db) for service in services }
[ "def", "get_earnings", "(", "services", ")", ":", "db", "=", "Two1SellDB", "(", ")", "return", "{", "service", ":", "get_earning", "(", "service", ",", "db", ")", "for", "service", "in", "services", "}" ]
https://github.com/21dotco/two1-python/blob/4e833300fd5a58363e3104ed4c097631e5d296d3/two1/sell/util/cli_helpers.py#L483-L489
BangLiu/ArticlePairMatching
51745af80e093391f668477d8d00ae59a0481d6f
src/models/CCIG/data/ccig.py
python
draw_ccig
(g, fig_name)
Draw ccig to a file. :param g: concept community interaction graph. :param fig_name: output figure file.
Draw ccig to a file. :param g: concept community interaction graph. :param fig_name: output figure file.
[ "Draw", "ccig", "to", "a", "file", ".", ":", "param", "g", ":", "concept", "community", "interaction", "graph", ".", ":", "param", "fig_name", ":", "output", "figure", "file", "." ]
def draw_ccig(g, fig_name): """ Draw ccig to a file. :param g: concept community interaction graph. :param fig_name: output figure file. """ c = label_components(g)[0] pos = sfdp_layout(g) graph_draw(g, pos=pos, vertex_text=g.vertex_properties["name"], verte...
[ "def", "draw_ccig", "(", "g", ",", "fig_name", ")", ":", "c", "=", "label_components", "(", "g", ")", "[", "0", "]", "pos", "=", "sfdp_layout", "(", "g", ")", "graph_draw", "(", "g", ",", "pos", "=", "pos", ",", "vertex_text", "=", "g", ".", "ver...
https://github.com/BangLiu/ArticlePairMatching/blob/51745af80e093391f668477d8d00ae59a0481d6f/src/models/CCIG/data/ccig.py#L23-L40
hexway/r00kie-kr00kie
c2712c4a15d7a5b8bfeeec0b9aebf7e852fde895
r00kie-kr00kie.py
python
ThreadManager.__init__
(self, thread_count)
The constructor for the ThreadManager class :param thread_count: Maximum capacity of thread queue
The constructor for the ThreadManager class :param thread_count: Maximum capacity of thread queue
[ "The", "constructor", "for", "the", "ThreadManager", "class", ":", "param", "thread_count", ":", "Maximum", "capacity", "of", "thread", "queue" ]
def __init__(self, thread_count): """ The constructor for the ThreadManager class :param thread_count: Maximum capacity of thread queue """ self._thread_count = thread_count self._threads = Queue(maxsize=self._thread_count) for _ in range(self._thread_count): ...
[ "def", "__init__", "(", "self", ",", "thread_count", ")", ":", "self", ".", "_thread_count", "=", "thread_count", "self", ".", "_threads", "=", "Queue", "(", "maxsize", "=", "self", ".", "_thread_count", ")", "for", "_", "in", "range", "(", "self", ".", ...
https://github.com/hexway/r00kie-kr00kie/blob/c2712c4a15d7a5b8bfeeec0b9aebf7e852fde895/r00kie-kr00kie.py#L55-L65
rwth-i6/returnn
f2d718a197a280b0d5f0fd91a7fcb8658560dddb
returnn/tf/layers/basic.py
python
SwapAxesLayer._translate_axis
(cls, axis_to_translate, axis1, axis2)
return axis_to_translate
:param int|None axis_to_translate: :param int axis1: :param int axis2: :return: new axis :rtype: int|None
:param int|None axis_to_translate: :param int axis1: :param int axis2: :return: new axis :rtype: int|None
[ ":", "param", "int|None", "axis_to_translate", ":", ":", "param", "int", "axis1", ":", ":", "param", "int", "axis2", ":", ":", "return", ":", "new", "axis", ":", "rtype", ":", "int|None" ]
def _translate_axis(cls, axis_to_translate, axis1, axis2): """ :param int|None axis_to_translate: :param int axis1: :param int axis2: :return: new axis :rtype: int|None """ if axis_to_translate == axis1: return axis2 if axis_to_translate == axis2: return axis1 return ...
[ "def", "_translate_axis", "(", "cls", ",", "axis_to_translate", ",", "axis1", ",", "axis2", ")", ":", "if", "axis_to_translate", "==", "axis1", ":", "return", "axis2", "if", "axis_to_translate", "==", "axis2", ":", "return", "axis1", "return", "axis_to_translate...
https://github.com/rwth-i6/returnn/blob/f2d718a197a280b0d5f0fd91a7fcb8658560dddb/returnn/tf/layers/basic.py#L4091-L4103
DataDog/integrations-core
934674b29d94b70ccc008f76ea172d0cdae05e1e
nginx/datadog_checks/nginx/nginx.py
python
Nginx._get_all_plus_api_endpoints
(self)
return endpoints
Returns endpoints that the integration supports collecting metrics from based on the Plus API version
Returns endpoints that the integration supports collecting metrics from based on the Plus API version
[ "Returns", "endpoints", "that", "the", "integration", "supports", "collecting", "metrics", "from", "based", "on", "the", "Plus", "API", "version" ]
def _get_all_plus_api_endpoints(self): """ Returns endpoints that the integration supports collecting metrics from based on the Plus API version """ endpoints = self._get_plus_api_endpoints() if self.use_plus_api_stream: endpoints = chain(endpoints, self._get_plus_ap...
[ "def", "_get_all_plus_api_endpoints", "(", "self", ")", ":", "endpoints", "=", "self", ".", "_get_plus_api_endpoints", "(", ")", "if", "self", ".", "use_plus_api_stream", ":", "endpoints", "=", "chain", "(", "endpoints", ",", "self", ".", "_get_plus_api_endpoints"...
https://github.com/DataDog/integrations-core/blob/934674b29d94b70ccc008f76ea172d0cdae05e1e/nginx/datadog_checks/nginx/nginx.py#L264-L273
theotherp/nzbhydra
4b03d7f769384b97dfc60dade4806c0fc987514e
libs/mailbox.py
python
Maildir._lookup
(self, key)
Use TOC to return subpath for given key, or raise a KeyError.
Use TOC to return subpath for given key, or raise a KeyError.
[ "Use", "TOC", "to", "return", "subpath", "for", "given", "key", "or", "raise", "a", "KeyError", "." ]
def _lookup(self, key): """Use TOC to return subpath for given key, or raise a KeyError.""" try: if os.path.exists(os.path.join(self._path, self._toc[key])): return self._toc[key] except KeyError: pass self._refresh() try: retur...
[ "def", "_lookup", "(", "self", ",", "key", ")", ":", "try", ":", "if", "os", ".", "path", ".", "exists", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_path", ",", "self", ".", "_toc", "[", "key", "]", ")", ")", ":", "return", "self...
https://github.com/theotherp/nzbhydra/blob/4b03d7f769384b97dfc60dade4806c0fc987514e/libs/mailbox.py#L537-L548
PySimpleGUI/PySimpleGUI
6c0d1fb54f493d45e90180b322fbbe70f7a5af3c
DemoPrograms/Demo_Pong.py
python
check_ball_exit
(ball: Ball, scores: Scores)
[]
def check_ball_exit(ball: Ball, scores: Scores): if ball.current_x <= 0: scores.increment_player_2() ball.restart() if ball.current_x >= GAMEPLAY_SIZE[0]: scores.increment_player_1() ball.restart()
[ "def", "check_ball_exit", "(", "ball", ":", "Ball", ",", "scores", ":", "Scores", ")", ":", "if", "ball", ".", "current_x", "<=", "0", ":", "scores", ".", "increment_player_2", "(", ")", "ball", ".", "restart", "(", ")", "if", "ball", ".", "current_x",...
https://github.com/PySimpleGUI/PySimpleGUI/blob/6c0d1fb54f493d45e90180b322fbbe70f7a5af3c/DemoPrograms/Demo_Pong.py#L181-L187
wwqgtxx/wwqLyParse
33136508e52821babd9294fdecffbdf02d73a6fc
wwqLyParse/lib/python-3.7.2-embed-win32/Crypto/Cipher/_mode_eax.py
python
EaxMode.hexverify
(self, hex_mac_tag)
Validate the *printable* MAC tag. This method is like `verify`. :Parameters: hex_mac_tag : string This is the *printable* MAC, as received from the sender. :Raises MacMismatchError: if the MAC does not match. The message has been tampered with or t...
Validate the *printable* MAC tag.
[ "Validate", "the", "*", "printable", "*", "MAC", "tag", "." ]
def hexverify(self, hex_mac_tag): """Validate the *printable* MAC tag. This method is like `verify`. :Parameters: hex_mac_tag : string This is the *printable* MAC, as received from the sender. :Raises MacMismatchError: if the MAC does not match. The me...
[ "def", "hexverify", "(", "self", ",", "hex_mac_tag", ")", ":", "self", ".", "verify", "(", "unhexlify", "(", "hex_mac_tag", ")", ")" ]
https://github.com/wwqgtxx/wwqLyParse/blob/33136508e52821babd9294fdecffbdf02d73a6fc/wwqLyParse/lib/python-3.7.2-embed-win32/Crypto/Cipher/_mode_eax.py#L295-L308
raiden-network/raiden
76c68b426a6f81f173b9a2c09bd88a610502c38b
tools/debugging/json-log-to-html.py
python
truncate_logger_name
(logger: str)
return ".".join(chain((part[0] for part in logger_path.split(".")), [logger_module]))
Truncate dotted logger path names. Keeps the last component unchanged. >>> truncate_logger_name("some.logger.name") s.l.name >>> truncate_logger_name("name") name
Truncate dotted logger path names.
[ "Truncate", "dotted", "logger", "path", "names", "." ]
def truncate_logger_name(logger: str) -> str: """Truncate dotted logger path names. Keeps the last component unchanged. >>> truncate_logger_name("some.logger.name") s.l.name >>> truncate_logger_name("name") name """ if "." not in logger: return logger logger_path, _, logge...
[ "def", "truncate_logger_name", "(", "logger", ":", "str", ")", "->", "str", ":", "if", "\".\"", "not", "in", "logger", ":", "return", "logger", "logger_path", ",", "_", ",", "logger_module", "=", "logger", ".", "rpartition", "(", "\".\"", ")", "return", ...
https://github.com/raiden-network/raiden/blob/76c68b426a6f81f173b9a2c09bd88a610502c38b/tools/debugging/json-log-to-html.py#L424-L438
omz/PythonistaAppTemplate
f560f93f8876d82a21d108977f90583df08d55af
PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/numpy/ma/core.py
python
masked_not_equal
(x, value, copy=True)
return masked_where(not_equal(x, value), x, copy=copy)
Mask an array where `not` equal to a given value. This function is a shortcut to ``masked_where``, with `condition` = (x != value). See Also -------- masked_where : Mask where a condition is met. Examples -------- >>> import numpy.ma as ma >>> a = np.arange(4) >>> a array(...
Mask an array where `not` equal to a given value.
[ "Mask", "an", "array", "where", "not", "equal", "to", "a", "given", "value", "." ]
def masked_not_equal(x, value, copy=True): """ Mask an array where `not` equal to a given value. This function is a shortcut to ``masked_where``, with `condition` = (x != value). See Also -------- masked_where : Mask where a condition is met. Examples -------- >>> import numpy...
[ "def", "masked_not_equal", "(", "x", ",", "value", ",", "copy", "=", "True", ")", ":", "return", "masked_where", "(", "not_equal", "(", "x", ",", "value", ")", ",", "x", ",", "copy", "=", "copy", ")" ]
https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/numpy/ma/core.py#L1922-L1945
evennia/evennia
fa79110ba6b219932f22297838e8ac72ebc0be0e
evennia/commands/default/system.py
python
CmdObjects.func
(self)
Implement the command
Implement the command
[ "Implement", "the", "command" ]
def func(self): """Implement the command""" caller = self.caller nlim = int(self.args) if self.args and self.args.isdigit() else 10 nobjs = ObjectDB.objects.count() Character = class_from_module(settings.BASE_CHARACTER_TYPECLASS) nchars = Character.objects.all_family().c...
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "nlim", "=", "int", "(", "self", ".", "args", ")", "if", "self", ".", "args", "and", "self", ".", "args", ".", "isdigit", "(", ")", "else", "10", "nobjs", "=", "ObjectDB"...
https://github.com/evennia/evennia/blob/fa79110ba6b219932f22297838e8ac72ebc0be0e/evennia/commands/default/system.py#L595-L662
scipy/scipy
e0a749f01e79046642ccfdc419edbf9e7ca141ad
scipy/stats/_ksstats.py
python
_select_and_clip_prob
(cdfprob, sfprob, cdf=True)
return _clip_prob(p)
Selects either the CDF or SF, and then clips to range 0<=p<=1.
Selects either the CDF or SF, and then clips to range 0<=p<=1.
[ "Selects", "either", "the", "CDF", "or", "SF", "and", "then", "clips", "to", "range", "0<", "=", "p<", "=", "1", "." ]
def _select_and_clip_prob(cdfprob, sfprob, cdf=True): """Selects either the CDF or SF, and then clips to range 0<=p<=1.""" p = np.where(cdf, cdfprob, sfprob) return _clip_prob(p)
[ "def", "_select_and_clip_prob", "(", "cdfprob", ",", "sfprob", ",", "cdf", "=", "True", ")", ":", "p", "=", "np", ".", "where", "(", "cdf", ",", "cdfprob", ",", "sfprob", ")", "return", "_clip_prob", "(", "p", ")" ]
https://github.com/scipy/scipy/blob/e0a749f01e79046642ccfdc419edbf9e7ca141ad/scipy/stats/_ksstats.py#L107-L110
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/benchmarks/src/benchmarks/sympy/sympy/polys/specialpolys.py
python
_f_2
()
return x**5*y**3 + x**5*y**2*z + x**5*y*z**2 + x**5*z**3 + x**3*y**2 + x**3*y*z + 90*x**3*y + 90*x**3*z + x**2*y**2*z - 11*x**2*y**2 + x**2*z**3 - 11*x**2*z**2 + y*z - 11*y + 90*z - 990
[]
def _f_2(): R, x, y, z = ring("x,y,z", ZZ) return x**5*y**3 + x**5*y**2*z + x**5*y*z**2 + x**5*z**3 + x**3*y**2 + x**3*y*z + 90*x**3*y + 90*x**3*z + x**2*y**2*z - 11*x**2*y**2 + x**2*z**3 - 11*x**2*z**2 + y*z - 11*y + 90*z - 990
[ "def", "_f_2", "(", ")", ":", "R", ",", "x", ",", "y", ",", "z", "=", "ring", "(", "\"x,y,z\"", ",", "ZZ", ")", "return", "x", "**", "5", "*", "y", "**", "3", "+", "x", "**", "5", "*", "y", "**", "2", "*", "z", "+", "x", "**", "5", "*...
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/polys/specialpolys.py#L278-L280
spyder-ide/spyder
55da47c032dfcf519600f67f8b30eab467f965e7
spyder/plugins/appearance/widgets.py
python
SchemeEditor.get_edited_color_scheme
(self)
return color_scheme
Get the values of the last edited color scheme to be used in an instant preview in the preview editor, without using `apply`.
Get the values of the last edited color scheme to be used in an instant preview in the preview editor, without using `apply`.
[ "Get", "the", "values", "of", "the", "last", "edited", "color", "scheme", "to", "be", "used", "in", "an", "instant", "preview", "in", "the", "preview", "editor", "without", "using", "apply", "." ]
def get_edited_color_scheme(self): """ Get the values of the last edited color scheme to be used in an instant preview in the preview editor, without using `apply`. """ color_scheme = {} scheme_name = self.last_used_scheme for key in self.widgets[scheme_name]: ...
[ "def", "get_edited_color_scheme", "(", "self", ")", ":", "color_scheme", "=", "{", "}", "scheme_name", "=", "self", ".", "last_used_scheme", "for", "key", "in", "self", ".", "widgets", "[", "scheme_name", "]", ":", "items", "=", "self", ".", "widgets", "["...
https://github.com/spyder-ide/spyder/blob/55da47c032dfcf519600f67f8b30eab467f965e7/spyder/plugins/appearance/widgets.py#L63-L84
cms-dev/cms
0401c5336b34b1731736045da4877fef11889274
cms/grading/languages/java_jdk.py
python
JavaJDK.get_evaluation_commands
( self, executable_filename, main=None, args=None)
See Language.get_evaluation_commands.
See Language.get_evaluation_commands.
[ "See", "Language", ".", "get_evaluation_commands", "." ]
def get_evaluation_commands( self, executable_filename, main=None, args=None): """See Language.get_evaluation_commands.""" args = args if args is not None else [] if JavaJDK.USE_JAR: # executable_filename is a jar file, main is the name of # the main java clas...
[ "def", "get_evaluation_commands", "(", "self", ",", "executable_filename", ",", "main", "=", "None", ",", "args", "=", "None", ")", ":", "args", "=", "args", "if", "args", "is", "not", "None", "else", "[", "]", "if", "JavaJDK", ".", "USE_JAR", ":", "# ...
https://github.com/cms-dev/cms/blob/0401c5336b34b1731736045da4877fef11889274/cms/grading/languages/java_jdk.py#L80-L93
certbot/certbot
30b066f08260b73fc26256b5484a180468b9d0a6
certbot/certbot/compat/os.py
python
access
(*unused_args, **unused_kwargs)
Method os.access() is forbidden
Method os.access() is forbidden
[ "Method", "os", ".", "access", "()", "is", "forbidden" ]
def access(*unused_args, **unused_kwargs): # type: ignore """Method os.access() is forbidden""" raise RuntimeError('Usage of os.access() is forbidden. ' 'Use certbot.compat.filesystem.check_mode() or ' 'certbot.compat.filesystem.is_executable() instead.')
[ "def", "access", "(", "*", "unused_args", ",", "*", "*", "unused_kwargs", ")", ":", "# type: ignore", "raise", "RuntimeError", "(", "'Usage of os.access() is forbidden. '", "'Use certbot.compat.filesystem.check_mode() or '", "'certbot.compat.filesystem.is_executable() instead.'", ...
https://github.com/certbot/certbot/blob/30b066f08260b73fc26256b5484a180468b9d0a6/certbot/certbot/compat/os.py#L139-L143
spesmilo/electrum
bdbd59300fbd35b01605e66145458e5f396108e8
electrum/transaction.py
python
PartialTransaction.to_json
(self)
return d
[]
def to_json(self) -> dict: d = super().to_json() d.update({ 'xpubs': {bip32node.to_xpub(): (xfp.hex(), bip32.convert_bip32_intpath_to_strpath(path)) for bip32node, (xfp, path) in self.xpubs.items()}, 'unknown_psbt_fields': {key.hex(): val.hex() for key, val ...
[ "def", "to_json", "(", "self", ")", "->", "dict", ":", "d", "=", "super", "(", ")", ".", "to_json", "(", ")", "d", ".", "update", "(", "{", "'xpubs'", ":", "{", "bip32node", ".", "to_xpub", "(", ")", ":", "(", "xfp", ".", "hex", "(", ")", ","...
https://github.com/spesmilo/electrum/blob/bdbd59300fbd35b01605e66145458e5f396108e8/electrum/transaction.py#L1657-L1664
Marsan-Ma-zz/tf_chatbot_seq2seq_antilm
145e78903b245050c3c31e9a162db8a54e1e91fe
ref/seq2seq.py
python
rnn_decoder
(decoder_inputs, initial_state, cell, loop_function=None, scope=None)
return outputs, state
RNN decoder for the sequence-to-sequence model. Args: decoder_inputs: A list of 2D Tensors [batch_size x input_size]. initial_state: 2D Tensor with shape [batch_size x cell.state_size]. cell: core_rnn_cell.RNNCell defining the cell function and size. loop_function: If not None, this function will be ...
RNN decoder for the sequence-to-sequence model.
[ "RNN", "decoder", "for", "the", "sequence", "-", "to", "-", "sequence", "model", "." ]
def rnn_decoder(decoder_inputs, initial_state, cell, loop_function=None, scope=None): """RNN decoder for the sequence-to-sequence model. Args: decoder_inputs: A list of 2D Tensors [batch_size x input_size]. initial_state: 2D Tensor with shape ...
[ "def", "rnn_decoder", "(", "decoder_inputs", ",", "initial_state", ",", "cell", ",", "loop_function", "=", "None", ",", "scope", "=", "None", ")", ":", "with", "variable_scope", ".", "variable_scope", "(", "scope", "or", "\"rnn_decoder\"", ")", ":", "state", ...
https://github.com/Marsan-Ma-zz/tf_chatbot_seq2seq_antilm/blob/145e78903b245050c3c31e9a162db8a54e1e91fe/ref/seq2seq.py#L112-L156
PyCQA/pylint
3fc855f9d0fa8e6410be5a23cf954ffd5471b4eb
pylint/checkers/similar.py
python
Similar._find_common
( self, lineset1: "LineSet", lineset2: "LineSet" )
Find similarities in the two given linesets. This the core of the algorithm. The idea is to compute the hashes of a minimal number of successive lines of each lineset and then compare the hashes. Every match of such comparison is stored in a dict that links the couple of starting indices in bot...
Find similarities in the two given linesets.
[ "Find", "similarities", "in", "the", "two", "given", "linesets", "." ]
def _find_common( self, lineset1: "LineSet", lineset2: "LineSet" ) -> Generator[Commonality, None, None]: """Find similarities in the two given linesets. This the core of the algorithm. The idea is to compute the hashes of a minimal number of successive lines of each lineset and the...
[ "def", "_find_common", "(", "self", ",", "lineset1", ":", "\"LineSet\"", ",", "lineset2", ":", "\"LineSet\"", ")", "->", "Generator", "[", "Commonality", ",", "None", ",", "None", "]", ":", "hash_to_index_1", ":", "HashToIndex_T", "hash_to_index_2", ":", "Hash...
https://github.com/PyCQA/pylint/blob/3fc855f9d0fa8e6410be5a23cf954ffd5471b4eb/pylint/checkers/similar.py#L468-L534
microsoft/DiscoFaceGAN
0530bd1c4e716a2cc4d99e8b12dbb269b23943d9
dnnlib/submission/run_context.py
python
RunContext.get_last_update_interval
(self)
return self.last_update_interval
How much time passed between the previous two calls to update.
How much time passed between the previous two calls to update.
[ "How", "much", "time", "passed", "between", "the", "previous", "two", "calls", "to", "update", "." ]
def get_last_update_interval(self) -> float: """How much time passed between the previous two calls to update.""" return self.last_update_interval
[ "def", "get_last_update_interval", "(", "self", ")", "->", "float", ":", "return", "self", ".", "last_update_interval" ]
https://github.com/microsoft/DiscoFaceGAN/blob/0530bd1c4e716a2cc4d99e8b12dbb269b23943d9/dnnlib/submission/run_context.py#L86-L88
sfu-db/dataprep
6dfb9c659e8bf73f07978ae195d0372495c6f118
dataprep/eda/missing/__init__.py
python
plot_missing
( df: Union[pd.DataFrame, dd.DataFrame], col1: Optional[str] = None, col2: Optional[str] = None, *, config: Optional[Dict[str, Any]] = None, display: Optional[List[str]] = None, dtype: Optional[DTypeDef] = None, progress: bool = True, )
return Container(to_render, itmdt.visual_type, cfg)
This function is designed to deal with missing values There are three functions: plot_missing(df), plot_missing(df, x) plot_missing(df, x, y) Parameters ---------- df the pandas data_frame for which plots are calculated for each column. col1 a valid column name of the data frame...
This function is designed to deal with missing values There are three functions: plot_missing(df), plot_missing(df, x) plot_missing(df, x, y)
[ "This", "function", "is", "designed", "to", "deal", "with", "missing", "values", "There", "are", "three", "functions", ":", "plot_missing", "(", "df", ")", "plot_missing", "(", "df", "x", ")", "plot_missing", "(", "df", "x", "y", ")" ]
def plot_missing( df: Union[pd.DataFrame, dd.DataFrame], col1: Optional[str] = None, col2: Optional[str] = None, *, config: Optional[Dict[str, Any]] = None, display: Optional[List[str]] = None, dtype: Optional[DTypeDef] = None, progress: bool = True, ) -> Container: """ This func...
[ "def", "plot_missing", "(", "df", ":", "Union", "[", "pd", ".", "DataFrame", ",", "dd", ".", "DataFrame", "]", ",", "col1", ":", "Optional", "[", "str", "]", "=", "None", ",", "col2", ":", "Optional", "[", "str", "]", "=", "None", ",", "*", ",", ...
https://github.com/sfu-db/dataprep/blob/6dfb9c659e8bf73f07978ae195d0372495c6f118/dataprep/eda/missing/__init__.py#L20-L72
kuri65536/python-for-android
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
python-modules/twisted/twisted/internet/cfreactor.py
python
CFReactor._scheduleSimulate
(self, force=False)
Schedule a call to C{self.runUntilCurrent}. This will cancel the currently scheduled call if it is already scheduled. @param force: Even if there are no timed calls, make sure that C{runUntilCurrent} runs immediately (in a 0-seconds-from-now {CFRunLoopTimer}). This is necessar...
Schedule a call to C{self.runUntilCurrent}. This will cancel the currently scheduled call if it is already scheduled.
[ "Schedule", "a", "call", "to", "C", "{", "self", ".", "runUntilCurrent", "}", ".", "This", "will", "cancel", "the", "currently", "scheduled", "call", "if", "it", "is", "already", "scheduled", "." ]
def _scheduleSimulate(self, force=False): """ Schedule a call to C{self.runUntilCurrent}. This will cancel the currently scheduled call if it is already scheduled. @param force: Even if there are no timed calls, make sure that C{runUntilCurrent} runs immediately (in a 0-sec...
[ "def", "_scheduleSimulate", "(", "self", ",", "force", "=", "False", ")", ":", "if", "self", ".", "_currentSimulator", "is", "not", "None", ":", "CFRunLoopTimerInvalidate", "(", "self", ".", "_currentSimulator", ")", "self", ".", "_currentSimulator", "=", "Non...
https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python-modules/twisted/twisted/internet/cfreactor.py#L390-L420
chribsen/simple-machine-learning-examples
dc94e52a4cebdc8bb959ff88b81ff8cfeca25022
venv/lib/python2.7/site-packages/pandas/tseries/util.py
python
isleapyear
(year)
return np.logical_or(year % 400 == 0, np.logical_and(year % 4 == 0, year % 100 > 0))
Returns true if year is a leap year. Parameters ---------- year : integer / sequence A given (list of) year(s).
Returns true if year is a leap year.
[ "Returns", "true", "if", "year", "is", "a", "leap", "year", "." ]
def isleapyear(year): """ Returns true if year is a leap year. Parameters ---------- year : integer / sequence A given (list of) year(s). """ msg = "isleapyear is deprecated. Use .is_leap_year property instead" warnings.warn(msg, FutureWarning) year = np.asarray(year) ...
[ "def", "isleapyear", "(", "year", ")", ":", "msg", "=", "\"isleapyear is deprecated. Use .is_leap_year property instead\"", "warnings", ".", "warn", "(", "msg", ",", "FutureWarning", ")", "year", "=", "np", ".", "asarray", "(", "year", ")", "return", "np", ".", ...
https://github.com/chribsen/simple-machine-learning-examples/blob/dc94e52a4cebdc8bb959ff88b81ff8cfeca25022/venv/lib/python2.7/site-packages/pandas/tseries/util.py#L89-L104
plotly/plotly.py
cfad7862594b35965c0e000813bd7805e8494a5b
packages/python/plotly/plotly/graph_objs/scatter3d/_projection.py
python
Projection.__init__
(self, arg=None, x=None, y=None, z=None, **kwargs)
Construct a new Projection object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scatter3d.Projection` x :class:`plotly.graph_objects.scatter3d.projection.X...
Construct a new Projection object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scatter3d.Projection` x :class:`plotly.graph_objects.scatter3d.projection.X...
[ "Construct", "a", "new", "Projection", "object", "Parameters", "----------", "arg", "dict", "of", "properties", "compatible", "with", "this", "constructor", "or", "an", "instance", "of", ":", "class", ":", "plotly", ".", "graph_objs", ".", "scatter3d", ".", "P...
def __init__(self, arg=None, x=None, y=None, z=None, **kwargs): """ Construct a new Projection object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scatter3d.P...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "x", "=", "None", ",", "y", "=", "None", ",", "z", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Projection", ",", "self", ")", ".", "__init__", "(", "\"projection\"",...
https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/scatter3d/_projection.py#L125-L197
neilagabriel/vim-geeknote
7f040f655bc5a8f98185c1e161bd4cba977f5664
plugin/explorer.py
python
getNode
(key)
return None
[]
def getNode(key): if key in registry: return registry[key] return None
[ "def", "getNode", "(", "key", ")", ":", "if", "key", "in", "registry", ":", "return", "registry", "[", "key", "]", "return", "None" ]
https://github.com/neilagabriel/vim-geeknote/blob/7f040f655bc5a8f98185c1e161bd4cba977f5664/plugin/explorer.py#L55-L58
zeromq/pyzmq
29aded1bf017385866dcbf7b92a954f272360060
zmq/devices/basedevice.py
python
Device.start
(self)
return self.run()
Start the device. Override me in subclass for other launchers.
Start the device. Override me in subclass for other launchers.
[ "Start", "the", "device", ".", "Override", "me", "in", "subclass", "for", "other", "launchers", "." ]
def start(self) -> None: """Start the device. Override me in subclass for other launchers.""" return self.run()
[ "def", "start", "(", "self", ")", "->", "None", ":", "return", "self", ".", "run", "(", ")" ]
https://github.com/zeromq/pyzmq/blob/29aded1bf017385866dcbf7b92a954f272360060/zmq/devices/basedevice.py#L250-L252
dropbox/dropbox-sdk-python
015437429be224732990041164a21a0501235db1
dropbox/files.py
python
DownloadZipError.is_other
(self)
return self._tag == 'other'
Check if the union tag is ``other``. :rtype: bool
Check if the union tag is ``other``.
[ "Check", "if", "the", "union", "tag", "is", "other", "." ]
def is_other(self): """ Check if the union tag is ``other``. :rtype: bool """ return self._tag == 'other'
[ "def", "is_other", "(", "self", ")", ":", "return", "self", ".", "_tag", "==", "'other'" ]
https://github.com/dropbox/dropbox-sdk-python/blob/015437429be224732990041164a21a0501235db1/dropbox/files.py#L1853-L1859
ViRb3/apk-utilities
818f0f455e4cb549896375bed0eada5c0d211651
bin/enjarify/jvm/writeclass.py
python
classFileAfterPool
(cls, opts)
return pool, stream
[]
def classFileAfterPool(cls, opts): stream = Writer() if opts.split_pool: pool = constantpool.SplitConstantPool() else: pool = constantpool.SimpleConstantPool() cls.parseData() access = cls.access & flags.CLASS_FLAGS if not access & flags.ACC_INTERFACE: # Not necessary fo...
[ "def", "classFileAfterPool", "(", "cls", ",", "opts", ")", ":", "stream", "=", "Writer", "(", ")", "if", "opts", ".", "split_pool", ":", "pool", "=", "constantpool", ".", "SplitConstantPool", "(", ")", "else", ":", "pool", "=", "constantpool", ".", "Simp...
https://github.com/ViRb3/apk-utilities/blob/818f0f455e4cb549896375bed0eada5c0d211651/bin/enjarify/jvm/writeclass.py#L71-L104
cloudera/impyla
0c736af4cad2bade9b8e313badc08ec50e81c948
impala/_thrift_gen/fb303/FacebookService.py
python
Client.setOption
(self, key, value)
Sets an option Parameters: - key - value
Sets an option
[ "Sets", "an", "option" ]
def setOption(self, key, value): """ Sets an option Parameters: - key - value """ self.send_setOption(key, value) self.recv_setOption()
[ "def", "setOption", "(", "self", ",", "key", ",", "value", ")", ":", "self", ".", "send_setOption", "(", "key", ",", "value", ")", "self", ".", "recv_setOption", "(", ")" ]
https://github.com/cloudera/impyla/blob/0c736af4cad2bade9b8e313badc08ec50e81c948/impala/_thrift_gen/fb303/FacebookService.py#L307-L316
aws-samples/aws-kube-codesuite
ab4e5ce45416b83bffb947ab8d234df5437f4fca
src/kubernetes/client/apis/core_v1_api.py
python
CoreV1Api.patch_namespaced_service_with_http_info
(self, name, namespace, body, **kwargs)
return self.api_client.call_api(resource_path, 'PATCH', path_params, query_params, header_params, body=body_params, post...
partially update the specified Service This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) ...
partially update the specified Service This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) ...
[ "partially", "update", "the", "specified", "Service", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a", "callback", "function", "to", "be", "i...
def patch_namespaced_service_with_http_info(self, name, namespace, body, **kwargs): """ partially update the specified Service This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when rec...
[ "def", "patch_namespaced_service_with_http_info", "(", "self", ",", "name", ",", "namespace", ",", "body", ",", "*", "*", "kwargs", ")", ":", "all_params", "=", "[", "'name'", ",", "'namespace'", ",", "'body'", ",", "'pretty'", "]", "all_params", ".", "appen...
https://github.com/aws-samples/aws-kube-codesuite/blob/ab4e5ce45416b83bffb947ab8d234df5437f4fca/src/kubernetes/client/apis/core_v1_api.py#L17327-L17420
demisto/content
5c664a65b992ac8ca90ac3f11b1b2cdf11ee9b07
Packs/FraudWatch/Integrations/FraudWatch/FraudWatch.py
python
fraud_watch_incident_report_command
(client: Client, args: Dict)
return CommandResults( outputs_prefix='FraudWatch.Incident', outputs=raw_response, outputs_key_field='identifier', raw_response=raw_response, readable_output=tableToMarkdown("Created FraudWatch Incident", raw_response, removeNull=True) )
Report an incident to FraudWatch service: - Brand(Required): The brand associated to the reported incident. - Incident Type(Required): The type of the incident to be associated to the reported incident. - possible values: ['phishing' => Phishing, 'vishing' => Vishing, ...
Report an incident to FraudWatch service: - Brand(Required): The brand associated to the reported incident. - Incident Type(Required): The type of the incident to be associated to the reported incident. - possible values: ['phishing' => Phishing, 'vishing' => Vishing, ...
[ "Report", "an", "incident", "to", "FraudWatch", "service", ":", "-", "Brand", "(", "Required", ")", ":", "The", "brand", "associated", "to", "the", "reported", "incident", ".", "-", "Incident", "Type", "(", "Required", ")", ":", "The", "type", "of", "the...
def fraud_watch_incident_report_command(client: Client, args: Dict) -> CommandResults: """ Report an incident to FraudWatch service: - Brand(Required): The brand associated to the reported incident. - Incident Type(Required): The type of the incident to be associated to the reported incident. -...
[ "def", "fraud_watch_incident_report_command", "(", "client", ":", "Client", ",", "args", ":", "Dict", ")", "->", "CommandResults", ":", "brand", ":", "str", "=", "args", ".", "get", "(", "'brand'", ")", "# type: ignore", "incident_type", ":", "str", "=", "ar...
https://github.com/demisto/content/blob/5c664a65b992ac8ca90ac3f11b1b2cdf11ee9b07/Packs/FraudWatch/Integrations/FraudWatch/FraudWatch.py#L470-L521
theotherp/nzbhydra
4b03d7f769384b97dfc60dade4806c0fc987514e
libs/code.py
python
InteractiveInterpreter.showsyntaxerror
(self, filename=None)
Display the syntax error that just occurred. This doesn't display a stack trace because there isn't one. If a filename is given, it is stuffed in the exception instead of what was there before (because Python's parser always uses "<string>" when reading from a string). The out...
Display the syntax error that just occurred.
[ "Display", "the", "syntax", "error", "that", "just", "occurred", "." ]
def showsyntaxerror(self, filename=None): """Display the syntax error that just occurred. This doesn't display a stack trace because there isn't one. If a filename is given, it is stuffed in the exception instead of what was there before (because Python's parser always uses "<s...
[ "def", "showsyntaxerror", "(", "self", ",", "filename", "=", "None", ")", ":", "type", ",", "value", ",", "sys", ".", "last_traceback", "=", "sys", ".", "exc_info", "(", ")", "sys", ".", "last_type", "=", "type", "sys", ".", "last_value", "=", "value",...
https://github.com/theotherp/nzbhydra/blob/4b03d7f769384b97dfc60dade4806c0fc987514e/libs/code.py#L112-L139
karlch/vimiv
acbb83e003805e5304131be1f73d7f66528606d6
vimiv/commandline.py
python
CommandLine._focus
(self)
Open and focus the command line.
Open and focus the command line.
[ "Open", "and", "focus", "the", "command", "line", "." ]
def _focus(self): """Open and focus the command line.""" # Show/hide the relevant stuff self.show() self._app["completions"].show() # Remember what widget was focused before self._last_widget = self._app.get_focused_widget() self.grab_focus() self.set_posi...
[ "def", "_focus", "(", "self", ")", ":", "# Show/hide the relevant stuff", "self", ".", "show", "(", ")", "self", ".", "_app", "[", "\"completions\"", "]", ".", "show", "(", ")", "# Remember what widget was focused before", "self", ".", "_last_widget", "=", "self...
https://github.com/karlch/vimiv/blob/acbb83e003805e5304131be1f73d7f66528606d6/vimiv/commandline.py#L358-L368
mchristopher/PokemonGo-DesktopMap
ec37575f2776ee7d64456e2a1f6b6b78830b4fe0
app/pywin/Lib/numbers.py
python
Integral.__float__
(self)
return float(long(self))
float(self) == float(long(self))
float(self) == float(long(self))
[ "float", "(", "self", ")", "==", "float", "(", "long", "(", "self", "))" ]
def __float__(self): """float(self) == float(long(self))""" return float(long(self))
[ "def", "__float__", "(", "self", ")", ":", "return", "float", "(", "long", "(", "self", ")", ")" ]
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/ec37575f2776ee7d64456e2a1f6b6b78830b4fe0/app/pywin/Lib/numbers.py#L376-L378
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_hxb2/lib/python3.5/site-packages/django/contrib/staticfiles/finders.py
python
BaseFinder.list
(self, ignore_patterns)
Given an optional list of paths to ignore, this should return a two item iterable consisting of the relative path and storage instance.
Given an optional list of paths to ignore, this should return a two item iterable consisting of the relative path and storage instance.
[ "Given", "an", "optional", "list", "of", "paths", "to", "ignore", "this", "should", "return", "a", "two", "item", "iterable", "consisting", "of", "the", "relative", "path", "and", "storage", "instance", "." ]
def list(self, ignore_patterns): """ Given an optional list of paths to ignore, this should return a two item iterable consisting of the relative path and storage instance. """ raise NotImplementedError('subclasses of BaseFinder must provide a list() method')
[ "def", "list", "(", "self", ",", "ignore_patterns", ")", ":", "raise", "NotImplementedError", "(", "'subclasses of BaseFinder must provide a list() method'", ")" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/django/contrib/staticfiles/finders.py#L36-L42
materialsproject/pymatgen
8128f3062a334a2edd240e4062b5b9bdd1ae6f58
pymatgen/io/adf.py
python
AdfTask.get_default_scf
()
return AdfKey.from_string("SCF\niterations 300\nEND")
Returns: ADF using default SCF.
Returns: ADF using default SCF.
[ "Returns", ":", "ADF", "using", "default", "SCF", "." ]
def get_default_scf(): """ Returns: ADF using default SCF. """ return AdfKey.from_string("SCF\niterations 300\nEND")
[ "def", "get_default_scf", "(", ")", ":", "return", "AdfKey", ".", "from_string", "(", "\"SCF\\niterations 300\\nEND\"", ")" ]
https://github.com/materialsproject/pymatgen/blob/8128f3062a334a2edd240e4062b5b9bdd1ae6f58/pymatgen/io/adf.py#L534-L538
pyscf/pyscf
0adfb464333f5ceee07b664f291d4084801bae64
pyscf/scf/ghf.py
python
mulliken_meta
(mol, dm_ao, verbose=logger.DEBUG, pre_orth_method=PRE_ORTH_METHOD, s=None)
return uhf.mulliken_meta(mol, (dma,dmb), verbose, pre_orth_method, s)
Mulliken population analysis, based on meta-Lowdin AOs.
Mulliken population analysis, based on meta-Lowdin AOs.
[ "Mulliken", "population", "analysis", "based", "on", "meta", "-", "Lowdin", "AOs", "." ]
def mulliken_meta(mol, dm_ao, verbose=logger.DEBUG, pre_orth_method=PRE_ORTH_METHOD, s=None): '''Mulliken population analysis, based on meta-Lowdin AOs. ''' nao = mol.nao_nr() dma = dm_ao[:nao,:nao] dmb = dm_ao[nao:,nao:] if s is not None: assert(s.size == nao**2 or num...
[ "def", "mulliken_meta", "(", "mol", ",", "dm_ao", ",", "verbose", "=", "logger", ".", "DEBUG", ",", "pre_orth_method", "=", "PRE_ORTH_METHOD", ",", "s", "=", "None", ")", ":", "nao", "=", "mol", ".", "nao_nr", "(", ")", "dma", "=", "dm_ao", "[", ":",...
https://github.com/pyscf/pyscf/blob/0adfb464333f5ceee07b664f291d4084801bae64/pyscf/scf/ghf.py#L318-L328
algorhythms/LeetCode
3fb14aeea62a960442e47dfde9f964c7ffce32be
475 Heaters.py
python
Solution.findRadius
(self, houses, heaters)
return r
check the responsibility use bisect :type houses: List[int] :type heaters: List[int] :rtype: int
check the responsibility use bisect :type houses: List[int] :type heaters: List[int] :rtype: int
[ "check", "the", "responsibility", "use", "bisect", ":", "type", "houses", ":", "List", "[", "int", "]", ":", "type", "heaters", ":", "List", "[", "int", "]", ":", "rtype", ":", "int" ]
def findRadius(self, houses, heaters): """ check the responsibility use bisect :type houses: List[int] :type heaters: List[int] :rtype: int """ houses.sort() heaters.sort() r = 0 i = 0 for h in houses: i = bisect...
[ "def", "findRadius", "(", "self", ",", "houses", ",", "heaters", ")", ":", "houses", ".", "sort", "(", ")", "heaters", ".", "sort", "(", ")", "r", "=", "0", "i", "=", "0", "for", "h", "in", "houses", ":", "i", "=", "bisect", ".", "bisect", "(",...
https://github.com/algorhythms/LeetCode/blob/3fb14aeea62a960442e47dfde9f964c7ffce32be/475 Heaters.py#L23-L42
Map-A-Droid/MAD
81375b5c9ccc5ca3161eb487aa81469d40ded221
mapadroid/route/RouteManagerIV.py
python
RouteManagerIV._can_pass_prioq_coords
(self)
return False
[]
def _can_pass_prioq_coords(self) -> bool: # Override the base class. No need to pass prioq coords. return False
[ "def", "_can_pass_prioq_coords", "(", "self", ")", "->", "bool", ":", "# Override the base class. No need to pass prioq coords.", "return", "False" ]
https://github.com/Map-A-Droid/MAD/blob/81375b5c9ccc5ca3161eb487aa81469d40ded221/mapadroid/route/RouteManagerIV.py#L79-L81
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/auth/__init__.py
python
AuthManager.async_get_or_create_user
( self, credentials: models.Credentials )
return user
Get or create a user.
Get or create a user.
[ "Get", "or", "create", "a", "user", "." ]
async def async_get_or_create_user( self, credentials: models.Credentials ) -> models.User: """Get or create a user.""" if not credentials.is_new: user = await self.async_get_user_by_credentials(credentials) if user is None: raise ValueError("Unable to...
[ "async", "def", "async_get_or_create_user", "(", "self", ",", "credentials", ":", "models", ".", "Credentials", ")", "->", "models", ".", "User", ":", "if", "not", "credentials", ".", "is_new", ":", "user", "=", "await", "self", ".", "async_get_user_by_credent...
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/auth/__init__.py#L261-L287
mittagessen/kraken
9882ba0743797a2d5b0a7b562fcc7235e87323da
kraken/lib/lstm.py
python
Codec.init
(self, charset)
return self
[]
def init(self, charset): charset = sorted(list(set(charset))) self.code2char = {} # type: Dict[int, str] self.char2code = {} # type: Dict[str, int] for code,char in enumerate(charset): self.code2char[code] = char self.char2code[char] = code return self
[ "def", "init", "(", "self", ",", "charset", ")", ":", "charset", "=", "sorted", "(", "list", "(", "set", "(", "charset", ")", ")", ")", "self", ".", "code2char", "=", "{", "}", "# type: Dict[int, str]", "self", ".", "char2code", "=", "{", "}", "# typ...
https://github.com/mittagessen/kraken/blob/9882ba0743797a2d5b0a7b562fcc7235e87323da/kraken/lib/lstm.py#L10-L17
ChineseGLUE/ChineseGLUE
1591b85cf5427c2ff60f718d359ecb71d2b44879
baselines/models/bert_wwm_ext/run_pretraining.py
python
get_next_sentence_output
(bert_config, input_tensor, labels)
Get loss and log probs for the next sentence prediction.
Get loss and log probs for the next sentence prediction.
[ "Get", "loss", "and", "log", "probs", "for", "the", "next", "sentence", "prediction", "." ]
def get_next_sentence_output(bert_config, input_tensor, labels): """Get loss and log probs for the next sentence prediction.""" # Simple binary classification. Note that 0 is "next sentence" and 1 is # "random sentence". This weight matrix is not used after pre-training. with tf.variable_scope("cls/seq_relatio...
[ "def", "get_next_sentence_output", "(", "bert_config", ",", "input_tensor", ",", "labels", ")", ":", "# Simple binary classification. Note that 0 is \"next sentence\" and 1 is", "# \"random sentence\". This weight matrix is not used after pre-training.", "with", "tf", ".", "variable_sc...
https://github.com/ChineseGLUE/ChineseGLUE/blob/1591b85cf5427c2ff60f718d359ecb71d2b44879/baselines/models/bert_wwm_ext/run_pretraining.py#L285-L305
gem/oq-engine
1bdb88f3914e390abcbd285600bfd39477aae47c
openquake/hazardlib/geo/geodetic.py
python
distance_matrix
(lons, lats, diameter=2*EARTH_RADIUS)
return result
:param lons: array of m longitudes :param lats: array of m latitudes :returns: matrix of (m, m) distances
:param lons: array of m longitudes :param lats: array of m latitudes :returns: matrix of (m, m) distances
[ ":", "param", "lons", ":", "array", "of", "m", "longitudes", ":", "param", "lats", ":", "array", "of", "m", "latitudes", ":", "returns", ":", "matrix", "of", "(", "m", "m", ")", "distances" ]
def distance_matrix(lons, lats, diameter=2*EARTH_RADIUS): """ :param lons: array of m longitudes :param lats: array of m latitudes :returns: matrix of (m, m) distances """ m = len(lons) assert m == len(lats), (m, len(lats)) lons = numpy.radians(lons) lats = numpy.radians(lats) co...
[ "def", "distance_matrix", "(", "lons", ",", "lats", ",", "diameter", "=", "2", "*", "EARTH_RADIUS", ")", ":", "m", "=", "len", "(", "lons", ")", "assert", "m", "==", "len", "(", "lats", ")", ",", "(", "m", ",", "len", "(", "lats", ")", ")", "lo...
https://github.com/gem/oq-engine/blob/1bdb88f3914e390abcbd285600bfd39477aae47c/openquake/hazardlib/geo/geodetic.py#L239-L256
n0fate/chainbreaker
6f5a2c74bb922769e2f3d05f7ead6f36d2750277
pyDes.py
python
TripleDES.decrypt
(self, data, pad='')
decrypt(data, [pad]) -> string data : String to be encrypted pad : Optional argument for decryption padding. Must only be one byte The data must be a multiple of 8 bytes and will be decrypted with the already specified key. If the optional padding character is supplied, then t...
decrypt(data, [pad]) -> string
[ "decrypt", "(", "data", "[", "pad", "]", ")", "-", ">", "string" ]
def decrypt(self, data, pad=''): """ decrypt(data, [pad]) -> string data : String to be encrypted pad : Optional argument for decryption padding. Must only be one byte The data must be a multiple of 8 bytes and will be decrypted with the already specified key. If the o...
[ "def", "decrypt", "(", "self", ",", "data", ",", "pad", "=", "''", ")", ":", "if", "self", ".", "getMode", "(", ")", "==", "ECB", ":", "# simple", "data", "=", "self", ".", "__key3", ".", "decrypt", "(", "data", ")", "data", "=", "self", ".", "...
https://github.com/n0fate/chainbreaker/blob/6f5a2c74bb922769e2f3d05f7ead6f36d2750277/pyDes.py#L616-L651
pypa/pipenv
b21baade71a86ab3ee1429f71fbc14d4f95fb75d
pipenv/patched/notpip/_vendor/html5lib/_trie/_base.py
python
Trie.keys
(self, prefix=None)
return {x for x in keys if x.startswith(prefix)}
[]
def keys(self, prefix=None): # pylint:disable=arguments-differ keys = super(Trie, self).keys() if prefix is None: return set(keys) return {x for x in keys if x.startswith(prefix)}
[ "def", "keys", "(", "self", ",", "prefix", "=", "None", ")", ":", "# pylint:disable=arguments-differ", "keys", "=", "super", "(", "Trie", ",", "self", ")", ".", "keys", "(", ")", "if", "prefix", "is", "None", ":", "return", "set", "(", "keys", ")", "...
https://github.com/pypa/pipenv/blob/b21baade71a86ab3ee1429f71fbc14d4f95fb75d/pipenv/patched/notpip/_vendor/html5lib/_trie/_base.py#L12-L19
lorentzenman/sheepl
a999bcfc5e73d8c173b76a6082cbe65b6618984e
tasks/credentials/KeePass.py
python
TaskConsole.do_masterpassword
(self, masterpassword)
Specifies the keepass masterpassword credential
Specifies the keepass masterpassword credential
[ "Specifies", "the", "keepass", "masterpassword", "credential" ]
def do_masterpassword(self, masterpassword): """ Specifies the keepass masterpassword credential """ if masterpassword: if self.taskstarted == True: self.masterpassword = masterpassword else: if self.taskstarted == False: ...
[ "def", "do_masterpassword", "(", "self", ",", "masterpassword", ")", ":", "if", "masterpassword", ":", "if", "self", ".", "taskstarted", "==", "True", ":", "self", ".", "masterpassword", "=", "masterpassword", "else", ":", "if", "self", ".", "taskstarted", "...
https://github.com/lorentzenman/sheepl/blob/a999bcfc5e73d8c173b76a6082cbe65b6618984e/tasks/credentials/KeePass.py#L149-L160
trevp/tlslite
cd82fadb6bb958522b7457c5ed95890283437a4f
tlslite/checker.py
python
Checker.__call__
(self, connection)
Check a TLSConnection. When a Checker is passed to a handshake function, this will be called at the end of the function. @type connection: L{tlslite.tlsconnection.TLSConnection} @param connection: The TLSConnection to examine. @raise tlslite.errors.TLSAuthenticationError: If t...
Check a TLSConnection.
[ "Check", "a", "TLSConnection", "." ]
def __call__(self, connection): """Check a TLSConnection. When a Checker is passed to a handshake function, this will be called at the end of the function. @type connection: L{tlslite.tlsconnection.TLSConnection} @param connection: The TLSConnection to examine. @raise ...
[ "def", "__call__", "(", "self", ",", "connection", ")", ":", "if", "not", "self", ".", "checkResumedSession", "and", "connection", ".", "resumed", ":", "return", "if", "self", ".", "x509Fingerprint", ":", "if", "connection", ".", "_client", ":", "chain", "...
https://github.com/trevp/tlslite/blob/cd82fadb6bb958522b7457c5ed95890283437a4f/tlslite/checker.py#L46-L77
Calysto/calysto_scheme
15bf81987870bcae1264e5a0a06feb9a8ee12b8b
calysto_scheme/scheme.py
python
b_cont2_59_d
()
[]
def b_cont2_59_d(): GLOBALS['final_reg'] = True GLOBALS['pc'] = pc_halt_signal
[ "def", "b_cont2_59_d", "(", ")", ":", "GLOBALS", "[", "'final_reg'", "]", "=", "True", "GLOBALS", "[", "'pc'", "]", "=", "pc_halt_signal" ]
https://github.com/Calysto/calysto_scheme/blob/15bf81987870bcae1264e5a0a06feb9a8ee12b8b/calysto_scheme/scheme.py#L2721-L2723
zhaoolee/StarsAndClown
b2d4039cad2f9232b691e5976f787b49a0a2c113
node_modules/npmi/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
python
AndroidMkWriter.ExtractIncludesFromCFlags
(self, cflags)
return (clean_cflags, include_paths)
Extract includes "-I..." out from cflags Args: cflags: A list of compiler flags, which may be mixed with "-I.." Returns: A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed.
Extract includes "-I..." out from cflags
[ "Extract", "includes", "-", "I", "...", "out", "from", "cflags" ]
def ExtractIncludesFromCFlags(self, cflags): """Extract includes "-I..." out from cflags Args: cflags: A list of compiler flags, which may be mixed with "-I.." Returns: A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed. """ clean_cflags = [] include_paths = [] f...
[ "def", "ExtractIncludesFromCFlags", "(", "self", ",", "cflags", ")", ":", "clean_cflags", "=", "[", "]", "include_paths", "=", "[", "]", "for", "flag", "in", "cflags", ":", "if", "flag", ".", "startswith", "(", "'-I'", ")", ":", "include_paths", ".", "ap...
https://github.com/zhaoolee/StarsAndClown/blob/b2d4039cad2f9232b691e5976f787b49a0a2c113/node_modules/npmi/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py#L706-L722
wizyoung/googletranslate.popclipext
a3c465685a5a75213e2ec8517eb98d336984bc50
src/urllib3/util/ssl_.py
python
is_ipaddress
(hostname)
return bool(IPV4_RE.match(hostname) or BRACELESS_IPV6_ADDRZ_RE.match(hostname))
Detects whether the hostname given is an IPv4 or IPv6 address. Also detects IPv6 addresses with Zone IDs. :param str hostname: Hostname to examine. :return: True if the hostname is an IP address, False otherwise.
Detects whether the hostname given is an IPv4 or IPv6 address. Also detects IPv6 addresses with Zone IDs.
[ "Detects", "whether", "the", "hostname", "given", "is", "an", "IPv4", "or", "IPv6", "address", ".", "Also", "detects", "IPv6", "addresses", "with", "Zone", "IDs", "." ]
def is_ipaddress(hostname): """Detects whether the hostname given is an IPv4 or IPv6 address. Also detects IPv6 addresses with Zone IDs. :param str hostname: Hostname to examine. :return: True if the hostname is an IP address, False otherwise. """ if not six.PY2 and isinstance(hostname, bytes):...
[ "def", "is_ipaddress", "(", "hostname", ")", ":", "if", "not", "six", ".", "PY2", "and", "isinstance", "(", "hostname", ",", "bytes", ")", ":", "# IDN A-label bytes are ASCII compatible.", "hostname", "=", "hostname", ".", "decode", "(", "\"ascii\"", ")", "ret...
https://github.com/wizyoung/googletranslate.popclipext/blob/a3c465685a5a75213e2ec8517eb98d336984bc50/src/urllib3/util/ssl_.py#L436-L446
frePPLe/frepple
57aa612030b4fcd03cb9c613f83a7dac4f0e8d6d
freppledb/execute/management/commands/createbuckets.py
python
Command.formatDate
(self, curdate, template)
return curdate.strftime(fmt)
[]
def formatDate(self, curdate, template): fmt = template if "%q" in fmt: month = int(curdate.strftime("%m")) # an integer in the range 1 - 12 quarter = (month - 1) // 3 + 1 # an integer in the range 1 - 4 fmt = fmt.replace("%q", str(quarter)) return curdate.s...
[ "def", "formatDate", "(", "self", ",", "curdate", ",", "template", ")", ":", "fmt", "=", "template", "if", "\"%q\"", "in", "fmt", ":", "month", "=", "int", "(", "curdate", ".", "strftime", "(", "\"%m\"", ")", ")", "# an integer in the range 1 - 12", "quart...
https://github.com/frePPLe/frepple/blob/57aa612030b4fcd03cb9c613f83a7dac4f0e8d6d/freppledb/execute/management/commands/createbuckets.py#L94-L100
apache/incubator-spot
2d60a2adae7608b43e90ce1b9ec0adf24f6cc8eb
spot-oa/api/resources/impala_engine.py
python
execute_query
(query,fetch=False)
return impala_cursor if not fetch else impala_cursor.fetchall()
[]
def execute_query(query,fetch=False): impala_cursor = create_connection() impala_cursor.execute(query) return impala_cursor if not fetch else impala_cursor.fetchall()
[ "def", "execute_query", "(", "query", ",", "fetch", "=", "False", ")", ":", "impala_cursor", "=", "create_connection", "(", ")", "impala_cursor", ".", "execute", "(", "query", ")", "return", "impala_cursor", "if", "not", "fetch", "else", "impala_cursor", ".", ...
https://github.com/apache/incubator-spot/blob/2d60a2adae7608b43e90ce1b9ec0adf24f6cc8eb/spot-oa/api/resources/impala_engine.py#L45-L50
kivy/kivy-designer
20343184a28c2851faf0c1ab451d0286d147a441
designer/components/event_viewer.py
python
NewEventTextInput.on_touch_down
(self, touch)
return super(NewEventTextInput, self).on_touch_down(touch)
Default handler for 'on_touch_down' event.
Default handler for 'on_touch_down' event.
[ "Default", "handler", "for", "on_touch_down", "event", "." ]
def on_touch_down(self, touch): '''Default handler for 'on_touch_down' event. ''' if self.collide_point(*touch.pos): self.info_bubble = InfoBubble(message=self.info_message) bubble_pos = list(self.to_window(*self.pos)) bubble_pos[1] += self.height ...
[ "def", "on_touch_down", "(", "self", ",", "touch", ")", ":", "if", "self", ".", "collide_point", "(", "*", "touch", ".", "pos", ")", ":", "self", ".", "info_bubble", "=", "InfoBubble", "(", "message", "=", "self", ".", "info_message", ")", "bubble_pos", ...
https://github.com/kivy/kivy-designer/blob/20343184a28c2851faf0c1ab451d0286d147a441/designer/components/event_viewer.py#L139-L148
kbandla/ImmunityDebugger
2abc03fb15c8f3ed0914e1175c4d8933977c73e3
1.73/Libs/immlib.py
python
Debugger.getFunction
(self, address)
return Function(self, address)
Get the Function information @type Address: DWORD @param Address: Address of the function @rtype: Function Object @return: Function Object containing information of the requested function
Get the Function information
[ "Get", "the", "Function", "information" ]
def getFunction(self, address): """ Get the Function information @type Address: DWORD @param Address: Address of the function @rtype: Function Object @return: Function Object containing information of the requested function """ ...
[ "def", "getFunction", "(", "self", ",", "address", ")", ":", "return", "Function", "(", "self", ",", "address", ")" ]
https://github.com/kbandla/ImmunityDebugger/blob/2abc03fb15c8f3ed0914e1175c4d8933977c73e3/1.73/Libs/immlib.py#L856-L867
kubernetes-client/python
47b9da9de2d02b2b7a34fbe05afb44afd130d73a
kubernetes/client/models/v1_replication_controller_condition.py
python
V1ReplicationControllerCondition.reason
(self, reason)
Sets the reason of this V1ReplicationControllerCondition. The reason for the condition's last transition. # noqa: E501 :param reason: The reason of this V1ReplicationControllerCondition. # noqa: E501 :type: str
Sets the reason of this V1ReplicationControllerCondition.
[ "Sets", "the", "reason", "of", "this", "V1ReplicationControllerCondition", "." ]
def reason(self, reason): """Sets the reason of this V1ReplicationControllerCondition. The reason for the condition's last transition. # noqa: E501 :param reason: The reason of this V1ReplicationControllerCondition. # noqa: E501 :type: str """ self._reason = reason
[ "def", "reason", "(", "self", ",", "reason", ")", ":", "self", ".", "_reason", "=", "reason" ]
https://github.com/kubernetes-client/python/blob/47b9da9de2d02b2b7a34fbe05afb44afd130d73a/kubernetes/client/models/v1_replication_controller_condition.py#L131-L140
cloudera/hue
23f02102d4547c17c32bd5ea0eb24e9eadd657a4
desktop/core/ext-py/gssapi-1.5.1/gssapi/_utils.py
python
import_gssapi_extension
(name)
Import a GSSAPI extension module This method imports a GSSAPI extension module based on the name of the extension (not including the 'ext_' prefix). If the extension is not available, the method retuns None. Args: name (str): the name of the extension Returns: module: Either ...
Import a GSSAPI extension module
[ "Import", "a", "GSSAPI", "extension", "module" ]
def import_gssapi_extension(name): """Import a GSSAPI extension module This method imports a GSSAPI extension module based on the name of the extension (not including the 'ext_' prefix). If the extension is not available, the method retuns None. Args: name (str): the name of the exten...
[ "def", "import_gssapi_extension", "(", "name", ")", ":", "try", ":", "path", "=", "'gssapi.raw.ext_{0}'", ".", "format", "(", "name", ")", "__import__", "(", "path", ")", "return", "sys", ".", "modules", "[", "path", "]", "except", "ImportError", ":", "ret...
https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/gssapi-1.5.1/gssapi/_utils.py#L10-L30
etetoolkit/ete
2b207357dc2a40ccad7bfd8f54964472c72e4726
ete3/nexml/_nexml.py
python
AbstractChar.exportAttributes
(self, outfile, level, already_processed, namespace_='', name_='AbstractChar')
[]
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AbstractChar'): super(AbstractChar, self).exportAttributes(outfile, level, already_processed, namespace_, name_='AbstractChar') if self.tokens is not None and 'tokens' not in already_processed: already_proces...
[ "def", "exportAttributes", "(", "self", ",", "outfile", ",", "level", ",", "already_processed", ",", "namespace_", "=", "''", ",", "name_", "=", "'AbstractChar'", ")", ":", "super", "(", "AbstractChar", ",", "self", ")", ".", "exportAttributes", "(", "outfil...
https://github.com/etetoolkit/ete/blob/2b207357dc2a40ccad7bfd8f54964472c72e4726/ete3/nexml/_nexml.py#L6735-L6745
leo-editor/leo-editor
383d6776d135ef17d73d935a2f0ecb3ac0e99494
leo/core/leoColorizer.py
python
PygmentsColorizer.__init__
(self, c, widget, wrapper)
Ctor for JEditColorizer class.
Ctor for JEditColorizer class.
[ "Ctor", "for", "JEditColorizer", "class", "." ]
def __init__(self, c, widget, wrapper): """Ctor for JEditColorizer class.""" super().__init__(c, widget, wrapper) # # Create the highlighter. The default is NullObject. if isinstance(widget, QtWidgets.QTextEdit): self.highlighter = LeoHighlighter(c, co...
[ "def", "__init__", "(", "self", ",", "c", ",", "widget", ",", "wrapper", ")", ":", "super", "(", ")", ".", "__init__", "(", "c", ",", "widget", ",", "wrapper", ")", "#", "# Create the highlighter. The default is NullObject.", "if", "isinstance", "(", "widget...
https://github.com/leo-editor/leo-editor/blob/383d6776d135ef17d73d935a2f0ecb3ac0e99494/leo/core/leoColorizer.py#L2612-L2632
Antergos/Cnchi
13ac2209da9432d453e0097cf48a107640b563a9
src/parted3/partition_module.py
python
make_new_disk
(dev_path, new_type)
return new_disk
Make a new disk
Make a new disk
[ "Make", "a", "new", "disk" ]
def make_new_disk(dev_path, new_type): """ Make a new disk """ new_dev = parted.Device(dev_path) new_disk = parted.freshDisk(new_dev, new_type) return new_disk
[ "def", "make_new_disk", "(", "dev_path", ",", "new_type", ")", ":", "new_dev", "=", "parted", ".", "Device", "(", "dev_path", ")", "new_disk", "=", "parted", ".", "freshDisk", "(", "new_dev", ",", "new_type", ")", "return", "new_disk" ]
https://github.com/Antergos/Cnchi/blob/13ac2209da9432d453e0097cf48a107640b563a9/src/parted3/partition_module.py#L140-L144
lxtGH/OctaveConv_pytorch
079f7da29d55c2eeed8985d33f0b2f765d7a469e
libs/nn/resnet.py
python
conv3x3
(in_planes, out_planes, stride=1, groups=1)
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, groups=groups, bias=False)
3x3 convolution with padding
3x3 convolution with padding
[ "3x3", "convolution", "with", "padding" ]
def conv3x3(in_planes, out_planes, stride=1, groups=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, groups=groups, bias=False)
[ "def", "conv3x3", "(", "in_planes", ",", "out_planes", ",", "stride", "=", "1", ",", "groups", "=", "1", ")", ":", "return", "nn", ".", "Conv2d", "(", "in_planes", ",", "out_planes", ",", "kernel_size", "=", "3", ",", "stride", "=", "stride", ",", "p...
https://github.com/lxtGH/OctaveConv_pytorch/blob/079f7da29d55c2eeed8985d33f0b2f765d7a469e/libs/nn/resnet.py#L7-L10
JimmXinu/FanFicFare
bc149a2deb2636320fe50a3e374af6eef8f61889
included_dependencies/urllib3/contrib/pyopenssl.py
python
PyOpenSSLContext.options
(self, value)
[]
def options(self, value): self._options = value self._ctx.set_options(value)
[ "def", "options", "(", "self", ",", "value", ")", ":", "self", ".", "_options", "=", "value", "self", ".", "_ctx", ".", "set_options", "(", "value", ")" ]
https://github.com/JimmXinu/FanFicFare/blob/bc149a2deb2636320fe50a3e374af6eef8f61889/included_dependencies/urllib3/contrib/pyopenssl.py#L434-L436
nlloyd/SubliminalCollaborator
5c619e17ddbe8acb9eea8996ec038169ddcd50a1
libs/twisted/web/http.py
python
HTTPChannel.checkPersistence
(self, request, version)
Check if the channel should close or not. @param request: The request most recently received over this channel against which checks will be made to determine if this connection can remain open after a matching response is returned. @type version: C{str} @param version: ...
Check if the channel should close or not.
[ "Check", "if", "the", "channel", "should", "close", "or", "not", "." ]
def checkPersistence(self, request, version): """ Check if the channel should close or not. @param request: The request most recently received over this channel against which checks will be made to determine if this connection can remain open after a matching response is...
[ "def", "checkPersistence", "(", "self", ",", "request", ",", "version", ")", ":", "connection", "=", "request", ".", "requestHeaders", ".", "getRawHeaders", "(", "'connection'", ")", "if", "connection", ":", "tokens", "=", "map", "(", "str", ".", "lower", ...
https://github.com/nlloyd/SubliminalCollaborator/blob/5c619e17ddbe8acb9eea8996ec038169ddcd50a1/libs/twisted/web/http.py#L1644-L1687
dpressel/mead-baseline
9987e6b37fa6525a4ddc187c305e292a718f59a9
baseline/pytorch/tagger/model.py
python
AbstractEncoderTaggerModel.forward
(self, inputs: Dict[str, TensorDef])
return path
Take the input and produce the best path of labels out :param inputs: The feature indices for the input :return: The most likely path through the output labels
Take the input and produce the best path of labels out
[ "Take", "the", "input", "and", "produce", "the", "best", "path", "of", "labels", "out" ]
def forward(self, inputs: Dict[str, TensorDef]) -> TensorDef: """Take the input and produce the best path of labels out :param inputs: The feature indices for the input :return: The most likely path through the output labels """ transduced = self.transduce(inputs) path =...
[ "def", "forward", "(", "self", ",", "inputs", ":", "Dict", "[", "str", ",", "TensorDef", "]", ")", "->", "TensorDef", ":", "transduced", "=", "self", ".", "transduce", "(", "inputs", ")", "path", "=", "self", ".", "decode", "(", "transduced", ",", "i...
https://github.com/dpressel/mead-baseline/blob/9987e6b37fa6525a4ddc187c305e292a718f59a9/baseline/pytorch/tagger/model.py#L317-L325
oauthlib/oauthlib
553850bc85dfd408be0dae9884b4a0aefda8e579
oauthlib/oauth1/rfc5849/__init__.py
python
Client.get_oauth_signature
(self, request)
return sig
Get an OAuth signature to be used in signing a request To satisfy `section 3.4.1.2`_ item 2, if the request argument's headers dict attribute contains a Host item, its value will replace any netloc part of the request argument's uri attribute value. .. _`section 3.4.1.2`: https...
Get an OAuth signature to be used in signing a request
[ "Get", "an", "OAuth", "signature", "to", "be", "used", "in", "signing", "a", "request" ]
def get_oauth_signature(self, request): """Get an OAuth signature to be used in signing a request To satisfy `section 3.4.1.2`_ item 2, if the request argument's headers dict attribute contains a Host item, its value will replace any netloc part of the request argument's uri attribute ...
[ "def", "get_oauth_signature", "(", "self", ",", "request", ")", ":", "if", "self", ".", "signature_method", "==", "SIGNATURE_PLAINTEXT", ":", "# fast-path", "return", "signature", ".", "sign_plaintext", "(", "self", ".", "client_secret", ",", "self", ".", "resou...
https://github.com/oauthlib/oauthlib/blob/553850bc85dfd408be0dae9884b4a0aefda8e579/oauthlib/oauth1/rfc5849/__init__.py#L150-L189
Yuliang-Liu/bezier_curve_text_spotting
8986ff0eb7f9ccd5943cc46191bded2affdfe61f
demo/predictor.py
python
COCODemo.build_transform
(self)
return transform
Creates a basic transformation that was used to train the models
Creates a basic transformation that was used to train the models
[ "Creates", "a", "basic", "transformation", "that", "was", "used", "to", "train", "the", "models" ]
def build_transform(self): """ Creates a basic transformation that was used to train the models """ cfg = self.cfg # we are loading images with OpenCV, so we don't need to convert them # to BGR, they are already! So all we need to do is to normalize # by 255 if w...
[ "def", "build_transform", "(", "self", ")", ":", "cfg", "=", "self", ".", "cfg", "# we are loading images with OpenCV, so we don't need to convert them", "# to BGR, they are already! So all we need to do is to normalize", "# by 255 if we want to convert to BGR255 format, or flip the channe...
https://github.com/Yuliang-Liu/bezier_curve_text_spotting/blob/8986ff0eb7f9ccd5943cc46191bded2affdfe61f/demo/predictor.py#L173-L202
bchretien/vim-profiler
d4fda79830528ffb6cce895448ac10b502f9f756
vim-profiler.py
python
stdev
(arr)
Compute the standard deviation.
Compute the standard deviation.
[ "Compute", "the", "standard", "deviation", "." ]
def stdev(arr): """ Compute the standard deviation. """ if sys.version_info >= (3, 0): import statistics return statistics.pstdev(arr) else: # Dependency on NumPy try: import numpy return numpy.std(arr, axis=0) except ImportError: ...
[ "def", "stdev", "(", "arr", ")", ":", "if", "sys", ".", "version_info", ">=", "(", "3", ",", "0", ")", ":", "import", "statistics", "return", "statistics", ".", "pstdev", "(", "arr", ")", "else", ":", "# Dependency on NumPy", "try", ":", "import", "num...
https://github.com/bchretien/vim-profiler/blob/d4fda79830528ffb6cce895448ac10b502f9f756/vim-profiler.py#L54-L67
makerbot/ReplicatorG
d6f2b07785a5a5f1e172fb87cb4303b17c575d5d
skein_engines/skeinforge-35/fabmetheus_utilities/geometry/solids/trianglemesh.py
python
getIndexedCellLoopsFromIndexedGrid
( grid )
return indexedCellLoops
Get indexed cell loops from an indexed grid.
Get indexed cell loops from an indexed grid.
[ "Get", "indexed", "cell", "loops", "from", "an", "indexed", "grid", "." ]
def getIndexedCellLoopsFromIndexedGrid( grid ): "Get indexed cell loops from an indexed grid." indexedCellLoops = [] for rowIndex in xrange( len( grid ) - 1 ): rowBottom = grid[ rowIndex ] rowTop = grid[ rowIndex + 1 ] for columnIndex in xrange( len( rowBottom ) - 1 ): columnIndexEnd = columnIndex + 1 in...
[ "def", "getIndexedCellLoopsFromIndexedGrid", "(", "grid", ")", ":", "indexedCellLoops", "=", "[", "]", "for", "rowIndex", "in", "xrange", "(", "len", "(", "grid", ")", "-", "1", ")", ":", "rowBottom", "=", "grid", "[", "rowIndex", "]", "rowTop", "=", "gr...
https://github.com/makerbot/ReplicatorG/blob/d6f2b07785a5a5f1e172fb87cb4303b17c575d5d/skein_engines/skeinforge-35/fabmetheus_utilities/geometry/solids/trianglemesh.py#L326-L340
kubernetes-client/python
47b9da9de2d02b2b7a34fbe05afb44afd130d73a
kubernetes/client/models/v2beta2_external_metric_status.py
python
V2beta2ExternalMetricStatus.__eq__
(self, other)
return self.to_dict() == other.to_dict()
Returns true if both objects are equal
Returns true if both objects are equal
[ "Returns", "true", "if", "both", "objects", "are", "equal" ]
def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, V2beta2ExternalMetricStatus): return False return self.to_dict() == other.to_dict()
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "V2beta2ExternalMetricStatus", ")", ":", "return", "False", "return", "self", ".", "to_dict", "(", ")", "==", "other", ".", "to_dict", "(", ")" ]
https://github.com/kubernetes-client/python/blob/47b9da9de2d02b2b7a34fbe05afb44afd130d73a/kubernetes/client/models/v2beta2_external_metric_status.py#L136-L141
yampelo/beagle
8bb2b615fd5968e07af42d41a173d98541fc1e85
beagle/datasources/base_datasource.py
python
DataSource._convert_to_parent_fields
(self, process: dict)
return output
Converts a process to represent a child process. Parameters ---------- process : dict Expects an input of format:: { FieldNames.PROCESS_IMAGE: ..., FieldNames.PROCESS_ID: ..., FieldNames.COMMAND_LINE: ..., ...
Converts a process to represent a child process.
[ "Converts", "a", "process", "to", "represent", "a", "child", "process", "." ]
def _convert_to_parent_fields(self, process: dict) -> dict: """Converts a process to represent a child process. Parameters ---------- process : dict Expects an input of format:: { FieldNames.PROCESS_IMAGE: ..., FieldNa...
[ "def", "_convert_to_parent_fields", "(", "self", ",", "process", ":", "dict", ")", "->", "dict", ":", "output", "=", "{", "}", "for", "left", ",", "right", "in", "[", "(", "FieldNames", ".", "PROCESS_IMAGE", ",", "FieldNames", ".", "PARENT_PROCESS_IMAGE", ...
https://github.com/yampelo/beagle/blob/8bb2b615fd5968e07af42d41a173d98541fc1e85/beagle/datasources/base_datasource.py#L115-L152
billy-yoyo/RainbowSixSiege-Python-API
d28d69fcc88c7a748a52869ed97235c5ac872f0c
r6sapi/players.py
python
Player.load_general
(self, data=None)
|coro| Loads the players general stats
|coro|
[ "|coro|" ]
def load_general(self, data=None): """|coro| Loads the players general stats""" stats = yield from self._fetch_statistics("generalpvp_timeplayed", "generalpvp_matchplayed", "generalpvp_matchwon", "generalpvp_matchlost", "generalpvp_kills", "gen...
[ "def", "load_general", "(", "self", ",", "data", "=", "None", ")", ":", "stats", "=", "yield", "from", "self", ".", "_fetch_statistics", "(", "\"generalpvp_timeplayed\"", ",", "\"generalpvp_matchplayed\"", ",", "\"generalpvp_matchwon\"", ",", "\"generalpvp_matchlost\"...
https://github.com/billy-yoyo/RainbowSixSiege-Python-API/blob/d28d69fcc88c7a748a52869ed97235c5ac872f0c/r6sapi/players.py#L553-L591
cournape/Bento
37de23d784407a7c98a4a15770ffc570d5f32d70
bento/compat/_zipfile.py
python
ZipFile.extractall
(self, path=None, members=None, pwd=None)
Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist().
Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist().
[ "Extract", "all", "members", "from", "the", "archive", "to", "the", "current", "working", "directory", ".", "path", "specifies", "a", "different", "directory", "to", "extract", "to", ".", "members", "is", "optional", "and", "must", "be", "a", "subset", "of",...
def extractall(self, path=None, members=None, pwd=None): """Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist(). """ ...
[ "def", "extractall", "(", "self", ",", "path", "=", "None", ",", "members", "=", "None", ",", "pwd", "=", "None", ")", ":", "if", "members", "is", "None", ":", "members", "=", "self", ".", "namelist", "(", ")", "for", "zipinfo", "in", "members", ":...
https://github.com/cournape/Bento/blob/37de23d784407a7c98a4a15770ffc570d5f32d70/bento/compat/_zipfile.py#L928-L938
avinashpaliwal/Super-SloMo
544802b543e4aaaa707ebac6ae6c61e1da72a6f6
model.py
python
down.__init__
(self, inChannels, outChannels, filterSize)
Parameters ---------- inChannels : int number of input channels for the first convolutional layer. outChannels : int number of output channels for the first convolutional layer. This is also used as input and output channels for the ...
Parameters ---------- inChannels : int number of input channels for the first convolutional layer. outChannels : int number of output channels for the first convolutional layer. This is also used as input and output channels for the ...
[ "Parameters", "----------", "inChannels", ":", "int", "number", "of", "input", "channels", "for", "the", "first", "convolutional", "layer", ".", "outChannels", ":", "int", "number", "of", "output", "channels", "for", "the", "first", "convolutional", "layer", "."...
def __init__(self, inChannels, outChannels, filterSize): """ Parameters ---------- inChannels : int number of input channels for the first convolutional layer. outChannels : int number of output channels for the first convolutional layer. ...
[ "def", "__init__", "(", "self", ",", "inChannels", ",", "outChannels", ",", "filterSize", ")", ":", "super", "(", "down", ",", "self", ")", ".", "__init__", "(", ")", "# Initialize convolutional layers.", "self", ".", "conv1", "=", "nn", ".", "Conv2d", "("...
https://github.com/avinashpaliwal/Super-SloMo/blob/544802b543e4aaaa707ebac6ae6c61e1da72a6f6/model.py#L28-L47
andresriancho/w3af
cd22e5252243a87aaa6d0ddea47cf58dacfe00a9
w3af/plugins/attack/db/sqlmap/waf/webknight.py
python
detect
(get_page)
return retval
[]
def detect(get_page): retval = False for vector in WAF_ATTACK_VECTORS: _, headers, code = get_page(get=vector) retval = code == 999 retval |= re.search(r"WebKnight", headers.get(HTTP_HEADER.SERVER, ""), re.I) is not None if retval: break return retval
[ "def", "detect", "(", "get_page", ")", ":", "retval", "=", "False", "for", "vector", "in", "WAF_ATTACK_VECTORS", ":", "_", ",", "headers", ",", "code", "=", "get_page", "(", "get", "=", "vector", ")", "retval", "=", "code", "==", "999", "retval", "|=",...
https://github.com/andresriancho/w3af/blob/cd22e5252243a87aaa6d0ddea47cf58dacfe00a9/w3af/plugins/attack/db/sqlmap/waf/webknight.py#L15-L25
thiagopena/djangoSIGE
e32186b27bfd8acf21b0fa400e699cb5c73e5433
djangosige/apps/vendas/models/vendas.py
python
ItensVenda.get_total_impostos
(self)
return sum(filter(None, [self.vicms, self.vicms_st, self.vipi, self.vfcp, self.vicmsufdest, self.vicmsufremet]))
[]
def get_total_impostos(self): return sum(filter(None, [self.vicms, self.vicms_st, self.vipi, self.vfcp, self.vicmsufdest, self.vicmsufremet]))
[ "def", "get_total_impostos", "(", "self", ")", ":", "return", "sum", "(", "filter", "(", "None", ",", "[", "self", ".", "vicms", ",", "self", ".", "vicms_st", ",", "self", ".", "vipi", ",", "self", ".", "vfcp", ",", "self", ".", "vicmsufdest", ",", ...
https://github.com/thiagopena/djangoSIGE/blob/e32186b27bfd8acf21b0fa400e699cb5c73e5433/djangosige/apps/vendas/models/vendas.py#L176-L177
Pylons/pyramid
0b24ac16cc04746b25cf460f1497c157f6d3d6f4
src/pyramid/interfaces.py
python
ISecurityPolicy.authenticated_userid
(request)
Return a :term:`userid` string identifying the trusted and verified user, or ``None`` if unauthenticated. If the result is ``None``, then :attr:`pyramid.request.Request.is_authenticated` will return ``False``.
Return a :term:`userid` string identifying the trusted and verified user, or ``None`` if unauthenticated.
[ "Return", "a", ":", "term", ":", "userid", "string", "identifying", "the", "trusted", "and", "verified", "user", "or", "None", "if", "unauthenticated", "." ]
def authenticated_userid(request): """Return a :term:`userid` string identifying the trusted and verified user, or ``None`` if unauthenticated. If the result is ``None``, then :attr:`pyramid.request.Request.is_authenticated` will return ``False``. """
[ "def", "authenticated_userid", "(", "request", ")", ":" ]
https://github.com/Pylons/pyramid/blob/0b24ac16cc04746b25cf460f1497c157f6d3d6f4/src/pyramid/interfaces.py#L510-L516
python/cpython
e13cdca0f5224ec4e23bdd04bb3120506964bc8b
Lib/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/python/cpython/blob/e13cdca0f5224ec4e23bdd04bb3120506964bc8b/Lib/fractions.py#L729-L731
beeware/ouroboros
a29123c6fab6a807caffbb7587cf548e0c370296
ouroboros/mailbox.py
python
_singlefileMailbox.unlock
(self)
Unlock the mailbox if it is locked.
Unlock the mailbox if it is locked.
[ "Unlock", "the", "mailbox", "if", "it", "is", "locked", "." ]
def unlock(self): """Unlock the mailbox if it is locked.""" if self._locked: _unlock_file(self._file) self._locked = False
[ "def", "unlock", "(", "self", ")", ":", "if", "self", ".", "_locked", ":", "_unlock_file", "(", "self", ".", "_file", ")", "self", ".", "_locked", "=", "False" ]
https://github.com/beeware/ouroboros/blob/a29123c6fab6a807caffbb7587cf548e0c370296/ouroboros/mailbox.py#L641-L645
IdentityPython/pysaml2
6badb32d212257bd83ffcc816f9b625f68281b47
src/saml2/client.py
python
Saml2Client.do_assertion_id_request
(self, assertion_ids, entity_id, consent=None, extensions=None, sign=False)
return None
[]
def do_assertion_id_request(self, assertion_ids, entity_id, consent=None, extensions=None, sign=False): srvs = self.metadata.assertion_id_request_service(entity_id, BINDING_SOAP) if not srvs: raise NoS...
[ "def", "do_assertion_id_request", "(", "self", ",", "assertion_ids", ",", "entity_id", ",", "consent", "=", "None", ",", "extensions", "=", "None", ",", "sign", "=", "False", ")", ":", "srvs", "=", "self", ".", "metadata", ".", "assertion_id_request_service", ...
https://github.com/IdentityPython/pysaml2/blob/6badb32d212257bd83ffcc816f9b625f68281b47/src/saml2/client.py#L499-L520
leancloud/satori
701caccbd4fe45765001ca60435c0cb499477c03
satori-rules/plugin/libs/pymongo/pool.py
python
SocketInfo.__eq__
(self, other)
return self.sock == other.sock
[]
def __eq__(self, other): return self.sock == other.sock
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "return", "self", ".", "sock", "==", "other", ".", "sock" ]
https://github.com/leancloud/satori/blob/701caccbd4fe45765001ca60435c0cb499477c03/satori-rules/plugin/libs/pymongo/pool.py#L348-L349
wrye-bash/wrye-bash
d495c47cfdb44475befa523438a40c4419cb386f
Mopy/bash/brec/mod_io.py
python
GrupHeader.pack_head
(self, __rh=RecordHeader)
return struct_pack(*pack_args)
Return the record header packed into a bitstream to be written to file. We decide what kind of GRUP we have based on the type of label, hacky but to redo this we must revisit records code.
Return the record header packed into a bitstream to be written to file. We decide what kind of GRUP we have based on the type of label, hacky but to redo this we must revisit records code.
[ "Return", "the", "record", "header", "packed", "into", "a", "bitstream", "to", "be", "written", "to", "file", ".", "We", "decide", "what", "kind", "of", "GRUP", "we", "have", "based", "on", "the", "type", "of", "label", "hacky", "but", "to", "redo", "t...
def pack_head(self, __rh=RecordHeader): """Return the record header packed into a bitstream to be written to file. We decide what kind of GRUP we have based on the type of label, hacky but to redo this we must revisit records code.""" if isinstance(self.label, tuple): pack_ar...
[ "def", "pack_head", "(", "self", ",", "__rh", "=", "RecordHeader", ")", ":", "if", "isinstance", "(", "self", ".", "label", ",", "tuple", ")", ":", "pack_args", "=", "[", "__rh", ".", "pack_formats", "[", "4", "]", ",", "b'GRUP'", ",", "self", ".", ...
https://github.com/wrye-bash/wrye-bash/blob/d495c47cfdb44475befa523438a40c4419cb386f/Mopy/bash/brec/mod_io.py#L140-L153