repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
geomet/geomet | geomet/wkt.py | _load_multilinestring | def _load_multilinestring(tokens, string):
"""
Has similar inputs and return value to to :func:`_load_point`, except is
for handling MULTILINESTRING geometry.
:returns:
A GeoJSON `dict` MultiLineString representation of the WKT ``string``.
"""
open_paren = next(tokens)
if not open_p... | python | def _load_multilinestring(tokens, string):
"""
Has similar inputs and return value to to :func:`_load_point`, except is
for handling MULTILINESTRING geometry.
:returns:
A GeoJSON `dict` MultiLineString representation of the WKT ``string``.
"""
open_paren = next(tokens)
if not open_p... | [
"def",
"_load_multilinestring",
"(",
"tokens",
",",
"string",
")",
":",
"open_paren",
"=",
"next",
"(",
"tokens",
")",
"if",
"not",
"open_paren",
"==",
"'('",
":",
"raise",
"ValueError",
"(",
"INVALID_WKT_FMT",
"%",
"string",
")",
"linestrs",
"=",
"[",
"]"... | Has similar inputs and return value to to :func:`_load_point`, except is
for handling MULTILINESTRING geometry.
:returns:
A GeoJSON `dict` MultiLineString representation of the WKT ``string``. | [
"Has",
"similar",
"inputs",
"and",
"return",
"value",
"to",
"to",
":",
"func",
":",
"_load_point",
"except",
"is",
"for",
"handling",
"MULTILINESTRING",
"geometry",
"."
] | b82d7118113ab723751eba3de5df98c368423c2b | https://github.com/geomet/geomet/blob/b82d7118113ab723751eba3de5df98c368423c2b/geomet/wkt.py#L520-L545 | train |
geomet/geomet | geomet/wkt.py | _load_geometrycollection | def _load_geometrycollection(tokens, string):
"""
Has similar inputs and return value to to :func:`_load_point`, except is
for handling GEOMETRYCOLLECTIONs.
Delegates parsing to the parsers for the individual geometry types.
:returns:
A GeoJSON `dict` GeometryCollection representation of t... | python | def _load_geometrycollection(tokens, string):
"""
Has similar inputs and return value to to :func:`_load_point`, except is
for handling GEOMETRYCOLLECTIONs.
Delegates parsing to the parsers for the individual geometry types.
:returns:
A GeoJSON `dict` GeometryCollection representation of t... | [
"def",
"_load_geometrycollection",
"(",
"tokens",
",",
"string",
")",
":",
"open_paren",
"=",
"next",
"(",
"tokens",
")",
"if",
"not",
"open_paren",
"==",
"'('",
":",
"raise",
"ValueError",
"(",
"INVALID_WKT_FMT",
"%",
"string",
")",
"geoms",
"=",
"[",
"]"... | Has similar inputs and return value to to :func:`_load_point`, except is
for handling GEOMETRYCOLLECTIONs.
Delegates parsing to the parsers for the individual geometry types.
:returns:
A GeoJSON `dict` GeometryCollection representation of the WKT
``string``. | [
"Has",
"similar",
"inputs",
"and",
"return",
"value",
"to",
"to",
":",
"func",
":",
"_load_point",
"except",
"is",
"for",
"handling",
"GEOMETRYCOLLECTIONs",
"."
] | b82d7118113ab723751eba3de5df98c368423c2b | https://github.com/geomet/geomet/blob/b82d7118113ab723751eba3de5df98c368423c2b/geomet/wkt.py#L548-L580 | train |
yola/demands | demands/__init__.py | HTTPServiceClient._get_request_params | def _get_request_params(self, **kwargs):
"""Merge shared params and new params."""
request_params = copy.deepcopy(self._shared_request_params)
for key, value in iteritems(kwargs):
if isinstance(value, dict) and key in request_params:
# ensure we don't lose dict values... | python | def _get_request_params(self, **kwargs):
"""Merge shared params and new params."""
request_params = copy.deepcopy(self._shared_request_params)
for key, value in iteritems(kwargs):
if isinstance(value, dict) and key in request_params:
# ensure we don't lose dict values... | [
"def",
"_get_request_params",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"request_params",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
".",
"_shared_request_params",
")",
"for",
"key",
",",
"value",
"in",
"iteritems",
"(",
"kwargs",
")",
":",
"if",
"... | Merge shared params and new params. | [
"Merge",
"shared",
"params",
"and",
"new",
"params",
"."
] | 816ae4a2684f077f5bb555844ee5f14228b20dba | https://github.com/yola/demands/blob/816ae4a2684f077f5bb555844ee5f14228b20dba/demands/__init__.py#L66-L75 | train |
yola/demands | demands/__init__.py | HTTPServiceClient._sanitize_request_params | def _sanitize_request_params(self, request_params):
"""Remove keyword arguments not used by `requests`"""
if 'verify_ssl' in request_params:
request_params['verify'] = request_params.pop('verify_ssl')
return dict((key, val) for key, val in request_params.items()
i... | python | def _sanitize_request_params(self, request_params):
"""Remove keyword arguments not used by `requests`"""
if 'verify_ssl' in request_params:
request_params['verify'] = request_params.pop('verify_ssl')
return dict((key, val) for key, val in request_params.items()
i... | [
"def",
"_sanitize_request_params",
"(",
"self",
",",
"request_params",
")",
":",
"if",
"'verify_ssl'",
"in",
"request_params",
":",
"request_params",
"[",
"'verify'",
"]",
"=",
"request_params",
".",
"pop",
"(",
"'verify_ssl'",
")",
"return",
"dict",
"(",
"(",
... | Remove keyword arguments not used by `requests` | [
"Remove",
"keyword",
"arguments",
"not",
"used",
"by",
"requests"
] | 816ae4a2684f077f5bb555844ee5f14228b20dba | https://github.com/yola/demands/blob/816ae4a2684f077f5bb555844ee5f14228b20dba/demands/__init__.py#L77-L82 | train |
yola/demands | demands/__init__.py | HTTPServiceClient.request | def request(self, method, path, **kwargs):
"""Send a :class:`requests.Request` and demand a
:class:`requests.Response`
"""
if path:
url = '%s/%s' % (self.url.rstrip('/'), path.lstrip('/'))
else:
url = self.url
request_params = self._get_request_pa... | python | def request(self, method, path, **kwargs):
"""Send a :class:`requests.Request` and demand a
:class:`requests.Response`
"""
if path:
url = '%s/%s' % (self.url.rstrip('/'), path.lstrip('/'))
else:
url = self.url
request_params = self._get_request_pa... | [
"def",
"request",
"(",
"self",
",",
"method",
",",
"path",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"path",
":",
"url",
"=",
"'%s/%s'",
"%",
"(",
"self",
".",
"url",
".",
"rstrip",
"(",
"'/'",
")",
",",
"path",
".",
"lstrip",
"(",
"'/'",
")",
... | Send a :class:`requests.Request` and demand a
:class:`requests.Response` | [
"Send",
"a",
":",
"class",
":",
"requests",
".",
"Request",
"and",
"demand",
"a",
":",
"class",
":",
"requests",
".",
"Response"
] | 816ae4a2684f077f5bb555844ee5f14228b20dba | https://github.com/yola/demands/blob/816ae4a2684f077f5bb555844ee5f14228b20dba/demands/__init__.py#L84-L115 | train |
yola/demands | demands/__init__.py | HTTPServiceClient.pre_send | def pre_send(self, request_params):
"""Override this method to modify sent request parameters"""
for adapter in itervalues(self.adapters):
adapter.max_retries = request_params.get('max_retries', 0)
return request_params | python | def pre_send(self, request_params):
"""Override this method to modify sent request parameters"""
for adapter in itervalues(self.adapters):
adapter.max_retries = request_params.get('max_retries', 0)
return request_params | [
"def",
"pre_send",
"(",
"self",
",",
"request_params",
")",
":",
"for",
"adapter",
"in",
"itervalues",
"(",
"self",
".",
"adapters",
")",
":",
"adapter",
".",
"max_retries",
"=",
"request_params",
".",
"get",
"(",
"'max_retries'",
",",
"0",
")",
"return",
... | Override this method to modify sent request parameters | [
"Override",
"this",
"method",
"to",
"modify",
"sent",
"request",
"parameters"
] | 816ae4a2684f077f5bb555844ee5f14228b20dba | https://github.com/yola/demands/blob/816ae4a2684f077f5bb555844ee5f14228b20dba/demands/__init__.py#L117-L122 | train |
yola/demands | demands/__init__.py | HTTPServiceClient.is_acceptable | def is_acceptable(self, response, request_params):
"""
Override this method to create a different definition of
what kind of response is acceptable.
If `bool(the_return_value) is False` then an `HTTPServiceError`
will be raised.
For example, you might want to assert that... | python | def is_acceptable(self, response, request_params):
"""
Override this method to create a different definition of
what kind of response is acceptable.
If `bool(the_return_value) is False` then an `HTTPServiceError`
will be raised.
For example, you might want to assert that... | [
"def",
"is_acceptable",
"(",
"self",
",",
"response",
",",
"request_params",
")",
":",
"expected_codes",
"=",
"request_params",
".",
"get",
"(",
"'expected_response_codes'",
",",
"[",
"]",
")",
"return",
"response",
".",
"is_ok",
"or",
"response",
".",
"status... | Override this method to create a different definition of
what kind of response is acceptable.
If `bool(the_return_value) is False` then an `HTTPServiceError`
will be raised.
For example, you might want to assert that the body must be empty,
so you could return `len(response.cont... | [
"Override",
"this",
"method",
"to",
"create",
"a",
"different",
"definition",
"of",
"what",
"kind",
"of",
"response",
"is",
"acceptable",
".",
"If",
"bool",
"(",
"the_return_value",
")",
"is",
"False",
"then",
"an",
"HTTPServiceError",
"will",
"be",
"raised",
... | 816ae4a2684f077f5bb555844ee5f14228b20dba | https://github.com/yola/demands/blob/816ae4a2684f077f5bb555844ee5f14228b20dba/demands/__init__.py#L128-L144 | train |
flatangle/flatlib | flatlib/angle.py | _roundSlist | def _roundSlist(slist):
""" Rounds a signed list over the last element and removes it. """
slist[-1] = 60 if slist[-1] >= 30 else 0
for i in range(len(slist)-1, 1, -1):
if slist[i] == 60:
slist[i] = 0
slist[i-1] += 1
return slist[:-1] | python | def _roundSlist(slist):
""" Rounds a signed list over the last element and removes it. """
slist[-1] = 60 if slist[-1] >= 30 else 0
for i in range(len(slist)-1, 1, -1):
if slist[i] == 60:
slist[i] = 0
slist[i-1] += 1
return slist[:-1] | [
"def",
"_roundSlist",
"(",
"slist",
")",
":",
"slist",
"[",
"-",
"1",
"]",
"=",
"60",
"if",
"slist",
"[",
"-",
"1",
"]",
">=",
"30",
"else",
"0",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"slist",
")",
"-",
"1",
",",
"1",
",",
"-",
"1",
... | Rounds a signed list over the last element and removes it. | [
"Rounds",
"a",
"signed",
"list",
"over",
"the",
"last",
"element",
"and",
"removes",
"it",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/angle.py#L58-L65 | train |
flatangle/flatlib | flatlib/angle.py | strSlist | def strSlist(string):
""" Converts angle string to signed list. """
sign = '-' if string[0] == '-' else '+'
values = [abs(int(x)) for x in string.split(':')]
return _fixSlist(list(sign) + values) | python | def strSlist(string):
""" Converts angle string to signed list. """
sign = '-' if string[0] == '-' else '+'
values = [abs(int(x)) for x in string.split(':')]
return _fixSlist(list(sign) + values) | [
"def",
"strSlist",
"(",
"string",
")",
":",
"sign",
"=",
"'-'",
"if",
"string",
"[",
"0",
"]",
"==",
"'-'",
"else",
"'+'",
"values",
"=",
"[",
"abs",
"(",
"int",
"(",
"x",
")",
")",
"for",
"x",
"in",
"string",
".",
"split",
"(",
"':'",
")",
"... | Converts angle string to signed list. | [
"Converts",
"angle",
"string",
"to",
"signed",
"list",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/angle.py#L70-L74 | train |
flatangle/flatlib | flatlib/angle.py | slistStr | def slistStr(slist):
""" Converts signed list to angle string. """
slist = _fixSlist(slist)
string = ':'.join(['%02d' % x for x in slist[1:]])
return slist[0] + string | python | def slistStr(slist):
""" Converts signed list to angle string. """
slist = _fixSlist(slist)
string = ':'.join(['%02d' % x for x in slist[1:]])
return slist[0] + string | [
"def",
"slistStr",
"(",
"slist",
")",
":",
"slist",
"=",
"_fixSlist",
"(",
"slist",
")",
"string",
"=",
"':'",
".",
"join",
"(",
"[",
"'%02d'",
"%",
"x",
"for",
"x",
"in",
"slist",
"[",
"1",
":",
"]",
"]",
")",
"return",
"slist",
"[",
"0",
"]",... | Converts signed list to angle string. | [
"Converts",
"signed",
"list",
"to",
"angle",
"string",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/angle.py#L76-L80 | train |
flatangle/flatlib | flatlib/angle.py | slistFloat | def slistFloat(slist):
""" Converts signed list to float. """
values = [v / 60**(i) for (i,v) in enumerate(slist[1:])]
value = sum(values)
return -value if slist[0] == '-' else value | python | def slistFloat(slist):
""" Converts signed list to float. """
values = [v / 60**(i) for (i,v) in enumerate(slist[1:])]
value = sum(values)
return -value if slist[0] == '-' else value | [
"def",
"slistFloat",
"(",
"slist",
")",
":",
"values",
"=",
"[",
"v",
"/",
"60",
"**",
"(",
"i",
")",
"for",
"(",
"i",
",",
"v",
")",
"in",
"enumerate",
"(",
"slist",
"[",
"1",
":",
"]",
")",
"]",
"value",
"=",
"sum",
"(",
"values",
")",
"r... | Converts signed list to float. | [
"Converts",
"signed",
"list",
"to",
"float",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/angle.py#L82-L86 | train |
flatangle/flatlib | flatlib/angle.py | floatSlist | def floatSlist(value):
""" Converts float to signed list. """
slist = ['+', 0, 0, 0, 0]
if value < 0:
slist[0] = '-'
value = abs(value)
for i in range(1,5):
slist[i] = math.floor(value)
value = (value - slist[i]) * 60
return _roundSlist(slist) | python | def floatSlist(value):
""" Converts float to signed list. """
slist = ['+', 0, 0, 0, 0]
if value < 0:
slist[0] = '-'
value = abs(value)
for i in range(1,5):
slist[i] = math.floor(value)
value = (value - slist[i]) * 60
return _roundSlist(slist) | [
"def",
"floatSlist",
"(",
"value",
")",
":",
"slist",
"=",
"[",
"'+'",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
"]",
"if",
"value",
"<",
"0",
":",
"slist",
"[",
"0",
"]",
"=",
"'-'",
"value",
"=",
"abs",
"(",
"value",
")",
"for",
"i",
"in",
... | Converts float to signed list. | [
"Converts",
"float",
"to",
"signed",
"list",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/angle.py#L88-L97 | train |
flatangle/flatlib | flatlib/angle.py | toFloat | def toFloat(value):
""" Converts string or signed list to float. """
if isinstance(value, str):
return strFloat(value)
elif isinstance(value, list):
return slistFloat(value)
else:
return value | python | def toFloat(value):
""" Converts string or signed list to float. """
if isinstance(value, str):
return strFloat(value)
elif isinstance(value, list):
return slistFloat(value)
else:
return value | [
"def",
"toFloat",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"return",
"strFloat",
"(",
"value",
")",
"elif",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"return",
"slistFloat",
"(",
"value",
")",
"else",
"... | Converts string or signed list to float. | [
"Converts",
"string",
"or",
"signed",
"list",
"to",
"float",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/angle.py#L112-L119 | train |
flatangle/flatlib | flatlib/tools/chartdynamics.py | ChartDynamics.inDignities | def inDignities(self, idA, idB):
""" Returns the dignities of A which belong to B. """
objA = self.chart.get(idA)
info = essential.getInfo(objA.sign, objA.signlon)
# Should we ignore exile and fall?
return [dign for (dign, ID) in info.items() if ID == idB] | python | def inDignities(self, idA, idB):
""" Returns the dignities of A which belong to B. """
objA = self.chart.get(idA)
info = essential.getInfo(objA.sign, objA.signlon)
# Should we ignore exile and fall?
return [dign for (dign, ID) in info.items() if ID == idB] | [
"def",
"inDignities",
"(",
"self",
",",
"idA",
",",
"idB",
")",
":",
"objA",
"=",
"self",
".",
"chart",
".",
"get",
"(",
"idA",
")",
"info",
"=",
"essential",
".",
"getInfo",
"(",
"objA",
".",
"sign",
",",
"objA",
".",
"signlon",
")",
"# Should we ... | Returns the dignities of A which belong to B. | [
"Returns",
"the",
"dignities",
"of",
"A",
"which",
"belong",
"to",
"B",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/tools/chartdynamics.py#L29-L34 | train |
flatangle/flatlib | flatlib/tools/chartdynamics.py | ChartDynamics.receives | def receives(self, idA, idB):
""" Returns the dignities where A receives B.
A receives B when (1) B aspects A and (2) B is in
dignities of A.
"""
objA = self.chart.get(idA)
objB = self.chart.get(idB)
asp = aspects.isAspecting(objB, objA, const.MAJOR_ASPECTS)
... | python | def receives(self, idA, idB):
""" Returns the dignities where A receives B.
A receives B when (1) B aspects A and (2) B is in
dignities of A.
"""
objA = self.chart.get(idA)
objB = self.chart.get(idB)
asp = aspects.isAspecting(objB, objA, const.MAJOR_ASPECTS)
... | [
"def",
"receives",
"(",
"self",
",",
"idA",
",",
"idB",
")",
":",
"objA",
"=",
"self",
".",
"chart",
".",
"get",
"(",
"idA",
")",
"objB",
"=",
"self",
".",
"chart",
".",
"get",
"(",
"idB",
")",
"asp",
"=",
"aspects",
".",
"isAspecting",
"(",
"o... | Returns the dignities where A receives B.
A receives B when (1) B aspects A and (2) B is in
dignities of A. | [
"Returns",
"the",
"dignities",
"where",
"A",
"receives",
"B",
".",
"A",
"receives",
"B",
"when",
"(",
"1",
")",
"B",
"aspects",
"A",
"and",
"(",
"2",
")",
"B",
"is",
"in",
"dignities",
"of",
"A",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/tools/chartdynamics.py#L36-L45 | train |
flatangle/flatlib | flatlib/tools/chartdynamics.py | ChartDynamics.mutualReceptions | def mutualReceptions(self, idA, idB):
""" Returns all pairs of dignities in mutual reception. """
AB = self.receives(idA, idB)
BA = self.receives(idB, idA)
# Returns a product of both lists
return [(a,b) for a in AB for b in BA] | python | def mutualReceptions(self, idA, idB):
""" Returns all pairs of dignities in mutual reception. """
AB = self.receives(idA, idB)
BA = self.receives(idB, idA)
# Returns a product of both lists
return [(a,b) for a in AB for b in BA] | [
"def",
"mutualReceptions",
"(",
"self",
",",
"idA",
",",
"idB",
")",
":",
"AB",
"=",
"self",
".",
"receives",
"(",
"idA",
",",
"idB",
")",
"BA",
"=",
"self",
".",
"receives",
"(",
"idB",
",",
"idA",
")",
"# Returns a product of both lists",
"return",
"... | Returns all pairs of dignities in mutual reception. | [
"Returns",
"all",
"pairs",
"of",
"dignities",
"in",
"mutual",
"reception",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/tools/chartdynamics.py#L51-L56 | train |
flatangle/flatlib | flatlib/tools/chartdynamics.py | ChartDynamics.reMutualReceptions | def reMutualReceptions(self, idA, idB):
""" Returns ruler and exaltation mutual receptions. """
mr = self.mutualReceptions(idA, idB)
filter_ = ['ruler', 'exalt']
# Each pair of dignities must be 'ruler' or 'exalt'
return [(a,b) for (a,b) in mr if (a in filter_ and b in filter_)] | python | def reMutualReceptions(self, idA, idB):
""" Returns ruler and exaltation mutual receptions. """
mr = self.mutualReceptions(idA, idB)
filter_ = ['ruler', 'exalt']
# Each pair of dignities must be 'ruler' or 'exalt'
return [(a,b) for (a,b) in mr if (a in filter_ and b in filter_)] | [
"def",
"reMutualReceptions",
"(",
"self",
",",
"idA",
",",
"idB",
")",
":",
"mr",
"=",
"self",
".",
"mutualReceptions",
"(",
"idA",
",",
"idB",
")",
"filter_",
"=",
"[",
"'ruler'",
",",
"'exalt'",
"]",
"# Each pair of dignities must be 'ruler' or 'exalt'",
"re... | Returns ruler and exaltation mutual receptions. | [
"Returns",
"ruler",
"and",
"exaltation",
"mutual",
"receptions",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/tools/chartdynamics.py#L58-L63 | train |
flatangle/flatlib | flatlib/tools/chartdynamics.py | ChartDynamics.validAspects | def validAspects(self, ID, aspList):
""" Returns a list with the aspects an object
makes with the other six planets, considering a
list of possible aspects.
"""
obj = self.chart.getObject(ID)
res = []
for otherID in const.LIST_SEVEN_PLANETS:
... | python | def validAspects(self, ID, aspList):
""" Returns a list with the aspects an object
makes with the other six planets, considering a
list of possible aspects.
"""
obj = self.chart.getObject(ID)
res = []
for otherID in const.LIST_SEVEN_PLANETS:
... | [
"def",
"validAspects",
"(",
"self",
",",
"ID",
",",
"aspList",
")",
":",
"obj",
"=",
"self",
".",
"chart",
".",
"getObject",
"(",
"ID",
")",
"res",
"=",
"[",
"]",
"for",
"otherID",
"in",
"const",
".",
"LIST_SEVEN_PLANETS",
":",
"if",
"ID",
"==",
"o... | Returns a list with the aspects an object
makes with the other six planets, considering a
list of possible aspects. | [
"Returns",
"a",
"list",
"with",
"the",
"aspects",
"an",
"object",
"makes",
"with",
"the",
"other",
"six",
"planets",
"considering",
"a",
"list",
"of",
"possible",
"aspects",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/tools/chartdynamics.py#L68-L88 | train |
flatangle/flatlib | flatlib/tools/chartdynamics.py | ChartDynamics.aspectsByCat | def aspectsByCat(self, ID, aspList):
""" Returns the aspects an object makes with the
other six planets, separated by category (applicative,
separative, exact).
Aspects must be within orb of the object.
"""
res = {
const.APPLICATIVE: [],
... | python | def aspectsByCat(self, ID, aspList):
""" Returns the aspects an object makes with the
other six planets, separated by category (applicative,
separative, exact).
Aspects must be within orb of the object.
"""
res = {
const.APPLICATIVE: [],
... | [
"def",
"aspectsByCat",
"(",
"self",
",",
"ID",
",",
"aspList",
")",
":",
"res",
"=",
"{",
"const",
".",
"APPLICATIVE",
":",
"[",
"]",
",",
"const",
".",
"SEPARATIVE",
":",
"[",
"]",
",",
"const",
".",
"EXACT",
":",
"[",
"]",
",",
"const",
".",
... | Returns the aspects an object makes with the
other six planets, separated by category (applicative,
separative, exact).
Aspects must be within orb of the object. | [
"Returns",
"the",
"aspects",
"an",
"object",
"makes",
"with",
"the",
"other",
"six",
"planets",
"separated",
"by",
"category",
"(",
"applicative",
"separative",
"exact",
")",
".",
"Aspects",
"must",
"be",
"within",
"orb",
"of",
"the",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/tools/chartdynamics.py#L90-L118 | train |
flatangle/flatlib | flatlib/tools/chartdynamics.py | ChartDynamics.immediateAspects | def immediateAspects(self, ID, aspList):
""" Returns the last separation and next application
considering a list of possible aspects.
"""
asps = self.aspectsByCat(ID, aspList)
applications = asps[const.APPLICATIVE]
separations = asps[const.SEPARATIVE]
exact = as... | python | def immediateAspects(self, ID, aspList):
""" Returns the last separation and next application
considering a list of possible aspects.
"""
asps = self.aspectsByCat(ID, aspList)
applications = asps[const.APPLICATIVE]
separations = asps[const.SEPARATIVE]
exact = as... | [
"def",
"immediateAspects",
"(",
"self",
",",
"ID",
",",
"aspList",
")",
":",
"asps",
"=",
"self",
".",
"aspectsByCat",
"(",
"ID",
",",
"aspList",
")",
"applications",
"=",
"asps",
"[",
"const",
".",
"APPLICATIVE",
"]",
"separations",
"=",
"asps",
"[",
... | Returns the last separation and next application
considering a list of possible aspects. | [
"Returns",
"the",
"last",
"separation",
"and",
"next",
"application",
"considering",
"a",
"list",
"of",
"possible",
"aspects",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/tools/chartdynamics.py#L120-L141 | train |
flatangle/flatlib | flatlib/tools/chartdynamics.py | ChartDynamics.isVOC | def isVOC(self, ID):
""" Returns if a planet is Void of Course.
A planet is not VOC if has any exact or applicative aspects
ignoring the sign status (associate or dissociate).
"""
asps = self.aspectsByCat(ID, const.MAJOR_ASPECTS)
applications = asps[const.APPLICA... | python | def isVOC(self, ID):
""" Returns if a planet is Void of Course.
A planet is not VOC if has any exact or applicative aspects
ignoring the sign status (associate or dissociate).
"""
asps = self.aspectsByCat(ID, const.MAJOR_ASPECTS)
applications = asps[const.APPLICA... | [
"def",
"isVOC",
"(",
"self",
",",
"ID",
")",
":",
"asps",
"=",
"self",
".",
"aspectsByCat",
"(",
"ID",
",",
"const",
".",
"MAJOR_ASPECTS",
")",
"applications",
"=",
"asps",
"[",
"const",
".",
"APPLICATIVE",
"]",
"exacts",
"=",
"asps",
"[",
"const",
"... | Returns if a planet is Void of Course.
A planet is not VOC if has any exact or applicative aspects
ignoring the sign status (associate or dissociate). | [
"Returns",
"if",
"a",
"planet",
"is",
"Void",
"of",
"Course",
".",
"A",
"planet",
"is",
"not",
"VOC",
"if",
"has",
"any",
"exact",
"or",
"applicative",
"aspects",
"ignoring",
"the",
"sign",
"status",
"(",
"associate",
"or",
"dissociate",
")",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/tools/chartdynamics.py#L143-L152 | train |
flatangle/flatlib | flatlib/protocols/temperament.py | singleFactor | def singleFactor(factors, chart, factor, obj, aspect=None):
"""" Single factor for the table. """
objID = obj if type(obj) == str else obj.id
res = {
'factor': factor,
'objID': objID,
'aspect': aspect
}
# For signs (obj as string) return sign element
if type(obj... | python | def singleFactor(factors, chart, factor, obj, aspect=None):
"""" Single factor for the table. """
objID = obj if type(obj) == str else obj.id
res = {
'factor': factor,
'objID': objID,
'aspect': aspect
}
# For signs (obj as string) return sign element
if type(obj... | [
"def",
"singleFactor",
"(",
"factors",
",",
"chart",
",",
"factor",
",",
"obj",
",",
"aspect",
"=",
"None",
")",
":",
"objID",
"=",
"obj",
"if",
"type",
"(",
"obj",
")",
"==",
"str",
"else",
"obj",
".",
"id",
"res",
"=",
"{",
"'factor'",
":",
"fa... | Single factor for the table. | [
"Single",
"factor",
"for",
"the",
"table",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/protocols/temperament.py#L44-L87 | train |
flatangle/flatlib | flatlib/protocols/temperament.py | modifierFactor | def modifierFactor(chart, factor, factorObj, otherObj, aspList):
""" Computes a factor for a modifier. """
asp = aspects.aspectType(factorObj, otherObj, aspList)
if asp != const.NO_ASPECT:
return {
'factor': factor,
'aspect': asp,
'objID': otherObj.id,
... | python | def modifierFactor(chart, factor, factorObj, otherObj, aspList):
""" Computes a factor for a modifier. """
asp = aspects.aspectType(factorObj, otherObj, aspList)
if asp != const.NO_ASPECT:
return {
'factor': factor,
'aspect': asp,
'objID': otherObj.id,
... | [
"def",
"modifierFactor",
"(",
"chart",
",",
"factor",
",",
"factorObj",
",",
"otherObj",
",",
"aspList",
")",
":",
"asp",
"=",
"aspects",
".",
"aspectType",
"(",
"factorObj",
",",
"otherObj",
",",
"aspList",
")",
"if",
"asp",
"!=",
"const",
".",
"NO_ASPE... | Computes a factor for a modifier. | [
"Computes",
"a",
"factor",
"for",
"a",
"modifier",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/protocols/temperament.py#L90-L101 | train |
flatangle/flatlib | flatlib/protocols/temperament.py | getFactors | def getFactors(chart):
""" Returns the factors for the temperament. """
factors = []
# Asc sign
asc = chart.getAngle(const.ASC)
singleFactor(factors, chart, ASC_SIGN, asc.sign)
# Asc ruler
ascRulerID = essential.ruler(asc.sign)
ascRuler = chart.getObject(ascRulerID)
si... | python | def getFactors(chart):
""" Returns the factors for the temperament. """
factors = []
# Asc sign
asc = chart.getAngle(const.ASC)
singleFactor(factors, chart, ASC_SIGN, asc.sign)
# Asc ruler
ascRulerID = essential.ruler(asc.sign)
ascRuler = chart.getObject(ascRulerID)
si... | [
"def",
"getFactors",
"(",
"chart",
")",
":",
"factors",
"=",
"[",
"]",
"# Asc sign",
"asc",
"=",
"chart",
".",
"getAngle",
"(",
"const",
".",
"ASC",
")",
"singleFactor",
"(",
"factors",
",",
"chart",
",",
"ASC_SIGN",
",",
"asc",
".",
"sign",
")",
"# ... | Returns the factors for the temperament. | [
"Returns",
"the",
"factors",
"for",
"the",
"temperament",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/protocols/temperament.py#L106-L168 | train |
flatangle/flatlib | flatlib/protocols/temperament.py | getModifiers | def getModifiers(chart):
""" Returns the factors of the temperament modifiers. """
modifiers = []
# Factors which can be affected
asc = chart.getAngle(const.ASC)
ascRulerID = essential.ruler(asc.sign)
ascRuler = chart.getObject(ascRulerID)
moon = chart.getObject(const.MOON)
fac... | python | def getModifiers(chart):
""" Returns the factors of the temperament modifiers. """
modifiers = []
# Factors which can be affected
asc = chart.getAngle(const.ASC)
ascRulerID = essential.ruler(asc.sign)
ascRuler = chart.getObject(ascRulerID)
moon = chart.getObject(const.MOON)
fac... | [
"def",
"getModifiers",
"(",
"chart",
")",
":",
"modifiers",
"=",
"[",
"]",
"# Factors which can be affected",
"asc",
"=",
"chart",
".",
"getAngle",
"(",
"const",
".",
"ASC",
")",
"ascRulerID",
"=",
"essential",
".",
"ruler",
"(",
"asc",
".",
"sign",
")",
... | Returns the factors of the temperament modifiers. | [
"Returns",
"the",
"factors",
"of",
"the",
"temperament",
"modifiers",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/protocols/temperament.py#L171-L208 | train |
flatangle/flatlib | flatlib/protocols/temperament.py | scores | def scores(factors):
""" Computes the score of temperaments
and elements.
"""
temperaments = {
const.CHOLERIC: 0,
const.MELANCHOLIC: 0,
const.SANGUINE: 0,
const.PHLEGMATIC: 0
}
qualities = {
const.HOT: 0,
const.COLD: 0,
... | python | def scores(factors):
""" Computes the score of temperaments
and elements.
"""
temperaments = {
const.CHOLERIC: 0,
const.MELANCHOLIC: 0,
const.SANGUINE: 0,
const.PHLEGMATIC: 0
}
qualities = {
const.HOT: 0,
const.COLD: 0,
... | [
"def",
"scores",
"(",
"factors",
")",
":",
"temperaments",
"=",
"{",
"const",
".",
"CHOLERIC",
":",
"0",
",",
"const",
".",
"MELANCHOLIC",
":",
"0",
",",
"const",
".",
"SANGUINE",
":",
"0",
",",
"const",
".",
"PHLEGMATIC",
":",
"0",
"}",
"qualities",... | Computes the score of temperaments
and elements. | [
"Computes",
"the",
"score",
"of",
"temperaments",
"and",
"elements",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/protocols/temperament.py#L211-L245 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | getObject | def getObject(ID, date, pos):
""" Returns an ephemeris object. """
obj = eph.getObject(ID, date.jd, pos.lat, pos.lon)
return Object.fromDict(obj) | python | def getObject(ID, date, pos):
""" Returns an ephemeris object. """
obj = eph.getObject(ID, date.jd, pos.lat, pos.lon)
return Object.fromDict(obj) | [
"def",
"getObject",
"(",
"ID",
",",
"date",
",",
"pos",
")",
":",
"obj",
"=",
"eph",
".",
"getObject",
"(",
"ID",
",",
"date",
".",
"jd",
",",
"pos",
".",
"lat",
",",
"pos",
".",
"lon",
")",
"return",
"Object",
".",
"fromDict",
"(",
"obj",
")"
... | Returns an ephemeris object. | [
"Returns",
"an",
"ephemeris",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L28-L31 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | getObjectList | def getObjectList(IDs, date, pos):
""" Returns a list of objects. """
objList = [getObject(ID, date, pos) for ID in IDs]
return ObjectList(objList) | python | def getObjectList(IDs, date, pos):
""" Returns a list of objects. """
objList = [getObject(ID, date, pos) for ID in IDs]
return ObjectList(objList) | [
"def",
"getObjectList",
"(",
"IDs",
",",
"date",
",",
"pos",
")",
":",
"objList",
"=",
"[",
"getObject",
"(",
"ID",
",",
"date",
",",
"pos",
")",
"for",
"ID",
"in",
"IDs",
"]",
"return",
"ObjectList",
"(",
"objList",
")"
] | Returns a list of objects. | [
"Returns",
"a",
"list",
"of",
"objects",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L33-L36 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | getHouses | def getHouses(date, pos, hsys):
""" Returns the lists of houses and angles.
Since houses and angles are computed at the
same time, this function should be fast.
"""
houses, angles = eph.getHouses(date.jd, pos.lat, pos.lon, hsys)
hList = [House.fromDict(house) for house in houses]
a... | python | def getHouses(date, pos, hsys):
""" Returns the lists of houses and angles.
Since houses and angles are computed at the
same time, this function should be fast.
"""
houses, angles = eph.getHouses(date.jd, pos.lat, pos.lon, hsys)
hList = [House.fromDict(house) for house in houses]
a... | [
"def",
"getHouses",
"(",
"date",
",",
"pos",
",",
"hsys",
")",
":",
"houses",
",",
"angles",
"=",
"eph",
".",
"getHouses",
"(",
"date",
".",
"jd",
",",
"pos",
".",
"lat",
",",
"pos",
".",
"lon",
",",
"hsys",
")",
"hList",
"=",
"[",
"House",
"."... | Returns the lists of houses and angles.
Since houses and angles are computed at the
same time, this function should be fast. | [
"Returns",
"the",
"lists",
"of",
"houses",
"and",
"angles",
".",
"Since",
"houses",
"and",
"angles",
"are",
"computed",
"at",
"the",
"same",
"time",
"this",
"function",
"should",
"be",
"fast",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L41-L51 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | getFixedStar | def getFixedStar(ID, date):
""" Returns a fixed star from the ephemeris. """
star = eph.getFixedStar(ID, date.jd)
return FixedStar.fromDict(star) | python | def getFixedStar(ID, date):
""" Returns a fixed star from the ephemeris. """
star = eph.getFixedStar(ID, date.jd)
return FixedStar.fromDict(star) | [
"def",
"getFixedStar",
"(",
"ID",
",",
"date",
")",
":",
"star",
"=",
"eph",
".",
"getFixedStar",
"(",
"ID",
",",
"date",
".",
"jd",
")",
"return",
"FixedStar",
".",
"fromDict",
"(",
"star",
")"
] | Returns a fixed star from the ephemeris. | [
"Returns",
"a",
"fixed",
"star",
"from",
"the",
"ephemeris",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L64-L67 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | getFixedStarList | def getFixedStarList(IDs, date):
""" Returns a list of fixed stars. """
starList = [getFixedStar(ID, date) for ID in IDs]
return FixedStarList(starList) | python | def getFixedStarList(IDs, date):
""" Returns a list of fixed stars. """
starList = [getFixedStar(ID, date) for ID in IDs]
return FixedStarList(starList) | [
"def",
"getFixedStarList",
"(",
"IDs",
",",
"date",
")",
":",
"starList",
"=",
"[",
"getFixedStar",
"(",
"ID",
",",
"date",
")",
"for",
"ID",
"in",
"IDs",
"]",
"return",
"FixedStarList",
"(",
"starList",
")"
] | Returns a list of fixed stars. | [
"Returns",
"a",
"list",
"of",
"fixed",
"stars",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L69-L72 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | nextSolarReturn | def nextSolarReturn(date, lon):
""" Returns the next date when sun is at longitude 'lon'. """
jd = eph.nextSolarReturn(date.jd, lon)
return Datetime.fromJD(jd, date.utcoffset) | python | def nextSolarReturn(date, lon):
""" Returns the next date when sun is at longitude 'lon'. """
jd = eph.nextSolarReturn(date.jd, lon)
return Datetime.fromJD(jd, date.utcoffset) | [
"def",
"nextSolarReturn",
"(",
"date",
",",
"lon",
")",
":",
"jd",
"=",
"eph",
".",
"nextSolarReturn",
"(",
"date",
".",
"jd",
",",
"lon",
")",
"return",
"Datetime",
".",
"fromJD",
"(",
"jd",
",",
"date",
".",
"utcoffset",
")"
] | Returns the next date when sun is at longitude 'lon'. | [
"Returns",
"the",
"next",
"date",
"when",
"sun",
"is",
"at",
"longitude",
"lon",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L77-L80 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | prevSolarReturn | def prevSolarReturn(date, lon):
""" Returns the previous date when sun is at longitude 'lon'. """
jd = eph.prevSolarReturn(date.jd, lon)
return Datetime.fromJD(jd, date.utcoffset) | python | def prevSolarReturn(date, lon):
""" Returns the previous date when sun is at longitude 'lon'. """
jd = eph.prevSolarReturn(date.jd, lon)
return Datetime.fromJD(jd, date.utcoffset) | [
"def",
"prevSolarReturn",
"(",
"date",
",",
"lon",
")",
":",
"jd",
"=",
"eph",
".",
"prevSolarReturn",
"(",
"date",
".",
"jd",
",",
"lon",
")",
"return",
"Datetime",
".",
"fromJD",
"(",
"jd",
",",
"date",
".",
"utcoffset",
")"
] | Returns the previous date when sun is at longitude 'lon'. | [
"Returns",
"the",
"previous",
"date",
"when",
"sun",
"is",
"at",
"longitude",
"lon",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L82-L85 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | nextSunrise | def nextSunrise(date, pos):
""" Returns the date of the next sunrise. """
jd = eph.nextSunrise(date.jd, pos.lat, pos.lon)
return Datetime.fromJD(jd, date.utcoffset) | python | def nextSunrise(date, pos):
""" Returns the date of the next sunrise. """
jd = eph.nextSunrise(date.jd, pos.lat, pos.lon)
return Datetime.fromJD(jd, date.utcoffset) | [
"def",
"nextSunrise",
"(",
"date",
",",
"pos",
")",
":",
"jd",
"=",
"eph",
".",
"nextSunrise",
"(",
"date",
".",
"jd",
",",
"pos",
".",
"lat",
",",
"pos",
".",
"lon",
")",
"return",
"Datetime",
".",
"fromJD",
"(",
"jd",
",",
"date",
".",
"utcoffs... | Returns the date of the next sunrise. | [
"Returns",
"the",
"date",
"of",
"the",
"next",
"sunrise",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L90-L93 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | nextStation | def nextStation(ID, date):
""" Returns the aproximate date of the next station. """
jd = eph.nextStation(ID, date.jd)
return Datetime.fromJD(jd, date.utcoffset) | python | def nextStation(ID, date):
""" Returns the aproximate date of the next station. """
jd = eph.nextStation(ID, date.jd)
return Datetime.fromJD(jd, date.utcoffset) | [
"def",
"nextStation",
"(",
"ID",
",",
"date",
")",
":",
"jd",
"=",
"eph",
".",
"nextStation",
"(",
"ID",
",",
"date",
".",
"jd",
")",
"return",
"Datetime",
".",
"fromJD",
"(",
"jd",
",",
"date",
".",
"utcoffset",
")"
] | Returns the aproximate date of the next station. | [
"Returns",
"the",
"aproximate",
"date",
"of",
"the",
"next",
"station",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L113-L116 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | prevSolarEclipse | def prevSolarEclipse(date):
""" Returns the Datetime of the maximum phase of the
previous global solar eclipse.
"""
eclipse = swe.solarEclipseGlobal(date.jd, backward=True)
return Datetime.fromJD(eclipse['maximum'], date.utcoffset) | python | def prevSolarEclipse(date):
""" Returns the Datetime of the maximum phase of the
previous global solar eclipse.
"""
eclipse = swe.solarEclipseGlobal(date.jd, backward=True)
return Datetime.fromJD(eclipse['maximum'], date.utcoffset) | [
"def",
"prevSolarEclipse",
"(",
"date",
")",
":",
"eclipse",
"=",
"swe",
".",
"solarEclipseGlobal",
"(",
"date",
".",
"jd",
",",
"backward",
"=",
"True",
")",
"return",
"Datetime",
".",
"fromJD",
"(",
"eclipse",
"[",
"'maximum'",
"]",
",",
"date",
".",
... | Returns the Datetime of the maximum phase of the
previous global solar eclipse. | [
"Returns",
"the",
"Datetime",
"of",
"the",
"maximum",
"phase",
"of",
"the",
"previous",
"global",
"solar",
"eclipse",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L121-L128 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | nextSolarEclipse | def nextSolarEclipse(date):
""" Returns the Datetime of the maximum phase of the
next global solar eclipse.
"""
eclipse = swe.solarEclipseGlobal(date.jd, backward=False)
return Datetime.fromJD(eclipse['maximum'], date.utcoffset) | python | def nextSolarEclipse(date):
""" Returns the Datetime of the maximum phase of the
next global solar eclipse.
"""
eclipse = swe.solarEclipseGlobal(date.jd, backward=False)
return Datetime.fromJD(eclipse['maximum'], date.utcoffset) | [
"def",
"nextSolarEclipse",
"(",
"date",
")",
":",
"eclipse",
"=",
"swe",
".",
"solarEclipseGlobal",
"(",
"date",
".",
"jd",
",",
"backward",
"=",
"False",
")",
"return",
"Datetime",
".",
"fromJD",
"(",
"eclipse",
"[",
"'maximum'",
"]",
",",
"date",
".",
... | Returns the Datetime of the maximum phase of the
next global solar eclipse. | [
"Returns",
"the",
"Datetime",
"of",
"the",
"maximum",
"phase",
"of",
"the",
"next",
"global",
"solar",
"eclipse",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L130-L137 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | prevLunarEclipse | def prevLunarEclipse(date):
""" Returns the Datetime of the maximum phase of the
previous global lunar eclipse.
"""
eclipse = swe.lunarEclipseGlobal(date.jd, backward=True)
return Datetime.fromJD(eclipse['maximum'], date.utcoffset) | python | def prevLunarEclipse(date):
""" Returns the Datetime of the maximum phase of the
previous global lunar eclipse.
"""
eclipse = swe.lunarEclipseGlobal(date.jd, backward=True)
return Datetime.fromJD(eclipse['maximum'], date.utcoffset) | [
"def",
"prevLunarEclipse",
"(",
"date",
")",
":",
"eclipse",
"=",
"swe",
".",
"lunarEclipseGlobal",
"(",
"date",
".",
"jd",
",",
"backward",
"=",
"True",
")",
"return",
"Datetime",
".",
"fromJD",
"(",
"eclipse",
"[",
"'maximum'",
"]",
",",
"date",
".",
... | Returns the Datetime of the maximum phase of the
previous global lunar eclipse. | [
"Returns",
"the",
"Datetime",
"of",
"the",
"maximum",
"phase",
"of",
"the",
"previous",
"global",
"lunar",
"eclipse",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L139-L146 | train |
flatangle/flatlib | flatlib/ephem/ephem.py | nextLunarEclipse | def nextLunarEclipse(date):
""" Returns the Datetime of the maximum phase of the
next global lunar eclipse.
"""
eclipse = swe.lunarEclipseGlobal(date.jd, backward=False)
return Datetime.fromJD(eclipse['maximum'], date.utcoffset) | python | def nextLunarEclipse(date):
""" Returns the Datetime of the maximum phase of the
next global lunar eclipse.
"""
eclipse = swe.lunarEclipseGlobal(date.jd, backward=False)
return Datetime.fromJD(eclipse['maximum'], date.utcoffset) | [
"def",
"nextLunarEclipse",
"(",
"date",
")",
":",
"eclipse",
"=",
"swe",
".",
"lunarEclipseGlobal",
"(",
"date",
".",
"jd",
",",
"backward",
"=",
"False",
")",
"return",
"Datetime",
".",
"fromJD",
"(",
"eclipse",
"[",
"'maximum'",
"]",
",",
"date",
".",
... | Returns the Datetime of the maximum phase of the
next global lunar eclipse. | [
"Returns",
"the",
"Datetime",
"of",
"the",
"maximum",
"phase",
"of",
"the",
"next",
"global",
"lunar",
"eclipse",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/ephem/ephem.py#L148-L155 | train |
flatangle/flatlib | recipes/solaryears.py | plot | def plot(hdiff, title):
""" Plots the tropical solar length
by year.
"""
import matplotlib.pyplot as plt
years = [elem[0] for elem in hdiff]
diffs = [elem[1] for elem in hdiff]
plt.plot(years, diffs)
plt.ylabel('Distance in minutes')
plt.xlabel('Year')
plt.title(title)
p... | python | def plot(hdiff, title):
""" Plots the tropical solar length
by year.
"""
import matplotlib.pyplot as plt
years = [elem[0] for elem in hdiff]
diffs = [elem[1] for elem in hdiff]
plt.plot(years, diffs)
plt.ylabel('Distance in minutes')
plt.xlabel('Year')
plt.title(title)
p... | [
"def",
"plot",
"(",
"hdiff",
",",
"title",
")",
":",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"years",
"=",
"[",
"elem",
"[",
"0",
"]",
"for",
"elem",
"in",
"hdiff",
"]",
"diffs",
"=",
"[",
"elem",
"[",
"1",
"]",
"for",
"elem",
"in",
... | Plots the tropical solar length
by year. | [
"Plots",
"the",
"tropical",
"solar",
"length",
"by",
"year",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/recipes/solaryears.py#L22-L35 | train |
flatangle/flatlib | flatlib/utils.py | ascdiff | def ascdiff(decl, lat):
""" Returns the Ascensional Difference of a point. """
delta = math.radians(decl)
phi = math.radians(lat)
ad = math.asin(math.tan(delta) * math.tan(phi))
return math.degrees(ad) | python | def ascdiff(decl, lat):
""" Returns the Ascensional Difference of a point. """
delta = math.radians(decl)
phi = math.radians(lat)
ad = math.asin(math.tan(delta) * math.tan(phi))
return math.degrees(ad) | [
"def",
"ascdiff",
"(",
"decl",
",",
"lat",
")",
":",
"delta",
"=",
"math",
".",
"radians",
"(",
"decl",
")",
"phi",
"=",
"math",
".",
"radians",
"(",
"lat",
")",
"ad",
"=",
"math",
".",
"asin",
"(",
"math",
".",
"tan",
"(",
"delta",
")",
"*",
... | Returns the Ascensional Difference of a point. | [
"Returns",
"the",
"Ascensional",
"Difference",
"of",
"a",
"point",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/utils.py#L14-L19 | train |
flatangle/flatlib | flatlib/utils.py | dnarcs | def dnarcs(decl, lat):
""" Returns the diurnal and nocturnal arcs of a point. """
dArc = 180 + 2 * ascdiff(decl, lat)
nArc = 360 - dArc
return (dArc, nArc) | python | def dnarcs(decl, lat):
""" Returns the diurnal and nocturnal arcs of a point. """
dArc = 180 + 2 * ascdiff(decl, lat)
nArc = 360 - dArc
return (dArc, nArc) | [
"def",
"dnarcs",
"(",
"decl",
",",
"lat",
")",
":",
"dArc",
"=",
"180",
"+",
"2",
"*",
"ascdiff",
"(",
"decl",
",",
"lat",
")",
"nArc",
"=",
"360",
"-",
"dArc",
"return",
"(",
"dArc",
",",
"nArc",
")"
] | Returns the diurnal and nocturnal arcs of a point. | [
"Returns",
"the",
"diurnal",
"and",
"nocturnal",
"arcs",
"of",
"a",
"point",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/utils.py#L21-L25 | train |
flatangle/flatlib | flatlib/utils.py | isAboveHorizon | def isAboveHorizon(ra, decl, mcRA, lat):
""" Returns if an object's 'ra' and 'decl'
is above the horizon at a specific latitude,
given the MC's right ascension.
"""
# This function checks if the equatorial distance from
# the object to the MC is within its diurnal semi-arc.
dArc... | python | def isAboveHorizon(ra, decl, mcRA, lat):
""" Returns if an object's 'ra' and 'decl'
is above the horizon at a specific latitude,
given the MC's right ascension.
"""
# This function checks if the equatorial distance from
# the object to the MC is within its diurnal semi-arc.
dArc... | [
"def",
"isAboveHorizon",
"(",
"ra",
",",
"decl",
",",
"mcRA",
",",
"lat",
")",
":",
"# This function checks if the equatorial distance from ",
"# the object to the MC is within its diurnal semi-arc.",
"dArc",
",",
"_",
"=",
"dnarcs",
"(",
"decl",
",",
"lat",
")",
"dis... | Returns if an object's 'ra' and 'decl'
is above the horizon at a specific latitude,
given the MC's right ascension. | [
"Returns",
"if",
"an",
"object",
"s",
"ra",
"and",
"decl",
"is",
"above",
"the",
"horizon",
"at",
"a",
"specific",
"latitude",
"given",
"the",
"MC",
"s",
"right",
"ascension",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/utils.py#L30-L41 | train |
flatangle/flatlib | flatlib/utils.py | eqCoords | def eqCoords(lon, lat):
""" Converts from ecliptical to equatorial coordinates.
This algorithm is described in book 'Primary Directions',
pp. 147-150.
"""
# Convert to radians
_lambda = math.radians(lon)
_beta = math.radians(lat)
_epson = math.radians(23.44) # The earth's inclina... | python | def eqCoords(lon, lat):
""" Converts from ecliptical to equatorial coordinates.
This algorithm is described in book 'Primary Directions',
pp. 147-150.
"""
# Convert to radians
_lambda = math.radians(lon)
_beta = math.radians(lat)
_epson = math.radians(23.44) # The earth's inclina... | [
"def",
"eqCoords",
"(",
"lon",
",",
"lat",
")",
":",
"# Convert to radians",
"_lambda",
"=",
"math",
".",
"radians",
"(",
"lon",
")",
"_beta",
"=",
"math",
".",
"radians",
"(",
"lat",
")",
"_epson",
"=",
"math",
".",
"radians",
"(",
"23.44",
")",
"# ... | Converts from ecliptical to equatorial coordinates.
This algorithm is described in book 'Primary Directions',
pp. 147-150. | [
"Converts",
"from",
"ecliptical",
"to",
"equatorial",
"coordinates",
".",
"This",
"algorithm",
"is",
"described",
"in",
"book",
"Primary",
"Directions",
"pp",
".",
"147",
"-",
"150",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/utils.py#L46-L76 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | sunRelation | def sunRelation(obj, sun):
""" Returns an object's relation with the sun. """
if obj.id == const.SUN:
return None
dist = abs(angle.closestdistance(sun.lon, obj.lon))
if dist < 0.2833: return CAZIMI
elif dist < 8.0: return COMBUST
elif dist < 16.0: return UNDER_SUN
else:
retur... | python | def sunRelation(obj, sun):
""" Returns an object's relation with the sun. """
if obj.id == const.SUN:
return None
dist = abs(angle.closestdistance(sun.lon, obj.lon))
if dist < 0.2833: return CAZIMI
elif dist < 8.0: return COMBUST
elif dist < 16.0: return UNDER_SUN
else:
retur... | [
"def",
"sunRelation",
"(",
"obj",
",",
"sun",
")",
":",
"if",
"obj",
".",
"id",
"==",
"const",
".",
"SUN",
":",
"return",
"None",
"dist",
"=",
"abs",
"(",
"angle",
".",
"closestdistance",
"(",
"sun",
".",
"lon",
",",
"obj",
".",
"lon",
")",
")",
... | Returns an object's relation with the sun. | [
"Returns",
"an",
"object",
"s",
"relation",
"with",
"the",
"sun",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L42-L51 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | light | def light(obj, sun):
""" Returns if an object is augmenting or diminishing light. """
dist = angle.distance(sun.lon, obj.lon)
faster = sun if sun.lonspeed > obj.lonspeed else obj
if faster == sun:
return LIGHT_DIMINISHING if dist < 180 else LIGHT_AUGMENTING
else:
return LIGHT_AUGMENT... | python | def light(obj, sun):
""" Returns if an object is augmenting or diminishing light. """
dist = angle.distance(sun.lon, obj.lon)
faster = sun if sun.lonspeed > obj.lonspeed else obj
if faster == sun:
return LIGHT_DIMINISHING if dist < 180 else LIGHT_AUGMENTING
else:
return LIGHT_AUGMENT... | [
"def",
"light",
"(",
"obj",
",",
"sun",
")",
":",
"dist",
"=",
"angle",
".",
"distance",
"(",
"sun",
".",
"lon",
",",
"obj",
".",
"lon",
")",
"faster",
"=",
"sun",
"if",
"sun",
".",
"lonspeed",
">",
"obj",
".",
"lonspeed",
"else",
"obj",
"if",
... | Returns if an object is augmenting or diminishing light. | [
"Returns",
"if",
"an",
"object",
"is",
"augmenting",
"or",
"diminishing",
"light",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L53-L60 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | orientality | def orientality(obj, sun):
""" Returns if an object is oriental or
occidental to the sun.
"""
dist = angle.distance(sun.lon, obj.lon)
return OCCIDENTAL if dist < 180 else ORIENTAL | python | def orientality(obj, sun):
""" Returns if an object is oriental or
occidental to the sun.
"""
dist = angle.distance(sun.lon, obj.lon)
return OCCIDENTAL if dist < 180 else ORIENTAL | [
"def",
"orientality",
"(",
"obj",
",",
"sun",
")",
":",
"dist",
"=",
"angle",
".",
"distance",
"(",
"sun",
".",
"lon",
",",
"obj",
".",
"lon",
")",
"return",
"OCCIDENTAL",
"if",
"dist",
"<",
"180",
"else",
"ORIENTAL"
] | Returns if an object is oriental or
occidental to the sun. | [
"Returns",
"if",
"an",
"object",
"is",
"oriental",
"or",
"occidental",
"to",
"the",
"sun",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L62-L68 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | haiz | def haiz(obj, chart):
""" Returns if an object is in Haiz. """
objGender = obj.gender()
objFaction = obj.faction()
if obj.id == const.MERCURY:
# Gender and faction of mercury depends on orientality
sun = chart.getObject(const.SUN)
orientalityM = orientality(obj, sun)
... | python | def haiz(obj, chart):
""" Returns if an object is in Haiz. """
objGender = obj.gender()
objFaction = obj.faction()
if obj.id == const.MERCURY:
# Gender and faction of mercury depends on orientality
sun = chart.getObject(const.SUN)
orientalityM = orientality(obj, sun)
... | [
"def",
"haiz",
"(",
"obj",
",",
"chart",
")",
":",
"objGender",
"=",
"obj",
".",
"gender",
"(",
")",
"objFaction",
"=",
"obj",
".",
"faction",
"(",
")",
"if",
"obj",
".",
"id",
"==",
"const",
".",
"MERCURY",
":",
"# Gender and faction of mercury depends ... | Returns if an object is in Haiz. | [
"Returns",
"if",
"an",
"object",
"is",
"in",
"Haiz",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L74-L122 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.house | def house(self):
""" Returns the object's house. """
house = self.chart.houses.getObjectHouse(self.obj)
return house | python | def house(self):
""" Returns the object's house. """
house = self.chart.houses.getObjectHouse(self.obj)
return house | [
"def",
"house",
"(",
"self",
")",
":",
"house",
"=",
"self",
".",
"chart",
".",
"houses",
".",
"getObjectHouse",
"(",
"self",
".",
"obj",
")",
"return",
"house"
] | Returns the object's house. | [
"Returns",
"the",
"object",
"s",
"house",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L161-L164 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.sunRelation | def sunRelation(self):
""" Returns the relation of the object with the sun. """
sun = self.chart.getObject(const.SUN)
return sunRelation(self.obj, sun) | python | def sunRelation(self):
""" Returns the relation of the object with the sun. """
sun = self.chart.getObject(const.SUN)
return sunRelation(self.obj, sun) | [
"def",
"sunRelation",
"(",
"self",
")",
":",
"sun",
"=",
"self",
".",
"chart",
".",
"getObject",
"(",
"const",
".",
"SUN",
")",
"return",
"sunRelation",
"(",
"self",
".",
"obj",
",",
"sun",
")"
] | Returns the relation of the object with the sun. | [
"Returns",
"the",
"relation",
"of",
"the",
"object",
"with",
"the",
"sun",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L174-L177 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.light | def light(self):
""" Returns if object is augmenting or diminishing its
light.
"""
sun = self.chart.getObject(const.SUN)
return light(self.obj, sun) | python | def light(self):
""" Returns if object is augmenting or diminishing its
light.
"""
sun = self.chart.getObject(const.SUN)
return light(self.obj, sun) | [
"def",
"light",
"(",
"self",
")",
":",
"sun",
"=",
"self",
".",
"chart",
".",
"getObject",
"(",
"const",
".",
"SUN",
")",
"return",
"light",
"(",
"self",
".",
"obj",
",",
"sun",
")"
] | Returns if object is augmenting or diminishing its
light. | [
"Returns",
"if",
"object",
"is",
"augmenting",
"or",
"diminishing",
"its",
"light",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L188-L194 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.orientality | def orientality(self):
""" Returns the orientality of the object. """
sun = self.chart.getObject(const.SUN)
return orientality(self.obj, sun) | python | def orientality(self):
""" Returns the orientality of the object. """
sun = self.chart.getObject(const.SUN)
return orientality(self.obj, sun) | [
"def",
"orientality",
"(",
"self",
")",
":",
"sun",
"=",
"self",
".",
"chart",
".",
"getObject",
"(",
"const",
".",
"SUN",
")",
"return",
"orientality",
"(",
"self",
".",
"obj",
",",
"sun",
")"
] | Returns the orientality of the object. | [
"Returns",
"the",
"orientality",
"of",
"the",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L199-L202 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.inHouseJoy | def inHouseJoy(self):
""" Returns if the object is in its house of joy. """
house = self.house()
return props.object.houseJoy[self.obj.id] == house.id | python | def inHouseJoy(self):
""" Returns if the object is in its house of joy. """
house = self.house()
return props.object.houseJoy[self.obj.id] == house.id | [
"def",
"inHouseJoy",
"(",
"self",
")",
":",
"house",
"=",
"self",
".",
"house",
"(",
")",
"return",
"props",
".",
"object",
".",
"houseJoy",
"[",
"self",
".",
"obj",
".",
"id",
"]",
"==",
"house",
".",
"id"
] | Returns if the object is in its house of joy. | [
"Returns",
"if",
"the",
"object",
"is",
"in",
"its",
"house",
"of",
"joy",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L210-L213 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.inSignJoy | def inSignJoy(self):
""" Returns if the object is in its sign of joy. """
return props.object.signJoy[self.obj.id] == self.obj.sign | python | def inSignJoy(self):
""" Returns if the object is in its sign of joy. """
return props.object.signJoy[self.obj.id] == self.obj.sign | [
"def",
"inSignJoy",
"(",
"self",
")",
":",
"return",
"props",
".",
"object",
".",
"signJoy",
"[",
"self",
".",
"obj",
".",
"id",
"]",
"==",
"self",
".",
"obj",
".",
"sign"
] | Returns if the object is in its sign of joy. | [
"Returns",
"if",
"the",
"object",
"is",
"in",
"its",
"sign",
"of",
"joy",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L215-L217 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.reMutualReceptions | def reMutualReceptions(self):
""" Returns all mutual receptions with the object
and other planets, indexed by planet ID.
It only includes ruler and exaltation receptions.
"""
planets = copy(const.LIST_SEVEN_PLANETS)
planets.remove(self.obj.id)
mrs = {}
... | python | def reMutualReceptions(self):
""" Returns all mutual receptions with the object
and other planets, indexed by planet ID.
It only includes ruler and exaltation receptions.
"""
planets = copy(const.LIST_SEVEN_PLANETS)
planets.remove(self.obj.id)
mrs = {}
... | [
"def",
"reMutualReceptions",
"(",
"self",
")",
":",
"planets",
"=",
"copy",
"(",
"const",
".",
"LIST_SEVEN_PLANETS",
")",
"planets",
".",
"remove",
"(",
"self",
".",
"obj",
".",
"id",
")",
"mrs",
"=",
"{",
"}",
"for",
"ID",
"in",
"planets",
":",
"mr"... | Returns all mutual receptions with the object
and other planets, indexed by planet ID.
It only includes ruler and exaltation receptions. | [
"Returns",
"all",
"mutual",
"receptions",
"with",
"the",
"object",
"and",
"other",
"planets",
"indexed",
"by",
"planet",
"ID",
".",
"It",
"only",
"includes",
"ruler",
"and",
"exaltation",
"receptions",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L222-L235 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.eqMutualReceptions | def eqMutualReceptions(self):
""" Returns a list with mutual receptions with the
object and other planets, when the reception is the
same for both (both ruler or both exaltation).
It basically return a list with every ruler-ruler and
exalt-exalt mutual receptions
... | python | def eqMutualReceptions(self):
""" Returns a list with mutual receptions with the
object and other planets, when the reception is the
same for both (both ruler or both exaltation).
It basically return a list with every ruler-ruler and
exalt-exalt mutual receptions
... | [
"def",
"eqMutualReceptions",
"(",
"self",
")",
":",
"mrs",
"=",
"self",
".",
"reMutualReceptions",
"(",
")",
"res",
"=",
"[",
"]",
"for",
"ID",
",",
"receptions",
"in",
"mrs",
".",
"items",
"(",
")",
":",
"for",
"pair",
"in",
"receptions",
":",
"if",... | Returns a list with mutual receptions with the
object and other planets, when the reception is the
same for both (both ruler or both exaltation).
It basically return a list with every ruler-ruler and
exalt-exalt mutual receptions | [
"Returns",
"a",
"list",
"with",
"mutual",
"receptions",
"with",
"the",
"object",
"and",
"other",
"planets",
"when",
"the",
"reception",
"is",
"the",
"same",
"for",
"both",
"(",
"both",
"ruler",
"or",
"both",
"exaltation",
")",
".",
"It",
"basically",
"retu... | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L237-L252 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.__aspectLists | def __aspectLists(self, IDs, aspList):
""" Returns a list with the aspects that the object
makes to the objects in IDs. It considers only
conjunctions and other exact/applicative aspects
if in aspList.
"""
res = []
for otherID in IDs:
... | python | def __aspectLists(self, IDs, aspList):
""" Returns a list with the aspects that the object
makes to the objects in IDs. It considers only
conjunctions and other exact/applicative aspects
if in aspList.
"""
res = []
for otherID in IDs:
... | [
"def",
"__aspectLists",
"(",
"self",
",",
"IDs",
",",
"aspList",
")",
":",
"res",
"=",
"[",
"]",
"for",
"otherID",
"in",
"IDs",
":",
"# Ignore same ",
"if",
"otherID",
"==",
"self",
".",
"obj",
".",
"id",
":",
"continue",
"# Get aspects to the other object... | Returns a list with the aspects that the object
makes to the objects in IDs. It considers only
conjunctions and other exact/applicative aspects
if in aspList. | [
"Returns",
"a",
"list",
"with",
"the",
"aspects",
"that",
"the",
"object",
"makes",
"to",
"the",
"objects",
"in",
"IDs",
".",
"It",
"considers",
"only",
"conjunctions",
"and",
"other",
"exact",
"/",
"applicative",
"aspects",
"if",
"in",
"aspList",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L257-L285 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.aspectBenefics | def aspectBenefics(self):
""" Returns a list with the good aspects the object
makes to the benefics.
"""
benefics = [const.VENUS, const.JUPITER]
return self.__aspectLists(benefics, aspList=[0, 60, 120]) | python | def aspectBenefics(self):
""" Returns a list with the good aspects the object
makes to the benefics.
"""
benefics = [const.VENUS, const.JUPITER]
return self.__aspectLists(benefics, aspList=[0, 60, 120]) | [
"def",
"aspectBenefics",
"(",
"self",
")",
":",
"benefics",
"=",
"[",
"const",
".",
"VENUS",
",",
"const",
".",
"JUPITER",
"]",
"return",
"self",
".",
"__aspectLists",
"(",
"benefics",
",",
"aspList",
"=",
"[",
"0",
",",
"60",
",",
"120",
"]",
")"
] | Returns a list with the good aspects the object
makes to the benefics. | [
"Returns",
"a",
"list",
"with",
"the",
"good",
"aspects",
"the",
"object",
"makes",
"to",
"the",
"benefics",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L287-L293 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.aspectMalefics | def aspectMalefics(self):
""" Returns a list with the bad aspects the object
makes to the malefics.
"""
malefics = [const.MARS, const.SATURN]
return self.__aspectLists(malefics, aspList=[0, 90, 180]) | python | def aspectMalefics(self):
""" Returns a list with the bad aspects the object
makes to the malefics.
"""
malefics = [const.MARS, const.SATURN]
return self.__aspectLists(malefics, aspList=[0, 90, 180]) | [
"def",
"aspectMalefics",
"(",
"self",
")",
":",
"malefics",
"=",
"[",
"const",
".",
"MARS",
",",
"const",
".",
"SATURN",
"]",
"return",
"self",
".",
"__aspectLists",
"(",
"malefics",
",",
"aspList",
"=",
"[",
"0",
",",
"90",
",",
"180",
"]",
")"
] | Returns a list with the bad aspects the object
makes to the malefics. | [
"Returns",
"a",
"list",
"with",
"the",
"bad",
"aspects",
"the",
"object",
"makes",
"to",
"the",
"malefics",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L295-L301 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.__sepApp | def __sepApp(self, IDs, aspList):
""" Returns true if the object last and next movement are
separations and applications to objects in list IDs.
It only considers aspects in aspList.
This function is static since it does not test if the next
application will be indeed pe... | python | def __sepApp(self, IDs, aspList):
""" Returns true if the object last and next movement are
separations and applications to objects in list IDs.
It only considers aspects in aspList.
This function is static since it does not test if the next
application will be indeed pe... | [
"def",
"__sepApp",
"(",
"self",
",",
"IDs",
",",
"aspList",
")",
":",
"sep",
",",
"app",
"=",
"self",
".",
"dyn",
".",
"immediateAspects",
"(",
"self",
".",
"obj",
".",
"id",
",",
"aspList",
")",
"if",
"sep",
"is",
"None",
"or",
"app",
"is",
"Non... | Returns true if the object last and next movement are
separations and applications to objects in list IDs.
It only considers aspects in aspList.
This function is static since it does not test if the next
application will be indeed perfected. It considers only
a snapshot ... | [
"Returns",
"true",
"if",
"the",
"object",
"last",
"and",
"next",
"movement",
"are",
"separations",
"and",
"applications",
"to",
"objects",
"in",
"list",
"IDs",
".",
"It",
"only",
"considers",
"aspects",
"in",
"aspList",
".",
"This",
"function",
"is",
"static... | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L306-L322 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.isAuxilied | def isAuxilied(self):
""" Returns if the object is separating and applying to
a benefic considering good aspects.
"""
benefics = [const.VENUS, const.JUPITER]
return self.__sepApp(benefics, aspList=[0, 60, 120]) | python | def isAuxilied(self):
""" Returns if the object is separating and applying to
a benefic considering good aspects.
"""
benefics = [const.VENUS, const.JUPITER]
return self.__sepApp(benefics, aspList=[0, 60, 120]) | [
"def",
"isAuxilied",
"(",
"self",
")",
":",
"benefics",
"=",
"[",
"const",
".",
"VENUS",
",",
"const",
".",
"JUPITER",
"]",
"return",
"self",
".",
"__sepApp",
"(",
"benefics",
",",
"aspList",
"=",
"[",
"0",
",",
"60",
",",
"120",
"]",
")"
] | Returns if the object is separating and applying to
a benefic considering good aspects. | [
"Returns",
"if",
"the",
"object",
"is",
"separating",
"and",
"applying",
"to",
"a",
"benefic",
"considering",
"good",
"aspects",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L324-L330 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.isSurrounded | def isSurrounded(self):
""" Returns if the object is separating and applying to
a malefic considering bad aspects.
"""
malefics = [const.MARS, const.SATURN]
return self.__sepApp(malefics, aspList=[0, 90, 180]) | python | def isSurrounded(self):
""" Returns if the object is separating and applying to
a malefic considering bad aspects.
"""
malefics = [const.MARS, const.SATURN]
return self.__sepApp(malefics, aspList=[0, 90, 180]) | [
"def",
"isSurrounded",
"(",
"self",
")",
":",
"malefics",
"=",
"[",
"const",
".",
"MARS",
",",
"const",
".",
"SATURN",
"]",
"return",
"self",
".",
"__sepApp",
"(",
"malefics",
",",
"aspList",
"=",
"[",
"0",
",",
"90",
",",
"180",
"]",
")"
] | Returns if the object is separating and applying to
a malefic considering bad aspects. | [
"Returns",
"if",
"the",
"object",
"is",
"separating",
"and",
"applying",
"to",
"a",
"malefic",
"considering",
"bad",
"aspects",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L332-L338 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.isConjNorthNode | def isConjNorthNode(self):
""" Returns if object is conjunct north node. """
node = self.chart.getObject(const.NORTH_NODE)
return aspects.hasAspect(self.obj, node, aspList=[0]) | python | def isConjNorthNode(self):
""" Returns if object is conjunct north node. """
node = self.chart.getObject(const.NORTH_NODE)
return aspects.hasAspect(self.obj, node, aspList=[0]) | [
"def",
"isConjNorthNode",
"(",
"self",
")",
":",
"node",
"=",
"self",
".",
"chart",
".",
"getObject",
"(",
"const",
".",
"NORTH_NODE",
")",
"return",
"aspects",
".",
"hasAspect",
"(",
"self",
".",
"obj",
",",
"node",
",",
"aspList",
"=",
"[",
"0",
"]... | Returns if object is conjunct north node. | [
"Returns",
"if",
"object",
"is",
"conjunct",
"north",
"node",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L343-L346 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.isConjSouthNode | def isConjSouthNode(self):
""" Returns if object is conjunct south node. """
node = self.chart.getObject(const.SOUTH_NODE)
return aspects.hasAspect(self.obj, node, aspList=[0]) | python | def isConjSouthNode(self):
""" Returns if object is conjunct south node. """
node = self.chart.getObject(const.SOUTH_NODE)
return aspects.hasAspect(self.obj, node, aspList=[0]) | [
"def",
"isConjSouthNode",
"(",
"self",
")",
":",
"node",
"=",
"self",
".",
"chart",
".",
"getObject",
"(",
"const",
".",
"SOUTH_NODE",
")",
"return",
"aspects",
".",
"hasAspect",
"(",
"self",
".",
"obj",
",",
"node",
",",
"aspList",
"=",
"[",
"0",
"]... | Returns if object is conjunct south node. | [
"Returns",
"if",
"object",
"is",
"conjunct",
"south",
"node",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L348-L351 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.isFeral | def isFeral(self):
""" Returns true if the object does not have any
aspects.
"""
planets = copy(const.LIST_SEVEN_PLANETS)
planets.remove(self.obj.id)
for otherID in planets:
otherObj = self.chart.getObject(otherID)
if aspects.hasAspect(se... | python | def isFeral(self):
""" Returns true if the object does not have any
aspects.
"""
planets = copy(const.LIST_SEVEN_PLANETS)
planets.remove(self.obj.id)
for otherID in planets:
otherObj = self.chart.getObject(otherID)
if aspects.hasAspect(se... | [
"def",
"isFeral",
"(",
"self",
")",
":",
"planets",
"=",
"copy",
"(",
"const",
".",
"LIST_SEVEN_PLANETS",
")",
"planets",
".",
"remove",
"(",
"self",
".",
"obj",
".",
"id",
")",
"for",
"otherID",
"in",
"planets",
":",
"otherObj",
"=",
"self",
".",
"c... | Returns true if the object does not have any
aspects. | [
"Returns",
"true",
"if",
"the",
"object",
"does",
"not",
"have",
"any",
"aspects",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L360-L371 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.getScoreProperties | def getScoreProperties(self):
""" Returns the accidental dignity score of the object
as dict.
"""
obj = self.obj
score = {}
# Peregrine
isPeregrine = essential.isPeregrine(obj.id, obj.sign, obj.signlon)
score['peregrine'] = -5 if isPere... | python | def getScoreProperties(self):
""" Returns the accidental dignity score of the object
as dict.
"""
obj = self.obj
score = {}
# Peregrine
isPeregrine = essential.isPeregrine(obj.id, obj.sign, obj.signlon)
score['peregrine'] = -5 if isPere... | [
"def",
"getScoreProperties",
"(",
"self",
")",
":",
"obj",
"=",
"self",
".",
"obj",
"score",
"=",
"{",
"}",
"# Peregrine",
"isPeregrine",
"=",
"essential",
".",
"isPeregrine",
"(",
"obj",
".",
"id",
",",
"obj",
".",
"sign",
",",
"obj",
".",
"signlon",
... | Returns the accidental dignity score of the object
as dict. | [
"Returns",
"the",
"accidental",
"dignity",
"score",
"of",
"the",
"object",
"as",
"dict",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L380-L467 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.getActiveProperties | def getActiveProperties(self):
""" Returns the non-zero accidental dignities. """
score = self.getScoreProperties()
return {key: value for (key, value) in score.items()
if value != 0} | python | def getActiveProperties(self):
""" Returns the non-zero accidental dignities. """
score = self.getScoreProperties()
return {key: value for (key, value) in score.items()
if value != 0} | [
"def",
"getActiveProperties",
"(",
"self",
")",
":",
"score",
"=",
"self",
".",
"getScoreProperties",
"(",
")",
"return",
"{",
"key",
":",
"value",
"for",
"(",
"key",
",",
"value",
")",
"in",
"score",
".",
"items",
"(",
")",
"if",
"value",
"!=",
"0",... | Returns the non-zero accidental dignities. | [
"Returns",
"the",
"non",
"-",
"zero",
"accidental",
"dignities",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L469-L473 | train |
flatangle/flatlib | flatlib/dignities/accidental.py | AccidentalDignity.score | def score(self):
""" Returns the sum of the accidental dignities
score.
"""
if not self.scoreProperties:
self.scoreProperties = self.getScoreProperties()
return sum(self.scoreProperties.values()) | python | def score(self):
""" Returns the sum of the accidental dignities
score.
"""
if not self.scoreProperties:
self.scoreProperties = self.getScoreProperties()
return sum(self.scoreProperties.values()) | [
"def",
"score",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"scoreProperties",
":",
"self",
".",
"scoreProperties",
"=",
"self",
".",
"getScoreProperties",
"(",
")",
"return",
"sum",
"(",
"self",
".",
"scoreProperties",
".",
"values",
"(",
")",
")"
... | Returns the sum of the accidental dignities
score. | [
"Returns",
"the",
"sum",
"of",
"the",
"accidental",
"dignities",
"score",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/dignities/accidental.py#L475-L482 | train |
flatangle/flatlib | flatlib/object.py | GenericObject.fromDict | def fromDict(cls, _dict):
""" Builds instance from dictionary of properties. """
obj = cls()
obj.__dict__.update(_dict)
return obj | python | def fromDict(cls, _dict):
""" Builds instance from dictionary of properties. """
obj = cls()
obj.__dict__.update(_dict)
return obj | [
"def",
"fromDict",
"(",
"cls",
",",
"_dict",
")",
":",
"obj",
"=",
"cls",
"(",
")",
"obj",
".",
"__dict__",
".",
"update",
"(",
"_dict",
")",
"return",
"obj"
] | Builds instance from dictionary of properties. | [
"Builds",
"instance",
"from",
"dictionary",
"of",
"properties",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/object.py#L39-L43 | train |
flatangle/flatlib | flatlib/object.py | GenericObject.eqCoords | def eqCoords(self, zerolat=False):
""" Returns the Equatorial Coordinates of this object.
Receives a boolean parameter to consider a zero latitude.
"""
lat = 0.0 if zerolat else self.lat
return utils.eqCoords(self.lon, lat) | python | def eqCoords(self, zerolat=False):
""" Returns the Equatorial Coordinates of this object.
Receives a boolean parameter to consider a zero latitude.
"""
lat = 0.0 if zerolat else self.lat
return utils.eqCoords(self.lon, lat) | [
"def",
"eqCoords",
"(",
"self",
",",
"zerolat",
"=",
"False",
")",
":",
"lat",
"=",
"0.0",
"if",
"zerolat",
"else",
"self",
".",
"lat",
"return",
"utils",
".",
"eqCoords",
"(",
"self",
".",
"lon",
",",
"lat",
")"
] | Returns the Equatorial Coordinates of this object.
Receives a boolean parameter to consider a zero latitude. | [
"Returns",
"the",
"Equatorial",
"Coordinates",
"of",
"this",
"object",
".",
"Receives",
"a",
"boolean",
"parameter",
"to",
"consider",
"a",
"zero",
"latitude",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/object.py#L66-L72 | train |
flatangle/flatlib | flatlib/object.py | GenericObject.relocate | def relocate(self, lon):
""" Relocates this object to a new longitude. """
self.lon = angle.norm(lon)
self.signlon = self.lon % 30
self.sign = const.LIST_SIGNS[int(self.lon / 30.0)] | python | def relocate(self, lon):
""" Relocates this object to a new longitude. """
self.lon = angle.norm(lon)
self.signlon = self.lon % 30
self.sign = const.LIST_SIGNS[int(self.lon / 30.0)] | [
"def",
"relocate",
"(",
"self",
",",
"lon",
")",
":",
"self",
".",
"lon",
"=",
"angle",
".",
"norm",
"(",
"lon",
")",
"self",
".",
"signlon",
"=",
"self",
".",
"lon",
"%",
"30",
"self",
".",
"sign",
"=",
"const",
".",
"LIST_SIGNS",
"[",
"int",
... | Relocates this object to a new longitude. | [
"Relocates",
"this",
"object",
"to",
"a",
"new",
"longitude",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/object.py#L76-L80 | train |
flatangle/flatlib | flatlib/object.py | GenericObject.antiscia | def antiscia(self):
""" Returns antiscia object. """
obj = self.copy()
obj.type = const.OBJ_GENERIC
obj.relocate(360 - obj.lon + 180)
return obj | python | def antiscia(self):
""" Returns antiscia object. """
obj = self.copy()
obj.type = const.OBJ_GENERIC
obj.relocate(360 - obj.lon + 180)
return obj | [
"def",
"antiscia",
"(",
"self",
")",
":",
"obj",
"=",
"self",
".",
"copy",
"(",
")",
"obj",
".",
"type",
"=",
"const",
".",
"OBJ_GENERIC",
"obj",
".",
"relocate",
"(",
"360",
"-",
"obj",
".",
"lon",
"+",
"180",
")",
"return",
"obj"
] | Returns antiscia object. | [
"Returns",
"antiscia",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/object.py#L82-L87 | train |
flatangle/flatlib | flatlib/object.py | Object.movement | def movement(self):
""" Returns if this object is direct, retrograde
or stationary.
"""
if abs(self.lonspeed) < 0.0003:
return const.STATIONARY
elif self.lonspeed > 0:
return const.DIRECT
else:
return const.RETROGRADE | python | def movement(self):
""" Returns if this object is direct, retrograde
or stationary.
"""
if abs(self.lonspeed) < 0.0003:
return const.STATIONARY
elif self.lonspeed > 0:
return const.DIRECT
else:
return const.RETROGRADE | [
"def",
"movement",
"(",
"self",
")",
":",
"if",
"abs",
"(",
"self",
".",
"lonspeed",
")",
"<",
"0.0003",
":",
"return",
"const",
".",
"STATIONARY",
"elif",
"self",
".",
"lonspeed",
">",
"0",
":",
"return",
"const",
".",
"DIRECT",
"else",
":",
"return... | Returns if this object is direct, retrograde
or stationary. | [
"Returns",
"if",
"this",
"object",
"is",
"direct",
"retrograde",
"or",
"stationary",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/object.py#L131-L141 | train |
flatangle/flatlib | flatlib/object.py | House.inHouse | def inHouse(self, lon):
""" Returns if a longitude belongs to this house. """
dist = angle.distance(self.lon + House._OFFSET, lon)
return dist < self.size | python | def inHouse(self, lon):
""" Returns if a longitude belongs to this house. """
dist = angle.distance(self.lon + House._OFFSET, lon)
return dist < self.size | [
"def",
"inHouse",
"(",
"self",
",",
"lon",
")",
":",
"dist",
"=",
"angle",
".",
"distance",
"(",
"self",
".",
"lon",
"+",
"House",
".",
"_OFFSET",
",",
"lon",
")",
"return",
"dist",
"<",
"self",
".",
"size"
] | Returns if a longitude belongs to this house. | [
"Returns",
"if",
"a",
"longitude",
"belongs",
"to",
"this",
"house",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/object.py#L219-L222 | train |
flatangle/flatlib | flatlib/object.py | FixedStar.orb | def orb(self):
""" Returns the orb of this fixed star. """
for (mag, orb) in FixedStar._ORBS:
if self.mag < mag:
return orb
return 0.5 | python | def orb(self):
""" Returns the orb of this fixed star. """
for (mag, orb) in FixedStar._ORBS:
if self.mag < mag:
return orb
return 0.5 | [
"def",
"orb",
"(",
"self",
")",
":",
"for",
"(",
"mag",
",",
"orb",
")",
"in",
"FixedStar",
".",
"_ORBS",
":",
"if",
"self",
".",
"mag",
"<",
"mag",
":",
"return",
"orb",
"return",
"0.5"
] | Returns the orb of this fixed star. | [
"Returns",
"the",
"orb",
"of",
"this",
"fixed",
"star",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/object.py#L253-L258 | train |
flatangle/flatlib | flatlib/object.py | FixedStar.aspects | def aspects(self, obj):
""" Returns true if this star aspects another object.
Fixed stars only aspect by conjunctions.
"""
dist = angle.closestdistance(self.lon, obj.lon)
return abs(dist) < self.orb() | python | def aspects(self, obj):
""" Returns true if this star aspects another object.
Fixed stars only aspect by conjunctions.
"""
dist = angle.closestdistance(self.lon, obj.lon)
return abs(dist) < self.orb() | [
"def",
"aspects",
"(",
"self",
",",
"obj",
")",
":",
"dist",
"=",
"angle",
".",
"closestdistance",
"(",
"self",
".",
"lon",
",",
"obj",
".",
"lon",
")",
"return",
"abs",
"(",
"dist",
")",
"<",
"self",
".",
"orb",
"(",
")"
] | Returns true if this star aspects another object.
Fixed stars only aspect by conjunctions. | [
"Returns",
"true",
"if",
"this",
"star",
"aspects",
"another",
"object",
".",
"Fixed",
"stars",
"only",
"aspect",
"by",
"conjunctions",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/object.py#L262-L268 | train |
flatangle/flatlib | flatlib/lists.py | ObjectList.getObjectsInHouse | def getObjectsInHouse(self, house):
""" Returns a list with all objects in a house. """
res = [obj for obj in self if house.hasObject(obj)]
return ObjectList(res) | python | def getObjectsInHouse(self, house):
""" Returns a list with all objects in a house. """
res = [obj for obj in self if house.hasObject(obj)]
return ObjectList(res) | [
"def",
"getObjectsInHouse",
"(",
"self",
",",
"house",
")",
":",
"res",
"=",
"[",
"obj",
"for",
"obj",
"in",
"self",
"if",
"house",
".",
"hasObject",
"(",
"obj",
")",
"]",
"return",
"ObjectList",
"(",
"res",
")"
] | Returns a list with all objects in a house. | [
"Returns",
"a",
"list",
"with",
"all",
"objects",
"in",
"a",
"house",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/lists.py#L63-L66 | train |
flatangle/flatlib | flatlib/lists.py | ObjectList.getObjectsAspecting | def getObjectsAspecting(self, point, aspList):
""" Returns a list of objects aspecting a point
considering a list of possible aspects.
"""
res = []
for obj in self:
if obj.isPlanet() and aspects.isAspecting(obj, point, aspList):
res.append(ob... | python | def getObjectsAspecting(self, point, aspList):
""" Returns a list of objects aspecting a point
considering a list of possible aspects.
"""
res = []
for obj in self:
if obj.isPlanet() and aspects.isAspecting(obj, point, aspList):
res.append(ob... | [
"def",
"getObjectsAspecting",
"(",
"self",
",",
"point",
",",
"aspList",
")",
":",
"res",
"=",
"[",
"]",
"for",
"obj",
"in",
"self",
":",
"if",
"obj",
".",
"isPlanet",
"(",
")",
"and",
"aspects",
".",
"isAspecting",
"(",
"obj",
",",
"point",
",",
"... | Returns a list of objects aspecting a point
considering a list of possible aspects. | [
"Returns",
"a",
"list",
"of",
"objects",
"aspecting",
"a",
"point",
"considering",
"a",
"list",
"of",
"possible",
"aspects",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/lists.py#L68-L77 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | arc | def arc(pRA, pDecl, sRA, sDecl, mcRA, lat):
""" Returns the arc of direction between a Promissor
and Significator. It uses the generic proportional
semi-arc method.
"""
pDArc, pNArc = utils.dnarcs(pDecl, lat)
sDArc, sNArc = utils.dnarcs(sDecl, lat)
# Select meridian and arcs to b... | python | def arc(pRA, pDecl, sRA, sDecl, mcRA, lat):
""" Returns the arc of direction between a Promissor
and Significator. It uses the generic proportional
semi-arc method.
"""
pDArc, pNArc = utils.dnarcs(pDecl, lat)
sDArc, sNArc = utils.dnarcs(sDecl, lat)
# Select meridian and arcs to b... | [
"def",
"arc",
"(",
"pRA",
",",
"pDecl",
",",
"sRA",
",",
"sDecl",
",",
"mcRA",
",",
"lat",
")",
":",
"pDArc",
",",
"pNArc",
"=",
"utils",
".",
"dnarcs",
"(",
"pDecl",
",",
"lat",
")",
"sDArc",
",",
"sNArc",
"=",
"utils",
".",
"dnarcs",
"(",
"sD... | Returns the arc of direction between a Promissor
and Significator. It uses the generic proportional
semi-arc method. | [
"Returns",
"the",
"arc",
"of",
"direction",
"between",
"a",
"Promissor",
"and",
"Significator",
".",
"It",
"uses",
"the",
"generic",
"proportional",
"semi",
"-",
"arc",
"method",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L25-L59 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | getArc | def getArc(prom, sig, mc, pos, zerolat):
""" Returns the arc of direction between a promissor
and a significator. Arguments are also the MC, the
geoposition and zerolat to assume zero ecliptical
latitudes.
ZeroLat true => inZodiaco, false => inMundo
"""
pRA, pDecl = prom.eqCoords(... | python | def getArc(prom, sig, mc, pos, zerolat):
""" Returns the arc of direction between a promissor
and a significator. Arguments are also the MC, the
geoposition and zerolat to assume zero ecliptical
latitudes.
ZeroLat true => inZodiaco, false => inMundo
"""
pRA, pDecl = prom.eqCoords(... | [
"def",
"getArc",
"(",
"prom",
",",
"sig",
",",
"mc",
",",
"pos",
",",
"zerolat",
")",
":",
"pRA",
",",
"pDecl",
"=",
"prom",
".",
"eqCoords",
"(",
"zerolat",
")",
"sRa",
",",
"sDecl",
"=",
"sig",
".",
"eqCoords",
"(",
"zerolat",
")",
"mcRa",
",",... | Returns the arc of direction between a promissor
and a significator. Arguments are also the MC, the
geoposition and zerolat to assume zero ecliptical
latitudes.
ZeroLat true => inZodiaco, false => inMundo | [
"Returns",
"the",
"arc",
"of",
"direction",
"between",
"a",
"promissor",
"and",
"a",
"significator",
".",
"Arguments",
"are",
"also",
"the",
"MC",
"the",
"geoposition",
"and",
"zerolat",
"to",
"assume",
"zero",
"ecliptical",
"latitudes",
".",
"ZeroLat",
"true"... | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L61-L73 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections._buildTerms | def _buildTerms(self):
""" Builds a data structure indexing the terms
longitude by sign and object.
"""
termLons = tables.termLons(tables.EGYPTIAN_TERMS)
res = {}
for (ID, sign, lon) in termLons:
try:
res[sign][ID] = lon
ex... | python | def _buildTerms(self):
""" Builds a data structure indexing the terms
longitude by sign and object.
"""
termLons = tables.termLons(tables.EGYPTIAN_TERMS)
res = {}
for (ID, sign, lon) in termLons:
try:
res[sign][ID] = lon
ex... | [
"def",
"_buildTerms",
"(",
"self",
")",
":",
"termLons",
"=",
"tables",
".",
"termLons",
"(",
"tables",
".",
"EGYPTIAN_TERMS",
")",
"res",
"=",
"{",
"}",
"for",
"(",
"ID",
",",
"sign",
",",
"lon",
")",
"in",
"termLons",
":",
"try",
":",
"res",
"[",... | Builds a data structure indexing the terms
longitude by sign and object. | [
"Builds",
"a",
"data",
"structure",
"indexing",
"the",
"terms",
"longitude",
"by",
"sign",
"and",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L118-L131 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections.G | def G(self, ID, lat, lon):
""" Creates a generic entry for an object. """
# Equatorial coordinates
eqM = utils.eqCoords(lon, lat)
eqZ = eqM
if lat != 0:
eqZ = utils.eqCoords(lon, 0)
return {
'id': ID,
'lat': lat,
... | python | def G(self, ID, lat, lon):
""" Creates a generic entry for an object. """
# Equatorial coordinates
eqM = utils.eqCoords(lon, lat)
eqZ = eqM
if lat != 0:
eqZ = utils.eqCoords(lon, 0)
return {
'id': ID,
'lat': lat,
... | [
"def",
"G",
"(",
"self",
",",
"ID",
",",
"lat",
",",
"lon",
")",
":",
"# Equatorial coordinates",
"eqM",
"=",
"utils",
".",
"eqCoords",
"(",
"lon",
",",
"lat",
")",
"eqZ",
"=",
"eqM",
"if",
"lat",
"!=",
"0",
":",
"eqZ",
"=",
"utils",
".",
"eqCoor... | Creates a generic entry for an object. | [
"Creates",
"a",
"generic",
"entry",
"for",
"an",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L136-L153 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections.T | def T(self, ID, sign):
""" Returns the term of an object in a sign. """
lon = self.terms[sign][ID]
ID = 'T_%s_%s' % (ID, sign)
return self.G(ID, 0, lon) | python | def T(self, ID, sign):
""" Returns the term of an object in a sign. """
lon = self.terms[sign][ID]
ID = 'T_%s_%s' % (ID, sign)
return self.G(ID, 0, lon) | [
"def",
"T",
"(",
"self",
",",
"ID",
",",
"sign",
")",
":",
"lon",
"=",
"self",
".",
"terms",
"[",
"sign",
"]",
"[",
"ID",
"]",
"ID",
"=",
"'T_%s_%s'",
"%",
"(",
"ID",
",",
"sign",
")",
"return",
"self",
".",
"G",
"(",
"ID",
",",
"0",
",",
... | Returns the term of an object in a sign. | [
"Returns",
"the",
"term",
"of",
"an",
"object",
"in",
"a",
"sign",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L155-L159 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections.A | def A(self, ID):
""" Returns the Antiscia of an object. """
obj = self.chart.getObject(ID).antiscia()
ID = 'A_%s' % (ID)
return self.G(ID, obj.lat, obj.lon) | python | def A(self, ID):
""" Returns the Antiscia of an object. """
obj = self.chart.getObject(ID).antiscia()
ID = 'A_%s' % (ID)
return self.G(ID, obj.lat, obj.lon) | [
"def",
"A",
"(",
"self",
",",
"ID",
")",
":",
"obj",
"=",
"self",
".",
"chart",
".",
"getObject",
"(",
"ID",
")",
".",
"antiscia",
"(",
")",
"ID",
"=",
"'A_%s'",
"%",
"(",
"ID",
")",
"return",
"self",
".",
"G",
"(",
"ID",
",",
"obj",
".",
"... | Returns the Antiscia of an object. | [
"Returns",
"the",
"Antiscia",
"of",
"an",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L161-L165 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections.C | def C(self, ID):
""" Returns the CAntiscia of an object. """
obj = self.chart.getObject(ID).cantiscia()
ID = 'C_%s' % (ID)
return self.G(ID, obj.lat, obj.lon) | python | def C(self, ID):
""" Returns the CAntiscia of an object. """
obj = self.chart.getObject(ID).cantiscia()
ID = 'C_%s' % (ID)
return self.G(ID, obj.lat, obj.lon) | [
"def",
"C",
"(",
"self",
",",
"ID",
")",
":",
"obj",
"=",
"self",
".",
"chart",
".",
"getObject",
"(",
"ID",
")",
".",
"cantiscia",
"(",
")",
"ID",
"=",
"'C_%s'",
"%",
"(",
"ID",
")",
"return",
"self",
".",
"G",
"(",
"ID",
",",
"obj",
".",
... | Returns the CAntiscia of an object. | [
"Returns",
"the",
"CAntiscia",
"of",
"an",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L167-L171 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections.D | def D(self, ID, asp):
""" Returns the dexter aspect of an object. """
obj = self.chart.getObject(ID).copy()
obj.relocate(obj.lon - asp)
ID = 'D_%s_%s' % (ID, asp)
return self.G(ID, obj.lat, obj.lon) | python | def D(self, ID, asp):
""" Returns the dexter aspect of an object. """
obj = self.chart.getObject(ID).copy()
obj.relocate(obj.lon - asp)
ID = 'D_%s_%s' % (ID, asp)
return self.G(ID, obj.lat, obj.lon) | [
"def",
"D",
"(",
"self",
",",
"ID",
",",
"asp",
")",
":",
"obj",
"=",
"self",
".",
"chart",
".",
"getObject",
"(",
"ID",
")",
".",
"copy",
"(",
")",
"obj",
".",
"relocate",
"(",
"obj",
".",
"lon",
"-",
"asp",
")",
"ID",
"=",
"'D_%s_%s'",
"%",... | Returns the dexter aspect of an object. | [
"Returns",
"the",
"dexter",
"aspect",
"of",
"an",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L173-L178 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections.N | def N(self, ID, asp=0):
""" Returns the conjunction or opposition aspect
of an object.
"""
obj = self.chart.get(ID).copy()
obj.relocate(obj.lon + asp)
ID = 'N_%s_%s' % (ID, asp)
return self.G(ID, obj.lat, obj.lon) | python | def N(self, ID, asp=0):
""" Returns the conjunction or opposition aspect
of an object.
"""
obj = self.chart.get(ID).copy()
obj.relocate(obj.lon + asp)
ID = 'N_%s_%s' % (ID, asp)
return self.G(ID, obj.lat, obj.lon) | [
"def",
"N",
"(",
"self",
",",
"ID",
",",
"asp",
"=",
"0",
")",
":",
"obj",
"=",
"self",
".",
"chart",
".",
"get",
"(",
"ID",
")",
".",
"copy",
"(",
")",
"obj",
".",
"relocate",
"(",
"obj",
".",
"lon",
"+",
"asp",
")",
"ID",
"=",
"'N_%s_%s'"... | Returns the conjunction or opposition aspect
of an object. | [
"Returns",
"the",
"conjunction",
"or",
"opposition",
"aspect",
"of",
"an",
"object",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L187-L195 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections._arc | def _arc(self, prom, sig):
""" Computes the in-zodiaco and in-mundo arcs
between a promissor and a significator.
"""
arcm = arc(prom['ra'], prom['decl'],
sig['ra'], sig['decl'],
self.mcRA, self.lat)
arcz = arc(prom['raZ'], prom['d... | python | def _arc(self, prom, sig):
""" Computes the in-zodiaco and in-mundo arcs
between a promissor and a significator.
"""
arcm = arc(prom['ra'], prom['decl'],
sig['ra'], sig['decl'],
self.mcRA, self.lat)
arcz = arc(prom['raZ'], prom['d... | [
"def",
"_arc",
"(",
"self",
",",
"prom",
",",
"sig",
")",
":",
"arcm",
"=",
"arc",
"(",
"prom",
"[",
"'ra'",
"]",
",",
"prom",
"[",
"'decl'",
"]",
",",
"sig",
"[",
"'ra'",
"]",
",",
"sig",
"[",
"'decl'",
"]",
",",
"self",
".",
"mcRA",
",",
... | Computes the in-zodiaco and in-mundo arcs
between a promissor and a significator. | [
"Computes",
"the",
"in",
"-",
"zodiaco",
"and",
"in",
"-",
"mundo",
"arcs",
"between",
"a",
"promissor",
"and",
"a",
"significator",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L200-L214 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections.getArc | def getArc(self, prom, sig):
""" Returns the arcs between a promissor and
a significator. Should uses the object creation
functions to build the objects.
"""
res = self._arc(prom, sig)
res.update({
'prom': prom['id'],
'sig': sig['id']
... | python | def getArc(self, prom, sig):
""" Returns the arcs between a promissor and
a significator. Should uses the object creation
functions to build the objects.
"""
res = self._arc(prom, sig)
res.update({
'prom': prom['id'],
'sig': sig['id']
... | [
"def",
"getArc",
"(",
"self",
",",
"prom",
",",
"sig",
")",
":",
"res",
"=",
"self",
".",
"_arc",
"(",
"prom",
",",
"sig",
")",
"res",
".",
"update",
"(",
"{",
"'prom'",
":",
"prom",
"[",
"'id'",
"]",
",",
"'sig'",
":",
"sig",
"[",
"'id'",
"]... | Returns the arcs between a promissor and
a significator. Should uses the object creation
functions to build the objects. | [
"Returns",
"the",
"arcs",
"between",
"a",
"promissor",
"and",
"a",
"significator",
".",
"Should",
"uses",
"the",
"object",
"creation",
"functions",
"to",
"build",
"the",
"objects",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L216-L227 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections._elements | def _elements(self, IDs, func, aspList):
""" Returns the IDs as objects considering the
aspList and the function.
"""
res = []
for asp in aspList:
if (asp in [0, 180]):
# Generate func for conjunctions and oppositions
if func =... | python | def _elements(self, IDs, func, aspList):
""" Returns the IDs as objects considering the
aspList and the function.
"""
res = []
for asp in aspList:
if (asp in [0, 180]):
# Generate func for conjunctions and oppositions
if func =... | [
"def",
"_elements",
"(",
"self",
",",
"IDs",
",",
"func",
",",
"aspList",
")",
":",
"res",
"=",
"[",
"]",
"for",
"asp",
"in",
"aspList",
":",
"if",
"(",
"asp",
"in",
"[",
"0",
",",
"180",
"]",
")",
":",
"# Generate func for conjunctions and oppositions... | Returns the IDs as objects considering the
aspList and the function. | [
"Returns",
"the",
"IDs",
"as",
"objects",
"considering",
"the",
"aspList",
"and",
"the",
"function",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L232-L249 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections._terms | def _terms(self):
""" Returns a list with the objects as terms. """
res = []
for sign, terms in self.terms.items():
for ID, lon in terms.items():
res.append(self.T(ID, sign))
return res | python | def _terms(self):
""" Returns a list with the objects as terms. """
res = []
for sign, terms in self.terms.items():
for ID, lon in terms.items():
res.append(self.T(ID, sign))
return res | [
"def",
"_terms",
"(",
"self",
")",
":",
"res",
"=",
"[",
"]",
"for",
"sign",
",",
"terms",
"in",
"self",
".",
"terms",
".",
"items",
"(",
")",
":",
"for",
"ID",
",",
"lon",
"in",
"terms",
".",
"items",
"(",
")",
":",
"res",
".",
"append",
"("... | Returns a list with the objects as terms. | [
"Returns",
"a",
"list",
"with",
"the",
"objects",
"as",
"terms",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L251-L257 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PrimaryDirections.getList | def getList(self, aspList):
""" Returns a sorted list with all
primary directions.
"""
# Significators
objects = self._elements(self.SIG_OBJECTS, self.N, [0])
houses = self._elements(self.SIG_HOUSES, self.N, [0])
angles = self._elements(self.SIG_ANGLES, ... | python | def getList(self, aspList):
""" Returns a sorted list with all
primary directions.
"""
# Significators
objects = self._elements(self.SIG_OBJECTS, self.N, [0])
houses = self._elements(self.SIG_HOUSES, self.N, [0])
angles = self._elements(self.SIG_ANGLES, ... | [
"def",
"getList",
"(",
"self",
",",
"aspList",
")",
":",
"# Significators",
"objects",
"=",
"self",
".",
"_elements",
"(",
"self",
".",
"SIG_OBJECTS",
",",
"self",
".",
"N",
",",
"[",
"0",
"]",
")",
"houses",
"=",
"self",
".",
"_elements",
"(",
"self... | Returns a sorted list with all
primary directions. | [
"Returns",
"a",
"sorted",
"list",
"with",
"all",
"primary",
"directions",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L259-L294 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PDTable.view | def view(self, arcmin, arcmax):
""" Returns the directions within the
min and max arcs.
"""
res = []
for direction in self.table:
if arcmin < direction[0] < arcmax:
res.append(direction)
return res | python | def view(self, arcmin, arcmax):
""" Returns the directions within the
min and max arcs.
"""
res = []
for direction in self.table:
if arcmin < direction[0] < arcmax:
res.append(direction)
return res | [
"def",
"view",
"(",
"self",
",",
"arcmin",
",",
"arcmax",
")",
":",
"res",
"=",
"[",
"]",
"for",
"direction",
"in",
"self",
".",
"table",
":",
"if",
"arcmin",
"<",
"direction",
"[",
"0",
"]",
"<",
"arcmax",
":",
"res",
".",
"append",
"(",
"direct... | Returns the directions within the
min and max arcs. | [
"Returns",
"the",
"directions",
"within",
"the",
"min",
"and",
"max",
"arcs",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L311-L320 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PDTable.bySignificator | def bySignificator(self, ID):
""" Returns all directions to a significator. """
res = []
for direction in self.table:
if ID in direction[2]:
res.append(direction)
return res | python | def bySignificator(self, ID):
""" Returns all directions to a significator. """
res = []
for direction in self.table:
if ID in direction[2]:
res.append(direction)
return res | [
"def",
"bySignificator",
"(",
"self",
",",
"ID",
")",
":",
"res",
"=",
"[",
"]",
"for",
"direction",
"in",
"self",
".",
"table",
":",
"if",
"ID",
"in",
"direction",
"[",
"2",
"]",
":",
"res",
".",
"append",
"(",
"direction",
")",
"return",
"res"
] | Returns all directions to a significator. | [
"Returns",
"all",
"directions",
"to",
"a",
"significator",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L322-L328 | train |
flatangle/flatlib | flatlib/predictives/primarydirections.py | PDTable.byPromissor | def byPromissor(self, ID):
""" Returns all directions to a promissor. """
res = []
for direction in self.table:
if ID in direction[1]:
res.append(direction)
return res | python | def byPromissor(self, ID):
""" Returns all directions to a promissor. """
res = []
for direction in self.table:
if ID in direction[1]:
res.append(direction)
return res | [
"def",
"byPromissor",
"(",
"self",
",",
"ID",
")",
":",
"res",
"=",
"[",
"]",
"for",
"direction",
"in",
"self",
".",
"table",
":",
"if",
"ID",
"in",
"direction",
"[",
"1",
"]",
":",
"res",
".",
"append",
"(",
"direction",
")",
"return",
"res"
] | Returns all directions to a promissor. | [
"Returns",
"all",
"directions",
"to",
"a",
"promissor",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/predictives/primarydirections.py#L330-L336 | train |
flatangle/flatlib | flatlib/chart.py | Chart.copy | def copy(self):
""" Returns a deep copy of this chart. """
chart = Chart.__new__(Chart)
chart.date = self.date
chart.pos = self.pos
chart.hsys = self.hsys
chart.objects = self.objects.copy()
chart.houses = self.houses.copy()
chart.angles = self.angles.copy... | python | def copy(self):
""" Returns a deep copy of this chart. """
chart = Chart.__new__(Chart)
chart.date = self.date
chart.pos = self.pos
chart.hsys = self.hsys
chart.objects = self.objects.copy()
chart.houses = self.houses.copy()
chart.angles = self.angles.copy... | [
"def",
"copy",
"(",
"self",
")",
":",
"chart",
"=",
"Chart",
".",
"__new__",
"(",
"Chart",
")",
"chart",
".",
"date",
"=",
"self",
".",
"date",
"chart",
".",
"pos",
"=",
"self",
".",
"pos",
"chart",
".",
"hsys",
"=",
"self",
".",
"hsys",
"chart",... | Returns a deep copy of this chart. | [
"Returns",
"a",
"deep",
"copy",
"of",
"this",
"chart",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/chart.py#L56-L65 | train |
flatangle/flatlib | flatlib/chart.py | Chart.get | def get(self, ID):
""" Returns an object, house or angle
from the chart.
"""
if ID.startswith('House'):
return self.getHouse(ID)
elif ID in const.LIST_ANGLES:
return self.getAngle(ID)
else:
return self.getObject(ID) | python | def get(self, ID):
""" Returns an object, house or angle
from the chart.
"""
if ID.startswith('House'):
return self.getHouse(ID)
elif ID in const.LIST_ANGLES:
return self.getAngle(ID)
else:
return self.getObject(ID) | [
"def",
"get",
"(",
"self",
",",
"ID",
")",
":",
"if",
"ID",
".",
"startswith",
"(",
"'House'",
")",
":",
"return",
"self",
".",
"getHouse",
"(",
"ID",
")",
"elif",
"ID",
"in",
"const",
".",
"LIST_ANGLES",
":",
"return",
"self",
".",
"getAngle",
"("... | Returns an object, house or angle
from the chart. | [
"Returns",
"an",
"object",
"house",
"or",
"angle",
"from",
"the",
"chart",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/chart.py#L82-L92 | train |
flatangle/flatlib | flatlib/chart.py | Chart.getFixedStars | def getFixedStars(self):
""" Returns a list with all fixed stars. """
IDs = const.LIST_FIXED_STARS
return ephem.getFixedStarList(IDs, self.date) | python | def getFixedStars(self):
""" Returns a list with all fixed stars. """
IDs = const.LIST_FIXED_STARS
return ephem.getFixedStarList(IDs, self.date) | [
"def",
"getFixedStars",
"(",
"self",
")",
":",
"IDs",
"=",
"const",
".",
"LIST_FIXED_STARS",
"return",
"ephem",
".",
"getFixedStarList",
"(",
"IDs",
",",
"self",
".",
"date",
")"
] | Returns a list with all fixed stars. | [
"Returns",
"a",
"list",
"with",
"all",
"fixed",
"stars",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/chart.py#L105-L108 | train |
flatangle/flatlib | flatlib/chart.py | Chart.isHouse1Asc | def isHouse1Asc(self):
""" Returns true if House1 is the same as the Asc. """
house1 = self.getHouse(const.HOUSE1)
asc = self.getAngle(const.ASC)
dist = angle.closestdistance(house1.lon, asc.lon)
return abs(dist) < 0.0003 | python | def isHouse1Asc(self):
""" Returns true if House1 is the same as the Asc. """
house1 = self.getHouse(const.HOUSE1)
asc = self.getAngle(const.ASC)
dist = angle.closestdistance(house1.lon, asc.lon)
return abs(dist) < 0.0003 | [
"def",
"isHouse1Asc",
"(",
"self",
")",
":",
"house1",
"=",
"self",
".",
"getHouse",
"(",
"const",
".",
"HOUSE1",
")",
"asc",
"=",
"self",
".",
"getAngle",
"(",
"const",
".",
"ASC",
")",
"dist",
"=",
"angle",
".",
"closestdistance",
"(",
"house1",
".... | Returns true if House1 is the same as the Asc. | [
"Returns",
"true",
"if",
"House1",
"is",
"the",
"same",
"as",
"the",
"Asc",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/chart.py#L113-L118 | train |
flatangle/flatlib | flatlib/chart.py | Chart.isHouse10MC | def isHouse10MC(self):
""" Returns true if House10 is the same as the MC. """
house10 = self.getHouse(const.HOUSE10)
mc = self.getAngle(const.MC)
dist = angle.closestdistance(house10.lon, mc.lon)
return abs(dist) < 0.0003 | python | def isHouse10MC(self):
""" Returns true if House10 is the same as the MC. """
house10 = self.getHouse(const.HOUSE10)
mc = self.getAngle(const.MC)
dist = angle.closestdistance(house10.lon, mc.lon)
return abs(dist) < 0.0003 | [
"def",
"isHouse10MC",
"(",
"self",
")",
":",
"house10",
"=",
"self",
".",
"getHouse",
"(",
"const",
".",
"HOUSE10",
")",
"mc",
"=",
"self",
".",
"getAngle",
"(",
"const",
".",
"MC",
")",
"dist",
"=",
"angle",
".",
"closestdistance",
"(",
"house10",
"... | Returns true if House10 is the same as the MC. | [
"Returns",
"true",
"if",
"House10",
"is",
"the",
"same",
"as",
"the",
"MC",
"."
] | 44e05b2991a296c678adbc17a1d51b6a21bc867c | https://github.com/flatangle/flatlib/blob/44e05b2991a296c678adbc17a1d51b6a21bc867c/flatlib/chart.py#L120-L125 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.