repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
fr0uty/oartm
oar/kao/advanced_job_sorting.py
1
1242
# coding: utf-8 """Collection of Job Sorting functions to provide priority policies """ from __future__ import unicode_literals, print_function from oar.lib.compat import itervalues from oar.lib import (get_logger, config) import json logger = get_logger("oar.kamelot") def job_sorting_simple_priority(queue, now, jid...
bsd-3-clause
scztt/supercollider
external_libraries/simplejson-2.3.2/decoder.py
44
15128
"""Implementation of JSONDecoder """ import re import sys import struct from .scanner import make_scanner def _import_c_scanstring(): try: from ._speedups import scanstring return scanstring except ImportError: return None c_scanstring = _import_c_scanstring() __all__ = ['JSONDecoder']...
gpl-3.0
vaygr/ansible
lib/ansible/modules/files/replace.py
23
9656
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Evan Kaufman <evan@digitalflophouse.com # Copyright: (c) 2017, Ansible Project # 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__ = ...
gpl-3.0
bh107/bohrium
test/python/tests/test_reorganization.py
2
5152
import util import functools import operator class test_gather: def init(self): for ary, shape in util.gen_random_arrays("R", 3, max_dim=50, dtype="np.float64"): nelem = functools.reduce(operator.mul, shape) if nelem == 0: continue cmd = "R = bh.random.R...
apache-2.0
cmeessen/fatiando
gallery/seismic/convolutional_model.py
6
1804
r""" Synthetic seismograms using the convolutional model --------------------------------------------------- The simplest way to get a seismogram (in time x offset) is through the convolutional model .. math:: trace(t) = wavelet(t) \ast reflectivity(t) Module :mod:`fatiando.seismic.conv` defines functions for d...
bsd-3-clause
gautamMalu/rootfs_xen_arndale
usr/lib/python2.7/curses/__init__.py
108
1817
"""curses The main package for curses support for Python. Normally used by importing the package, and perhaps a particular module inside it. import curses from curses import textpad curses.initscr() ... """ __revision__ = "$Id$" from _curses import * from curses.wrapper import wrapper import os as _os...
gpl-2.0
aral/isvat
django/db/backends/postgresql_psycopg2/creation.py
107
4139
import psycopg2.extensions from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can conta...
mit
wemanuel/smry
server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/retry-decorator/retry_decorator/retry_decorator.py
36
1190
#!/usr/bin/env python from __future__ import print_function import traceback import logging import time import random import sys def retry(ExceptionToCheck, tries=10, timeout_secs=1.0, logger=None): """ Retry calling the decorated function using an exponential backoff. """ def deco_retry(f): ...
apache-2.0
hudl/redash
redash/handlers/query_snippets.py
11
2342
from flask import request from funcy import project from redash import models from redash.permissions import require_admin_or_owner from redash.handlers.base import (BaseResource, require_fields, get_object_or_404) class QuerySnippetResource(BaseResource): def get(self, snippet_...
bsd-2-clause
HybridF5/jacket
jacket/common/config.py
1
9934
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2012 Red Hat, Inc. # Copyright 2013 NTT corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file exc...
apache-2.0
leomorsy/medical8.0
oemedical_his/__init__.py
10
1141
# -*- coding: utf-8 -*- #/############################################################################# # # Tech-Receptives Solutions Pvt. Ltd. # Copyright (C) 2004-TODAY Tech-Receptives(<http://www.techreceptives.com>) # Special Credit and Thanks to Thymbra Latinoamericana S.A. # # This program is free sof...
agpl-3.0
abhi11/dak
dak/dakdb/update26.py
6
2982
#!/usr/bin/env python """ Add created,modified columns for all tables. @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2009 Barry deFreese <bdefreese@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it and/or modify # it und...
gpl-2.0
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_largefile.py
58
6626
"""Test largefile support on system where this makes sense. """ import os import stat import sys import unittest from test.test_support import run_unittest, TESTFN, verbose, requires, \ TestSkipped, unlink try: import signal # The default handler for SIGXFSZ is to abort the proce...
apache-2.0
Yusa95/numpy
numpy/core/tests/test_nditer.py
85
103653
from __future__ import division, absolute_import, print_function import sys import warnings import numpy as np from numpy import array, arange, nditer, all from numpy.compat import asbytes, sixu from numpy.core.multiarray_tests import test_nditer_too_large from numpy.testing import ( run_module_suite, assert_, as...
bsd-3-clause
Just-D/chromium-1
tools/telemetry/third_party/gsutilz/third_party/boto/tests/integration/gs/test_basic.py
107
17895
# -*- coding: utf-8 -*- # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # Copyright (c) 2011, Nexenta Systems, Inc. # Copyright (c) 2012, Google, Inc. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of t...
bsd-3-clause
scenarios/tensorflow
tensorflow/contrib/legacy_seq2seq/__init__.py
165
2433
# 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...
apache-2.0
cliffano/swaggy-jenkins
clients/python-flask/generated/openapi_server/models/pipeline_activities.py
1
1034
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from openapi_server.models.base_model_ import Model from openapi_server.models.pipeline_activity import PipelineActivity # noqa: F401,E501 from openapi_server import u...
mit
sudosurootdev/linux
scripts/gdb/linux/symbols.py
367
6324
# # gdb helper commands and functions for Linux kernel debugging # # load kernel and module symbols # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb import os import re import string from linux...
gpl-2.0
gri-is/lodjob
crom_scripts/deprecated/actor_automatic.py
1
5251
import os from cromulent.model import * # imports models from cromulent.vocab import * # imports model subcomponents def props(o): return o._list_all_props() def toJSON(o): return o._toJSON() def toString(o): return factory.toString(o, compact=False) #ulan_json_file = '/Users/nlomeli/Desktop/vocabs_du...
agpl-3.0
amohanta/CapTipper
jsbeautifier/unpackers/myobfuscate.py
175
2832
# # deobfuscator for scripts messed up with myobfuscate.com # by Einar Lielmanis <einar@jsbeautifier.org> # # written by Stefano Sanfilippo <a.little.coder@gmail.com> # # usage: # # if detect(some_string): # unpacked = unpack(some_string) # # CAVEAT by Einar Lielmanis # # You really don't want to obfuscate yo...
gpl-3.0
rudhir-upretee/Sumo17_With_Netsim
tools/net/OrderedMultiSet.py
4
2901
#!/usr/bin/env python """ @file netdiff.py @author Jakob Erdmann @date 2011-10-04 @version $Id: OrderedMultiSet.py 11571 2011-12-01 09:06:35Z bieker $ multi set with insertion-order iteration based on OrderedSet by Raymond Hettinger (c) , MIT-License [http://code.activestate.com/recipes/576694/] SUMO, Simulati...
gpl-3.0
RainerSchulz/HomeWatch
node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_sln.py
1831
5099
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
mit
AIML/scikit-learn
examples/ensemble/plot_gradient_boosting_regression.py
227
2520
""" ============================ Gradient Boosting regression ============================ Demonstrate Gradient Boosting on the Boston housing dataset. This example fits a Gradient Boosting model with least squares loss and 500 regression trees of depth 4. """ print(__doc__) # Author: Peter Prettenhofer <peter.prett...
bsd-3-clause
alistairlow/tensorflow
tensorflow/contrib/session_bundle/session_bundle_test.py
133
7571
# 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...
apache-2.0
kingmotley/SickRage
lib/oauth2/__init__.py
45
23521
""" The MIT License Copyright (c) 2007 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 right...
gpl-3.0
sharhar/USB-Thing
UpdaterFiles/Lib/python-3.5.1.amd64/Lib/site-packages/pip/_vendor/__init__.py
252
2508
""" pip._vendor is for vendoring dependencies of pip to prevent needing pip to depend on something external. Files inside of pip._vendor should be considered immutable and should only be updated to versions from upstream. """ from __future__ import absolute_import import glob import os.path import sys # Downstream r...
apache-2.0
pasqualguerrero/django
django/db/models/query.py
25
67826
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import sys import warnings from collections import OrderedDict, deque from django.conf import settings from django.core import exceptions from django.db import ( DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ...
bsd-3-clause
whelan957/leetcode
python3/Tree/leetcode1448. Count Good Nodes in Binary Tree.py
1
1535
# Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X. # Return the number of good nodes in the binary tree. # Example 1: # Input: root = [3,1,4,3,null,1,5] # Output: 4 # Explanation: Nodes in blue are good. # Root Node (3) is ...
gpl-3.0
monikasulik/django-oscar
src/oscar/apps/dashboard/users/app.py
49
1734
from django.conf.urls import url from oscar.core.application import Application from oscar.core.loading import get_class class UserManagementApplication(Application): name = None default_permissions = ['is_staff', ] index_view = get_class('dashboard.users.views', 'IndexView') user_detail_view = get_...
bsd-3-clause
OmgOhnoes/Flexget
flexget/plugins/cli/explain_sql.py
9
1761
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging from time import time from argparse import SUPPRESS from sqlalchemy.orm.query import Query from sqlalchemy.ext.compiler import compiles from sqlalchemy.sql....
mit
eugene-eeo/mailthon
tests/test_enclosure.py
1
3458
# coding=utf8 from pytest import fixture from mailthon.enclosure import PlainText, HTML, Binary, Attachment, Collection from .mimetest import mimetest from .utils import unicode fixture = fixture(scope='class') class TestCollection: @fixture def mime(self): coll = Collection( PlainText('...
mit
sburns/PyCap
test/test_request.py
2
2263
#!/usr/bin/env python # -*- coding: utf-8 -*- """Test low level API interface""" import unittest import responses from redcap import RCRequest, RCAPIError class TestClass(unittest.TestCase): """ Testing RCRequest """ def setUp(self): """ We can use Kenneth Reitz's httpbin.org to test requests """ ...
mit
simbha/mAngE-Gin
lib/Django 1.7/django/conf/locale/ko/formats.py
115
2320
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y년 n월 j일' TIME_FORMAT = 'A g:i' D...
mit
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/opus_gui/data_manager/run/tools/opus_data_to_esri.py
2
2317
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE import os, sys from opus_core.export_storage import ExportStorage esri_is_avail = False try: from opus_core.store.esri_storage import esri_storage esri_is_avail = True except ImportError: p...
gpl-2.0
old8xp/gyp_from_google
test/make_global_settings/ar/gyptest-make_global_settings_ar.py
67
3740
#!/usr/bin/env python # Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies 'AR' in make_global_settings. """ import os import sys import TestGyp def resolve_path(test, path): if path is None: re...
bsd-3-clause
puiterwijk/product-definition-center
pdc/apps/common/hacks.py
1
3525
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # import re from django.db import connection from django.conf import settings from django.core.exceptions import ValidationError from rest_framework import serializers from productmd impo...
mit
MridulS/sympy
sympy/mpmath/libmp/libintmath.py
24
16462
""" Utility functions for integer math. TODO: rename, cleanup, perhaps move the gmpy wrapper code here from settings.py """ import math from bisect import bisect from .backend import xrange from .backend import BACKEND, gmpy, sage, sage_utils, MPZ, MPZ_ONE, MPZ_ZERO def giant_steps(start, target, n=2): """ ...
bsd-3-clause
ahu-odoo/odoo
addons/hr_timesheet_sheet/res_config.py
389
2324
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
jkonecki/autorest
AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/models/error.py
50
1295
# 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 ...
mit
jrechandi/sundahipP
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, distrib...
mit
quxiaolong1504/dpark
dpark/util.py
6
1938
# util import types from zlib import compress as _compress, decompress import threading import warnings import errno try: from dpark.portable_hash import portable_hash as _hash except ImportError: import pyximport pyximport.install(inplace=True) from dpark.portable_hash import portable_hash as _hash tr...
bsd-3-clause
2uller/LotF
App/Lib/ssl.py
5
16637
# Wrapper module for _ssl, providing some additional facilities # implemented in Python. Written by Bill Janssen. """\ This module provides some more Pythonic support for SSL. Object types: SSLSocket -- subtype of socket.socket which does SSL over the socket Exceptions: SSLError -- exception raise...
gpl-2.0
isht3/zulip
zerver/lib/email_mirror.py
1
12948
from __future__ import absolute_import from typing import Any, Optional, Text import logging import re from email.header import decode_header import email.message as message from django.conf import settings from zerver.lib.actions import decode_email_address, get_email_gateway_message_string_from_address, \ int...
apache-2.0
sergeysynergy/graph
django/zcore/tmp.py
1
12955
# -*- coding: utf-8 -*- # Для тестовых целей: создание проекции данных с ограниченным числом узлов def json_semantic(request): G = nx.Graph() # Cоздаём пустой NetworkX-граф # Создаём объект типа cusros, который позволяет нам подключиться и работаться с базой данных, # содержащей данные многомерной матриц...
mit
ufaks/pos-addons
product_barcode_generator/res_company.py
11
1296
# -*- coding: utf-8 -*- ################################################################################# # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Julius Network Solutions SARL <contact@julius.fr> # # This program is free software: you can redistribute it and/or modify # it under th...
lgpl-3.0
jianglu/mojo
testing/scripts/nacl_integration.py
75
1121
#!/usr/bin/env python # Copyright 2014 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 json import os import sys import common def main_run(args): filter_tests = [] if args.filter_file: filter_tests = js...
bsd-3-clause
aricchen/openHR
openerp/addons/base/res/res_lang.py
34
14785
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
ShortMap/ShortMap
src/contrib/hod/testing/testHodRing.py
118
4351
#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 thi...
apache-2.0
pravsripad/mne-python
mne/inverse_sparse/tests/test_mxne_inverse.py
8
14714
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # # License: Simplified BSD import os.path as op import numpy as np from numpy.testing import (assert_array_almost_equal, assert_allclose, assert_array_less) import pytest...
bsd-3-clause
jorsea/odoomrp-wip
mrp_packaging/models/mrp_production.py
11
9890
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import api, fields, models, exceptions, _ f...
agpl-3.0
ihsanudin/odoo
addons/hr_payroll/res_config.py
441
1294
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
diegoguimaraes/django
django/contrib/auth/management/__init__.py
66
6462
""" Creates permissions for all installed apps that need permissions. """ from __future__ import unicode_literals import getpass import unicodedata from django.apps import apps from django.contrib.auth import models as auth_app, get_permission_codename from django.core import exceptions from django.core.management.ba...
bsd-3-clause
beni55/Minecraft
timer.py
4
2022
# Imports, sorted alphabetically. # Python packages # Nothing for now... # Third-party packages # Nothing for now... # Modules from this project # Nothing for now... import threading import time __all__ = ( 'TimerTask', 'Timer', ) class TimerTask(object): def __init__(self, ticks, callback, speed): ...
mit
krafczyk/spack
var/spack/repos/builtin.mock/packages/dtrun1/package.py
5
1601
############################################################################## # Copyright (c) 2013-2018, 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...
lgpl-2.1
sergecodd/FireFox-OS
B2G/build/tools/findleaves.py
5
2723
#!/usr/bin/env python # # Copyright (C) 2009 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 req...
apache-2.0
Jakob37/HarshTerminalTypingPractice
modules/database/database_interface.py
1
6033
import sqlite3 import harty_config from modules.utils import date_utils from modules.practice.run_status import RunStatus ENTRY_TABLE = 'type_entries' ENTRY_FIELDS = [('entry_id', 'INTEGER PRIMARY KEY'), ('date_stamp', 'TEXT'), ('time_stamp', 'TEXT'), ('typed_characte...
gpl-3.0
grahamgilbert/Crypt-Server
functional_tests/test_simple_site_functionality.py
1
4982
import time from .base import FunctionalTest from selenium.webdriver.common.keys import Keys class LoginAndBasicFunctionality(FunctionalTest): def test_admin_can_create_and_browse(self): # Admin goes to fv2 key mgmt site, sees it's named Crypt post-redirect to a login self.browser.get(self.live_se...
apache-2.0
brandond/ansible
lib/ansible/plugins/lookup/aws_secret.py
2
5007
# Copyright: (c) 2018, Aaron Smith <ajsmith10381@gmail.com> # 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 DOCUMENTATION = r""" lookup: aws_secret author: - Aaron Smith <ajsmith10381...
gpl-3.0
dcosentino/edx-platform
common/djangoapps/student/migrations/0020_add_test_center_user.py
188
15924
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TestCenterUser' db.create_table('student_testcenteruser', ( ('id', self.gf('djan...
agpl-3.0
lumig242/Hue-Integration-with-CDAP
desktop/core/setup.py
40
1536
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
apache-2.0
sputnick-dev/weboob
modules/vine/test.py
4
1158
# -*- coding: utf-8 -*- # Copyright(C) 2015 P4ncake # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your optio...
agpl-3.0
ollej/shoutbridge
src/plugins/TwitterPlugin.py
1
7094
# -*- coding: utf-8 -*- """ The MIT License Copyright (c) 2010 Olle Johansson 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,...
mit
freeflightsim/ffs-app-engine
google_appengine/lib/django/django/db/backends/oracle/base.py
32
5075
""" Oracle database backend for Django. Requires cx_Oracle: http://www.python.net/crew/atuining/cx_Oracle/ """ from django.db.backends import util try: import cx_Oracle as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured, "Error loading cx_...
gpl-2.0
palashahuja/myhdl
myhdl/conversion/_analyze.py
1
47160
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2013 Jan Decaluwe # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published by t...
lgpl-2.1
zxl200406/minos
supervisor/supervisor/tests/test_xmlrpc.py
5
15389
import sys import unittest from supervisor.tests.base import DummySupervisor from supervisor.tests.base import DummyRequest from supervisor.tests.base import DummySupervisorRPCNamespace class XMLRPCMarshallingTests(unittest.TestCase): def test_xmlrpc_marshal(self): import xmlrpclib from supervisor...
apache-2.0
lovelylain/pyctp
example/pyctp2/trader/environ.py
7
14281
# -*- coding:utf-8 -*- ''' 基础框架数据结构 在此层次之上, 为策略组织层 对于交易节的处理 比如在8:59-9:00, 10:15-10:30, 11:30-13:30的间断时间, 通过延迟发送的方式来处理 并订阅tick时间驱动的事件 ''' import logging import threading import time import collections from random import randint from functools import reduce from ..common.base import (LONG,...
mit
saleemjaveds/https-github.com-openstack-nova
nova/tests/virt/libvirt/test_driver.py
1
509266
# Copyright 2010 OpenStack Foundation # Copyright 2012 University Of Minho # # 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....
apache-2.0
arunkgupta/gramps
gramps/gui/filters/sidebar/_sidebarfilter.py
1
9378
# # 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...
gpl-2.0
nickbanana/chatbot-backend
Chatbot/RuleMatcher/rulebase.py
1
7905
# -*- coding: utf-8 -*- import os import json from gensim.models import word2vec from gensim import models class Rule(object): """ Store the concept terms of a rule, and calculate the rule similarity. """ def __init__(self, domain, rule_terms, children, response, word2vec_model): self.id_ter...
gpl-3.0
sigmavirus24/pip
tests/unit/test_vcs.py
5
4697
import pytest from tests.lib import pyversion from pip.vcs import VersionControl from pip.vcs.bazaar import Bazaar from pip.vcs.git import Git from pip.vcs.subversion import Subversion from mock import Mock from pip._vendor.packaging.version import parse as parse_version if pyversion >= '3': VERBOSE_FALSE = False ...
mit
40223234/w16b_test
static/Brython3.1.3-20150514-095342/Lib/unittest/runner.py
637
7485
"""Running tests""" import sys import time import warnings from . import result from .signals import registerResult __unittest = True class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'writeln' method""" def __init__(self,stream): self.stream = stream def __ge...
agpl-3.0
zzz14/LOST-FOUND
codex/baseview.py
7
2588
# -*- coding: utf-8 -*- # import json import logging from django.http import HttpResponse from django.views.generic import View from codex.baseerror import BaseError, InputError __author__ = "Epsirom" class BaseView(View): logger = logging.getLogger('View') def dispatch(self, request, *args, **kwargs): ...
gpl-3.0
djkonro/client-python
kubernetes/client/models/v1_flex_volume_source.py
2
6932
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
xuweiliang/Codelibrary
nova/common/config.py
14
1763
# Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. # # 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 b...
apache-2.0
fengz10/ICN_SCM
resultsPlot/plotCostCacheRatio.py
1
5727
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt ratio = np.arange(0, 1.01, 0.05) # Data from AS 7018 # Other inputs are: main(7018, ratio, 3, 0.7, 0) #cost7018Algo0= [0.32816886868289885, 0.2208175601847247, 0.19251093813725606, 0.19213511824943674, 0.13080090885015863, 0.11537045883303, 0.0963...
gpl-2.0
danieldanciu/schoggi
models/content.py
22
21971
# Copyright 2013 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 ...
apache-2.0
svenstaro/ansible
lib/ansible/plugins/connection/iocage.py
67
2395
# based on jail.py (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2016, Stephan Lohse <dev-github@ploek.org> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU Ge...
gpl-3.0
xzturn/tensorflow
tensorflow/compiler/mlir/runlit.cfg.py
2
2963
# Copyright 2019 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...
apache-2.0
projectchrono/chrono
src/demos/python/vehicle/demo_VEH_HMMWV_circle.py
3
5030
# ============================================================================= # PROJECT CHRONO - http:#projectchrono.org # # Copyright (c) 2014 projectchrono.org # All rights reserved. # # Use of this source code is governed by a BSD-style license that can be found # in the LICENSE file at the top level of the distri...
bsd-3-clause
jsayol/vpngate-gtk
vpngate_gtk_lib/Builder.py
1
10802
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # This file is in the public domain ### END LICENSE ### DO NOT EDIT THIS FILE ### '''Enhances builder connections, provides object to access glade objects''' from gi.repository import GObject, Gtk # pylint: disable=E0611 im...
gpl-3.0
mxklabs/mxklabs-python
test/expr/test_solver.py
1
1155
import mxklabs.expr import pytest def test_sat1(): ctx = mxklabs.expr.ExprContext() a = ctx.bool.variable(name="a") ctx.add_constraint(a) result = ctx.solve() # Is satisfiable. assert(result) # Must have a=True varmap = result.get_varmap() assert(True == varmap[a]) def test_sat2(): ctx = mxklabs...
gpl-3.0
DylanMcCall/rhythmbox-songinfo-context-menu
plugins/magnatune/magnatune.py
1
8456
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- # # Copyright (C) 2006 Adam Zimmerman <adam_zimmerman@sfu.ca> # Copyright (C) 2006 James Livingston <doclivingston@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Publi...
gpl-2.0
adongy/pytwitcher
pytwitcher/base.py
1
8350
import asyncio import importlib import logging import random import signal import ssl import sys import traceback import certifi from . import protocol from . import registry from . import utils logger = logging.getLogger(__name__) class IrcObject: HOST = 'irc.chat.twitch.tv' CAPABILITIES = ('membership'...
mit
wanghaven/nupic
tests/unit/nupic/frameworks/opf/common_models/cluster_params_test.py
15
2447
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
agpl-3.0
shineyear/catawampus
dm/netdev_test.py
6
3117
#!/usr/bin/python # Copyright 2011 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 appli...
apache-2.0
projectmallard/pintail
pintail/translation.py
1
2744
# pintail - Build static sites from collections of Mallard documents # Copyright (c) 2016-2020 Shaun McCance <shaunm@gnome.org> # # This program 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 ve...
gpl-2.0
sestrella/ansible
lib/ansible/modules/network/aci/aci_config_snapshot.py
13
9858
#!/usr/bin/python # -*- coding: utf-8 -*- # 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.1', 'status': ['preview'], ...
gpl-3.0
semonte/intellij-community
python/testData/MockSdk2.7/python_stubs/sys.py
27
15749
# encoding: utf-8 # module sys # from (built-in) # by generator 1.138 """ This module provides access to some objects used or maintained by the interpreter and to functions that interact strongly with the interpreter. Dynamic objects: argv -- command line arguments; argv[0] is the script pathname if known path -- mod...
apache-2.0
cherusk/ansible
lib/ansible/parsing/mod_args.py
26
12266
# (c) 2014 Michael DeHaan, <michael@ansible.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 ve...
gpl-3.0
henryfjordan/django
tests/many_to_one/tests.py
88
30333
import datetime from copy import deepcopy from django.core.exceptions import FieldError, MultipleObjectsReturned from django.db import models, transaction from django.test import TestCase from django.utils import six from django.utils.translation import ugettext_lazy from .models import ( Article, Category, Child...
bsd-3-clause
mx3L/archivczsk
build/twisted/web/rewrite.py
83
1852
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # from twisted.web import resource class RewriterResource(resource.Resource): def __init__(self, orig, *rewriteRules): resource.Resource.__init__(self) self.resource = orig self.rewriteRules = list(rewriteRules) ...
gpl-2.0
neonatura/crotalus
lib/libxml2/doc/apibuild.py
21
81665
#!/usr/bin/python -u # # This is the API builder, it parses the C sources and build the # API formal description in XML. # # See Copyright for the status of this software. # # daniel@veillard.com # import os, sys import string import glob debug=0 #debugsym='ignorableWhitespaceSAXFunc' debugsym=None # # C parser analy...
gpl-2.0
gkc1000/pyscf
pyscf/prop/nmr/uhf.py
1
10174
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
AnupBansod/linux-btrfs
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
andreasgal/GT9100-kernel
tools/perf/scripts/python/sctop.py
895
1936
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
astocko/statsmodels
statsmodels/genmod/tests/test_glm.py
6
37718
""" Test functions for models.GLM """ from statsmodels.compat import range import os import numpy as np from numpy.testing import (assert_almost_equal, assert_equal, assert_raises, assert_allclose, assert_, assert_array_less, dec) from scipy import stats import statsmodels.api as sm from st...
bsd-3-clause
synconics/odoo
addons/l10n_be_coda/__init__.py
430
1105
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
fbradyirl/home-assistant
tests/components/homekit/test_type_security_systems.py
7
4925
"""Test different accessory types: Security Systems.""" import pytest from homeassistant.components.alarm_control_panel import DOMAIN from homeassistant.components.homekit.const import ATTR_VALUE from homeassistant.components.homekit.type_security_systems import SecuritySystem from homeassistant.const import ( ATT...
apache-2.0
indrajitr/ansible
test/lib/ansible_test/_internal/docker_util.py
7
8941
"""Functions for accessing docker via the docker cli.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os import time from .io import ( open_binary_file, read_text_file, ) from .util import ( ApplicationError, common_environment, displa...
gpl-3.0
SUSE/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_list_result.py
2
1129
# 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 ...
mit