src
stringlengths
721
1.04M
#! /usr/bin/python # -*- encoding: utf-8 -*- import time import threading import subprocess class Periodic: def __init__(self, arg): self.interval = int(arg['interval']) / 1000 self.temp_dir = arg['temp_dir'] self.arg = arg self.is_running = True self.is_finish = False ...
# 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 io import StringIO def str_collection(val, begin, end): with StringIO() as buf: buf.write(begin) firs...
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # # 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...
#!/usr/bin/env python3 import time, re, io, sys import contextlib def test_we_can_import_module(): import printtime_cm def test_context_manager_exists(): import printtime_cm printtime_cm.printtime_cm def test_context_manager_can_be_used(): import printtime_cm with printtime_cm.printtime_cm(): ...
from tkinter import * from tkinter.scrolledtext import ScrolledText from tkinter.ttk import * from unjabberlib import formatters class ScrolledTextFormatter(formatters.Formatter): def __init__(self, scrolled_text): super().__init__() self.text = scrolled_text self.text.tag_configure(forma...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import sys import webbrowser from .statareport import Reporting from .stataspoon import MutationsTester from .statautils import Directory, Logger from .stataxml import ConfigParser """ Report filename """ REPORT_FILENAME = 'statam_report.html' ...
# This tool will plot the HST ground tracks from mpl_toolkits.basemap import Basemap from pylab import * from matplotlib.font_manager import FontProperties import sys import string, math import ephem import time_util import spst_getopt # Deal with the input parameters # 1st parm should be the start time for the HST ...
#!/usr/bin/env python3 ############################################################################### # # # Copyright 2019. Triad National Security, LLC. All rights reserved. # # This program was produced under U.S. Government contrac...
# -*- coding:utf-8 -*- """ 抓取主逻辑,分三个进程:解析三级目录,抓取种子,解析详情 @version: 1.0 @author: kevin @license: Apache Licence @contact: liujiezhang@bupt.edu.cn @site: @software: PyCharm Community Edition @file: fetch.py @time: 16/11/26 下午5:21 """ import sys import getopt # from dataBase.mysql import M from mysql import M from detail...
#!/usr/bin/env python # Copyright (c) 2015 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. import codecs import copy import json import os import sys import unittest #import test_env # pylint: disable=relative-import,unu...
#!/usr/bin/python # vim: encoding=utf-8 # Generate the file lists for processing with g-ir-scanner import os import sys import re import string import subprocess import optparse def gen_jsonglib_filelist(srcroot, subdir, dest): vars = read_vars_from_AM(os.path.join(srcroot, subdir, 'Makefile.am'), ...
#!/usr/bin/env python3 __author__ = 'nick.york' __license__ = 'https://www.apache.org/licenses/LICENSE-2.0' __copyright__ = 'Copyright (c) 2015 Virtual Instruments Corporation. All rights reserved.' __date__ = '2015-02-22' __version__ = '1.0' # requires python requests module by Kenneth Reitz # http://docs.python-req...
from cgum.basic import * from cgum.utility import FNULL from pprint import pprint import cgum.statement as statement import cgum.expression as expression import cgum.preprocessor as preprocessor import cgum.typs as typs from subprocess import Popen, CalledProcessError import os.path import json import tempfile import ...
# -*- 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...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import datetime import logging import requests import werkzeug.urls from ast import literal_eval from odoo import api, release, SUPERUSER_ID from odoo.exceptions import UserError from odoo.models import AbstractModel ...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # # 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 you...
import os import versioneer from setuptools import setup, find_packages PACKAGES = find_packages() DISTNAME = 'xrft' LICENSE = 'MIT' AUTHOR = 'xrft Developers' AUTHOR_EMAIL = 'takaya@ldeo.columbia.edu' URL = 'https://github.com/xgcm/xrft' CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'License :: OSI Approv...
import re, csv header_end = re.compile("\s+START\s+END\s+") five_data_re = re.compile("\s*([\w\d]+)\s+(\d\d\/\d\d\/\d\d\d\d)\s+(.*?)\s+(\d\d\/\d\d\/\d\d\d\d)\s+(\d\d\/\d\d\/\d\d\d\d)\s*(.+?)\s+([\d\.\-\,]+)\s*\Z") five_data_missing_date = re.compile("\s*([\w\d]+)\s+(\d\d\/\d\d\/\d\d\d\d)\s+(.*?)\s{10,}(.*?)\s+([\d\...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2021 GEM Foundation # # OpenQuake 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 of the Licen...
#!/usr/bin/pythonv import sys import subprocess from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db.models import get_app, get_models class Command(BaseCommand): args = "<restore_db>" help = 'Dump data to staging database. restore_db should be either "st...
from django.urls import reverse from django.views.generic import ( CreateView, DeleteView, DetailView, ListView, UpdateView, ) from .models import ExampleModel class ExampleCreateView(CreateView): fields = [ "location", "location_lat", "location_lon", "another"...
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Douglas S. Blank <doug.blank@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 2 of the L...
import sys import urllib2 import zipfile import StringIO import datetime output_path = "hkex_options" def main(argv): if len(argv) > 1: dt = datetime.datetime.strptime(argv[1], "%Y%m%d").date() else: dt = datetime.date.today() + datetime.timedelta(days=-3) while dt < datetime.date.today(): if int(dt.strfti...
# -*- coding: utf-8 -*- # flake8: noqa from __future__ import unicode_literals, absolute_import from invoke import run, task from os.path import join, abspath, dirname ROOT = abspath(join(dirname(__file__))) def lrun(cmd, **kwargs): return run('cd {root} && {cmd}'.format(root=ROOT, cmd=cmd), **kwargs) @task ...
"""setup.py ..codeauthor:: John Lane <jlane@fanthreesixty.com> """ from setuptools import setup, find_packages from sda import __author__, __email__, __license__, __version__ setup( name='sda', version=__version__, packages=find_packages(), scripts=[], description='A wrapper for Selenium. This ...
from PyQt4.Qt import * from PyQt4.QtCore import * from PyQt4.QtGui import * from matplotlib.backends import qt4_compat from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg from matplotlib.figure import Figure #from matp...
# $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # All rights reserved. # # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions are #met: # ...
import pytest from collections import namedtuple from wait_for import wait_for from cfme.utils import os from cfme.utils.log_validator import LogValidator from cfme.utils.log import logger from cfme.utils.conf import hidden import tempfile import lxml.etree import yaml TimedCommand = namedtuple('TimedCommand', ['comma...
import numpy as np from IOHandler import loadMultipart ##### Diff between particle data, data should be stored as x column xp column y column yp firstdata = raw_input('Enter first multipart datafile name:') seconddata = raw_input('Enter second multipart datafile name:') firstmultipart = loadMultipart(firstdata) secon...
import io import os from .test_helper import patch_open from mock import ( patch, Mock, MagicMock, call ) from kiwi.utils.rpm import Rpm from kiwi.defaults import Defaults class TestRpm(object): def setup(self): self.rpm_host = Rpm() self.rpm_image = Rpm('root_dir') self.macro_file = ...
import os import sys #from helpers import modify_prm # include via file link to ../../../tests/helpers.py jobs ={} #SUCCESSFUL! jobs['master_mhd_para'] ={'exec' :'../../build_master_mhd_para/bin/fluxo', 'param':'parameter_mhd.ini'} #jobs['mortarmaster_ns_para'] ={'exec' :'../../build_mortarmaste...
# -*- coding: utf-8 -*- # Code for Life # # Copyright (C) 2016, Ocado Innovation Limited # # This program 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 of the # License, or (at your o...
#Задача №7. Вариант 17 #Программа в которой компьютер загадывает название одного из пяти космических челноков проекта Спейс шаттл, а игрок должен его угадать. #Если он угадывает,то получает баллы. Если не угадывает,то отномаются. #Шмирейчик С.В. #01.04.2016 import random SpaceShuttles=('Колумбия','Челленджер...
""" Falkonry Client Client to access Condition Prediction APIs :copyright: (c) 2016-2018 by Falkonry Inc. :license: MIT, see LICENSE for more details. """ import json class EntityMeta: """EntityMeta schema class""" def __init__(self, **kwargs): self.raw = kwargs.get('entityMeta') if 'entityMeta' i...
import os import subprocess import unittest from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException from django.contrib.st...
#!/usr/bin/env python3 import csv import sys import matplotlib.pyplot as plt from config import data_sets, fontdict try: sys.argv[1] if sys.argv[1] not in data_sets: raise IndexError except IndexError as error: keys = '\n'.join(key for key in data_sets) print(f'Data sets:\n{keys}\nPut in arg #1...
#!/usr/bin/python3 ### ### Automatic seeding over HTTP ### (C) 2016 Alex D. ### ### http://www.gnu.org/licenses/agpl-3.0.en.html ### import os import sys import json import random import platform import urllib.request sources = ['http://dalexhz1.cloudapp.net', 'http://dalexhz2.cloudapp.net', 'http://dalexhz4.clou...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2017, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must reta...
# Copyright 2016 by MPI-SWS and Data-Ken Research. # Licensed under the Apache 2.0 License. """Tests of the linq apis. Pretty much still manually verified, although running it as a part of the automated test suite makes a decent regression test. """ import asyncio import unittest from thingflow.base import * from util...
# Copyright (C) 2013 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 law ...
""" Test the sensors on the Lego NXT. Copyright (C) Sarah Mount, 2008. 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 p...
#!/usr/bin/python # -*- coding: UTF-8 -*- # # Copyright 2010 Google 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...
# ~*~ coding: utf-8 ~*~ from __future__ import unicode_literals from django.shortcuts import render from django.views.generic import RedirectView from django.core.files.storage import default_storage from django.shortcuts import reverse, redirect from django.utils.translation import ugettext as _ from django.views.gen...
########################################################################## # # Copyright (c) 2018, Image Engine Design 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: # # * Redistribu...
import pytest from pyquery import PyQuery as pq from kuma.core.urlresolvers import reverse from kuma.core.utils import to_html from kuma.wiki.models import Revision from . import make_test_file from ..models import Attachment @pytest.mark.security def test_xss_file_attachment_title(admin_client, constance_config, r...
# -*- coding: utf-8 -*- import os import time import pickle import logging import datetime import socket from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.template import RequestContext from django.http import HttpResponseForbidden from django.http import HttpRe...
import sys, os #TODO: LOOK UP CURRENT DIRECTORY # sys.argv[0] <fulldirectory>\\<this filename> in ipython does not describe this filename # so use os.getcwd # For this TEST just add both possible paths to the necessary imports # # sys.path.append( os.path.join(os.path.split(os.path.dirname(sys.argv[0]))[0],'kipa...
import piggyphoto from kivy.uix.widget import Widget from kivy.properties import StringProperty from kivy.properties import NumericProperty from kivy.properties import ListProperty, ObjectProperty from kivy.core.image import Image as CoreImage from kivy.uix.image import Image # ------------------------------...
import multiprocessing from itertools import islice from typing import ClassVar, Dict, Iterable, List, NamedTuple, Optional, Union from ..patterns import MeshPatt, Perm from ..permutils import is_finite, is_insertion_encodable, is_polynomial from .basis import Basis, MeshBasis class AvBase(NamedTuple): """A base...
""" Helper methods for push notifications from Studio. """ from django.conf import settings from logging import exception as log_exception from contentstore.tasks import push_course_update_task from contentstore.models import PushNotificationConfig from xmodule.modulestore.django import modulestore from parse_rest.in...
# 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 2014 TellApart, 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 writi...
# -*- coding: utf-8 -*- """ Instagram Competition Automation @author: RCCG pip install git+https://github.com/LevPasha/Instagram-API-python TODOs: [ ] create log, make timing dependent on log since last action was taken, log account name to allow expansion for multiple accounts later on. [ ] split on "bonus...
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI...
""" Support for myStrom switches. For more details about this component, please refer to the documentation at https://home-assistant.io/components/switch.mystrom/ """ import logging import requests from blumate.components.switch import SwitchDevice DEFAULT_NAME = 'myStrom Switch' _LOGGER = logging.getLogger(__name...
# -*- coding:utf8 -*- import re from flask import Flask from flask_sqlalchemy import SQLAlchemy as BaseSQLAlchemy from flask_sqlalchemy import _SignallingSession as BaseSignallingSession from flask_sqlalchemy import orm, partial, get_state from datetime import datetime class _BindingKeyPattern(object): def __in...
# Copyright 2013 OpenStack Foundation # # 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 ...
# Copyright 2015 Internap. # # 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, so...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models TRANSLATE_NAMES = { 'Git': ['swc/git'], 'Make': ['swc/make'], 'Matlab': ['swc/matlab'], 'Mercurial': ['swc/hg'], 'Python': ['swc/python', 'dc/python'], 'R': ['swc/r', 'dc/r'], 'Regexp':...
# file: digital.py # versi: python 2.7 # Program Jam Digital dengan Tkinter # created by Exhacking.net # update: 02/08/2012 12.13 AM # memanggil modul Tkinter from Tkinter import * # memanggil modul time (untuk mengakses waktu saat ini) import time class JamDigital: """ Kelas Jam Digital""" def __init...
""" 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 use this ...
""" Sizun MIT License (C) 2015 David Rieger """ from abc import ABCMeta from enum import IntEnum, unique from sizun.controllers.aghandler import AGHandler from sizun.controllers.pmdhandler import PMDHandler from sizun.controllers.syntaxhandler import SyntaxHandler from sizun.controllers.linegrabber import LineGrabber...
import numpy as np import glob def toa2Complex(toa, db, freq = 2.4e9): radian = toa*freq*2*np.pi return (10**(db/10.))*(np.cos(radian)+1j*np.sin(radian) ) def parseTOALog(fname, num_paths=1): with open(fname) as f: content = f.readlines() # Get rid of the first two lines (header) conten...
# -*- coding: utf-8 -*- """ Defines the unit tests for the :mod:`colour.phenomena.rayleigh` module. """ import numpy as np import unittest from itertools import permutations from colour.phenomena.rayleigh import ( air_refraction_index_Penndorf1957, air_refraction_index_Edlen1966, air_refraction_index_Peck1972...
import os import sys import threading import socket import tempfile import shutil import random import time try: # 3.x style module import urllib.request as urlopenlib except: # 2.x style module import urllib as urlopenlib import git_http_backend import cherrypy as wsgiserver import ...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing 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 # Unles...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime from dateutil.relativedelta import relativedelta from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.tools import float_compare, float_round from odoo.ad...
#! /usr/bin/python ################ # models\DB.py # ################ import logging from PyQt5.QtCore import Qt from PyQt5.QtGui import QColor from PyQt5.QtSql import QSqlRelationalTableModel, QSqlRelation, QSqlTableModel, QSqlDatabase, QSqlQuery, QSql from Dialogs import Dialogs log = logging.getLogger('DB') (TASK, W...
from flask.ext.sqlalchemy import SQLAlchemy import html2text as convert import time db = SQLAlchemy() class Email(db.Model): """ Email model Store emails going through the app in a database. """ id = db.Column(db.Integer, primary_key=True) to_email = db.Column(db.String(254)) to_name ...
from __future__ import print_function import unittest, hashlib, logging import litesockets, time from . import utils import os try: xrange(1) except: xrange=range DIRNAME = os.path.dirname(__file__) TEST_STRING = ("TEST"*100).encode('utf-8') logging.basicConfig(format="%(asctime)s - %(levelname)s - %(name)s - %...
# -*- coding: utf-8 -*- # # 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 #...
"""These tests compare filter parameters from pysynphot with the ones I have calculated myself.""" from __future__ import (print_function, absolute_import, division, unicode_literals) import os import pytest import nebulio from nebulio.tests.utils import this_func_name from nebulio.legacy import wfc3_utils from matpl...
#!/usr/bin/env python # Copyright 2015, 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 o...
### # Copyright (c) 2002-2008 Kongsberg SIM # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS...
from goscale.cms_plugins import GoscaleCMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext_lazy as _ from django.conf import settings import models GOSCALE_PRESENTATIONS_PLUGIN_TEMPLATES = getattr(settings, 'GOSCALE_PRESENTATIONS_PLUGIN_TEMPLATES', ( ('presentation.h...
""" Benchmarks for functions related to streamline Run all benchmarks with:: import dipy.tracking as dipytracking dipytracking.bench() If you have doctests enabled by default in nose (with a noserc file or environment variable), and you have a numpy version <= 1.6.1, this will also run the doctests, let's ho...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Record and manage file changes and keep track of history. Key concepts are : - events : everytime somethin is changed, we use this event - history : the whole thread of events that applies to a page For each event, a unique SHA id is created (like git https://stackove...
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 # # MDAnalysis --- http://www.mdanalysis.org # Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # ...
# -*- coding: utf-8 -*- """ *************************************************************************** ModelerParameterDefinitionDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******...
# -*- coding: utf-8 -*- import re def phrase_index(sentence, phrase): ''' Returns the start and end index of phrase (first instance) if it exists in sentence. ex: >>> phrase_index('the quick brown fox jumps over the lazy dog', 'brown fox jumps') (10, 24) ''' phrase = str...
# This file is part of Checkbox. # # Copyright 2012, 2013 Canonical Ltd. # Written by: # Zygmunt Krynicki <zygmunt.krynicki@canonical.com> # # Checkbox 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 ...
import os import sys import json import tensorflow as tf from data import DataSet, Record, datasets from data import iterator, read_tfrecord, write_tfrecord from grapher import graphers from .helper.labeling import labelings, scanline from .helper.neighborhood_assembly import neighborhood_assemblies as neighb,\ ...
# -*- coding: utf-8 -*- import functools import httplib as http from django.core.paginator import Paginator from django.db.models import QuerySet import markupsafe import pymongo from modularodm.query import QueryBase from modularodm.exceptions import NoResultsFound, MultipleResultsFound from framework.exceptions im...
#!/usr/bin/env python # -*- coding: utf-8 -*- # original author: Marko Drotschmann # changes: Arne Neumann import json import hashlib ''' # an example document for a 'celebrity' { # Alter "age": , # ausgedachtes Rating von 1.0 bis 5.0 "rating": 0.0, # Geburtstag, Format yyyy-mm-dd "birthday": "", # Vorname "firstnam...
#!/usr/bin/env python # # Copyright 2009-2021 Ghent University # # This file is part of vsc-mympirun, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Fl...
#!/usr/bin/env python # Mandelbrot set computed in parallel using python-csp. # Multiple-producer, single consumer architecture. # Copyright (C) Sarah Mount, 2009. # 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 ...
# Copyright 2017 Codethink Ltd. # # 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 writin...
from django.utils.encoding import force_text from olympia.amo.tests import TestCase, addon_factory, user_factory from olympia.amo.urlresolvers import reverse class TestFileAdmin(TestCase): def setUp(self): self.list_url = reverse('admin:files_file_changelist') def test_can_list_files_with_admin_adva...
# -*- 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 warnings from django.contrib.localflavor.ca.forms import (CAPostalCodeField, CAPhoneNumberField, CAProvinceField, CAProvinceSelect, CASocialInsuranceNumberField) from django.test import SimpleTestCase class CALocalFlavorTests(SimpleTestCase): def setUp(self): self.save_warnings_st...
import itertools import os from django.conf import settings from django.core.management import call_command from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Generates class diagrams.' def handle(self, *args, **options): if 'django_extensions' not in settings.IN...
# -*- coding: utf8 -*- import sys, os sys.path.append(os.path.abspath('.')) import re from operator import attrgetter import difflib # Pylons model init sequence import pylons.test import logging from quanthistling.config.environment import load_environment from quanthistling.model.meta import Sessi...
"""Cross-validation wrapper to be run with Spearmint. Author: Seth Axen E-mail: seth.axen@gmail.com """ import os import glob import re import logging import csv from python_utilities.scripting import setup_logging from python_utilities.io_tools import touch_dir, smart_open from python_utilities.parallel import Paral...
# Copyright 2014 Foursquare Labs Inc. All Rights Reserved. from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import os from pants.backend.core.tasks.task import Task class Validate(Task): def __init__(self, *arg...
import json import sensor import unittest from mock import Mock, patch class CalibrationTestCase(unittest.TestCase): def setUp(self): self.app = sensor.app.test_client() sensor.app.debug = True def tearDown(self): pass @patch('sensor.db') @patch('sensor.mongo') def test_...
# Classes for scrAPI Harvesters from __future__ import unicode_literals import abc import json import logging from datetime import timedelta, date from lxml import etree from scrapi import util from scrapi import requests from scrapi import registry from scrapi import settings from scrapi.base.schemas import OAISCHE...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update encrypted deploy password in Travis config file """ from __future__ import print_function import base64 import json import os from getpass import getpass import yaml from cryptography.hazmat.primitives.serialization import load_pem_public_key from cryptography.h...
# 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/. import datetime import re from elasticsearch_dsl import Search, A, F, Q from elasticsearch.exceptions import NotFoundErr...
#!/usr/bin/env python # # This skript generates the inputs and carries out the calculations # of charmm dimer interaction energies. # At the moment this skript only works for uncharged dimers # The skript assumes that both monomers are the same and # that all atoms of the two monomers appear in the same order in the ...
#Embedded file name: /Volumes/Home/development/goprodumper/emulator.py import threading import curses class emulator(threading.Thread): LEFT = 0 UP = 1 DOWN = 2 RIGHT = 3 SELECT = 4 ON = 5 OFF = 6 def __init__(self): threading.Thread.__init__(self) self.alive = threadin...