本文整理汇总了Python中ShareYourSystem._filter方法的典型用法代码示例。如果您正苦于以下问题:Python ShareYourSystem._filter方法的具体用法?Python ShareYourSystem._filter怎么用?Python ShareYourSystem._filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShareYourSystem
的用法示例。
在下文中一共展示了ShareYourSystem._filter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_status
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def do_status(self):
#debug
'''
self.debug(('self.',self,['StatusingProcessStr']))
'''
#Check
if self.StatusingProcessStr!="":
#call
self.StatusedSnapshotStr=self.process(
"ps -ef | grep "+self.StatusingProcessStr
).ProcessedBashStr
#debug
'''
self.debug(('self.',self,['StatusedSnapshotStr']))
'''
#map
if self.StatusingProcessStr=='Python':
#filter
self.StatusedLineStrsList=SYS._filter(
lambda __LineStr:
SYS.PythonPathStr in __LineStr,
self.StatusedSnapshotStr.split('\n')
)
else:
#split
self.StatusedLineStrsList=self.StatusedSnapshotStr.split('\n')
#debug
'''
self.debug(
[
('self.',self,['StatusedLineStrsList']),
]
)
'''
#filter
self.StatusedLineStrsList=SYS._filter(
lambda __StatusedLineStr:
__StatusedLineStr!='',
self.StatusedLineStrsList
)
#call
self.StatusedIdStrsList=map(
lambda __LineStr:
__LineStr.split()[1],
self.StatusedLineStrsList
)
#debug
'''
示例2: status
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def status(_ProcessStr):
#call
SnapshotStr=self.process(
"ps -ef | grep "+_ProcessStr
).ProcessedBashStr
#Debug
'''
print('Processer')
print('SnapshotStr is '+SnapshotStr)
print('')
'''
#map
if _ProcessStr=='Python':
#filter
LineStrsList=SYS._filter(
lambda __LineStr:
SYS.PythonPathStr in __LineStr,
SnapshotStr.split('\n')
)
else:
#split
LineStrsList=SnapshotStr.split('\n')
#debug
'''
print('Processer')
print('LineStrsList is ')
print(LineStrsList)
print('')
'''
#filter
LineStrsList=SYS._filter(
lambda __LineStr:
__LineStr!='',
LineStrsList
)
#call
IdStrsList=map(
lambda __LineStr:
__LineStr.split()[1],
LineStrsList
)
#debug
'''
print('Processer')
print('IdStrsList is ')
print(IdStrsList)
print('')
'''
return ' '.join(map(str,IdStrsList))
示例3: propertize
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def propertize(self,_Class):
#debug
'''
print('Propertiser l.47 default method')
print('_Class is ',_Class)
print('')
'''
#Check
if hasattr(_Class,"DefaultAttributeItemTuplesList"):
#debug
'''
print('_Class.DefaultAttributeItemTuplesList is',_Class.DefaultAttributeItemTuplesList)
print('')
'''
#set the PropertizedDefaultTuplesList
_Class.PropertizedDefaultTuplesList=SYS._filter(
lambda __DefaultSetTuple:
type(__DefaultSetTuple[1]
)==property or (
hasattr(__DefaultSetTuple[1],'items'
) and 'DefaultValueType' in __DefaultSetTuple[1
] and __DefaultSetTuple[1
]['DefaultValueType']==property),
_Class.DefaultAttributeItemTuplesList
)
示例4: propertize_setModelingDescriptionTuplesList
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def propertize_setModelingDescriptionTuplesList(self, _SettingValueVariable):
# set
self._ModelingDescriptionTuplesList = _SettingValueVariable
# /###################/#
# Update the ModelKeyStrsList
#
# extend
self._ModelKeyStrsList = SYS.unzip(_SettingValueVariable, [0])
# debug
"""
self.debug(
[
'We have binded ModelingDescriptionTuplesList to ModelKeyStrsList',
('self.',self,['ModelingDescriptionTuplesList'])
]
)
"""
# /###################/#
# Look for items where it is a get dimension
#
# filter
self.ModelDimensionTuplesList = map(
lambda __DescriptionTuple: (__DescriptionTuple[0], __DescriptionTuple[2]),
SYS._filter(lambda __DescriptionTuple: type(__DescriptionTuple[2]) in [list, tuple], _SettingValueVariable),
)
# debug
"""
示例5: do_pool
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def do_pool(self):
#debug
self.debug(('self.',self,[
'PoolingSubsetLengthInt',
'PoolingSetLengthInt'
]))
#Combine
self.PooledIntsListsList=list(
itertools.combinations(
xrange(self.PoolingSetLengthInt),
self.PoolingSubsetLengthInt
)
)
#debug
'''
self.debug(('self.',self,['PooledIntsListsList']))
'''
#filter only the one with the pitch 0
self.PooledIntsListsList=SYS._filter(
lambda __PooledInt:
__PooledInt[0]==0,
self.PooledIntsListsList
)
示例6: getDatabasedColWithGetKeyStr
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def getDatabasedColWithGetKeyStr(_GetKeyStr):
# import
import tables
# Definition
global AnalyzingColStrsList
# Definition
DatabasedColStr = SYS._filter(
lambda __AnalyzingColStr: _GetKeyStr.endswith(__AnalyzingColStr), AnalyzingColStrsList
)[0]
# Debug
"""
print('l 55 getDatabasedColWithGetKeyStr')
print('DatabasedColStr is ')
print(DatabasedColStr)
print('')
"""
# Get the Col Class
if DatabasedColStr == "Str":
DatabasedColClass = getattr(tables, "StringCol")
else:
DatabasedColClass = getattr(tables, DatabasedColStr + "Col")
# Return
if DatabasedColStr == "Str":
return DatabasedColClass(100)
else:
return DatabasedColClass()
示例7: propertize_setModelingDescriptionTuplesList
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def propertize_setModelingDescriptionTuplesList(self,_SettingValueVariable):
#set
BaseClass.propertize_setModelingDescriptionTuplesList(self,_SettingValueVariable)
#filter
self.ShapingDimensionTuplesList=map(
lambda __DescriptionTuple:
(__DescriptionTuple[0], __DescriptionTuple[2]),
SYS._filter(
lambda __DescriptionTuple:
type(__DescriptionTuple[2]) in [list,tuple],
_SettingValueVariable
)
)
#debug
'''
示例8: do_attest
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def do_attest(self):
#set the TestedFolderPathStr
if self.AttestingFolderPathStr=="":
#In the gl
self.AttestingFolderPathStr=SYS.PythonlogyLocalFolderPathStr+self.DoClass.__module__.replace(
'.','/')+'/Attests/'
#debug
'''
print('self.ClassedModule is ',self.ClassedModule)
print('')
'''
#set the AttestedMethodStrsList
self.AttestedMethodStrsList=SYS._filter(
lambda __AttributeKeyStr:
__AttributeKeyStr.startswith(AttestingPrefixStr),
dir(self.DoClass)
)
#set
self.AttestedUnboundMethodsList=map(
lambda __AttestedMethodStr:
getattr(self.DoClass,__AttestedMethodStr),
self.AttestedMethodStrsList
)
#debug
'''
print('self.AttestedMethodStrsList is '+str(self.AttestedMethodStrsList))
print('')
'''
#set
if hasattr(self.DoClass,'setAttest')==False:
setattr(
self.DoClass,
setAttest.__name__,
setAttest
)
示例9: getModeledColWithGetKeyStr
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def getModeledColWithGetKeyStr(_GetKeyStr):
#import
import tables
#Definition
global AnalyzingColStrsList
#Definition
ModeledColStr=SYS._filter(
lambda __AnalyzingColStr:
_GetKeyStr.endswith(__AnalyzingColStr),
AnalyzingColStrsList
)[0]
#Debug
'''
print('l 55 getModeledColWithGetKeyStr')
print('ModeledColStr is ')
print(ModeledColStr)
print('')
'''
#Get the Col Class
if ModeledColStr=='Str':
ModeledColClass=getattr(
tables,
'StringCol'
)
else:
ModeledColClass=getattr(
tables,
ModeledColStr+'Col'
)
#Return
if ModeledColStr=='Str':
return ModeledColClass(100)
else:
return ModeledColClass()
示例10: __call__
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def __call__(self,_Class):
#debug
'''
print('Defaultor l.31 __call__ method')
print('_Class is ',_Class)
print('')
'''
#Call the parent init method
BaseClass.__call__(self,_Class)
#debug
'''
print('Defaultor l.47 look for an __init__ method')
print('_Class is ',_Class)
print('')
'''
#Check
if hasattr(_Class,"__init__"):
#debug
'''
print('It has an __init__ method')
print('')
'''
#get
InitWrapUnboundMethod=getattr(_Class,DefaultWrapMethodStr) if hasattr(_Class,DefaultWrapMethodStr) else DefaultInitFunction
#set the DefaultDict
_Class.InitInspectDict=SYS.InspectDict(InitWrapUnboundMethod)
#Definition the DefaultAttributeItemTuplesList
DefaultAttributeItemTuplesList=map(
lambda __DefaultSetItemTuple:
(
DefaultPrefixStr.join(
__DefaultSetItemTuple[0].split(DefaultPrefixStr)[1:]
),
getDefaultedValueVariableWithSetVariable(
__DefaultSetItemTuple[1]
)
),
SYS._filter(
lambda __DefaultItemTuple:
__DefaultItemTuple[0].startswith(DefaultPrefixStr),
_Class.InitInspectDict['DefaultOrderedDict'].items()
)
)
#set
_Class.DefaultAttributeVariablesOrderedDict=collections.OrderedDict(
DefaultAttributeItemTuplesList
)
#debug
'''
print('_Class.DefaultAttributeItemTuplesList is ',_Class.DefaultAttributeItemTuplesList)
print('')
'''
#set at the level of the class
map(
lambda __DefaultSetItemTuple:
setattr(_Class,*__DefaultSetItemTuple),
_Class.DefaultAttributeVariablesOrderedDict.items()
)
#set the DefaultSpecificKeyStrsList
_Class.DefaultSpecificKeyStrsList=_Class.DefaultAttributeVariablesOrderedDict.keys()
#Get the BaseKeyStrsList
_Class.DefaultBaseKeyStrsList=list(
SYS.collect(
_Class,
'__bases__',
'DefaultSpecificKeyStrsList'
)
)
#Debug
'''
print("l 269 Defaultor")
print("DefaultDecorationMethodStr is ",DefaultDecorationMethodStr)
print("")
'''
#Define the decorated function
InitExecStr="def "+DefaultDecorationMethodStr+"(_InstanceVariable,"
InitExecStr+="*_LiargVariablesList,"
InitExecStr+="**_KwargVariablesDict):\n\t"
InitExecStr+="initDefault(_InstanceVariable,"
InitExecStr+="*_LiargVariablesList,"
InitExecStr+="**dict(_KwargVariablesDict,**{'DefaultWrapMethodStr':'"+DefaultWrapMethodStr+"','DefaultClassStr':'"+_Class.__name__+"'}))\n"
#debug
'''
print('Defaultor l 280')
#.........这里部分代码省略.........
示例11: setDefault
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def setDefault(
_InstanceVariable,
_ClassVariable,
_AttributeKeyVariable=None,
**_KwargVariablesDict
):
#/#################/#
# Get all the default classes
#
#get
DefaultClassesList=SYS.GetList(_ClassVariable,SYS)
#Debug
print('setDefault l 168')
print('DefaultClassesList is ')
print(DefaultClassesList)
print('')
#/#################/#
# Get all the attribute to default set again and filter
# the ones that have not the right
#
#Check
if _AttributeKeyVariable==None:
AttributeKeyStrsList=SYS.sum(
map(
lambda __DefaultClass:
__DefaultClass.DefaultSpecificKeyStrsList,
DefaultClassesList
)
)
elif type(_AttributeKeyVariable)!=list:
AttributeKeyStrsList=[_AttributeKeyVariable]
else:
AttributeKeyStrsList=_AttributeKeyVariable
#Check
if 'DefaultNotSetTagStrsList' in _KwargVariablesDict:
#filter
AttributeKeyStrsList=SYS._filter(
lambda __AttributeKeyStr:
__AttributeKeyStr not in _KwargVariablesDict['DefaultNotSetTagStrsList'],
AttributeKeyStrsList
)
#Debug
print('Defaultor l 194')
print('AttributeKeyStrsList is ')
print(AttributeKeyStrsList)
print('')
#map a set for all the class attributes into the instance
map(
lambda __AttributeKeyStr:
_InstanceVariable.__setattr__
(
__AttributeKeyStr,
getattr(
_InstanceVariable.__class__,
__AttributeKeyStr
)
),
AttributeKeyStrsList
)
#set
'''
setDefaultMutable(
_InstanceVariable,
DefaultClassesList,
AttributeKeyStrsList
)
'''
#return
return _InstanceVariable
示例12: hasattr
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
DoClass.DoneNotAttributesOrderedDict=collections.OrderedDict()
#Check
if hasattr(DoClass,'DefaultAttributeItemTuplesList'):
#Debug
'''
print('Doer l.383')
print('DoClass.DefaultAttributeItemTuplesList is ',_Class.DefaultAttributeItemTuplesList)
print('')
'''
#Check for doing and done keyStrs
DoClass.DoneAttributeVariablesOrderedDict=collections.OrderedDict(SYS._filter(
lambda __DefaultAttributeTuple:
__DefaultAttributeTuple[0].startswith(DoneStr),
DoClass.DefaultAttributeItemTuplesList
))
DoClass.DoingAttributeVariablesOrderedDict=collections.OrderedDict(SYS._filter(
lambda __DefaultAttributeTuple:
__DefaultAttributeTuple[0].startswith(DoingStr),
DoClass.DefaultAttributeItemTuplesList
))
#Definition
DoMethodKeyStr=DoingDoMethodStr+DoMethodStr
#Debug
'''
print('Doer l.401')
print('DoClass.DoneAttributeVariablesOrderedDict is ',DoClass.DoneAttributeVariablesOrderedDict)
示例13: do_insert
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
#.........这里部分代码省略.........
)+self.InsertedHdfNotRowPickOrderedDict.items()
#debug
'''
self.debug(
[
'This is a new hdf row',
('self.',self,['InsertedItemTuplesList'])
#'Colnames are : '+str(self.ModeledHdfTable.colnames),
#'self.ModeledHdfTable is '+str(dir(self.ModeledHdfTable)),
#'self.ModeledDescriptionClass is '+(str(self.ModeledDescriptionClass.columns) if hasattr(self.ModeledDescriptionClass,'columns') else ""),
#'Row is '+str(dir(Row)),
#'Row.table is '+str(Row.table),
#'TabularedHdfTablesOrderedDict is '+str(self.TabularedHdfTablesOrderedDict)
]
)
'''
#/###################/#
# Watch... The list or arrays needs to be at least one dimension
#
#debug
'''
self.debug(
[
'We filter the items that have null size...',
('self.',self,['InsertedItemTuplesList'])
]
)
'''
#filter
self.InsertedItemTuplesList=SYS._filter(
lambda __InsertedItemTuple:
hasattr(
__InsertedItemTuple[1],
'__len__'
)==False or len(__InsertedItemTuple[1])!=0,
self.InsertedItemTuplesList
)
try:
#debug
'''
self.debug(
[
'Ok now we try to append in the rows',
('self.',self,['InsertedItemTuplesList'])
]
)
'''
#set
map(
lambda __InsertingTuple:
Row.__setitem__(*__InsertingTuple),
self.InsertedItemTuplesList
)
#debug
'''
self.debug(
[
'It has worked !'
示例14: getModelColVariableWithKeyStr
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def getModelColVariableWithKeyStr(self, _KeyStr):
# import
import tables
# Definition
global ModelOneColStrsList, ModelListColStrsList, ModelArrayColStrsList
# /##################/#
# Look for one single type
#
# Definition
List = SYS._filter(lambda __ModelOneColStr: _KeyStr.endswith(__ModelOneColStr), ModelOneColStrsList)
# Check
if len(List) == 1:
# Get
ModelOneColStr = List[0]
# Debug
"""
print('l 55 getModelColVariableWithKeyStr')
print('ModeledColStr is ')
print(ModeledColStr)
print('')
"""
# Get the Col Class
if ModelOneColStr == "Str":
ModelColClass = getattr(tables, "StringCol")
else:
ModelColClass = getattr(tables, ModelOneColStr + "Col")
# Return
if ModelOneColStr == "Str":
return ModelColClass(100)
else:
return ModelColClass()
else:
# /##################/#
# Look for a shaped type
#
# Check
for __TypeStr in ["List", "Array"]:
# Definition
ModeledEndBoolsList = map(
lambda __ModelListColStr: _KeyStr.endswith(__ModelListColStr),
globals()["Model" + __TypeStr + "ColStrsList"],
)
# Check
if True in ModeledEndBoolsList:
# /####################/#
# Get the type
#
# get
ModelOneColStr = ModelOneColStrsList[ModeledEndBoolsList.index(True)]
# debug
"""
self.debug(
[
'ModelOneColStr is ',
ModelOneColStr
]
)
"""
# Get the Col Class
if ModelOneColStr == "Str":
ModelColClass = getattr(tables, "StringCol")
else:
ModelColClass = getattr(tables, ModelOneColStr + "Col")
# /####################/#
# Look if there is no a shape
#
# Check
if _KeyStr in self.__class__.DefaultAttributeVariablesOrderedDict:
# get
ClassValueVariable = self.__class__.DefaultAttributeVariablesOrderedDict[_KeyStr]
# debug
"""
self.debug(
[
'There is a shape ',
"ClassValueVariable['ShapeKeyStrsList'] is ",
str(ClassValueVariable['ShapeKeyStrsList'])
]
#.........这里部分代码省略.........
示例15: do_figure
# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import _filter [as 别名]
def do_figure(self):
#/###################/#
# First we get the children figurers and check what they are
#
#debug
self.debug(
[
'We figure here',
#('self.',self,['ViewFirstDeriveViewerVariable'])
'self.TeamDict.keys() is ',
str(self.TeamDict.keys())
]
)
#filter
FiguredTeamTagStrsList=SYS._filter(
lambda __KeyStr:
__KeyStr in ['Panels','Axes','Plots'],
self.TeamDict.keys()
)
#Check
if len(FiguredTeamTagStrsList)==1:
#filter
self.FiguredTeamTagStr=FiguredTeamTagStrsList[0]
#get
self.FiguredDeriveTeamerVariablesList=self.TeamDict[
self.FiguredTeamTagStr
].ManagementDict.values()
#debug
'''
self.debug(
[
('self.',self,[
'FiguredTeamTagStr',
#'FiguredDeriveTeamerVariablesList'
])
]
)
'''
#/###################/#
# do something before descending a figure call
#
if self.FiguredTeamTagStr=='Panels':
#debug
'''
self.debug(
[
'I am the top figurer...'
]
)
'''
elif self.FiguredTeamTagStr=='Axes' or self.ParentDeriveTeamerVariable.TeamTagStr=='Panels':
#/###############/#
# Add an axe for the symbol of the panel
#
#debug
'''
self.debug(
[
'We transform the team dict Axes to add a panel axe',
'self.TeamDict[\'Axes\'] is ',
SYS._str(self.TeamDict['Axes'])
]
)
'''
#team
self.team('Axes')
#debug
'''
self.debug(
[
'before setting',
'self.TeamedValueVariable.ManagementDict is ',
SYS._str(self.TeamedValueVariable.ManagementDict),
'Manager.ManagementDict is ',
str(Manager.ManagementDict)
]
)
'''
#map an add
map(
lambda __DeriveFigurer:
setattr(
__DeriveFigurer,
'ManagementIndexInt',
#.........这里部分代码省略.........