text stringlengths 0 828 |
|---|
help="""") |
parser.add_option(""--leak-detector-add-traceback"", action=""store_true"", |
default=env.get('NOSE_LEAK_DETECTOR_SAVE_TRACEBACK', False), |
dest=""leak_detector_save_traceback"", |
help="""") |
parser.add_option(""--leak-detector-ignore-pattern"", action=""append"", |
default=(list(filter(operator.truth, |
env.get('NOSE_LEAK_DETECTOR_IGNORE_PATTERNS', |
'').split(','))) or |
['NOSE_LEAK_DETECTOR_IGNORE']), |
dest=""leak_detector_ignore_patterns"", |
help="""")" |
3751,"def configure(self, options, conf): |
"""""" |
Configure plugin. |
"""""" |
super(LeakDetectorPlugin, self).configure(options, conf) |
if options.leak_detector_level: |
self.reporting_level = int(options.leak_detector_level) |
self.report_delta = options.leak_detector_report_delta |
self.patch_mock = options.leak_detector_patch_mock |
self.ignore_patterns = options.leak_detector_ignore_patterns |
self.save_traceback = options.leak_detector_save_traceback |
self.multiprocessing_enabled = bool(getattr(options, 'multiprocess_workers', False))" |
3752,"def bind(self, instance, auto=False): |
"""""" |
Bind deps to instance |
:param instance: |
:param auto: follow update of DI and refresh binds once we will get something new |
:return: |
"""""" |
methods = [ |
(m, cls.__dict__[m]) |
for cls in inspect.getmro(type(instance)) |
for m in cls.__dict__ if inspect.isfunction(cls.__dict__[m]) |
] |
try: |
deps_of_endpoints = [(method_ptr, self.entrypoint_deps(method_ptr)) |
for (method_name, method_ptr) in methods] |
for (method_ptr, method_deps) in deps_of_endpoints: |
if len(method_deps) > 0: |
method_ptr(instance, **method_deps) |
except KeyError: |
pass |
if auto and instance not in self.current_scope.get_auto_bind_list(): |
self.current_scope.auto_bind(instance) |
return instance" |
3753,"def map_dict(self, dict_entity): |
"""""" map dict_entity to current instance(self) """""" |
self.dict_entity = dict_entity |
Entity.map(self, self.dict_entity)" |
3754,"def as_dict(self): |
"""""" create a dict based on class attributes """""" |
odict = OrderedDict() |
for name in self._order: |
attr_value = getattr(self, name) |
if isinstance(attr_value, List): |
_list = [] |
for item in attr_value: |
_list.append((item.as_dict() if isinstance(item, Entity) else item)) |
odict[name] = _list |
elif isinstance(attr_value, Entity): |
odict[name] = attr_value.as_dict() |
else: |
odict[name] = getattr(self, name) |
return odict" |
3755,"def map(cls, dict_entity): |
"""""" staticmethod which will be used in recursive mode in order to map dict to instance """""" |
for key, value in dict_entity.items(): |
if hasattr(cls, key): |
if isinstance(value, list): |
_list = getattr(cls, key) |
if isinstance(_list.expected_type, list): |
for _dict in value: |
_list.append(cls.map(_list.typeof(), _dict)) |
elif isinstance(value, dict): |
attr = getattr(cls, key) |
instance = attr.expected_type() |
Entity.map(instance, value) |
setattr(cls, key, instance) |
else: |
setattr(cls, key, value) |
else: |
setattr(cls, key, value)" |
3756,"def generateParams(rawfilepath, outputpath, isolationWindow, coElute): |
""""""Generates a string containing the parameters for a pParse parameter file |
but doesn't write any file yet. |
:param rawfilepath: location of the thermo "".raw"" file |
:param outputpath: path to the output directory of pParse |
:param isolationWindow: MSn isolation window that was used for the |
aquisition of the specified thermo raw file |
:param coElute: 0 or 1, see ""[Advanced Options]"" below |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.