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
LowieHuyghe/edmunds
edmunds/log/drivers/timedfile.py
1
1853
from logging.handlers import TimedRotatingFileHandler from logging import WARNING, Formatter import os class TimedFile(TimedRotatingFileHandler): """ Timed File Driver """ def __init__(self, app, log_path, filename, prefix='', when='D', interval=1, backup_count=0, level=WARNING, format=None): ...
apache-2.0
jtgans/squish
lib/squish/command.py
1
8698
#!/usr/bin/env python # -*- python -*- # # Copyright (C) 2008 Google, Inc. All Rights Reserved. # # 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 ...
gpl-2.0
stonebig/bokeh
bokeh/application/handlers/tests/test___init__.py
2
2005
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
arthurchan1111/EventPlanner
node_modules/node-gyp/gyp/pylib/gyp/__init__.py
1524
22178
#!/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. import copy import gyp.input import optparse import os.path import re import shlex import sys import traceback from gyp.common import GypErr...
mit
sebadiaz/rethinkdb
test/rql_test/connections/http_support/werkzeug/serving.py
145
27668
# -*- coding: utf-8 -*- """ werkzeug.serving ~~~~~~~~~~~~~~~~ There are many ways to serve a WSGI application. While you're developing it you usually don't want a full blown webserver like Apache but a simple standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in the standa...
agpl-3.0
mfherbst/spack
var/spack/repos/builtin/packages/libuv/package.py
5
1850
############################################################################## # 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
capecchi/capecchi.github.io
posts/AmericaByTrain/length_builder.py
1
2840
#pep : current path endpoint (for finding next segment(s)) #ipath : array of indices on this path #iredund : if available, indices to ignore (from previous juncture analyses) #pl : path length to reach def main(pep, ipath, iredund, pl, index, strt, end, cid, rb): import numpy as np import length_builder #IDE...
mit
gdimitris/ChessPuzzler
Virtual_Environment/lib/python2.7/site-packages/sqlalchemy/util/deprecations.py
60
4403
# util/deprecations.py # Copyright (C) 2005-2015 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 """Helpers related to deprecation of functions, methods, classes, other functio...
mit
tlemoult/spectroDb
spectrum/RR/get-spc-RR.py
1
3788
import datetime import time import json from datetime import datetime import sys import os import shutil import glob import libsdb.dbSpectro as dbSpectro import libsdb.cds as cds # mes modules from modEphem import * def createPath(racine,path): dirs=path.split("/") current=racine # chemin absolu partDir='' ...
mit
nick-thompson/servo
tests/wpt/web-platform-tests/webdriver/element_state/method_test.py
65
3455
import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test class GetElementAttributeTest(base_test.WebDriverBaseTest): def test_get_element_attribute(self): self.driver.get(self.webserver.where_is("element_state/res/element-with-id-attribute...
mpl-2.0
schwarz/youtube-dl
youtube_dl/extractor/scivee.py
150
1894
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class SciVeeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?scivee\.tv/node/(?P<id>\d+)' _TEST = { 'url': 'http://www.scivee.tv/node/62352', 'md5': 'b16699b74c9e6a120f677...
unlicense
DebugBill/domoticz
plugins/examples/DenonMarantz.py
15
23003
# # Denon AVR 4306 Plugin # # Author: Dnpwwo, 2016 - 2017 # # Mode4 ("Sources") needs to have '|' delimited names of sources that the Denon knows about. The Selector can be changed afterwards to any text and the plugin will still map to the actual Denon name. # """ <plugin key="Denon4306" version="3...
gpl-3.0
sinuos/FreeNOS
site_scons/phony.py
15
1319
# # Copyright (C) 2010 Niek Linnenbank # # 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 option) any later version. # # This program is distributed...
gpl-3.0
whutch/atria
cwmud/core/protocols/__init__.py
2
2361
# -*- coding: utf-8 -*- """Transport protocol implementations.""" # Part of Clockwork MUD Server (https://github.com/whutch/cwmud) # :copyright: (c) 2008 - 2017 Will Hutcheson # :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt) from time import sleep from ..logs import get_logger from ..messages...
mit
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/test/test_fileio.py
80
15460
# Adapted from test_file.py by Daniel Stutzbach import sys import os import io import errno import unittest from array import array from weakref import proxy from functools import wraps from test.support import TESTFN, check_warnings, run_unittest, make_bad_fd, cpython_only from collections import UserList from _io ...
gpl-2.0
studiomobile/protobuf-objc
python/google/protobuf/internal/type_checkers.py
9
12239
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
madmax983/h2o-3
h2o-py/h2o/model/dim_reduction.py
2
2505
from model_base import ModelBase from metrics_base import * class H2ODimReductionModel(ModelBase): def num_iterations(self): """ Get the number of iterations that it took to converge or reach max iterations. :return: number of iterations (integer) """ o = self._model_json["output"]...
apache-2.0
awslabs/chalice
chalice/cli/reloader.py
1
4475
"""Automatically reload chalice app when files change. How It Works ============ This approach borrow from what django, flask, and other frameworks do. Essentially, with reloading enabled ``chalice local`` will start up a worker process that runs the dev http server. This means there will be a total of two processes...
apache-2.0
yamila-moreno/django
django/middleware/csrf.py
155
8477
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ from __future__ import unicode_literals import logging import re from django.conf import settings from django.core.urlresolvers import get_callable from django.utils...
bsd-3-clause
softlayer/jumpgate
jumpgate/common/sl/auth.py
4
4421
import logging import time from jumpgate.common import exceptions from jumpgate.common import utils from jumpgate.identity.drivers import core as identity from oslo.config import cfg import SoftLayer USER_MASK = 'id, username, accountId' LOG = logging.getLogger(__name__) def get_token_details(token, tenant_id=Non...
mit
shacker6868/signatumclassicd
share/qt/extract_strings_qt.py
1294
1784
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
mit
bwhitelock/garmon-ng
plugins/dtc_connected/dtc_connected.py
1
4480
#!/usr/bin/python # # dtc_connected.py # # Copyright (C) Ben Van Mechelen 2007-2009 <me@benvm.be> # # This file is part of Garmon # # Garmon 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 ...
gpl-3.0
secimTools/SECIMTools
src/secimtools/dataManager/interface.py
2
19566
#!/usr/bin/env python """ Secim Tools data interface library. """ # Built-in packages import re import sys # Add-on packages import numpy as np import pandas as pd class wideToDesign: """ Class to handle generic data in a wide format with an associated design file. """ def __init__(self, wide, design, uniqID...
mit
tchellomello/home-assistant
homeassistant/components/rflink/switch.py
7
2285
"""Support for Rflink switches.""" import logging import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import CONF_NAME import homeassistant.helpers.config_validation as cv from . import ( CONF_ALIASES, CONF_DEVICE_DEFAULTS, CONF_DEVI...
apache-2.0
Osmose/trephub
vendor-local/lib/python/requests/packages/charade/langthaimodel.py
206
11475
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Ri...
bsd-3-clause
anbangr/trusted-nova
nova/ipv6/account_identifier.py
20
1970
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
witcxc/scipy
scipy/io/arff/tests/test_arffread.py
26
7733
#!/usr/bin/env python from __future__ import division, print_function, absolute_import import datetime import os import sys from os.path import join as pjoin if sys.version_info[0] >= 3: from io import StringIO else: from cStringIO import StringIO import numpy as np from numpy.testing import (TestCase, asse...
bsd-3-clause
ewandor/home-assistant
homeassistant/components/sensor/glances.py
6
6483
""" Support gathering system information of hosts which are running glances. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.glances/ """ import logging from datetime import timedelta import requests import voluptuous as vol import homeassistant....
apache-2.0
DistroSeed/DistroSeed-Dashboard
distroseed/dashboard/views.py
2
13958
import re import os import ast import json import requests import subprocess import transmissionrpc from hurry.filesize import size from urlparse import urljoin from django.db.models import * from django.template import Context, loader, RequestContext from django.shortcuts import render_to_response, get_object_or_404, ...
gpl-3.0
gijzelaerr/python-libchan
setup.py
1
1364
import os from setuptools import setup, find_packages import imp REQUIREMENTS = ["offset"] CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Pro...
mit
TUB-Control/PaPI
papi/yapsy/VersionedPluginManager.py
1
4203
#!/usr/bin/python # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t; python-indent: 4 -*- """ Role ==== Defines the basic interface for a plugin manager that also keeps track of versions of plugins API === """ from distutils.version import StrictVersion from papi.yapsy.PluginInfo import PluginInfo from papi.y...
gpl-3.0
sidartaoliveira/ansible
lib/ansible/module_utils/six/_six.py
28
30097
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
gpl-3.0
andrewd18/eve-wspace
evewspace/account/models.py
7
3471
# Eve W-Space # Copyright (C) 2013 Andrew Austin and other contributors # # 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
srikantbmandal/ansible
lib/ansible/modules/cloud/webfaction/webfaction_site.py
63
7118
#!/usr/bin/python # # Create Webfaction website using Ansible and the Webfaction API # # ------------------------------------------ # # (c) Quentin Stafford-Fraser 2015 # # 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 Lic...
gpl-3.0
onyxfish/journalism
agate/mapped_sequence.py
2
4458
#!/usr/bin/env python """ This module contains the :class:`MappedSequence` class that forms the foundation for agate's :class:`.Row` and :class:`.Column` as well as for named sequences of rows and columns. """ from collections import OrderedDict, Sequence import six from six.moves import range # pylint: disable=W06...
mit
ml-lab/neon
neon/optimizers/learning_rule.py
4
2997
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
apache-2.0
Khaon/android_external_skia
platform_tools/android/gyp_gen/vars_dict_lib.py
146
4422
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import types # The goal of this class is to store a set of unique items in the order in # which they are inserted. This is important for the final ...
bsd-3-clause
chrishavlin/nyc_taxi_viz
src/taxi_main.py
1
12620
""" taxi_main.py module for loading the raw csv taxi files. Copyright (C) 2016 Chris Havlin, <https://chrishavlin.wordpress.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either ...
gpl-3.0
joshloyal/scikit-learn
sklearn/externals/joblib/_memory_helpers.py
303
3605
try: # Available in Python 3 from tokenize import open as open_py_source except ImportError: # Copied from python3 tokenize from codecs import lookup, BOM_UTF8 import re from io import TextIOWrapper, open cookie_re = re.compile("coding[:=]\s*([-\w.]+)") def _get_normal_name(orig_enc): ...
bsd-3-clause
buhe/judge
wbox/sandbox.py
2
3154
from _wbox import UserManager, ProcessManager, NetworkManager from subprocess import list2cmdline, Popen from winutils import execution_time from uuid import uuid1 class WBoxPopen(object): def __init__(self, argv, time, memory, nproc=1, executable=None, cwd=None, env=None, network_block=False): self.user ...
agpl-3.0
DisruptiveLabs/nacha
tests/test_records.py
2
7022
import datetime import nacha from . import TestCase class TestRecord(TestCase): pass class TestFileHeader(TestRecord): def setUp(self): self.record = self.fixture_line(1, 'sample').strip('\n') self.assertEqual(len(self.record), nacha.FileHeader.length) def test_construction_of_file_...
isc
intel-analytics/BigDL
spark/dl/src/test/resources/tf/models/inception_resnet_v2.py
9
1518
# # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
xiang12835/python_web
py2_web2py/web2py/applications/main/languages/es.py
4
23678
# -*- coding: utf-8 -*- { '!langcode!': 'es', '!langname!': 'Español', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN', '%(nr...
apache-2.0
jkitzes/macroeco
macroeco/models/__init__.py
1
1969
""" =============================== Models (:mod:`macroeco.models`) =============================== This module contains distributions and curves (i.e., standard mathematical functions) commonly used in analysis of ecological patterns. Distributions ============= All of the distributions here are subclasses of eithe...
bsd-2-clause
dianchen96/gym
envs/__init__.py
1
13852
from gym.envs.registration import registry, register, make, spec # Algorithmic # ---------------------------------------- register( id='Copy-v0', entry_point='gym.envs.algorithmic:CopyEnv', max_episode_steps=200, reward_threshold=25.0, ) register( id='RepeatCopy-v0', entry_point='gym.envs.alg...
mit
GEHC-Surgery/ITK
Wrapping/Generators/SwigInterface/pygccxml-1.0.0/pygccxml/declarations/dependencies.py
13
2149
# Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) """ this module contains class that keeps dependency information of some declaration """ import cpptypes class dependency_inf...
apache-2.0
resmo/ansible
test/units/modules/network/netvisor/test_pn_port_config.py
23
2782
# Copyright: (c) 2018, Pluribus Networks # 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 from units.compat.mock import patch from ansible.modules.network.netvisor import pn_port_config ...
gpl-3.0
ihsanudin/odoo
openerp/addons/base/module/wizard/base_export_language.py
269
3648
# -*- 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 of t...
agpl-3.0
GiovanniConserva/TestDeploy
venv/Lib/site-packages/django/contrib/gis/geos/linestring.py
76
5843
from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.coordseq import GEOSCoordSeq from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import ( GEOSGeometry, ProjectInterpolateMixin, ) from django.contrib.gis.geos.point import Point from django...
bsd-3-clause
klnprj/testapp
django/contrib/flatpages/tests/templatetags.py
228
5965
import os from django.conf import settings from django.contrib.auth.models import AnonymousUser, User from django.template import Template, Context, TemplateSyntaxError from django.test import TestCase class FlatpageTemplateTagTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.te...
bsd-3-clause
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/structured/labs/serving/application/lib/pyasn1_modules/rfc8494.py
13
2363
# This file is being contributed to pyasn1-modules software. # # Created by Russ Housley with assistance from asn1ate v.0.6.0. # # Copyright (c) 2019, Vigil Security, LLC # License: http://snmplabs.com/pyasn1/license.html # # Multicast Email (MULE) over Allied Communications Publication 142 # # ASN.1 source from: # htt...
apache-2.0
PeterWangIntel/chromium-crosswalk
tools/perf/metrics/timeline.py
20
12212
# 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 collections from telemetry.util.statistics import DivideIfPossibleOrZero from telemetry.value import scalar from telemetry.web_perf.metrics import tim...
bsd-3-clause
was4444/chromium.src
third_party/closure_linter/closure_linter/tokenutil_test.py
109
7678
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 # #...
bsd-3-clause
zymsys/sms-tools
lectures/07-Sinusoidal-plus-residual-model/plots-code/hpsModelFrame.py
22
2075
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris, resample import math from scipy.fftpack import fft, ifft, fftshift import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import ...
agpl-3.0
ESSS/numpy
numpy/distutils/fcompiler/gnu.py
28
14667
from __future__ import division, absolute_import, print_function import re import os import sys import warnings import platform import tempfile from subprocess import Popen, PIPE, STDOUT from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import exec_command from numpy.distutils.misc_uti...
bsd-3-clause
ANDABO/plugin.video.aresiptv-1.9.4
pyaes.py
189
16661
"""Simple AES cipher implementation in pure Python following PEP-272 API Homepage: https://bitbucket.org/intgr/pyaes/ The goal of this module is to be as fast as reasonable in Python while still being Pythonic and readable/understandable. It is licensed under the permissive MIT license. Hopefully the code is readabl...
gpl-2.0
drcapulet/sentry
src/sentry/receivers/rules.py
15
1174
from __future__ import absolute_import, print_function from django.db.models.signals import post_save from sentry.models import Project, Rule def create_default_rules(instance, created=True, RuleModel=Rule, **kwargs): if not created: return RuleModel.objects.create( project=instance, ...
bsd-3-clause
acreations/rockit-server
rockit/core/views/settings.py
1
1235
from celery.execute import send_task from django.shortcuts import get_object_or_404 from rest_framework import viewsets from rest_framework.response import Response from rest_framework.reverse import reverse_lazy from rockit.core import holders from rockit.core import models class SettingViewSet(viewsets.ViewSet):...
mit
LyleMi/Trafficker
Trafficker/layer/layer.py
1
2062
import socket class layer(object): """base layer""" def __init__(self, packet=''): self.packet = packet def pack(self): return self.packet def __str__(self): return str(self.pack()) def __repr__(self): return '<%s>' % self.name def json(self): retu...
mit
Bitcoin-ABC/bitcoin-abc
test/functional/abc-magnetic-anomaly-mining.py
1
4364
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test that mining RPC continues to supply correct transaction metadata after the Nov 2018 protocol upgr...
mit
muntasirsyed/intellij-community
python/lib/Lib/encodings/cp1254.py
593
13758
""" Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
apache-2.0
PulsePod/evepod
lib/python2.7/site-packages/simplejson/tests/test_namedtuple.py
147
4004
from __future__ import absolute_import import unittest import simplejson as json from simplejson.compat import StringIO try: from collections import namedtuple except ImportError: class Value(tuple): def __new__(cls, *args): return tuple.__new__(cls, args) def _asdict(self): ...
apache-2.0
etherkit/OpenBeacon2
client/linux-x86/venv/lib/python3.8/site-packages/setuptools/command/test.py
5
9602
import os import operator import sys import contextlib import itertools import unittest from distutils.errors import DistutilsError, DistutilsOptionError from distutils import log from unittest import TestLoader from setuptools.extern import six from setuptools.extern.six.moves import map, filter from pkg_resources i...
gpl-3.0
oinopion/django
django/views/generic/base.py
281
7690
from __future__ import unicode_literals import logging from functools import update_wrapper from django import http from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import NoReverseMatch, reverse from django.template.response import TemplateResponse from django.utils import six fr...
bsd-3-clause
thnee/ansible
lib/ansible/modules/network/cloudengine/ce_lldp_interface.py
11
69893
#!/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
ag-wood/ansible-modules-extras
cloud/vmware/vmware_portgroup.py
47
4163
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
loveyoupeng/rt
modules/web/src/main/native/Tools/Scripts/webkitpy/replay/main.py
3
5231
# Copyright (C) 2011 Google Inc. All rights reserved. # Copyright (C) 2014 Apple 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 c...
gpl-2.0
caiocsalvador/whats_the_craic
lib/python3.4/site-packages/django/contrib/auth/hashers.py
3
17456
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...
mit
royalharsh/grpc
tools/buildgen/bunch.py
44
2469
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
ataylor32/django
django/forms/utils.py
169
5975
from __future__ import unicode_literals import json import sys from django.conf import settings from django.core.exceptions import ValidationError # backwards compatibility from django.utils import six, timezone from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.html import e...
bsd-3-clause
gavioto/fiware-orion
test/acceptance/lettuce/integration/steps_lib/background.py
8
1483
# -*- coding: utf-8 -*- """ # Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker 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 Foun...
agpl-3.0
F-Secure/resource-api
src/tests/http_test.py
2
8199
""" Copyright (c) 2014-2015 F-Secure See LICENSE for details """ import json import mock from werkzeug.test import Client as BaseClient from werkzeug.wrappers import BaseResponse from resource_api_http.http import Application from resource_api import errors from .base_test import BaseTest class Client(BaseClient)...
apache-2.0
icdishb/scikit-learn
sklearn/feature_selection/tests/test_rfe.py
4
8628
""" Testing Recursive feature elimination """ import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_equal, assert_true from scipy import sparse from sklearn.feature_selection.rfe import RFE, RFECV from sklearn.datasets import load_iris, make_friedman1...
bsd-3-clause
ZombieNinjaPirate/HonSSH-utilities
bifrozt/find/networkobj.py
1
3561
"""Searches for network related objects. """ """ Copyright (c) 2015, Are Hansen - Honeypot Development 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 th...
gpl-2.0
pshen/ansible
lib/ansible/modules/network/avi/avi_cloudproperties.py
49
3631
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
tareqalayan/ansible
lib/ansible/plugins/filter/json_query.py
197
1857
# (c) 2015, Filipe Niero Felisbino <filipenf@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 l...
gpl-3.0
streed/antZoo
antZoo/clusterView/app.py
1
2109
import random import uuid from flask import Flask, render_template from flask.ext.wtf import Form from wtforms import TextField from wtforms.validators import Required from ..gossipService.gossiping.ttypes import GossipData from ..gossip import make_client app = Flask( __name__ ) nodes = [ { "address": "localho...
mit
CompSciCabal/SMRTYPRTY
experiments/scott/immutable_strings/test_strings.py
1
4272
import unittest from itertools import product from .str_default import String from .str_list import ListString from .str_bst import BSTString from .str_ll import LinkedListString from .str_rope import RopeString from .str_mway import MWayString class TestDefault(unittest.TestCase): def setUp(self): self....
unlicense
wenboyu2/yahoo-earnings-calendar
yahoo_earnings_calendar/scraper.py
1
6689
''' Yahoo! Earnings Calendar scraper ''' import datetime import json import logging import requests import time BASE_URL = 'https://finance.yahoo.com/calendar/earnings' BASE_STOCK_URL = 'https://finance.yahoo.com/quote' RATE_LIMIT = 2000.0 SLEEP_BETWEEN_REQUESTS_S = 60 * 60 / RATE_LIMIT OFFSET_STEP = 100 # Logging co...
mit
TyberiusPrime/nikola
nikola/data/themes/base/messages/messages_fil.py
28
1044
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "%d min remaining to read": "", "(active)": "", "Also available in:": "", "Archive": "", "Authors": "", "Categories": "", "Comments": "", "LANGUAGE": "", "Languages:": "", "More posts about %s": "", ...
mit
aakash-cr7/zulip
zerver/lib/response.py
13
2084
from __future__ import absolute_import from django.http import HttpResponse, HttpResponseNotAllowed import ujson from typing import Optional, Any, Dict, List, Text from zerver.lib.str_utils import force_bytes class HttpResponseUnauthorized(HttpResponse): status_code = 401 def __init__(self, realm, www_auth...
apache-2.0
Krozark/Harpe-v1.0
Harpe-server/Harpe-website/Kraggne/contrib/flatblocks/admin.py
3
2508
from django.contrib import admin from django.conf import settings from django.utils.translation import ugettext_lazy as _ from Kraggne.contrib.flatblocks.models import GenericFlatblock, GenericFlatblockList, TemplateBlock from Kraggne.contrib.flatblocks.forms import GenericFlatblockListForm, GenericFlatblockForm, Tempa...
bsd-2-clause
marc-sensenich/ansible
lib/ansible/modules/network/f5/bigip_cli_script.py
14
13966
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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
tamland/actors
actors/utils/ask.py
2
1341
# -*- coding: utf-8 -*- # # Copyright 2015 Thomas Amland # # 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...
gpl-3.0
ivanhorvath/openshift-tools
openshift/installer/vendored/openshift-ansible-3.7.42-1/roles/lib_openshift/library/oc_label.py
6
59262
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
apache-2.0
tornadozou/tensorflow
tensorflow/contrib/saved_model/__init__.py
109
1411
# 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
tafaRU/l10n-switzerland
__unported__/l10n_ch_sepa/base_sepa/msg_sepa.py
4
3006
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2011 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
linsalrob/EdwardsLab
bin/resample.py
1
1678
""" Resample 80% of the data and plot a graph of how many new things we see. This is to answer an argument with Geni """ import os import sys import argparse import matplotlib.pyplot as plt from random import shuffle def resample(size, percent, tries): if percent > 1: percent /= 100 # define an arra...
mit
kyuupichan/electrum
lib/qrscanner.py
1
3449
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
mit
grupoprog3/proyecto_final
Entrega Final/flask/Lib/site-packages/pip/_vendor/requests/packages/urllib3/response.py
360
18615
from __future__ import absolute_import from contextlib import contextmanager import zlib import io from socket import timeout as SocketTimeout from socket import error as SocketError from ._collections import HTTPHeaderDict from .exceptions import ( ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked ...
apache-2.0
ericpre/hyperspy
hyperspy/tests/io/test_edax.py
1
19259
import gc import hashlib import os import os.path import tempfile import zipfile import numpy as np import pytest import requests from hyperspy import signals from hyperspy.io import load MY_PATH = os.path.dirname(__file__) ZIPF = os.path.join(MY_PATH, "edax_files.zip") TMP_DIR = tempfile.TemporaryDirectory() TEST_F...
gpl-3.0
nansencenter/DAPPER
dapper/da_methods/__init__.py
1
5619
"""Contains the data assimilation methods included with DAPPER. See the README section on [DA Methods](https://github.com/nansencenter/DAPPER#DA-Methods) for an overview of the methods included with DAPPER. ## Defining your own method Follow the example of one of the methods within one of the sub-directories/package...
mit
carsonmcdonald/electron
script/upload-index-json.py
105
1152
#!/usr/bin/env python import os import sys from lib.config import PLATFORM, s3_config from lib.util import atom_gyp, execute, s3put, scoped_cwd SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') PROJECT_NAME = atom_gyp()['project_name%'] PR...
mit
inspirehep/invenio
modules/bibformat/lib/bibformat_engine.py
2
93734
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2016, 2020 CERN. ## ## Invenio 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 ve...
gpl-2.0
staticlibs/android-ndk-r9d-arm-linux-androideabi-4.8
lib/python2.7/genericpath.py
246
3015
""" Path operations common to more than one OS Do not use directly. The OS specific modules import the appropriate functions from this module themselves. """ import os import stat __all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime', 'getsize', 'isdir', 'isfile'] # Does a path exist? #...
gpl-2.0
0k/OpenUpgrade
addons/pos_discount/__init__.py
315
1072
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
yaoxiaoyong/CocosBuilder
CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
48
73263
# 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. import copy import hashlib import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common import gyp.msvs_...
mit
qma/pants
tests/python/pants_test/backend/python/tasks/checkstyle/test_trailing_whitespace.py
2
2007
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.p...
apache-2.0
GauravSahu/odoo
addons/stock_dropshipping/stock_dropshipping.py
160
2228
# coding: utf-8 from openerp import models, api, _ from openerp.exceptions import Warning class sale_order_line(models.Model): _inherit = 'sale.order.line' @api.multi def _check_routing(self, product, warehouse): """ skip stock verification if the route goes from supplier to customer ...
agpl-3.0
odoomrp/server-tools
super_calendar/__openerp__.py
9
2125
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) All rights reserved: # (c) 2012-2015 Agile Business Group sagl (<http://www.agilebg.com>) # Lorenzo Battistini <lorenzo.battistini@agilebg.com> # (c) 2012 D...
agpl-3.0