NOTUSED by islam
513298
def process_list_page(page)
      @logger.info("Processing list page with URL: #{page.uri}")
      #page.save_as "html/result-list.html"

      new_items_found = nil

      items = page.links #[0..50]   # TODO REMOVE [], getting sample only
      items_len = items.length - 1
      @total = @total + items_len
  #    pline "Found #{items_len} items in page", true
      items.each do |anchor|
        next if anchor.text == '../'

        new_items_found = false if new_items_found.nil? 
      
        pid = anchor.text.split('.').first
        link = "#{page.uri}#{anchor.href}"
        
        @logger.info "Got result with id #{pid}"
        
  #      pline "  Item #{@curr_property} of #{@total}..."
        # get detailed info

        begin
          article = Article.find_by_url link
          if article.nil?
            new_items_found = true
            article = process_fulltext_detail_page(@agent.get(link), pid)
            yield article, true
          else
            yield article, false
          end
        rescue => exception
          @logger.error "Error processing #{link}:"
          @logger.error exception
          @logger.error exception.backtrace.join("\n")
        end
        @curr_property = @curr_property + 1
      end
      new_items_found
    end
1097157
private static function _skipFormating()
    {
        return false;

        if(null !== self::$_isAjaxOrCli) {
            return self::$_isAjaxOrCli;
        }

        self::$_isAjaxOrCli =
            (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
            || (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']));

        return self::$_isAjaxOrCli;
    }
317107
def nonpadding(self):
    """"""
    if self.sequence_id is None:
      return None
    if self.sequence_id == 1:
      return 1
    else:
      return mtf.cast(
          mtf.not_equal(self.sequence_id, 0), self.activation_dtype)
309321
def without(remove)
      r = remove.is_a?(Array) ? remove : [remove]
      obj = dup
      r.each { |fact| obj.remove_fact_from_list(fact) }
      obj
    end
1185065
def answerUnsupported(self, message, preferred_association_type=None,
                          preferred_session_type=None):
        """"""
        if self.message.isOpenID1():
            raise ProtocolError(self.message)

        response = OpenIDResponse(self)
        response.fields.setArg(OPENID_NS, 'error_code', 'unsupported-type')
        response.fields.setArg(OPENID_NS, 'error', message)

        if preferred_association_type:
            response.fields.setArg(
                OPENID_NS, 'assoc_type', preferred_association_type)

        if preferred_session_type:
            response.fields.setArg(
                OPENID_NS, 'session_type', preferred_session_type)

        return response
329747
function f_tumu_tarih_araligindakiler(_tahta_id, _tarih1, _tarih2) {
        console.log("f_tumu_tarih_araligindakiler")
        return f_idler_aktif_tarih_araligindakiler(_tahta_id, _tarih1, _tarih2)
            .then(function (_ihale_idler) {
                if (Array.isArray(_ihale_idler) && _ihale_idler.length > 0) {
                    /** @type {OptionsIhale} */
                    var opts = {};
                    opts.bArrKalemleri = true;
                    opts.bYapanKurum = true;
                    opts.bTakip = true;
                    opts.optKalem = {};
                    opts.optKalem.bArrTeklifleri = false;
                    opts.optKalem.bOnayDurumu = true;
                    opts.optKalem.bTakiptemi = true;

                    return f_id(_ihale_idler, _tahta_id, opts);
                } else {
                    return [];
                }
            });

    }
48340
private void wrongUsage() {

        String usage = "Usage: java -cp $PATH_TO_OPENCMS_JAR org.opencms.rmi.CmsRemoteShellClient\n"
            + "    -script=[path to script] (optional) \n"
            + "    -registryPort=[port of RMI registry] (optional, default is "
            + CmsRemoteShellConstants.DEFAULT_PORT
            + ")\n"
            + "    -additional=[additional commands class name] (optional)";
        System.out.println(usage);
        System.exit(1);
    }
1106055
def except(*keys)
      self.reject { |k,v| keys.include?(k || k.to_sym) }
    end
597973
def not_query(expression):
    """"""
    compiled_expression = compile_query(expression)

    def _not(index, expression=compiled_expression):
        """Return store key for documents that satisfy expression."""
        all_keys = index.get_all_keys()
        returned_keys = expression(index)
        return [key for key in all_keys if key not in returned_keys]

    return _not
962428
function(){
    if (this.accept('not')) {
      var node = new nodes.Expression;
      node.push(new nodes.Literal('not'));
      node.push(this.supportsFeature());
      return node;
    }
  }
369677
def port_is_used(port, host='127.0.0.1'):
    
    unused = _can_bind(port, host) and _refuses_connection(port, host)
    return not unused
219938
function f_uyarilar_tahta_tumu(_tahta_id) {
        return result.dbQ.smembers(result.kp.tahta.ssetUyarilari(_tahta_id, true))
            .then(function (_uyari_idleri) {
                return f_uyari_id(_uyari_idleri, _tahta_id);
            });
    }
761232
def reduce_tashkeel(text):
    
    patterns = [
        # delete all fathat,   except on waw and yeh
        u"(?<!(%s|%s))(%s|%s)" % (WAW, YEH, SUKUN, FATHA),
        # delete damma if followed by waw.
        u"%s(?=%s)" % (DAMMA, WAW),
        # delete kasra if followed by yeh.
        u"%s(?=%s)" % (KASRA, YEH),
        # delete fatha if followed by alef to reduce yeh maftouha
        #  and waw maftouha before alef.
        u"%s(?=%s)" % (FATHA, ALEF),
        # delete fatha from yeh and waw if they are in the word begining.
        u"(?<=\s(%s|%s))%s" % (WAW, YEH, FATHA),
        # delete kasra if preceded by Hamza below alef.
        u"(?<=%s)%s" % (ALEF_HAMZA_BELOW, KASRA),
    ]
    reduced = text
    for pat in patterns:
        reduced = re.sub(pat, '', reduced)
    return reduced
626969
function abs(year, absDate) {

	// find the first saturday on or after today's date
	absDate = c.dayOnOrBefore(6, absDate + 6);

	var weekNum = (absDate - year.first_saturday) / 7;
	var index = year.theSedraArray[weekNum];

	if (undefined === index) {
		return abs(new Sedra(year.year + 1, year.il), absDate); // must be next year
	}
	if (typeof index == 'object') {
		// Shabbat has a chag. Return a description
		return {parsha: [index], chag: true};
	}
	if (index >= 0) {
		return {parsha: [parshiot[index]], chag: false};
	}

	index = D(index); // undouble the parsha
	return {parsha: [parshiot[index], parshiot[index + 1]], chag: false};
}
1118519
function f_bolge_sehir_ekle(_sehir_idler, _bolge_id, _tahta_id) {
        if (Array.isArray(_sehir_idler) && _sehir_idler.length > 0) {
            return _sehir_idler.mapX(null, function (_sehir_id) {
                return result.dbQ.sadd(result.kp.bolge.ssetSehirleri(_bolge_id), _sehir_id);
            }).allX();
        } else {
            return result.dbQ.sadd(result.kp.bolge.ssetSehirleri(_bolge_id), _sehir_idler);
        }
    }
47143
def deleteUnused(self):
        
        if self.dryrun:
            self._client.listUnused()
        else:
            self._client.deleteUnused()
961983
def not_implemented(self, context, **response_kwargs):
        '''
        
        '''
        if settings.DEBUG:
            raise NotImplementedError(_('This export type ({})is not yet supported.'.format(self.format)))
        raise Http404