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
marczellm/algorimp
weimar/_parser.py
1
3033
""" A parser for chord progressions in the Weimar Jazzomat CSV format """ import re from itertools import chain from typing import Tuple, Optional from music import ABCNote, ChordType, Chord, ChordProgression, Note _chordtype_mapping = { '': ChordType.maj, '6': ChordType.maj, 'j7': ChordType.maj, '-7'...
gpl-3.0
wbc2010/django1.2.5
django1.2.5/django/contrib/gis/utils/srs.py
311
3157
from django.contrib.gis.gdal import SpatialReference from django.db import connections, DEFAULT_DB_ALIAS def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None, database=DEFAULT_DB_ALIAS): """ This function takes a GDAL SpatialReference system and adds its information ...
bsd-3-clause
borisroman/vdsm
tests/blockVolumeTests.py
1
2058
# # Copyright 2015 Red Hat, Inc. # # 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 th...
gpl-2.0
moypray/flocker
flocker/node/agents/functional/test_cinder.py
5
5116
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Functional tests for ``flocker.node.agents.cinder`` using a real OpenStack cluster. Ideally, there'd be some in-memory tests too. Some ideas: * Maybe start a `mimic` server and use it to at test just the authentication step. * Mimic doesn't current...
apache-2.0
Alphadelta14/ansible
lib/ansible/new_inventory/host.py
236
1551
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
kwagyeman/openmv
scripts/examples/OpenMV/02-Board-Control/cpufreq_scaling.py
4
1117
# CPU frequency scaling example. # # This example shows how to use the cpufreq module to change the CPU frequency on the fly. import sensor, image, time, cpufreq sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE...
mit
feroda/odoo
addons/base_report_designer/base_report_designer.py
314
3433
# -*- 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
dhesse/tree-level-improve
tli.py
1
8135
# -*- coding: utf-8 -*- r""" :mod:`tli` -- Tree level improvement. ========================================= Calculate tree level improvements for lattice QCD observables in the spirit of [1]_. Given an observable :math:`{\mathcal O}(a/L)`, one defines the improved observable .. math:: {\mathcal O}_\mathrm{I}(a/...
mit
lokeshh/stem
stem/connection.py
4
48655
# Copyright 2011-2014, Damian Johnson and The Tor Project # See LICENSE for licensing information """ Functions for connecting and authenticating to the tor process. The :func:`~stem.connection.connect` function give an easy, one line method for getting an authenticated control connection. This is handy for CLI appli...
lgpl-3.0
TomBaxter/waterbutler
waterbutler/server/api/v0/move.py
6
1852
import time from waterbutler import tasks from waterbutler.server.api.v0 import core from waterbutler.core import remote_logging class MoveHandler(core.BaseCrossProviderHandler): JSON_REQUIRED = True ACTION_MAP = { 'POST': 'move' } async def post(self): if not self.source_provider.ca...
apache-2.0
Edraak/edx-platform
common/djangoapps/dark_lang/tests.py
46
10165
""" Tests of DarkLangMiddleware """ from django.contrib.auth.models import User from django.http import HttpRequest import ddt from django.test import TestCase from mock import Mock import unittest from dark_lang.middleware import DarkLangMiddleware from dark_lang.models import DarkLangConfig from django.utils.transl...
agpl-3.0
NL66278/odoo
addons/portal_project/tests/__init__.py
170
1124
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
stevekuznetsov/ansible
lib/ansible/module_utils/vmware.py
51
16732
# -*- 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 License, or # (at yo...
gpl-3.0
tangyiyong/odoo
addons/analytic_user_function/__init__.py
441
1086
# -*- 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
zzzombat/precise-python-django-social-auth
debian/python-django-social-auth/usr/share/pyshared/social_auth/backends/contrib/weibo.py
2
2383
#coding:utf8 #author:hepochen@gmail.com https://github.com/hepochen """ Weibo OAuth2 support. This script adds support for Weibo OAuth service. An application must be registered first on http://open.weibo.com. WEIBO_CLIENT_KEY and WEIBO_CLIENT_SECRET must be defined in the settings.py correctly. By default account ...
bsd-3-clause
ghandiosm/Test
addons/google_spreadsheet/google_spreadsheet.py
41
4717
# Part of Odoo. See LICENSE file for full copyright and licensing details. import cgi import json import logging from lxml import etree import re import werkzeug.urls import urllib2 from openerp.osv import osv from openerp.addons.google_account import TIMEOUT _logger = logging.getLogger(__name__) class config(osv.o...
gpl-3.0
yiakwy/numpy
numpy/doc/misc.py
124
6164
""" ============= Miscellaneous ============= IEEE 754 Floating Point Special Values -------------------------------------- Special values defined in numpy: nan, inf, NaNs can be used as a poor-man's mask (if you don't care what the original value was) Note: cannot use equality to test NaNs. E.g.: :: >>> myarr = ...
bsd-3-clause
mnahm5/django-estore
Lib/site-packages/crispy_forms/base.py
19
1042
def from_iterable(iterables): """ Backport of `itertools.chain.from_iterable` compatible with Python 2.5 """ for it in iterables: for element in it: if isinstance(element, dict): for key in element: yield key else: yield...
mit
beswarm/django-allauth
allauth/socialaccount/providers/flickr/provider.py
50
2011
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class FlickrAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data \ .get('person')...
mit
fluxw42/youtube-dl
youtube_dl/extractor/urort.py
64
2249
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_urllib_parse, ) from ..utils import ( unified_strdate, ) class UrortIE(InfoExtractor): IE_DESC = 'NRK P3 Urørt' _VALID_URL = r'https?://(?:www\.)?urort\.p3\.no/#!/Band/(?P<id>[^/]+)...
unlicense
yw374cornell/e-mission-server
emission/analysis/result/carbon.py
2
12278
# Standard imports import logging from datetime import datetime, timedelta from uuid import UUID # Our imports import emission.net.api.distance as distance # from get_database import get_user_db from emission.core.wrapper.user import User from emission.core.common import getDistinctUserCount, getAllModes, getDisplayMo...
bsd-3-clause
botswana-harvard/getresults-distribute
getresults_dst/actions.py
2
2794
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Erik van Widenfelt # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # import os import pytz from builtins import FileNotFoundError from datetime import datetime from dja...
gpl-2.0
opentechinstitute/piecewise
piecewise/piecewise/__main__.py
2
6058
import argparse from sqlalchemy import create_engine, MetaData import piecewise.aggregate import piecewise.config import piecewise.ingest import piecewise.query def refine(config, args): modified_aggregations = [] for agg in config.aggregations: if args.only_compute is not None and not agg.name in arg...
apache-2.0
qgis/QGIS
python/plugins/grassprovider/ext/r_li_padcv_ascii.py
45
1440
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_padcv_ascii.py ------------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ********************...
gpl-2.0
xianggong/m2c_unit_test
test/operator/unary_minus_uint8/compile.py
1861
4430
#!/usr/bin/python import os import subprocess import re def runCommand(command): p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) p.wait() return iter(p.stdout.readline, b'') def dumpRunCommand(command,...
gpl-2.0
credativ/pulp
server/test/unit/server/db/migrations/test_0005_unit_last_updated.py
4
1940
from ....base import PulpServerTests from pulp.plugins.types.database import TYPE_COLLECTION_PREFIX from pulp.server.db import connection from pulp.server.db.migrate.models import MigrationModule ID = '_id' LAST_UPDATED = '_last_updated' MIGRATION = 'pulp.server.db.migrations.0005_unit_last_updated' def test_collec...
gpl-2.0
shaanlan/youtube-dl
youtube_dl/extractor/liveleak.py
110
4940
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import int_or_none class LiveLeakIE(InfoExtractor): _VALID_URL = r'https?://(?:\w+\.)?liveleak\.com/view\?(?:.*?)i=(?P<id>[\w_]+)(?:.*)' _TESTS = [{ 'url': 'http://www.liveleak.com/view?i=757...
unlicense
Hellrungj/CSC-412-Networking
Protocol_Buffers/venv/lib/python2.7/site-packages/google/protobuf/service.py
243
9144
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
gpl-3.0
wickman/compactor
tests/test_protobuf_process.py
1
1546
import threading from compactor.context import Context from compactor.process import ProtobufProcess import pytest try: from google.protobuf import descriptor_pb2 HAS_PROTOBUF = True except ImportError: HAS_PROTOBUF = False import logging logging.basicConfig() # Send from one to another, swap out contexts t...
apache-2.0
realincubus/pluto_clang
orio-0.1.0/src/main/ann_parser.py
5
9643
# # Parser to extract annotations from the source code # import re, sys import code_frag #---------------------------------------- class AnnParser: '''The parser used for annotations extraction''' # regular expressions __vname_re = r'[A-Za-z_]\w*' __any_re = r'(.|\n)' __ann_re = r'/\*@' + __any_...
gpl-3.0
LeartS/odoo
addons/payment_adyen/models/adyen.py
136
7759
# -*- coding: utf-'8' "-*-" import base64 try: import simplejson as json except ImportError: import json from hashlib import sha1 import hmac import logging import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_adyen.controllers.main import Adye...
agpl-3.0
louislam/android-ocr-precompiled-tesstwo
android/jni/com_googlecode_tesseract_android/src/contrib/tesseract-c_api-demo.py
21
2184
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Zdenko Podobný # Author: Zdenko Podobný # # 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/LIC...
apache-2.0
ROAND/dota2herovoices
.buildozer/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/mbcssm.py
982
19608
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Rights Reserved. # # Con...
gpl-2.0
ltilve/chromium
tools/chrome_proxy/integration_tests/chrome_proxy_metrics_unittest.py
4
15208
# 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 base64 import unittest from integration_tests import chrome_proxy_metrics as metrics from integration_tests import network_metrics_unittest as networ...
bsd-3-clause
HiSPARC/sapphire
scripts/simulations/analyze_shower_front.py
1
5153
import numpy as np import tables from scipy.optimize import curve_fit from scipy.stats import scoreatpercentile from artist import GraphArtist from pylab import * import matplotlib.pyplot as plt import utils USE_TEX = False # For matplotlib plots if USE_TEX: rcParams['font.serif'] = 'Computer Modern' rcPar...
gpl-3.0
spottradingllc/zoom
server/zoom/www/handlers/reload_cache_handler.py
1
1371
import logging import tornado.web from httplib import INTERNAL_SERVER_ERROR from zoom.common.decorators import TimeThis class ReloadCacheHandler(tornado.web.RequestHandler): @property def data_store(self): """ :rtype: zoom.www.cache.data_store.DataStore """ return self.applica...
gpl-2.0
mhnatiuk/phd_sociology_of_religion
scrapper/lib/python2.7/site-packages/twisted/conch/test/test_agent.py
42
13082
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.ssh.agent}. """ import struct from twisted.trial import unittest try: import OpenSSL except ImportError: iosim = None else: from twisted.test import iosim try: import Crypto.Cipher.DES3 except Impo...
gpl-2.0
thetimpotter/bitcoin_1.0
qa/rpc-tests/decodescript.py
26
13617
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_fra...
mit
mseaborn/switch
sandbox_dev/param_v_expression.py
5
4430
#!/usr/local/bin/python # Copyright 2015 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2, which is in the LICENSE file. """ I wrote this script to explore the usage and limitations of parameters and expression objects in Pyomo. I thought they were interchangable, but when I con...
apache-2.0
raspberrydie/Jasper
client/tts.py
9
21928
# -*- coding: utf-8-*- """ A Speaker handles audio output from Jasper to the user Speaker methods: say - output 'phrase' as speech play - play the audio in 'filename' is_available - returns True if the platform supports this implementation """ import os import platform import re import tempfile import subp...
mit
gigglesninja/senior-design
ardupilot/Tools/LogAnalyzer/UnitTest.py
160
8893
#!/usr/bin/env python # # # Unit and regression tests for the LogAnalyzer code # # # TODO: implement more unit+regression tests import DataflashLog import traceback try: # test DataflashLog reading 1 logdata = DataflashLog.DataflashLog() logdata.read("examples/robert_lefebvre_octo_PM.log", ignoreBadlines=False) ...
gpl-2.0
vathpela/pytrace
test.py
1
2157
#!/usr/bin/python3 import pdb import sys from module import * def print_it(tp, tl, time, s): print("%s %s.%d: %s" % (time, tp, tl, s)) def print_if_9(tp, tl, time, s): if tl >= 9: print("%s %s.%d: %s" % (time, tp, tl, s)) tl = trace.Logger("debug", 9, print_if_9) loggers = [ {'trace_point':...
gpl-3.0
xiaoxiamii/scikit-learn
sklearn/feature_selection/univariate_selection.py
78
23706
"""Univariate features selection.""" # Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay. # L. Buitinck, A. Joly # License: BSD 3 clause import numpy as np import warnings from scipy import special, stats from scipy.sparse import issparse from ..base import BaseEstimator from ..prepr...
bsd-3-clause
sashinde/VulkanTools
loader/vk-loader-generate.py
4
16672
#!/usr/bin/env python3 # # Copyright (c) 2015-2016 The Khronos Group Inc. # Copyright (c) 2015-2016 Valve Corporation # Copyright (c) 2015-2016 LunarG, 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 t...
apache-2.0
jmbeuken/abinit
scripts/post_processing/abinit_eignc_to_bandstructure.py
3
47417
#!/usr/bin/python #=================================================================# # Script to plot the bandstructure from an abinit bandstructure # # _EIG.nc netcdf file or from a wannier bandstructure, or from # # an _EIG.nc file+GW file+ bandstructure _EIG.nc file # #=============================...
gpl-3.0
hdinsight/hue
desktop/libs/aws/src/aws/s3/s3stat.py
6
2614
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
apache-2.0
ajaxsys/dict-admin
pygments/util.py
5
6867
# -*- coding: utf-8 -*- """ pygments.util ~~~~~~~~~~~~~ Utility functions. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import codecs split_path_re = re.compile(r'[/\\ ]') doctype_lookup_re =...
bsd-3-clause
stevenliuit/neon
neon/models/tests/test_rbm.py
13
3470
# ---------------------------------------------------------------------------- # 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
erickt/hue
desktop/core/ext-py/Django-1.6.10/tests/admin_scripts/tests.py
52
81725
# -*- coding: utf-8 -*- """ A series of tests to establish that the command-line managment tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ from __future__ import unicode_literals import os import re import shutil import socket import s...
apache-2.0
robios/PyTES
pytes/Util.py
1
32573
import warnings import numpy as np import time from struct import unpack from scipy.stats import norm from scipy.signal import tukey from Filter import median_filter import Analysis, Filter, Constants def savefits(data, filename, vmax=1.0, sps=1e6, bits=14, noise=False, clobber=True): """ Save pulse/noise to F...
mit
yongshengwang/hue
desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/tests/test_store.py
45
8151
# django-openid-auth - OpenID integration for django.contrib.auth # # Copyright (C) 2009-2013 Canonical Ltd. # # 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 ...
apache-2.0
apanju/GMIO_Odoo
addons/crm/__init__.py
329
1265
# -*- 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
Kagami/kisa
lib/twisted/internet/cfreactor.py
53
17431
# -*- test-case-name: twisted.internet.test.test_core -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A reactor for integrating with U{CFRunLoop<http://bit.ly/cfrunloop>}, the CoreFoundation main loop used by MacOS X. This is useful for integrating Twisted with U{PyObjC<http://pyobjc.s...
cc0-1.0
milafrerichs/geonode
geonode/groups/admin.py
7
1218
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
Allow2CEO/browser-ios
brave/node_modules/ad-block/vendor/depot_tools/third_party/gsutil/gslib/commands/cat.py
51
4387
# Copyright 2011 Google Inc. All Rights Reserved. # Copyright 2011, Nexenta 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.org/licenses/LICENSE-2.0 # #...
mpl-2.0
mwv/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
249
1095
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
tinloaf/home-assistant
homeassistant/components/binary_sensor/netatmo.py
5
7407
""" Support for the Netatmo binary sensors. The binary sensors based on events seen by the Netatmo cameras. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.netatmo/. """ import logging import voluptuous as vol from homeassistant.component...
apache-2.0
cxx-hep/root-cern
interpreter/llvm/src/tools/clang/bindings/python/examples/cindex/cindex-includes.py
110
1644
#!/usr/bin/env python #===- cindex-includes.py - cindex/Python Inclusion Graph -----*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===---------------------------------------...
lgpl-2.1
vicky2135/lucious
oscar/lib/python2.7/site-packages/IPython/utils/text.py
8
23504
# encoding: utf-8 """ Utilities for working with strings and text. Inheritance diagram: .. inheritance-diagram:: IPython.utils.text :parts: 3 """ from __future__ import absolute_import import os import re import sys import textwrap from string import Formatter try: from pathlib import Path except ImportError:...
bsd-3-clause
MrSenko/Nitrate
tcms/profiles/views.py
1
5280
# -*- coding: utf-8 -*- from django import http from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.db.models import Q from django.shortcuts import render_to_...
gpl-2.0
saisrisathya/whatsapps
yowsup/registration/regrequest.py
50
1982
''' Copyright (c) <2012> Tarek Galal <tare2.galal@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, modify, m...
gpl-3.0
AZtheAsian/zulip
zerver/migrations/0037_disallow_null_string_id.py
29
1506
# -*- coding: utf-8 -*- from __future__ import unicode_literals from six.moves import range from django.db.utils import IntegrityError from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps from django.db import migrations, models def set_strin...
apache-2.0
alimony/django
tests/postgres_tests/test_trigram.py
131
1888
from django.contrib.postgres.search import TrigramDistance, TrigramSimilarity from django.test import modify_settings from . import PostgreSQLTestCase from .models import CharFieldModel, TextFieldModel @modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'}) class TrigramTest(PostgreSQLTestCase): M...
bsd-3-clause
erikriver/eduIntelligent-cynin
src/ubify.policy/ubify/policy/__init__.py
5
3717
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distribut...
gpl-3.0
evernym/zeno
stp_core/common/logging/handlers.py
2
2199
import logging class CallbackHandler(logging.Handler): def __init__(self, typestr, default_tags, callback, override_tags): """ Initialize the handler. """ super().__init__() self.callback = callback self.tags = default_tags self.update_tags(override_tags or ...
apache-2.0
yufengg/tensorflow
tensorflow/contrib/keras/api/keras/callbacks/__init__.py
30
1766
# 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
kthordarson/CouchPotatoServer
libs/enzyme/__init__.py
168
2414
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2006 Thomas Schueppel <stain@acm.org> # Copyright 2003-2006 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
gpl-3.0
gangadharkadam/tailorerp
erpnext/accounts/party.py
22
6295
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.defaults import get_user_permissions from frappe.utils import add_days from erpnext.utilities.doctype...
agpl-3.0
alazaro/tennis_tournament
django/contrib/gis/tests/geogapp/tests.py
222
4080
""" Tests for geography support in PostGIS 1.5+ """ import os from django.contrib.gis import gdal from django.contrib.gis.measure import D from django.test import TestCase from models import City, County, Zipcode class GeographyTest(TestCase): def test01_fixture_load(self): "Ensure geography features load...
gpl-3.0
erochest/threepress-rdfa
bookworm/django_authopenid/urls.py
7
1360
# -*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, url urlpatterns = patterns('django_authopenid.views', # manage account registration url(r'^%s$' % ('signin/'), 'signin', name='user_signin'), url(r'^%s$' % ('signout/'), 'signout...
bsd-3-clause
openfisca/openfisca-france-indirect-taxation
openfisca_france_indirect_taxation/examples/transports/plot_legislation/plot_ticpe_taux_implicite.py
4
2264
# -*- coding: utf-8 -*- """ Created on Mon Aug 17 18:06:45 2015 @author: thomas.douenne TICPE: Taxe intérieure sur la consommation des produits énergétiques """ # L'objectif de ce script est d'illustrer graphiquement l'évolution du taux implicite de la TICPE depuis 1993. # On étudie ce taux pour le diesel, et pour l...
agpl-3.0
BT-fgarbely/odoo
addons/edi/models/res_partner.py
437
4243
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-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
yan12125/youtube-dl
youtube_dl/extractor/jove.py
50
3075
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate ) class JoveIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?jove\.com/video/(?P<id>[0-9]+)' _CHAPTERS_URL = 'http://www.jove.com/video-chapters?videoid={vide...
unlicense
JJones131/steam-engage-monitor
lib/jinja2/testsuite/regression.py
414
8382
# -*- coding: utf-8 -*- """ jinja2.testsuite.regression ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests corner cases and bugs. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Template, Enviro...
apache-2.0
asm-products/movie-database-service
ani/lib/python2.7/site-packages/paramiko/config.py
2
10382
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com> # Copyright (C) 2012 Olle Lundberg <geek@nerd.sh> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software F...
agpl-3.0
janusnic/wagtail
wagtail/wagtailredirects/models.py
8
2622
from __future__ import unicode_literals from django.db import models from django.utils.six.moves.urllib.parse import urlparse from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel, PageChooserPanel class Redirect(models.Model): old_pat...
bsd-3-clause
mariaantoanelam/Licenta
Lib/test/test_array.py
5
13973
# CAU: Adaptation of the cpython 2.2 test_array.py for jython 2.2 # Formerly test_jarray.py, now test_array.py so that this # test completely supercedes the cpthyhon test. It would # be better to simply complement the cpython test, but that # test bombs out too early due to basic incompatibilities...
mit
msabramo/ansible
lib/ansible/modules/network/nxos/nxos_aaa_server.py
19
12497
#!/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
levelrf/level_basestation
gr-digital/examples/narrowband/tunnel.py
59
10293
#!/usr/bin/env python # # Copyright 2005,2006,2009,2011 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 (a...
gpl-3.0
gangadhar-kadam/latestchurcherp
erpnext/hr/doctype/salary_manager/salary_manager.py
13
5930
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint, flt, nowdate from frappe import _ from frappe.model.document import Document class SalaryManager(Document...
agpl-3.0
rizumu/django
tests/file_storage/tests.py
35
30366
# -*- coding: utf-8 -*- from __future__ import unicode_literals import errno import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation, Suspicio...
bsd-3-clause
menardorama/ReadyNAS-Add-ons
headphones-1.0.0/debian/headphones/apps/headphones/lib/unidecode/x0b9.py
253
4704
data = ( 'ruk', # 0x00 'rut', # 0x01 'rup', # 0x02 'ruh', # 0x03 'rweo', # 0x04 'rweog', # 0x05 'rweogg', # 0x06 'rweogs', # 0x07 'rweon', # 0x08 'rweonj', # 0x09 'rweonh', # 0x0a 'rweod', # 0x0b 'rweol', # 0x0c 'rweolg', # 0x0d 'rweolm', # 0x0e 'rweolb', # 0x0f 'rweols',...
gpl-2.0
Adel-Magebinary/odoo
addons/crm/sales_team.py
321
5053
# -*- coding: utf-8 -*- import calendar from datetime import date from dateutil import relativedelta import json from openerp import tools from openerp.osv import fields, osv class crm_case_section(osv.Model): _inherit = 'crm.case.section' _inherits = {'mail.alias': 'alias_id'} def _get_opportunities_d...
agpl-3.0
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/kombu-3.0.13-py2.7.egg/kombu/transport/virtual/__init__.py
1
27656
""" kombu.transport.virtual ======================= Virtual transport implementation. Emulates the AMQ API for non-AMQ transports. """ from __future__ import absolute_import, unicode_literals import base64 import socket import sys import warnings from array import array from itertools import count from multiproces...
gpl-3.0
jmontgom10/Mimir_pyPol
oldCode/04b_avgBAABditherHWPimages.py
1
17054
# -*- coding: utf-8 -*- """ Combines all the images for a given (TARGET, FILTER, HWP) combination to produce a single, average image. Estimates the sky background level of the on-target position at the time of the on-target observation using a bracketing pair of off-target observations through the same HWP polaroid ro...
mit
kulicuu/supercollider
editors/sced/scedwin/py/Settings.py
37
2412
# sced (SuperCollider mode for gedit) # # Copyright 2012 Jakob Leben # Copyright 2009 Artem Popov and other contributors (see AUTHORS) # # sced 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, ei...
gpl-3.0
dashmug/django-payments
payments/paypal/__init__.py
3
12996
from __future__ import unicode_literals from datetime import timedelta from decimal import Decimal, ROUND_HALF_UP from functools import wraps try: from itertools import ifilter as filter except ImportError: pass import json import logging from django.http import HttpResponseForbidden from django.shortcuts impo...
bsd-3-clause
Hasimir/cryptography
src/cryptography/hazmat/backends/openssl/hmac.py
16
2952
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.exceptions import ( ...
bsd-3-clause
MER-GROUP/intellij-community
plugins/hg4idea/testData/bin/hgext/convert/monotone.py
94
12947
# monotone.py - monotone support for the convert extension # # Copyright 2008, 2009 Mikkel Fahnoe Jorgensen <mikkel@dvide.com> and # others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import os, re from mercurial import util...
apache-2.0
GaussDing/django
django/contrib/gis/geoip/base.py
106
11135
import os import re from ctypes import c_char_p from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS from django.contrib.gis.geoip.prototypes import ( GeoIP_country_code_by_addr, GeoIP_country_code_by_name, GeoIP_country_name_by_addr, GeoIP_country_name_by_name, GeoIP_database_info, GeoIP_delete, G...
bsd-3-clause
gangadharkadam/johnfrappe
frappe/widgets/event.py
35
1523
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # Event # ------------- from __future__ import unicode_literals import frappe @frappe.whitelist() def get_cal_events(m_st, m_end): # load owned events res1 = frappe.db.sql("""select name from `tabEvent` WHERE...
mit
ansible/ansible
test/sanity/code-smell/docs-build.py
16
5175
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re import shutil import subprocess import sys import tempfile def main(): base_dir = os.getcwd() + os.path.sep docs_dir = os.path.abspath('docs/docsite') # TODO: Remove this tem...
gpl-3.0
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/sequence/test_sequence_concat.py
2
3737
# Copyright (c) 2018 PaddlePaddle 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 appli...
apache-2.0
sampadsaha5/sympy
sympy/polys/compatibility.py
96
56525
"""Compatibility interface between dense and sparse polys. """ from __future__ import print_function, division from sympy.polys.densearith import dup_add_term from sympy.polys.densearith import dmp_add_term from sympy.polys.densearith import dup_sub_term from sympy.polys.densearith import dmp_sub_term from sympy.poly...
bsd-3-clause
jimi-c/ansible
test/units/modules/conftest.py
10
1154
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import json from collections import MutableMapping import pytest from ansible.module_utils.six import string_types from ansible.module_utils._text import to_bytes @pytest.fixture def pa...
gpl-3.0
raspilot/ardupilot
mk/PX4/Tools/genmsg/src/genmsg/base.py
216
2414
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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 ...
gpl-3.0
ninotoshi/tensorflow
tensorflow/contrib/learn/python/learn/estimators/tensor_signature_test.py
2
4896
# Copyright 2015 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 o...
apache-2.0
aiyyoi/DevFest-MaxBond
MaxBond/env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py
1724
14031
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
mit
alfcrisci/httpie
tests/test_downloads.py
49
4859
import os import time import pytest from requests.structures import CaseInsensitiveDict from httpie.compat import urlopen from httpie.downloads import ( parse_content_range, filename_from_content_disposition, filename_from_url, get_unique_filename, ContentRangeError, Download, ) from utils import http, TestEn...
bsd-3-clause
elvishknight1/Terranova
venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py
3121
45978
######################## 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 Rights R...
artistic-2.0