code
stringlengths
1
199k
from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect from django.template import RequestContext from django.utils.translation import ugettext as _ from apps.mainapp.models import Report, ReportSubscriber from apps.mainapp.forms import ReportSubscriberForm def n...
import os import sys import drivecasa import logging import shlex import shutil import subprocess import yaml import glob casa = drivecasa.Casapy(log2term=True, echo_to_stdout=True, timeout=24*3600*10) CONFIG = os.environ["CONFIG"] INPUT = os.environ["INPUT"] OUTPUT = os.environ["OUTPUT"] MSDIR = os.environ["MSDIR"] wi...
import operator import math class Machine(): """Simple stack based machine designed for genetic programming (GP) experiments. Easy to use and forgiving with nonfatal errors. See README and tests for examples. """ def __init__(self, debug=False): self.stack = [] self.debug = deb...
__author__ = 'dani882' x = int(raw_input('Enter an integer: ')) ans = 0 while ans**3 < abs(x): ans = ans + 1 if ans**3 != abs(x): print(str(x) + ' is not a perfect cube') else: if x < 0: ans = -ans print('Cube root of ' + str(x) + ' is ' + str(ans))
from django.contrib import admin from . import models @admin.register(models.OAuthUser) class OAuthUserAdmin(admin.ModelAdmin): list_display = ['__str__', 'provider', 'uid', 'email', 'user']
import sys import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GObject from multiprocessing import Queue import threading from xmlrpc import client import time import bb import bb.event (COL_PKG_NAME) = (0) (TYPE_DEP, TYPE_RDEP) = (0, 1) (COL_DEP_TYPE, COL_DEP_PARENT, COL_DEP_PACKAGE) = (0, 1...
__author__= "barun" __date__ = "$20 May, 2011 12:19:25 PM$" class Metrics(object): ## Calculate average throughput as: total_bytes_rcvd / duration. # # @param pkts_list An iterator object in the format [(timestamp, size),] # @param duration Time duration (in s) over which thruput is to be computed. T...
"""Utilities for working with DataCite metadata.""" from __future__ import absolute_import import re import urllib2 from invenio_utils.xmlDict import ElementTree, XmlDictConfig __all__ = ( 'DataciteMetadata', ) class DataciteMetadata(object): """Helper class for working with DataCite metadata.""" def __init...
from distutils.core import setup setup( name='popy', description='Parser for GNU Po files', long_description=open('README.rst').read(), version='0.3.0', packages=['popy'], author='Murat Aydos', author_email='murataydos@yandex.com', url='https://github.com/murataydos/popy', license='M...
from django.shortcuts import render import models class Pager(object): def __init__(self,current_page): self.current_page = current_page @property def start(self): return (self.current_page-1)*10 @property def end(self): return self.current_page*10 def page_str(self,all_i...
from . import json from .node import bin, hex from .util import altsortdict class smallcommitmetadata(object): def __init__(self, vfs, entrylimit): self.vfs = vfs self.limit = entrylimit self.contents = altsortdict() self.reload() def reload(self): """Read the database fr...
def select(sstr, prefix): ltext = '' if sstr.startswith(prefix): ltext += sstr[len(prefix) + 1:] return ltext def textprint(slist, params): ltext = '' is_symbol = 0 is_iso = 0 for x in slist: try: f = x.keys()[0] except AttributeError: # must be a string if x == 'Return': l...
from tests import TestCase, mkstemp import os from quodlibet.qltk.cbes import ComboBoxEntrySave, StandaloneEditor import quodlibet.config class TComboBoxEntrySave(TestCase): memory = "pattern 1\npattern 2\n" saved = "pattern text\npattern name\n" def setUp(self): quodlibet.config.init() h, s...
"""This does HTTP GET requests given a host:port and path and returns a subset of the headers plus the body of the result.""" from __future__ import absolute_import, print_function import json import os import sys from edenscm.mercurial import util httplib = util.httplib try: import msvcrt msvcrt.setmode(sys.st...
DEBUG = 0 directions = ("left","up","right","down") maxExamined = 75000 # maximum number of tries when solving maxMoves = 19 # maximum number of moves cullFrequency = 75000 # number of tries per cull update cullCutoff = 1.2 # fraction of average to cull gridRows = 5 gridColumns = 6 textCalculateCurrentCombos = "Calcula...
from ..dataset.arff import ArffFile from scipy.spatial import kdtree, distance from ..representations.intervalsProbability import IntervalsProbability import numpy as np from math import exp class IPKNN(object): """IPKNN implements a K-nearest neighbour method using lower previsions. If data are all precise, it...
from spyparty.ReplayOffsets import ReplayOffsets class ReplayVersion3Offsets(ReplayOffsets): def extract_number_offset(self): return 0x00 def get_file_version_offset(self): return 0x04 def get_protocol_version_offset(self): return 0x08 def get_spy_party_version_offset(self): ...
from django.db import models, migrations import autoslug.fields import django.core.files.storage import marking.models class Migration(migrations.Migration): dependencies = [ ('grades', '0001_initial'), ('groups', '0001_initial'), ] operations = [ migrations.CreateModel( ...
'''Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@gmail.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 Free Software Foundation, either version 3 of the License...
import psycopg2 from db.enums import * base = psycopg2.connect("dbname='cardkeepersample' user='andrew' host='localhost' password='1234'") cursor = base.cursor() def active_packs(user_id, start=0, count=10): query = """SELECT packs.pack_id, packs.name FROM user_packs, packs WHERE packs.pack_id = user_packs.pack_id ...
import shesha.config as conf simul_name = "bench_scao_sh_16x16_8pix" p_loop = conf.Param_loop() p_loop.set_niter(100) p_loop.set_ittime(0.002) # =1/500 p_geom = conf.Param_geom() p_geom.set_zenithangle(0.) p_tel = conf.Param_tel() p_tel.set_diam(4.0) p_tel.set_cobs(0.12) p_atmos = conf.Param_atmos() p_atmos.set_r0(0.1...
""" Setup script for the WDmodel package """ import sys import os import re import glob from setuptools import find_packages, setup dep_file = 'dependencies_py36.txt' with open(dep_file,'r') as f: required = f.read().splitlines() dir_path = os.path.dirname(os.path.realpath(__file__)) init_string = open(os.path.join...
"""AWS Cloud Volumes Services - Manage fileSystem""" from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' module: aws_netapp_cvs...
from panopticon.core.base import ServiceAttribute from panopticon.core.actions.base import (ManagerDependantActionLauncher, DependantAction, DecoratorAction, ActionManager) class ServiceAction(ServiceAttribute, DependantAction): _excluded_values_names = ["manager"] def __init__(self, name=None, service=...
pluginType = MODULE def moduleInformation(): return "PyQt4.Qsci", ("QsciScintilla", )
class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = """ options: host: description: - Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address fo...
template = """# Generated on {{dt}} *filter :INPUT DROP :FORWARD ACCEPT :OUTPUT ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp -j ACCEPT {{#rule}}...
import os import sys import time import numpy import logging from stoqs import models as m from django.conf import settings from django.db.models import Avg from django.http import HttpResponse, HttpResponseBadRequest import pprint logger = logging.getLogger(__name__) class InvalidLimits(Exception): pass def readCL...
from time import sleep import socket import libs.vDialupcore as core from multiprocessing import Process import sys import struct def MD5SUM_mismatch(vNumber_to_connect, sock): print("*Warning: The server's MD5SUM does not match with the one listed on file, Do you wish to continue? (Y/N)") if vNumber_to_connect...
import argparse import urllib2 # python 2.7 import re import sqlite3 import traceback import datetime import csv headers = { 'User-Agent' : 'Mozilla/5.0 (compatible; Googlebot/2.1;' +' +http://www.google.com/bot.html)' } # http://www.useragentstring.com par...
idade = 12 if idade < 4: preco = 0 elif idade < 18: preco = 5 elif idade < 65: preco = 10 else: preco = 5 print('Seu custo de admissão e R$' + str(preco) + '.') ''' Foi adicionado mais bloco de instrução elif para idades abaixo de 65. Se caso a idade for maior que 18 e menor que 65 o bloco e executado, ...
from skypebot import * class Skype_Bot: """ This class handles communication with Skype via SkypeBot """ def __init__(self, plugins): self.skype = Skypebot.Skype(Events=self) self.skype.FriendlyName = "Skype Bot Levitan" self.skype.Attach() self.plugins = plugins def ...
from pylab import * data = loadtxt('Data/dummy_data.dat') posterior_sample = atleast_2d(loadtxt('posterior_sample.txt')) ion() for i in xrange(0, posterior_sample.shape[0]): hold(False) plot(data[:,0], data[:,1], 'bo') hold(True) plot(data[:,0], posterior_sample[i, -data.shape[0]:], 'r-') ylim([0, 1.1*data[:,...
"""Minimal Python 3 shim around PyQt5 and Pyside2 Qt bindings for QML applications. Forked from https://github.com/mottosso/Qt.py under MIT License. Copyright (c) 2016 Marcus Ottosson Changes * Dropped Python2 and Qt4 support * Focus on last Python 3 release * Focus on last Qt API : QML Requirements * make use of lazy ...
import os if not 'DJANGO_SETTINGS_MODULE' in os.environ: os.environ['DJANGO_SETTINGS_MODULE'] = 'flooding.windows' from django.core import management if __name__ == '__main__': management.execute_from_command_line()
from django.conf.urls import include, url from sapl.sessao.views import (AdicionarVariasMateriasExpediente, AdicionarVariasMateriasOrdemDia, BancadaCrud, CargoBancadaCrud, ExpedienteMateriaCrud, ExpedienteView, JustificativaAus...
import os import time import traceback from lib.FileManager.FM import REQUEST_DELAY from lib.FileManager.workers.baseWorkerCustomer import BaseWorkerCustomer class CreateCopy(BaseWorkerCustomer): def __init__(self, paths, session, *args, **kwargs): super(CreateCopy, self).__init__(*args, **kwargs) s...
import src class PoisonBush(src.items.Item): """ a hard to remove poison plant """ type = "PoisonBush" name = "poison brush" description = "" usageInfo = """ You can use it to loose 100 satiation. """ walkable = False charges = 0 def __init__(self): """ set up int...
import datetime import re import string import urllib.request from functools import partial from cppman.formatter.tableparser import parse_table from cppman.util import fixupHTML, html2man def member_table_def(g): tbl = parse_table('<table>%s</table>' % str(g.group(3))) # Escape column with '.' as prefix tb...
from django.apps import AppConfig class OntakAppConfig(AppConfig): name = "oioioi.ontak"
""" Set the configuration variables for fabric recipes. """ from fabric.api import env from fabric.colors import yellow import os env.warn_only = True try: import ConfigParser as cp except ImportError: import configparser as cp # Python 3.0 config = {} _config = cp.SafeConfigParser() if not os.path.isfile("fa...
from functools import partial import threading from PIL import Image from PyQt4.Qt import Qt from PyQt4.Qt import QGridLayout, QInputDialog, QPushButton from PyQt4.Qt import QVBoxLayout, QLabel, SIGNAL from electrum_gui.qt.main_window import StatusBarButton from electrum_gui.qt.password_dialog import PasswordDialog fro...
""" PySAR Polarimetric SAR decomposition Contents -------- decomp_fd(hhhh,vvvv,hvhv,hhvv,numthrd=None) : Freeman-Durden 3-component decomposition """ from __future__ import print_function, division import sys,os import numpy as np def decomp_fd(hhhh,vvvv,hvhv,hhvv,null=None,numthrd=None,maxthrd=8): """ Freeman-...
from PySide import QtCore, QtGui class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(808, 600) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayoutWidg...
import sys, getopt import re import time def get_option(): opts, args = getopt.getopt(sys.argv[1:], "hi:o:") input_file = "" output_file = "" h = "" for op, value in opts: if op == "-i": input_file = value elif op == "-o": output_file = value elif op == "-h": h = "E-value distribution.\n-i : inputfi...
""" ===================================== dummySensor.py - Dummy Sensor Handler ===================================== Displays a silly little window for faking sensor values by clicking on buttons. """ import threading, subprocess, os, time, socket import numpy, math import sys class sensorHandler: def __init__(sel...
from http.server import BaseHTTPRequestHandler, HTTPServer import requests import urllib.parse import json HOSTNAME = '' PORT = 7800 _u = lambda t: t.decode('UTF-8', 'replace') if isinstance(t, str) else t class PostHandler(BaseHTTPRequestHandler): def do_GET(self): length = int(self.headers['Content-Length...
import heapq import random import matplotlib.pyplot as plt from aipython.cspProblem import CSP, Constraint from aipython.searchProblem import Arc, Search_problem from aipython.utilities import Displayable class SLSearcher(Displayable): """A search problem directly from the CSP.. A node is a variable:value dicti...
from newLayer import * from newSimulation import *
import os from optparse import OptionParser import io import time import random import thread import sys from smtp_stuff import sendMail from imap_stuff import checkMessages import datetime import string import array from time import gmtime, strftime from socket import * user = '' recipient = '' incoming_server = '' ou...
import sys import unittest sys.path.append(".") sys.path.append("..") from .CloudConn import TestCloudConnectorBase from IM.CloudInfo import CloudInfo from IM.auth import Authentication from radl import radl_parse from IM.VirtualMachine import VirtualMachine from IM.InfrastructureInfo import InfrastructureInfo from IM....
"""Unit tests for the ``organizations`` paths. Each ``APITestCase`` subclass tests a single URL. A full list of URLs to be tested can be found here: http://theforeman.org/api/apidoc/v2/organizations.html :Requirement: Organization :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: API :TestType: Function...
""" Panel displaying the torrc or armrc with the validation done against it. """ import math import curses import threading from util import conf, panel, torConfig, uiTools DEFAULT_CONFIG = {"features.config.file.showScrollbars": True, "features.config.file.maxLinesPerEntry": 8} TORRC, ARMRC = range(1...
""" Tests for pip related code. """ import unittest from unittest.mock import patch import logassert from fades.pipmanager import PipManager from fades import helpers class PipManagerTestCase(unittest.TestCase): """ Check parsing for `pip show`. """ def setUp(self): logassert.setup(self, 'fades.pipmanag...
from html import unescape from re import sub from urllib.request import Request as request, urlopen from xml.dom import minidom class SteamChecker: @staticmethod def striptags(gtstr, gtrep=''): """ Strip HTML tags from string. :param gtstr: String to strip tags :param gtrep: Repl...
import gensim import numpy as np from gensim.models import word2vec import jieba from TextSta_v2 import TextSta from gensim.corpora.dictionary import Dictionary path = u"C:\\Users\\xiangrufan\\Desktop\\NLP\\Astro_NLP\\resource\\复旦分类语料\\answer\\C3-Art\\C3-Art0002.txt" text = TextSta(path,encoding="GBK") sentense_file = ...
"""Tests for the hrpt reader.""" import os import unittest from contextlib import suppress from tempfile import NamedTemporaryFile from unittest import mock import numpy as np import xarray as xr from satpy.readers.hrpt import HRPTFile, dtype from satpy.tests.reader_tests.test_avhrr_l1b_gaclac import PygacPatcher from ...
""" vivopump -- module of helper functions for the pump """ import sys import csv import string import random import logging __author__ = "Michael Conlon" __copyright__ = "Copyright (c) 2016 Michael Conlon" __license__ = "New BSD license" __version__ = "0.8.7" logger = logging.getLogger(__name__) class DefNotFoundExcep...
""" optimisation.py: Optimisations for worldview solving Copyright (C) 2014 Michael Kelly 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 (...
''' Copyright 2016,暗夜幽灵 <darknightghost.cn@gmail.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 Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is ...
#################################################################################################### import re #For user-defined iteration filters. import rtmidi import threading import time import yaml def getMIDIInDevices(): midi = rtmidi.RtMidiIn() return list((port, midi.getPortName(port)) for port in ran...
""" conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime import endpoints from protorpc import...
from django.utils.translation import ugettext_lazy as _ from oioioi.base.menu import MenuRegistry navbar_links_registry = MenuRegistry(_("Navigation Bar Menu"))
from flask import Flask,render_template,send_file,Response,flash,request,redirect,session from werkzeug.utils import secure_filename import json import os.path import os import gzip import urllib from db import DbGetListOfDates,DbGet,DbGetComments,DbGetMulitple,DbGetNearbyPoints,DbPut,DbPutWithoutPassword,DbSearchWord,...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
from sympy import Add from uncertainties import __version_info__ as uncert_version from uncertainties import ufloat, ufloat_fromstr from uncertainties.core import Variable, AffineScalarFunc if uncert_version < (3, 0): raise Warning("Your version of uncertanties is not supported. Try\n" "$ sudo pip...
from __future__ import with_statement from sympy import Symbol, exp, Integer, Float, sin, cos, log, Poly, Lambda, \ Function, I, S, sqrt, srepr, Rational, Tuple, Matrix, Interval from sympy.abc import x, y from sympy.core.sympify import sympify, _sympify, SympifyError, kernS from sympy.core.decorators import _sympi...
import collections import os import unittest from ansible.modules.identity.keycloak.keycloak_group import * class KeycloakGroupTestCase(unittest.TestCase): def test_create_group(self): toCreate = { "username":"admin", "password":"admin", "realm":"master", "url...
import sys, os extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] templates_path = ['.templates'] source_suffix = '.txt' master_doc = 'index' project = u'GromacsWrapper' copyright = u'2009-2018, The Authors of GromacsWrapper (see AUTHORS)' packageversion = __import__('gromacs').__version__ version = '.'.join...
import time from menu.ncolor import * from menu.showMainMenu import * from command.shell import * from write.dnsmasq_write import * class Sub_Menu(): dns_message = """ you can add a redirect entry in this menu or edit the dnsmasq configuration file located in""" + color.BLEU + """ '/etc/redirect/dnsmasq.host'\n ""...
from __future__ import with_statement import os import re import threading import datetime import traceback import sickbeard from common import SNATCHED, SNATCHED_PROPER, SNATCHED_BEST, Quality, SEASON_RESULT, MULTI_EP_RESULT from sickbeard import logger, db, show_name_helpers, exceptions, helpers from sickbeard import...
""" Custom Bi Directional Binary Data Parser ModParser """
import unittest import os import sys import copy import nose from numpy.testing import * from numpy import array, alltrue, ndarray, asarray, can_cast,zeros, dtype from numpy.core.multiarray import typeinfo import util wrap = None def setup(): """ Build the required testing extension module """ global wr...
from greencouriers.tests import * class TestCourierController(TestController): def test_index(self): response = self.app.get(url(controller='courier', action='index')) # Test response...
import os from typing import Dict, List, Union OptionalJSON = Union[List, Dict, float, int, str, bool, None] def ensure_dir_exists(directory): if not os.path.exists(directory): os.mkdir(directory) def get_dir(directory: str) -> str: """ Return a string which contains the complete path to the input d...
import logging from gettext import gettext as _ from gi.repository import GObject from gi.repository import Gio from gi.repository import GLib from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GdkPixbuf from sugar3.graphics import style from sugar3.graphics.icon import Icon from suga...
__problem_title__ = "Number Rotations" __problem_url___ = "https://projecteuler.net/problem=168" __problem_description__ = "Consider the number 142857. We can right-rotate this number by moving " \ "the last digit (7) to the front of it, giving us 714285. It can be " \ ...
__author__ = "davide" import struct import socket import argparse import sys from datetime import datetime import time from collections import defaultdict from signal import signal, SIGINT, SIG_IGN ICMP_ECHO_REQUEST = 8, 0 ICMP_ECHO_RESPONSE = 0, 0 __all__ = ["ICMPPacket", "Pinger", "ICMP_ECHO_REQUEST", "ICM...
from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' from calibre.gui2.complete2 import LineEdit from calibre.gui2.widgets import history class HistoryLineEdit2(LineEdit): max...
from quanthistling.tests import * class TestBookController(TestController): def test_index(self): response = self.app.get(url(controller='book', action='index')) # Test response...
def sudoku(puzzle): import collections print('=== in sudoku ===') # Print arguments print_board(puzzle) # Count the numbers that are currently populated on the sudoku board number_count = collections.Counter(number for row in puzzle for number in row) number_count = dict(number_count) print_dict(number_count) ...
from multiprocessing import Process, JoinableQueue, Manager, Lock, Value, Event import wiringpi as wp import RPi.GPIO as rpio from slaveprocess import SlaveProcess import time rpio.setmode(rpio.BCM) class PMWProcess(Process): def __init__(self,**kwargs): super(PWMProcess, self).__init__(**kwargs) se...
from PySide import QtCore, QtGui from pysql_browser import MainWindow import sys def main(): app = QtGui.QApplication(sys.argv) window = MainWindow() window.show() sys.exit(app.exec_()) if __name__ == '__main__': main()
from npoapi.npoapi import NpoApi class Schedule(NpoApi): def get(self, guideDay=None, channel=None, sort="asc", offset=0, limit=240, properties=None, accept=None): params = { 'guideDay': guideDay, "sort": sort, "max": limit, "offset": offset, "pro...
import sys import os from ..data.molecular_species import molecular_species from ..data.reaction_mechanism_class import reaction_mechanism from ..data.condition_class import condition from ..data.reagent import reagent from ..data.puzzle_class import puzzle from ..data.solution_class import solution def name(class_obj)...
import tkinter as tk from tkinter import ttk from multiprocessing import pool import numpy as np import stat_functions as stat from scipy import stats as scstats from gui import gui_functions as guif import os import functions as fu class process_charts(ttk.Frame): def __init__(self,window,master,main_tabs,tabs): st...
compiler = './icc.py' mpicompiler = './icc.py' mpilinker = 'MPICH_CC=gcc mpicc' scalapack = True library_dirs += ['/opt/intel/Compiler/11.0/074/mkl/lib/em64t'] libraries = ['mkl_intel_lp64' ,'mkl_sequential' ,'mkl_core', 'mkl_lapack', 'mkl_scalapack_lp64', 'mkl_blacs_intelmpi_lp64', ...
""" Hardware file for the Superconducting Magnet (SCM) QuDi 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. QuDi is distributed in the hope t...
import re import lxml.html from pupa.scrape import Scraper, Organization class WYCommitteeScraper(Scraper): members = {} urls = { "list": "http://legisweb.state.wy.us/LegbyYear/CommitteeList.aspx?Year=%s", "detail": "http://legisweb.state.wy.us/LegbyYear/%s", } def scrape(self, session=N...
from gRefer import log def start_notifier(): import os from gRefer.config_constants import dir_name, bibfiler_log_file from gRefer.log import NotifyHandler import logging import logging.handlers logger = logging.getLogger(name="Notifier") if not os.path.exists(dir_name): os.makedirs(...
""" Load this into a Python Script widget (does not have to be connected to any other widgets), and set the project directory to the location of the git repo. Hit execute and enjoy! """ PROJECT_DIR = '/home/mahmoud/work/qualityvis' import sys sys.path.append(PROJECT_DIR) sys.path.append(PROJECT_DIR+'/orange_scripts')
a = 'GeeksforGeeks' c = b'GeeksforGeeks' d = a.encode('ASCII') if (d==c): print ("Encoding successful") else : print ("Encoding Unsuccessful") a = 'GeeksforGeeks' c = b'GeeksforGeeks' d = c.decode('ASCII') if (d==a): print ("Decoding successful") else : print ("Decoding Unsuccessful")
from dcgpy import expression_gdual_double as expression from dcgpy import kernel_set_gdual_double as kernel_set from pyaudi import gdual_double as gdual ks = kernel_set(["sum", "diff", "div", "mul"]) ex = expression(inputs = 1, outputs = 1, rows = 1, cols = 6, ...
import random from django.http import HttpResponse from httplib import HTTPConnection, HTTPSConnection from urlparse import urlsplit import httplib2 import urllib from django.utils import simplejson as json from django.conf import settings from django.contrib.auth.decorators import login_required from django.utils.html...
from . import memfbf from numpy import append import os import logging from glob import glob LOG = logging.getLogger(__name__) class SlicerFrame(dict): pass class FBFSlicer(object): """Given a workspace directory of flat binary files, grab all useful filenames and return a record of data at a time as a pyth...
DOCUMENTATION = ''' --- module: gandi_iface version_added: "2.0" short_description: create, attach, detach or delete Gandi network interfaces description: - Manage Gandi network interfaces options: state: description: - desired state of the resource required: false default: "created" choice...
__author__ = "David Estévez Fernández <david.estevez@bq.com>" __license__ = "GNU General Public License v3 http://www.gnu.org/licenses/gpl.html" import os import FreeCAD, FreeCADGui import Parameter class RecomputeParameters: """Creates a new parameter""" def GetResources(self): icon_path = os.path.join...
from rest_framework import generics from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from aklub.models import UserProfile, AdministrativeUnit from oauth2_provider.contrib.rest_framework import TokenHasReadWriteScope from rest_framework import serializers from rest_framework.perm...
import re from pyload.plugin.Account import Account class StahnuTo(Account): __name = "StahnuTo" __type = "account" __version = "0.05" __description = """StahnuTo account plugin""" __license = "GPLv3" __authors = [("zoidberg", "zoidberg@mujmail.cz")] def loadAccountInfo(self, u...
import SeqIterator import Constants """ @author: Jacob Porter @summary: An iterator class for iterating through two sequence record files simultaneously. @requires: SeqIterator """ class SeqDoubleIterator: def __init__(self, file_name1, file_name2, file_type=Constants.FASTQ, gzip_switch = False): self.SeqIt...