本文整理汇总了Python中java.util.Arrays.asList方法的典型用法代码示例。如果您正苦于以下问题:Python Arrays.asList方法的具体用法?Python Arrays.asList怎么用?Python Arrays.asList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Arrays
的用法示例。
在下文中一共展示了Arrays.asList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getExtraParametersForStep
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def getExtraParametersForStep(self, configurationAttributes, step):
if (step == 1):
return Arrays.asList("display_register_action")
elif (step == 2):
return Arrays.asList("oxpush2_auth_method", "oxpush2_request")
return None
示例2: getExtraParametersForStep
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def getExtraParametersForStep(self, configurationAttributes, step):
print "Passport. getExtraParametersForStep called"
if step == 1:
return Arrays.asList("selectedProvider", "externalProviders")
elif step == 2:
return Arrays.asList("passport_user_profile")
return None
示例3: getOutlierBound
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def getOutlierBound(rt):
""" Analyzes the results of the 1st partcile analysis.
Since the dilation of nuclear perimeter often causes
overlap of neighboring neculeus 'terrirories', such nucleus
are discarded from the measurements.
Small nucelei are already removed, but since rejection of nuclei depends on
standard outlier detection method, outliers in both smaller and larger sizes
are discarded.
"""
area = rt.getColumn(rt.getColumnIndex('Area'))
circ = rt.getColumn(rt.getColumnIndex("Circ."))
arealist = ArrayList(Arrays.asList(area.tolist()))
circlist = ArrayList(Arrays.asList(circ.tolist()))
bwc = InstBWC()
ans = bwc.calculateBoxAndWhiskerStatistics(arealist)
#anscirc = bwc.calculateBoxAndWhiskerStatistics(circlist)
if (VERBOSE):
print ans.toString()
print ans.getOutliers()
q1 = ans.getQ1()
q3 = ans.getQ3()
intrange = q3 - q1
outlier_offset = intrange * 1.5
# circularity better be fixed.
#circq1 = anscirc.getQ1()
#circq3 = anscirc.getQ3()
#circintrange = circq3 - circq1
#circoutlier_offset = circintrange * 1.5
return q1, q3, outlier_offset
示例4: getExtraParametersForStep
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def getExtraParametersForStep(self, configurationAttributes, step):
if step == 1:
if self.oneStep:
return Arrays.asList("super_gluu_request")
elif self.twoStep:
return Arrays.asList("display_register_action")
elif step == 2:
return Arrays.asList("super_gluu_auth_method", "super_gluu_request")
return None
示例5: test_vararg
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def test_vararg(self):
from java.util import Arrays
self.assertSequenceEqual((), Arrays.asList())
self.assertSequenceEqual(("1"), Arrays.asList("1"))
self.assertSequenceEqual(("1","2"), Arrays.asList("1","2"))
# Passing a tuple should convert the tuple elemnts to the varargs array.
self.assertSequenceEqual(("1","2"), Arrays.asList(("1","2")))
# instance method as opposed to static method above
self.assertSequenceEqual(("1","2"), self.test.testAllVarArgs("1","2"))
# Multiple varargs goes through a different path then just one vararg so be sure to hit both.
self.assertSequenceEqual(("1"), self.test.testAllVarArgs("1"))
# mixing normal args with varargs
self.assertSequenceEqual(("1","2", "3"), self.test.testMixedVarArgs("1","2", "3"))
self.assertSequenceEqual(("1","2", "3", "4"), self.test.testMixedVarArgs("1","2", "3", "4"))
示例6: run
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def run(self, ctx):
engctx = ctx.getEnginesContext()
if not engctx:
print('Back-end engines not initialized')
return
projects = engctx.getProjects()
if not projects:
print('There is no opened project')
return
# get the first unit available
units = RuntimeProjectUtil.findUnitsByType(projects[0], None, False)
if not units:
print('No unit available')
return
unit = units[0]
print('Unit: %s' % unit)
# retrieve the formatter, which is a producer of unit representations
formatter = unit.getFormatter()
# create a table document
columnLabels = Arrays.asList('Key', 'Value', 'Comment')
rows = ArrayList()
rows.add(TableRow(Arrays.asList(Cell('foo'), Cell('bar'), Cell('none'))))
rows.add(TableRow(Arrays.asList(Cell('type'), Cell('integer'), Cell('unset'))))
extraDoc = StaticTableDocument(columnLabels, rows)
extraPres0 = UnitRepresentationAdapter(101, 'Demo Table', False, extraDoc)
# create a tree document
columnLabels = Arrays.asList('Key', 'Value')
root = KVNode('foo', 'bar')
roots = Arrays.asList(root)
root.addChild(KVNode('quantified', 'self'))
root.addChild(KVNode('galaxy', 'milky way'))
node = KVNode('black hole', '42')
node.setClassId(ItemClassIdentifiers.INFO_DANGEROUS)
root.addChild(node)
extraDoc = StaticTreeDocument(roots, columnLabels, -1)
extraPres1 = UnitRepresentationAdapter(102, 'Demo Tree', False, extraDoc)
# add the newly created presentations to our unit, and notify clients
# the second argument indicates that the presentation should be persisted when saving the project
formatter.addPresentation(extraPres0, True)
formatter.addPresentation(extraPres1, True)
unit.notifyListeners(JebEvent(J.UnitChange));
示例7: disjunct
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def disjunct(cls, multiplier, *queries, **terms):
"Return lucene DisjunctionMaxQuery from queries and terms."
self = cls(search.DisjunctionMaxQuery, Arrays.asList(queries), multiplier)
for name, values in terms.items():
for value in ([values] if isinstance(values, basestring) else values):
self.add(cls.term(name, value))
return self
示例8: createLdapExtendedConfigurations
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def createLdapExtendedConfigurations(self, authConfiguration):
ldapExtendedConfigurations = []
for ldapConfiguration in authConfiguration["ldap_configuration"]:
configId = ldapConfiguration["configId"]
servers = ldapConfiguration["servers"]
bindDN = None
bindPassword = None
useAnonymousBind = True
if (self.containsAttributeString(ldapConfiguration, "bindDN")):
useAnonymousBind = False
bindDN = ldapConfiguration["bindDN"]
bindPassword = ldapConfiguration["bindPassword"]
useSSL = ldapConfiguration["useSSL"]
maxConnections = ldapConfiguration["maxConnections"]
baseDNs = ldapConfiguration["baseDNs"]
loginAttributes = ldapConfiguration["loginAttributes"]
localLoginAttributes = ldapConfiguration["localLoginAttributes"]
ldapConfiguration = GluuLdapConfiguration(configId, bindDN, bindPassword, Arrays.asList(servers),
maxConnections, useSSL, Arrays.asList(baseDNs),
loginAttributes[0], localLoginAttributes[0], useAnonymousBind)
ldapExtendedConfigurations.append({ "ldapConfiguration" : ldapConfiguration, "loginAttributes" : loginAttributes, "localLoginAttributes" : localLoginAttributes })
return ldapExtendedConfigurations
示例9: __init__
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def __init__(self, searcher, query, field, terms=False, fields=False, tag='', formatter=None, encoder=None):
if tag:
formatter = highlight.SimpleHTMLFormatter('<{}>'.format(tag), '</{}>'.format(tag))
scorer = (highlight.QueryTermScorer if terms else highlight.QueryScorer)(query, *(searcher.indexReader, field) * (not fields))
highlight.Highlighter.__init__(self, *filter(None, [formatter, encoder, scorer]))
self.searcher, self.field = searcher, field
self.selector = HashSet(Arrays.asList([field]))
示例10: outlierDetection
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def outlierDetection(pattern, measA):
filtsdevA = []
for ind, sd in enumerate(measA[2]):
if not measA[4][ind]:
filtsdevA.append(sd)
#sdevlist = ArrayList(Arrays.asList(measA[2]))
sdevlist = ArrayList(Arrays.asList(filtsdevA))
bwc = InstBWC()
ans = bwc.calculateBoxAndWhiskerStatistics(sdevlist)
q1 = ans.getQ1()
q3 = ans.getQ3()
intrange = q3 - q1
outlier_offset = intrange * 1.5
outlow = q1 - outlier_offset
outup = q3 + outlier_offset
filtersummary = { 'n': len(measA[2]),'Mean': ans.getMean(), 'Median': ans.getMedian(), 'Outlier-Low': outlow, 'Outlier-Up': outup }
for i, filep in enumerate(measA[0]):
#res = re.search(pattern, filep)
if (measA[2][i] < outlow) or (measA[2][i] > outup):
#print 'xxxW', res.group(2), measA[2][i]
measA[4][i] = 1
# else:
#print 'W', res.group(2), measA[2][i]
#measA[4].append(0)
return filtersummary
示例11: getUniqueSrcIps
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def getUniqueSrcIps(self, protocol=6):
uniqueIps = HashSet()
srcAddrSqlBuilder = SelectSqlBuilder('Agg_V5', 'srcAddr as ip', distinct=1)
srcAddrSqlBuilder.where('prot=%d' % protocol)
srcIps = self._sqlClient.execute(srcAddrSqlBuilder)
if srcIps:
uniqueIps.addAll(Arrays.asList([ipEntry.ip for ipEntry in srcIps]))
return uniqueIps.toArray()
示例12: initialize_executors_holder
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def initialize_executors_holder(servers):
server_names= []
for server in servers:
server_name = server.getProperty("serverName")
server_names.append(server_name)
if executors_holder.RUNNING_EXECUTORS.containsKey(server_name):
print "DEBUG: server name already in RUNNING EXECUTORS [%s]" % server_name
current_size = executors_holder.RUNNING_EXECUTORS.get(server_name).maxSize()
if current_size != server.getProperty("nrExecutors"):
fixed = FixedSizeList.decorate(Arrays.asList(String[server.getProperty("nrExecutors")]));
executors_holder.RUNNING_EXECUTORS.replace(server_name, fixed)
else:
print "DEBUG: server name not in RUNNING EXECUTORS [%s]" % server_name
fixed = FixedSizeList.decorate(Arrays.asList(["available"] * server.getProperty("nrExecutors")));
executors_holder.RUNNING_EXECUTORS.put(server_name, fixed)
# Remove any RUNNING_EXECUTORS that are not in servers
for key in executors_holder.RUNNING_EXECUTORS.keySet():
if key not in server_names:
print "DEBUG: Removing obsolete executors server [%s]" % key
executors_holder.RUNNING_EXECUTORS.remove(key)
示例13: addCommentsToDoc
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def addCommentsToDoc(self, unit):
notes = unit.getNotes() # Get the notes of unit
if isinstance(unit, IInteractiveUnit): # If the type of unit is IInteractiveUnit, which means it my has comments and we can use getComments()
totalComments = unit.getComments() # Get all comments
flag = True # If flag is true, we will add the unit name in the first column, and after that, it will be set to false, which means other rows of this unit will not be added the unit name.
# So only the first row of the unit have the unit name
if totalComments:
for address in totalComments:
if (totalComments[address] != None and totalComments[address] != ''):
if (flag):
self.rows.add(TableRow(Arrays.asList(Cell(unit.getName()), Cell(address), Cell(totalComments[address]))))
flag = False
else:
self.rows.add(TableRow(Arrays.asList(Cell(''), Cell(address), Cell(totalComments[address]))))
if totalComments and notes:
self.rows.add(TableRow(Arrays.asList(Cell(''), Cell('Notes:'), Cell(unit.getNotes()))))
return
if notes:
self.rows.add(TableRow(Arrays.asList(Cell(unit.getName()), Cell('Notes:'), Cell(unit.getNotes()))))
return
return
if notes:
self.rows.add(TableRow(Arrays.asList(Cell(unit.getName()), Cell('Notes:'), Cell(unit.getNotes()))))
示例14: getExtraParametersForStep
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def getExtraParametersForStep(self, configurationAttributes, step):
print "Casa. getExtraParametersForStep %s" % str(step)
if step > 1:
list = ArrayList()
acr = CdiUtil.bean(Identity).getWorkingParameter("ACR")
if acr in self.authenticators:
module = self.authenticators[acr]
params = module.getExtraParametersForStep(module.configAttrs, step)
if params != None:
list.addAll(params)
list.addAll(Arrays.asList("ACR", "methods", "trustedDevicesInfo"))
print "extras are %s" % list
return list
return None
示例15: doInit
# 需要导入模块: from java.util import Arrays [as 别名]
# 或者: from java.util.Arrays import asList [as 别名]
def doInit(self):
self.client = MemcachedClient(ConnectionFactoryBiggerTimeout(), Arrays.asList([InetSocketAddress("127.0.0.1", 11211)]))