Did I find the right examples for you? yes no

All Samples(93809)  |  Call(91242)  |  Derive(2557)  |  Import(10)
list() -> new empty list
list(iterable) -> new list initialized from iterable's items

src/i/r/Iris7-1.99.0-xdistrev2/lib/iris/analysis/interpolate.py   Iris7(Download)
        for dim in cube.coord_dims(coord):
            sample_dims.add(dim)
    sample_dims = sorted(list(sample_dims))
 
    # Extract a sub cube that lives in just the sampling space.
 
    # get the new shape of the data
    new_shape = list(source_cube.shape)
    if source_x_dims:
        new_shape[source_x_dims[0]] = grid_x.shape[0]
    if mode == 'bilinear':
        # Perform bilinear interpolation, passing through any keywords.
        points_dict = [(source_x, list(x_coord.points)), (source_y, list(y_coord.points))]
        new_data = linear(source_cube, points_dict, **kwargs).data
    else:
            ok = numpy.where( (requested_x >= self.x[0]) & (requested_x <= self.x[-1]) )[0]
 
            data_shape = list(self._interpolator.y.shape)
            data_shape[-1] = len(requested_x)
            result = numpy.empty(data_shape, dtype=self._interpolator(self.x[0]).dtype)

src/p/y/pyobjc-framework-PreferencePanes-2.5.1/Examples/EnvironmentPrefs/ShellEnv.py   pyobjc-framework-PreferencePanes(Download)
        if self.environ is None:
            self.environ = NSMutableDictionary.dictionary()
        self.keys = list(self.environ.keys())
        self.keys.sort()
        self.changed = False
            name = NEWTMPL%(i,)
        self.environ[name] = NSLocalizedString("New Value", "")
        self.keys = list(self.environ.keys())
        self.keys.sort()
        self.mainTable.reloadData()
                del self.environ[envname]
                self.environ[value] = val
                self.keys = list(self.environ.keys())
                self.keys.sort()
                aView.reloadData()

src/b/o/Boodler-2.0.3/src/boodle/sample.py   Boodler(Download)
def unload_unused(deathtime):
    for samp in list(cache.values()):
        if (samp.refcount == 0
            and (not (samp.csamp is None))
            and deathtime >= samp.lastused

src/s/e/seishub.core-1.2.1/seishub/core/registry/registry.py   seishub.core(Download)
class RegistryBase(DbStorage, list):
    """
    Base class for StylesheetRegistry, SchemaRegistry and AliasRegistry.
 
    NOTE: a registry object is unambiguously defined by either 
class SchemaRegistry(RegistryBase):
    _registry = list()
    cls = Schema
    package_id = "seishub"
    resourcetype_id = "schema"
class StylesheetRegistry(RegistryBase):
    _registry = list()
    cls = Stylesheet
    package_id = "seishub"
    resourcetype_id = "stylesheet"
class AliasRegistry(RegistryBase):
    _registry = list()
    cls = Alias
 
    def register(self, uri, expr):
            formats = cls.format_id
            if isinstance(formats, basestring):
                formats = list(formats)
            if not isinstance(cls.format_id, list):
                msg = "Class %s has a wrong implementation of %s. " + \

src/p/y/pymaclab-0.95.9/sympycore/heads/exp_coeff_dict.py   pymaclab(Download)
        """
        variables = set([])
        seq = list(seq)
        while seq:
            s = seq.pop(0)
            return expr
        variables = self.combine_variables(evars, variables)
        levars = list(evars)
        l = []
        for v in variables:
        TODO: move the algorithm to expr.py and implement its C version.
        """
        exps = list(lexps) + list(rexps)
        n = len(exps)
        i0 = 0

src/u/n/uniconvertor-HEAD/UniConvertor/trunk/uniconvertor/src/app/Graphics/bezier.py   uniconvertor(Download)
	def OpenNodes(self):
		if self.selection_type == SelCurvePoint:
			index = self.selected_path
			paths = list(self.paths)
			path = paths[index]
	def SegmentsToLines(self):
		if self.selection_type == SelCurvePoint:
			new_paths = list(self.paths)
			path = new_paths[self.selected_path]
			new_paths[self.selected_path] = segment_to_line(path, self.selected_idx)
	def SegmentsToCurve(self):
		if self.selection_type == SelCurvePoint:
			new_paths = list(self.paths)
			path = new_paths[self.selected_path]
			new_paths[self.selected_path] = segment_to_curve(path, self.selected_idx)
	def InsertNodes(self):
		if self.selection_type == SelCurvePoint:
			new_paths = list(self.paths)
			path = new_paths[self.selected_path]
			new_paths[self.selected_path] = insert_node_at(path, self.selected_idx)

src/o/t/otrace-0.30.9/tornademos/otrace.py   otrace(Download)
class LineList(list):
    def __str__(self):
        s = [str(x) for x in self]
        return "".join(x if x.endswith("\n") else x+"\n" for x in s)
 
            new_context.set_trc("exception", new_excp_str)
            if excp.args:
                excp.args = tuple([new_excp_str] + list(excp.args[1:]))
            else:
                excp.args = (new_excp_str,)
                        # Hold before generator executes
                        try:
                            context_path = [BASE_DIR, RECENT_DIR] + list(ContextDict.split_trace_id(info.trace_id))
                            async_handler = cls.hold_wrapper(HoldHandler(info.self_arg, PATH_SEP+PATH_SEP.join(context_path),
                                                                         resume_value=wrapped_gen) )
    def method2(self, *args, **kwargs):
        unpatched = getattr(self.method2, "_otrace_unpatched_function")
        args = tuple([args[0] + "-MODIFIED"] + list(args[1:]))
        ret_value = unpatched(self, *args, **kwargs)
        return ret_value + "-RETMODIFIED"

src/d/j/django-sct-0.7/sphenecoll/sphene/community/models.py   django-sct(Download)
 
    # Check if anything has changed
    tag_labels = list(tag_labels)
    old_tag_labels = TaggedItem.objects.filter( content_type__pk = model_type.id,
                                                object_id = model_instance.id, )
                                              object_id = model_instance.id, )
 
    tag_labels = list()
    for tagged_item in tagged_items:
        if tagged_item.tag_label == '':

src/p/g/pg_proboscis-1.0.5/postgresql/interface/proboscis/tracenull.py   pg_proboscis(Download)
def iter_row_pack(htiter, typio, encode):
	'Used to process tuples for bulk loads'
	for x in htiter:
		yield list(row_pack(x, typio, encode))
 
	def items(self):
		return list(self.iteritems())
 
	def iteritems(self):
		for k, v in self.attmap.iteritems():
			self.connection._complete()
 
		r = list(subidxiter(self._init_xact.completed, 1))
		argtypes = r[-3]
		tupdesc = r[-2]
	def __call__(self, *args, **kw):
		if self._input_io:
			params = list(row_pack(
				args, self._input_io,
				self.connection._encode
	def first(self, *args):
		# Parameters? Build em'.
		if self._input_io:
			params = list(row_pack(
				args or self.defaults,

src/t/e/Telemeta-1.4.4/example/sandbox_sqlite/modelviz.py   Telemeta(Download)
        for appmodel in appmodels:
            abstract_models = abstract_models + [abstract_model for abstract_model in appmodel.__bases__ if hasattr(abstract_model, '_meta') and abstract_model._meta.abstract]
        abstract_models = list(set(abstract_models)) # remove duplicates
        appmodels = abstract_models + appmodels
 

Previous  3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11  Next