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
demisto/content
Packs/Nmap/Integrations/Nmap/Nmap.py
1
2190
import demistomock as demisto from CommonServerPython import * from libnmap.process import NmapProcess from libnmap.parser import NmapParser from libnmap.reportjson import ReportEncoder if demisto.command() == 'test-module': demisto.results('ok') sys.exit(0) if demisto.command() == 'nmap-scan': nm = NmapPr...
mit
mayankcu/Django-social
social_auth/backends/google.py
7
9621
""" Google OpenID and OAuth support OAuth works straightforward using anonymous configurations, username is generated by requesting email to the not documented, googleapis.com service. Registered applications can define settings GOOGLE_CONSUMER_KEY and GOOGLE_CONSUMER_SECRET and they will be used in the auth process. ...
bsd-3-clause
MERegistro/meregistro
tests/regressiontests/sites_framework/tests.py
92
1784
from django.conf import settings from django.contrib.sites.models import Site from django.test import TestCase from models import SyndicatedArticle, ExclusiveArticle, CustomArticle, InvalidArticle, ConfusedArticle class SitesFrameworkTestCase(TestCase): def setUp(self): Site.objects.get_or_create(id=setti...
bsd-3-clause
bramwalet/Subliminal.bundle
Contents/Libraries/Shared/subliminal/converters/addic7ed.py
32
1771
# -*- coding: utf-8 -*- from __future__ import unicode_literals from babelfish import LanguageReverseConverter, language_converters class Addic7edConverter(LanguageReverseConverter): def __init__(self): self.name_converter = language_converters['name'] self.from_addic7ed = {'Català': ('cat',), 'Ch...
mit
koding/koding
go/src/vendor/github.com/koding/kite/kitectl/release.py
24
7372
#!/usr/bin/env python2.7 """ A script for packaging and releasing kite tool for OS X and Linux platforms. It can also upload the generated package file to S3 if you provide --upload flag. usage: release.py [-h] [--upload] Run it at the same directory as this script. It will put the generated files into the current wo...
agpl-3.0
bodi000/odoo
addons/l10n_be_hr_payroll/l10n_be_hr_payroll.py
379
3110
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
benschmaus/catapult
third_party/gsutil/third_party/boto/tests/unit/ec2/test_reservedinstance.py
100
1670
from tests.unit import AWSMockServiceTestCase from boto.ec2.connection import EC2Connection from boto.ec2.reservedinstance import ReservedInstance class TestReservedInstancesSet(AWSMockServiceTestCase): connection_class = EC2Connection def default_body(self): return b""" <reservedInstancesSet> <i...
bsd-3-clause
oeeagle/quantum
neutron/plugins/nec/ofc_driver_base.py
5
4998
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 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.apache.or...
apache-2.0
nju520/pyspider
pyspider/message_queue/kombu_queue.py
60
3271
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<roy@binux.me> # http://binux.me # Created on 2015-05-22 20:54:01 import time import umsgpack from kombu import Connection, enable_insecure_serializers from kombu.serialization import register from k...
apache-2.0
S01780/python-social-auth
social/backends/appsfuel.py
83
1502
""" Appsfueld OAuth2 backend (with sandbox mode support), docs at: http://psa.matiasaguirre.net/docs/backends/appsfuel.html """ from social.backends.oauth import BaseOAuth2 class AppsfuelOAuth2(BaseOAuth2): name = 'appsfuel' ID_KEY = 'user_id' AUTHORIZATION_URL = 'http://app.appsfuel.com/content/permi...
bsd-3-clause
dacjames/scrapy
tests/test_engine.py
92
8653
""" Scrapy engine tests This starts a testing web server (using twisted.server.Site) and then crawls it with the Scrapy crawler. To view the testing web server in a browser you can start it by running this module with the ``runserver`` argument:: python test_engine.py runserver """ from __future__ import print_...
bsd-3-clause
shreyasp/erpnext
erpnext/config/accounts.py
1
9631
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Billing"), "items": [ { "type": "doctype", "name": "Sales Invoice", "description": _("Bills raised to Customers.") }, { "type": "doctype", "name": "Purchase Invoice", "...
gpl-3.0
pubs/pubs
pubs/commands/rename_cmd.py
1
1161
from __future__ import unicode_literals from ..uis import get_ui from .. import color from .. import repo from ..utils import resolve_citekey from ..completion import CiteKeyCompletion def parser(subparsers, conf): parser = subparsers.add_parser('rename', help='rename the citek...
lgpl-3.0
rxuriguera/bibtexIndexMaker
src/bibim/util/tests/test_beautifulsoup.py
1
1810
# Copyright 2010 Ramon Xuriguera # # This file is part of BibtexIndexMaker. # # BibtexIndexMaker 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 late...
gpl-3.0
mdeejay/kernel_huawei_omap4
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
valkyriesavage/invenio
modules/bibupload/lib/batchuploader_engine.py
2
22837
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011 CERN. ## ## Invenio 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 opt...
gpl-2.0
lo-co/atm-py
atmPy/for_removal/LAS/LAS.py
6
8188
# -*- coding: utf-8 -*- """ Created on Mon Nov 10 11:43:10 2014 @author: htelg """ import datetime import warnings import numpy as np import pandas as pd import pylab as plt from StringIO import StringIO as io from scipy.interpolate import UnivariateSpline from atmPy.aerosols.size_distr import sizedistribution de...
mit
WhireCrow/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/urlparse.py
32
14414
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
gpl-2.0
dpla/zen
lib/akamod/__init__.py
2
1845
#zen.akamod #Some helper classes for accessing local Zen/Akara services import urllib from amara.thirdparty import httplib2, json from akara import logger from akara import request from akara.caching import cache from akara import global_config from akara.util import find_peer_service class geolookup_service(object)...
apache-2.0
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py
2
11616
# Copyright (C) 2010, 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions an...
gpl-3.0
lakshayg/tensorflow
tensorflow/python/debug/cli/cli_config_test.py
68
5541
# 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
caosmo/pip
pip/_vendor/requests/packages/chardet/langgreekmodel.py
2763
12628
######################## 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...
mit
marrow/web.dispatch.route
test/test_router.py
1
1820
# encoding: utf-8 import pytest from web.dispatch.route.router import __DYNAMIC__, Router from sample import Root @pytest.fixture def router(): return Router.from_object(Root) def test_dynamic_repr(): assert repr(__DYNAMIC__) == '<dynamic element>' def test_router_singleton(): assert Router.from_object(Root...
mit
saeschdivara/ArangoPy
arangodb/tests/api/collection.py
1
2502
import unittest from arangodb.api import Database, Collection class CollectionTestCase(unittest.TestCase): def setUp(self): self.database_name = 'testcase_collection_123' self.db = Database.create(name=self.database_name) def tearDown(self): Database.remove(name=self.database_name) ...
mit
mintar/ros-infrastructure-rosdistro
src/rosdistro/source_repository_specification.py
1
2465
# Software License Agreement (BSD License) # # Copyright (c) 2014, Open Source Robotics Foundation, 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 mus...
bsd-3-clause
mgagne/nova
nova/baserpc.py
10
2562
# # 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/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
CatsAndDogsbvba/odoo
addons/l10n_tr/__openerp__.py
259
2056
# -*- 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
abdulla-alali/CRE-NS3
src/fd-net-device/bindings/modulegen__gcc_LP64.py
6
300516
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
aneeshusa/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/serializer/htmlserializer.py
423
12897
from __future__ import absolute_import, division, unicode_literals from six import text_type import gettext _ = gettext.gettext try: from functools import reduce except ImportError: pass from ..constants import voidElements, booleanAttributes, spaceCharacters from ..constants import rcdataElements, entities,...
mpl-2.0
xifle/home-assistant
homeassistant/components/climate/heatmiser.py
22
3369
""" Support for the PRT Heatmiser themostats using the V3 protocol. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.heatmiser/ """ import logging import voluptuous as vol from homeassistant.components.climate import ClimateDevice, PLATFORM_SCHEM...
mit
dhruvsrivastava/OJ
flask/lib/python2.7/site-packages/werkzeug/posixemulation.py
148
3483
# -*- 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...
bsd-3-clause
vrv/tensorflow
tensorflow/python/kernel_tests/distributions/kullback_leibler_test.py
59
4537
# 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
charles-cooper/raiden
raiden/tests/smart_contracts/test_endpointregistry.py
3
1083
# -*- coding: utf-8 -*- from ethereum import tester from raiden.utils import get_contract_path def test_endpointregistry(tester_state, tester_events): account0 = tester.DEFAULT_ACCOUNT sender = account0.encode('hex') endpointregistry_path = get_contract_path('EndpointRegistry.sol') registry_contract ...
mit
Kongsea/tensorflow
tensorflow/contrib/quantize/python/graph_matcher.py
17
6445
# 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
huawei-cloud/compass
compass/tests/config_management/utils/test_config_reference.py
4
5733
import unittest2 from copy import deepcopy from compass.utils import util from compass.config_management.utils import config_reference class TestConfigReference(unittest2.TestCase): def test_init(self): config = {'1': {'2': 3, '10': {}}, '4': [5, 6, 7], '8': 8} ref = config_reference.ConfigRefere...
apache-2.0
ilexius/odoo
addons/lunch/tests/test_lunch.py
47
3259
# -*- coding: utf-8 -*- from openerp.tests import common class Test_Lunch(common.TransactionCase): def setUp(self): """*****setUp*****""" super(Test_Lunch, self).setUp() self.demo_user = self.env['res.users'].search([('name', '=', 'Demo User')]) self.product_bolognese_ref = self...
gpl-3.0
codecollision/DropboxToFlickr
django/template/smartif.py
331
6261
""" Parser and utilities for the smart 'if' tag """ import operator # Using a simple top down parser, as described here: # http://effbot.org/zone/simple-top-down-parsing.htm. # 'led' = left denotation # 'nud' = null denotation # 'bp' = binding power (left = lbp, right = rbp) class TokenBase(object): """ Ba...
bsd-3-clause
patmcb/odoo
addons/account/wizard/account_move_line_unreconcile_select.py
385
1864
# -*- 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
maellak/invenio
modules/webauthorprofile/lib/webauthorprofile_cli.py
18
1182
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 CERN. ## ## Invenio 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) a...
gpl-2.0
josefgrosch/Pyetree
pyetree/PyetreeBandnames.py
1
28154
# ----------------------------------------------------------------------- # # < pyetree_bandnames.py > # # ----------------------------------------------------------------------- # ----------------------------------------------------------------------- # # File Name : pyetree_bandnames.p...
apache-2.0
ivanhorvath/openshift-tools
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/src/lib/volume.py
64
2002
# pylint: skip-file # flake8: noqa class Volume(object): ''' Class to represent an openshift volume object''' volume_mounts_path = {"pod": "spec.containers[0].volumeMounts", "dc": "spec.template.spec.containers[0].volumeMounts", "rc": "spec.template.spec.co...
apache-2.0
varunarya10/boto
tests/integration/ec2/test_cert_verification.py
126
1549
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # 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 withou...
mit
npiganeau/odoo
addons/base_gengo/res_company.py
24
1784
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 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
trondhindenes/ansible
test/units/modules/network/netscaler/test_netscaler_gslb_site.py
68
24193
# Copyright (c) 2017 Citrix Systems # # 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
vishnuvaradaraj/firefox-ios
scripts/export-xliff.py
49
1380
#!/usr/bin/env python # # xliff-export.py xcodeproj-path l10n-path # # Export all locales that are present in the l10n directory. We use xcodebuild # to export and write to l10n-directory/$locale/firefox-ios.xliff so that it # can be easily imported into svn. (which is a manual step) # # Example: # # cd firefox-io...
mpl-2.0
runt18/mod_python
lib/python/mod_python/Cookie.py
3
12964
# vim: set sw=4 expandtab : # # Copyright (C) 2000, 2001, 2013 Gregory Trubetskoy # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software 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...
apache-2.0
kirmani/lockman
MC/RPi.GPIO-0.1.0/build/lib.linux-armv6l-2.7/RPi/GPIO/__init__.py
4
3646
#!/usr/bin/env python # Copyright (c) 2012 Ben Croston # # 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, ...
mit
zakuro9715/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/many_to_one_regress/tests.py
92
4466
from django.db import models from django.test import TestCase from models import First, Second, Third, Parent, Child, Category, Record, Relation class ManyToOneRegressionTests(TestCase): def test_object_creation(self): Third.objects.create(id='3', name='An example') parent = Parent(name='fred') ...
gpl-3.0
Ant-OS/android_packages_apps_OTAUpdates
jni/boost_1_57_0/libs/python/test/operators.py
46
1166
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' >>> from operators_ext import * Check __nonzero__ support >>> assert X(2) >>> assert not X(0) ---- >>> x = X(42) >>> x.val...
apache-2.0
mistercrunch/airflow
airflow/migrations/versions/45ba3f1493b9_add_k8s_yaml_to_rendered_templates.py
9
1689
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
haoch/incubator-eagle
eagle-external/eagle-ambari/lib/EAGLE/package/scripts/eagle_userprofile_topology.py
21
3337
#!/usr/bin/python # 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 # "Licen...
apache-2.0
DailyActie/Surrogate-Model
01-codes/OpenMDAO-Framework-dev/openmdao.main/src/openmdao/main/geom.py
1
2622
from openmdao.main.interfaces import IParametricGeometry, implements class ParametricGeometry(object): """A base class for objects implementing the IParametricGeometry interface. """ implements(IParametricGeometry) def __init__(self): self._callbacks = [] def regen_model(self): ...
mit
bytor99999/vertx-web
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py
2994
1676
######################## 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...
apache-2.0
eoghan2t9/Oppo-Find5-4.2-Kernel
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
dungeonsnd/test-code
dev_examples/pyserver/examples/server.py
1
1790
class Actor(gevent.Greenlet): def __init__(self): self.inbox = Queue() Greenlet.__init__(self) def onRecv(self, message): """ Define in your subclass. """ raise NotImplemented() def _run(self): self.running = True while s...
gpl-3.0
drpjk/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/sbcsgroupprober.py
2936
3291
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
lgpl-2.1
ecosoft-odoo/odoo
addons/account/report/account_print_overdue.py
380
3907
# -*- 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
datamade/jekyll-hook
tasks.py
1
1685
import pickle from redis import Redis import subprocess from uuid import uuid4 from app_config import SENTRY_DSN, REDIS_QUEUE_KEY from raven import Client sentry = Client(SENTRY_DSN) redis = Redis() class DelayedResult(object): def __init__(self, key): self.key = key self._rv = None @prope...
bsd-3-clause
mhvk/astropy
astropy/io/misc/asdf/tags/transform/basic.py
8
8303
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- from asdf.versioning import AsdfVersion from astropy.modeling import mappings from astropy.modeling import functional_models from astropy.modeling.core import CompoundModel from astropy.io.misc.asdf.types import AstropyAsdfType, A...
bsd-3-clause
collex100/odoo
addons/account_anglo_saxon/invoice.py
50
13086
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) # 2004-2010 Tiny SPRL (<http://tiny.be>). # 2009-2010 Veritos (http://veritos.nl). # All Rights Reserved # # This program is free software: you can redistri...
agpl-3.0
orion1024/Sick-Beard
lib/imdb/parser/mobile/__init__.py
50
37466
""" parser.mobile package (imdb package). This package provides the IMDbMobileAccessSystem class used to access IMDb's data for mobile systems. the imdb.IMDb function will return an instance of this class when called with the 'accessSystem' argument set to "mobile". Copyright 2005-2011 Davide Alberani <da@erlug.linux...
gpl-3.0
sephii/django
django/template/defaulttags.py
2
53552
"""Default tags used by the template system, available to all templates.""" from __future__ import unicode_literals import os import sys import re from datetime import datetime from itertools import groupby, cycle as itertools_cycle import warnings from django.conf import settings from django.template.base import (No...
bsd-3-clause
GENIEMC/GENIE_2_9_0
data/validation/hA/fsiv.py
5
22493
#!/usr/bin/env python """ Author: Tomasz Golan For help run one from the following commands: './fsiv.py --help' or './fsiv.py -h' 'python fsiv.py --help' or 'python fsiv.py -h' """ import os, re, sys, getopt, time from subprocess import call #GLOBAL VARIABLES DAT_DIR = os.environ.get('FSIV_DAT_DIR') or 'd...
gpl-3.0
bottompawn/kbengine
kbe/src/lib/python/Lib/encodings/iso8859_9.py
272
13156
""" Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.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,errors='...
lgpl-3.0
xylsxyls/xueyelingshuang
src/BigNumberBase/scripts/rebuild_BigNumberBase.py
1
14102
#!python3 # -*- coding:utf-8 -*- import os import sys import time import ctypes import shutil import subprocess IsPy3 = sys.version_info[0] >= 3 if IsPy3: import winreg else: import codecs import _winreg as winreg BuildType = 'Release' IsRebuild = True Build = 'Rebuild' Update = False Copy = False CleanAl...
mit
ChanChiChoi/scikit-learn
sklearn/cluster/tests/test_affinity_propagation.py
341
2620
""" Testing for Clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.cluster.affinity_propagation_ import AffinityPropagation from sklearn.cluster.affinity_propagatio...
bsd-3-clause
hugs/django
django/contrib/gis/geos/prototypes/__init__.py
8
1585
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ # Coordinate sequence routines. from django.contrib.gis.geos.prototypes.coordseq import create_cs, get_cs, \ cs_clone, cs_getordinate, cs_setordinate, c...
bsd-3-clause
Toshakins/wagtail
wagtail/wagtailcore/tests/test_migrations.py
7
2212
""" Check that all changes to Wagtail models have had migrations created. If there are outstanding model changes that need migrations, fail the tests. """ from __future__ import absolute_import, unicode_literals from django.apps import apps from django.db.migrations.autodetector import MigrationAutodetector from djan...
bsd-3-clause
shubhdev/edx-platform
common/djangoapps/embargo/admin.py
154
1315
""" Django admin page for embargo models """ from django.contrib import admin import textwrap from config_models.admin import ConfigurationModelAdmin from embargo.models import IPFilter, CountryAccessRule, RestrictedCourse from embargo.forms import IPFilterForm, RestrictedCourseForm class IPFilterAdmin(Configuration...
agpl-3.0
precedenceguo/mxnet
tests/python/unittest/test_module.py
5
36954
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
bgxavier/neutron
neutron/plugins/brocade/db/models.py
63
4551
# Copyright 2013 Brocade Communications System, 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 # #...
apache-2.0
snasoft/QtCreatorPluginsPack
Bin/3rdParty/vera/bin/lib/test/test_isinstance.py
198
9806
# Tests some corner cases with isinstance() and issubclass(). While these # tests use new style classes and properties, they actually do whitebox # testing of error conditions uncovered when using extension types. import unittest from test import test_support import sys class TestIsInstanceExceptions(unittest.Tes...
lgpl-3.0
siliconsmiley/QGIS
python/plugins/processing/algs/lidar/lastools/lasthinPro.py
1
3972
# -*- coding: utf-8 -*- """ *************************************************************************** lasthinPro.py --------------------- Date : October 2014 Copyright : (C) 2014 by Martin Isenburg Email : martin near rapidlasso point com ****************...
gpl-2.0
alexryndin/ambari
ambari-server/src/test/python/stacks/2.4/AMBARI_INFRA/test_infra_solr.py
2
8157
#!/usr/bin/env python ''' 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")...
apache-2.0
vshtanko/scikit-learn
sklearn/metrics/setup.py
299
1024
import os import os.path import numpy from numpy.distutils.misc_util import Configuration from sklearn._build_utils import get_blas_info def configuration(parent_package="", top_path=None): config = Configuration("metrics", parent_package, top_path) cblas_libs, blas_info = get_blas_info() if os.name ==...
bsd-3-clause
kanagasabapathi/python-for-android
python3-alpha/python3-src/Tools/scripts/linktree.py
49
2443
#! /usr/bin/env python3 # linktree # # Make a copy of a directory tree with symbolic links to all files in the # original tree. # All symbolic links go to a special symbolic link at the top, so you # can easily fix things if the original source tree moves. # See also "mkreal". # # usage: mklinks oldtree newtree impor...
apache-2.0
amohanta/yalih
mechanize/_http.py
133
14354
"""HTTP related handlers. Note that some other HTTP handlers live in more specific modules: _auth.py, _gzip.py, etc. Copyright 2002-2006 John J Lee <jjl@pobox.com> This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included w...
apache-2.0
wenxichen/tensorflow_yolo2
src/slim_dir/nets/inception_utils.py
66
2630
# 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 applicable ...
mit
psawaya/Mental-Ginger
django/conf/locale/ka/formats.py
329
1888
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'l, j F, Y' TIME_FORMAT = 'h:i:s a' DATETIME_FORMAT = 'j F, Y h:i:s a' YEA...
bsd-3-clause
wzbozon/scikit-learn
sklearn/preprocessing/data.py
68
57385
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Eric Martin <eric@ericmart.in> # License: BSD 3 clause from itertools import chain, combina...
bsd-3-clause
griffincalme/LineweaverBurkKinematics
CompareTwoEnzymes.py
1
2335
#Griffin Calme #Python 3.5.0 import matplotlib.pyplot as plt import numpy as np from scipy import stats #Raw Data s = np.array([1., 3., 5., 10., 20., 50., 100.]) #substrate concentration (micromoles) vA = np.array([0.67, 1.20, 1.43, 1.67, 1.82, 1.92, 1.96]) #velocity of enzyme A at corresponding concentratio...
mit
redebian/documentation
django/contrib/comments/views/utils.py
192
1947
""" A few bits of helper functions for comment views. """ import urllib import textwrap from django.http import HttpResponseRedirect from django.core import urlresolvers from django.shortcuts import render_to_response from django.template import RequestContext from django.core.exceptions import ObjectDoesNotExist from...
bsd-3-clause
google-research/dice_rl
google/scripts/xm_run_tabular_teq_dice.py
1
2698
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
tuestudy/ipsc
2014/B/gsong-easy.py
1
2748
#/usr/bin/env python import unittest import sys class RandomGenerator: def __init__(self, arr): self.randoms = arr self.curr = 43 self.c = [0 for x in xrange(43)] def random(self): r = 43 s = 22 m = 2 ** 32 val = self.randoms[self.curr - s] - self.random...
mit
talhajaved/nyuadmarket
flask/lib/python2.7/site-packages/mako/pygen.py
15
9447
# mako/pygen.py # Copyright (C) 2006-2013 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """utilities for generating and formatting literal Python code.""" import re from mako import excep...
mit
ClusterLabs/pacemaker-1.0
cts/CTSscenarios.py
1
16516
from CTS import * from CTStests import CTSTest from CTSaudits import ClusterAudit class ScenarioComponent: def __init__(self, Env): self.Env = Env def IsApplicable(self): '''Return TRUE if the current ScenarioComponent is applicable in the given LabEnvironment given to the constructor....
gpl-2.0
roshannaik/storm
dev-tools/test-ns.py
23
1027
#!/usr/bin/env python # 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 # "Li...
apache-2.0
fbsder/openthread
tools/harness-automation/cases/sed_9_2_10.py
16
1871
#!/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
amiguez/youtube-dl
test/test_swfinterp.py
158
2224
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import errno import io import json import re import subprocess from youtube_dl.swfinterp import SWFInterpreter ...
unlicense
gauravbose/digital-menu
digimenu2/django/contrib/admindocs/urls.py
574
1183
from django.conf.urls import url from django.contrib.admindocs import views urlpatterns = [ url('^$', views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'), name='django-admindocs-docroot'), url('^bookmarklets/$', views.BookmarkletsView.as_view(), name='django-ad...
bsd-3-clause
jabesq/home-assistant
tests/components/time_date/test_sensor.py
8
4811
"""The tests for Kira sensor platform.""" import unittest from unittest.mock import patch import homeassistant.components.time_date.sensor as time_date import homeassistant.util.dt as dt_util from tests.common import get_test_home_assistant class TestTimeDateSensor(unittest.TestCase): """Tests the Kira Sensor p...
apache-2.0
Konubinix/uzbl
tests/event-manager/testcore.py
8
2874
#!/usr/bin/env python # vi: set et ts=4: import six import unittest from mock import Mock from uzbl.core import Uzbl class TestUzbl(unittest.TestCase): def setUp(self): options = Mock() options.print_events = False self.em = Mock() self.proto = Mock() self.uzbl = Uzbl(self...
gpl-3.0
danwangyiqie/danwangyiqie.github.io
crawler.py
1
2335
#!/usr/bin/env python # -*- coding: utf-8 -*- import os,sys import bs4 import datetime import urllib2 from bs4 import BeautifulSoup reload(sys) sys.setdefaultencoding('utf8') NEW_LAST_URL='' TAG_FILE='.last_url' def find_new_urls(opener): global TAG_FILE base_url=u'http://www.sexychinese.net/page/' las...
mit
DaniilLeksin/gc
wx/tools/Editra/src/syntax/_ooc.py
3
2634
############################################################################### # Name: ooc.py # # Purpose: Define OOC Syntax Highlighting Support and other features # # Author: Cody Precord <cprecord@editra.org> # ...
apache-2.0
samepage-labs/luigi
luigi/contrib/sge.py
11
11055
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
hackoder/django-masquerade
masquerade/tests.py
1
3250
from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.http import HttpRequest from django.test import TestCase, Client from mock import Mock from masquerade.middleware import MasqueradeMiddleware import masquerade.views class MasqueradeTes...
apache-2.0
iulian787/spack
lib/spack/external/_pytest/config.py
11
52505
""" command line options, ini-file and conftest.py processing. """ from __future__ import absolute_import, division, print_function import argparse import shlex import traceback import types import warnings import py # DON't import pytest here because it causes import cycle troubles import sys import os import _pytest...
lgpl-2.1
mattrobenolt/django
django/db/models/options.py
3
36340
from __future__ import unicode_literals import warnings from bisect import bisect from collections import OrderedDict, defaultdict from itertools import chain from django.apps import apps from django.conf import settings from django.core.exceptions import FieldDoesNotExist from django.db import connections from djang...
bsd-3-clause
andykimpe/chromium-test-npapi
tools/json_schema_compiler/preview.py
44
12765
#!/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. """Server for viewing the compiled C++ code from tools/json_schema_compiler. """ import cc_generator import code import cpp_type_g...
bsd-3-clause
NathanW2/QGIS
python/plugins/processing/algs/qgis/TinInterpolation.py
7
8273
# -*- coding: utf-8 -*- """ *************************************************************************** TinInterpolation.py --------------------- Date : October 2016 Copyright : (C) 2016 by Alexander Bruy Email : alexander dot bruy at gmail dot com ********...
gpl-2.0