Creates a new stop <Placemark/> element.

    Args:
      stop_folder: the KML folder the placemark will be added to.
      stop: the actual Stop to create a placemark for.
      style_id: optional argument indicating a style id to add to the placemark.
968451
def _CreateStopPlacemark(self, stop_folder, stop, style_id):
    
    desc_items = []
    desc_items.append("Stop id: %s" % stop.stop_id)
    if stop.stop_desc:
      desc_items.append(stop.stop_desc)
    if stop.stop_url:
      desc_items.append('Stop info page: <a href="%s">%s</a>' % (
          stop.stop_url, stop.stop_url))
    description = '<br/>'.join(desc_items) or None
    placemark = self._CreatePlacemark(stop_folder, stop.stop_name,
                                        description=description,
                                        style_id=style_id)
    point = ET.SubElement(placemark, 'Point')
    coordinates = ET.SubElement(point, 'coordinates')
    coordinates.text = '%.6f,%.6f' % (stop.stop_lon, stop.stop_lat)
400492
def _element_path_create_new(element_path):
    # type: (Text) -> Tuple[ET.Element, ET.Element]
    
    element_names = element_path.split('/')

    start_element = ET.Element(element_names[0])
    end_element = _element_append_path(start_element, element_names[1:])

    return start_element, end_element
192440
def task_stop(self, **kw):
        

        id, task = self.get_task(**kw)

        self._execute(id, 'stop')
        return self.get_task(uuid=task['uuid'])[1]
215535
function() {
        // Folder
        var folder = this.createElementNS(this.kmlns, "Folder");

        // Folder name
        if (this.foldersName) {
            var folderName = this.createElementNS(this.kmlns, "name");
            var folderNameText = this.createTextNode(this.foldersName); 
            folderName.appendChild(folderNameText);
            folder.appendChild(folderName);
        }

        // Folder description
        if (this.foldersDesc) {
            var folderDesc = this.createElementNS(this.kmlns, "description");        
            var folderDescText = this.createTextNode(this.foldersDesc); 
            folderDesc.appendChild(folderDescText);
            folder.appendChild(folderDesc);
        }

        return folder;
    }
516410
def create_folder_if_not_exists(folder_path):
    """"""
    folder_path = tilde_expansion(folder_path)
    folder_path = "".join([folder_path, '/']) if not folder_path[-1] == '/' else folder_path
    direc = os.path.dirname(folder_path)
    if not folder_exists(direc):
        os.makedirs(direc)
328541
def mkdir(self, target_folder):
        
        self.printv("Making directory: %s" % target_folder)
        self.k.key = re.sub(r"^/|/$", "", target_folder) + "/"
        self.k.set_contents_from_string('')
        self.k.close()
31109
def app_stop(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('app:stop', **{
        'node': ctx.repo.create_secure_service('node'),
        'name': name,
    })
1102173
function (endpoint, placeholder, _jsPlumb) {
		var stopped = false;
		return {
			drag: function () {
				if (stopped) {
					stopped = false;
					return true;
				}

				if (placeholder.element) {
					var _ui = _jsPlumb.getUIPosition(arguments, _jsPlumb.getZoom());
					jsPlumb.setPosition(placeholder.element, _ui);
					_jsPlumb.repaint(placeholder.element, _ui);
					// always repaint the source endpoint, because only continuous/dynamic anchors cause the endpoint
					// to be repainted, so static anchors need to be told (or the endpoint gets dragged around)
					endpoint.paint({anchorPoint:endpoint.anchor.getCurrentLocation({element:endpoint.element})});
				}
			},
			stopDrag: function () {
				stopped = true;
			}
		};
	}
1316268
def create(self):
    

    self.validate()
    body = soap_request.new_folder(self)

    response_xml = self.service.send(body)
    self._id, self._change_key = self._parse_id_and_change_key_from_response(response_xml)

    return self
1282648
def createFolder(self, name):
        
        url = "%s/createFolder" % self.root
        params = {
            "f" : "json",
            "title" : name
        }
        self._folders = None
        return self._post(url=url,
                             param_dict=params,
                             securityHandler=self._securityHandler,
                             proxy_port=self._proxy_port,
                             proxy_url=self._proxy_url)
822654
def stop_instance(self, instance_id):
        
        if not instance_id:
            log.info("Instance to stop has no instance id")
            return

        gce = self._connect()

        try:
            request = gce.instances().delete(project=self._project_id,
                                        instance=instance_id, zone=self._zone)
            response = self._execute_request(request)
            self._check_response(response)
        except HttpError as e:
            # If the instance does not exist, we get a 404
            if e.resp.status == 404:
                raise InstanceNotFoundError(
                    "Instance `{instance_id}` was not found"
                    .format(instance_id=instance_id))
            else:
                raise InstanceError(
                    "Could not stop instance `{instance_id}`: `{e}`"
                    .format(instance_id=instance_id, e=e))
        except CloudProviderError as e:
            raise InstanceError(
                "Could not stop instance `{instance_id}`: `{e}`"
                .format(instance_id=instance_id, e=e))
149384
def folder_created_message(self, request, folder):
        
        messages.success(request, _("Folder {} was created".format(folder)))
439354
public final void addFolder(@NotNull final Folder folder) {
        Contract.requireArgNotNull("folder", folder);
        if (folders == null) {
            folders = new ArrayList<>();
        }
        folders.add(folder);
    }
930534
def step_a_new_working_directory(context):
    
    command_util.ensure_context_attribute_exists(context, "workdir", None)
    command_util.ensure_workdir_exists(context)
    shutil.rmtree(context.workdir, ignore_errors=True)
931884
private void mkdir(IStructuredSelection selection) {
    List<DFSFolder> folders = filterSelection(DFSFolder.class, selection);
    if (folders.size() >= 1) {
      DFSFolder folder = folders.get(0);
      InputDialog dialog =
          new InputDialog(Display.getCurrent().getActiveShell(),
              "Create subfolder", "Enter the name of the subfolder", "",
              null);
      if (dialog.open() == InputDialog.OK)
        folder.mkdir(dialog.getValue());
    }
  }
391502
def add_folder_task(self, dir_name=None):
        ''''''
        folder_dialog = Gtk.FileChooserDialog(_('Choose Folders..'),
                self.app.window, Gtk.FileChooserAction.SELECT_FOLDER,
                (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                 Gtk.STOCK_OK, Gtk.ResponseType.OK))
        folder_dialog.set_modal(True)
        folder_dialog.set_select_multiple(True)
        folder_dialog.set_default_response(Gtk.ResponseType.OK)
        folder_dialog.set_current_folder(Config.HOME_DIR)
        response = folder_dialog.run()
        if response != Gtk.ResponseType.OK:
            folder_dialog.destroy()
            return
        source_paths = folder_dialog.get_filenames()
        folder_dialog.destroy()
        if source_paths:
            self.upload_files(source_paths, dir_name)
180864
def stop(args):
    
    p = OptionParser(stop.__doc__)
    p.add_option("--profile", default="mvrad-datasci-role", help="Profile name")
    opts, args = p.parse_args(args)

    if len(args) != 0:
        sys.exit(not p.print_help())

    role(["htang"])
    session = boto3.Session(profile_name=opts.profile)
    client = session.client('ec2')
    s = InstanceSkeleton()

    # Make sure the instance id is NOT empty
    instance_id = s.instance_id
    if instance_id == "":
        logging.error("Cannot find instance_id {}".format(instance_id))
        sys.exit(1)

    block_device_mappings = []
    for volume in s.volumes:
        block_device_mappings.append(
            {
                "DeviceName": volume["Device"],
                "NoDevice": ""
            }
        )

    new_image_name = "htang-dev-{}-{}".format(timestamp(), int(time.time()))
    response = client.create_image(
        InstanceId=instance_id,
        Name=new_image_name,
        BlockDeviceMappings=block_device_mappings
    )
    print(response, file=sys.stderr)
    new_image_id = response["ImageId"]

    image_status = ""
    while image_status != "available":
        logging.debug("Waiting for image to be ready")
        time.sleep(10)
        response = client.describe_images(ImageIds=[new_image_id])
        image_status = response["Images"][0]["State"]

    # Delete old image, snapshot and shut down instance
    old_image_id = s.image_id
    response = client.describe_images(ImageIds=[old_image_id])
    old_snapshot_id = response["Images"][0]["BlockDeviceMappings"][0]["Ebs"]["SnapshotId"]
    response = client.deregister_image(ImageId=old_image_id)
    print(response, file=sys.stderr)
    response = client.delete_snapshot(SnapshotId=old_snapshot_id)
    print(response, file=sys.stderr)
    response = client.terminate_instances(InstanceIds=[instance_id])
    print(response, file=sys.stderr)

    # Save new image id
    s.save_image_id(new_image_id)
    s.save_instance_id("", "")