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
damdam-s/partner-contact
portal_partner_merge/__openerp__.py
15
1376
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
mgraupe/acq4
acq4/devices/DAQGeneric/DOChannelTemplate.py
3
5756
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'DOChannelTemplate.ui' # # Created: Sun Feb 22 13:29:09 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 exc...
mit
azureplus/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/admindocs/tests/test_fields.py
111
1192
from __future__ import absolute_import, unicode_literals from django.contrib.admindocs import views from django.db import models from django.db.models import fields from django.utils import unittest from django.utils.translation import ugettext as _ class CustomField(models.Field): description = "A custom field ...
apache-2.0
todaychi/hue
desktop/core/ext-py/Django-1.6.10/django/utils/translation/trans_null.py
119
1990
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_text from django.ut...
apache-2.0
NixaSoftware/CVis
venv/lib/python2.7/site-packages/setuptools/monkey.py
39
5789
""" Monkey patching of distutils. """ import sys import distutils.filelist import platform import types import functools from importlib import import_module import inspect from setuptools.extern import six import setuptools __all__ = [] """ Everything is private. Contact the project team if you think you need this ...
apache-2.0
imsplitbit/nova
nova/tests/integrated/api_samples_test_base.py
10
13015
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
apache-2.0
melviso/phycpp
beatle/activity/models/ui/pane/PyModulePane.py
2
12276
# -*- coding: utf-8 -*- """Subclass of PyModulePane, which is generated by wxFormBuilder.""" #import wx import wx.stc from beatle import tran, localpath from beatle.ctx import THE_CONTEXT as context from beatle.app.ui import pane, dlg from beatle.lib.handlers import Identifiers from beatle.activity.models.ui import ...
gpl-2.0
hyperized/ansible
lib/ansible/module_utils/docker/common.py
13
41043
# # Copyright 2016 Red Hat | Ansible # # 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
fayf/pyload
module/plugins/hoster/MegaCoNz.py
14
8273
# -*- coding: utf-8 -*- import array import os # import pycurl import random import re from base64 import standard_b64decode from Crypto.Cipher import AES from Crypto.Util import Counter from module.common.json_layer import json_loads, json_dumps from module.plugins.internal.Hoster import Hoster from module.utils i...
gpl-3.0
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/archiveuploader/tests/test_nascentupload.py
1
5083
# Copyright 2010-2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Test NascentUpload functionality.""" __metaclass__ = type from testtools import TestCase from testtools.matchers import MatchesStructure from lp.archiveuploader.changesf...
agpl-3.0
iambibhas/django
tests/admin_custom_urls/tests.py
6
5517
from __future__ import unicode_literals from django.contrib.admin.utils import quote from django.core.urlresolvers import reverse from django.template.response import TemplateResponse from django.test import TestCase, override_settings from .models import Action, Person, Car @override_settings(PASSWORD_HASHERS=('dj...
bsd-3-clause
primiano/blink-gitcs
Source/bindings/scripts/compute_interfaces_info_individual.py
5
13781
#!/usr/bin/python # # Copyright (C) 2013 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...
bsd-3-clause
pwong-mapr/private-hue
desktop/core/ext-py/elementtree/setup.py
45
1306
#!/usr/bin/env python # # Setup script for the elementtree library # $Id: setup.py 2326 2005-03-17 07:45:21Z fredrik $ # # Usage: python setup.py install # from distutils.core import setup try: # add download_url syntax to distutils from distutils.dist import DistributionMetadata DistributionMetadata.clas...
apache-2.0
savoirfairelinux/OpenUpgrade
addons/website_mail/models/mail_message.py
27
4601
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-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
DURAARK/duraark-pointcloud-viewer
lastools/ArcGIS_toolbox/scripts_production/lasboundaryPro.py
1
5636
# # lasboundaryPro.py # # (c) 2013, martin isenburg - http://rapidlasso.com # rapidlasso GmbH - fast tools to catch reality # # uses lasboundary.exe to compute a boundary polygon for the # points. This is a concave hull of the points with a "concavity" # defined by the user that is 50 m (or 150 ft) by default. It i...
mit
zhhf/charging
charging/tests/unit/ml2/drivers/brocade/test_brocade_mechanism_driver.py
5
2414
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 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 # # Unl...
apache-2.0
letuananh/beautifulsoup
bs4-python3/tests/test_lxml.py
16
2962
"""Tests to ensure that the lxml tree builder generates good trees.""" import re import warnings try: import lxml.etree LXML_PRESENT = True LXML_VERSION = lxml.etree.LXML_VERSION except ImportError as e: LXML_PRESENT = False LXML_VERSION = (0,) if LXML_PRESENT: from bs4.builder import LXMLTre...
mit
yongtang/tensorflow
tensorflow/python/kernel_tests/linalg/linear_operator_block_lower_triangular_test.py
14
12091
# Copyright 2020 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
anand-c-goog/tensorflow
tensorflow/python/kernel_tests/array_ops_test.py
3
33485
# 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
CKehl/pylearn2
pylearn2/sampling/remove_samples.py
1
6030
''' Created on Apr 16, 2015 @author: christian ''' from optparse import OptionParser import numpy import os from os import listdir from os.path import isfile, join import cPickle import glob def unpickle(file): fo = open(file, 'rb') dictionary = cPickle.load(fo) fo.close() return dictionary if __na...
bsd-3-clause
jjscarafia/odoo
openerp/tools/mail.py
1
29387
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2012-TODAY OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
hsbhathiya/stratos
components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/gen/ThriftSecureEventTransmissionService/ThriftSecureEventTransmissionService.py
17
47704
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
newswangerd/ansible
lib/ansible/plugins/loader.py
8
55324
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com> # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> and others # (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import ...
gpl-3.0
hguochen/mediapop
mediapop/mediapop/settings/local.py
58
1632
"""Development settings and globals.""" from __future__ import absolute_import from os.path import join, normpath from .base import * ########## DEBUG CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-deb...
mit
lewisc/spark-tk
regression-tests/generatedata/movie_user_5ratings.py
14
1717
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel 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 require...
apache-2.0
wazeerzulfikar/scikit-learn
examples/model_selection/plot_grid_search_digits.py
56
2761
""" ============================================================ Parameter estimation using grid search with cross-validation ============================================================ This examples shows how a classifier is optimized by cross-validation, which is done using the :class:`sklearn.model_selection.GridS...
bsd-3-clause
sudarkoff/ansible
contrib/inventory/proxmox.py
74
5579
#!/usr/bin/env python # Copyright (C) 2014 Mathieu GAUTHIER-LAFAYE <gauthierl@lapth.cnrs.fr> # # 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 op...
gpl-3.0
myangeline/pygame
flightgame/plane.py
1
1930
# _*_ coding:utf-8 _*_ import random import pygame __author__ = 'Administrator' class Plane(): def __init__(self, width, height, value, image, type): self.width = width self.height = height self.value = value self.image = image self.type = type self.rect = pygame.R...
apache-2.0
ethguo/xpify
legacy/main - LEGACY (S).py
1
34036
#!/usr/bin/env python ### # XPify - An application to gamify learning. # Version: DEV # Timestamp: NULL # # Written by Ethan Guo # Using Google App Engine and the webapp2 framework # ### ### IMPORTS ### import time import uuid import cgi import webapp2 from google.appengine.ext.webapp import util from google.app...
gpl-3.0
toshywoshy/ansible
lib/ansible/modules/network/ios/ios_system.py
18
12129
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
shail2810/nova
nova/servicegroup/drivers/zk.py
49
8221
# Copyright (c) AT&T 2012-2013 Yun Mao <yunmao@gmail.com> # Copyright 2012 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 # # Unle...
apache-2.0
arangodb/arangodb
3rdParty/V8/gypfiles/broken/verify_source_deps.py
2
4450
#!/usr/bin/env python # Copyright 2015 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Script to print potentially missing source dependencies based on the actual .h and .cc files in the source tree and which files a...
apache-2.0
golismero/golismero
plugins/testing/recon/punkspider.py
5
5708
#!/usr/bin/env python # -*- coding: utf-8 -*- __license__ = """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it and/or modify it under the terms of...
gpl-2.0
fxtentacle/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/outputtee_unittest.py
124
1987
# Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com> # # 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 t...
bsd-3-clause
thiriel/maps
venv/lib/python2.7/site-packages/django/contrib/localflavor/fi/fi_municipalities.py
394
10822
# -*- coding: utf-8 -*- """ An alphabetical list of Finnish municipalities for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ MUNICIPALITY_CHOICES = ( ('akaa', u"Akaa"), ('alajarvi', u"Alajärvi"), ('alavieska', u"Alav...
bsd-3-clause
adamkh/kivy
kivy/config.py
2
30423
''' Configuration object ==================== The :class:`Config` object is an instance of a modified Python ConfigParser. See the `ConfigParser documentation <http://docs.python.org/library/configparser.html>`_ for more information. Kivy has a configuration file which determines the default settings. In order to cha...
mit
liucode/tempest-master
tempest/scenario/test_server_basic_ops.py
1
6234
# 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
jcoliver/OSUScratchpads
sites/all/libraries/mediaelement/src/Builder.py
14
4203
import sys import os import shutil me_filename = 'mediaelement' mep_filename = 'mediaelementplayer' combined_filename = 'mediaelement-and-player' # BUILD MediaElement (single file) print('building MediaElement.js') me_files = [] me_files.append('me-header.js') me_files.append('me-namespace.js') me_file...
gpl-2.0
Anonymous-X6/django
tests/mail/test_sendtestemail.py
327
3088
from __future__ import unicode_literals from django.core import mail from django.core.management import call_command from django.test import SimpleTestCase, override_settings @override_settings( ADMINS=(('Admin', 'admin@example.com'), ('Admin and Manager', 'admin_and_manager@example.com')), MANAGERS=(('Manag...
bsd-3-clause
liusen09003110-163-com/linux
tools/perf/scripts/python/syscall-counts.py
1996
1700
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
MarekSuchanek/repocribro
repocribro/controllers/webhooks.py
1
1567
import flask from ..models import Repository webhooks = flask.Blueprint('webhooks', __name__, url_prefix='/webhook/github') @webhooks.route('', methods=['POST']) def gh_webhook(): """Point for GitHub webhook msgs (POST handler)""" db = flask.current_app.container.get('db') ext_master = flask.current_app...
mit
GdZ/scriptfile
software/googleAppEngine/lib/django_1_4/tests/modeltests/custom_pk/tests.py
34
5733
# -*- coding: utf-8 -*- from __future__ import absolute_import from django.db import transaction, IntegrityError from django.test import TestCase, skipIfDBFeature from .models import Employee, Business, Bar, Foo class CustomPKTests(TestCase): def test_custom_pk(self): dan = Employee.objects.create( ...
mit
ChromiumWebApps/chromium
third_party/closure_linter/closure_linter/not_strict_test.py
142
2332
#!/usr/bin/env python # # Copyright 2011 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
idrogeno/enigma2
lib/python/Components/Converter/ClockToText.py
30
3734
from Converter import Converter from time import localtime, strftime from Components.Element import cached class ClockToText(Converter, object): DEFAULT = 0 WITH_SECONDS = 1 IN_MINUTES = 2 DATE = 3 FORMAT = 4 AS_LENGTH = 5 TIMESTAMP = 6 FULL = 7 SHORT_DATE = 8 LONG_DATE = 9 VFD = 10 AS_LENGTHHOURS = 11 AS...
gpl-2.0
mrknow/filmkodi
plugin.video.fanfilm/resources/lib/libraries/cachemeta.py
2
2532
# -*- coding: utf-8 -*- ''' FanFilm Add-on Copyright (C) 2015 lambda 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 ...
apache-2.0
xiaoyaozi5566/DynamicCache
src/arch/x86/isa/insts/general_purpose/flags/load_and_store.py
91
2246
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
AccelAI/accel.ai
flask-aws/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py
354
3406
"""A collection of modules for building different kinds of tree from HTML documents. To create a treebuilder for a new type of tree, you need to do implement several things: 1) A set of classes for various types of elements: Document, Doctype, Comment, Element. These must implement the interface of _base.treebuilders...
mit
Eric-Gaudiello/tensorflow_dev
tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py
252
106466
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
gpl-3.0
khosrow/metpx
sundew/unittests/unittest_Ingestor.py
1
2061
# -*- coding: iso-8859-1 -*- ############################################################################################# # Name: unittest_Ingestor.py # Author: Jun Hu # Date: 2012-04-30 # Description: test cases for Ingestor class ######################################################################################...
gpl-2.0
Zekom/fofix
src/Scene.py
4
3747
##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire X (FoFiX) # # Copyright (C) 2006 Sami Kyöstilä ...
gpl-2.0
xiandiancloud/ji
common/test/acceptance/pages/lms/courseware.py
6
1321
""" Courseware page. """ from .course_page import CoursePage class CoursewarePage(CoursePage): """ Course info. """ url_path = "courseware/" xblock_component_selector = '.vert .xblock' def is_browser_on_page(self): return self.q(css='body.courseware').present @property def ...
agpl-3.0
invisiblek/python-for-android
python3-alpha/extra_modules/gdata/dublincore/data.py
126
2106
#!/usr/bin/python # # Copyright (C) 2009 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 ...
apache-2.0
rafaeltomesouza/frontend-class1
aula2/a11/linkedin/client/.gradle/nodejs/node-v7.5.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
1789
10585
# Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
mit
Work4Labs/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/delete_regress/models.py
28
1583
from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType class Award(models.Model): name = models.CharField(max_length=25) object_id = models.PositiveIntegerField() content_type = models.ForeignKey(ContentType) content_obje...
gpl-3.0
agaffney/ansible
test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/main.py
6
106436
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Matt Martz <matt@sivel.net> # Copyright (C) 2015 Rackspace US, Inc. # # 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 ...
gpl-3.0
googleapis/python-texttospeech
samples/snippets/audio_profile_test.py
1
1085
# Copyright 2018, 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, s...
apache-2.0
tcheehow/MissionPlanner
Lib/httplib.py
50
49485
"""HTTP/1.1 client library <intro stuff goes here> <other stuff, too> HTTPConnection goes through a number of "states", which define when a client may legally make another request or fetch the response for a particular request. This diagram details these state transitions: (null) | | HTTPC...
gpl-3.0
timvdm/Helium
test/python/bitvec.py
2
2947
import helium import unittest class TestBitvec(unittest.TestCase): def test_Fingerprint(self): fp = helium.Fingerprint(8) self.assertEqual(8, fp.numWords) fp = helium.Fingerprint(1) self.assertEqual('0000000000000000', fp.hex()) self.assertEqual('0000000000000000 000000000...
bsd-3-clause
Alt90/Student_progress_bar
progress_bar/settings.py
1
3133
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep th...
mit
shishengjia/OnlineCourses
apps/organisation/adminx.py
1
1321
# -*- encoding: utf-8 -*- from .models import CityDict, CourseOrg, Teacher import xadmin _author_ = 'shishengjia' _date_ = '05/01/2017 13:36' class CityDictAdmin(object): list_display = ['name', 'desc', 'add_time'] search_fields = ['name', 'desc'] list_filter = ['name', 'desc', 'add_time'] class Cour...
apache-2.0
SpaceKatt/CSPLN
apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/gluon/contrib/redis_session.py
11
9611
""" Developed by niphlod@gmail.com """ import redis from gluon import current from gluon.storage import Storage import time import logging import thread logger = logging.getLogger("web2py.session.redis") locker = thread.allocate_lock() def RedisSession(*args, **vars): """ Usage example: put in models f...
gpl-3.0
rlugojr/kubernetes
hack/update_owners.py
94
7705
#!/usr/bin/env python # Copyright 2016 The Kubernetes Authors. # # 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 appli...
apache-2.0
nicolaspanel/djangularjs
server/settings/base.py
1
3798
""" Django settings for server project. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ NOTE: __generator-djangularjs__ may automatically modified this file. """ # Bu...
mit
dhimmel/networkx
networkx/algorithms/bipartite/tests/test_project.py
31
13836
#!/usr/bin/env python from nose.tools import assert_equal import networkx as nx from networkx.algorithms import bipartite from networkx.testing import assert_edges_equal, assert_nodes_equal class TestBipartiteProject: def test_path_projected_graph(self): G=nx.path_graph(4) P=bipartite.projected_gr...
bsd-3-clause
ol-loginov/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/tests/geometries.py
90
33343
import re wkt_regex = re.compile(r'^(?P<type>[A-Z]+) ?\(') class TestGeom: "The Test Geometry class container." def __init__(self, wkt, **kwargs): self.wkt = wkt self.bad = kwargs.pop('bad', False) if not self.bad: m = wkt_regex.match(wkt) if not m: ...
apache-2.0
fx19880617/helix
contributors/py-helix-admin/helix/zkfunctions.py
7
22919
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
rlucio/cinder-violin-driver-icehouse
cinder/volume/drivers/violin/vxg/vshare/snapshot.py
1
23168
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Violin Memory, 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 # # ...
apache-2.0
huggingface/pytorch-transformers
src/transformers/models/squeezebert/modeling_squeezebert.py
1
44192
# coding=utf-8 # Copyright 2020 The SqueezeBert authors and The HuggingFace Inc. team. # # 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 # # U...
apache-2.0
tklaus/ansible
lib/ansible/playbook/included_file.py
34
5081
# (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
CatMe0w/shadowsocks
shadowsocks/obfsplugin/http_simple.py
11
13800
#!/usr/bin/env python # # Copyright 2015-2015 breakwa11 # # 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 la...
apache-2.0
40223225/2015-cdb_g3-40223225
static/Brython3.1.1-20150328-091302/Lib/xml/dom/domreg.py
841
3402
"""Registration facilities for DOM. This module should not be used directly. Instead, the functions getDOMImplementation and registerDOMImplementation should be imported from xml.dom.""" # This is a list of well-known implementations. Well-known names # should be published by posting to xml-sig@python.org, and are # ...
gpl-3.0
DirtyUnicorns/android_external_chromium-org
third_party/protobuf/python/google/protobuf/service.py
590
9131
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
Zanzibar82/streamondemand.test
channels/channels_sports/main.py
1
5373
# -*- coding: utf-8 -*- #------------------------------------------------------------ # streamondemand - XBMC Plugin # Canal para sports-main # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys from cor...
gpl-3.0
keflavich/TurbuStat
turbustat/statistics/wavelets/wavelet_transform.py
1
13165
# Licensed under an MIT open source license - see LICENSE import numpy as np import warnings from astropy.convolution import convolve_fft, MexicanHat2DKernel import statsmodels.formula.api as sm from pandas import Series, DataFrame try: from scipy.fftpack import fftn, ifftn, fftfreq except ImportError: from ...
mit
andyxhadji/incubator-airflow
airflow/hooks/pig_hook.py
13
3181
# -*- 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
fhe-odoo/odoo
addons/project_issue_sheet/project_issue_sheet.py
381
2875
#-*- 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
KyoungRan/Django_React_ex
Django_React_Workshop-mbrochh/django/myvenv/lib/python3.4/site-packages/pyasn1/codec/der/encoder.py
160
1139
# DER encoder from pyasn1.type import univ from pyasn1.codec.cer import encoder from pyasn1 import error class SetOfEncoder(encoder.SetOfEncoder): def _cmpSetComponents(self, c1, c2): tagSet1 = isinstance(c1, univ.Choice) and \ c1.getEffectiveTagSet() or c1.getTagSet() tagSet2 = i...
mit
GalaxyTab4/android_kernel_motorola_msm8226
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
Yelp/fullerite
src/diamond/collectors/userscripts/userscripts.py
51
3524
# coding=utf-8 """ Runs third party scripts and collects their output. Scripts need to be +x and should output metrics in the form of ``` metric.path.a 1 metric.path.b 2 metric.path.c 3 ``` They are not passed any arguments and if they return an error code, no metrics are collected. #### Dependencies * [subproce...
apache-2.0
ampax/edx-platform-backup
common/djangoapps/student/migrations/0004_add_email_index.py
188
7971
# encoding: 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): db.execute("create unique index email on auth_user (email)") pass def backwards(self, orm): db.execut...
agpl-3.0
nirmeshk/oh-mainline
vendor/packages/irc/irc/functools.py
22
1030
from __future__ import absolute_import, print_function, unicode_literals import functools import collections def save_method_args(method): """ Wrap a method such that when it is called, we save the args and kwargs with which it was called. >>> class MyClass(object): ... @save_method_args ...
agpl-3.0
hnarayanan/django-rest-framework
tests/test_viewsets.py
5
1240
from django.test import TestCase from rest_framework import status from rest_framework.response import Response from rest_framework.test import APIRequestFactory from rest_framework.viewsets import GenericViewSet factory = APIRequestFactory() class BasicViewSet(GenericViewSet): def list(self, request, *args, **...
bsd-2-clause
40223136/w17test1
static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_suite.py
791
12066
import unittest import sys from .support import LoggingResult, TestEquality ### Support code for Test_TestSuite ################################################################ class Test(object): class Foo(unittest.TestCase): def test_1(self): pass def test_2(self): pass def test_3(self...
gpl-3.0
Obus/scikit-learn
sklearn/tests/test_learning_curve.py
225
10791
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import warnings from sklearn.base import BaseEstimator from sklearn.learning_curve import learning_curve, validation_curve from sklearn.u...
bsd-3-clause
JonathanStein/odoo
addons/account/tests/test_account_move_closed_period.py
127
1623
from datetime import date from openerp.tests.common import TransactionCase from openerp.osv.orm import except_orm class TestPeriodState(TransactionCase): """ Forbid creation of Journal Entries for a closed period. """ def setUp(self): super(TestPeriodState, self).setUp() cr, uid = sel...
agpl-3.0
geeknoid/api
python/istio_api/networking/v1alpha3/gateway_pb2.py
1
19574
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: networking/v1alpha3/gateway.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from...
apache-2.0
RichardLitt/wyrd-django-dev
django/contrib/localflavor/mx/mx_states.py
110
1304
# -*- coding: utf-8 -*- """ A list of Mexican states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ # All 31 states, plus the `D...
bsd-3-clause
Benolds/kachMIT-myo-2015
myo/utils/__init__.py
9
1097
# Copyright (c) 2015 Niklas Rosenstein # # 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
ghandiosm/Test
addons/account/tests/account_test_users.py
46
1657
from openerp.addons.account.tests.account_test_classes import AccountingTestCase class AccountTestUsers(AccountingTestCase): """Tests for diffrent type of user 'Accountant/Adviser' and added groups""" def setUp(self): super(AccountTestUsers, self).setUp() self.res_user_model = self.env['res....
gpl-3.0
darionyaphet/spark
python/pyspark/sql/tests/test_conf.py
21
2361
# # 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
spring-week-topos/cinder-week
cinder/tests/api/extensions/foxinsocks.py
12
2929
# Copyright 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 requ...
apache-2.0
robinro/ansible
lib/ansible/plugins/lookup/first_found.py
18
6606
# (c) 2013, seth vidal <skvidal@fedoraproject.org> red hat, inc # # 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 optio...
gpl-3.0
Axiologue/DjangoRestMultipleModels
drf_multiple_model/mixins.py
1
12380
import warnings from django.core.exceptions import ValidationError from django.db.models.query import QuerySet from rest_framework.response import Response class BaseMultipleModelMixin(object): """ Base class that holds functions need for all MultipleModelMixins/Views """ querylist = None # Keys...
mit
knossos-project/PythonQt
examples/NicePyConsole/pygments/formatters/svg.py
76
5840
# -*- coding: utf-8 -*- """ pygments.formatters.svg ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for SVG output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_bool_opt, get...
lgpl-2.1
ansible/ansible
test/units/executor/test_task_queue_manager_callbacks.py
68
4502
# (c) 2016, Steve Kuznetsov <skuznets@redhat.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 later v...
gpl-3.0
agermanidis/autosub
setup.py
1
1496
#!/usr/bin/env python from __future__ import unicode_literals try: from setuptools import setup except ImportError: from distutils.core import setup long_description = ( 'Autosub is a utility for automatic speech recognition and subtitle generation. ' 'It takes a video or an audio file as input, perfo...
mit
deepakselvaraj/federated-horizon
openstack_dashboard/dashboards/project/overview/views.py
2
2120
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
rapilabs/django
tests/template_tests/templatetags/custom.py
161
5408
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
bristy/login_app_flask
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py
304
4273
from collections import namedtuple from ..exceptions import LocationParseError class Url(namedtuple('Url', ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'])): """ Datastructure for representing an HTTP URL. Used as a return value for :func:`parse_url`. """ slots = () def __new...
mit
aifil/odoo
addons/event/models/event_mail.py
33
5792
# -*- coding: utf-8 -*- from datetime import datetime from dateutil.relativedelta import relativedelta from openerp import api, fields, models, tools _INTERVALS = { 'hours': lambda interval: relativedelta(hours=interval), 'days': lambda interval: relativedelta(days=interval), 'weeks': lambda interval: r...
gpl-3.0