text
stringlengths
475
200k
# -*- coding: utf8 -*- # # Copyright (C) 2019 NDP Systèmes (<http://www.ndp-systemes.fr>). # # 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 # Licen...
#!/usr/bin/env python # # Multiples contactors with multiples non smooth laws # from siconos.mechanics.contact_detection.tools import Contactor from siconos.io.mechanics_io import Hdf5 # Creation of the hdf5 file for input/output with Hdf5(mode='w') as io: # Definition of two boxes shape io.addPrimitiveSha...
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2014 Stanford University and the Authors # # Authors: Robert McGibbon # Contributors: # # MDTraj is free software: y...
# $Id$ # # Copyright (C) 2004-2006 Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ unit testing code for MOE-type des...
import numpy as np from astLib import astCalc as aca # buzzard simulation cosmology aca.H0 = 70 aca.OMEGA_M0 = 0.286 aca.OMEGA_L0 = 0.714 def calcMass(vd, A1D=1082.9, alpha=0.3361): avgz = 0.0 return 1e15 / (aca.H0 * aca.Ez(avgz) / 100.) * (vd / A1D)**(1 / alpha) def calcLOSVD(M, z, A1D=1082.9, alpha=0.336...
#!/usr/bin/env python # example frame.py import pygtk pygtk.require('2.0') import gtk class FrameExample: def __init__(self): # Create a new window window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.set_title("Frame Example") # Here we connect the "destroy" event to a signal handler...
#!/usr/bin/env python # Copyright (c) 2012 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. '''Unit tests for grit.tool.android2grd''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os.path....
"""Simple XML-RPC Server. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCRequestHandler class. A list of possible usage patterns follows: 1. Install functions: server = SimpleXMLRPCServer(("localhost", ...
#!/usr/bin/python # Copyright (c) 2014 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests for package info.""" import json import os import unittest import sys sys.path.append(os.path.join(os.path.dirname(__fi...
from __future__ import absolute_import from operator import attrgetter import sys import os import shlex from six import StringIO from mock import patch from .testcases import DockerClientTestCase from compose.cli.main import TopLevelCommand from compose.project import NoSuchService class CLITestCase(DockerClientTe...
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Author: Doug Hellmann <[EMAIL]> # # 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.apach...
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import List, Tuple, TYPE_CHECKING, Optional from cura.CuraApplication import CuraApplication #To find some resource types. from cura.Settings.GlobalStack import GlobalStack from UM.PackageManager import Packag...
#! /usr/bin/env python # --*-- coding = utf-8 --*-- __author__ = 'jeff.yu' import sys sys.path.append(sys.path[0].replace('/script', '')) from base import Test from common.parser import QueryProducer import logging import logging.config from common.dataconv import conv_data class PageTest(Test): def __ini...
def _url_from_swagger_spec(path_name, path_spec): if 'parameters' not in path_spec['get']: return path_name params = [] for param_spec in path_spec['get']['parameters']: params.append('{}={}'.format(param_spec['name'], param_spec['default'])) return '{}?{}'.format(path_name, '&'.join(p...
import re import time from .connection import Urllib3HttpConnection from .connection_pool import ConnectionPool from .serializer import JSONSerializer, Deserializer, DEFAULT_SERIALIZERS from .exceptions import ConnectionError, TransportError, SerializationError # get ip/port from "inet[wind/127.0.0.1:9200]" ADDRESS_R...
# coding: utf-8 ''' The MIT License (MIT) Copyright (c) 2014 Andreas "Akki" Nitsch 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # tests/server/web_tools.py # # 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 l...
# Copyright (c) 2014 Pure Storage, 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 re...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ from erpnext.schools.utils import validate_duplicate_student class ...
import gdbm import string import os import ufido ALIAS_TYPE_NORMAL = 1 # Traditional aliase ALIAS_TYPE_MAGIC = 2 # "Magic" alias # TODO: These functions must generate an exception in case of errors def get_bool(str): str = string.lower(str) if str == 'yes' or str == 'true': return 1 elif str == 'no' or str == ...
# testing/requirements.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Global database feature support policy. Provides decorators to mark test...
# # Copyright (c) 2010-2012 Dominik Oepen # # This file is part of OpenPACE. # # OpenPACE 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 versio...
# Copyright 2016 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...
#!/usr/bin/env python # # Copyright (c) 2012-2013 # Nexa Center for Internet & Society, Politecnico di Torino (DAUIN) # Simone Basso <[EMAIL]> # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pub...
import tempfile from model_mommy import mommy from django.test import override_settings from django.urls import reverse from meupet.models import Kind, PetStatus from meupet.tests.tests import MEDIA_ROOT, MeuPetTestCase @override_settings(MEDIA_ROOT=MEDIA_ROOT) class PetRegisterTest(MeuPetTestCase): @staticmet...
# -*- encoding: utf-8 -*- # This file is part of ranger, the console file manager. # License: GNU GPL version 3, see the file "AUTHORS" for details. from __future__ import (absolute_import, division, print_function) import sys from unicodedata import east_asian_width from ranger import PY3 ASCIIONLY = set(chr(c) fo...
# 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 u...
# -*- coding: utf-8 -*- import anki.stdmodels from anki.hooks import addHook from aqt import mw import sqlite3 nomecab=False try: from japanese.reading import mecab except: nomecab=True def addJpGrammarModel(col): models = col.models km = models.new(_("JP Grammar")) f = models.newField(_("Text"))...
"""Custom context processors for Omuni""" from django.conf import settings from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from openbudgets.apps.accounts.forms import CustomAuthenticationForm, \ CustomRegistrationForm, CustomPasswordResetForm, CustomPasswordChang...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2004-2019 Edgewall Software # Copyright (C) 2004 Dmitry Yusupov <[EMAIL]> # Copyright (C) 2004 Mark Rowe <[EMAIL]> # Copyright (C) 2005 Bill Soudan <[EMAIL]> # Copyright (C) 2005 Florent Guillaume <[EMAIL]> # Copyright (C) 2005 Jeroen Ruigrok van der Werve...
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Michael A.G. Aivazis # California Institute of Technology # (C) 1998-2005 All Rights Reserved # # <LicenseText> # # ~~~~~~~~~~...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
""" Models for User Information (students, staff, etc) Migration Notes If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py lms schemamigration student --auto description_of_...
import sark from dumper_helper import dump_attrs import itertools def main(): print('Bytes') print(list(itertools.islice(sark.data.Bytes(), 10))) print() print('Bytes Until 0') print(list(sark.data.bytes_until())) print() print('Words') print(list(itertools.islice(sark.data.Words()...
#!/usr/bin/env python # vispy: gallery 30 # ----------------------------------------------------------------------------- # 2014, Aurore Deschildre, Gael Goret, Cyrille Rossant, Nicolas P. Rougier. # Distributed under the terms of the new BSD License. # ------------------------------------------------------------------...
# -*- coding: utf-8 -*- """ *************************************************************************** ExtentFromLayer.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***********************...
from __future__ import print_function import os import shutil import conda_build.build as build_module from conda_build.metadata import MetaData import conda_build.config from conda.lock import Locked from conda_build.build import bldpkg_path import binstar_client from binstar_client.utils.detect import detect_packag...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import absolute_import import os from .info import (LONG_DESCRIPTION as __doc__, URL as __url__, STATUS as __status__, __version__)...
# Copyright (C) 2014 VA Linux Systems Japan K.K. # # 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 appl...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # Copyright (C) 2010 Nick Hall # # 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 v...
"""Download flags of top 20 countries by population asyncio + aiottp version Sample run:: $ python3 flags_asyncio.py EG VN IN TR RU ID US DE CN MX JP BD NG ET FR BR PH PK CD IR 20 flags downloaded in 1.07s """ # BEGIN FLAGS_ASYNCIO import asyncio import aiohttp # <1> from concurrency_futures.flags im...
import matplotlib.pyplot as plt import numpy as np from scipy.linalg import cho_factor, cho_solve from psoap import constants as C from psoap.data import lkca14, redshift from psoap import covariance # Optimized parameters for this chunk. Not that relevant though, since we are just using the GP # as an interpolator....
import logging import threading import cupy from ray.util.collective.collective_group import nccl_util from ray.util.collective.const import ENV NCCL_STREAM_POOL_SIZE = 32 MAX_GPU_PER_ACTOR = 16 logger = logging.getLogger(__name__) class StreamPool: """The class that represents a stream pool associated with a ...
#!/usr/bin/python # Gitian Downloader - download/update and verify a gitian distribution package # 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 Lic...
"""SCons.Tool.c++ Tool-specific initialization for generic Posix C++ compilers. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons...
from os.path import join, dirname, abspath import os class Settings(object): _prefix = "BOKEH_" debugjs = False @property def _environ(self): return os.environ def _get_str(self, key, default): return self._environ.get(self._prefix + key, default) def _get_bool(self, key, defa...
# -*- coding: utf-8 -*- # # This file is part of HEPData. # Copyright (C) 2016 CERN. # # HEPData 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...
# Copyright 2021, The TensorFlow Federated 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...
import os import re import logging from autotest.client.shared import error from autotest.client import utils from virttest import utils_misc from virttest import funcatexit from virttest import utils_test from virttest import data_dir from virttest.staging import utils_memory from generic.tests import autotest_cont...
from django.contrib import admin from models import * from django.db.models import get_model from reversion.admin import VersionAdmin from seamoss.forms import PageForm try: tinymce = models.get_app('tinymce') except ImproperlyConfigured: tinymce = False class PageAdmin(VersionAdmin): ordering = ('title',...
################################################################################ # Copyright (C) 2013-2014 Jaakko Luttinen # # This file is licensed under the MIT License. ################################################################################ """ Unit tests for `dot` module. """ import warnings warnings.si...
"""Remove agreement_returned_at, countersigned_at and agreement_details columns from supplier_framework table as they are no longer used Revision ID: 780 Revises: 770 Create Date: 2016-11-07 10:14:00.000000 """ # revision identifiers, used by Alembic. revision = '780' down_revision = '770' from alembic import op...
import datetime import itertools import logging import requests from zeit.cms.i18n import MessageFactory as _ import grokcore.component as grok import lxml.objectify import zeit.cms.content.dav import zeit.cms.content.xmlsupport import zeit.cms.interfaces import zeit.cms.type import zeit.content.cp.interfaces import ze...
# (c) 2015, Jan-Piet Mens <jpmens(at)gmail.com> # # This file is part of Ansible # # Ansible 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 ver...
import sys from pathlib import Path import molflow module_path = Path(molflow.__file__).parents[0] testpath = Path(__file__).parents[0] pdbfile_path = testpath / 'data' / '3AID.pdb' twofile_path = testpath / 'data' / 'two.txt' if sys.version_info.major == 3: from contextlib import redirect_stdout else: asse...
#!/usr/bin/python3 # -*- coding: utf-8 -*- ''' A translation function for TIGER 2012 counties ''' def filterTags(attrs): if not attrs: return tags = {} ''' print type(u'Lokalvej-Primær') print attrs['vejklasse_'] print type(attrs['vejklasse_']) ''' tags['name'] = attrs['ogr_fid...
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Eucalyptus Systems, Inc. # 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 ...
""" this is the module for the schedule implementation """ import urllib.request import logging from course import Course logger = logging.getLogger() def printShifts(shift=None): """ print shifts """ counter = 0 if shift is None: return for classtype in shift: for key in classtype.key...
# Configure Postman for testing or production import os import os.path, time import string import json import shutil import PIL from optparse import OptionParser from datetime import datetime from jinja2 import Environment, PackageLoader, Template def generate_config_file(is_testing, web_url): config_template = open(...
# stdlib from xml.etree import ElementTree # third party import requests # project from checks import AgentCheck QUEUE_URL = "/admin/xml/queues.jsp" TOPIC_URL = "/admin/xml/topics.jsp" SUBSCRIBER_URL = "/admin/xml/subscribers.jsp" TOPIC_QUEUE_METRICS = { "consumerCount": "consumer_count", "dequeueCount": "d...
# -*- coding: utf-8 -*- from castle.cms.testing import BaseTest from plone.namedfile.file import NamedBlobImage from plone.namedfile.tests.test_image import zptlogo from Products.CMFPlone.browser.syndication.settings import FeedSettings import json class TestSyndication(BaseTest): def _get_image(self): ...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:26197") else: access = Se...
from windrose import WindroseAxes from matplotlib import pyplot as plt import matplotlib.cm as cm from numpy.random import random from numpy import arange #Create wind speed and direction variables ws = random(500)*6 wd = random(500)*360 def new_axes(): fig = plt.figure(figsize=(8, 8), dpi=80, facecolor='w', edge...
import os import re import unittest from collections import OrderedDict from coalib.settings.Setting import ( Setting, path, path_list, url, typed_dict, typed_list, typed_ordered_dict, glob, glob_list) from coalib.parsing.Globbing import glob_escape class SettingTest(unittest.TestCase): def test_constru...
########################################################################## # # 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: # # * Redistrib...
# -*- coding: utf-8 -*- # # This file is part of CERN CodeSync for ServiceNow. # Copyright (C) 2010 - 2015 European Organization for Nuclear Research (CERN). # # CERN CodeSync for ServiceNow is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by ...
""" Test for checking spuriousness of observers works """ import _importer from gtkmvc3 import Model, Observer import unittest # ---------------------------------------------------------------------- class MyModel (Model): prop1 = 0 prop2 = 0 __observables__ = ("prop[12]", ) pass # end of class # ---...
""" mediatum - a multimedia content repository Copyright (C) 2007 Arne Seifert <[EMAIL]> Copyright (C) 2007 Matthias Kramm <[EMAIL]> Copyright (C) 2011 Peter Heckl <[EMAIL]> 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 ...
''' Created on Jun 12, 2012 @author: Felix ''' Rmin = -1 Record = None def importModules(recordModule): import LeafSparseADTree LeafSparseADTree.Record = __import__(recordModule) class ADNode(object): ''' The value of attribute this ADN is represented as the index of this ADN in its parent VN's child...
# -*- 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 # -*- coding: utf-8 -*- """ @author: Dr Ekaterina Abramova, 2017 Root Searching Algorithms """ # ----------------------------------------------------------------------------- # -------------------- Bisection: find square root ---------------------------- def Bisection1(S): """ Parameters:...
from flask import request, redirect, url_for from flask.ext.cors import cross_origin from apps.remote import remote from apps import login_required from apps import database from apps.users.db import User from apps import Sessions import db sessions = Sessions() user = User(database) remoteDb = db.Remote(database) ...
# -*- coding: utf-8 -*- # <nbformat>2</nbformat> # <codecell> # Demo python notebook for sklearn elm and random_hidden_layer modules # # Author: David C. Lambert [dcl -at- panix -dot- com] # Copyright(c) 2013 # License: Simple BSD # <codecell> from time import time from sklearn.cluster import k_means from elm impo...
''' @author: frank ''' import sys, os, os.path from zstacklib.utils import log from zstacklib.utils import linux import zstacklib.utils.iptables as iptables pidfile = '/var/run/zstack/ceph-backupstorage.pid' log.configure_log('/var/log/zstack/ceph-backupstorage.log') logger = log.get_logger(__name__) import cephagent...
# -*- coding: utf-8 -*- # # Copyright 2015-2020 BigML # # 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 2008 Owen Taylor # Copyright 2008 Kai Willadsen # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import copy import ins...
""" Django settings for django_magic_login project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """...
from __future__ import unicode_literals from oauthlib import oauth2 from oauthlib.common import urlencode, urlencoded, quote from .exceptions import OAuthToolkitError, FatalClientError from .settings import oauth2_settings from .compat import urlparse, urlunparse class OAuthLibCore(object): """ TODO: add do...
import _base from html5lib.constants import voidElements from xml.sax.saxutils import escape # Really crappy basic implementation of a DOM-core like thing class Node(_base.Node): type = -1 def __init__(self, name): self.name = name self.parent = None self.value = None self.child...
# -*- coding: utf-8 -*- import time import unittest from convertdate import french_republican as fr from convertdate import gregorian year_starts = [ ((1, 1, 1), (1792, 9, 22)), ((2, 1, 1), (1793, 9, 22)), ((3, 1, 1), (1794, 9, 22)), ((4, 1, 1), (1795, 9, 23)), ((5, 1, 1), (1796, 9, 22)), ((6,...
# Copyright 2015 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.0 # # Unless required by applicable law or a...
from django.shortcuts import render, render_to_response, redirect from django.template.loader import render_to_string from django.http import HttpResponseRedirect, HttpResponse from django.views.decorators.csrf import csrf_protect from django.contrib.auth.decorators import login_required from django.conf import setting...
import os from mock import patch from unittest import TestCase from zulint.custom_rules import RuleList from linter_lib.custom_check import python_rules, non_py_rules ROOT_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..')) CHECK_MESSAGE = "Fix the corresponding rule in `tools/linter_lib/custom_check.py`...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
#!/usr/bin/python # (c) 2017, Abhijeet Kasurde <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['pr...
#!/usr/bin/env python """ Examples:: $ python geet.py no command given $ python geet.py leet unknown command 'leet' $ python geet.py --help geet v1.7.2 The l33t version control Usage: geet.py [SWITCHES] [SUBCOMMAND [SWITCHES]] args... Meta-switches: -h, --help...
import datetime import os import subprocess import sys def duration(t1, t2): d = t2 - t1 return 86400 * d.days + d.seconds + 1e-6 * d.microseconds class Run: def __init__(self): self.__cwd = None self.__log = [] def __logfile(self, cmd): fn = os.path.join(os.getcwd(), '%04d....
# -*- coding: utf-8 -*- """OS tools """ import os import shlex from subprocess import PIPE, STDOUT, Popen, call import psutil class Process: """OS process""" def __init__(self, cmd): """ :param cmd: Command to execute """ self.cmd = cmd def get_simple_output(self, stde...
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytz import pytest from datetime import timedelta, datetime from distutils.version import LooseVersion from numpy import nan import numpy as np import pandas as pd from pandas import (Series, DataFrame, isna, date_range, MultiIndex, Index, ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('rest_notifications', '0006_auto_20141027_1906'), ] operations = [ migrations.AlterField( model_name='notificatio...
import cStringIO import json import unicodecsv as ucsv import uuid from celery import task from celery import current_task from celery.result import AsyncResult from collections import defaultdict from copy import deepcopy from datetime import datetime from django.contrib.auth.models import User from onadata.libs.uti...
# 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 agreed to in writing, ...
#!/usr/bin/env python import random import re import sys from gutenberg import GutenbergCleaner try: from tqdm import tqdm except ImportError: def tqdm(x): return x DEBUG = False def main(argv): filenames = argv[1:] words = [] for filename in filenames: with open(filename, '...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
# -*- coding: utf-8 -*- from datetime import timedelta from django.utils import timezone import pytest from .utils import versioned_reverse as reverse from events.tests.utils import assert_event_data_is_equal from events.tests.test_event_post import create_with_post from .conftest import DATETIME from events.models i...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2008 Jerome Rapinat # Copyright (C) 2008 Benny Malengier # # 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 Fre...
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui class ComboBox(QtGui.QComboBox): """Extends QComboBox with some extra functionality: - remembers argument to setValue, restores correct selection after contents have been cleared/repopulated """ def __init__(self, *args): QtGui.QComboBox....
from . import ast from .. import types, tool, codegen from ..tool import extends, debug_func import llvmlite.ir as ir @extends(ast.Lit) @debug_func('lit') def codegen(self, state): node_type = state.node_type(self) if node_type is types.unit: return None elif node_type is types.string: ...
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/tools/docco/t_parse.py """ Template parsing module inspired by REXX (with thanks to Donn Cave for discussion). Template initialization has the form: ...
#!/usr/bin/python import tkinter from tkinter import ttk import serial import serial.tools.list_ports import threading import time from take4 import TakeDialog class simpleapp_tk(tkinter.Tk): def __init__(self,parent): tkinter.Tk.__init__(self,parent) self.parent = parent self.initializ...