:call-seq:
   url = url => hash
   url = Hash => hash

 With a String url, returns a standardize URL Hash.

 With a Hash argument { :url => 'url', :username => 'username', :password => 'password' }, returns a standardize URL Hash.
163330
def convert_remote_url(url)
      if url.is_a? String
        return {:url =>  URI.parse(url)}
      elsif url.is_a? Hash
        hash = { :url =>  URI.parse((url[:url] || url['url'])) }
        username = url[:username] || url['username']
        hash[:username] = username if username
        
        password = (url[:password] || url['password'])
        hash[:password] = password if password
        
        return hash
      elsif url.is_a? URI
        return { :url => url }
      else
        raise ArgumentError, "Unsupported :url, must be String, Hash, or URI: #{url.inspect}"
      end
    end
1231331
def to_hash
      stringified_params = Hash[parameters.map { |key, val| [key.to_s, val] }]
      base_hash.merge(stringified_params)
    end
549323
function _hash() {
    var set = Array.prototype.map.call(arguments, function(v) {
        return typeof v === 'string' ? v : Object.keys(v).join(' ');
    }).join(' ');

    return set.split(/\s+/)
        .reduce(function(res, keyword) {
            res[keyword] = true;
            return res;
        }, {});
}
1183363
function () {
    function startsWith(str, searchString) {
        return str.substr(0, searchString.length) === searchString;
    }

    function normalize (str, options) {
        if (startsWith(str, 'file://')) {
            // make sure file protocol has max three slashes
            str = str.replace(/(\/{0,3})\/*/g, '$1');
        } else {
            // make sure protocol is followed by two slashes
            str = str.replace(/:\//g, '://');

            // remove consecutive slashes
            str = str.replace(/([^:\s\%\3\A])\/+/g, '$1/');
        }

        // remove trailing slash before parameters or hash
        str = str.replace(/\/(\?|&|#[^!])/g, '$1');

        // replace ? in parameters with &
        str = str.replace(/(\?.+)\?/g, '$1&');

        return str;
    }

    var input = arguments;
    var options = {};

    if (typeof arguments[0] === 'object') {
        // new syntax with array and options
        input = arguments[0];
        options = arguments[1] || {};
    }

    var joined = [].slice.call(input, 0).join('/');

    return normalize(joined, options);
}
102006
def to_hash
      {
        :repository   => repository.name,
        :model        => model.name,
        :fields       => fields,
        :links        => links,
        :conditions   => conditions,
        :offset       => offset,
        :limit        => limit,
        :order        => order,
        :unique       => unique?,
        :add_reversed => add_reversed?,
        :reload       => reload?,
      }
    end
816747
def normalize_url(url: 'Union[URL, str]') -> 'URL':
    """"""
    url = URL(url)
    return url.with_query(urlencode(sorted(parse_qsl(url.query_string))))
1256071
def hash(self):
        
        return u''.join([
            self.alias,
            self.description,
            str(self.ignored),
            str(self.flags),
        ])
951976
def normalize_path(url)
      url = URI(url)
      (url.path.start_with?('/') ? url.path : '/' + url.path) +
        (url.query ? "?#{sort_query_params(url.query)}" : '')
    end
1325384
def from_url(cls, url):
        
        parsed = urlparse(url)
        return cls(
            username=parsed.username,
            password=parsed.password,
            hostname=parsed.hostname,
            port=parsed.port,
            database=parsed.path.lstrip('/'),
            # Like parse_qs, but produces a scalar per key, instead of a list:
            query_params=dict(param.split('=')
                              for param in parsed.query.split('&'))
            if parsed.query else {},
        )
1140325
def to_hash
      {
        'status'       => status.to_hash,
        'headers'      => headers,
        'body'         => serializable_body,
        'http_version' => http_version
      }.tap do |hash|
        hash['adapter_metadata'] = adapter_metadata unless adapter_metadata.empty?
      end
    end
364627
def hash(self, hash):
        
        self.md5 = None
        self.sha1 = None
        self.sha256 = None
        if (hash is None):
            return
        hash_seen = set()
        errors = []
        for entry in hash.split():
            (hash_type, value) = entry.split(':', 1)
            if (hash_type in hash_seen):
                errors.append("Ignored duplicate hash type %s" % (hash_type))
            else:
                hash_seen.add(hash_type)
                if (hash_type == 'md5'):
                    self.md5 = value
                elif (hash_type == 'sha-1'):
                    self.sha1 = value
                elif (hash_type == 'sha-256'):
                    self.sha256 = value
                else:
                    errors.append("Ignored unsupported hash type (%s)" %
                                  (hash_type))
        if (len(errors) > 0):
            raise ValueError(". ".join(errors))
675713
function formatUrl (url, query) {
  let protocol
  let index = url.indexOf('://')
  if (index !== -1) {
    protocol = url.substring(0, index)
    url = url.substring(index + 3)
  } else if (url.indexOf('//') === 0) {
    url = url.substring(2)
  }

  let parts = url.split('/')
  let result = (protocol ? protocol + '://' : '//') + parts.shift()

  let path = parts.filter(Boolean).join('/')
  let hash
  parts = path.split('#')
  if (parts.length === 2) {
    path = parts[0]
    hash = parts[1]
  }

  result += path ? '/' + path : ''

  if (query && JSON.stringify(query) !== '{}') {
    result += (url.split('?').length === 2 ? '&' : '?') + formatQuery(query)
  }
  result += hash ? '#' + hash : ''

  return result
}
413570
def to_hash
      {
        response_id: response_id,
        question_id: question_id,
        option_id: option_id,
        question_pipe: question_pipe,
        submitted_at: submitted_at,
        survey_id: survey_id,
        other_text: other_text,
        answer_text: option_id || other_text ? nil : answer_text
      }.reject { |k, v| v.nil? }
    end
690153
def make_hash(str)

      str = str.split('&')
      hash = {}

      str.each do |s|
        opt = s.split('=')
        hash[opt[0]] = URI.unescape(opt[1].to_s.gsub('+', ' '))
      end

      hash

    end
870133
def get_urlhash(self, url, fmt):
        
        with self.open(os.path.basename(url)) as f:
            return {'url': fmt(url), 'sha256': filehash(f, 'sha256')}
78380
def sample(self, hash, limit=None, offset=None):
        ''''''

        uri = self._uris['sample'].format(hash)
        params = {'limit': limit, 'offset': offset}

        return self.get_parse(uri, params)
43295
def auth_url
      auth_call = prepare_api_call("", :params=>{:api_key=>@api_key},
        :base_url=>ODESK_AUTH_URL, :format=>nil, :method=>:get, :auth=>false)
      data = auth_call[:params].to_a.map{|pair| pair.join '='}.join('&')
      return auth_call[:url]+"?"+data
    end