repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
SnakeJenny/TensorFlow
tensorflow/python/training/device_setter_test.py
14
5488
# 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
oisinmulvihill/nozama-cloudsearch
nozama/cloudsearch/data/db.py
1
4468
# -*- coding: utf-8 -*- """ """ import logging from urllib.parse import urljoin from pymongo import MongoClient from elasticsearch import Elasticsearch class DB(object): """An lightwrapper around a mongodb connection. The init is given the configuration dict:: dict( db_name='<name>', #...
bsd-3-clause
openfun/edx-platform
openedx/core/djangoapps/course_groups/migrations/0003_auto__add_coursecohort__add_coursecohortssettings.py
100
7464
# -*- 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 'CourseCohort' db.create_table('course_groups_coursecohort', ( ('id', self.gf('dj...
agpl-3.0
mcking49/apache-flask
Python/Lib/site-packages/pylint/test/functional/abstract_class_instantiated_py3.py
11
2470
"""Check that instantiating a class with `abc.ABCMeta` as metaclass fails if it defines abstract methods. """ # pylint: disable=too-few-public-methods, missing-docstring # pylint: disable=abstract-method, import-error import abc import weakref from lala import Bala class GoodClass(object, metaclass=abc.ABCMeta): ...
mit
j0nathan33/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/mechanize/_sgmllib_copy.py
134
18248
# Taken from Python 2.6.4 and regexp module constants modified """A parser for SGML, using the derived class as a static DTD.""" # XXX This only supports those SGML features used by HTML. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable charac...
gpl-3.0
normalnorway/normal.no
django/apps/erp/admin.py
1
2298
from django.contrib import admin from .models import Contact, ContactTag from .models import Task, SubTask, Reminder, ReminderType, Note #admin.site.register (Task) @admin.register (Note) class NoteAdmin (admin.ModelAdmin): list_display = 'title', 'owner' list_filter = 'owner', search_fields = 'title', '...
gpl-3.0
baklanovp/pystella
pystella/model/stella.py
1
5782
import os from pystella.rf.reddening import ReddeningLaw, LawFitz __author__ = 'bakl' stella_extensions = ('tt', 'swd', 'lbol', 'res', 'dat', 'ph', "mrt", 'eve', 'rho', 'xni', 'flx') class Stella: def __init__(self, name, path='./', info=False): """Creates a Stella model instance. Required parameters:...
mit
tecwebjoao/TecWeb-TF-2T-B-SI
venv/Lib/site-packages/django/contrib/auth/backends.py
51
6724
from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission UserModel = get_user_model() class ModelBackend(object): """ Authenticates against settings.AUTH_USER_MODEL. """ def authenticate(self, request, username=None, pa...
apache-2.0
alesdotio/motorway
motorway/mixins.py
1
6502
import datetime import itertools import random import socket import uuid import zmq import time from motorway.exceptions import SocketBlockedException from motorway.grouping import HashRingGrouper, RandomGrouper, GroupingValueMissing, SendToAllGrouper from motorway.messages import Message from motorway.utils import ...
apache-2.0
pec1985/titanium_mobile
drillbit/sdk_tests/unittest2/test/test_runner.py
122
4644
import pickle from cStringIO import StringIO from unittest2.test.support import LoggingResult, OldTestResult import unittest2 class Test_TextTestRunner(unittest2.TestCase): """Tests for TextTestRunner.""" def test_init(self): runner = unittest2.TextTestRunner() self.assertFalse(runner.failf...
apache-2.0
OpringaoDoTurno/airflow
airflow/migrations/versions/211e584da130_add_ti_state_index.py
60
1037
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
jiangzhonghui/viewfinder
backend/db/operation.py
13
13363
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """Viewfinder operation. Operations are write-ahead logs for functions which comprise multiple steps. If server failure or transient exceptions would otherwise leave the database in a partial state, creating an operation to encapsulate the execution will guarantee...
apache-2.0
ekwoodrich/nirha
nirhalib/venv/lib/python2.7/site-packages/serial/tools/miniterm.py
11
32322
#!/usr/bin/env python # # Very simple serial terminal # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C)2002-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import codecs import os import sys import threading import serial from serial.tools.list_ports impo...
apache-2.0
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/test/test_univnewlines.py
130
3922
# Tests universal newline support for both reading and parsing files. import io import _pyio as pyio import unittest import os import sys from test import support if not hasattr(sys.stdin, 'newlines'): raise unittest.SkipTest( "This Python does not have universal newline support") FATX = 'x' * (2**14) DA...
apache-2.0
Novasoft-India/OperERP-AM-Motors
openerp/addons/procurement/__init__.py
72
1112
# -*- 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
caisq/tensorflow
tensorflow/python/kernel_tests/nth_element_op_test.py
20
6683
# 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
ArcherSys/ArcherSys
Lib/site-packages/nbformat/v4/tests/test_convert.py
3
1871
# -*- coding: utf-8 -*- import copy import nose.tools as nt from nbformat import validate from .. import convert from . import nbexamples from nbformat.v3.tests import nbexamples as v3examples from nbformat import v3, v4 def test_upgrade_notebook(): nb03 = copy.deepcopy(v3examples.nb0) validate(nb03) nb...
mit
jwomeara/mapnik
scons/scons-local-2.3.4/SCons/Tool/gdc.py
8
4730
"""SCons.Tool.gdc Tool-specific initialization for the GDC compiler. (https://github.com/D-Programming-GDC/GDC) Developed by Russel Winder (russel@winder.org.uk) 2012-05-09 onwards Compiler variables: DC - The name of the D compiler to use. Defaults to gdc. DPATH - List of paths to search for import modules...
lgpl-2.1
hugs/django
tests/regressiontests/forms/localflavor/au.py
25
3528
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ AU form fields. tests = r""" ## AUPostCodeField ########################################################## A field that accepts a four digit Australian post code. >>> from django.contrib.localflavor.au.forms import AUPostCodeField >>> f = AUPostCodeField()...
bsd-3-clause
yida-lxw/solr-5.2.0
dev-tools/scripts/smokeTestRelease.py
2
61014
# 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
thaim/ansible
test/units/modules/storage/netapp/test_na_ontap_net_routes.py
38
11658
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit test template for ONTAP Ansible module ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch, Mock from ans...
mit
yakovenkodenis/rethinkdb
external/v8_3.30.33.16/build/gyp/test/win/gyptest-cl-debug-format.py
344
1270
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure debug format settings are extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.Te...
agpl-3.0
jocelynmass/nrf51
toolchain/arm_cm0_deprecated/arm-none-eabi/lib/armv7e-m/fpu/libstdc++.a-gdb.py
1
2614
# -*- python -*- # Copyright (C) 2009-2015 Free Software Foundation, 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 the License, or # (at your option) any later versio...
gpl-2.0
Linutronix/elbe
elbepack/validate.py
1
3480
# ELBE - Debian Based Embedded Rootfilesystem Builder # Copyright (c) 2014-2015 Torben Hohn <torbenh@linutronix.de> # Copyright (c) 2017 Benedikt Spranger <b.spranger@linutronix.de> # Copyright (c) 2017 Manuel Traut <manut@linutronix.de> # # SPDX-License-Identifier: GPL-3.0-or-later import os import sys from lxml imp...
gpl-3.0
surkovalex/linux
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
40223108/w18
static/Brython3.1.3-20150514-095342/Lib/unittest/test/testmock/testmock.py
737
40047
import copy import sys import unittest from unittest.test.testmock.support import is_instance from unittest import mock from unittest.mock import ( call, DEFAULT, patch, sentinel, MagicMock, Mock, NonCallableMock, NonCallableMagicMock, _CallList, create_autospec ) class Iter(object): def __init__...
gpl-3.0
JianfengXu/crosswalk-test-suite
webapi/tct-download-tizen-tests/inst.wgt.py
372
6809
#!/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
MarvinCorro/linux-cmps107
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
hendradarwin/VTK
ThirdParty/Twisted/twisted/conch/test/test_checkers.py
27
22085
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.checkers}. """ try: import crypt except ImportError: cryptSkip = 'cannot run without crypt module' else: cryptSkip = None import os, base64 from twisted.python import util from twisted.python.failure im...
bsd-3-clause
wangxiangyu/horizon
openstack_dashboard/dashboards/project/routers/forms.py
51
7602
# Copyright 2012, Nachi Ueno, NTT MCL, 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...
apache-2.0
guewen/odoo
openerp/service/security.py
43
1483
# -*- 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
JBonsink/GSOC-2013
tools/ns-allinone-3.14.1/ns-3.14.1/src/visualizer/visualizer/base.py
160
3799
import ns.point_to_point import ns.csma import ns.wifi import ns.bridge import ns.internet import ns.mesh import ns.wimax import ns.wimax import ns.lte import gobject import os.path import sys PIXELS_PER_METER = 3.0 # pixels-per-meter, at 100% zoom level class PyVizObject(gobject.GObject): __gtype_name__ = "PyVi...
gpl-3.0
redhat-openstack/heat
heat/engine/stack_resource.py
1
14958
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
wangyou/XX-Net
code/default/python27/1.0/lib/noarch/sortedcontainers/sortedlist.py
10
37521
# -*- coding: utf-8 -*- # # Sorted list implementation. from __future__ import print_function from sys import hexversion from bisect import bisect_left, bisect_right, insort from itertools import chain, repeat, starmap from collections import MutableSequence from operator import iadd, add from functools import wraps ...
bsd-2-clause
ehashman/oh-mainline
vendor/packages/python-social-auth/social/tests/backends/test_evernote.py
71
1525
from requests import HTTPError from social.p3 import urlencode from social.exceptions import AuthCanceled from social.tests.backends.oauth import OAuth1Test class EvernoteOAuth1Test(OAuth1Test): backend_path = 'social.backends.evernote.EvernoteOAuth' expected_username = '101010' access_token_body = urle...
agpl-3.0
ioram7/keystone-federado-pgid2013
build/requests/build/lib.linux-x86_64-2.7/requests/packages/charade/mbcsgroupprober.py
181
2021
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer....
apache-2.0
bratsche/Neutron-Drive
neutron-drive/django/contrib/sitemaps/tests/http.py
85
5641
from datetime import date from django.conf import settings from django.contrib.auth.models import User from django.contrib.sitemaps import Sitemap, GenericSitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.utils.unittest import skipUnless from django...
bsd-3-clause
LingxiaoJIA/gem5
ext/ply/ply/ctokens.py
363
3170
# ---------------------------------------------------------------------- # ctokens.py # # Token specifications for symbols in ANSI C and C++. This file is # meant to be used as a library in other tokenizers. # ---------------------------------------------------------------------- # Reserved words tokens = [ # Li...
bsd-3-clause
vrutkovs/vrutkovs.github.io
extras/ircbot/bot.py
2
8761
### # Copyright (c) 2003-2004, Jeremiah Fincher # Copyright (c) 2012 Colin Walters <walters@verbum.org> # Copyright (c) 2013 Jasper St. Pierre <jstpierre@mecheye.net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
lgpl-2.1
logonmy/QConf
test/unit/gtest/scripts/pump.py
2471
23673
#!/usr/bin/env python # # Copyright 2008, 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...
bsd-2-clause
erikdejonge/youtube-dl
youtube_dl/extractor/tube8.py
20
3087
from __future__ import unicode_literals import re from ..utils import ( int_or_none, str_to_int, ) from .keezmovies import KeezMoviesIE class Tube8IE(KeezMoviesIE): _VALID_URL = r'https?://(?:www\.)?tube8\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.tube8...
unlicense
bgreenlee/sublime-github
lib/requests/packages/charade/constants.py
231
1374
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer....
mit
MQQiang/kbengine
kbe/src/lib/python/Lib/test/test_json/test_decode.py
79
4248
import decimal from io import StringIO, BytesIO from collections import OrderedDict from test.test_json import PyTest, CTest class TestDecode: def test_decimal(self): rval = self.loads('1.1', parse_float=decimal.Decimal) self.assertTrue(isinstance(rval, decimal.Decimal)) self.assertEqual(r...
lgpl-3.0
Mikescher/Project-Euler_Befunge
compiled/Python3/Euler_Problem-030.py
1
2884
#!/usr/bin/env python3 # transpiled with BefunCompile v1.3.0 (c) 2017 def td(a,b): return ((0)if(b==0)else(a//b)) def tm(a,b): return ((0)if(b==0)else(a%b)) s=[] def sp(): global s if (len(s) == 0): return 0 return s.pop() def sa(v): global s s.append(v) def sr(): global s i...
mit
lodemo/CATANA
src/face_recognition/youtube_dl/extractor/makerschannel.py
66
1593
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class MakersChannelIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?makerschannel\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)' _TEST = { 'url': 'http://makerschannel.com/en/zoomin/commu...
mit
jonathonwalz/ansible
lib/ansible/modules/network/lenovo/cnos_bgp.py
59
19250
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, 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 # ...
gpl-3.0
divya-csekar/flask-microblog-server
flask/Lib/site-packages/pip/_vendor/distlib/compat.py
357
38875
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys if sys.version_info[0] < 3: from StringIO import StringIO stri...
bsd-3-clause
ivanhorvath/openshift-tools
ansible/roles/lib_oa_utils/filter_plugins/openshift_master.py
11
20128
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Custom filters for use in openshift-master ''' import copy import sys from ansible import errors from ansible.parsing.yaml.dumper import AnsibleDumper from ansible.plugins.filter.core import to_bool as ansible_bool from ansible.module_utils.six import string_types, u imp...
apache-2.0
Lujeni/ansible
lib/ansible/modules/cloud/vmware/vmware_vm_vss_dvs_migrate.py
23
5290
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # 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'...
gpl-3.0
shyamalschandra/neon
neon/util/batch_writer.py
2
12174
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems 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.o...
apache-2.0
saleemjaveds/https-github.com-openstack-nova
tools/xenserver/vdi_chain_cleanup.py
139
3678
#!/usr/bin/env python # Copyright 2012 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 l...
apache-2.0
christianurich/VIBe2UrbanSim
3rdparty/opus/src/vibe_min/estimation/HLCM_specification_min.py
2
3886
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE ####### # In a command line, you can estimate using this command: # # python urbansim/tools/start_estimation.py -c eugene.configs.baseline_estimation --model=household_location_choice_model -s...
gpl-2.0
namanjain236/personfinder
tools/merge_messages.py
17
7957
#!/usr/bin/env python # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
normtown/SickRage
sickbeard/providers/scenetime.py
5
10892
# Author: Idan Gutman # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 o...
gpl-3.0
ict-felix/stack
modules/resource/orchestrator/test/delegate/geni/v3/rspecs/tnrm/adv_examples.py
2
1055
#!/usr/bin/env python # TODO Convert to unittest, update paths added to syspath, etc import sys import os if __name__ == '__main__': bp_ = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))) if bp_ not in [os.path.abspath(x) for x in sys.path]: sys.path.insert(0, bp_) pref = "../.....
apache-2.0
jtannas/NOA
app/mod_legal/controllers.py
1
1924
''' The business logic & routing controller of the legal module The is the controller aspect of the module. References: - This module's: jinja templates Yields: - Route: Privacy, Displays the website privacy policy - Route: TOS, Displays the website Terms of Service Todo: - Overhaul expected in ...
mit
jjingrong/PONUS-1.2
venv/Lib/site-packages/pip/_vendor/html5lib/sanitizer.py
805
16428
from __future__ import absolute_import, division, unicode_literals import re from xml.sax.saxutils import escape, unescape from .tokenizer import HTMLTokenizer from .constants import tokenTypes class HTMLSanitizerMixin(object): """ sanitization of XHTML+MathML+SVG and of inline style attributes.""" accepta...
mit
xin3liang/platform_external_chromium_org
media/tools/constrained_network_server/cns_test.py
168
9899
#!/usr/bin/env python # Copyright (c) 2012 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. """Tests for Constrained Network Server.""" import os import signal import subprocess import tempfile import time import unittest i...
bsd-3-clause
vbraun/oxford-strings
lib/dateutil/zoneinfo/__init__.py
83
3558
# -*- coding: utf-8 -*- """ Copyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard Python datetime module. """ import logging import os from subprocess import call from tarfile import TarFile from dateutil.tz import tzfile __author__ = "Tomi Pieviläinen <tomi.p...
gpl-2.0
facaiy/spark
python/pyspark/ml/tests/test_algorithms.py
5
14969
# # 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
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/lib/matplotlib/animation.py
2
37256
# TODO: # * Loop Delay is broken on GTKAgg. This is because source_remove() is not # working as we want. PyGTK bug? # * Documentation -- this will need a new section of the User's Guide. # Both for Animations and just timers. # - Also need to update http://www.scipy.org/Cookbook/Matplotlib/Animations # * Blit ...
mit
virgree/odoo
addons/lunch/report/__init__.py
441
1087
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
Elringus/BiosorbEngine
registration/backends/simple/urls.py
48
1376
""" URLconf for registration and activation, using django-registration's one-step backend. If the default behavior of these views is acceptable to you, simply use a line like this in your root URLconf to set up the default URLs for registration:: (r'^accounts/', include('registration.backends.simple.urls')), Thi...
bsd-3-clause
passren/Roxd
gpx/models.py
1
5745
from django.db import models from django.contrib.auth.models import User # Models of GPX object class Gpx(models.Model): id = models.AutoField(primary_key=True) version = models.CharField(max_length=50, blank=True) creator = models.CharField(max_length=50, blank=True) name = models.CharField(max_length...
gpl-2.0
procamora/Gestor-Series
app/views/notificaciones.py
1
6380
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from typing import NoReturn, List from PyQt5 import QtWidgets from app.views.ui.notificaciones_ui import Ui_Dialog import app.controller.Controller as Controller from app.models.model_notifications import Notifications from app.models.model_query import Query...
gpl-3.0
ximion/dak
dak/dakdb/update98.py
7
2236
#!/usr/bin/env python # coding=utf8 """ Remove obsolete functions @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2013, Ansgar Burchardt <ansgar@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it and/or modify # it under the...
gpl-2.0
legalsylvain/OpenUpgrade
openerp/addons/base/module/wizard/__init__.py
365
1250
# -*- 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 GNU...
agpl-3.0
madhurrajn/samashthi
lib/django/template/backends/django.py
240
5574
# Since this package contains a "django" module, this is required on Python 2. from __future__ import absolute_import import sys import warnings from importlib import import_module from pkgutil import walk_packages from django.apps import apps from django.conf import settings from django.template import TemplateDoesN...
bsd-3-clause
HyperBaton/ansible
lib/ansible/modules/net_tools/nios/nios_fixed_address.py
9
8869
#!/usr/bin/python # Copyright (c) 2018 Red Hat, 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
rCorvidae/CppPyDoc
UserInputParse.py
1
1672
import sys import argparse import os.path as op class InputSourceError(Exception): def __init__(self, value): self.text = value def __str__(self): print("INPUT SOURCE ERROR: ".format(self.text)) print("No file or directory incorrect") class UserInputParse(object): ''' ...
gpl-2.0
CINPLA/exdir
tests/test_file.py
1
12615
# -*- coding: utf-8 -*- # # This file is part of Exdir, the Experimental Directory Structure. # # Copyright 2017 Simen Tennøe # # License: MIT, see "LICENSE" file for the full license terms. # # This file contains code from h5py, a Python interface to the HDF5 library, # licensed under a standard 3-clause BSD license #...
mit
ksrajkumar/openerp-6.1
openerp/addons/mrp_subproduct/mrp_subproduct.py
9
7555
# -*- 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
nistormihai/superdesk-core
apps/auth/db/reset_password.py
4
4836
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
agpl-3.0
2013Commons/HUE-SHARK
desktop/core/ext-py/Django-1.2.3/django/db/models/sql/subqueries.py
22
7687
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db import connections from django.db.models.sql.constants import * from django.db.models.sql.datastructures import Date from django.db.models.sql.expressions import SQLEval...
apache-2.0
mattclay/ansible
lib/ansible/plugins/test/files.py
170
1518
# (c) 2015, Ansible, 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 option) any later version. # # Ansible is di...
gpl-3.0
google-research/batch-ppo
agents/tools/loop.py
1
9339
# Copyright 2017 The TensorFlow Agents 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 applicable law or ag...
apache-2.0
zlsun/XX-Net
code/default/python27/1.0/lib/SimpleHTTPServer.py
24
7997
"""Simple HTTP Server. This module builds on BaseHTTPServer by implementing the standard GET and HEAD requests in a fairly straightforward manner. """ __version__ = "0.6" __all__ = ["SimpleHTTPRequestHandler"] import os import posixpath import BaseHTTPServer import urllib import urlparse import cgi import sys imp...
bsd-2-clause
Conorh97/CA117---Python3
week_11/file_111.py
1
1448
class File(object): FILE_PERMISSIONS = "rwx" def __init__(self , name , owner , size = 0 , permissions = ""): self.name = name self.owner = owner self.size = size self.permissions = permissions def enable_permission(self , user , mode): if mode not in self.FILE_PER...
lgpl-3.0
davidzchen/tensorflow
tensorflow/python/estimator/exporter.py
41
1274
# 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
koyuawsmbrtn/eclock
windows/Python27/Lib/stringold.py
293
12449
# module 'string' -- A collection of string operations # Warning: most of the code you see here isn't normally used nowadays. With # Python 1.6, many of these functions are implemented as methods on the # standard string object. They used to be implemented by a built-in module # called strop, but strop is now obsolet...
gpl-2.0
WatanabeYasumasa/edx-platform
common/test/acceptance/pages/lms/tab_nav.py
30
3027
""" High-level tab navigation. """ from bok_choy.page_object import PageObject from bok_choy.promise import Promise, EmptyPromise class TabNavPage(PageObject): """ High-level tab navigation. """ url = None def is_browser_on_page(self): return self.q(css='ol.course-tabs').present de...
agpl-3.0
gisadmin/vb2py
vb2py/vb/test3/test/frmSettings.py
2
2225
# Created by Leo from: C:\Development\Python23\Lib\site-packages\vb2py\vb2py.leo """The main form for the application""" from PythonCardPrototype import model # Allow importing of our custom controls import PythonCardPrototype.res PythonCardPrototype.res.APP_COMPONENTS_PACKAGE = "vb2py.targets.pythoncard.vbc...
gpl-3.0
Azure/azure-sdk-for-python
sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/aio/_container_registry_management_client.py
1
4119
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
dricciardelli/vae2vec
ctc_loss.py
1
1850
import tensorflow as tf def get_output_probabilities(output_probabilities,captions): pre_prob=tf.pow(output_probabilities,captions) pre_prob=1-captions+(2*captions-1)*output_probabilities pre_prob=tf.maximum(pre_prob,tf.constant(1e-3,dtype=tf.float32)) pre_prob=tf.minimum(pre_prob,tf.constant(1.0-1e-3,dtype=tf.flo...
mit
Kali-/htc-kernel-ace
scripts/rt-tester/rt-tester.py
904
5366
#!/usr/bin/env python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt impor...
gpl-2.0
hwkns/django-phonenumber-field
phonenumber_field/modelfields.py
1
3143
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.conf import settings from django.core import validators from django.db import models from django.utils.translation import ugettext_lazy as _ from .validators import validate_international_phonenumber from .phonenumber import ...
mit
chessco/cursus
modules/certificate/certificate.py
5
11202
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
Frontier314/kernel_s702hf
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
dbrattli/RxPY
rx/testing/marbles.py
1
4412
import re import threading from rx import AnonymousObservable, Observable from rx.blockingobservable import BlockingObservable from rx.concurrency import timeout_scheduler from rx.internal import extensionmethod, extensionclassmethod from .coldobservable import ColdObservable from .reactivetest import ReactiveTest o...
apache-2.0
andreparames/odoo
addons/sale_crm/wizard/crm_make_sale.py
223
7199
# -*- 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
muntasirsyed/intellij-community
python/lib/Lib/site-packages/django/conf/locale/sk/formats.py
232
1288
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = 'j. F Y G:i:s' YEAR_MONTH...
apache-2.0
mitodl/orcoursetrion
orcoursetrion/cmd.py
2
6931
# -*- coding: utf-8 -*- """ Command line interface to orchestrion """ from __future__ import print_function import argparse from orcoursetrion import actions def run_create_export_repo(args): """Run the create_export_repo action using args""" repo = actions.create_export_repo(args.course, args.term, args.de...
bsd-2-clause
ChristineLaMuse/mozillians
mozillians/groups/migrations/0012_auto__del_field_group_always_auto_complete__del_field_group_auto_compl.py
3
16384
# -*- 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 'Group.always_auto_complete' db.delete_column('groups_group', 'always_auto_complete') ...
bsd-3-clause
nguyentu1602/statsmodels
statsmodels/examples/example_enhanced_boxplots.py
33
3179
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm # Necessary to make horizontal axis labels fit plt.rcParams['figure.subplot.bottom'] = 0.23 data = sm.datasets.anes96.load_pandas() party_ID = np.arange(7) labels = ["Strong Democrat", "Weak Democr...
bsd-3-clause
JunHe77/bigtop
bigtop-packages/src/charm/spark/layer-spark/tests/03-scale-standalone.py
6
3016
#!/usr/bin/env python3 # 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 "Lic...
apache-2.0
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_dumbdbm.py
138
4839
#! /usr/bin/env python """Test script for the dumbdbm module Original by Roger E. Masse """ import os import unittest import dumbdbm from test import test_support _fname = test_support.TESTFN def _delete_files(): for ext in [".dir", ".dat", ".bak"]: try: os.unlink(_fname + ext) exc...
apache-2.0
xzYue/odoo
addons/auth_signup/controllers/main.py
144
6049
# -*- 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
JorgeCoock/django
tests/admin_utils/models.py
217
1821
from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Site(models.Model): domain = models.CharField(max_length=100) def __str__(self): return self.domain class Article(models.Model): """ A s...
bsd-3-clause
pinkavaj/gnuradio
gr-digital/python/digital/qam.py
58
13846
# # Copyright 2005,2006,2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any l...
gpl-3.0
windofthesky/ansible
lib/ansible/plugins/action/win_template.py
117
1168
# (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