id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
53,100
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_references
def search_references( self, reference_set_id, accession=None, md5checksum=None): """ Returns an iterator over the References fulfilling the specified conditions from the specified Dataset. :param str reference_set_id: The ReferenceSet to search. :param str accession...
python
def search_references( self, reference_set_id, accession=None, md5checksum=None): """ Returns an iterator over the References fulfilling the specified conditions from the specified Dataset. :param str reference_set_id: The ReferenceSet to search. :param str accession...
[ "def", "search_references", "(", "self", ",", "reference_set_id", ",", "accession", "=", "None", ",", "md5checksum", "=", "None", ")", ":", "request", "=", "protocol", ".", "SearchReferencesRequest", "(", ")", "request", ".", "reference_set_id", "=", "reference_...
Returns an iterator over the References fulfilling the specified conditions from the specified Dataset. :param str reference_set_id: The ReferenceSet to search. :param str accession: If not None, return the references for which the `accession` matches this string (case-sensitive, ex...
[ "Returns", "an", "iterator", "over", "the", "References", "fulfilling", "the", "specified", "conditions", "from", "the", "specified", "Dataset", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L610-L631
53,101
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_call_sets
def search_call_sets(self, variant_set_id, name=None, biosample_id=None): """ Returns an iterator over the CallSets fulfilling the specified conditions from the specified VariantSet. :param str variant_set_id: Find callsets belonging to the provided variant set. :par...
python
def search_call_sets(self, variant_set_id, name=None, biosample_id=None): """ Returns an iterator over the CallSets fulfilling the specified conditions from the specified VariantSet. :param str variant_set_id: Find callsets belonging to the provided variant set. :par...
[ "def", "search_call_sets", "(", "self", ",", "variant_set_id", ",", "name", "=", "None", ",", "biosample_id", "=", "None", ")", ":", "request", "=", "protocol", ".", "SearchCallSetsRequest", "(", ")", "request", ".", "variant_set_id", "=", "variant_set_id", "r...
Returns an iterator over the CallSets fulfilling the specified conditions from the specified VariantSet. :param str variant_set_id: Find callsets belonging to the provided variant set. :param str name: Only CallSets matching the specified name will be returned. :...
[ "Returns", "an", "iterator", "over", "the", "CallSets", "fulfilling", "the", "specified", "conditions", "from", "the", "specified", "VariantSet", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L633-L653
53,102
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_biosamples
def search_biosamples(self, dataset_id, name=None, individual_id=None): """ Returns an iterator over the Biosamples fulfilling the specified conditions. :param str dataset_id: The dataset to search within. :param str name: Only Biosamples matching the specified name will ...
python
def search_biosamples(self, dataset_id, name=None, individual_id=None): """ Returns an iterator over the Biosamples fulfilling the specified conditions. :param str dataset_id: The dataset to search within. :param str name: Only Biosamples matching the specified name will ...
[ "def", "search_biosamples", "(", "self", ",", "dataset_id", ",", "name", "=", "None", ",", "individual_id", "=", "None", ")", ":", "request", "=", "protocol", ".", "SearchBiosamplesRequest", "(", ")", "request", ".", "dataset_id", "=", "dataset_id", "request",...
Returns an iterator over the Biosamples fulfilling the specified conditions. :param str dataset_id: The dataset to search within. :param str name: Only Biosamples matching the specified name will be returned. :param str individual_id: Only Biosamples matching matching this ...
[ "Returns", "an", "iterator", "over", "the", "Biosamples", "fulfilling", "the", "specified", "conditions", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L655-L674
53,103
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_individuals
def search_individuals(self, dataset_id, name=None): """ Returns an iterator over the Individuals fulfilling the specified conditions. :param str dataset_id: The dataset to search within. :param str name: Only Individuals matching the specified name will be returned....
python
def search_individuals(self, dataset_id, name=None): """ Returns an iterator over the Individuals fulfilling the specified conditions. :param str dataset_id: The dataset to search within. :param str name: Only Individuals matching the specified name will be returned....
[ "def", "search_individuals", "(", "self", ",", "dataset_id", ",", "name", "=", "None", ")", ":", "request", "=", "protocol", ".", "SearchIndividualsRequest", "(", ")", "request", ".", "dataset_id", "=", "dataset_id", "request", ".", "name", "=", "pb", ".", ...
Returns an iterator over the Individuals fulfilling the specified conditions. :param str dataset_id: The dataset to search within. :param str name: Only Individuals matching the specified name will be returned. :return: An iterator over the :class:`ga4gh.protocol.Biosample` ...
[ "Returns", "an", "iterator", "over", "the", "Individuals", "fulfilling", "the", "specified", "conditions", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L676-L692
53,104
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_read_group_sets
def search_read_group_sets( self, dataset_id, name=None, biosample_id=None): """ Returns an iterator over the ReadGroupSets fulfilling the specified conditions from the specified Dataset. :param str name: Only ReadGroupSets matching the specified name will be ret...
python
def search_read_group_sets( self, dataset_id, name=None, biosample_id=None): """ Returns an iterator over the ReadGroupSets fulfilling the specified conditions from the specified Dataset. :param str name: Only ReadGroupSets matching the specified name will be ret...
[ "def", "search_read_group_sets", "(", "self", ",", "dataset_id", ",", "name", "=", "None", ",", "biosample_id", "=", "None", ")", ":", "request", "=", "protocol", ".", "SearchReadGroupSetsRequest", "(", ")", "request", ".", "dataset_id", "=", "dataset_id", "re...
Returns an iterator over the ReadGroupSets fulfilling the specified conditions from the specified Dataset. :param str name: Only ReadGroupSets matching the specified name will be returned. :param str biosample_id: Only ReadGroups matching the specified biosample will be ...
[ "Returns", "an", "iterator", "over", "the", "ReadGroupSets", "fulfilling", "the", "specified", "conditions", "from", "the", "specified", "Dataset", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L694-L714
53,105
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_reads
def search_reads( self, read_group_ids, reference_id=None, start=None, end=None): """ Returns an iterator over the Reads fulfilling the specified conditions from the specified read_group_ids. :param str read_group_ids: The IDs of the :class:`ga4gh.protocol.ReadGr...
python
def search_reads( self, read_group_ids, reference_id=None, start=None, end=None): """ Returns an iterator over the Reads fulfilling the specified conditions from the specified read_group_ids. :param str read_group_ids: The IDs of the :class:`ga4gh.protocol.ReadGr...
[ "def", "search_reads", "(", "self", ",", "read_group_ids", ",", "reference_id", "=", "None", ",", "start", "=", "None", ",", "end", "=", "None", ")", ":", "request", "=", "protocol", ".", "SearchReadsRequest", "(", ")", "request", ".", "read_group_ids", "....
Returns an iterator over the Reads fulfilling the specified conditions from the specified read_group_ids. :param str read_group_ids: The IDs of the :class:`ga4gh.protocol.ReadGroup` of interest. :param str reference_id: The name of the :class:`ga4gh.protocol.Reference` w...
[ "Returns", "an", "iterator", "over", "the", "Reads", "fulfilling", "the", "specified", "conditions", "from", "the", "specified", "read_group_ids", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L716-L747
53,106
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_phenotype_association_sets
def search_phenotype_association_sets(self, dataset_id): """ Returns an iterator over the PhenotypeAssociationSets on the server. """ request = protocol.SearchPhenotypeAssociationSetsRequest() request.dataset_id = dataset_id request.page_size = pb.int(self._page_size) ...
python
def search_phenotype_association_sets(self, dataset_id): """ Returns an iterator over the PhenotypeAssociationSets on the server. """ request = protocol.SearchPhenotypeAssociationSetsRequest() request.dataset_id = dataset_id request.page_size = pb.int(self._page_size) ...
[ "def", "search_phenotype_association_sets", "(", "self", ",", "dataset_id", ")", ":", "request", "=", "protocol", ".", "SearchPhenotypeAssociationSetsRequest", "(", ")", "request", ".", "dataset_id", "=", "dataset_id", "request", ".", "page_size", "=", "pb", ".", ...
Returns an iterator over the PhenotypeAssociationSets on the server.
[ "Returns", "an", "iterator", "over", "the", "PhenotypeAssociationSets", "on", "the", "server", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L749-L758
53,107
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_genotype_phenotype
def search_genotype_phenotype( self, phenotype_association_set_id=None, feature_ids=None, phenotype_ids=None, evidence=None): """ Returns an iterator over the GeneotypePhenotype associations from the server """ request = protocol.SearchGenotypePhenotypeReq...
python
def search_genotype_phenotype( self, phenotype_association_set_id=None, feature_ids=None, phenotype_ids=None, evidence=None): """ Returns an iterator over the GeneotypePhenotype associations from the server """ request = protocol.SearchGenotypePhenotypeReq...
[ "def", "search_genotype_phenotype", "(", "self", ",", "phenotype_association_set_id", "=", "None", ",", "feature_ids", "=", "None", ",", "phenotype_ids", "=", "None", ",", "evidence", "=", "None", ")", ":", "request", "=", "protocol", ".", "SearchGenotypePhenotype...
Returns an iterator over the GeneotypePhenotype associations from the server
[ "Returns", "an", "iterator", "over", "the", "GeneotypePhenotype", "associations", "from", "the", "server" ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L760-L779
53,108
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_phenotype
def search_phenotype( self, phenotype_association_set_id=None, phenotype_id=None, description=None, type_=None, age_of_onset=None): """ Returns an iterator over the Phenotypes from the server """ request = protocol.SearchPhenotypesRequest() request.phenoty...
python
def search_phenotype( self, phenotype_association_set_id=None, phenotype_id=None, description=None, type_=None, age_of_onset=None): """ Returns an iterator over the Phenotypes from the server """ request = protocol.SearchPhenotypesRequest() request.phenoty...
[ "def", "search_phenotype", "(", "self", ",", "phenotype_association_set_id", "=", "None", ",", "phenotype_id", "=", "None", ",", "description", "=", "None", ",", "type_", "=", "None", ",", "age_of_onset", "=", "None", ")", ":", "request", "=", "protocol", "....
Returns an iterator over the Phenotypes from the server
[ "Returns", "an", "iterator", "over", "the", "Phenotypes", "from", "the", "server" ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L781-L800
53,109
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_rna_quantification_sets
def search_rna_quantification_sets(self, dataset_id): """ Returns an iterator over the RnaQuantificationSet objects from the server """ request = protocol.SearchRnaQuantificationSetsRequest() request.dataset_id = dataset_id request.page_size = pb.int(self._page_si...
python
def search_rna_quantification_sets(self, dataset_id): """ Returns an iterator over the RnaQuantificationSet objects from the server """ request = protocol.SearchRnaQuantificationSetsRequest() request.dataset_id = dataset_id request.page_size = pb.int(self._page_si...
[ "def", "search_rna_quantification_sets", "(", "self", ",", "dataset_id", ")", ":", "request", "=", "protocol", ".", "SearchRnaQuantificationSetsRequest", "(", ")", "request", ".", "dataset_id", "=", "dataset_id", "request", ".", "page_size", "=", "pb", ".", "int",...
Returns an iterator over the RnaQuantificationSet objects from the server
[ "Returns", "an", "iterator", "over", "the", "RnaQuantificationSet", "objects", "from", "the", "server" ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L802-L812
53,110
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_rna_quantifications
def search_rna_quantifications(self, rna_quantification_set_id=""): """ Returns an iterator over the RnaQuantification objects from the server :param str rna_quantification_set_id: The ID of the :class:`ga4gh.protocol.RnaQuantificationSet` of interest. """ request = ...
python
def search_rna_quantifications(self, rna_quantification_set_id=""): """ Returns an iterator over the RnaQuantification objects from the server :param str rna_quantification_set_id: The ID of the :class:`ga4gh.protocol.RnaQuantificationSet` of interest. """ request = ...
[ "def", "search_rna_quantifications", "(", "self", ",", "rna_quantification_set_id", "=", "\"\"", ")", ":", "request", "=", "protocol", ".", "SearchRnaQuantificationsRequest", "(", ")", "request", ".", "rna_quantification_set_id", "=", "rna_quantification_set_id", "request...
Returns an iterator over the RnaQuantification objects from the server :param str rna_quantification_set_id: The ID of the :class:`ga4gh.protocol.RnaQuantificationSet` of interest.
[ "Returns", "an", "iterator", "over", "the", "RnaQuantification", "objects", "from", "the", "server" ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L814-L826
53,111
ga4gh/ga4gh-client
ga4gh/client/client.py
AbstractClient.search_expression_levels
def search_expression_levels( self, rna_quantification_id="", names=[], threshold=0.0): """ Returns an iterator over the ExpressionLevel objects from the server :param str feature_ids: The IDs of the :class:`ga4gh.protocol.Feature` of interest. :param str rna_qua...
python
def search_expression_levels( self, rna_quantification_id="", names=[], threshold=0.0): """ Returns an iterator over the ExpressionLevel objects from the server :param str feature_ids: The IDs of the :class:`ga4gh.protocol.Feature` of interest. :param str rna_qua...
[ "def", "search_expression_levels", "(", "self", ",", "rna_quantification_id", "=", "\"\"", ",", "names", "=", "[", "]", ",", "threshold", "=", "0.0", ")", ":", "request", "=", "protocol", ".", "SearchExpressionLevelsRequest", "(", ")", "request", ".", "rna_qua...
Returns an iterator over the ExpressionLevel objects from the server :param str feature_ids: The IDs of the :class:`ga4gh.protocol.Feature` of interest. :param str rna_quantification_id: The ID of the :class:`ga4gh.protocol.RnaQuantification` of interest. :param float th...
[ "Returns", "an", "iterator", "over", "the", "ExpressionLevel", "objects", "from", "the", "server" ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L828-L846
53,112
ga4gh/ga4gh-client
ga4gh/client/client.py
HttpClient._setup_http_session
def _setup_http_session(self): """ Sets up the common HTTP session parameters used by requests. """ headers = {"Content-type": "application/json"} if (self._id_token): headers.update({"authorization": "Bearer {}".format( self._id_token)}) self....
python
def _setup_http_session(self): """ Sets up the common HTTP session parameters used by requests. """ headers = {"Content-type": "application/json"} if (self._id_token): headers.update({"authorization": "Bearer {}".format( self._id_token)}) self....
[ "def", "_setup_http_session", "(", "self", ")", ":", "headers", "=", "{", "\"Content-type\"", ":", "\"application/json\"", "}", "if", "(", "self", ".", "_id_token", ")", ":", "headers", ".", "update", "(", "{", "\"authorization\"", ":", "\"Bearer {}\"", ".", ...
Sets up the common HTTP session parameters used by requests.
[ "Sets", "up", "the", "common", "HTTP", "session", "parameters", "used", "by", "requests", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L881-L891
53,113
ga4gh/ga4gh-client
ga4gh/client/client.py
HttpClient._check_response_status
def _check_response_status(self, response): """ Checks the speficied HTTP response from the requests package and raises an exception if a non-200 HTTP code was returned by the server. """ if response.status_code != requests.codes.ok: self._logger.error("%s %s"...
python
def _check_response_status(self, response): """ Checks the speficied HTTP response from the requests package and raises an exception if a non-200 HTTP code was returned by the server. """ if response.status_code != requests.codes.ok: self._logger.error("%s %s"...
[ "def", "_check_response_status", "(", "self", ",", "response", ")", ":", "if", "response", ".", "status_code", "!=", "requests", ".", "codes", ".", "ok", ":", "self", ".", "_logger", ".", "error", "(", "\"%s %s\"", ",", "response", ".", "status_code", ",",...
Checks the speficied HTTP response from the requests package and raises an exception if a non-200 HTTP code was returned by the server.
[ "Checks", "the", "speficied", "HTTP", "response", "from", "the", "requests", "package", "and", "raises", "an", "exception", "if", "a", "non", "-", "200", "HTTP", "code", "was", "returned", "by", "the", "server", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/client.py#L893-L903
53,114
Tethik/flask-session-captcha
flask_session_captcha/__init__.py
FlaskSessionCaptcha.init_app
def init_app(self, app): """ Initialize the captcha extension to the given app object. """ self.enabled = app.config.get("CAPTCHA_ENABLE", True) self.digits = app.config.get("CAPTCHA_LENGTH", 4) self.max = 10**self.digits self.image_generator = ImageCaptcha() ...
python
def init_app(self, app): """ Initialize the captcha extension to the given app object. """ self.enabled = app.config.get("CAPTCHA_ENABLE", True) self.digits = app.config.get("CAPTCHA_LENGTH", 4) self.max = 10**self.digits self.image_generator = ImageCaptcha() ...
[ "def", "init_app", "(", "self", ",", "app", ")", ":", "self", ".", "enabled", "=", "app", ".", "config", ".", "get", "(", "\"CAPTCHA_ENABLE\"", ",", "True", ")", "self", ".", "digits", "=", "app", ".", "config", ".", "get", "(", "\"CAPTCHA_LENGTH\"", ...
Initialize the captcha extension to the given app object.
[ "Initialize", "the", "captcha", "extension", "to", "the", "given", "app", "object", "." ]
02bb68b9563ecc4967650b49b4c8447fecbc92d6
https://github.com/Tethik/flask-session-captcha/blob/02bb68b9563ecc4967650b49b4c8447fecbc92d6/flask_session_captcha/__init__.py#L14-L40
53,115
polymeris/python-monit
monit.py
Monit.update
def update(self): """ Update Monit deamon and services status. """ url = self.baseurl + '/_status?format=xml' response = self.s.get(url) response.raise_for_status() from xml.etree.ElementTree import XML root = XML(response.text) for serv_el in root...
python
def update(self): """ Update Monit deamon and services status. """ url = self.baseurl + '/_status?format=xml' response = self.s.get(url) response.raise_for_status() from xml.etree.ElementTree import XML root = XML(response.text) for serv_el in root...
[ "def", "update", "(", "self", ")", ":", "url", "=", "self", ".", "baseurl", "+", "'/_status?format=xml'", "response", "=", "self", ".", "s", ".", "get", "(", "url", ")", "response", ".", "raise_for_status", "(", ")", "from", "xml", ".", "etree", ".", ...
Update Monit deamon and services status.
[ "Update", "Monit", "deamon", "and", "services", "status", "." ]
8915dc96a5fa1f44f037efbb01a6a9899fca7f6e
https://github.com/polymeris/python-monit/blob/8915dc96a5fa1f44f037efbb01a6a9899fca7f6e/monit.py#L36-L55
53,116
kimvais/ike
ike/protocol.py
IKE.init_recv
def init_recv(self): """ Parses the IKE_INIT response packet received from Responder. Assigns the correct values of rSPI and Nr Calculates Diffie-Hellman exchange and assigns all keys to self. """ assert len(self.packets) == 2 packet = self.packets[-1] f...
python
def init_recv(self): """ Parses the IKE_INIT response packet received from Responder. Assigns the correct values of rSPI and Nr Calculates Diffie-Hellman exchange and assigns all keys to self. """ assert len(self.packets) == 2 packet = self.packets[-1] f...
[ "def", "init_recv", "(", "self", ")", ":", "assert", "len", "(", "self", ".", "packets", ")", "==", "2", "packet", "=", "self", ".", "packets", "[", "-", "1", "]", "for", "p", "in", "packet", ".", "payloads", ":", "if", "p", ".", "_type", "==", ...
Parses the IKE_INIT response packet received from Responder. Assigns the correct values of rSPI and Nr Calculates Diffie-Hellman exchange and assigns all keys to self.
[ "Parses", "the", "IKE_INIT", "response", "packet", "received", "from", "Responder", "." ]
4a5622c878a43a3d3cc19c54aa7cc7be29318eae
https://github.com/kimvais/ike/blob/4a5622c878a43a3d3cc19c54aa7cc7be29318eae/ike/protocol.py#L130-L173
53,117
kimvais/ike
ike/protocol.py
IKE.authenticate_peer
def authenticate_peer(self, auth_data, peer_id, message): """ Verifies the peers authentication. """ logger.debug('message: {}'.format(dump(message))) signed_octets = message + self.Ni + prf(self.SK_pr, peer_id._data) auth_type = const.AuthenticationType(struct.unpack(con...
python
def authenticate_peer(self, auth_data, peer_id, message): """ Verifies the peers authentication. """ logger.debug('message: {}'.format(dump(message))) signed_octets = message + self.Ni + prf(self.SK_pr, peer_id._data) auth_type = const.AuthenticationType(struct.unpack(con...
[ "def", "authenticate_peer", "(", "self", ",", "auth_data", ",", "peer_id", ",", "message", ")", ":", "logger", ".", "debug", "(", "'message: {}'", ".", "format", "(", "dump", "(", "message", ")", ")", ")", "signed_octets", "=", "message", "+", "self", "....
Verifies the peers authentication.
[ "Verifies", "the", "peers", "authentication", "." ]
4a5622c878a43a3d3cc19c54aa7cc7be29318eae
https://github.com/kimvais/ike/blob/4a5622c878a43a3d3cc19c54aa7cc7be29318eae/ike/protocol.py#L175-L187
53,118
kimvais/ike
ike/protocol.py
IKE.auth_recv
def auth_recv(self): """ Handle peer's IKE_AUTH response. """ id_r = auth_data = None for p in self.packets[-1].payloads: if p._type == payloads.Type.IDr: id_r = p logger.debug('Got responder ID: {}'.format(dump(bytes(p)))) ...
python
def auth_recv(self): """ Handle peer's IKE_AUTH response. """ id_r = auth_data = None for p in self.packets[-1].payloads: if p._type == payloads.Type.IDr: id_r = p logger.debug('Got responder ID: {}'.format(dump(bytes(p)))) ...
[ "def", "auth_recv", "(", "self", ")", ":", "id_r", "=", "auth_data", "=", "None", "for", "p", "in", "self", ".", "packets", "[", "-", "1", "]", ".", "payloads", ":", "if", "p", ".", "_type", "==", "payloads", ".", "Type", ".", "IDr", ":", "id_r",...
Handle peer's IKE_AUTH response.
[ "Handle", "peer", "s", "IKE_AUTH", "response", "." ]
4a5622c878a43a3d3cc19c54aa7cc7be29318eae
https://github.com/kimvais/ike/blob/4a5622c878a43a3d3cc19c54aa7cc7be29318eae/ike/protocol.py#L213-L242
53,119
kimvais/ike
ike/protocol.py
Packet.add_payload
def add_payload(self, payload): """ Adds a payload to packet, updating last payload's next_payload field """ if self.payloads: self.payloads[-1].next_payload = payload._type self.payloads.append(payload)
python
def add_payload(self, payload): """ Adds a payload to packet, updating last payload's next_payload field """ if self.payloads: self.payloads[-1].next_payload = payload._type self.payloads.append(payload)
[ "def", "add_payload", "(", "self", ",", "payload", ")", ":", "if", "self", ".", "payloads", ":", "self", ".", "payloads", "[", "-", "1", "]", ".", "next_payload", "=", "payload", ".", "_type", "self", ".", "payloads", ".", "append", "(", "payload", "...
Adds a payload to packet, updating last payload's next_payload field
[ "Adds", "a", "payload", "to", "packet", "updating", "last", "payload", "s", "next_payload", "field" ]
4a5622c878a43a3d3cc19c54aa7cc7be29318eae
https://github.com/kimvais/ike/blob/4a5622c878a43a3d3cc19c54aa7cc7be29318eae/ike/protocol.py#L382-L388
53,120
eddieantonio/sentinel
sentinel.py
get_caller_module
def get_caller_module(): """ Returns the name of the caller's module as a string. >>> get_caller_module() '__main__' """ stack = inspect.stack() assert len(stack) > 1 caller = stack[2][0] return caller.f_globals['__name__']
python
def get_caller_module(): """ Returns the name of the caller's module as a string. >>> get_caller_module() '__main__' """ stack = inspect.stack() assert len(stack) > 1 caller = stack[2][0] return caller.f_globals['__name__']
[ "def", "get_caller_module", "(", ")", ":", "stack", "=", "inspect", ".", "stack", "(", ")", "assert", "len", "(", "stack", ")", ">", "1", "caller", "=", "stack", "[", "2", "]", "[", "0", "]", "return", "caller", ".", "f_globals", "[", "'__name__'", ...
Returns the name of the caller's module as a string. >>> get_caller_module() '__main__'
[ "Returns", "the", "name", "of", "the", "caller", "s", "module", "as", "a", "string", "." ]
56fa1ca3faa6e7634d5130bf19956a8b3234b083
https://github.com/eddieantonio/sentinel/blob/56fa1ca3faa6e7634d5130bf19956a8b3234b083/sentinel.py#L16-L26
53,121
ondergetekende/python-panavatar
panavatar/parameters.py
RandomParameters.uniform
def uniform(self, key, min_value=0., max_value=1.): """Returns a random number between min_value and max_value""" return min_value + self._random(key) * (max_value - min_value)
python
def uniform(self, key, min_value=0., max_value=1.): """Returns a random number between min_value and max_value""" return min_value + self._random(key) * (max_value - min_value)
[ "def", "uniform", "(", "self", ",", "key", ",", "min_value", "=", "0.", ",", "max_value", "=", "1.", ")", ":", "return", "min_value", "+", "self", ".", "_random", "(", "key", ")", "*", "(", "max_value", "-", "min_value", ")" ]
Returns a random number between min_value and max_value
[ "Returns", "a", "random", "number", "between", "min_value", "and", "max_value" ]
d89d952db27ddd196ac66aafa89cb80dbcd40ca6
https://github.com/ondergetekende/python-panavatar/blob/d89d952db27ddd196ac66aafa89cb80dbcd40ca6/panavatar/parameters.py#L63-L65
53,122
ondergetekende/python-panavatar
panavatar/parameters.py
RandomParameters.perlin
def perlin(self, key, **kwargs): """Return perlin noise seede with the specified key. For parameters, check the PerlinNoise class.""" if hasattr(key, "encode"): key = key.encode('ascii') value = zlib.adler32(key, self.seed) return PerlinNoise(value, **kwargs)
python
def perlin(self, key, **kwargs): """Return perlin noise seede with the specified key. For parameters, check the PerlinNoise class.""" if hasattr(key, "encode"): key = key.encode('ascii') value = zlib.adler32(key, self.seed) return PerlinNoise(value, **kwargs)
[ "def", "perlin", "(", "self", ",", "key", ",", "*", "*", "kwargs", ")", ":", "if", "hasattr", "(", "key", ",", "\"encode\"", ")", ":", "key", "=", "key", ".", "encode", "(", "'ascii'", ")", "value", "=", "zlib", ".", "adler32", "(", "key", ",", ...
Return perlin noise seede with the specified key. For parameters, check the PerlinNoise class.
[ "Return", "perlin", "noise", "seede", "with", "the", "specified", "key", ".", "For", "parameters", "check", "the", "PerlinNoise", "class", "." ]
d89d952db27ddd196ac66aafa89cb80dbcd40ca6
https://github.com/ondergetekende/python-panavatar/blob/d89d952db27ddd196ac66aafa89cb80dbcd40ca6/panavatar/parameters.py#L95-L103
53,123
ResilienceTesting/gremlinsdk-python
python/pygremlin/assertionchecker.py
AssertionChecker.check_no_proxy_errors
def check_no_proxy_errors(self, **kwargs): """ Helper method to determine if the proxies logged any major errors related to the functioning of the proxy itself """ data = self._es.search(body={ "size": max_query_results, "query": { "filtered": { ...
python
def check_no_proxy_errors(self, **kwargs): """ Helper method to determine if the proxies logged any major errors related to the functioning of the proxy itself """ data = self._es.search(body={ "size": max_query_results, "query": { "filtered": { ...
[ "def", "check_no_proxy_errors", "(", "self", ",", "*", "*", "kwargs", ")", ":", "data", "=", "self", ".", "_es", ".", "search", "(", "body", "=", "{", "\"size\"", ":", "max_query_results", ",", "\"query\"", ":", "{", "\"filtered\"", ":", "{", "\"query\""...
Helper method to determine if the proxies logged any major errors related to the functioning of the proxy itself
[ "Helper", "method", "to", "determine", "if", "the", "proxies", "logged", "any", "major", "errors", "related", "to", "the", "functioning", "of", "the", "proxy", "itself" ]
c5cc439ea1c0d6a98ff88f5604bf739f3c48d1e6
https://github.com/ResilienceTesting/gremlinsdk-python/blob/c5cc439ea1c0d6a98ff88f5604bf739f3c48d1e6/python/pygremlin/assertionchecker.py#L121-L142
53,124
ResilienceTesting/gremlinsdk-python
python/pygremlin/assertionchecker.py
AssertionChecker.get_requests_with_errors
def get_requests_with_errors(self): """ Helper method to determine if proxies logged any error related to the requests passing through""" data = self._es.search(body={ "size": max_query_results, "query": { "filtered": { "query": { ...
python
def get_requests_with_errors(self): """ Helper method to determine if proxies logged any error related to the requests passing through""" data = self._es.search(body={ "size": max_query_results, "query": { "filtered": { "query": { ...
[ "def", "get_requests_with_errors", "(", "self", ")", ":", "data", "=", "self", ".", "_es", ".", "search", "(", "body", "=", "{", "\"size\"", ":", "max_query_results", ",", "\"query\"", ":", "{", "\"filtered\"", ":", "{", "\"query\"", ":", "{", "\"match_all...
Helper method to determine if proxies logged any error related to the requests passing through
[ "Helper", "method", "to", "determine", "if", "proxies", "logged", "any", "error", "related", "to", "the", "requests", "passing", "through" ]
c5cc439ea1c0d6a98ff88f5604bf739f3c48d1e6
https://github.com/ResilienceTesting/gremlinsdk-python/blob/c5cc439ea1c0d6a98ff88f5604bf739f3c48d1e6/python/pygremlin/assertionchecker.py#L145-L162
53,125
ResilienceTesting/gremlinsdk-python
python/pygremlin/assertionchecker.py
AssertionChecker.check_assertions
def check_assertions(self, checklist, all=False): """Check a set of assertions @param all boolean if False, stop at first failure @return: False if any assertion fails. """ assert isinstance(checklist, dict) and 'checks' in checklist retval = None retlist = [] ...
python
def check_assertions(self, checklist, all=False): """Check a set of assertions @param all boolean if False, stop at first failure @return: False if any assertion fails. """ assert isinstance(checklist, dict) and 'checks' in checklist retval = None retlist = [] ...
[ "def", "check_assertions", "(", "self", ",", "checklist", ",", "all", "=", "False", ")", ":", "assert", "isinstance", "(", "checklist", ",", "dict", ")", "and", "'checks'", "in", "checklist", "retval", "=", "None", "retlist", "=", "[", "]", "for", "asser...
Check a set of assertions @param all boolean if False, stop at first failure @return: False if any assertion fails.
[ "Check", "a", "set", "of", "assertions" ]
c5cc439ea1c0d6a98ff88f5604bf739f3c48d1e6
https://github.com/ResilienceTesting/gremlinsdk-python/blob/c5cc439ea1c0d6a98ff88f5604bf739f3c48d1e6/python/pygremlin/assertionchecker.py#L742-L760
53,126
scivision/astrometry_azel
astrometry_azel/__init__.py
download
def download(odir: Path, source_url: str, irng: Sequence[int]): """Download star index files. The default range was useful for my cameras. """ assert len(irng) == 2, 'specify start, stop indices' odir = Path(odir).expanduser() odir.mkdir(parents=True, exist_ok=True) ri = int(source_url.spl...
python
def download(odir: Path, source_url: str, irng: Sequence[int]): """Download star index files. The default range was useful for my cameras. """ assert len(irng) == 2, 'specify start, stop indices' odir = Path(odir).expanduser() odir.mkdir(parents=True, exist_ok=True) ri = int(source_url.spl...
[ "def", "download", "(", "odir", ":", "Path", ",", "source_url", ":", "str", ",", "irng", ":", "Sequence", "[", "int", "]", ")", ":", "assert", "len", "(", "irng", ")", "==", "2", ",", "'specify start, stop indices'", "odir", "=", "Path", "(", "odir", ...
Download star index files. The default range was useful for my cameras.
[ "Download", "star", "index", "files", ".", "The", "default", "range", "was", "useful", "for", "my", "cameras", "." ]
b7232ff9b53528feae8e9a15b226aaeda4d425d2
https://github.com/scivision/astrometry_azel/blob/b7232ff9b53528feae8e9a15b226aaeda4d425d2/astrometry_azel/__init__.py#L41-L61
53,127
michigan-com/linkGrabber
linkGrabber/__init__.py
exclude_match
def exclude_match(exclude, link_value): """ Check excluded value against the link's current value """ if hasattr(exclude, "search") and exclude.search(link_value): return True if exclude == link_value: return True return False
python
def exclude_match(exclude, link_value): """ Check excluded value against the link's current value """ if hasattr(exclude, "search") and exclude.search(link_value): return True if exclude == link_value: return True return False
[ "def", "exclude_match", "(", "exclude", ",", "link_value", ")", ":", "if", "hasattr", "(", "exclude", ",", "\"search\"", ")", "and", "exclude", ".", "search", "(", "link_value", ")", ":", "return", "True", "if", "exclude", "==", "link_value", ":", "return"...
Check excluded value against the link's current value
[ "Check", "excluded", "value", "against", "the", "link", "s", "current", "value" ]
f5295a2dd357d63d38d6ad6090da3904a580d8ce
https://github.com/michigan-com/linkGrabber/blob/f5295a2dd357d63d38d6ad6090da3904a580d8ce/linkGrabber/__init__.py#L132-L140
53,128
michigan-com/linkGrabber
linkGrabber/__init__.py
seoify_hyperlink
def seoify_hyperlink(hyperlink): """Modify a hyperlink to make it SEO-friendly by replacing hyphens with spaces and trimming multiple spaces. :param hyperlink: URL to attempt to grab SEO from """ last_slash = hyperlink.rfind('/') return re.sub(r' +|-', ' ', hyperlink[last_slash + 1:])
python
def seoify_hyperlink(hyperlink): """Modify a hyperlink to make it SEO-friendly by replacing hyphens with spaces and trimming multiple spaces. :param hyperlink: URL to attempt to grab SEO from """ last_slash = hyperlink.rfind('/') return re.sub(r' +|-', ' ', hyperlink[last_slash + 1:])
[ "def", "seoify_hyperlink", "(", "hyperlink", ")", ":", "last_slash", "=", "hyperlink", ".", "rfind", "(", "'/'", ")", "return", "re", ".", "sub", "(", "r' +|-'", ",", "' '", ",", "hyperlink", "[", "last_slash", "+", "1", ":", "]", ")" ]
Modify a hyperlink to make it SEO-friendly by replacing hyphens with spaces and trimming multiple spaces. :param hyperlink: URL to attempt to grab SEO from
[ "Modify", "a", "hyperlink", "to", "make", "it", "SEO", "-", "friendly", "by", "replacing", "hyphens", "with", "spaces", "and", "trimming", "multiple", "spaces", "." ]
f5295a2dd357d63d38d6ad6090da3904a580d8ce
https://github.com/michigan-com/linkGrabber/blob/f5295a2dd357d63d38d6ad6090da3904a580d8ce/linkGrabber/__init__.py#L143-L149
53,129
michigan-com/linkGrabber
linkGrabber/__init__.py
Links.find
def find(self, limit=None, reverse=False, sort=None, exclude=None, duplicates=True, pretty=False, **filters): """ Using filters and sorts, this finds all hyperlinks on a web page :param limit: Crop results down to limit specified :param reverse: Reverse the list of links, u...
python
def find(self, limit=None, reverse=False, sort=None, exclude=None, duplicates=True, pretty=False, **filters): """ Using filters and sorts, this finds all hyperlinks on a web page :param limit: Crop results down to limit specified :param reverse: Reverse the list of links, u...
[ "def", "find", "(", "self", ",", "limit", "=", "None", ",", "reverse", "=", "False", ",", "sort", "=", "None", ",", "exclude", "=", "None", ",", "duplicates", "=", "True", ",", "pretty", "=", "False", ",", "*", "*", "filters", ")", ":", "if", "ex...
Using filters and sorts, this finds all hyperlinks on a web page :param limit: Crop results down to limit specified :param reverse: Reverse the list of links, useful for before limiting :param exclude: Remove links from list :param duplicates: Determines if identical URLs should...
[ "Using", "filters", "and", "sorts", "this", "finds", "all", "hyperlinks", "on", "a", "web", "page" ]
f5295a2dd357d63d38d6ad6090da3904a580d8ce
https://github.com/michigan-com/linkGrabber/blob/f5295a2dd357d63d38d6ad6090da3904a580d8ce/linkGrabber/__init__.py#L66-L129
53,130
scivision/astrometry_azel
PlotOverlay.py
add_plot
def add_plot(fn: Path, cm, ax, alpha=1): """Astrometry.net makes file ".new" with the image and the WCS SIP 2-D polynomial fit coefficients in the FITS header We use DECL as "x" and RA as "y". pcolormesh() is used as it handles arbitrary pixel shapes. Note that pcolormesh() cannot tolerate NaN in X or ...
python
def add_plot(fn: Path, cm, ax, alpha=1): """Astrometry.net makes file ".new" with the image and the WCS SIP 2-D polynomial fit coefficients in the FITS header We use DECL as "x" and RA as "y". pcolormesh() is used as it handles arbitrary pixel shapes. Note that pcolormesh() cannot tolerate NaN in X or ...
[ "def", "add_plot", "(", "fn", ":", "Path", ",", "cm", ",", "ax", ",", "alpha", "=", "1", ")", ":", "with", "fits", ".", "open", "(", "fn", ",", "mode", "=", "'readonly'", ",", "memmap", "=", "False", ")", "as", "f", ":", "img", "=", "f", "[",...
Astrometry.net makes file ".new" with the image and the WCS SIP 2-D polynomial fit coefficients in the FITS header We use DECL as "x" and RA as "y". pcolormesh() is used as it handles arbitrary pixel shapes. Note that pcolormesh() cannot tolerate NaN in X or Y (NaN in C is OK). This is handled in https...
[ "Astrometry", ".", "net", "makes", "file", ".", "new", "with", "the", "image", "and", "the", "WCS", "SIP", "2", "-", "D", "polynomial", "fit", "coefficients", "in", "the", "FITS", "header" ]
b7232ff9b53528feae8e9a15b226aaeda4d425d2
https://github.com/scivision/astrometry_azel/blob/b7232ff9b53528feae8e9a15b226aaeda4d425d2/PlotOverlay.py#L48-L72
53,131
kimvais/ike
ike/util/dump.py
dump
def dump(src): """ Returns data in hex format in groups of 4 octets delimited by spaces for debugging purposes. """ return b' '.join(binascii.hexlify(bytes(x)) for x in zip(src[::4], src[1::4], src[2::4], src[3::4]))
python
def dump(src): """ Returns data in hex format in groups of 4 octets delimited by spaces for debugging purposes. """ return b' '.join(binascii.hexlify(bytes(x)) for x in zip(src[::4], src[1::4], src[2::4], src[3::4]))
[ "def", "dump", "(", "src", ")", ":", "return", "b' '", ".", "join", "(", "binascii", ".", "hexlify", "(", "bytes", "(", "x", ")", ")", "for", "x", "in", "zip", "(", "src", "[", ":", ":", "4", "]", ",", "src", "[", "1", ":", ":", "4", "]", ...
Returns data in hex format in groups of 4 octets delimited by spaces for debugging purposes.
[ "Returns", "data", "in", "hex", "format", "in", "groups", "of", "4", "octets", "delimited", "by", "spaces", "for", "debugging", "purposes", "." ]
4a5622c878a43a3d3cc19c54aa7cc7be29318eae
https://github.com/kimvais/ike/blob/4a5622c878a43a3d3cc19c54aa7cc7be29318eae/ike/util/dump.py#L3-L7
53,132
ResilienceTesting/gremlinsdk-python
exampleapp/productpage/productpage-v1.py
index
def index(): """ Display productpage with normal user and test user buttons""" global productpage table = json2html.convert(json = json.dumps(productpage), table_attributes="class=\"table table-condensed table-bordered table-hover\"") return render_template('index.html', ...
python
def index(): """ Display productpage with normal user and test user buttons""" global productpage table = json2html.convert(json = json.dumps(productpage), table_attributes="class=\"table table-condensed table-bordered table-hover\"") return render_template('index.html', ...
[ "def", "index", "(", ")", ":", "global", "productpage", "table", "=", "json2html", ".", "convert", "(", "json", "=", "json", ".", "dumps", "(", "productpage", ")", ",", "table_attributes", "=", "\"class=\\\"table table-condensed table-bordered table-hover\\\"\"", ")...
Display productpage with normal user and test user buttons
[ "Display", "productpage", "with", "normal", "user", "and", "test", "user", "buttons" ]
c5cc439ea1c0d6a98ff88f5604bf739f3c48d1e6
https://github.com/ResilienceTesting/gremlinsdk-python/blob/c5cc439ea1c0d6a98ff88f5604bf739f3c48d1e6/exampleapp/productpage/productpage-v1.py#L70-L77
53,133
ondergetekende/python-panavatar
panavatar/patterns.py
frange
def frange(start, end, step): """A range implementation which can handle floats""" if start <= end: step = abs(step) else: step = -abs(step) while start < end: yield start start += step
python
def frange(start, end, step): """A range implementation which can handle floats""" if start <= end: step = abs(step) else: step = -abs(step) while start < end: yield start start += step
[ "def", "frange", "(", "start", ",", "end", ",", "step", ")", ":", "if", "start", "<=", "end", ":", "step", "=", "abs", "(", "step", ")", "else", ":", "step", "=", "-", "abs", "(", "step", ")", "while", "start", "<", "end", ":", "yield", "start"...
A range implementation which can handle floats
[ "A", "range", "implementation", "which", "can", "handle", "floats" ]
d89d952db27ddd196ac66aafa89cb80dbcd40ca6
https://github.com/ondergetekende/python-panavatar/blob/d89d952db27ddd196ac66aafa89cb80dbcd40ca6/panavatar/patterns.py#L9-L18
53,134
ondergetekende/python-panavatar
panavatar/patterns.py
gridrange
def gridrange(start, end, step): """Generate a grid of complex numbers""" for x in frange(start.real, end.real, step.real): for y in frange(start.imag, end.imag, step.imag): yield x + y * 1j
python
def gridrange(start, end, step): """Generate a grid of complex numbers""" for x in frange(start.real, end.real, step.real): for y in frange(start.imag, end.imag, step.imag): yield x + y * 1j
[ "def", "gridrange", "(", "start", ",", "end", ",", "step", ")", ":", "for", "x", "in", "frange", "(", "start", ".", "real", ",", "end", ".", "real", ",", "step", ".", "real", ")", ":", "for", "y", "in", "frange", "(", "start", ".", "imag", ",",...
Generate a grid of complex numbers
[ "Generate", "a", "grid", "of", "complex", "numbers" ]
d89d952db27ddd196ac66aafa89cb80dbcd40ca6
https://github.com/ondergetekende/python-panavatar/blob/d89d952db27ddd196ac66aafa89cb80dbcd40ca6/panavatar/patterns.py#L21-L25
53,135
kimvais/ike
ike/util/cipher.py
pad
def pad(data, blocksize=16): """ Pads data to blocksize according to RFC 4303. Pad length field is included in output. """ padlen = blocksize - len(data) % blocksize return bytes(data + bytearray(range(1, padlen)) + bytearray((padlen - 1,)))
python
def pad(data, blocksize=16): """ Pads data to blocksize according to RFC 4303. Pad length field is included in output. """ padlen = blocksize - len(data) % blocksize return bytes(data + bytearray(range(1, padlen)) + bytearray((padlen - 1,)))
[ "def", "pad", "(", "data", ",", "blocksize", "=", "16", ")", ":", "padlen", "=", "blocksize", "-", "len", "(", "data", ")", "%", "blocksize", "return", "bytes", "(", "data", "+", "bytearray", "(", "range", "(", "1", ",", "padlen", ")", ")", "+", ...
Pads data to blocksize according to RFC 4303. Pad length field is included in output.
[ "Pads", "data", "to", "blocksize", "according", "to", "RFC", "4303", ".", "Pad", "length", "field", "is", "included", "in", "output", "." ]
4a5622c878a43a3d3cc19c54aa7cc7be29318eae
https://github.com/kimvais/ike/blob/4a5622c878a43a3d3cc19c54aa7cc7be29318eae/ike/util/cipher.py#L14-L19
53,136
scivision/astrometry_azel
astrometry_azel/base.py
doSolve
def doSolve(fitsfn: Path, args: str=None): """ Astrometry.net from at least version 0.67 is OK with Python 3. """ # binpath = Path(find_executable('solve-field')).parent opts = args.split(' ') if args else [] # %% build command cmd = ['solve-field', '--overwrite', str(fitsfn)] cmd += opts ...
python
def doSolve(fitsfn: Path, args: str=None): """ Astrometry.net from at least version 0.67 is OK with Python 3. """ # binpath = Path(find_executable('solve-field')).parent opts = args.split(' ') if args else [] # %% build command cmd = ['solve-field', '--overwrite', str(fitsfn)] cmd += opts ...
[ "def", "doSolve", "(", "fitsfn", ":", "Path", ",", "args", ":", "str", "=", "None", ")", ":", "# binpath = Path(find_executable('solve-field')).parent", "opts", "=", "args", ".", "split", "(", "' '", ")", "if", "args", "else", "[", "]", "# %% build command", ...
Astrometry.net from at least version 0.67 is OK with Python 3.
[ "Astrometry", ".", "net", "from", "at", "least", "version", "0", ".", "67", "is", "OK", "with", "Python", "3", "." ]
b7232ff9b53528feae8e9a15b226aaeda4d425d2
https://github.com/scivision/astrometry_azel/blob/b7232ff9b53528feae8e9a15b226aaeda4d425d2/astrometry_azel/base.py#L92-L110
53,137
ondergetekende/python-panavatar
panavatar/color_scheme.py
to_rgb
def to_rgb(hsv): """Converts a color from HSV to a hex RGB. HSV should be in range 0..1, though hue wraps around. Output is a hexadecimal color value as used by CSS, HTML and SVG""" r, g, b = [int(min(255, max(0, component * 256))) for component in colorsys.hsv_to_rgb(*hsv)] return...
python
def to_rgb(hsv): """Converts a color from HSV to a hex RGB. HSV should be in range 0..1, though hue wraps around. Output is a hexadecimal color value as used by CSS, HTML and SVG""" r, g, b = [int(min(255, max(0, component * 256))) for component in colorsys.hsv_to_rgb(*hsv)] return...
[ "def", "to_rgb", "(", "hsv", ")", ":", "r", ",", "g", ",", "b", "=", "[", "int", "(", "min", "(", "255", ",", "max", "(", "0", ",", "component", "*", "256", ")", ")", ")", "for", "component", "in", "colorsys", ".", "hsv_to_rgb", "(", "*", "hs...
Converts a color from HSV to a hex RGB. HSV should be in range 0..1, though hue wraps around. Output is a hexadecimal color value as used by CSS, HTML and SVG
[ "Converts", "a", "color", "from", "HSV", "to", "a", "hex", "RGB", "." ]
d89d952db27ddd196ac66aafa89cb80dbcd40ca6
https://github.com/ondergetekende/python-panavatar/blob/d89d952db27ddd196ac66aafa89cb80dbcd40ca6/panavatar/color_scheme.py#L4-L12
53,138
ga4gh/ga4gh-client
ga4gh/client/cli.py
verbosityToLogLevel
def verbosityToLogLevel(verbosity): """ Returns the specfied verbosity level interpreted as a logging level. """ ret = 0 if verbosity == 1: ret = logging.INFO elif verbosity >= 2: ret = logging.DEBUG return ret
python
def verbosityToLogLevel(verbosity): """ Returns the specfied verbosity level interpreted as a logging level. """ ret = 0 if verbosity == 1: ret = logging.INFO elif verbosity >= 2: ret = logging.DEBUG return ret
[ "def", "verbosityToLogLevel", "(", "verbosity", ")", ":", "ret", "=", "0", "if", "verbosity", "==", "1", ":", "ret", "=", "logging", ".", "INFO", "elif", "verbosity", ">=", "2", ":", "ret", "=", "logging", ".", "DEBUG", "return", "ret" ]
Returns the specfied verbosity level interpreted as a logging level.
[ "Returns", "the", "specfied", "verbosity", "level", "interpreted", "as", "a", "logging", "level", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L48-L57
53,139
ga4gh/ga4gh-client
ga4gh/client/cli.py
addVariantSearchOptions
def addVariantSearchOptions(parser): """ Adds common options to a variant searches command line parser. """ addVariantSetIdArgument(parser) addReferenceNameArgument(parser) addCallSetIdsArgument(parser) addStartArgument(parser) addEndArgument(parser) addPageSizeArgument(parser)
python
def addVariantSearchOptions(parser): """ Adds common options to a variant searches command line parser. """ addVariantSetIdArgument(parser) addReferenceNameArgument(parser) addCallSetIdsArgument(parser) addStartArgument(parser) addEndArgument(parser) addPageSizeArgument(parser)
[ "def", "addVariantSearchOptions", "(", "parser", ")", ":", "addVariantSetIdArgument", "(", "parser", ")", "addReferenceNameArgument", "(", "parser", ")", "addCallSetIdsArgument", "(", "parser", ")", "addStartArgument", "(", "parser", ")", "addEndArgument", "(", "parse...
Adds common options to a variant searches command line parser.
[ "Adds", "common", "options", "to", "a", "variant", "searches", "command", "line", "parser", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L1077-L1086
53,140
ga4gh/ga4gh-client
ga4gh/client/cli.py
addAnnotationsSearchOptions
def addAnnotationsSearchOptions(parser): """ Adds common options to a annotation searches command line parser. """ addAnnotationSetIdArgument(parser) addReferenceNameArgument(parser) addReferenceIdArgument(parser) addStartArgument(parser) addEndArgument(parser) addEffectsArgument(par...
python
def addAnnotationsSearchOptions(parser): """ Adds common options to a annotation searches command line parser. """ addAnnotationSetIdArgument(parser) addReferenceNameArgument(parser) addReferenceIdArgument(parser) addStartArgument(parser) addEndArgument(parser) addEffectsArgument(par...
[ "def", "addAnnotationsSearchOptions", "(", "parser", ")", ":", "addAnnotationSetIdArgument", "(", "parser", ")", "addReferenceNameArgument", "(", "parser", ")", "addReferenceIdArgument", "(", "parser", ")", "addStartArgument", "(", "parser", ")", "addEndArgument", "(", ...
Adds common options to a annotation searches command line parser.
[ "Adds", "common", "options", "to", "a", "annotation", "searches", "command", "line", "parser", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L1089-L1099
53,141
ga4gh/ga4gh-client
ga4gh/client/cli.py
addFeaturesSearchOptions
def addFeaturesSearchOptions(parser): """ Adds common options to a features search command line parser. """ addFeatureSetIdArgument(parser) addFeaturesReferenceNameArgument(parser) addStartArgument(parser) addEndArgument(parser) addParentFeatureIdArgument(parser) addFeatureTypesArgum...
python
def addFeaturesSearchOptions(parser): """ Adds common options to a features search command line parser. """ addFeatureSetIdArgument(parser) addFeaturesReferenceNameArgument(parser) addStartArgument(parser) addEndArgument(parser) addParentFeatureIdArgument(parser) addFeatureTypesArgum...
[ "def", "addFeaturesSearchOptions", "(", "parser", ")", ":", "addFeatureSetIdArgument", "(", "parser", ")", "addFeaturesReferenceNameArgument", "(", "parser", ")", "addStartArgument", "(", "parser", ")", "addEndArgument", "(", "parser", ")", "addParentFeatureIdArgument", ...
Adds common options to a features search command line parser.
[ "Adds", "common", "options", "to", "a", "features", "search", "command", "line", "parser", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L1102-L1111
53,142
ga4gh/ga4gh-client
ga4gh/client/cli.py
addContinuousSearchOptions
def addContinuousSearchOptions(parser): """ Adds common options to a continuous search command line parser. """ addContinuousSetIdArgument(parser) addContinuousReferenceNameArgument(parser) addStartArgument(parser) addEndArgument(parser)
python
def addContinuousSearchOptions(parser): """ Adds common options to a continuous search command line parser. """ addContinuousSetIdArgument(parser) addContinuousReferenceNameArgument(parser) addStartArgument(parser) addEndArgument(parser)
[ "def", "addContinuousSearchOptions", "(", "parser", ")", ":", "addContinuousSetIdArgument", "(", "parser", ")", "addContinuousReferenceNameArgument", "(", "parser", ")", "addStartArgument", "(", "parser", ")", "addEndArgument", "(", "parser", ")" ]
Adds common options to a continuous search command line parser.
[ "Adds", "common", "options", "to", "a", "continuous", "search", "command", "line", "parser", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L1114-L1121
53,143
ga4gh/ga4gh-client
ga4gh/client/cli.py
addGenotypePhenotypeSearchOptions
def addGenotypePhenotypeSearchOptions(parser): """ Adds options to a g2p searches command line parser. """ parser.add_argument( "--phenotype_association_set_id", "-s", default=None, help="Only return associations from this phenotype_association_set.") parser.add_argument( "--...
python
def addGenotypePhenotypeSearchOptions(parser): """ Adds options to a g2p searches command line parser. """ parser.add_argument( "--phenotype_association_set_id", "-s", default=None, help="Only return associations from this phenotype_association_set.") parser.add_argument( "--...
[ "def", "addGenotypePhenotypeSearchOptions", "(", "parser", ")", ":", "parser", ".", "add_argument", "(", "\"--phenotype_association_set_id\"", ",", "\"-s\"", ",", "default", "=", "None", ",", "help", "=", "\"Only return associations from this phenotype_association_set.\"", ...
Adds options to a g2p searches command line parser.
[ "Adds", "options", "to", "a", "g2p", "searches", "command", "line", "parser", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L1124-L1139
53,144
ga4gh/ga4gh-client
ga4gh/client/cli.py
addPhenotypeSearchOptions
def addPhenotypeSearchOptions(parser): """ Adds options to a phenotype searches command line parser. """ parser.add_argument( "--phenotype_association_set_id", "-s", default=None, help="Only return phenotypes from this phenotype_association_set.") parser.add_argument( "--phen...
python
def addPhenotypeSearchOptions(parser): """ Adds options to a phenotype searches command line parser. """ parser.add_argument( "--phenotype_association_set_id", "-s", default=None, help="Only return phenotypes from this phenotype_association_set.") parser.add_argument( "--phen...
[ "def", "addPhenotypeSearchOptions", "(", "parser", ")", ":", "parser", ".", "add_argument", "(", "\"--phenotype_association_set_id\"", ",", "\"-s\"", ",", "default", "=", "None", ",", "help", "=", "\"Only return phenotypes from this phenotype_association_set.\"", ")", "pa...
Adds options to a phenotype searches command line parser.
[ "Adds", "options", "to", "a", "phenotype", "searches", "command", "line", "parser", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L1142-L1160
53,145
ga4gh/ga4gh-client
ga4gh/client/cli.py
FormattedOutputRunner._textOutput
def _textOutput(self, gaObjects): """ Outputs a text summary of the specified protocol objects, one per line. """ for gaObject in gaObjects: if hasattr(gaObject, 'name'): print(gaObject.id, gaObject.name, sep="\t") else: pri...
python
def _textOutput(self, gaObjects): """ Outputs a text summary of the specified protocol objects, one per line. """ for gaObject in gaObjects: if hasattr(gaObject, 'name'): print(gaObject.id, gaObject.name, sep="\t") else: pri...
[ "def", "_textOutput", "(", "self", ",", "gaObjects", ")", ":", "for", "gaObject", "in", "gaObjects", ":", "if", "hasattr", "(", "gaObject", ",", "'name'", ")", ":", "print", "(", "gaObject", ".", "id", ",", "gaObject", ".", "name", ",", "sep", "=", "...
Outputs a text summary of the specified protocol objects, one per line.
[ "Outputs", "a", "text", "summary", "of", "the", "specified", "protocol", "objects", "one", "per", "line", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L92-L101
53,146
ga4gh/ga4gh-client
ga4gh/client/cli.py
AbstractSearchRunner.getAllVariantSets
def getAllVariantSets(self): """ Returns all variant sets on the server. """ for dataset in self.getAllDatasets(): iterator = self._client.search_variant_sets( dataset_id=dataset.id) for variantSet in iterator: yield variantSet
python
def getAllVariantSets(self): """ Returns all variant sets on the server. """ for dataset in self.getAllDatasets(): iterator = self._client.search_variant_sets( dataset_id=dataset.id) for variantSet in iterator: yield variantSet
[ "def", "getAllVariantSets", "(", "self", ")", ":", "for", "dataset", "in", "self", ".", "getAllDatasets", "(", ")", ":", "iterator", "=", "self", ".", "_client", ".", "search_variant_sets", "(", "dataset_id", "=", "dataset", ".", "id", ")", "for", "variant...
Returns all variant sets on the server.
[ "Returns", "all", "variant", "sets", "on", "the", "server", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L133-L141
53,147
ga4gh/ga4gh-client
ga4gh/client/cli.py
AbstractSearchRunner.getAllFeatureSets
def getAllFeatureSets(self): """ Returns all feature sets on the server. """ for dataset in self.getAllDatasets(): iterator = self._client.search_feature_sets( dataset_id=dataset.id) for featureSet in iterator: yield featureSet
python
def getAllFeatureSets(self): """ Returns all feature sets on the server. """ for dataset in self.getAllDatasets(): iterator = self._client.search_feature_sets( dataset_id=dataset.id) for featureSet in iterator: yield featureSet
[ "def", "getAllFeatureSets", "(", "self", ")", ":", "for", "dataset", "in", "self", ".", "getAllDatasets", "(", ")", ":", "iterator", "=", "self", ".", "_client", ".", "search_feature_sets", "(", "dataset_id", "=", "dataset", ".", "id", ")", "for", "feature...
Returns all feature sets on the server.
[ "Returns", "all", "feature", "sets", "on", "the", "server", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L143-L151
53,148
ga4gh/ga4gh-client
ga4gh/client/cli.py
AbstractSearchRunner.getAllContinuousSets
def getAllContinuousSets(self): """ Returns all continuous sets on the server. """ for dataset in self.getAllDatasets(): iterator = self._client.search_continuous_sets( dataset_id=dataset.id) for continuousSet in iterator: yield con...
python
def getAllContinuousSets(self): """ Returns all continuous sets on the server. """ for dataset in self.getAllDatasets(): iterator = self._client.search_continuous_sets( dataset_id=dataset.id) for continuousSet in iterator: yield con...
[ "def", "getAllContinuousSets", "(", "self", ")", ":", "for", "dataset", "in", "self", ".", "getAllDatasets", "(", ")", ":", "iterator", "=", "self", ".", "_client", ".", "search_continuous_sets", "(", "dataset_id", "=", "dataset", ".", "id", ")", "for", "c...
Returns all continuous sets on the server.
[ "Returns", "all", "continuous", "sets", "on", "the", "server", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L153-L161
53,149
ga4gh/ga4gh-client
ga4gh/client/cli.py
AbstractSearchRunner.getAllReadGroupSets
def getAllReadGroupSets(self): """ Returns all readgroup sets on the server. """ for dataset in self.getAllDatasets(): iterator = self._client.search_read_group_sets( dataset_id=dataset.id) for readGroupSet in iterator: yield readGr...
python
def getAllReadGroupSets(self): """ Returns all readgroup sets on the server. """ for dataset in self.getAllDatasets(): iterator = self._client.search_read_group_sets( dataset_id=dataset.id) for readGroupSet in iterator: yield readGr...
[ "def", "getAllReadGroupSets", "(", "self", ")", ":", "for", "dataset", "in", "self", ".", "getAllDatasets", "(", ")", ":", "iterator", "=", "self", ".", "_client", ".", "search_read_group_sets", "(", "dataset_id", "=", "dataset", ".", "id", ")", "for", "re...
Returns all readgroup sets on the server.
[ "Returns", "all", "readgroup", "sets", "on", "the", "server", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L163-L171
53,150
ga4gh/ga4gh-client
ga4gh/client/cli.py
AbstractSearchRunner.getAllReadGroups
def getAllReadGroups(self): """ Get all read groups in a read group set """ for dataset in self.getAllDatasets(): iterator = self._client.search_read_group_sets( dataset_id=dataset.id) for readGroupSet in iterator: readGroupSet = se...
python
def getAllReadGroups(self): """ Get all read groups in a read group set """ for dataset in self.getAllDatasets(): iterator = self._client.search_read_group_sets( dataset_id=dataset.id) for readGroupSet in iterator: readGroupSet = se...
[ "def", "getAllReadGroups", "(", "self", ")", ":", "for", "dataset", "in", "self", ".", "getAllDatasets", "(", ")", ":", "iterator", "=", "self", ".", "_client", ".", "search_read_group_sets", "(", "dataset_id", "=", "dataset", ".", "id", ")", "for", "readG...
Get all read groups in a read group set
[ "Get", "all", "read", "groups", "in", "a", "read", "group", "set" ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L173-L184
53,151
ga4gh/ga4gh-client
ga4gh/client/cli.py
SearchVariantAnnotationsRunner.getAllAnnotationSets
def getAllAnnotationSets(self): """ Returns all variant annotation sets on the server. """ for variantSet in self.getAllVariantSets(): iterator = self._client.search_variant_annotation_sets( variant_set_id=variantSet.id) for variantAnnotationSet in...
python
def getAllAnnotationSets(self): """ Returns all variant annotation sets on the server. """ for variantSet in self.getAllVariantSets(): iterator = self._client.search_variant_annotation_sets( variant_set_id=variantSet.id) for variantAnnotationSet in...
[ "def", "getAllAnnotationSets", "(", "self", ")", ":", "for", "variantSet", "in", "self", ".", "getAllVariantSets", "(", ")", ":", "iterator", "=", "self", ".", "_client", ".", "search_variant_annotation_sets", "(", "variant_set_id", "=", "variantSet", ".", "id",...
Returns all variant annotation sets on the server.
[ "Returns", "all", "variant", "annotation", "sets", "on", "the", "server", "." ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L644-L652
53,152
ga4gh/ga4gh-client
ga4gh/client/cli.py
SearchReadsRunner._run
def _run(self, referenceGroupId, referenceId=None): """ automatically guess reference id if not passed """ # check if we can get reference id from rg if referenceId is None: referenceId = self._referenceId if referenceId is None: rg = self._client....
python
def _run(self, referenceGroupId, referenceId=None): """ automatically guess reference id if not passed """ # check if we can get reference id from rg if referenceId is None: referenceId = self._referenceId if referenceId is None: rg = self._client....
[ "def", "_run", "(", "self", ",", "referenceGroupId", ",", "referenceId", "=", "None", ")", ":", "# check if we can get reference id from rg", "if", "referenceId", "is", "None", ":", "referenceId", "=", "self", ".", "_referenceId", "if", "referenceId", "is", "None"...
automatically guess reference id if not passed
[ "automatically", "guess", "reference", "id", "if", "not", "passed" ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L733-L751
53,153
ga4gh/ga4gh-client
ga4gh/client/cli.py
SearchReadsRunner.run
def run(self): """ Iterate passed read group ids, or go through all available read groups """ if not self._readGroupIds: for referenceGroupId in self.getAllReadGroups(): self._run(referenceGroupId) else: for referenceGroupId in self._readGr...
python
def run(self): """ Iterate passed read group ids, or go through all available read groups """ if not self._readGroupIds: for referenceGroupId in self.getAllReadGroups(): self._run(referenceGroupId) else: for referenceGroupId in self._readGr...
[ "def", "run", "(", "self", ")", ":", "if", "not", "self", ".", "_readGroupIds", ":", "for", "referenceGroupId", "in", "self", ".", "getAllReadGroups", "(", ")", ":", "self", ".", "_run", "(", "referenceGroupId", ")", "else", ":", "for", "referenceGroupId",...
Iterate passed read group ids, or go through all available read groups
[ "Iterate", "passed", "read", "group", "ids", "or", "go", "through", "all", "available", "read", "groups" ]
d23b00b89112ef0930d45ee75aa3c6de3db615c5
https://github.com/ga4gh/ga4gh-client/blob/d23b00b89112ef0930d45ee75aa3c6de3db615c5/ga4gh/client/cli.py#L753-L762
53,154
meowklaski/custom_inherit
custom_inherit/_doc_parse_tools/napoleon_parse_tools.py
merge_all_sections
def merge_all_sections(prnt_sctns, child_sctns, style): """ Merge the doc-sections of the parent's and child's attribute into a single docstring. Parameters ---------- prnt_sctns: OrderedDict[str, Union[None,str]] child_sctns: OrderedDict[str, Union[None,str]] Returns ...
python
def merge_all_sections(prnt_sctns, child_sctns, style): """ Merge the doc-sections of the parent's and child's attribute into a single docstring. Parameters ---------- prnt_sctns: OrderedDict[str, Union[None,str]] child_sctns: OrderedDict[str, Union[None,str]] Returns ...
[ "def", "merge_all_sections", "(", "prnt_sctns", ",", "child_sctns", ",", "style", ")", ":", "doc", "=", "[", "]", "prnt_only_raises", "=", "prnt_sctns", "[", "\"Raises\"", "]", "and", "not", "(", "prnt_sctns", "[", "\"Returns\"", "]", "or", "prnt_sctns", "["...
Merge the doc-sections of the parent's and child's attribute into a single docstring. Parameters ---------- prnt_sctns: OrderedDict[str, Union[None,str]] child_sctns: OrderedDict[str, Union[None,str]] Returns ------- str Output docstring of the merge...
[ "Merge", "the", "doc", "-", "sections", "of", "the", "parent", "s", "and", "child", "s", "attribute", "into", "a", "single", "docstring", "." ]
13bce675e246d84e21bcd7658e0a4fbf25db4adc
https://github.com/meowklaski/custom_inherit/blob/13bce675e246d84e21bcd7658e0a4fbf25db4adc/custom_inherit/_doc_parse_tools/napoleon_parse_tools.py#L95-L117
53,155
meowklaski/custom_inherit
custom_inherit/_doc_parse_tools/napoleon_parse_tools.py
merge_numpy_napoleon_docs
def merge_numpy_napoleon_docs(prnt_doc=None, child_doc=None): """ Merge two numpy-style docstrings into a single docstring, according to napoleon docstring sections. Given the numpy-style docstrings from a parent and child's attributes, merge the docstring sections such that the child's section is ...
python
def merge_numpy_napoleon_docs(prnt_doc=None, child_doc=None): """ Merge two numpy-style docstrings into a single docstring, according to napoleon docstring sections. Given the numpy-style docstrings from a parent and child's attributes, merge the docstring sections such that the child's section is ...
[ "def", "merge_numpy_napoleon_docs", "(", "prnt_doc", "=", "None", ",", "child_doc", "=", "None", ")", ":", "style", "=", "\"numpy\"", "return", "merge_all_sections", "(", "parse_napoleon_doc", "(", "prnt_doc", ",", "style", ")", ",", "parse_napoleon_doc", "(", "...
Merge two numpy-style docstrings into a single docstring, according to napoleon docstring sections. Given the numpy-style docstrings from a parent and child's attributes, merge the docstring sections such that the child's section is used, wherever present, otherwise the parent's section is used...
[ "Merge", "two", "numpy", "-", "style", "docstrings", "into", "a", "single", "docstring", "according", "to", "napoleon", "docstring", "sections", "." ]
13bce675e246d84e21bcd7658e0a4fbf25db4adc
https://github.com/meowklaski/custom_inherit/blob/13bce675e246d84e21bcd7658e0a4fbf25db4adc/custom_inherit/_doc_parse_tools/napoleon_parse_tools.py#L120-L144
53,156
meowklaski/custom_inherit
custom_inherit/_doc_parse_tools/napoleon_parse_tools.py
merge_google_napoleon_docs
def merge_google_napoleon_docs(prnt_doc=None, child_doc=None): """ Merge two google-style docstrings into a single docstring, according to napoleon docstring sections. Given the google-style docstrings from a parent and child's attributes, merge the docstring sections such that the child's section ...
python
def merge_google_napoleon_docs(prnt_doc=None, child_doc=None): """ Merge two google-style docstrings into a single docstring, according to napoleon docstring sections. Given the google-style docstrings from a parent and child's attributes, merge the docstring sections such that the child's section ...
[ "def", "merge_google_napoleon_docs", "(", "prnt_doc", "=", "None", ",", "child_doc", "=", "None", ")", ":", "style", "=", "\"google\"", "return", "merge_all_sections", "(", "parse_napoleon_doc", "(", "prnt_doc", ",", "style", ")", ",", "parse_napoleon_doc", "(", ...
Merge two google-style docstrings into a single docstring, according to napoleon docstring sections. Given the google-style docstrings from a parent and child's attributes, merge the docstring sections such that the child's section is used, wherever present, otherwise the parent's section is us...
[ "Merge", "two", "google", "-", "style", "docstrings", "into", "a", "single", "docstring", "according", "to", "napoleon", "docstring", "sections", "." ]
13bce675e246d84e21bcd7658e0a4fbf25db4adc
https://github.com/meowklaski/custom_inherit/blob/13bce675e246d84e21bcd7658e0a4fbf25db4adc/custom_inherit/_doc_parse_tools/napoleon_parse_tools.py#L147-L171
53,157
vlukes/dicom2fem
dicom2fem/mesh.py
merge_mesh
def merge_mesh( x1, ngroups1, conns1, x2, ngroups2, conns2, cmap, eps = 1e-8 ): """Merge two meshes in common coordinates found in x1, x2.""" n1 = x1.shape[0] n2 = x2.shape[0] err = nm.sum( nm.sum( nm.abs( x1[cmap[:,0],:-1] - x2[cmap[:,1],:-1] ) ) ) if abs( err ) > (10.0 * eps): print 'nonm...
python
def merge_mesh( x1, ngroups1, conns1, x2, ngroups2, conns2, cmap, eps = 1e-8 ): """Merge two meshes in common coordinates found in x1, x2.""" n1 = x1.shape[0] n2 = x2.shape[0] err = nm.sum( nm.sum( nm.abs( x1[cmap[:,0],:-1] - x2[cmap[:,1],:-1] ) ) ) if abs( err ) > (10.0 * eps): print 'nonm...
[ "def", "merge_mesh", "(", "x1", ",", "ngroups1", ",", "conns1", ",", "x2", ",", "ngroups2", ",", "conns2", ",", "cmap", ",", "eps", "=", "1e-8", ")", ":", "n1", "=", "x1", ".", "shape", "[", "0", "]", "n2", "=", "x2", ".", "shape", "[", "0", ...
Merge two meshes in common coordinates found in x1, x2.
[ "Merge", "two", "meshes", "in", "common", "coordinates", "found", "in", "x1", "x2", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L67-L94
53,158
vlukes/dicom2fem
dicom2fem/mesh.py
fix_double_nodes
def fix_double_nodes(coor, ngroups, conns, eps): """ Detect and attempt fixing double nodes in a mesh. The double nodes are nodes having the same coordinates w.r.t. precision given by `eps`. """ n_nod, dim = coor.shape cmap = find_map( coor, nm.zeros( (0,dim) ), eps = eps, allow_double = Tr...
python
def fix_double_nodes(coor, ngroups, conns, eps): """ Detect and attempt fixing double nodes in a mesh. The double nodes are nodes having the same coordinates w.r.t. precision given by `eps`. """ n_nod, dim = coor.shape cmap = find_map( coor, nm.zeros( (0,dim) ), eps = eps, allow_double = Tr...
[ "def", "fix_double_nodes", "(", "coor", ",", "ngroups", ",", "conns", ",", "eps", ")", ":", "n_nod", ",", "dim", "=", "coor", ".", "shape", "cmap", "=", "find_map", "(", "coor", ",", "nm", ".", "zeros", "(", "(", "0", ",", "dim", ")", ")", ",", ...
Detect and attempt fixing double nodes in a mesh. The double nodes are nodes having the same coordinates w.r.t. precision given by `eps`.
[ "Detect", "and", "attempt", "fixing", "double", "nodes", "in", "a", "mesh", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L96-L133
53,159
vlukes/dicom2fem
dicom2fem/mesh.py
get_min_edge_size
def get_min_edge_size(coor, conns): """ Get the smallest edge length. """ mes = 1e16 for conn in conns: n_ep = conn.shape[1] for ir in range( n_ep ): x1 = coor[conn[:,ir]] for ic in range( ir + 1, n_ep ): x2 = coor[conn[:,ic]] a...
python
def get_min_edge_size(coor, conns): """ Get the smallest edge length. """ mes = 1e16 for conn in conns: n_ep = conn.shape[1] for ir in range( n_ep ): x1 = coor[conn[:,ir]] for ic in range( ir + 1, n_ep ): x2 = coor[conn[:,ic]] a...
[ "def", "get_min_edge_size", "(", "coor", ",", "conns", ")", ":", "mes", "=", "1e16", "for", "conn", "in", "conns", ":", "n_ep", "=", "conn", ".", "shape", "[", "1", "]", "for", "ir", "in", "range", "(", "n_ep", ")", ":", "x1", "=", "coor", "[", ...
Get the smallest edge length.
[ "Get", "the", "smallest", "edge", "length", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L135-L149
53,160
vlukes/dicom2fem
dicom2fem/mesh.py
get_min_vertex_distance
def get_min_vertex_distance( coor, guess ): """Can miss the minimum, but is enough for our purposes.""" # Sort by x. ix = nm.argsort( coor[:,0] ) scoor = coor[ix] mvd = 1e16 # Get mvd in chunks potentially smaller than guess. n_coor = coor.shape[0] print n_coor i0 = i1 = 0...
python
def get_min_vertex_distance( coor, guess ): """Can miss the minimum, but is enough for our purposes.""" # Sort by x. ix = nm.argsort( coor[:,0] ) scoor = coor[ix] mvd = 1e16 # Get mvd in chunks potentially smaller than guess. n_coor = coor.shape[0] print n_coor i0 = i1 = 0...
[ "def", "get_min_vertex_distance", "(", "coor", ",", "guess", ")", ":", "# Sort by x.", "ix", "=", "nm", ".", "argsort", "(", "coor", "[", ":", ",", "0", "]", ")", "scoor", "=", "coor", "[", "ix", "]", "mvd", "=", "1e16", "# Get mvd in chunks potentially ...
Can miss the minimum, but is enough for our purposes.
[ "Can", "miss", "the", "minimum", "but", "is", "enough", "for", "our", "purposes", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L153-L185
53,161
vlukes/dicom2fem
dicom2fem/mesh.py
make_mesh
def make_mesh( coor, ngroups, conns, mesh_in ): """Create a mesh reusing mat_ids and descs of mesh_in.""" mat_ids = [] for ii, conn in enumerate( conns ): mat_id = nm.empty( (conn.shape[0],), dtype = nm.int32 ) mat_id.fill( mesh_in.mat_ids[ii][0] ) mat_ids.append( mat_id ) ...
python
def make_mesh( coor, ngroups, conns, mesh_in ): """Create a mesh reusing mat_ids and descs of mesh_in.""" mat_ids = [] for ii, conn in enumerate( conns ): mat_id = nm.empty( (conn.shape[0],), dtype = nm.int32 ) mat_id.fill( mesh_in.mat_ids[ii][0] ) mat_ids.append( mat_id ) ...
[ "def", "make_mesh", "(", "coor", ",", "ngroups", ",", "conns", ",", "mesh_in", ")", ":", "mat_ids", "=", "[", "]", "for", "ii", ",", "conn", "in", "enumerate", "(", "conns", ")", ":", "mat_id", "=", "nm", ".", "empty", "(", "(", "conn", ".", "sha...
Create a mesh reusing mat_ids and descs of mesh_in.
[ "Create", "a", "mesh", "reusing", "mat_ids", "and", "descs", "of", "mesh_in", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L204-L214
53,162
vlukes/dicom2fem
dicom2fem/mesh.py
make_inverse_connectivity
def make_inverse_connectivity(conns, n_nod, ret_offsets=True): """ For each mesh node referenced in the connectivity conns, make a list of elements it belongs to. """ from itertools import chain iconn = [[] for ii in xrange( n_nod )] n_els = [0] * n_nod for ig, conn in enumerate( conns ...
python
def make_inverse_connectivity(conns, n_nod, ret_offsets=True): """ For each mesh node referenced in the connectivity conns, make a list of elements it belongs to. """ from itertools import chain iconn = [[] for ii in xrange( n_nod )] n_els = [0] * n_nod for ig, conn in enumerate( conns ...
[ "def", "make_inverse_connectivity", "(", "conns", ",", "n_nod", ",", "ret_offsets", "=", "True", ")", ":", "from", "itertools", "import", "chain", "iconn", "=", "[", "[", "]", "for", "ii", "in", "xrange", "(", "n_nod", ")", "]", "n_els", "=", "[", "0",...
For each mesh node referenced in the connectivity conns, make a list of elements it belongs to.
[ "For", "each", "mesh", "node", "referenced", "in", "the", "connectivity", "conns", "make", "a", "list", "of", "elements", "it", "belongs", "to", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L216-L239
53,163
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh.from_surface
def from_surface( surf_faces, mesh_in ): """ Create a mesh given a set of surface faces and the original mesh. """ aux = nm.concatenate([faces.ravel() for faces in surf_faces]) inod = nm.unique(aux) n_nod = len( inod ) n_nod_m, dim = mesh_in.coors.shape ...
python
def from_surface( surf_faces, mesh_in ): """ Create a mesh given a set of surface faces and the original mesh. """ aux = nm.concatenate([faces.ravel() for faces in surf_faces]) inod = nm.unique(aux) n_nod = len( inod ) n_nod_m, dim = mesh_in.coors.shape ...
[ "def", "from_surface", "(", "surf_faces", ",", "mesh_in", ")", ":", "aux", "=", "nm", ".", "concatenate", "(", "[", "faces", ".", "ravel", "(", ")", "for", "faces", "in", "surf_faces", "]", ")", "inod", "=", "nm", ".", "unique", "(", "aux", ")", "n...
Create a mesh given a set of surface faces and the original mesh.
[ "Create", "a", "mesh", "given", "a", "set", "of", "surface", "faces", "and", "the", "original", "mesh", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L363-L399
53,164
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh.from_file
def from_file(filename=None, io='auto', prefix_dir=None, omit_facets=False): """ Read a mesh from a file. Parameters ---------- filename : string or function or MeshIO instance or Mesh instance The name of file to read the mesh from. For convenience...
python
def from_file(filename=None, io='auto', prefix_dir=None, omit_facets=False): """ Read a mesh from a file. Parameters ---------- filename : string or function or MeshIO instance or Mesh instance The name of file to read the mesh from. For convenience...
[ "def", "from_file", "(", "filename", "=", "None", ",", "io", "=", "'auto'", ",", "prefix_dir", "=", "None", ",", "omit_facets", "=", "False", ")", ":", "if", "isinstance", "(", "filename", ",", "Mesh", ")", ":", "return", "filename", "if", "io", "==", ...
Read a mesh from a file. Parameters ---------- filename : string or function or MeshIO instance or Mesh instance The name of file to read the mesh from. For convenience, a mesh creation function or a MeshIO instance or directly a Mesh instance can be passed i...
[ "Read", "a", "mesh", "from", "a", "file", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L403-L444
53,165
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh.from_region
def from_region(region, mesh_in, save_edges=False, save_faces=False, localize=False, is_surface=False): """ Create a mesh corresponding to a given region. """ mesh = Mesh( mesh_in.name + "_reg" ) mesh.coors = mesh_in.coors.copy() mesh.ngroups = mesh_in...
python
def from_region(region, mesh_in, save_edges=False, save_faces=False, localize=False, is_surface=False): """ Create a mesh corresponding to a given region. """ mesh = Mesh( mesh_in.name + "_reg" ) mesh.coors = mesh_in.coors.copy() mesh.ngroups = mesh_in...
[ "def", "from_region", "(", "region", ",", "mesh_in", ",", "save_edges", "=", "False", ",", "save_faces", "=", "False", ",", "localize", "=", "False", ",", "is_surface", "=", "False", ")", ":", "mesh", "=", "Mesh", "(", "mesh_in", ".", "name", "+", "\"_...
Create a mesh corresponding to a given region.
[ "Create", "a", "mesh", "corresponding", "to", "a", "given", "region", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L447-L493
53,166
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh.from_data
def from_data( name, coors, ngroups, conns, mat_ids, descs, igs = None ): """ Create a mesh from mesh data. """ if igs is None: igs = range( len( conns ) ) mesh = Mesh(name) mesh._set_data(coors = coors, ngroups = ngroups, ...
python
def from_data( name, coors, ngroups, conns, mat_ids, descs, igs = None ): """ Create a mesh from mesh data. """ if igs is None: igs = range( len( conns ) ) mesh = Mesh(name) mesh._set_data(coors = coors, ngroups = ngroups, ...
[ "def", "from_data", "(", "name", ",", "coors", ",", "ngroups", ",", "conns", ",", "mat_ids", ",", "descs", ",", "igs", "=", "None", ")", ":", "if", "igs", "is", "None", ":", "igs", "=", "range", "(", "len", "(", "conns", ")", ")", "mesh", "=", ...
Create a mesh from mesh data.
[ "Create", "a", "mesh", "from", "mesh", "data", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L495-L508
53,167
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh.copy
def copy(self, name=None): """Make a deep copy of self. Parameters ---------- name : str Name of the copied mesh. """ return Struct.copy(self, deep=True, name=name)
python
def copy(self, name=None): """Make a deep copy of self. Parameters ---------- name : str Name of the copied mesh. """ return Struct.copy(self, deep=True, name=name)
[ "def", "copy", "(", "self", ",", "name", "=", "None", ")", ":", "return", "Struct", ".", "copy", "(", "self", ",", "deep", "=", "True", ",", "name", "=", "name", ")" ]
Make a deep copy of self. Parameters ---------- name : str Name of the copied mesh.
[ "Make", "a", "deep", "copy", "of", "self", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L539-L547
53,168
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh._set_data
def _set_data(self, coors, ngroups, conns, mat_ids, descs, nodal_bcs=None): """ Set mesh data. Parameters ---------- coors : array Coordinates of mesh nodes. ngroups : array Node groups. conns : list of arrays The array of mesh...
python
def _set_data(self, coors, ngroups, conns, mat_ids, descs, nodal_bcs=None): """ Set mesh data. Parameters ---------- coors : array Coordinates of mesh nodes. ngroups : array Node groups. conns : list of arrays The array of mesh...
[ "def", "_set_data", "(", "self", ",", "coors", ",", "ngroups", ",", "conns", ",", "mat_ids", ",", "descs", ",", "nodal_bcs", "=", "None", ")", ":", "self", ".", "coors", "=", "nm", ".", "ascontiguousarray", "(", "coors", ")", "if", "ngroups", "is", "...
Set mesh data. Parameters ---------- coors : array Coordinates of mesh nodes. ngroups : array Node groups. conns : list of arrays The array of mesh elements (connectivities) for each element group. mat_ids : list of arrays ...
[ "Set", "mesh", "data", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L560-L592
53,169
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh.write
def write(self, filename=None, io=None, coors=None, igs=None, out=None, float_format=None, **kwargs): """ Write mesh + optional results in `out` to a file. Parameters ---------- filename : str, optional The file name. If None, the mesh name is used inst...
python
def write(self, filename=None, io=None, coors=None, igs=None, out=None, float_format=None, **kwargs): """ Write mesh + optional results in `out` to a file. Parameters ---------- filename : str, optional The file name. If None, the mesh name is used inst...
[ "def", "write", "(", "self", ",", "filename", "=", "None", ",", "io", "=", "None", ",", "coors", "=", "None", ",", "igs", "=", "None", ",", "out", "=", "None", ",", "float_format", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "filename",...
Write mesh + optional results in `out` to a file. Parameters ---------- filename : str, optional The file name. If None, the mesh name is used instead. io : MeshIO instance or 'auto', optional Passing 'auto' respects the extension of `filename`. coors : a...
[ "Write", "mesh", "+", "optional", "results", "in", "out", "to", "a", "file", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L616-L659
53,170
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh.get_element_coors
def get_element_coors(self, ig=None): """ Get the coordinates of vertices elements in group `ig`. Parameters ---------- ig : int, optional The element group. If None, the coordinates for all groups are returned, filled with zeros at places of missing ...
python
def get_element_coors(self, ig=None): """ Get the coordinates of vertices elements in group `ig`. Parameters ---------- ig : int, optional The element group. If None, the coordinates for all groups are returned, filled with zeros at places of missing ...
[ "def", "get_element_coors", "(", "self", ",", "ig", "=", "None", ")", ":", "cc", "=", "self", ".", "coors", "n_ep_max", "=", "self", ".", "n_e_ps", ".", "max", "(", ")", "coors", "=", "nm", ".", "empty", "(", "(", "self", ".", "n_el", ",", "n_ep_...
Get the coordinates of vertices elements in group `ig`. Parameters ---------- ig : int, optional The element group. If None, the coordinates for all groups are returned, filled with zeros at places of missing vertices, i.e. where elements having less then the...
[ "Get", "the", "coordinates", "of", "vertices", "elements", "in", "group", "ig", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L666-L691
53,171
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh.transform_coors
def transform_coors(self, mtx_t, ref_coors=None): """ Transform coordinates of the mesh by the given transformation matrix. Parameters ---------- mtx_t : array The transformation matrix `T` (2D array). It is applied depending on its shape: - `(d...
python
def transform_coors(self, mtx_t, ref_coors=None): """ Transform coordinates of the mesh by the given transformation matrix. Parameters ---------- mtx_t : array The transformation matrix `T` (2D array). It is applied depending on its shape: - `(d...
[ "def", "transform_coors", "(", "self", ",", "mtx_t", ",", "ref_coors", "=", "None", ")", ":", "if", "ref_coors", "is", "None", ":", "ref_coors", "=", "self", ".", "coors", "if", "mtx_t", ".", "shape", "[", "1", "]", ">", "self", ".", "coors", ".", ...
Transform coordinates of the mesh by the given transformation matrix. Parameters ---------- mtx_t : array The transformation matrix `T` (2D array). It is applied depending on its shape: - `(dim, dim): x = T * x` - `(dim, dim + 1): x = T[:, :-1] * x +...
[ "Transform", "coordinates", "of", "the", "mesh", "by", "the", "given", "transformation", "matrix", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L720-L742
53,172
vlukes/dicom2fem
dicom2fem/mesh.py
Mesh.explode_groups
def explode_groups(self, eps, return_emap=False): """ Explode the mesh element groups by `eps`, i.e. split group interface nodes and shrink each group towards its centre by `eps`. Parameters ---------- eps : float in `[0.0, 1.0]` The group shrinking f...
python
def explode_groups(self, eps, return_emap=False): """ Explode the mesh element groups by `eps`, i.e. split group interface nodes and shrink each group towards its centre by `eps`. Parameters ---------- eps : float in `[0.0, 1.0]` The group shrinking f...
[ "def", "explode_groups", "(", "self", ",", "eps", ",", "return_emap", "=", "False", ")", ":", "assert_", "(", "0.0", "<=", "eps", "<=", "1.0", ")", "remap", "=", "nm", ".", "empty", "(", "(", "self", ".", "n_nod", ",", ")", ",", "dtype", "=", "nm...
Explode the mesh element groups by `eps`, i.e. split group interface nodes and shrink each group towards its centre by `eps`. Parameters ---------- eps : float in `[0.0, 1.0]` The group shrinking factor. return_emap : bool, optional If True, also ...
[ "Explode", "the", "mesh", "element", "groups", "by", "eps", "i", ".", "e", ".", "split", "group", "interface", "nodes", "and", "shrink", "each", "group", "towards", "its", "centre", "by", "eps", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/mesh.py#L776-L855
53,173
vlukes/dicom2fem
dicom2fem/meshio.py
join_conn_groups
def join_conn_groups( conns, descs, mat_ids, concat = False ): """Join groups of the same element type.""" el = dict_from_keys_init( descs, list ) for ig, desc in enumerate( descs ): el[desc].append( ig ) groups = [ii for ii in el.values() if ii] ## print el, groups descs_out, conns_ou...
python
def join_conn_groups( conns, descs, mat_ids, concat = False ): """Join groups of the same element type.""" el = dict_from_keys_init( descs, list ) for ig, desc in enumerate( descs ): el[desc].append( ig ) groups = [ii for ii in el.values() if ii] ## print el, groups descs_out, conns_ou...
[ "def", "join_conn_groups", "(", "conns", ",", "descs", ",", "mat_ids", ",", "concat", "=", "False", ")", ":", "el", "=", "dict_from_keys_init", "(", "descs", ",", "list", ")", "for", "ig", ",", "desc", "in", "enumerate", "(", "descs", ")", ":", "el", ...
Join groups of the same element type.
[ "Join", "groups", "of", "the", "same", "element", "type", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/meshio.py#L132-L161
53,174
vlukes/dicom2fem
dicom2fem/meshio.py
convert_complex_output
def convert_complex_output(out_in): """ Convert complex values in the output dictionary `out_in` to pairs of real and imaginary parts. """ out = {} for key, val in out_in.iteritems(): if val.data.dtype in complex_types: rval = copy(val) rval.data = val.data.real...
python
def convert_complex_output(out_in): """ Convert complex values in the output dictionary `out_in` to pairs of real and imaginary parts. """ out = {} for key, val in out_in.iteritems(): if val.data.dtype in complex_types: rval = copy(val) rval.data = val.data.real...
[ "def", "convert_complex_output", "(", "out_in", ")", ":", "out", "=", "{", "}", "for", "key", ",", "val", "in", "out_in", ".", "iteritems", "(", ")", ":", "if", "val", ".", "data", ".", "dtype", "in", "complex_types", ":", "rval", "=", "copy", "(", ...
Convert complex values in the output dictionary `out_in` to pairs of real and imaginary parts.
[ "Convert", "complex", "values", "in", "the", "output", "dictionary", "out_in", "to", "pairs", "of", "real", "and", "imaginary", "parts", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/meshio.py#L163-L183
53,175
vlukes/dicom2fem
dicom2fem/meshio.py
guess_format
def guess_format( filename, ext, formats, io_table ): """ Guess the format of filename, candidates are in formats. """ ok = False for format in formats: output( 'guessing %s' % format ) try: ok = io_table[format].guess( filename ) except AttributeError: ...
python
def guess_format( filename, ext, formats, io_table ): """ Guess the format of filename, candidates are in formats. """ ok = False for format in formats: output( 'guessing %s' % format ) try: ok = io_table[format].guess( filename ) except AttributeError: ...
[ "def", "guess_format", "(", "filename", ",", "ext", ",", "formats", ",", "io_table", ")", ":", "ok", "=", "False", "for", "format", "in", "formats", ":", "output", "(", "'guessing %s'", "%", "format", ")", "try", ":", "ok", "=", "io_table", "[", "forma...
Guess the format of filename, candidates are in formats.
[ "Guess", "the", "format", "of", "filename", "candidates", "are", "in", "formats", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/meshio.py#L2540-L2556
53,176
vlukes/dicom2fem
dicom2fem/meshio.py
any_from_filename
def any_from_filename(filename, prefix_dir=None): """ Create a MeshIO instance according to the kind of `filename`. Parameters ---------- filename : str, function or MeshIO subclass instance The name of the mesh file. It can be also a user-supplied function accepting two arguments: ...
python
def any_from_filename(filename, prefix_dir=None): """ Create a MeshIO instance according to the kind of `filename`. Parameters ---------- filename : str, function or MeshIO subclass instance The name of the mesh file. It can be also a user-supplied function accepting two arguments: ...
[ "def", "any_from_filename", "(", "filename", ",", "prefix_dir", "=", "None", ")", ":", "if", "not", "isinstance", "(", "filename", ",", "basestr", ")", ":", "if", "isinstance", "(", "filename", ",", "MeshIO", ")", ":", "return", "filename", "else", ":", ...
Create a MeshIO instance according to the kind of `filename`. Parameters ---------- filename : str, function or MeshIO subclass instance The name of the mesh file. It can be also a user-supplied function accepting two arguments: `mesh`, `mode`, where `mesh` is a Mesh instance and `m...
[ "Create", "a", "MeshIO", "instance", "according", "to", "the", "kind", "of", "filename", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/meshio.py#L2571-L2609
53,177
vlukes/dicom2fem
dicom2fem/meshio.py
for_format
def for_format(filename, format=None, writable=False, prefix_dir=None): """ Create a MeshIO instance for file `filename` with forced `format`. Parameters ---------- filename : str The name of the mesh file. format : str One of supported formats. If None, :func:`MeshIO.an...
python
def for_format(filename, format=None, writable=False, prefix_dir=None): """ Create a MeshIO instance for file `filename` with forced `format`. Parameters ---------- filename : str The name of the mesh file. format : str One of supported formats. If None, :func:`MeshIO.an...
[ "def", "for_format", "(", "filename", ",", "format", "=", "None", ",", "writable", "=", "False", ",", "prefix_dir", "=", "None", ")", ":", "ext", "=", "op", ".", "splitext", "(", "filename", ")", "[", "1", "]", ".", "lower", "(", ")", "try", ":", ...
Create a MeshIO instance for file `filename` with forced `format`. Parameters ---------- filename : str The name of the mesh file. format : str One of supported formats. If None, :func:`MeshIO.any_from_filename()` is called instead. writable : bool If True, verify th...
[ "Create", "a", "MeshIO", "instance", "for", "file", "filename", "with", "forced", "format", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/meshio.py#L2614-L2665
53,178
vlukes/dicom2fem
dicom2fem/meshio.py
VTKMeshIO.read_data
def read_data( self, step, filename = None ): """Point data only!""" filename = get_default( filename, self.filename ) out = {} fd = open( self.filename, 'r' ) while 1: line = skip_read_line(fd, no_eof=True).split() if line[0] == 'POINT_DATA': ...
python
def read_data( self, step, filename = None ): """Point data only!""" filename = get_default( filename, self.filename ) out = {} fd = open( self.filename, 'r' ) while 1: line = skip_read_line(fd, no_eof=True).split() if line[0] == 'POINT_DATA': ...
[ "def", "read_data", "(", "self", ",", "step", ",", "filename", "=", "None", ")", ":", "filename", "=", "get_default", "(", "filename", ",", "self", ".", "filename", ")", "out", "=", "{", "}", "fd", "=", "open", "(", "self", ".", "filename", ",", "'...
Point data only!
[ "Point", "data", "only!" ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/meshio.py#L890-L947
53,179
vlukes/dicom2fem
dicom2fem/meshio.py
TetgenMeshIO.getnodes
def getnodes(fnods, up=None, verbose=False): """ Reads t.1.nodes, returns a list of nodes. Example: >>> self.getnodes("t.1.node", MyBar("nodes:")) [(0.0, 0.0, 0.0), (4.0, 0.0, 0.0), (0.0, 4.0, 0.0), (-4.0, 0.0, 0.0), (0.0, 0.0, 4.0), (0.0, -4.0, 0.0), (0.0, -0.0, -4.0),...
python
def getnodes(fnods, up=None, verbose=False): """ Reads t.1.nodes, returns a list of nodes. Example: >>> self.getnodes("t.1.node", MyBar("nodes:")) [(0.0, 0.0, 0.0), (4.0, 0.0, 0.0), (0.0, 4.0, 0.0), (-4.0, 0.0, 0.0), (0.0, 0.0, 4.0), (0.0, -4.0, 0.0), (0.0, -0.0, -4.0),...
[ "def", "getnodes", "(", "fnods", ",", "up", "=", "None", ",", "verbose", "=", "False", ")", ":", "f", "=", "open", "(", "fnods", ")", "l", "=", "[", "int", "(", "x", ")", "for", "x", "in", "f", ".", "readline", "(", ")", ".", "split", "(", ...
Reads t.1.nodes, returns a list of nodes. Example: >>> self.getnodes("t.1.node", MyBar("nodes:")) [(0.0, 0.0, 0.0), (4.0, 0.0, 0.0), (0.0, 4.0, 0.0), (-4.0, 0.0, 0.0), (0.0, 0.0, 4.0), (0.0, -4.0, 0.0), (0.0, -0.0, -4.0), (-2.0, 0.0, -2.0), (-2.0, 2.0, 0.0), (0.0, 2.0, -2.0), (...
[ "Reads", "t", ".", "1", ".", "nodes", "returns", "a", "list", "of", "nodes", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/meshio.py#L977-L1008
53,180
vlukes/dicom2fem
dicom2fem/meshio.py
TetgenMeshIO.getele
def getele(fele, up=None, verbose=False): """ Reads t.1.ele, returns a list of elements. Example: >>> elements, regions = self.getele("t.1.ele", MyBar("elements:")) >>> elements [(20, 154, 122, 258), (86, 186, 134, 238), (15, 309, 170, 310), (146, 229, 145, 285)...
python
def getele(fele, up=None, verbose=False): """ Reads t.1.ele, returns a list of elements. Example: >>> elements, regions = self.getele("t.1.ele", MyBar("elements:")) >>> elements [(20, 154, 122, 258), (86, 186, 134, 238), (15, 309, 170, 310), (146, 229, 145, 285)...
[ "def", "getele", "(", "fele", ",", "up", "=", "None", ",", "verbose", "=", "False", ")", ":", "f", "=", "file", "(", "fele", ")", "l", "=", "[", "int", "(", "x", ")", "for", "x", "in", "f", ".", "readline", "(", ")", ".", "split", "(", ")",...
Reads t.1.ele, returns a list of elements. Example: >>> elements, regions = self.getele("t.1.ele", MyBar("elements:")) >>> elements [(20, 154, 122, 258), (86, 186, 134, 238), (15, 309, 170, 310), (146, 229, 145, 285), (206, 207, 125, 211), (99, 193, 39, 194), (185, 197, ...
[ "Reads", "t", ".", "1", ".", "ele", "returns", "a", "list", "of", "elements", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/meshio.py#L1013-L1074
53,181
vlukes/dicom2fem
dicom2fem/meshio.py
Mesh3DMeshIO._read_section
def _read_section(self, f, integer=True): """ Reads one section from the mesh3d file. integer ... if True, all numbers are passed to int(), otherwise to float(), before returning Some examples how a section can look like: 2 1 2 5 4 7 8 11 10 2 3 6 5...
python
def _read_section(self, f, integer=True): """ Reads one section from the mesh3d file. integer ... if True, all numbers are passed to int(), otherwise to float(), before returning Some examples how a section can look like: 2 1 2 5 4 7 8 11 10 2 3 6 5...
[ "def", "_read_section", "(", "self", ",", "f", ",", "integer", "=", "True", ")", ":", "if", "integer", ":", "dtype", "=", "int", "else", ":", "dtype", "=", "float", "l", "=", "self", ".", "_read_line", "(", "f", ")", "N", "=", "int", "(", "l", ...
Reads one section from the mesh3d file. integer ... if True, all numbers are passed to int(), otherwise to float(), before returning Some examples how a section can look like: 2 1 2 5 4 7 8 11 10 2 3 6 5 8 9 12 11 or 5 1 2 3 4 1 ...
[ "Reads", "one", "section", "from", "the", "mesh3d", "file", "." ]
3056c977ca7119e01984d3aa0c4448a1c6c2430f
https://github.com/vlukes/dicom2fem/blob/3056c977ca7119e01984d3aa0c4448a1c6c2430f/dicom2fem/meshio.py#L1727-L1765
53,182
luizalabs/ramos
ramos/mixins.py
SingletonCreateMixin.create
def create(cls): """ Return always the same instance of the backend class """ if cls not in cls._instances: cls._instances[cls] = cls() return cls._instances[cls]
python
def create(cls): """ Return always the same instance of the backend class """ if cls not in cls._instances: cls._instances[cls] = cls() return cls._instances[cls]
[ "def", "create", "(", "cls", ")", ":", "if", "cls", "not", "in", "cls", ".", "_instances", ":", "cls", ".", "_instances", "[", "cls", "]", "=", "cls", "(", ")", "return", "cls", ".", "_instances", "[", "cls", "]" ]
Return always the same instance of the backend class
[ "Return", "always", "the", "same", "instance", "of", "the", "backend", "class" ]
1bafbcd38824e6e2ae51927064efb66b1ea3325c
https://github.com/luizalabs/ramos/blob/1bafbcd38824e6e2ae51927064efb66b1ea3325c/ramos/mixins.py#L27-L34
53,183
jumpscale7/python-consistent-toml
contoml/file/peekableit.py
PeekableIterator.peek
def peek(self): """ Returns PeekableIterator.Nothing when the iterator is exhausted. """ try: v = next(self._iter) self._iter = itertools.chain((v,), self._iter) return v except StopIteration: return PeekableIterator.Nothing
python
def peek(self): """ Returns PeekableIterator.Nothing when the iterator is exhausted. """ try: v = next(self._iter) self._iter = itertools.chain((v,), self._iter) return v except StopIteration: return PeekableIterator.Nothing
[ "def", "peek", "(", "self", ")", ":", "try", ":", "v", "=", "next", "(", "self", ".", "_iter", ")", "self", ".", "_iter", "=", "itertools", ".", "chain", "(", "(", "v", ",", ")", ",", "self", ".", "_iter", ")", "return", "v", "except", "StopIte...
Returns PeekableIterator.Nothing when the iterator is exhausted.
[ "Returns", "PeekableIterator", ".", "Nothing", "when", "the", "iterator", "is", "exhausted", "." ]
a0149c65313ccb8170aa99a0cc498e76231292b9
https://github.com/jumpscale7/python-consistent-toml/blob/a0149c65313ccb8170aa99a0cc498e76231292b9/contoml/file/peekableit.py#L21-L30
53,184
jumpscale7/python-consistent-toml
contoml/file/freshtable.py
FreshTable._append_to_parent
def _append_to_parent(self): """ Causes this ephemeral table to be persisted on the TOMLFile. """ if self.__appended: return if self._parent is not None: self._parent.append_fresh_table(self) self.__appended = True
python
def _append_to_parent(self): """ Causes this ephemeral table to be persisted on the TOMLFile. """ if self.__appended: return if self._parent is not None: self._parent.append_fresh_table(self) self.__appended = True
[ "def", "_append_to_parent", "(", "self", ")", ":", "if", "self", ".", "__appended", ":", "return", "if", "self", ".", "_parent", "is", "not", "None", ":", "self", ".", "_parent", ".", "append_fresh_table", "(", "self", ")", "self", ".", "__appended", "="...
Causes this ephemeral table to be persisted on the TOMLFile.
[ "Causes", "this", "ephemeral", "table", "to", "be", "persisted", "on", "the", "TOMLFile", "." ]
a0149c65313ccb8170aa99a0cc498e76231292b9
https://github.com/jumpscale7/python-consistent-toml/blob/a0149c65313ccb8170aa99a0cc498e76231292b9/contoml/file/freshtable.py#L30-L41
53,185
Rediker-Software/doac
doac/handlers/bearer.py
BearerHandler.access_token
def access_token(self, value, request): """ Try to get the `AccessToken` associated with the provided token. *The provided value must pass `BearerHandler.validate()`* """ if self.validate(value, request) is not None: return None access_token = Acces...
python
def access_token(self, value, request): """ Try to get the `AccessToken` associated with the provided token. *The provided value must pass `BearerHandler.validate()`* """ if self.validate(value, request) is not None: return None access_token = Acces...
[ "def", "access_token", "(", "self", ",", "value", ",", "request", ")", ":", "if", "self", ".", "validate", "(", "value", ",", "request", ")", "is", "not", "None", ":", "return", "None", "access_token", "=", "AccessToken", ".", "objects", ".", "for_token"...
Try to get the `AccessToken` associated with the provided token. *The provided value must pass `BearerHandler.validate()`*
[ "Try", "to", "get", "the", "AccessToken", "associated", "with", "the", "provided", "token", "." ]
398fdd64452e4ff8662297b0381926addd77505a
https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/handlers/bearer.py#L9-L21
53,186
Rediker-Software/doac
doac/handlers/bearer.py
BearerHandler.validate
def validate(self, value, request): """ Try to get the `AccessToken` associated with the given token. The return value is determined based n a few things: - If no token is provided (`value` is None), a 400 response will be returned. - If an invalid token is provided, a 401 res...
python
def validate(self, value, request): """ Try to get the `AccessToken` associated with the given token. The return value is determined based n a few things: - If no token is provided (`value` is None), a 400 response will be returned. - If an invalid token is provided, a 401 res...
[ "def", "validate", "(", "self", ",", "value", ",", "request", ")", ":", "from", "django", ".", "http", "import", "HttpResponseBadRequest", "from", "doac", ".", "http", "import", "HttpResponseUnauthorized", "if", "not", "value", ":", "response", "=", "HttpRespo...
Try to get the `AccessToken` associated with the given token. The return value is determined based n a few things: - If no token is provided (`value` is None), a 400 response will be returned. - If an invalid token is provided, a 401 response will be returned. - If the token provided ...
[ "Try", "to", "get", "the", "AccessToken", "associated", "with", "the", "given", "token", "." ]
398fdd64452e4ff8662297b0381926addd77505a
https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/handlers/bearer.py#L37-L65
53,187
laplacesdemon/django-social-friends-finder
social_friends_finder/backends/twitter_backend.py
TwitterFriendsProvider.fetch_friends
def fetch_friends(self, user): """ fetches the friends from twitter using the information on django-social-auth models user is an instance of UserSocialAuth Returns: collection of friend objects fetched from facebook """ # Fetch the token key and sec...
python
def fetch_friends(self, user): """ fetches the friends from twitter using the information on django-social-auth models user is an instance of UserSocialAuth Returns: collection of friend objects fetched from facebook """ # Fetch the token key and sec...
[ "def", "fetch_friends", "(", "self", ",", "user", ")", ":", "# Fetch the token key and secret", "if", "USING_ALLAUTH", ":", "social_app", "=", "SocialApp", ".", "objects", ".", "get_current", "(", "'twitter'", ")", "consumer_key", "=", "social_app", ".", "key", ...
fetches the friends from twitter using the information on django-social-auth models user is an instance of UserSocialAuth Returns: collection of friend objects fetched from facebook
[ "fetches", "the", "friends", "from", "twitter", "using", "the", "information", "on", "django", "-", "social", "-", "auth", "models", "user", "is", "an", "instance", "of", "UserSocialAuth" ]
cad63349b19b3c301626c24420ace13c63f45ad7
https://github.com/laplacesdemon/django-social-friends-finder/blob/cad63349b19b3c301626c24420ace13c63f45ad7/social_friends_finder/backends/twitter_backend.py#L15-L50
53,188
laplacesdemon/django-social-friends-finder
social_friends_finder/backends/twitter_backend.py
TwitterFriendsProvider.fetch_friend_ids
def fetch_friend_ids(self, user): """ fethces friend id's from twitter Return: collection of friend ids """ friends = self.fetch_friends(user) friend_ids = [] for friend in friends: friend_ids.append(friend.id) return friend_ids
python
def fetch_friend_ids(self, user): """ fethces friend id's from twitter Return: collection of friend ids """ friends = self.fetch_friends(user) friend_ids = [] for friend in friends: friend_ids.append(friend.id) return friend_ids
[ "def", "fetch_friend_ids", "(", "self", ",", "user", ")", ":", "friends", "=", "self", ".", "fetch_friends", "(", "user", ")", "friend_ids", "=", "[", "]", "for", "friend", "in", "friends", ":", "friend_ids", ".", "append", "(", "friend", ".", "id", ")...
fethces friend id's from twitter Return: collection of friend ids
[ "fethces", "friend", "id", "s", "from", "twitter" ]
cad63349b19b3c301626c24420ace13c63f45ad7
https://github.com/laplacesdemon/django-social-friends-finder/blob/cad63349b19b3c301626c24420ace13c63f45ad7/social_friends_finder/backends/twitter_backend.py#L52-L63
53,189
meowklaski/custom_inherit
custom_inherit/_doc_parse_tools/numpy_parse_tools.py
merge_section
def merge_section(key, prnt_sec, child_sec): """ Synthesize a output numpy docstring section. Parameters ---------- key: str The numpy-section being merged. prnt_sec: Optional[str] The docstring section from the parent's attribute. child_sec: Optional...
python
def merge_section(key, prnt_sec, child_sec): """ Synthesize a output numpy docstring section. Parameters ---------- key: str The numpy-section being merged. prnt_sec: Optional[str] The docstring section from the parent's attribute. child_sec: Optional...
[ "def", "merge_section", "(", "key", ",", "prnt_sec", ",", "child_sec", ")", ":", "if", "prnt_sec", "is", "None", "and", "child_sec", "is", "None", ":", "return", "None", "if", "key", "==", "\"Short Summary\"", ":", "header", "=", "''", "else", ":", "head...
Synthesize a output numpy docstring section. Parameters ---------- key: str The numpy-section being merged. prnt_sec: Optional[str] The docstring section from the parent's attribute. child_sec: Optional[str] The docstring section from the chil...
[ "Synthesize", "a", "output", "numpy", "docstring", "section", "." ]
13bce675e246d84e21bcd7658e0a4fbf25db4adc
https://github.com/meowklaski/custom_inherit/blob/13bce675e246d84e21bcd7658e0a4fbf25db4adc/custom_inherit/_doc_parse_tools/numpy_parse_tools.py#L59-L87
53,190
jumpscale7/python-consistent-toml
contoml/file/structurer.py
structure
def structure(table_toplevels): """ Accepts an ordered sequence of TopLevel instances and returns a navigable object structure representation of the TOML file. """ table_toplevels = tuple(table_toplevels) obj = NamedDict() last_array_of_tables = None # The Name of the last array-of...
python
def structure(table_toplevels): """ Accepts an ordered sequence of TopLevel instances and returns a navigable object structure representation of the TOML file. """ table_toplevels = tuple(table_toplevels) obj = NamedDict() last_array_of_tables = None # The Name of the last array-of...
[ "def", "structure", "(", "table_toplevels", ")", ":", "table_toplevels", "=", "tuple", "(", "table_toplevels", ")", "obj", "=", "NamedDict", "(", ")", "last_array_of_tables", "=", "None", "# The Name of the last array-of-tables header", "for", "toplevel", "in", "table...
Accepts an ordered sequence of TopLevel instances and returns a navigable object structure representation of the TOML file.
[ "Accepts", "an", "ordered", "sequence", "of", "TopLevel", "instances", "and", "returns", "a", "navigable", "object", "structure", "representation", "of", "the", "TOML", "file", "." ]
a0149c65313ccb8170aa99a0cc498e76231292b9
https://github.com/jumpscale7/python-consistent-toml/blob/a0149c65313ccb8170aa99a0cc498e76231292b9/contoml/file/structurer.py#L74-L116
53,191
Rediker-Software/doac
doac/utils.py
prune_old_authorization_codes
def prune_old_authorization_codes(): """ Removes all unused and expired authorization codes from the database. """ from .compat import now from .models import AuthorizationCode AuthorizationCode.objects.with_expiration_before(now()).delete()
python
def prune_old_authorization_codes(): """ Removes all unused and expired authorization codes from the database. """ from .compat import now from .models import AuthorizationCode AuthorizationCode.objects.with_expiration_before(now()).delete()
[ "def", "prune_old_authorization_codes", "(", ")", ":", "from", ".", "compat", "import", "now", "from", ".", "models", "import", "AuthorizationCode", "AuthorizationCode", ".", "objects", ".", "with_expiration_before", "(", "now", "(", ")", ")", ".", "delete", "("...
Removes all unused and expired authorization codes from the database.
[ "Removes", "all", "unused", "and", "expired", "authorization", "codes", "from", "the", "database", "." ]
398fdd64452e4ff8662297b0381926addd77505a
https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/utils.py#L1-L9
53,192
Rediker-Software/doac
doac/utils.py
get_handler
def get_handler(handler_name): """ Imports the module for a DOAC handler based on the string representation of the module path that is provided. """ from .conf import options handlers = options.handlers for handler in handlers: handler_path = handler.split(".") name = ...
python
def get_handler(handler_name): """ Imports the module for a DOAC handler based on the string representation of the module path that is provided. """ from .conf import options handlers = options.handlers for handler in handlers: handler_path = handler.split(".") name = ...
[ "def", "get_handler", "(", "handler_name", ")", ":", "from", ".", "conf", "import", "options", "handlers", "=", "options", ".", "handlers", "for", "handler", "in", "handlers", ":", "handler_path", "=", "handler", ".", "split", "(", "\".\"", ")", "name", "=...
Imports the module for a DOAC handler based on the string representation of the module path that is provided.
[ "Imports", "the", "module", "for", "a", "DOAC", "handler", "based", "on", "the", "string", "representation", "of", "the", "module", "path", "that", "is", "provided", "." ]
398fdd64452e4ff8662297b0381926addd77505a
https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/utils.py#L12-L30
53,193
Rediker-Software/doac
doac/utils.py
request_error_header
def request_error_header(exception): """ Generates the error header for a request using a Bearer token based on a given OAuth exception. """ from .conf import options header = "Bearer realm=\"%s\"" % (options.realm, ) if hasattr(exception, "error"): header = header + ", error=...
python
def request_error_header(exception): """ Generates the error header for a request using a Bearer token based on a given OAuth exception. """ from .conf import options header = "Bearer realm=\"%s\"" % (options.realm, ) if hasattr(exception, "error"): header = header + ", error=...
[ "def", "request_error_header", "(", "exception", ")", ":", "from", ".", "conf", "import", "options", "header", "=", "\"Bearer realm=\\\"%s\\\"\"", "%", "(", "options", ".", "realm", ",", ")", "if", "hasattr", "(", "exception", ",", "\"error\"", ")", ":", "he...
Generates the error header for a request using a Bearer token based on a given OAuth exception.
[ "Generates", "the", "error", "header", "for", "a", "request", "using", "a", "Bearer", "token", "based", "on", "a", "given", "OAuth", "exception", "." ]
398fdd64452e4ff8662297b0381926addd77505a
https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/utils.py#L33-L48
53,194
Scoppio/RagnarokEngine3
Tutorials/Platforming Block - PyGame Release/Game/Code/TileHeroCharacter.py
TileHeroCharacter.set_default_pos
def set_default_pos(self, defaultPos): """Set the default starting location of our character.""" self.coords = defaultPos self.velocity = r.Vector2() self.desired_position = defaultPos r.Ragnarok.get_world().Camera.pan = self.coords r.Ragnarok.get_world().Camera.desired_p...
python
def set_default_pos(self, defaultPos): """Set the default starting location of our character.""" self.coords = defaultPos self.velocity = r.Vector2() self.desired_position = defaultPos r.Ragnarok.get_world().Camera.pan = self.coords r.Ragnarok.get_world().Camera.desired_p...
[ "def", "set_default_pos", "(", "self", ",", "defaultPos", ")", ":", "self", ".", "coords", "=", "defaultPos", "self", ".", "velocity", "=", "r", ".", "Vector2", "(", ")", "self", ".", "desired_position", "=", "defaultPos", "r", ".", "Ragnarok", ".", "get...
Set the default starting location of our character.
[ "Set", "the", "default", "starting", "location", "of", "our", "character", "." ]
4395d419ccd64fe9327c41f200b72ee0176ad896
https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/Tutorials/Platforming Block - PyGame Release/Game/Code/TileHeroCharacter.py#L40-L46
53,195
Scoppio/RagnarokEngine3
Tutorials/Tutorial 3 - Creating new entities/tuto3.py
Cloud.__generate_location
def __generate_location(self): """ Reset the location of the cloud once it has left the viewable area of the screen. """ screen_width = world.get_backbuffer_size().X self.movement_speed = random.randrange(10, 25) # This line of code places the cloud to the right of the v...
python
def __generate_location(self): """ Reset the location of the cloud once it has left the viewable area of the screen. """ screen_width = world.get_backbuffer_size().X self.movement_speed = random.randrange(10, 25) # This line of code places the cloud to the right of the v...
[ "def", "__generate_location", "(", "self", ")", ":", "screen_width", "=", "world", ".", "get_backbuffer_size", "(", ")", ".", "X", "self", ".", "movement_speed", "=", "random", ".", "randrange", "(", "10", ",", "25", ")", "# This line of code places the cloud to...
Reset the location of the cloud once it has left the viewable area of the screen.
[ "Reset", "the", "location", "of", "the", "cloud", "once", "it", "has", "left", "the", "viewable", "area", "of", "the", "screen", "." ]
4395d419ccd64fe9327c41f200b72ee0176ad896
https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/Tutorials/Tutorial 3 - Creating new entities/tuto3.py#L120-L130
53,196
meowklaski/custom_inherit
custom_inherit/_doc_parse_tools/rest_parse_tools.py
is_delimiter
def is_delimiter(line): """ True if a line consists only of a single punctuation character.""" return bool(line) and line[0] in punctuation and line[0]*len(line) == line
python
def is_delimiter(line): """ True if a line consists only of a single punctuation character.""" return bool(line) and line[0] in punctuation and line[0]*len(line) == line
[ "def", "is_delimiter", "(", "line", ")", ":", "return", "bool", "(", "line", ")", "and", "line", "[", "0", "]", "in", "punctuation", "and", "line", "[", "0", "]", "*", "len", "(", "line", ")", "==", "line" ]
True if a line consists only of a single punctuation character.
[ "True", "if", "a", "line", "consists", "only", "of", "a", "single", "punctuation", "character", "." ]
13bce675e246d84e21bcd7658e0a4fbf25db4adc
https://github.com/meowklaski/custom_inherit/blob/13bce675e246d84e21bcd7658e0a4fbf25db4adc/custom_inherit/_doc_parse_tools/rest_parse_tools.py#L9-L11
53,197
meowklaski/custom_inherit
custom_inherit/_doc_parse_tools/rest_parse_tools.py
parse_rest_doc
def parse_rest_doc(doc): """ Extract the headers, delimiters, and text from reST-formatted docstrings. Parameters ---------- doc: Union[str, None] Returns ------- Dict[str, Section] """ class Section(object): def __init__(self, header=None, body=None): ...
python
def parse_rest_doc(doc): """ Extract the headers, delimiters, and text from reST-formatted docstrings. Parameters ---------- doc: Union[str, None] Returns ------- Dict[str, Section] """ class Section(object): def __init__(self, header=None, body=None): ...
[ "def", "parse_rest_doc", "(", "doc", ")", ":", "class", "Section", "(", "object", ")", ":", "def", "__init__", "(", "self", ",", "header", "=", "None", ",", "body", "=", "None", ")", ":", "self", ".", "header", "=", "header", "# str", "self", ".", ...
Extract the headers, delimiters, and text from reST-formatted docstrings. Parameters ---------- doc: Union[str, None] Returns ------- Dict[str, Section]
[ "Extract", "the", "headers", "delimiters", "and", "text", "from", "reST", "-", "formatted", "docstrings", "." ]
13bce675e246d84e21bcd7658e0a4fbf25db4adc
https://github.com/meowklaski/custom_inherit/blob/13bce675e246d84e21bcd7658e0a4fbf25db4adc/custom_inherit/_doc_parse_tools/rest_parse_tools.py#L14-L67
53,198
meowklaski/custom_inherit
custom_inherit/_doc_parse_tools/rest_parse_tools.py
merge_rest_docs
def merge_rest_docs(prnt_doc=None, child_doc=None): """ See custom_inherit.style_store.reST for details. """ prnt_sections = parse_rest_doc(prnt_doc) child_sections = parse_rest_doc(child_doc) header = prnt_sections[''] prnt_sections.update(child_sections) if not child_sections[''].body: ...
python
def merge_rest_docs(prnt_doc=None, child_doc=None): """ See custom_inherit.style_store.reST for details. """ prnt_sections = parse_rest_doc(prnt_doc) child_sections = parse_rest_doc(child_doc) header = prnt_sections[''] prnt_sections.update(child_sections) if not child_sections[''].body: ...
[ "def", "merge_rest_docs", "(", "prnt_doc", "=", "None", ",", "child_doc", "=", "None", ")", ":", "prnt_sections", "=", "parse_rest_doc", "(", "prnt_doc", ")", "child_sections", "=", "parse_rest_doc", "(", "child_doc", ")", "header", "=", "prnt_sections", "[", ...
See custom_inherit.style_store.reST for details.
[ "See", "custom_inherit", ".", "style_store", ".", "reST", "for", "details", "." ]
13bce675e246d84e21bcd7658e0a4fbf25db4adc
https://github.com/meowklaski/custom_inherit/blob/13bce675e246d84e21bcd7658e0a4fbf25db4adc/custom_inherit/_doc_parse_tools/rest_parse_tools.py#L70-L82
53,199
chrisballinger/python-localizable
localizable.py
parse_strings
def parse_strings(content="", filename=None): """Parse an apple .strings file and create a stringset with all entries in the file. See http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPInternational/Articles/StringsFiles.html for details. """ if filename is not None:...
python
def parse_strings(content="", filename=None): """Parse an apple .strings file and create a stringset with all entries in the file. See http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPInternational/Articles/StringsFiles.html for details. """ if filename is not None:...
[ "def", "parse_strings", "(", "content", "=", "\"\"", ",", "filename", "=", "None", ")", ":", "if", "filename", "is", "not", "None", ":", "content", "=", "_get_content", "(", "filename", "=", "filename", ")", "stringset", "=", "[", "]", "f", "=", "conte...
Parse an apple .strings file and create a stringset with all entries in the file. See http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPInternational/Articles/StringsFiles.html for details.
[ "Parse", "an", "apple", ".", "strings", "file", "and", "create", "a", "stringset", "with", "all", "entries", "in", "the", "file", "." ]
15d3bf2466d0de1a826d3f0ff1f365b0c1910f56
https://github.com/chrisballinger/python-localizable/blob/15d3bf2466d0de1a826d3f0ff1f365b0c1910f56/localizable.py#L63-L103