Creates a placeholder connection view

        :return: New placeholder connection
        :rtype: rafcon.gui.mygaphas.items.connection.ConnectionPlaceholderView
504798
def _create_temporary_connection(self):
        
        if self._is_transition:
            self._connection_v = TransitionPlaceholderView(self._parent_state_v.hierarchy_level)
        else:
            self._connection_v = DataFlowPlaceholderView(self._parent_state_v.hierarchy_level)
        self.view.canvas.add(self._connection_v, self._parent_state_v)
161048
def clone_master_placeholders(self, notes_master):
        
        def iter_cloneable_placeholders(notes_master):
            """
            Generate a reference to each placeholder in *notes_master* that
            should be cloned to a notes slide when the a new notes slide is
            created.
            """
            cloneable = (
                PP_PLACEHOLDER.SLIDE_IMAGE,
                PP_PLACEHOLDER.BODY,
                PP_PLACEHOLDER.SLIDE_NUMBER,
            )
            for placeholder in notes_master.placeholders:
                if placeholder.element.ph_type in cloneable:
                    yield placeholder

        shapes = self.shapes
        for placeholder in iter_cloneable_placeholders(notes_master):
            shapes.clone_placeholder(placeholder)
403743
protected Connection<MailResourcesHolder> getMailConnection()
    {
        Connection<MailResourcesHolder> mailConnection=null;
        if(this.usePersistentConnection)
        {
            synchronized(this)
            {
                if(this.connection==null)
                {
                    //create new connection
                    this.connection=this.createMailConnection();
                }
            }
            
            //get connection
            mailConnection=this.connection;
        }
        else
        {
            //create new connection
            mailConnection=this.createMailConnection();
        }
        
        return mailConnection;
    }
608121
def formfield(self, **kwargs):
        
        defaults = {
            'label': capfirst(self.verbose_name),
            'help_text': self.help_text,
            'required': not self.blank,
        }
        defaults.update(kwargs)
        return PlaceholderFormField(slot=self.slot, plugins=self._plugins, **defaults)
1093297
def iter_cloneable_placeholders(self):
        
        latent_ph_types = (
            PP_PLACEHOLDER.DATE, PP_PLACEHOLDER.FOOTER,
            PP_PLACEHOLDER.SLIDE_NUMBER
        )
        for ph in self.placeholders:
            if ph.element.ph_type not in latent_ph_types:
                yield ph
473095
@NonNull
    public ViewHolder onCreateViewHolder(@NonNull ViewDataBinding binding) {
        if (viewHolderFactory != null) {
            return viewHolderFactory.createViewHolder(binding);
        } else {
            return new BindingViewHolder(binding);
        }
    }
81502
def _create_connection(self):
        
        db = psycopg2.connect(database=self.dbname,
                                user=self.user, password=self.password,
                                host=self.host, port=self.port)
        if 'psycopg2.extras' in sys.modules:
            psycopg2.extras.register_hstore(db)
        return db
706664
def _createConnection(self, connections):
        

        for c in connections:
            # Create GSSHAPY Connection object
            connection = Connection(slinkNumber=c['slinkNumber'],
                                    upSjuncNumber=c['upSjunc'],
                                    downSjuncNumber=c['downSjunc'])

            # Associate Connection with StormPipeNetworkFile
            connection.stormPipeNetworkFile = self
449367
def get_urls(self):
        
        # See: `fluent_pages.pagetypes.fluentpage.admin.FluentPageAdmin`.
        urls = super(LayoutAdmin, self).get_urls()
        my_urls = patterns(
            '',
            url(
                r'^placeholder_data/(?P<id>\d+)/$',
                self.admin_site.admin_view(self.placeholder_data_view),
                name='layout_placeholder_data',
            )
        )
        return my_urls + urls
911258
def insert(self, context):
	
		
		
		status_code, msg = self.__endpoint.post(
			"/resources/connector-connection-pool",
			data={
				"id": self.__name,
				"resourceAdapterName": self.__res_adapter_name,
				"connectiondefinitionname": self.__conn_def_name,
				"property": props_value(self.__props)
			}
		)
		self.__available = True
857529
def get_placeholder_data_view(self, request, object_id):
        
        language = 'en'  #request.POST['language']
        with translation.override(language):  # Use generic solution here, don't assume django-parler is used now.
            obj = self.get_object(request, object_id)

        if obj is None:
            json = {'success': False, 'error': 'Page not found'}
            status = 404
        elif not self.has_change_permission(request, obj):
            json = {'success': False, 'error': 'No access to page'}
            status = 403
        else:
            # Fetch the forms that would be displayed,
            # return the data as serialized form data.
            status = 200
            json = {
                'success': True,
                'object_id': object_id,
                'language_code': language,
                'formset_forms': self._get_object_formset_data(request, obj),
            }

        return JsonResponse(json, status=status)
183694
def connected(self, *, presence=structs.PresenceState(False), **kwargs):
        
        return UseConnected(self, presence=presence, **kwargs)
1331023
def __get_placeholders(self):
        
        ret = True

        pattern = re.compile('(@[A-Za-z0-9_.]+(%(max-)?type)?@)')
        matches = pattern.findall(self._routine_source_code)

        placeholders = []

        if len(matches) != 0:
            for tmp in matches:
                placeholder = tmp[0]
                if placeholder.lower() not in self._replace_pairs:
                    raise LoaderException("Unknown placeholder '{0}' in file {1}".
                                          format(placeholder, self._source_filename))
                if placeholder not in placeholders:
                    placeholders.append(placeholder)

        for placeholder in placeholders:
            if placeholder not in self._replace:
                self._replace[placeholder] = self._replace_pairs[placeholder.lower()]

        return ret
538114
def _resolve_placeholder(placeholder, original):
    
    new = copy.deepcopy(original)
    # The name remains the same.
    new["name"] = placeholder["name"]
    new["full_name"] = placeholder["full_name"]
    # Record where the placeholder originally came from.
    new["original_path"] = original["full_name"]
    # The source lines for this placeholder do not exist in this file.
    # The keys might not exist if original is a resolved placeholder.
    new.pop("from_line_no", None)
    new.pop("to_line_no", None)

    # Resolve the children
    stack = list(new.get("children", ()))
    while stack:
        child = stack.pop()
        # Relocate the child to the new location
        assert child["full_name"].startswith(original["full_name"])
        suffix = child["full_name"][len(original["full_name"]) :]
        child["full_name"] = new["full_name"] + suffix
        # The source lines for this placeholder do not exist in this file.
        # The keys might not exist if original is a resolved placeholder.
        child.pop("from_line_no", None)
        child.pop("to_line_no", None)
        # Resolve the remaining children
        stack.extend(child.get("children", ()))

    placeholder.clear()
    placeholder.update(new)
976558
def visit(self, node):
        
        if isinstance(node, Placeholder):
            return self.placeholders[node.id]
        else:
            return super(PlaceholderReplace, self).visit(node)
740933
def copy_to_placeholder(self, placeholder, sort_order=None):
        
        qs = self.all()  # Get clone
        for item in qs:
            # Change the item directly in the resultset.
            item.copy_to_placeholder(placeholder, sort_order=sort_order, in_place=True)
            if sort_order is not None:
                sort_order += 1

        return qs
1031703
def get_formset(self, request, obj=None, **kwargs):
        
        def _placeholder_initial(p):
            # p.as_dict() returns allowed_plugins too for the client-side API.
            return {
                'slot': p.slot,
                'title': p.title,
                'role': p.role,
            }

        # Note this method is called twice, the second time in get_fieldsets() as `get_formset(request).form`
        initial = []
        if request.method == "GET":
            placeholder_admin = self._get_parent_modeladmin()

            # Grab the initial data from the parent PlaceholderEditorBaseMixin
            data = placeholder_admin.get_placeholder_data(request, obj)
            initial = [_placeholder_initial(d) for d in data]

            # Order initial properly,

        # Inject as default parameter to the constructor
        # This is the BaseExtendedGenericInlineFormSet constructor
        FormSetClass = super(PlaceholderEditorInline, self).get_formset(request, obj, **kwargs)
        FormSetClass.__init__ = curry(FormSetClass.__init__, initial=initial)
        return FormSetClass