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
aws-samples/aws-kube-codesuite
ab4e5ce45416b83bffb947ab8d234df5437f4fca
src/kubernetes/client/models/v1_nfs_volume_source.py
python
V1NFSVolumeSource.read_only
(self, read_only)
Sets the read_only of this V1NFSVolumeSource. ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs :param read_only: The read_only of this V1NFSVolumeSource. :type: bool
Sets the read_only of this V1NFSVolumeSource. ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs
[ "Sets", "the", "read_only", "of", "this", "V1NFSVolumeSource", ".", "ReadOnly", "here", "will", "force", "the", "NFS", "export", "to", "be", "mounted", "with", "read", "-", "only", "permissions", ".", "Defaults", "to", "false", ".", "More", "info", ":", "h...
def read_only(self, read_only): """ Sets the read_only of this V1NFSVolumeSource. ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs :param read_only: The read_only of th...
[ "def", "read_only", "(", "self", ",", "read_only", ")", ":", "self", ".", "_read_only", "=", "read_only" ]
https://github.com/aws-samples/aws-kube-codesuite/blob/ab4e5ce45416b83bffb947ab8d234df5437f4fca/src/kubernetes/client/models/v1_nfs_volume_source.py#L86-L95
huggingface/transformers
623b4f7c63f60cce917677ee704d6c93ee960b4b
src/transformers/models/deberta/modeling_tf_deberta.py
python
TFDebertaSelfOutput.__init__
(self, config: DebertaConfig, **kwargs)
[]
def __init__(self, config: DebertaConfig, **kwargs): super().__init__(**kwargs) self.dense = tf.keras.layers.Dense(config.hidden_size, name="dense") self.LayerNorm = tf.keras.layers.LayerNormalization(epsilon=config.layer_norm_eps, name="LayerNorm") self.dropout = TFDebertaStableDropout(...
[ "def", "__init__", "(", "self", ",", "config", ":", "DebertaConfig", ",", "*", "*", "kwargs", ")", ":", "super", "(", ")", ".", "__init__", "(", "*", "*", "kwargs", ")", "self", ".", "dense", "=", "tf", ".", "keras", ".", "layers", ".", "Dense", ...
https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/models/deberta/modeling_tf_deberta.py#L165-L169
qiyuangong/leetcode
790f9ee86dcc7bf85be1bd9358f4c069b4a4c2f5
python/225_Implement_Stack_using_Queues.py
python
Stack.top
(self)
:rtype: int
:rtype: int
[ ":", "rtype", ":", "int" ]
def top(self): """ :rtype: int """ if self.empty() is False: return self.curr_top
[ "def", "top", "(", "self", ")", ":", "if", "self", ".", "empty", "(", ")", "is", "False", ":", "return", "self", ".", "curr_top" ]
https://github.com/qiyuangong/leetcode/blob/790f9ee86dcc7bf85be1bd9358f4c069b4a4c2f5/python/225_Implement_Stack_using_Queues.py#L75-L80
Azure/azure-iot-sdk-python
51fa810907373fd2134af49bd03d3977ca7a9a8d
azure-iot-device/azure/iot/device/common/http_transport.py
python
HTTPTransport.request
(self, method, path, callback, body="", headers={}, query_params="")
This method creates a connection to a remote host, sends a request to that host, and then waits for and reads the response from that request. :param str method: The request method (e.g. "POST") :param str path: The path for the URL :param Function callback: The function that gets called when th...
This method creates a connection to a remote host, sends a request to that host, and then waits for and reads the response from that request.
[ "This", "method", "creates", "a", "connection", "to", "a", "remote", "host", "sends", "a", "request", "to", "that", "host", "and", "then", "waits", "for", "and", "reads", "the", "response", "from", "that", "request", "." ]
def request(self, method, path, callback, body="", headers={}, query_params=""): """ This method creates a connection to a remote host, sends a request to that host, and then waits for and reads the response from that request. :param str method: The request method (e.g. "POST") :param s...
[ "def", "request", "(", "self", ",", "method", ",", "path", ",", "callback", ",", "body", "=", "\"\"", ",", "headers", "=", "{", "}", ",", "query_params", "=", "\"\"", ")", ":", "# Sends a complete request to the server", "logger", ".", "info", "(", "\"send...
https://github.com/Azure/azure-iot-sdk-python/blob/51fa810907373fd2134af49bd03d3977ca7a9a8d/azure-iot-device/azure/iot/device/common/http_transport.py#L72-L127
jliljebl/flowblade
995313a509b80e99eb1ad550d945bdda5995093b
flowblade-trunk/Flowblade/mltfilters.py
python
get_colorize_filter_info
()
return _colorize_filter_info
[]
def get_colorize_filter_info(): return _colorize_filter_info
[ "def", "get_colorize_filter_info", "(", ")", ":", "return", "_colorize_filter_info" ]
https://github.com/jliljebl/flowblade/blob/995313a509b80e99eb1ad550d945bdda5995093b/flowblade-trunk/Flowblade/mltfilters.py#L524-L525
floooh/fips
5ce5aebfc7c69778cab03ef5f8830928f2bad6d4
mod/project.py
python
clean
(fips_dir, proj_dir, cfg_name)
clean build files :param fips_dir: absolute path of fips :param proj_dir: absolute project path :param cfg_name: config name (or pattern)
clean build files
[ "clean", "build", "files" ]
def clean(fips_dir, proj_dir, cfg_name) : """clean build files :param fips_dir: absolute path of fips :param proj_dir: absolute project path :param cfg_name: config name (or pattern) """ proj_name = util.get_project_name_from_dir(proj_dir) configs = config.load(fips_dir, proj_dir, ...
[ "def", "clean", "(", "fips_dir", ",", "proj_dir", ",", "cfg_name", ")", ":", "proj_name", "=", "util", ".", "get_project_name_from_dir", "(", "proj_dir", ")", "configs", "=", "config", ".", "load", "(", "fips_dir", ",", "proj_dir", ",", "cfg_name", ")", "i...
https://github.com/floooh/fips/blob/5ce5aebfc7c69778cab03ef5f8830928f2bad6d4/mod/project.py#L350-L383
brendano/tweetmotif
1b0b1e3a941745cd5a26eba01f554688b7c4b27e
everything_else/djfrontend/django-1.0.2/forms/forms.py
python
BoundField.as_hidden
(self, attrs=None, **kwargs)
return self.as_widget(self.field.hidden_widget(), attrs, **kwargs)
Returns a string of HTML for representing this as an <input type="hidden">.
Returns a string of HTML for representing this as an <input type="hidden">.
[ "Returns", "a", "string", "of", "HTML", "for", "representing", "this", "as", "an", "<input", "type", "=", "hidden", ">", "." ]
def as_hidden(self, attrs=None, **kwargs): """ Returns a string of HTML for representing this as an <input type="hidden">. """ return self.as_widget(self.field.hidden_widget(), attrs, **kwargs)
[ "def", "as_hidden", "(", "self", ",", "attrs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "as_widget", "(", "self", ".", "field", ".", "hidden_widget", "(", ")", ",", "attrs", ",", "*", "*", "kwargs", ")" ]
https://github.com/brendano/tweetmotif/blob/1b0b1e3a941745cd5a26eba01f554688b7c4b27e/everything_else/djfrontend/django-1.0.2/forms/forms.py#L377-L381
eliasdabbas/advertools
5d3d3c88bfb76fe2917f3583de8fe874e26a5900
advertools/urlytics.py
python
url_to_df
(urls, decode=True)
return df
Split the given URLs into their components to a DataFrame. Each column will have its own component, and query parameters and directories will also be parsed and given special columns each. :param url urls: A list of URLs to split into components :param bool decode: Whether or not to decode the given U...
Split the given URLs into their components to a DataFrame.
[ "Split", "the", "given", "URLs", "into", "their", "components", "to", "a", "DataFrame", "." ]
def url_to_df(urls, decode=True): """Split the given URLs into their components to a DataFrame. Each column will have its own component, and query parameters and directories will also be parsed and given special columns each. :param url urls: A list of URLs to split into components :param bool dec...
[ "def", "url_to_df", "(", "urls", ",", "decode", "=", "True", ")", ":", "if", "isinstance", "(", "urls", ",", "str", ")", ":", "urls", "=", "[", "urls", "]", "decode", "=", "unquote", "if", "decode", "else", "lambda", "x", ":", "x", "split_list", "=...
https://github.com/eliasdabbas/advertools/blob/5d3d3c88bfb76fe2917f3583de8fe874e26a5900/advertools/urlytics.py#L139-L191
JaywongWang/DenseVideoCaptioning
db31ca2b597840494eee31547d3bf3215a995846
densevid_eval-master/coco-caption/pycocoevalcap/bleu/bleu_scorer.py
python
cook_refs
(refs, eff=None, n=4)
return (reflen, maxcounts)
Takes a list of reference sentences for a single segment and returns an object that encapsulates everything that BLEU needs to know about them.
Takes a list of reference sentences for a single segment and returns an object that encapsulates everything that BLEU needs to know about them.
[ "Takes", "a", "list", "of", "reference", "sentences", "for", "a", "single", "segment", "and", "returns", "an", "object", "that", "encapsulates", "everything", "that", "BLEU", "needs", "to", "know", "about", "them", "." ]
def cook_refs(refs, eff=None, 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.''' reflen = [] maxcounts = {} for ref in refs: rl, counts = p...
[ "def", "cook_refs", "(", "refs", ",", "eff", "=", "None", ",", "n", "=", "4", ")", ":", "## lhuang: oracle will call with \"average\"", "reflen", "=", "[", "]", "maxcounts", "=", "{", "}", "for", "ref", "in", "refs", ":", "rl", ",", "counts", "=", "pre...
https://github.com/JaywongWang/DenseVideoCaptioning/blob/db31ca2b597840494eee31547d3bf3215a995846/densevid_eval-master/coco-caption/pycocoevalcap/bleu/bleu_scorer.py#L35-L58
rowliny/DiffHelper
ab3a96f58f9579d0023aed9ebd785f4edf26f8af
Tool/SitePackages/nltk/sem/logic.py
python
Expression.normalize
(self, newvars=None)
return result
Rename auto-generated unique variables
Rename auto-generated unique variables
[ "Rename", "auto", "-", "generated", "unique", "variables" ]
def normalize(self, newvars=None): """Rename auto-generated unique variables""" def get_indiv_vars(e): if isinstance(e, IndividualVariableExpression): return {e} elif isinstance(e, AbstractVariableExpression): return set() else: ...
[ "def", "normalize", "(", "self", ",", "newvars", "=", "None", ")", ":", "def", "get_indiv_vars", "(", "e", ")", ":", "if", "isinstance", "(", "e", ",", "IndividualVariableExpression", ")", ":", "return", "{", "e", "}", "elif", "isinstance", "(", "e", "...
https://github.com/rowliny/DiffHelper/blob/ab3a96f58f9579d0023aed9ebd785f4edf26f8af/Tool/SitePackages/nltk/sem/logic.py#L1097-L1119
robhagemans/pcbasic
c3a043b46af66623a801e18a38175be077251ada
pcbasic/basic/devices/parports.py
python
StdIOParallelStream.get_status
(self)
return False, False, False, False, False
Get the values of the status pins.
Get the values of the status pins.
[ "Get", "the", "values", "of", "the", "status", "pins", "." ]
def get_status(self): """Get the values of the status pins.""" return False, False, False, False, False
[ "def", "get_status", "(", "self", ")", ":", "return", "False", ",", "False", ",", "False", ",", "False", ",", "False" ]
https://github.com/robhagemans/pcbasic/blob/c3a043b46af66623a801e18a38175be077251ada/pcbasic/basic/devices/parports.py#L300-L302
aws-samples/aws-kube-codesuite
ab4e5ce45416b83bffb947ab8d234df5437f4fca
src/kubernetes/client/apis/core_v1_api.py
python
CoreV1Api.connect_get_node_proxy_with_http_info
(self, name, **kwargs)
return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_p...
connect GET requests to proxy of Node This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) ...
connect GET requests to proxy of Node This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) ...
[ "connect", "GET", "requests", "to", "proxy", "of", "Node", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a", "callback", "function", "to", "...
def connect_get_node_proxy_with_http_info(self, name, **kwargs): """ connect GET requests to proxy of Node This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response....
[ "def", "connect_get_node_proxy_with_http_info", "(", "self", ",", "name", ",", "*", "*", "kwargs", ")", ":", "all_params", "=", "[", "'name'", ",", "'path'", "]", "all_params", ".", "append", "(", "'callback'", ")", "all_params", ".", "append", "(", "'_retur...
https://github.com/aws-samples/aws-kube-codesuite/blob/ab4e5ce45416b83bffb947ab8d234df5437f4fca/src/kubernetes/client/apis/core_v1_api.py#L1634-L1715
zatosource/zato
2a9d273f06f9d776fbfeb53e73855af6e40fa208
code/zato-common/src/zato/common/odb/api.py
python
ODBManager.get_cache_memcached
(self, cluster_id, id)
Returns a Memcached-based definition's details.
Returns a Memcached-based definition's details.
[ "Returns", "a", "Memcached", "-", "based", "definition", "s", "details", "." ]
def get_cache_memcached(self, cluster_id, id): """ Returns a Memcached-based definition's details. """ with closing(self.session()) as session: return query.cache_memcached(session, cluster_id, id)
[ "def", "get_cache_memcached", "(", "self", ",", "cluster_id", ",", "id", ")", ":", "with", "closing", "(", "self", ".", "session", "(", ")", ")", "as", "session", ":", "return", "query", ".", "cache_memcached", "(", "session", ",", "cluster_id", ",", "id...
https://github.com/zatosource/zato/blob/2a9d273f06f9d776fbfeb53e73855af6e40fa208/code/zato-common/src/zato/common/odb/api.py#L1311-L1315
BitcoinExchangeFH/BitcoinExchangeFH
a1905985cbd8dde23e31e1229c0bf5946245a9b8
befh/core/runner.py
python
Runner.load
(self)
Load.
Load.
[ "Load", "." ]
def load(self): """Load. """ LOGGER.info('Loading runner') handlers_configuration = self._config.handlers handlers = self.create_handlers( handlers_configuration=handlers_configuration, is_debug=self._is_debug, is_cold=self._is_cold) ...
[ "def", "load", "(", "self", ")", ":", "LOGGER", ".", "info", "(", "'Loading runner'", ")", "handlers_configuration", "=", "self", ".", "_config", ".", "handlers", "handlers", "=", "self", ".", "create_handlers", "(", "handlers_configuration", "=", "handlers_conf...
https://github.com/BitcoinExchangeFH/BitcoinExchangeFH/blob/a1905985cbd8dde23e31e1229c0bf5946245a9b8/befh/core/runner.py#L21-L41
edisonlz/fastor
342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3
base/site-packages/tagging/__init__.py
python
register
(model, tag_descriptor_attr='tags', tagged_item_manager_attr='tagged')
Sets the given model class up for working with tags.
Sets the given model class up for working with tags.
[ "Sets", "the", "given", "model", "class", "up", "for", "working", "with", "tags", "." ]
def register(model, tag_descriptor_attr='tags', tagged_item_manager_attr='tagged'): """ Sets the given model class up for working with tags. """ from tagging.managers import ModelTaggedItemManager, TagDescriptor if model in registry: raise AlreadyRegistered("The model '%s' has...
[ "def", "register", "(", "model", ",", "tag_descriptor_attr", "=", "'tags'", ",", "tagged_item_manager_attr", "=", "'tagged'", ")", ":", "from", "tagging", ".", "managers", "import", "ModelTaggedItemManager", ",", "TagDescriptor", "if", "model", "in", "registry", "...
https://github.com/edisonlz/fastor/blob/342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3/base/site-packages/tagging/__init__.py#L29-L62
simpeg/simpeg
d93145d768b5512621cdd75566b4a8175fee9ed3
SimPEG/electromagnetics/natural_source/fields.py
python
Fields3DPrimarySecondary._e_pxSecondary
(self, e_pxSolution, source_list)
return e_pxSolution
px polarization of secondary electric field from source :param numpy.ndarray e_pxSolution: px polarization that was solved for :param list source_list: list of sources :rtype: numpy.ndarray :return: secondary electric field as defined by the sources
px polarization of secondary electric field from source
[ "px", "polarization", "of", "secondary", "electric", "field", "from", "source" ]
def _e_pxSecondary(self, e_pxSolution, source_list): """ px polarization of secondary electric field from source :param numpy.ndarray e_pxSolution: px polarization that was solved for :param list source_list: list of sources :rtype: numpy.ndarray :return: secondary elect...
[ "def", "_e_pxSecondary", "(", "self", ",", "e_pxSolution", ",", "source_list", ")", ":", "return", "e_pxSolution" ]
https://github.com/simpeg/simpeg/blob/d93145d768b5512621cdd75566b4a8175fee9ed3/SimPEG/electromagnetics/natural_source/fields.py#L284-L294
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/components/numato/binary_sensor.py
python
NumatoGpioBinarySensor.name
(self)
return self._name
Return the name of the sensor.
Return the name of the sensor.
[ "Return", "the", "name", "of", "the", "sensor", "." ]
def name(self): """Return the name of the sensor.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/numato/binary_sensor.py#L115-L117
telegraphic/hickle
a5aac2db4e236d90990e3387c5822b466e8e84fa
hickle/loaders/load_astropy.py
python
create_astropy_angle
(py_obj, h_group, name, **kwargs)
return d,()
dumps an astropy angle Parameters ---------- py_obj: python object to dump; should be a python type h_group (h5.File.group): group to dump data into. name (str): the name of the resulting dataset kwargs (dict): keyword arguments to be passed to create_dataset ...
dumps an astropy angle
[ "dumps", "an", "astropy", "angle" ]
def create_astropy_angle(py_obj, h_group, name, **kwargs): """ dumps an astropy angle Parameters ---------- py_obj: python object to dump; should be a python type h_group (h5.File.group): group to dump data into. name (str): the name of the resulting dataset k...
[ "def", "create_astropy_angle", "(", "py_obj", ",", "h_group", ",", "name", ",", "*", "*", "kwargs", ")", ":", "d", "=", "h_group", ".", "create_dataset", "(", "name", ",", "data", "=", "py_obj", ".", "value", ",", "dtype", "=", "'float64'", ",", "*", ...
https://github.com/telegraphic/hickle/blob/a5aac2db4e236d90990e3387c5822b466e8e84fa/hickle/loaders/load_astropy.py#L44-L70
mesalock-linux/mesapy
ed546d59a21b36feb93e2309d5c6b75aa0ad95c9
rpython/rtyper/lltypesystem/rffi.py
python
get_raw_address_of_string
(string)
Returns a 'char *' that is valid as long as the rpython string object is alive. Two calls to to this function, given the same string parameter, are guaranteed to return the same pointer. The extra parameter key is necessary to create a weak reference. The buffer of the returned pointer (if object is yo...
Returns a 'char *' that is valid as long as the rpython string object is alive. Two calls to to this function, given the same string parameter, are guaranteed to return the same pointer.
[ "Returns", "a", "char", "*", "that", "is", "valid", "as", "long", "as", "the", "rpython", "string", "object", "is", "alive", ".", "Two", "calls", "to", "to", "this", "function", "given", "the", "same", "string", "parameter", "are", "guaranteed", "to", "r...
def get_raw_address_of_string(string): """Returns a 'char *' that is valid as long as the rpython string object is alive. Two calls to to this function, given the same string parameter, are guaranteed to return the same pointer. The extra parameter key is necessary to create a weak reference. The b...
[ "def", "get_raw_address_of_string", "(", "string", ")", ":", "assert", "isinstance", "(", "string", ",", "str", ")", "from", "rpython", ".", "rtyper", ".", "annlowlevel", "import", "llstr", "from", "rpython", ".", "rtyper", ".", "lltypesystem", ".", "rstr", ...
https://github.com/mesalock-linux/mesapy/blob/ed546d59a21b36feb93e2309d5c6b75aa0ad95c9/rpython/rtyper/lltypesystem/rffi.py#L1336-L1374
anchore/anchore-engine
bb18b70e0cbcad58beb44cd439d00067d8f7ea8b
anchore_engine/db/entities/policy_engine.py
python
VersionPreservingDistroMapper._do_mapping
(self)
Map from the given values to a new distro if an explicit mapping exists or else None :param distro_name: :param distro_version: :param like_distro: :return: list of tuples: [(distro, version, flavor), ... ,(distro, versionN, flavorN)]
Map from the given values to a new distro if an explicit mapping exists or else None
[ "Map", "from", "the", "given", "values", "to", "a", "new", "distro", "if", "an", "explicit", "mapping", "exists", "or", "else", "None" ]
def _do_mapping(self): """ Map from the given values to a new distro if an explicit mapping exists or else None :param distro_name: :param distro_version: :param like_distro: :return: list of tuples: [(distro, version, flavor), ... ,(distro, versionN, flavorN)] "...
[ "def", "_do_mapping", "(", "self", ")", ":", "distro", "=", "None", "versions", "=", "None", "flavor", "=", "None", "try", ":", "distro", "=", "self", ".", "_map_name", "(", "self", ".", "from_distro", ",", "self", ".", "from_version", ",", "self", "."...
https://github.com/anchore/anchore-engine/blob/bb18b70e0cbcad58beb44cd439d00067d8f7ea8b/anchore_engine/db/entities/policy_engine.py#L3154-L3196
nutonomy/nuscenes-devkit
05d05b3c994fb3c17b6643016d9f622a001c7275
python-sdk/nuscenes/nuscenes.py
python
NuScenesExplorer._plot_points_and_bboxes
(self, pointsensor_token: str, camera_token: str, filter_lidarseg_labels: Iterable[int] = None, lidarseg_preds_bin_path: str = None, with_anns: bool = False, ...
return mat, no_points_in_im
Projects a pointcloud into a camera image along with the lidarseg labels. There is an option to plot the bounding boxes as well. :param pointsensor_token: Token of lidar sensor to render points from and lidarseg labels. :param camera_token: Token of camera to render image from. :param fi...
Projects a pointcloud into a camera image along with the lidarseg labels. There is an option to plot the bounding boxes as well. :param pointsensor_token: Token of lidar sensor to render points from and lidarseg labels. :param camera_token: Token of camera to render image from. :param fi...
[ "Projects", "a", "pointcloud", "into", "a", "camera", "image", "along", "with", "the", "lidarseg", "labels", ".", "There", "is", "an", "option", "to", "plot", "the", "bounding", "boxes", "as", "well", ".", ":", "param", "pointsensor_token", ":", "Token", "...
def _plot_points_and_bboxes(self, pointsensor_token: str, camera_token: str, filter_lidarseg_labels: Iterable[int] = None, lidarseg_preds_bin_path: str = None, ...
[ "def", "_plot_points_and_bboxes", "(", "self", ",", "pointsensor_token", ":", "str", ",", "camera_token", ":", "str", ",", "filter_lidarseg_labels", ":", "Iterable", "[", "int", "]", "=", "None", ",", "lidarseg_preds_bin_path", ":", "str", "=", "None", ",", "w...
https://github.com/nutonomy/nuscenes-devkit/blob/05d05b3c994fb3c17b6643016d9f622a001c7275/python-sdk/nuscenes/nuscenes.py#L1876-L1946
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_hxb2/lib/python3.5/site-packages/rest_framework/decorators.py
python
api_view
(http_method_names=None, exclude_from_schema=False)
return decorator
Decorator that converts a function-based view into an APIView subclass. Takes a list of allowed methods for the view as an argument.
Decorator that converts a function-based view into an APIView subclass. Takes a list of allowed methods for the view as an argument.
[ "Decorator", "that", "converts", "a", "function", "-", "based", "view", "into", "an", "APIView", "subclass", ".", "Takes", "a", "list", "of", "allowed", "methods", "for", "the", "view", "as", "an", "argument", "." ]
def api_view(http_method_names=None, exclude_from_schema=False): """ Decorator that converts a function-based view into an APIView subclass. Takes a list of allowed methods for the view as an argument. """ http_method_names = ['GET'] if (http_method_names is None) else http_method_names def dec...
[ "def", "api_view", "(", "http_method_names", "=", "None", ",", "exclude_from_schema", "=", "False", ")", ":", "http_method_names", "=", "[", "'GET'", "]", "if", "(", "http_method_names", "is", "None", ")", "else", "http_method_names", "def", "decorator", "(", ...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/rest_framework/decorators.py#L18-L77
privacyidea/privacyidea
9490c12ddbf77a34ac935b082d09eb583dfafa2c
privacyidea/lib/tokens/webauthn.py
python
WebAuthnUser.__init__
(self, user_id, user_name, user_display_name, icon_url, credential_id, public_key, sign_count, rp_id)
Create a new WebAuthnUser object. :param user_id: The ID for the user credential being stored. This is the privacyIDEA token serial. :type user_id: basestring :param user_name: The user name the user logs in with. :type user_name: basestring :param user_display_name: The human r...
Create a new WebAuthnUser object.
[ "Create", "a", "new", "WebAuthnUser", "object", "." ]
def __init__(self, user_id, user_name, user_display_name, icon_url, credential_id, public_key, sign_count, rp_id): """ Create a new WebAuthnUser object. :param...
[ "def", "__init__", "(", "self", ",", "user_id", ",", "user_name", ",", "user_display_name", ",", "icon_url", ",", "credential_id", ",", "public_key", ",", "sign_count", ",", "rp_id", ")", ":", "if", "not", "credential_id", ":", "raise", "WebAuthnUserDataMissing"...
https://github.com/privacyidea/privacyidea/blob/9490c12ddbf77a34ac935b082d09eb583dfafa2c/privacyidea/lib/tokens/webauthn.py#L640-L686
nasa/CrisisMappingToolkit
0296487974d74cec6aa8be42eafbb5cd24dc6a51
app_engine/libs/bs4/builder/__init__.py
python
TreeBuilder.prepare_markup
(self, markup, user_specified_encoding=None, document_declared_encoding=None)
return markup, None, None, False
[]
def prepare_markup(self, markup, user_specified_encoding=None, document_declared_encoding=None): return markup, None, None, False
[ "def", "prepare_markup", "(", "self", ",", "markup", ",", "user_specified_encoding", "=", "None", ",", "document_declared_encoding", "=", "None", ")", ":", "return", "markup", ",", "None", ",", "None", ",", "False" ]
https://github.com/nasa/CrisisMappingToolkit/blob/0296487974d74cec6aa8be42eafbb5cd24dc6a51/app_engine/libs/bs4/builder/__init__.py#L128-L130
beetbox/beets
2fea53c34dd505ba391cb345424e0613901c8025
beets/autotag/match.py
python
distance
(items, album_info, mapping)
return dist
Determines how "significant" an album metadata change would be. Returns a Distance object. `album_info` is an AlbumInfo object reflecting the album to be compared. `items` is a sequence of all Item objects that will be matched (order is not important). `mapping` is a dictionary mapping Items to TrackInf...
Determines how "significant" an album metadata change would be. Returns a Distance object. `album_info` is an AlbumInfo object reflecting the album to be compared. `items` is a sequence of all Item objects that will be matched (order is not important). `mapping` is a dictionary mapping Items to TrackInf...
[ "Determines", "how", "significant", "an", "album", "metadata", "change", "would", "be", ".", "Returns", "a", "Distance", "object", ".", "album_info", "is", "an", "AlbumInfo", "object", "reflecting", "the", "album", "to", "be", "compared", ".", "items", "is", ...
def distance(items, album_info, mapping): """Determines how "significant" an album metadata change would be. Returns a Distance object. `album_info` is an AlbumInfo object reflecting the album to be compared. `items` is a sequence of all Item objects that will be matched (order is not important). `m...
[ "def", "distance", "(", "items", ",", "album_info", ",", "mapping", ")", ":", "likelies", ",", "_", "=", "current_metadata", "(", "items", ")", "dist", "=", "hooks", ".", "Distance", "(", ")", "# Artist, if not various.", "if", "not", "album_info", ".", "v...
https://github.com/beetbox/beets/blob/2fea53c34dd505ba391cb345424e0613901c8025/beets/autotag/match.py#L160-L263
Tautulli/Tautulli
2410eb33805aaac4bd1c5dad0f71e4f15afaf742
lib/arrow/arrow.py
python
Arrow.__le__
(self, other: Any)
return self._datetime <= self._get_datetime(other)
[]
def __le__(self, other: Any) -> bool: if not isinstance(other, (Arrow, dt_datetime)): return NotImplemented return self._datetime <= self._get_datetime(other)
[ "def", "__le__", "(", "self", ",", "other", ":", "Any", ")", "->", "bool", ":", "if", "not", "isinstance", "(", "other", ",", "(", "Arrow", ",", "dt_datetime", ")", ")", ":", "return", "NotImplemented", "return", "self", ".", "_datetime", "<=", "self",...
https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/arrow/arrow.py#L1795-L1800
polakowo/vectorbt
6638735c131655760474d72b9f045d1dbdbd8fe9
vectorbt/messaging/telegram.py
python
TelegramBot.error_callback
(self, update: object, context: CallbackContext, *args)
Error callback.
Error callback.
[ "Error", "callback", "." ]
def error_callback(self, update: object, context: CallbackContext, *args) -> None: """Error callback.""" logger.error("Exception while handling an update \"%s\": ", update, exc_info=context.error) if isinstance(update, Update) and update.effective_chat: chat_id = update.effective_cha...
[ "def", "error_callback", "(", "self", ",", "update", ":", "object", ",", "context", ":", "CallbackContext", ",", "*", "args", ")", "->", "None", ":", "logger", ".", "error", "(", "\"Exception while handling an update \\\"%s\\\": \"", ",", "update", ",", "exc_inf...
https://github.com/polakowo/vectorbt/blob/6638735c131655760474d72b9f045d1dbdbd8fe9/vectorbt/messaging/telegram.py#L350-L355
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/quadratic_forms/random_quadraticform.py
python
random_ternaryqf_with_conditions
(condition_list=[], rand_arg_list=[])
return Q
Create a random ternary quadratic form satisfying a list of boolean (i.e. True/False) conditions. The conditions `c` appearing in the list must be boolean functions which can be called either as ``Q.c()`` or ``c(Q)``, where ``Q`` is the random ternary quadratic form. The last (and optional) argume...
Create a random ternary quadratic form satisfying a list of boolean (i.e. True/False) conditions.
[ "Create", "a", "random", "ternary", "quadratic", "form", "satisfying", "a", "list", "of", "boolean", "(", "i", ".", "e", ".", "True", "/", "False", ")", "conditions", "." ]
def random_ternaryqf_with_conditions(condition_list=[], rand_arg_list=[]): """ Create a random ternary quadratic form satisfying a list of boolean (i.e. True/False) conditions. The conditions `c` appearing in the list must be boolean functions which can be called either as ``Q.c()`` or ``c(Q)``, wh...
[ "def", "random_ternaryqf_with_conditions", "(", "condition_list", "=", "[", "]", ",", "rand_arg_list", "=", "[", "]", ")", ":", "Q", "=", "random_ternaryqf", "(", "rand_arg_list", ")", "Done_Flag", "=", "True", "## Check that all conditions are satisfied", "while", ...
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/quadratic_forms/random_quadraticform.py#L174-L215
elastic/apm-agent-python
67ce41e492f91d0aaf9fdb599e11d42e5f0ea198
elasticapm/contrib/django/middleware/__init__.py
python
_is_ignorable_404
(uri)
return any(pattern.search(uri) for pattern in urls)
Returns True if the given request *shouldn't* notify the site managers.
Returns True if the given request *shouldn't* notify the site managers.
[ "Returns", "True", "if", "the", "given", "request", "*", "shouldn", "t", "*", "notify", "the", "site", "managers", "." ]
def _is_ignorable_404(uri): """ Returns True if the given request *shouldn't* notify the site managers. """ urls = getattr(django_settings, "IGNORABLE_404_URLS", ()) return any(pattern.search(uri) for pattern in urls)
[ "def", "_is_ignorable_404", "(", "uri", ")", ":", "urls", "=", "getattr", "(", "django_settings", ",", "\"IGNORABLE_404_URLS\"", ",", "(", ")", ")", "return", "any", "(", "pattern", ".", "search", "(", "uri", ")", "for", "pattern", "in", "urls", ")" ]
https://github.com/elastic/apm-agent-python/blob/67ce41e492f91d0aaf9fdb599e11d42e5f0ea198/elasticapm/contrib/django/middleware/__init__.py#L61-L66
lisa-lab/pylearn2
af81e5c362f0df4df85c3e54e23b2adeec026055
pylearn2/space/__init__.py
python
CompositeSpace.dtype
(self)
return get_dtype_of_space(self)
Returns a nested tuple of dtype strings. NullSpaces will yield a bogus dtype string (see NullSpace.dtype).
Returns a nested tuple of dtype strings. NullSpaces will yield a bogus dtype string (see NullSpace.dtype).
[ "Returns", "a", "nested", "tuple", "of", "dtype", "strings", ".", "NullSpaces", "will", "yield", "a", "bogus", "dtype", "string", "(", "see", "NullSpace", ".", "dtype", ")", "." ]
def dtype(self): """ Returns a nested tuple of dtype strings. NullSpaces will yield a bogus dtype string (see NullSpace.dtype). """ def get_dtype_of_space(space): if isinstance(space, CompositeSpace): return tuple(get_dtype_of_space(c) for c in space....
[ "def", "dtype", "(", "self", ")", ":", "def", "get_dtype_of_space", "(", "space", ")", ":", "if", "isinstance", "(", "space", ",", "CompositeSpace", ")", ":", "return", "tuple", "(", "get_dtype_of_space", "(", "c", ")", "for", "c", "in", "space", ".", ...
https://github.com/lisa-lab/pylearn2/blob/af81e5c362f0df4df85c3e54e23b2adeec026055/pylearn2/space/__init__.py#L2133-L2147
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_hxb2/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py
python
parse_requirements
(strs)
Yield ``Requirement`` objects for each specification in `strs` `strs` must be a string, or a (possibly-nested) iterable thereof.
Yield ``Requirement`` objects for each specification in `strs`
[ "Yield", "Requirement", "objects", "for", "each", "specification", "in", "strs" ]
def parse_requirements(strs): """Yield ``Requirement`` objects for each specification in `strs` `strs` must be a string, or a (possibly-nested) iterable thereof. """ # create a steppable iterator, so we can handle \-continuations lines = iter(yield_lines(strs)) for line in lines: # Dro...
[ "def", "parse_requirements", "(", "strs", ")", ":", "# create a steppable iterator, so we can handle \\-continuations", "lines", "=", "iter", "(", "yield_lines", "(", "strs", ")", ")", "for", "line", "in", "lines", ":", "# Drop comments -- a hash without a space may be in a...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py#L2851-L2867
Bitmessage/PyBitmessage
97612b049e0453867d6d90aa628f8e7b007b4d85
src/bitmessageqt/settings.py
python
SettingsDialog.comboBoxProxyTypeChanged
(self, comboBoxIndex)
A callback for currentIndexChanged event of comboBoxProxyType
A callback for currentIndexChanged event of comboBoxProxyType
[ "A", "callback", "for", "currentIndexChanged", "event", "of", "comboBoxProxyType" ]
def comboBoxProxyTypeChanged(self, comboBoxIndex): """A callback for currentIndexChanged event of comboBoxProxyType""" if comboBoxIndex == 0: self.lineEditSocksHostname.setEnabled(False) self.lineEditSocksPort.setEnabled(False) self.lineEditSocksUsername.setEnabled(Fa...
[ "def", "comboBoxProxyTypeChanged", "(", "self", ",", "comboBoxIndex", ")", ":", "if", "comboBoxIndex", "==", "0", ":", "self", ".", "lineEditSocksHostname", ".", "setEnabled", "(", "False", ")", "self", ".", "lineEditSocksPort", ".", "setEnabled", "(", "False", ...
https://github.com/Bitmessage/PyBitmessage/blob/97612b049e0453867d6d90aa628f8e7b007b4d85/src/bitmessageqt/settings.py#L239-L257
pymedusa/Medusa
1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
ext/tvdbapiv2/models/series_image_query_result.py
python
SeriesImageQueryResult.language_id
(self, language_id)
Sets the language_id of this SeriesImageQueryResult. :param language_id: The language_id of this SeriesImageQueryResult. :type: int
Sets the language_id of this SeriesImageQueryResult.
[ "Sets", "the", "language_id", "of", "this", "SeriesImageQueryResult", "." ]
def language_id(self, language_id): """ Sets the language_id of this SeriesImageQueryResult. :param language_id: The language_id of this SeriesImageQueryResult. :type: int """ self._language_id = language_id
[ "def", "language_id", "(", "self", ",", "language_id", ")", ":", "self", ".", "_language_id", "=", "language_id" ]
https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/ext/tvdbapiv2/models/series_image_query_result.py#L173-L181
wzzheng/HDML
fa03ef0eb0be2256df7aab928bcc596c41d44fb3
datasets/data_provider.py
python
NPairLossScheme.__init__
(self, labels, batch_size)
[]
def __init__(self, labels, batch_size): self._labels = np.array(labels).flatten() self._label_encoder = LabelEncoder().fit(self._labels) self._classes = self._label_encoder.classes_ self.num_classes = len(self._classes) assert batch_size % 2 == 0, ("batch_size must be even number...
[ "def", "__init__", "(", "self", ",", "labels", ",", "batch_size", ")", ":", "self", ".", "_labels", "=", "np", ".", "array", "(", "labels", ")", ".", "flatten", "(", ")", "self", ".", "_label_encoder", "=", "LabelEncoder", "(", ")", ".", "fit", "(", ...
https://github.com/wzzheng/HDML/blob/fa03ef0eb0be2256df7aab928bcc596c41d44fb3/datasets/data_provider.py#L88-L102
vispy/vispy
26256fdc2574259dd227022fbce0767cae4e244b
vispy/scene/cameras/perspective.py
python
Base3DRotationCamera._update_rotation
(self, event)
Update rotation parmeters based on mouse movement
Update rotation parmeters based on mouse movement
[ "Update", "rotation", "parmeters", "based", "on", "mouse", "movement" ]
def _update_rotation(self, event): """Update rotation parmeters based on mouse movement""" raise NotImplementedError
[ "def", "_update_rotation", "(", "self", ",", "event", ")", ":", "raise", "NotImplementedError" ]
https://github.com/vispy/vispy/blob/26256fdc2574259dd227022fbce0767cae4e244b/vispy/scene/cameras/perspective.py#L317-L319
RTIInternational/gobbli
d9ec8132f74ce49dc4bead2fad25b661bcef6e76
gobbli/model/bert/src/run_classifier.py
python
DataProcessor.get_train_examples
(self, data_dir)
Gets a collection of `InputExample`s for the train set.
Gets a collection of `InputExample`s for the train set.
[ "Gets", "a", "collection", "of", "InputExample", "s", "for", "the", "train", "set", "." ]
def get_train_examples(self, data_dir): """Gets a collection of `InputExample`s for the train set.""" raise NotImplementedError()
[ "def", "get_train_examples", "(", "self", ",", "data_dir", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/RTIInternational/gobbli/blob/d9ec8132f74ce49dc4bead2fad25b661bcef6e76/gobbli/model/bert/src/run_classifier.py#L203-L205
zopefoundation/Zope
ea04dd670d1a48d4d5c879d3db38fc2e9b4330bb
src/Products/Five/viewlet/metaconfigure.py
python
viewletDirective
( _context, name, permission, for_=Interface, layer=IDefaultBrowserLayer, view=IBrowserView, manager=interfaces.IViewletManager, class_=None, template=None, attribute='render', allowed_interface=None, allowed_attributes=None, **kwargs)
[]
def viewletDirective( _context, name, permission, for_=Interface, layer=IDefaultBrowserLayer, view=IBrowserView, manager=interfaces.IViewletManager, class_=None, template=None, attribute='render', allowed_interface=None, allowed_attributes=None, **kwargs): # Either the class...
[ "def", "viewletDirective", "(", "_context", ",", "name", ",", "permission", ",", "for_", "=", "Interface", ",", "layer", "=", "IDefaultBrowserLayer", ",", "view", "=", "IBrowserView", ",", "manager", "=", "interfaces", ".", "IViewletManager", ",", "class_", "=...
https://github.com/zopefoundation/Zope/blob/ea04dd670d1a48d4d5c879d3db38fc2e9b4330bb/src/Products/Five/viewlet/metaconfigure.py#L96-L190
pfnet-research/xfeat
b199c3cdacef408b3d2b1d920b22c243cfe0667c
xfeat/cat_encoder/_target_encoder.py
python
_CuPy_MeanEncoder.fit_transform
(self, X, y)
return self.transform(X)
[summary]. Args: X : [description]. y : [description]. Returns: Any : [description].
[summary].
[ "[", "summary", "]", "." ]
def fit_transform(self, X, y): """[summary]. Args: X : [description]. y : [description]. Returns: Any : [description]. """ # TODO(smly): # X = column_or_1d(X, warn=True) # y = column_or_1d(y, warn=True) self.fit(X, y) ...
[ "def", "fit_transform", "(", "self", ",", "X", ",", "y", ")", ":", "# TODO(smly):", "# X = column_or_1d(X, warn=True)", "# y = column_or_1d(y, warn=True)", "self", ".", "fit", "(", "X", ",", "y", ")", "return", "self", ".", "transform", "(", "X", ")" ]
https://github.com/pfnet-research/xfeat/blob/b199c3cdacef408b3d2b1d920b22c243cfe0667c/xfeat/cat_encoder/_target_encoder.py#L475-L488
Ultimaker/Cura
a1622c77ea7259ecb956acd6de07b7d34b7ac52b
cura/Settings/CuraContainerStack.py
python
CuraContainerStack.setUserChanges
(self, new_user_changes: InstanceContainer)
Set the user changes container. :param new_user_changes: The new user changes container. It is expected to have a "type" metadata entry with the value "user".
Set the user changes container.
[ "Set", "the", "user", "changes", "container", "." ]
def setUserChanges(self, new_user_changes: InstanceContainer) -> None: """Set the user changes container. :param new_user_changes: The new user changes container. It is expected to have a "type" metadata entry with the value "user". """ self.replaceContainer(_ContainerIndexes.UserChang...
[ "def", "setUserChanges", "(", "self", ",", "new_user_changes", ":", "InstanceContainer", ")", "->", "None", ":", "self", ".", "replaceContainer", "(", "_ContainerIndexes", ".", "UserChanges", ",", "new_user_changes", ")" ]
https://github.com/Ultimaker/Cura/blob/a1622c77ea7259ecb956acd6de07b7d34b7ac52b/cura/Settings/CuraContainerStack.py#L70-L76
andresriancho/w3af
cd22e5252243a87aaa6d0ddea47cf58dacfe00a9
w3af/plugins/crawl/web_spider.py
python
web_spider._extract_links_and_verify
(self, resp, fuzzable_req)
This is a very basic method that will send the work to different threads. Work is generated by the _urls_to_verify_generator :param resp: HTTP response object :param fuzzable_req: The HTTP request that generated the response
This is a very basic method that will send the work to different threads. Work is generated by the _urls_to_verify_generator
[ "This", "is", "a", "very", "basic", "method", "that", "will", "send", "the", "work", "to", "different", "threads", ".", "Work", "is", "generated", "by", "the", "_urls_to_verify_generator" ]
def _extract_links_and_verify(self, resp, fuzzable_req): """ This is a very basic method that will send the work to different threads. Work is generated by the _urls_to_verify_generator :param resp: HTTP response object :param fuzzable_req: The HTTP request that generated the re...
[ "def", "_extract_links_and_verify", "(", "self", ",", "resp", ",", "fuzzable_req", ")", ":", "self", ".", "worker_pool", ".", "map_multi_args", "(", "self", ".", "_verify_reference", ",", "self", ".", "_urls_to_verify_generator", "(", "resp", ",", "fuzzable_req", ...
https://github.com/andresriancho/w3af/blob/cd22e5252243a87aaa6d0ddea47cf58dacfe00a9/w3af/plugins/crawl/web_spider.py#L359-L369
jliljebl/flowblade
995313a509b80e99eb1ad550d945bdda5995093b
flowblade-trunk/Flowblade/keyframeeditor.py
python
AbstractKeyFrameEditor._create_keyframe_type_submenu
(self, kf_type, menu, callback)
[]
def _create_keyframe_type_submenu(self, kf_type, menu, callback): linear_item = Gtk.RadioMenuItem() linear_item.set_label(_("Linear")) if kf_type == appconsts.KEYFRAME_LINEAR: linear_item.set_active(True) linear_item.connect("activate", callback, "linear") linear_item...
[ "def", "_create_keyframe_type_submenu", "(", "self", ",", "kf_type", ",", "menu", ",", "callback", ")", ":", "linear_item", "=", "Gtk", ".", "RadioMenuItem", "(", ")", "linear_item", ".", "set_label", "(", "_", "(", "\"Linear\"", ")", ")", "if", "kf_type", ...
https://github.com/jliljebl/flowblade/blob/995313a509b80e99eb1ad550d945bdda5995093b/flowblade-trunk/Flowblade/keyframeeditor.py#L1006-L1027
jgagneastro/coffeegrindsize
22661ebd21831dba4cf32bfc6ba59fe3d49f879c
App/dist/coffeegrindsize.app/Contents/Resources/lib/python3.7/pandas/core/resample.py
python
_GroupByMixin._apply
(self, f, grouper=None, *args, **kwargs)
return self._wrap_result(result)
Dispatch to _upsample; we are stripping all of the _upsample kwargs and performing the original function call on the grouped object.
Dispatch to _upsample; we are stripping all of the _upsample kwargs and performing the original function call on the grouped object.
[ "Dispatch", "to", "_upsample", ";", "we", "are", "stripping", "all", "of", "the", "_upsample", "kwargs", "and", "performing", "the", "original", "function", "call", "on", "the", "grouped", "object", "." ]
def _apply(self, f, grouper=None, *args, **kwargs): """ Dispatch to _upsample; we are stripping all of the _upsample kwargs and performing the original function call on the grouped object. """ def func(x): x = self._shallow_copy(x, groupby=self.groupby) ...
[ "def", "_apply", "(", "self", ",", "f", ",", "grouper", "=", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "def", "func", "(", "x", ")", ":", "x", "=", "self", ".", "_shallow_copy", "(", "x", ",", "groupby", "=", "self", ".", "...
https://github.com/jgagneastro/coffeegrindsize/blob/22661ebd21831dba4cf32bfc6ba59fe3d49f879c/App/dist/coffeegrindsize.app/Contents/Resources/lib/python3.7/pandas/core/resample.py#L954-L969
serkanyersen/underscore.py
07c25c3f0f789536e4ad47aa315faccc0da9602f
src/underscore.py
python
underscore.obj
(self)
Returns passed object but if chain method is used returns the last processed result
Returns passed object but if chain method is used returns the last processed result
[ "Returns", "passed", "object", "but", "if", "chain", "method", "is", "used", "returns", "the", "last", "processed", "result" ]
def obj(self): """ Returns passed object but if chain method is used returns the last processed result """ if self._wrapped is not self.Null: return self._wrapped else: return self.object
[ "def", "obj", "(", "self", ")", ":", "if", "self", ".", "_wrapped", "is", "not", "self", ".", "Null", ":", "return", "self", ".", "_wrapped", "else", ":", "return", "self", ".", "object" ]
https://github.com/serkanyersen/underscore.py/blob/07c25c3f0f789536e4ad47aa315faccc0da9602f/src/underscore.py#L115-L123
sagemath/sage
f9b2db94f675ff16963ccdefba4f1a3393b3fe0d
src/sage/game_theory/matching_game.py
python
Player.__repr__
(self)
return repr(self._name)
r""" TESTS:: sage: from sage.game_theory.matching_game import Player sage: p = Player(10) sage: p 10 sage: p = Player('Karl') sage: p 'Karl'
r""" TESTS::
[ "r", "TESTS", "::" ]
def __repr__(self): r""" TESTS:: sage: from sage.game_theory.matching_game import Player sage: p = Player(10) sage: p 10 sage: p = Player('Karl') sage: p 'Karl' """ return repr(self._name)
[ "def", "__repr__", "(", "self", ")", ":", "return", "repr", "(", "self", ".", "_name", ")" ]
https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/game_theory/matching_game.py#L978-L991
pymedusa/Medusa
1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
ext/boto/cloudsearch/layer1.py
python
Layer1.update_stemming_options
(self, domain_name, stems)
return self.get_response(doc_path, 'UpdateStemmingOptions', params, verb='POST')
Updates stemming options used by indexing for the search domain. :type domain_name: string :param domain_name: A string that represents the name of a domain. Domain names must be unique across the domains owned by an account within an AWS region. Domain names must st...
Updates stemming options used by indexing for the search domain.
[ "Updates", "stemming", "options", "used", "by", "indexing", "for", "the", "search", "domain", "." ]
def update_stemming_options(self, domain_name, stems): """ Updates stemming options used by indexing for the search domain. :type domain_name: string :param domain_name: A string that represents the name of a domain. Domain names must be unique across the domains ...
[ "def", "update_stemming_options", "(", "self", ",", "domain_name", ",", "stems", ")", ":", "doc_path", "=", "(", "'update_stemming_options_response'", ",", "'update_stemming_options_result'", ",", "'stems'", ")", "params", "=", "{", "'DomainName'", ":", "domain_name",...
https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/ext/boto/cloudsearch/layer1.py#L656-L685
kubernetes-client/python
47b9da9de2d02b2b7a34fbe05afb44afd130d73a
kubernetes/client/models/v1_pod_status.py
python
V1PodStatus.message
(self, message)
Sets the message of this V1PodStatus. A human readable message indicating details about why the pod is in this condition. # noqa: E501 :param message: The message of this V1PodStatus. # noqa: E501 :type: str
Sets the message of this V1PodStatus.
[ "Sets", "the", "message", "of", "this", "V1PodStatus", "." ]
def message(self, message): """Sets the message of this V1PodStatus. A human readable message indicating details about why the pod is in this condition. # noqa: E501 :param message: The message of this V1PodStatus. # noqa: E501 :type: str """ self._message = message
[ "def", "message", "(", "self", ",", "message", ")", ":", "self", ".", "_message", "=", "message" ]
https://github.com/kubernetes-client/python/blob/47b9da9de2d02b2b7a34fbe05afb44afd130d73a/kubernetes/client/models/v1_pod_status.py#L242-L251
dbrattli/aioreactive
e057264a5905964c68d443b98b3e602279b3b9ed
aioreactive/__init__.py
python
AsyncRx.take
(self, count: int)
return AsyncRx(pipe(self, take(count)))
Take the first elements from the stream. Returns a specified number of contiguous elements from the start of an observable sequence. Args: count Number of elements to take. Returns: An observable sequence that contains the specified number of elemen...
Take the first elements from the stream.
[ "Take", "the", "first", "elements", "from", "the", "stream", "." ]
def take(self, count: int) -> AsyncObservable[TSource]: """Take the first elements from the stream. Returns a specified number of contiguous elements from the start of an observable sequence. Args: count Number of elements to take. Returns: An observabl...
[ "def", "take", "(", "self", ",", "count", ":", "int", ")", "->", "AsyncObservable", "[", "TSource", "]", ":", "from", ".", "filtering", "import", "take", "return", "AsyncRx", "(", "pipe", "(", "self", ",", "take", "(", "count", ")", ")", ")" ]
https://github.com/dbrattli/aioreactive/blob/e057264a5905964c68d443b98b3e602279b3b9ed/aioreactive/__init__.py#L351-L366
WikidPad/WikidPad
558109638807bc76b4672922686e416ab2d5f79c
WikidPad/lib/aui/auibook.py
python
AuiTabContainer.GetPageCount
(self)
return len(self._pages)
Returns the number of pages in the :class:`AuiTabContainer`.
Returns the number of pages in the :class:`AuiTabContainer`.
[ "Returns", "the", "number", "of", "pages", "in", "the", ":", "class", ":", "AuiTabContainer", "." ]
def GetPageCount(self): """ Returns the number of pages in the :class:`AuiTabContainer`. """ return len(self._pages)
[ "def", "GetPageCount", "(", "self", ")", ":", "return", "len", "(", "self", ".", "_pages", ")" ]
https://github.com/WikidPad/WikidPad/blob/558109638807bc76b4672922686e416ab2d5f79c/WikidPad/lib/aui/auibook.py#L1275-L1278
Dozed12/df-style-worldgen
937455d54f4b02df9c4b10ae6418f4c932fd97bf
dist/libtcodpy.py
python
mouse_is_cursor_visible
()
return _lib.TCOD_mouse_is_cursor_visible()
[]
def mouse_is_cursor_visible(): return _lib.TCOD_mouse_is_cursor_visible()
[ "def", "mouse_is_cursor_visible", "(", ")", ":", "return", "_lib", ".", "TCOD_mouse_is_cursor_visible", "(", ")" ]
https://github.com/Dozed12/df-style-worldgen/blob/937455d54f4b02df9c4b10ae6418f4c932fd97bf/dist/libtcodpy.py#L1187-L1188
dragonfly/dragonfly
a579b5eadf452e23b07d4caf27b402703b0012b7
dragonfly/nn/neural_network.py
python
_get_common_layer_labels
()
return ['ip', 'op']
Returns layer labels common for all types of neural networks.
Returns layer labels common for all types of neural networks.
[ "Returns", "layer", "labels", "common", "for", "all", "types", "of", "neural", "networks", "." ]
def _get_common_layer_labels(): """ Returns layer labels common for all types of neural networks. """ return ['ip', 'op']
[ "def", "_get_common_layer_labels", "(", ")", ":", "return", "[", "'ip'", ",", "'op'", "]" ]
https://github.com/dragonfly/dragonfly/blob/a579b5eadf452e23b07d4caf27b402703b0012b7/dragonfly/nn/neural_network.py#L633-L635
hubblestack/hubble
763142474edcecdec5fd25591dc29c3536e8f969
hubblestack/modules/pkg_resource.py
python
add_pkg
(pkgs, name, pkgver)
Add a package to a dict of installed packages.
Add a package to a dict of installed packages.
[ "Add", "a", "package", "to", "a", "dict", "of", "installed", "packages", "." ]
def add_pkg(pkgs, name, pkgver): ''' Add a package to a dict of installed packages. ''' try: pkgs.setdefault(name, []).append(pkgver) except AttributeError as exc: log.exception(exc)
[ "def", "add_pkg", "(", "pkgs", ",", "name", ",", "pkgver", ")", ":", "try", ":", "pkgs", ".", "setdefault", "(", "name", ",", "[", "]", ")", ".", "append", "(", "pkgver", ")", "except", "AttributeError", "as", "exc", ":", "log", ".", "exception", "...
https://github.com/hubblestack/hubble/blob/763142474edcecdec5fd25591dc29c3536e8f969/hubblestack/modules/pkg_resource.py#L18-L25
ansible/ansibullbot
c0a777dba16411db2ab0ce1a13eb166de2bed063
ansibullbot/_text_compat.py
python
to_text
(obj, encoding='utf-8', errors=None, nonstring='simplerepr')
return to_text(value, encoding, errors)
Make sure that a string is a text string :arg obj: An object to make sure is a text string. In most cases this will be either a text string or a byte string. However, with ``nonstring='simplerepr'``, this can be used as a traceback-free version of ``str(obj)``. :kwarg encoding: The en...
Make sure that a string is a text string
[ "Make", "sure", "that", "a", "string", "is", "a", "text", "string" ]
def to_text(obj, encoding='utf-8', errors=None, nonstring='simplerepr'): """Make sure that a string is a text string :arg obj: An object to make sure is a text string. In most cases this will be either a text string or a byte string. However, with ``nonstring='simplerepr'``, this can be used ...
[ "def", "to_text", "(", "obj", ",", "encoding", "=", "'utf-8'", ",", "errors", "=", "None", ",", "nonstring", "=", "'simplerepr'", ")", ":", "if", "isinstance", "(", "obj", ",", "str", ")", ":", "return", "obj", "if", "errors", "in", "_COMPOSED_ERROR_HAND...
https://github.com/ansible/ansibullbot/blob/c0a777dba16411db2ab0ce1a13eb166de2bed063/ansibullbot/_text_compat.py#L167-L255
sympy/sympy
d822fcba181155b85ff2b29fe525adbafb22b448
sympy/integrals/meijerint.py
python
meijerint_definite
(f, x, a, b)
Integrate ``f`` over the interval [``a``, ``b``], by rewriting it as a product of two G functions, or as a single G function. Return res, cond, where cond are convergence conditions. Examples ======== >>> from sympy.integrals.meijerint import meijerint_definite >>> from sympy import exp, oo ...
Integrate ``f`` over the interval [``a``, ``b``], by rewriting it as a product of two G functions, or as a single G function.
[ "Integrate", "f", "over", "the", "interval", "[", "a", "b", "]", "by", "rewriting", "it", "as", "a", "product", "of", "two", "G", "functions", "or", "as", "a", "single", "G", "function", "." ]
def meijerint_definite(f, x, a, b): """ Integrate ``f`` over the interval [``a``, ``b``], by rewriting it as a product of two G functions, or as a single G function. Return res, cond, where cond are convergence conditions. Examples ======== >>> from sympy.integrals.meijerint import meijer...
[ "def", "meijerint_definite", "(", "f", ",", "x", ",", "a", ",", "b", ")", ":", "# This consists of three steps:", "# 1) Change the integration limits to 0, oo", "# 2) Rewrite in terms of G functions", "# 3) Evaluate the integral", "#", "# There are usually several ways of doing thi...
https://github.com/sympy/sympy/blob/d822fcba181155b85ff2b29fe525adbafb22b448/sympy/integrals/meijerint.py#L1783-L1917
androguard/androguard
8d091cbb309c0c50bf239f805cc1e0931b8dcddc
androguard/core/bytecodes/dvm.py
python
DCode.get_raw
(self)
return buff
Return the raw buffer of this object :rtype: bytearray
Return the raw buffer of this object
[ "Return", "the", "raw", "buffer", "of", "this", "object" ]
def get_raw(self): """ Return the raw buffer of this object :rtype: bytearray """ buff = bytearray() for i in self.get_instructions(): buff += i.get_raw() return buff
[ "def", "get_raw", "(", "self", ")", ":", "buff", "=", "bytearray", "(", ")", "for", "i", "in", "self", ".", "get_instructions", "(", ")", ":", "buff", "+=", "i", ".", "get_raw", "(", ")", "return", "buff" ]
https://github.com/androguard/androguard/blob/8d091cbb309c0c50bf239f805cc1e0931b8dcddc/androguard/core/bytecodes/dvm.py#L6626-L6635
keiffster/program-y
8c99b56f8c32f01a7b9887b5daae9465619d0385
src/utils/aiml_generator/generator.py
python
XmlWriter.write_body
(self, sentence)
[]
def write_body(self, sentence): template_content = sentence[0] pattern_text = self.prepare_sentence(sentence) self.aiml_file.write("\n\t<category>") self.aiml_file.write("\n\t\t<pattern>") self.aiml_file.write(pattern_text.upper()) self.aiml_file.write("</pattern>") ...
[ "def", "write_body", "(", "self", ",", "sentence", ")", ":", "template_content", "=", "sentence", "[", "0", "]", "pattern_text", "=", "self", ".", "prepare_sentence", "(", "sentence", ")", "self", ".", "aiml_file", ".", "write", "(", "\"\\n\\t<category>\"", ...
https://github.com/keiffster/program-y/blob/8c99b56f8c32f01a7b9887b5daae9465619d0385/src/utils/aiml_generator/generator.py#L87-L97
beeware/ouroboros
a29123c6fab6a807caffbb7587cf548e0c370296
ouroboros/logging/config.py
python
_resolve
(name)
return found
Resolve a dotted name to a global object.
Resolve a dotted name to a global object.
[ "Resolve", "a", "dotted", "name", "to", "a", "global", "object", "." ]
def _resolve(name): """Resolve a dotted name to a global object.""" name = name.split('.') used = name.pop(0) found = __import__(used) for n in name: used = used + '.' + n try: found = getattr(found, n) except AttributeError: __import__(used) ...
[ "def", "_resolve", "(", "name", ")", ":", "name", "=", "name", ".", "split", "(", "'.'", ")", "used", "=", "name", ".", "pop", "(", "0", ")", "found", "=", "__import__", "(", "used", ")", "for", "n", "in", "name", ":", "used", "=", "used", "+",...
https://github.com/beeware/ouroboros/blob/a29123c6fab6a807caffbb7587cf548e0c370296/ouroboros/logging/config.py#L90-L102
roam-qgis/Roam
6bfa836a2735f611b7f26de18ae4a4581f7e83ef
src/configmanager/ui/layerwidgets.py
python
FormWidget.layer_updated
(self, index)
Called when the forms layer has changed. :param index: The index of the new layer.
Called when the forms layer has changed. :param index: The index of the new layer.
[ "Called", "when", "the", "forms", "layer", "has", "changed", ".", ":", "param", "index", ":", "The", "index", "of", "the", "new", "layer", "." ]
def layer_updated(self, index): """ Called when the forms layer has changed. :param index: The index of the new layer. """ if not self.selected_layer: return self.updatefields(self.selected_layer)
[ "def", "layer_updated", "(", "self", ",", "index", ")", ":", "if", "not", "self", ".", "selected_layer", ":", "return", "self", ".", "updatefields", "(", "self", ".", "selected_layer", ")" ]
https://github.com/roam-qgis/Roam/blob/6bfa836a2735f611b7f26de18ae4a4581f7e83ef/src/configmanager/ui/layerwidgets.py#L277-L285
Neuraxio/Neuraxle
c5627e663ef6d50736bc6a01110afa626fffec07
neuraxle/base.py
python
_HasHyperparamsSpace.update_hyperparams_space
(self, hyperparams_space: HyperparameterSpace)
return self
Update the step hyperparameter spaces without removing the already-set hyperparameters. This can be useful to add more hyperparameter spaces to the existing ones without flushing the ones that were already set. Example : .. code-block:: python step.set_hyperparams_space(Hyperparam...
Update the step hyperparameter spaces without removing the already-set hyperparameters. This can be useful to add more hyperparameter spaces to the existing ones without flushing the ones that were already set.
[ "Update", "the", "step", "hyperparameter", "spaces", "without", "removing", "the", "already", "-", "set", "hyperparameters", ".", "This", "can", "be", "useful", "to", "add", "more", "hyperparameter", "spaces", "to", "the", "existing", "ones", "without", "flushin...
def update_hyperparams_space(self, hyperparams_space: HyperparameterSpace) -> 'BaseTransformer': """ Update the step hyperparameter spaces without removing the already-set hyperparameters. This can be useful to add more hyperparameter spaces to the existing ones without flushing the ones that we...
[ "def", "update_hyperparams_space", "(", "self", ",", "hyperparams_space", ":", "HyperparameterSpace", ")", "->", "'BaseTransformer'", ":", "self", ".", "apply", "(", "method", "=", "'_update_hyperparams_space'", ",", "hyperparams_space", "=", "HyperparameterSpace", "(",...
https://github.com/Neuraxio/Neuraxle/blob/c5627e663ef6d50736bc6a01110afa626fffec07/neuraxle/base.py#L1398-L1431
nats-io/nats.py
49635bf58b1c888c66fa37569a9248b1a83a6c0a
examples/client.py
python
Client.__init__
(self, nc)
[]
def __init__(self, nc): self.nc = nc
[ "def", "__init__", "(", "self", ",", "nc", ")", ":", "self", ".", "nc", "=", "nc" ]
https://github.com/nats-io/nats.py/blob/49635bf58b1c888c66fa37569a9248b1a83a6c0a/examples/client.py#L8-L9
AspenWeb/pando.py
87c70837ae66caf2705b2dfceb36d87e87cfaf1f
pando/http/request.py
python
Request.host
(self)
The hostname of the request. Raises a 400 :class:`.Response` if no ``Host`` header is found or if decoding it fails. See `RFC7230 section 5.4 <https://tools.ietf.org/html/rfc7230#section-5.4>`_.
The hostname of the request.
[ "The", "hostname", "of", "the", "request", "." ]
def host(self): """The hostname of the request. Raises a 400 :class:`.Response` if no ``Host`` header is found or if decoding it fails. See `RFC7230 section 5.4 <https://tools.ietf.org/html/rfc7230#section-5.4>`_. """ host = self.headers[b'Host'] try: ...
[ "def", "host", "(", "self", ")", ":", "host", "=", "self", ".", "headers", "[", "b'Host'", "]", "try", ":", "return", "host", ".", "decode", "(", "'idna'", ")", "except", "UnicodeError", ":", "raise", "Response", "(", "400", ",", "\"The 'Host' header is ...
https://github.com/AspenWeb/pando.py/blob/87c70837ae66caf2705b2dfceb36d87e87cfaf1f/pando/http/request.py#L271-L285
zbarge/stocklook
d40bf60566681acd1e970818450228602bb7d8a5
stocklook/crypto/bittrex/api.py
python
Bittrex.get_market_summaries
(self)
return self._api_query(path_dict={ API_V1_1: '/public/getmarketsummaries', API_V2_0: '/pub/Markets/GetMarketSummaries' }, protection=PROTECTION_PUB)
Used to get the last 24 hour summary of all active exchanges Endpoint: 1.1 /public/getmarketsummaries 2.0 /pub/Markets/GetMarketSummaries :return: Summaries of active exchanges in JSON :rtype : dict
Used to get the last 24 hour summary of all active exchanges Endpoint: 1.1 /public/getmarketsummaries 2.0 /pub/Markets/GetMarketSummaries :return: Summaries of active exchanges in JSON :rtype : dict
[ "Used", "to", "get", "the", "last", "24", "hour", "summary", "of", "all", "active", "exchanges", "Endpoint", ":", "1", ".", "1", "/", "public", "/", "getmarketsummaries", "2", ".", "0", "/", "pub", "/", "Markets", "/", "GetMarketSummaries", ":", "return"...
def get_market_summaries(self): """ Used to get the last 24 hour summary of all active exchanges Endpoint: 1.1 /public/getmarketsummaries 2.0 /pub/Markets/GetMarketSummaries :return: Summaries of active exchanges in JSON :rtype : dict """ return se...
[ "def", "get_market_summaries", "(", "self", ")", ":", "return", "self", ".", "_api_query", "(", "path_dict", "=", "{", "API_V1_1", ":", "'/public/getmarketsummaries'", ",", "API_V2_0", ":", "'/pub/Markets/GetMarketSummaries'", "}", ",", "protection", "=", "PROTECTIO...
https://github.com/zbarge/stocklook/blob/d40bf60566681acd1e970818450228602bb7d8a5/stocklook/crypto/bittrex/api.py#L244-L256
gem/oq-engine
1bdb88f3914e390abcbd285600bfd39477aae47c
openquake/hazardlib/gsim/bommer_2009.py
python
get_stddevs
(C)
return [np.sqrt(C["tau"] ** 2. + C["phi"] ** 2.), C["tau"], C["phi"]]
Returns the standard deviations
Returns the standard deviations
[ "Returns", "the", "standard", "deviations" ]
def get_stddevs(C): """ Returns the standard deviations """ return [np.sqrt(C["tau"] ** 2. + C["phi"] ** 2.), C["tau"], C["phi"]]
[ "def", "get_stddevs", "(", "C", ")", ":", "return", "[", "np", ".", "sqrt", "(", "C", "[", "\"tau\"", "]", "**", "2.", "+", "C", "[", "\"phi\"", "]", "**", "2.", ")", ",", "C", "[", "\"tau\"", "]", ",", "C", "[", "\"phi\"", "]", "]" ]
https://github.com/gem/oq-engine/blob/1bdb88f3914e390abcbd285600bfd39477aae47c/openquake/hazardlib/gsim/bommer_2009.py#L58-L62
JaniceWuo/MovieRecommend
4c86db64ca45598917d304f535413df3bc9fea65
movierecommend/venv1/Lib/site-packages/django/utils/ipv6.py
python
_unpack_ipv4
(ip_str)
return ip_str.rsplit(':', 1)[1]
Unpack an IPv4 address that was mapped in a compressed IPv6 address. This converts 0000:0000:0000:0000:0000:ffff:10.10.10.10 to 10.10.10.10. If there is nothing to sanitize, returns None. Args: ip_str: A string, the expanded IPv6 address. Returns: The unpacked IPv4 address, or None if...
Unpack an IPv4 address that was mapped in a compressed IPv6 address.
[ "Unpack", "an", "IPv4", "address", "that", "was", "mapped", "in", "a", "compressed", "IPv6", "address", "." ]
def _unpack_ipv4(ip_str): """ Unpack an IPv4 address that was mapped in a compressed IPv6 address. This converts 0000:0000:0000:0000:0000:ffff:10.10.10.10 to 10.10.10.10. If there is nothing to sanitize, returns None. Args: ip_str: A string, the expanded IPv6 address. Returns: ...
[ "def", "_unpack_ipv4", "(", "ip_str", ")", ":", "if", "not", "ip_str", ".", "lower", "(", ")", ".", "startswith", "(", "'0000:0000:0000:0000:0000:ffff:'", ")", ":", "return", "None", "return", "ip_str", ".", "rsplit", "(", "':'", ",", "1", ")", "[", "1",...
https://github.com/JaniceWuo/MovieRecommend/blob/4c86db64ca45598917d304f535413df3bc9fea65/movierecommend/venv1/Lib/site-packages/django/utils/ipv6.py#L130-L146
laoqiu/pypress
06cb3ac185936a576c156ed14e5271b4cfc5ebca
pypress/twitter.py
python
List.GetSlug
(self)
return self._slug
Get the slug of this list. Returns: The slug of this list
Get the slug of this list.
[ "Get", "the", "slug", "of", "this", "list", "." ]
def GetSlug(self): '''Get the slug of this list. Returns: The slug of this list ''' return self._slug
[ "def", "GetSlug", "(", "self", ")", ":", "return", "self", ".", "_slug" ]
https://github.com/laoqiu/pypress/blob/06cb3ac185936a576c156ed14e5271b4cfc5ebca/pypress/twitter.py#L1219-L1225
Komodo/KomodoEdit
61edab75dce2bdb03943b387b0608ea36f548e8e
src/SciMoz/XPFacer.py
python
setterVersion
(feature, face)
return None
Given a getter feature, find the matching setter feature
Given a getter feature, find the matching setter feature
[ "Given", "a", "getter", "feature", "find", "the", "matching", "setter", "feature" ]
def setterVersion(feature, face): """ Given a getter feature, find the matching setter feature """ if isinstance(feature, str): assert feature in face.features, \ "Can't find setter for unknown getter %s" % (feature) feature = face.features[feature] if feature["FeatureTyp...
[ "def", "setterVersion", "(", "feature", ",", "face", ")", ":", "if", "isinstance", "(", "feature", ",", "str", ")", ":", "assert", "feature", "in", "face", ".", "features", ",", "\"Can't find setter for unknown getter %s\"", "%", "(", "feature", ")", "feature"...
https://github.com/Komodo/KomodoEdit/blob/61edab75dce2bdb03943b387b0608ea36f548e8e/src/SciMoz/XPFacer.py#L359-L379
epfml/attention-cnn
21483bba7d8e3ff1dc104c1b311a44a84d5c9db4
utils/accumulators.py
python
Max.add
(self, value)
Add a value to the accumulator. :return: `true` if the provided value became the new max
Add a value to the accumulator. :return: `true` if the provided value became the new max
[ "Add", "a", "value", "to", "the", "accumulator", ".", ":", "return", ":", "true", "if", "the", "provided", "value", "became", "the", "new", "max" ]
def add(self, value): """ Add a value to the accumulator. :return: `true` if the provided value became the new max """ if self.max is None or value > self.max: self.max = deepcopy(value) return True else: return False
[ "def", "add", "(", "self", ",", "value", ")", ":", "if", "self", ".", "max", "is", "None", "or", "value", ">", "self", ".", "max", ":", "self", ".", "max", "=", "deepcopy", "(", "value", ")", "return", "True", "else", ":", "return", "False" ]
https://github.com/epfml/attention-cnn/blob/21483bba7d8e3ff1dc104c1b311a44a84d5c9db4/utils/accumulators.py#L39-L48
TencentCloud/tencentcloud-sdk-python
3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2
tencentcloud/vpc/v20170312/models.py
python
ModifyGatewayFlowQosRequest.__init__
(self)
r""" :param GatewayId: 网关实例ID,目前我们支持的网关实例类型有, 专线网关实例ID,形如,`dcg-ltjahce6`; Nat网关实例ID,形如,`nat-ltjahce6`; VPN网关实例ID,形如,`vpn-ltjahce6`。 :type GatewayId: str :param Bandwidth: 流控带宽值。取值大于0,表示限流到指定的Mbps;取值等于0,表示完全限流;取值为-1,不限流。 :type Bandwidth: int :param IpAddresses: 限流的云服务器内网IP。 ...
r""" :param GatewayId: 网关实例ID,目前我们支持的网关实例类型有, 专线网关实例ID,形如,`dcg-ltjahce6`; Nat网关实例ID,形如,`nat-ltjahce6`; VPN网关实例ID,形如,`vpn-ltjahce6`。 :type GatewayId: str :param Bandwidth: 流控带宽值。取值大于0,表示限流到指定的Mbps;取值等于0,表示完全限流;取值为-1,不限流。 :type Bandwidth: int :param IpAddresses: 限流的云服务器内网IP。 ...
[ "r", ":", "param", "GatewayId", ":", "网关实例ID,目前我们支持的网关实例类型有,", "专线网关实例ID,形如,", "dcg", "-", "ltjahce6", ";", "Nat网关实例ID,形如,", "nat", "-", "ltjahce6", ";", "VPN网关实例ID,形如,", "vpn", "-", "ltjahce6", "。", ":", "type", "GatewayId", ":", "str", ":", "param", "Bandwid...
def __init__(self): r""" :param GatewayId: 网关实例ID,目前我们支持的网关实例类型有, 专线网关实例ID,形如,`dcg-ltjahce6`; Nat网关实例ID,形如,`nat-ltjahce6`; VPN网关实例ID,形如,`vpn-ltjahce6`。 :type GatewayId: str :param Bandwidth: 流控带宽值。取值大于0,表示限流到指定的Mbps;取值等于0,表示完全限流;取值为-1,不限流。 :type Bandwidth: int :param IpAd...
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "GatewayId", "=", "None", "self", ".", "Bandwidth", "=", "None", "self", ".", "IpAddresses", "=", "None" ]
https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/vpc/v20170312/models.py#L14505-L14519
mars-project/mars
6afd7ed86db77f29cc9470485698ef192ecc6d33
mars/tensor/indexing/unravel_index.py
python
unravel_index
(indices, dims, order="C")
return op(indices)
Converts a flat index or tensor of flat indices into a tuple of coordinate tensors. Parameters ---------- indices : array_like An integer tensor whose elements are indices into the flattened version of a tensor of dimensions ``dims``. dims : tuple of ints The shape of the te...
Converts a flat index or tensor of flat indices into a tuple of coordinate tensors.
[ "Converts", "a", "flat", "index", "or", "tensor", "of", "flat", "indices", "into", "a", "tuple", "of", "coordinate", "tensors", "." ]
def unravel_index(indices, dims, order="C"): """ Converts a flat index or tensor of flat indices into a tuple of coordinate tensors. Parameters ---------- indices : array_like An integer tensor whose elements are indices into the flattened version of a tensor of dimensions ``dim...
[ "def", "unravel_index", "(", "indices", ",", "dims", ",", "order", "=", "\"C\"", ")", ":", "indices", "=", "astensor", "(", "indices", ")", "if", "isinstance", "(", "dims", ",", "Iterable", ")", ":", "dims", "=", "tuple", "(", "dims", ")", "else", ":...
https://github.com/mars-project/mars/blob/6afd7ed86db77f29cc9470485698ef192ecc6d33/mars/tensor/indexing/unravel_index.py#L106-L152
xgi/castero
766965fb1d3586d62ab6fd6dd144fa510c1e0ecb
castero/perspective.py
python
Perspective.update_menus
(self)
Update/refresh the contents of all menus.
Update/refresh the contents of all menus.
[ "Update", "/", "refresh", "the", "contents", "of", "all", "menus", "." ]
def update_menus(self) -> None: """Update/refresh the contents of all menus."""
[ "def", "update_menus", "(", "self", ")", "->", "None", ":" ]
https://github.com/xgi/castero/blob/766965fb1d3586d62ab6fd6dd144fa510c1e0ecb/castero/perspective.py#L89-L90
ucfopen/canvasapi
3f1a71e23c86a49dbaa6e84f6c0e81c297b86e36
canvasapi/current_user.py
python
CurrentUser.add_favorite_course
(self, course, use_sis_id=False, **kwargs)
return Favorite(self._requester, response.json())
Add a course to the current user's favorites. If the course is already in the user's favorites, nothing happens. :calls: `POST /api/v1/users/self/favorites/courses/:id \ <https://canvas.instructure.com/doc/api/favorites.html#method.favorites.add_favorite_course>`_ :param course: The co...
Add a course to the current user's favorites. If the course is already in the user's favorites, nothing happens.
[ "Add", "a", "course", "to", "the", "current", "user", "s", "favorites", ".", "If", "the", "course", "is", "already", "in", "the", "user", "s", "favorites", "nothing", "happens", "." ]
def add_favorite_course(self, course, use_sis_id=False, **kwargs): """ Add a course to the current user's favorites. If the course is already in the user's favorites, nothing happens. :calls: `POST /api/v1/users/self/favorites/courses/:id \ <https://canvas.instructure.com/doc/ap...
[ "def", "add_favorite_course", "(", "self", ",", "course", ",", "use_sis_id", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "use_sis_id", ":", "course_id", "=", "course", "uri_str", "=", "\"users/self/favorites/courses/sis_course_id:{}\"", "else", ":", "...
https://github.com/ucfopen/canvasapi/blob/3f1a71e23c86a49dbaa6e84f6c0e81c297b86e36/canvasapi/current_user.py#L21-L48
jquast/x84
11f445bb82e6e895d7cce57d4c6d8572d1981162
x84/webmodules/static.py
python
web_module
()
return { 'urls': ('/www-static(/.*)?', 'static'), 'funcs': { 'static': StaticApp } }
Expose our REST API. Run only once on server startup.
Expose our REST API. Run only once on server startup.
[ "Expose", "our", "REST", "API", ".", "Run", "only", "once", "on", "server", "startup", "." ]
def web_module(): """ Expose our REST API. Run only once on server startup. """ from x84.bbs.ini import get_ini # determine document root for web server static_root = (get_ini('web', 'document_root') or os.path.join(get_ini('system', 'scriptpath', split=True)[0], '...
[ "def", "web_module", "(", ")", ":", "from", "x84", ".", "bbs", ".", "ini", "import", "get_ini", "# determine document root for web server", "static_root", "=", "(", "get_ini", "(", "'web'", ",", "'document_root'", ")", "or", "os", ".", "path", ".", "join", "...
https://github.com/jquast/x84/blob/11f445bb82e6e895d7cce57d4c6d8572d1981162/x84/webmodules/static.py#L41-L56
turicas/brasil.io
f1c371fe828a090510259a5027b49e2e651936b4
core/middlewares.py
python
disable_non_logged_user_cache
(func)
return wrapper
[]
def disable_non_logged_user_cache(func): setattr(func, DISABLE_CACHE_ATTR, True) @functools.wraps(func) def wrapper(*args, **kwargs): return func(*args, **kwargs) return wrapper
[ "def", "disable_non_logged_user_cache", "(", "func", ")", ":", "setattr", "(", "func", ",", "DISABLE_CACHE_ATTR", ",", "True", ")", "@", "functools", ".", "wraps", "(", "func", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", ...
https://github.com/turicas/brasil.io/blob/f1c371fe828a090510259a5027b49e2e651936b4/core/middlewares.py#L11-L19
rwightman/gen-efficientnet-pytorch
2d6623e956fbc9ac9c2f86ace2619e22ce7e2960
data/dataset.py
python
natural_key
(string_)
return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string_.lower())]
See http://www.codinghorror.com/blog/archives/001018.html
See http://www.codinghorror.com/blog/archives/001018.html
[ "See", "http", ":", "//", "www", ".", "codinghorror", ".", "com", "/", "blog", "/", "archives", "/", "001018", ".", "html" ]
def natural_key(string_): """See http://www.codinghorror.com/blog/archives/001018.html""" return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string_.lower())]
[ "def", "natural_key", "(", "string_", ")", ":", "return", "[", "int", "(", "s", ")", "if", "s", ".", "isdigit", "(", ")", "else", "s", "for", "s", "in", "re", ".", "split", "(", "r'(\\d+)'", ",", "string_", ".", "lower", "(", ")", ")", "]" ]
https://github.com/rwightman/gen-efficientnet-pytorch/blob/2d6623e956fbc9ac9c2f86ace2619e22ce7e2960/data/dataset.py#L16-L18
frescobaldi/frescobaldi
301cc977fc4ba7caa3df9e4bf905212ad5d06912
frescobaldi_app/session.py
python
sessionSettings
(key)
return settings
Returns the QSettings object for sessiondata of the specified key.
Returns the QSettings object for sessiondata of the specified key.
[ "Returns", "the", "QSettings", "object", "for", "sessiondata", "of", "the", "specified", "key", "." ]
def sessionSettings(key): """Returns the QSettings object for sessiondata of the specified key.""" settings = QSettings() settings.beginGroup("sessiondata") settings.beginGroup(key) return settings
[ "def", "sessionSettings", "(", "key", ")", ":", "settings", "=", "QSettings", "(", ")", "settings", ".", "beginGroup", "(", "\"sessiondata\"", ")", "settings", ".", "beginGroup", "(", "key", ")", "return", "settings" ]
https://github.com/frescobaldi/frescobaldi/blob/301cc977fc4ba7caa3df9e4bf905212ad5d06912/frescobaldi_app/session.py#L37-L42
dropbox/PyHive
b21c507a24ed2f2b0cf15b0b6abb1c43f31d3ee0
TCLIService/ttypes.py
python
TByteValue.read
(self, iprot)
[]
def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) return iprot.readStructBegin() while True: ...
[ "def", "read", "(", "self", ",", "iprot", ")", ":", "if", "iprot", ".", "_fast_decode", "is", "not", "None", "and", "isinstance", "(", "iprot", ".", "trans", ",", "TTransport", ".", "CReadableTransport", ")", "and", "self", ".", "thrift_spec", "is", "not...
https://github.com/dropbox/PyHive/blob/b21c507a24ed2f2b0cf15b0b6abb1c43f31d3ee0/TCLIService/ttypes.py#L1430-L1447
wechatpy/wechatpy
5f693a7e90156786c2540ad3c941d12cdf6d88ef
wechatpy/crypto/__init__.py
python
BaseWeChatCrypto._decrypt_message
(self, msg, signature, timestamp, nonce, crypto_class=None)
return pc.decrypt(encrypt, self._id)
[]
def _decrypt_message(self, msg, signature, timestamp, nonce, crypto_class=None): if not isinstance(msg, dict): import xmltodict msg = xmltodict.parse(to_text(msg))["xml"] encrypt = msg["Encrypt"] _signature = _get_signature(self.token, timestamp, nonce, encrypt) ...
[ "def", "_decrypt_message", "(", "self", ",", "msg", ",", "signature", ",", "timestamp", ",", "nonce", ",", "crypto_class", "=", "None", ")", ":", "if", "not", "isinstance", "(", "msg", ",", "dict", ")", ":", "import", "xmltodict", "msg", "=", "xmltodict"...
https://github.com/wechatpy/wechatpy/blob/5f693a7e90156786c2540ad3c941d12cdf6d88ef/wechatpy/crypto/__init__.py#L73-L84
burke-software/schooldriver
a07262ba864aee0182548ecceb661e49c925725f
appy/pod/pod_parser.py
python
PodEnvironment.manageInserts
(self)
We just dumped the start of an elem. Here we will insert any odt chunk if needed.
We just dumped the start of an elem. Here we will insert any odt chunk if needed.
[ "We", "just", "dumped", "the", "start", "of", "an", "elem", ".", "Here", "we", "will", "insert", "any", "odt", "chunk", "if", "needed", "." ]
def manageInserts(self): '''We just dumped the start of an elem. Here we will insert any odt chunk if needed.''' if self.inserts.has_key(self.currentElem.elem): insert = self.inserts[self.currentElem.elem] self.currentBuffer.write(insert.resolve(self.namespaces)) ...
[ "def", "manageInserts", "(", "self", ")", ":", "if", "self", ".", "inserts", ".", "has_key", "(", "self", ".", "currentElem", ".", "elem", ")", ":", "insert", "=", "self", ".", "inserts", "[", "self", ".", "currentElem", ".", "elem", "]", "self", "."...
https://github.com/burke-software/schooldriver/blob/a07262ba864aee0182548ecceb661e49c925725f/appy/pod/pod_parser.py#L131-L138
edgewall/trac
beb3e4eaf1e0a456d801a50a8614ecab06de29fc
trac/util/__init__.py
python
get_pkginfo
(dist)
return info
Get a dictionary containing package information for a package `dist` can be either a Distribution instance or, as a shortcut, directly the module instance, if one can safely infer a Distribution instance from it. Always returns a dictionary but it will be empty if no Distribution instance can be c...
Get a dictionary containing package information for a package
[ "Get", "a", "dictionary", "containing", "package", "information", "for", "a", "package" ]
def get_pkginfo(dist): """Get a dictionary containing package information for a package `dist` can be either a Distribution instance or, as a shortcut, directly the module instance, if one can safely infer a Distribution instance from it. Always returns a dictionary but it will be empty if no Dist...
[ "def", "get_pkginfo", "(", "dist", ")", ":", "import", "email", "import", "email", ".", "errors", "import", "types", "from", "trac", ".", "util", ".", "translation", "import", "_", "def", "parse_pkginfo", "(", "dist", ",", "name", ")", ":", "return", "em...
https://github.com/edgewall/trac/blob/beb3e4eaf1e0a456d801a50a8614ecab06de29fc/trac/util/__init__.py#L816-L901
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/benchmarks/src/benchmarks/sympy/sympy/polys/rootisolation.py
python
dup_inner_isolate_negative_roots
(f, K, inf=None, sup=None, eps=None, fast=False, mobius=False)
return results
Iteratively compute disjoint negative root isolation intervals.
Iteratively compute disjoint negative root isolation intervals.
[ "Iteratively", "compute", "disjoint", "negative", "root", "isolation", "intervals", "." ]
def dup_inner_isolate_negative_roots(f, K, inf=None, sup=None, eps=None, fast=False, mobius=False): """Iteratively compute disjoint negative root isolation intervals. """ if inf is not None and inf >= 0: return [] roots = dup_inner_isolate_real_roots(dup_mirror(f, K), K, eps=eps, fast=fast) F,...
[ "def", "dup_inner_isolate_negative_roots", "(", "f", ",", "K", ",", "inf", "=", "None", ",", "sup", "=", "None", ",", "eps", "=", "None", ",", "fast", "=", "False", ",", "mobius", "=", "False", ")", ":", "if", "inf", "is", "not", "None", "and", "in...
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/polys/rootisolation.py#L447-L469
n1nj4sec/pupy
a5d766ea81fdfe3bc2c38c9bdaf10e9b75af3b39
pupy/packages/all/odbc.py
python
as_cursor
(cleanup=True)
return _wrap
[]
def as_cursor(cleanup=True): def _as_cursor_wrap_gen(func, cleanup): def _wrapper(alias, *args, **kwargs): from pyodbc import connect, OperationalError, SQL_WCHAR try: key, (connstr, encoding, ctx) = _get(alias) cursor = ctx.cursor() t...
[ "def", "as_cursor", "(", "cleanup", "=", "True", ")", ":", "def", "_as_cursor_wrap_gen", "(", "func", ",", "cleanup", ")", ":", "def", "_wrapper", "(", "alias", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "pyodbc", "import", "connect",...
https://github.com/n1nj4sec/pupy/blob/a5d766ea81fdfe3bc2c38c9bdaf10e9b75af3b39/pupy/packages/all/odbc.py#L61-L117
minerllabs/minerl
0123527c334c96ebb3f0cf313df1552fa4302691
minerl/herobraine/hero/handlers/util.py
python
error_on_malformed_item_list
(item_list: Sequence[str], special_items: Sequence[str])
Check that there are no duplicate item IDs, overlapping item IDs (e.g. "planks#2" and "planks"), that special item types don't come with metadata constraints (e.g. "air#0" should not be valid).
Check that there are no duplicate item IDs, overlapping item IDs (e.g. "planks#2" and "planks"), that special item types don't come with metadata constraints (e.g. "air#0" should not be valid).
[ "Check", "that", "there", "are", "no", "duplicate", "item", "IDs", "overlapping", "item", "IDs", "(", "e", ".", "g", ".", "planks#2", "and", "planks", ")", "that", "special", "item", "types", "don", "t", "come", "with", "metadata", "constraints", "(", "e...
def error_on_malformed_item_list(item_list: Sequence[str], special_items: Sequence[str]): """Check that there are no duplicate item IDs, overlapping item IDs (e.g. "planks#2" and "planks"), that special item types don't come with metadata constraints (e.g. "air#0" should not be valid). """ map_type_...
[ "def", "error_on_malformed_item_list", "(", "item_list", ":", "Sequence", "[", "str", "]", ",", "special_items", ":", "Sequence", "[", "str", "]", ")", ":", "map_type_to_metadata", ":", "Dict", "[", "str", ",", "Set", "[", "Optional", "[", "int", "]", "]",...
https://github.com/minerllabs/minerl/blob/0123527c334c96ebb3f0cf313df1552fa4302691/minerl/herobraine/hero/handlers/util.py#L27-L50
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/alembic/ddl/postgresql.py
python
PostgresqlImpl._render_ARRAY_type
(self, type_, autogen_context)
return render._render_type_w_subtype( type_, autogen_context, 'item_type', r'(.+?\()' )
[]
def _render_ARRAY_type(self, type_, autogen_context): return render._render_type_w_subtype( type_, autogen_context, 'item_type', r'(.+?\()' )
[ "def", "_render_ARRAY_type", "(", "self", ",", "type_", ",", "autogen_context", ")", ":", "return", "render", ".", "_render_type_w_subtype", "(", "type_", ",", "autogen_context", ",", "'item_type'", ",", "r'(.+?\\()'", ")" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/alembic/ddl/postgresql.py#L207-L210
nicolargo/glances
00c65933ae1d0ebd3e72dc30fc3c215a83dfaae2
glances/plugins/glances_plugin.py
python
GlancesPlugin.__init__
(self, args=None, config=None, items_history_list=None, stats_init_value={}, fields_description=None)
Init the plugin of plugins class. All Glances' plugins should inherit from this class. Most of the methods are already implemented in the father classes. Your plugin should return a dict or a list of dicts (stored in the self.stats). As an example, you can have a look on the mem plugin...
Init the plugin of plugins class.
[ "Init", "the", "plugin", "of", "plugins", "class", "." ]
def __init__(self, args=None, config=None, items_history_list=None, stats_init_value={}, fields_description=None): """Init the plugin of plugins class. All Glances' plugins should inherit from this class. Most of the methods are already implemented in the father classes. Your plugin sh...
[ "def", "__init__", "(", "self", ",", "args", "=", "None", ",", "config", "=", "None", ",", "items_history_list", "=", "None", ",", "stats_init_value", "=", "{", "}", ",", "fields_description", "=", "None", ")", ":", "# Plugin name (= module name without glances_...
https://github.com/nicolargo/glances/blob/00c65933ae1d0ebd3e72dc30fc3c215a83dfaae2/glances/plugins/glances_plugin.py#L61-L129
pwnieexpress/raspberry_pwn
86f80e781cfb9f130a21a7ff41ef3d5c0340f287
src/pexpect-2.3/screen.py
python
screen.scroll_screen
(self)
Enable scrolling for entire display.
Enable scrolling for entire display.
[ "Enable", "scrolling", "for", "entire", "display", "." ]
def scroll_screen (self): # <ESC>[r """Enable scrolling for entire display.""" self.scroll_row_start = 1 self.scroll_row_end = self.rows
[ "def", "scroll_screen", "(", "self", ")", ":", "# <ESC>[r", "self", ".", "scroll_row_start", "=", "1", "self", ".", "scroll_row_end", "=", "self", ".", "rows" ]
https://github.com/pwnieexpress/raspberry_pwn/blob/86f80e781cfb9f130a21a7ff41ef3d5c0340f287/src/pexpect-2.3/screen.py#L283-L288
inasafe/inasafe
355eb2ce63f516b9c26af0c86a24f99e53f63f87
safe/gui/tools/help/definitions_help.py
python
content
()
return full_message
Helper method that returns just the content. This method was added so that the text could be reused in the dock_help module. .. versionadded:: 4.0.0 :returns: A message object without brand element. :rtype: safe.messaging.message.Message
Helper method that returns just the content.
[ "Helper", "method", "that", "returns", "just", "the", "content", "." ]
def content(): """Helper method that returns just the content. This method was added so that the text could be reused in the dock_help module. .. versionadded:: 4.0.0 :returns: A message object without brand element. :rtype: safe.messaging.message.Message """ # We will store a content...
[ "def", "content", "(", ")", ":", "# We will store a contents section at the top for easy navigation", "table_of_contents", "=", "m", ".", "Message", "(", ")", "# and this will be the main message that we create", "message", "=", "m", ".", "Message", "(", ")", "_create_secti...
https://github.com/inasafe/inasafe/blob/355eb2ce63f516b9c26af0c86a24f99e53f63f87/safe/gui/tools/help/definitions_help.py#L115-L883
lxy5513/videopose
6da0415183c5befd233ad85ff3aefce3179d8c44
joints_detectors/Alphapose/fn.py
python
collate_fn
(batch)
r"""Puts each data field into a tensor with outer dimension batch size
r"""Puts each data field into a tensor with outer dimension batch size
[ "r", "Puts", "each", "data", "field", "into", "a", "tensor", "with", "outer", "dimension", "batch", "size" ]
def collate_fn(batch): r"""Puts each data field into a tensor with outer dimension batch size""" error_msg = "batch must contain tensors, numbers, dicts or lists; found {}" elem_type = type(batch[0]) if isinstance(batch[0], torch.Tensor): out = None if _use_shared_memory: #...
[ "def", "collate_fn", "(", "batch", ")", ":", "error_msg", "=", "\"batch must contain tensors, numbers, dicts or lists; found {}\"", "elem_type", "=", "type", "(", "batch", "[", "0", "]", ")", "if", "isinstance", "(", "batch", "[", "0", "]", ",", "torch", ".", ...
https://github.com/lxy5513/videopose/blob/6da0415183c5befd233ad85ff3aefce3179d8c44/joints_detectors/Alphapose/fn.py#L38-L77
deepmind/acme
9880719d9def1d87a194377b394a414a17d11064
acme/wrappers/atari_wrapper.py
python
AtariWrapper.step
(self, action: int)
return self._postprocess_observation(timestep)
Steps up to action_repeat times and returns a post-processed step.
Steps up to action_repeat times and returns a post-processed step.
[ "Steps", "up", "to", "action_repeat", "times", "and", "returns", "a", "post", "-", "processed", "step", "." ]
def step(self, action: int) -> dm_env.TimeStep: """Steps up to action_repeat times and returns a post-processed step.""" if self._reset_next_step: return self.reset() timestep_stack = [] # Step on environment multiple times for each selected action. for _ in range(self._action_repeats): ...
[ "def", "step", "(", "self", ",", "action", ":", "int", ")", "->", "dm_env", ".", "TimeStep", ":", "if", "self", ".", "_reset_next_step", ":", "return", "self", ".", "reset", "(", ")", "timestep_stack", "=", "[", "]", "# Step on environment multiple times for...
https://github.com/deepmind/acme/blob/9880719d9def1d87a194377b394a414a17d11064/acme/wrappers/atari_wrapper.py#L202-L259
sahana/eden
1696fa50e90ce967df69f66b571af45356cc18da
modules/s3db/cms.py
python
CMSContentModel.cms_post_onaccept
(form)
- Set person_id from created_by if not already set - Handle the case where the page is for a Module home page, Resource Summary page or Map Layer
- Set person_id from created_by if not already set - Handle the case where the page is for a Module home page, Resource Summary page or Map Layer
[ "-", "Set", "person_id", "from", "created_by", "if", "not", "already", "set", "-", "Handle", "the", "case", "where", "the", "page", "is", "for", "a", "Module", "home", "page", "Resource", "Summary", "page", "or", "Map", "Layer" ]
def cms_post_onaccept(form): """ - Set person_id from created_by if not already set - Handle the case where the page is for a Module home page, Resource Summary page or Map Layer """ db = current.db s3db = current.s3db post_id = form.vars.id ...
[ "def", "cms_post_onaccept", "(", "form", ")", ":", "db", "=", "current", ".", "db", "s3db", "=", "current", ".", "s3db", "post_id", "=", "form", ".", "vars", ".", "id", "get_vars", "=", "current", ".", "request", ".", "get_vars", "module", "=", "get_va...
https://github.com/sahana/eden/blob/1696fa50e90ce967df69f66b571af45356cc18da/modules/s3db/cms.py#L757-L821
ilius/pyglossary
d599b3beda3ae17642af5debd83bb991148e6425
pyglossary/plugins/crawler_dir.py
python
Writer.write
(self, )
[]
def write(self, ): from collections import OrderedDict as odict from pyglossary.json_utils import dataToPrettyJson filename = self._filename wordCount = 0 compression = self._compression c_open = compressionOpenFunc(compression) if not c_open: raise ValueError(f"invalid compression {c!r}") while Tr...
[ "def", "write", "(", "self", ",", ")", ":", "from", "collections", "import", "OrderedDict", "as", "odict", "from", "pyglossary", ".", "json_utils", "import", "dataToPrettyJson", "filename", "=", "self", ".", "_filename", "wordCount", "=", "0", "compression", "...
https://github.com/ilius/pyglossary/blob/d599b3beda3ae17642af5debd83bb991148e6425/pyglossary/plugins/crawler_dir.py#L61-L106
jealous/stockstats
753019044a675048d3ec2963534e02c20d0fd2e3
stockstats.py
python
StockDataFrame._get_pdm
(self, windows)
+DM, positive directional moving If window is not 1, calculate the SMMA of +DM :param windows: range :return:
+DM, positive directional moving
[ "+", "DM", "positive", "directional", "moving" ]
def _get_pdm(self, windows): """ +DM, positive directional moving If window is not 1, calculate the SMMA of +DM :param windows: range :return: """ window = self.get_int_positive(windows) column_name = 'pdm_{}'.format(window) um, dm = self['um'], self['dm...
[ "def", "_get_pdm", "(", "self", ",", "windows", ")", ":", "window", "=", "self", ".", "get_int_positive", "(", "windows", ")", "column_name", "=", "'pdm_{}'", ".", "format", "(", "window", ")", "um", ",", "dm", "=", "self", "[", "'um'", "]", ",", "se...
https://github.com/jealous/stockstats/blob/753019044a675048d3ec2963534e02c20d0fd2e3/stockstats.py#L661-L677
dimagi/commcare-hq
d67ff1d3b4c51fa050c19e60c3253a79d3452a39
corehq/apps/app_manager/app_schemas/app_case_metadata.py
python
CaseTypeMeta.get_save_properties
(self, form_id, path)
return self.save_properties.get(form_id, {}).get(path, [])
returns a list of properties which load into a particular form question
returns a list of properties which load into a particular form question
[ "returns", "a", "list", "of", "properties", "which", "load", "into", "a", "particular", "form", "question" ]
def get_save_properties(self, form_id, path): """returns a list of properties which load into a particular form question """ return self.save_properties.get(form_id, {}).get(path, [])
[ "def", "get_save_properties", "(", "self", ",", "form_id", ",", "path", ")", ":", "return", "self", ".", "save_properties", ".", "get", "(", "form_id", ",", "{", "}", ")", ".", "get", "(", "path", ",", "[", "]", ")" ]
https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/app_manager/app_schemas/app_case_metadata.py#L445-L448
SteveDoyle2/pyNastran
eda651ac2d4883d95a34951f8a002ff94f642a1a
pyNastran/bdf/cards/coordinate_systems.py
python
SphericalCoord.xyz_to_coord_array
(p)
return xyz_to_rtp_array(p)
r""" Returns ------- xyz : (3, ) float ndarray the local XYZ point in the R, \theta, \phi coordinate system
r""" Returns ------- xyz : (3, ) float ndarray the local XYZ point in the R, \theta, \phi coordinate system
[ "r", "Returns", "-------", "xyz", ":", "(", "3", ")", "float", "ndarray", "the", "local", "XYZ", "point", "in", "the", "R", "\\", "theta", "\\", "phi", "coordinate", "system" ]
def xyz_to_coord_array(p): r""" Returns ------- xyz : (3, ) float ndarray the local XYZ point in the R, \theta, \phi coordinate system """ return xyz_to_rtp_array(p)
[ "def", "xyz_to_coord_array", "(", "p", ")", ":", "return", "xyz_to_rtp_array", "(", "p", ")" ]
https://github.com/SteveDoyle2/pyNastran/blob/eda651ac2d4883d95a34951f8a002ff94f642a1a/pyNastran/bdf/cards/coordinate_systems.py#L1468-L1476
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_hxb2/lib/python3.5/site-packages/requests/cookies.py
python
create_cookie
(name, value, **kwargs)
return cookielib.Cookie(**result)
Make a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie").
Make a cookie from underspecified parameters.
[ "Make", "a", "cookie", "from", "underspecified", "parameters", "." ]
def create_cookie(name, value, **kwargs): """Make a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). """ result = dict( version=0, name=name, ...
[ "def", "create_cookie", "(", "name", ",", "value", ",", "*", "*", "kwargs", ")", ":", "result", "=", "dict", "(", "version", "=", "0", ",", "name", "=", "name", ",", "value", "=", "value", ",", "port", "=", "None", ",", "domain", "=", "''", ",", ...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/requests/cookies.py#L437-L469
ladybug-tools/honeybee-legacy
bd62af4862fe022801fb87dbc8794fdf1dff73a9
src/Honeybee_Separate Zones By Orientation.py
python
getOrientation
(HBZone, onlyWGlz)
return orientationVectors
[]
def getOrientation(HBZone, onlyWGlz): orientationVectors = [] for HBSrf in HBZone.surfaces: if HBSrf.type == 0 and HBSrf.BC.lower()=="outdoors": if onlyWGlz and HBSrf.hasChild: for glzSrf in HBSrf.childSrfs: if not glzSrf.normalVector in orientationVe...
[ "def", "getOrientation", "(", "HBZone", ",", "onlyWGlz", ")", ":", "orientationVectors", "=", "[", "]", "for", "HBSrf", "in", "HBZone", ".", "surfaces", ":", "if", "HBSrf", ".", "type", "==", "0", "and", "HBSrf", ".", "BC", ".", "lower", "(", ")", "=...
https://github.com/ladybug-tools/honeybee-legacy/blob/bd62af4862fe022801fb87dbc8794fdf1dff73a9/src/Honeybee_Separate Zones By Orientation.py#L60-L77
robotlearn/pyrobolearn
9cd7c060723fda7d2779fa255ac998c2c82b8436
pyrobolearn/priorities/tasks/task.py
python
Task.Qs
(self)
return [[self._A.T.dot(self.weight).dot(self._A)]]
r"""Return the Q matrices :math:`Q = A^\top W A` used in :math:`\frac{1}{2} x^T Q x + p^T x` for QP, for each task. Warnings: this does not concatenate the Q matrices. Returns: list[list[np.array[float[M,M]]]]: Q matrices (for each task in the stack of tasks).
r"""Return the Q matrices :math:`Q = A^\top W A` used in :math:`\frac{1}{2} x^T Q x + p^T x` for QP, for each task.
[ "r", "Return", "the", "Q", "matrices", ":", "math", ":", "Q", "=", "A^", "\\", "top", "W", "A", "used", "in", ":", "math", ":", "\\", "frac", "{", "1", "}", "{", "2", "}", "x^T", "Q", "x", "+", "p^T", "x", "for", "QP", "for", "each", "task"...
def Qs(self): r"""Return the Q matrices :math:`Q = A^\top W A` used in :math:`\frac{1}{2} x^T Q x + p^T x` for QP, for each task. Warnings: this does not concatenate the Q matrices. Returns: list[list[np.array[float[M,M]]]]: Q matrices (for each task in the stack of tasks)....
[ "def", "Qs", "(", "self", ")", ":", "if", "self", ".", "is_stack_of_tasks", "(", ")", ":", "# if not a single task", "return", "[", "[", "soft_task", ".", "Q", "for", "soft_task", "in", "hard_task", "]", "for", "hard_task", "in", "self", ".", "tasks", "]...
https://github.com/robotlearn/pyrobolearn/blob/9cd7c060723fda7d2779fa255ac998c2c82b8436/pyrobolearn/priorities/tasks/task.py#L444-L455
CLUEbenchmark/CLUE
5bd39732734afecb490cf18a5212e692dbf2c007
baselines/models_pytorch/classifier_pytorch/transformers/modeling_bert.py
python
BertOutput.__init__
(self, config)
[]
def __init__(self, config): super(BertOutput, self).__init__() self.dense = nn.Linear(config.intermediate_size, config.hidden_size) self.LayerNorm = BertLayerNorm(config.hidden_size, eps=config.layer_norm_eps) self.dropout = nn.Dropout(config.hidden_dropout_prob)
[ "def", "__init__", "(", "self", ",", "config", ")", ":", "super", "(", "BertOutput", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "dense", "=", "nn", ".", "Linear", "(", "config", ".", "intermediate_size", ",", "config", ".", "hidden_size"...
https://github.com/CLUEbenchmark/CLUE/blob/5bd39732734afecb490cf18a5212e692dbf2c007/baselines/models_pytorch/classifier_pytorch/transformers/modeling_bert.py#L305-L309
pymedusa/Medusa
1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38
ext/rebulk/match.py
python
Match.children
(self)
return self._children
Children matches.
Children matches.
[ "Children", "matches", "." ]
def children(self): """ Children matches. """ if self._children is None: self._children = Matches(None, self.input_string) return self._children
[ "def", "children", "(", "self", ")", ":", "if", "self", ".", "_children", "is", "None", ":", "self", ".", "_children", "=", "Matches", "(", "None", ",", "self", ".", "input_string", ")", "return", "self", ".", "_children" ]
https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/ext/rebulk/match.py#L624-L630
dickreuter/neuron_poker
9f841e5aeead681fa1fb2955524c53081fba2078
gym_env/env.py
python
PlayerCycle.mark_folder
(self)
Mark a player as no longer eligible to win cash from the current hand
Mark a player as no longer eligible to win cash from the current hand
[ "Mark", "a", "player", "as", "no", "longer", "eligible", "to", "win", "cash", "from", "the", "current", "hand" ]
def mark_folder(self): """Mark a player as no longer eligible to win cash from the current hand""" self.folder[self.idx] = True
[ "def", "mark_folder", "(", "self", ")", ":", "self", ".", "folder", "[", "self", ".", "idx", "]", "=", "True" ]
https://github.com/dickreuter/neuron_poker/blob/9f841e5aeead681fa1fb2955524c53081fba2078/gym_env/env.py#L845-L847
Sprytile/Sprytile
6b68d0069aef5bfed6ab40d1d5a94a3382b41619
rx/linq/observable/timestamp.py
python
timestamp
(self, scheduler=None)
return self.map(selector)
Records the timestamp for each value in an observable sequence. 1 - res = source.timestamp() # produces objects with attributes "value" and "timestamp", where value is the original value. 2 - res = source.timestamp(Scheduler.timeout) :param Scheduler scheduler: [Optional] Scheduler used to compute...
Records the timestamp for each value in an observable sequence.
[ "Records", "the", "timestamp", "for", "each", "value", "in", "an", "observable", "sequence", "." ]
def timestamp(self, scheduler=None): """Records the timestamp for each value in an observable sequence. 1 - res = source.timestamp() # produces objects with attributes "value" and "timestamp", where value is the original value. 2 - res = source.timestamp(Scheduler.timeout) :param Scheduler sch...
[ "def", "timestamp", "(", "self", ",", "scheduler", "=", "None", ")", ":", "scheduler", "=", "scheduler", "or", "timeout_scheduler", "def", "selector", "(", "x", ")", ":", "return", "Timestamp", "(", "value", "=", "x", ",", "timestamp", "=", "scheduler", ...
https://github.com/Sprytile/Sprytile/blob/6b68d0069aef5bfed6ab40d1d5a94a3382b41619/rx/linq/observable/timestamp.py#L12-L30
donnemartin/gitsome
d7c57abc7cb66e9c910a844f15d4536866da3310
xonsh/ptk/key_bindings.py
python
should_confirm_completion
(cli)
return ( builtins.__xonsh__.env.get("COMPLETIONS_CONFIRM") and cli.current_buffer.complete_state )
Check if completion needs confirmation
Check if completion needs confirmation
[ "Check", "if", "completion", "needs", "confirmation" ]
def should_confirm_completion(cli): """Check if completion needs confirmation""" return ( builtins.__xonsh__.env.get("COMPLETIONS_CONFIRM") and cli.current_buffer.complete_state )
[ "def", "should_confirm_completion", "(", "cli", ")", ":", "return", "(", "builtins", ".", "__xonsh__", ".", "env", ".", "get", "(", "\"COMPLETIONS_CONFIRM\"", ")", "and", "cli", ".", "current_buffer", ".", "complete_state", ")" ]
https://github.com/donnemartin/gitsome/blob/d7c57abc7cb66e9c910a844f15d4536866da3310/xonsh/ptk/key_bindings.py#L132-L137