repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
FreeOpcUa/opcua-modeler
release.py
4
1112
import re import os def bump_version(): with open("setup.py") as f: s = f.read() m = re.search(r'version="(.*)\.(.*)\.(.*)",', s) v1, v2, v3 = m.groups() oldv = "{}.{}.{}".format(v1, v2, v3) newv = "{}.{}.{}".format(v1, v2, str(int(v3) + 1)) print("Current version is: {}, write new ver...
gpl-3.0
chjw8016/GreenOdoo7-haibao
openerp/addons/base_vat/__openerp__.py
125
2928
# -*- 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...
mit
yxl/emscripten-calligra-mobile
3rdparty/google-breakpad/src/tools/gyp/test/generator-output/gyptest-relocate.py
74
1688
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that a project hierarchy created with the --generator-output= option can be built even when it's relocated to a different path....
gpl-2.0
touilleMan/mongoengine
tests/test_context_managers.py
31
6351
import sys sys.path[0:0] = [""] import unittest from mongoengine import * from mongoengine.connection import get_db from mongoengine.context_managers import (switch_db, switch_collection, no_sub_classes, no_dereference, query_counter) ...
mit
zenodo/invenio
invenio/legacy/websubmit/functions/Create_Upload_Files_Interface.py
13
23083
# $Id: Revise_Files.py,v 1.37 2009/03/26 15:11:05 jerome Exp $ # This file is part of Invenio. # Copyright (C) 2009, 2010, 2011, 2014 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 v...
gpl-2.0
nicferrier/pyproxyfs
src/pyproxyfs/__init__.py
1
6159
# pyproxyfs - a very lightweight proxy filesystem class # Copyright (C) 2010 Nic Ferrier <nic@ferrier.me.uk> # 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...
gpl-3.0
trosa/forca
fcgihandler.py
2
1504
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) This is a handler for lighttpd+fastcgi This file has to be in the PYTHONPATH Put something like this in the...
gpl-2.0
maartenq/ansible
test/units/modules/network/nso/test_nso_show.py
12
4300
# # Copyright (c) 2017 Cisco and/or its affiliates. # # 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...
gpl-3.0
bob60/DHT-sensors-python3
examples/AdafruitDHT.py
1
2171
#!/usr/bin/python3 # Copyright (c) 2014 Adafruit Industries # Author: Tony DiCola # 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...
mit
blaquee/crits
crits/core/class_mapper.py
8
9178
from bson.objectid import ObjectId __obj_type_to_key_descriptor__ = { 'Actor': 'name', 'Backdoor': 'id', 'Campaign': 'name', 'Certificate': 'md5', 'Comment': 'object_id', 'Domain': 'domain', 'Email': 'id', 'Event': 'id', 'Exploit': 'id', 'Indicator': 'id', 'IP': 'ip', '...
mit
davidcusatis/horizon
openstack_dashboard/test/api_tests/cinder_tests.py
4
17320
# Copyright 2012 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 agre...
apache-2.0
tempbottle/kbengine
kbe/res/scripts/common/Lib/multiprocessing/context.py
98
10669
import os import sys import threading from . import process __all__ = [] # things are copied from here to __init__.py # # Exceptions # class ProcessError(Exception): pass class BufferTooShort(ProcessError): pass class TimeoutError(ProcessError): pass class AuthenticationError(ProcessError)...
lgpl-3.0
liikGit/MissionPlanner
Lib/site-packages/numpy/NumpyDotNet/benchmark.py
54
7011
import sys import time from numpy import * UsingIronPython = False if sys.subversion[0] == 'IronPython': import System UsingIronPython = True #import numbers #from random import random class Complex(object): def __init__(self, r, i): self.__r = r self.__i = i def __eq__(self, oth...
gpl-3.0
aliguori/qemu-next
scripts/tracetool/backend/dtrace.py
71
2135
#!/usr/bin/env python # -*- coding: utf-8 -*- """ DTrace/SystemTAP backend. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __e...
gpl-2.0
Bysmyyr/blink-crosswalk
LayoutTests/http/tests/fetch/PRESUBMIT.py
39
1307
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Chromium presubmit script for fetch API layout tests. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts. ''' import os import ...
bsd-3-clause
akhmadMizkat/odoo
addons/utm/models/utm.py
2
3323
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models from odoo.http import request class UtmMedium(models.Model): # OLD crm.case.channel _name = 'utm.medium' _description = 'Channels' _order = 'name' name = fields...
gpl-3.0
vicnet/weboob
modules/avendrealouer/browser.py
2
3460
# -*- coding: utf-8 -*- # Copyright(C) 2017 ZeHiro # # This file is part of a weboob module. # # This weboob module is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License,...
lgpl-3.0
as110/as110.github.io
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/dalvik.py
364
3442
# -*- coding: utf-8 -*- """ pygments.lexers.dalvik ~~~~~~~~~~~~~~~~~~~~~~ Pygments lexers for Dalvik VM-related languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups from p...
mit
dimkarakostas/rupture
backend/breach/backtracking_analyzer.py
2
5758
import operator import collections import logging logger = logging.getLogger(__name__) def get_accumulated_probabilities(sorted_candidate_lengths, current_round_acc_probability, compression_function_factor, amplification_factor): '''Take a dictionary of sorted candidate alphabets and calculate the relative ...
mit
cuilishen/cuilishenMissionPlanner
Lib/site-packages/scipy/cluster/tests/test_vq.py
51
6554
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" # David Cournapeau # Last Change: Wed Nov 05 07:00 PM 2008 J import os.path import warnings import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal, \ TestCase, run_module_s...
gpl-3.0
maxive/erp
setup/odoo-wsgi.example.py
36
1723
# WSGI Handler sample configuration file. # # Change the appropriate settings below, in order to provide the parameters # that would normally be passed in the command-line. # (at least conf['addons_path']) # # For generic wsgi handlers a global application is defined. # For uwsgi this should work: # $ uwsgi_python --...
agpl-3.0
pmajka/3dbar
bin/parsers/paxinos_watson_rbisc/svgfix.py
2
19761
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # # # This file is part of 3d Brain Atlas Reconstructor # # ...
gpl-3.0
ehomeshasha/easydata
easydata/constant.py
1
1220
from django.utils.translation import ugettext_lazy as _ CONTENT_TYPE = { 'pdf': 'application/pdf', 'image': ['image/png','image/jpeg','image/pjpeg','image/gif','image/bmp'], 'file': ['application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multi...
mit
nlholdem/icodoom
.venv/lib/python2.7/site-packages/pbr/cmd/main.py
34
3422
# Copyright 2014 Hewlett-Packard Development Company, L.P. # 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...
gpl-3.0
google/llvm-propeller
lldb/test/API/functionalities/gdb_remote_client/TestRegDefinitionInParts.py
8
7315
from __future__ import print_function import lldb import time from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * from gdbclientutils import * class TestRegDefinitionInParts(GDBRemoteTestBase): @skipIfXmlSupportMissing @skipIfRemote def test(self): """ Test that l...
apache-2.0
zephyrplugins/zephyr
zephyr.plugin.jython/jython2.5.2rc3/Lib/dummy_threading.py
102
2900
"""Faux ``threading`` version using ``dummy_thread`` instead of ``thread``. The module ``_dummy_threading`` is added to ``sys.modules`` in order to not have ``threading`` considered imported. Had ``threading`` been directly imported it would have made all subsequent imports succeed regardless of whether ``thread`` wa...
epl-1.0
RonnyPfannschmidt/pytest
testing/test_pastebin.py
3
6207
import io from typing import List from typing import Union import pytest from _pytest.monkeypatch import MonkeyPatch from _pytest.pytester import Pytester class TestPasteCapture: @pytest.fixture def pastebinlist(self, monkeypatch, request) -> List[Union[str, bytes]]: pastebinlist: List[Union[str, byt...
mit
dcroc16/skunk_works
google_appengine/google/appengine/tools/download_appstats.py
1
6069
#!/usr/bin/env python # # Copyright 2007 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 o...
mit
dbader/envconfig
test_envconfig.py
1
2265
# coding=utf8 """Unit tests for the config module.""" # Silence "missing docstring", "method could be a function", and # "too many public methods" messages: # pylint: disable-msg=R0201,C0111,R0904 import unittest import os import envconfig class TestConfig(unittest.TestCase): def assert_get_set_bool(self, valu...
mit
EduPepperPDTesting/pepper2013-testing
lms/djangoapps/certificates/migrations/0009_auto__del_field_generatedcertificate_graded_download_url__del_field_ge.py
188
6118
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'GeneratedCertificate.graded_download_url' db.delete_column('certificates_generatedcertific...
agpl-3.0
severinson/Coded-Shuffling
tests/simulationtests.py
2
4673
############################################################################ # Copyright 2016 Albin Severinson # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may no...
apache-2.0
pgonda/servo
python/mach/mach/logging.py
125
8070
# 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/. # This file contains logging functionality for mach. It essentially provides # support for a structured logging framewor...
mpl-2.0
mikeckennedy/python-for-entrepreneurs-course-demos
12_user_accounts/final_12_blue_yellow_app/blue_yellow_app/controllers/home_controller.py
10
1152
import pyramid_handlers from blue_yellow_app.controllers.base_controller import BaseController from blue_yellow_app.infrastructure.supressor import suppress class HomeController(BaseController): alternate_mode = False @pyramid_handlers.action(renderer='templates/home/index.pt') def index(self): r...
mit
abhikumar22/MYBLOG
blg/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.py
2763
12536
######################## 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-3.0
wdwvt1/qiime
qiime/align_seqs.py
15
11369
#!/usr/bin/env python __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = [ "Rob Knight", "Greg Caporaso", "Jeremy Widmann", "Kyle Bittinger"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = "gregcaporaso@gmail.com" ...
gpl-2.0
alephu5/Soundbyte
statistics/linear_complexity.py
1
2280
#! ../environment/bin/python3.3 #This test calculates the length of the smallest linear-feedback #register to estimate complextiy, and decides whether #the sequence is likely to be random. This is based on the idea #that a random sequence is unlikely to have a short linear-feeback #register. from scipy.stats import...
gpl-3.0
petrutlucian94/nova_dev
nova/wsgi.py
2
17814
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
anrl/gini
backend/src/gloader/xml/xpath/ParsedStep.py
10
3414
######################################################################## # # File Name: ParsedStep.py # # """ A Parsed token that represents a step on the result tree. WWW: http://4suite.org/XPATH e-mail: support@4suite.org Copyright (c) 2000-2001 Fourthought Inc, USA. All Rights Reserved. See http://4suit...
mit
coderjames/pascal
quex-0.63.1/quex/engine/generator/skipper/range.py
1
16427
import quex.engine.state_machine.index as sm_index from quex.engine.generator.skipper.common import line_counter_in_loop, \ end_delimiter_is_subset_of_indentation_counter_newline, \ ...
bsd-2-clause
maestrano/openerp
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tiny_socket.py
386
3270
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
beck/django
tests/model_forms/tests.py
85
109361
from __future__ import unicode_literals import datetime import os from decimal import Decimal from unittest import skipUnless from django import forms from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ) from django.core.files.uploadedfile import SimpleUploadedFile from djang...
bsd-3-clause
paulocoding/DataScienceMachineLearning
DataMunging/DataProcessing.py
2
1705
import pandas as pd def sum_of_digits(str_value): """ Sum up all the digits in a number till it is single digit Eg: 1 => 1 11 => 2 123 => 6 1235 => 2 98 => 8 """ total = 0 for num in str_value: total += int(num) if total > 9: retur...
mit
betoesquivel/fil2014
filenv/lib/python2.7/site-packages/django/contrib/staticfiles/finders.py
90
9285
import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import default_storage, Storage, FileSystemStorage from django.utils.datastructures import SortedDict from django.utils.functional import empty, memoize, LazyObject from django.utils.module_...
mit
krbaker/Diamond
src/collectors/http/http.py
7
3323
# coding=utf-8 """ Collect statistics from a HTTP or HTTPS connexion #### Dependencies * urllib2 #### Usage Add the collector config as : enabled = True ttl_multiplier = 2 path_suffix = "" measure_collector_time = False byte_unit = byte, req_vhost = www.my_server.com req_url = https://www.my_server.com/, https://...
mit
crimsonthunder/kernel_samsung_trlte_5.1.1
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
TEAM-Gummy/platform_external_chromium_org
tools/telemetry/telemetry/core/timeline/process.py
23
2296
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import telemetry.core.timeline.event_container as event_container import telemetry.core.timeline.counter as tracing_counter import telemetry.core.timeline.th...
bsd-3-clause
rekbun/browserscope
gaeunit_test.py
9
1328
#!/usr/bin/python2.5 # # Copyright 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 ...
apache-2.0
lambday/shogun
examples/undocumented/python/kernel_weighted_degree_position_string.py
10
1114
#!/usr/bin/env python from tools.load import LoadMatrix lm=LoadMatrix() traindat = lm.load_dna('../data/fm_train_dna.dat') testdat = lm.load_dna('../data/fm_test_dna.dat') parameter_list = [[traindat,testdat,20],[traindat,testdat,22]] def kernel_weighted_degree_position_string (fm_train_dna=traindat,fm_test_dna=testd...
bsd-3-clause
OptiPop/external_chromium_org
third_party/cython/src/Cython/Compiler/CythonScope.py
99
5817
from Symtab import ModuleScope from PyrexTypes import * from UtilityCode import CythonUtilityCode from Errors import error from Scanning import StringSourceDescriptor import MemoryView class CythonScope(ModuleScope): is_cython_builtin = 1 _cythonscope_initialized = False def __init__(self, context): ...
bsd-3-clause
mikeconley/emscripten-scummvm
devtools/tasmrecover/tasm/parser.py
56
7994
# ScummVM - Graphic Adventure Engine # # ScummVM is the legal property of its developers, whose names # are too numerous to list here. Please refer to the COPYRIGHT # file distributed with this source distribution. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU ...
gpl-2.0
Antiun/purchase-workflow
purchase_requisition_bid_selection/wizard/purchase_requisition_partner.py
27
1568
# -*- coding: utf-8 -*- # # # Copyright 2013, 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) an...
agpl-3.0
haveal/googleads-python-lib
examples/dfa/authentication/generate_refresh_token.py
4
2018
#!/usr/bin/python # # 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 b...
apache-2.0
DefyVentures/edx-platform
lms/djangoapps/mobile_api/video_outlines/serializers.py
16
8501
""" Serializer for video outline """ from rest_framework.reverse import reverse from xmodule.modulestore.mongo.base import BLOCK_TYPES_WITH_CHILDREN from courseware.access import has_access from courseware.model_data import FieldDataCache from courseware.module_render import get_module_for_descriptor from util.module_...
agpl-3.0
shashank971/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_import.py
125
4194
""" Unittests for importing a course via management command """ import os from path import Path as path import shutil import tempfile from django.core.management import call_command from django_comment_common.utils import are_permissions_roles_seeded from xmodule.modulestore.django import modulestore from xmodule.mo...
agpl-3.0
angelblue05/Embytest.Kodi
resources/lib/mutagen/asf/_objects.py
6
14054
# -*- coding: utf-8 -*- # Copyright (C) 2005-2006 Joe Wreschnig # Copyright (C) 2006-2007 Lukas Lalinsky # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. import struct from mutage...
gpl-2.0
iulian787/spack
var/spack/repos/builtin/packages/nrm/package.py
5
1074
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Nrm(PythonPackage): """Node Resource Manager""" homepage = "https://xgitlab.cels.anl....
lgpl-2.1
ric2b/Vivaldi-browser
chromium/mojo/public/tools/bindings/pylib/mojom_tests/support/run_bindings_generator.py
2
1544
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os.path from subprocess import check_call import sys def RunBindingsGenerator(out_dir, root_dir, mojom_file, extra_flags=None): out_dir = os.path....
bsd-3-clause
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/urbansim/configurations/residential_land_share_model_configuration_creator.py
2
8336
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.configuration import Configuration class ResidentialLandShareModelConfigurationCreator(object): _model_name = 'residential_land_share_model' def __init__(self...
gpl-2.0
GheRivero/ansible
test/runner/lib/metadata.py
76
4798
"""Test metadata for passing data to delegated tests.""" from __future__ import absolute_import, print_function import json from lib.util import ( display, is_shippable, ) from lib.diff import ( parse_diff, FileDiff, ) class Metadata(object): """Metadata object for passing data to delegated tes...
gpl-3.0
kholidfu/django
django/http/multipartparser.py
332
24331
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ from __future__ import unicode_literals import base64 import binascii import cgi import sys from django.conf import settings from django.core.exceptions imp...
bsd-3-clause
inouire/climage
climage/ls-climage.py
1
3824
# Copyright 2010-2012 Edouard Garnier de Labareyre # # This file is part of climage. # # Climage 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...
lgpl-3.0
phantaminos/uch-ultrasonic-anemometer
software/data_recorder.py
3
1288
# # Copyright (C) 2013 UNIVERSIDAD DE CHILE. # # 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 dist...
gpl-3.0
KamranMackey/CloudBot
plugins/wolframalpha.py
3
1863
import re import urllib.parse import requests from lxml import etree from cloudbot import hook from cloudbot.util import web, formatting # security parser = etree.XMLParser(resolve_entities=False, no_network=True) api_url = 'http://api.wolframalpha.com/v2/query' query_url = 'http://www.wolframalpha.com/input/?i={}'...
gpl-3.0
mavarick/pyes
tests/test_multifield.py
5
3889
# -*- coding: utf-8 -*- from __future__ import absolute_import import unittest from pyes.tests import ESTestCase from pyes.query import TermQuery class MultifieldTestCase(ESTestCase): def setUp(self): super(MultifieldTestCase, self).setUp() mapping = {u'parsedtext': {'boost': 1.0, ...
bsd-3-clause
idlesign/django-sitetree
sitetree/tests/conftest.py
1
4305
import pytest from pytest_djangoapp import configure_djangoapp_plugin def hook(settings): apps = settings['INSTALLED_APPS'] apps.remove('sitetree.tests.testapp') apps.append('sitetree.tests.testapp.conf.MyAppConfig') return settings pytest_plugins = configure_djangoapp_plugin( settings=dict( ...
bsd-3-clause
FundersClub/fire
src/firebot/settings/prod.py
1
2942
import dj_database_url import os from firebot.settings.base import * # noqa ############################################################################### # Django ############################################################################### ADMIN_URL = os.environ.get('DJANGO_ADMIN_URL') ALLOWED_HOSTS = os.envi...
apache-2.0
hpcuantwerpen/easybuild-framework
test/framework/sandbox/easybuild/easyblocks/generic/toolchain.py
2
1427
## # Copyright 2009-2021 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
jamison904/kernel_jflte_tw
build-all.py
17
9439
#! /usr/bin/env python # Copyright (c) 2009-2011, The Linux Foundation. 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 # ...
gpl-2.0
yahman72/robotframework
src/robot/reporting/resultwriter.py
4
5657
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
mexeniz/django-oscar
src/oscar/apps/catalogue/admin.py
14
3027
from django.contrib import admin from treebeard.admin import TreeAdmin from oscar.core.loading import get_model AttributeOption = get_model('catalogue', 'AttributeOption') AttributeOptionGroup = get_model('catalogue', 'AttributeOptionGroup') Category = get_model('catalogue', 'Category') Option = get_model('catalogue'...
bsd-3-clause
thegricean/sinking-marbles
models/complex_prior/smoothed_unbinned15/scripts/parseUnreliableSpeakerResults.py
2
2762
import csv import itertools import random import ast import sys #usage # python parseResults.py results.txt fname = '../results/'+sys.argv[1] file_names = [fname] itemfile = open("items.txt") items = [" ".join(l.rstrip().split()) for l in itemfile.readlines()] itemfile.close() #print items lines = [] results = []...
mit
65apps/omim
3party/freetype/src/tools/docmaker/utils.py
153
3513
# # utils.py # # Auxiliary functions for the `docmaker' tool (library file). # # Copyright 2002-2015 by # David Turner. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.TXT. By continuing to use, modify,...
apache-2.0
InfiniteAlpha/profitpy
profit/workbench/portfoliodisplay.py
18
1350
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2007 Troy Melhase <troy@gci.net> # Distributed under the terms of the GNU General Public License v2 from PyQt4.QtGui import QFrame from profit.lib import BasicHandler, Signals from profit.lib.gui import symbolIcon from profit.workbench.widgets.ui_portfoliodis...
gpl-2.0
thorrak/fermentrack
gravity/signals.py
1
2221
from django.dispatch import receiver from django.db.models.signals import post_save, pre_delete from .models import GravitySensor, TiltConfiguration, TiltGravityCalibrationPoint, TiltTempCalibrationPoint # The main purpose of these signals at the moment is to trigger reloading of the TiltConfiguration object within t...
mit
sgt7kor/android_kernel_samsung_m180
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
linearregression/subuser
logic/subuserlib/executablePath.py
3
1841
#!/usr/bin/env python # This file should be compatible with both Python 2 and 3. # If it is not, please file a bug report. """ This module provides the usefull function C{which} which allows us to find the full path of a given executable and determine if an executable is present on the given system. """ #external imp...
lgpl-3.0
zhaodelong/django
django/contrib/gis/db/backends/mysql/introspection.py
700
1771
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. ...
bsd-3-clause
onethirtyfive/skadi
skadi/protoc/networkbasetypes_pb2.py
2
19683
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: networkbasetypes.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.prot...
mit
empeeu/numpy
numpy/core/numerictypes.py
18
29192
""" numerictypes: Define the numeric type objects This module is designed so "from numerictypes import \\*" is safe. Exported symbols include: Dictionary with all registered number types (including aliases): typeDict Type objects (not all will be available, depends on platform): see variable sctypes fo...
bsd-3-clause
cortedeltimo/SickRage
lib/future/utils/__init__.py
36
20238
""" A selection of cross-compatible functions for Python 2 and 3. This module exports useful functions for 2/3 compatible code: * bind_method: binds functions to classes * ``native_str_to_bytes`` and ``bytes_to_native_str`` * ``native_str``: always equal to the native platform string object (because ...
gpl-3.0
jonathonwalz/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint_facts.py
23
6518
#!/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
jessesnyder/beatbox
src/beatbox/tests/test_benchmark.py
6
3661
from types import DictType, StringTypes, IntType, ListType, TupleType import gc import unittest import datetime from time import time import sfconfig import beatbox from beatbox import SoapFaultError BENCHMARK_REPS = 1 def benchmark(func): def benchmarked_func(self): # temporarily disable garbage collect...
gpl-2.0
agiliq/nginx-python-buildpack
vendor/pip-1.5.4/pip/_vendor/requests/packages/charade/sjisprober.py
1182
3734
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
yunxliu/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_child-src_cross-origin_blocked-manual.py
25
2612
def main(request, response): response.headers.set( "Content-Security-Policy", "child-src http://www.w3c.com") response.headers.set( "X-Content-Security-Policy", "child-src http://www.w3c.com") response.headers.set("X-WebKit-CSP", "child-src http://www.w3c.com") return """...
bsd-3-clause
musically-ut/statsmodels
statsmodels/examples/tsa/ex_arma_all.py
34
1982
from __future__ import print_function import numpy as np from numpy.testing import assert_almost_equal import matplotlib.pyplot as plt import statsmodels.sandbox.tsa.fftarma as fa from statsmodels.tsa.descriptivestats import TsaDescriptive from statsmodels.tsa.arma_mle import Arma x = fa.ArmaFft([1, -0.5], [1., 0.4]...
bsd-3-clause
TheTacoScott/GoAtThrottleUp
ServerRelay/cherrypy/test/modpy.py
12
5027
"""Wrapper for mod_python, for use as a CherryPy HTTP server when testing. To autostart modpython, the "apache" executable or script must be on your system path, or you must override the global APACHE_PATH. On some platforms, "apache" may be called "apachectl" or "apache2ctl"-- create a symlink to them if needed. If ...
mit
Nexenta/s3-tests
virtualenv/lib/python2.7/site-packages/boto/ec2/image.py
92
16222
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # 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 # w...
mit
grlee77/numpy
benchmarks/benchmarks/common.py
2
2573
import numpy import random # Various pre-crafted datasets/variables for testing # !!! Must not be changed -- only appended !!! # while testing numpy we better not rely on numpy to produce random # sequences random.seed(1) # but will seed it nevertheless numpy.random.seed(1) nx, ny = 1000, 1000 # reduced squares based...
bsd-3-clause
antoan2/incubator-mxnet
tests/python/unittest/test_model_parallel.py
50
2560
# 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
igio/webfaction-meteor
deploy.py
1
4300
#!/usr/bin/env python3 import os import subprocess import paramiko import argparse import json # Manage the command line arguments parser = argparse.ArgumentParser() parser.add_argument('-u', '--update', action='store_true', help='Update the application') parser.add_argument('-b', '--build', action='store_true', hel...
mit
noodle-learns-programming/wagtail
wagtail/wagtailsearch/tests/test_frontend.py
27
5312
from django.test import TestCase from django.core.urlresolvers import reverse from django.core import paginator from wagtail.wagtailcore.models import Page from wagtail.wagtailsearch.models import Query from wagtail.tests.testapp.models import EventPage class TestSearchView(TestCase): fixtures = ['test.json'] ...
bsd-3-clause
rooi/CouchPotatoServer
libs/suds/umx/__init__.py
203
1811
# 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 ...
gpl-3.0
talbrecht/pism_pik
test/vnreport.py
1
8967
#!/usr/bin/env python from pylab import close, figure, clf, hold, plot, xlabel, ylabel, xticks, yticks, axis, legend, title, grid, show, savefig from numpy import array, polyfit, polyval, log10, floor, ceil, unique import sys try: from netCDF4 import Dataset as NC except: print "netCDF4 is not installed!" ...
gpl-3.0
ppapadeas/wprevents
vendor-local/lib/python/unidecode/x0ca.py
253
5007
data = ( 'jjael', # 0x00 'jjaelg', # 0x01 'jjaelm', # 0x02 'jjaelb', # 0x03 'jjaels', # 0x04 'jjaelt', # 0x05 'jjaelp', # 0x06 'jjaelh', # 0x07 'jjaem', # 0x08 'jjaeb', # 0x09 'jjaebs', # 0x0a 'jjaes', # 0x0b 'jjaess', # 0x0c 'jjaeng', # 0x0d 'jjaej', # 0x0e 'jjaec', # 0x...
bsd-3-clause
ellipsis14/dolfin
demo/undocumented/parallel-refinement/python/demo_parallel-refinement.py
5
1661
# Copyright (C) 2013 Chris N. Richardson # # This file is part of DOLFIN. # # DOLFIN 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 later vers...
gpl-3.0
team-vigir/vigir_behaviors
behaviors/vigir_behavior_walk_and_grasp_demo/src/vigir_behavior_walk_and_grasp_demo/walk_and_grasp_demo_sm.py
1
13360
#!/usr/bin/env python ########################################################### # WARNING: Generated code! # # ************************** # # Manual changes may get lost if file is generated again. # # Only code inside the [MANUAL] tags will be kept. ...
bsd-3-clause
dkubiak789/odoo
addons/stock_landed_costs/__openerp__.py
220
1914
# -*- 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
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/skimage/measure/tests/test_structural_similarity.py
3
6671
import os import numpy as np from skimage import data, data_dir from skimage.measure import compare_ssim as ssim from skimage._shared import testing from skimage._shared._warnings import expected_warnings from skimage._shared.testing import (assert_equal, assert_almost_equal, asse...
gpl-3.0
kate-v-stepanova/scilifelab
scilifelab/report/delivery_notes.py
4
36997
"""Module delivery_notes - code for generating delivery reports and notes""" import os import re import itertools import ast import json import math import csv import yaml import texttable import unicodedata from cStringIO import StringIO from collections import Counter from scilifelab.db.statusdb import SampleRunMetri...
mit
Andrey-Tkachev/Creto
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
mit