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
loretoparisi/nupic
tests/unit/nupic/algorithms/knn_classifier_test.py
22
4983
#! /usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
agpl-3.0
kevinsung/OpenFermion
src/openfermion/ops/_quadratic_hamiltonian_test.py
2
19329
# 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 # distribu...
apache-2.0
loli/sklearn-ensembletrees
sklearn/datasets/covtype.py
3
3352
"""Forest covertype dataset. A classic dataset for classification benchmarks, featuring categorical and real-valued features. """ # Author: Lars Buitinck <L.J.Buitinck@uva.nl> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # License: BSD 3 clause import sys import errno from gzip import GzipFile from io...
bsd-3-clause
ridfrustum/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/utils/dateformat.py
51
5778
from datetime import datetime, date import os import time from django.utils.dateformat import format from django.utils import dateformat, translation, unittest from django.utils.tzinfo import FixedOffset, LocalTimezone class DateFormatTests(unittest.TestCase): def setUp(self): self.old_TZ = os.environ.ge...
gpl-3.0
tomchristie/django-rest-framework
tests/test_negotiation.py
5
3678
import pytest from django.http import Http404 from django.test import TestCase from rest_framework.negotiation import ( BaseContentNegotiation, DefaultContentNegotiation ) from rest_framework.renderers import BaseRenderer from rest_framework.request import Request from rest_framework.test import APIRequestFactory ...
bsd-2-clause
lesserwhirls/scipy-cwt
scipy/optimize/nonlin.py
2
45860
r""" Nonlinear solvers ================= .. currentmodule:: scipy.optimize This is a collection of general-purpose nonlinear multidimensional solvers. These solvers find *x* for which *F(x) = 0*. Both *x* and *F* can be multidimensional. Routines -------- Large-scale nonlinear solvers: .. autosummary:: newton...
bsd-3-clause
aliyun/oss-ftp
python27/win32/Lib/idlelib/keybindingDialog.py
35
12408
""" Dialog for building Tkinter accelerator key bindings """ from Tkinter import * import tkMessageBox import string import sys class GetKeysDialog(Toplevel): def __init__(self,parent,title,action,currentKeySequences,_htest=False): """ action - string, the name of the virtual event these keys will ...
mit
amitaekbote/dcos
dcos_installer/upgrade.py
4
5473
""" Generating node upgrade script """ import uuid import gen.build_deploy.util as util import gen.calc import gen.template from dcos_installer.constants import SERVE_DIR from pkgpanda.util import make_directory, write_string node_upgrade_template = """#!/bin/bash # # BASH script to upgrade DC/OS on a node # # Meta...
apache-2.0
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/windows/win_owner.py
16
1048
#!/usr/bin/python # Copyright 2015, Hans-Joachim Kliemeck <git@kliemeck.de> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'core'} DOCUMENTATION ...
bsd-3-clause
trivoldus28/pulsarch-verilog
tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/test/test_profile.py
19
2170
"""Test suite for the profile module.""" import profile # In order to have reproducible time, we simulate a timer in the global # variable 'ticks', which represents simulated time in milliseconds. # (We can't use a helper function increment the timer since it would be # included in the profile and would appear to con...
gpl-2.0
kaarolch/ansible
lib/ansible/modules/files/fetch.py
50
3704
# this is a virtual module that is entirely implemented server side # 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 op...
gpl-3.0
gameunits/gameunits
share/qt/extract_strings_qt.py
1294
1784
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
mit
shaunstanislaus/flexx
make/__main__.py
21
1176
# License: consider this public domain from __future__ import absolute_import, division, print_function import sys import os import os.path as op THIS_DIR = op.dirname(op.abspath(__file__)) ROOT_DIR = op.dirname(THIS_DIR) # Setup paths os.chdir(ROOT_DIR) sys.path.insert(0, ROOT_DIR) if 'make' in sys.path: sys....
bsd-2-clause
shizhai/wprobe
staging_dir/host/lib/scons-2.1.0/SCons/Tool/fortran.py
21
2056
"""SCons.Tool.fortran Tool-specific initialization for a generic Posix f77/f90 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 20...
gpl-2.0
s-hertel/ansible
lib/ansible/playbook/helpers.py
7
19790
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
drglove/SickRage
lib/subliminal/tasks.py
170
2328
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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...
gpl-3.0
schambers/civmarket
civmarket/lib/python2.7/site-packages/setuptools/tests/test_sandbox.py
342
2170
"""develop tests """ import sys import os import shutil import unittest import tempfile import types import pkg_resources import setuptools.sandbox from setuptools.sandbox import DirectorySandbox, SandboxViolation def has_win32com(): """ Run this to determine if the local machine has win32com, and if it d...
apache-2.0
shubhdev/edx-platform
common/djangoapps/geoinfo/tests/test_middleware.py
137
5217
""" Tests for CountryMiddleware. """ from mock import patch import pygeoip from django.contrib.sessions.middleware import SessionMiddleware from django.test import TestCase from django.test.client import RequestFactory from geoinfo.middleware import CountryMiddleware from student.tests.factories import UserFactory, A...
agpl-3.0
vlegoff/tsunami
src/primaires/scripting/actions/attaquer.py
1
2733
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # ...
bsd-3-clause
konstruktoid/ansible-upstream
lib/ansible/modules/storage/netapp/netapp_e_storage_system.py
29
10956
#!/usr/bin/python # (c) 2016, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
anderson7ru/bienestarues
empleadosapp/views.py
1
6154
from django.shortcuts import render from django.shortcuts import redirect from django.utils import timezone from django.contrib import messages from django.db import connection from django.contrib.auth.decorators import login_required from empleadosapp.models import Empleado, Especialidad, Doctor from empleadosapp.for...
mit
wndias/bc.repository
plugin.video.gdrive/resources/lib/cloudservice.py
3
46765
''' Copyright (C) 2013-2015 ddurdle 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 di...
gpl-2.0
frankyrumple/ope
admin_app/gluon/debug.py
22
5538
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu>, | limodou <limodou@gmail.com> and srackham <srackham@gmail.com>. | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Debugger support classes ------------...
mit
tango-controls/pytango
tango/tango_numpy.py
4
5606
# ------------------------------------------------------------------------------ # This file is part of PyTango (http://pytango.rtfd.io) # # Copyright 2006-2012 CELLS / ALBA Synchrotron, Bellaterra, Spain # Copyright 2013-2014 European Synchrotron Radiation Facility, Grenoble, France # # Distributed under the terms of ...
lgpl-3.0
servo/servo
tests/wpt/web-platform-tests/webdriver/tests/navigate_to/navigate.py
5
2352
import time import pytest from tests.support import platform_name from webdriver.transport import Response from tests.support.asserts import assert_error, assert_success def navigate_to(session, url): return session.transport.send( "POST", "session/{session_id}/url".format(**vars(session)), {"u...
mpl-2.0
spotify/cobbler
cobbler/cexceptions.py
3
1234
""" Custom exceptions for Cobbler Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> 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 Licens...
gpl-2.0
cliffyg/heron
third_party/pex/pex/compatibility.py
14
2609
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). # This file contains several 2.x/3.x compatibility checkstyle violations for a reason # checkstyle: noqa import os from abc import ABCMeta from numbers import Integral, Real from sys impo...
apache-2.0
Work4Labs/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/formtools/utils.py
64
1261
try: import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.utils.hashcompat import md5_constructor from django.forms import BooleanField def security_hash(request, form, *args): """ Calculates a security hash for the given Form instance. This crea...
gpl-3.0
marinkaz/orange3
Orange/misc/environ.py
11
2354
""" Retrive basic library/application data/cache locations. The basic FS layout for Orange data files is $DATA_HOME/Orange/$VERSION/ widgets/ canvas/ where DATA_HOME is a platform dependent application directory (:ref:`data_dir_base`) and VERSION is Orange.__version__ string. ``canvas`` subdirectory is rese...
bsd-2-clause
loveyoupeng/rt
modules/web/src/main/native/Tools/Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py
143
2113
# Copyright (C) 2010 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 and th...
gpl-2.0
cryptapus/electrum
electrum/gui/qt/main_window.py
1
136511
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
mit
babyliynfg/cross
tools/project-creator/Python2.6.6/Lib/idlelib/AutoComplete.py
6
9290
"""AutoComplete.py - An IDLE extension for automatically completing names. This extension can complete either attribute names of file names. It can pop a window with all available names, for the user to select from. """ import os import sys import string from idlelib.configHandler import idleConf # This s...
mit
tmerrick1/spack
lib/spack/spack/hooks/yaml_version_check.py
4
2432
############################################################################## # 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
Hitechverma/zamboni
mkt/files/utils.py
1
9752
import hashlib import json import logging import os import re import shutil import stat import tempfile import zipfile from django import forms from django.conf import settings from django.core.files.storage import default_storage as storage from django.utils.translation import trans_real as translation from tower im...
bsd-3-clause
quru/wagtail
wagtail/api/v2/tests/test_images.py
2
14475
from __future__ import absolute_import, unicode_literals import json import mock from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from wagtail.api.v2 import signal_handlers from wagtail.wagtailimages.models import get_image_model class Te...
bsd-3-clause
GoogleCloudPlatform/python-compat-runtime
appengine-compat/exported_appengine_sdk/google/appengine/api/search/stub/document_matcher.py
2
18623
#!/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...
apache-2.0
gjvis/splinter
tests/popups.py
7
3349
# -*- coding: utf-8 -*- # Copyright 2015 splinter authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. class PopupWindowsTest(object): def test_lists_all_windows_as_window_instances(self): self.browser.find_by_id("open-popup"...
bsd-3-clause
Changaco/oh-mainline
vendor/packages/kombu/kombu/transport/pyamqp.py
16
4722
""" kombu.transport.pyamqp ====================== pure python amqp transport. """ from __future__ import absolute_import import amqp from kombu.five import items from kombu.utils.amq_manager import get_manager from kombu.utils.text import version_string_as_tuple from . import base DEFAULT_PORT = 5672 class Mess...
agpl-3.0
osblinnikov/cnets
SNocscript.py
1
1114
from helper import * # Environment Import( 'env' ) def add_dependencies(env): AddDependency(env,'types_cnets_osblinnikov_github_com','github.com/osblinnikov/cnets/types') AddDependency(env,'selector_cnets_osblinnikov_github_com','github.com/osblinnikov/cnets/selector') AddDependency(env,'mapBuffer_cnet...
bsd-2-clause
shabab12/edx-platform
common/test/acceptance/tests/studio/test_studio_settings_details.py
6
9945
""" Acceptance tests for Studio's Settings Details pages """ from datetime import datetime, timedelta from flaky import flaky from nose.plugins.attrib import attr from unittest import skip from ...fixtures.config import ConfigModelFixture from ...fixtures.course import CourseFixture from ...pages.studio.settings impor...
agpl-3.0
IcarPA-TBlab/nrc
src/python/DL_WORK_conv_mlp.py
1
5121
"""This tutorial introduces the LeNet5 neural network architecture using Theano. LeNet5 is a convolutional neural network, good for classifying images. This tutorial shows how to build the architecture, and comes with all the hyper-parameters you need to reproduce the paper's MNIST results. This implementation simpl...
gpl-3.0
petrleocompel/gnome15
src/pylibg19/g19/keys.py
8
4910
# Gnome15 - Suite of tools for the Logitech G series keyboards and headsets # Copyright (C) 2010 Brett Smith <tanktarta@blueyonder.co.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, e...
gpl-3.0
liangazhou/django-rdp
packages/eclipse/plugins/org.python.pydev_4.4.0.201510052309/pysrc/tests/test_simpleTipper.py
11
7529
''' @author Fabio Zadrozny ''' import sys import os try: import __builtin__ #@UnusedImport BUILTIN_MOD = '__builtin__' except ImportError: BUILTIN_MOD = 'builtins' if sys.platform.find('java') == -1: HAS_WX = False import unittest try: import _pydev_imports_tipper except: ...
apache-2.0
AlbertoPeon/invenio
po/i18n_update_wml_target.py
39
2074
## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 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 option) any ...
gpl-2.0
vv1133/home_web
tests/template_tests/test_response.py
56
13282
from __future__ import unicode_literals import os import pickle import time from datetime import datetime from django.test import RequestFactory, TestCase from django.conf import settings from django.template import Template, Context from django.template.response import (TemplateResponse, SimpleTemplateResponse, ...
bsd-3-clause
search5/nanumlectures
lib/requests/__init__.py
15
2197
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
apache-2.0
foreni-packages/hachoir-metadata
hachoir_metadata/setter.py
94
5203
from datetime import date, datetime import re from hachoir_core.language import Language from locale import setlocale, LC_ALL from time import strptime from hachoir_metadata.timezone import createTimezone from hachoir_metadata import config NORMALIZE_REGEX = re.compile("[-/.: ]+") YEAR_REGEX1 = re.compile("^([0-9]{4})...
gpl-2.0
ToontownUprising/src
toontown/minigame/DistributedCannonGameAI.py
5
5185
from DistributedMinigameAI import * from direct.distributed.ClockDelta import * from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.task import Task import CannonGameGlobals class DistributedCannonGameAI(DistributedMinigameAI): def __init__(self, air, minigameId): Distributed...
mit
GbalsaC/bitnamiP
venv/src/django-oauth2-provider/provider/oauth2/models.py
11
5922
""" Default model implementations. Custom database or OAuth backends need to implement these models with fields and and methods to be compatible with the views in :attr:`provider.views`. """ from django.db import models from django.conf import settings from .. import constants from ..constants import CLIENT_TYPES from...
agpl-3.0
xifle/home-assistant
homeassistant/components/tts/google.py
3
4233
""" Support for the google speech service. For more details about this component, please refer to the documentation at https://home-assistant.io/components/tts/google/ """ import asyncio import logging import re import aiohttp import async_timeout import voluptuous as vol import yarl from homeassistant.components.tt...
mit
badbytes/pymeg
meg/print_dipole.py
1
2740
#!/usr/bin/python # print_dipole.py # # Copyright 2011 dan collins <danc@badbytes.net> # # 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 Lic...
gpl-3.0
cesargtz/YecoraOdoo
addons/lunch/report/order.py
377
2637
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
0x86/viden
source/conf.py
1
8702
# -*- coding: utf-8 -*- # # Viden documentation build configuration file, created by # sphinx-quickstart on Mon Sep 22 09:22:09 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
gpl-3.0
derekjchow/models
research/syntaxnet/examples/dragnn/tutorial_2.py
18
3659
"""Second example: separate tagger and parser.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import tensorflow as tf from google.protobuf import text_format from dragnn.protos import spec_pb2 from dragnn.python import graph_builder from ...
apache-2.0
iModels/ffci
github/InputFileContent.py
1
2498
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
mit
jalama/drupdates
drupdates/tests/behavioral/test_drupal8.py
1
1083
""" Test running Drupdates on one repo. """ from drupdates.tests.behavioral.behavioral_utils import BehavioralUtils from drupdates.tests import Setup from nose import SkipTest class TestSimple(object): """ Test running Drupdates on one repo. """ @classmethod def setup_class(cls): """ Setup test c...
mit
DSLituiev/scikit-learn
sklearn/datasets/covtype.py
46
3508
"""Forest covertype dataset. A classic dataset for classification benchmarks, featuring categorical and real-valued features. The dataset page is available from UCI Machine Learning Repository http://archive.ics.uci.edu/ml/datasets/Covertype Courtesy of Jock A. Blackard and Colorado State University. """ # Aut...
bsd-3-clause
zdszxp/gamesrc
Trdlib/src/boost_1_60_0/libs/python/pyste/src/Pyste/policies.py
54
2401
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to 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) class Policy(object): 'Represents one of the call policies of boost.python.' ...
gpl-3.0
Transkribus/TranskribusDU
usecases/Ghent/DU_GHENT.py
1
16186
# -*- coding: utf-8 -*- """ DU task for tagging resolution graph after the SW re-engineering by JLM during the 2019 summer. As of June 5th, 2015, this is the exemplary code Copyright NAVER(C) 2019 Hervé Déjean Developed for the EU project READ. The READ project has ...
bsd-3-clause
maxamillion/origin
vendor/github.com/google/certificate-transparency/python/ct/cert_analysis/all_checks.py
24
1552
from ct.cert_analysis import algorithm from ct.cert_analysis import ca_field from ct.cert_analysis import common_name from ct.cert_analysis import crl_pointers from ct.cert_analysis import dnsnames from ct.cert_analysis import extensions from ct.cert_analysis import ip_addresses from ct.cert_analysis import ocsp_pointe...
apache-2.0
EUDAT-B2SHARE/invenio-old
modules/webstyle/lib/goto_plugins/goto_plugin_cern_hr_documents.py
8
7087
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012 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
angelapper/edx-platform
lms/djangoapps/discussion_api/serializers.py
10
16500
""" Discussion API serializers """ from urllib import urlencode from urlparse import urlunparse from django.contrib.auth.models import User as DjangoUser from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from rest_framework import serializers from discussion_api.permissio...
agpl-3.0
dancingdan/tensorflow
tensorflow/contrib/rnn/python/tools/checkpoint_convert.py
47
11728
# 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
hungtt57/matchmaker
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## 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 ...
mit
srm912/servo
tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py
636
71218
# Copyright 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 and the f...
mpl-2.0
seznam-schland/mythemortgagemeter
retrieval/mortgages/chelsea.py
4
4103
# vim: set fileencoding=utf-8 import xml.etree.ElementTree as ET import urllib2 import argparse import re import datetime import html5lib import pgdb import logging import main import mc_util import mc_db import themortgagemeter_utils institution_code = 'CHLS' def get_product_pages(static,url,logger): logger.debu...
gpl-2.0
gavin-feng/odoo
openerp/addons/test_converter/tests/test_html.py
257
13533
# -*- encoding: utf-8 -*- import json import os import datetime from lxml import etree from openerp.tests import common from openerp.tools import html_escape as e from openerp.addons.base.ir import ir_qweb directory = os.path.dirname(__file__) class TestExport(common.TransactionCase): _model = None def set...
agpl-3.0
andrebellafronte/brotli
tools/rfc-format.py
99
2111
#!/usr/bin/python # # Takes an .nroff source file and prints a text file in RFC format. # # Usage: rfc-format.py <source file> import re import sys from subprocess import Popen, PIPE def Readfile(fn): f = open(fn, "r") return f.read() def FixNroffOutput(buf): p = re.compile(r'(.*)FORMFEED(\[Page\s+\d+\])$') ...
apache-2.0
odoousers2014/LibrERP
account_vat_on_payment/__openerp__.py
2
1756
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>). # Copyright (C) 2012-2013 Agile Business Group sagl # (<http://www.agilebg.com>) # Cop...
agpl-3.0
hmen89/odoo
openerp/report/render/rml2pdf/color.py
443
1720
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
vFense/vFenseAgent-nix
agent/deps/rpm6-32/Python-2.7.5/lib/python2.7/lib2to3/fixes/fix_idioms.py
327
4889
"""Adjust some old Python 2 idioms to their modern counterparts. * Change some type comparisons to isinstance() calls: type(x) == T -> isinstance(x, T) type(x) is T -> isinstance(x, T) type(x) != T -> not isinstance(x, T) type(x) is not T -> not isinstance(x, T) * Change "while 1:" into "while True:"....
lgpl-3.0
jeffrey4l/nova
nova/api/openstack/compute/plugins/v3/extended_volumes.py
36
3252
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
yakovenkodenis/rethinkdb
test/rql_test/connections/http_support/werkzeug/__init__.py
145
7210
# -*- coding: utf-8 -*- """ werkzeug ~~~~~~~~ Werkzeug is the Swiss Army knife of Python web development. It provides useful classes and functions for any WSGI application to make the life of a python web developer much easier. All of the provided classes are independent from each other so yo...
agpl-3.0
anshulkgupta/viznow
Mayank/blpapi_python3.5.5/build/lib.linux-i686-2.7/blpapi/__init__.py
2
2029
# __init__.py from __future__ import absolute_import from .internals import CorrelationId from .abstractsession import AbstractSession from .constant import Constant, ConstantList from .datetime import FixedOffset from .datatype import DataType from .element import Element from .event import Event, EventQueue from ....
mit
topxiaoke/myedx
common/djangoapps/status/status.py
86
1196
""" A tiny app that checks for a status message. """ from django.conf import settings import json import logging import os log = logging.getLogger(__name__) def get_site_status_msg(course_id): """ Look for a file settings.STATUS_MESSAGE_PATH. If found, read it, parse as json, and do the following: ...
agpl-3.0
EmbolismSoil/ucore_os_lab
related_info/lab7/race-condition/x86.py
102
37305
#! /usr/bin/env python import sys import time import random from optparse import OptionParser # # HELPER # def dospace(howmuch): for i in range(howmuch): print '%24s' % ' ', # useful instead of assert def zassert(cond, str): if cond == False: print 'ABORT::', str exit(1) return c...
gpl-2.0
sileht/deb-openstack-nova
nova/common/policy.py
8
6912
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 OpenStack, LLC. # 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...
apache-2.0
jrrembert/django
tests/delete_regress/tests.py
182
13415
from __future__ import unicode_literals import datetime from django.conf import settings from django.db import DEFAULT_DB_ALIAS, models, transaction from django.db.utils import ConnectionHandler from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from .models import ( Award, AwardNote, Boo...
bsd-3-clause
City-of-Bloomington/green-rental
allauth/socialaccount/providers/facebook/migrations/0003_tosocialaccount.py
82
8978
# encoding: utf-8 from south.v2 import DataMigration class Migration(DataMigration): depends_on = (('socialaccount', '0002_genericmodels'),) def forwards(self, orm): # Migrate FB apps app_id_to_sapp = {} for app in orm.FacebookApp.objects.all(): sapp = orm['socialaccount.S...
agpl-3.0
mozvip/Sick-Beard
lib/hachoir_core/field/string_field.py
90
14849
""" String field classes: - String: Fixed length string (no prefix/no suffix) ; - CString: String which ends with nul byte ("\0") ; - UnixLine: Unix line of text, string which ends with "\n" ; - PascalString8, PascalString16, PascalString32: String prefixed with length written in a 8, 16, 32-bit integer (use parent e...
gpl-3.0
jacquerie/inspire-next
tests/integration/workflows/conftest.py
1
6487
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
3liz/qgis-wps4server
filters/PyWPS/pywps/Parser/Execute.py
1
23826
""" This module parses OGC Web Processing Service (WPS) Execute request. """ # Author: Jachym Cepicky # http://les-ejk.cz # jachym at les-ejk dot cz # Lince: # # Web Processing Service implementation # Copyright (C) 2006 Jachym Cepicky # # This program is free software; you can redistribute it...
gpl-3.0
Adarnof/adarnauth
mumble/models.py
1
4861
from __future__ import unicode_literals from django.db import models from services.models import BaseServiceModel from django.contrib.auth.models import Group import hashlib from authentication.models import User import services.errors import logging logger = logging.getLogger(__name__) class MumbleService(BaseServi...
gpl-2.0
espadrine/opera
chromium/src/third_party/python_26/Lib/io.py
51
64383
""" The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no seperation between reading and writing to streams; imp...
bsd-3-clause
djenniex/CouchPotatoServer
libs/chardet/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library 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 # versio...
gpl-3.0
wildchildyn/autism-website
yanni_env/lib/python3.6/site-packages/sqlalchemy/testing/util.py
15
7540
# testing/util.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from ..util import jython, pypy, defaultdict, decorator, py2k import decimal import ...
gpl-3.0
jandom/rdkit
rdkit/Chem/Pharm2D/Matcher.py
1
4156
# $Id$ # # Copyright (C) 2003-2008 greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ functionality for f...
bsd-3-clause
pheanex/fail2ban
doc/conf.py
1
8171
# -*- coding: utf-8 -*- import sys sys.path.insert(0, ".") sys.path.insert(0, "..") # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown h...
gpl-2.0
sunfounder/SunFounder_Dragit
Dragit/Dragit/libs/modules/liquid_crystal_i2c.py
1
9256
class LiquidCrystal_I2C(): # Commands LCD_CLEARDISPLAY = 0x01 LCD_RETURNHOME = 0x02 LCD_ENTRYMODESET = 0x04 LCD_DISPLAYCONTROL = 0x08 LCD_CURSORSHIFT = 0x10 LCD_FUNCTIONSET = 0x20 LCD_SETCGRAMADDR = 0x40 LCD_SETDDRAMADDR = 0x80 # Flags for display entry mode ...
gpl-2.0
abstract-open-solutions/account-invoicing
stock_picking_invoicing/tests/test_picking_invoicing.py
21
3137
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licens...
agpl-3.0
markgrovs/alfred-airmail-to-todoist
src/lib/todoist/models.py
1
6068
from pprint import pformat class Model(object): """ Implements a generic object. """ def __init__(self, data, api): self.temp_id = '' self.data = data self.api = api def __setitem__(self, key, value): self.data[key] = value def __getitem__(self, key): ...
mit
spirrello/spirrello-pynet-work
applied_python/lib/python2.7/site-packages/pysnmp/smi/mibs/SNMPv2-MIB.py
4
31435
# # This file is part of pysnmp software. # # Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net> # License: http://pysnmp.sf.net/license.html # # PySNMP MIB module SNMPv2-MIB (http://pysnmp.sf.net) # ASN.1 source file:///usr/share/snmp/mibs/SNMPv2-MIB.txt # Produced by pysmi-0.0.5 at Sat Sep 19 23:15:24 2015 # On ho...
gpl-3.0
hamiltont/CouchPotatoServer
libs/chardet/langhungarianmodel.py
235
12572
######################## 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
rombie/contrail-controller
src/config/svc-monitor/svc_monitor/db.py
2
8312
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # """ Service monitor DB to store VM, SI information """ import inspect from cfgm_common import jsonutils as json from cfgm_common.vnc_object_db import VncObjectDBClient from sandesh_common.vns.constants imp...
apache-2.0
uberlaggydarwin/htc-desire-eye-kernel
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
ferabra/edx-platform
lms/djangoapps/lti_provider/outcomes.py
34
9222
""" Helper functions for managing interactions with the LTI outcomes service defined in LTI v1.1. """ from hashlib import sha1 from base64 import b64encode import logging import uuid from lxml import etree from lxml.builder import ElementMaker from oauthlib.oauth1 import Client from oauthlib.common import to_unicode ...
agpl-3.0
bhupennewalkar1337/erpnext
erpnext/config/stock.py
4
6820
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Stock Transactions"), "items": [ { "type": "doctype", "name": "Stock Entry", "description": _("Record item movement."), }, { "type": "doctype", "name": "Delivery Note", ...
gpl-3.0
uranusjr/django
tests/introspection/tests.py
6
10226
from unittest import mock, skipUnless from django.db import connection from django.db.models import Index from django.db.utils import DatabaseError from django.test import TransactionTestCase, skipUnlessDBFeature from .models import Article, ArticleReporter, City, District, Reporter class IntrospectionTests(Transac...
bsd-3-clause
dynaryu/inasafe
safe/gui/tools/help/batch_help.py
5
3507
# coding=utf-8 """Help for batch runner dialog.""" from safe.utilities.i18n import tr from safe import messaging as m from safe.messaging import styles INFO_STYLE = styles.INFO_STYLE __author__ = 'ismailsunni' def batch_help(): """Help message for Batch Dialog. .. versionadded:: 3.2.1 :returns: A mes...
gpl-3.0
michaelBenin/Django-facebook
django_facebook/example_views.py
14
5719
from django.contrib import messages from django.http import HttpResponse from django.shortcuts import render_to_response from django.template.context import RequestContext from django.views.decorators.csrf import csrf_protect from django_facebook.api import get_persistent_graph, require_persistent_graph from django_fac...
bsd-3-clause