repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
sudo87/cm_api
cm_api/endpoints/dashboards.py
7
2494
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
apache-2.0
synconics/odoo
addons/website/tests/test_views.py
144
9831
# -*- coding: utf-8 -*- import itertools import unittest2 from lxml import etree as ET, html from lxml.html import builder as h from openerp.tests import common def attrs(**kwargs): return dict(('data-oe-%s' % key, str(value)) for key, value in kwargs.iteritems()) class TestViewSaving(common.TransactionCase): ...
agpl-3.0
double12gzh/nova
nova/api/metadata/base.py
14
19291
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
dalegregory/odoo
addons/auth_oauth/res_config.py
292
3368
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
NL66278/OCB
addons/l10n_sg/__init__.py
669
1059
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>). # # This program is free software: you can redistribute it and/or modify # it under the te...
agpl-3.0
memtoko/django
django/core/management/commands/sqlmigrate.py
463
2715
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.executor import MigrationExecutor from django.db.migrations.loader import AmbiguityError class Command(BaseCo...
bsd-3-clause
romain-dartigues/ansible
lib/ansible/modules/network/netscaler/netscaler_lb_vserver.py
101
72334
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
kingvuplus/nn-gui
lib/python/Components/GUISkin.py
58
3172
from GUIComponent import GUIComponent from skin import applyAllAttributes from Tools.CList import CList from Sources.StaticText import StaticText class GUISkin: __module__ = __name__ def __init__(self): self["Title"] = StaticText() self.onLayoutFinish = [ ] self.summaries = CList() self.instance = None se...
gpl-2.0
vIiRuS/Lagerregal
users/forms.py
1
1438
from django import forms from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext from users.models import Lageruser, DepartmentUser from Lagerregal import settings class SettingsForm(forms.ModelForm): error_css_class = 'has-error' class Meta: model = Lag...
bsd-3-clause
rjschof/gem5
util/cpt_upgraders/isa-is-simobject.py
29
2624
# The ISA is now a separate SimObject, which means that we serialize # it in a separate section instead of as a part of the ThreadContext. def upgrader(cpt): isa = cpt.get('root','isa') isa_fields = { "alpha" : ( "fpcr", "uniq", "lock_flag", "lock_addr", "ipr" ), "arm" : ( "miscRegs" ), ...
bsd-3-clause
taedori81/shoop
shoop/admin/module_registry.py
6
1540
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import contextlib import six from shoop.apps.provides import get_provide_o...
agpl-3.0
ssvsergeyev/ZenPacks.zenoss.AWS
src/boto/boto/cognito/identity/exceptions.py
15
1050
# The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOS...
gpl-2.0
wolfram74/numerical_methods_iserles_notes
venv/lib/python2.7/site-packages/numpy/lib/tests/test_stride_tricks.py
32
7775
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import ( run_module_suite, assert_equal, assert_array_equal, assert_raises ) from numpy.lib.stride_tricks import as_strided, broadcast_arrays def assert_shapes_correct(input_shapes, expected_shape): ...
mit
matthieucan/debsources
debsources/updater.py
5
29780
# Copyright (C) 2013-2014 The Debsources developers <info@sources.debian.net>. # See the AUTHORS file at the top-level directory of this distribution and at # https://anonscm.debian.org/gitweb/?p=qa/debsources.git;a=blob;f=AUTHORS;hb=HEAD # # This file is part of Debsources. Debsources is free software: you can # redi...
agpl-3.0
atreyv/sympy
sympy/physics/vector/tests/test_functions.py
79
18478
from sympy import S, Integral, sin, cos, pi, sqrt, symbols from sympy.physics.vector import (Dyadic, Point, ReferenceFrame, \ Vector) from sympy.physics.vector import (cross, dot, express, \ time_derivative, kinematic_equations, \ ...
bsd-3-clause
krunal3103/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_stream.py
446
6264
from __future__ import absolute_import, division, unicode_literals from . import support # flake8: noqa import unittest import codecs from io import BytesIO from six.moves import http_client from html5lib.inputstream import (BufferedStream, HTMLInputStream, HTMLUnicodeInputStream, ...
mpl-2.0
dednal/chromium.src
third_party/closure_linter/closure_linter/errorrules_test.py
126
3658
#!/usr/bin/env python # Copyright 2013 The Closure Linter 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 # #...
bsd-3-clause
MiLk/youtube-dl
youtube_dl/extractor/justintv.py
5
6037
from __future__ import unicode_literals import json import os import re from .common import InfoExtractor from ..utils import ( compat_str, ExtractorError, formatSeconds, ) class JustinTVIE(InfoExtractor): """Information extractor for justin.tv and twitch.tv""" # TODO: One broadcast may be split...
unlicense
jiajiax/crosswalk-test-suite
usecase/usecase-webapi-xwalk-tests/inst.wgt.py
44
6786
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
dmsimard/ansible
lib/ansible/plugins/filter/core.py
1
21532
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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
apache/beam
sdks/python/apache_beam/transforms/combiners_test.py
5
33747
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
mancoast/CPythonPyc_test
cpython/279_test_socket.py
24
63529
import unittest from test import test_support import errno import itertools import socket import select import time import traceback import Queue import sys import os import array import contextlib import signal import math import weakref try: import _socket except ImportError: _socket = None def try_address...
gpl-3.0
jacky-young/crosswalk-test-suite
stability/stability-iterative-android-tests/inst.apk.py
903
3180
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
bsd-3-clause
farhaanbukhsh/sympy
sympy/physics/unitsystems/systems/natural.py
91
1785
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- """ Naturalunit system. The natural system comes from "setting c = 1, hbar = 1". From the computer point of view it means that we use velocity and action instead of length and time. Moreover instead of mass we use energy. """ from __future__ import division from sympy...
bsd-3-clause
bonethrown/azure-sdk-for-python
azure-nspkg/setup.py
4
2040
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. 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...
apache-2.0
ErickMurillo/ciat_plataforma
comunicacion/notas/migrations/0001_initial.py
3
7549
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Temas' db.create_table(u'notas_temas', ( (u'i...
mit
jesmorc/Proyecto-IV
lib/python2.7/site-packages/werkzeug/debug/tbtools.py
147
16913
# -*- coding: utf-8 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import json import inspect import ...
gpl-2.0
WillGuan105/django
tests/migrations/test_multidb.py
366
6909
import unittest from django.db import connection, migrations, models from django.db.migrations.state import ProjectState from django.test import override_settings from .test_operations import OperationTestBase try: import sqlparse except ImportError: sqlparse = None class AgnosticRouter(object): """ ...
bsd-3-clause
SilverLiningSystems/cxmanage-test
cxmanage_api/decorators.py
4
2599
# pylint: disable=useless-else-on-loop # Copyright (c) 2012-2013, Calxeda 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 copyr...
bsd-3-clause
taotie12010/bigfour
lms/djangoapps/shoppingcart/migrations/0027_add_invoice_history.py
102
22387
# -*- 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): # Adding model 'InvoiceHistory' db.create_table('shoppingcart_invoicehistory', ( ('id', self.gf(...
agpl-3.0
slisson/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/handlers/modpython.py
436
1899
from mod_python import apache import os def authenhandler(req, **kwargs): """ Authentication handler that checks against Django's auth database. """ # mod_python fakes the environ, and thus doesn't process SetEnv. This fixes # that so that the following import works os.environ.update(req.subp...
apache-2.0
stormi/tsunami
src/secondaires/familier/editeurs/famedit/__init__.py
1
6790
# -*-coding:Utf-8 -* # Copyright (c) 2014 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 # lis...
bsd-3-clause
shskyinfo/android_kernel_lge_e610
scripts/build-all.py
1250
9474
#! /usr/bin/env python # Copyright (c) 2009-2011, Code Aurora Forum. 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 # n...
gpl-2.0
wido/libcloud
libcloud/test/compute/test_ecp.py
46
5159
# 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 use ...
apache-2.0
fangxingli/hue
desktop/core/ext-py/markdown/regression-tests.py
44
8693
#!/usr/bin/python """ Python-Markdown Regression Tests ================================ Tests of the various APIs with the python markdown lib. """ import unittest from doctest import DocTestSuite import os import markdown class TestMarkdown(unittest.TestCase): """ Tests basics of the Markdown class. """ d...
apache-2.0
rderradi/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/base/struct/TriggerPatchTHnSparse.py
41
3251
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
camilonova/django
tests/utils_tests/test_decorators.py
93
4792
from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, SimpleTestCase from django.utils.decorators import classproperty, decorator_from_middleware class ProcessViewMiddleware: def process_view(self, req...
bsd-3-clause
sestrella/ansible
lib/ansible/modules/storage/netapp/netapp_e_iscsi_target.py
24
10686
#!/usr/bin/python # (c) 2018, 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
Sorsly/subtle
google-cloud-sdk/lib/surface/compute/groups/create.py
3
2213
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
mit
charmander/livestreamer
src/livestreamer/stream/segmented.py
36
5517
from concurrent import futures from threading import Thread, Event from .stream import StreamIO from ..buffers import RingBuffer from ..compat import queue class SegmentedStreamWorker(Thread): """The general worker thread. This thread is responsible for queueing up segments in the writer thread. """...
bsd-2-clause
msduketown/SublimeKodi
libs-mac/lxml/html/_diffcommand.py
93
2084
import optparse import sys import re import os from lxml.html.diff import htmldiff description = """\ """ parser = optparse.OptionParser( usage="%prog [OPTIONS] FILE1 FILE2\n" "%prog --annotate [OPTIONS] INFO1 FILE1 INFO2 FILE2 ...", description=description, ) parser.add_option( '-o', '--output',...
gpl-3.0
cshallue/models
research/minigo/features_test.py
2
3096
# Copyright 2018 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
0k/OpenUpgrade
openerp/addons/test_new_api/tests/test_new_fields.py
51
15560
# # test cases for new-style fields # from datetime import date, datetime from collections import defaultdict from openerp.tests import common from openerp.exceptions import except_orm class TestNewFields(common.TransactionCase): def test_00_basics(self): """ test accessing new fields """ # find...
agpl-3.0
a-langer/lo_report
modules/markupsafe/markupsafe/_constants.py
1535
4795
# -*- coding: utf-8 -*- """ markupsafe._constants ~~~~~~~~~~~~~~~~~~~~~ Highlevel implementation of the Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ HTML_ENTITIES = { 'AElig': 198, 'Aacute': 193, 'Acirc': 194, 'Agrave': 1...
apache-2.0
dirtycoder/opbeat_python
opbeat/base.py
2
20371
""" opbeat.base ~~~~~~~~~~ :copyright: (c) 2011-2012 Opbeat Large portions are :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import contextlib import datetime import logging import sys import time import...
bsd-3-clause
sudosurootdev/kernel_lge_g3-1
tools/perf/scripts/python/net_dropmonitor.py
4235
1554
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
SivilTaram/edx-platform
cms/djangoapps/contentstore/migrations/0002_auto__del_field_videouploadconfig_status_whitelist.py
108
4442
# -*- 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 'VideoUploadConfig.status_whitelist' db.delete_column('contentstore_videouploadconfig', 'st...
agpl-3.0
prechelt/typecheck-decorator
typecheck/test_typing_annotations.py
1
18996
import builtins import datetime as dt import io import re import sys import tempfile import typing as tg import pytest import typecheck as tc import typecheck.framework as fw from typecheck.testhelper import expected # global TypeVars, used in various places: X = tg.TypeVar('X') Tb = tg.TypeVar('Tb', bound=dt.date...
bsd-2-clause
MillerDix/NEChromeX
flaskTest/venv/lib/python2.7/site-packages/pip/_vendor/webencodings/labels.py
512
8979
""" webencodings.labels ~~~~~~~~~~~~~~~~~~~ Map encoding labels to their name. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ # XXX Do not edit! # This file is automatically generated by mklabels.py LABELS = { 'unicode-1-1-utf-8': 'utf-8', 'utf-...
mit
IV-GII/SocialCookies
ENV1/lib/python2.7/site-packages/django/db/models/fields/__init__.py
28
52768
from __future__ import unicode_literals import copy import datetime import decimal import math import warnings from base64 import b64decode, b64encode from itertools import tee from django.db import connection from django.db.models.loading import get_model from django.db.models.query_utils import QueryWrapper from dj...
gpl-2.0
JukeboxPipeline/jukebox-core
src/jukeboxcore/addons/guerilla/guerillamgmt.py
1
82524
from PySide import QtGui from jukeboxcore.log import get_logger log = get_logger(__name__) from jukeboxcore import ostool from jukeboxcore import djadapter from jukeboxcore.gui.main import JB_MainWindow, JB_Dialog, dt_to_qdatetime from jukeboxcore.gui import treemodel from jukeboxcore.gui import djitemdata from jukeb...
bsd-3-clause
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/scipy/io/matlab/tests/test_streams.py
109
5442
""" Testing """ from __future__ import division, print_function, absolute_import import os import sys import zlib from io import BytesIO if sys.version_info[0] >= 3: cStringIO = BytesIO else: from cStringIO import StringIO as cStringIO from tempfile import mkstemp import numpy as np from numpy.testing i...
gpl-2.0
DefyVentures/edx-platform
common/lib/capa/capa/safe_exec/lazymod.py
193
1200
"""A module proxy for delayed importing of modules. From http://barnesc.blogspot.com/2006/06/automatic-python-imports-with-autoimp.html, in the public domain. """ import sys class LazyModule(object): """A lazy module proxy.""" def __init__(self, modname): self.__dict__['__name__'] = modname ...
agpl-3.0
tbullmann/heuhaufen
publication/generators_and_depth/aggregate.py
1
5320
import os import pandas import numpy as np from bokeh.palettes import Viridis4 as palette from bokeh.layouts import layout, column, row from bokeh.plotting import figure, output_file, show, ColumnDataSource from bokeh.models import HoverTool, Div, DataTable, TableColumn, NumberFormatter, LinearAxis, Select, CustomJS, ...
mit
bcoca/ansible
lib/ansible/parsing/splitter.py
15
11349
# (c) 2014 James Cammarata, <jcammarata@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
rouault/mapnik
scons/scons-local-2.3.4/SCons/Scanner/IDL.py
9
1807
"""SCons.Scanner.IDL This module implements the depenency scanner for IDL (Interface Definition Language) files. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Softwa...
lgpl-2.1
Statoil/libres
python/res/enkf/ert_template.py
1
2187
# Copyright (C) 2012 Equinor ASA, Norway. # # The file 'ert_template.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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 Li...
gpl-3.0
blueskyjunkie/timeTools
timetools/synchronization/compliance/ituTG8261/eecOption1/networkWander.py
1
1252
# # Copyright 2017 Russell Smiley # # This file is part of timetools. # # timetools 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
bkirui/odoo
addons/project_timesheet/report/task_report.py
336
4030
# -*- 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
oemof/oemof_base
src/oemof/solph/groupings.py
1
2875
# -*- coding: utf-8 -*- """Groupings needed on an energy system for it to work with solph. If you want to use solph on an energy system, you need to create it with these groupings specified like this: .. code-block: python from oemof.network import EnergySystem import solph energy_system = EnergySy...
gpl-3.0
biswajitsahu/kuma
kuma/actioncounters/tests/tests.py
9
8421
from django.core.exceptions import MultipleObjectsReturned from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser from django.contrib.contenttypes.models import ContentType from django.http import HttpRequest from django.test import TransactionTestCase from nose.tools impo...
mpl-2.0
NIRALUser/RodentThickness
Applications/RodentThickness/Testing/Data/vtkPointAttributes.py
2
3379
import sys # path="/tools/Python/Python-2.7.3/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg:/tools/Python/Python-2.7.3/lib/python2.7/site-packages/pip-1.0-py2.7.egg:/tools/Python/Python-2.7.3/lib/python2.7/site-packages/VTK-6.0-py2.7.egg:/tools/Python/Python-2.7.3/lib/python2.7/site-packages/distribute-0.6....
gpl-3.0
LaMi-/pmatic
ccu_pkg/python/lib/python2.7/encodings/mac_greek.py
593
13977
""" Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.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,err...
gpl-2.0
imsut/commons
src/python/twitter/pants/targets/jvm_target.py
1
2954
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
DefyVentures/edx-platform
common/lib/symmath/symmath/symmath_check.py
36
12584
#!/usr/bin/python # -*- coding: utf-8 -*- # # File: symmath_check.py # Date: 02-May-12 (creation) # # Symbolic mathematical expression checker for edX. Uses sympy to check for expression equality. # # Takes in math expressions given as Presentation MathML (from ASCIIMathML), converts to Content MathML using Snuggl...
agpl-3.0
jmesteve/medical
openerp/addons/sale/report/sale_report.py
13
5526
# -*- 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
ver228/tierpsy-tracker
tierpsy/helper/misc/file_processing.py
1
2071
import os import tables from .misc import TABLE_FILTERS RESERVED_EXT = ['_skeletons.hdf5', '_trajectories.hdf5', '_features.hdf5', '_intensities.hdf5', '_feat_manual.hdf5', '_subsample.avi', '.wcon.zip', ...
mit
google-code/android-scripting
python/src/Demo/tkinter/guido/hanoi.py
42
4649
# Animated Towers of Hanoi using Tk with optional bitmap file in # background. # # Usage: tkhanoi [n [bitmapfile]] # # n is the number of pieces to animate; default is 4, maximum 15. # # The bitmap file can be any X11 bitmap file (look in # /usr/include/X11/bitmaps for samples); it is displayed as the # background of t...
apache-2.0
Jichao/skia
tools/skp/page_sets/skia_css3gradients_desktop.py
32
1393
# 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. # pylint: disable=W0401,W0614 from telemetry import story from telemetry.page import page as page_module from telemetry.page import shared_page_state clas...
bsd-3-clause
girving/tensorflow
tensorflow/python/tools/api/generator/doc_srcs.py
9
3894
# Copyright 2018 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
Stargrazer82301/CAAPR
CAAPR/CAAPR_AstroMagic/PTS/pts/modeling/config/launch_best.py
1
1734
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** # ...
mit
drufat/sympy
sympy/interactive/ipythonprinting.py
118
1785
""" A print function that pretty prints SymPy objects. :moduleauthor: Brian Granger Usage ===== To use this extension, execute: %load_ext sympy.interactive.ipythonprinting Once the extension is loaded, SymPy Basic objects are automatically pretty-printed in the terminal and rendered in LaTeX in the Qt console ...
bsd-3-clause
brettlangdon/dd-agent
checks.d/teamcity.py
3
6264
# stdlib import time # 3p import requests # project from checks import AgentCheck from config import _is_affirmative class TeamCityCheck(AgentCheck): HEADERS = {'Accept': 'application/json'} DEFAULT_TIMEOUT = 10 NEW_BUILD_URL = "http://{server}/guestAuth/app/rest/builds/?locator=buildType:{build_conf},s...
bsd-3-clause
Alwnikrotikz/cortex-vfx
test/IECore/CurvesMergeOpTest.py
12
2851
########################################################################## # # Copyright (c) 2009-2013, Image Engine Design 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: # # * Redis...
bsd-3-clause
afandria/sky_engine
build/util/lib/common/unittest_util.py
29
4933
# 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. """Utilities for dealing with the python unittest module.""" import fnmatch import sys import unittest class _TextTestResult(unittest._TextTestResult): ...
bsd-3-clause
Jarn/jarn.mkrelease
jarn/mkrelease/tests/test_git.py
1
18107
import unittest import os from os.path import join, isdir from jarn.mkrelease.scm import Git from jarn.mkrelease.process import Process from jarn.mkrelease.testing import GitSetup from jarn.mkrelease.testing import MockProcess from jarn.mkrelease.testing import quiet class ValidUrlTests(unittest.TestCase): d...
bsd-2-clause
ionutbalutoiu/ironic
ironic/drivers/modules/ilo/boot.py
2
16854
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
attia42/twitter_word2vec
kmeans/experimentm.py
1
3559
import csv import nltk from nltk.tokenize import word_tokenize import string from nltk import pos_tag from gensim.models.word2vec import Word2Vec from gensim import matutils from numpy import array, float32 as REAL from sklearn.cluster import MiniBatchKMeans, KMeans from multiprocessing import Pool from collections imp...
mit
hbisheng/ucore_os_lab
related_info/lab8/sfs-homework.py
45
13723
#! /usr/bin/env python import random from optparse import OptionParser DEBUG = False def dprint(str): if DEBUG: print str printOps = True printState = True printFinal = True class bitmap: def __init__(self, size): self.size = size self.bmap = [] for num in range(s...
gpl-2.0
WhittKinley/aima-python
submissions/Fritz/c4-11-28/ConnectFourText.py
29
1607
from ConnectFour import ConnectFour class ConnectFourText(ConnectFour): def current(self): print(self.players[self.first_player]) def drop(self, column): ConnectFour.drop(self, column) print(self) if self.game_over != False: print('Game has ended.') return ...
mit
notriddle/servo
tests/wpt/web-platform-tests/tools/pywebsocket/test/testdata/handlers/sub/plain_wsh.py
499
1789
# Copyright 2009, 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
fga-gpp-mds/2017.2-Receituario-Medico
medical_prescription/exam/test/test_view_list_custom_exam.py
1
2151
# Django imports from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied # Local Django imports from exam.views import ListCustomExams from user.models import User, Patient, HealthProfessiona...
mit
tfrancart/schemaorg
lib/html5lib/tests/test_treewalkers.py
72
12240
import os import sys import StringIO import unittest import warnings warnings.simplefilter("error") from support import html5lib_test_files, TestData, convertExpected from html5lib import html5parser, treewalkers, treebuilders, constants from html5lib.filters.lint import Filter as LintFilter, LintError def PullDOMA...
apache-2.0
mxcube/mxcube
mxcubeqt/widgets/optimisation_parameters_widget_layout.py
1
2158
# # Project: MXCuBE # https://github.com/mxcube # # This file is part of MXCuBE software. # # MXCuBE 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...
lgpl-3.0
hyperized/ansible
lib/ansible/modules/packaging/language/pear.py
54
7094
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Afterburn <https://github.com/afterburn> # (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com> # (c) 2015, Jonathan Lestrelin <jonathan.lestrelin@gmail.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __futu...
gpl-3.0
peacekeeper/indy-sdk
vcx/wrappers/python3/demo/faber-pg.py
3
5852
import sys import asyncio import json import random from ctypes import cdll from time import sleep import platform import logging from indy import wallet from indy.error import ErrorCode, IndyError from vcx.api.connection import Connection from vcx.api.credential_def import CredentialDef from vcx.api.issuer_credenti...
apache-2.0
gohin/django
django/contrib/sites/models.py
316
3743
from __future__ import unicode_literals import string from django.core.exceptions import ImproperlyConfigured, ValidationError from django.db import models from django.db.models.signals import pre_delete, pre_save from django.http.request import split_domain_port from django.utils.encoding import python_2_unicode_com...
bsd-3-clause
yongtang/tensorflow
tensorflow/python/framework/registry_test.py
14
1986
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
BillmanH/termite
execute.py
3
8107
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import argparse import ConfigParser import logging import time import os from pipeline.tokenize import Tokenize from pipeline.import_mallet import ImportMallet from pipeline.import_stmt import ImportStmt from pipeline.compute_saliency import ComputeSaliency fro...
bsd-3-clause
PowerHMC/HmcRestClient
src/managed_system/PowerOnManagedSystem.py
1
2162
# Copyright 2015, 2016 IBM Corp. # # 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 require...
apache-2.0
mtconley/turntable
test/lib/python2.7/site-packages/scipy/interpolate/fitpack2.py
7
57978
""" fitpack --- curve and surface fitting with splines fitpack is based on a collection of Fortran routines DIERCKX by P. Dierckx (see http://www.netlib.org/dierckx/) transformed to double routines by Pearu Peterson. """ # Created by Pearu Peterson, June,August 2003 from __future__ import division, print_function, abs...
mit
projectcalico/calico-nova
nova/tests/functional/v3/test_images.py
14
3676
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
apache-2.0
ryansb/boto
boto/logs/exceptions.py
150
1732
# -*- coding: utf-8 -*- # Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/ # # 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 th...
mit
mmlr/qemu-haiku
roms/seabios/scripts/readserial.py
11
6173
#!/usr/bin/env python # Script that can read from a serial device and show timestamps. # # Copyright (C) 2009 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. # Usage: # tools/readserial.py /dev/ttyUSB0 115200 import sys import time import select import...
gpl-2.0
chen0510566/MissionPlanner
Lib/timeit.py
50
12387
#! /usr/bin/env python """Tool for measuring execution time of small code snippets. This module avoids a number of common traps for measuring execution times. See also Tim Peters' introduction to the Algorithms chapter in the Python Cookbook, published by O'Reilly. Library usage: see the Timer class. Com...
gpl-3.0
netroby/vitess
py/vtdb/db_object_range_sharded.py
6
21233
"""Module containing base classes for range-sharded database objects. There are two base classes for tables that live in range-sharded keyspace - 1. DBObjectRangeSharded - This should be used for tables that only reference lookup entities but don't create or manage them. Please see examples in test/clientlib_tests/db...
bsd-3-clause
mhotwagner/abackend
abackend-env/lib/python3.5/site-packages/django/utils/http.py
285
9978
from __future__ import unicode_literals import base64 import calendar import datetime import re import sys import unicodedata from binascii import Error as BinasciiError from email.utils import formatdate from django.utils import six from django.utils.datastructures import MultiValueDict from django.utils.encoding im...
mit
Nablaquabla/sns-analysis
ba-missing-files.py
1
5827
import os import time as tm import sys # Handles the creation of condor files for a given set of directories # ----------------------------------------------------------------------------- def createCondorFile(dataDir,outDir,run,day,time): # Condor submission file name convention: run-day-time.condor with open...
gpl-3.0
bryanph/OIPA
OIPA/iati_synchroniser/migrations/0001_initial.py
3
3637
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Codelist', fields=[ ('name', models.CharField(m...
agpl-3.0
CamelBackNotation/CarnotKE
jyhton/lib-python/2.7/ctypes/macholib/dyld.py
253
5341
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ dyld emulation """ import os from framework import framework_info from dylib import dylib_info from it...
apache-2.0