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
SatAgro/ecoclima
ecoclima_parser/init_all.py
1
2540
#!/usr/bin/python # -*- coding: utf-8 -*- import psycopg2 import sys def init_all(db_name, user, host, password): try: conn = psycopg2.connect("dbname='" + db_name + "' user='" + user + "' host='" + host + "' password='" + password + "'") ...
lgpl-3.0
kangsterizer/linux-3.1.y-rsbac
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
yelizariev/mail-addons
mail_partner_lang/models.py
15
4306
# -*- coding: utf-8 -*- from openerp.osv import osv,fields from openerp import SUPERUSER_ID class mail_thread(osv.Model): _inherit = "mail.thread" def message_track(self, cr, uid, ids, tracked_fields, initial_values, context={}): def convert_for_display(value, col_info): if not value and ...
lgpl-3.0
Curso-OpenShift/Formulario
OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/contrib/gis/serializers/geojson.py
49
3110
from __future__ import unicode_literals from django.contrib.gis.gdal import HAS_GDAL from django.core.serializers.base import ( SerializationError, SerializerDoesNotExist, ) from django.core.serializers.json import Serializer as JSONSerializer if HAS_GDAL: from django.contrib.gis.gdal import CoordTransform, S...
gpl-3.0
skython/eXe
exe/engine/config.py
3
16002
# =========================================================================== # eXe config # Copyright 2004-2006, University of Auckland # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either ...
gpl-2.0
French77/osmc
package/mediacenter-addon-osmc/src/script.module.osmccommon/resources/lib/osmccommon/osmc_comms.py
2
4885
# -*- coding: utf-8 -*- """ Copyright (C) 2014-2020 OSMC (KodeKarnage) This file is part of script.module.osmccommon SPDX-License-Identifier: GPL-2.0-or-later See LICENSES/GPL-2.0-or-later for more information. """ import os import socket import subprocess import threading import traceback import xb...
gpl-2.0
sjperkins/tensorflow
tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py
6
28717
# 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
frank-tancf/scikit-learn
sklearn/neighbors/tests/test_neighbors.py
25
45729
from itertools import product import numpy as np from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix, dok_matrix, lil_matrix) from sklearn import metrics from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn....
bsd-3-clause
SRabbelier/Melange
thirdparty/google_appengine/lib/django_1_2/tests/regressiontests/views/tests/generic/create_update.py
40
8270
import datetime from django.test import TestCase from django.core.exceptions import ImproperlyConfigured from regressiontests.views.models import Article, UrlArticle class CreateObjectTest(TestCase): fixtures = ['testdata.json'] def test_login_required_view(self): """ Verifies that an unauth...
apache-2.0
DeMille/emailhooks
django_nonrel/django/contrib/localflavor/is_/forms.py
100
2794
""" Iceland specific form helpers. """ from __future__ import absolute_import, unicode_literals from django.contrib.localflavor.is_.is_postalcodes import IS_POSTALCODES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField from django.forms...
mit
piosz/test-infra
kettle/make_db_test.py
17
6376
#!/usr/bin/env python # Copyright 2017 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 appli...
apache-2.0
ajylee/gpaw-rtxs
gpaw/test/big/miscellaneous/revtpss_tpss_scf.py
2
1489
from ase import Atom, Atoms from gpaw import GPAW L = 6 name='N2' a = Atoms([Atom('N', (L/2.+1.098/2.,L/2.,L/2.)), Atom('N', (L/2.-1.098/2.,L/2.,L/2.))], cell=(L, L, L), pbc=False) calc=GPAW(h=0.22, xc='PBE',convergence={'eigenstates':1.0e-7}, stencils=(3,3), txt = name+'.txt') a.set_calculator(calc) e_n2 ...
gpl-3.0
jonesir/jonesir-util
lib/werkzeug/posixemulation.py
319
3543
# -*- coding: utf-8 -*- r""" werkzeug.posixemulation ~~~~~~~~~~~~~~~~~~~~~~~ Provides a POSIX emulation for some features that are relevant to web applications. The main purpose is to simplify support for systems such as Windows NT that are not 100% POSIX compatible. Currently this only imple...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/distutils/tests/test_install.py
42
8410
"""Tests for distutils.command.install.""" import os import sys import unittest import site from test.test_support import captured_stdout, run_unittest from distutils import sysconfig from distutils.command.install import install from distutils.command import install as install_module from distutils.command.build_ex...
gpl-3.0
UManPychron/pychron
pychron/spectrometer/isotopx/manager/ngx.py
2
1088
# =============================================================================== # Copyright 2017 ross # # 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/LICE...
apache-2.0
OrkoHunter/networkx
examples/graph/atlas.py
54
2609
#!/usr/bin/env python """ Atlas of all graphs of 6 nodes or less. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)""" # Copyright (C) 2004 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx...
bsd-3-clause
ledtvavs/repository.ledtv
script.mrknow.urlresolver/lib/urlresolver9/plugins/briskfile.py
4
2223
''' urlresolver XBMC Addon Copyright (C) 2013 Bstrdsmkr This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distri...
gpl-3.0
seansu4you87/kupo
projects/molt/venv/lib/python2.7/site-packages/wheel/test/test_tagopt.py
236
3550
""" Tests for the bdist_wheel tag options (--python-tag and --universal) """ import sys import shutil import pytest import py.path import tempfile import subprocess SETUP_PY = """\ from setuptools import setup setup( name="Test", version="1.0", author_email="author@example.com", py_modules=["test"], ...
mit
ocampocj/cloud-custodian
c7n/resources/opsworks.py
4
6984
# Copyright 2016-2017 Capital One Services, 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 ...
apache-2.0
atreyv/sympy
sympy/physics/unitsystems/systems/natural.py
91
1785
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- """ Naturalunit system. The natural system comes from "setting c = 1, hbar = 1". From the computer point of view it means that we use velocity and action instead of length and time. Moreover instead of mass we use energy. """ from __future__ import division from sympy...
bsd-3-clause
samkuehn/suds
suds/properties.py
203
16223
# 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
Atos-FiwareOps/flavor-sync
flavorsync/openstack/openstack_manager.py
2
7923
from keystoneclient.auth.identity import v3 from keystoneclient import session from novaclient import client from uuid import uuid4 from flavorsync.exceptions import FlavorAlreadyExistsError,\ OpenStackConnectionError, FlavorNotFoundExceptionError, OpenStackEndPointNotFound, OpenStackUnauthorizedError,\ OpenSt...
apache-2.0
eternalfame/django-admin-tools
admin_tools/menu/menus.py
17
3636
""" Module where admin tools menu classes are defined. """ from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from admin_tools.menu import items from admin_tools.utils import get_admin_site_name class Menu(object): """ This is the base class for creating cus...
mit
ferdisdot/elbe
elbepack/pkgutils.py
1
7605
# ELBE - Debian Based Embedded Rootfilesystem Builder # Copyright (C) 2013 Linutronix GmbH # # This file is part of ELBE. # # ELBE 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 Licen...
gpl-3.0
adieu/django-nonrel
tests/modeltests/custom_pk/models.py
91
1160
# -*- coding: utf-8 -*- """ 14. Using a custom primary key By default, Django adds an ``"id"`` field to each model. But you can override this behavior by explicitly adding ``primary_key=True`` to a field. """ from django.conf import settings from django.db import models, transaction, IntegrityError, DEFAULT_DB_ALIAS ...
bsd-3-clause
icedwater/jpype
jpype/_gui.py
4
1327
#***************************************************************************** # Copyright 2004-2008 Steve Menard # # 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...
apache-2.0
adarnimrod/ansible-modules
ldap/ldap_attr.py
5
10951
#!/usr/bin/env python # ldap_attr Ansible module # Copyright (C) 2014 Peter Sagerson <psagers@ignorare.net> # Homepage: https://bitbucket.org/psagers/ansible-ldap # Copyright (c) 2014, Peter Sagerson # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are per...
agpl-3.0
popgengui/negui
agestrucne/pgchromlocifilemanager.py
1
9254
''' Description This class wraps defs to validate a chromosome loci table file used by LDNe2 to filter out loci pairs that share a chromosome. ''' __filename__ = "pgchromlocifilemanager.py" __date__ = "20180502" __author__ = "Ted Cosart<ted.cosart@umontana.edu>" ''' This string designates that there is no chrom loci f...
agpl-3.0
nupic-community/nupic.audio
NuMozart/data/midi/example_transpose_octave.py
18
1076
from MidiOutFile import MidiOutFile from MidiInFile import MidiInFile """ This is an example of the smallest possible type 0 midi file, where all the midi events are in the same track. """ class Transposer(MidiOutFile): "Transposes all notes by 1 octave" def _transp(self, ch, note): ...
gpl-3.0
IQSS/miniverse
dv_apps/slackbot/starterbot.py
1
2042
import os import time from slackclient import SlackClient # starterbot's ID as an environment variable BOT_ID = os.environ.get("BOT_ID") # constants AT_BOT = "<@" + BOT_ID + ">" EXAMPLE_COMMAND = "gofish" # instantiate Slack & Twilio clients slack_client = SlackClient(os.environ.get('SLACK_BOT_TOKEN')) def handle_c...
mit
bhell/jimi
jimi/jimi/settings_orig.py
1
5206
# Django settings for jimi project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', ...
bsd-3-clause
keen99/SickRage
sickbeard/logger.py
6
11164
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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
kkdd/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/iso2022_jp_2.py
816
1061
# # iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_2') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
apache-2.0
nelmiux/CarnotKE
jyhton/lib-python/2.7/unittest/case.py
28
42629
"""Test case implementation""" import collections import sys import functools import difflib import pprint import re import types import warnings from . import result from .util import ( strclass, safe_repr, unorderable_list_difference, _count_diff_all_purpose, _count_diff_hashable ) __unittest = True DIF...
apache-2.0
mattduan/proof
driver/test/testMySQLConnection.py
1
1469
""" A testcase for MySQLConnection. """ import proof.driver.MySQLConnection as MySQLConnection import proof.driver.MySQLCursor as MySQLCursor import proof.driver.MySQLDictCursor as MySQLDictCursor import unittest class testMySQLConnection(unittest.TestCase): def setUp(self): self.__host = 'localh...
bsd-3-clause
globocom/database-as-a-service
dbaas/physical/migrations/0112_auto__add_ip.py
1
36235
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Ip' db.create_table(u'physical_ip', ( (u'id',...
bsd-3-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/django/contrib/auth/management/commands/changepassword.py
97
1881
import getpass from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.db import DEFAULT_DB_ALIAS class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--database', action='stor...
agpl-3.0
pv/scikit-learn
sklearn/utils/tests/test_validation.py
133
18339
"""Tests for input validation functions""" import warnings from tempfile import NamedTemporaryFile from itertools import product import numpy as np from numpy.testing import assert_array_equal import scipy.sparse as sp from nose.tools import assert_raises, assert_true, assert_false, assert_equal from sklearn.utils....
bsd-3-clause
intero-chz/connector-telephony
base_phone_popup/__openerp__.py
12
2314
# -*- encoding: utf-8 -*- ############################################################################## # # Base Phone Pop-up module for Odoo/OpenERP # Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
AlanZheng/heekscnc
pycnc/SpeedOp.py
25
1385
from Operation import Operation from CNCConfig import CNCConfig import HeeksCNC ABS_MODE_ABSOLUTE = 1 ABS_MODE_INCREMENTAL = 2 class SpeedOp(Operation): def __init__(self): Operation.__init__(self) def ReadDefaultValues(self): Operation.ReadDefaultValues(self) config = CNCConf...
bsd-3-clause
AnishShah/tensorflow
tensorflow/python/estimator/export/export.py
6
26585
# 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
skg-net/ansible
lib/ansible/modules/files/iso_extract.py
101
6645
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be> # Copyright: (c) 2016, Matt Robinson <git@nerdoftheherd.com> # Copyright: (c) 2017, Dag Wieers <dag@wieers.com> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.g...
gpl-3.0
zhaohuaw/brotli
python/tests/roundtrip_test.py
98
1504
#!/usr/bin/env python from __future__ import print_function import sys import os from subprocess import check_call, Popen, PIPE from test_utils import PYTHON, BRO, TEST_ENV, diff_q INPUTS = """\ testdata/alice29.txt testdata/asyoulik.txt testdata/lcet10.txt testdata/plrabn12.txt ../enc/encode.cc ../enc/dictionary.h ...
apache-2.0
kidscancode/gamedev
tutorials/tilemap/part 06/tilemap.py
5
1126
import pygame as pg from settings import * def collide_hit_rect(one, two): return one.hit_rect.colliderect(two.rect) class Map: def __init__(self, filename): self.data = [] with open(filename, 'rt') as f: for line in f: self.data.append(line.strip()) self.t...
mit
mubix/pth-toolkit
lib/python2.7/site-packages/samba/external/subunit/progress_model.py
85
4056
# # subunit: extensions to Python unittest to get test results from subprocesses. # Copyright (C) 2009 Robert Collins <robertc@robertcollins.net> # # Licensed under either the Apache License, Version 2.0 or the BSD 3-clause # license at the users choice. A copy of both licenses are available in the # project sour...
bsd-2-clause
GoogleCloudPlatform/PerfKitExplorer
third_party/py/apiclient/discovery.py
115
35847
# Copyright (C) 2010 Google 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 # # Unless required by applicable law or agreed to in writ...
apache-2.0
ketnh55/Permission
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #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, merge, publish, distrib...
mit
herilalaina/scikit-learn
examples/feature_selection/plot_f_test_vs_mi.py
82
1671
""" =========================================== Comparison of F-test and mutual information =========================================== This example illustrates the differences between univariate F-test statistics and mutual information. We consider 3 features x_1, x_2, x_3 distributed uniformly over [0, 1], the targ...
bsd-3-clause
CI-WATER/TethysCluster
tethyscluster/plugins/mysql.py
2
13790
# Copyright 2009-2014 Justin Riley # # This file is part of TethysCluster. # # TethysCluster 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 Foundation, either version 3 of the License, or (at your option) any # la...
gpl-3.0
syci/l10n-spain
l10n_es_payment_order_confirming_bankia/wizard/export_csb.py
5
1310
# -*- coding: utf-8 -*- # (c) 2016 Soluntec Proyectos y Soluciones TIC. - Rubén Francés , Nacho Torró # (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, api from .confirming_bankia import ConfirmingBankia class BankingExport...
agpl-3.0
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/addons/purchase/wizard/purchase_order_group.py
376
3379
# -*- 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
KitKatXperience/platform_external_chromium_org
build/download_nacl_toolchains.py
66
2382
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Shim to run nacl toolchain download script only if there is a nacl dir.""" import os import sys def Main(args): # Exit earl...
bsd-3-clause
bwrsandman/OpenUpgrade
addons/web_graph/controllers/main.py
251
3561
from openerp import http import simplejson from openerp.http import request, serialize_exception as _serialize_exception from cStringIO import StringIO from collections import deque try: import xlwt except ImportError: xlwt = None class TableExporter(http.Controller): @http.route('/web_graph/check_xlwt',...
agpl-3.0
vmindru/ansible
contrib/inventory/ssh_config.py
70
4027
#!/usr/bin/env python # (c) 2014, Tomas Karasek <tomas.karasek@digile.fi> # # 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
fxfitz/ansible
lib/ansible/modules/network/f5/bigip_iapp_service.py
6
21102
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
was4444/chromium.src
native_client_sdk/src/tools/create_html.py
51
5934
#!/usr/bin/env python # Copyright (c) 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. """Creates simple HTML for running a NaCl module. This script is designed to make the process of creating running Native Client ex...
bsd-3-clause
vaginessa/pyload
module/plugins/accounts/PremiumTo.py
6
1484
# -*- coding: utf-8 -*- from module.plugins.internal.Account import Account class PremiumTo(Account): __name__ = "PremiumTo" __type__ = "account" __version__ = "0.11" __status__ = "testing" __description__ = """Premium.to account plugin""" __license__ = "GPLv3" __authors__ ...
gpl-3.0
liorvh/infernal-twin
build/reportlab/src/reportlab/lib/arciv.py
32
7610
#copyright ReportLab Europe Limited. 2000-2012 #see license.txt for license details ''' Arciv Stream ciphering ''' __all__='''ArcIV encode decode'''.split() __version__=''' 1.0 ''' from reportlab.lib.utils import isUnicode, isPy3 class ArcIV: ''' performs 'ArcIV' Stream Encryption of S using key Based on what is wi...
gpl-3.0
pearsonlab/nipype
nipype/algorithms/tests/test_moments.py
10
13486
import numpy as np from nipype.testing import assert_true import tempfile from nipype.algorithms.misc import calc_moments def test_skew(): data = """14.62418305 5.916396751 -1.658088086 4.71113546 1.598428608 5.612553811 -5.004056368 -4.057513911 11.16365251 17.32688599 -3.099920667 2.630189741 2.38970...
bsd-3-clause
TomBaxter/osf.io
framework/bcrypt/__init__.py
62
1564
# Adapted from: # Name: Flask-Bcrypt # Version: 0.3.2 # Summary: Bcrypt support for hashing passwords # Home-page: https://github.com/maxcountryman/flask-bcrypt # Author: Max Countryman # Author-email: maxc@me.com # License: BSD import bcrypt from website import settings def generate_password_hash(passw...
apache-2.0
sadanandb/pmt
src/tactic/ui/examples/keyboard_handler_examples_wdg.py
6
3068
########################################################### # # Copyright (c) 2009, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
USStateDept/geonode
geonode/security/views.py
27
4547
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 versio...
gpl-3.0
vlegoff/tsunami
src/primaires/scripting/extensions/selection.py
1
8145
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 # ...
bsd-3-clause
Lujeni/ansible
lib/ansible/modules/network/fortios/fortios_firewall_local_in_policy.py
13
14679
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 3 of the Lic...
gpl-3.0
johnkeates/statsite
sinks/graphite.py
1
5895
""" Supports flushing metrics to graphite """ import re import sys import socket import logging import pickle import struct # Initialize the logger logging.basicConfig() SPACES = re.compile(r"\s+") SLASHES = re.compile(r"\/+") NON_ALNUM = re.compile(r"[^a-zA-Z_\-0-9\.]") class GraphiteStore(object): def __init...
bsd-3-clause
itielshwartz/BackendApi
lib/googleapiclient/schema.py
1
10198
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
kennethgillen/ansible
lib/ansible/modules/cloud/amazon/ec2_customer_gateway.py
61
9038
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
gpl-3.0
kumar303/amo-validator
tests/test_js_spidermonkey.py
6
3356
import mock from nose.tools import assert_raises, eq_ from .js_helper import _do_test_raw, _get_var from validator import decorator from validator.errorbundler import ErrorBundle from validator.testcases import scripting from validator.testcases.javascript.jsshell import JSShell, get_tree def test_scripting_snippe...
bsd-3-clause
hguemar/cinder
cinder/volume/drivers/huawei/__init__.py
3
4417
# Copyright (c) 2013 - 2014 Huawei Technologies Co., Ltd. # 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....
apache-2.0
macourteau/scripts
chromium/sublime/find_owners.py
1
2139
"""Sublime Text plugin to find the Chromium OWNERS for the current file. In a Chromium checkout, this will search for the closest OWNERS file and list its contents. Select an entry to copy to the clipboard. You can also open the displayed OWNERS file, or walk up the directory tree to the next OWNERS file. """ import ...
mit
abagh0703/RetailTrail
flask/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/gaerdbms.py
55
3387
# mysql/gaerdbms.py # Copyright (C) 2005-2016 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+gaerdbms :name: Google Cloud SQL :dbapi: rdbms :...
mit
mhaessig/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_stash.py
23
1415
import unittest import uuid import pytest wptserve = pytest.importorskip("wptserve") from wptserve.router import any_method from wptserve.stash import StashServer from .base import TestUsingServer class TestResponseSetCookie(TestUsingServer): def run(self, result=None): with StashServer(None, authkey=st...
mpl-2.0
spisneha25/django
django/db/models/expressions.py
159
33643
import copy import datetime from django.conf import settings from django.core.exceptions import FieldError from django.db.backends import utils as backend_utils from django.db.models import fields from django.db.models.constants import LOOKUP_SEP from django.db.models.query_utils import Q, refs_aggregate from django.u...
bsd-3-clause
unicri/edx-platform
cms/djangoapps/contentstore/views/tabs.py
28
7943
""" Views related to course tabs """ from student.auth import has_course_author_access from util.json_request import expect_json, JsonResponse from django.http import HttpResponseNotFound from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions import Permi...
agpl-3.0
mrniranjan/sssd
src/tests/pyhbac-test.py
5
20864
#!/usr/bin/env python # SSSD # # SSSD HBAC python API tests # # Copyright (C) Red Hat # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your opti...
gpl-3.0
skg-net/ansible
test/units/modules/network/f5/test_bigiq_utility_license.py
10
3436
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys from nose.plugins.skip i...
gpl-3.0
crlang/sublime-text---front-end-config
Data/Packages/pymdownx/st3/pymdownx/__version__.py
4
1431
"""Version.""" # (major, minor, micro, release type, pre-release build, post-release build) version_info = (4, 11, 0, 'final', 0, 0) def _version(): """ Get the version (PEP 440). Version structure (major, minor, micro, release type, pre-release build, post-release build) Release names are n...
mit
paolodedios/tensorflow
tensorflow/python/data/kernel_tests/placement_test.py
6
9657
# Copyright 2020 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
toidi/hadoop-yarn-api-python-client
tests/test_history_server.py
1
3978
# -*- coding: utf-8 -*- from mock import patch from tests import TestCase from yarn_api_client.history_server import HistoryServer from yarn_api_client.errors import IllegalArgumentError @patch('yarn_api_client.history_server.HistoryServer.request') class HistoryServerTestCase(TestCase): def setUp(self): ...
bsd-3-clause
apache/beam
sdks/python/apache_beam/runners/portability/sdk_container_builder.py
4
13597
# # 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
kannon92/psi4
psi4/share/psi4/scripts/vmd_cube.py
1
12482
#!/usr/bin/env python # # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2016 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This program is free software; you can redistribute it and/or modify #...
gpl-2.0
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/mpl_examples/misc/font_indexing.py
4
1299
""" A little example that shows how the various indexing into the font tables relate to one another. Mainly for mpl developers.... """ import matplotlib from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, KERNING_UNFITTED, KERNING_UNSCALED #fname = '/usr/share/fonts/sfd/FreeSans.ttf' fname = matplotlib.get_da...
gpl-2.0
gstarnberger/paasta
paasta_tools/check_marathon_services_replication.py
1
17359
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 # # Unless required by applicable law ...
apache-2.0
NL66278/OCB
addons/auth_signup/__init__.py
446
1039
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
kacozg/Alice
core.py
1
1695
""" How to run scrapers programmatically from a script """ import sys #ubuntu sys.path.insert(0, '/home/kaco/Desktop/alice') #windows sys.path.insert(0, 'C:/Users/Carlos/Google Drive/ZetUp/Buscato/alice') sys.path.insert(0, 'C:/alice') from spiders.abcdin_spider import AbcdinSpider from spiders.casaximena_spider impo...
apache-2.0
gFelicio/agenda
public/node_modules/node-gyp/gyp/pylib/gyp/input.py
578
116086
# 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. from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from co...
mit
jazkarta/edx-platform
common/test/acceptance/tests/lms/test_lms.py
21
46632
# -*- coding: utf-8 -*- """ End-to-end tests for the LMS. """ from datetime import datetime from flaky import flaky from textwrap import dedent from unittest import skip from nose.plugins.attrib import attr from bok_choy.promise import EmptyPromise from ..helpers import ( UniqueCourseTest, EventsTestMixin, ...
agpl-3.0
Cgruppo/oppia
core/controllers/profile.py
15
7159
# Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
seadsystem/website
web2py/gluon/tests/test_contribs.py
20
2128
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit tests for contribs """ import unittest import os from fix_path import fix_sys_path fix_sys_path(__file__) from gluon.storage import Storage import gluon.contrib.fpdf as fpdf import gluon.contrib.pyfpdf as pyfpdf from gluon.contrib.appconfig import AppConfig d...
mit
shikhardb/scikit-learn
sklearn/utils/random.py
19
10413
# Author: Hamzeh Alsalhi <ha258@cornell.edu> # # License: BSD 3 clause from __future__ import division import numpy as np import scipy.sparse as sp import operator import array from sklearn.utils import check_random_state from ._random import sample_without_replacement __all__ = ['sample_without_replacement', 'choic...
bsd-3-clause
napjon/moocs_solution
ml-udacity/tools/startup.py
5
1048
#!/usr/bin/python print print "checking for nltk" try: import nltk except ImportError: print "you should install nltk before continuing" print "checking for numpy" try: import numpy except ImportError: print "you should install numpy before continuing" print "checking for sklearn" try: import skl...
mit
ReconCell/smacha
smacha_ros/test/smacha_generated_py/executive_smach_tutorials/state_machine_nesting2_generate_output.py
4
1898
#!/usr/bin/env python import roslib; roslib.load_manifest('smacha') import rospy import smach import smach_ros # define state Bas class Bas(smach.State): def __init__(self): smach.State.__init__(self, outcomes=['outcome3']) def execute(self, userdata): rospy.loginfo('Executing state...
bsd-3-clause
shakamunyi/tensorflow
tensorflow/python/training/session_run_hook.py
22
10420
# 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
Darknet-Crypto/Darknet
test/functional/test_framework/netutil.py
21
5054
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Linux network utilities. Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-10...
mit
srvg/ansible
lib/ansible/module_utils/facts/system/date_time.py
18
2693
# Data and time related facts collection for ansible. # # 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
gymnasium/edx-platform
lms/djangoapps/badges/models.py
1
12332
""" Database models for the badges app """ from importlib import import_module from config_models.models import ConfigurationModel from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models from django.utils.translation i...
agpl-3.0
jalexvig/tensorflow
tensorflow/python/training/checkpointable/util_test.py
3
67131
# 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
lcrees/twoq
twoq/tests/auto/queuing.py
1
2927
# -*- coding: utf-8 -*- '''auto queuing call chain test mixins''' class AQMixin(object): ########################################################################### ## queue manipulation ##################################################### ################################################################...
bsd-3-clause
shakamunyi/tensorflow
tensorflow/python/kernel_tests/matmul_op_test.py
60
9899
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
weka-io/boto
tests/unit/ec2/test_connection.py
9
71657
#!/usr/bin/env python import httplib from datetime import datetime, timedelta from mock import MagicMock, Mock from tests.unit import unittest from tests.unit import AWSMockServiceTestCase import boto.ec2 from boto.regioninfo import RegionInfo from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMappi...
mit