code
stringlengths
1
199k
from setuptools import setup, find_packages setup( name="simple-crawler", version="0.1", url="https://github.com/shonenada/crawler", author="shonenada", author_email="shonenada@gmail.com", description="Simple crawler", zip_safe=True, platforms="any", packages=find_packages(), ins...
import unittest import numpy as np import theano import theano.tensor as T from tests.helpers import (SimpleTrainer, SimpleClf, SimpleTransformer, simple_reg) from theano_wrapper.layers import (BaseLayer, HiddenLayer, MultiLayerBase, BaseEstimator, BaseTrans...
a = 5 if a >= 5: print("Value is greater than 5") else: print("Value is less than 5") if a >= 5: print("Value is greater than 5") elif a < 5: print("Value is less than 5") else: print("Value is 5") a=3 b=5 if (a==3) and (b==5): print("a and b are as expected - great :)") else: print("a and b not as expected -...
import py from rpython.annotator import model as annmodel from rpython.rtyper.llannotation import SomePtr, lltype_to_annotation from rpython.conftest import option from rpython.rtyper.annlowlevel import (annotate_lowlevel_helper, MixLevelHelperAnnotator, PseudoHighLevelCallable, llhelper, cast_instance_to_base_...
import eventmaster as EM from time import sleep import random import sys """ Create new Instance of EventMasterSwitcher and turn off logging """ s3 = EM.EventMasterSwitcher() s3.setVerbose(0) with open('example_settings_.xml', 'r') as content_file: content = content_file.read() s3.loadFromXML(content) """ Enumerate...
import curses import shutil import signal from curses import wrapper class Picker: """Allows you to select from a list with curses""" stdscr = None win = None title = "" arrow = "" footer = "" more = "" c_selected = "" c_empty = "" cursor = 0 offset = 0 selected = 0 s...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "remakery.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
import dateutil.parser import dateutil.tz import feedparser import re from datetime import datetime, timedelta from joblist import JobList class FilterException(Exception): pass class IndeedJobList(JobList): '''Joblist class for Indeed This joblist is for the indeed.com rss feed. Indeed has an API, but ...
from .config import Config, HentaiHavenConfig, HAnimeConfig, Section from .last_entry import LastEntry
from Tkinter import * from ScrolledText import ScrolledText from unicodedata import lookup import os class Diacritical: """Mix-in class that adds keyboard bindings for accented characters, plus other common functionality. An inheriting class must define a select_all method that will respond to Ctrl-A.""...
import base64 import json import requests def call_vision_api(image_filename, api_keys): api_key = api_keys['microsoft'] post_url = "https://api.projectoxford.ai/vision/v1.0/analyze?visualFeatures=Categories,Tags,Description,Faces,ImageType,Color,Adult&subscription-key=" + api_key image_data = open(image_fi...
from django.db import models from django.contrib.auth.models import User, Group from django.utils.translation import ugettext_lazy as _ from django.core.validators import RegexValidator from django.conf import settings class Repository(models.Model): """ Git repository """ # basic info name = models...
import re def read_lua(): PATTERN = r'\s*\[(?P<id>\d+)\] = {\s*unidentifiedDisplayName = ' \ r'"(?P<unidentifiedDisplayName>[^"]+)",\s*unidentifie' \ r'dResourceName = "(?P<unidentifiedResourceName>[^"]+' \ r')",\s*unidentifiedDescriptionName = {\s*"(?P<uniden' \ ...
from django.apps import AppConfig class JcvrbaseappConfig(AppConfig): name = 'jcvrbaseapp'
import time import random import unittest from qiniuManager.progress import * class Pro(object): def __init__(self): self.progressed = 0 self.total = 100 self.title = 'test' self.chunked = False self.chunk_recved = 0 self.start = time.time() @bar(100, '=') def...
from __future__ import unicode_literals from django.db import migrations, models import django.forms.widgets class Migration(migrations.Migration): dependencies = [ ('sshcomm', '0002_auto_20170118_1702'), ] operations = [ migrations.AlterField( model_name='userdata', ...
from bson.objectid import ObjectId import json class Room(): def __init__(self, players_num, objectid, table, current_color='purple'): if players_num: self.players_num = players_num else: self.players_num = 0 for el in ['p', 'b', 'g', 'r']: if el i...
class Solution: def countSegments(self, s: 'str') -> 'int': return len(s.split())
import datetime from sqlalchemy import create_engine, ForeignKey, Column, Integer, String, Text, Date, Table, Boolean from sqlalchemy.orm import sessionmaker, relationship from sqlalchemy.ext.declarative import declarative_base from . import app from flask_login import UserMixin engine = create_engine(app.config["SQLAL...
"""Pyramidal bidirectional LSTM encoder.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf class PyramidBLSTMEncoder(object): """Pyramidal bidirectional LSTM Encoder. Args: num_units (int): the number of units in each ...
import numpy as np import pandas as pd arts = pd.DataFrame() arts["execution_date"] = arts["execution_date"].str.findall(r"([0-9]+)").str[0] arts["execution_date"] = arts["execution_date"].astype(float) arts.head() arts["execution_date"] = arts["execution_date"].apply(lambda x: 1900 + x if x < 100 else x) arts.head() a...
import os from .base import Output class AppleSay(Output): """Speech output supporting the Apple Say subsystem.""" name = 'Apple Say' def __init__(self, voice = 'Alex', rate = '300'): self.voice = voice self.rate = rate super(AppleSay, self).__init__() def is_active(self): return not os.system('which say') ...
from jupyter_server.utils import url_path_join as ujoin from .config import Lmod as LmodConfig from .handler import default_handlers, PinsHandler def _jupyter_server_extension_paths(): return [{"module": "jupyterlmod"}] def _jupyter_nbextension_paths(): return [ dict( section="tree", src="st...
from models import Event from django.views.generic import DetailView, ListView class EventListView(ListView): template_name = 'agenda/event_list.html' queryset = Event.objects.upcoming() paginate_by = 20 class EventArchiveview(EventListView): queryset = Event.objects.past() class EventDetailView(DetailV...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Prueba', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False...
""" Download NLTK data """ __author__ = "Manan Kalra" __email__ = "manankalr29@gmail.com" import nltk nltk.download()
import numpy as np import ctypes import struct import time from .ioctl_numbers import _IOR, _IOW from fcntl import ioctl SPI_IOC_MAGIC = ord("k") SPI_IOC_RD_MODE = _IOR(SPI_IOC_MAGIC, 1, "=B") SPI_IOC_WR_MODE = _IOW(SPI_IOC_MAGIC, 1, "=B") SPI_IOC_RD_LSB_FIRST = _IOR(SPI_IOC_MAGIC, 2, "=B") SPI_...
import numpy as np import matplotlib.pyplot as plt from astropy.io import fits from scipy.interpolate import interp1d,splev,splrep def extractSpectrum(filename): """ NAME: extractSpectrum PURPOSE: To open an input fits file from SDSS and extract the relevant components, namely the flu...
import unittest import random from pygraph.classes.graph import graph class SWIM(object): def __init__(self, graph): self.graph = graph def edge_alive(self, nodeA, nodeB, alive): ''' edge_alive(A, B, True|False) ''' edge = (nodeA, nodeB) if alive: self...
import numpy as np from astropy.coordinates import EarthLocation, SkyCoord __all__ = ['MWA_LOC', 'MWA_FIELD_EOR0', 'MWA_FIELD_EOR1', 'MWA_FIELD_EOR2', 'MWA_FREQ_EOR_ALL_40KHZ', 'MWA_FREQ_EOR_ALL_80KHZ', 'MWA_FREQ_EOR_HI_40KHZ', 'MWA_FREQ_EOR_HI_80KHZ', 'MWA_FREQ_EOR_LOW_40KHZ', 'MWA_FRE...
__all__ = ['LEAGUE_PROPERTIES'] LEAGUE_PROPERTIES = { "PL": { "rl": [18, 20], "cl": [1, 4], "el": [5, 5], }, "EL1": { "rl": [21, 24], "cl": [1, 2], "el": [3, 6] }, "EL2": { "rl": [21, 24], "cl": [1, 2], "el": [3, 6] }, "...
''' This script demonstrates how to create a periodic Gaussian process using the *gpiso* function. ''' import numpy as np import matplotlib.pyplot as plt from sympy import sin, exp, pi from rbf.basis import get_r, get_eps, RBF from rbf.gproc import gpiso np.random.seed(1) period = 5.0 cls = 0.5 # characteristic length ...
import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc Print = PETSc.Sys.Print from dolfin import * import numpy as np import matplotlib.pylab as plt import scipy.sparse as sps import scipy.sparse.linalg as slinalg import os import scipy.io import PETScIO as IO import MatrixOperations as MO def S...
from __future__ import unicode_literals import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion import proso.django.models class Migration(migrations.Migration): initial = True dependencies = [ ('proso_user', '0001_initial'), mig...
import sys import csv from collections import Counter, defaultdict sequences = sys.argv[1] accession2taxonomy = sys.argv[2] alignment = sys.argv[3] with open(accession2taxonomy) as inf: next(inf) csv_inf = csv.reader(inf, delimiter="\t") a2t = dict(('_'.join(row[0].split()[0].split('_')[:-1]).split('.')[0],...
from .config import Config
import seaborn as sns import matplotlib.pyplot as plt def plot_corrmatrix(df, square=True, linewidths=0.1, annot=True, size=None, figsize=(12, 9), *args, **kwargs): """ Plot correlation matrix of the dataset see doc at https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.heat...
import base64 import json import pickle import re from utils import HTTP_REQUESTS from azure.core.pipeline._tools import is_rest import types import unittest try: from unittest import mock except ImportError: import mock import pytest from requests import Request, Response from msrest import Deserializer from a...
from organise import app app.run()
from __future__ import unicode_literals from django.db import models, migrations from django.contrib.gis.geos import GeometryCollection def change_line_to_multiline(apps, schema_editor): # We can't import the Person model directly as it may be a newer # version than this migration expects. We use the historical...
from eth_utils import ( is_hex, is_string, is_integer, remove_0x_prefix, force_text, ) def is_predefined_block_number(value): if not is_string(value): return False return force_text(value) in {"latest", "pending", "earliest"} def is_hex_encoded_block_hash(value): if not is_string...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^', include('ebets.urls')), url(r'^admin/', include(admin.site.urls)), )
class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ inspected_dict = {} for i, num in enumerate(nums): try: j = inspected_dict[num] return j+1, i+...
"""Unit tests for the image downloader.""" import unittest import download __author__ = "Nick Pascucci (npascut1@gmail.com)" class DownloadTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_img_matcher(self): html = """<html> <body> <b>Hi there!</b> <img src="...
r""" .. _SoftiMAX: SoftiMAX at MAX IV ------------------ The images below are produced by scripts in ``\examples\withRaycing\14_SoftiMAX``. The beamline will have two branches: - STXM (Scanning Transmission X-ray Microscopy) and - CXI (Coherent X-ray Imaging), see the scheme provided by K. Thånell. .. imagezoom:: _imag...
import unittest import pandas as pd import nose.tools from mia.features.blobs import detect_blobs from mia.features.intensity import detect_intensity from mia.utils import preprocess_image from ..test_utils import get_file_path class IntensityTests(unittest.TestCase): @classmethod def setupClass(cls): i...
import Bio from Bio import SeqIO import sys import os.path filename = sys.argv[-1] outname = filename.split('.') outname1 = '.'.join([outname[0], 'txt']) FastaFile = open(filename, 'rU') f = open(outname1, 'w') for rec in SeqIO.parse(FastaFile, 'fasta'): name = rec.id seq = rec.seq seqLen = len(rec) print name, seq...
""" [2015-12-28] Challenge #247 [Easy] Secret Santa https://www.reddit.com/r/dailyprogrammer/comments/3yiy2d/20151228_challenge_247_easy_secret_santa/ Every December my friends do a "Secret Santa" - the traditional gift exchange where everybody is randomly assigned to give a gift to a friend. To make things exciting, t...
import os, os.path from matplotlib import pyplot as plt from pylab import get_cmap import SimpleCV as cv from glob import glob def show_img(img, ax = None): if ax is not None: plt.sca(ax) nimg = img.getNumpy() return plt.imshow(nimg, aspect='equal') path = '/home/will/Dropbox/burnimages/*.jpg' norm_...
import game import pygame from pygame.locals import * class Resources: <<<<<<< HEAD def cambiar(self,imagen): sheet = game.load_image(imagen) rects = [pygame.Rect(112,2,26,40), pygame.Rect(112,2,26,40), pygame.Rect(112,2,26,40), pygame.Rect(4,4,30,3...
''' author Lama Hamadeh ''' import pandas as pd import matplotlib.pyplot as plt import matplotlib import assignment2_helper as helper matplotlib.style.use('ggplot') scaleFeatures = True #Features scaling (if it's false no scaling appears and that affects the 2D plot and the variance values) df=pd.read_csv('/Users/ADB3H...
import unittest import os from sqltxt.table import Table from sqltxt.column import Column, ColumnName, AmbiguousColumnNameError from sqltxt.expression import Expression class TableTest(unittest.TestCase): def setUp(self): self.data_path = os.path.join(os.path.dirname(__file__), '../data') table_head...
"""Test a Fast R-CNN network on an image database.""" import argparse import pprint import time import os import os.path as osp import sys import cPickle import numpy as np this_dir = osp.dirname(__file__) sys.path.insert(0, osp.join(this_dir, '../../external/py-faster-rcnn/lib')) from fast_rcnn.config import cfg, cfg_...
import django_filters from django import forms from django.utils.translation import ugettext_lazy as _ from courses.models import Course from issues.models import Issue from issues.model_issue_status import IssueStatus class IssueFilterStudent(django_filters.FilterSet): is_active = django_filters.ChoiceFilter(label...
from django.db import models import datetime def get_choices(lst): return [(i, i) for i in lst] pprint_pan = lambda pan: "%s %s %s" % (pan[:5], pan[5:9], pan[9:]) class Person(models.Model): name = models.CharField(max_length=255, db_index=True) fathers_name = models.CharField(max_length=255, null=True, bla...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="serverless-wsgi", version="3.0.0", python_requires=">3.6", author="Logan Raarup", author_email="logan@logan.dk", description="Amazon AWS API Gateway WSGI wrapper", long_description=l...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('orders', '0001_initial'), ] operations = [ migrations.AlterField( model_name='order', name='paid', field=models.Boole...
from click.testing import CliRunner from sqlitebiter.__main__ import cmd from sqlitebiter._const import ExitCode from .common import print_traceback class Test_version_subcommand: def test_smoke(self): runner = CliRunner() result = runner.invoke(cmd, ["version"]) print_traceback(result) ...
from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from buildfarm.models import Package, Queue from repository.models import Repository, PisiPackage from source.models import SourcePackage from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger import xmlrpclib ...
from django.core.management.base import BaseCommand, CommandError from ship_data.models import GpggaGpsFix import datetime from main import utils import csv import os from django.db.models import Q import glob from main.management.commands import findgpsgaps gps_bridge_working_intervals = None class Command(BaseCommand...
from yaml import load from os import environ from os.path import join, isfile from ..module_ultra_repo import ModuleUltraRepo from ..module_ultra_config import ModuleUltraConfig class RepoDaemonConfig: """Represent a MU repo to the MU daemon.""" def __init__(self, **kwargs): self.repo_name = kwargs['rep...
import imaplib import re from libqtile.log_utils import logger from libqtile.widget import base class GmailChecker(base.ThreadPoolText): """A simple gmail checker. If 'status_only_unseen' is True - set 'fmt' for one argument, ex. 'unseen: {0}'""" orientations = base.ORIENTATION_HORIZONTAL defaults = [ ...
def gpio_init(pin, output): try: with open(f"/sys/class/gpio/gpio{pin}/direction", 'wb') as f: f.write(b"out" if output else b"in") except Exception as e: print(f"Failed to set gpio {pin} direction: {e}") def gpio_set(pin, high): try: with open(f"/sys/class/gpio/gpio{pin}/value", 'wb') as f: ...
""" AppHtml settings @author Toshiya NISHIO(http://www.toshiya240.com) """ defaultTemplate = { '1) 小さいボタン': '${badgeS}', '2) 大きいボタン': '${badgeL}', '3) テキストのみ': '${textonly}', "4) アイコン付き(小)": u"""<span class="appIcon"><img class="appIconImg" height="60" src="${icon60url}" style="float:left;margin: 0px 15...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "houseofdota.production_settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
""" Django settings for plasystem project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ from local_...
"""Tests for the object departures module.""" import responses import test as _test import navitia_client import requests class DeparturesTest(_test.TestCase): def setUp(self): self.user = 'leo' self.core_url = "https://api.navitia.io/v1/" self.client = navitia_client.Client(self.user) ...
import numpy as np import pandas as pd import tensorflow as tf import matplotlib.pyplot as plt pd.options.display.max_rows = 1000 pd.options.display.max_columns = 25 pd.options.display.width = 1000 data = pd.read_csv('StockDataWithVolume.csv', index_col='Date', parse_dates=True) features = [data.columns.values] data['r...
""" Django settings for ecommerce project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ import os BASE_D...
"""geo.py: Implementation of class AbstractTwitterGeoCommand and its subclasses. """ from argparse import ArgumentParser from . import (AbstractTwitterCommand, call_decorator) from ..parsers import (filter_args, cache) GEO_ID_PLACE_ID = ('geo/id/:place_id', 'id') GEO_REVERSE_GEOCODE = ('geo/reverse_geocode', 'reverse')...
from __future__ import absolute_import from collections import defaultdict as ddict import os.path as op def enum(**enums): """#enumeration #backward compatible :param enums: """ return type('Enum', (), enums) IONISATION_MODE = enum(NEG=-1, POS=1) class ExperimentalSettings(object): """ :par...
from nose.tools import ( eq_, raises, ) from py3oauth2.utils import ( normalize_netloc, normalize_path, normalize_query, normalize_url, ) def test_normalize_url(): eq_(normalize_url('http://a/b/c/%7Bfoo%7D'), normalize_url('hTTP://a/./b/../b/%63/%7bfoo%7d')) @raises(ValueError) def t...
"""Executa o servidor de nomes ".br".""" import logging import dns def main(): logging.basicConfig( format='[%(levelname)s]%(threadName)s %(message)s', level=logging.INFO) brNS = dns.NameServer('.br', 2, '127.0.0.1', 10001) brNS.add_record('uem.br', '127.0.0.1:10002') brNS.run() if __nam...
from __future__ import unicode_literals from django.apps import AppConfig class DevelopersConfig(AppConfig): name = 'developers'
""" Contains all elements of this package. They act as the formal elements of the law. """ import json import sys def from_json(data): """ Reconstructs any `BaseElement` from its own `.as_json()`. Returns the element. """ def _decode(data_dict): values = [] if isinstance(data_dict, str):...
import scipy as sp import numpy as np import matplotlib.pyplot as plt import matplotlib import sys import matplotlib.lines as lines import h5py from matplotlib.font_manager import FontProperties import matplotlib.ticker as ticker from scipy.fftpack import fft axial_label_font = FontProperties() axial_label_font.set_fam...
import smtplib from email.mime.text import MIMEText from django.core.mail import EmailMultiAlternatives from django.conf import settings def send_message(message): """ * desc 快捷发送邮件 * input 要发送的邮件信息 * output None """ mail_handler = SendMail() mail_handler.send_mail(settings.REPORT_USER...
from django.db import models class Pizza(models.Model): name = models.CharField(max_length=128) price = models.DecimalField(decimal_places=2, max_digits=5) ingredients = models.TextField() picture = models.ImageField(blank=True, null=True) def __unicode__(self): return u'Pizza: {}'.format(se...
import json from django.core.urlresolvers import reverse from django.http import HttpResponseNotFound from django.test import TestCase from mock import Mock from utils import use_GET_in from api.views import msas, tables class ConversionTest(TestCase): def test_use_GET_in(self): fn, request = Mock(), Mock()...
""" The most important object in the Gratipay object model is Participant, and the second most important one is Ccommunity. There are a few others, but those are the most important two. Participant, in particular, is at the center of everything on Gratipay. """ from contextlib import contextmanager from postgres import...
""" This module contains functions dealing with platform information. """ import OvfLibvirt from locale import getlocale, getdefaultlocale from time import timezone def virtTypeIsAvailable(virtType): """ Check if the given virt type is available on this system @type node: String @param node: Platform ty...
''' Created on Jul 1, 2014 @author: anroco I have a list in python and I want to invest the elements, ie the latter is the first, how I can do? Tengo una lista en python y quiero invertir los elementos de la lista, es decir que el último sea el primero, ¿como puedo hacerlo? ''' lista = [9, 2, 5, 10, 9, 1, 3] print (lis...
import os import glob import subprocess def expand_path(path): return os.path.abspath(os.path.expandvars(os.path.expanduser(path))) def is_file(path): if not path: return False if not os.path.isfile(path): return False return True def arg_is_file(path): try: if not is_file(path): raise e...
from flask import Blueprint, render_template, request,flash, redirect, url_for from app.{resources}.models import {Resources}, {Resources}Schema {resources} = Blueprint('{resources}', __name__, template_folder='templates') schema = {Resources}Schema() @{resources}.route('/' ) def {resource}_index(): {resources} = {...
""" /*************************************************************************** DsgTools A QGIS plugin Brazilian Army Cartographic Production Tools ------------------- begin : 2019-04-26 git sha : $Format:%H$ ...
""" Default configuration values for certmaster items when not specified in config file. Copyright 2008, Red Hat, Inc see AUTHORS This software may be freely redistributed under the terms of the GNU general public license. You should have received a copy of the GNU General Public License along with this program; if not...
import forge from forge.models.groups import Group class Add(object): def __init__(self,json_args,session): if type(json_args) != type({}): raise TypeError("JSON Arg must be dict type") if 'name' and 'distribution' not in json_args.keys(): ...
'A simple client for accessing api.ly.g0v.tw.' import json import unittest try: import urllib.request as request import urllib.parse as urlparse except: import urllib2 as request import urllib as urlparse def assert_args(func, *args): def inner(*args): required_arg = args[1] assert(len(required_arg) > 0) ret...
import io, readconf, getinfo, pastebin import os, sys, gettext,string, pexpect,getpass gettext.textdomain('inforevealer') _ = gettext.gettext __version__="0.5.1" def askYesNo(question,default='y'): """ Yes/no question throught a console """ if string.lower(default) == 'y': question = question + " [Y/n]" else: q...
from __future__ import print_function import sys from blib_util import * def build_kfont(build_info): for compiler_info in build_info.compilers: build_a_project("kfont", "kfont", build_info, compiler_info, True) if __name__ == "__main__": cfg = cfg_from_argv(sys.argv) bi = build_info(cfg.compiler, cfg.archs, cfg.c...
import json import logging import sys import time from webkitpy.common.system.autoinstall import AutoInstaller from webkitpy.layout_tests.servers import http_server_base _log = logging.getLogger(__name__) def doc_root(port_obj): doc_root = port_obj.get_option("wptserver_doc_root") if doc_root is None: r...
""" OK resolveurl XBMC Addon Copyright (C) 2016 Seberoth Version 0.0.2 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This prog...
from functions.str import w_str from wtypes.control import WEvalRequired, WRaisedException, WReturnValue from wtypes.exception import WException from wtypes.magic_macro import WMagicMacro from wtypes.boolean import WBoolean class WAssert(WMagicMacro): def call_magic_macro(self, exprs, scope): if len(exprs) ...
""" Builds out and synchronizes yum repo mirrors. Initial support for rsync, perhaps reposync coming later. Copyright 2006-2007, Red Hat, Inc Michael DeHaan <mdehaan@redhat.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the ...
"""Copyright (c) 2017 abhishek-sehgal954 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is dis...
from dnfpluginscore import logger import dnf import os.path class BashCompletionCache(dnf.Plugin): name = 'generate_completion_cache' def __init__(self, base, cli): self.base = base self.available_cache_file = '/var/cache/dnf/available.cache' self.installed_cache_file = '/var/cache/dnf/i...
from django.conf.urls import * urlpatterns = patterns('foo.views', # Listing URL url(r'^$', view='browse', name='foo.browse'), # Detail URL url(r'^(?P<slug>(?!overview\-)[\w\-\_\.\,]+)/$', view='detail', name='foo.detail'), )
""" This nagios active check parses the Hadoop HDFS web interface url: http://<namenode>:<port>/dfsnodelist.jsp?whatNodes=LIVE to check for active datanodes that use disk beyond the given thresholds. The output includes performance datas and is truncated if longer than 1024 chars. Tested on: Hadoop CDH3U5 """ __author_...
from __future__ import absolute_import, division, print_function, unicode_literals from django.template.response import TemplateResponse from django.template.context import RequestContext from asymmetricbase.jinja import jinja_env from asymmetricbase.logging import logger #@UnusedImport class JinjaTemplateResponse(Temp...
""" * Copyright (c) 2015 BEEVC - Electronic Systems This file is part of BEESOFT * software: you can redistribute it and/or modify it under the terms of the GNU * General Public License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. BEESOFT is * d...