repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
3 values
summary
stringlengths
4
350
romanorac/discomll
discomll/classification/naivebayes.py
map_predict
def map_predict(interface, state, label, inp): """ Function makes a predictions of samples with given model. It calculates probabilities with multinomial and Gaussian distribution. """ import numpy as np out = interface.output(0) continuous = [j for i, j in enumerate(state["X_indices"]) if ...
python
def map_predict(interface, state, label, inp): """ Function makes a predictions of samples with given model. It calculates probabilities with multinomial and Gaussian distribution. """ import numpy as np out = interface.output(0) continuous = [j for i, j in enumerate(state["X_indices"]) if ...
[ "def", "map_predict", "(", "interface", ",", "state", ",", "label", ",", "inp", ")", ":", "import", "numpy", "as", "np", "out", "=", "interface", ".", "output", "(", "0", ")", "continuous", "=", "[", "j", "for", "i", ",", "j", "in", "enumerate", "(...
Function makes a predictions of samples with given model. It calculates probabilities with multinomial and Gaussian distribution.
[ "Function", "makes", "a", "predictions", "of", "samples", "with", "given", "model", ".", "It", "calculates", "probabilities", "with", "multinomial", "and", "Gaussian", "distribution", "." ]
a4703daffb2ba3c9f614bc3dbe45ae55884aea00
https://github.com/romanorac/discomll/blob/a4703daffb2ba3c9f614bc3dbe45ae55884aea00/discomll/classification/naivebayes.py#L131-L173
train
Function makes a predictions of samples with given model. It calculates probabilities with multinomial and Gaussian distribution.
romanorac/discomll
discomll/classification/naivebayes.py
predict
def predict(dataset, fitmodel_url, m=1, save_results=True, show=False): """ Function starts a job that makes predictions to input data with a given model Parameters ---------- input - dataset object with input urls and other parameters fitmodel_url - model created in fit phase m - m estimat...
python
def predict(dataset, fitmodel_url, m=1, save_results=True, show=False): """ Function starts a job that makes predictions to input data with a given model Parameters ---------- input - dataset object with input urls and other parameters fitmodel_url - model created in fit phase m - m estimat...
[ "def", "predict", "(", "dataset", ",", "fitmodel_url", ",", "m", "=", "1", ",", "save_results", "=", "True", ",", "show", "=", "False", ")", ":", "from", "disco", ".", "worker", ".", "pipeline", ".", "worker", "import", "Worker", ",", "Stage", "from", ...
Function starts a job that makes predictions to input data with a given model Parameters ---------- input - dataset object with input urls and other parameters fitmodel_url - model created in fit phase m - m estimate is used with discrete features save_results - save results to ddfs show - ...
[ "Function", "starts", "a", "job", "that", "makes", "predictions", "to", "input", "data", "with", "a", "given", "model" ]
a4703daffb2ba3c9f614bc3dbe45ae55884aea00
https://github.com/romanorac/discomll/blob/a4703daffb2ba3c9f614bc3dbe45ae55884aea00/discomll/classification/naivebayes.py#L208-L264
train
Function that makes predictions to input data with a given model.
pneff/wsgiservice
wsgiservice/resource.py
Resource.data
def data(self): """Returns the request data as a dictionary. Merges the path parameters, GET parameters and POST parameters (form-encoded or JSON dictionary). If a key is present in multiple of these, the first one defined is used. """ if self._data: return s...
python
def data(self): """Returns the request data as a dictionary. Merges the path parameters, GET parameters and POST parameters (form-encoded or JSON dictionary). If a key is present in multiple of these, the first one defined is used. """ if self._data: return s...
[ "def", "data", "(", "self", ")", ":", "if", "self", ".", "_data", ":", "return", "self", ".", "_data", "retval", "=", "{", "}", "data", "=", "self", ".", "get_request_data", "(", ")", "for", "subdata", "in", "data", ":", "for", "key", ",", "value",...
Returns the request data as a dictionary. Merges the path parameters, GET parameters and POST parameters (form-encoded or JSON dictionary). If a key is present in multiple of these, the first one defined is used.
[ "Returns", "the", "request", "data", "as", "a", "dictionary", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L157-L175
train
Returns the request data as a dictionary.
pneff/wsgiservice
wsgiservice/resource.py
Resource.get_resource
def get_resource(self, resource, **kwargs): """Returns a new instance of the resource class passed in as resource. This is a helper to make future-compatibility easier when new arguments get added to the constructor. :param resource: Resource class to instantiate. Gets called with the ...
python
def get_resource(self, resource, **kwargs): """Returns a new instance of the resource class passed in as resource. This is a helper to make future-compatibility easier when new arguments get added to the constructor. :param resource: Resource class to instantiate. Gets called with the ...
[ "def", "get_resource", "(", "self", ",", "resource", ",", "*", "*", "kwargs", ")", ":", "return", "resource", "(", "request", "=", "self", ".", "request", ",", "response", "=", "self", ".", "response", ",", "path_params", "=", "self", ".", "path_params",...
Returns a new instance of the resource class passed in as resource. This is a helper to make future-compatibility easier when new arguments get added to the constructor. :param resource: Resource class to instantiate. Gets called with the named arguments as required for...
[ "Returns", "a", "new", "instance", "of", "the", "resource", "class", "passed", "in", "as", "resource", ".", "This", "is", "a", "helper", "to", "make", "future", "-", "compatibility", "easier", "when", "new", "arguments", "get", "added", "to", "the", "const...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L177-L191
train
Returns a new instance of the resource class passed in as resource.
pneff/wsgiservice
wsgiservice/resource.py
Resource.get_method
def get_method(self, method=None): """Returns the method to call on this instance as a string. Raises a HTTP exception if no method can be found. Aborts with a 405 status code for known methods (based on the :attr:`KNOWN_METHODS` list) and a 501 status code for all other methods. ...
python
def get_method(self, method=None): """Returns the method to call on this instance as a string. Raises a HTTP exception if no method can be found. Aborts with a 405 status code for known methods (based on the :attr:`KNOWN_METHODS` list) and a 501 status code for all other methods. ...
[ "def", "get_method", "(", "self", ",", "method", "=", "None", ")", ":", "if", "method", "is", "None", ":", "method", "=", "self", ".", "request", ".", "method", "if", "hasattr", "(", "self", ",", "method", ")", "and", "callable", "(", "getattr", "(",...
Returns the method to call on this instance as a string. Raises a HTTP exception if no method can be found. Aborts with a 405 status code for known methods (based on the :attr:`KNOWN_METHODS` list) and a 501 status code for all other methods. :param method: Name of the method to return....
[ "Returns", "the", "method", "to", "call", "on", "this", "instance", "as", "a", "string", ".", "Raises", "a", "HTTP", "exception", "if", "no", "method", "can", "be", "found", ".", "Aborts", "with", "a", "405", "status", "code", "for", "known", "methods", ...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L193-L217
train
Returns the method to call on this instance.
pneff/wsgiservice
wsgiservice/resource.py
Resource.get_content_type
def get_content_type(self): """Returns the Content Type to serve from either the extension or the Accept headers. Uses the :attr:`EXTENSION_MAP` list for all the configured MIME types. """ extension = self.path_params.get('_extension') for ext, mime in self.EXTENSION_MAP:...
python
def get_content_type(self): """Returns the Content Type to serve from either the extension or the Accept headers. Uses the :attr:`EXTENSION_MAP` list for all the configured MIME types. """ extension = self.path_params.get('_extension') for ext, mime in self.EXTENSION_MAP:...
[ "def", "get_content_type", "(", "self", ")", ":", "extension", "=", "self", ".", "path_params", ".", "get", "(", "'_extension'", ")", "for", "ext", ",", "mime", "in", "self", ".", "EXTENSION_MAP", ":", "if", "ext", "==", "extension", ":", "return", "mime...
Returns the Content Type to serve from either the extension or the Accept headers. Uses the :attr:`EXTENSION_MAP` list for all the configured MIME types.
[ "Returns", "the", "Content", "Type", "to", "serve", "from", "either", "the", "extension", "or", "the", "Accept", "headers", ".", "Uses", "the", ":", "attr", ":", "EXTENSION_MAP", "list", "for", "all", "the", "configured", "MIME", "types", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L219-L241
train
Returns the Content Type to serve from either the extension or the Accept headers. Uses the extension_map list for all the the Accept headers. Uses the HTTP Accept header to determine the content type.
pneff/wsgiservice
wsgiservice/resource.py
Resource.handle_ignored_resources
def handle_ignored_resources(self): """Ignore robots.txt and favicon.ico GET requests based on a list of absolute paths in :attr:`IGNORED_PATHS`. Aborts the request with a 404 status code. This is mostly a usability issue to avoid extra log entries for resources we are not inter...
python
def handle_ignored_resources(self): """Ignore robots.txt and favicon.ico GET requests based on a list of absolute paths in :attr:`IGNORED_PATHS`. Aborts the request with a 404 status code. This is mostly a usability issue to avoid extra log entries for resources we are not inter...
[ "def", "handle_ignored_resources", "(", "self", ")", ":", "if", "(", "self", ".", "method", "in", "(", "'GET'", ",", "'HEAD'", ")", "and", "self", ".", "request", ".", "path_qs", "in", "self", ".", "IGNORED_PATHS", ")", ":", "raise_404", "(", "self", "...
Ignore robots.txt and favicon.ico GET requests based on a list of absolute paths in :attr:`IGNORED_PATHS`. Aborts the request with a 404 status code. This is mostly a usability issue to avoid extra log entries for resources we are not interested in. :raises: :class:`webob.excep...
[ "Ignore", "robots", ".", "txt", "and", "favicon", ".", "ico", "GET", "requests", "based", "on", "a", "list", "of", "absolute", "paths", "in", ":", "attr", ":", "IGNORED_PATHS", ".", "Aborts", "the", "request", "with", "a", "404", "status", "code", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L243-L256
train
Handle the ignore requests for the resource that we are not interested in.
pneff/wsgiservice
wsgiservice/resource.py
Resource.assert_conditions
def assert_conditions(self): """Handles various HTTP conditions and raises HTTP exceptions to abort the request. - Content-MD5 request header must match the MD5 hash of the full input (:func:`assert_condition_md5`). - If-Match and If-None-Match etags are checked ag...
python
def assert_conditions(self): """Handles various HTTP conditions and raises HTTP exceptions to abort the request. - Content-MD5 request header must match the MD5 hash of the full input (:func:`assert_condition_md5`). - If-Match and If-None-Match etags are checked ag...
[ "def", "assert_conditions", "(", "self", ")", ":", "self", ".", "assert_condition_md5", "(", ")", "etag", "=", "self", ".", "clean_etag", "(", "self", ".", "call_method", "(", "'get_etag'", ")", ")", "self", ".", "response", ".", "last_modified", "=", "sel...
Handles various HTTP conditions and raises HTTP exceptions to abort the request. - Content-MD5 request header must match the MD5 hash of the full input (:func:`assert_condition_md5`). - If-Match and If-None-Match etags are checked against the ETag of this res...
[ "Handles", "various", "HTTP", "conditions", "and", "raises", "HTTP", "exceptions", "to", "abort", "the", "request", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L258-L277
train
Checks the HTTP conditions and raises HTTP exceptions to the resource.
pneff/wsgiservice
wsgiservice/resource.py
Resource.assert_condition_md5
def assert_condition_md5(self): """If the ``Content-MD5`` request header is present in the request it's verified against the MD5 hash of the request body. If they don't match, a 400 HTTP response is returned. :raises: :class:`webob.exceptions.ResponseException` of status 400 if ...
python
def assert_condition_md5(self): """If the ``Content-MD5`` request header is present in the request it's verified against the MD5 hash of the request body. If they don't match, a 400 HTTP response is returned. :raises: :class:`webob.exceptions.ResponseException` of status 400 if ...
[ "def", "assert_condition_md5", "(", "self", ")", ":", "if", "'Content-MD5'", "in", "self", ".", "request", ".", "headers", ":", "body_md5", "=", "hashlib", ".", "md5", "(", "self", ".", "request", ".", "body", ")", ".", "hexdigest", "(", ")", "if", "bo...
If the ``Content-MD5`` request header is present in the request it's verified against the MD5 hash of the request body. If they don't match, a 400 HTTP response is returned. :raises: :class:`webob.exceptions.ResponseException` of status 400 if the MD5 hash does not match the bo...
[ "If", "the", "Content", "-", "MD5", "request", "header", "is", "present", "in", "the", "request", "it", "s", "verified", "against", "the", "MD5", "hash", "of", "the", "request", "body", ".", "If", "they", "don", "t", "match", "a", "400", "HTTP", "respo...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L279-L290
train
Checks that the MD5 hash of the request body matches the MD5 hash of the request body.
pneff/wsgiservice
wsgiservice/resource.py
Resource.assert_condition_etag
def assert_condition_etag(self): """If the resource has an ETag (see :func:`get_etag`) the request headers ``If-Match`` and ``If-None-Match`` are verified. May abort the request with 304 or 412 response codes. :raises: - :class:`webob.exceptions.ResponseException` of status ...
python
def assert_condition_etag(self): """If the resource has an ETag (see :func:`get_etag`) the request headers ``If-Match`` and ``If-None-Match`` are verified. May abort the request with 304 or 412 response codes. :raises: - :class:`webob.exceptions.ResponseException` of status ...
[ "def", "assert_condition_etag", "(", "self", ")", ":", "if", "self", ".", "response", ".", "etag", ":", "etag", "=", "self", ".", "response", ".", "etag", ".", "replace", "(", "'\"'", ",", "''", ")", "if", "not", "etag", "in", "self", ".", "request",...
If the resource has an ETag (see :func:`get_etag`) the request headers ``If-Match`` and ``If-None-Match`` are verified. May abort the request with 304 or 412 response codes. :raises: - :class:`webob.exceptions.ResponseException` of status 304 if the ETag matches the ``...
[ "If", "the", "resource", "has", "an", "ETag", "(", "see", ":", "func", ":", "get_etag", ")", "the", "request", "headers", "If", "-", "Match", "and", "If", "-", "None", "-", "Match", "are", "verified", ".", "May", "abort", "the", "request", "with", "3...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L292-L316
train
Checks whether the ETag of the resource matches the ETag in the request headers.
pneff/wsgiservice
wsgiservice/resource.py
Resource.assert_condition_last_modified
def assert_condition_last_modified(self): """If the resource has a last modified date (see :func:`get_last_modified`) the request headers ``If-Modified-Since`` and ``If-Unmodified-Since`` are verified. May abort the request with 304 or 412 response codes. :raises: - ...
python
def assert_condition_last_modified(self): """If the resource has a last modified date (see :func:`get_last_modified`) the request headers ``If-Modified-Since`` and ``If-Unmodified-Since`` are verified. May abort the request with 304 or 412 response codes. :raises: - ...
[ "def", "assert_condition_last_modified", "(", "self", ")", ":", "rq", "=", "self", ".", "request", "rs", "=", "self", ".", "response", "if", "rs", ".", "last_modified", ":", "rsl", "=", "rs", ".", "last_modified", "if", "rq", ".", "if_modified_since", "and...
If the resource has a last modified date (see :func:`get_last_modified`) the request headers ``If-Modified-Since`` and ``If-Unmodified-Since`` are verified. May abort the request with 304 or 412 response codes. :raises: - :class:`webob.exceptions.ResponseException` of status...
[ "If", "the", "resource", "has", "a", "last", "modified", "date", "(", "see", ":", "func", ":", "get_last_modified", ")", "the", "request", "headers", "If", "-", "Modified", "-", "Since", "and", "If", "-", "Unmodified", "-", "Since", "are", "verified", "....
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L318-L339
train
Checks if the resource has a last modified date.
pneff/wsgiservice
wsgiservice/resource.py
Resource.clean_etag
def clean_etag(self, etag): """Cleans the ETag as returned by :func:`get_etag`. Will wrap it in quotes and append the extension for the current MIME type. """ if etag: etag = etag.replace('"', '') extension = None for ext, mime in self.EXTENSION_MAP: ...
python
def clean_etag(self, etag): """Cleans the ETag as returned by :func:`get_etag`. Will wrap it in quotes and append the extension for the current MIME type. """ if etag: etag = etag.replace('"', '') extension = None for ext, mime in self.EXTENSION_MAP: ...
[ "def", "clean_etag", "(", "self", ",", "etag", ")", ":", "if", "etag", ":", "etag", "=", "etag", ".", "replace", "(", "'\"'", ",", "''", ")", "extension", "=", "None", "for", "ext", ",", "mime", "in", "self", ".", "EXTENSION_MAP", ":", "if", "mime"...
Cleans the ETag as returned by :func:`get_etag`. Will wrap it in quotes and append the extension for the current MIME type.
[ "Cleans", "the", "ETag", "as", "returned", "by", ":", "func", ":", "get_etag", ".", "Will", "wrap", "it", "in", "quotes", "and", "append", "the", "extension", "for", "the", "current", "MIME", "type", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L348-L361
train
Cleans the ETag as returned by get_etag. Will wrap it in quotes and append the extension for the current MIME type.
pneff/wsgiservice
wsgiservice/resource.py
Resource.get_allowed_methods
def get_allowed_methods(self): """Returns a coma-separated list of method names that are allowed on this instance. Useful to set the ``Allowed`` response header. """ return ", ".join([method for method in dir(self) if method.upper() == method and callable(getattr(...
python
def get_allowed_methods(self): """Returns a coma-separated list of method names that are allowed on this instance. Useful to set the ``Allowed`` response header. """ return ", ".join([method for method in dir(self) if method.upper() == method and callable(getattr(...
[ "def", "get_allowed_methods", "(", "self", ")", ":", "return", "\", \"", ".", "join", "(", "[", "method", "for", "method", "in", "dir", "(", "self", ")", "if", "method", ".", "upper", "(", ")", "==", "method", "and", "callable", "(", "getattr", "(", ...
Returns a coma-separated list of method names that are allowed on this instance. Useful to set the ``Allowed`` response header.
[ "Returns", "a", "coma", "-", "separated", "list", "of", "method", "names", "that", "are", "allowed", "on", "this", "instance", ".", "Useful", "to", "set", "the", "Allowed", "response", "header", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L373-L379
train
Returns a coma - separated list of method names that are allowed on this instance. Useful to set the Allowed response header.
pneff/wsgiservice
wsgiservice/resource.py
Resource.call_method
def call_method(self, method_name): """Call an instance method filling in all the method parameters based on their names. The parameters are filled in from the following locations (in that order of precedence): 1. Path parameters from routing 2. GET parameters ...
python
def call_method(self, method_name): """Call an instance method filling in all the method parameters based on their names. The parameters are filled in from the following locations (in that order of precedence): 1. Path parameters from routing 2. GET parameters ...
[ "def", "call_method", "(", "self", ",", "method_name", ")", ":", "params", "=", "[", "]", "method", "=", "getattr", "(", "self", ",", "method_name", ")", "method_params", ",", "varargs", ",", "varkw", ",", "defaults", "=", "inspect", ".", "getargspec", "...
Call an instance method filling in all the method parameters based on their names. The parameters are filled in from the following locations (in that order of precedence): 1. Path parameters from routing 2. GET parameters 3. POST parameters All values are va...
[ "Call", "an", "instance", "method", "filling", "in", "all", "the", "method", "parameters", "based", "on", "their", "names", ".", "The", "parameters", "are", "filled", "in", "from", "the", "following", "locations", "(", "in", "that", "order", "of", "precedenc...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L381-L410
train
Calls the specified method on the current instance.
pneff/wsgiservice
wsgiservice/resource.py
Resource.validate_param
def validate_param(self, method, param, value): """Validates the parameter according to the configurations in the _validations dictionary of either the method or the instance. This dictionaries are written by the decorator :func:`wsgiservice.decorators.validate`. .. todo:: Allow...
python
def validate_param(self, method, param, value): """Validates the parameter according to the configurations in the _validations dictionary of either the method or the instance. This dictionaries are written by the decorator :func:`wsgiservice.decorators.validate`. .. todo:: Allow...
[ "def", "validate_param", "(", "self", ",", "method", ",", "param", ",", "value", ")", ":", "rules", "=", "self", ".", "_get_validation", "(", "method", ",", "param", ")", "if", "not", "rules", ":", "return", "if", "value", "is", "None", "or", "(", "i...
Validates the parameter according to the configurations in the _validations dictionary of either the method or the instance. This dictionaries are written by the decorator :func:`wsgiservice.decorators.validate`. .. todo:: Allow validation by type (e.g. header, post, query, etc.) ...
[ "Validates", "the", "parameter", "according", "to", "the", "configurations", "in", "the", "_validations", "dictionary", "of", "either", "the", "method", "or", "the", "instance", ".", "This", "dictionaries", "are", "written", "by", "the", "decorator", ":", "func"...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L412-L440
train
Validates the parameter according to the rules in the validation dictionary of the method and the instance.
pneff/wsgiservice
wsgiservice/resource.py
Resource.convert_param
def convert_param(self, method, param, value): """Converts the parameter using the function 'convert' function of the validation rules. Same parameters as the `validate_param` method, so it might have just been added there. But lumping together the two functionalities would make overwrit...
python
def convert_param(self, method, param, value): """Converts the parameter using the function 'convert' function of the validation rules. Same parameters as the `validate_param` method, so it might have just been added there. But lumping together the two functionalities would make overwrit...
[ "def", "convert_param", "(", "self", ",", "method", ",", "param", ",", "value", ")", ":", "rules", "=", "self", ".", "_get_validation", "(", "method", ",", "param", ")", "if", "not", "rules", "or", "not", "rules", ".", "get", "(", "'convert'", ")", "...
Converts the parameter using the function 'convert' function of the validation rules. Same parameters as the `validate_param` method, so it might have just been added there. But lumping together the two functionalities would make overwriting harder. :param method: A function to get the ...
[ "Converts", "the", "parameter", "using", "the", "function", "convert", "function", "of", "the", "validation", "rules", ".", "Same", "parameters", "as", "the", "validate_param", "method", "so", "it", "might", "have", "just", "been", "added", "there", ".", "But"...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L442-L466
train
Converts the parameter using the function convert function of the validation rules.
pneff/wsgiservice
wsgiservice/resource.py
Resource._get_validation
def _get_validation(self, method, param): """Return the correct validations dictionary for this parameter. First checks the method itself and then its class. If no validation is defined for this parameter, None is returned. :param method: A function to get the validation information fro...
python
def _get_validation(self, method, param): """Return the correct validations dictionary for this parameter. First checks the method itself and then its class. If no validation is defined for this parameter, None is returned. :param method: A function to get the validation information fro...
[ "def", "_get_validation", "(", "self", ",", "method", ",", "param", ")", ":", "if", "hasattr", "(", "method", ",", "'_validations'", ")", "and", "param", "in", "method", ".", "_validations", ":", "return", "method", ".", "_validations", "[", "param", "]", ...
Return the correct validations dictionary for this parameter. First checks the method itself and then its class. If no validation is defined for this parameter, None is returned. :param method: A function to get the validation information from. :type method: Python function :par...
[ "Return", "the", "correct", "validations", "dictionary", "for", "this", "parameter", ".", "First", "checks", "the", "method", "itself", "and", "then", "its", "class", ".", "If", "no", "validation", "is", "defined", "for", "this", "parameter", "None", "is", "...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L468-L484
train
Returns the correct validations dictionary for this parameter.
pneff/wsgiservice
wsgiservice/resource.py
Resource.convert_response
def convert_response(self): """Finish filling the instance's response object so it's ready to be served to the client. This includes converting the body_raw property to the content type requested by the user if necessary. """ if hasattr(self.response, 'body_raw'): if ...
python
def convert_response(self): """Finish filling the instance's response object so it's ready to be served to the client. This includes converting the body_raw property to the content type requested by the user if necessary. """ if hasattr(self.response, 'body_raw'): if ...
[ "def", "convert_response", "(", "self", ")", ":", "if", "hasattr", "(", "self", ".", "response", ",", "'body_raw'", ")", ":", "if", "self", ".", "response", ".", "body_raw", "is", "not", "None", ":", "to_type", "=", "re", ".", "sub", "(", "'[^a-zA-Z_]'...
Finish filling the instance's response object so it's ready to be served to the client. This includes converting the body_raw property to the content type requested by the user if necessary.
[ "Finish", "filling", "the", "instance", "s", "response", "object", "so", "it", "s", "ready", "to", "be", "served", "to", "the", "client", ".", "This", "includes", "converting", "the", "body_raw", "property", "to", "the", "content", "type", "requested", "by",...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L486-L498
train
Finish filling the instance s response object so it s ready to be a new object.
pneff/wsgiservice
wsgiservice/resource.py
Resource.handle_exception
def handle_exception(self, e, status=500): """Handle the given exception. Log, sets the response code and output the exception message as an error message. :param e: Exception which is being handled. :type e: :class:`Exception` :param status: Status code to set. :type st...
python
def handle_exception(self, e, status=500): """Handle the given exception. Log, sets the response code and output the exception message as an error message. :param e: Exception which is being handled. :type e: :class:`Exception` :param status: Status code to set. :type st...
[ "def", "handle_exception", "(", "self", ",", "e", ",", "status", "=", "500", ")", ":", "logger", ".", "exception", "(", "\"An exception occurred while handling the request: %s\"", ",", "e", ")", "self", ".", "response", ".", "body_raw", "=", "{", "'error'", ":...
Handle the given exception. Log, sets the response code and output the exception message as an error message. :param e: Exception which is being handled. :type e: :class:`Exception` :param status: Status code to set. :type status: int
[ "Handle", "the", "given", "exception", ".", "Log", "sets", "the", "response", "code", "and", "output", "the", "exception", "message", "as", "an", "error", "message", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L525-L537
train
Log the given exception and set the response code and status to the status code.
pneff/wsgiservice
wsgiservice/resource.py
Resource.handle_exception_404
def handle_exception_404(self, e): """Handle the given exception. Log, sets the response code to 404 and output the exception message as an error message. :param e: Exception which is being handled. :type e: :class:`Exception` """ logger.debug("A 404 Not Found exception ...
python
def handle_exception_404(self, e): """Handle the given exception. Log, sets the response code to 404 and output the exception message as an error message. :param e: Exception which is being handled. :type e: :class:`Exception` """ logger.debug("A 404 Not Found exception ...
[ "def", "handle_exception_404", "(", "self", ",", "e", ")", ":", "logger", ".", "debug", "(", "\"A 404 Not Found exception occurred while handling \"", "\"the request.\"", ")", "self", ".", "response", ".", "body_raw", "=", "{", "'error'", ":", "'Not Found'", "}", ...
Handle the given exception. Log, sets the response code to 404 and output the exception message as an error message. :param e: Exception which is being handled. :type e: :class:`Exception`
[ "Handle", "the", "given", "exception", ".", "Log", "sets", "the", "response", "code", "to", "404", "and", "output", "the", "exception", "message", "as", "an", "error", "message", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L539-L549
train
Handle the given exception and set the response code to 404 and the response body_raw to be a string containing the error message.
pneff/wsgiservice
wsgiservice/resource.py
Resource.set_response_content_type
def set_response_content_type(self): """Set the Content-Type in the response. Uses the :attr:`type` instance attribute which was set by :func:`get_content_type`. Also declares a UTF-8 charset. """ if self.response.body: ct = self.type if self.charset: ...
python
def set_response_content_type(self): """Set the Content-Type in the response. Uses the :attr:`type` instance attribute which was set by :func:`get_content_type`. Also declares a UTF-8 charset. """ if self.response.body: ct = self.type if self.charset: ...
[ "def", "set_response_content_type", "(", "self", ")", ":", "if", "self", ".", "response", ".", "body", ":", "ct", "=", "self", ".", "type", "if", "self", ".", "charset", ":", "ct", "+=", "'; charset='", "+", "self", ".", "charset", "self", ".", "respon...
Set the Content-Type in the response. Uses the :attr:`type` instance attribute which was set by :func:`get_content_type`. Also declares a UTF-8 charset.
[ "Set", "the", "Content", "-", "Type", "in", "the", "response", ".", "Uses", "the", ":", "attr", ":", "type", "instance", "attribute", "which", "was", "set", "by", ":", "func", ":", "get_content_type", ".", "Also", "declares", "a", "UTF", "-", "8", "cha...
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L556-L567
train
Sets the Content - Type in the response. Uses the type and charset attributes which were set by get_content_type. Also uses the charset attribute which was set by get_content_type. Also uses the charset attribute which was set by get_content_type. Also uses the charset attribute which was set by get_content_type.
pneff/wsgiservice
wsgiservice/resource.py
Resource.set_response_content_md5
def set_response_content_md5(self): """Set the Content-MD5 response header. Calculated from the the response body by creating the MD5 hash from it. """ self.response.content_md5 = hashlib.md5(self.response.body).hexdigest()
python
def set_response_content_md5(self): """Set the Content-MD5 response header. Calculated from the the response body by creating the MD5 hash from it. """ self.response.content_md5 = hashlib.md5(self.response.body).hexdigest()
[ "def", "set_response_content_md5", "(", "self", ")", ":", "self", ".", "response", ".", "content_md5", "=", "hashlib", ".", "md5", "(", "self", ".", "response", ".", "body", ")", ".", "hexdigest", "(", ")" ]
Set the Content-MD5 response header. Calculated from the the response body by creating the MD5 hash from it.
[ "Set", "the", "Content", "-", "MD5", "response", "header", ".", "Calculated", "from", "the", "the", "response", "body", "by", "creating", "the", "MD5", "hash", "from", "it", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L569-L573
train
Set the Content - MD5 response header. Calculated from the the response body by creating the MD5 hash from it.
pneff/wsgiservice
wsgiservice/resource.py
Resource.get_request_data
def get_request_data(self): """ Read the input values. Returns a list of dictionaries. These will be used to automatically pass them into the method. Additionally a combined dictionary is written to `self.data`. In the case of JSON input, that element in this list will...
python
def get_request_data(self): """ Read the input values. Returns a list of dictionaries. These will be used to automatically pass them into the method. Additionally a combined dictionary is written to `self.data`. In the case of JSON input, that element in this list will...
[ "def", "get_request_data", "(", "self", ")", ":", "request_data", "=", "[", "self", ".", "path_params", ",", "self", ".", "request", ".", "GET", "]", "if", "self", ".", "request", ".", "headers", ".", "get", "(", "'Content-Type'", ")", "==", "'applicatio...
Read the input values. Returns a list of dictionaries. These will be used to automatically pass them into the method. Additionally a combined dictionary is written to `self.data`. In the case of JSON input, that element in this list will be the parsed JSON value. That may not ...
[ "Read", "the", "input", "values", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L575-L600
train
Read the input values.
pneff/wsgiservice
wsgiservice/resource.py
Resource._merge_defaults
def _merge_defaults(self, data, method_params, defaults): """Helper method for adding default values to the data dictionary. The `defaults` are the default values inspected from the method that will be called. For any values that are not present in the incoming data, the default value i...
python
def _merge_defaults(self, data, method_params, defaults): """Helper method for adding default values to the data dictionary. The `defaults` are the default values inspected from the method that will be called. For any values that are not present in the incoming data, the default value i...
[ "def", "_merge_defaults", "(", "self", ",", "data", ",", "method_params", ",", "defaults", ")", ":", "if", "defaults", ":", "optional_args", "=", "method_params", "[", "-", "len", "(", "defaults", ")", ":", "]", "for", "key", ",", "value", "in", "zip", ...
Helper method for adding default values to the data dictionary. The `defaults` are the default values inspected from the method that will be called. For any values that are not present in the incoming data, the default value is added.
[ "Helper", "method", "for", "adding", "default", "values", "to", "the", "data", "dictionary", "." ]
03c064ac2e8c53a1aac9c7b99970f23cf79e20f4
https://github.com/pneff/wsgiservice/blob/03c064ac2e8c53a1aac9c7b99970f23cf79e20f4/wsgiservice/resource.py#L602-L614
train
Helper method for adding default values to the data dictionary.
openearth/mmi-python
mmi/tracker.py
ModelHandler.get
def get(self, key=None, view=None): """Register a new model (models)""" self.set_header("Access-Control-Allow-Origin", "*") self.set_header("Content-Type", "application/json") if key is not None: value = {} value.update(self.database[key]) if view is n...
python
def get(self, key=None, view=None): """Register a new model (models)""" self.set_header("Access-Control-Allow-Origin", "*") self.set_header("Content-Type", "application/json") if key is not None: value = {} value.update(self.database[key]) if view is n...
[ "def", "get", "(", "self", ",", "key", "=", "None", ",", "view", "=", "None", ")", ":", "self", ".", "set_header", "(", "\"Access-Control-Allow-Origin\"", ",", "\"*\"", ")", "self", ".", "set_header", "(", "\"Content-Type\"", ",", "\"application/json\"", ")"...
Register a new model (models)
[ "Register", "a", "new", "model", "(", "models", ")" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/tracker.py#L145-L163
train
Get a new model from the database.
openearth/mmi-python
mmi/tracker.py
ModelHandler.post
def post(self): """Register a new model (models)""" self.set_header("Content-Type", "application/json") key = uuid.uuid4().hex metadata = json.loads(self.request.body.decode()) metadata["uuid"] = key self.database[key] = metadata result = json.dumps({"uuid": key})...
python
def post(self): """Register a new model (models)""" self.set_header("Content-Type", "application/json") key = uuid.uuid4().hex metadata = json.loads(self.request.body.decode()) metadata["uuid"] = key self.database[key] = metadata result = json.dumps({"uuid": key})...
[ "def", "post", "(", "self", ")", ":", "self", ".", "set_header", "(", "\"Content-Type\"", ",", "\"application/json\"", ")", "key", "=", "uuid", ".", "uuid4", "(", ")", ".", "hex", "metadata", "=", "json", ".", "loads", "(", "self", ".", "request", ".",...
Register a new model (models)
[ "Register", "a", "new", "model", "(", "models", ")" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/tracker.py#L165-L173
train
Register a new model ( models
mouradmourafiq/pandas2sklearn
pandas_sklearn/__init__.py
DataSet.get_columns
def get_columns(self, usage, columns=None): """ Returns a `data_frame.columns`. :param usage (str): should be a value from [ALL, INCLUDE, EXCLUDE]. this value only makes sense if attr `columns` is also set. otherwise, should be used with de...
python
def get_columns(self, usage, columns=None): """ Returns a `data_frame.columns`. :param usage (str): should be a value from [ALL, INCLUDE, EXCLUDE]. this value only makes sense if attr `columns` is also set. otherwise, should be used with de...
[ "def", "get_columns", "(", "self", ",", "usage", ",", "columns", "=", "None", ")", ":", "columns_excluded", "=", "pd", ".", "Index", "(", "[", "]", ")", "columns_included", "=", "self", ".", "df", ".", "columns", "if", "self", ".", "has_target", "(", ...
Returns a `data_frame.columns`. :param usage (str): should be a value from [ALL, INCLUDE, EXCLUDE]. this value only makes sense if attr `columns` is also set. otherwise, should be used with default value ALL. :param columns: * if `usage` is all, th...
[ "Returns", "a", "data_frame", ".", "columns", ".", ":", "param", "usage", "(", "str", ")", ":", "should", "be", "a", "value", "from", "[", "ALL", "INCLUDE", "EXCLUDE", "]", ".", "this", "value", "only", "makes", "sense", "if", "attr", "columns", "is", ...
dbaf5180a893f4612852c1c217551b161fd519d4
https://github.com/mouradmourafiq/pandas2sklearn/blob/dbaf5180a893f4612852c1c217551b161fd519d4/pandas_sklearn/__init__.py#L114-L148
train
Returns a data_frame. columns.
mouradmourafiq/pandas2sklearn
pandas_sklearn/__init__.py
DataSet.to_dict
def to_dict(self, columns=None): """ Return a python dict from a pandas dataframe, with columns as keys :return: dict """ if columns: assert len(columns) == len(self.feature_names) d = [ dict([ (columns[i] if columns else col_name, ...
python
def to_dict(self, columns=None): """ Return a python dict from a pandas dataframe, with columns as keys :return: dict """ if columns: assert len(columns) == len(self.feature_names) d = [ dict([ (columns[i] if columns else col_name, ...
[ "def", "to_dict", "(", "self", ",", "columns", "=", "None", ")", ":", "if", "columns", ":", "assert", "len", "(", "columns", ")", "==", "len", "(", "self", ".", "feature_names", ")", "d", "=", "[", "dict", "(", "[", "(", "columns", "[", "i", "]",...
Return a python dict from a pandas dataframe, with columns as keys :return: dict
[ "Return", "a", "python", "dict", "from", "a", "pandas", "dataframe", "with", "columns", "as", "keys", ":", "return", ":", "dict" ]
dbaf5180a893f4612852c1c217551b161fd519d4
https://github.com/mouradmourafiq/pandas2sklearn/blob/dbaf5180a893f4612852c1c217551b161fd519d4/pandas_sklearn/__init__.py#L150-L164
train
Return a python dict from a pandas dataframe with columns as keys
mouradmourafiq/pandas2sklearn
pandas_sklearn/__init__.py
DataSetTransformer._get_columns
def _get_columns(self, X, cols): """ Get a subset of columns from the given table X. X a Pandas dataframe; the table to select columns from cols a string or list of strings representing the columns to select Returns a numpy array with the data from the se...
python
def _get_columns(self, X, cols): """ Get a subset of columns from the given table X. X a Pandas dataframe; the table to select columns from cols a string or list of strings representing the columns to select Returns a numpy array with the data from the se...
[ "def", "_get_columns", "(", "self", ",", "X", ",", "cols", ")", ":", "if", "isinstance", "(", "X", ",", "DataSet", ")", ":", "X", "=", "X", "[", "cols", "]", "return_vector", "=", "False", "if", "isinstance", "(", "cols", ",", "basestring", ")", ":...
Get a subset of columns from the given table X. X a Pandas dataframe; the table to select columns from cols a string or list of strings representing the columns to select Returns a numpy array with the data from the selected columns
[ "Get", "a", "subset", "of", "columns", "from", "the", "given", "table", "X", ".", "X", "a", "Pandas", "dataframe", ";", "the", "table", "to", "select", "columns", "from", "cols", "a", "string", "or", "list", "of", "strings", "representing", "the", "colum...
dbaf5180a893f4612852c1c217551b161fd519d4
https://github.com/mouradmourafiq/pandas2sklearn/blob/dbaf5180a893f4612852c1c217551b161fd519d4/pandas_sklearn/__init__.py#L181-L206
train
Get a subset of columns from the given table X
mouradmourafiq/pandas2sklearn
pandas_sklearn/__init__.py
DataSetTransformer.fit
def fit(self, X, y=None): """ Fit a transformation from the pipeline :param X (DataSet): the data to fit """ for columns, transformer in self.mapping: if transformer is not None: transformer.fit(self._get_columns(X, columns)) return self
python
def fit(self, X, y=None): """ Fit a transformation from the pipeline :param X (DataSet): the data to fit """ for columns, transformer in self.mapping: if transformer is not None: transformer.fit(self._get_columns(X, columns)) return self
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ")", ":", "for", "columns", ",", "transformer", "in", "self", ".", "mapping", ":", "if", "transformer", "is", "not", "None", ":", "transformer", ".", "fit", "(", "self", ".", "_get_columns",...
Fit a transformation from the pipeline :param X (DataSet): the data to fit
[ "Fit", "a", "transformation", "from", "the", "pipeline", ":", "param", "X", "(", "DataSet", ")", ":", "the", "data", "to", "fit" ]
dbaf5180a893f4612852c1c217551b161fd519d4
https://github.com/mouradmourafiq/pandas2sklearn/blob/dbaf5180a893f4612852c1c217551b161fd519d4/pandas_sklearn/__init__.py#L208-L216
train
Fit a transformation from the pipeline to the data.
mouradmourafiq/pandas2sklearn
pandas_sklearn/__init__.py
DataSetTransformer.transform
def transform(self, X): """ Transform the given data. Assumes that fit has already been called. :param X (DataSet): the data to transform """ extracted = [] for columns, transformer in self.mapping: if transformer is not None: feature = transf...
python
def transform(self, X): """ Transform the given data. Assumes that fit has already been called. :param X (DataSet): the data to transform """ extracted = [] for columns, transformer in self.mapping: if transformer is not None: feature = transf...
[ "def", "transform", "(", "self", ",", "X", ")", ":", "extracted", "=", "[", "]", "for", "columns", ",", "transformer", "in", "self", ".", "mapping", ":", "if", "transformer", "is", "not", "None", ":", "feature", "=", "transformer", ".", "transform", "(...
Transform the given data. Assumes that fit has already been called. :param X (DataSet): the data to transform
[ "Transform", "the", "given", "data", ".", "Assumes", "that", "fit", "has", "already", "been", "called", ".", ":", "param", "X", "(", "DataSet", ")", ":", "the", "data", "to", "transform" ]
dbaf5180a893f4612852c1c217551b161fd519d4
https://github.com/mouradmourafiq/pandas2sklearn/blob/dbaf5180a893f4612852c1c217551b161fd519d4/pandas_sklearn/__init__.py#L218-L243
train
Transform the given data. Assumes that fit has already been called.
mkoura/dump2polarion
dump2polarion/exporters/requirements_exporter.py
RequirementExport._top_element
def _top_element(self): """Returns top XML element.""" attrs = {"project-id": self.config["polarion-project-id"]} document_relative_path = self.config.get("requirements-document-relative-path") if document_relative_path: attrs["document-relative-path"] = document_relative_pat...
python
def _top_element(self): """Returns top XML element.""" attrs = {"project-id": self.config["polarion-project-id"]} document_relative_path = self.config.get("requirements-document-relative-path") if document_relative_path: attrs["document-relative-path"] = document_relative_pat...
[ "def", "_top_element", "(", "self", ")", ":", "attrs", "=", "{", "\"project-id\"", ":", "self", ".", "config", "[", "\"polarion-project-id\"", "]", "}", "document_relative_path", "=", "self", ".", "config", ".", "get", "(", "\"requirements-document-relative-path\"...
Returns top XML element.
[ "Returns", "top", "XML", "element", "." ]
f4bd24e9d5070e282aad15f1e8bb514c0525cd37
https://github.com/mkoura/dump2polarion/blob/f4bd24e9d5070e282aad15f1e8bb514c0525cd37/dump2polarion/exporters/requirements_exporter.py#L75-L82
train
Returns the top XML element.
mkoura/dump2polarion
dump2polarion/exporters/requirements_exporter.py
RequirementExport._properties_element
def _properties_element(self, parent_element): """Returns properties XML element.""" requirements_properties = etree.SubElement(parent_element, "properties") req_properties_conf = self.config.get("requirements_import_properties") or {} for name, value in sorted(six.iteritems(req_propert...
python
def _properties_element(self, parent_element): """Returns properties XML element.""" requirements_properties = etree.SubElement(parent_element, "properties") req_properties_conf = self.config.get("requirements_import_properties") or {} for name, value in sorted(six.iteritems(req_propert...
[ "def", "_properties_element", "(", "self", ",", "parent_element", ")", ":", "requirements_properties", "=", "etree", ".", "SubElement", "(", "parent_element", ",", "\"properties\"", ")", "req_properties_conf", "=", "self", ".", "config", ".", "get", "(", "\"requir...
Returns properties XML element.
[ "Returns", "properties", "XML", "element", "." ]
f4bd24e9d5070e282aad15f1e8bb514c0525cd37
https://github.com/mkoura/dump2polarion/blob/f4bd24e9d5070e282aad15f1e8bb514c0525cd37/dump2polarion/exporters/requirements_exporter.py#L84-L102
train
Returns properties XML element.
mkoura/dump2polarion
dump2polarion/exporters/requirements_exporter.py
RequirementExport._fill_lookup_prop
def _fill_lookup_prop(self, requirements_properties): """Fills the polarion-lookup-method property.""" if not self._lookup_prop: raise Dump2PolarionException("Failed to set the 'polarion-lookup-method' property") etree.SubElement( requirements_properties, "pr...
python
def _fill_lookup_prop(self, requirements_properties): """Fills the polarion-lookup-method property.""" if not self._lookup_prop: raise Dump2PolarionException("Failed to set the 'polarion-lookup-method' property") etree.SubElement( requirements_properties, "pr...
[ "def", "_fill_lookup_prop", "(", "self", ",", "requirements_properties", ")", ":", "if", "not", "self", ".", "_lookup_prop", ":", "raise", "Dump2PolarionException", "(", "\"Failed to set the 'polarion-lookup-method' property\"", ")", "etree", ".", "SubElement", "(", "re...
Fills the polarion-lookup-method property.
[ "Fills", "the", "polarion", "-", "lookup", "-", "method", "property", "." ]
f4bd24e9d5070e282aad15f1e8bb514c0525cd37
https://github.com/mkoura/dump2polarion/blob/f4bd24e9d5070e282aad15f1e8bb514c0525cd37/dump2polarion/exporters/requirements_exporter.py#L104-L113
train
Fills the polarion - lookup - method property.
mkoura/dump2polarion
dump2polarion/exporters/requirements_exporter.py
RequirementExport._check_lookup_prop
def _check_lookup_prop(self, req_id): """Checks that selected lookup property can be used for this testcase.""" if self._lookup_prop: if not req_id and self._lookup_prop == "id": return False else: if req_id: self._lookup_prop = "id" ...
python
def _check_lookup_prop(self, req_id): """Checks that selected lookup property can be used for this testcase.""" if self._lookup_prop: if not req_id and self._lookup_prop == "id": return False else: if req_id: self._lookup_prop = "id" ...
[ "def", "_check_lookup_prop", "(", "self", ",", "req_id", ")", ":", "if", "self", ".", "_lookup_prop", ":", "if", "not", "req_id", "and", "self", ".", "_lookup_prop", "==", "\"id\"", ":", "return", "False", "else", ":", "if", "req_id", ":", "self", ".", ...
Checks that selected lookup property can be used for this testcase.
[ "Checks", "that", "selected", "lookup", "property", "can", "be", "used", "for", "this", "testcase", "." ]
f4bd24e9d5070e282aad15f1e8bb514c0525cd37
https://github.com/mkoura/dump2polarion/blob/f4bd24e9d5070e282aad15f1e8bb514c0525cd37/dump2polarion/exporters/requirements_exporter.py#L115-L125
train
Checks that the selected lookup property can be used for this testcase.
mkoura/dump2polarion
dump2polarion/exporters/requirements_exporter.py
RequirementExport._requirement_element
def _requirement_element(self, parent_element, req_data): """Adds requirement XML element.""" req_data = self._transform_result(req_data) if not req_data: return title = req_data.get("title") if not title: logger.warning("Skipping requirement, title is mi...
python
def _requirement_element(self, parent_element, req_data): """Adds requirement XML element.""" req_data = self._transform_result(req_data) if not req_data: return title = req_data.get("title") if not title: logger.warning("Skipping requirement, title is mi...
[ "def", "_requirement_element", "(", "self", ",", "parent_element", ",", "req_data", ")", ":", "req_data", "=", "self", ".", "_transform_result", "(", "req_data", ")", "if", "not", "req_data", ":", "return", "title", "=", "req_data", ".", "get", "(", "\"title...
Adds requirement XML element.
[ "Adds", "requirement", "XML", "element", "." ]
f4bd24e9d5070e282aad15f1e8bb514c0525cd37
https://github.com/mkoura/dump2polarion/blob/f4bd24e9d5070e282aad15f1e8bb514c0525cd37/dump2polarion/exporters/requirements_exporter.py#L159-L195
train
Adds requirement XML element.
mkoura/dump2polarion
dump2polarion/exporters/requirements_exporter.py
RequirementExport.export
def export(self): """Returns requirements XML.""" top = self._top_element() properties = self._properties_element(top) self._fill_requirements(top) self._fill_lookup_prop(properties) return utils.prettify_xml(top)
python
def export(self): """Returns requirements XML.""" top = self._top_element() properties = self._properties_element(top) self._fill_requirements(top) self._fill_lookup_prop(properties) return utils.prettify_xml(top)
[ "def", "export", "(", "self", ")", ":", "top", "=", "self", ".", "_top_element", "(", ")", "properties", "=", "self", ".", "_properties_element", "(", "top", ")", "self", ".", "_fill_requirements", "(", "top", ")", "self", ".", "_fill_lookup_prop", "(", ...
Returns requirements XML.
[ "Returns", "requirements", "XML", "." ]
f4bd24e9d5070e282aad15f1e8bb514c0525cd37
https://github.com/mkoura/dump2polarion/blob/f4bd24e9d5070e282aad15f1e8bb514c0525cd37/dump2polarion/exporters/requirements_exporter.py#L203-L209
train
Returns requirements XML.
mkoura/dump2polarion
dump2polarion/exporters/requirements_exporter.py
RequirementExport.write_xml
def write_xml(xml, output_file=None): """Outputs the XML content into a file.""" gen_filename = "requirements-{:%Y%m%d%H%M%S}.xml".format(datetime.datetime.now()) utils.write_xml(xml, output_loc=output_file, filename=gen_filename)
python
def write_xml(xml, output_file=None): """Outputs the XML content into a file.""" gen_filename = "requirements-{:%Y%m%d%H%M%S}.xml".format(datetime.datetime.now()) utils.write_xml(xml, output_loc=output_file, filename=gen_filename)
[ "def", "write_xml", "(", "xml", ",", "output_file", "=", "None", ")", ":", "gen_filename", "=", "\"requirements-{:%Y%m%d%H%M%S}.xml\"", ".", "format", "(", "datetime", ".", "datetime", ".", "now", "(", ")", ")", "utils", ".", "write_xml", "(", "xml", ",", ...
Outputs the XML content into a file.
[ "Outputs", "the", "XML", "content", "into", "a", "file", "." ]
f4bd24e9d5070e282aad15f1e8bb514c0525cd37
https://github.com/mkoura/dump2polarion/blob/f4bd24e9d5070e282aad15f1e8bb514c0525cd37/dump2polarion/exporters/requirements_exporter.py#L212-L215
train
Outputs the XML content into a file.
SpringerPE/python-cfconfigurator
cfconfigurator/uaa.py
UAA._client
def _client(self, id, secret): """Performs client login with the provided credentials""" url = self.api_url + self.auth_token_url auth_string = '%s:%s' % (id, secret) authorization = base64.b64encode(auth_string.encode()).decode() headers = { 'Authorization': "Basic "...
python
def _client(self, id, secret): """Performs client login with the provided credentials""" url = self.api_url + self.auth_token_url auth_string = '%s:%s' % (id, secret) authorization = base64.b64encode(auth_string.encode()).decode() headers = { 'Authorization': "Basic "...
[ "def", "_client", "(", "self", ",", "id", ",", "secret", ")", ":", "url", "=", "self", ".", "api_url", "+", "self", ".", "auth_token_url", "auth_string", "=", "'%s:%s'", "%", "(", "id", ",", "secret", ")", "authorization", "=", "base64", ".", "b64encod...
Performs client login with the provided credentials
[ "Performs", "client", "login", "with", "the", "provided", "credentials" ]
198b4e00cd9e362abee726c0242c1d5f986eb073
https://github.com/SpringerPE/python-cfconfigurator/blob/198b4e00cd9e362abee726c0242c1d5f986eb073/cfconfigurator/uaa.py#L73-L86
train
Performs client login with the provided credentials
SpringerPE/python-cfconfigurator
cfconfigurator/uaa.py
UAA._login
def _login(self, username, password, client_id, client_secret): """Performs login with the provided credentials""" url = self.api_url + self.auth_token_url auth_string = '%s:%s' % (client_id, client_secret) authorization = base64.b64encode(auth_string.encode()).decode() headers =...
python
def _login(self, username, password, client_id, client_secret): """Performs login with the provided credentials""" url = self.api_url + self.auth_token_url auth_string = '%s:%s' % (client_id, client_secret) authorization = base64.b64encode(auth_string.encode()).decode() headers =...
[ "def", "_login", "(", "self", ",", "username", ",", "password", ",", "client_id", ",", "client_secret", ")", ":", "url", "=", "self", ".", "api_url", "+", "self", ".", "auth_token_url", "auth_string", "=", "'%s:%s'", "%", "(", "client_id", ",", "client_sec...
Performs login with the provided credentials
[ "Performs", "login", "with", "the", "provided", "credentials" ]
198b4e00cd9e362abee726c0242c1d5f986eb073
https://github.com/SpringerPE/python-cfconfigurator/blob/198b4e00cd9e362abee726c0242c1d5f986eb073/cfconfigurator/uaa.py#L88-L104
train
Performs login with the provided credentials
SpringerPE/python-cfconfigurator
cfconfigurator/uaa.py
UAA.login
def login(self, username=None, password=''): """Performs login with the provided credentials""" auth = None if username is not None: # User login resp = self._login(username, password, self.client_id, self.client_secret) msg = "User Login" else: ...
python
def login(self, username=None, password=''): """Performs login with the provided credentials""" auth = None if username is not None: # User login resp = self._login(username, password, self.client_id, self.client_secret) msg = "User Login" else: ...
[ "def", "login", "(", "self", ",", "username", "=", "None", ",", "password", "=", "''", ")", ":", "auth", "=", "None", "if", "username", "is", "not", "None", ":", "# User login", "resp", "=", "self", ".", "_login", "(", "username", ",", "password", ",...
Performs login with the provided credentials
[ "Performs", "login", "with", "the", "provided", "credentials" ]
198b4e00cd9e362abee726c0242c1d5f986eb073
https://github.com/SpringerPE/python-cfconfigurator/blob/198b4e00cd9e362abee726c0242c1d5f986eb073/cfconfigurator/uaa.py#L185-L205
train
Performs login with the provided credentials
oemof/oemof.db
oemof/db/feedin_pg.py
Feedin.aggregate_cap_val
def aggregate_cap_val(self, conn, **kwargs): ''' Returns the normalised feedin profile and installed capacity for a given region. Parameters ---------- region : Region instance region.geom : shapely.geometry object Geo-spatial data with information fo...
python
def aggregate_cap_val(self, conn, **kwargs): ''' Returns the normalised feedin profile and installed capacity for a given region. Parameters ---------- region : Region instance region.geom : shapely.geometry object Geo-spatial data with information fo...
[ "def", "aggregate_cap_val", "(", "self", ",", "conn", ",", "*", "*", "kwargs", ")", ":", "region", "=", "kwargs", "[", "'region'", "]", "[", "pv_df", ",", "wind_df", ",", "cap", "]", "=", "self", ".", "get_timeseries", "(", "conn", ",", "geometry", "...
Returns the normalised feedin profile and installed capacity for a given region. Parameters ---------- region : Region instance region.geom : shapely.geometry object Geo-spatial data with information for location/region-shape. The geometry can be a polygo...
[ "Returns", "the", "normalised", "feedin", "profile", "and", "installed", "capacity", "for", "a", "given", "region", "." ]
d51ac50187f03a875bd7ce5991ed4772e8b77b93
https://github.com/oemof/oemof.db/blob/d51ac50187f03a875bd7ce5991ed4772e8b77b93/oemof/db/feedin_pg.py#L21-L58
train
Returns the normalised feedin profile and installed capacity for the given object - store the data in a single dataframe.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.save_assets
def save_assets(self, dest_path): """Save plot assets alongside dest_path. Some plots may have assets, like bitmap files, which need to be saved alongside the rendered plot file. :param dest_path: path of the main output file. """ for idx, subplot in enumerate(self.sub...
python
def save_assets(self, dest_path): """Save plot assets alongside dest_path. Some plots may have assets, like bitmap files, which need to be saved alongside the rendered plot file. :param dest_path: path of the main output file. """ for idx, subplot in enumerate(self.sub...
[ "def", "save_assets", "(", "self", ",", "dest_path", ")", ":", "for", "idx", ",", "subplot", "in", "enumerate", "(", "self", ".", "subplots", ")", ":", "subplot", ".", "save_assets", "(", "dest_path", ",", "suffix", "=", "'_%d'", "%", "idx", ")" ]
Save plot assets alongside dest_path. Some plots may have assets, like bitmap files, which need to be saved alongside the rendered plot file. :param dest_path: path of the main output file.
[ "Save", "plot", "assets", "alongside", "dest_path", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L65-L75
train
Save plot assets alongside dest_path.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_empty
def set_empty(self, row, column): """Keep one of the subplots completely empty. :param row,column: specify the subplot. """ subplot = self.get_subplot_at(row, column) subplot.set_empty()
python
def set_empty(self, row, column): """Keep one of the subplots completely empty. :param row,column: specify the subplot. """ subplot = self.get_subplot_at(row, column) subplot.set_empty()
[ "def", "set_empty", "(", "self", ",", "row", ",", "column", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_empty", "(", ")" ]
Keep one of the subplots completely empty. :param row,column: specify the subplot.
[ "Keep", "one", "of", "the", "subplots", "completely", "empty", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L77-L84
train
Keep one of the subplots completely empty.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_empty_for_all
def set_empty_for_all(self, row_column_list): """Keep all specified subplots completely empty. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None """ for row...
python
def set_empty_for_all(self, row_column_list): """Keep all specified subplots completely empty. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None """ for row...
[ "def", "set_empty_for_all", "(", "self", ",", "row_column_list", ")", ":", "for", "row", ",", "column", "in", "row_column_list", ":", "self", ".", "set_empty", "(", "row", ",", "column", ")" ]
Keep all specified subplots completely empty. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None
[ "Keep", "all", "specified", "subplots", "completely", "empty", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L86-L95
train
Keep all specified subplots completely empty.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_title
def set_title(self, row, column, text): """Set a title text. :param row,column: specify the subplot. :param text: title text. """ subplot = self.get_subplot_at(row, column) subplot.set_title(text)
python
def set_title(self, row, column, text): """Set a title text. :param row,column: specify the subplot. :param text: title text. """ subplot = self.get_subplot_at(row, column) subplot.set_title(text)
[ "def", "set_title", "(", "self", ",", "row", ",", "column", ",", "text", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_title", "(", "text", ")" ]
Set a title text. :param row,column: specify the subplot. :param text: title text.
[ "Set", "a", "title", "text", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L97-L105
train
Set a title text.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_label
def set_label(self, row, column, text, location='upper right', style=None): """Set a label for the subplot. :param row,column: specify the subplot. :param text: the label text. :param location: the location of the label inside the plot. May be one of 'cent...
python
def set_label(self, row, column, text, location='upper right', style=None): """Set a label for the subplot. :param row,column: specify the subplot. :param text: the label text. :param location: the location of the label inside the plot. May be one of 'cent...
[ "def", "set_label", "(", "self", ",", "row", ",", "column", ",", "text", ",", "location", "=", "'upper right'", ",", "style", "=", "None", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_lab...
Set a label for the subplot. :param row,column: specify the subplot. :param text: the label text. :param location: the location of the label inside the plot. May be one of 'center', 'upper right', 'lower right', 'upper left', 'lower left'. :param style: any TikZ...
[ "Set", "a", "label", "for", "the", "subplot", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L107-L120
train
Set a label for the current subplot.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.show_xticklabels
def show_xticklabels(self, row, column): """Show the x-axis tick labels for a subplot. :param row,column: specify the subplot. """ subplot = self.get_subplot_at(row, column) subplot.show_xticklabels()
python
def show_xticklabels(self, row, column): """Show the x-axis tick labels for a subplot. :param row,column: specify the subplot. """ subplot = self.get_subplot_at(row, column) subplot.show_xticklabels()
[ "def", "show_xticklabels", "(", "self", ",", "row", ",", "column", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "show_xticklabels", "(", ")" ]
Show the x-axis tick labels for a subplot. :param row,column: specify the subplot.
[ "Show", "the", "x", "-", "axis", "tick", "labels", "for", "a", "subplot", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L122-L129
train
Show the x - axis tick labels for a specific subplot.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.show_xticklabels_for_all
def show_xticklabels_for_all(self, row_column_list=None): """Show the x-axis tick labels for all specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def show_xticklabels_for_all(self, row_column_list=None): """Show the x-axis tick labels for all specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "show_xticklabels_for_all", "(", "self", ",", "row_column_list", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "for", "subplot", "in", "self", ".", "subplots", ":", "subplot", ".", "show_xticklabels", "(", ")", "else", ":", "for",...
Show the x-axis tick labels for all specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None
[ "Show", "the", "x", "-", "axis", "tick", "labels", "for", "all", "specified", "subplots", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L131-L144
train
Show the x - axis tick labels for all specified subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.show_yticklabels
def show_yticklabels(self, row, column): """Show the y-axis tick labels for a subplot. :param row,column: specify the subplot. """ subplot = self.get_subplot_at(row, column) subplot.show_yticklabels()
python
def show_yticklabels(self, row, column): """Show the y-axis tick labels for a subplot. :param row,column: specify the subplot. """ subplot = self.get_subplot_at(row, column) subplot.show_yticklabels()
[ "def", "show_yticklabels", "(", "self", ",", "row", ",", "column", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "show_yticklabels", "(", ")" ]
Show the y-axis tick labels for a subplot. :param row,column: specify the subplot.
[ "Show", "the", "y", "-", "axis", "tick", "labels", "for", "a", "subplot", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L146-L153
train
Show the y - axis tick labels for a specific subplot.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.show_yticklabels_for_all
def show_yticklabels_for_all(self, row_column_list=None): """Show the y-axis tick labels for all specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def show_yticklabels_for_all(self, row_column_list=None): """Show the y-axis tick labels for all specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "show_yticklabels_for_all", "(", "self", ",", "row_column_list", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "for", "subplot", "in", "self", ".", "subplots", ":", "subplot", ".", "show_yticklabels", "(", ")", "else", ":", "for",...
Show the y-axis tick labels for all specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None
[ "Show", "the", "y", "-", "axis", "tick", "labels", "for", "all", "specified", "subplots", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L155-L168
train
Show the y - axis tick labels for all specified subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_xticklabels_position
def set_xticklabels_position(self, row, column, position): """Specify the position of the axis tick labels. This is generally only useful for multiplots containing only one row. This can be used to e.g. alternatively draw the tick labels on the bottom or the top of the subplot. ...
python
def set_xticklabels_position(self, row, column, position): """Specify the position of the axis tick labels. This is generally only useful for multiplots containing only one row. This can be used to e.g. alternatively draw the tick labels on the bottom or the top of the subplot. ...
[ "def", "set_xticklabels_position", "(", "self", ",", "row", ",", "column", ",", "position", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_xticklabels_position", "(", "position", ")" ]
Specify the position of the axis tick labels. This is generally only useful for multiplots containing only one row. This can be used to e.g. alternatively draw the tick labels on the bottom or the top of the subplot. :param row,column: specify the subplot. :param position: 'to...
[ "Specify", "the", "position", "of", "the", "axis", "tick", "labels", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L170-L183
train
Set the position of the x - axis tick labels.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_yticklabels_position
def set_yticklabels_position(self, row, column, position): """Specify the position of the axis tick labels. This is generally only useful for multiplots containing only one column. This can be used to e.g. alternatively draw the tick labels on the left or the right of the subplot. ...
python
def set_yticklabels_position(self, row, column, position): """Specify the position of the axis tick labels. This is generally only useful for multiplots containing only one column. This can be used to e.g. alternatively draw the tick labels on the left or the right of the subplot. ...
[ "def", "set_yticklabels_position", "(", "self", ",", "row", ",", "column", ",", "position", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_yticklabels_position", "(", "position", ")" ]
Specify the position of the axis tick labels. This is generally only useful for multiplots containing only one column. This can be used to e.g. alternatively draw the tick labels on the left or the right of the subplot. :param row,column: specify the subplot. :param position: ...
[ "Specify", "the", "position", "of", "the", "axis", "tick", "labels", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L185-L198
train
Set the position of the y - axis tick labels.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_xlimits
def set_xlimits(self, row, column, min=None, max=None): """Set x-axis limits of a subplot. :param row,column: specify the subplot. :param min: minimal axis value :param max: maximum axis value """ subplot = self.get_subplot_at(row, column) subplot.set_xlimits(mi...
python
def set_xlimits(self, row, column, min=None, max=None): """Set x-axis limits of a subplot. :param row,column: specify the subplot. :param min: minimal axis value :param max: maximum axis value """ subplot = self.get_subplot_at(row, column) subplot.set_xlimits(mi...
[ "def", "set_xlimits", "(", "self", ",", "row", ",", "column", ",", "min", "=", "None", ",", "max", "=", "None", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_xlimits", "(", "min", ",", ...
Set x-axis limits of a subplot. :param row,column: specify the subplot. :param min: minimal axis value :param max: maximum axis value
[ "Set", "x", "-", "axis", "limits", "of", "a", "subplot", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L200-L209
train
Set x - axis limits of a subplot.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_xlimits_for_all
def set_xlimits_for_all(self, row_column_list=None, min=None, max=None): """Set x-axis limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def set_xlimits_for_all(self, row_column_list=None, min=None, max=None): """Set x-axis limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "set_xlimits_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "min", "=", "None", ",", "max", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "self", ".", "limits", "[", "'xmin'", "]", "=", "min", "self", ".", ...
Set x-axis limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param min: minimal axis value :param max: maximum axis value
[ "Set", "x", "-", "axis", "limits", "of", "specified", "subplots", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L211-L226
train
Set x - axis limits of all the specified subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_ylimits
def set_ylimits(self, row, column, min=None, max=None): """Set y-axis limits of a subplot. :param row,column: specify the subplot. :param min: minimal axis value :param max: maximum axis value """ subplot = self.get_subplot_at(row, column) subplot.set_ylimits(mi...
python
def set_ylimits(self, row, column, min=None, max=None): """Set y-axis limits of a subplot. :param row,column: specify the subplot. :param min: minimal axis value :param max: maximum axis value """ subplot = self.get_subplot_at(row, column) subplot.set_ylimits(mi...
[ "def", "set_ylimits", "(", "self", ",", "row", ",", "column", ",", "min", "=", "None", ",", "max", "=", "None", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_ylimits", "(", "min", ",", ...
Set y-axis limits of a subplot. :param row,column: specify the subplot. :param min: minimal axis value :param max: maximum axis value
[ "Set", "y", "-", "axis", "limits", "of", "a", "subplot", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L228-L237
train
Set y - axis limits of a subplot.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_ylimits_for_all
def set_ylimits_for_all(self, row_column_list=None, min=None, max=None): """Set y-axis limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def set_ylimits_for_all(self, row_column_list=None, min=None, max=None): """Set y-axis limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "set_ylimits_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "min", "=", "None", ",", "max", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "self", ".", "limits", "[", "'ymin'", "]", "=", "min", "self", ".", ...
Set y-axis limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param min: minimal axis value :param max: maximum axis value
[ "Set", "y", "-", "axis", "limits", "of", "specified", "subplots", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L239-L254
train
Set y - axis limits of all the available base cDNA resources.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_mlimits
def set_mlimits(self, row, column, min=None, max=None): """Set limits for the point meta (colormap). Point meta values outside this range will be clipped. :param min: value for start of the colormap. :param max: value for end of the colormap. """ subplot = self.get_sub...
python
def set_mlimits(self, row, column, min=None, max=None): """Set limits for the point meta (colormap). Point meta values outside this range will be clipped. :param min: value for start of the colormap. :param max: value for end of the colormap. """ subplot = self.get_sub...
[ "def", "set_mlimits", "(", "self", ",", "row", ",", "column", ",", "min", "=", "None", ",", "max", "=", "None", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_mlimits", "(", "min", ",", ...
Set limits for the point meta (colormap). Point meta values outside this range will be clipped. :param min: value for start of the colormap. :param max: value for end of the colormap.
[ "Set", "limits", "for", "the", "point", "meta", "(", "colormap", ")", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L256-L266
train
Set limits for the point meta values outside this range will be clipped.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_mlimits_for_all
def set_mlimits_for_all(self, row_column_list=None, min=None, max=None): """Set limits for point meta (colormap) for specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list:...
python
def set_mlimits_for_all(self, row_column_list=None, min=None, max=None): """Set limits for point meta (colormap) for specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list:...
[ "def", "set_mlimits_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "min", "=", "None", ",", "max", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "self", ".", "limits", "[", "'mmin'", "]", "=", "min", "self", ".", ...
Set limits for point meta (colormap) for specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param min: value for start of the colormap. :param ma...
[ "Set", "limits", "for", "point", "meta", "(", "colormap", ")", "for", "specified", "subplots", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L268-L283
train
Set limits for all the point meta data for all the subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_slimits
def set_slimits(self, row, column, min, max): """Set limits for the point sizes. :param min: point size for the lowest value. :param max: point size for the highest value. """ subplot = self.get_subplot_at(row, column) subplot.set_slimits(min, max)
python
def set_slimits(self, row, column, min, max): """Set limits for the point sizes. :param min: point size for the lowest value. :param max: point size for the highest value. """ subplot = self.get_subplot_at(row, column) subplot.set_slimits(min, max)
[ "def", "set_slimits", "(", "self", ",", "row", ",", "column", ",", "min", ",", "max", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_slimits", "(", "min", ",", "max", ")" ]
Set limits for the point sizes. :param min: point size for the lowest value. :param max: point size for the highest value.
[ "Set", "limits", "for", "the", "point", "sizes", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L285-L293
train
Set limits for the point sizes.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_slimits_for_all
def set_slimits_for_all(self, row_column_list=None, min=None, max=None): """Set point size limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def set_slimits_for_all(self, row_column_list=None, min=None, max=None): """Set point size limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "set_slimits_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "min", "=", "None", ",", "max", "=", "None", ")", ":", "if", "min", "is", "None", "or", "max", "is", "None", ":", "raise", "Exception", "(", "'Both min and max are require...
Set point size limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param min: point size for the lowest value. :param max: point size fo...
[ "Set", "point", "size", "limits", "of", "specified", "subplots", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L295-L312
train
Set point size limits for all the specified subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_xticks
def set_xticks(self, row, column, ticks): """Manually specify the x-axis tick values. :param row,column: specify the subplot. :param ticks: list of tick values. """ subplot = self.get_subplot_at(row, column) subplot.set_xticks(ticks)
python
def set_xticks(self, row, column, ticks): """Manually specify the x-axis tick values. :param row,column: specify the subplot. :param ticks: list of tick values. """ subplot = self.get_subplot_at(row, column) subplot.set_xticks(ticks)
[ "def", "set_xticks", "(", "self", ",", "row", ",", "column", ",", "ticks", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_xticks", "(", "ticks", ")" ]
Manually specify the x-axis tick values. :param row,column: specify the subplot. :param ticks: list of tick values.
[ "Manually", "specify", "the", "x", "-", "axis", "tick", "values", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L314-L322
train
Manually specify the x - axis tick values.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_xticks_for_all
def set_xticks_for_all(self, row_column_list=None, ticks=None): """Manually specify the x-axis tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param ...
python
def set_xticks_for_all(self, row_column_list=None, ticks=None): """Manually specify the x-axis tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param ...
[ "def", "set_xticks_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "ticks", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "self", ".", "ticks", "[", "'x'", "]", "=", "ticks", "else", ":", "for", "row", ",", "column...
Manually specify the x-axis tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param ticks: list of tick values.
[ "Manually", "specify", "the", "x", "-", "axis", "tick", "values", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L324-L337
train
Manually specify the x - axis tick values for all subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_logxticks
def set_logxticks(self, row, column, logticks): """Manually specify the x-axis log tick values. :param row,column: specify the subplot. :param logticks: logarithm of the locations for the ticks along the axis. For example, if you specify [1, 2, 3], ticks will be placed at 1...
python
def set_logxticks(self, row, column, logticks): """Manually specify the x-axis log tick values. :param row,column: specify the subplot. :param logticks: logarithm of the locations for the ticks along the axis. For example, if you specify [1, 2, 3], ticks will be placed at 1...
[ "def", "set_logxticks", "(", "self", ",", "row", ",", "column", ",", "logticks", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_logxticks", "(", "logticks", ")" ]
Manually specify the x-axis log tick values. :param row,column: specify the subplot. :param logticks: logarithm of the locations for the ticks along the axis. For example, if you specify [1, 2, 3], ticks will be placed at 10, 100 and 1000.
[ "Manually", "specify", "the", "x", "-", "axis", "log", "tick", "values", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L339-L351
train
Manually specify the x - axis log tick values.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_logxticks_for_all
def set_logxticks_for_all(self, row_column_list=None, logticks=None): """Manually specify the x-axis log tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def set_logxticks_for_all(self, row_column_list=None, logticks=None): """Manually specify the x-axis log tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "set_logxticks_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "logticks", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "self", ".", "ticks", "[", "'x'", "]", "=", "[", "'1e%d'", "%", "u", "for", "u", "in",...
Manually specify the x-axis log tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param logticks: logarithm of the locations for the ticks along the ...
[ "Manually", "specify", "the", "x", "-", "axis", "log", "tick", "values", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L353-L370
train
Manually specify the x - axis log tick values for all the available base classes.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_yticks
def set_yticks(self, row, column, ticks): """Manually specify the y-axis tick values. :param row,column: specify the subplot. :param ticks: list of tick values. """ subplot = self.get_subplot_at(row, column) subplot.set_yticks(ticks)
python
def set_yticks(self, row, column, ticks): """Manually specify the y-axis tick values. :param row,column: specify the subplot. :param ticks: list of tick values. """ subplot = self.get_subplot_at(row, column) subplot.set_yticks(ticks)
[ "def", "set_yticks", "(", "self", ",", "row", ",", "column", ",", "ticks", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_yticks", "(", "ticks", ")" ]
Manually specify the y-axis tick values. :param row,column: specify the subplot. :param ticks: list of tick values.
[ "Manually", "specify", "the", "y", "-", "axis", "tick", "values", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L372-L380
train
Manually specify the y - axis tick values.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_yticks_for_all
def set_yticks_for_all(self, row_column_list=None, ticks=None): """Manually specify the y-axis tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param ...
python
def set_yticks_for_all(self, row_column_list=None, ticks=None): """Manually specify the y-axis tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param ...
[ "def", "set_yticks_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "ticks", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "self", ".", "ticks", "[", "'y'", "]", "=", "ticks", "else", ":", "for", "row", ",", "column...
Manually specify the y-axis tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param ticks: list of tick values.
[ "Manually", "specify", "the", "y", "-", "axis", "tick", "values", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L382-L395
train
Manually specify the y - axis tick values for all subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_logyticks
def set_logyticks(self, row, column, logticks): """Manually specify the y-axis log tick values. :param row,column: specify the subplot. :param logticks: logarithm of the locations for the ticks along the axis. For example, if you specify [1, 2, 3], ticks will be placed at 1...
python
def set_logyticks(self, row, column, logticks): """Manually specify the y-axis log tick values. :param row,column: specify the subplot. :param logticks: logarithm of the locations for the ticks along the axis. For example, if you specify [1, 2, 3], ticks will be placed at 1...
[ "def", "set_logyticks", "(", "self", ",", "row", ",", "column", ",", "logticks", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_logyticks", "(", "logticks", ")" ]
Manually specify the y-axis log tick values. :param row,column: specify the subplot. :param logticks: logarithm of the locations for the ticks along the axis. For example, if you specify [1, 2, 3], ticks will be placed at 10, 100 and 1000.
[ "Manually", "specify", "the", "y", "-", "axis", "log", "tick", "values", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L397-L409
train
Manually specify the y - axis log tick values.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_logyticks_for_all
def set_logyticks_for_all(self, row_column_list=None, logticks=None): """Manually specify the y-axis log tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def set_logyticks_for_all(self, row_column_list=None, logticks=None): """Manually specify the y-axis log tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "set_logyticks_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "logticks", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "self", ".", "ticks", "[", "'y'", "]", "=", "[", "'1e%d'", "%", "u", "for", "u", "in",...
Manually specify the y-axis log tick values. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param logticks: logarithm of the locations for the ticks along the ...
[ "Manually", "specify", "the", "y", "-", "axis", "log", "tick", "values", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L411-L428
train
Manually specify the y - axis log tick values for all the available base classes.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_xtick_labels
def set_xtick_labels(self, row, column, labels): """Manually specify the x-axis tick labels. :param row,column: specify the subplot. :param labels: list of tick labels. """ subplot = self.get_subplot_at(row, column) subplot.set_xtick_labels(labels)
python
def set_xtick_labels(self, row, column, labels): """Manually specify the x-axis tick labels. :param row,column: specify the subplot. :param labels: list of tick labels. """ subplot = self.get_subplot_at(row, column) subplot.set_xtick_labels(labels)
[ "def", "set_xtick_labels", "(", "self", ",", "row", ",", "column", ",", "labels", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_xtick_labels", "(", "labels", ")" ]
Manually specify the x-axis tick labels. :param row,column: specify the subplot. :param labels: list of tick labels.
[ "Manually", "specify", "the", "x", "-", "axis", "tick", "labels", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L430-L438
train
Manually specify the x - axis tick labels.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_xtick_labels_for_all
def set_xtick_labels_for_all(self, row_column_list=None, labels=None): """Manually specify the x-axis tick labels. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def set_xtick_labels_for_all(self, row_column_list=None, labels=None): """Manually specify the x-axis tick labels. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "set_xtick_labels_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "labels", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "for", "subplot", "in", "self", ".", "subplots", ":", "self", ".", "set_xtick_labels", "(",...
Manually specify the x-axis tick labels. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param labels: list of tick labels.
[ "Manually", "specify", "the", "x", "-", "axis", "tick", "labels", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L440-L454
train
Manually specify the x - axis tick labels for all subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_ytick_labels
def set_ytick_labels(self, row, column, labels): """Manually specify the y-axis tick labels. :param row,column: specify the subplot. :param labels: list of tick labels. """ subplot = self.get_subplot_at(row, column) subplot.set_ytick_labels(labels)
python
def set_ytick_labels(self, row, column, labels): """Manually specify the y-axis tick labels. :param row,column: specify the subplot. :param labels: list of tick labels. """ subplot = self.get_subplot_at(row, column) subplot.set_ytick_labels(labels)
[ "def", "set_ytick_labels", "(", "self", ",", "row", ",", "column", ",", "labels", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_ytick_labels", "(", "labels", ")" ]
Manually specify the y-axis tick labels. :param row,column: specify the subplot. :param labels: list of tick labels.
[ "Manually", "specify", "the", "y", "-", "axis", "tick", "labels", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L456-L464
train
Manually specify the y - axis tick labels.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_ytick_labels_for_all
def set_ytick_labels_for_all(self, row_column_list=None, labels=None): """Manually specify the x-axis tick labels. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def set_ytick_labels_for_all(self, row_column_list=None, labels=None): """Manually specify the x-axis tick labels. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "set_ytick_labels_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "labels", "=", "None", ")", ":", "if", "row_column_list", "is", "None", ":", "for", "subplot", "in", "self", ".", "subplots", ":", "self", ".", "set_ytick_labels", "(",...
Manually specify the x-axis tick labels. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param labels: list of tick labels.
[ "Manually", "specify", "the", "x", "-", "axis", "tick", "labels", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L466-L480
train
Manually specify the x - axis tick labels for all subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.get_subplot_at
def get_subplot_at(self, row, column): """Return the subplot at row, column position. :param row,column: specify the subplot. """ idx = row * self.columns + column return self.subplots[idx]
python
def get_subplot_at(self, row, column): """Return the subplot at row, column position. :param row,column: specify the subplot. """ idx = row * self.columns + column return self.subplots[idx]
[ "def", "get_subplot_at", "(", "self", ",", "row", ",", "column", ")", ":", "idx", "=", "row", "*", "self", ".", "columns", "+", "column", "return", "self", ".", "subplots", "[", "idx", "]" ]
Return the subplot at row, column position. :param row,column: specify the subplot.
[ "Return", "the", "subplot", "at", "row", "column", "position", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L482-L489
train
Return the subplot at row column position.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.render
def render(self, template=None): """Render the plot using a template. Once the plot is complete, it needs to be rendered. Artist uses the Jinja2 templating engine. The default template results in a LaTeX file which can be included in your document. :param template: a user-sup...
python
def render(self, template=None): """Render the plot using a template. Once the plot is complete, it needs to be rendered. Artist uses the Jinja2 templating engine. The default template results in a LaTeX file which can be included in your document. :param template: a user-sup...
[ "def", "render", "(", "self", ",", "template", "=", "None", ")", ":", "if", "not", "template", ":", "template", "=", "self", ".", "template", "for", "subplot", "in", "self", ".", "subplots", ":", "subplot", ".", "_prepare_data", "(", ")", "response", "...
Render the plot using a template. Once the plot is complete, it needs to be rendered. Artist uses the Jinja2 templating engine. The default template results in a LaTeX file which can be included in your document. :param template: a user-supplied template or None. :type templa...
[ "Render", "the", "plot", "using", "a", "template", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L491-L521
train
Render the plot using a template.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_subplot_xlabel
def set_subplot_xlabel(self, row, column, text): """Set a label for the x-axis of a subplot. :param row,column: specify the subplot. :param text: text of the label. """ subplot = self.get_subplot_at(row, column) subplot.set_xlabel(text)
python
def set_subplot_xlabel(self, row, column, text): """Set a label for the x-axis of a subplot. :param row,column: specify the subplot. :param text: text of the label. """ subplot = self.get_subplot_at(row, column) subplot.set_xlabel(text)
[ "def", "set_subplot_xlabel", "(", "self", ",", "row", ",", "column", ",", "text", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_xlabel", "(", "text", ")" ]
Set a label for the x-axis of a subplot. :param row,column: specify the subplot. :param text: text of the label.
[ "Set", "a", "label", "for", "the", "x", "-", "axis", "of", "a", "subplot", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L539-L547
train
Set a label for the x - axis of a subplot.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_subplot_ylabel
def set_subplot_ylabel(self, row, column, text): """Set a label for the y-axis of a subplot. :param row,column: specify the subplot. :param text: text of the label. """ subplot = self.get_subplot_at(row, column) subplot.set_ylabel(text)
python
def set_subplot_ylabel(self, row, column, text): """Set a label for the y-axis of a subplot. :param row,column: specify the subplot. :param text: text of the label. """ subplot = self.get_subplot_at(row, column) subplot.set_ylabel(text)
[ "def", "set_subplot_ylabel", "(", "self", ",", "row", ",", "column", ",", "text", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_ylabel", "(", "text", ")" ]
Set a label for the y-axis of a subplot. :param row,column: specify the subplot. :param text: text of the label.
[ "Set", "a", "label", "for", "the", "y", "-", "axis", "of", "a", "subplot", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L549-L557
train
Set a label for the y - axis of a subplot.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_scalebar_for_all
def set_scalebar_for_all(self, row_column_list=None, location='lower right'): """Show marker area scale for subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :param locat...
python
def set_scalebar_for_all(self, row_column_list=None, location='lower right'): """Show marker area scale for subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :param locat...
[ "def", "set_scalebar_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "location", "=", "'lower right'", ")", ":", "if", "row_column_list", "is", "None", ":", "for", "subplot", "in", "self", ".", "subplots", ":", "subplot", ".", "set_scalebar", ...
Show marker area scale for subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :param location: the location of the label inside the plot. May be one of 'center', 'upper right', 'lower right', 'up...
[ "Show", "marker", "area", "scale", "for", "subplots", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L559-L576
train
Show marker area scale for all subplots.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_colorbar
def set_colorbar(self, label='', horizontal=False): """Show the colorbar, it will be attached to the last plot. Not for the histogram2d, only for the scatter_table. Global mlimits should be set for this to properly reflect the colormap of each subplot. :param label: axis label ...
python
def set_colorbar(self, label='', horizontal=False): """Show the colorbar, it will be attached to the last plot. Not for the histogram2d, only for the scatter_table. Global mlimits should be set for this to properly reflect the colormap of each subplot. :param label: axis label ...
[ "def", "set_colorbar", "(", "self", ",", "label", "=", "''", ",", "horizontal", "=", "False", ")", ":", "if", "self", ".", "limits", "[", "'mmin'", "]", "is", "None", "or", "self", ".", "limits", "[", "'mmax'", "]", "is", "None", ":", "warnings", "...
Show the colorbar, it will be attached to the last plot. Not for the histogram2d, only for the scatter_table. Global mlimits should be set for this to properly reflect the colormap of each subplot. :param label: axis label for the colorbar. :param horizontal: boolean, if True t...
[ "Show", "the", "colorbar", "it", "will", "be", "attached", "to", "the", "last", "plot", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L578-L593
train
Show the colorbar for the last plot.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_axis_options
def set_axis_options(self, row, column, text): """Set additionnal options as plain text.""" subplot = self.get_subplot_at(row, column) subplot.set_axis_options(text)
python
def set_axis_options(self, row, column, text): """Set additionnal options as plain text.""" subplot = self.get_subplot_at(row, column) subplot.set_axis_options(text)
[ "def", "set_axis_options", "(", "self", ",", "row", ",", "column", ",", "text", ")", ":", "subplot", "=", "self", ".", "get_subplot_at", "(", "row", ",", "column", ")", "subplot", ".", "set_axis_options", "(", "text", ")" ]
Set additionnal options as plain text.
[ "Set", "additionnal", "options", "as", "plain", "text", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L604-L608
train
Set additionnal options as plain text.
davidfokkema/artist
artist/multi_plot.py
MultiPlot.set_axis_options_for_all
def set_axis_options_for_all(self, row_column_list=None, text=''): """Set point size limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
python
def set_axis_options_for_all(self, row_column_list=None, text=''): """Set point size limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None ...
[ "def", "set_axis_options_for_all", "(", "self", ",", "row_column_list", "=", "None", ",", "text", "=", "''", ")", ":", "if", "row_column_list", "is", "None", ":", "self", ".", "axis_options", "=", "text", "else", ":", "for", "row", ",", "column", "in", "...
Set point size limits of specified subplots. :param row_column_list: a list containing (row, column) tuples to specify the subplots, or None to indicate *all* subplots. :type row_column_list: list or None :param text: axis options for the given subplots or the overall plot.
[ "Set", "point", "size", "limits", "of", "specified", "subplots", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L610-L623
train
Set point size limits for all subplots.
davidfokkema/artist
artist/multi_plot.py
SubPlotContainer.set_xticklabels_position
def set_xticklabels_position(self, position): """Specify the position of the axis tick labels. This is generally only useful for multiplots containing only one row. This can be used to e.g. alternatively draw the tick labels on the bottom or the top of the subplot. :param posi...
python
def set_xticklabels_position(self, position): """Specify the position of the axis tick labels. This is generally only useful for multiplots containing only one row. This can be used to e.g. alternatively draw the tick labels on the bottom or the top of the subplot. :param posi...
[ "def", "set_xticklabels_position", "(", "self", ",", "position", ")", ":", "pgfplots_translation", "=", "{", "'top'", ":", "'right'", ",", "'bottom'", ":", "'left'", "}", "fixed_position", "=", "pgfplots_translation", "[", "position", "]", "self", ".", "xticklab...
Specify the position of the axis tick labels. This is generally only useful for multiplots containing only one row. This can be used to e.g. alternatively draw the tick labels on the bottom or the top of the subplot. :param position: 'top' or 'bottom' to specify the position of the ...
[ "Specify", "the", "position", "of", "the", "axis", "tick", "labels", "." ]
26ae7987522622710f2910980770c50012fda47d
https://github.com/davidfokkema/artist/blob/26ae7987522622710f2910980770c50012fda47d/artist/multi_plot.py#L662-L676
train
Set the position of the x - axis tick labels.
openearth/mmi-python
mmi/mmi_client.py
MMIClient.initialize
def initialize(self, configfile=None): """ Initialize the module """ method = "initialize" A = None metadata = {method: configfile} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self...
python
def initialize(self, configfile=None): """ Initialize the module """ method = "initialize" A = None metadata = {method: configfile} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self...
[ "def", "initialize", "(", "self", ",", "configfile", "=", "None", ")", ":", "method", "=", "\"initialize\"", "A", "=", "None", "metadata", "=", "{", "method", ":", "configfile", "}", "send_array", "(", "self", ".", "socket", ",", "A", ",", "metadata", ...
Initialize the module
[ "Initialize", "the", "module" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/mmi_client.py#L56-L69
train
Initialize the module with the given configfile.
openearth/mmi-python
mmi/mmi_client.py
MMIClient.finalize
def finalize(self): """ Finalize the module """ method = "finalize" A = None metadata = {method: -1} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.poll_timeout, flag...
python
def finalize(self): """ Finalize the module """ method = "finalize" A = None metadata = {method: -1} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.poll_timeout, flag...
[ "def", "finalize", "(", "self", ")", ":", "method", "=", "\"finalize\"", "A", "=", "None", "metadata", "=", "{", "method", ":", "-", "1", "}", "send_array", "(", "self", ".", "socket", ",", "A", ",", "metadata", ")", "A", ",", "metadata", "=", "rec...
Finalize the module
[ "Finalize", "the", "module" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/mmi_client.py#L71-L84
train
Finalize the module
openearth/mmi-python
mmi/mmi_client.py
MMIClient.get_var_name
def get_var_name(self, i): """ Return variable name """ method = "get_var_name" A = None metadata = {method: i} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.poll_timeout, ...
python
def get_var_name(self, i): """ Return variable name """ method = "get_var_name" A = None metadata = {method: i} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.poll_timeout, ...
[ "def", "get_var_name", "(", "self", ",", "i", ")", ":", "method", "=", "\"get_var_name\"", "A", "=", "None", "metadata", "=", "{", "method", ":", "i", "}", "send_array", "(", "self", ".", "socket", ",", "A", ",", "metadata", ")", "A", ",", "metadata"...
Return variable name
[ "Return", "variable", "name" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/mmi_client.py#L103-L118
train
Get variable name from the object.
openearth/mmi-python
mmi/mmi_client.py
MMIClient.get_var_type
def get_var_type(self, name): """ Return variable name """ method = "get_var_type" A = None metadata = {method: name} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.poll_timeout,...
python
def get_var_type(self, name): """ Return variable name """ method = "get_var_type" A = None metadata = {method: name} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.poll_timeout,...
[ "def", "get_var_type", "(", "self", ",", "name", ")", ":", "method", "=", "\"get_var_type\"", "A", "=", "None", "metadata", "=", "{", "method", ":", "name", "}", "send_array", "(", "self", ".", "socket", ",", "A", ",", "metadata", ")", "A", ",", "met...
Return variable name
[ "Return", "variable", "name" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/mmi_client.py#L120-L135
train
Get the type of a variable.
openearth/mmi-python
mmi/mmi_client.py
MMIClient.set_current_time
def set_current_time(self, t): """ Set current time of simulation """ method = "set_current_time" A = None metadata = {method: t} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.p...
python
def set_current_time(self, t): """ Set current time of simulation """ method = "set_current_time" A = None metadata = {method: t} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.p...
[ "def", "set_current_time", "(", "self", ",", "t", ")", ":", "method", "=", "\"set_current_time\"", "A", "=", "None", "metadata", "=", "{", "method", ":", "t", "}", "send_array", "(", "self", ".", "socket", ",", "A", ",", "metadata", ")", "A", ",", "m...
Set current time of simulation
[ "Set", "current", "time", "of", "simulation" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/mmi_client.py#L188-L201
train
Set current time of simulation
openearth/mmi-python
mmi/mmi_client.py
MMIClient.set_var_slice
def set_var_slice(self, name, start, count, var): """ Set the variable name with the values of var """ method = "set_var_slice" A = var metadata = { method: name, "start": start, "count": count } send_array(self.socket...
python
def set_var_slice(self, name, start, count, var): """ Set the variable name with the values of var """ method = "set_var_slice" A = var metadata = { method: name, "start": start, "count": count } send_array(self.socket...
[ "def", "set_var_slice", "(", "self", ",", "name", ",", "start", ",", "count", ",", "var", ")", ":", "method", "=", "\"set_var_slice\"", "A", "=", "var", "metadata", "=", "{", "method", ":", "name", ",", "\"start\"", ":", "start", ",", "\"count\"", ":",...
Set the variable name with the values of var
[ "Set", "the", "variable", "name", "with", "the", "values", "of", "var" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/mmi_client.py#L218-L234
train
Set the variable name with the values of var
openearth/mmi-python
mmi/mmi_client.py
MMIClient.update
def update(self, dt): """ Advance the module with timestep dt """ method = "update" A = None metadata = {method: dt} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.poll_timeout, ...
python
def update(self, dt): """ Advance the module with timestep dt """ method = "update" A = None metadata = {method: dt} send_array(self.socket, A, metadata) A, metadata = recv_array( self.socket, poll=self.poll, poll_timeout=self.poll_timeout, ...
[ "def", "update", "(", "self", ",", "dt", ")", ":", "method", "=", "\"update\"", "A", "=", "None", "metadata", "=", "{", "method", ":", "dt", "}", "send_array", "(", "self", ".", "socket", ",", "A", ",", "metadata", ")", "A", ",", "metadata", "=", ...
Advance the module with timestep dt
[ "Advance", "the", "module", "with", "timestep", "dt" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/mmi_client.py#L304-L317
train
Advance the module with timestep dt
openearth/mmi-python
mmi/mmi_client.py
MMIClient.remote
def remote(self, action): """ Function specific for MMI, not BMI. action is one of: "play", "stop", "pause", "rewind", "quit" """ method = "remote" A = None metadata = {method: action} send_array(self.socket, A, metadata) A, metadata = recv_array...
python
def remote(self, action): """ Function specific for MMI, not BMI. action is one of: "play", "stop", "pause", "rewind", "quit" """ method = "remote" A = None metadata = {method: action} send_array(self.socket, A, metadata) A, metadata = recv_array...
[ "def", "remote", "(", "self", ",", "action", ")", ":", "method", "=", "\"remote\"", "A", "=", "None", "metadata", "=", "{", "method", ":", "action", "}", "send_array", "(", "self", ".", "socket", ",", "A", ",", "metadata", ")", "A", ",", "metadata", ...
Function specific for MMI, not BMI. action is one of: "play", "stop", "pause", "rewind", "quit"
[ "Function", "specific", "for", "MMI", "not", "BMI", ".", "action", "is", "one", "of", ":", "play", "stop", "pause", "rewind", "quit" ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/mmi_client.py#L332-L347
train
Function specific for MMI not BMI.
openearth/mmi-python
mmi/mmi_client.py
MMIClient.subscribe
def subscribe(self, topic=b''): """subscribe to the SUB socket, to listen for incomming variables, return a stream that can be listened to.""" self.sockets[zmq.SUB].setsockopt(zmq.SUBSCRIBE, topic) poller = self.pollers[zmq.SUB] return poller
python
def subscribe(self, topic=b''): """subscribe to the SUB socket, to listen for incomming variables, return a stream that can be listened to.""" self.sockets[zmq.SUB].setsockopt(zmq.SUBSCRIBE, topic) poller = self.pollers[zmq.SUB] return poller
[ "def", "subscribe", "(", "self", ",", "topic", "=", "b''", ")", ":", "self", ".", "sockets", "[", "zmq", ".", "SUB", "]", ".", "setsockopt", "(", "zmq", ".", "SUBSCRIBE", ",", "topic", ")", "poller", "=", "self", ".", "pollers", "[", "zmq", ".", ...
subscribe to the SUB socket, to listen for incomming variables, return a stream that can be listened to.
[ "subscribe", "to", "the", "SUB", "socket", "to", "listen", "for", "incomming", "variables", "return", "a", "stream", "that", "can", "be", "listened", "to", "." ]
a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d
https://github.com/openearth/mmi-python/blob/a2f4ac96b1e7f2fa903f668b3e05c4e86ad42e8d/mmi/mmi_client.py#L349-L353
train
subscribe to the SUB socket to listen for incomming variables return a stream that can be listened to. topic is the topic to listen for incomming variables return a stream that can be listened to.
djaodjin/djaodjin-deployutils
deployutils/copy.py
download
def download(remote_location, remotes=None, prefix="", dry_run=False): """ Download resources from a stage server. """ if remotes is None: remotes, _ = _resources_files( abs_paths=remote_location.startswith('s3://')) if remote_location.startswith('s3://'): from .s3 import...
python
def download(remote_location, remotes=None, prefix="", dry_run=False): """ Download resources from a stage server. """ if remotes is None: remotes, _ = _resources_files( abs_paths=remote_location.startswith('s3://')) if remote_location.startswith('s3://'): from .s3 import...
[ "def", "download", "(", "remote_location", ",", "remotes", "=", "None", ",", "prefix", "=", "\"\"", ",", "dry_run", "=", "False", ")", ":", "if", "remotes", "is", "None", ":", "remotes", ",", "_", "=", "_resources_files", "(", "abs_paths", "=", "remote_l...
Download resources from a stage server.
[ "Download", "resources", "from", "a", "stage", "server", "." ]
a0fe3cf3030dbbf09025c69ce75a69b326565dd8
https://github.com/djaodjin/djaodjin-deployutils/blob/a0fe3cf3030dbbf09025c69ce75a69b326565dd8/deployutils/copy.py#L58-L74
train
Download resources from a stage server.
djaodjin/djaodjin-deployutils
deployutils/copy.py
shell_command
def shell_command(cmd, dry_run=False): """ Run a shell command. """ if cmd[0] == '/usr/bin/rsync': if dry_run: cmd = [cmd[0], '-n'] + cmd[1:] LOGGER.info('run: %s', ' '.join(cmd)) subprocess.check_call(cmd) else: LOGGER.info('run: %s', ' '.join(cmd)) ...
python
def shell_command(cmd, dry_run=False): """ Run a shell command. """ if cmd[0] == '/usr/bin/rsync': if dry_run: cmd = [cmd[0], '-n'] + cmd[1:] LOGGER.info('run: %s', ' '.join(cmd)) subprocess.check_call(cmd) else: LOGGER.info('run: %s', ' '.join(cmd)) ...
[ "def", "shell_command", "(", "cmd", ",", "dry_run", "=", "False", ")", ":", "if", "cmd", "[", "0", "]", "==", "'/usr/bin/rsync'", ":", "if", "dry_run", ":", "cmd", "=", "[", "cmd", "[", "0", "]", ",", "'-n'", "]", "+", "cmd", "[", "1", ":", "]"...
Run a shell command.
[ "Run", "a", "shell", "command", "." ]
a0fe3cf3030dbbf09025c69ce75a69b326565dd8
https://github.com/djaodjin/djaodjin-deployutils/blob/a0fe3cf3030dbbf09025c69ce75a69b326565dd8/deployutils/copy.py#L77-L89
train
Run a shell command.
djaodjin/djaodjin-deployutils
deployutils/copy.py
upload
def upload(remote_location, remotes=None, ignores=None, static_root="/static/", prefix="", dry_run=False): # pylint:disable=too-many-arguments """ Upload resources to a stage server. """ if remotes is None: remotes, ignores = _resources_files( abs_paths=remote_location...
python
def upload(remote_location, remotes=None, ignores=None, static_root="/static/", prefix="", dry_run=False): # pylint:disable=too-many-arguments """ Upload resources to a stage server. """ if remotes is None: remotes, ignores = _resources_files( abs_paths=remote_location...
[ "def", "upload", "(", "remote_location", ",", "remotes", "=", "None", ",", "ignores", "=", "None", ",", "static_root", "=", "\"/static/\"", ",", "prefix", "=", "\"\"", ",", "dry_run", "=", "False", ")", ":", "# pylint:disable=too-many-arguments", "if", "remote...
Upload resources to a stage server.
[ "Upload", "resources", "to", "a", "stage", "server", "." ]
a0fe3cf3030dbbf09025c69ce75a69b326565dd8
https://github.com/djaodjin/djaodjin-deployutils/blob/a0fe3cf3030dbbf09025c69ce75a69b326565dd8/deployutils/copy.py#L92-L114
train
Uploads resources to a stage server.
JosuaKrause/quick_server
quick_server/quick_server.py
json_dumps
def json_dumps(obj): """A safe JSON dump function that provides correct diverging numbers for a ECMAscript consumer. """ try: return json.dumps(obj, indent=2, sort_keys=True, allow_nan=False) except ValueError: pass # we don't want to call do_map on the original object since i...
python
def json_dumps(obj): """A safe JSON dump function that provides correct diverging numbers for a ECMAscript consumer. """ try: return json.dumps(obj, indent=2, sort_keys=True, allow_nan=False) except ValueError: pass # we don't want to call do_map on the original object since i...
[ "def", "json_dumps", "(", "obj", ")", ":", "try", ":", "return", "json", ".", "dumps", "(", "obj", ",", "indent", "=", "2", ",", "sort_keys", "=", "True", ",", "allow_nan", "=", "False", ")", "except", "ValueError", ":", "pass", "# we don't want to call ...
A safe JSON dump function that provides correct diverging numbers for a ECMAscript consumer.
[ "A", "safe", "JSON", "dump", "function", "that", "provides", "correct", "diverging", "numbers", "for", "a", "ECMAscript", "consumer", "." ]
55dc7c5fe726a341f8476f749fe0f9da156fc1cb
https://github.com/JosuaKrause/quick_server/blob/55dc7c5fe726a341f8476f749fe0f9da156fc1cb/quick_server/quick_server.py#L148-L187
train
A safe JSON dump function that provides correct diverging numbers for ECMAscript consumer.
JosuaKrause/quick_server
quick_server/quick_server.py
msg
def msg(message, *args, **kwargs): """Prints a message from the server to the log file.""" global log_file if log_file is None: log_file = sys.stderr if long_msg: file_name, line = caller_trace() file_name, file_type = os.path.splitext(file_name) if file_name.endswith('/_...
python
def msg(message, *args, **kwargs): """Prints a message from the server to the log file.""" global log_file if log_file is None: log_file = sys.stderr if long_msg: file_name, line = caller_trace() file_name, file_type = os.path.splitext(file_name) if file_name.endswith('/_...
[ "def", "msg", "(", "message", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "global", "log_file", "if", "log_file", "is", "None", ":", "log_file", "=", "sys", ".", "stderr", "if", "long_msg", ":", "file_name", ",", "line", "=", "caller_trace", ...
Prints a message from the server to the log file.
[ "Prints", "a", "message", "from", "the", "server", "to", "the", "log", "file", "." ]
55dc7c5fe726a341f8476f749fe0f9da156fc1cb
https://github.com/JosuaKrause/quick_server/blob/55dc7c5fe726a341f8476f749fe0f9da156fc1cb/quick_server/quick_server.py#L232-L261
train
Prints a message from the server to the log file.
JosuaKrause/quick_server
quick_server/quick_server.py
setup_restart
def setup_restart(): """Sets up restart functionality that doesn't keep the first process alive. The function needs to be called before the actual process starts but after loading the program. It will restart the program in a child process and immediately returns in the child process. The call ...
python
def setup_restart(): """Sets up restart functionality that doesn't keep the first process alive. The function needs to be called before the actual process starts but after loading the program. It will restart the program in a child process and immediately returns in the child process. The call ...
[ "def", "setup_restart", "(", ")", ":", "exit_code", "=", "os", ".", "environ", ".", "get", "(", "'QUICK_SERVER_RESTART'", ",", "None", ")", "if", "exit_code", "is", "None", ":", "try", ":", "atexit", ".", "unregister", "(", "_on_exit", ")", "except", "At...
Sets up restart functionality that doesn't keep the first process alive. The function needs to be called before the actual process starts but after loading the program. It will restart the program in a child process and immediately returns in the child process. The call in the parent process...
[ "Sets", "up", "restart", "functionality", "that", "doesn", "t", "keep", "the", "first", "process", "alive", ".", "The", "function", "needs", "to", "be", "called", "before", "the", "actual", "process", "starts", "but", "after", "loading", "the", "program", "....
55dc7c5fe726a341f8476f749fe0f9da156fc1cb
https://github.com/JosuaKrause/quick_server/blob/55dc7c5fe726a341f8476f749fe0f9da156fc1cb/quick_server/quick_server.py#L393-L409
train
Sets up restart functionality that doesn t keep the first process alive.
JosuaKrause/quick_server
quick_server/quick_server.py
QuickServerRequestHandler.convert_argmap
def convert_argmap(self, query): """Converts the query string of an URL to a map. Parameters ---------- query : string The URL to parse. Returns ------- A map object containing all fields as keys with their value. Fields without '=' in the UR...
python
def convert_argmap(self, query): """Converts the query string of an URL to a map. Parameters ---------- query : string The URL to parse. Returns ------- A map object containing all fields as keys with their value. Fields without '=' in the UR...
[ "def", "convert_argmap", "(", "self", ",", "query", ")", ":", "res", "=", "{", "}", "if", "isinstance", "(", "query", ",", "bytes", ")", ":", "query", "=", "query", ".", "decode", "(", "'utf8'", ")", "for", "section", "in", "query", ".", "split", "...
Converts the query string of an URL to a map. Parameters ---------- query : string The URL to parse. Returns ------- A map object containing all fields as keys with their value. Fields without '=' in the URL are interpreted as flags and the value is ...
[ "Converts", "the", "query", "string", "of", "an", "URL", "to", "a", "map", "." ]
55dc7c5fe726a341f8476f749fe0f9da156fc1cb
https://github.com/JosuaKrause/quick_server/blob/55dc7c5fe726a341f8476f749fe0f9da156fc1cb/quick_server/quick_server.py#L452-L476
train
Converts the query string of an URL to a map.
JosuaKrause/quick_server
quick_server/quick_server.py
QuickServerRequestHandler.convert_args
def convert_args(self, rem_path, args): """Splits the rest of a URL into its argument parts. The URL is assumed to start with the dynamic request prefix already removed. Parameters ---------- rem_path : string The URL to parse. The URL must start with the dynamic ...
python
def convert_args(self, rem_path, args): """Splits the rest of a URL into its argument parts. The URL is assumed to start with the dynamic request prefix already removed. Parameters ---------- rem_path : string The URL to parse. The URL must start with the dynamic ...
[ "def", "convert_args", "(", "self", ",", "rem_path", ",", "args", ")", ":", "fragment_split", "=", "rem_path", ".", "split", "(", "'#'", ",", "1", ")", "query_split", "=", "fragment_split", "[", "0", "]", ".", "split", "(", "'?'", ",", "1", ")", "seg...
Splits the rest of a URL into its argument parts. The URL is assumed to start with the dynamic request prefix already removed. Parameters ---------- rem_path : string The URL to parse. The URL must start with the dynamic request prefix already removed. ...
[ "Splits", "the", "rest", "of", "a", "URL", "into", "its", "argument", "parts", ".", "The", "URL", "is", "assumed", "to", "start", "with", "the", "dynamic", "request", "prefix", "already", "removed", "." ]
55dc7c5fe726a341f8476f749fe0f9da156fc1cb
https://github.com/JosuaKrause/quick_server/blob/55dc7c5fe726a341f8476f749fe0f9da156fc1cb/quick_server/quick_server.py#L478-L509
train
Splits the rest of a URL into its argument parts.
JosuaKrause/quick_server
quick_server/quick_server.py
QuickServerRequestHandler.get_post_file
def get_post_file(self, hdr, f_in, clen, post, files): """Reads from a multipart/form-data.""" lens = { 'clen': clen, 'push': [], } prefix = "boundary=" if not hdr.startswith(prefix): return None boundary = hdr[len(prefix):].strip().enc...
python
def get_post_file(self, hdr, f_in, clen, post, files): """Reads from a multipart/form-data.""" lens = { 'clen': clen, 'push': [], } prefix = "boundary=" if not hdr.startswith(prefix): return None boundary = hdr[len(prefix):].strip().enc...
[ "def", "get_post_file", "(", "self", ",", "hdr", ",", "f_in", ",", "clen", ",", "post", ",", "files", ")", ":", "lens", "=", "{", "'clen'", ":", "clen", ",", "'push'", ":", "[", "]", ",", "}", "prefix", "=", "\"boundary=\"", "if", "not", "hdr", "...
Reads from a multipart/form-data.
[ "Reads", "from", "a", "multipart", "/", "form", "-", "data", "." ]
55dc7c5fe726a341f8476f749fe0f9da156fc1cb
https://github.com/JosuaKrause/quick_server/blob/55dc7c5fe726a341f8476f749fe0f9da156fc1cb/quick_server/quick_server.py#L511-L633
train
Reads a single file from a multipart - form - data file.