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
wenyu1001/python-multiprocessing
Lib/multiprocessing/connection.py
4
12223
# # A higher level module for using sockets (or Windows named pipes) # # multiprocessing/connection.py # # Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt # __all__ = [ 'Client', 'Listener', 'Pipe' ] import os import sys import socket import errno import time import tempfile import itertools import _multiproc...
bsd-3-clause
analyseuc3m/ANALYSE-v1
openedx/core/djangoapps/profile_images/tests/test_views.py
29
21972
""" Test cases for the HTTP endpoints of the profile image api. """ from contextlib import closing import datetime from pytz import UTC import unittest from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponse import ddt import mock from mock import patch from ...
agpl-3.0
def-/commandergenius
project/jni/python/src/Lib/test/test_transformer.py
90
1028
import unittest from test import test_support from compiler import transformer, ast from compiler import compile class Tests(unittest.TestCase): def testMultipleLHS(self): """ Test multiple targets on the left hand side. """ snippets = ['a, b = 1, 2', '(a, b) = 1, 2', ...
lgpl-2.1
andresailer/DIRAC
DataManagementSystem/scripts/dirac-dms-create-replication-request.py
11
3404
#!/usr/bin/env python """ Create a DIRAC transfer/replicateAndRegister request to be executed by the DMS Transfer Agent """ __RCSID__ = "$Id$" import os from hashlib import md5 import time from DIRAC.Core.Base import Script from DIRAC.Core.Utilities.List import breakListIntoChunks Script.setUsageMessage( '\n'.joi...
gpl-3.0
whaleygeek/punchcard_reader
cardreader/arduino.py
1
3715
# arduino.py 20/06/2015 D.J.Whale # # (c) 2015 D.J.Whale # # Read card records from an arduino card reader. #----- CONFIGURATION ----------------------------------------------------------- DEBUG = False USE_EMBEDDED_PYSERIAL = True BAUD = 115200 ENABLE_ERROR_CORRECT = False if US...
mit
bitmazk/django-dynamic-content
dynamic_content/south_migrations/0001_initial.py
1
2962
# flake8: noqa # -*- 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 'DynamicContentTranslation' db.create_table...
mit
yajiedesign/mxnet
example/distributed_training/cifar10_dist.py
9
6548
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
apache-2.0
CydarLtd/ansible
lib/ansible/modules/monitoring/zabbix_maintenance.py
42
12164
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Alexander Bulimov <lazywolf0@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 t...
gpl-3.0
jvkops/django
django/views/decorators/vary.py
586
1200
from functools import wraps from django.utils.cache import patch_vary_headers from django.utils.decorators import available_attrs def vary_on_headers(*headers): """ A view decorator that adds the specified headers to the Vary header of the response. Usage: @vary_on_headers('Cookie', 'Accept-langu...
bsd-3-clause
eldarion/pycon
pycon/sponsorship/managers.py
1
1557
from django.db import models class SponsorManager(models.Manager): def active(self): return self.get_query_set().filter(active=True).order_by("level") def with_weblogo(self): queryset = self.raw(""" SELECT DISTINCT "sponsorship_sponsor"."id", "sponsorship_...
bsd-3-clause
NAMD/pypln.backend
pypln/backend/workers/__init__.py
2
1362
# coding: utf-8 # # Copyright 2012 NAMD-EMAP-FGV # # This file is part of PyPLN. You can get more information at: http://pypln.org/. # # PyPLN 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 o...
gpl-3.0
PDXostc/rvi_backend
server/trackingserver.py
7
3237
""" Copyright (C) 2014, Jaguar Land Rover This program is licensed under the terms and conditions of the Mozilla Public License, version 2.0. The full text of the Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ Maintainer: Rudolf Streif (rstreif@jaguarlandrover.com) """ """ Software Over The Air (SO...
mpl-2.0
lenstr/rethinkdb
test/rql_test/connections/http_support/flask/testsuite/config.py
556
11820
# -*- coding: utf-8 -*- """ flask.testsuite.config ~~~~~~~~~~~~~~~~~~~~~~ Configuration and instances. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys import flask import pkgutil import unittest from contextlib import contextmanager fr...
agpl-3.0
ChameleonCloud/horizon
openstack_dashboard/dashboards/admin/volume_groups/urls.py
3
1212
# Copyright 2019 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
tombtc/dashman
lib/pycoin/pycoin/ecdsa/native/library.py
13
3285
import ctypes.util import os from .bignum import bignum_type_for_library class BignumContext(ctypes.Structure): pass def set_api(library, api_info): for f_name, argtypes, restype in api_info: f = getattr(library, f_name) f.argtypes = argtypes f.restype = restype def load_library()...
mit
DolphinDream/sverchok
nodes/curve/concat_curves.py
2
3697
import numpy as np import bpy from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level from sverchok.utils.curve import SvCurve from sverchok.utils.curve.nurbs...
gpl-3.0
Antiun/odoomrp-wip
product_variant_default_code/__openerp__.py
27
1422
# -*- encoding: utf-8 -*- ############################################################################## # # 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...
agpl-3.0
zanderle/django
django/contrib/gis/gdal/geometries.py
337
24056
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" u...
bsd-3-clause
campadrenalin/python-libdeje
deje/tests/test_dexter_commands_deje.py
1
17629
''' This file is part of python-libdeje. python-libdeje 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 version. python-libdeje is distribute...
gpl-3.0
zhaohuaw/brotli
python/tests/test_utils.py
98
1128
from __future__ import print_function import sys import os import sysconfig import filecmp def diff_q(first_file, second_file): """Simulate call to POSIX diff with -q argument""" if not filecmp.cmp(first_file, second_file, shallow=False): print("Files %s and %s differ" % (first_file, second_file), ...
apache-2.0
surhudm/scipy
scipy/optimize/cobyla.py
83
9915
""" Interface to Constrained Optimization By Linear Approximation Functions --------- .. autosummary:: :toctree: generated/ fmin_cobyla """ from __future__ import division, print_function, absolute_import import numpy as np from scipy._lib.six import callable from scipy.optimize import _cobyla from .optimiz...
bsd-3-clause
raghavs1108/DataPlotter
pyqtgraph/dockarea/Container.py
37
8634
# -*- coding: utf-8 -*- from ..Qt import QtCore, QtGui import weakref class Container(object): #sigStretchChanged = QtCore.Signal() ## can't do this here; not a QObject. def __init__(self, area): object.__init__(self) self.area = area self._container = None self._stretch =...
mit
jm-begon/scikit-learn
sklearn/cluster/spectral.py
233
18153
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
UOMx/edx-platform
lms/djangoapps/ccx/api/v0/serializers.py
33
1588
""" CCX API v0 Serializers. """ from rest_framework import serializers from lms.djangoapps.ccx.models import CustomCourseForEdX from ccx_keys.locator import CCXLocator class CCXCourseSerializer(serializers.ModelSerializer): """ Serializer for CCX courses """ ccx_course_id = serializers.SerializerMet...
agpl-3.0
hightoon/Sora
kernel/sdl/exe/sdroma/update.py
7
1316
import os; import random; target = 'now.dmp'; def tryGetNewDump(fn): """Dump data from driver""" # dump data from driver. cwd = os.getcwd(); os.system("rm newdump.dmp"); os.system("rm %s" % fn); if (not os.path.isdir("E:\\Sora\\dot11a")): return False; os.system("E:\\Sora\\dot11a\\...
bsd-2-clause
mixturemodel-flow/tensorflow
tensorflow/python/platform/test.py
13
3786
# 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
faridani/pyDoc
Unidecode/unidecode/x0cf.py
253
4713
data = ( 'ke', # 0x00 'keg', # 0x01 'kegg', # 0x02 'kegs', # 0x03 'ken', # 0x04 'kenj', # 0x05 'kenh', # 0x06 'ked', # 0x07 'kel', # 0x08 'kelg', # 0x09 'kelm', # 0x0a 'kelb', # 0x0b 'kels', # 0x0c 'kelt', # 0x0d 'kelp', # 0x0e 'kelh', # 0x0f 'kem', # 0x10 'keb', # ...
mit
foufou55/Sick-Beard
lib/subliminal/services/__init__.py
36
9247
# -*- 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
EBTCoin/EBT
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
stonezdj/forzdj
registration/forms.py
4
5496
""" Forms and validation code for user registration. """ from django.contrib.auth.models import User from django import forms from django.utils.translation import ugettext_lazy as _ from registration.models import RegistrationProfile # I put this on all required fields, because it's easier to pick up # on them wit...
mit
a115027a/Openkore
src/scons-local-2.0.1/SCons/Builder.py
61
33976
"""SCons.Builder Builder object subsystem. A Builder object is a callable that encapsulates information about how to execute actions to create a target Node (file) from source Nodes (files), and how to create those dependencies for tracking. The main entry point here is the Builder() factory method. This provides a...
gpl-2.0
lqik2004/xhtml2pdf
test/helloworld.py
154
1057
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
apache-2.0
BeegorMif/HTPC-Manager
lib/unidecode/x060.py
250
4642
data = ( 'Huai ', # 0x00 'Tai ', # 0x01 'Song ', # 0x02 'Wu ', # 0x03 'Ou ', # 0x04 'Chang ', # 0x05 'Chuang ', # 0x06 'Ju ', # 0x07 'Yi ', # 0x08 'Bao ', # 0x09 'Chao ', # 0x0a 'Min ', # 0x0b 'Pei ', # 0x0c 'Zuo ', # 0x0d 'Zen ', # 0x0e 'Yang ', # 0x0f 'Kou ', # 0x10 ...
gpl-3.0
alanjw/GreenOpenERP-Win-X86
openerp/addons/document_page/wizard/__init__.py
59
1110
# -*- 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
unsiloai/syntaxnet-ops-hack
tensorflow/python/ops/state_ops.py
16
9675
# 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
Fokko/incubator-airflow
tests/contrib/hooks/test_segment_hook.py
1
2012
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
awakener1986/myPetrolApp
node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 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. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
mit
albertomurillo/ansible
lib/ansible/__init__.py
301
1224
# (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
matthewzhenggong/ardupilot
Tools/autotest/apmrover2.py
3
5834
# drive APMrover2 in SITL import util, pexpect, sys, time, math, shutil, os from common import * from pymavlink import mavutil import random # get location of scripts testdir=os.path.dirname(os.path.realpath(__file__)) #HOME=mavutil.location(-35.362938,149.165085,584,270) HOME=mavutil.location(40.071374969556928,-1...
gpl-3.0
justinhayes/cm_api
python/examples/schema.py
6
4232
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
daveferrara1/linkchecker
tests/checker/test_file.py
7
5403
# -*- coding: utf-8 -*- # Copyright (C) 2004-2014 Bastian Kleineidam # # 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. #...
gpl-2.0
moijes12/oh-mainline
vendor/packages/requests/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
agpl-3.0
Beeblio/django
django/contrib/gis/tests/test_spatialrefsys.py
2
4677
import unittest from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis, spatialite, HAS_SPATIALREFSYS, SpatialRefSys) from django.utils import six test_srs = ({'srid': 4326, 'auth_name': ('EPSG', True), 'auth_srid': 4326, ...
bsd-3-clause
cyberden/CouchPotatoServer
libs/guessit/country.py
151
3723
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
bsipocz/astropy
astropy/io/fits/tests/test_compression_failures.py
4
5020
# Licensed under a 3-clause BSD style license - see PYFITS.rst import pytest import numpy as np from astropy.io import fits from astropy.io.fits.compression import compress_hdu from . import FitsTestCase MAX_INT = np.iinfo(np.intc).max MAX_LONG = np.iinfo(np.long).max MAX_LONGLONG = np.iinfo(np.longlong).max cla...
bsd-3-clause
vmahuli/tempest
tempest/api/compute/volumes/test_volumes_list.py
4
7445
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
zwChan/VATEC
~/eb-virt/Scripts/activate_this.py
1076
1137
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
apache-2.0
timchenxiaoyu/Diamond
src/collectors/chronyd/chronyd.py
25
2401
# coding=utf-8 """ Collect metrics from chrony - http://chrony.tuxfamily.org/ #### Dependencies * subprocess """ import re import subprocess import diamond.collector import diamond.convertor from diamond.collector import str_to_bool LINE_PATTERN = re.compile( '^(?P<source>\S+).*\s+(?P<offset>[+-]\d+)(?P<unit>...
mit
jodegbami/simulation
dream/simulation/OrderComponent.py
5
4092
# =========================================================================== # Copyright 2013 University of Limerick # # This file is part of DREAM. # # DREAM 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 Founda...
gpl-3.0
stylianos-kampakis/scikit-learn
sklearn/preprocessing/_function_transformer.py
163
2407
from ..base import BaseEstimator, TransformerMixin from ..utils import check_array def _identity(X): """The identity function. """ return X class FunctionTransformer(BaseEstimator, TransformerMixin): """Constructs a transformer from an arbitrary callable. A FunctionTransformer forwards its X (a...
bsd-3-clause
kuiche/chromium
tools/grit/grit/gather/muppet_strings_unittest.py
7
2541
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 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. '''Unit tests for grit.gather.muppet_strings''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join...
bsd-3-clause
jimbydamonk/ansible-modules-core
files/assemble.py
79
8158
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@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 Lice...
gpl-3.0
ondrokrc/gramps
gramps/gui/utilscairo.py
1
2664
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2001-2007 Donald N. Allingham, Martin Hawlisch # Copyright (C) 2009 Douglas S. Blank # Copyright (C) 2012 Benny Malengier # Copyright (C) 2013 Vassilii Khachaturov # # This program is free software; you can redistribute it and/or modify # it under the...
gpl-2.0
azverkan/scons
test/Depends/Depends.py
5
5292
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
mit
robhudson/kuma
vendor/packages/pygments/formatters/terminal.py
76
5401
# -*- coding: utf-8 -*- """ pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Format...
mpl-2.0
JeyZeta/Dangerous
Dangerous/Golismero/thirdparty_libs/nltk/parse/sr.py
12
16390
# Natural Language Toolkit: Shift-Reduce Parser # # Copyright (C) 2001-2012 NLTK Project # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from nltk.grammar import Nonterminal from nltk.tree im...
mit
timpalpant/calibre
src/calibre/gui2/store/stores/libri_de_plugin.py
15
3765
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) store_version = 4 # Needed for dynamic plugin loading __license__ = 'GPL 3' __copyright__ = '2011, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import urllib2 from contextlib im...
gpl-3.0
petrutlucian94/nova_dev
nova/scheduler/weights/ram.py
41
1614
# Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
jithinbp/SEELablet-apps
SEEL_Apps/templates/template_Stream.py
3
5431
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'stream.ui' # # Created: Sat Oct 17 16:53:14 2015 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attribu...
gpl-3.0
luci/luci-py
client/third_party/infra_libs/experiments.py
7
1193
# Copyright 2015 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. """Tools for gradually enabling a feature on a deterministic set of machines. Add a flag to your program to control the percentage of machines that a new fe...
apache-2.0
dancingdan/tensorflow
tensorflow/python/kernel_tests/draw_bounding_box_op_test.py
139
4191
# 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
sk1418/passwdmanager
passwdmanager/upgrade.py
1
8922
# PasswdManager -- Password management tool # Copyright (C) 2009 -- 2013 Kai Yuan <kent.yuan@gmail.com> # # 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
jeremiahyan/odoo
addons/mrp/models/mrp_production.py
1
92112
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import json import datetime import math import re from collections import defaultdict from dateutil.relativedelta import relativedelta from odoo import api, fields, models, _ from odoo.exceptions import AccessError, Us...
gpl-3.0
Jaidan/jaidan-hab-home-assistant
tests/test_util.py
3
8610
""" tests.test_util ~~~~~~~~~~~~~~~~~ Tests Home Assistant util methods. """ # pylint: disable=too-many-public-methods import unittest import time from datetime import datetime, timedelta import homeassistant.util as util class TestUtil(unittest.TestCase): """ Tests util methods. """ def test_sanitize_filen...
mit
elelianghh/sqlalchemy
lib/sqlalchemy/testing/suite/test_select.py
66
9567
from .. import fixtures, config from ..assertions import eq_ from sqlalchemy import util from sqlalchemy import Integer, String, select, func, bindparam, union from sqlalchemy import testing from ..schema import Table, Column class OrderByLabelTest(fixtures.TablesTest): """Test the dialect sends appropriate ORD...
mit
alqfahad/odoo
openerp/report/render/html2html/html2html.py
443
4238
# -*- 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
j00bar/ansible
lib/ansible/modules/utilities/helper/meta.py
27
3847
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, a Red Hat company # # 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, o...
gpl-3.0
thedrow/django-guardian
guardian/utils.py
16
6437
""" django-guardian helper functions. Functions defined within this module should be considered as django-guardian's internal functionality. They are **not** guaranteed to be stable - which means they actual input parameters/output type may change in future releases. """ from __future__ import unicode_literals import ...
bsd-2-clause
monikagrabowska/osf.io
website/addons/github/views.py
14
11024
"""Views for the node settings page.""" # -*- coding: utf-8 -*- from dateutil.parser import parse as dateparse import httplib as http import logging from flask import request, make_response from framework.exceptions import HTTPError from website.addons.base import generic_views from website.addons.github.api import ...
apache-2.0
Zolomon/pos-hidden-markov
noise_channel.py
1
4279
from corpus import Corpus import processing __author__ = 'bengt' import argparse def main(): parser = argparse.ArgumentParser() parser.add_argument('train', help='Path to training corpus.') parser.add_argument('corpus', help='Path to corpus.') parser.add_argument('n', help='Tag sentences shorter than...
mit
oouyang/fxos-certsuite
mcts/web-platform-tests/tests/tools/pywebsocket/src/mod_pywebsocket/common.py
139
10217
# 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
icea-dev/atn-sim-ng
configs/core/home/myservices/cyber_attack.py
1
2197
# # CORE # Copyright (c)2010-2012 the Boeing Company. # See the LICENSE file included in this distribution. # ''' Sample user-defined service. ''' import os from core.service import CoreService, addservice from core.misc.ipaddr import IPv4Prefix, IPv6Prefix class CyberAttack(CoreService): ''' This is a sample u...
gpl-3.0
BizzCloud/PosBox
addons/account_anglo_saxon/__init__.py
436
1090
############################################################################## # # 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 GNU Affero General Publ...
agpl-3.0
jlev/ballistic-missile-range
plot.py
1
68191
#----------------------------------------------------------------------------- # Name: wx.lib.plot.py # Purpose: Line, Bar and Scatter Graphs # # Author: Gordon Williams # # Created: 2003/11/03 # RCS-ID: $Id: plot.py,v 1.13 2005/05/09 19:59:34 RD Exp $ # Copyright: (c) 2002 # Licence: Use...
mit
alajara/servo
components/script/dom/bindings/codegen/parser/tests/test_prototype_ident.py
142
2387
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface TestIface { static attribute boolean prototype; }; """) results = parser.finish() except: threw = True harness.ok(threw, "The identifier of a static attri...
mpl-2.0
alanjw/GreenOpenERP-Win-X86
python/Lib/unittest/test/test_skipping.py
9
4879
import unittest from .support import LoggingResult class Test_TestSkipping(unittest.TestCase): def test_skipping(self): class Foo(unittest.TestCase): def test_skip_me(self): self.skipTest("skip") events = [] result = LoggingResult(events) ...
agpl-3.0
Juniper/neutron
neutron/tests/unit/ml2/test_ml2_plugin.py
3
13799
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
alilotfi/django
django/utils/datetime_safe.py
535
2836
# Python's datetime strftime doesn't handle dates before 1900. # These classes override date and datetime to support the formatting of a date # through its full "proleptic Gregorian" date range. # # Based on code submitted to comp.lang.python by Andrew Dalke # # >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was...
bsd-3-clause
khchine5/lino-welfare
lino_welfare/modlib/pcsw/fixtures/std.py
1
4085
# -*- coding: UTF-8 -*- # Copyright 2011,2013 Luc Saffre # This file is part of Lino Welfare. # # Lino Welfare 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 y...
agpl-3.0
Dandandan/wikiprogramming
jsrepl/build/extern/python/closured/lib/python2.7/mhlib.py
290
33434
"""MH interface -- purely object-oriented (well, almost) Executive summary: import mhlib mh = mhlib.MH() # use default mailbox directory and profile mh = mhlib.MH(mailbox) # override mailbox location (default from profile) mh = mhlib.MH(mailbox, profile) # override mailbox and profile mh.error(format, ...)...
mit
roessland/PRST
prst/utils/__init__.py
1
22249
# -*- coding: utf-8 -*- from __future__ import print_function, division import copy __all__ = ["rldecode", "rlencode", "units", "mcolon", "recursive_diff", "gridtools"] import prst.utils.gridtools import numpy as np import scipy.sparse from scipy.sparse import csr_matrix import scipy.sparse as sps class Struct(dict...
gpl-3.0
ntddk/pemu
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
waltharius/NewsBlur
vendor/feedvalidator/content.py
16
6021
"""$Id: content.py 699 2006-09-25 02:01:18Z rubys $""" __author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>" __version__ = "$Revision: 699 $" __date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $" __copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim" from ...
mit
datacommonsorg/data
scripts/us_bea/states_gdp/validate_import.py
1
3576
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
quanvm009/codev7
openerp/addons/portal_hr_employees/hr_employee.py
53
2381
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
bev-a-tron/pledge_service
build/requests/adapters.py
293
14608
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib3.response impo...
apache-2.0
miloszz/DIRAC
RequestManagementSystem/Service/ReqProxyHandler.py
7
7200
######################################################################## # $HeadURL$ # File: ReqProxyHandler.py # Author: Krzysztof.Ciba@NOSPAMgmail.com # Date: 2013/06/04 13:18:41 ######################################################################## """ :mod: RequestProxyHandler .. module: ReqtProxyHandler :syn...
gpl-3.0
rockneurotiko/django
tests/template_tests/templatetags/custom.py
152
5394
import operator import warnings from django import template from django.template.defaultfilters import stringfilter from django.utils import six from django.utils.html import escape, format_html register = template.Library() @register.filter @stringfilter def trim(value, num): return value[:num] @register.fil...
bsd-3-clause
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/tools/perf/page_sets/profile_safe_urls.py
34
1181
# Copyright 2015 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. from profile_creators import profile_safe_url_list from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry ...
mit
chewable/django
tests/regressiontests/decorators/tests.py
16
2356
from unittest import TestCase from sys import version_info from django.http import HttpResponse from django.utils.functional import allow_lazy, lazy, memoize from django.views.decorators.http import require_http_methods, require_GET, require_POST from django.views.decorators.vary import vary_on_headers, vary_on_cookie...
bsd-3-clause
10clouds/edx-platform
lms/djangoapps/discussion_api/permissions.py
61
3031
""" Discussion API permission logic """ from lms.lib.comment_client.comment import Comment from lms.lib.comment_client.thread import Thread def _is_author(cc_content, context): """ Return True if the requester authored the given content, False otherwise """ return context["cc_requester"]["id"] == cc_c...
agpl-3.0
jktunney/codeship
lib/werkzeug/local.py
310
14094
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from functools import update_wrapper from werkzeug.wsgi import ClosingIt...
apache-2.0
MapofLife/MOL
earthengine/google-api-python-client/oauth2/clients/imap.py
885
1685
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
bsd-3-clause
mlperf/training_results_v0.5
v0.5.0/google/cloud_v2.8/ssd-tpuv2-8/code/ssd/model/tpu/models/official/retinanet/object_detection/faster_rcnn_box_coder.py
22
3827
# 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
Tranzystorek/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_assertrewrite.py
171
23567
import os import stat import sys import zipfile import py import pytest ast = pytest.importorskip("ast") if sys.platform.startswith("java"): # XXX should be xfail pytest.skip("assert rewrite does currently not work on jython") import _pytest._code from _pytest.assertion import util from _pytest.assertion.rewr...
mpl-2.0
guerrerocarlos/odoo
addons/sale_service/__init__.py
354
1060
# -*- 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
dkubiak789/OpenUpgrade
addons/website_forum_doc/__openerp__.py
63
1533
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
edfall/vnpy
vn.datayes/storage.py
29
18623
import os import json import pymongo import pandas as pd from datetime import datetime, timedelta from api import Config, PyApi from api import BaseDataContainer, History, Bar from errors import (VNPAST_ConfigError, VNPAST_RequestError, VNPAST_DataConstructorError, VNPAST_DatabaseError) class DBConfig(Co...
mit
kongseokhwan/kulcloud-iitp-neutron
neutron/db/migration/alembic_migrations/other_plugins_init_ops.py
15
3235
# Copyright 2014 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 ...
apache-2.0
scrapinghub/dateparser
tests/test_data.py
1
18146
from itertools import chain import regex as re from parameterized import parameterized from dateparser.languages import default_loader from dateparser.data import language_locale_dict from tests import BaseTestCase DEFAULT_MONTH_PATTERN = re.compile(r'^M?\d+$', re.U) INVALID_AM_PM_PATTERN = re.compile(r'^[AaPp]\.?\s+...
bsd-3-clause