Create an Upload Area
        :param area_uuid: UUID of Upload Area to be created
        :return: an Upload Area object
        :rtype: UploadArea
183590
def create_area(self, area_uuid):
        
        result = self.api_client.create_area(area_uuid=area_uuid)
        area_uri = UploadAreaURI(uri=result['uri'])
        return UploadArea(uri=area_uri, upload_service=self)
316113
def dinfContributingArea(self,
                             contributing_area_grid,
                             flow_dir_grid,
                             outlet_shapefile=None,
                             weight_grid=None,
                             edge_contamination=False,
                             ):
        
        log("PROCESS: DinfContributingArea")

        # Construct the taudem command line.
        cmd = [os.path.join(self.taudem_exe_path, 'areadinf'),
               '-ang', flow_dir_grid,
               '-sca', contributing_area_grid,
               ]

        if outlet_shapefile:
            cmd += ['-o', outlet_shapefile]
        if weight_grid:
            cmd += ['-wg', weight_grid]
        if not edge_contamination:
            cmd = cmd + ['-nc']

        self._run_mpi_cmd(cmd)

        # create projection file
        self._add_prj_file(flow_dir_grid,
                           contributing_area_grid)
1154855
def file_upload_to(self, instance, filename):
        
        ext = filename.split(".")[-1]
        filename = "{}.{}".format(uuid.uuid4(), ext)
        return os.path.join("document", filename)
1037903
def file_upload(context, id, path):
    
    result = component.file_upload(context, id=id, file_path=path)
    utils.format_output(result, context.format)
281340
protected function Area()
    {
        if (!$this->area) {
            $this->area = new Area(Request::GetData('area'));
        }
        return $this->area;
    }
498985
def delete_area(area)
      reset_meta_data
      segments.each do |seg|
        seg.delete_area(area)
        update_meta_data(seg) unless seg.empty?
      end
      segments.delete_if(&:empty?)
    end
1309082
def __upload_chunk(self, resource, chunk_size, bytes, bytes_start, bytes_read):
        """"""

        # note: string conversion required here due to open encoding bug in requests-oauthlib.
        headers = {
            'content-type': self.content_type,
            'content-length': str(min([chunk_size, self._file_size - bytes_read])),
            'content-range': "bytes {0}-{1}/{2}".format(
                bytes_start, bytes_read - 1, self._file_size)
        }

        return Request(self._client, 'put', resource,
                       domain=self._DEFAULT_DOMAIN, headers=headers, body=bytes).perform()
417252
private void createAreas(final BufferedImage IMAGE) {
        if (!getAreas().isEmpty() && bImage != null) {
            final double ORIGIN_CORRECTION = 180.0;
            final double OUTER_RADIUS = bImage.getWidth() * 0.38f;
            final double RADIUS;
            if (isSectionsVisible()) {
                RADIUS = isExpandedSectionsEnabled() ? OUTER_RADIUS - bImage.getWidth() * 0.12f : OUTER_RADIUS - bImage.getWidth() * 0.04f;
            } else {
                RADIUS = OUTER_RADIUS;
            }
            final double FREE_AREA = bImage.getWidth() / 2.0 - RADIUS;

            for (Section area : getAreas()) {
                final double ANGLE_START;
                final double ANGLE_EXTEND;

                if (!isLogScale()) {
                    ANGLE_START = ORIGIN_CORRECTION - (area.getStart() * Math.toDegrees(getAngleStep()));
                    ANGLE_EXTEND = -(area.getStop() - area.getStart()) * Math.toDegrees(getAngleStep());
                } else {
                    ANGLE_START = ORIGIN_CORRECTION - (UTIL.logOfBase(BASE, area.getStart()) * Math.toDegrees(getLogAngleStep()));
                    ANGLE_EXTEND = -UTIL.logOfBase(BASE, area.getStop() - area.getStart()) * Math.toDegrees(getLogAngleStep());
                }

                final Arc2D AREA = new Arc2D.Double(Arc2D.PIE);
                AREA.setFrame(bImage.getMinX() + FREE_AREA, bImage.getMinY() + FREE_AREA, 2 * RADIUS, 2 * RADIUS);
                AREA.setAngleStart(ANGLE_START);
                AREA.setAngleExtent(ANGLE_EXTEND);

                area.setFilledArea(AREA);
            }

            // Draw the area
            if (isAreasVisible() && IMAGE != null) {
                final Graphics2D G2 = IMAGE.createGraphics();
                G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                for (Section area : getAreas()) {
                    G2.setColor(isTransparentAreasEnabled() ? area.getTransparentColor() : area.getColor());
                    G2.fill(area.getFilledArea());
                    if (area3DEffectVisible) {
                        G2.setPaint(area3DEffect);
                        G2.fill(area.getFilledArea());
                    }
                }
                G2.dispose();
            }
        }
    }
874258
private void createAreas(final BufferedImage IMAGE) {
        final Point2D AREA_OFFSET = new Point2D.Double(0, 0);

        if (bImage != null && !getAreas().isEmpty()) {
            double stopAngle = 0;
            double startAngle = 0;

            final double OUTER_RADIUS = bImage.getWidth() *  0.3411214953f;
            final double RADIUS;
            if (isSectionsVisible()) {
                RADIUS = isExpandedSectionsEnabled() ? OUTER_RADIUS - bImage.getWidth() * 0.12f : OUTER_RADIUS - bImage.getWidth() * 0.023364486f;
            } else {
                RADIUS = OUTER_RADIUS;
            }

            final double FREE_AREA = bImage.getWidth() / 2.0 - RADIUS;
            final Rectangle2D AREA_FRAME = new Rectangle2D.Double(bImage.getMinX() + FREE_AREA * 0.9 + AREA_OFFSET.getX(), bImage.getMinY() + FREE_AREA * 0.9 + AREA_OFFSET.getY(), 4 * RADIUS, 4 * RADIUS);

            for (Section tmpArea : getAreas()) {
                switch (getOrientation()) {
                    case NORTH_EAST:
                        if (!isLogScale()) {
                            stopAngle = 90 - Math.toDegrees((getMaxValue() - tmpArea.getStop() - getMinValue()) * getAngleStep());
                            startAngle = 90 - Math.toDegrees((getMaxValue() - tmpArea.getStart() - getMinValue()) * getAngleStep());
                        } else {
                            stopAngle = 90 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - tmpArea.getStop() - getMinValue()) * getLogAngleStep());
                            startAngle = 90 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - tmpArea.getStart() - getMinValue()) * getLogAngleStep());
                        }
                        AREA_OFFSET.setLocation(-bImage.getWidth() * 0.45, bImage.getWidth() * 0.195);
                        break;

                    case SOUTH_EAST:
                        if (!isLogScale()) {
                            stopAngle = 0 - Math.toDegrees((getMaxValue() - tmpArea.getStop() - getMinValue()) * getAngleStep());
                            startAngle = 0 - Math.toDegrees((getMaxValue() - tmpArea.getStart() - getMinValue()) * getAngleStep());
                        } else {
                            stopAngle = 0 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - tmpArea.getStop() - getMinValue()) * getLogAngleStep());
                            startAngle = 0 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - tmpArea.getStart() - getMinValue()) * getLogAngleStep());
                        }
                        AREA_OFFSET.setLocation(-bImage.getWidth() * 0.45, -bImage.getWidth() * 0.45);
                        break;

                    case SOUTH_WEST:
                        if (!isLogScale()) {
                            stopAngle = 270 - Math.toDegrees((tmpArea.getStop() - getMinValue()) * getAngleStep());
                            startAngle = 270 - Math.toDegrees((tmpArea.getStart() - getMinValue()) * getAngleStep());
                        } else {
                            stopAngle = 270 - Math.toDegrees(UTIL.logOfBase(BASE, tmpArea.getStop() - getMinValue()) * getLogAngleStep());
                            startAngle = 270 - Math.toDegrees(UTIL.logOfBase(BASE, tmpArea.getStart() - getMinValue()) * getLogAngleStep());
                        }
                        AREA_OFFSET.setLocation(bImage.getWidth() * 0.195, -bImage.getWidth() * 0.45);
                        break;

                    case NORTH_WEST:

                    default:
                        if (!isLogScale()) {
                            stopAngle = 180 - Math.toDegrees((tmpArea.getStop() - getMinValue()) * getAngleStep());
                            startAngle = 180 - Math.toDegrees((tmpArea.getStart() - getMinValue()) * getAngleStep());
                        } else {
                            if (!isLogScale()) {
                            stopAngle = 180 - Math.toDegrees(UTIL.logOfBase(BASE, tmpArea.getStop() - getMinValue()) * getLogAngleStep());
                            startAngle = 180 - Math.toDegrees(UTIL.logOfBase(BASE, tmpArea.getStart() - getMinValue()) * getLogAngleStep());
                        }
                        }
                        if (isSectionsVisible()) {
                            AREA_OFFSET.setLocation(bImage.getWidth() * 0.195, bImage.getWidth() * 0.195);
                        } else {
                            AREA_OFFSET.setLocation(bImage.getWidth() * 0.148271028, bImage.getWidth() * 0.148271028);
                        }

                        break;
                }
                final java.awt.geom.Arc2D ARC = new java.awt.geom.Arc2D.Double(AREA_FRAME, 0 - (tmpArea.getStart() * getAngleStep()), -(tmpArea.getStop() - tmpArea.getStart()) * getAngleStep(), java.awt.geom.Arc2D.PIE);
                ARC.setFrame(AREA_OFFSET.getX(), AREA_OFFSET.getY(), 4 * RADIUS, 4 * RADIUS);
                ARC.setAngleStart(startAngle);
                ARC.setAngleExtent(stopAngle - startAngle);
                tmpArea.setFilledArea(ARC);
            }

            // Draw the area
            if (isAreasVisible() && IMAGE != null) {
                final Graphics2D G2 = IMAGE.createGraphics();
                G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                for (Section area : getAreas()) {
                    G2.setColor(isTransparentAreasEnabled() ? area.getTransparentColor() : area.getColor());
                    G2.fill(area.getFilledArea());
                }
                G2.dispose();
            }
        }
    }
1061694
def get_area_def(area_name):
    
    try:
        from pyresample import parse_area_file
    except ImportError:
        from pyresample.utils import parse_area_file
    return parse_area_file(get_area_file(), area_name)[0]
209233
def _handle_start_area(self, attrs):
        
        self._curr = {
            'attributes': dict(attrs),
            'tags': {},
            'area_id': None
        }
        if attrs.get('id', None) is not None:
            self._curr['area_id'] = int(attrs['id'])
            del self._curr['attributes']['id']
684775
def area_field(key='area'):
    """"""

    area_list = list(subdivisions)
    title_map = []
    for item in area_list:
        title_map.append({'value': item.code, 'name': item.name})

    widget = {
        'key': key,
        'type': 'uiselect',
        'titleMap': title_map
    }

    return widget
1065396
def create(self, issue_id=None, repo_slug=None, **kwargs):
        
        issue_id = issue_id or self.issue_id
        repo_slug = repo_slug or self.bitbucket.repo_slug or ''
        url = self.bitbucket.url('CREATE_COMMENT',
                                 username=self.bitbucket.username,
                                 repo_slug=repo_slug,
                                 issue_id=issue_id)
        return self.bitbucket.dispatch('POST', url, auth=self.bitbucket.auth, **kwargs)
695286
def _load_area_def(self, dsid, file_handlers):
        """"""
        area_defs = [fh.get_area_def(dsid) for fh in file_handlers]
        area_defs = [area_def for area_def in area_defs
                     if area_def is not None]

        final_area = StackedAreaDefinition(*area_defs)
        return final_area.squeeze()
870951
def _upload_resumable_unit(self, uu_info):
        

        # Get actual unit size
        unit_size = uu_info.fd.len

        if uu_info.hash_ is None:
            raise ValueError('UploadUnitInfo.hash_ is now required')

        return self._api.upload_resumable(
            uu_info.fd,
            uu_info.upload_info.size,
            uu_info.upload_info.hash_info.file,
            uu_info.hash_,
            uu_info.uid,
            unit_size,
            filedrop_key=uu_info.upload_info.filedrop_key,
            folder_key=uu_info.upload_info.folder_key,
            path=uu_info.upload_info.path,
            action_on_duplicate=uu_info.upload_info.action_on_duplicate)
12833
def create(cls, address, ospf_area=None, **kwargs):
        
        return super(LoopbackClusterInterface, cls).create(
            address=address,
            network_value='{}/32'.format(address),
            interface_id='Loopback Interface',
            ospfv2_area_ref=ospf_area,
            **kwargs)
815954
def create_primary_zone_by_upload(self, account_name, zone_name, bind_file):
        
        zone_properties = {"name": zone_name, "accountName": account_name, "type": "PRIMARY"}
        primary_zone_info = {"forceImport": True, "createType": "UPLOAD"}
        zone_data = {"properties": zone_properties, "primaryCreateInfo": primary_zone_info}
        files = {'zone': ('', json.dumps(zone_data), 'application/json'),
                 'file': ('file', open(bind_file, 'rb'), 'application/octet-stream')}
        return self.rest_api_connection.post_multi_part("/v1/zones", files)