function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def load(
pipette_model: PipetteModel,
pipette_id: str = None) -> PipetteConfig:
"""
Load pipette config data
This function loads from a combination of
- the pipetteModelSpecs.json file in the wheel (should never be edited)
- the pipetteNameSpecs.json file in the wheel (should nev... | Opentrons/labware | [
323,
152,
323,
668,
1436215261
] |
def validate_overrides(data: TypeOverrides,
config_model: Dict) -> None:
"""
Check that override fields are valid.
:param data: a dict of field name to value
:param config_model: the configuration for the chosen model
:raises ValueError: If a value is invalid
"""
for ... | Opentrons/labware | [
323,
152,
323,
668,
1436215261
] |
def save_overrides(pipette_id: str,
overrides: TypeOverrides,
model: PipetteModel):
"""
Save overrides for the pipette.
:param pipette_id: The pipette id
:param overrides: The incoming values
:param model: The model of pipette
:return: None
"""
over... | Opentrons/labware | [
323,
152,
323,
668,
1436215261
] |
def load_overrides(pipette_id: str) -> Dict[str, Any]:
overrides = config.CONFIG['pipette_config_overrides_dir']
fi = (overrides/f'{pipette_id}.json').open()
try:
return json.load(fi)
except json.JSONDecodeError as e:
log.warning(f'pipette override for {pipette_id} is corrupt: {e}')
... | Opentrons/labware | [
323,
152,
323,
668,
1436215261
] |
def ensure_value(
config: PipetteFusedSpec,
name: Union[str, Tuple[str, ...]],
mutable_config_list: List[str]):
"""
Pull value of config data from file. Shape can either be a dictionary with
a value key -- indicating that it can be changed -- or another
data structure such as an ... | Opentrons/labware | [
323,
152,
323,
668,
1436215261
] |
def add_default(cfg):
if isinstance(cfg, dict):
if 'value' in cfg.keys():
cfg['default'] = cfg['value']
else:
for top_level_key in cfg.keys():
add_default(cfg[top_level_key]) | Opentrons/labware | [
323,
152,
323,
668,
1436215261
] |
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback') | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_all_policy_input_rbridge_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_all_policy = ET.Element("maps_get_all_policy")
config = maps_get_all_policy
input = ET.SubElement(maps_get_all_policy, "input")
rbridge_id =... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_all_policy_output_policy_policyname(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_all_policy = ET.Element("maps_get_all_policy")
config = maps_get_all_policy
output = ET.SubElement(maps_get_all_policy, "output")
po... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_input_rbridge_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
input = ET.SubElement(maps_get_rules, "input")
rbridge_id = ET.SubElement(input, "rb... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_rbridgeid(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output,... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_rulename(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, ... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_groupname(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output,... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_monitor(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, "... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_op(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, "rules... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_value(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, "ru... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_action(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, "r... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_timebase(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, ... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_policyname(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_all_policy_input_rbridge_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_all_policy = ET.Element("maps_get_all_policy")
config = maps_get_all_policy
input = ET.SubElement(maps_get_all_policy, "input")
rbridge_id =... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_all_policy_output_policy_policyname(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_all_policy = ET.Element("maps_get_all_policy")
config = maps_get_all_policy
output = ET.SubElement(maps_get_all_policy, "output")
po... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_input_rbridge_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
input = ET.SubElement(maps_get_rules, "input")
rbridge_id = ET.SubElement(input, "rb... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_rbridgeid(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output,... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_rulename(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, ... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_groupname(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output,... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_monitor(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, "... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_op(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, "rules... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_value(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, "ru... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_action(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, "r... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_timebase(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output, ... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def maps_get_rules_output_rules_policyname(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
maps_get_rules = ET.Element("maps_get_rules")
config = maps_get_rules
output = ET.SubElement(maps_get_rules, "output")
rules = ET.SubElement(output... | BRCDcomm/pynos | [
16,
8,
16,
2,
1437520628
] |
def xpath_tokenizer(pattern, namespaces=None):
# ElementTree uses '', lxml used None originally.
default_namespace = (namespaces.get(None) or namespaces.get('')) if namespaces else None
parsing_attribute = False
for token in xpath_tokenizer_re.findall(pattern):
ttype, tag = token
if tag ... | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def select(result):
for elem in result:
for e in elem.iterchildren(tag):
yield e | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def prepare_star(next, token):
def select(result):
for elem in result:
for e in elem.iterchildren('*'):
yield e
return select | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def select(result):
return result | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def prepare_descendant(next, token):
token = next()
if token[0] == "*":
tag = "*"
elif not token[0]:
tag = token[1]
else:
raise SyntaxError("invalid descendant")
def select(result):
for elem in result:
for e in elem.iterdescendants(tag):
yi... | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def select(result):
for elem in result:
parent = elem.getparent()
if parent is not None:
yield parent | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def prepare_predicate(next, token):
# FIXME: replace with real parser!!! refs:
# http://effbot.org/zone/simple-iterator-parser.htm
# http://javascript.crockford.com/tdop/tdop.html
signature = ''
predicate = []
while 1:
token = next()
if token[0] == "]":
break
... | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def _build_path_iterator(path, namespaces):
"""compile selector pattern"""
if path[-1:] == "/":
path += "*" # implicit all (FIXME: keep this?)
cache_key = (path,)
if namespaces:
# lxml originally used None for the default namespace but ElementTree uses the
# more convenient (al... | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def iterfind(elem, path, namespaces=None):
selector = _build_path_iterator(path, namespaces)
result = iter((elem,))
for select in selector:
result = select(result)
return result | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def find(elem, path, namespaces=None):
it = iterfind(elem, path, namespaces)
try:
return next(it)
except StopIteration:
return None | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def findall(elem, path, namespaces=None):
return list(iterfind(elem, path, namespaces)) | lxml/lxml | [
2302,
530,
2302,
22,
1297402991
] |
def test_traverse():
provider1 = providers.Provider()
provided = provider1.provided
method = provided.method
provider = method.call()
all_providers = list(provider.traverse())
assert len(all_providers) == 3
assert provider1 in all_providers
assert provided in all_providers
assert m... | ets-labs/python-dependency-injector | [
2723,
206,
2723,
132,
1420377785
] |
def test_traverse_kwargs():
provider1 = providers.Provider()
provided = provider1.provided
method = provided.method
provider2 = providers.Provider()
provider = method.call(foo="foo", bar=provider2)
all_providers = list(provider.traverse())
assert len(all_providers) == 4
assert provider... | ets-labs/python-dependency-injector | [
2723,
206,
2723,
132,
1420377785
] |
def _TimeoutRetryWrapper(f, timeout_func, retries_func, pass_values=False):
""" Wraps a funcion with timeout and retry handling logic.
Args:
f: The function to wrap.
timeout_func: A callable that returns the timeout value.
retries_func: A callable that returns the retries value.
pass_values: If Tru... | Teamxrtc/webrtc-streaming-node | [
6,
5,
6,
2,
1449773735
] |
def WithExplicitTimeoutAndRetries(timeout, retries):
"""Returns a decorator that handles timeouts and retries.
The provided |timeout| and |retries| values are always used.
Args:
timeout: The number of seconds to wait for the decorated function to
return. Always used.
retries: The number of ... | Teamxrtc/webrtc-streaming-node | [
6,
5,
6,
2,
1449773735
] |
def decorator(f):
get_timeout = lambda *a, **kw: kw.get('timeout', default_timeout)
get_retries = lambda *a, **kw: kw.get('retries', default_retries)
return _TimeoutRetryWrapper(f, get_timeout, get_retries, pass_values=True) | Teamxrtc/webrtc-streaming-node | [
6,
5,
6,
2,
1449773735
] |
def generateRecursorConfig(cls, confdir):
authzonepath = os.path.join(confdir, 'authzone.zone')
with open(authzonepath, 'w') as authzone:
authzone.write("""$ORIGIN authzone.example. | PowerDNS/pdns | [
3002,
827,
3002,
852,
1366975009
] |
def sendTCPQueryKeepOpen(cls, sock, query, timeout=2.0):
try:
wire = query.to_wire()
sock.send(struct.pack("!H", len(wire)))
sock.send(wire)
data = sock.recv(2)
if data:
(datalen,) = struct.unpack("!H", data)
data = sock... | PowerDNS/pdns | [
3002,
827,
3002,
852,
1366975009
] |
def autoreconf(self, spec, prefix):
autogen = Executable('./autogen.sh')
autogen() | LLNL/spack | [
3244,
1839,
3244,
2847,
1389172932
] |
def test_allow_any_authorization():
authorizer = get_authorizer(None)
authorization = authorizer.get_authorization('tool1')
authorization.authorize_setup()
authorization.authorize_tool_file('cow', '#!/bin/bash\necho "Hello World!"') | galaxyproject/pulsar | [
36,
43,
36,
69,
1403216408
] |
def setUp(self):
self.toolbox = get_test_toolbox()
self.authorizer = get_authorizer(self.toolbox) | galaxyproject/pulsar | [
36,
43,
36,
69,
1403216408
] |
def test_invalid_setup_fails(self):
with self.unauthorized_expectation():
self.authorizer.get_authorization('tool2').authorize_setup() | galaxyproject/pulsar | [
36,
43,
36,
69,
1403216408
] |
def test_invalid_tool_file_fails(self):
authorization = self.authorizer.get_authorization('tool1')
with self.unauthorized_expectation():
authorization.authorize_tool_file('tool1_wrapper.py', '#!/bin/sh\nrm -rf /valuable/data') | galaxyproject/pulsar | [
36,
43,
36,
69,
1403216408
] |
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.alter_column('labmanager_users', 'login',
existing_type=mysql.VARCHAR(length=50),
nullable=False)
### end Alembic commands ### | gateway4labs/labmanager | [
13,
9,
13,
31,
1354207127
] |
def get_movie(self, id):
return self.browser.get_movie(id) | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def iter_movies(self, pattern):
return self.browser.iter_movies(pattern.encode('utf-8')) | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def iter_movie_persons(self, id, role=None):
return self.browser.iter_movie_persons(id, role) | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def iter_person_movies_ids(self, id):
return self.browser.iter_person_movies_ids(id) | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def get_person_biography(self, id):
return self.browser.get_person_biography(id) | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def fill_person(self, person, fields):
if 'real_name' in fields or 'birth_place' in fields\
or 'death_date' in fields or 'nationality' in fields\
or 'short_biography' in fields or 'roles' in fields\
or 'birth_date' in fields or 'thumbnail_url' in fields\
or 'biogr... | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def fill_video(self, video, fields):
if 'url' in fields:
with self.browser:
if not isinstance(video, BaseVideo):
video = self.get_video(self, video.id)
if hasattr(video, '_video_code'):
video.url = unicode(self.browser.get_vide... | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def iter_resources(self, objs, split_path):
with self.browser:
if BaseVideo in objs:
collection = self.get_collection(objs, split_path)
if collection.path_level == 0:
yield Collection([u'comingsoon'], u'Films prochainement au cinéma')
... | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def search_events(self, query):
with self.browser:
if CATEGORIES.CINE in query.categories:
if query.city and re.match('\d{5}', query.city):
events = list(self.browser.search_events(query))
events.sort(key=lambda x: x.start_date, reverse=False)
... | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def fill_event(self, event, fields):
if 'description' in fields:
movieCode = event.id.split('#')[2]
movie = self.get_movie(movieCode)
event.description = movie.pitch
return event | frankrousseau/weboob | [
4,
3,
4,
1,
1381825736
] |
def main():
colorama.init()
# gratuitous use of lambda.
pos = lambda y, x: '\x1b[%d;%dH' % (y, x)
# draw a white border.
print(Back.WHITE, end='')
print('%s%s' % (pos(MINY, MINX), ' '*MAXX), end='')
for y in range(MINY, 1+MAXY):
print('%s %s ' % (pos(y, MINX), pos(y, MAXX)), end='')
... | Teamxrtc/webrtc-streaming-node | [
6,
5,
6,
2,
1449773735
] |
def test(name, input, output, *args):
if verbose:
print 'string.%s%s =? %s... ' % (name, (input,) + args, output),
f = getattr(strop, name)
try:
value = apply(f, (input,) + args)
except:
value = sys.exc_type
if value != output:
if verbose:
print 'no'
... | atmark-techno/atmark-dist | [
3,
2,
3,
4,
1476164728
] |
def __init__(self): self.seq = 'wxyz' | atmark-techno/atmark-dist | [
3,
2,
3,
4,
1476164728
] |
def __getitem__(self, i): return self.seq[i] | atmark-techno/atmark-dist | [
3,
2,
3,
4,
1476164728
] |
def batch_row_ids(data_batch):
""" Generate row ids based on the current mini-batch """
return {'weight': data_batch.data[0].indices} | dmlc/mxnet | [
20293,
6870,
20293,
1995,
1430410875
] |
def SOCKSProxyManager(*args, **kwargs):
raise InvalidSchema("Missing dependencies for SOCKS support.") | momm3/WelcomeBot | [
1,
1,
1,
1,
1500546203
] |
def __init__(self):
super(BaseAdapter, self).__init__() | momm3/WelcomeBot | [
1,
1,
1,
1,
1500546203
] |
def close(self):
"""Cleans up adapter specific items."""
raise NotImplementedError | momm3/WelcomeBot | [
1,
1,
1,
1,
1500546203
] |
def __init__(self, pool_connections=DEFAULT_POOLSIZE,
pool_maxsize=DEFAULT_POOLSIZE, max_retries=DEFAULT_RETRIES,
pool_block=DEFAULT_POOLBLOCK):
if max_retries == DEFAULT_RETRIES:
self.max_retries = Retry(0, read=False)
else:
self.max_retries = R... | momm3/WelcomeBot | [
1,
1,
1,
1,
1500546203
] |
def __setstate__(self, state):
# Can't handle by adding 'proxy_manager' to self.__attrs__ because
# self.poolmanager uses a lambda function, which isn't pickleable.
self.proxy_manager = {}
self.config = {}
for attr, value in state.items():
setattr(self, attr, value)
... | momm3/WelcomeBot | [
1,
1,
1,
1,
1500546203
] |
def proxy_manager_for(self, proxy, **proxy_kwargs):
"""Return urllib3 ProxyManager for the given proxy.
This method should not be called from user code, and is only
exposed for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
:param proxy: The prox... | momm3/WelcomeBot | [
1,
1,
1,
1,
1500546203
] |
def build_response(self, req, resp):
"""Builds a :class:`Response <requests.Response>` object from a urllib3
response. This should not be called from user code, and is only exposed
for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`
:param req: The ... | momm3/WelcomeBot | [
1,
1,
1,
1,
1500546203
] |
def close(self):
"""Disposes of any internal state.
Currently, this closes the PoolManager and any active ProxyManager,
which closes any pooled connections.
"""
self.poolmanager.clear()
for proxy in self.proxy_manager.values():
proxy.clear() | momm3/WelcomeBot | [
1,
1,
1,
1,
1500546203
] |
def add_headers(self, request, **kwargs):
"""Add any headers needed by the connection. As of v2.0 this does
nothing by default, but is left for overriding by users that subclass
the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
This should not be called from user code, and is on... | momm3/WelcomeBot | [
1,
1,
1,
1,
1500546203
] |
def _encode(input,errors='strict'):
# split to see if we have any 'extended' characters
runs=unicode_splitter.split(input) | developmentseed/slingshotSMS | [
55,
21,
55,
1,
1250476174
] |
def _decode(input,errors='strict'):
# opposite of above, look for multibye 'marker'
# and handle it ourselves, pass the rest to the
# standard decoder | developmentseed/slingshotSMS | [
55,
21,
55,
1,
1250476174
] |
def encode(self,input,errors='strict'):
return _encode(input,errors) | developmentseed/slingshotSMS | [
55,
21,
55,
1,
1250476174
] |
def encode(self, input, final=False):
# just use the standard encoding as there is no need
# to hold state
return _encode(input,self.errors)[0] | developmentseed/slingshotSMS | [
55,
21,
55,
1,
1250476174
] |
def __init__(self,errors='strict'):
codecs.IncrementalDecoder.__init__(self,errors)
self.last_saw_mark=False | developmentseed/slingshotSMS | [
55,
21,
55,
1,
1250476174
] |
def reset(self):
self.last_saw_mark=False | developmentseed/slingshotSMS | [
55,
21,
55,
1,
1250476174
] |
def getregentry():
return codecs.CodecInfo(
name='gsm0338',
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
incrementaldecoder=IncrementalDecoder,
streamreader=StreamReader,
streamwriter=StreamWriter,
) | developmentseed/slingshotSMS | [
55,
21,
55,
1,
1250476174
] |
def _inc_encode(ie):
encoded=list()
hop=17 # make it something odd
final=False
for i in range(0,len(gsm_alpha),hop):
end=i+hop
if end>=len(gsm_alpha): final=True
encoded.append(ie.encode(gsm_alpha[i:end],final))
return ''.join(encoded) | developmentseed/slingshotSMS | [
55,
21,
55,
1,
1250476174
] |
def _inc_decode(idec):
decoded=list()
# define so we KNOW we hit a mark as last char
hop=gsm_alpha_gsm.index('\x1b')+1
final=False
for i in range(0,len(gsm_alpha_gsm),hop):
end=i+hop
if end>=len(gsm_alpha_gsm): final=True
decoded.append(idec.de... | developmentseed/slingshotSMS | [
55,
21,
55,
1,
1250476174
] |
def macroop INS_M_R {
# Find the constant we need to either add or subtract from rdi
ruflag t0, 10
movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
subi t4, t0, dsz, dataSize=asz
mov t3, t3, t4, flags=(nCEZF,), dataSize=asz
zexti t2, reg, 15, dataSize=8
mfence
ld t6, intseg, [1, t2, t0], ... | austinharris/gem5-riscv | [
11,
2,
11,
1,
1435967033
] |
def macroop INS_E_M_R {
and t0, rcx, rcx, flags=(EZF,), dataSize=asz
br label("end"), flags=(CEZF,)
# Find the constant we need to either add or subtract from rdi
ruflag t0, 10
movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
subi t4, t0, dsz, dataSize=asz
mov t3, t3, t4, flags=(nCEZF,), dataSi... | austinharris/gem5-riscv | [
11,
2,
11,
1,
1435967033
] |
def macroop OUTS_R_M {
# Find the constant we need to either add or subtract from rdi
ruflag t0, 10
movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
subi t4, t0, dsz, dataSize=asz
mov t3, t3, t4, flags=(nCEZF,), dataSize=asz
zexti t2, reg, 15, dataSize=8
mfence
ld t6, ds, [1, t0, rsi]
... | austinharris/gem5-riscv | [
11,
2,
11,
1,
1435967033
] |
def macroop OUTS_E_R_M {
and t0, rcx, rcx, flags=(EZF,), dataSize=asz
br label("end"), flags=(CEZF,)
# Find the constant we need to either add or subtract from rdi
ruflag t0, 10
movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
subi t4, t0, dsz, dataSize=asz
mov t3, t3, t4, flags=(nCEZF,), dataS... | austinharris/gem5-riscv | [
11,
2,
11,
1,
1435967033
] |
def __init__(self, config_section, defaults=None, config_path=None, secrets_dir=None,
throw_exception=False, allow_no_value=True):
"""
Config files will be checked in /etc/panw be default. If a PANW_CONFIG env exists, it will pull the path from
there When setting variable values... | PaloAltoNetworks-BD/autofocus-client-library | [
18,
12,
18,
4,
1443801109
] |
def get_int(self, *args, **kwargs):
""" Cast raw value to int
Returns:
int: value cast to int
"""
# TODO: Make this mimic the config parser behavior. Does it throw exceptions?
return int(self.get_setting(*args, **kwargs)) | PaloAltoNetworks-BD/autofocus-client-library | [
18,
12,
18,
4,
1443801109
] |
def get_boolean(self, *args, **kwargs):
""" Returns boolean for parsed value. Parsed value must be one of
["1", "yes", "on", "true", "0", "no", "off", "false"]
Returns:
bool: boolean value representation of provided value
Raises:
ValueError:... | PaloAltoNetworks-BD/autofocus-client-library | [
18,
12,
18,
4,
1443801109
] |
def get_setting(self, name, section=None, throw_exception=None):
"""
Setting names should always be lower_case_underscore
Well check the config and environment variables for the name. Environment variables will be made all caps
when checked
Args:
... | PaloAltoNetworks-BD/autofocus-client-library | [
18,
12,
18,
4,
1443801109
] |
def find_origin_coordinate(sites):
""" Find the coordinates of each site within the tile, and then subtract the
smallest coordinate to re-origin them all to be relative to the tile.
"""
if len(sites) == 0:
return 0, 0
def inner_():
for site in sites:
coordinate = SITE_C... | SymbiFlow/prjuray | [
48,
12,
48,
18,
1594844148
] |
def main():
site_pins = json5.load(sys.stdin)
output_site_pins = {}
output_site_pins["tile_type"] = site_pins["tile_type"]
output_site_pins["sites"] = copy.deepcopy(site_pins["sites"])
site_pin_to_wires = create_site_pin_to_wire_maps(site_pins['tile_name'],
... | SymbiFlow/prjuray | [
48,
12,
48,
18,
1594844148
] |
def __init__(self, isPercentageLimits=False, *args, **kw_args):
"""Initialises a new 'LimitSet' instance.
@param isPercentageLimits: Tells if the limit values are in percentage of normalValue or the specified Unit for Measurements and Controls.
"""
#: Tells if the limit values are in p... | rwl/PyCIM | [
68,
33,
68,
7,
1238978196
] |
def __init__(
self,
plotly_name="sizesrc",
parent_name="scattermapbox.hoverlabel.font",
**kwargs | plotly/python-api | [
13052,
2308,
13052,
1319,
1385013188
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.