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
kevalds51/sympy
sympy/concrete/delta.py
66
9727
from __future__ import print_function, division from sympy.core import Add, Mul, S, Dummy from sympy.core.cache import cacheit from sympy.core.compatibility import default_sort_key, range from sympy.functions import KroneckerDelta, Piecewise, piecewise_fold from sympy.sets import Interval @cacheit def _expand_delta(...
bsd-3-clause
todddeluca/diabric
diabric/files.py
1
11396
''' Fabric utilities for working with files. ''' import StringIO import contextlib import os import shutil import subprocess import uuid from fabric.api import sudo, run, settings, hide, put, local from fabric.contrib.files import exists ################## # HELPER FUNCTIONS # These functions are reusable snippets...
mit
mlavin/django
tests/queries/tests.py
4
160528
import datetime import pickle import unittest from collections import OrderedDict from operator import attrgetter from django.core.exceptions import EmptyResultSet, FieldError from django.db import DEFAULT_DB_ALIAS, connection from django.db.models import Count, F, Q from django.db.models.sql.constants import LOUTER f...
bsd-3-clause
wizardxbl/rtt-stm32f10x
bsp/upd70f3454/rtconfig.py
36
2949
import os # toolchains options ARCH = 'v850' CPU = '70f34' CROSS_TOOL = 'iar' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': print '================ERROR============================' print 'Not support gcc yet!' print '=======================================...
gpl-2.0
gstiebler/odemis
src/odemis/driver/pigcs.py
2
182360
# -*- coding: utf-8 -*- ''' Created on 7 Aug 2012 @author: Éric Piel Copyright © 2012-2015 Éric Piel, Delmic This file is part of Odemis. Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. Odemi...
gpl-2.0
beiko-lab/gengis
bin/Lib/test/test_ascii_formatd.py
13
1977
# PyOS_ascii_formatd is deprecated and not called from anywhere in # Python itself. So this module is the only place it gets tested. # Test that it works, and test that it's deprecated. import unittest from test.test_support import check_warnings, run_unittest, import_module # Skip tests if _ctypes module doe...
gpl-3.0
Fusion-Rom/android_external_chromium_org
chrome/common/extensions/docs/server2/appengine_wrappers.py
25
8570
# 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. def IsDeadlineExceededError(error): '''A general way of determining whether |error| is a DeadlineExceededError, since there are 3 different types thr...
bsd-3-clause
trondhindenes/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_user.py
27
3766
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.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 ANSIBLE_METADATA = {'metadata_version': '1.1...
gpl-3.0
peacekeeper/indy-sdk
docs/how-tos/rotate-key/python/step4.py
4
1548
print_log('\n13. Reading new verkey from wallet\n') verkey_in_wallet = await did.key_for_local_did(wallet_handle, trust_anchor_did) print_log('Trust Anchor Verkey in wallet: ', verkey_in_wallet) print_log('\n14. Building GET_NYM request to get Trust Anchor verkey\n') get_nym_request = await ledger.build_get_...
apache-2.0
NGnius/ModScraper
ModScraper.py
1
4720
'''This actually runs everything''' import sys, os, time sys.path.append(os.getcwd()+'/Resources') import ForumsToCheck, scraper, config, log_it import necroDetector, profanityDetector, capsDetector, annoyanceAlerts from multiprocessing import Process def init(queue): global q q = queue def main(): '''()...
gpl-3.0
konstruktoid/ansible-upstream
lib/ansible/modules/cloud/azure/azure_rm_functionapp.py
7
10280
#!/usr/bin/python # # Copyright (c) 2016 Thomas Stringer, <tomstr@microsoft.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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
airbnb/airflow
airflow/providers/http/operators/http.py
6
5139
# # 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...
apache-2.0
ramanajee/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/urlfetcher_mock.py
165
2053
# Copyright (C) 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
thegooglecodearchive/mpmath
mpmath/tests/test_ode.py
15
1822
#from mpmath.calculus import ODE_step_euler, ODE_step_rk4, odeint, arange from mpmath import odefun, cos, sin, mpf, sinc, mp ''' solvers = [ODE_step_euler, ODE_step_rk4] def test_ode1(): """ Let's solve: x'' + w**2 * x = 0 i.e. x1 = x, x2 = x1': x1' = x2 x2' = -x1 """ def derivs((x...
bsd-3-clause
pixbuffer/django-cms
cms/tests/i18n.py
10
11055
from cms.test_utils.testcases import SettingsOverrideTestCase from cms.utils import i18n class TestLanguages(SettingsOverrideTestCase): settings_overrides = { 'LANGUAGE_CODE': 'en-us', 'LANGUAGES': (('fr', 'French'), ('en', 'English'), ('de', 'German'), ...
bsd-3-clause
unseenlaser/python-for-android
python-modules/twisted/twisted/internet/ssl.py
60
7496
# -*- test-case-name: twisted.test.test_ssl -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ SSL transport. Requires PyOpenSSL (http://pyopenssl.sf.net). SSL connections require a ContextFactory so they can create SSL contexts. End users should only use the ContextFactory cla...
apache-2.0
aaltinisik/OCBAltinkaya
openerp/cli/deploy.py
369
3947
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import requests import sys import tempfile import zipfile from . import Command class Deploy(Command): """Deploy a module on an Odoo instance""" def __init__(self): super(Deploy, self).__init__() self.session = requests.se...
agpl-3.0
Bismarrck/tensorflow
tensorflow/python/data/experimental/kernel_tests/serialization/sample_from_datasets_serialization_test.py
21
1758
# Copyright 2018 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
jtorrents/networkx
networkx/generators/degree_seq.py
11
21837
# -*- coding: utf-8 -*- """Generate graphs with a given degree sequence or expected degree sequence. """ # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import heapq from itertools ...
bsd-3-clause
eptmp3/Sick-Beard
sickbeard/providers/newzbin.py
46
13632
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
gpl-3.0
broferek/ansible
lib/ansible/modules/network/nxos/nxos_vrf_af.py
16
4381
#!/usr/bin/python # # 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 distribut...
gpl-3.0
spisneha25/django
tests/template_tests/test_response.py
199
14388
from __future__ import unicode_literals import pickle import time from datetime import datetime from django.conf import settings from django.template import Context, engines from django.template.response import ( ContentNotRenderedError, SimpleTemplateResponse, TemplateResponse, ) from django.test import ( Re...
bsd-3-clause
mscherer/ansible
lib/ansible/plugins/__init__.py
15
13328
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com> # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> and others # # 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 Foun...
gpl-3.0
gauravbose/digital-menu
tests/lookup/tests.py
33
36080
from __future__ import unicode_literals from datetime import datetime from operator import attrgetter from unittest import skipUnless from django.core.exceptions import FieldError from django.db import connection from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from .models import Article, ...
bsd-3-clause
nopjmp/SickRage
lib/sqlalchemy/orm/descriptor_props.py
78
24571
# orm/descriptor_props.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 """Descriptor properties are more "auxiliary" properties that exist as configu...
gpl-3.0
ArcherCraftStore/ArcherVMPeridot
Python/Lib/lib2to3/fixes/fix_print.py
164
2854
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for print. Change: 'print' into 'print()' 'print ...' into 'print(...)' 'print ... ,' into 'print(..., end=" ")' 'print >>x, ...' into 'print(..., file=x)' No changes are appl...
apache-2.0
NiclasEriksen/py-towerwars
src/numpy/distutils/intelccompiler.py
59
1775
from __future__ import division, absolute_import, print_function from distutils.unixccompiler import UnixCCompiler from numpy.distutils.exec_command import find_executable class IntelCCompiler(UnixCCompiler): """ A modified Intel compiler compatible with an gcc built Python.""" compiler_type = 'intel' cc_...
cc0-1.0
sandan/sqlalchemy
examples/association/proxied_association.py
30
3324
"""proxied_association.py same example as basic_association, adding in usage of :mod:`sqlalchemy.ext.associationproxy` to make explicit references to ``OrderItem`` optional. """ from datetime import datetime from sqlalchemy import (create_engine, MetaData, Table, Column, Integer, String, DateTime, Float, Forei...
mit
dwightgunning/django
django/views/generic/detail.py
306
6922
from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.db import models from django.http import Http404 from django.utils.translation import ugettext as _ from django.views.generic.base import ContextMixin, TemplateResponseMixin, View class SingleObjectMixin(Conte...
bsd-3-clause
njwilson23/scipy
scipy/stats/__init__.py
27
8924
""" ========================================== Statistical functions (:mod:`scipy.stats`) ========================================== .. module:: scipy.stats This module contains a large number of probability distributions as well as a growing library of statistical functions. Each univariate distribution is an insta...
bsd-3-clause
yqm/sl4a
python/src/Lib/distutils/command/build_py.py
52
16702
"""distutils.command.build_py Implements the Distutils 'build_py' command.""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: build_py.py 65742 2008-08-17 04:16:04Z brett.cannon $" import string, os from types import * from glob import glob from distutils.core import Command from dist...
apache-2.0
TeamExodus/external_chromium_org
tools/json_schema_compiler/cpp_util_test.py
96
2096
#!/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. import unittest from cpp_util import ( Classname, CloseNamespace, GenerateIfndefName, OpenNamespace) class CppUtilTest(unitte...
bsd-3-clause
zeroSteiner/boltons
boltons/formatutils.py
1
11298
# -*- coding: utf-8 -*- """`PEP 3101`_ introduced the :meth:`str.format` method, and what would later be called "new-style" string formatting. For the sake of explicit correctness, it is probably best to refer to Python's dual string formatting capabilities as *bracket-style* and *percent-style*. There is overlap, but ...
bsd-3-clause
etos/django
django/core/management/commands/inspectdb.py
20
12852
import keyword import re from collections import OrderedDict from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.models.constants import LOOKUP_SEP class Command(BaseCommand): help = "Introspects the database tables in the given dat...
bsd-3-clause
iandees/all-the-places
locations/spiders/sunloan.py
1
2377
# -*- coding: utf-8 -*- import scrapy import json import re from locations.items import GeojsonPointItem DAYS={ 'Monday':'Mo', 'Tuesday':'Tu', 'Wednesday':'We', 'Friday':'Fr', 'Thursday':'Th', 'Saturday':'Sa', 'Sunday':'Su', } class SunLoanSpider(scrapy.Spider): name = "sunloan" a...
mit
zsdonghao/tensorlayer
setup.py
1
5906
#!/usr/bin/env python import codecs import os import sys os.environ['TENSORLAYER_PACKAGE_BUILDING'] = 'True' try: from setuptools import find_packages, setup, Extension from setuptools.command.build_ext import build_ext except ImportError: from distutils.core import ( setup, find_package...
apache-2.0
kidmaple/CoolWall
user/python/Lib/test/re_tests.py
6
29675
#!/usr/bin/env python # -*- 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-2.0
ModdedPA/android_external_chromium_org
chrome/test/chromedriver/client/chromedriver.py
29
8385
# Copyright 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. import command_executor from command_executor import Command from webelement import WebElement class ChromeDriverException(Exception): pass class NoSuchE...
bsd-3-clause
cherez/youtube-dl
youtube_dl/postprocessor/embedthumbnail.py
109
3507
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import subprocess from .ffmpeg import FFmpegPostProcessor from ..utils import ( check_executable, encodeArgument, encodeFilename, PostProcessingError, prepend_extension, shell_quote ) class EmbedThumbnailPPError(Post...
unlicense
tadebayo/myedge
myvenv/Lib/site-packages/PIL/ImageFile.py
14
16320
# # The Python Imaging Library. # $Id$ # # base class for image file handlers # # history: # 1995-09-09 fl Created # 1996-03-11 fl Fixed load mechanism. # 1996-04-15 fl Added pcx/xbm decoders. # 1996-04-30 fl Added encoders. # 1996-12-14 fl Added load helpers # 1997-01-11 fl Use encode_to_file where possibl...
mit
jcpowermac/ansible
test/sanity/code-smell/no-assert.py
18
1257
#!/usr/bin/env python from __future__ import print_function import os import re import sys from collections import defaultdict PATH = 'lib/ansible' ASSERT_RE = re.compile(r'.*(?<![-:a-zA-Z#][ -])\bassert\b(?!:).*') all_matches = defaultdict(list) for dirpath, dirnames, filenames in os.walk(PATH): for filename ...
gpl-3.0
mcepl/youtube-dl
youtube_dl/extractor/threeqsdn.py
76
5328
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, js_to_json, mimetype2ext, ) class ThreeQSDNIE(InfoExtractor): IE_NAME = '3qsdn' IE_DESC = '3Q SDN' _VALID_URL = r'https?://playout\.3qsdn\.com/(?P<id>[\da-f]{8}-[\da-f]{4}...
unlicense
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/django-1.3/django/contrib/localflavor/pt/forms.py
309
1561
""" PT-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re phone_digits_re = re.com...
lgpl-3.0
mani-monaj/ros_buildfarm
scripts/misc/generate_check_slaves_job.py
3
1109
#!/usr/bin/env python3 import argparse import sys from ros_buildfarm.argument import add_argument_config_url from ros_buildfarm.config import get_index from ros_buildfarm.jenkins import configure_job from ros_buildfarm.jenkins import configure_management_view from ros_buildfarm.jenkins import connect from ros_buildfa...
apache-2.0
hellofreedom/ansible-modules-core
cloud/openstack/os_security_group_rule.py
72
10710
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # # This module 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 vers...
gpl-3.0
little-dude/nose2
nose2/tests/functional/support/such/test_such.py
5
4675
import unittest from nose2.tools import such class SomeLayer(object): @classmethod def setUp(cls): it.somelayer = True @classmethod def tearDown(cls): del it.somelayer # # Such tests start with a declaration about the system under test # and will typically bind the test declaration...
bsd-2-clause
PiaBianca/PyMaster
pymasterlib/ask.py
1
1995
# PyMaster # Copyright (C) 2014, 2015 FreedomOfRestriction <FreedomOfRestriction@openmailbox.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
gpl-3.0
Noirello/bonsai
docs/conf.py
1
9146
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bonsai documentation build configuration file, created by # sphinx-quickstart on Sat Jan 18 21:30:25 2014. # # 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 # aut...
mit
osh/gnuradio
gr-blocks/python/blocks/qa_unpack_k_bits.py
57
1821
#!/usr/bin/env python # # Copyright 2006,2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
gpl-3.0
git-cola/git-cola
cola/widgets/dag.py
3
74824
from __future__ import division, absolute_import, unicode_literals import collections import itertools import math from functools import partial from qtpy.QtCore import Qt from qtpy.QtCore import Signal from qtpy import QtCore from qtpy import QtGui from qtpy import QtWidgets from ..compat import maxsize from ..i18n ...
gpl-2.0
dark1729dragon/pixutils
pixutils/vplayer/PlayImgs.py
1
2169
from __future__ import nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals from .videoutils import * def default_labeller(x): try: return int(x.split('_')[1].split('.')[0]) except: try: return int(basename(x).split('_')[1].split(...
bsd-2-clause
fangxingli/hue
desktop/core/ext-py/django-axes-1.5.0/axes/tests.py
10
7395
import random import string import time from django.test import TestCase from django.test.utils import override_settings from django.contrib.auth.models import User from django.core.urlresolvers import NoReverseMatch from django.core.urlresolvers import reverse from axes.decorators import COOLOFF_TIME from axes.decor...
apache-2.0
jonathf/chaospy
chaospy/distributions/baseclass/operator.py
1
2655
"""Operator transformation.""" import numpy import chaospy from ..baseclass import Distribution class OperatorDistribution(Distribution): """Operator transformation.""" def __init__(self, left, right, exclusion=None, repr_args=None): if not isinstance(left, Distribution): left = numpy.at...
mit
tsdmgz/ansible
lib/ansible/modules/windows/win_tempfile.py
47
2164
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017 Dag Wieers <dag@wieers.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 # ...
gpl-3.0
yeraydiazdiaz/nonrel-blog
django/db/backends/oracle/creation.py
29
12065
import sys import time from django.db.backends.creation import BaseDatabaseCreation TEST_DATABASE_PREFIX = 'test_' PASSWORD = 'Im_a_lumberjack' class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated Oracle column # types, as strings. Column-type strings can cont...
bsd-3-clause
ShinyROM/android_external_chromium_org
third_party/protobuf/descriptor_pb2.py
193
48695
# Generated by the protocol buffer compiler. DO NOT EDIT! from google.protobuf import descriptor from google.protobuf import message from google.protobuf import reflection # @@protoc_insertion_point(imports) DESCRIPTOR = descriptor.FileDescriptor( name='google/protobuf/descriptor.proto', package='google.protobu...
bsd-3-clause
davidsminor/cortex
test/IECoreGL/ShaderLoaderTest.py
5
5102
########################################################################## # # Copyright (c) 2007-2012, 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: # # * Redis...
bsd-3-clause
seaotterman/tensorflow
tensorflow/python/util/lazy_loader.py
20
2006
# 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
slipperyhank/pyphi
benchmarks/benchmarks/compute.py
2
3384
import timeit import copy from pyphi import cache as _cache, compute, config, constants, examples, Subsystem from .subsystem import clear_subsystem_caches def _clear_joblib_cache(): constants.joblib_memory.clear() class BenchmarkConstellation: params = [ ['parallel', 'sequential'], ['basi...
gpl-3.0
RobbieBowman/Robot-Game-AI
rg.py
3
1416
# users will import rg to be able to use robot game functions import math import operator settings = None # constants CENTER_POINT = None def after_settings(): global CENTER_POINT global settings CENTER_POINT = (int(settings.board_size / 2), int(settings.board_size / 2)) def set_settings(s): global...
unlicense
narasimhan-v/avocado-misc-tests-1
io/disk/fiotest.py
4
10168
#!/usr/bin/env python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that ...
gpl-2.0
pierreg/tensorflow
tensorflow/contrib/specs/python/specs.py
63
4927
# 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 applicable ...
apache-2.0
thnee/ansible
test/units/modules/network/nxos/test_nxos_bgp_neighbor_af.py
68
4912
# (c) 2016 Red Hat 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 dis...
gpl-3.0
FeatherCoin/Feathercoin
contrib/devtools/security-check.py
22
8242
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Perform basic ELF security checks on a series of executables. Exit status will be 0 if successful, and...
mit
usingnamespace/pyramid_authsanity
src/pyramid_authsanity/policy.py
1
6144
import base64 import os from pyramid.authorization import Authenticated, Everyone from pyramid.interfaces import IAuthenticationPolicy, IDebugLogger from zope.interface import implementer from .util import _find_services, _session_registered, add_vary_callback def _clean_principal(princid): """Utility function ...
isc
maxalbert/ansible
lib/ansible/galaxy/role.py
40
11943
######################################################################## # # (C) 2015, Brian Coca <bcoca@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...
gpl-3.0
willhardy/django
django/urls/resolvers.py
18
16937
""" This module converts requested URLs to callback view functions. RegexURLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a ResolverMatch object which provides access to all attributes of the resolved URL match. """ from __future__ import unicode_literals import functools...
bsd-3-clause
PrincetonUniversity/seisflows
seisflows/workflow/test_postprocess.py
2
1036
# # This is Seisflows # # See LICENCE file # ############################################################################### # Import system modules import sys # Import Numpy import numpy as np # Local imports from seisflows.tools import unix from seisflows.tools.tools import exists from seisflows.config import cust...
bsd-2-clause
danielberndt/Feature_Langpop
librarian/plugins/__init__.py
2
5147
""" plugins: code related to plugins and plugin loaders Copyright 2014-2015, Outernet Inc. Some rights reserved. This software is free software licensed under the terms of GPLv3. See COPYING file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt. """ import os import logging import bottle from...
gpl-3.0
h3biomed/ansible
lib/ansible/modules/messaging/rabbitmq/rabbitmq_vhost.py
63
3952
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Chatham Financial <oss@chathamfinancial.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 ANSIBLE_METADATA = {'metada...
gpl-3.0
mobilecoind/mobilecoin
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
arael120/App-Beicor
node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
896
91092
# Copyright (c) 2013 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. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
gpl-3.0
indro/t2c
libs/external_libs/python-openid-2.1.1/openid/test/test_openidyadis.py
87
4828
import unittest from openid.consumer.discover import \ OpenIDServiceEndpoint, OPENID_1_1_TYPE, OPENID_1_0_TYPE from openid.yadis.services import applyFilter XRDS_BOILERPLATE = '''\ <?xml version="1.0" encoding="UTF-8"?> <xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)" xmlns:...
mit
JCBarahona/edX
lms/djangoapps/courseware/features/annotatable.py
158
3492
import textwrap from lettuce import world, steps from nose.tools import assert_in, assert_equals from common import i_am_registered_for_the_course, visit_scenario_item DATA_TEMPLATE = textwrap.dedent("""\ <annotatable> <instructions>Instruction text</instructions> <p>{}</p> </annotatable> """...
agpl-3.0
CroceRossaItaliana/jorvik
formazione/migrations/0035_auto_20190510_1149.py
1
2215
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2019-05-10 11:49 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('formazione', '0034_auto_201904...
gpl-3.0
shashisp/blumix-webpy
app/gluon/contrib/pyrtf/Constants.py
44
4082
class ViewKind : """An integer (0-5) that represents the view mode of the document.""" NONE = 0 PageLayout = 1 Outline = 2 MasterDocument = 3 Normal = 4 OnlineLayout = 5 DEFAULT = PageLayout def _IsValid( cls, value ) : return value in [ 0, 1...
mit
kgullikson88/General
Analyze_CCF.py
1
9048
""" This is a module to read in an HDF5 file with CCFs. Use this to determine the best parameters, and plot the best CCF for each star/date """ from collections import defaultdict import logging import h5py import numpy as np import pandas as pd from scipy.interpolate import InterpolatedUnivariateSpline as spline cl...
gpl-3.0
alubbock/pysb
pysb/jacobian.py
5
4629
import pysb, pysb.bng, warnings, re, sympy class JacobianGenerator(object): def __init__(self, model): self.model = model self.indent_level = 0 self.__content = None def get_content(self, sim_length=1): if self.__content == None: self.generate_content(sim_length=s...
bsd-2-clause
miipl-naveen/optibizz
addons/account_bank_statement_extensions/__init__.py
442
1153
# -*- 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
andreparrish/python-for-android
python3-alpha/python3-src/Lib/xml/etree/__init__.py
1200
1604
# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2008 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you ...
apache-2.0
clausqr/HTPC-Manager
modules/qbittorrent.py
1
12490
#!/usr/bin/env python # -*- coding: utf-8 -*- import htpc import cherrypy import json import logging import time import math from cherrypy.lib.auth2 import require from htpc.helpers import striphttp, sizeof import requests from requests.auth import HTTPDigestAuth class Qbittorrent(object): session = requests.Ses...
mit
fumen/gae-fumen
lib/werkzeug/useragents.py
86
5640
# -*- coding: utf-8 -*- """ werkzeug.useragents ~~~~~~~~~~~~~~~~~~~ This module provides a helper to inspect user agent strings. This module is far from complete but should work for most of the currently available browsers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta...
bsd-3-clause
Acehaidrey/incubator-airflow
tests/providers/google/cloud/transfers/test_gcs_to_bigquery_system.py
10
1324
# # 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...
apache-2.0
vimagick/youtube-dl
youtube_dl/extractor/keezmovies.py
107
1802
from __future__ import unicode_literals import os import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, compat_urllib_request, ) class KeezMoviesIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?keezmovies\.com/video/.+?(?P<id>[0-9]+)(?:[/?&]|$)' _TEST =...
unlicense
adesignsk/wpbedrock
web/app/themes/tepelnecerpadlo/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1558
4945
# Copyright (c) 2011 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. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
gpl-3.0
MounirMesselmeni/django
django/db/backends/oracle/utils.py
539
1252
import datetime from django.utils.encoding import force_bytes, force_text from .base import Database # Check whether cx_Oracle was compiled with the WITH_UNICODE option if cx_Oracle is pre-5.1. This will # also be True for cx_Oracle 5.1 and in Python 3.0. See #19606 if int(Database.version.split('.', 1)[0]) >= 5 and...
bsd-3-clause
Obus/scikit-learn
sklearn/setup.py
225
2856
import os from os.path import join import warnings def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, BlasNotFoundError import numpy libraries = [] if os.name == 'posix': libraries.appe...
bsd-3-clause
Jazz-823/kernel_lge_hammerhead
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
mrquim/repository.mrquim
repo/plugin.program.indigo/libs/requests/packages/urllib3/util/retry.py
86
14123
from __future__ import absolute_import import time import logging from collections import namedtuple from itertools import takewhile import email import re from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, InvalidHeader, ) from ..pack...
gpl-2.0
KaranToor/MA450
google-cloud-sdk/lib/surface/compute/vpn_tunnels/list.py
7
1103
# Copyright 2014 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 ag...
apache-2.0
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/algorithms/swap.py
4
9829
"""Swap edges in a graph. """ import math from networkx.utils import py_random_state import networkx as nx __all__ = ["double_edge_swap", "connected_double_edge_swap"] @py_random_state(3) def double_edge_swap(G, nswap=1, max_tries=100, seed=None): """Swap two edges in the graph while keeping the node degrees f...
gpl-3.0
IllusionRom-deprecated/android_platform_external_chromium_org
chrome/common/extensions/docs/server2/cron_servlet_test.py
23
9487
#!/usr/bin/env python # Copyright 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. import unittest from appengine_wrappers import GetAppVersion from app_yaml_helper import AppYamlHelper from cron_servlet import CronSe...
bsd-3-clause
MSOpenTech/python-social-auth
social/apps/flask_app/routes.py
36
1507
from flask import g, Blueprint, request from flask.ext.login import login_required, login_user from social.actions import do_auth, do_complete, do_disconnect from social.apps.flask_app.utils import psa social_auth = Blueprint('social', __name__) @social_auth.route('/login/<string:backend>/', methods=('GET', 'POST'...
bsd-3-clause
xpol/gyp
test/ninja/action_dependencies/gyptest-action-dependencies.py
34
2086
#!/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. """ Verify that building an object file correctly depends on running actions in dependent targets, but not the targets themselves. """ impo...
bsd-3-clause
newvem/pytz
pytz/zoneinfo/America/Indiana/Vincennes.py
9
4532
'''tzinfo timezone information for America/Indiana/Vincennes.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Vincennes(DstTzInfo): '''America/Indiana/Vincennes timezone definition. See datetime.tzinfo for details''' zone...
mit
toshywoshy/ansible
lib/ansible/modules/cloud/huawei/hwc_vpc_security_group_rule.py
13
17745
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei # 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 #################################################################...
gpl-3.0
Endika/OpenUpgrade
addons/mail/res_users.py
314
10337
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
dpranke/typ
typ/tests/stats_test.py
84
2292
# Copyright 2014 Dirk Pranke. 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...
apache-2.0
rohitwaghchaure/digitales_erpnext
erpnext/hr/doctype/leave_block_list/leave_block_list.py
40
2266
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from erpnext.accounts.utils import validate_fiscal_year from frappe import _ from f...
agpl-3.0
carnotweat/cpupimp
libs/pyasn1/type/tagmap.py
200
1772
from pyasn1 import error class TagMap: def __init__(self, posMap={}, negMap={}, defType=None): self.__posMap = posMap.copy() self.__negMap = negMap.copy() self.__defType = defType def __contains__(self, tagSet): return tagSet in self.__posMap or \ self.__...
gpl-3.0