return ruby script to eliminate duplicated
 @return [String] ruby script
13457
def script_dup
      r = "require 'fileutils'\n"
      duplicates.each do |entries|
        flg_first = true
        r += "\n"
        entries.each do |entry|
          src = File.join(@dirname, entry.path, entry.name)
          if flg_first
            flg_first = false
            r += "# FileUtils.mv( \"#{src}\", \"#{Dir.tmpdir}\" )\n"
          else
            r += "FileUtils.mv( \"#{src}\", \"#{Dir.tmpdir}\" )\n"
          end
        end
      end
      r
    end
1056981
def construct_hash
      vars = instance_variables.reject { |x| [:@client, :@original].include? x }
      Hash[vars.map { |key| [key.to_s[1..key.length], instance_variable_get(key)] }]
    end
149422
function remove_script_tags(){
      html = html.replace(/<script[^>]*>.*?<\/script>/g, function(str){
        if (str.match(/ type=/) && ! str.match(/text\/javascript/)) { return str; }
        else if (str.match(/src=['"]?(https?)/)) { return str; }
        else if (str.match(/src=['"]?\/\//)) { return str; }
        else if (! options.clean_scripts && str.match(/src=['"]/)) { return str; }
        else { return ""; }
      });
    }
849435
def code_less?
      return unless @page
      sum = 0
      page_text = @page.text.size
      @page.css('script').each do |tag|
        sum += tag.text.size
      end
      sum < page_text / 2
    end
698755
def make_unique_script_attr(attributes):
    
    filtered_attr = []
    script_list = []
    for attr in attributes:
        if attr.Usage != TransactionAttributeUsage.Script:
            filtered_attr.append(attr)
        else:
            data = attr.Data
            if isinstance(data, UInt160):
                # convert it to equal type
                data = attr.Data.ToArray()

            # only add if it's not already in the list
            if data not in script_list:
                script_list.append(data)
                filtered_attr.append(attr)

    return filtered_attr
1329809
def links_duplicate_on(attribute, separator)
      links.map do  |link|
        link.send(attribute).split(separator).collect do |value|
          link.dup.update(Hash[attribute, value])
        end
      end.flatten
    end
1211838
def to_ruby_method!(allow_bangs = true)
      leader, trailer = @wrapped_string.strip.scan(/\A(.+)(.)\z/).flatten
      leader          = leader.to_s
      trailer         = trailer.to_s
      if allow_bangs
        trailer.downcase!
        trailer.gsub!(/[^a-z0-9!=\\?]/, '')
      else
        trailer.downcase!
        trailer.gsub!(/[^a-z0-9]/, '')
      end
      id = leader.to_identifier
      id.transliterate!
      id.to_ascii!
      id.clean!
      id.word_chars!
      id.clean!
      @wrapped_string = id.to_s + trailer
      if @wrapped_string == ""
        raise Error, "Input generates impossible Ruby method name"
      end
      with_separators!("_")
    end
216816
def ScriptHash(self):
        
        if self._scriptHash is None:
            self._scriptHash = Crypto.ToScriptHash(self.Script, unhex=False)

        return self._scriptHash
999155
def delete!
      Scripts.call(
        :delete,
        redis_pool,
        keys: [exists_key, grabbed_key, available_key, version_key, UNIQUE_SET, unique_digest],
      )
    end
781678
def require_rails_script(script, description)
      # Check that we're actually within a rails project directory
      script_path = File.join(Loops.root, script)
      unless File.exists?(script_path)
        puts
        puts "Error: missing Rails #{description}: #{script}"
        puts "Are you sure current directory is a root of a Rails project?"
        puts "Current dir: #{Loops.root}"
        puts
        exit(1)
      end

      # Load the script
      require(script_path)
    end
321585
function stripDuplicates(results) {
  var i;
  var placeshash = {};
  var stripped = [];
  for (i = 0; i < results.length; i++) {
    var lat = Number(results[i].location.split(",")[0]).toFixed(1);
    var lng = Number(results[i].location.split(",")[1]).toFixed(1);

    var hash = results[i].name + "_" + lat + " " + lng;
    if (!defined(placeshash[hash])) {
      placeshash[hash] = results[i];
      stripped.push(results[i]);
    }
  }
  return stripped;
}
139248
def get_script(self):
        
        uri = "{}/script".format(self.data["uri"])
        return self._helper.do_get(uri)
598119
def duplicable?(obj)
      case obj
      when NilClass, FalseClass, TrueClass, Symbol, Numeric
        false
      else
        true
      end
    end
328991
def extract_options(args)
      options = args.last
      options.respond_to?(:to_hash) ? options.to_hash.dup : {}
    end
89824
def initialize_copy(other)
      @options = other.options.dup
      @errors = other.errors.dup
      @data, @strings = [], {}
      @entries = Hash.new { |h,k| h.fetch(k.to_s, nil) }

      other.each do |element|
        add element.dup
      end

      self
    end
311496
def as_json(_options = {})
      hash = {}
      instance_variables.each do |var|
        name = var[1..-1]

        if name =~ /^__/
          # if a variable starts with double underscore, strip one off
          name = name[1..-1]
        elsif name =~ /^_/
          # Hide variables that start with single underscore
          name = nil
        end

        hash[name] = instance_variable_get(var) if name
      end
      hash
    end
1207462
def remove_script(identifier)
      removed = @scripts.delete_if { |s| s[:id] == identifier || s[:name] == identifier }
      @need_to_update = true if removed
      removed
    end