Creates a new DSCP marking rule.
971987
def create_dscp_marking_rule(self, policy, body=None):
        """"""
        return self.post(self.qos_dscp_marking_rules_path % policy,
                         body=body)
130790
function createRuleWithVariation(rule, variationName) {
  const selector = getSelectorName(rule, variationName);
  return postcss.rule({
    selector,
  });
}
838640
def create(cls, zone_id, record):
        """"""
        cls.echo('Creating new zone version')
        new_version_id = Zone.new(zone_id)

        cls.echo('Updating zone version')
        cls.add(zone_id, new_version_id, record)

        cls.echo('Activation of new zone version')
        Zone.set(zone_id, new_version_id)

        return new_version_id
1356637
def new(cls, alias, sealed_obj, algorithm, key, key_size):
        
        timestamp = int(time.time()) * 1000

        raise NotImplementedError("Creating Secret Keys not implemented")
417188
function (location, options, record) {
		var marker;

		if (location) {
			if (options.numberOfSides >= 30 && !(options.innerRadius || (options.innerRadiusX && options.innerRadiusY))) {
				marker = new L.CircleMarker(location, options);
			}
			else {
				marker = new L.RegularPolygonMarker(location, options);
			}
		}

		return marker;
	}
1021522
def build_dsc(debinfo,
              dist_dir,
              repackaged_dirname,
              orig_sdist=None,
              patch_posix=0,
              remove_expanded_source_dir=0,
              debian_dir_only=False,
              sign_dsc=False,
              ):
    """"""
    #    A. Find new dirname and delete any pre-existing contents

    # dist_dir is usually 'deb_dist'

    # the location of the copied original source package (it was
    # re-recreated in dist_dir)
    if debian_dir_only:
        fullpath_repackaged_dirname = os.path.abspath(os.curdir)
    else:
        fullpath_repackaged_dirname = os.path.join(dist_dir,repackaged_dirname)

    ###############################################
    # 1. make temporary original source tarball

    #    Note that, for the final tarball, best practices suggest
    #    using "dpkg-source -b".  See
    #    http://www.debian.org/doc/developers-reference/ch-best-pkging-practices.en.html

    # Create the name of the tarball that qualifies as the upstream
    # source. If the original was specified, we'll link to
    # it. Otherwise, we generate our own .tar.gz file from the output
    # of "python setup.py sdist" (done above) so that we avoid
    # packaging .svn directories, for example.

    if not debian_dir_only:
        repackaged_orig_tarball = ('%(source)s_%(upstream_version)s.orig.tar.gz'%
                                   debinfo.__dict__)
        repackaged_orig_tarball_path = os.path.join(dist_dir,
                                                    repackaged_orig_tarball)
        if orig_sdist is not None:
            if os.path.exists(repackaged_orig_tarball_path):
                os.unlink(repackaged_orig_tarball_path)
            link_func(orig_sdist,repackaged_orig_tarball_path)
        else:
            make_tarball(repackaged_orig_tarball,
                         repackaged_dirname,
                         cwd=dist_dir)

        # apply patch
        if debinfo.patch_file != '':
            apply_patch(debinfo.patch_file,
                        posix=patch_posix,
                        level=debinfo.patch_level,
                        cwd=fullpath_repackaged_dirname)

    for fname in ['Makefile','makefile']:
        if os.path.exists(os.path.join(fullpath_repackaged_dirname,fname)):
            sys.stderr.write('*'*1000 + '\n')
            sys.stderr.write('WARNING: a Makefile exists in this package. '
                             'stdeb will tell debhelper 7 to use setup.py '
                             'to build and install the package, and the '
                             'Makefile will be ignored.\n')
            sys.stderr.write('*'*1000 + '\n')


    ###############################################
    # 2. create debian/ directory and contents
    debian_dir = os.path.join(fullpath_repackaged_dirname,'debian')
    if not os.path.exists(debian_dir):
        os.mkdir(debian_dir)

    #    A. debian/changelog
    changelog = CHANGELOG_FILE%debinfo.__dict__
    with codecs.open( os.path.join(debian_dir,'changelog'),
                 mode='w', encoding='utf-8') as fd:
        fd.write(changelog)

    #    B. debian/control
    if debinfo.uploaders:
        debinfo.uploaders = 'Uploaders: %s\n' % ', '.join(debinfo.uploaders)
    else:
        debinfo.uploaders = ''
    control = CONTROL_FILE%debinfo.__dict__
    with codecs.open( os.path.join(debian_dir,'control'),
                      mode='w', encoding='utf-8') as fd:
        fd.write(control)

    #    C. debian/rules
    debinfo.percent_symbol = '%'
    rules = RULES_MAIN%debinfo.__dict__

    rules = rules.replace('        ','\t')
    rules_fname = os.path.join(debian_dir,'rules')
    with codecs.open( rules_fname,
                      mode='w', encoding='utf-8') as fd:
        fd.write(rules)
    os.chmod(rules_fname,0o755)

    #    D. debian/compat
    fd = open( os.path.join(debian_dir,'compat'), mode='w')
    fd.write('7\n')
    fd.close()

    #    E. debian/package.mime
    if debinfo.mime_file != '':
        if not os.path.exists(debinfo.mime_file):
            raise ValueError(
                'a MIME file was specified, but does not exist: %s'%(
                debinfo.mime_file,))
        link_func( debinfo.mime_file,
                 os.path.join(debian_dir,debinfo.package+'.mime'))
    if debinfo.shared_mime_file != '':
        if not os.path.exists(debinfo.shared_mime_file):
            raise ValueError(
                'a shared MIME file was specified, but does not exist: %s'%(
                debinfo.shared_mime_file,))
        link_func( debinfo.shared_mime_file,
                 os.path.join(debian_dir,
                              debinfo.package+'.sharedmimeinfo'))

    #    F. debian/copyright
    if debinfo.copyright_file != '':
        link_func( debinfo.copyright_file,
                 os.path.join(debian_dir,'copyright'))

    #    H. debian/<package>.install
    if len(debinfo.install_file_lines):
        fd = open( os.path.join(debian_dir,'%s.install'%debinfo.package), mode='w')
        fd.write('\n'.join(debinfo.install_file_lines)+'\n')
        fd.close()

    #    I. debian/<package>.udev
    if debinfo.udev_rules != '':
        fname = debinfo.udev_rules
        if not os.path.exists(fname):
            raise ValueError('udev rules file specified, but does not exist')
        link_func(fname,
                  os.path.join(debian_dir,'%s.udev'%debinfo.package))

    #    J. debian/source/format
    os.mkdir(os.path.join(debian_dir,'source'))
    fd = open( os.path.join(debian_dir,'source','format'), mode='w')
    fd.write('3.0 (quilt)\n')
    fd.close()

    fd = open( os.path.join(debian_dir,'source','options'), mode='w')
    fd.write('extend-diff-ignore="\.egg-info$"')
    fd.close()

    if debian_dir_only:
        return

    ###############################################
    # 3. unpack original source tarball

    debianized_package_dirname = fullpath_repackaged_dirname+'.debianized'
    if os.path.exists(debianized_package_dirname):
        raise RuntimeError('debianized_package_dirname exists: %s' %
                           debianized_package_dirname)
    #    A. move debianized tree away
    os.rename(fullpath_repackaged_dirname, debianized_package_dirname )
    if orig_sdist is not None:
        #    B. expand repackaged original tarball
        tmp_dir = os.path.join(dist_dir,'tmp-expand')
        os.mkdir(tmp_dir)
        try:
            expand_tarball(orig_sdist,cwd=tmp_dir)
            orig_tarball_top_contents = os.listdir(tmp_dir)

            # make sure original tarball has exactly one directory
            assert len(orig_tarball_top_contents)==1
            orig_dirname = orig_tarball_top_contents[0]
            fullpath_orig_dirname = os.path.join(tmp_dir,orig_dirname)

            #    C. remove original repackaged tree
            shutil.rmtree(fullpath_orig_dirname)

        finally:
            shutil.rmtree(tmp_dir)

    if 1:
        # check versions of debhelper and python-all
        debhelper_version_str = get_version_str('debhelper')
        if len(debhelper_version_str)==0:
            log.warn('This version of stdeb requires debhelper >= %s, but you '
                     'do not have debhelper installed. '
                     'Could not check compatibility.'%DH_MIN_VERS)
        else:
            if not dpkg_compare_versions(
                debhelper_version_str, 'ge', DH_MIN_VERS ):
                log.warn('This version of stdeb requires debhelper >= %s. '
                         'Use stdeb 0.3.x to generate source packages '
                         'compatible with older versions of debhelper.'%(
                    DH_MIN_VERS,))

        python_defaults_version_str = get_version_str('python-all')
        if len(python_defaults_version_str)==0:
            log.warn('This version of stdeb requires python-all >= %s, '
                     'but you do not have this package installed. '
                     'Could not check compatibility.'%PYTHON_ALL_MIN_VERS)
        else:
            if not dpkg_compare_versions(
                python_defaults_version_str, 'ge', PYTHON_ALL_MIN_VERS):
                log.warn('This version of stdeb requires python-all >= %s. '
                         'Use stdeb 0.6.0 or older to generate source packages '
                         'that use python-support.'%(
                    PYTHON_ALL_MIN_VERS,))

    #    D. restore debianized tree
    os.rename(fullpath_repackaged_dirname+'.debianized',
              fullpath_repackaged_dirname)

    #    Re-generate tarball using best practices see
    #    http://www.debian.org/doc/developers-reference/ch-best-pkging-practices.en.html

    if sign_dsc:
        args = ()
    else:
        args = ('-uc','-us')

    dpkg_buildpackage('-S','-sa',*args,cwd=fullpath_repackaged_dirname)

    if 1:
        shutil.rmtree(fullpath_repackaged_dirname)

    if not remove_expanded_source_dir:
        # expand the debian source package
        dsc_name = debinfo.source + '_' + debinfo.dsc_version + '.dsc'
        dpkg_source('-x',dsc_name,
                    cwd=dist_dir)
607763
def _create_symbol(self, id, symbolobj):
        """"""
        result = {'id': symbolobj.name, 'isPoint': False, 'isStroke': False, 'isFill': False}
        matcher = Mapfile._SYMBOL_NAME_REGEXP.match(symbolobj.name)
        if matcher:
            result['name'] = matcher.group(2)
            for c in matcher.group(1):
                field = Mapfile._STYLE_CHAR2NAME[c]
                result[field] = True
        else:
            result['name'] = symbolobj.name
            result['isPoint'] = result['isStroke'] = result['isFill'] = True
        return result
922514
private Shape createCheckMark(int x, int y, int size) {
        int markSize = (int) (size * SIZE_MULTIPLIER + 0.5);
        int markX    = x + (int) (size * X_MULTIPLIER + 0.5);
        int markY    = y + (int) (size * Y_MULTIPLIER + 0.5);

        return shapeGenerator.createCheckMark(markX, markY, markSize, markSize);
    }
287974
def make_dot(self, filename_or_stream, auts):
        """"""
        if isinstance(filename_or_stream, str):
            stream = file(filename_or_stream, 'w')
        else:
            stream = filename_or_stream
        
        dot = DotFile(stream)
        
        for aut in auts:
            dot.start(aut.name)
            dot.node('shape=Mrecord width=1.5')
    
            for st in aut.states:
                label = st.name
                if st.entering:
                    label += '|%s' % '\\l'.join(str(st) for st in st.entering)
                if st.leaving:
                    label += '|%s' % '\\l'.join(str(st) for st in st.leaving)
                label = '{%s}' % label
                    
                dot.state(st.name, label=label)
                
            for st in aut.states:
                for tr in st.transitions:
                    dot.transition(tr.s_from.name, tr.s_to.name, tr.when)
            
            dot.end()
            
        dot.finish()
913
def create_css(self, rules):
        
        style = rules[0].legacy_compiler_options.get(
            'style', self.compiler.output_style)
        debug_info = self.compiler.generate_source_map

        if style == 'legacy':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = True, ' ', '  ', False, '', '\n', '\n', '\n', debug_info
        elif style == 'compressed':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = False, '', '', False, '', '', '', '', False
        elif style == 'compact':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = True, ' ', '', False, '\n', ' ', '\n', ' ', debug_info
        elif style == 'expanded':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = True, ' ', '  ', False, '\n', '\n', '\n', '\n', debug_info
        else:  # if style == 'nested':
            sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg = True, ' ', '  ', True, '\n', '\n', '\n', ' ', debug_info

        return self._create_css(rules, sc, sp, tb, nst, srnl, nl, rnl, lnl, dbg)
510505
def create_rules(aes, value):
    
    if isinstance(value, six.string_types):
        return Rules(aes)
    else:
        rules = Rules()
        for idx, (pattern, css_value) in enumerate(value):
            rules.add_rule(pattern, '{0}_{1}'.format(aes, idx))
        return rules
334545
def create_dset(directory,slice_order='alt+z',sort_order='zt',force_slices=None):
    ''''''
    return _create_dset_dicom(directory,slice_order,sort_order,force_slices=force_slices)
499153
public MonetaryFormat decimalMark(char decimalMark) {
        checkArgument(!Character.isDigit(decimalMark));
        checkArgument(decimalMark > 0);
        if (decimalMark == this.decimalMark)
            return this;
        else
            return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups,
                    shift, roundingMode, codes, codeSeparator, codePrefixed);
    }
303829
def create_watermark(self, target, mark, fpath, quality=QUALITY, **kwargs):
        """"""

        im = utils.watermark(target, mark, **kwargs)
        im.save(fpath, quality=quality)
        return im
356292
def _make_marker_token(self, type_):
        """"""
        tok = Token(type_,
                    '',
                    self.line,
                    self.line_num,
                    self.start,
                    self.start)
        return tok
584449
void markNewRepartition() {
        lastRepartitionTime.set(Clock.currentTimeMillis());
        elapsedMigrationOperationTime.set(0);
        elapsedDestinationCommitTime.set(0);
        elapsedMigrationTime.set(0);
        completedMigrations.set(0);
    }
1126756
def _generate_mark_code(rule_name):
    
    code = ''.join([i for i in str(rule_name) if i.isdigit()])
    code = code.zfill(2)
    return code