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
klynton/riagi
riagi/settings.py
3
2745
import os.path import riak import django_riak import pwd import os # Django settings for riagi project. if pwd.getpwuid(os.getuid())[0] == "dotcloud": RIAK_HOST = "riak01.riagi.com" RIAK_PORT = "8098" DEBUG = False else: RIAK_HOST = "127.0.0.1" RIAK_PORT = "8087" DEBUG = True TEMPLATE_DEBUG ...
apache-2.0
ujjwalwahi/odoo
addons/account_bank_statement_extensions/wizard/cancel_statement_line.py
381
1484
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
AutorestCI/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_extension.py
2
3690
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
Iristyle/ChocolateyPackages
EthanBrown.SublimeText2.UtilPackages/tools/PackageCache/EncodingHelper/chardet/utf8prober.py
216
2663
######################## 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...
mit
felipemontefuscolo/bitme
get_bitmex_candles.py
1
4122
#!/usr/bin/env python import sys import time import swagger_client from swagger_client.rest import ApiException from utils.utils import smart_open import argparse import pandas as pd MAX_NUM_CANDLES_BITMEX = 500 def print_file(file_or_stdout, api_instance, bin_size, partial, symbol, reverse, start_time, end_time)...
mpl-2.0
TApplencourt/EMSL_Basis_Set_Exchange_Local
src/misc/collections.py
9
8821
# 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. try: from thread import get_ident as _get_ident except ImportError: from dummy_thread import get_ident as _get_ident try: from _abcoll import KeysView...
mit
thinkwhale/MyTakeOnQuotes
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/colorful.py
364
2778
# -*- coding: utf-8 -*- """ pygments.styles.colorful ~~~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by CodeRay. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, ...
mit
dou800/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/test/test_multiprocessing.py
9
78668
#!/usr/bin/env python # # Unit tests for the multiprocessing package # import unittest import Queue import time import sys import os import gc import signal import array import socket import random import logging import errno import test.script_helper from test import test_support from StringIO import StringIO _multi...
mit
oscarolar/odoo
addons/email_template/__openerp__.py
64
3160
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
ariabuckles/pyobjc-core
PyObjCTest/test_specialtypecodes_unichar.py
2
6465
""" Test handling of the private typecodes: _C_UNICHAR This typecode doesn't actually exists in the ObjC runtime but are private to PyObjC. We use these to simplify the bridge code while at the same time getting a higher fidelity bridge. - Add tests for calling methods from ObjC """ from __future__ import unicode_li...
mit
google/makani
avionics/network/network_config.py
1
19633
# Copyright 2020 Makani Technologies LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
Oslandia/qgis-swmm
SwmmAlgorithm.py
1
21125
# -*- coding: utf-8 -*- """ *************************************************************************** SwmmAlgorithm.py --------------------- Date : December 2013 Copyright : (C) 2013 by Vincent Mora Email : vincent dot mora dot mtl at gmail dot com ******...
gpl-2.0
2ndQuadrant/ansible
lib/ansible/modules/cloud/amazon/data_pipeline.py
46
20762
#!/usr/bin/python # # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['pr...
gpl-3.0
courtneypresto/googletest
test/gtest_test_utils.py
674
10826
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
fabiosantoscode/django-pipeline
pipeline/utils.py
23
1441
from __future__ import unicode_literals import mimetypes import posixpath import urllib from django.utils import importlib from django.utils.encoding import smart_str from pipeline.conf import settings def to_class(class_str): if not class_str: return None module_bits = class_str.split('.') mo...
mit
ellio167/lammps
examples/SPIN/test_problems/validation_damped_precession/llg_precession.py
9
1646
#!/usr/bin/env python3 import numpy as np , pylab, tkinter import math import matplotlib.pyplot as plt import mpmath as mp mub=5.78901e-5 # Bohr magneton (eV/T) hbar=0.658212 # Planck's constant (eV.fs/rad) g=2.0 # Lande factor (adim) gyro=g*mub/hbar # gyromag ratio (rad/f...
gpl-2.0
aspectron/jsx
extern/v8/tools/testrunner/local/junit_output.py
101
2278
# Copyright 2013 the V8 project authors. 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 conditi...
mit
vipul-sharma20/oh-mainline
vendor/packages/kombu/kombu/simple.py
31
4113
""" kombu.simple ============ Simple interface. """ from __future__ import absolute_import import socket from collections import deque from . import entity from . import messaging from .connection import maybe_channel from .five import Empty, monotonic __all__ = ['SimpleQueue', 'SimpleBuffer'] class SimpleBase(...
agpl-3.0
LibrePCB/LibrePCB
tests/funq/libraryeditor/conftest.py
1
1156
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest library = 'libraries/Populated Library.lplib' @pytest.fixture def library_editor(librepcb, helpers): """ Fixture opening the library editor with an empty library """ librepcb.add_local_library_to_workspace(path=library) with librepcb.op...
gpl-3.0
luis-rr/nest-simulator
pynest/nest/tests/test_connect_helpers.py
13
17143
# -*- coding: utf-8 -*- # # test_connect_helpers.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 Li...
gpl-2.0
pengkobe/leetcode
questions/Regular_Expression_Matching.py
1
6170
# -*- coding: utf-8 -*- # 本题难度:★★★ # 实现一个正则表达式引擎,让其支持匹配 . 和 *,其中: # . 匹配任何单字符 # * 匹配 0 个或者多个前字符 # 需要匹配全部输入而非部分输入,函数格式如下: # bool isMatch(const char *s, const char *p) # 如: # isMatch('aa', 'a') // false # isMatch('aa', 'aa') // true # isMatch('aaa', 'aa') // false # isMatch('aa', 'a*') // true # isMatch('aa', '.*') //...
gpl-3.0
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/encodings/__init__.py
406
5698
""" Standard "encodings" Package Standard Python encoding modules are stored in this package directory. Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'. Ea...
gpl-2.0
HyperBaton/ansible
lib/ansible/modules/cloud/cloudstack/cs_resourcelimit.py
13
5573
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016, René Moser <mail@renemoser.net> # 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': '...
gpl-3.0
alxgu/ansible
lib/ansible/plugins/action/raw.py
152
1823
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
MisanthropicBit/bibpy
examples/requirements_check.py
1
1795
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Example of checking the requirements of bibtext and biblatex.""" import bibpy from bibpy.tools import get_abspath_for def format_requirements_check(required, optional): s = "" if required: s = "required field(s) " + ", ".join(map(str, required)) ...
mit
hdd/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/Perforce.py
61
3816
"""SCons.Tool.Perforce.py Tool-specific initialization for Perforce Source Code Management system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 20...
apache-2.0
wlanslovenija/cmsplugin-filer
cmsplugin_filer_image/migrations/0010_auto__add_field_filerimage_target_blank.py
11
17206
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from cmsplugin_filer_utils.migration import rename_tables_new_to_old class Migration(SchemaMigration): cms_plugin_table_mapping = ( # (old_name, new_name), ('cmsplugin_...
bsd-3-clause
syci/ingadhoc-odoo-addons
partner_views_fields/res_config.py
1
1176
# -*- coding: utf-8 -*- from openerp import fields, models class partner_configuration(models.TransientModel): _inherit = 'base.config.settings' group_ref = fields.Boolean( "Show Reference On Partners Tree View", implied_group='partner_views_fields.group_ref', ) group_user_id = fi...
agpl-3.0
javachengwc/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/db/backends/spatialite/models.py
222
1934
""" The GeometryColumns and SpatialRefSys models for the SpatiaLite backend. """ from django.db import models from django.contrib.gis.db.backends.base import SpatialRefSysMixin from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class GeometryColumns(models.Model): """ T...
apache-2.0
rlugojr/django
tests/queries/test_q.py
17
2830
from django.db.models import F, Q from django.test import SimpleTestCase class QTests(SimpleTestCase): def test_deconstruct(self): q = Q(price__gt=F('discounted_price')) path, args, kwargs = q.deconstruct() self.assertEqual(path, 'django.db.models.query_utils.Q') self.assertEqual(a...
bsd-3-clause
HellerCommaA/flask-angular
lib/python2.7/site-packages/jinja2/bccache.py
18
10983
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
mit
safwanrahman/kuma
kuma/urls.py
1
2694
from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.views.static import serve from django.views.generic import RedirectView from kuma.attachments import views as attachment_views from kuma.core import views as core_views from kuma.wiki.admin import pu...
mpl-2.0
fxsjy/pybrain
pybrain/structure/evolvables/topology.py
5
1218
__author__ = 'Tom Schaul, tom@idsia.ch' from pybrain.utilities import abstractMethod from evolvable import Evolvable from pybrain.structure.parametercontainer import ParameterContainer class TopologyEvolvable(ParameterContainer): """ An evolvable object, with higher-level mutations, that change the topology ...
bsd-3-clause
funkring/fdoo
openerp/addons/base/workflow/workflow.py
40
9998
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
michaelhowden/eden
modules/s3/s3crud.py
5
120324
# -*- coding: utf-8 -*- """ S3 RESTful CRUD Methods @see: U{B{I{S3XRC}} <http://eden.sahanafoundation.org/wiki/S3XRC>} @requires: U{B{I{gluon}} <http://web2py.com>} @requires: U{B{I{lxml}} <http://codespeak.net/lxml>} @copyright: 2009-2015 (c) Sahana Software Foundation @license: MIT Permis...
mit
carthach/essentia
test/src/unittests/rhythm/test_onsetdetection.py
1
5977
#!/usr/bin/env python # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
agpl-3.0
malt1/lutris
tests/test_installer.py
1
1700
from unittest import TestCase from lutris.installer import ScriptInterpreter, ScriptingError class MockInterpreter(ScriptInterpreter): """ a script interpreter mock """ script = {'runner': 'linux'} def is_valid(self): return True class TestScriptInterpreter(TestCase): def test_script_with_c...
gpl-3.0
xcat2/confluent
confluent_server/confluent/shellserver.py
2
5379
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2016-2018 Lenovo # # 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 require...
apache-2.0
Chilledheart/chromium
third_party/tlslite/tlslite/x509.py
118
3331
# Authors: # Trevor Perrin # Google - parsing subject field # # See the LICENSE file for legal information regarding use of this file. """Class representing an X.509 certificate.""" from .utils.asn1parser import ASN1Parser from .utils.cryptomath import * from .utils.keyfactory import _createPublicRSAKey from .ut...
bsd-3-clause
jossgray/zyrecffi
zyrecffi/_cffi.py
1
3231
from cffi import FFI import os, sys ffi = FFI() ffi.cdef(''' // zsock.h typedef struct _zsock_t zsock_t; // zmsg.h typedef struct _zmsg_t zmsg_t; int zmsg_addstr (zmsg_t* self, const char* string); char* zmsg_popstr (zmsg_t* self); // zyre.h typedef struct _zyre_t zyre_t; zyre_t* zyre_new (const char *name); ...
gpl-3.0
molobrakos/home-assistant
tests/util/test_location.py
9
5486
"""Test Home Assistant location util methods.""" from unittest import TestCase from unittest.mock import patch import requests import requests_mock import homeassistant.util.location as location_util from tests.common import load_fixture # Paris COORDINATES_PARIS = (48.864716, 2.349014) # New York COORDINATES_NEW_Y...
apache-2.0
GodBlessPP/2015cdb
static/Brython3.1.1-20150328-091302/Lib/unittest/util.py
794
4157
"""Various utility functions.""" from collections import namedtuple, OrderedDict __unittest = True _MAX_LENGTH = 80 def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result ...
gpl-3.0
moneta-project/moneta
contrib/spendfrom/spendfrom.py
5
10017
#!/usr/bin/env python # # Use the raw transactions API to spend monetas received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a monetad or Monet...
mit
robjohnson189/home-assistant
homeassistant/components/notify/message_bird.py
11
2185
""" MessageBird platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.message_bird/ """ import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.notify imp...
mit
Zord13appdesa/python-for-android
python-build/python-libs/gdata/src/gdata/apps/migration/__init__.py
168
8177
#!/usr/bin/python # # Copyright (C) 2008 Google # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
cwisecarver/osf.io
api/base/serializers.py
1
58011
import collections import re import furl from django.core.urlresolvers import resolve, reverse, NoReverseMatch from django.core.exceptions import ImproperlyConfigured from django.utils import six from rest_framework import exceptions, permissions from rest_framework import serializers as ser from rest_framework.field...
apache-2.0
yakky/djangocms-text-ckeditor
djangocms_text_ckeditor/forms.py
1
3464
# -*- coding: utf-8 -*- from django import forms from django.core import signing from django.core.signing import BadSignature from django.forms.models import ModelForm from django.template import RequestContext from django.utils.translation import ugettext from cms.models import CMSPlugin from .models import Text fro...
bsd-3-clause
andrewsmedina/django
django/http/utils.py
73
3499
""" Functions that modify an HTTP request or response in some way. """ # This group of functions are run as part of the response handling, after # everything else, including all response middleware. Think of them as # "compulsory response middleware". Be careful about what goes here, because # it's a little fiddly to ...
bsd-3-clause
behzadnouri/scipy
scipy/weave/examples/cast_copy_transpose.py
100
5687
""" Cast Copy Tranpose is used in numpy LinearAlgebra.py to convert C ordered arrays to Fortran order arrays before calling Fortran functions. A couple of C implementations are provided here that show modest speed improvements. One is an "inplace" transpose that does an in memory transpose of an array...
bsd-3-clause
bnavarma/netsnmp
tests/test_imports_smiv2_pysnmp.py
2
1484
import sys if sys.version_info[0:2] < (2, 7) or \ sys.version_info[0:2] in ( (3, 0), (3, 1) ): try: import unittest2 as unittest except ImportError: import unittest else: import unittest from pysmi.parser.smi import parserFactory from pysmi.codegen.pysnmp import PySnmpCodeGen from pysmi.c...
bsd-2-clause
SanPen/GridCal
src/research/PTDF/ACPTDF_research2.py
1
14022
# This file is part of GridCal. # # GridCal 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. # # GridCal is distributed in the hope that...
gpl-3.0
depet/scikit-learn
sklearn/neighbors/tests/test_dist_metrics.py
48
4949
import itertools import numpy as np from numpy.testing import assert_array_almost_equal import scipy from scipy.spatial.distance import cdist from sklearn.neighbors.dist_metrics import DistanceMetric from nose import SkipTest def cmp_version(version1, version2): version1 = tuple(map(int, version1.split('.')[:2]...
bsd-3-clause
netscaler/neutron
neutron/tests/unit/brocade/test_brocade_vlan.py
24
2176
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2013 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
apache-2.0
likexx/riftwarrior
code/external/emscripten/third_party/ply/example/closurecalc/calc.py
165
3028
# ----------------------------------------------------------------------------- # calc.py # # A calculator parser that makes use of closures. The function make_calculator() # returns a function that accepts an input string and returns a result. All # lexing rules, parsing rules, and internal state are held inside the...
mit
Yubico/yubikey-manager
ykman/cli/fido.py
1
24461
# Copyright (c) 2018 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
bsd-2-clause
fejta/test-infra
releng/generate_tests_test.py
13
2304
#!/usr/bin/env python3 # Copyright 2019 The Kubernetes 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 appl...
apache-2.0
kobotoolbox/kobocat
onadata/apps/logger/tests/test_briefcase_client.py
1
6934
# coding: utf-8 import os.path from io import StringIO, BytesIO from urllib.parse import urljoin import requests from django.contrib.auth import authenticate from django.core.files.storage import get_storage_class from django.core.files.uploadedfile import UploadedFile from django.urls import reverse from django.test ...
bsd-2-clause
rossburton/yocto-autobuilder
lib/python2.7/site-packages/SQLAlchemy-0.8.0b2-py2.7-linux-x86_64.egg/sqlalchemy/dialects/mysql/base.py
6
100029
# mysql/base.py # Copyright (C) 2005-2012 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 """ .. dialect:: mysql :name: MySQL Supported Versions and Features --------------...
gpl-2.0
zhukaixy/kbengine
kbe/res/scripts/common/Lib/site-packages/setuptools/command/rotate.py
285
2062
import distutils, os from setuptools import Command from setuptools.compat import basestring from distutils.util import convert_path from distutils import log from distutils.errors import * class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N newest file...
lgpl-3.0
timduru/platform-external-chromium_org
build/android/gyp/util/md5_check.py
63
2174
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import hashlib import os def CallAndRecordIfStale( function, record_path=None, input_paths=[], input_strings=[], force=False): """Calls function if t...
bsd-3-clause
kwikteam/klustakwik2
klustakwik2/tests/test_compute_covariance_matrix.py
2
2821
from numpy import * from klustakwik2 import * from numpy.testing import assert_raises, assert_array_almost_equal, assert_array_equal from nose import with_setup from nose.tools import nottest from numpy.random import randint, rand from copy import deepcopy from six.moves import range from klustakwik2.linear_algebra imp...
bsd-3-clause
hale36/SRTV
lib/sqlalchemy/dialects/postgresql/base.py
75
85273
# postgresql/base.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: postgresql :name: PostgreSQL Sequences/SERIAL --------------...
gpl-3.0
mmlab/eice
EiCGraphAlgo/core/typeahead.py
1
4270
''' Created on 17-sep.-2012 @author: ldevocht ''' import urllib.parse, lxml.objectify, logging, configparser, re, ujson, requests from core.resourceretriever import Resourceretriever from core import resourceretriever, config_search config = resourceretriever.config mappings = resourceretriever.mappings logger = loggi...
agpl-3.0
asser/django
django/template/context_processors.py
34
2393
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the 'context_processors' option of the configuration of a DjangoTemplates backend and use...
bsd-3-clause
gaeun/open-event-orga-server
app/api/helpers/utils.py
1
7209
import json from hashlib import md5 from flask import request from flask.ext.restplus import Resource as RestplusResource from flask_restplus import Model, fields, reqparse from app.helpers.data import update_version from app.models.event import Event as EventModel from .error_docs import ( notfound_error_model, ...
gpl-3.0
cafe-grader-team/cafe-grader-web
lib/assets/Lib/copy.py
9
9233
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is...
mit
wskplho/fontuley
src/third_party/fontTools/Lib/fontTools/ttLib/tables/DefaultTable.py
11
1294
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.ttLib import getClassTag class DefaultTable(object): dependencies = [] def __init__(self, tag=None): if tag is None: tag = getClassTag(self.__class__) self.tableTag = Tag(tag) def decompile...
apache-2.0
jaimesanz/suds-webpay
suds/builder.py
197
4220
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 in the hope that it will ...
lgpl-3.0
Elandril/SickRage
lib/unidecode/x0d6.py
253
4765
data = ( 'hyeo', # 0x00 'hyeog', # 0x01 'hyeogg', # 0x02 'hyeogs', # 0x03 'hyeon', # 0x04 'hyeonj', # 0x05 'hyeonh', # 0x06 'hyeod', # 0x07 'hyeol', # 0x08 'hyeolg', # 0x09 'hyeolm', # 0x0a 'hyeolb', # 0x0b 'hyeols', # 0x0c 'hyeolt', # 0x0d 'hyeolp', # 0x0e 'hyeolh', # 0x...
gpl-3.0
google/rekall
rekall-core/rekall/plugins/addrspaces/macho.py
4
2166
# Rekall Memory Forensics # # Copyright 2012 Michael Cohen <scudette@gmail.com> # Copyright 2013 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...
gpl-2.0
drewandersonnz/openshift-tools
ansible/roles/lib_oa_openshift/src/test/unit/test_oc_env.py
82
19321
''' Unit tests for oc_env ''' import os import six import sys import unittest import mock # Removing invalid variable names for tests so that I can # keep them brief # pylint: disable=invalid-name,no-name-in-module # Disable import-error b/c our libraries aren't loaded in jenkins # pylint: disable=import-error,wrong...
apache-2.0
sogis/Quantum-GIS
python/plugins/processing/algs/qgis/RegularPoints.py
10
4770
# -*- coding: utf-8 -*- """ *************************************************************************** RegularPoints.py --------------------- Date : September 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********...
gpl-2.0
wradlib/wradlib
wradlib/tests/test_adjust.py
1
7916
#!/usr/bin/env python # Copyright (c) 2011-2020, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. import numpy as np import pytest from wradlib import adjust class Data: # Arguments to be used throughout all test classes raw_x, raw_y = np.meshgrid(np.arange(4).astype("...
mit
huaweiswitch/neutron
neutron/services/metering/drivers/noop/noop_driver.py
17
1249
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
apache-2.0
Jimdo/ansible-modules-core
cloud/rackspace/rax_files.py
60
11966
#!/usr/bin/python # (c) 2013, Paul Durivage <paul.durivage@rackspace.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 # (a...
gpl-3.0
adalke/rdkit
rdkit/ML/Cluster/Murtagh.py
6
2935
# $Id$ # # Copyright (C) 2001-2008 greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ Interface to the C...
bsd-3-clause
forkbong/qutebrowser
qutebrowser/misc/backendproblem.py
1
17440
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2017-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
jaggu303619/asylum-v2.0
openerp/addons/stock_invoice_directly/wizard/__init__.py
68
1076
# -*- 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
MartinHjelmare/home-assistant
tests/components/deconz/test_sensor.py
5
5536
"""deCONZ sensor platform tests.""" from unittest.mock import Mock, patch from homeassistant import config_entries from homeassistant.components import deconz from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.setup import async_setup_component import homeassistant.components.sensor...
apache-2.0
maxivanoff/fftoolbox-app
q/fftoolbox/multipole.py
1
12213
import logging import numpy as np from copy import deepcopy from numpy.linalg import norm from scipy.special import sph_harm as Y mult_logger = logging.getLogger('multipole') def Rlm(l, m, r, theta, phi): return r**l * np.sqrt(4 * np.pi / (2 * l + 1)) * Y(m, l, theta, phi) def Rlmc(l, m, r, theta, phi): retu...
gpl-2.0
richo/capstone-rs
capstone-sys/capstone/bindings/python/test_ppc.py
11
2982
#!/usr/bin/env python # Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com> from __future__ import print_function from capstone import * from capstone.ppc import * from xprint import to_hex, to_x_32 PPC_CODE = b"\x43\x20\x0c\x07\x41\x56\xff\x17\x80\x20\x00\x00\x80\x3f\x00\x00\x10\x43\x23\x0e\xd0\x44\x00...
mit
jfarcher/checkinapi
flask/lib/python2.7/site-packages/click/core.py
136
70254
import errno import os import sys from contextlib import contextmanager from itertools import repeat from functools import update_wrapper from .types import convert_type, IntRange, BOOL from .utils import make_str, make_default_short_help, echo, get_os_args from .exceptions import ClickException, UsageError, BadParame...
gpl-3.0
hnakamur/ansible
lib/ansible/playbook/play_context.py
6
15307
# -*- coding: utf-8 -*- # (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,...
gpl-3.0
woobe/h2o
py/testdir_multi_jvm/test_rf_1ktrees_job_cancel_many_fvec.py
1
2219
import unittest, time, sys, random sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i, h2o_jobs, h2o_rf class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost()...
apache-2.0
mxOBS/deb-pkg_trusty_chromium-browser
tools/gyp/test/mac/gyptest-ldflags.py
100
2078
#!/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. """ Verifies that filenames passed to various linker flags are converted into build-directory relative paths correctly. """ import TestGyp ...
bsd-3-clause
lonetwin/pydown
pygments/styles/pastie.py
26
2473
# -*- coding: utf-8 -*- """ pygments.styles.pastie ~~~~~~~~~~~~~~~~~~~~~~ Style similar to the `pastie`_ default style. .. _pastie: http://pastie.caboo.se/ :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style impor...
mit
juliosmelo/soldo
utils/settings.py
1
1331
PGS_TOKEN = 'C888EE7F420841CF92D0B0063EDDFC7D' PGS_EMAIL = 'pagseguro@panfleteria.com.br' # from datetime import datetime # from datetime import date # from datetime import timedelta # dates = [d0] # dates_two = list() # def date_paginator(x, y): # print x, y # if pages == 1 and pages_mods == 0: # _date =...
mit
seanli9jan/tensorflow
tensorflow/contrib/distribute/python/input_ops_test.py
7
9593
# 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
MichaelAnckaert/Hermes
message.py
1
1631
"""Message functionality for Hermes""" from datetime import datetime import json __author__ = "Michael Anckaert" __copyright__ = "Copyright 2012, Michael Anckaert" __credits__ = ["Michael Anckaert"] __license__ = "GPLv3" __version__ = "0.0.1" __maintainer__ = "Michael Anckaert" __email__ = "michael.anckaert@sinax.be"...
gpl-3.0
nagyistoce/odoo-dev-odoo
addons/product_extended/__openerp__.py
295
1877
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute i...
agpl-3.0
Sendoushi/servo
components/script/dom/bindings/codegen/parser/tests/test_arraybuffer.py
158
4183
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestArrayBuffer { attribute ArrayBuffer bufferAttr; void bufferMethod(ArrayBuffer arg1, ArrayBuffer? arg2, ArrayBuffer[] arg3, sequence<ArrayBuffer> arg4); attribute ArrayBufferView viewAttr; ...
mpl-2.0
sutartmelson/girder
tests/cases/file_test.py
2
40561
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
apache-2.0
zorroz/microblog
flask/lib/python2.7/site-packages/werkzeug/debug/repr.py
107
9340
# -*- coding: utf-8 -*- """ werkzeug.debug.repr ~~~~~~~~~~~~~~~~~~~ This module implements object representations for debugging purposes. Unlike the default repr these reprs expose a lot more information and produce HTML instead of ASCII. Together with the CSS and JavaScript files of the debug...
bsd-3-clause
fernandog/Medusa
ext/boto/cloudfront/__init__.py
164
15176
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
gpl-3.0
yuyu2172/chainercv
tests/transforms_tests/bbox_tests/test_crop_bbox.py
3
1498
import numpy as np import unittest from chainer import testing from chainercv.transforms import crop_bbox class TestCropBbox(unittest.TestCase): def setUp(self): self.bbox = np.array(( (0, 0, 3, 4), (0, 0, 5, 6), (0, 5, 3, 6), (1, 2, 3, 4), (3...
mit
gourie/ParkingPlaza
__test__/test_utilities.py
1
9609
__author__ = 'Joeri Nicolaes' __author_email__ = 'joerinicolaes@gmail.com' from datetime import datetime from decimal import Decimal import sys, unittest import db_logic import pytz import sys import unittest #sys.path.append('~/pycharm/parking-plaza') import utilities util = utilities.utilities() parkingDb = db_logi...
bsd-3-clause
DedMemez/ODS-August-2017
suit/SuitDNA.py
1
7589
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.suit.SuitDNA from panda3d.core import Datagram, DatagramIterator, VBase4 import random from direct.directnotify.DirectNotifyGlobal import * from toontown.toonbase import TTLocalizer, ToontownGlobals import random from direct.distributed.PyDatagra...
apache-2.0
tbeadle/django
tests/sitemaps_tests/base.py
380
1079
from django.apps import apps from django.contrib.sites.models import Site from django.core.cache import cache from django.test import TestCase, modify_settings, override_settings from .models import I18nTestModel, TestModel @modify_settings(INSTALLED_APPS={'append': 'django.contrib.sitemaps'}) @override_settings(ROO...
bsd-3-clause
pridemusvaire/yowsup
yowsup/layers/protocol_groups/protocolentities/iq_groups_participants.py
61
1641
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .iq_groups import GroupsIqProtocolEntity class ParticipantsGroupsIqProtocolEntity(GroupsIqProtocolEntity): ''' <iq type="get" id="{{id}}" xmlns="w:g2", to={{group_jid}}"> <list></list> </iq> ''' modes=["add","promote","remove...
gpl-3.0
tmcw/simple-statistics-py
simplestatistics/statistics/add_to_mean.py
3
1992
""" Implements add_to_mean() function. """ from .sum import sum # pylint: disable=redefined-builtin def add_to_mean(current_mean, n, new_value, decimals=2): """ This function can be used when wanting to know the new mean of a list after adding one or more values to it. One could use this function ins...
bsd-3-clause