src
stringlengths
721
1.04M
# Copyright (c) 2015, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. # builtin import re import itertools import collections import distutils.version # external from lxml import etree from mixbox.vendor.six import iteritems, itervalues, with_metaclass from mixbox import compat # in...
from django import forms from django.core.exceptions import NON_FIELD_ERRORS from django.utils.html import escape from opentech.apply.review.options import NA from opentech.apply.stream_forms.forms import StreamBaseForm from .models import Review, ReviewOpinion from .options import OPINION_CHOICES, PRIVATE class Mi...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright(C) 2010-2013 Christophe Benz, Laurent Bachelier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, ei...
import textwrap from datetime import date from itertools import chain import decimal from sqlalchemy import Table, Column, Integer, ForeignKey, Date, Numeric, String, Text, Boolean, Time, and_, or_, cast, \ func, CheckConstraint from sqlalchemy.orm import relationship, backref from sqlalchemy.dialects import postg...
# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this perm...
from flask import request, redirect, url_for, abort, jsonify import rethinkdb as r import yahoofin as yf import json from app import app, db import datetime, time import threading def getTime(toConvert = None): """ Get current time in seconds or convert given time in seconds Arguments: toConvert ...
import os import subprocess import shutil import sys import tempfile import pytest thisdir = os.path.dirname(os.path.realpath(__file__)) metadata_dir = os.path.join(thisdir, "test-recipes/metadata") fail_dir = os.path.join(thisdir, "test-recipes/fail") def is_valid_dir(parent_dir, dirname): valid = os.path.isdi...
""" <Program> test_get_resources.py <Started> 8/30/2009 <Author> Jason Chen jchen@cs.washington.edu <Purpose> Tests that the get_resources view function handles normal operation and exceptions correctly. <Notes> See test_register.py for an explanation of our usage of the Django test...
# -*- coding: utf-8 -*- # Copyright 2017 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Sometimes we poke 'private' AFDO methods, since that's the most direct way to # test what we're looking to test. That's OK. # # ...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
#!/usr/bin/env python3 # Copyright (C) 2017 Alexandre Abadie <alexandre.abadie@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import sys import os from testrunner import run EXPECTED_...
# Copyright 2020 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2012-12-17 11:07:19 from __future__ import unicode_literals import os import sys import six import copy import time import json import logging import trac...
# -*- coding: utf-8 -*- # Copyright 2017 IBM RESEARCH. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
import os,sys,json,random class uploadTest: def __init__(self): self.source = sys.argv[1] self.f = open("operations.txt",'w',1) self.counter = 0 print('running') self.mapping = dict() def getParentID(self,filename): ...
#!/usr/bin/python # # test-postfix.py quality assurance test script for postfix # Copyright (C) 2008-2012 Canonical Ltd. # Author: Kees Cook <kees@ubuntu.com> # Author: Marc Deslauriers <marc.deslauriers@canonical.com> # Author: Jamie Strandboge <jamie@canonical.com> # # This program is free software:...
import inspect from django.core.urlresolvers import resolve, reverse, Resolver404 from django.template import Node, Library, TemplateSyntaxError from django.utils.translation import get_language from django.utils import six from parler.models import TranslatableModel, TranslationDoesNotExist from parler.utils.context i...
import sys, random, time, pygame from pygame.locals import * def print_text(font, x, y, text, color=(255,255,255)): imgText = font.render(text, True, color) screen.blit(imgText, (x,y)) pygame.init() screen = pygame.display.set_mode((600,500)) pygame.display.set_caption("Bomb Catching Game") font1 = pygame.font.Font...
import os import configparser import shutil import glob from lxml import etree RESOURCE_TYPES = range(4) CSS_RESOURCE, JS_RESOURCE, DIRECTORY_RESOURCE, OTHER_RESOURCE = RESOURCE_TYPES JS_POSITIONS = range(2) JS_POSITION_HEADER, JS_POSITION_BODY = JS_POSITIONS HOVERCRAFT_DIR = os.path.split(__file__)[0] class Reso...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- # Copyright (c) 2013 Kai Kratzer, Universität Stuttgart, ICP, # Allmandring 3, 70569 Stuttgart, Germany; all rights # reserved unless otherwise stated. # # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
from pylab import * convolen = -1 convolens = [] eventuals = [] explicits = [] replylens = [] convolendict = {} bytes_per_explicit = 1 #mpl.rcParams['font.size'] = 12 mpl.rcParams['figure.figsize'] = 4, 1 #mpl.rcParams['lines.markersize'] = 14 #mpl.rcParams['lines.linewidth'] = 1.5 for line in open("conversations....
import base64 import json import logging import re import urllib.parse from string import Template import pkg_resources import requests from detectem.exceptions import SplashError from detectem.settings import SPLASH_TIMEOUT, SPLASH_URL from detectem.utils import docker_container DEFAULT_CHARSET = "iso-8859-1" ERRO...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import itertools import os.path import sys import argparse import logging def cartesian_product(dicts): return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values())) def summary(configuration): kvs = sorted([(k, v) for k, v in configuration.items()...
#!/usr/bin/python # -*- coding: utf-8 -*- from lib.meos import MEoS from lib import unidades class C2(MEoS): """Multiparameter equation of state for ethane""" name = "ethane" CASNumber = "74-84-0" formula = "CH3CH3" synonym = "R-170" rhoc = unidades.Density(206.18) Tc = unidades.Temperatu...
# -*- coding: utf-8 -*- from django.db import models, migrations def datamigrate_admins_into_permissiongroups(apps, schema_editor): permissiongroup_model = apps.get_model('devilry_account', 'PermissionGroup') permissiongroupuser_model = apps.get_model('devilry_account', 'PermissionGroupUser') subject_mo...
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Anima Istanbul # # This module is part of anima-tools and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause import sys import maya.OpenMaya as OpenMaya import maya.OpenMayaMPx as OpenMayaMPx kPluginNodeTypeName = "spClosestPointO...
# Copyright (c) 2017 Ultimaker B.V. # PluginBrowser is released under the terms of the AGPLv3 or higher. from UM.Extension import Extension from UM.i18n import i18nCatalog from UM.Logger import Logger from UM.PluginRegistry import PluginRegistry from UM.Application import Application from PyQt5.QtCore import QUrl, QOb...
#!/usr/bin/env python from __future__ import division import numpy as np import numpy.matlib as npm class Controller: """ Define control law """ def __init__(self, number, T): """ Initialise the controller """ self.u = np.matrix([]) # Output for plant self.p = np.matrix([]...
from __future__ import print_function import numpy as np from scipy.linalg import eigvals from msmbuilder.cluster import NDGrid from msmbuilder.example_datasets import load_doublewell from msmbuilder.msm import MarkovStateModel, ContinuousTimeMSM from msmbuilder.msm.core import _solve_msm_eigensystem def test_eigen...
#!/usr/bin/env python3 # coding=utf-8 # ly2video - generate performances video from LilyPond source files # Copyright (C) 2012 Jiri "FireTight" Szabo # Copyright (C) 2012 Adam Spiers # Copyright (C) 2014 Emmanuel Leguy # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Copyright (c) 2015 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
from unittest import TestCase import nacl import pytest from eduid_common.config.base import RedisConfig from eduid_common.session.meta import SessionMeta from eduid_common.session.redis_session import RedisEncryptedSession, SessionManager, SessionOutOfSync from eduid_common.session.testing import RedisTemporaryInsta...
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
# Copyright (c) 2014 - 2016 townhallpinball.org # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, p...
#!/usr/bin/env python # -*- encoding: utf-8; py-indent-offset: 4 -*- # # Written / Edited by Philipp Näther # philipp.naether@stadt-meissen.de # Perf-O-Meters for Check_MK's checks # # They are called with: # 1. row -> a dictionary of the data row with at least the # keys "service_perf_data", "service_state" and "s...
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
"""Configuration of directories, target column names, cross-validation folds""" import os import numpy as np from datetime import datetime class ParamConfig: def __init__(self): self.target_cols = ['NPWD2372', 'NPWD2401', 'NPWD2402', 'NPWD2451', 'NPWD2471', 'NPWD2472', 'NPWD2481', ...
#fsTimer - free, open source software for race timing. #Copyright 2012-15 Ben Letham #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...
from sqlite3 import OperationalError from datetime import date from os.path import join, expanduser import os import Config DATABASE = join(expanduser('~'), '.ControlOrange\\controlOrange.db') __author__ = 'David' import sqlite3 class Modelo: @staticmethod def initbd(): if not os.path.exists(DATAB...
#------------------------------------------------------------------------------- # # Copyright (c) 2007, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in /LICENSE.txt and may be redistributed only # under the conditions described...
# -*- coding: utf-8 -*- from openerp import models,pooler, api import logging import threading import traceback from actualizador.facade_actualizacion import Facade_Actualizacion _logger = logging.getLogger(__name__) class update_nickel(models.Model): _name = 'expresso_nickel.update_nickel' _description = '...
"""This module implements the core Scheme interpreter functions, including the eval/apply mutual recurrence, environment model, and read-eval-print loop. """ from scheme_primitives import * from scheme_reader import * from ucb import main, trace ############## # Eval/Apply # ############## def scheme_eval(expr, env)...
#!/usr/bin/python3 from enum import IntEnum import struct class Flag(IntEnum): Payload = 0b10000000 Success = 0b01000000 Resend = 0b00100000 Configurate = 0b00000100 Hello = 0b00000010 Parity = 0b00000001 class FlagSet(object): def __init__(self, flags=0x00): flags = int(flags) if ...
import asyncio from decimal import Decimal import hashlib import io import ipaddress import json import logging from pathlib import Path import re from typing import ( Any, Optional, Iterable, Mapping, MutableMapping, List, Sequence, Tuple, Union, Type, overload, ) from typing_extensions import Fina...
# Copyright 2006 James Tauber and contributors # Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class BindingTestCase(Integrati...
# Copyright 2012 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
import numpy as np import theano import theano.tensor as T from operator import itemgetter from dnn.utils import npt _unpack = itemgetter('lr', 'm', 'nesterov', 'weight_decay') # I didn't know how `weight_decay` work with `nesterov`, # before or after, so did not add it # NOTE: custom grads is powerful # for example...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name = 'walmart-reviews',...
# -*- coding: utf-8 -*- """ /*************************************************************************** Landsat 8 LST Retriever (SWA) A QGIS plugin This module allows to retrieve Land Surface Temperature (LST) from Landsat 8 data (TIRS channels) using Split-Windows Algorithm. Water Vap...
from __future__ import print_function from threading import Thread import sys import cv2 import numpy as np import queue from BETA.dev02.test2 import avg_color from BETA.dev02.test4 import t2s_say class VideoStream: def __init__(self, src=None, height=None, width=None, ratio=None): cv2.setUseOptimized(Tru...
# Copyright (C) 2017-2018 OpenIO SAS # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# coding: utf-8 # Copyright (C) 2016 Bruno Abude Cardoso # # Imagem Cinemática 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. # # Imag...
import gtk import dialog import utils import random from fract4d import gradient def show_gradients(parent,f): GradientDialog.show(parent,f) class GradientDialog(dialog.T): def __init__(self,main_window,f): global userPrefs dialog.T.__init__( self, _("Gradients"), ...
from fabric.api import * import re import os.path import logging import utils.log l = logging.getLogger() l = utils.log.CustomLogAdapter(l, None) @task(default=True) def check(input_params, cluster): """ Install a given version of a given package Can support multiple backends input_params para...
#-*- coding: utf-8 -*- #----------------------------------------------------------------------- # Author: delimitry #----------------------------------------------------------------------- class AsciiCanvas(object): """ ASCII canvas for drawing in console using ASCII chars """ def __init__(self, cols...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
from __future__ import unicode_literals # Python 2/3 compatibility # from __future__ import print_function # Python 2/3 compatibility # import sys import argparse import modelio from parser import TokenParser from trainer import MarkovTrainer from generator import MarkovGenerator parser = argparse.ArgumentParser(d...
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # # --------------------------------------------------------------------- # Copyright (C) 2017-2018 The --- Project # See LICENSE for details # --------------------------------------------------------------------- class Fi...
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.node import Branch log = logging.getLogger(__name__) class TestBranch(unittest.TestCase): def setUp(self): self.fd, self.path = tempfile.mkstemp() def tearDown...
#coding: utf-8 import types, time import csv, cStringIO, codecs import xml.dom.minidom import httplib import urllib import sys import optparse import os import simplejson import logging from pprint import pprint from launchpadlib.launchpad import Launchpad import dateutil.parser #import pdb CONST_TEAM = "trafodion" ...
# -*- coding: iso-8859-1 -*- # Copyright (C) 2005-2010 Bastian Kleineidam """ """ import time from .. import ProxyTest from wc.http.date import get_date_rfc1123 class test_datedwarn_1old_0cur_0fut(ProxyTest): def test_datedwarn_1old_0cur_0fut(self): self.start_test() def get_response_headers(self, ...
''' Test to make sure that the downsampling of the catalog produces (more or less) the same results as the full catalog ''' import env import numpy as np import catalog as Cat import evolver as Evol import observables as Obvs import util as UT import matplotlib.pyplot as plt import corner as DFM from ChangTools....
import unittest import json from snort import Alert class TestSnortParser(unittest.TestCase): maxDiff = None def test_parse_buffer_udp(self): buf = """[**] [1:2003195:5] ET POLICY Unusual number of DNS No Such Name Responses [**] [Classification: Potentially Bad Traffic] [Priority: 2] 05/04/14-11...
import logging from collections import Counter class Utils: def __init__(self, workspace_client): self.ws = workspace_client @staticmethod def validate_params(params, expected, opt_param=set()): """Validates that required parameters are present. Warns if unexpected parameters appear""" ...
import os import unittest from unittest import TestSuite import random import math import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as plticker import acpc_python_client as acpc from response.data_biased_response import DataBiasedResponse from evaluation.exploitability import Exploitabilit...
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # ***** END LICENSE BLOCK ***** """Generic signing methods. """ ...
## simplexml.py based on Mattew Allum's xmlstream.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (...
""" Footnotes Extension for Python-Markdown ======================================= Adds footnote handling to Python-Markdown. See <https://pythonhosted.org/Markdown/extensions/footnotes.html> for documentation. Copyright The Python Markdown Project License: [BSD](http://www.opensource.org/licenses/bsd-license.php)...
import re from textwrap import TextWrapper from six.moves.urllib.parse import unquote as gff3_unescape class EMBLContig(object): def __init__(self): self.header = None self.features = {} self.sequence = None def format(self): try: header = self.header.format() except AttributeError: ...
# -*- coding: utf-8 -*- """File containing a Windows Registry plugin to parse the USBStor key.""" import logging from plaso.containers import windows_events from plaso.parsers import winreg from plaso.parsers.winreg_plugins import interface __author__ = 'David Nides (david.nides@gmail.com)' class USBStorPlugin(in...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' cc_plugin_ncei/ncei_point.py ''' from compliance_checker.base import BaseCheck from cc_plugin_ncei.ncei_base import TestCtx, NCEI1_1Check, NCEI2_0Check from cc_plugin_ncei import util class NCEIPointBase(BaseCheck): _cc_spec = 'ncei-point' valid_feature_types...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'People.control_group' db.add_column(u'people', 'control_group', self.g...
import json import time import pytest from flask import url_for import listenbrainz.db.user as db_user import listenbrainz.db.user_relationship as db_user_relationship from listenbrainz import db from listenbrainz.tests.integration import ListenAPIIntegrationTestCase from listenbrainz.webserver.views.api_tools import...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Short interest dynamics """ from __future__ import print_function, division import os import zipfile import datetime as dt import pandas as pd import matplotlib.pyplot as plt import seaborn as sns path = os.getenv("HOME") + '/Dropbox/Research/data/Compustat/data/' #...
"""Frame objects that do the frame demarshaling and marshaling.""" import logging import struct from pika import amqp_object from pika import exceptions from pika import spec from pika.compat import byte LOGGER = logging.getLogger(__name__) class Frame(amqp_object.AMQPObject): """Base Frame object mapping. Defi...
# Copyright 2016 Ebay Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.arrays import BooleanArray from pandas.core.arrays.boolean import coerce_to_array @pytest.fixture def data(): return pd.array( [True, False] * 4 + [np.nan] + [True, False] * 44 + [np.nan] + [True, False], ...
""" WSGI config for controller project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION...
# Copyright 2014 Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
""" Copyright (C) <2010> Autin L. TSRI This file git_upy/autodeskmaya/mayaHelper.py is part of upy. upy 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, ...
"""Read images""" import os import logging import argparse import pickle from exif import _extract_exif_metadata, _extract_image_metadata from PIL import Image from rawkit.raw import Raw from multiprocessing import Pool from functools import partial import libraw TMPDIR=os.getenv("TMPDIR") def get_arguments(): p...
""" Add material to support overhang or remove material at the overhang angle. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utili...
import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GObject, GdkPixbuf import urllib.request, urllib.parse from concurrent.futures import ThreadPoolExecutor import sqlite3 import os, sys import blacklist #my directory mydir=os.path.dirname(sys.argv[0]) #sqlite stuff conn=sqlite3.connect(os.pat...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009-2012 Zuza Software Foundation # # This file is part of Pootle. # # Pootle 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 th...
# # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # from antlr4.IntervalSet import IntervalSet from antlr4.Token import Token from antlr4.atn.ATNState import ATNState from antlr...
import time from datetime import datetime, date from dateutil.parser import parse as dateFromString __all__ = ['todate', 'date2timestamp', 'timestamp2date', 'yyyymmdd2date', 'date2yyyymmdd', 'juldate2date', 'date2juldate', 'dateFromString',...
""" Runs a command [ssh] formula = sprinter.formula.command redirect_stdout_to_log=false fail_on_error=true shell = False install=echo 'setting up...' update=echo 'updating...' remove=echo 'destroying...' activate=echo 'activating...' deactivate=echo 'deactivating...' """ from __future__ import unicode_literals from s...
# this script will open a file with email addresses in it, then extract # those address and write them to a new file import os import re # vars for filenames filename = 'em.txt' newfilename = 'er.txt' # read file if os.path.exists(filename): data = open(filename,'r') bulkemails = data.read() else: ...
__author__ = 'james' from django.utils.translation import ugettext as _ from django import forms from django.core.exceptions import ValidationError from django.contrib.auth.models import User from django.contrib.auth import login, authenticate from events.models import Booking from orders.models import Order, OrderIt...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PlanningConnections' db.create_table(u'planning_planningc...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jul 11 21:14:57 2017 @author: fernando """ import pandas as pd import matplotlib import matplotlib.pyplot as plt plt.style.use('ggplot') df = pd.read_csv('concrete.csv') print df.describe() # Plot 1 df.plot.scatter(x='cement', y='strength') plt.s...
################################################################################ ## Demonstration program for class Date ################################################################################ import date print("[Testing Area-__init__]") J = date.Date( brake, me, 2013 )#testin two arguments to function that...
# -*- coding: utf-8 -*- # # Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig import os, sys sys.path.insert(0, os.path.abspath('.')) from nogamespy import models, settings # this is the Alembic Config object, which provides # access to the va...
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import abc from typepy import RealNumber class AbstractContainer(metaclass=abc.ABCMeta): @abc.abstractproperty def min_value(self): # pragma: no cover pass @abc.abstractproperty def max_value(self): # pragma: no cover...
""" WSGI config for django_http_api project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLIC...