text
stringlengths
0
828
lst = IgnoreList(root)
lst.parse(lines)
self.append(lst)"
1404,"def match(self, filename, isdir=False):
""""""
Match all the #IgnoreList#s` in this collection. Returns one of
- #MATCH_DEFAULT
- #MATCH_IGNORE
- #MATCH_INCLUDE
""""""
for lst in self:
result = lst.match(filename, isdir)
if result != MATCH_DEFAULT:
return result
return MATCH_DEFAULT"
1405,"def reply(self,message,message_type):
""""""
Send a reply message of the given type
Args:
- message: the message to publish
- message_type: the type of message being sent
""""""
if message_type == MULTIPART:
raise Exception(""Unsupported reply type"")
super(Replier,self).send(message,message_type)"
1406,"def parse_domain(url):
"""""" parse the domain from the url """"""
domain_match = lib.DOMAIN_REGEX.match(url)
if domain_match:
return domain_match.group()"
1407,"def get_credentials(options, environment):
"""""" Get credentials or prompt for them from options """"""
if options['--username'] or options['--auth']:
if not options['--username']:
options['<username>'] = lib.prompt(""Please enter the username for %s..."" % environment)
if not options['--password']:
options['<password>'] = lib.prompt(""Please enter the password for %s..."" % environment, secret=True)
return options"
1408,"def check_type(self, value):
""""""
Raises a #TypeError if *value* is not an instance of the field's #type.
""""""
if self.null and value is None:
return
if self.type is not None and not isinstance(value, self.type):
msg = '{0!r} expected type {1}'
raise TypeError(msg.format(self.full_name, self.type.__name__))"
1409,"def get_default(self):
""""""
Return the default value of the field. Returns either #default, the return
value of #default_factory or raises a #RuntimeError if the field has no
default value.
""""""
if self.default is not NotImplemented:
return self.default
elif self.default_factory is not None:
return self.default_factory()
else:
raise RuntimeError('{0!r} has no default value'.format(self.full_name))"
1410,"def full_name(self):
""""""
The full name of the field. This is the field's entities name
concatenated with the field's name. If the field is unnamed or
not bound to an entity, the result respectively contains None.
""""""
entity = self.entity.__name__ if self.entity is not None else None
name = self.name if self.name is not None else None
if entity and name:
return entity + '.' + name
elif entity:
return entity + '.<unnamed>'
elif name:
return '<unbound>.' + name
else:
return '<unbound>.<unnamed>'"
1411,"def type_name(self):
""""""
Returns the full type identifier of the field.
""""""
res = self.type.__name__
if self.type.__module__ not in ('__builtin__', 'builtins'):
res = self.type.__module__ + '.' + res
return res"
1412,"def get_subclass_from_module(module, parent_class):
""""""
Get a subclass of parent_class from the module at module
get_subclass_from_module performs reflection to find the first class that
extends the parent_class in the module path, and returns it.
""""""
try: