All voucher codes in our datasets have dashes converted to underscores.
963061
def _validate_outgroup(self, outgroup):
        """"""
        if outgroup:
            outgroup = outgroup.replace("-", "_")
            good_outgroup = False
            for seq_record in self.seq_records:
                if seq_record.voucher_code == outgroup:
                    good_outgroup = True
                    break
            if good_outgroup:
                self.outgroup = outgroup
            else:
                raise ValueError("The given outgroup {0!r} cannot be found in the "
                                 "input sequence records.".format(outgroup))
        else:
            self.outgroup = None
490524
def dashrepl(value):
    
    patt = re.compile(r'\W', re.UNICODE)
    return re.sub(patt, '-', value)
348414
function dashToCamelCase(dashCase) {
    if (!dashCase) { return dashCase; }

    var parts = dashCase.split('-');
    var camelCase = parts[0];
    var part;

    for (var i = 1; i < parts.length; i++) {
        part = parts[i];
        camelCase += part.substring(0, 1).toUpperCase() + part.substring(1);
    }

    return camelCase;
}
1073611
def capture_dash_in_url_name(self, node):
        
        for keyword in node.keywords:
            if keyword.arg == 'name' and '-' in keyword.value.s:
                return DJ04(
                    lineno=node.lineno,
                    col=node.col_offset,
                )
264017
function dashProperCase(str) {
        if ( !str.length ) {
            return str;
        }
        return str.split('-').map(function (piece) {
            if ( piece.length ) {
                return piece.substring(0, 1).toUpperCase() + piece.substring(1);
            }
            return piece;
        }).join('-');
    }
141499
def dasherize(class_name)
      return class_name if class_name !~ /[A-Z:_]/
      c = class_name.to_s.gsub('::', '')

      (c[0] + c[1..-1].gsub(/[A-Z]/){ |c| "-#{c}" }).
        downcase.
        gsub('_', '-')
    end
925892
public void replaceNumericFeatures(List<Vec> newNumericFeatures)
    {
        if(this.size() != newNumericFeatures.size())
            throw new RuntimeException("Input list does not have the same not of dataums as the dataset");
        
        for(int i = 0; i < newNumericFeatures.size(); i++)
        {
            DataPoint dp_i = getDataPoint(i);
            setDataPoint(i, new DataPoint(newNumericFeatures.get(i), dp_i.getCategoricalValues(), dp_i.getCategoricalData()));
        }
        
        this.numNumerVals = getDataPoint(0).numNumericalValues();
        if (this.numericalVariableNames != null)
            this.numericalVariableNames.clear();
            
    }
1153275
def fix_desc(desc, units=None):
    """"""
    full_desc = desc.strip()
    if units and units != 'N/A':
        if full_desc:
            full_desc += ' (' + units + ')'
        else:
            full_desc = units
    return full_desc
122866
def convert_to_underscore(name):
    
    s1 = _first_cap_re.sub(r'\1_\2', name)
    return _all_cap_re.sub(r'\1_\2', s1).lower()
1204371
def remove_all_matching(self, address=None, name=None):
        
        if self.entries:
            if address and name:
                func = lambda entry: not entry.is_real_entry() or (entry.address != address and name not in entry.names)
            elif address:
                func = lambda entry: not entry.is_real_entry() or entry.address != address
            elif name:
                func = lambda entry: not entry.is_real_entry() or name not in entry.names
            else:
                raise ValueError('No address or name was specified for removal.')
            self.entries = list(filter(func, self.entries))
1280113
def _utf8_encode(self, d):
        
        for k, v in d.items():
            if isinstance(v, str):
                d[k] = v.encode('utf8').lower()
            if isinstance(v, list):
                for index,item in enumerate(v):
                    item = item.encode('utf8').lower()
                    v[index] = item
            if isinstance(v, dict):
                d[k] = self._utf8_encode(v)
        
        return d
957984
def _stripped_codes(codes):
    """"""
    return tuple([
        code.strip() for code in codes.split(',')
        if code.strip()
    ])
466187
def normalize_match_data_captures(match_data)
      match_data.names.inject({}) do |mem, capture|
        mem[capture.gsub(/\d/,'')] = match_data[capture]
        break mem if mem.keys.length >= 2
        mem
      end
    end
429501
def abbreviate_dashed(s):
    """"""
    r = []
    for part in s.split('-'):
        r.append(abbreviate(part))
    return '-'.join(r)
1044358
def create_new_code(cls,**kwargs):
        '''
        
        '''
        prefix = kwargs.pop('prefix','')

        new = False
        while not new:
            # Standard is a ten-letter random string of uppercase letters
            random_string = ''.join(random.choice(string.ascii_uppercase) for z in range(10))
            if not Voucher.objects.filter(voucherId='%s%s' % (prefix, random_string)).exists():
                new = True

        return Voucher.objects.create(voucherId='%s%s' % (prefix, random_string),**kwargs)
73645
def _stripped(d):
    ''''''
    ret = {}
    for k, v in six.iteritems(d):
        if v:
            ret[k] = v
    return ret
427465
def camelCaseToDashName(camelCase):
        '''
            
        '''

        camelCaseList = list(camelCase)

        ret = []

        for ch in camelCaseList:
            if ch.isupper():
                ret.append('-')
                ret.append(ch.lower())
            else:
                ret.append(ch)

        return ''.join(ret)