repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
vmahuli/contrail-controller
src/opserver/partition_handler.py
1
28794
#!/usr/bin/python from gevent import monkey monkey.patch_all() import logging import gevent from gevent.coros import BoundedSemaphore from kafka import KafkaClient, KeyedProducer, SimpleConsumer, common from uveserver import UVEServer import os import json import copy import traceback import uuid import struct import ...
apache-2.0
edesky/text_validator
lib/validate.py
1
1509
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import argparse import json import math parser = argparse.ArgumentParser() parser.add_argument("--text", required=True, help="Input text") parser.add_argument("--short", action='store_true') args = parser.parse_args() input_text = ...
mit
veger/ansible
test/units/modules/net_tools/nios/test_nios_a_record.py
59
5731
# 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 version. # # Ansible is distributed in the hope that ...
gpl-3.0
cmotc/schs738c-external_chromium
testing/gmock/test/gmock_test_utils.py
222
3579
#!/usr/bin/env python # # Copyright 2006, 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...
bsd-3-clause
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/system-config-printer/errordialogs.py
1
3111
#!/usr/bin/python ## system-config-printer ## Copyright (C) 2006, 2007, 2008, 2010 Red Hat, Inc. ## Authors: ## Florian Festi <ffesti@redhat.com> ## Tim Waugh <twaugh@redhat.com> ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as publi...
gpl-3.0
chouseknecht/ansible
lib/ansible/module_utils/network/ios/config/lldp_global/lldp_global.py
19
8572
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The ios_lldp_global class It is in this file where the current configuration (as dict) is compared to the provided configuration (as dict) and the command set necessar...
gpl-3.0
Kamp9/scipy
scipy/stats/_tukeylambda_stats.py
128
6930
from __future__ import division, print_function, absolute_import import numpy as np from numpy import poly1d from scipy.special import beta # The following code was used to generate the Pade coefficients for the # Tukey Lambda variance function. Version 0.17 of mpmath was used. #------------------------------------...
bsd-3-clause
allenlavoie/tensorflow
tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_vocabulary_test.py
137
2187
# encoding: utf-8 # 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 r...
apache-2.0
t-hey/QGIS-Original
python/pyplugin_installer/__init__.py
32
1499
# -*- coding: utf-8 -*- """ *************************************************************************** __init__.py --------------------- Date : May 2013 Copyright : (C) 2013 by Borys Jurgiel Email : info at borysjurgiel dot pl This module is based on ...
gpl-2.0
aparo/django-nonrel
django/contrib/gis/db/backends/postgis/models.py
403
1970
""" The GeometryColumns and SpatialRefSys models for the PostGIS backend. """ from django.db import models from django.contrib.gis.db.backends.base import SpatialRefSysMixin class GeometryColumns(models.Model): """ The 'geometry_columns' table from the PostGIS. See the PostGIS documentation at Ch. 4.2.2. ...
bsd-3-clause
drelu/SAGA-Hadoop
hadoop1/launcher.py
1
2591
#!/usr/bin/env python import time import saga import os, sys import subprocess import pdb import logging logging.basicConfig(level=logging.ERROR) def main(): try: # create a job service for Futuregrid's 'india' PBS cluster js = saga.job.Service("pbs+ssh://india") #js = saga.job.Servi...
apache-2.0
SeaFalcon/Musicool_Pr
lib/sqlalchemy/engine/interfaces.py
32
30327
# engine/interfaces.py # Copyright (C) 2005-2014 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 """Define core interfaces used by the engine system.""" from .. import util, e...
apache-2.0
heilaaks/snippy
tests/lib/helper.py
1
7104
# -*- coding: utf-8 -*- # # SPDX-License-Identifier: AGPL-3.0-or-later # # snippy - software development and maintenance notes manager. # Copyright 2017-2020 Heikki J. Laaksonen <laaksonen.heikki.j@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
agpl-3.0
blighj/django
django/utils/dateparse.py
22
4167
"""Functions to parse datetime objects.""" # We're using regular expressions rather than time.strptime because: # - They provide both validation and parsing. # - They're more flexible for datetimes. # - The date/datetime/time constructors produce friendlier error messages. import datetime import re from django.utils...
bsd-3-clause
ycflame/google-python-exercises
basic/solution/string2.py
208
3094
#!/usr/bin/python2.4 -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Additional basic string exercises # D. verbing # Given a string, if its length is a...
apache-2.0
leshchevds/ganeti
lib/ssh.py
1
43027
# # # Copyright (C) 2006, 2007, 2010, 2011 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list ...
bsd-2-clause
littlstar/chromium.src
build/android/surface_stats.py
44
3692
#!/usr/bin/env python # # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Command line tool for continuously printing Android graphics surface statistics on the console. """ import collections import...
bsd-3-clause
Y3K/django
django/contrib/auth/hashers.py
211
17463
from __future__ import unicode_literals import base64 import binascii import hashlib import importlib from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import receiver from d...
bsd-3-clause
sudheerchintala/LearnEraPlatForm
lms/djangoapps/class_dashboard/tests/test_views.py
33
4214
""" Tests for class dashboard (Metrics tab in instructor dashboard) """ from mock import patch from django.test.utils import override_settings from django.test import TestCase from django.test.client import RequestFactory from xmodule.modulestore.tests.factories import CourseFactory from student.tests.factories import...
agpl-3.0
danieldanciu/schoggi
tests/functional/explorer_module.py
4
11627
# 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
Peratham/segan
script/dot_topics.py
3
4584
# Script to take plain text topics from SHLDA and turn them into dot file # (suitable for further editing in OmniGraffle) # # Author: Jordan Boyd-Graber # Date: 12. Feb 2013 from textwrap import TextWrapper import sys from math import floor from string import strip COLORS = ["FF8888", "F8888E", "F28894", "EC889A", "E...
apache-2.0
nevir/plexability
extern/depot_tools/third_party/gsutil/gslib/addlhelp/acls.py
51
9472
# Copyright 2012 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...
gpl-2.0
clever-crow-consulting/otm-core
opentreemap/exporter/views.py
6
3612
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.http import Http404 from django.shortcuts import get_object_or_404 from tasks import async_csv_export, async_users_export from django_tinsel.utils import decorate as do fr...
agpl-3.0
vwflow/raws-python
raws_json/__init__.py
1
28752
#!/usr/bin/python # -*- coding: utf-8 -*- # # This is a modified version of '__init__.py' (version 1.1.1), part of the 'atom' module # from the gdata-python-client project (http://code.google.com/p/gdata-python-client/) by Google Inc. # Copyright (C) 2006, 2007, 2008 Google Inc. # # It has been modified to support jso...
apache-2.0
quaquel/EMAworkbench
test/test_em_framework/test_outcomes.py
1
5451
''' Created on Jul 28, 2015 .. codeauthor:: jhkwakkel <j.h.kwakkel (at) tudelft (dot) nl> ''' from __future__ import (division, print_function, absolute_import, unicode_literals) import unittest import unittest.mock as mock from ema_workbench.em_framework.outcomes import ScalarOutcome,\ T...
bsd-3-clause
tokenly/counterparty-lib
counterpartylib/lib/messages/versions/send2.py
3
3560
#! /usr/bin/python3 """Create and parse ‘send’-type messages.""" import struct from counterpartylib.lib import util from counterpartylib.lib import config from counterpartylib.lib.script import AddressError from counterpartylib.lib.exceptions import ValidateError from counterpartylib.lib.exceptions import UnpackErro...
mit
doot/CouchPotatoServer
libs/guessit/patterns.py
94
10301
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2011 Nicolas Wack <wackou@gmail.com> # Copyright (c) 2011 Ricard Marxer <ricardmp@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesse...
gpl-3.0
google/google-ctf
2019/finals/web-gphotos-finals/app/gallery/middleware.py
1
1230
# Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
atosatto/ansible
lib/ansible/modules/storage/netapp/na_cdot_license.py
67
9643
#!/usr/bin/python # (c) 2017, NetApp, Inc # # 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 version....
gpl-3.0
JioEducation/edx-platform
pavelib/utils/envs.py
9
7028
""" Helper functions for loading environment settings. """ from __future__ import print_function import os import sys import json from lazy import lazy from path import Path as path import memcache class Env(object): """ Load information about the execution environment. """ # Root of the git reposito...
agpl-3.0
smanolloff/SublimeLinter3
docs/conf.py
4
8489
# -*- coding: utf-8 -*- """SublimeLinter documentation build configuration file. Created by sphinx-quickstart on Sun Dec 29 11:05:37 2013. This file is execfile()d with the current directory set to its containing dir. Note that not all possible configuration values are present in this autogenerated file. All config...
mit
diegoingaramo/img-search-al
node_modules/googleapis/node_modules/google-auth-library/node_modules/gtoken/node_modules/google-p12-pem/node_modules/node-forge/tests/server.py
171
5756
#!/usr/bin/env python """ SSL server for Forge tests. - The server changes to the directory of the server script. - SSL uses "server.key" and "server.crt". - Sever performs basic static file serving. - Starts Flash cross domain policy file server. - Defaults to HTTP/HTTPS port 19400. - Defaults to Flash socket policy...
mit
EggieCode/ansible-role-ufw
test/test.py
1
2161
#!/usr/bin/env python3 import imp import os import unittest from pprint import pprint imp.load_source('ufw_forward', os.path.join(os.path.dirname(__file__), os.path.pardir, 'library', 'ufw_forward.py')) from ufw_forward import UFWForwards class TestBase(unittest.TestCase): def test_do_magic(self): test = { ...
mit
mcalmer/spacewalk
client/tools/rhncfg/config_common/rhn_log.py
10
3785
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
rklabs/scrapy
scrapy/spidermiddlewares/offsite.py
85
2120
""" Offsite Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import re import logging from scrapy import signals from scrapy.http import Request from scrapy.utils.httpobj import urlparse_cached logger = logging.getLogger(__name__) class OffsiteMiddleware(object): def __init__(self...
bsd-3-clause
UKPLab/emnlp2017-claim-identification
src/main/python/process_data_se_WithDevel.py
1
4976
import cPickle import numpy as np import pandas as pd import re import sys from collections import defaultdict def build_data_cv(data_folder, cv=10, clean_string=True): """ Loads data. """ revs = [] pos_file = data_folder[0] # train file neg_file = data_folder[1] # test file devel_file = d...
apache-2.0
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/ctypes/test/test_callbacks.py
59
8177
import unittest from ctypes import * import _ctypes_test class Callbacks(unittest.TestCase): functype = CFUNCTYPE ## def tearDown(self): ## import gc ## gc.collect() def callback(self, *args): self.got_args = args return args[-1] def check_type(self, typ, arg): P...
gpl-2.0
magne-max/zipline-ja
zipline/testing/__init__.py
1
1320
from .core import ( # noqa AssetID, AssetIDPlusDay, EPOCH, ExplodingObject, FakeDataPortal, FetcherDataPortal, MockDailyBarReader, OpenPrice, add_security_data, all_pairs_matching_predicate, all_subindices, assert_single_position, assert_timestamp_equal, check_al...
apache-2.0
ReganBell/QReview
build/lib/networkx/algorithms/simple_paths.py
33
3813
# -*- coding: utf-8 -*- # Copyright (C) 2012 by # Sergio Nery Simoes <sergionery@gmail.com> # All rights reserved. # BSD license. import networkx as nx __author__ = """\n""".join(['Sérgio Nery Simões <sergionery@gmail.com>', 'Aric Hagberg <aric.hagberg@gmail.com>']) __all__ = ['a...
bsd-3-clause
yuewko/neutron
neutron/plugins/midonet/plugin.py
43
1975
# Copyright (C) 2012 Midokura Japan K.K. # Copyright (C) 2013 Midokura PTE LTD # 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.or...
apache-2.0
aljscott/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/examples/add_person.py
432
1656
#! /usr/bin/python # See README.txt for information and build instructions. import addressbook_pb2 import sys # This function fills in a Person message based on user input. def PromptForAddress(person): person.id = int(raw_input("Enter person ID number: ")) person.name = raw_input("Enter name: ") email = raw_...
bsd-3-clause
alephu5/Soundbyte
environment/lib/python3.3/site-packages/IPython/nbconvert/preprocessors/tests/test_extractoutput.py
8
2601
""" Module with tests for the extractoutput preprocessor """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with ...
gpl-3.0
huntxu/neutron
neutron/agent/linux/daemon.py
3
7987
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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 a...
apache-2.0
themurph/openshift-tools
ansible/roles/lib_openshift_3.2/build/generate.py
12
8336
#!/usr/bin/env python ''' Generate the openshift-tools/ansible/roles/lib_openshift_cli/library/ modules. ''' import os # pylint: disable=anomalous-backslash-in-string GEN_STR = "#!/usr/bin/env python # pylint: disable=too-many-lines\n" + \ "# ___ ___ _ _ ___ ___ _ _____ ___ ___\n" + \ ...
apache-2.0
ktan2020/legacy-automation
win/Lib/bsddb/dbrecio.py
19
5498
""" File-like objects that read from or write to a bsddb record. This implements (nearly) all stdio methods. f = DBRecIO(db, key, txn=None) f.close() # explicitly release resources held flag = f.isatty() # always false pos = f.tell() # get current position f.seek(pos) # set current...
mit
damonkohler/sl4a
python/src/Lib/lib2to3/patcomp.py
52
6524
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Pattern compiler. The grammer is taken from PatternGrammar.txt. The compiler compiles a pattern to a pytree.*Pattern instance. """ __author__ = "Guido van Rossum <guido@python.org>" # Python imports import os # ...
apache-2.0
bcgov/gwells
app/backend/gwells/views/bulk.py
1
18358
""" 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, software distri...
apache-2.0
live-clones/dolfin-adjoint
tests_dolfin/optimization_scalar/optimization_scalar.py
1
1880
from __future__ import print_function from dolfin import * from dolfin_adjoint import * import sys dolfin.set_log_level(ERROR) n = 10 mesh = UnitIntervalMesh(n) V = FunctionSpace(mesh, "CG", 2) ic = project(Expression("sin(2*pi*x[0])", degree=1), V) u = ic.copy(deepcopy=True) def main(nu): u_next = Function(V)...
lgpl-3.0
haoxli/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_ro_img-src_self_allowed_ext-manual.py
30
2545
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "img-src 'self'" r...
bsd-3-clause
Eternali/synk
synk-pre/synk-pre.py
1
5279
''' Synk - Sublime Text Plugin ''' import os import socket import sublime import sublime_plugin from threading import Thread, Timer # variables for storing user defined settings settings_filename = "synk_pre.sublime-settings" enabled_field = "enabled" server_ips_field = "project_server_ips" # NOTE: add feature ...
gpl-3.0
ChristianKniep/QNIB
serverfiles/usr/local/lib/networkx-1.6/networkx/exception.py
5
1540
# -*- coding: utf-8 -*- """ ********** Exceptions ********** Base exceptions and errors for NetworkX. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult(dschult@colgate.edu)\nLoïc Séguin-C. <loicseguin@gmail.com>""" # Copyright (C) 2004-2008 by # Aric Hagberg <ha...
gpl-2.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.6.0/Lib/selectors.py
4
19168
"""Selectors module. This module allows high-level and efficient I/O multiplexing, built upon the `select` module primitives. """ from abc import ABCMeta, abstractmethod from collections import namedtuple, Mapping import math import select import sys # generic events, that must be mapped to implementation-specific...
mit
duncanhawthorne/robot-robot
libs/future/backports/urllib/robotparser.py
81
6865
from __future__ import absolute_import, division, unicode_literals from future.builtins import str """ robotparser.py Copyright (C) 2000 Bastian Kleineidam You can choose between two licenses when using this package: 1) GNU GPLv2 2) PSF license for Python 2.2 The robots.txt Exclusion Protocol is...
mit
talha81/TACTIC-DEV
src/pyasm/widget/timecard_wdg.py
6
41157
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
PostTenebrasLab/DrinkingBuddyServer
drinkingBuddyDB_declarative.py
1
3467
#!/usr/bin/python3 import os import sys from sqlalchemy import Column, ForeignKey, Integer, String, DateTime, Boolean from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from marshmallow import Schema, fields from flask_sqlalchemy import ...
mit
tragiclifestories/django
tests/auth_tests/models/invalid_models.py
251
1340
from django.contrib.auth.models import AbstractBaseUser, UserManager from django.db import models class CustomUserNonUniqueUsername(AbstractBaseUser): """ A user with a non-unique username. This model is not invalid if it is used with a custom authentication backend which supports non-unique username...
bsd-3-clause
tkingless/webtesting
venvs/tutorials/lib/python2.7/site-packages/pip/commands/hash.py
514
1597
from __future__ import absolute_import import hashlib import logging import sys from pip.basecommand import Command from pip.status_codes import ERROR from pip.utils import read_chunks from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES logger = logging.getLogger(__name__) class HashCommand(Command): ""...
mit
fintech-circle/edx-platform
lms/djangoapps/badges/api/tests.py
17
9405
""" Tests for the badges API views. """ from ddt import ddt, data, unpack from django.conf import settings from django.test.utils import override_settings from nose.plugins.attrib import attr from badges.tests.factories import BadgeAssertionFactory, BadgeClassFactory, RandomBadgeClassFactory from openedx.core.lib.api....
agpl-3.0
collex100/odoo
addons/report/controllers/main.py
210
6943
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
imatge-upc/saliency
shallow/train.py
2
3064
# add to kfkd.py from lasagne import layers from lasagne.updates import nesterov_momentum from nolearn.lasagne import NeuralNet,BatchIterator import os import numpy as np from sklearn.utils import shuffle import cPickle as pickle import matplotlib.pyplot as plt import Image import ImageOps from scipy import misc import...
mit
Distrotech/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/interactive.py
102
85840
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Acknowledgements: # Nicolas Economou, for his command line debugger on which this is inspired. # http://tinyurl.com/nicolaseconomou # Copyright (c) 2009-2014, Mario Vilas # All rights reserved. # # Redistribution and use in source and binary forms, wit...
apache-2.0
gavinp/chromium
build/android/flag_changer.py
9
1779
# Copyright (c) 2011 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. # Location where chrome reads command line flags from CHROME_COMMAND_FILE = '/data/local/chrome-command-line' class FlagChanger(object): """Temporar...
bsd-3-clause
joshainglis/ansible
lib/ansible/module_utils/facts.py
3
133495
# (c) 2012, Michael DeHaan <michael.dehaan@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 lat...
gpl-3.0
ifzing/ceilometer-extended-monitor
network/lbaas.py
1
2469
# -*- encoding: utf-8 -*- from ceilometer.openstack.common import log from ceilometer.openstack.common import timeutils from ceilometer.central import plugin from ceilometer import sample from ceilometer import neutron_client class LbaasInBytesPollster(plugin.CentralPollster): LOG = log.getLogger(__name__ + '....
apache-2.0
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/site-packages/qtpy/tests/test_macos_checks.py
8
2939
from __future__ import absolute_import import mock import platform import sys import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not PYQT5, reason="Targeted to PyQt5") @mock.patch.object(platform, 'mac_ver') def test_qt59_exception(mac_ver, monkeypatch): # Remove qtpy to reimport it again try...
gpl-3.0
bromjiri/Presto
predictor/predictor_new.py
1
8137
import settings import pandas as pd import numpy as np import os from datetime import datetime from datetime import timedelta import predictor.predictor_classifier as cls import predictor.predictor_statistic as stat import random import nltk class Stock: def __init__(self, subject): input_file = settings...
mit
imgos/asterisk-scripts
script/googlecontacts.py
1
2701
#!/usr/bin/python3 """Get Google Contacts Usage: google_contacts.py [--noauth_local_webserver] Options: --noauth_local_webserver passed on to google auth """ import docopt import httplib2 import subprocess import unidecode from apiclient import discovery from argparse import Namespace from oauth...
mit
DueLaser/oprint_raster_develop
src/octoprint/filemanager/storage.py
26
36038
# coding=utf-8 from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import logging import os im...
agpl-3.0
MotorolaMobilityLLC/external-chromium_org
third_party/tlslite/tlslite/utils/dateFuncs.py
407
2181
import os #Functions for manipulating datetime objects #CCYY-MM-DDThh:mm:ssZ def parseDateClass(s): year, month, day = s.split("-") day, tail = day[:2], day[2:] hour, minute, second = tail[1:].split(":") second = second[:2] year, month, day = int(year), int(month), int(day) hour, minute, secon...
bsd-3-clause
ewindisch/nova
tools/xenserver/vdi_chain_cleanup.py
139
3678
#!/usr/bin/env python # Copyright 2012 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 l...
apache-2.0
weisongchen/flaskapp
venv/lib/python2.7/site-packages/pip/_vendor/packaging/_structures.py
1152
1416
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function class Infinity(object): def __repr__(self): return "Infinity...
mit
fls-bioinformatics-core/RnaChipIntegrator
test/test_Features.py
1
14809
# # test_Features.py: unit tests for Features module # Copyright (C) University of Manchester 2011-5 Peter Briggs from common import * from rnachipintegrator.Features import Feature from rnachipintegrator.Features import FeatureSet import unittest class TestFeature(unittest.TestCase): def setUp(self): ...
artistic-2.0
ravibhure/ansible
lib/ansible/modules/cloud/rackspace/rax_identity.py
151
2712
#!/usr/bin/python # Copyright: 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__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
dingmingliu/quanttrade
bt/core.py
1
37660
""" Contains the core building blocks of the framework. """ import math from copy import deepcopy import pandas as pd import numpy as np import cython as cy class Node(object): """ The Node is the main building block in bt's tree structure design. Both StrategyBase and SecurityBase inherit Node. It cont...
apache-2.0
adamkovics/atmosphere
atmosphere/gas_opacity.py
1
8280
""" Add gas opacities to model based on the composition and vertical structure. """ import numpy as np import logging logger = logging.getLogger() def interpolate_kc(p, T, kc, verbose=False): """Linearly interpolate k-coefficients at a particular pressure and temperature, using the input k-coefficent grid, k...
gpl-2.0
hanlind/nova
nova/virt/xenapi/firewall.py
8
2689
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
apache-2.0
jhawkesworth/ansible
lib/ansible/modules/cloud/vmware/vmware_host_powermgmt_policy.py
43
8768
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de> # # 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 = { 'met...
gpl-3.0
kernel-sanders/arsenic-mobile
Dependencies/zope.interface-4.0.5/src/zope/interface/advice.py
31
7546
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
gpl-3.0
vanish87/shadowsocks
setup.py
18
1321
import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name="shadowsocks", version="3.0.0", license='http://www.apache.org/licenses/LICENSE-2.0', description="A fast tunnel proxy that help you get through firewalls", ...
apache-2.0
sander76/home-assistant
homeassistant/components/almond/__init__.py
3
10130
"""Support for Almond.""" from __future__ import annotations import asyncio from datetime import timedelta import logging import time from aiohttp import ClientError, ClientSession import async_timeout from pyalmond import AbstractAlmondWebAuth, AlmondLocalAuth, WebAlmondAPI import voluptuous as vol from homeassista...
apache-2.0
ArcherSys/ArcherSys
node_modules/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py
1
18134
<<<<<<< HEAD <<<<<<< HEAD #!/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. """Argument-less script to select what to run on the buildbots.""" import os import shutil import subprocess imp...
mit
munyirik/python
cpython/Tools/freeze/freeze.py
5
17071
#! /usr/bin/env python3 """Freeze a Python script into a binary. usage: freeze [options...] script [module]... Options: -p prefix: This is the prefix used when you ran ``make install'' in the Python build directory. (If you never ran this, freeze won't work.) The default ...
bsd-3-clause
jeltz/rust-debian-package
src/llvm/test/Scripts/common_dump.py
10
1441
def dataToHex(d): """ Convert the raw data in 'd' to an hex string with a space every 4 bytes. """ bytes = [] for i,c in enumerate(d): byte = ord(c) hex_byte = hex(byte)[2:] if byte <= 0xf: hex_byte = '0' + hex_byte if i % 4 == 3: hex_byte += ' ' ...
apache-2.0
linjoahow/w17test_1
static/Brython3.1.3-20150514-095342/Lib/test/re_tests.py
879
31796
#!/usr/bin/env python3 # -*- mode: python -*- # Re test suite and benchmark suite v1.5 # The 3 possible outcomes for each pattern [SUCCEED, FAIL, SYNTAX_ERROR] = range(3) # Benchmark suite (needs expansion) # # The benchmark suite does not test correctness, just speed. The # first element of each tuple is the regex...
gpl-3.0
dawsonjon/Chips-2.0
chips/compiler/tokens.py
1
9314
__author__ = "Jon Dawson" __copyright__ = "Copyright (C) 2012, Jonathan P Dawson" __version__ = "0.1" import os.path import subprocess from chips.compiler.exceptions import C2CHIPError operators = [ "!", "~", "+", "-", "*", "/", "//", "%", "=", "==", "<", ">", "<=", ">=", "!=", "|", "&", "^", "||", "&&", "("...
mit
hsaputra/tensorflow
tensorflow/compiler/tests/ternary_ops_test.py
101
4286
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
caisq/tensorflow
tensorflow/python/training/proximal_adagrad_test.py
36
9246
# Copyright 2015 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
theboocock/fine_mapping_pipeline
fine_mapping_pipeline/utils/zscores.py
2
3971
# Copyright (c) 2015 Boocock James <james.boocock@otago.ac.nz> # Author: Boocock James <james.boocock@otago.ac.nz> # # 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, incl...
mit
istresearch/readthedocs.org
readthedocs/rtd_tests/tests/test_bookmarks.py
32
4846
from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User import json from readthedocs.builds.constants import LATEST from readthedocs.projects.models import Project from readthedocs.bookmarks.models import Bookmark class TestBookmarks(TestCase): fi...
mit
kosgroup/odoo
addons/lunch/models/lunch.py
10
13201
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import datetime from odoo import api, fields, models, _ from odoo.exceptions import AccessError, ValidationError import odoo.addons.decimal_precision as dp class LunchOrder(models.Model): """ A lunch order con...
gpl-3.0
OnroerendErfgoed/skosprovider_heritagedata
skosprovider_heritagedata/utils.py
1
5488
# -*- coding: utf-8 -*- ''' Utility functions for :mod:`skosprovider_heritagedata`. ''' import requests from skosprovider.skos import ( Concept, Label, Note, ConceptScheme) from skosprovider.exceptions import ProviderUnavailableException import logging import sys import requests log = logging.getLogg...
mit
hynnet/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/distutils/core.py
175
9093
"""distutils.core The only module that needs to be imported to use the Distutils; provides the 'setup' function (which is to be called from the setup script). Also indirectly provides the Distribution and Command classes, although they are really defined in distutils.dist and distutils.cmd. """ __revision__ = "$Id$"...
gpl-2.0
tomprince/gemrb
gemrb/GUIScripts/bg2/GUICG22.py
3
7449
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2003-2007 The GemRB Project # # 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 opt...
gpl-2.0
CYBAI/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptmanifest/tests/test_static.py
28
2527
import unittest from ..backends import static # There aren't many tests here because it turns out to be way more convenient to # use test_serializer for the majority of cases class TestStatic(unittest.TestCase): def compile(self, input_text, input_data): return static.compile(input_text, input_data) ...
mpl-2.0
nvbn/python-social-auth
social/backends/yammer.py
3
1364
""" Yammer OAuth2 support """ from social.backends.oauth import BaseOAuth2 class YammerOAuth2(BaseOAuth2): name = 'yammer' AUTHORIZATION_URL = 'https://www.yammer.com/dialog/oauth' ACCESS_TOKEN_URL = 'https://www.yammer.com/oauth2/access_token' EXTRA_DATA = [ ('id', 'id'), ('expires', ...
bsd-3-clause
mr-ping/WebTesting
main.py
1
5059
#!/usr/bin/python import os import sys import argparse from log import Log from chat import Trend from chat import plot_trend as pl from settings import * def parse_args(): """ Parsing shell command arguments, and override appropriate params from setting module :return: None """ parser = arg...
mit
MikeLing/shogun
examples/undocumented/python/graphical/interactive_svm_demo.py
6
12586
""" Shogun demo, based on PyQT Demo by Eli Bendersky Christian Widmer Soeren Sonnenburg License: GPLv3 """ import numpy import sys, os, csv from PyQt4.QtCore import * from PyQt4.QtGui import * import matplotlib from matplotlib.colorbar import make_axes, Colorbar from matplotlib.backends.backend_qt4agg import FigureCa...
gpl-3.0
christoph-buente/phantomjs
src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_env_var_test.py
233
3509
#!/usr/bin/env python # # Copyright 2008, 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...
bsd-3-clause
jcftang/ansible
lib/ansible/plugins/test/files.py
148
1347
# (c) 2015, Ansible, Inc # # 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 version. # # Ansible is di...
gpl-3.0
arnedesmedt/dotfiles
.config/sublime-text-3/Packages.symlinkfollow/pygments/all/pygments/lexers/dalvik.py
47
4420
# -*- coding: utf-8 -*- """ pygments.lexers.dalvik ~~~~~~~~~~~~~~~~~~~~~~ Pygments lexers for Dalvik VM-related languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygr...
mit