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
openvinotoolkit/open_model_zoo
5a4232f6c35b4916eb6e8750141f4e45761237ef
demos/speech_recognition_deepspeech_demo/python/asr_utils/audio_features.py
python
AudioFeaturesSeqPipelineStage._process_blocks
(self, audio, finish=False)
audio (numpy.ndarray), this buffer is guaranteed to contain data for 1 or more blocks (audio.shape[0]>=self._block_len+self._context_len)
audio (numpy.ndarray), this buffer is guaranteed to contain data for 1 or more blocks (audio.shape[0]>=self._block_len+self._context_len)
[ "audio", "(", "numpy", ".", "ndarray", ")", "this", "buffer", "is", "guaranteed", "to", "contain", "data", "for", "1", "or", "more", "blocks", "(", "audio", ".", "shape", "[", "0", "]", ">", "=", "self", ".", "_block_len", "+", "self", ".", "_context...
def _process_blocks(self, audio, finish=False): """ audio (numpy.ndarray), this buffer is guaranteed to contain data for 1 or more blocks (audio.shape[0]>=self._block_len+self._context_len) """ # Cut the buffer to the end of the last frame audio_len = audio.shape[0] ...
[ "def", "_process_blocks", "(", "self", ",", "audio", ",", "finish", "=", "False", ")", ":", "# Cut the buffer to the end of the last frame", "audio_len", "=", "audio", ".", "shape", "[", "0", "]", "processable_len", "=", "audio_len", "-", "(", "audio_len", "-", ...
https://github.com/openvinotoolkit/open_model_zoo/blob/5a4232f6c35b4916eb6e8750141f4e45761237ef/demos/speech_recognition_deepspeech_demo/python/asr_utils/audio_features.py#L45-L75
TencentCloud/tencentcloud-sdk-python
3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2
tencentcloud/vpc/v20170312/models.py
python
TemplateLimit.__init__
(self)
r""" :param AddressTemplateMemberLimit: 参数模板IP地址成员配额。 :type AddressTemplateMemberLimit: int :param AddressTemplateGroupMemberLimit: 参数模板IP地址组成员配额。 :type AddressTemplateGroupMemberLimit: int :param ServiceTemplateMemberLimit: 参数模板I协议端口成员配额。 :type ServiceTemplateMemberLimit...
r""" :param AddressTemplateMemberLimit: 参数模板IP地址成员配额。 :type AddressTemplateMemberLimit: int :param AddressTemplateGroupMemberLimit: 参数模板IP地址组成员配额。 :type AddressTemplateGroupMemberLimit: int :param ServiceTemplateMemberLimit: 参数模板I协议端口成员配额。 :type ServiceTemplateMemberLimit...
[ "r", ":", "param", "AddressTemplateMemberLimit", ":", "参数模板IP地址成员配额。", ":", "type", "AddressTemplateMemberLimit", ":", "int", ":", "param", "AddressTemplateGroupMemberLimit", ":", "参数模板IP地址组成员配额。", ":", "type", "AddressTemplateGroupMemberLimit", ":", "int", ":", "param", ...
def __init__(self): r""" :param AddressTemplateMemberLimit: 参数模板IP地址成员配额。 :type AddressTemplateMemberLimit: int :param AddressTemplateGroupMemberLimit: 参数模板IP地址组成员配额。 :type AddressTemplateGroupMemberLimit: int :param ServiceTemplateMemberLimit: 参数模板I协议端口成员配额。 :typ...
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "AddressTemplateMemberLimit", "=", "None", "self", ".", "AddressTemplateGroupMemberLimit", "=", "None", "self", ".", "ServiceTemplateMemberLimit", "=", "None", "self", ".", "ServiceTemplateGroupMemberLimit", "=", ...
https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/vpc/v20170312/models.py#L19116-L19130
tensorflow/mesh
57ed4018e6a173952501b074daabad32b6449f3d
mesh_tensorflow/auto_mtf/graph_interface.py
python
GraphInterface.get_tensor_num_entries
(self, tensor_name, partial_layout=None, mesh_dimension_to_size=None)
return num_entries
The number of entries in a tensor. If partial_layout is specified, then mesh_dimension_to_size must also be. In this case, the number of entries on a single device is returned. Args: tensor_name: a string, name of a tensor in the graph. partial_layout: an optional {string: string}, from MTF di...
The number of entries in a tensor.
[ "The", "number", "of", "entries", "in", "a", "tensor", "." ]
def get_tensor_num_entries(self, tensor_name, partial_layout=None, mesh_dimension_to_size=None): """The number of entries in a tensor. If partial_layout is specified, then mesh_dimension_to_size must also be. In this case, the number of entries on a single device is returned. ...
[ "def", "get_tensor_num_entries", "(", "self", ",", "tensor_name", ",", "partial_layout", "=", "None", ",", "mesh_dimension_to_size", "=", "None", ")", ":", "shape", "=", "self", ".", "get_tensor_shape", "(", "tensor_name", ")", "# We don't have to worry about divisibl...
https://github.com/tensorflow/mesh/blob/57ed4018e6a173952501b074daabad32b6449f3d/mesh_tensorflow/auto_mtf/graph_interface.py#L153-L187
pinterest/mysql_utils
7ab237699b85de8b503b09f36e0309ac807689fe
retirement_queue.py
python
get_protected_hosts
(return_type='tuple')
Get data on all protected hosts Args: return_type - Options are: 'set'- return a set of protected hosts 'tuple' - returns all data regarding protected hosts Returns: A tuple which may be empty, with entries similar to: ({'protecting_user'...
Get data on all protected hosts
[ "Get", "data", "on", "all", "protected", "hosts" ]
def get_protected_hosts(return_type='tuple'): """ Get data on all protected hosts Args: return_type - Options are: 'set'- return a set of protected hosts 'tuple' - returns all data regarding protected hosts Returns: A tuple which may be e...
[ "def", "get_protected_hosts", "(", "return_type", "=", "'tuple'", ")", ":", "if", "return_type", "!=", "'tuple'", "and", "return_type", "!=", "'set'", ":", "raise", "Exception", "(", "'Unsupported return_type '", "'{return_type}'", ".", "format", "(", "return_type",...
https://github.com/pinterest/mysql_utils/blob/7ab237699b85de8b503b09f36e0309ac807689fe/retirement_queue.py#L422-L452
googleapis/python-ndb
e780c81cde1016651afbfcad8180d9912722cf1b
google/cloud/ndb/_cache.py
python
_GlobalCacheDeleteBatch.add
(self, key)
return future
Add a key to delete from the cache. Arguments: key (bytes): The key to delete. Returns: tasklets.Future: Eventual result will be ``None``.
Add a key to delete from the cache.
[ "Add", "a", "key", "to", "delete", "from", "the", "cache", "." ]
def add(self, key): """Add a key to delete from the cache. Arguments: key (bytes): The key to delete. Returns: tasklets.Future: Eventual result will be ``None``. """ future = tasklets.Future(info=self.future_info(key)) self.keys.append(key) ...
[ "def", "add", "(", "self", ",", "key", ")", ":", "future", "=", "tasklets", ".", "Future", "(", "info", "=", "self", ".", "future_info", "(", "key", ")", ")", "self", ".", "keys", ".", "append", "(", "key", ")", "self", ".", "futures", ".", "appe...
https://github.com/googleapis/python-ndb/blob/e780c81cde1016651afbfcad8180d9912722cf1b/google/cloud/ndb/_cache.py#L467-L479
duterscmy/ccks2019-ckbqa-4th-codes
19784e5ffc801b0647d27286b4984e0d24087a47
src/mention_extractor.py
python
MentionExtractor.extract_mentions
(self,question)
return entity_mention
返回字典,实体mentions
返回字典,实体mentions
[ "返回字典,实体mentions" ]
def extract_mentions(self,question): ''' 返回字典,实体mentions ''' entity_mention = {} #使用jieba粗糙分词的方式得到候选mention mentions = [] tokens = jieba.lcut(question) for t in tokens: if t in self.segment_dic: mentions.append(t) ...
[ "def", "extract_mentions", "(", "self", ",", "question", ")", ":", "entity_mention", "=", "{", "}", "#使用jieba粗糙分词的方式得到候选mention", "mentions", "=", "[", "]", "tokens", "=", "jieba", ".", "lcut", "(", "question", ")", "for", "t", "in", "tokens", ":", "if", ...
https://github.com/duterscmy/ccks2019-ckbqa-4th-codes/blob/19784e5ffc801b0647d27286b4984e0d24087a47/src/mention_extractor.py#L42-L67
facebookresearch/ParlAI
e4d59c30eef44f1f67105961b82a83fd28d7d78b
parlai/utils/bpe.py
python
Gpt2BpeHelper.save
(self, dir_name: str, file_name: str)
Save appropriate files. :param dir_name: directory to save. :param file_name: file to save.
Save appropriate files.
[ "Save", "appropriate", "files", "." ]
def save(self, dir_name: str, file_name: str): """ Save appropriate files. :param dir_name: directory to save. :param file_name: file to save. """ out_json_path = os.path.join(dir_name, file_name + "-vocab.json") out_merge_path = os.path.j...
[ "def", "save", "(", "self", ",", "dir_name", ":", "str", ",", "file_name", ":", "str", ")", ":", "out_json_path", "=", "os", ".", "path", ".", "join", "(", "dir_name", ",", "file_name", "+", "\"-vocab.json\"", ")", "out_merge_path", "=", "os", ".", "pa...
https://github.com/facebookresearch/ParlAI/blob/e4d59c30eef44f1f67105961b82a83fd28d7d78b/parlai/utils/bpe.py#L759-L777
kuri65536/python-for-android
26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891
python-modules/twisted/twisted/trial/reporter.py
python
Reporter._printErrors
(self)
Print all of the non-success results to the stream in full.
Print all of the non-success results to the stream in full.
[ "Print", "all", "of", "the", "non", "-", "success", "results", "to", "the", "stream", "in", "full", "." ]
def _printErrors(self): """ Print all of the non-success results to the stream in full. """ self._write('\n') self._printResults('[SKIPPED]', self.skips, lambda x : '%s\n' % x) self._printResults('[TODO]', self.expectedFailures, self._printExpec...
[ "def", "_printErrors", "(", "self", ")", ":", "self", ".", "_write", "(", "'\\n'", ")", "self", ".", "_printResults", "(", "'[SKIPPED]'", ",", "self", ".", "skips", ",", "lambda", "x", ":", "'%s\\n'", "%", "x", ")", "self", ".", "_printResults", "(", ...
https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python-modules/twisted/twisted/trial/reporter.py#L598-L611
mesalock-linux/mesapy
ed546d59a21b36feb93e2309d5c6b75aa0ad95c9
lib-python/2.7/mutex.py
python
mutex.lock
(self, function, argument)
Lock a mutex, call the function with supplied argument when it is acquired. If the mutex is already locked, place function and argument in the queue.
Lock a mutex, call the function with supplied argument when it is acquired. If the mutex is already locked, place function and argument in the queue.
[ "Lock", "a", "mutex", "call", "the", "function", "with", "supplied", "argument", "when", "it", "is", "acquired", ".", "If", "the", "mutex", "is", "already", "locked", "place", "function", "and", "argument", "in", "the", "queue", "." ]
def lock(self, function, argument): """Lock a mutex, call the function with supplied argument when it is acquired. If the mutex is already locked, place function and argument in the queue.""" if self.testandset(): function(argument) else: self.queue.appen...
[ "def", "lock", "(", "self", ",", "function", ",", "argument", ")", ":", "if", "self", ".", "testandset", "(", ")", ":", "function", "(", "argument", ")", "else", ":", "self", ".", "queue", ".", "append", "(", "(", "function", ",", "argument", ")", ...
https://github.com/mesalock-linux/mesapy/blob/ed546d59a21b36feb93e2309d5c6b75aa0ad95c9/lib-python/2.7/mutex.py#L39-L46
carla-simulator/scenario_runner
f4d00d88eda4212a1e119515c96281a4be5c234e
srunner/scenarios/object_crash_vehicle.py
python
StationaryObjectCrossing._create_test_criteria
(self)
return criteria
A list of all test criteria will be created that is later used in parallel behavior tree.
A list of all test criteria will be created that is later used in parallel behavior tree.
[ "A", "list", "of", "all", "test", "criteria", "will", "be", "created", "that", "is", "later", "used", "in", "parallel", "behavior", "tree", "." ]
def _create_test_criteria(self): """ A list of all test criteria will be created that is later used in parallel behavior tree. """ criteria = [] collision_criterion = CollisionTest(self.ego_vehicles[0]) criteria.append(collision_criterion) return criteri...
[ "def", "_create_test_criteria", "(", "self", ")", ":", "criteria", "=", "[", "]", "collision_criterion", "=", "CollisionTest", "(", "self", ".", "ego_vehicles", "[", "0", "]", ")", "criteria", ".", "append", "(", "collision_criterion", ")", "return", "criteria...
https://github.com/carla-simulator/scenario_runner/blob/f4d00d88eda4212a1e119515c96281a4be5c234e/srunner/scenarios/object_crash_vehicle.py#L109-L119
edgewall/trac
beb3e4eaf1e0a456d801a50a8614ecab06de29fc
trac/util/html.py
python
TracHTMLSanitizer.sanitize
(self, html)
return Markup(transform.out.getvalue())
Transforms the incoming HTML by removing anything's that deemed unsafe. :param html: the input HTML :type: str :return: the sanitized content :rtype: Markup
Transforms the incoming HTML by removing anything's that deemed unsafe.
[ "Transforms", "the", "incoming", "HTML", "by", "removing", "anything", "s", "that", "deemed", "unsafe", "." ]
def sanitize(self, html): """Transforms the incoming HTML by removing anything's that deemed unsafe. :param html: the input HTML :type: str :return: the sanitized content :rtype: Markup """ transform = HTMLSanitization(self, io.StringIO()) transf...
[ "def", "sanitize", "(", "self", ",", "html", ")", ":", "transform", "=", "HTMLSanitization", "(", "self", ",", "io", ".", "StringIO", "(", ")", ")", "transform", ".", "feed", "(", "html", ")", "transform", ".", "close", "(", ")", "return", "Markup", ...
https://github.com/edgewall/trac/blob/beb3e4eaf1e0a456d801a50a8614ecab06de29fc/trac/util/html.py#L608-L621
a312863063/seeprettyface-generator-yellow
c75b95b56c40036d00b35f3e140cc4a45598e077
dnnlib/tflib/network.py
python
Network._init_graph
(self)
[]
def _init_graph(self) -> None: # Collect inputs. self.input_names = [] for param in inspect.signature(self._build_func).parameters.values(): if param.kind == param.POSITIONAL_OR_KEYWORD and param.default is param.empty: self.input_names.append(param.name) se...
[ "def", "_init_graph", "(", "self", ")", "->", "None", ":", "# Collect inputs.", "self", ".", "input_names", "=", "[", "]", "for", "param", "in", "inspect", ".", "signature", "(", "self", ".", "_build_func", ")", ".", "parameters", ".", "values", "(", ")"...
https://github.com/a312863063/seeprettyface-generator-yellow/blob/c75b95b56c40036d00b35f3e140cc4a45598e077/dnnlib/tflib/network.py#L126-L186
WerWolv/EdiZon_CheatsConfigsAndScripts
d16d36c7509c01dca770f402babd83ff2e9ae6e7
Scripts/lib/python3.5/lzma.py
python
LZMAFile.writable
(self)
return self._mode == _MODE_WRITE
Return whether the file was opened for writing.
Return whether the file was opened for writing.
[ "Return", "whether", "the", "file", "was", "opened", "for", "writing", "." ]
def writable(self): """Return whether the file was opened for writing.""" self._check_not_closed() return self._mode == _MODE_WRITE
[ "def", "writable", "(", "self", ")", ":", "self", ".", "_check_not_closed", "(", ")", "return", "self", ".", "_mode", "==", "_MODE_WRITE" ]
https://github.com/WerWolv/EdiZon_CheatsConfigsAndScripts/blob/d16d36c7509c01dca770f402babd83ff2e9ae6e7/Scripts/lib/python3.5/lzma.py#L175-L178
xuanzebi/BERT-CH-NER
24bf95411e831281ffc6c13f3ea9382870a17d64
bert-master/extract_features.py
python
input_fn_builder
(features, seq_length)
return input_fn
Creates an `input_fn` closure to be passed to TPUEstimator.
Creates an `input_fn` closure to be passed to TPUEstimator.
[ "Creates", "an", "input_fn", "closure", "to", "be", "passed", "to", "TPUEstimator", "." ]
def input_fn_builder(features, seq_length): """Creates an `input_fn` closure to be passed to TPUEstimator.""" all_unique_ids = [] all_input_ids = [] all_input_mask = [] all_input_type_ids = [] for feature in features: all_unique_ids.append(feature.unique_id) all_input_ids.append(feature.input_ids)...
[ "def", "input_fn_builder", "(", "features", ",", "seq_length", ")", ":", "all_unique_ids", "=", "[", "]", "all_input_ids", "=", "[", "]", "all_input_mask", "=", "[", "]", "all_input_type_ids", "=", "[", "]", "for", "feature", "in", "features", ":", "all_uniq...
https://github.com/xuanzebi/BERT-CH-NER/blob/24bf95411e831281ffc6c13f3ea9382870a17d64/bert-master/extract_features.py#L100-L145
Nuitka/Nuitka
39262276993757fa4e299f497654065600453fc9
nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Node/FS.py
python
Dir.glob
(self, pathname, ondisk=True, source=False, strings=False, exclude=None)
return sorted(result, key=lambda a: str(a))
Returns a list of Nodes (or strings) matching a specified pathname pattern. Pathname patterns follow UNIX shell semantics: * matches any-length strings of any characters, ? matches any character, and [] can enclose lists or ranges of characters. Matches do not span directory s...
Returns a list of Nodes (or strings) matching a specified pathname pattern.
[ "Returns", "a", "list", "of", "Nodes", "(", "or", "strings", ")", "matching", "a", "specified", "pathname", "pattern", "." ]
def glob(self, pathname, ondisk=True, source=False, strings=False, exclude=None): """ Returns a list of Nodes (or strings) matching a specified pathname pattern. Pathname patterns follow UNIX shell semantics: * matches any-length strings of any characters, ? matches any charact...
[ "def", "glob", "(", "self", ",", "pathname", ",", "ondisk", "=", "True", ",", "source", "=", "False", ",", "strings", "=", "False", ",", "exclude", "=", "None", ")", ":", "dirname", ",", "basename", "=", "os", ".", "path", ".", "split", "(", "pathn...
https://github.com/Nuitka/Nuitka/blob/39262276993757fa4e299f497654065600453fc9/nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Node/FS.py#L2131-L2189
biopython/biopython
2dd97e71762af7b046d7f7f8a4f1e38db6b06c86
Bio/Align/__init__.py
python
Alignment.__getitem__
(self, key)
Return self[key]. Indices of the form self[:, :] return a copy of the Alignment object; self[:, i:] self[:, :j] self[:, i:j] self[:, iterable] (where iterable returns integers) return a new Alignment object spanning the selected columns; self...
Return self[key].
[ "Return", "self", "[", "key", "]", "." ]
def __getitem__(self, key): """Return self[key]. Indices of the form self[:, :] return a copy of the Alignment object; self[:, i:] self[:, :j] self[:, i:j] self[:, iterable] (where iterable returns integers) return a new Alignment object spann...
[ "def", "__getitem__", "(", "self", ",", "key", ")", ":", "import", "numpy", "if", "isinstance", "(", "key", ",", "slice", ")", ":", "if", "key", ".", "indices", "(", "len", "(", "self", ")", ")", "==", "(", "0", ",", "2", ",", "1", ")", ":", ...
https://github.com/biopython/biopython/blob/2dd97e71762af7b046d7f7f8a4f1e38db6b06c86/Bio/Align/__init__.py#L1245-L1592
networkx/networkx
1620568e36702b1cfeaf1c0277b167b6cb93e48d
networkx/algorithms/isomorphism/ismags.py
python
ISMAGS._find_node_edge_color
(graph, node_colors, edge_colors)
return node_edge_colors
For every node in graph, come up with a color that combines 1) the color of the node, and 2) the number of edges of a color to each type of node.
For every node in graph, come up with a color that combines 1) the color of the node, and 2) the number of edges of a color to each type of node.
[ "For", "every", "node", "in", "graph", "come", "up", "with", "a", "color", "that", "combines", "1", ")", "the", "color", "of", "the", "node", "and", "2", ")", "the", "number", "of", "edges", "of", "a", "color", "to", "each", "type", "of", "node", "...
def _find_node_edge_color(graph, node_colors, edge_colors): """ For every node in graph, come up with a color that combines 1) the color of the node, and 2) the number of edges of a color to each type of node. """ counts = defaultdict(lambda: defaultdict(int)) for...
[ "def", "_find_node_edge_color", "(", "graph", ",", "node_colors", ",", "edge_colors", ")", ":", "counts", "=", "defaultdict", "(", "lambda", ":", "defaultdict", "(", "int", ")", ")", "for", "node1", ",", "node2", "in", "graph", ".", "edges", ":", "if", "...
https://github.com/networkx/networkx/blob/1620568e36702b1cfeaf1c0277b167b6cb93e48d/networkx/algorithms/isomorphism/ismags.py#L688-L710
quantumlib/Cirq
89f88b01d69222d3f1ec14d649b7b3a85ed9211f
cirq-google/cirq_google/engine/engine_client.py
python
EngineClient.remove_job_labels
( self, project_id: str, program_id: str, job_id: str, label_keys: List[str] )
return job
Removes labels with given keys from the labels of a previously created quantum job. Args: project_id: A project_id of the parent Google Cloud Project. program_id: Unique ID of the program within the parent project. job_id: Unique ID of the job within the parent progr...
Removes labels with given keys from the labels of a previously created quantum job.
[ "Removes", "labels", "with", "given", "keys", "from", "the", "labels", "of", "a", "previously", "created", "quantum", "job", "." ]
def remove_job_labels( self, project_id: str, program_id: str, job_id: str, label_keys: List[str] ) -> qtypes.QuantumJob: """Removes labels with given keys from the labels of a previously created quantum job. Args: project_id: A project_id of the parent Google Cloud Proj...
[ "def", "remove_job_labels", "(", "self", ",", "project_id", ":", "str", ",", "program_id", ":", "str", ",", "job_id", ":", "str", ",", "label_keys", ":", "List", "[", "str", "]", ")", "->", "qtypes", ".", "QuantumJob", ":", "job", "=", "self", ".", "...
https://github.com/quantumlib/Cirq/blob/89f88b01d69222d3f1ec14d649b7b3a85ed9211f/cirq-google/cirq_google/engine/engine_client.py#L536-L559
numenta/nupic
b9ebedaf54f49a33de22d8d44dff7c765cdb5548
external/linux32/lib/python2.6/site-packages/pkg_resources.py
python
Environment.obtain
(self, requirement, installer=None)
Obtain a distribution matching `requirement` (e.g. via download) Obtain a distro that matches requirement (e.g. via download). In the base ``Environment`` class, this routine just returns ``installer(requirement)``, unless `installer` is None, in which case None is returned instead. T...
Obtain a distribution matching `requirement` (e.g. via download)
[ "Obtain", "a", "distribution", "matching", "requirement", "(", "e", ".", "g", ".", "via", "download", ")" ]
def obtain(self, requirement, installer=None): """Obtain a distribution matching `requirement` (e.g. via download) Obtain a distro that matches requirement (e.g. via download). In the base ``Environment`` class, this routine just returns ``installer(requirement)``, unless `installer` i...
[ "def", "obtain", "(", "self", ",", "requirement", ",", "installer", "=", "None", ")", ":", "if", "installer", "is", "not", "None", ":", "return", "installer", "(", "requirement", ")" ]
https://github.com/numenta/nupic/blob/b9ebedaf54f49a33de22d8d44dff7c765cdb5548/external/linux32/lib/python2.6/site-packages/pkg_resources.py#L760-L770
mozilla/treeherder
228750c5774cfbe7d395e10e2c84665d9122496d
treeherder/services/pulse/exchange.py
python
get_exchange
(connection, name, create=False)
return bound_exchange
Get a Kombu Exchange object using the passed in name. Can create an Exchange but this is typically not wanted in production-like environments and only useful for testing.
Get a Kombu Exchange object using the passed in name.
[ "Get", "a", "Kombu", "Exchange", "object", "using", "the", "passed", "in", "name", "." ]
def get_exchange(connection, name, create=False): """ Get a Kombu Exchange object using the passed in name. Can create an Exchange but this is typically not wanted in production-like environments and only useful for testing. """ exchange = Exchange(name, type="topic", passive=not create) #...
[ "def", "get_exchange", "(", "connection", ",", "name", ",", "create", "=", "False", ")", ":", "exchange", "=", "Exchange", "(", "name", ",", "type", "=", "\"topic\"", ",", "passive", "=", "not", "create", ")", "# bind the exchange to our connection so operations...
https://github.com/mozilla/treeherder/blob/228750c5774cfbe7d395e10e2c84665d9122496d/treeherder/services/pulse/exchange.py#L4-L20
KhronosGroup/glTF-Blender-Exporter
dd7a3dbd8f43a79d572e7c45f4215f770bb92a37
scripts/addons/io_scene_gltf2/gltf2_get.py
python
get_light_index
(glTF, name)
return -1
Return the light index in the glTF array.
Return the light index in the glTF array.
[ "Return", "the", "light", "index", "in", "the", "glTF", "array", "." ]
def get_light_index(glTF, name): """ Return the light index in the glTF array. """ if glTF.get('extensions') is None: return -1 extensions = glTF['extensions'] if extensions.get('KHR_lights') is None: return -1 khr_lights = extensions['KHR_lights'] if...
[ "def", "get_light_index", "(", "glTF", ",", "name", ")", ":", "if", "glTF", ".", "get", "(", "'extensions'", ")", "is", "None", ":", "return", "-", "1", "extensions", "=", "glTF", "[", "'extensions'", "]", "if", "extensions", ".", "get", "(", "'KHR_lig...
https://github.com/KhronosGroup/glTF-Blender-Exporter/blob/dd7a3dbd8f43a79d572e7c45f4215f770bb92a37/scripts/addons/io_scene_gltf2/gltf2_get.py#L287-L314
holoviz/holoviews
cc6b27f01710402fdfee2aeef1507425ca78c91f
holoviews/core/spaces.py
python
HoloMap.overlay
(self, dimensions=None, **kwargs)
Group by supplied dimension(s) and overlay each group Groups data by supplied dimension(s) overlaying the groups along the dimension(s). Args: dimensions: Dimension(s) of dimensions to group by Returns: NdOverlay object(s) with supplied dimensions
Group by supplied dimension(s) and overlay each group
[ "Group", "by", "supplied", "dimension", "(", "s", ")", "and", "overlay", "each", "group" ]
def overlay(self, dimensions=None, **kwargs): """Group by supplied dimension(s) and overlay each group Groups data by supplied dimension(s) overlaying the groups along the dimension(s). Args: dimensions: Dimension(s) of dimensions to group by Returns: N...
[ "def", "overlay", "(", "self", ",", "dimensions", "=", "None", ",", "*", "*", "kwargs", ")", ":", "dimensions", "=", "self", ".", "_valid_dimensions", "(", "dimensions", ")", "if", "len", "(", "dimensions", ")", "==", "self", ".", "ndims", ":", "with",...
https://github.com/holoviz/holoviews/blob/cc6b27f01710402fdfee2aeef1507425ca78c91f/holoviews/core/spaces.py#L47-L65
ruotianluo/Image_Captioning_AI_Challenger
ad230614efb8b964b4ced49a3622f4585d4de1cc
scripts/prepro_ngrams.py
python
cook_refs
(refs, n=4)
return [precook(ref, n) for ref in refs]
Takes a list of reference sentences for a single segment and returns an object that encapsulates everything that BLEU needs to know about them. :param refs: list of string : reference sentences for some image :param n: int : number of ngrams for which (ngram) representation is calculated :return: re...
Takes a list of reference sentences for a single segment and returns an object that encapsulates everything that BLEU needs to know about them. :param refs: list of string : reference sentences for some image :param n: int : number of ngrams for which (ngram) representation is calculated :return: re...
[ "Takes", "a", "list", "of", "reference", "sentences", "for", "a", "single", "segment", "and", "returns", "an", "object", "that", "encapsulates", "everything", "that", "BLEU", "needs", "to", "know", "about", "them", ".", ":", "param", "refs", ":", "list", "...
def cook_refs(refs, n=4): ## lhuang: oracle will call with "average" '''Takes a list of reference sentences for a single segment and returns an object that encapsulates everything that BLEU needs to know about them. :param refs: list of string : reference sentences for some image :param n: int : num...
[ "def", "cook_refs", "(", "refs", ",", "n", "=", "4", ")", ":", "## lhuang: oracle will call with \"average\"", "return", "[", "precook", "(", "ref", ",", "n", ")", "for", "ref", "in", "refs", "]" ]
https://github.com/ruotianluo/Image_Captioning_AI_Challenger/blob/ad230614efb8b964b4ced49a3622f4585d4de1cc/scripts/prepro_ngrams.py#L49-L57
mila-iqia/myia
56774a39579b4ec4123f44843ad4ca688acc859b
myia/monomorphize.py
python
_MonoRemapper.__init__
( self, graphs, inlines, manager, relation, graph_relation, clone_constants, engine, graph_repl, fv_function, )
Initialize the _MonoRemapper.
Initialize the _MonoRemapper.
[ "Initialize", "the", "_MonoRemapper", "." ]
def __init__( self, graphs, inlines, manager, relation, graph_relation, clone_constants, engine, graph_repl, fv_function, ): """Initialize the _MonoRemapper.""" super().__init__( graphs=graphs, in...
[ "def", "__init__", "(", "self", ",", "graphs", ",", "inlines", ",", "manager", ",", "relation", ",", "graph_relation", ",", "clone_constants", ",", "engine", ",", "graph_repl", ",", "fv_function", ",", ")", ":", "super", "(", ")", ".", "__init__", "(", "...
https://github.com/mila-iqia/myia/blob/56774a39579b4ec4123f44843ad4ca688acc859b/myia/monomorphize.py#L739-L763
Tautulli/Tautulli
2410eb33805aaac4bd1c5dad0f71e4f15afaf742
lib/pyparsing/core.py
python
ParseExpression.ignore_whitespace
(self, recursive=True)
return self
Extends ``ignore_whitespace`` defined in base class, and also invokes ``leave_whitespace`` on all contained expressions.
Extends ``ignore_whitespace`` defined in base class, and also invokes ``leave_whitespace`` on all contained expressions.
[ "Extends", "ignore_whitespace", "defined", "in", "base", "class", "and", "also", "invokes", "leave_whitespace", "on", "all", "contained", "expressions", "." ]
def ignore_whitespace(self, recursive=True): """ Extends ``ignore_whitespace`` defined in base class, and also invokes ``leave_whitespace`` on all contained expressions. """ super().ignore_whitespace(recursive) if recursive: self.exprs = [e.copy() for e in ...
[ "def", "ignore_whitespace", "(", "self", ",", "recursive", "=", "True", ")", ":", "super", "(", ")", ".", "ignore_whitespace", "(", "recursive", ")", "if", "recursive", ":", "self", ".", "exprs", "=", "[", "e", ".", "copy", "(", ")", "for", "e", "in"...
https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/pyparsing/core.py#L3619-L3629
garnaat/kappa
a06a0047cc51f6a210beec4028a5fbe8ebcd5c53
kappa/restapi.py
python
RestApi.api_exists
(self)
return self._get_api()
[]
def api_exists(self): return self._get_api()
[ "def", "api_exists", "(", "self", ")", ":", "return", "self", ".", "_get_api", "(", ")" ]
https://github.com/garnaat/kappa/blob/a06a0047cc51f6a210beec4028a5fbe8ebcd5c53/kappa/restapi.py#L197-L198
tobegit3hub/deep_image_model
8a53edecd9e00678b278bb10f6fb4bdb1e4ee25e
java_predict_client/src/main/proto/tensorflow/python/ops/gradients_impl.py
python
_MultiDeviceAddN
(tensor_list)
return math_ops.add_n(summands)
Adds tensors from potentially multiple devices.
Adds tensors from potentially multiple devices.
[ "Adds", "tensors", "from", "potentially", "multiple", "devices", "." ]
def _MultiDeviceAddN(tensor_list): """Adds tensors from potentially multiple devices.""" # Basic function structure comes from control_flow_ops.group(). # Sort tensors according to their devices. tensors_on_device = collections.defaultdict(lambda: []) for tensor in tensor_list: tensors_on_device[tensor.de...
[ "def", "_MultiDeviceAddN", "(", "tensor_list", ")", ":", "# Basic function structure comes from control_flow_ops.group().", "# Sort tensors according to their devices.", "tensors_on_device", "=", "collections", ".", "defaultdict", "(", "lambda", ":", "[", "]", ")", "for", "te...
https://github.com/tobegit3hub/deep_image_model/blob/8a53edecd9e00678b278bb10f6fb4bdb1e4ee25e/java_predict_client/src/main/proto/tensorflow/python/ops/gradients_impl.py#L638-L660
wikimedia/pywikibot
81a01ffaec7271bf5b4b170f85a80388420a4e78
scripts/welcome.py
python
WelcomeBot.define_sign
(self, force=False)
return self._random_signature
Setup signature.
Setup signature.
[ "Setup", "signature", "." ]
def define_sign(self, force=False) -> List[str]: """Setup signature.""" if hasattr(self, '_random_signature') and not force: return self._random_signature sign_text = '' creg = re.compile(r'^\* ?(.*?)$', re.M) if not globalvar.sign_file_name: sign_page_na...
[ "def", "define_sign", "(", "self", ",", "force", "=", "False", ")", "->", "List", "[", "str", "]", ":", "if", "hasattr", "(", "self", ",", "'_random_signature'", ")", "and", "not", "force", ":", "return", "self", ".", "_random_signature", "sign_text", "=...
https://github.com/wikimedia/pywikibot/blob/81a01ffaec7271bf5b4b170f85a80388420a4e78/scripts/welcome.py#L727-L768
twke18/Adaptive_Affinity_Fields
8488aa6ad16022ab4b89fb8626386997559cb951
pyscripts/train/train_affinity_mgpu.py
python
save
(saver, sess, logdir, step)
Save the trained weights. Args: saver: TensorFlow Saver object. sess: TensorFlow session. logdir: path to the snapshots directory. step: current training step.
Save the trained weights. Args: saver: TensorFlow Saver object. sess: TensorFlow session. logdir: path to the snapshots directory. step: current training step.
[ "Save", "the", "trained", "weights", ".", "Args", ":", "saver", ":", "TensorFlow", "Saver", "object", ".", "sess", ":", "TensorFlow", "session", ".", "logdir", ":", "path", "to", "the", "snapshots", "directory", ".", "step", ":", "current", "training", "st...
def save(saver, sess, logdir, step): """Save the trained weights. Args: saver: TensorFlow Saver object. sess: TensorFlow session. logdir: path to the snapshots directory. step: current training step. """ model_name = 'model.ckpt' checkpoint_path = os.path.join(logdir, model_name) if...
[ "def", "save", "(", "saver", ",", "sess", ",", "logdir", ",", "step", ")", ":", "model_name", "=", "'model.ckpt'", "checkpoint_path", "=", "os", ".", "path", ".", "join", "(", "logdir", ",", "model_name", ")", "if", "not", "os", ".", "path", ".", "ex...
https://github.com/twke18/Adaptive_Affinity_Fields/blob/8488aa6ad16022ab4b89fb8626386997559cb951/pyscripts/train/train_affinity_mgpu.py#L89-L104
fzlee/alipay
0f8eab30fea7adb43284182cc6bcac08f51b2e08
alipay/__init__.py
python
DCAliPay.load_alipay_public_key_string
(self)
return OpenSSL.crypto.dump_publickey( OpenSSL.crypto.FILETYPE_PEM, cert.get_pubkey() ).decode("utf-8")
[]
def load_alipay_public_key_string(self): cert = OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_PEM, self._alipay_public_key_cert_string ) return OpenSSL.crypto.dump_publickey( OpenSSL.crypto.FILETYPE_PEM, cert.get_pubkey() ).decode("utf-8")
[ "def", "load_alipay_public_key_string", "(", "self", ")", ":", "cert", "=", "OpenSSL", ".", "crypto", ".", "load_certificate", "(", "OpenSSL", ".", "crypto", ".", "FILETYPE_PEM", ",", "self", ".", "_alipay_public_key_cert_string", ")", "return", "OpenSSL", ".", ...
https://github.com/fzlee/alipay/blob/0f8eab30fea7adb43284182cc6bcac08f51b2e08/alipay/__init__.py#L691-L697
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/components/acmeda/sensor.py
python
AcmedaBattery.name
(self)
return f"{super().name} Battery"
Return the name of roller.
Return the name of roller.
[ "Return", "the", "name", "of", "roller", "." ]
def name(self): """Return the name of roller.""" return f"{super().name} Battery"
[ "def", "name", "(", "self", ")", ":", "return", "f\"{super().name} Battery\"" ]
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/acmeda/sensor.py#L48-L50
andresriancho/w3af
cd22e5252243a87aaa6d0ddea47cf58dacfe00a9
w3af/plugins/attack/db/sqlmap/lib/utils/hash.py
python
vbulletin_passwd
(password, salt, **kwargs)
return "%s:%s" % (md5("%s%s" % (md5(password).hexdigest(), salt)).hexdigest(), salt)
Reference: https://stackoverflow.com/a/2202810 >>> vbulletin_passwd(password='testpass', salt='salt') '85c4d8ea77ebef2236fb7e9d24ba9482:salt'
Reference: https://stackoverflow.com/a/2202810
[ "Reference", ":", "https", ":", "//", "stackoverflow", ".", "com", "/", "a", "/", "2202810" ]
def vbulletin_passwd(password, salt, **kwargs): """ Reference: https://stackoverflow.com/a/2202810 >>> vbulletin_passwd(password='testpass', salt='salt') '85c4d8ea77ebef2236fb7e9d24ba9482:salt' """ return "%s:%s" % (md5("%s%s" % (md5(password).hexdigest(), salt)).hexdigest(), salt)
[ "def", "vbulletin_passwd", "(", "password", ",", "salt", ",", "*", "*", "kwargs", ")", ":", "return", "\"%s:%s\"", "%", "(", "md5", "(", "\"%s%s\"", "%", "(", "md5", "(", "password", ")", ".", "hexdigest", "(", ")", ",", "salt", ")", ")", ".", "hex...
https://github.com/andresriancho/w3af/blob/cd22e5252243a87aaa6d0ddea47cf58dacfe00a9/w3af/plugins/attack/db/sqlmap/lib/utils/hash.py#L449-L457
FederatedAI/FATE
32540492623568ecd1afcb367360133616e02fa3
python/federatedml/util/sample_weight.py
python
SampleWeight.transform_weighted_instance
(self, data_instances, weight_loc)
return SampleWeight.assign_sample_weight(data_instances, self.class_weight_dict, weight_loc, self.normalize)
[]
def transform_weighted_instance(self, data_instances, weight_loc): if self.class_weight and self.class_weight == 'balanced': self.class_weight_dict = SampleWeight.get_class_weight(data_instances) else: if self.class_weight_dict is None: self.class_weight_dict = se...
[ "def", "transform_weighted_instance", "(", "self", ",", "data_instances", ",", "weight_loc", ")", ":", "if", "self", ".", "class_weight", "and", "self", ".", "class_weight", "==", "'balanced'", ":", "self", ".", "class_weight_dict", "=", "SampleWeight", ".", "ge...
https://github.com/FederatedAI/FATE/blob/32540492623568ecd1afcb367360133616e02fa3/python/federatedml/util/sample_weight.py#L102-L108
MichiganCOG/ViP
74776f2575bd5339ba39c784bbda4f04cc859add
train.py
python
train
(**args)
Evaluate selected model Args: rerun (Int): Integer indicating number of repetitions for the select experiment seed (Int): Integer indicating set seed for random state save_dir (String): Top level directory to generate results folder model ...
Evaluate selected model Args: rerun (Int): Integer indicating number of repetitions for the select experiment seed (Int): Integer indicating set seed for random state save_dir (String): Top level directory to generate results folder model ...
[ "Evaluate", "selected", "model", "Args", ":", "rerun", "(", "Int", ")", ":", "Integer", "indicating", "number", "of", "repetitions", "for", "the", "select", "experiment", "seed", "(", "Int", ")", ":", "Integer", "indicating", "set", "seed", "for", "random", ...
def train(**args): """ Evaluate selected model Args: rerun (Int): Integer indicating number of repetitions for the select experiment seed (Int): Integer indicating set seed for random state save_dir (String): Top level directory to generate resu...
[ "def", "train", "(", "*", "*", "args", ")", ":", "print", "(", "\"\\n############################################################################\\n\"", ")", "print", "(", "\"Experimental Setup: \"", ",", "args", ")", "print", "(", "\"\\n######################################...
https://github.com/MichiganCOG/ViP/blob/74776f2575bd5339ba39c784bbda4f04cc859add/train.py#L21-L252
telegraphic/hickle
a5aac2db4e236d90990e3387c5822b466e8e84fa
hickle/loaders/load_numpy.py
python
create_np_scalar_dataset
(py_obj, h_group, name, **kwargs)
return d,()
dumps an numpy.dtype object to h5py file Parameters ---------- py_obj (numpy.scalar): python object to dump; should be a numpy scalar, e.g. numpy.float16(1) h_group (h5.File.group): group to dump data into. name (str): the name of the resulting dataset kwargs (dict)...
dumps an numpy.dtype object to h5py file
[ "dumps", "an", "numpy", ".", "dtype", "object", "to", "h5py", "file" ]
def create_np_scalar_dataset(py_obj, h_group, name, **kwargs): """ dumps an numpy.dtype object to h5py file Parameters ---------- py_obj (numpy.scalar): python object to dump; should be a numpy scalar, e.g. numpy.float16(1) h_group (h5.File.group): group to dump data into. na...
[ "def", "create_np_scalar_dataset", "(", "py_obj", ",", "h_group", ",", "name", ",", "*", "*", "kwargs", ")", ":", "d", "=", "h_group", ".", "create_dataset", "(", "name", ",", "data", "=", "py_obj", ",", "*", "*", "no_compression", "(", "kwargs", ")", ...
https://github.com/telegraphic/hickle/blob/a5aac2db4e236d90990e3387c5822b466e8e84fa/hickle/loaders/load_numpy.py#L21-L46
avalonstrel/GatedConvolution_pytorch
0a49013a70e77cc484ab45a5da535c2ac003b252
data/base_dataset.py
python
NoriBaseDataset.__len__
(self)
return len(self.nori_list)
[]
def __len__(self): return len(self.nori_list)
[ "def", "__len__", "(", "self", ")", ":", "return", "len", "(", "self", ".", "nori_list", ")" ]
https://github.com/avalonstrel/GatedConvolution_pytorch/blob/0a49013a70e77cc484ab45a5da535c2ac003b252/data/base_dataset.py#L70-L71
tobegit3hub/deep_image_model
8a53edecd9e00678b278bb10f6fb4bdb1e4ee25e
java_predict_client/src/main/proto/tensorflow/contrib/distributions/python/ops/normal.py
python
_kl_normal_normal
(n_a, n_b, name=None)
Calculate the batched KL divergence KL(n_a || n_b) with n_a and n_b Normal. Args: n_a: instance of a Normal distribution object. n_b: instance of a Normal distribution object. name: (optional) Name to use for created operations. default is "kl_normal_normal". Returns: Batchwise KL(n_a || n_b...
Calculate the batched KL divergence KL(n_a || n_b) with n_a and n_b Normal.
[ "Calculate", "the", "batched", "KL", "divergence", "KL", "(", "n_a", "||", "n_b", ")", "with", "n_a", "and", "n_b", "Normal", "." ]
def _kl_normal_normal(n_a, n_b, name=None): """Calculate the batched KL divergence KL(n_a || n_b) with n_a and n_b Normal. Args: n_a: instance of a Normal distribution object. n_b: instance of a Normal distribution object. name: (optional) Name to use for created operations. default is "kl_normal...
[ "def", "_kl_normal_normal", "(", "n_a", ",", "n_b", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"kl_normal_normal\"", ",", "[", "n_a", ".", "mu", ",", "n_b", ".", "mu", "]", ")", ":", "one", "=", "const...
https://github.com/tobegit3hub/deep_image_model/blob/8a53edecd9e00678b278bb10f6fb4bdb1e4ee25e/java_predict_client/src/main/proto/tensorflow/contrib/distributions/python/ops/normal.py#L229-L249
TencentCloud/tencentcloud-sdk-python
3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2
tencentcloud/vm/v20201229/models.py
python
AudioResultDetailMoanResult.__init__
(self)
r""" :param Label: 该字段用于返回检测结果需要检测的内容类型,此处固定为**Moan**(呻吟)以调用呻吟检测功能。 注意:此字段可能返回 null,表示取不到有效值。 :type Label: str :param Score: 该字段用于返回呻吟检测的置信度,取值范围:0(**置信度最低**)-100(**置信度最高**),越高代表音频越有可能属于呻吟内容。 :type Score: int :param StartTime: 该字段用于返回对应呻吟标签的片段在音频文件内的开始时间,单位为毫秒。 :type Star...
r""" :param Label: 该字段用于返回检测结果需要检测的内容类型,此处固定为**Moan**(呻吟)以调用呻吟检测功能。 注意:此字段可能返回 null,表示取不到有效值。 :type Label: str :param Score: 该字段用于返回呻吟检测的置信度,取值范围:0(**置信度最低**)-100(**置信度最高**),越高代表音频越有可能属于呻吟内容。 :type Score: int :param StartTime: 该字段用于返回对应呻吟标签的片段在音频文件内的开始时间,单位为毫秒。 :type Star...
[ "r", ":", "param", "Label", ":", "该字段用于返回检测结果需要检测的内容类型,此处固定为", "**", "Moan", "**", "(呻吟)以调用呻吟检测功能。", "注意:此字段可能返回", "null,表示取不到有效值。", ":", "type", "Label", ":", "str", ":", "param", "Score", ":", "该字段用于返回呻吟检测的置信度,取值范围:0(", "**", "置信度最低", "**", ")", "-", "100(", ...
def __init__(self): r""" :param Label: 该字段用于返回检测结果需要检测的内容类型,此处固定为**Moan**(呻吟)以调用呻吟检测功能。 注意:此字段可能返回 null,表示取不到有效值。 :type Label: str :param Score: 该字段用于返回呻吟检测的置信度,取值范围:0(**置信度最低**)-100(**置信度最高**),越高代表音频越有可能属于呻吟内容。 :type Score: int :param StartTime: 该字段用于返回对应呻吟标签的片段在音频文件内的开始...
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "Label", "=", "None", "self", ".", "Score", "=", "None", "self", ".", "StartTime", "=", "None", "self", ".", "EndTime", "=", "None", "self", ".", "SubLabelCode", "=", "None", "self", ".", "SubLab...
https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/vm/v20201229/models.py#L167-L189
City-Bureau/city-scrapers
b295d0aa612e3979a9fccab7c5f55ecea9ed074c
city_scrapers/spiders/cook_emergency_telephone.py
python
CookEmergencyTelephoneSpider.parse
(self, response)
`parse` should always `yield` Meeting items. Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping needs.
`parse` should always `yield` Meeting items.
[ "parse", "should", "always", "yield", "Meeting", "items", "." ]
def parse(self, response): """ `parse` should always `yield` Meeting items. Change the `_parse_title`, `_parse_start`, etc methods to fit your scraping needs. """ for link in response.css(".sliding_box a"): link_text = link.css("*::text").get() ...
[ "def", "parse", "(", "self", ",", "response", ")", ":", "for", "link", "in", "response", ".", "css", "(", "\".sliding_box a\"", ")", ":", "link_text", "=", "link", ".", "css", "(", "\"*::text\"", ")", ".", "get", "(", ")", "if", "\"Minutes\"", "in", ...
https://github.com/City-Bureau/city-scrapers/blob/b295d0aa612e3979a9fccab7c5f55ecea9ed074c/city_scrapers/spiders/cook_emergency_telephone.py#L30-L53
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_utils/library/yedit.py
python
Yedit.write
(self)
return (True, self.yaml_dict)
write to file
write to file
[ "write", "to", "file" ]
def write(self): ''' write to file ''' if not self.filename: raise YeditException('Please specify a filename.') if self.backup and self.file_exists(): shutil.copy(self.filename, '{}{}'.format(self.filename, self.backup_ext)) # Try to set format attributes if sup...
[ "def", "write", "(", "self", ")", ":", "if", "not", "self", ".", "filename", ":", "raise", "YeditException", "(", "'Please specify a filename.'", ")", "if", "self", ".", "backup", "and", "self", ".", "file_exists", "(", ")", ":", "shutil", ".", "copy", "...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_utils/library/yedit.py#L434-L460
DigitalSlideArchive/HistomicsTK
db2ceb4831bec0efa557cf5b18078ae790253de5
histomicstk/annotations_and_masks/annotation_database_parser.py
python
dump_annotations_locally
( gc, folderid, local, save_json=True, save_sqlite=False, dbcon=None, callback=None, callback_kwargs=None)
Dump annotations of folder and subfolders locally recursively. This reproduces this tiered structure locally and (possibly) dumps annotations there. Adapted from Lee A.D. Cooper Parameters ----------- gc : girder_client.GirderClient authenticated girder client instance folderid : str ...
Dump annotations of folder and subfolders locally recursively.
[ "Dump", "annotations", "of", "folder", "and", "subfolders", "locally", "recursively", "." ]
def dump_annotations_locally( gc, folderid, local, save_json=True, save_sqlite=False, dbcon=None, callback=None, callback_kwargs=None): """Dump annotations of folder and subfolders locally recursively. This reproduces this tiered structure locally and (possibly) dumps annotations th...
[ "def", "dump_annotations_locally", "(", "gc", ",", "folderid", ",", "local", ",", "save_json", "=", "True", ",", "save_sqlite", "=", "False", ",", "dbcon", "=", "None", ",", "callback", "=", "None", ",", "callback_kwargs", "=", "None", ")", ":", "callback_...
https://github.com/DigitalSlideArchive/HistomicsTK/blob/db2ceb4831bec0efa557cf5b18078ae790253de5/histomicstk/annotations_and_masks/annotation_database_parser.py#L275-L379
makerbot/ReplicatorG
d6f2b07785a5a5f1e172fb87cb4303b17c575d5d
skein_engines/skeinforge-50/skeinforge_application/skeinforge_plugins/craft_plugins/dwindle.py
python
DwindleSkein.addThread
(self)
Add the thread sections to the gcode.
Add the thread sections to the gcode.
[ "Add", "the", "thread", "sections", "to", "the", "gcode", "." ]
def addThread(self): 'Add the thread sections to the gcode.' if len(self.threadSections) == 0: return area = self.area dwindlePortion = 0.0 endRateMultiplier = self.repository.endRateMultiplier.value halfOverSteps = self.halfOverSteps oneOverSteps = self.oneOverSteps currentPentUpVolume = self.reposi...
[ "def", "addThread", "(", "self", ")", ":", "if", "len", "(", "self", ".", "threadSections", ")", "==", "0", ":", "return", "area", "=", "self", ".", "area", "dwindlePortion", "=", "0.0", "endRateMultiplier", "=", "self", ".", "repository", ".", "endRateM...
https://github.com/makerbot/ReplicatorG/blob/d6f2b07785a5a5f1e172fb87cb4303b17c575d5d/skein_engines/skeinforge-50/skeinforge_application/skeinforge_plugins/craft_plugins/dwindle.py#L129-L148
linkchecker/linkchecker
d1078ed8480e5cfc4264d0dbf026b45b45aede4d
linkcheck/dummy.py
python
Dummy.__getitem__
(self, key)
return self
Return self
Return self
[ "Return", "self" ]
def __getitem__(self, key): """Return self""" return self
[ "def", "__getitem__", "(", "self", ",", "key", ")", ":", "return", "self" ]
https://github.com/linkchecker/linkchecker/blob/d1078ed8480e5cfc4264d0dbf026b45b45aede4d/linkcheck/dummy.py#L60-L62
plotly/plotly.py
cfad7862594b35965c0e000813bd7805e8494a5b
packages/python/plotly/plotly/graph_objs/funnel/_textfont.py
python
Textfont.color
(self)
return self["color"]
The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A named CSS color: aliceblu...
The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A named CSS color: aliceblu...
[ "The", "color", "property", "is", "a", "color", "and", "may", "be", "specified", "as", ":", "-", "A", "hex", "string", "(", "e", ".", "g", ".", "#ff0000", ")", "-", "An", "rgb", "/", "rgba", "string", "(", "e", ".", "g", ".", "rgb", "(", "255",...
def color(self): """ The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A name...
[ "def", "color", "(", "self", ")", ":", "return", "self", "[", "\"color\"", "]" ]
https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/funnel/_textfont.py#L16-L65
quantumlib/Cirq
89f88b01d69222d3f1ec14d649b7b3a85ed9211f
cirq-ionq/cirq_ionq/ionq_client.py
python
_IonQClient.list_jobs
( self, status: Optional[str] = None, limit: int = 100, batch_size: int = 1000 )
return self._list('jobs', params, 'jobs', limit, batch_size)
Lists jobs from the IonQ API. Args: status: If not None, filter to jobs with this status. limit: The maximum number of jobs to return. batch_size: The size of the batches requested per http GET call. Returns: A list of the json bodies of the job dicts. ...
Lists jobs from the IonQ API.
[ "Lists", "jobs", "from", "the", "IonQ", "API", "." ]
def list_jobs( self, status: Optional[str] = None, limit: int = 100, batch_size: int = 1000 ) -> List[Dict[str, Any]]: """Lists jobs from the IonQ API. Args: status: If not None, filter to jobs with this status. limit: The maximum number of jobs to return. ...
[ "def", "list_jobs", "(", "self", ",", "status", ":", "Optional", "[", "str", "]", "=", "None", ",", "limit", ":", "int", "=", "100", ",", "batch_size", ":", "int", "=", "1000", ")", "->", "List", "[", "Dict", "[", "str", ",", "Any", "]", "]", "...
https://github.com/quantumlib/Cirq/blob/89f88b01d69222d3f1ec14d649b7b3a85ed9211f/cirq-ionq/cirq_ionq/ionq_client.py#L157-L176
phantomcyber/playbooks
9e850ecc44cb98c5dde53784744213a1ed5799bd
zscaler_hunt_and_block_url.py
python
exec_short_description
(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, **kwargs)
return
[]
def exec_short_description(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, **kwargs): phantom.debug('exec_short_description() called') template = """Please Investigate Executive Workstation - {0}""" # parameter...
[ "def", "exec_short_description", "(", "action", "=", "None", ",", "success", "=", "None", ",", "container", "=", "None", ",", "results", "=", "None", ",", "handle", "=", "None", ",", "filtered_artifacts", "=", "None", ",", "filtered_results", "=", "None", ...
https://github.com/phantomcyber/playbooks/blob/9e850ecc44cb98c5dde53784744213a1ed5799bd/zscaler_hunt_and_block_url.py#L412-L426
hasegaw/IkaLog
bd476da541fcc296f792d4db76a6b9174c4777ad
ikalog/engine.py
python
IkaEngine.disble_profile
(self)
[]
def disble_profile(self): self._enable_profile = False
[ "def", "disble_profile", "(", "self", ")", ":", "self", ".", "_enable_profile", "=", "False" ]
https://github.com/hasegaw/IkaLog/blob/bd476da541fcc296f792d4db76a6b9174c4777ad/ikalog/engine.py#L51-L52
huggingface/transformers
623b4f7c63f60cce917677ee704d6c93ee960b4b
src/transformers/utils/dummy_tf_objects.py
python
TFDistilBertForSequenceClassification.call
(self, *args, **kwargs)
[]
def call(self, *args, **kwargs): requires_backends(self, ["tf"])
[ "def", "call", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "requires_backends", "(", "self", ",", "[", "\"tf\"", "]", ")" ]
https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/utils/dummy_tf_objects.py#L1098-L1099
josiah-wolf-oberholtzer/supriya
5ca725a6b97edfbe016a75666d420ecfdf49592f
supriya/intervals/Interval.py
python
Interval.intersects
(self, expr: Union["Interval", float])
return self.start_offset <= expr < self.stop_offset
True when interval intersects ``expr``, another interval or offset: :: >>> from supriya.intervals import Interval >>> interval_1 = Interval(0, 10) >>> interval_2 = Interval(5, 15) >>> interval_3 = Interval(10, 15) >>> interval_4 = Interval(15, 25) ...
True when interval intersects ``expr``, another interval or offset:
[ "True", "when", "interval", "intersects", "expr", "another", "interval", "or", "offset", ":" ]
def intersects(self, expr: Union["Interval", float]) -> bool: """ True when interval intersects ``expr``, another interval or offset: :: >>> from supriya.intervals import Interval >>> interval_1 = Interval(0, 10) >>> interval_2 = Interval(5, 15) ...
[ "def", "intersects", "(", "self", ",", "expr", ":", "Union", "[", "\"Interval\"", ",", "float", "]", ")", "->", "bool", ":", "if", "isinstance", "(", "expr", ",", "Interval", ")", ":", "return", "(", "expr", ".", "start_offset", "<=", "self", ".", "s...
https://github.com/josiah-wolf-oberholtzer/supriya/blob/5ca725a6b97edfbe016a75666d420ecfdf49592f/supriya/intervals/Interval.py#L488-L531
fkie/multimaster_fkie
3d23df29d25d71a75c66bbd3cc6e9cbb255724d8
fkie_node_manager_daemon/src/fkie_node_manager_daemon/url.py
python
equal_uri
(url1, url2)
return url1.rstrip(os.path.sep) == url2.rstrip(os.path.sep)
Removes to string after remove last slash character.
Removes to string after remove last slash character.
[ "Removes", "to", "string", "after", "remove", "last", "slash", "character", "." ]
def equal_uri(url1, url2): ''' Removes to string after remove last slash character. ''' return url1.rstrip(os.path.sep) == url2.rstrip(os.path.sep)
[ "def", "equal_uri", "(", "url1", ",", "url2", ")", ":", "return", "url1", ".", "rstrip", "(", "os", ".", "path", ".", "sep", ")", "==", "url2", ".", "rstrip", "(", "os", ".", "path", ".", "sep", ")" ]
https://github.com/fkie/multimaster_fkie/blob/3d23df29d25d71a75c66bbd3cc6e9cbb255724d8/fkie_node_manager_daemon/src/fkie_node_manager_daemon/url.py#L47-L51
jansel/opentuner
070c5cef6d933eb760a2f9cd5cd08c95f27aee75
examples/gccflags/gccflags.py
python
GccFlagsTuner.save_final_config
(self, configuration)
called at the end of tuning
called at the end of tuning
[ "called", "at", "the", "end", "of", "tuning" ]
def save_final_config(self, configuration): """called at the end of tuning""" print("Best flags written to gccflags_final_config.{json,cmd}") self.manipulator().save_to_file(configuration.data, 'gccflags_final_config.json') with open('gccflags_fina...
[ "def", "save_final_config", "(", "self", ",", "configuration", ")", ":", "print", "(", "\"Best flags written to gccflags_final_config.{json,cmd}\"", ")", "self", ".", "manipulator", "(", ")", ".", "save_to_file", "(", "configuration", ".", "data", ",", "'gccflags_fina...
https://github.com/jansel/opentuner/blob/070c5cef6d933eb760a2f9cd5cd08c95f27aee75/examples/gccflags/gccflags.py#L345-L351
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/whoosh/codec/whoosh3.py
python
_lenfield
(fieldname)
return "_%s_len" % fieldname
[]
def _lenfield(fieldname): return "_%s_len" % fieldname
[ "def", "_lenfield", "(", "fieldname", ")", ":", "return", "\"_%s_len\"", "%", "fieldname" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/whoosh/codec/whoosh3.py#L150-L151
ninja-ide/ninja-ide
87d91131bd19fdc3dcfd91eb97ad1e41c49c60c0
ninja_ide/gui/explorer/tabs/tree_projects_widget.py
python
ProjectTreeColumn._add_file_to_project
(self, path)
Add the file for 'path' in the project the user choose here.
Add the file for 'path' in the project the user choose here.
[ "Add", "the", "file", "for", "path", "in", "the", "project", "the", "user", "choose", "here", "." ]
def _add_file_to_project(self, path): """Add the file for 'path' in the project the user choose here.""" if self._projects_area.count() > 0: path_project = [self.current_project] _add_to_project = add_to_project.AddToProject(path_project, self) _add_to_project.exec_()...
[ "def", "_add_file_to_project", "(", "self", ",", "path", ")", ":", "if", "self", ".", "_projects_area", ".", "count", "(", ")", ">", "0", ":", "path_project", "=", "[", "self", ".", "current_project", "]", "_add_to_project", "=", "add_to_project", ".", "Ad...
https://github.com/ninja-ide/ninja-ide/blob/87d91131bd19fdc3dcfd91eb97ad1e41c49c60c0/ninja_ide/gui/explorer/tabs/tree_projects_widget.py#L200-L232
FederatedAI/FATE
32540492623568ecd1afcb367360133616e02fa3
python/federatedml/statistic/data_overview.py
python
with_weight
(data_instances)
return False
[]
def with_weight(data_instances): first_entry = data_instances.first()[1] if isinstance(first_entry, Instance) and first_entry.weight is not None: return True return False
[ "def", "with_weight", "(", "data_instances", ")", ":", "first_entry", "=", "data_instances", ".", "first", "(", ")", "[", "1", "]", "if", "isinstance", "(", "first_entry", ",", "Instance", ")", "and", "first_entry", ".", "weight", "is", "not", "None", ":",...
https://github.com/FederatedAI/FATE/blob/32540492623568ecd1afcb367360133616e02fa3/python/federatedml/statistic/data_overview.py#L180-L184
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/urllib3/util/selectors.py
python
BaseSelector._key_from_fd
(self, fd)
Return the key associated to a given file descriptor Return None if it is not found.
Return the key associated to a given file descriptor Return None if it is not found.
[ "Return", "the", "key", "associated", "to", "a", "given", "file", "descriptor", "Return", "None", "if", "it", "is", "not", "found", "." ]
def _key_from_fd(self, fd): """ Return the key associated to a given file descriptor Return None if it is not found. """ try: return self._fd_to_key[fd] except KeyError: return None
[ "def", "_key_from_fd", "(", "self", ",", "fd", ")", ":", "try", ":", "return", "self", ".", "_fd_to_key", "[", "fd", "]", "except", "KeyError", ":", "return", "None" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/urllib3/util/selectors.py#L270-L276
bruderstein/PythonScript
df9f7071ddf3a079e3a301b9b53a6dc78cf1208f
PythonLib/full/ssl.py
python
_inet_paton
(ipname)
Try to convert an IP address to packed binary form Supports IPv4 addresses on all platforms and IPv6 on platforms with IPv6 support.
Try to convert an IP address to packed binary form
[ "Try", "to", "convert", "an", "IP", "address", "to", "packed", "binary", "form" ]
def _inet_paton(ipname): """Try to convert an IP address to packed binary form Supports IPv4 addresses on all platforms and IPv6 on platforms with IPv6 support. """ # inet_aton() also accepts strings like '1', '127.1', some also trailing # data like '127.0.0.1 whatever'. try: addr =...
[ "def", "_inet_paton", "(", "ipname", ")", ":", "# inet_aton() also accepts strings like '1', '127.1', some also trailing", "# data like '127.0.0.1 whatever'.", "try", ":", "addr", "=", "_socket", ".", "inet_aton", "(", "ipname", ")", "except", "OSError", ":", "# not an IPv4...
https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/full/ssl.py#L324-L356
TencentCloud/tencentcloud-sdk-python
3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2
tencentcloud/cpdp/v20190820/models.py
python
ApplyDeclareData.__init__
(self)
r""" :param MerchantId: 商户号 :type MerchantId: str :param TransactionId: 第三方指令编号 :type TransactionId: str :param Status: 受理状态 :type Status: str :param DeclareId: 申报流水号 :type DeclareId: str :param OriginalDeclareId: 原申报流水号 注意:此字段可能返回 null,表示取不到有效值。 ...
r""" :param MerchantId: 商户号 :type MerchantId: str :param TransactionId: 第三方指令编号 :type TransactionId: str :param Status: 受理状态 :type Status: str :param DeclareId: 申报流水号 :type DeclareId: str :param OriginalDeclareId: 原申报流水号 注意:此字段可能返回 null,表示取不到有效值。 ...
[ "r", ":", "param", "MerchantId", ":", "商户号", ":", "type", "MerchantId", ":", "str", ":", "param", "TransactionId", ":", "第三方指令编号", ":", "type", "TransactionId", ":", "str", ":", "param", "Status", ":", "受理状态", ":", "type", "Status", ":", "str", ":", "p...
def __init__(self): r""" :param MerchantId: 商户号 :type MerchantId: str :param TransactionId: 第三方指令编号 :type TransactionId: str :param Status: 受理状态 :type Status: str :param DeclareId: 申报流水号 :type DeclareId: str :param OriginalDeclareId: 原申报流水号...
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "MerchantId", "=", "None", "self", ".", "TransactionId", "=", "None", "self", ".", "Status", "=", "None", "self", ".", "DeclareId", "=", "None", "self", ".", "OriginalDeclareId", "=", "None", "self",...
https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/cpdp/v20190820/models.py#L1052-L1073
sqlalchemy/sqlalchemy
eb716884a4abcabae84a6aaba105568e925b7d27
lib/sqlalchemy/orm/attributes.py
python
History.has_changes
(self)
return bool(self.added or self.deleted)
Return True if this :class:`.History` has changes.
Return True if this :class:`.History` has changes.
[ "Return", "True", "if", "this", ":", "class", ":", ".", "History", "has", "changes", "." ]
def has_changes(self): """Return True if this :class:`.History` has changes.""" return bool(self.added or self.deleted)
[ "def", "has_changes", "(", "self", ")", ":", "return", "bool", "(", "self", ".", "added", "or", "self", ".", "deleted", ")" ]
https://github.com/sqlalchemy/sqlalchemy/blob/eb716884a4abcabae84a6aaba105568e925b7d27/lib/sqlalchemy/orm/attributes.py#L1828-L1831
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/graphs/generators/random.py
python
growing_subtrees
(T, k)
return S
r""" Return a list of the vertex sets of ``n`` randomly chosen subtrees of ``T``. For a tree of order `n`, the collection contains `n` subtrees with maximum order `k` and average order `\frac{k + 1}{2}`. This method is part of :meth:`~sage.graphs.generators.random.RandomChordalGraph`. ALGORIT...
r""" Return a list of the vertex sets of ``n`` randomly chosen subtrees of ``T``.
[ "r", "Return", "a", "list", "of", "the", "vertex", "sets", "of", "n", "randomly", "chosen", "subtrees", "of", "T", "." ]
def growing_subtrees(T, k): r""" Return a list of the vertex sets of ``n`` randomly chosen subtrees of ``T``. For a tree of order `n`, the collection contains `n` subtrees with maximum order `k` and average order `\frac{k + 1}{2}`. This method is part of :meth:`~sage.graphs.generators.random.R...
[ "def", "growing_subtrees", "(", "T", ",", "k", ")", ":", "from", "sage", ".", "misc", ".", "prandom", "import", "choice", "n", "=", "T", ".", "order", "(", ")", "S", "=", "[", "]", "for", "_", "in", "range", "(", "n", ")", ":", "ki", "=", "ra...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/graphs/generators/random.py#L857-L909
openhatch/oh-mainline
ce29352a034e1223141dcc2f317030bbc3359a51
vendor/packages/whoosh/src/whoosh/matching.py
python
FilterMatcher.__init__
(self, child, ids, exclude=False, boost=1.0)
:param child: the child matcher. :param ids: a set of IDs to filter by. :param exclude: by default, only IDs from the wrapped matcher that are **in** the set are used. If this argument is True, only IDs from the wrapped matcher that are **not in** the set are used.
:param child: the child matcher. :param ids: a set of IDs to filter by. :param exclude: by default, only IDs from the wrapped matcher that are **in** the set are used. If this argument is True, only IDs from the wrapped matcher that are **not in** the set are used.
[ ":", "param", "child", ":", "the", "child", "matcher", ".", ":", "param", "ids", ":", "a", "set", "of", "IDs", "to", "filter", "by", ".", ":", "param", "exclude", ":", "by", "default", "only", "IDs", "from", "the", "wrapped", "matcher", "that", "are"...
def __init__(self, child, ids, exclude=False, boost=1.0): """ :param child: the child matcher. :param ids: a set of IDs to filter by. :param exclude: by default, only IDs from the wrapped matcher that are **in** the set are used. If this argument is True, only IDs from ...
[ "def", "__init__", "(", "self", ",", "child", ",", "ids", ",", "exclude", "=", "False", ",", "boost", "=", "1.0", ")", ":", "super", "(", "FilterMatcher", ",", "self", ")", ".", "__init__", "(", "child", ")", "self", ".", "_ids", "=", "ids", "self"...
https://github.com/openhatch/oh-mainline/blob/ce29352a034e1223141dcc2f317030bbc3359a51/vendor/packages/whoosh/src/whoosh/matching.py#L737-L750
libertysoft3/saidit
271c7d03adb369f82921d811360b00812e42da24
r2/r2/controllers/api.py
python
ApiController.POST_subreddit_stylesheet
(self, form, jquery, stylesheet_contents = '', prevstyle='', op='save', reason=None)
Update a subreddit's stylesheet. `op` should be `save` to update the contents of the stylesheet.
Update a subreddit's stylesheet.
[ "Update", "a", "subreddit", "s", "stylesheet", "." ]
def POST_subreddit_stylesheet(self, form, jquery, stylesheet_contents = '', prevstyle='', op='save', reason=None): """Update a subreddit's stylesheet. `op` should be `save` to update the contents of the stylesheet. """ ...
[ "def", "POST_subreddit_stylesheet", "(", "self", ",", "form", ",", "jquery", ",", "stylesheet_contents", "=", "''", ",", "prevstyle", "=", "''", ",", "op", "=", "'save'", ",", "reason", "=", "None", ")", ":", "if", "g", ".", "css_killswitch", ":", "retur...
https://github.com/libertysoft3/saidit/blob/271c7d03adb369f82921d811360b00812e42da24/r2/r2/controllers/api.py#L2417-L2498
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/models/v1_service_list.py
python
V1ServiceList.__ne__
(self, other)
return self.to_dict() != other.to_dict()
Returns true if both objects are not equal
Returns true if both objects are not equal
[ "Returns", "true", "if", "both", "objects", "are", "not", "equal" ]
def __ne__(self, other): """Returns true if both objects are not equal""" if not isinstance(other, V1ServiceList): return True return self.to_dict() != other.to_dict()
[ "def", "__ne__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "V1ServiceList", ")", ":", "return", "True", "return", "self", ".", "to_dict", "(", ")", "!=", "other", ".", "to_dict", "(", ")" ]
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/models/v1_service_list.py#L200-L205
CharlesBlonde/libpurecoollink
a91362c57a0bc4126279c8c51c407dd713b08e10
libpurecoollink/dyson_360_eye.py
python
Dyson360Eye.on_message
(client, userdata, msg)
Set function Callback when message received.
Set function Callback when message received.
[ "Set", "function", "Callback", "when", "message", "received", "." ]
def on_message(client, userdata, msg): # pylint: disable=unused-argument """Set function Callback when message received.""" payload = msg.payload.decode("utf-8") device_msg = None if Dyson360EyeState.is_state_message(payload): device_msg = Dyson360EyeState(payload) ...
[ "def", "on_message", "(", "client", ",", "userdata", ",", "msg", ")", ":", "# pylint: disable=unused-argument", "payload", "=", "msg", ".", "payload", ".", "decode", "(", "\"utf-8\"", ")", "device_msg", "=", "None", "if", "Dyson360EyeState", ".", "is_state_messa...
https://github.com/CharlesBlonde/libpurecoollink/blob/a91362c57a0bc4126279c8c51c407dd713b08e10/libpurecoollink/dyson_360_eye.py#L109-L134
wizyoung/googletranslate.popclipext
a3c465685a5a75213e2ec8517eb98d336984bc50
src/httpx/_utils.py
python
peek_filelike_length
(stream: typing.IO)
Given a file-like stream object, return its length in number of bytes without reading it into memory.
Given a file-like stream object, return its length in number of bytes without reading it into memory.
[ "Given", "a", "file", "-", "like", "stream", "object", "return", "its", "length", "in", "number", "of", "bytes", "without", "reading", "it", "into", "memory", "." ]
def peek_filelike_length(stream: typing.IO) -> int: """ Given a file-like stream object, return its length in number of bytes without reading it into memory. """ try: # Is it an actual file? fd = stream.fileno() except OSError: # No... Maybe it's something that supports r...
[ "def", "peek_filelike_length", "(", "stream", ":", "typing", ".", "IO", ")", "->", "int", ":", "try", ":", "# Is it an actual file?", "fd", "=", "stream", ".", "fileno", "(", ")", "except", "OSError", ":", "# No... Maybe it's something that supports random access, l...
https://github.com/wizyoung/googletranslate.popclipext/blob/a3c465685a5a75213e2ec8517eb98d336984bc50/src/httpx/_utils.py#L324-L347
facelessuser/ColorHelper
cfed17c35dbae4db49a14165ef222407c48a3014
ch_preview.py
python
ColorHelperListener.should_update
(self, view)
return force_update
Check if an update should be performed.
Check if an update should be performed.
[ "Check", "if", "an", "update", "should", "be", "performed", "." ]
def should_update(self, view): """Check if an update should be performed.""" force_update = False rules = view.settings().get('color_helper.scan', None) if rules: last_updated = rules.get('last_updated', None) if last_updated is None or last_updated < ch_last_upd...
[ "def", "should_update", "(", "self", ",", "view", ")", ":", "force_update", "=", "False", "rules", "=", "view", ".", "settings", "(", ")", ".", "get", "(", "'color_helper.scan'", ",", "None", ")", "if", "rules", ":", "last_updated", "=", "rules", ".", ...
https://github.com/facelessuser/ColorHelper/blob/cfed17c35dbae4db49a14165ef222407c48a3014/ch_preview.py#L780-L800
bruderstein/PythonScript
df9f7071ddf3a079e3a301b9b53a6dc78cf1208f
PythonLib/min/numbers.py
python
Real.__le__
(self, other)
self <= other
self <= other
[ "self", "<", "=", "other" ]
def __le__(self, other): """self <= other""" raise NotImplementedError
[ "def", "__le__", "(", "self", ",", "other", ")", ":", "raise", "NotImplementedError" ]
https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/min/numbers.py#L241-L243
angr/angr-management
60ae5fa483e74810fb3a3da8d37b00034d7fefab
angrmanagement/plugins/base_plugin.py
python
BasePlugin.on_workspace_initialized
(self, workspace: 'Workspace')
A handler that is called right after a workspace is initialized.
A handler that is called right after a workspace is initialized.
[ "A", "handler", "that", "is", "called", "right", "after", "a", "workspace", "is", "initialized", "." ]
def on_workspace_initialized(self, workspace: 'Workspace'): """ A handler that is called right after a workspace is initialized. """
[ "def", "on_workspace_initialized", "(", "self", ",", "workspace", ":", "'Workspace'", ")", ":" ]
https://github.com/angr/angr-management/blob/60ae5fa483e74810fb3a3da8d37b00034d7fefab/angrmanagement/plugins/base_plugin.py#L61-L64
cisco/mindmeld
809c36112e9ea8019fe29d54d136ca14eb4fd8db
mindmeld/resource_loader.py
python
Hasher._get_algorithm
(self)
return self._algorithm
Getter for algorithm property. Returns: str: the hashing algorithm
Getter for algorithm property.
[ "Getter", "for", "algorithm", "property", "." ]
def _get_algorithm(self): """Getter for algorithm property. Returns: str: the hashing algorithm """ return self._algorithm
[ "def", "_get_algorithm", "(", "self", ")", ":", "return", "self", ".", "_algorithm" ]
https://github.com/cisco/mindmeld/blob/809c36112e9ea8019fe29d54d136ca14eb4fd8db/mindmeld/resource_loader.py#L956-L962
Nuitka/Nuitka
39262276993757fa4e299f497654065600453fc9
nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py
python
Task.failed
(self)
Default action when a task fails: stop the build. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure().
Default action when a task fails: stop the build.
[ "Default", "action", "when", "a", "task", "fails", ":", "stop", "the", "build", "." ]
def failed(self): """ Default action when a task fails: stop the build. Note: Although this function is normally invoked on nodes in the executing state, it might also be invoked on up-to-date nodes when using Configure(). """ self.fail_stop()
[ "def", "failed", "(", "self", ")", ":", "self", ".", "fail_stop", "(", ")" ]
https://github.com/Nuitka/Nuitka/blob/39262276993757fa4e299f497654065600453fc9/nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py#L303-L311
tensorlayer/tensorlayer
cb4eb896dd063e650ef22533ed6fa6056a71cad5
tensorlayer/layers/normalization.py
python
LocalResponseNorm.forward
(self, inputs)
return outputs
prev_layer : :class:`Layer` The previous layer with a 4D output shape.
prev_layer : :class:`Layer` The previous layer with a 4D output shape.
[ "prev_layer", ":", ":", "class", ":", "Layer", "The", "previous", "layer", "with", "a", "4D", "output", "shape", "." ]
def forward(self, inputs): """ prev_layer : :class:`Layer` The previous layer with a 4D output shape. """ outputs = tf.nn.lrn(inputs, depth_radius=self.depth_radius, bias=self.bias, alpha=self.alpha, beta=self.beta) return outputs
[ "def", "forward", "(", "self", ",", "inputs", ")", ":", "outputs", "=", "tf", ".", "nn", ".", "lrn", "(", "inputs", ",", "depth_radius", "=", "self", ".", "depth_radius", ",", "bias", "=", "self", ".", "bias", ",", "alpha", "=", "self", ".", "alpha...
https://github.com/tensorlayer/tensorlayer/blob/cb4eb896dd063e650ef22533ed6fa6056a71cad5/tensorlayer/layers/normalization.py#L73-L79
calmevtime/DCTNet
bd7c669b478e47fde230119045133d10e135de97
segmentation/mmdet/core/bbox/samplers/base_sampler.py
python
BaseSampler.sample
(self, assign_result, bboxes, gt_bboxes, gt_labels=None, **kwargs)
return SamplingResult(pos_inds, neg_inds, bboxes, gt_bboxes, assign_result, gt_flags)
Sample positive and negative bboxes. This is a simple implementation of bbox sampling given candidates, assigning results and ground truth bboxes. Args: assign_result (:obj:`AssignResult`): Bbox assigning results. bboxes (Tensor): Boxes to be sampled from. g...
Sample positive and negative bboxes.
[ "Sample", "positive", "and", "negative", "bboxes", "." ]
def sample(self, assign_result, bboxes, gt_bboxes, gt_labels=None, **kwargs): """Sample positive and negative bboxes. This is a simple implementation of bbox sampling given candidates, assigning results and ground truth ...
[ "def", "sample", "(", "self", ",", "assign_result", ",", "bboxes", ",", "gt_bboxes", ",", "gt_labels", "=", "None", ",", "*", "*", "kwargs", ")", ":", "bboxes", "=", "bboxes", "[", ":", ",", ":", "4", "]", "gt_flags", "=", "bboxes", ".", "new_zeros",...
https://github.com/calmevtime/DCTNet/blob/bd7c669b478e47fde230119045133d10e135de97/segmentation/mmdet/core/bbox/samplers/base_sampler.py#L31-L78
omz/PythonistaAppTemplate
f560f93f8876d82a21d108977f90583df08d55af
PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/matplotlib/pyplot.py
python
colormaps
()
return sorted(cm.cmap_d.keys())
Matplotlib provides a number of colormaps, and others can be added using :func:`~matplotlib.cm.register_cmap`. This function documents the built-in colormaps, and will also return a list of all registered colormaps if called. You can set the colormap for an image, pcolor, scatter, etc, using a keyword...
Matplotlib provides a number of colormaps, and others can be added using :func:`~matplotlib.cm.register_cmap`. This function documents the built-in colormaps, and will also return a list of all registered colormaps if called.
[ "Matplotlib", "provides", "a", "number", "of", "colormaps", "and", "others", "can", "be", "added", "using", ":", "func", ":", "~matplotlib", ".", "cm", ".", "register_cmap", ".", "This", "function", "documents", "the", "built", "-", "in", "colormaps", "and",...
def colormaps(): """ Matplotlib provides a number of colormaps, and others can be added using :func:`~matplotlib.cm.register_cmap`. This function documents the built-in colormaps, and will also return a list of all registered colormaps if called. You can set the colormap for an image, pcolor, scat...
[ "def", "colormaps", "(", ")", ":", "return", "sorted", "(", "cm", ".", "cmap_d", ".", "keys", "(", ")", ")" ]
https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/matplotlib/pyplot.py#L1820-L2054
deepmind/dm_control
806a10e896e7c887635328bfa8352604ad0fedae
dm_control/entities/manipulators/kinova/jaco_arm.py
python
JacoArm.joints
(self)
return self._joints
List of joint elements belonging to the arm.
List of joint elements belonging to the arm.
[ "List", "of", "joint", "elements", "belonging", "to", "the", "arm", "." ]
def joints(self): """List of joint elements belonging to the arm.""" return self._joints
[ "def", "joints", "(", "self", ")", ":", "return", "self", ".", "_joints" ]
https://github.com/deepmind/dm_control/blob/806a10e896e7c887635328bfa8352604ad0fedae/dm_control/entities/manipulators/kinova/jaco_arm.py#L77-L79
omz/PythonistaAppTemplate
f560f93f8876d82a21d108977f90583df08d55af
PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/httplib2/__init__.py
python
Http.add_certificate
(self, key, cert, domain)
Add a key and cert that will be used any time a request requires authentication.
Add a key and cert that will be used any time a request requires authentication.
[ "Add", "a", "key", "and", "cert", "that", "will", "be", "used", "any", "time", "a", "request", "requires", "authentication", "." ]
def add_certificate(self, key, cert, domain): """Add a key and cert that will be used any time a request requires authentication.""" self.certificates.add(key, cert, domain)
[ "def", "add_certificate", "(", "self", ",", "key", ",", "cert", ",", "domain", ")", ":", "self", ".", "certificates", ".", "add", "(", "key", ",", "cert", ",", "domain", ")" ]
https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/httplib2/__init__.py#L1237-L1240
IronLanguages/main
a949455434b1fda8c783289e897e78a9a0caabb5
External.LCA_RESTRICTED/Languages/CPython/27/Lib/logging/__init__.py
python
Filterer.filter
(self, record)
return rv
Determine if a record is loggable by consulting all the filters. The default is to allow the record to be logged; any filter can veto this and the record is then dropped. Returns a zero value if a record is to be dropped, else non-zero.
Determine if a record is loggable by consulting all the filters.
[ "Determine", "if", "a", "record", "is", "loggable", "by", "consulting", "all", "the", "filters", "." ]
def filter(self, record): """ Determine if a record is loggable by consulting all the filters. The default is to allow the record to be logged; any filter can veto this and the record is then dropped. Returns a zero value if a record is to be dropped, else non-zero. """ ...
[ "def", "filter", "(", "self", ",", "record", ")", ":", "rv", "=", "1", "for", "f", "in", "self", ".", "filters", ":", "if", "not", "f", ".", "filter", "(", "record", ")", ":", "rv", "=", "0", "break", "return", "rv" ]
https://github.com/IronLanguages/main/blob/a949455434b1fda8c783289e897e78a9a0caabb5/External.LCA_RESTRICTED/Languages/CPython/27/Lib/logging/__init__.py#L594-L607
memray/seq2seq-keyphrase
9145c63ebdc4c3bc431f8091dc52547a46804012
emolga/models/covc_encdec.py
python
AutoEncoder.__init__
(self, config, n_rng, rng, mode='Evaluation')
[]
def __init__(self, config, n_rng, rng, mode='Evaluation'): super(RNNLM, self).__init__() self.config = config self.n_rng = n_rng # numpy random stream self.rng = rng # Theano random stream self.mode = mode self.name = 'vae'
[ "def", "__init__", "(", "self", ",", "config", ",", "n_rng", ",", "rng", ",", "mode", "=", "'Evaluation'", ")", ":", "super", "(", "RNNLM", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "config", "=", "config", "self", ".", "n_rng", "="...
https://github.com/memray/seq2seq-keyphrase/blob/9145c63ebdc4c3bc431f8091dc52547a46804012/emolga/models/covc_encdec.py#L1712-L1721
pm4py/pm4py-core
7807b09a088b02199cd0149d724d0e28793971bf
pm4py/write.py
python
write_xes
(log: EventLog, file_path: str)
Exports a XES log Parameters -------------- log Event log file_path Destination path Returns ------------- void
Exports a XES log
[ "Exports", "a", "XES", "log" ]
def write_xes(log: EventLog, file_path: str) -> None: """ Exports a XES log Parameters -------------- log Event log file_path Destination path Returns ------------- void """ general_checks_classical_event_log(log) from pm4py.objects.log.exporter.xes impo...
[ "def", "write_xes", "(", "log", ":", "EventLog", ",", "file_path", ":", "str", ")", "->", "None", ":", "general_checks_classical_event_log", "(", "log", ")", "from", "pm4py", ".", "objects", ".", "log", ".", "exporter", ".", "xes", "import", "exporter", "a...
https://github.com/pm4py/pm4py-core/blob/7807b09a088b02199cd0149d724d0e28793971bf/pm4py/write.py#L29-L46
spesmilo/electrum
bdbd59300fbd35b01605e66145458e5f396108e8
electrum/lnpeer.py
python
close_and_cleanup
(self)
[]
def close_and_cleanup(self): # note: This method might get called multiple times! # E.g. if you call close_and_cleanup() to cause a disconnection from the peer, # it will get called a second time in handle_disconnect(). try: if self.transport: self...
[ "def", "close_and_cleanup", "(", "self", ")", ":", "# note: This method might get called multiple times!", "# E.g. if you call close_and_cleanup() to cause a disconnection from the peer,", "# it will get called a second time in handle_disconnect().", "try", ":", "if", "self", "...
https://github.com/spesmilo/electrum/blob/bdbd59300fbd35b01605e66145458e5f396108e8/electrum/lnpeer.py#L493-L503
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/rings/asymptotic/term_monoid.py
python
GenericTerm._eq_
(self, other)
return self.growth == other.growth
r""" Return whether this generic term is equal to ``other``. INPUT: - ``other`` -- an asymptotic term. OUTPUT: A boolean. .. NOTE:: This method gets called by the coercion framework, so it can be assumed that this asymptotic term is from the ...
r""" Return whether this generic term is equal to ``other``.
[ "r", "Return", "whether", "this", "generic", "term", "is", "equal", "to", "other", "." ]
def _eq_(self, other): r""" Return whether this generic term is equal to ``other``. INPUT: - ``other`` -- an asymptotic term. OUTPUT: A boolean. .. NOTE:: This method gets called by the coercion framework, so it can be assumed that th...
[ "def", "_eq_", "(", "self", ",", "other", ")", ":", "return", "self", ".", "growth", "==", "other", ".", "growth" ]
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/rings/asymptotic/term_monoid.py#L1019-L1074
mesonbuild/meson
a22d0f9a0a787df70ce79b05d0c45de90a970048
mesonbuild/compilers/d.py
python
DmdLikeCompilerMixin._get_crt_args
(self, crt_val: str, buildtype: str)
[]
def _get_crt_args(self, crt_val: str, buildtype: str) -> T.List[str]: if not self.info.is_windows(): return [] if crt_val in self.mscrt_args: return self.mscrt_args[crt_val] assert crt_val in ['from_buildtype', 'static_from_buildtype'] dbg = 'mdd' rel = ...
[ "def", "_get_crt_args", "(", "self", ",", "crt_val", ":", "str", ",", "buildtype", ":", "str", ")", "->", "T", ".", "List", "[", "str", "]", ":", "if", "not", "self", ".", "info", ".", "is_windows", "(", ")", ":", "return", "[", "]", "if", "crt_v...
https://github.com/mesonbuild/meson/blob/a22d0f9a0a787df70ce79b05d0c45de90a970048/mesonbuild/compilers/d.py#L441-L468
Delta-ML/delta
31dfebc8f20b7cb282b62f291ff25a87e403cc86
delta/utils/postprocess/base_postproc.py
python
PostProcABC.call
(self)
implementation func
implementation func
[ "implementation", "func" ]
def call(self): ''' implementation func ''' raise NotImplementedError()
[ "def", "call", "(", "self", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/Delta-ML/delta/blob/31dfebc8f20b7cb282b62f291ff25a87e403cc86/delta/utils/postprocess/base_postproc.py#L28-L30
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/components/sisyphus/media_player.py
python
SisyphusPlayer.media_position_updated_at
(self)
return self._table.active_track_remaining_time_as_of
Return the last time we got a position update.
Return the last time we got a position update.
[ "Return", "the", "last", "time", "we", "got", "a", "position", "update", "." ]
def media_position_updated_at(self): """Return the last time we got a position update.""" return self._table.active_track_remaining_time_as_of
[ "def", "media_position_updated_at", "(", "self", ")", ":", "return", "self", ".", "_table", ".", "active_track_remaining_time_as_of" ]
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/sisyphus/media_player.py#L150-L152
PowerScript/KatanaFramework
0f6ad90a88de865d58ec26941cb4460501e75496
lib/MySQLdb/connections.py
python
Connection.show_warnings
(self)
return warnings
Return detailed information about warnings as a sequence of tuples of (Level, Code, Message). This is only supported in MySQL-4.1 and up. If your server is an earlier version, an empty sequence is returned.
Return detailed information about warnings as a sequence of tuples of (Level, Code, Message). This is only supported in MySQL-4.1 and up. If your server is an earlier version, an empty sequence is returned.
[ "Return", "detailed", "information", "about", "warnings", "as", "a", "sequence", "of", "tuples", "of", "(", "Level", "Code", "Message", ")", ".", "This", "is", "only", "supported", "in", "MySQL", "-", "4", ".", "1", "and", "up", ".", "If", "your", "ser...
def show_warnings(self): """Return detailed information about warnings as a sequence of tuples of (Level, Code, Message). This is only supported in MySQL-4.1 and up. If your server is an earlier version, an empty sequence is returned.""" if self._server_version < (4,1): return ()...
[ "def", "show_warnings", "(", "self", ")", ":", "if", "self", ".", "_server_version", "<", "(", "4", ",", "1", ")", ":", "return", "(", ")", "self", ".", "query", "(", "\"SHOW WARNINGS\"", ")", "r", "=", "self", ".", "store_result", "(", ")", "warning...
https://github.com/PowerScript/KatanaFramework/blob/0f6ad90a88de865d58ec26941cb4460501e75496/lib/MySQLdb/connections.py#L311-L320
Fizzadar/pyinfra
ff0913d6a172966760b63fe59e55dff9ea852e0d
pyinfra/api/command.py
python
FileDownloadCommand.__repr__
(self)
return 'FileDownloadCommand({0}, {1})'.format(self.src, self.dest)
[]
def __repr__(self): return 'FileDownloadCommand({0}, {1})'.format(self.src, self.dest)
[ "def", "__repr__", "(", "self", ")", ":", "return", "'FileDownloadCommand({0}, {1})'", ".", "format", "(", "self", ".", "src", ",", "self", ".", "dest", ")" ]
https://github.com/Fizzadar/pyinfra/blob/ff0913d6a172966760b63fe59e55dff9ea852e0d/pyinfra/api/command.py#L155-L156
oracle/graalpython
577e02da9755d916056184ec441c26e00b70145c
graalpython/lib-python/3/asyncio/trsock.py
python
TransportSocket.send
(self, *args, **kwargs)
return self._sock.send(*args, **kwargs)
[]
def send(self, *args, **kwargs): self._na('send() method') return self._sock.send(*args, **kwargs)
[ "def", "send", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_na", "(", "'send() method'", ")", "return", "self", ".", "_sock", ".", "send", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/oracle/graalpython/blob/577e02da9755d916056184ec441c26e00b70145c/graalpython/lib-python/3/asyncio/trsock.py#L145-L147
PaloAltoNetworks/pan-os-python
30f6cd9e29d0e3c2549d46c722f6dcb507acd437
panos/base.py
python
PanDevice.update_connection_method
(self)
return self._xapi_private
Regenerate the xapi object used to connect to the device This is only necessary if the API key, password, hostname, or other connectivity information in this object has changed. In this case, the xapi object used to communicate with the firewall must be regenerated to use the new connec...
Regenerate the xapi object used to connect to the device
[ "Regenerate", "the", "xapi", "object", "used", "to", "connect", "to", "the", "device" ]
def update_connection_method(self): """Regenerate the xapi object used to connect to the device This is only necessary if the API key, password, hostname, or other connectivity information in this object has changed. In this case, the xapi object used to communicate with the firewall mu...
[ "def", "update_connection_method", "(", "self", ")", ":", "self", ".", "_xapi_private", "=", "self", ".", "generate_xapi", "(", ")", "return", "self", ".", "_xapi_private" ]
https://github.com/PaloAltoNetworks/pan-os-python/blob/30f6cd9e29d0e3c2549d46c722f6dcb507acd437/panos/base.py#L3832-L3847
nilearn/nilearn
9edba4471747efacf21260bf470a346307f52706
nilearn/interfaces/fmriprep/load_confounds_utils.py
python
MissingConfound.__init__
(self, params=None, keywords=None)
Set missing parameters and keywords.
Set missing parameters and keywords.
[ "Set", "missing", "parameters", "and", "keywords", "." ]
def __init__(self, params=None, keywords=None): """Set missing parameters and keywords.""" self.params = params or [] self.keywords = keywords or []
[ "def", "__init__", "(", "self", ",", "params", "=", "None", ",", "keywords", "=", "None", ")", ":", "self", ".", "params", "=", "params", "or", "[", "]", "self", ".", "keywords", "=", "keywords", "or", "[", "]" ]
https://github.com/nilearn/nilearn/blob/9edba4471747efacf21260bf470a346307f52706/nilearn/interfaces/fmriprep/load_confounds_utils.py#L246-L249
MushroomRL/mushroom-rl
a0eaa2cf8001e433419234a9fc48b64170e3f61c
mushroom_rl/utils/parameters.py
python
Parameter._compute
(self, *idx, **kwargs)
return self._initial_value
Returns: The value of the parameter in the provided index.
Returns: The value of the parameter in the provided index.
[ "Returns", ":", "The", "value", "of", "the", "parameter", "in", "the", "provided", "index", "." ]
def _compute(self, *idx, **kwargs): """ Returns: The value of the parameter in the provided index. """ return self._initial_value
[ "def", "_compute", "(", "self", ",", "*", "idx", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_initial_value" ]
https://github.com/MushroomRL/mushroom-rl/blob/a0eaa2cf8001e433419234a9fc48b64170e3f61c/mushroom_rl/utils/parameters.py#L83-L89
coherence-project/Coherence
88016204c7778bf0d3ad1ae331b4d8fd725dd2af
coherence/extern/youtubedl/youtubedl.py
python
YoutubeIE.report_video_info_webpage_download
(self, video_id)
Report attempt to download video info webpage.
Report attempt to download video info webpage.
[ "Report", "attempt", "to", "download", "video", "info", "webpage", "." ]
def report_video_info_webpage_download(self, video_id): """Report attempt to download video info webpage.""" self._downloader.to_stdout(u'[youtube] %s: Downloading video info webpage' % video_id)
[ "def", "report_video_info_webpage_download", "(", "self", ",", "video_id", ")", ":", "self", ".", "_downloader", ".", "to_stdout", "(", "u'[youtube] %s: Downloading video info webpage'", "%", "video_id", ")" ]
https://github.com/coherence-project/Coherence/blob/88016204c7778bf0d3ad1ae331b4d8fd725dd2af/coherence/extern/youtubedl/youtubedl.py#L559-L561
Eniac-Xie/faster-rcnn-resnet
aba743e8404b47fc9bcccba4920846d1068c7e3c
lib/roi_data_layer/layer.py
python
RoIDataLayer.reshape
(self, bottom, top)
Reshaping happens during the call to forward.
Reshaping happens during the call to forward.
[ "Reshaping", "happens", "during", "the", "call", "to", "forward", "." ]
def reshape(self, bottom, top): """Reshaping happens during the call to forward.""" pass
[ "def", "reshape", "(", "self", ",", "bottom", ",", "top", ")", ":", "pass" ]
https://github.com/Eniac-Xie/faster-rcnn-resnet/blob/aba743e8404b47fc9bcccba4920846d1068c7e3c/lib/roi_data_layer/layer.py#L161-L163
TheAlgorithms/Python
9af2eef9b3761bf51580dedfb6fa7136ca0c5c2c
data_structures/binary_tree/binary_tree_traversals.py
python
zigzag
(root: Node | None)
return output
ZigZag traverse: Returns a list of nodes value from left to right and right to left, alternatively.
ZigZag traverse: Returns a list of nodes value from left to right and right to left, alternatively.
[ "ZigZag", "traverse", ":", "Returns", "a", "list", "of", "nodes", "value", "from", "left", "to", "right", "and", "right", "to", "left", "alternatively", "." ]
def zigzag(root: Node | None) -> Sequence[Node | None] | list[Any]: """ ZigZag traverse: Returns a list of nodes value from left to right and right to left, alternatively. """ if root is None: return [] output: list[Sequence[Node | None]] = [] flag = 0 height_tree = height(root...
[ "def", "zigzag", "(", "root", ":", "Node", "|", "None", ")", "->", "Sequence", "[", "Node", "|", "None", "]", "|", "list", "[", "Any", "]", ":", "if", "root", "is", "None", ":", "return", "[", "]", "output", ":", "list", "[", "Sequence", "[", "...
https://github.com/TheAlgorithms/Python/blob/9af2eef9b3761bf51580dedfb6fa7136ca0c5c2c/data_structures/binary_tree/binary_tree_traversals.py#L126-L147
BigBrotherBot/big-brother-bot
848823c71413c86e7f1ff9584f43e08d40a7f2c0
b3/tools/debug/statlib/stats.py
python
azmap
(scores, compare, dimension=0)
return (scores - mns) / sstd
Returns an array of z-scores the shape of scores (e.g., [x,y]), compared to array passed to compare (e.g., [time,x,y]). Assumes collapsing over dim 0 of the compare array. Usage: azs(scores, compare, dimension=0)
Returns an array of z-scores the shape of scores (e.g., [x,y]), compared to array passed to compare (e.g., [time,x,y]). Assumes collapsing over dim 0 of the compare array. Usage: azs(scores, compare, dimension=0)
[ "Returns", "an", "array", "of", "z", "-", "scores", "the", "shape", "of", "scores", "(", "e", ".", "g", ".", "[", "x", "y", "]", ")", "compared", "to", "array", "passed", "to", "compare", "(", "e", ".", "g", ".", "[", "time", "x", "y", "]", "...
def azmap (scores, compare, dimension=0): """ Returns an array of z-scores the shape of scores (e.g., [x,y]), compared to array passed to compare (e.g., [time,x,y]). Assumes collapsing over dim 0 of the compare array. Usage: azs(scores, compare, dimension=0) """ mns = amean(compare,d...
[ "def", "azmap", "(", "scores", ",", "compare", ",", "dimension", "=", "0", ")", ":", "mns", "=", "amean", "(", "compare", ",", "dimension", ")", "sstd", "=", "asamplestdev", "(", "compare", ",", "0", ")", "return", "(", "scores", "-", "mns", ")", "...
https://github.com/BigBrotherBot/big-brother-bot/blob/848823c71413c86e7f1ff9584f43e08d40a7f2c0/b3/tools/debug/statlib/stats.py#L2916-L2926
ns2250225/py-mt4
60b6b98f80923289dc6a73542e4b31e34abc030c
pythonicMT4.py
python
zmq_python.get_data
(self, symbol, timeframe, start_bar, end_bar)
return price_arr
only start_bar and end_bar as int
only start_bar and end_bar as int
[ "only", "start_bar", "and", "end_bar", "as", "int" ]
def get_data(self, symbol, timeframe, start_bar, end_bar): ''' only start_bar and end_bar as int ''' self.data = "DATA|"+ symbol+"|"+"PERIOD_"+timeframe+"|"+str(start_bar)+"|"+str(end_bar+1) self.remote_send(self.reqSocket, self.data) prices= self.remote_pull(self.pullSoc...
[ "def", "get_data", "(", "self", ",", "symbol", ",", "timeframe", ",", "start_bar", ",", "end_bar", ")", ":", "self", ".", "data", "=", "\"DATA|\"", "+", "symbol", "+", "\"|\"", "+", "\"PERIOD_\"", "+", "timeframe", "+", "\"|\"", "+", "str", "(", "start...
https://github.com/ns2250225/py-mt4/blob/60b6b98f80923289dc6a73542e4b31e34abc030c/pythonicMT4.py#L42-L54
golismero/golismero
7d605b937e241f51c1ca4f47b20f755eeefb9d76
thirdparty_libs/django/db/models/sql/query.py
python
Query.reset_refcounts
(self, to_counts)
This method will reset reference counts for aliases so that they match the value passed in :param to_counts:.
This method will reset reference counts for aliases so that they match the value passed in :param to_counts:.
[ "This", "method", "will", "reset", "reference", "counts", "for", "aliases", "so", "that", "they", "match", "the", "value", "passed", "in", ":", "param", "to_counts", ":", "." ]
def reset_refcounts(self, to_counts): """ This method will reset reference counts for aliases so that they match the value passed in :param to_counts:. """ for alias, cur_refcount in self.alias_refcount.copy().items(): unref_amount = cur_refcount - to_counts.get(alias...
[ "def", "reset_refcounts", "(", "self", ",", "to_counts", ")", ":", "for", "alias", ",", "cur_refcount", "in", "self", ".", "alias_refcount", ".", "copy", "(", ")", ".", "items", "(", ")", ":", "unref_amount", "=", "cur_refcount", "-", "to_counts", ".", "...
https://github.com/golismero/golismero/blob/7d605b937e241f51c1ca4f47b20f755eeefb9d76/thirdparty_libs/django/db/models/sql/query.py#L733-L740
Chaffelson/nipyapi
d3b186fd701ce308c2812746d98af9120955e810
nipyapi/nifi/models/reporting_task_dto.py
python
ReportingTaskDTO.scheduling_period
(self)
return self._scheduling_period
Gets the scheduling_period of this ReportingTaskDTO. The frequency with which to schedule the reporting task. The format of the value willd epend on the valud of the schedulingStrategy. :return: The scheduling_period of this ReportingTaskDTO. :rtype: str
Gets the scheduling_period of this ReportingTaskDTO. The frequency with which to schedule the reporting task. The format of the value willd epend on the valud of the schedulingStrategy.
[ "Gets", "the", "scheduling_period", "of", "this", "ReportingTaskDTO", ".", "The", "frequency", "with", "which", "to", "schedule", "the", "reporting", "task", ".", "The", "format", "of", "the", "value", "willd", "epend", "on", "the", "valud", "of", "the", "sc...
def scheduling_period(self): """ Gets the scheduling_period of this ReportingTaskDTO. The frequency with which to schedule the reporting task. The format of the value willd epend on the valud of the schedulingStrategy. :return: The scheduling_period of this ReportingTaskDTO. :rt...
[ "def", "scheduling_period", "(", "self", ")", ":", "return", "self", ".", "_scheduling_period" ]
https://github.com/Chaffelson/nipyapi/blob/d3b186fd701ce308c2812746d98af9120955e810/nipyapi/nifi/models/reporting_task_dto.py#L472-L480
RasaHQ/rasa
54823b68c1297849ba7ae841a4246193cd1223a1
rasa/shared/core/events.py
python
StoryExported.__init__
( self, path: Optional[Text] = None, timestamp: Optional[float] = None, metadata: Optional[Dict[Text, Any]] = None, )
Creates event about story exporting. Args: path: Path to which story was exported to. timestamp: When the event was created. metadata: Additional event metadata.
Creates event about story exporting.
[ "Creates", "event", "about", "story", "exporting", "." ]
def __init__( self, path: Optional[Text] = None, timestamp: Optional[float] = None, metadata: Optional[Dict[Text, Any]] = None, ) -> None: """Creates event about story exporting. Args: path: Path to which story was exported to. timestamp: When...
[ "def", "__init__", "(", "self", ",", "path", ":", "Optional", "[", "Text", "]", "=", "None", ",", "timestamp", ":", "Optional", "[", "float", "]", "=", "None", ",", "metadata", ":", "Optional", "[", "Dict", "[", "Text", ",", "Any", "]", "]", "=", ...
https://github.com/RasaHQ/rasa/blob/54823b68c1297849ba7ae841a4246193cd1223a1/rasa/shared/core/events.py#L1330-L1344
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/site-packages/astropy-4.0-py3.7-macosx-10.9-x86_64.egg/astropy/cosmology/core.py
python
wpwaCDM.wp
(self)
return self._wp
Dark energy equation of state at the pivot redshift zp
Dark energy equation of state at the pivot redshift zp
[ "Dark", "energy", "equation", "of", "state", "at", "the", "pivot", "redshift", "zp" ]
def wp(self): """ Dark energy equation of state at the pivot redshift zp""" return self._wp
[ "def", "wp", "(", "self", ")", ":", "return", "self", ".", "_wp" ]
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/astropy-4.0-py3.7-macosx-10.9-x86_64.egg/astropy/cosmology/core.py#L2999-L3001
number5/cloud-init
19948dbaf40309355e1a2dbef116efb0ce66245c
cloudinit/distros/debian.py
python
read_system_locale
(sys_path=LOCALE_CONF_FN, keyname="LANG")
return sys_val
Read system default locale setting, if present
Read system default locale setting, if present
[ "Read", "system", "default", "locale", "setting", "if", "present" ]
def read_system_locale(sys_path=LOCALE_CONF_FN, keyname="LANG"): """Read system default locale setting, if present""" sys_val = "" if not sys_path: raise ValueError("Invalid path: %s" % sys_path) if os.path.exists(sys_path): locale_content = util.load_file(sys_path) sys_defaults...
[ "def", "read_system_locale", "(", "sys_path", "=", "LOCALE_CONF_FN", ",", "keyname", "=", "\"LANG\"", ")", ":", "sys_val", "=", "\"\"", "if", "not", "sys_path", ":", "raise", "ValueError", "(", "\"Invalid path: %s\"", "%", "sys_path", ")", "if", "os", ".", "...
https://github.com/number5/cloud-init/blob/19948dbaf40309355e1a2dbef116efb0ce66245c/cloudinit/distros/debian.py#L348-L359
spotify/luigi
c3b66f4a5fa7eaa52f9a72eb6704b1049035c789
luigi/contrib/rdbms.py
python
CopyToTable.init_copy
(self, connection)
Override to perform custom queries. Any code here will be formed in the same transaction as the main copy, just prior to copying data. Example use cases include truncating the table or removing all data older than X in the database to keep a rolling window of data available in the table.
Override to perform custom queries.
[ "Override", "to", "perform", "custom", "queries", "." ]
def init_copy(self, connection): """ Override to perform custom queries. Any code here will be formed in the same transaction as the main copy, just prior to copying data. Example use cases include truncating the table or removing all data older than X in the database to keep a ...
[ "def", "init_copy", "(", "self", ",", "connection", ")", ":", "# TODO: remove this after sufficient time so most people using the", "# clear_table attribtue will have noticed it doesn't work anymore", "if", "hasattr", "(", "self", ",", "\"clear_table\"", ")", ":", "raise", "Exc...
https://github.com/spotify/luigi/blob/c3b66f4a5fa7eaa52f9a72eb6704b1049035c789/luigi/contrib/rdbms.py#L237-L252
dfirtrack/dfirtrack
d405e9e2520f3f95372883e6543fa2aa7dac0121
dfirtrack_main/exporter/markdown/write_report.py
python
write_headline
(django_report, system)
write headline
write headline
[ "write", "headline" ]
def write_headline(django_report, system): """write headline""" django_report.write("# " + system.system_name + "\n") emptyline(django_report)
[ "def", "write_headline", "(", "django_report", ",", "system", ")", ":", "django_report", ".", "write", "(", "\"# \"", "+", "system", ".", "system_name", "+", "\"\\n\"", ")", "emptyline", "(", "django_report", ")" ]
https://github.com/dfirtrack/dfirtrack/blob/d405e9e2520f3f95372883e6543fa2aa7dac0121/dfirtrack_main/exporter/markdown/write_report.py#L9-L13