repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
hachard/Cra-Magnet
flask/lib/python3.5/site-packages/migrate/changeset/schema.py
66
24237
""" Schema module providing common schema operations. """ import abc try: # Python 3 from collections import MutableMapping as DictMixin except ImportError: # Python 2 from UserDict import DictMixin import warnings import six import sqlalchemy from sqlalchemy.schema import ForeignKeyConstraint from sqlal...
gpl-3.0
mvaled/OpenUpgrade
openerp/report/print_fnc.py
458
1318
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
ohsangjin/git-core
contrib/hg-to-git/hg-to-git.py
342
8074
#!/usr/bin/env python """ hg-to-git.py - A Mercurial to GIT converter Copyright (C)2007 Stelian Pop <stelian@popies.net> 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 versi...
gpl-2.0
minhphung171093/GreenERP
openerp/tools/pdf_utils.py
72
2702
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ Copyright (c) 2003-2007 LOGILAB S.A. (Paris, FRANCE). http://www.logilab.fr/ -- mailto:contact@logilab.fr manipulate pdf and fdf files. pdftk recommended. Notes regarding pdftk, pdf forms and fdf files (form defin...
gpl-3.0
smartdata-x/robots
pylib/Twisted/twisted/web/test/test_static.py
28
56293
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.static}. """ import inspect import mimetypes import os import re import StringIO from zope.interface.verify import verifyObject from twisted.internet import abstract, interfaces from twisted.python.runtime import plat...
apache-2.0
MattsFleaMarket/python-for-android
python3-alpha/python3-src/Lib/idlelib/SearchDialogBase.py
55
4385
from tkinter import * class SearchDialogBase: title = "Search Dialog" icon = "Search" needwrapbutton = 1 def __init__(self, root, engine): self.root = root self.engine = engine self.top = None def open(self, text, searchphrase=None): self.text = text if no...
apache-2.0
cfelton/minnesota
examples/cores/fpgalink/led/fpgalink_led.py
1
2713
from myhdl import * from mn.cores.usb_ext import fl_fx2 from mn.cores.usb_ext import fpgalink_fx2 def fpgalink_led( # ~~ FX2 interface signals ~~ IFCLK, # 48 MHz clock from FX2 RST, # active low async reset SLWR, # active low write strobe SLRD, # active low read strobe ...
gpl-3.0
huawei-cloud/compass
compass/hdsdiscovery/utils.py
4
4810
"""Utility functions Including functions of get/getbulk/walk/set of snmp for three versions """ import imp import re import logging def load_module(mod_name, path, host=None, credential=None): """ Load a module instance. :param str mod_name: module name :param str path: directory of the module :pa...
apache-2.0
miguelparaiso/PracticaOdoo
addons/website_membership/models/product.py
338
1264
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-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
google/cloudprint_logocert
_ticket.py
1
5318
"""Copyright 2016 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 agreed to in ...
apache-2.0
Acehaidrey/incubator-airflow
airflow/migrations/versions/1507a7289a2f_create_is_encrypted.py
8
2164
# # 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
JCBarahona/edX
common/djangoapps/student/helpers.py
9
10576
"""Helpers for the student app. """ from datetime import datetime import urllib from pytz import UTC from django.core.urlresolvers import reverse, NoReverseMatch import third_party_auth from verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification # pylint: disable=import-error from course_...
agpl-3.0
ric2b/Vivaldi-browser
chromium/build/toolchain/win/tool_wrapper.py
1
8967
# 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. """Utility functions for Windows builds. This file is copied to the build directory as part of toolchain setup and is used to set up calls to tools used...
bsd-3-clause
acenario/Payable
lib/python2.7/site-packages/django/template/engine.py
38
10794
import warnings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache, six from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import cached_property from django.utils.module_loading import import_string from .base import Context, Lexer, Par...
mit
tadeegan/eiger-application-aware
test/system/test_thrift_server.py
3
101018
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
brainstorm/python_koans
python3/koans/about_iteration.py
8
4399
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutIteration(Koan): def test_iterators_are_a_type(self): it = iter(range(1,6)) fib = 0 for num in it: fib += num self.assertEqual(__ , fib) def test_iter...
mit
CriticalD20/Final-Project
ggame/headlessdeps.py
228
9672
def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True if module_exists('PIL'): from PIL import Image class _body(object): def __init__(self): self.events = {} def appendChild(self, obj): self...
mit
laurentgo/pants
src/python/pants/backend/codegen/register.py
9
2481
# coding=utf-8 # Copyright 2014 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.c...
apache-2.0
hajgato/easybuild-easyblocks
easybuild/easyblocks/s/suitesparse.py
4
7013
## # Copyright 2009-2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
AmurG/tardis
tardis/simulation.py
11
2036
import logging import time from pandas import HDFStore import os # Adding logging support logger = logging.getLogger(__name__) def run_radial1d(radial1d_model, history_fname=None): if history_fname: if os.path.exists(history_fname): logger.warn('History file %s exists - it will be overwritten...
bsd-3-clause
detrout/debian-statsmodels
statsmodels/stats/tabledist.py
34
11643
# -*- coding: utf-8 -*- """ Created on Sat Oct 01 20:20:16 2011 Author: Josef Perktold License: BSD-3 TODO: check orientation, size and alpha should be increasing for interp1d, but what is alpha? can be either sf or cdf probability change it to use one consistent notation check: instead of bound checking I could us...
bsd-3-clause
ConeyLiu/spark
examples/src/main/python/ml/power_iteration_clustering_example.py
54
1604
# # 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 us...
apache-2.0
willworth/thermos
thermos/Lib/site-packages/pip/utils/logging.py
516
3327
from __future__ import absolute_import import contextlib import logging import logging.handlers import os try: import threading except ImportError: import dummy_threading as threading from pip.compat import WINDOWS from pip.utils import ensure_dir try: from pip._vendor import colorama # Lots of differen...
mit
littlepea/django-docs
docs/tests/runtests.py
1
1998
#!/usr/bin/env python """ This script is a trick to setup a fake Django environment, since this reusable app will be developed and tested outside any specific Django project. Via ``settings.configure`` you will be able to set all necessary settings for your app and run the tests as if you were calling ``./manage.py te...
bsd-3-clause
fone4u/python-oauth2
tests/test_oauth.py
301
53269
# -*- coding: utf-8 -*- """ The MIT License Copyright (c) 2009 Vic Fryzel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, co...
mit
helloiloveit/VkxPhoneProject
submodules/externals/libvpx/third_party/googletest/src/test/gtest_throw_on_failure_test.py
2917
5766
#!/usr/bin/env python # # Copyright 2009, 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...
gpl-2.0
CosmicFish/CosmicFish
bundled/doxygen/testing/testsqlite3.py
27
3977
#! /usr/bin/python from xml.etree import cElementTree as ET import os import sqlite3 import sys import getopt # map XML attributes/elements to SQL rows # --POC: iterate through the children and attributes of the memberdef elelement # and search it in doxygen_sqlite3.db g_conn=None val=[] def print_unprocessed_...
gpl-3.0
OpenFacetracker/facetracker-core
lib/youtube-dl/youtube_dl/extractor/fourtube.py
39
3885
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, ) from ..utils import ( parse_duration, parse_iso8601, str_to_int, ) class FourTubeIE(InfoExtractor): IE_NAME = '4tube' _VALID_URL = r'https?://(?:www\.)?4tube\.c...
gpl-2.0
aboutsajjad/Bridge
app_packages/youtube_dl/extractor/streetvoice.py
60
1615
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import unified_strdate class StreetVoiceIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?streetvoice\.com/[^/]+/songs/(?P<id>[0-9]+)' _TESTS = [{ 'url': 'http://s...
mit
txemi/ansible
lib/ansible/modules/network/panos/panos_address.py
78
6066
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
veloutin/papas
lib6ko/tests/mocks/interactive_console.py
1
2406
# PAPAS Access Point Administration System # Copyright (c) 2010 Revolution Linux inc. <info@revolutionlinux.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the ...
agpl-3.0
konstruktoid/ansible-upstream
lib/ansible/module_utils/network/junos/junos.py
19
13610
# # (c) 2017 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 ...
gpl-3.0
home-assistant/home-assistant
homeassistant/components/smappee/sensor.py
2
12427
"""Support for monitoring a Smappee energy sensor.""" from homeassistant.components.sensor import SensorEntity from homeassistant.const import DEVICE_CLASS_POWER, ENERGY_WATT_HOUR, POWER_WATT, VOLT from .const import DOMAIN TREND_SENSORS = { "total_power": [ "Total consumption - Active power", Non...
apache-2.0
j-mracek/ci-dnf-stack
dnf-docker-test/features/steps/gpg_steps.py
2
4886
from __future__ import absolute_import from __future__ import unicode_literals import jinja2 from whichcraft import which from behave import given from command_steps import step_i_successfully_run_command import table_utils GPGKEY_CONF_TMPL = """ %no-protection %transient-key Key-Type: {{ key_type|default("RSA") }}...
gpl-3.0
shizhai/wprobe
staging_dir/host/lib/scons-2.1.0/SCons/compat/_scons_hashlib.py
21
2524
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # 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-2.0
stefanfoulis/django-cms
cms/south_migrations/0001_initial.py
48
30500
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
kevlar1818/dotfiles
bspwm/.config/polybar/package_update_checker.py
1
1205
#!/usr/bin/env python import sys from subprocess import run def colorize_text(text, color): return f'%{{F{color}}}{text}%{{F-}}' if __name__ == '__main__': xrdb = run('xrdb -query', shell=True, capture_output=True, text=True, check=True) raw_colors = ( line.replace('*', '').split(':') f...
mit
djboersma/puppy
mhd_zpad.py
1
7768
#!/usr/bin/env python import SimpleITK as sitk import numpy as np def zpad(img,nzbot=0,nztop=0): """ Return an augmented copy of an image object: the central part is the same as the original, but we add nzbot (nztop) copies of the bottom (top) layer to the bottom (top). """ if type(img) != sit...
gpl-3.0
nubark/odoo
addons/mrp/mrp.py
2
73120
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from collections import OrderedDict import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools import float_comp...
gpl-3.0
jabesq/home-assistant
homeassistant/components/file/notify.py
7
1796
"""Support for file notification.""" import logging import os import voluptuous as vol from homeassistant.const import CONF_FILENAME import homeassistant.helpers.config_validation as cv import homeassistant.util.dt as dt_util from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_...
apache-2.0
bsipocz/statsmodels
statsmodels/graphics/tests/test_mosaicplot.py
17
18878
from __future__ import division from statsmodels.compat.python import iterkeys, zip, lrange, iteritems, range from numpy.testing import assert_, assert_raises, dec from numpy.testing import run_module_suite # utilities for the tests from statsmodels.compat.collections import OrderedDict from statsmodels.api import d...
bsd-3-clause
RJVB/audacity
lib-src/lv2/lv2/waflib/Build.py
265
20971
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys,errno,re,shutil try: import cPickle except ImportError: import pickle as cPickle from waflib import Runner,TaskGen,Utils,ConfigSet,Task,Logs,Options,Context,Er...
gpl-2.0
aselle/tensorflow
tensorflow/contrib/tensorrt/test/test_tftrt.py
13
9983
# 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
Ragowit/fireplace
tests/test_tgt.py
2
19665
from utils import * def test_anubarak(): game = prepare_empty_game() anubarak = game.player1.give("AT_036") anubarak.play() game.player1.discard_hand() assert len(game.player1.field) == 1 assert len(game.player1.hand) == 0 anubarak.destroy() assert len(game.player1.field) == 1 assert len(game.player1.hand) =...
agpl-3.0
mattsch/Sickbeard
cherrypy/tutorial/tut04_complex_site.py
2
2889
""" Tutorial - Multiple objects This tutorial shows you how to create a site structure through multiple possibly nested request handler objects. """ import cherrypy class HomePage: def index(self): return ''' <p>Hi, this is the home page! Check out the other fun stu...
gpl-3.0
ZHAW-INES/rioxo-uClinux-dist
user/python/python-2.4.4/Lib/xdrlib.py
5
7353
"""Implements (a subset of) Sun XDR -- eXternal Data Representation. See: RFC 1014 """ import struct try: from cStringIO import StringIO as _StringIO except ImportError: from StringIO import StringIO as _StringIO __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] # exceptions class Error(Exceptio...
gpl-2.0
imsparsh/python-social-auth
social/backends/exacttarget.py
12
3066
""" ExactTarget OAuth support. Support Authentication from IMH using JWT token and pre-shared key. Requires package pyjwt """ from datetime import timedelta, datetime import jwt from social.exceptions import AuthFailed, AuthCanceled from social.backends.oauth import BaseOAuth2 class ExactTargetOAuth2(BaseOAuth2): ...
bsd-3-clause
Russell-IO/ansible
lib/ansible/modules/cloud/ovirt/ovirt_networks_facts.py
73
3447
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (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 #...
gpl-3.0
camilonova/django-pipeline
pipeline/manifest.py
18
2084
from __future__ import unicode_literals import os from django.contrib.staticfiles.finders import get_finders from pipeline.conf import settings from manifesto import Manifest from pipeline.packager import Packager class PipelineManifest(Manifest): def __init__(self): self.packager = Packager() ...
mit
freevo/freevo1
src/plugins/idlebar/cdstatus.py
1
3044
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------- # cdstatus.py - IdleBarplugin for monitoring the cdstatus # ----------------------------------------------------------------------- # $Id$ # # ----------------------------------------------------------------------- # ...
gpl-2.0
proxysh/Safejumper-for-Desktop
buildlinux/env64/lib/python2.7/site-packages/twisted/internet/iocpreactor/tcp.py
13
19849
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ TCP support for IOCP reactor """ import socket, operator, errno, struct from zope.interface import implementer, classImplements from twisted.internet import interfaces, error, address, main, defer from twisted.internet.protocol import Proto...
gpl-2.0
rgfernandes/libesedb
setup.py
3
7773
#!/usr/bin/env python # # Script to build and install Python-bindings. # Version: 20150725 import glob import platform import os import shutil import subprocess import sys from distutils import sysconfig from distutils import util from distutils.ccompiler import new_compiler from distutils.command.build_ext import bu...
lgpl-3.0
himleyb85/django
django/contrib/gis/db/backends/spatialite/operations.py
24
10581
""" SQL functions reference lists: http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html https://web.archive.org/web/20130407175746/http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html """ import re import sys from django.contrib.gis.db....
bsd-3-clause
mlc0202/vitess
test/queryservice_tests/cache_tests.py
9
11106
from vtdb import dbexceptions from vtdb import field_types import framework import cache_cases1 import cache_cases2 import cases_framework class TestWillNotBeCached(framework.TestCase): def setUp(self): self.env.log.reset() def tearDown(self): self.env.execute("drop table vtocc_nocache") def test_no...
bsd-3-clause
jundongl/scikit-feast
skfeature/example/test_SPEC.py
3
1385
import scipy.io from skfeature.function.similarity_based import SPEC from skfeature.utility import unsupervised_evaluation def main(): # load data mat = scipy.io.loadmat('../data/COIL20.mat') X = mat['X'] # data X = X.astype(float) y = mat['Y'] # label y = y[:, 0] # specify the seco...
gpl-2.0
playm2mboy/edx-platform
common/test/acceptance/pages/studio/component_editor.py
73
5069
from bok_choy.page_object import PageObject from selenium.webdriver.common.keys import Keys from ..common.utils import click_css from selenium.webdriver.support.ui import Select class BaseComponentEditorView(PageObject): """ A base :class:`.PageObject` for the component and visibility editors. This class...
agpl-3.0
basicthinker/Sexain-MemController
gem5-stable/src/mem/slicc/ast/CheckAllocateStatementAST.py
91
2239
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
apache-2.0
memtoko/django
docs/conf.py
6
11881
# -*- coding: utf-8 -*- # # Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
bsd-3-clause
im-infamou5/volatility
volatility/timefmt.py
54
4522
# Volatility # # Authors: # Mike Auty <mike.auty@gmail.com> # # This file is part of Volatility. # # Volatility 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 op...
gpl-2.0
dcroc16/skunk_works
google_appengine/lib/django-1.2/django/core/handlers/modpython.py
71
9160
import os from pprint import pformat from django import http from django.core import signals from django.core.handlers.base import BaseHandler from django.core.urlresolvers import set_script_prefix from django.utils import datastructures from django.utils.encoding import force_unicode, smart_str, iri_to_uri # NOTE: d...
mit
elopio/snapcraft
snapcraft/plugins/jdk.py
13
1395
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
pamapa/callblocker
usr/var/www/callblocker/python-fcgi/api.py
1
2252
#!/usr/bin/env python3 # callblocker - blocking unwanted calls from your home phone # Copyright (C) 2015-2020 Patrick Ammann <pammann@gmx.net> # # 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; ...
gpl-2.0
aimas/TuniErp-8.0
addons/account_followup/__init__.py
436
1098
# -*- 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 GNU...
agpl-3.0
ogenstad/ansible
lib/ansible/modules/network/avi/avi_sslprofile.py
23
8496
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
liorvh/golismero
thirdparty_libs/yaml/resolver.py
474
8972
__all__ = ['BaseResolver', 'Resolver'] from error import * from nodes import * import re class ResolverError(YAMLError): pass class BaseResolver(object): DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str' DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq' DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map' ...
gpl-2.0
Sorsly/subtle
google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/emr/test_emr_responses.py
98
17266
# Copyright (c) 2010 Jeremy Thurgood <firxen+boto@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, mod...
mit
aselle/tensorflow
tensorflow/examples/speech_commands/freeze_test.py
5
3289
# 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
Russell-IO/ansible
lib/ansible/modules/commands/telnet.py
33
2576
# this is a virtual module that is entirely implemented server side # 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...
gpl-3.0
rigid/jobpip3
tests/test_record.py
1
1172
import unittest from jobpip3 import Record class TestRecord(unittest.TestCase): """Record() tests""" def test_dict(self): """a Record() mimics a dict. Test that here""" # create a record a = Record() # __setattr__ a['foo'] = 2.5 self.assertEqual(a['foo'],...
gpl-3.0
karanvivekbhargava/robot-butler-enpm808x
vendor/googletest/googletest/test/gtest_test_utils.py
344
10823
#!/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...
mit
plilja/project-euler
problem_60/prime_set.py
1
1038
import sys from ast import literal_eval import os infile = open(os.path.join(os.path.dirname(__file__), 'prime_pairs.txt')) PRIME_PAIRS = literal_eval(infile.read()) for key in PRIME_PAIRS.keys(): PRIME_PAIRS[key] = set(PRIME_PAIRS[key]) # literal_eval doesn't support sets, hence we convert here infile.close() ...
apache-2.0
vjmac15/Lyilis
lib/youtube_dl/extractor/skysports (VJ Washington's conflicted copy 2017-08-29).py
34
1156
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import strip_or_none class SkySportsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?skysports\.com/watch/video/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.skysports.com/watch/video/10328419/ba...
gpl-3.0
piyush0609/scipy
scipy/weave/tests/test_numpy_scalar_spec.py
91
4001
from __future__ import absolute_import, print_function import os import sys import tempfile import numpy from numpy.testing import TestCase, assert_, run_module_suite from scipy.weave import inline_tools, ext_tools from scipy.weave.build_tools import msvc_exists, gcc_exists from scipy.weave.catalog import unique_fil...
bsd-3-clause
weblabdeusto/weblabdeusto
server/src/test/unit/weblab/translator/test_stores_everything_except_for_files_translator.py
3
1892
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, # list...
bsd-2-clause
srthurman/transitland-python-client
transitland/route.py
2
1704
"""Route Entity.""" import geom import util import errors from entity import Entity class Route(Entity): """Transitland Route Entity.""" onestop_type = 'r' def geohash(self): """Return 10 characters of geohash.""" return geom.geohash_features(self.stops()) def add_tags_gtfs(self, gtfs_entity): ke...
mit
meisterpeeps/grpc
src/python/src/grpc/_cython/adapter_low.py
3
3285
# 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
gerco/p2pool
p2pool/test/bitcoin/test_getwork.py
275
4273
import unittest from p2pool.bitcoin import getwork, data as bitcoin_data class Test(unittest.TestCase): def test_all(self): cases = [ { 'target': '0000000000000000000000000000000000000000000000f2b944000000000000', 'midstate': '5982f893102dec03e374b472647c4f19b1b...
gpl-3.0
alexandrucoman/vbox-nova-driver
nova/tests/functional/v3/test_availability_zone.py
23
2082
# Copyright 2013 IBM Corp. # # 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 t...
apache-2.0
Carmezim/tensorflow
tensorflow/contrib/slim/python/slim/nets/inception_v2_test.py
111
11157
# 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
betoesquivel/fil2014
build/django/build/lib.linux-x86_64-2.7/django/contrib/gis/gdal/prototypes/geom.py
219
4737
from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope from django.contrib.gis.gdal.prototypes.generation import (const_s...
mit
yongshengwang/hue
build/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
2040
8935
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
apache-2.0
ishay2b/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/transforms/sum.py
102
1987
# 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
geier/alot
alot/commands/thread.py
1
46406
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file from __future__ import absolute_import import argparse import logging import mailcap import os import re import subprocess import temp...
gpl-3.0
raxenak/borg
src/borg/platform/base.py
2
6272
import errno import os from borg.helpers import truncate_and_unlink """ platform base module ==================== Contains platform API implementations based on what Python itself provides. More specific APIs are stubs in this module. When functions in this module use platform APIs themselves they access the public...
bsd-3-clause
CorySimon/pyIAST
test/python_scripts/Test IAST for Langmuir case.py
2
7330
# coding: utf-8 # # Test pyIAST for match with competitive Langmuir model # In the case that the pure-component isotherms $N_{i,pure}(P)$ follow the Langmuir model with the same saturation loading $M$: # # $N_{i,pure} = M \frac{K_iP}{1+K_iP},$ # # The mixed gas adsorption isotherm follows the competitive Langmuir iso...
mit
stasiek/robotframework
src/robot/running/timeouts/jython.py
26
1627
# Copyright 2008-2015 Nokia Solutions and Networks # # 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
jmmartinez84/yowsup
yowsup/layers/protocol_contacts/protocolentities/notification_contact_remove.py
68
1295
from yowsup.structs import ProtocolTreeNode from .notification_contact import ContactNotificationProtocolEntity class RemoveContactNotificationProtocolEntity(ContactNotificationProtocolEntity): ''' <notification offline="0" id="{{NOTIFICATION_ID}}" notify="{{NOTIFY_NAME}}" type="contacts" t="{{TIME...
gpl-3.0
tachylyte/HydroGeoPy
conversion.py
1
1110
# Useful unit conversions def secsToDays(s): '''Assume s is time in seconds and a positive integer or float. Return time in days''' days = s / (60 * 60 * 24) return days def daysToSecs(d): '''Assume d is time in days and a positive integer or float. Return time in seconds''' secs = (60 * ...
bsd-2-clause
mhbu50/frappe
frappe/desk/doctype/desktop_icon/test_desktop_icon.py
10
2904
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from frappe.desk.doctype.desktop_icon.desktop_icon import (get_desktop_icons, add_user_icon, set_hidden_list, set_order, clear_desktop_i...
mit
jjmachan/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/contrib/gis/db/backends/oracle/adapter.py
273
1866
from cx_Oracle import CLOB from django.contrib.gis.db.backends.base.adapter import WKTAdapter from django.contrib.gis.geos import GeometryCollection, Polygon from django.utils.six.moves import range class OracleSpatialAdapter(WKTAdapter): input_size = CLOB def __init__(self, geom): """ Oracl...
mit
fxfitz/ansible
lib/ansible/modules/cloud/amazon/rds_instance_facts.py
5
12095
#!/usr/bin/python # Copyright (c) 2017, 2018 Michael De La Rue # Copyright (c) 2017, 2018 Will Thames # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'communi...
gpl-3.0
davidsims9t/itis-graphql
venv/lib/python3.4/site-packages/setuptools/namespaces.py
54
2648
import os from distutils import log import itertools from setuptools.extern.six.moves import map flatten = itertools.chain.from_iterable class Installer: nspkg_ext = '-nspkg.pth' def install_namespaces(self): nsp = self._get_all_ns_packages() if not nsp: return filenam...
gpl-3.0
jthomm/game-center-db
gcdb/__init__.py
1
18930
__version__ = '0.0.1' """Reading and executing SQL""" from os import path class Table(object): """Given a table name and a `sqlite3.Cursor`, execute `CREATE TABLE` and `INSERT INTO`. """ SQL_PATH = path.abspath(path.join(path.dirname(__file__), 'sql')) def __init__(self, name): self....
mit
maiome-development/malibu
src/malibu/design/borgish.py
1
2517
# -*- coding: utf-8 -*- __doc__ = """ malibu.design.borgish --------------------- Borgish was designed as a more extended implementation of Alex Martelli's Borg design pattern, which aims to provide state consistency similar to a singleton design, but without the terribleness of singletons. """ class SharedState(ob...
unlicense
Dino0631/RedRain-Bot
lib/youtube_dl/extractor/cracked.py
170
3213
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_iso8601, str_to_int, ) class CrackedIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?cracked\.com/video_(?P<id>\d+)_[\da-z-]+\.html' _TESTS = [{ 'url': 'http://www.cracked.com/...
gpl-3.0
Abdoctor/behave
features/steps/behave_active_tags_steps.py
4
3394
# -*- coding: UTF-8 -*- """ .. code-block:: gherkin Given I setup the current values for active tags with: | category | value | | foo | xxx | Then the following active tag combinations are enabled: | tags | enabled? | | @active.with_foo=xxx ...
bsd-2-clause
dwhswenson/mdtraj
mdtraj/formats/prmtop.py
10
9196
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: TJ Lane # Contributors: Robert McGibbon, Jason Swails # # MDTr...
lgpl-2.1
minghuascode/pyj
examples/hangman/Wordlist_15.py
8
5084
words=[ 'counterintelligence', 'interdenominational', 'nonrepresentational', 'characteristically', 'chlorofluorocarbon', 'disproportionately', 'electrocardiograph', 'oversimplification', 'telecommunications', 'transubstantiation', 'commercialization', 'comprehensiveness', 'conscientiousness', 'constitutionality', 'cont...
apache-2.0
Doctor777/d8
themes/custom/my_bootstrap/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
1569
23354
#!/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. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
gpl-2.0
spbguru/repo1
tests/unit/py2/nupic/encoders/vector_test.py
4
3552
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0