repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
adambrenecki/django
tests/generic_views/test_dates.py
4
31517
from __future__ import unicode_literals import time import datetime from unittest import skipUnless from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, skipUnlessDBFeature from django.test.utils import override_settings from django.utils import timezone from .models import Book,...
bsd-3-clause
ninjin/fader
src/ngram.py
1
2963
#!/usr/bin/env python ''' Generate n-grams from input strings. If you want liblinear-style feature representations, here is a nice hack: paste <(cut -f 1 ${FILE}) <(./ngram.py -i ${FILE} | cut -f 2- \ | sed -e 's| |_|g' -e 's|\t|:1 |g' -e 's|$|:1|g' -e 's|\t| |g') Author: Pontus Stenetorp <po...
isc
asobolev/gndata-api
state_machine/tests/fake.py
2
1387
from django.db import models from state_machine.models import BaseGnodeObject from state_machine.versioning.models import VersionedM2M from state_machine.versioning.descriptors import VersionedForeignKey from state_machine.versioning.descriptors import VersionedManyToManyField #=======================================...
gpl-3.0
xisisu/RT-Xen
tools/xm-test/tests/xapi/01_xapi-vm_basic.py
42
1709
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2006 # Author: Stefan Berger <stefanb@us.ibm.com> # Basic VM creation test from XmTestLib import xapi from XmTestLib.XenAPIDomain import XmTestAPIDomain from XmTestLib import * from xen.xend import XendAPIConstants import commands import os tr...
gpl-2.0
jezdez/kuma
kuma/core/tests/test_locale_middleware.py
30
1946
from kuma.core.tests import KumaTestCase class TestLocaleMiddleware(KumaTestCase): def test_default_redirect(self): # User wants en-us, we send en-US response = self.client.get('/', follow=True, HTTP_ACCEPT_LANGUAGE='en-us') self.assertRedirects(response,...
mpl-2.0
jezdez/kuma
vendor/packages/translate/search/test_lshtein.py
37
1873
from translate.search import lshtein class TestLevenshtein: """Test whether Levenshtein distance calculations are correct""" def test_basic_distance(self): """Tests distance correctness with a few basic values""" levenshtein = lshtein.LevenshteinComparer() assert lshtein.distance("wor...
mpl-2.0
aristanetworks/neutron
neutron/plugins/metaplugin/meta_models_v2.py
45
1594
# Copyright 2012, Nachi Ueno, NTT MCL, 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 # # Unles...
apache-2.0
jamespcole/home-assistant
tests/components/zha/test_binary_sensor.py
7
6355
"""Test zha binary sensor.""" from homeassistant.components.binary_sensor import DOMAIN from homeassistant.const import STATE_ON, STATE_OFF, STATE_UNAVAILABLE from .common import ( async_init_zigpy_device, make_attribute, make_entity_id, async_test_device_join, async_enable_traffic ) async def test_binary_sen...
apache-2.0
cedk/odoo
addons/l10n_vn/__init__.py
425
1067
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved. # # This program is free software: you can redistribute it and/or...
agpl-3.0
openstack/nova
tools/reserve-migrations.py
7
2468
#!/usr/bin/env python import argparse import glob import os import subprocess BASE = 'nova/db/sqlalchemy/migrate_repo/versions'.split('/') API_BASE = 'nova/db/sqlalchemy/api_migrations/migrate_repo/versions'.split('/') STUB = \ """# Licensed under the Apache License, Version 2.0 (the "License"); you may # not ...
apache-2.0
spthaolt/socorro
webapp-django/crashstats/tokens/models.py
9
1033
import datetime import uuid from django.db import models from django.conf import settings from django.contrib.auth.models import User, Permission from django.utils import timezone def get_future(): delta = datetime.timedelta(days=settings.TOKENS_DEFAULT_EXPIRATION_DAYS) return timezone.now() + delta def ma...
mpl-2.0
yati-sagade/incubator-airflow
tests/utils/test_operator_helpers.py
31
2192
# -*- coding: utf-8 -*- # # 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 writing, software ...
apache-2.0
mcalmer/spacewalk
spacewalk/certs-tools/rhn_bootstrap_strings.py
1
16095
# # Copyright (c) 2008--2018 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
ToonBoxEntertainment/rez
src/rez/utils/colorize.py
3
9443
import sys import logging from rez.vendor import colorama from rez.config import config from rez.utils.platform_ import platform_ _initialised = False def _init_colorama(): global _initialised if not _initialised: colorama.init() _initialised = True def stream_is_tty(stream): """Return...
lgpl-3.0
facebookexperimental/eden
eden/hg-server/tests/test-duplicateoptions.py
2
1451
from __future__ import absolute_import, print_function import os from edenscm.mercurial import commands, extensions, ui as uimod from hghave import require require(["py2"]) ignore = { b"", b"factotum", b"fbscmquery", b"globalrevs", b"hgsql", b"highlight", b"lz4revlog", b"remotename...
gpl-2.0
virtualopensystems/neutron
neutron/tests/unit/test_iptables_firewall.py
8
53251
# Copyright 2012, Nachi Ueno, NTT MCL, 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 # # Unles...
apache-2.0
ingresscoin/ingresscoin
qa/rpc-tests/forknotify.py
161
2179
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test -alertnotify # from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import Aut...
mit
BrandoJS/Paparazzi_vtol
sw/lib/python/messages_xml_map.py
14
2389
#!/usr/bin/env python import os import sys import getopt messages_path = '%s/conf/messages.xml' % os.getenv("PAPARAZZI_HOME") message_dictionary = {} message_dictionary_types = {} message_dictionary_id_name = {} message_dictionary_name_id = {} def Usage(scmd): lpathitem = scmd.split('/') fmt = '''Usage: %s [-h | ...
gpl-2.0
IronLanguages/ironpython2
Src/StdLib/Lib/urllib.py
1
60265
"""Open an arbitrary URL. See the following document for more info on URLs: "Names and Addresses, URIs, URLs, URNs, URCs", at http://www.w3.org/pub/WWW/Addressing/Overview.html See also the HTTP spec (from which the error codes are derived): "HTTP - Hypertext Transfer Protocol", at http://www.w3.org/pub/WWW/Protocols...
apache-2.0
SkyLothar/requests-aliyun
tests/test-sign-1-0.py
1
3874
# -*- coding: utf8 -*- import base64 import hashlib import hmac import mock import nose import requests import aliyunauth.sign_ver_1_0 @nose.tools.raises(NotImplementedError) def test_no_version(): class FakeNoVersion(aliyunauth.sign_ver_1_0.AuthBase): SERVICE = "test" FakeNoVersion("access-key", "...
apache-2.0
kawamon/hue
apps/oozie/src/oozie/conf.py
2
3955
#!/usr/bin/env python # 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 ma...
apache-2.0
tellesnobrega/horizon
openstack_dashboard/dashboards/project/instances/tabs.py
41
4133
# Copyright 2012 Nebula, 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 agree...
apache-2.0
nox/servo
tests/wpt/harness/wptrunner/executors/executormarionette.py
58
21153
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import hashlib import httplib import os import socket import threading import time import traceback import urlparse impo...
mpl-2.0
VictorLowther/swift
test/functionalnosetests/test_object.py
10
21986
#!/usr/bin/python import unittest from nose import SkipTest from uuid import uuid4 from swift.common.constraints import MAX_META_COUNT, MAX_META_NAME_LENGTH, \ MAX_META_OVERALL_SIZE, MAX_META_VALUE_LENGTH from swift_testing import check_response, retry, skip, skip3, swift_test_user class TestObject(unittest.Te...
apache-2.0
dereulenspiegel/spotimc
envutils.py
1
1520
''' Copyright 2011 Mikel Azkolain This file is part of Spotimc. Spotimc 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. Spotimc ...
gpl-3.0
robbiet480/home-assistant
homeassistant/components/mychevy/__init__.py
19
4650
"""Support for MyChevy.""" from datetime import timedelta import logging import threading import time import mychevy.mychevy as mc import voluptuous as vol from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from homeassistant.helpers import config_validation as cv, discovery from homeassistant.util import T...
apache-2.0
tobegit3hub/glance_docker
glance/api/v2/schemas.py
11
3947
# Copyright 2012 OpenStack Foundation. # 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 req...
apache-2.0
ChristineLaMuse/mozillians
mozillians/users/migrations/0043_migrate_externalaccount_types.py
3
12629
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): type_map = {'0': 'AMO', '1': 'BMO', '2': 'GITHUB', '3': 'MDN', '4': 'SUMO', ...
bsd-3-clause
GheRivero/ansible
lib/ansible/modules/system/getent.py
104
3914
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Brian Coca <brian.coca+dev@gmail.com> # 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_versi...
gpl-3.0
pgmillon/ansible
lib/ansible/modules/monitoring/pagerduty_alert.py
68
8678
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
justacec/bokeh
bokeh/util/browser.py
8
1702
from __future__ import absolute_import from os.path import abspath import webbrowser from ..settings import settings def get_browser_controller(browser=None): browser = settings.browser(browser) if browser is not None: if browser == 'none': class DummyWebBrowser(object): ...
bsd-3-clause
parvez3019/bitcoin
qa/rpc-tests/keypool.py
48
4579
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the wallet keypool, and interaction with wallet encryption/locking # Add python-bitcoinrpc to modu...
mit
bxshi/gem5
src/cpu/o3/O3CPU.py
9
7790
# Copyright (c) 2005-2007 The Regents of The University of Michigan # 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
Southpaw-TACTIC/Team
src/python/Lib/site-packages/PySide/examples/sql/querymodel.py
1
4176
#!/usr/bin/env python ############################################################################ ## ## Copyright (C) 2004-2005 Trolltech AS. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## This file may be used under the terms of the GNU General Public ## License version ...
epl-1.0
sajuptpm/neutron-ipam
neutron/plugins/nec/packet_filter.py
5
11716
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012-2013 NEC Corporation. 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.apach...
apache-2.0
Tendrl/commons
tendrl/commons/objects/node/atoms/cmd/__init__.py
2
1493
from tendrl.commons.objects import AtomExecutionFailedError from tendrl.commons.objects import BaseAtom from tendrl.commons.utils.cmd_utils import Command from tendrl.commons.utils import log_utils as logger class Cmd(BaseAtom): def run(self): cmd = self.parameters.get("Node.cmd_str") logger.log(...
lgpl-2.1
charukiewicz/beer-manager
venv/lib/python3.4/site-packages/pip/_vendor/requests/auth.py
331
6123
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import parse_dict_header ...
mit
houstar/linux-3.8.8
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
ebber/noteCreationServer
flask/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/big5prober.py
2931
1684
######################## 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...
gpl-2.0
wfleurant/cjdns
contrib/python/pingAll.py
9
2684
#!/usr/bin/env python2 # You may redistribute this program and/or modify it under the terms of # the GNU General Public License as published by the Free Software Foundation, # either version 3 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
gpl-3.0
kambysese/mne-python
tutorials/source-modeling/plot_eeg_mri_coords.py
10
6635
# -*- coding: utf-8 -*- """ .. _tut-eeg-mri-coords: EEG source localization given electrode locations on an MRI =========================================================== This tutorial explains how to compute the forward operator from EEG data when the electrodes are in MRI voxel coordinates. """ # Authors: Eric La...
bsd-3-clause
janslow/boto
tests/unit/rds/test_snapshot.py
121
14445
from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.rds import RDSConnection from boto.rds.dbsnapshot import DBSnapshot from boto.rds import DBInstance class TestDescribeDBSnapshots(AWSMockServiceTestCase): connection_class = RDSConnection def default_body(self): ...
mit
jinnykoo/christmas
src/oscar/management/commands/oscar_populate_countries.py
6
1689
# -*- coding: utf-8 -*- from optparse import make_option from django.core.management.base import BaseCommand, CommandError from oscar.core.loading import get_model Country = get_model('address', 'Country') class Command(BaseCommand): help = "Populates the list of countries with data from pycountry." # TODO:...
bsd-3-clause
rvalyi/geraldo
site/newsite/site-geraldo/django/contrib/localflavor/nl/forms.py
35
2762
""" NL-specific Form helpers """ import re from django.forms import ValidationError from django.forms.fields import Field, Select, EMPTY_VALUES from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode pc_re = re.compile('^\d{4}[A-Z]{2}$') sofi_re = re.compile('^\d{9}$')...
lgpl-3.0
manti-by/m2
app/core/tasks.py
2
1678
import logging import subprocess from raven.contrib.django.raven_compat.models import client from core.celery import app from blog.constants import MP3_PREVIEW, OGG_PREVIEW, OGG_RELEASE logger = logging.getLogger() @app.task def convert_to_mp3_preview(post_id): command = [ "-acodec", "libmp3lam...
bsd-3-clause
jlegendary/SimpleCV
SimpleCV/MachineLearning/TreeClassifier.py
11
19981
from SimpleCV.base import * from SimpleCV.ImageClass import Image, ImageSet from SimpleCV.DrawingLayer import * from SimpleCV.Features import FeatureExtractorBase """ This class is encapsulates almost everything needed to train, test, and deploy a multiclass decision tree / forest image classifier. Training data shou...
bsd-3-clause
John-Boik/Principled-Societies-Project
leddaApp/static/brython/src/Lib/test/test_pyclbr.py
39
6960
''' Test cases for pyclbr.py Nick Mathewson ''' from test.support import run_unittest import sys from types import FunctionType, MethodType, BuiltinFunctionType import pyclbr from unittest import TestCase StaticMethodType = type(staticmethod(lambda: None)) ClassMethodType = type(classmethod(lambda c: None)) # H...
gpl-3.0
mhnatiuk/phd_sociology_of_religion
scrapper/build/cryptography/tests/hazmat/backends/test_openssl.py
1
18724
# 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 import os import subprocess import sys import textwrap import pretend i...
gpl-2.0
ataylor32/django
tests/admin_views/admin.py
26
30169
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import tempfile from wsgiref.util import FileWrapper from django import forms from django.conf.urls import url from django.contrib import admin from django.contrib.admin import BooleanFieldListFilter from django.contrib.admin.views.main import ...
bsd-3-clause
Hodorable/0602
openstack_dashboard/test/api_tests/glance_rest_tests.py
35
3890
# Copyright 2015, Rackspace, US, Inc. # Copyright 2015, Hewlett-Packard Development Company, L.P. # # 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...
apache-2.0
kelvinatorr/relationshipanalytics
hitlist_api.py
1
6082
import endpoints import logging from protorpc import messages from protorpc import message_types from protorpc import remote from time import sleep import ra_memcache # Import api messages from hitlist_api_messages import EateryNotes from hitlist_api_messages import EateryLocation from hitlist_api_messages import Eate...
mit
AutorestCI/azure-sdk-for-python
azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py
2
1345
# 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
telerik/cloudbase-init
cloudbaseinit/plugins/windows/userdataplugins/parthandler.py
2
1683
# Copyright 2013 Mirantis Inc. # Copyright 2014 Cloudbase Solutions Srl # # 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
evro/CouchPotatoServer
libs/tornado/ioloop.py
4
38297
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
gpl-3.0
ogenstad/ansible
lib/ansible/modules/network/onyx/onyx_magp.py
66
7830
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
rockyuse/rockyuse.github.io
AvatarUI/lib/js_beautify/python/jsbeautifier/tests/testjsbeautifier.py
2
21509
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import unittest import jsbeautifier class TestJSBeautifier(unittest.TestCase): def test_unescape(self): # Test cases contributed by <chrisjshull on GitHub.com> test_fragment = self.decodesto bt = self.bt bt('"\\\\s"'); # == "...
mit
ds-hwang/chromium-crosswalk
third_party/pycoverage/coverage/xmlreport.py
159
5809
"""XML reporting for coverage.py""" import os, sys, time import xml.dom.minidom from coverage import __url__, __version__ from coverage.backward import sorted, rpartition # pylint: disable=W0622 from coverage.report import Reporter def rate(hit, num): """Return the fraction of `hit`/`num`, as a string.""" ...
bsd-3-clause
dingocuster/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
276
3790
# Authors: Lars Buitinck <L.J.Buitinck@uva.nl> # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils.testing import (assert_equal, assert_in, ...
bsd-3-clause
fengxiaoiie/volatility
volatility/plugins/linux/dentry_cache.py
57
2513
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your o...
gpl-2.0
BhallaLab/moose-examples
neuroml/lobster_pyloric/STG_net.py
2
5530
## Aditya Gilra, NCBS, Bangalore, 2013 """ Stomatogastric ganglion Central Pattern Generator: generates pyloric rhythm of the lobster Network model translated from: Prinz, Bucher, Marder, Nature Neuroscience, 2004; STG neuron models translated from: Prinz, Billimoria, Marder, J.Neurophys., 2003. Translated into MOO...
gpl-2.0
carlgao/lenga
images/lenny64-peon/usr/share/python-support/python-pygments/pygments/styles/friendly.py
24
2508
# -*- coding: utf-8 -*- """ pygments.styles.friendly ~~~~~~~~~~~~~~~~~~~~~~~~ A modern style based on the VIM pyte theme. :copyright: 2006-2007 by Georg Brandl, Armin Ronacher. :license: BSD, see LICENSE for more details. """ from pygments.style import Style from pygments.token import Keyword, Na...
mit
haniehrajabi/ryu
ryu/tests/unit/test_utils.py
17
1521
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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
roberthartung/risk
server.py
1
21775
#!/usr/bin/env python import asyncio import datetime import random import websockets import json from enum import Enum import gamemap import sys import copy import random mapinfo = gamemap.MapInfo('web/map.svg') COLORS=['black', 'green', 'yellow', 'red', 'blue', 'cyan', 'orange'] # TODO(rh): Uppercase members class ...
bsd-3-clause
jeremiahmarks/sl4a
python/src/Mac/Modules/ctl/ctlscan.py
34
7767
# Scan <Controls.h>, generating ctlgen.py. import sys from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner def main(): # input = "Controls.h" # Universal Headers < 3.3 input = ["Controls.h", "ControlDefinitions.h"] # Universal Headers >= 3.3 output = "ctlg...
apache-2.0
jagguli/intellij-community
python/lib/Lib/site-packages/django/contrib/formtools/preview.py
229
6829
""" Formtools Preview application. """ import cPickle as pickle from django.conf import settings from django.http import Http404 from django.shortcuts import render_to_response from django.template.context import RequestContext from django.utils.hashcompat import md5_constructor from django.utils.crypto import consta...
apache-2.0
Jumpscale/jumpscale6_core
utils/bitbucket_repos_importer.py
1
2183
from JumpScale import j import JumpScale.baselib.mercurial import requests import boto from boto.gs.connection import GSConnection gs_access_key_id = j.application.config.get('gs.access_key_id') gs_secret_access_key = j.application.config.get('gs.secret_access_key') def repos_list(account, username, password): ur...
bsd-2-clause
upliftaero/MissionPlanner
Lib/encodings/cp1140.py
93
13668
""" Python Character Mapping Codec cp1140 generated from 'python-mappings/CP1140.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
gpl-3.0
quentinsf/ansible
v1/ansible/module_utils/basic.py
81
63055
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/base_rml_edit/__openerp__.py
14
1503
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
tmerrick1/spack
lib/spack/spack/cmd/common/arguments.py
2
4824
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
cloudera/hue
desktop/core/ext-py/eventlet-0.24.1/eventlet/hubs/kqueue.py
4
3572
import os import sys from eventlet import patcher, support import six select = patcher.original('select') time = patcher.original('time') from eventlet.hubs.hub import BaseHub, READ, WRITE, noop if getattr(select, 'kqueue', None) is None: raise ImportError('No kqueue implementation found in select module') FIL...
apache-2.0
stutivarshney/Bal-Aveksha
WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/core/management/commands/startproject.py
117
1223
from importlib import import_module from django.core.management.base import CommandError from django.core.management.templates import TemplateCommand from ..utils import get_random_secret_key class Command(TemplateCommand): help = ( "Creates a Django project directory structure for the given project " ...
gpl-3.0
ii0/bits
python/bits/__init__.py
1
10976
# Copyright (c) 2015, Intel Corporation # 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 condit...
bsd-3-clause
ChopChopKodi/pelisalacarta
python/main-classic/channels/beeg.py
3
4675
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para beeg.com # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import re import sys import urllib from core import logger fro...
gpl-3.0
basepi/hubble
hubblestack/hec/obj.py
2
13362
# -*- encoding: utf-8 -*- import socket import json import time import copy import os import hashlib import certifi import urllib3 import logging log = logging.getLogger(__name__) import hubblestack.status hubble_status = hubblestack.status.HubbleStatus(__name__) from . dq import DiskQueue, NoQueue, QueueCapacityE...
apache-2.0
kevclarx/ansible
lib/ansible/plugins/lookup/pipe.py
67
1864
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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
dustymabe/ansible-modules-core
cloud/amazon/ec2_ami.py
28
19455
#!/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 distributed...
gpl-3.0
KarimAllah/goldfish
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
LLCampos/radlex_annotator
annotator/Annotator.py
1
2676
from RadlexOntology import RadlexOntology import re from stopwords import STOPWORDS class RadlexAnnotator(object): def __init__(self, subset=False): self.ontology = RadlexOntology(subset) def annotate(self, text, stopwords=STOPWORDS, min_length=3): """ stopwords - words that are ig...
mit
tinchoss/Python_Android
python/src/Doc/tools/rstlint.py
43
7587
#!/usr/bin/env python # -*- coding: utf-8 -*- # Check for stylistic and formal issues in .rst and .py # files included in the documentation. # # 01/2009, Georg Brandl # TODO: - wrong versions in versionadded/changed # - wrong markup after versionchanged directive from __future__ import with_statement import o...
apache-2.0
elopio/snapcraft
snapcraft/plugins/scons.py
7
2233
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
brianjmiller/TinCanPython
test/activitydefinition_test.py
2
9485
# Copyright 2014 Rustici Software # # 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
JakubBrachTieto/openthread
tools/harness-automation/cases/reed_5_2_5.py
16
1872
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread 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: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
wmorning/EvilLens
evillens/analyticSIELens.py
1
15100
# -*- coding: utf-8 -*- """ Created on Mon Sep 29 22:53:20 2014 @author: warrenmorningstar """ # ====================================================================== from astropy import units, constants import numpy as np import evillens as evil # ===================================================================...
gpl-2.0
GoogleCloudPlatform/cloud-foundation-toolkit
docs/meta/generate-index.py
1
4267
#!/usr/bin/env python3 # Copyright 2020 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
alaski/nova
nova/tests/unit/compute/test_host_api.py
4
21737
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # Copyright 2013 Red Hat, 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/lice...
apache-2.0
Sup3Roque/Pancas
_OLD/plugin.video.pancas/resources/lib/sources/disabled/dizimag_tv.py
10
5827
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
kailIII/emaresa
trunk.pe/report_aeroo/wizard/__init__.py
14
1620
############################################################################## # # Copyright (c) 2008-2012 Alistek Ltd (http://www.alistek.com) All Rights Reserved. # General contacts <info@alistek.com> # # WARNING: This program as such is intended to be used by professional # programmers who take th...
agpl-3.0
aldenjenkins/foobargamingwebsite
mezzanine/core/fields.py
1
5672
from __future__ import unicode_literals from future.builtins import str from bleach import clean, sanitizer from django.conf import settings from django.contrib.admin.widgets import AdminTextareaWidget from django.core.exceptions import ImproperlyConfigured, ValidationError from django.db import models from django.fo...
bsd-3-clause
HyunsukBaek/etherpad-lite
src/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py
778
65880
#!/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. """Unit tests for the MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
apache-2.0
emdodds/SAILnet
Scripts/matspectrorun.py
1
2043
# -*- coding: utf-8 -*- """ Created on Mon Dec 14 00:30:43 2015 @author: Eric """ import argparse import scipy.io as io import SAILnet import numpy as np import pca.pca import matplotlib.pyplot as plt plt.ioff() parser = argparse.ArgumentParser(description="Run SAILnet with given parameters.") parser...
mit
bjolivot/ansible
lib/ansible/modules/windows/win_reboot.py
78
2860
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
aliciawyy/CompInvest
portfolio_correlation.py
1
1421
""" This file contains some functions on correlation analysis. We mainly compute the CAC 40 correlation matrix during the current year. """ import datetime as dt import pandas as pd from load.load_ticker import load_valid_cac40_names from portfolio import BasicPortfolio def get_correlations_cac40(filename='result/co...
mit
goliveirab/odoo
addons/purchase/company.py
383
1576
# -*- 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
okuta/chainer
examples/static_graph_optimizations/ptb/train_ptb_custom_loop.py
8
12422
"""Recurrent neural network language model with static graph optimizations. This is a modified version of the standard Chainer Penn Tree Bank (ptb) example that includes static subgraph optimizations. It is mostly unchanged from the original model except that that the RNN is unrolled for `bproplen` slices inside of a ...
mit
dpogue/korman
korman/properties/modifiers/water.py
2
22526
# This file is part of Korman. # # Korman 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. # # Korman is distributed i...
gpl-3.0
Arakmar/Sick-Beard
cherrypy/lib/reprconf.py
74
11033
"""Generic configuration system using unrepr. Configuration data may be supplied as a Python dictionary, as a filename, or as an open file object. When you supply a filename or file, Python's builtin ConfigParser is used (with some extensions). Namespaces ---------- Configuration keys are separated into namespaces b...
gpl-3.0
ptschip/bitcoin
contrib/testgen/gen_base58_test_vectors.py
1000
4343
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
mit
jonludlam/xen
tools/python/xen/xend/PrettyPrint.py
44
8320
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
dentaku65/plugin.video.sod
channels/saintseiya.py
2
8833
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # streamondemand.- XBMC Plugin # Canale per I Cavalieri Dello Zodiaco # http://blog.tvalacarta.info/plugin-xbmc/streamondemand. # ------------------------------------------------------------ import re from core import config from co...
gpl-3.0