src
stringlengths
721
1.04M
# coding=utf-8 """ This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base....
# -*- coding: utf-8 -*- """ Created on Wed Jul 08 10:03:13 2015 @author: kimlanc """ import matplotlib import matplotlib.pyplot as plt import numpy # Flow as function of reactor power and deltaT def power(DT,Vdot,rho=1000,cp=4200): # Power [MWt], DT [degC or K], Vdot [m3/day], rho [kg/m3], cp [J/kgK] ...
####################################### ## BOT Messages ####################################### # Message in response to someone asking us to verify them bot_msg_verify=''' Hello there! I believe you requested verification? If so please reply back to THIS PRIVATE MESSAGE with your Account Name (name with numbers) ...
"""Distinguished Encoding Rules (DER) codec. """ from . import DecodeTagError from . import ber from . import restricted_utc_time_to_datetime from . import restricted_utc_time_from_datetime from . import restricted_generalized_time_to_datetime from . import restricted_generalized_time_from_datetime from . import add_...
import threading from bottypes.invalid_console_command import InvalidConsoleCommand from util.loghandler import log class ConsoleThread(threading.Thread): def __init__(self, botserver): self.botserver = botserver threading.Thread.__init__(self) def update_config(self, option, value): ...
import logging import os import time import sys import socket import requests if sys.version_info < (3, 0): from xmlrpclib import ServerProxy else: from xmlrpc.client import ServerProxy, Transport, ProtocolError from .constants import SYNC_TIMESTAMP, SYNC_HOSTS, SYNC_HOSTS_TMP, SYNC_RECEIVED_HOSTS, SOCKET_TI...
""" Normal Django models with a few custom options for configuration. If you have custom model classes that need these options, add them here and create a child class of the appropriate options class and your custom model class. """ # Django from django.db import models class Options(): def __init__(self, di_sh...
#!/usr/bin/python # Thanks: Glusk for the GREAT help # karapidiola for the base script from socket import * import hashlib try: import _srp as srp except: print("Need py_srp") exit(1) def generate_K(S): """Generate K from S with SHA1 Interleaved""" s_bytes = srp.long_to_bytes(S) # Has...
from __future__ import print_function from types import IntType, FloatType, LongType, StringTypes from copy import deepcopy from binascii import hexlify from Constants import * from Styles import * class UnhandledParamError( Exception ) : def __init__( self, param ) : ...
# -*- coding: utf-8 -*- import json from pybikes import BikeShareSystem, BikeShareStation, PyBikesScraper from pybikes.exceptions import InvalidStation class Bicing(BikeShareSystem): meta = { 'system': 'Bicing', 'company': [ 'Barcelona de Serveis Municipals, S.A. (BSM)', '...
from PyQt4.QtGui import QToolBar, QActionGroup from PyQt4.QtCore import Qt, QPoint from utils import log class FloatingToolBar(QToolBar): """ A floating QToolBar with no border and is offset under its parent """ def __init__(self, name, parent): """ parent: The parent of this toolbar. Should be another toolba...
#FLM: Library routine - bez format conversion ###################################################################### __copyright__ = """ Copyright 2016 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. This software is licensed as OpenSource, under the Apache License, Version 2.0. This license ...
# -*- coding: utf-8 -*- import unittest import subprocess import shlex class TestConsole(unittest.TestCase): def call(self, command): args = shlex.split(command) command = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) return command.stdout.read() def command(...
import logging from unittest import TestResult logger = logging.getLogger(__name__) class CustomTestReport(TestResult): def __init__(self, change_callback=None): super(CustomTestReport, self).__init__() logger.debug('__init__') self.running = False self.change_callback = change_c...
# # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2005 Robert Collins <robertc@robertcollins.net> # # 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 Foun...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
from flask import Flask, request, render_template, Response from geojson import Feature, Point, FeatureCollection import Test """Simple flask app to display listings on a map The dwelling type is hardcoded by the coordinates are passed in from the frontend. """ app = Flask(__name__, template_folder="../templates", st...
import json from mock import patch from string import Template from django.db.models import F from django_webtest import WebTest from popolo.models import Identifier from candidates.models import MembershipExtra, PersonExtra from .auth import TestUserMixin from . import factories example_timestamp = '2014-09-29T10...
from __future__ import division, absolute_import, print_function import pytest import numpy as np import numpy.ma as ma from numpy.ma.mrecords import MaskedRecords from numpy.ma.testutils import assert_equal from numpy.testing import assert_, assert_raises from numpy.lib.recfunctions import ( drop_fields, rename_...
#!/usr/bin/env python # Copyright 2014 Alessio Sclocco <a.sclocco@vu.nl> # # 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...
# -*- coding: utf-8 -*- from django.db import models, migrations from ..models.project import Project def change_primary_organisations(apps, schema_editor): Project = apps.get_model("rsr", "Project") for project in Project.objects.all(): primary_organisation = None # Pick the reporting org...
# -*- coding: utf-8 -*- # Copyright 2017 Dhana Babu # # 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...
# -*- coding: utf-8 -*- # # hl_api_types.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, o...
#!/usr/bin/env python # # Copyright 2014 Martin Cochran # # 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 la...
"""Google Service API classes.""" __author__ = 'Pavel Simakov (psimakov@google.com)' import datetime import logging import time from dateutil import parser from googleapiclient import discovery from googleapiclient import errors import pytz from google.cloud import datastore RFC3339_FORMAT = '%Y-%m-%dT%H:%M:%SZ' ...
""" Given an array of integers nums and an integer k, return the number of unique k-diff pairs in the array. A k-diff pair is an integer pair (nums[i], nums[j]), where the following are true: 0 <= i, j < nums.length i != j a <= b b - a == k Example 1: Input: nums = [3,1,4,1,5], k = 2 Output: 2 Explanation: There ...
from geokey.projects.models import Project from geokey.contributions.models import Observation class SingleAllContribution(object): """ Base class for single contributions on the all contributions endpoints """ def get_object(self, user, project_id, observation_id): """ Returns a singl...
# Given a nested list of integers, implement an iterator to flatten it. # Each element is either an integer, or a list -- whose elements may also be integers or other lists. # Example 1: # Given the list [[1,1],2,[1,1]], # By calling next repeatedly until hasNext returns false, the order of elements returned by next...
"""margins.py Functions for computing stability margins and related functions. Routines in this module: margins.stability_margins margins.phase_crossover_frequencies margins.margin """ # Python 3 compatibility (needs to go here) from __future__ import print_function """Copyright (c) 2011 by California Institute of...
#!/usr/local/bin/python # -*- coding: utf-8 -*- """ - LICENCE The MIT License (MIT) Copyright (c) 2016 Eleftherios Anagnostopoulos for Ericsson AB (EU FP7 CityPulse Project) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software...
#!/usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- coding: iso-8859-1 -*- """ RSTWriter.py Copyright 2009 by Marcello Perathoner Distributable under the GNU General Public License Version 3 or newer. Build an RST file. This is just the master RST with the PG license mixed in. """ from __future_...
# QPy - Copyright (c) 2012,2013 Ugo Varetto # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of cond...
import os from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import sys import uuid from taskwarrior_subtask_capsule import __version__ as version_string requirements_path = os.path.join( os.path.dirname(__file__), 'requirements.txt', ) try: from pip.req i...
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
from pyqtgraph.Qt import QtCore, QtGui class ThreadsafeTimer(QtCore.QObject): """ Thread-safe replacement for QTimer. """ timeout = QtCore.Signal() sigTimerStopRequested = QtCore.Signal() sigTimerStartRequested = QtCore.Signal(object) def __init__(self): QtCore...
import os import django # placeholder for gettext def _(s): return s BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = 'j#zwt2c!*(7(jz!m(tr$+jq^1d(+)e(^059f^nd_(*zj!gv0x)' DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = ['*'] INSTALLED_APPS = ( 'modeltranslation', 'django.contr...
""" Django settings for tgrsite project. Generated by 'django-admin startproject' using Django 1.10.2. 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/ """ import os...
from django.contrib.auth import get_user_model from factory import DjangoModelFactory, CREATE_STRATEGY, LazyAttribute, PostGeneration, Sequence from karrot.utils.tests.fake import faker class UserFactory(DjangoModelFactory): class Meta: model = get_user_model() strategy = CREATE_STRATEGY is_...
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
# coding=utf-8 # Copyright 2018 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 agreed t...
# # Copyright (C) 2015 The Android Open Source Project # # 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 la...
import os, sys, time from twisted.trial import unittest from twisted.internet import reactor, task from twisted.internet.threads import deferToThread from twisted.internet.defer import Deferred from twisted.python import threadable TEST_FILENAME = "__test_aio_output__" class TestAio(unittest.TestCase): def setUp...
from sqlalchemy import Column, Integer, String, DateTime, Boolean, Text, func from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session, sessionmaker from kokemomo.plugins.engine.model.km_s...
# -*- coding: utf-8 -*- import re USE_SOCKS_PROXY = 0 if USE_SOCKS_PROXY: import requesocks as requests else: import requests # import socks, socket # socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 1080) # socket.socket = socks.socksocket username = 'x@gmail.com' password = 'xyz' host = 'http://www.v2ex....
""" mediatum - a multimedia content repository Copyright (C) 2007 Arne Seifert <seiferta@in.tum.de> Copyright (C) 2007 Matthias Kramm <kramm@in.tum.de> 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 Foun...
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- """This script generates a family file from a given URL.""" from __future__ import (absolute_import, division, print_function, unicode_literals) # # (C) Merlijn van Deen, 2010-2013 # (C) Pywikibot team, 2010-2018 # # Distributed under the terms of the MI...
# Copyright 2001 by Jeffrey Chang. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Maximum Entropy code. Uses Improved Iterative Scaling. """ # TODO Define terminology from...
''' Plot queue occupancy over time ''' from helper import * import plot_defaults from matplotlib.ticker import MaxNLocator from pylab import figure parser = argparse.ArgumentParser() parser.add_argument('--files', '-f', help="Queue timeseries output to one plot", required=True...
# Copyright 2013 IBM Corp. # # 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 t...
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' # Imports {{{ ...
# -*- coding: utf-8 -*- # # live-magic - GUI frontend to create Debian LiveCDs, etc. # Copyright (C) 2007-2010 Chris Lamb <lamby@debian.org> # # 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 Found...
# Copyright 2017 Raphaël Hertzog # # This file is subject to the license terms in the LICENSE file found in # the top-level directory of this distribution. import argparse from datetime import datetime import csv import logging from django.core.management.base import BaseCommand from parrainage.app.models import Elu...
""" Contains the house price model. DON'T USE THIS MODEL! Use the HousePriceModel in house_price_model_2.py. """ import os import numpy as np import pandas as pd from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import RidgeCV # Constants BASE_DATE = pd.to_datetime('20140101', format='%Y%...
from flask_script import Manager from flask_restful import Api from models.user import User from redis_ops.init_redis import RedisPopulater from config import app from config import db from api import api import logging import os import sys manager = Manager(app) def setup_api(app): """ Config resources wi...
# Built-in modules # import os, sqlite3, types # Internal modules # from seqenv.common import download_from_url, md5sum from seqenv.common.color import Color from seqenv.common.autopaths import FilePath from seqenv.common.cache import property_cached #################################################...
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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 F...
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Top-level presubmit script for Blink. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmi...
import safenet.api import requests import json from StringIO import StringIO import base64 __author__ = "William Clyde" __copyright__ = "Copyright 2016, William Clyde" __license__ = "MIT" class Directory: """Directory management""" def __init__(self): """__init__""" self.headers = {'content-...
# 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/. from marionette_harness import MarionetteTestCase class TestSetWindowSize(MarionetteTestCase): def setUp(self): ...
# # Copyright 2015 VTT Technical Research Center of Finland # # 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 applicabl...
#!/usr/bin/env python3 # Copyright (c) 2015-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the prioritisetransaction mining RPC.""" import time from test_framework.messages import COIN, M...
import logging import json import unittest import sys import apache_beam as beam from taxi_streaming_pipeline import * from apache_beam.testing.test_pipeline import TestPipeline from apache_beam.testing.util import BeamAssertException from apache_beam.testing.util import assert_that, equal_to_per_window from apache_b...
# -*- 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 field 'Cred.expire_time' db.add_column(u'cred_cred', 'expire_tim...
from nasa import api from nasa.base import NasaApiObject ''' Retrieves the most recent MAAS Report ''' def latest(): response = api.external_api_get( 'http://marsweather.ingenology.com/v1/latest/', {}, ) return MAASReport.from_response(response['report']) ''' Retrieves the set of MAAS Repo...
''' In Freecad properties of surfaces and edges are expressed in absolute co-ordinates when acess object.shape . Therefore when altering a objects placement variables as to get two surface aligned (or the like), its recommended to the feature variables are converted into a relative co-ordinate system. This relative co-...
from __future__ import unicode_literals from .win32 import read_message_from_pipe, write_message_to_pipe, connect_to_pipe from ctypes import windll from prompt_toolkit.eventloop import From, Return import six __all__ = [ 'PipeClient', ] class PipeClient(object): r""" Windows pipe client. :param pipe...
# Copyright © 2014-2016 Jakub Wilk <jwilk@jwilk.net> # # 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, mer...
""" The main code implementing simple matrix Q-learning """ import numpy as np import random class quint: """ The class for creating a Q-learning system """ def __init__(self, reward_matrix, gamma, not_allowed_action = -1): """ Initializes a learner using the reward matrix Reward Matrix structure ---...
#!/usr/bin/python # -*- coding: utf-8 -*- """ # Author: Yongkyu Kim, PhD Max Planck Institute for terrestrial microbiology # # Date: 2014-04-02 # Version: 1.0 # # Try 'dafga_refDB.py -h' for more information and See manual # # Purpose: # Bugs: Please report to https://github.com/outbig/DAFGA/is...
import tkinter as tk from tkinter.ttk import Progressbar from tkinter import filedialog, messagebox import os import errno from threading import Thread import program_logic def get_paths_in_dir(directory): filenames = os.listdir(directory) return [os.path.abspath(os.path.join(directory, name)) for name in fil...
# coding: utf8 """ flask_weasyprint ~~~~~~~~~~~~~~~~ Flask-WeasyPrint: Make PDF in your Flask app with WeasyPrint. :copyright: (c) 2012 by Simon Sapin. :license: BSD, see LICENSE for more details. """ import weasyprint from flask import request, current_app from werkzeug.test import Client, Clie...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Functions to calculate the electronic band structure. Note: no symmetry recognition is implemented yet. """ import numpy as np from math import fabs, sqrt from postqe.xmlfile import get_cell_data, get_calculation_data, get_band_strucure_data from postqe.constants im...
#!/usr/bin/env python # -*- coding: utf-8 -*- class UnitLevel: """ Functionality related to how much xp a unit has """ def get_level_by_xp(self, total_experience): player_level = 1 levels = self.get_levels() for level, experience_needed in levels: if total_experi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import unittest from hwt.simulator.simTestCase import SimTestCase from hwtLib.amba.datapump.interconnect.rStricOrder import RStrictOrderInterconnect from hwtLib.amba.datapump.sim_ram import AxiDpSimRam from pyMathBitPrecise.bit_utils import mask from hwtSimApi.constants ...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
#!/usr/bin/python __author__ = "Steffen Vogel" __copyright__ = "Copyright 2015, Steffen Vogel" __license__ = "GPLv3" __maintainer__ = "Steffen Vogel" __email__ = "post@steffenvogel.de" """ This file is part of transWhat transWhat is free software: you can redistribute it and/or modify it under the terms of the GN...
import os from setuptools import setup, Command from unittest import TextTestRunner, TestLoader class TestCommand(Command): '''Run test suite using `python setup.py test `''' user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): ...
#!/usr/bin/env python # encoding: utf-8 import sys import os class Package(object): def config_attributes(self): return dict(comment='dev package', name_short='dev', name_long='dev', name_full='dev') def config_db(self, pkg): #developer table t = pkg.table('de...
""" Created on 30 Apr 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) example: { "id": "southcoastscience-dev", "name": "South Coast Science - Dev", "month": "2016-11", "gravatar-hash": "07f512e9fe64863039df0c0f1834cc25", "topics": [ { "topic": "/orgs/south-coast-science-dev/user/d...
# -*- 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...
import json import requests from logistics.models import Fleet SERVER_URL = "http://demo.geo2tag.org/instance/" BASE_SERVICE_NAME = "testservice" SERVICE_NAME = BASE_SERVICE_NAME channel_dict = {} points_dict = {} def getSerivceUrl(): return SERVER_URL + "service/" + SERVICE_NAME def one_time_startup(): ...
## @file # This file is used to define class objects of INF file [LibraryClasses] section. # It will consumed by InfParser. # # Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the B...
# -*- coding: utf-8 -*- # Copyright 2018 ProjectQ-Framework (www.projectq.ch) # # 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 # # ...
# -*- coding: utf-8 -*- """ Created on Mon Feb 14, 2011 @author:Isabel Restrepo Compuets PCA reconstruction error. Each block is processed in a separate thread. This script assumes that the pca basis has been computed as gone by extract_pca_kernels.py """ import os; import bvpl_octree_batch import multiprocessing imp...
# hgweb/server.py - The standalone hg web server. # # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net> # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2, incorporated herein by reference. im...
# -*- coding: utf-8 -*- import urlparse from dirtyfields import DirtyFieldsMixin from django.db import models from django.utils import timezone from django.utils.functional import cached_property from django.contrib.contenttypes.fields import GenericRelation from framework.postcommit_tasks.handlers import enqueue_pos...
import unittest import warnings from ingenico.connect.sdk.communicator_configuration import CommunicatorConfiguration from ingenico.connect.sdk.log.response_log_message import ResponseLogMessage from ingenico.connect.sdk.log.sys_out_communicator_logger import SysOutCommunicatorLogger from ingenico.connect.sdk.defaulti...
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from django.conf.urls import url from ribbit_app.models import Ribbit from . import views from django.core.urlresolvers import reverse from django.test import LiveServerTestCase from django.contrib.auth....
from flask import Flask app = Flask(__name__) from flask import request @app.route('/') def index(): user_agent = request.headers.get('User-Agent') return " <p>Your browser is %s</p> " % user_agent @app.route('/') def index(): response = make_response(<h1>This document carries a cookie.</h1>) respon...
import nomad.api.exceptions from nomad.api.base import Requester class Deployment(Requester): """ The /deployment endpoints are used to query for and interact with deployments. https://www.nomadproject.io/docs/http/deployments.html """ ENDPOINT = "deployment" def __init__(self, **kwargs): ...
import os import sys from requests import exceptions from imgurpython import ImgurClient from imgurpython.helpers.error import ImgurClientError class Client(): def __init__(self, client_id, client_secret, cred_dir): self.supported_types = [".jpg", ".jpeg", ".png", ".apng", ".tiff", ".pdf", ".xc...
""" Non-cython methods for getting counts and distributions from data. """ import numpy as np __all__ = ( 'counts_from_data', 'distribution_from_data', 'get_counts', ) try: # cython from .pycounts import counts_from_data, distribution_from_data except ImportError: # no cython from boltons....
"""Tools for setting up interactive sessions. """ from __future__ import print_function, division from distutils.version import LooseVersion as V from sympy.external import import_module from sympy.interactive.printing import init_printing preexec_source = """\ from __future__ import division from sympy import * x,...
# -*- coding: UTF-8 -*- import sys reload(sys) sys.setdefaultencoding('utf8') import requests import re import os from lxml import etree fileLoc = os.path.join("/","Users","YutoTakamoto","Dropbox","YutoProgramming","python","pagesToNuke.txt") baseURL = "http://en.kancollewiki.net/api.php?" searchSize = 50 searchParams ...
# -*- coding: utf-8 -*- # # Copyright (c) 2014-2015 Université Catholique de Louvain. # # This file is part of INGInious. # # INGInious 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, either version 3 o...
import os import sys import fcntl import errno import signal def unblock_stdout(): # get a non-blocking stdout child_pid, child_pty = os.forkpty() if child_pid != 0: # parent # child is in its own process group, manually pass kill signals signal.signal(signal.SIGINT, lambda signum, frame: os.kill(chil...
""" @author: Amine Sehili <amine.sehili@gmail.com> September 2015 """ import unittest from functools import partial import sys import wave from genty import genty, genty_dataset from auditok import ( dataset, ADSFactory, AudioDataSource, AudioReader, Recorder, BufferAudioSource, WaveAudioS...
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distribut...