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
vipins/ccccms
env/Lib/site-packages/html5lib/constants.py
100
88603
import string, gettext _ = gettext.gettext try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset EOF = None E = { "null-character": _(u"Null character in input stream, replaced with U+FFFD."), ...
bsd-3-clause
tuomas2/serviceform
serviceform/serviceform/models/participation.py
1
4015
# -*- coding: utf-8 -*- # (c) 2017 Tuomas Airaksinen # # This file is part of Serviceform. # # Serviceform 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)...
gpl-3.0
cryptickp/heat
heat/tests/aws/test_volume.py
4
27952
# # 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
steedos/odoo7
openerp/addons/warning/__openerp__.py
63
1680
# -*- 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
mhlechner/psi4
psi4/share/psi4/fsapt/copy_pymol.py
3
1373
#!/usr/bin/env python # # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2017 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This program is free software; you can redistribute it and/or modify #...
gpl-2.0
ShySec/scrimmage-scoreboard
web2py/gluon/contrib/pg8000/six.py
31
20969
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2013 Benjamin Peterson # # 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 with...
gpl-2.0
dsbrown/FreeCAD
src/Mod/Test/Gui/qtunittest.py
29
9305
# Qt Unit test module # (c) 2006 Werner Mayer # #*************************************************************************** #* (c) Werner Mayer <werner.wm.mayer@gmx.de> 2006 * #* * #* This file is part of the FreeCAD CA...
lgpl-2.1
mancoast/CPythonPyc_test
fail/301_test_urllib2_localnet.py
1
17211
#!/usr/bin/env python import email import threading import urllib.parse import urllib.request import http.server import unittest import hashlib from test import support # Loopback http server infrastructure class LoopbackHttpServer(http.server.HTTPServer): """HTTP server w/ a few modifications that make it usefu...
gpl-3.0
darkwing/kuma
vendor/packages/translate/storage/xml_extract/misc.py
24
2936
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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...
mpl-2.0
thermokarst/qiime2
qiime2/core/type/tests/test_parse.py
1
4541
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2020, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
tesidroni/mp
Lib/distutils/command/bdist_rpm.py
104
20408
"""distutils.command.bdist_rpm Implements the Distutils 'bdist_rpm' command (create RPM source and binary distributions).""" __revision__ = "$Id$" import sys import os import string from distutils.core import Command from distutils.debug import DEBUG from distutils.file_util import write_file from distutils.errors ...
gpl-3.0
Alucard24/Alucard-Kernel-jfltexx
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
waytai/django
django/template/backends/dummy.py
480
2037
# Since this package contains a "django" module, this is required on Python 2. from __future__ import absolute_import import errno import io import string from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template import Origin, TemplateDoesNotExist from django.utils...
bsd-3-clause
mflu/openvstorage_centos
ovs/extensions/storage/volatile/dummystore.py
2
3090
# Copyright 2014 CloudFounders NV # # 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 writ...
apache-2.0
karthik-suresh/horizon
openstack_dashboard/dashboards/identity/users/tables.py
4
9272
# 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 # distributed under t...
apache-2.0
williamthegrey/swift
swift/common/ring/builder.py
2
73487
# Copyright (c) 2010-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 law or agree...
apache-2.0
bennytheshap/ouimeaux
ouimeaux/subscribe.py
4
3676
from collections import defaultdict import logging from xml.etree import cElementTree from functools import partial import gevent from gevent.wsgi import WSGIServer from ouimeaux.utils import get_ip_address, requests_request from ouimeaux.device.insight import Insight from ouimeaux.device.maker import Maker from ouim...
bsd-3-clause
jainanisha90/WeVoteServer
import_export_wikipedia/views_admin.py
2
3836
# import_export_wikipedia/views_admin.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from .controllers import retrieve_all_organizations_logos_from_wikipedia, \ retrieve_organization_logo_from_wikipedia_page, retrieve_wikipedia_page_from_wikipedia from admin_tools.views import redirect_to_sign_in...
mit
owwlo/Courier
src/courier/app/CourierService.py
1
5234
''' Created on Jan 17, 2015 @author: owwlo ''' from PyQt5 import QtGui, QtCore, QtQml, QtQuick from PyQt5.QtCore import QObject, QUrl, Qt, QVariant, QMetaObject, Q_ARG import threading import websocket import json import logging from time import sleep import coloredlogs WS_URL = "ws://localhost:88...
mit
popazerty/beyonwiz-4.1
lib/python/Screens/TaskList.py
7
3028
# -*- coding: utf-8 -*- # taken from mytube plugin from enigma import eTimer from Screens.Screen import Screen from Components.ActionMap import ActionMap from Components.Button import Button from Components.Label import Label from Components.Sources.List import List from Components.MultiContent import MultiContentEntr...
gpl-2.0
philhassey/zanthor
zanthor/explode.py
2
4998
import pygame from pygame.locals import * import random from pgu import timer rr = random.randrange class Part: def __init__(self,pos): self.pos = pygame.Rect(pos[0],pos[1],1,1) self._pos = pygame.Rect(self.pos) self.frame = 0 SIZE = 16 #32 is original class Effect: def __init__(sel...
gpl-2.0
githubmlai/numpy
numpy/tests/test_matlib.py
70
1595
from __future__ import division, absolute_import, print_function import numpy as np import numpy.matlib from numpy.testing import assert_array_equal, assert_, run_module_suite def test_empty(): x = np.matlib.empty((2,)) assert_(isinstance(x, np.matrix)) assert_(x.shape, (1, 2)) def test_ones(): asser...
bsd-3-clause
tankca/store
store/dummy_data/orders.py
1
1720
"""Order dummy data.""" from store.orders.models import Order # from store.orders.models import OrderConsistsOf # Orders o1 = Order('cid1') o2 = Order('cid2') o3 = Order('cid3') o4 = Order('cid4') o5 = Order('cid5') o6 = Order('cid6') o7 = Order('cid7') o8 = Order('cid8') o9 = Order('cid9') o10 = Order('cid10') o11 ...
bsd-3-clause
Captain-Coder/tribler
Tribler/Test/Core/Libtorrent/test_libtorrent_mgr.py
1
19035
import binascii import os import shutil import tempfile from libtorrent import bencode from twisted.internet.task import deferLater from Tribler.Test.tools import trial_timeout from twisted.internet.defer import inlineCallbacks, Deferred from twisted.internet import reactor from Tribler.Core.CacheDB.Notifier import...
lgpl-3.0
vFense/vFenseAgent-nix
agent/deps/rpm/Python-2.7.5/lib/python2.7/idlelib/MultiCall.py
43
17483
""" MultiCall - a class which inherits its methods from a Tkinter widget (Text, for example), but enables multiple calls of functions per virtual event - all matching events will be called, not only the most specific one. This is done by wrapping the event functions - event_add, event_delete and event_info. MultiCall r...
lgpl-3.0
mikewiebe-ansible/ansible
test/units/modules/network/netvisor/test_pn_ipv6security_raguard.py
23
3119
# Copyright: (c) 2018, Pluribus Networks # 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 from units.compat.mock import patch from ansible.modules.network.netvisor import pn_ipv6security...
gpl-3.0
autokey-py3/autokey
lib/autokey/qtui/popupmenu.py
4
6205
# Copyright (C) 2011 Chris Dekter # Copyright (C) 2018 Thomas Hess # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # #...
gpl-3.0
usc-isi/nova
nova/tests/network/test_quantumv2.py
1
26589
# Copyright 2012 OpenStack LLC. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
FreekingDean/home-assistant
tests/components/emulated_hue/test_init.py
4
1598
from unittest.mock import patch from homeassistant.components.emulated_hue import Config, _LOGGER def test_config_google_home_entity_id_to_number(): """Test config adheres to the type.""" conf = Config({ 'type': 'google_home' }) number = conf.entity_id_to_number('light.test') ...
mit
tlakshman26/cinder-new-branch
cinder/db/sqlalchemy/migrate_repo/versions/002_quota_class.py
20
5291
# 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 law ...
apache-2.0
tquilian/exeNext
exe/engine/lom/lom.py
9
560188
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Fri May 10 13:36:48 2013 by generateDS.py version 2.9a. # import sys import getopt import re as re_ import base64 from datetime import datetime, tzinfo, timedelta from twisted.spread.jelly import Unjellyable etree_ = None Verbose_import_ = False ( XMLPars...
gpl-2.0
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/python/keras/applications/inception_v3/__init__.py
74
1161
# Copyright 2016 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...
mit
mdakin/engine
build/protoc_java.py
78
2330
#!/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. """Generate java source files from protobuf files. This is a helper file for the genproto_java action in protoc_java.gypi. It per...
bsd-3-clause
intgr/django-cms
cms/test_utils/testcases.py
4
15135
# -*- coding: utf-8 -*- import sys import json from cms.compat import get_user_model from cms.models import Page from cms.test_utils.util.context_managers import (UserLoginContext, SettingsOverride) from django.conf import settings from django.contrib.auth.models import AnonymousUser, Permission from django.contri...
bsd-3-clause
cognitiveclass/edx-platform
common/djangoapps/terrain/stubs/comments.py
85
5565
""" Stub implementation of cs_comments_service for acceptance tests """ import re import urlparse from .http import StubHttpRequestHandler, StubHttpService class StubCommentsServiceHandler(StubHttpRequestHandler): @property def _params(self): return urlparse.parse_qs(urlparse.urlparse(self.path).que...
agpl-3.0
carlthome/librosa
librosa/feature/utils.py
1
8078
#!/usr/bin/env python # -*- coding: utf-8 -*- """Feature manipulation utilities""" from warnings import warn import numpy as np import scipy.signal from .._cache import cache from ..util.exceptions import ParameterError __all__ = ['delta', 'stack_memory'] @cache(level=40) def delta(data, width=9, order=1, axis=-1, ...
isc
krafczyk/root-5.34.09-ams
cint/reflex/python/genreflex/genreflex.py
4
18641
# Copyright CERN, CH-1211 Geneva 23, 2004-2006, All rights reserved. # # Permission to use, copy, modify, and distribute this software for any # purpose is hereby granted without fee, provided that this copyright and # permissions notice appear in all copies and derivatives. # # This software is provided "as is" withou...
lgpl-2.1
ivelum/graphql-py
tests/test_lexer.py
1
4421
from decimal import Decimal from unittest import TestCase from graphql.lexer import GraphQLLexer from graphql.exceptions import LexerError class GraphQLLexerTest(TestCase): lexer = GraphQLLexer() def assert_output(self, lexer, expected): actual = list(lexer) len_actual = len(actual) ...
mit
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_1_0_6/models/familymemberhistory_tests.py
1
3883
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 1.0.2.7202 on 2016-06-23. # 2016, SMART Health IT. import io import json import os import unittest from . import familymemberhistory from .fhirdate import FHIRDate class FamilyMemberHistoryTests(unittest.TestCase): def instantiate_from(sel...
bsd-3-clause
gregmuellegger/django-rest-framework
rest_framework/routers.py
14
11625
""" Routers provide a convenient and consistent way of automatically determining the URL conf for your API. They are used by simply instantiating a Router class, and then registering all the required ViewSets with that router. For example, you might have a `urls.py` that looks something like this: router = route...
bsd-2-clause
bdero/edx-platform
common/djangoapps/terrain/stubs/tests/test_http.py
49
3845
""" Unit tests for stub HTTP server base class. """ import unittest import requests import json from terrain.stubs.http import StubHttpService, StubHttpRequestHandler, require_params class StubHttpServiceTest(unittest.TestCase): def setUp(self): self.server = StubHttpService() self.addCleanup(se...
agpl-3.0
felixfontein/ansible
test/units/galaxy/test_api.py
13
47350
# -*- coding: utf-8 -*- # Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os import re import pyte...
gpl-3.0
JimCircadian/ansible
lib/ansible/modules/cloud/cloudstack/cs_staticnat.py
29
7371
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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
nilnvoid/wagtail
wagtail/wagtailadmin/tests/test_jinja2.py
9
1588
from __future__ import absolute_import, unicode_literals from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser from django.template import engines from django.test import TestCase from wagtail.wagtailcore.models import PAGE_TEMPLATE_VAR, Page, Site class TestCoreJinja(T...
bsd-3-clause
LEPT-Development/android_kernel_lge_f6mt
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
CamelBackNotation/CarnotKE
jyhton/lib-python/2.7/test/test_zlib.py
45
22321
import unittest from test.test_support import TESTFN, run_unittest, import_module, unlink, requires import binascii import random from test.test_support import precisionbigmemtest, _1G, _4G import sys try: import mmap except ImportError: mmap = None zlib = import_module('zlib') class ChecksumTestCase(unitte...
apache-2.0
tomasy23/evertonkrosnodart
tools/addheader/addheader.py
6
2999
header="""\ /*************************************************************************/ /* $filename */ /*************************************************************************/ /* This file is part of: */ /* ...
mit
Carmezim/tensorflow
tensorflow/python/platform/flags_test.py
79
3046
# 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
kawamon/hue
desktop/core/ext-py/boto-2.46.1/boto/gs/connection.py
157
5478
# Copyright 2010 Google Inc. # # 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, dis- # trib...
apache-2.0
bollu/sandhi
modules/gr36/gnuradio-core/src/examples/volk_benchmark/volk_math.py
18
5153
#!/usr/bin/env python from gnuradio import gr import argparse from volk_test_funcs import * def multiply_const_cc(N): k = 3.3 op = gr.multiply_const_cc(k) tb = helper(N, op, gr.sizeof_gr_complex, gr.sizeof_gr_complex, 1, 1) return tb ###################################################################...
gpl-3.0
dataDogma/Computer-Science
Django-MVP-page/venv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py
154
7938
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
gpl-3.0
jkorell/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/palmos.py
96
3019
""" Python Character Mapping Codec for PalmOS 3.5. Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def d...
apache-2.0
chewxy/cu
cmd/gencudnn/parse.py
1
3705
from bs4 import BeautifulSoup import requests import re import sys import os inputs ={} outputs = {} ios = {} docs = {} def get(): if os.path.isfile("cache/docs.html"): with open("cache/docs.html", 'r') as f: print("Using cache", file=sys.stderr) return f.read() r = requests.get("http://docs.nvidia.com/deep...
mit
MortalViews/python-notes
inheritance.py
1
1192
import random class Person: def __init__(self,name,age,location): self.name = name self.age = age self.locaiton = location def is_sick(self): return random.randint(1,10)%2==0 class AttendenceMixin: def swip_in(self): pass def swip_out(self): pass ...
apache-2.0
mxOBS/deb-pkg_trusty_chromium-browser
tools/perf/page_sets/service_worker_micro_benchmark.py
9
1509
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page from telemetry.page import page_set as page_set archive_data_file_path = 'data/service_worker_micro_benchmark.json'...
bsd-3-clause
guaix-ucm/numina
numina/core/requirements.py
3
1934
# # Copyright 2008-2021 Universidad Complutense de Madrid # # This file is part of Numina # # SPDX-License-Identifier: GPL-3.0+ # License-Filename: LICENSE.txt # """ Recipe requirement holders """ import numina.exceptions import numina.types.obsresult as obtypes from .dataholders import Requirement class Observat...
gpl-3.0
dwadler/QGIS
tests/src/python/test_qgslocator.py
8
16296
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLocator. .. note:: 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. """ __auth...
gpl-2.0
ryfeus/lambda-packs
Selenium_PhantomJS/source/pyasn1_modules/rfc3447.py
127
1400
# # PKCS#1 syntax # # ASN.1 source from: # ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1.asn # # Sample captures could be obtained with "openssl genrsa" command # from pyasn1_modules.rfc2437 import * class OtherPrimeInfo(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('prim...
mit
ales-erjavec/orange
Orange/OrangeWidgets/Visualize/OWSurveyPlot.py
6
9664
""" <name>Survey Plot</name> <description>Survey plot (multiattribute) visualization.</description> <contact>Gregor Leban (gregor.leban@fri.uni-lj.si)</contact> <icon>icons/SurveyPlot.svg</icon> <priority>3250</priority> """ # OWSurveyPlot.py # # Show data using survey plot visualization method # from OWVisWidget impor...
gpl-3.0
ravibhure/ansible
lib/ansible/modules/cloud/amazon/efs_facts.py
11
11498
#!/usr/bin/python # Copyright: Ansible Project # 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
kytvi2p/Sigil
3rdparty/python/Lib/test/curses_tests.py
194
1242
#!/usr/bin/env python3 # # $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $ # # Interactive test suite for the curses module. # This script displays various things and the user should verify whether # they display correctly. # import curses from curses import textpad def test_textpad(stdscr, insert_mode=False): ...
gpl-3.0
tarikgwa/nfd
newfies/appointment/models/rules.py
5
3218
from django.db import models from django.utils.translation import ugettext_lazy as _ from dateutil import rrule freqs = ( ("YEARLY", _("Yearly")), ("MONTHLY", _("Monthly")), ("WEEKLY", _("Weekly")), ("DAILY", _("Daily")), ("HOURLY", _("Hourly")), ("MINUTELY", _("Minutely")), ("SECONDLY", _(...
mpl-2.0
Nispand1492/appengine-try-python-flask
lib/cloudstorage/api_utils.py
48
11314
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
michigraber/scikit-learn
examples/calibration/plot_calibration_multiclass.py
272
6972
""" ================================================== Probability Calibration for 3-class classification ================================================== This example illustrates how sigmoid calibration changes predicted probabilities for a 3-class classification problem. Illustrated is the standard 2-simplex, wher...
bsd-3-clause
xkmato/youtube-dl
youtube_dl/extractor/viki.py
81
11693
# coding: utf-8 from __future__ import unicode_literals import json import time import hmac import hashlib import itertools from ..utils import ( ExtractorError, int_or_none, parse_age_limit, parse_iso8601, ) from ..compat import compat_urllib_request from .common import InfoExtractor class VikiBase...
unlicense
lutris/website
games/notifier.py
1
1688
"""Send a digest of unpublished content to moderators""" from django.conf import settings from accounts.models import User from games import models from emails.messages import send_email DEFAULT_COUNT = 12 def get_unpublished_installers(count=DEFAULT_COUNT): """Return a random list of unpublished installers""" ...
agpl-3.0
nehresma/bvcms
CmsWeb/test.py
3
1031
orgid = 2191107 sql = ''' WITH members AS ( SELECT om.PeopleId, LastGroup = (SELECT MAX(Value) FROM dbo.Split(Groups, CHAR(10)) WHERE Value LIKE 'NewGuestEmail-%') FROM dbo.OrgPeopleCurrent({0}) om JOIN dbo.People p ON p.PeopleId = om.PeopleId JOIN dbo.OrganizationMembers omm ON omm.PeopleId = p.PeopleId AND om...
gpl-2.0
brianjgeiger/osf.io
api/wikis/permissions.py
17
1742
# -*- coding: utf-8 -*- from rest_framework import permissions from api.base.utils import get_user_auth from addons.wiki.models import WikiPage, WikiVersion class ContributorOrPublic(permissions.BasePermission): def has_object_permission(self, request, view, obj): assert isinstance(obj, WikiPage), 'obj ...
apache-2.0
Creworker/FreeCAD
src/Mod/Path/PathScripts/PathProject.py
6
6281
# -*- coding: utf-8 -*- #*************************************************************************** #* * #* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
cloud-ark/cloudark
server/common/fm_logger.py
1
2400
import inspect import logging from server.common import constants class Logging(object): def __init__(self): logging.basicConfig(filename=constants.LOG_FILE_NAME, level=logging.DEBUG, filemode='a', format='%(asctime)s %(message)s', ...
apache-2.0
azvoleff/chitwanabm
chitwanabm/modelloop.py
1
18907
# Copyright 2008-2013 Alex Zvoleff # # This file is part of the chitwanabm agent-based model. # # chitwanabm 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...
gpl-3.0
djfkahn/MemberHubDirectoryTools
roster_tools.py
1
5813
#!/usr/bin/env python """This program inputs a MemberHub directory dump, and analyzes it. """ import family import roster import os from openpyxl import load_workbook MIN_NUM_ROSTER_FIELDS = 5 def ReadRosterAdultsFromMostRecent(file_name=None): """ roster_tools.ReadRosterAdultsFromMostRecent PURPOSE: Gene...
apache-2.0
SamWhited/photoREPL
photorepl/views/preview.py
2
1876
import os from gi.repository import Gtk, GdkPixbuf from photorepl import app_name from threading import Lock class Preview(Gtk.Window): """ The preview window, which shows photos as you edit them. """ def __init__(self, filename=None, rawfile=None, show=True): super().__init__() se...
bsd-2-clause
marcoantoniooliveira/labweb
oscar/lib/python2.7/site-packages/setuptools/command/egg_info.py
215
14320
"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" import os import re import sys from setuptools import Command import distutils.errors from distutils import log from setuptools.command.sdist import sdist from setuptools.compat import basestring from setuptools import svn_uti...
bsd-3-clause
Remwrath/bgui
bgui/texture.py
7
3754
# This module encapsulates texture loading so we are not dependent on bge.texture from .gl_utils import * try: from bge import texture import aud USING_BGE_TEXTURE = True except ImportError: from PyQt4 import QtOpenGL, QtGui USING_BGE_TEXTURE = False class Texture: def __init__(self, path, interp_mode): self....
mit
yusufm/mobly
mobly/controllers/android_device_lib/event_dispatcher.py
1
15487
#!/usr/bin/env python3.4 # # Copyright 2016 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...
apache-2.0
ds-hwang/chromium-crosswalk
tools/memory_inspector/memory_inspector/data/file_storage_unittest.py
89
5331
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This unittest covers both file_storage and serialization modules.""" import os import tempfile import time import unittest from memory_inspector.core im...
bsd-3-clause
leorochael/odoo
addons/analytic/__openerp__.py
302
1891
# -*- 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
cavestruz/L500analysis
plotting/profiles/T_Vcirc_evolution/Vcirc_evolution/plot_Vcirc2_nu_binned_Vc500c.py
1
3175
from L500analysis.data_io.get_cluster_data import GetClusterData from L500analysis.utils.utils import aexp2redshift from L500analysis.plotting.tools.figure_formatting import * from L500analysis.plotting.profiles.tools.profiles_percentile \ import * from L500analysis.plotting.profiles.tools.select_profiles \ imp...
mit
JasonCormie/ansible-modules-extras
remote_management/ipmi/ipmi_power.py
38
3879
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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
studio666/gnuradio
gr-channels/python/channels/qa_fading_model.py
47
1949
#!/usr/bin/env python # # Copyright 2012,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 optio...
gpl-3.0
tobiaghiraldini/DjangoBBB
docs/source/conf.py
1
8027
# -*- coding: utf-8 -*- # # Django Backbone Boilerplate documentation build configuration file, created by # sphinx-quickstart on Thu Sep 19 19:15:23 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogen...
mit
40223211/cadb_g7_w18test
static/Brython3.1.1-20150328-091302/Lib/textwrap.py
745
16488
"""Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> import re __all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent'] # Hardcode the recognized whitespace characters to the US-ASCII # whit...
gpl-3.0
Workday/OpenFrame
tools/telemetry/third_party/altgraph/doc/conf.py
25
6931
# -*- coding: utf-8 -*- # # altgraph documentation build configuration file, created by # sphinx-quickstart on Tue Aug 31 11:04:49 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
bsd-3-clause
SphinxKnight/kuma
kuma/wiki/tests/test_managers.py
2
10496
from datetime import datetime import pytest from ..constants import REDIRECT_CONTENT from ..models import (Document, DocumentTag, LocalizationTag, ReviewTag, Revision) @pytest.fixture def redirect_doc(root_doc, wiki_user): """A redirect document.""" html = REDIRECT_CONTENT % {'href': r...
mpl-2.0
gigglesninja/senior-design
MissionPlanner/Lib/getpass.py
233
5563
"""Utilities to get a password and/or the current user name. getpass(prompt[, stream]) - Prompt for a password, with echo turned off. getuser() - Get the user name from the environment or password database. GetPassWarning - This UserWarning is issued when getpass() cannot prevent echoing of the passw...
gpl-2.0
ujenmr/ansible
lib/ansible/module_utils/linode.py
41
1985
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
npe9/binutils-gdb
gdb/testsuite/gdb.perf/disassemble.py
46
1514
# Copyright (C) 2013-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 version. # # This progr...
gpl-2.0
soleneulmer/atmos
indicators_molec.py
1
4324
# =================================== # CALCULATES Ioff and Ires # Indicators described in Molecfit II # # Solene 20.09.2016 # =================================== # import numpy as np from astropy.io import fits import matplotlib.pyplot as plt # from PyAstronomy import pyasl from scipy.interpolate import interp1d from ...
mit
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/twisted/internet/_posixserialport.py
18
1823
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Serial Port Protocol """ # system imports import os, errno # dependent on pyserial ( http://pyserial.sf.net/ ) # only tested w/ 1.18 (5 Dec 2002) import serial from serial import PARITY_NONE, PARITY_EVEN, PARITY_ODD from serial import STOPB...
gpl-3.0
Videoclases/videoclases
quality_control/views/api.py
1
4172
import random from django.contrib.auth.decorators import user_passes_test from django.contrib import messages from django.core.urlresolvers import reverse from django.db.models.aggregates import Count from django.http.response import JsonResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404 fro...
gpl-3.0
tchernomax/ansible
lib/ansible/config/manager.py
18
21112
# Copyright: (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 (absolute_import, division, print_function) __metaclass__ = type import io import os import os.path import sys import stat import tempfile import traceback from co...
gpl-3.0
dgsantana/arsenalsuite
cpp/lib/PyQt4/examples/mainwindows/recentfiles.py
17
8720
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-2.0
zanderle/django
tests/aggregation/tests.py
108
45704
from __future__ import unicode_literals import datetime import re from decimal import Decimal from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Aggregate, Avg, Count, DecimalField, DurationField, FloatField, Func, IntegerField, Max, Min, Sum, Valu...
bsd-3-clause
JGrishey/MHLSim
pylib/simulation.py
1
19119
''' Season Simulation 2017 Jacob Grishey For the purpose of simulating sports seasons and determining regular season standings. ''' # IMPORTS import json import statistics import numpy from operator import itemgetter import copy # Read JSON file (schedule, team list) with open("./../data/seas...
mit
ilexius/odoo
addons/membership/__openerp__.py
24
1270
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Membership Management', 'version': '0.1', 'category': 'Association', 'description': """ This module allows you to manage all operations for managing memberships. ==============================...
gpl-3.0
PuZheng/lejian-backend
lejian/apis/model_wrapper.py
1
3211
# -*- coding: UTF-8 -*- import types import inspect import traceback class _MyAttributeError(Exception): pass def convert_attribute_error(f): def f_(*args, **kwargs): try: return f(*args, **kwargs) except AttributeError, e: print "~" * 78 traceback.print...
mit
chouseknecht/ansible
lib/ansible/plugins/filter/core.py
11
21162
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
xuewei4d/scikit-learn
sklearn/decomposition/__init__.py
14
1396
""" The :mod:`sklearn.decomposition` module includes matrix decomposition algorithms, including among others PCA, NMF or ICA. Most of the algorithms of this module can be regarded as dimensionality reduction techniques. """ from ._nmf import NMF, non_negative_factorization from ._pca import PCA from ._incremental_pca...
bsd-3-clause
Senseg/Py4A
python3-alpha/extra_modules/gdata/tlslite/utils/keyfactory.py
48
8803
"""Factory functions for asymmetric cryptography. @sort: generateRSAKey, parseXMLKey, parsePEMKey, parseAsPublicKey, parseAsPrivateKey """ from .compat import * from .RSAKey import RSAKey from .Python_RSAKey import Python_RSAKey from . import cryptomath if cryptomath.m2cryptoLoaded: from .OpenSSL_RSAKey import O...
apache-2.0