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
justacec/bokeh
bokeh/server/tornado.py
2
15041
''' Provides the Bokeh Server Tornado application. ''' from __future__ import absolute_import, print_function import logging log = logging.getLogger(__name__) import atexit # NOTE: needs PyPI backport on Python 2 (https://pypi.python.org/pypi/futures) from concurrent.futures import ProcessPoolExecutor import os from...
bsd-3-clause
minhphung171093/GreenERP_V7
openerp/addons/report_webkit/webkit_report.py
16
15315
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # Contributor(s) : Florent Xicluna (Wingo SA) # # WARNING: This program as such is intended...
agpl-3.0
Hoekz/hackness-monster
venv/lib/python2.7/site-packages/werkzeug/routing.py
174
66350
# -*- coding: utf-8 -*- """ werkzeug.routing ~~~~~~~~~~~~~~~~ When it comes to combining multiple controller or view functions (however you want to call them) you need a dispatcher. A simple way would be applying regular expression tests on the ``PATH_INFO`` and calling registered callback fun...
mit
Qalthos/ansible
test/units/plugins/connection/test_winrm.py
47
15343
# -*- coding: utf-8 -*- # (c) 2018, Jordan Borean <jborean@redhat.com> # 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 pytest from io import Strin...
gpl-3.0
JCROM-Android/jcrom_external_chromium_org
third_party/tlslite/tlslite/utils/rijndael.py
359
11341
""" A pure python (slow) implementation of rijndael with a decent interface To include - from rijndael import rijndael To do a key setup - r = rijndael(key, block_size = 16) key must be a string of length 16, 24, or 32 blocksize must be 16, 24, or 32. Default is 16 To use - ciphertext = r.encrypt(plaintext) plai...
bsd-3-clause
great-expectations/great_expectations
tests/datasource/test_batch_generators.py
1
6706
import os from great_expectations.datasource.batch_kwargs_generator import ( DatabricksTableBatchKwargsGenerator, GlobReaderBatchKwargsGenerator, SubdirReaderBatchKwargsGenerator, ) try: from unittest import mock except ImportError: from unittest import mock def test_file_kwargs_generator( d...
apache-2.0
thumbimigwe/echorizr
lib/python2.7/site-packages/django/template/loaders/cached.py
19
7094
""" Wrapper class that takes a list of template loaders as an argument and attempts to load templates from them in order, caching the result. """ import hashlib import warnings from django.template import Origin, Template, TemplateDoesNotExist from django.template.backends.django import copy_exception from django.uti...
mit
glls/Cinnamon
files/usr/share/cinnamon/cinnamon-settings/modules/cs_workspaces.py
3
2070
#!/usr/bin/python3 from SettingsWidgets import SidePage from xapp.GSettingsWidgets import * class Module: name = "workspaces" category = "prefs" comment = _("Manage workspace preferences") def __init__(self, content_box): keywords = _("workspace, osd, expo, monitor") sidePage = SideP...
gpl-2.0
smunix/ns-3-rfid
src/wifi/bindings/modulegen__gcc_LP64.py
2
742364
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
stephen144/odoo
addons/gamification/tests/test_challenge.py
39
4253
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.tests import common class test_challenge(common.TransactionCase): def setUp(self): super(test_challenge, self).setUp() cr, uid = self.cr, self.uid self.data_obj = self.registry...
agpl-3.0
ericmok/eri53
learn/libsvm-3.12/tools/checkdata.py
144
2479
#!/usr/bin/env python # # A format checker for LIBSVM # # # Copyright (c) 2007, Rong-En Fan # # All rights reserved. # # This program is distributed under the same license of the LIBSVM package. # from sys import argv, exit import os.path def err(line_no, msg): print("line {0}: {1}".format(line_no, msg)) # works...
unlicense
ekeih/libtado
docs/source/conf.py
1
4718
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # libtado documentation build configuration file, created by # sphinx-quickstart on Thu Feb 16 17:11:41 2017. # # 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 # au...
gpl-3.0
jswope00/GAI
common/djangoapps/user_api/tests/test_models.py
52
1757
from django.db import IntegrityError from django.test import TestCase from student.tests.factories import UserFactory from user_api.tests.factories import UserPreferenceFactory from user_api.models import UserPreference class UserPreferenceModelTest(TestCase): def test_duplicate_user_key(self): user = Use...
agpl-3.0
er432/TASSELpy
TASSELpy/net/maizegenetics/trait/CombinePhenotype.py
1
4297
from TASSELpy.utils.helper import make_sig from TASSELpy.utils.Overloading import javaOverload, javaConstructorOverload, javaStaticOverload from TASSELpy.net.maizegenetics.trait.AbstractPhenotype import AbstractPhenotype from TASSELpy.net.maizegenetics.trait.Phenotype import Phenotype from TASSELpy.net.maizegenetics.tr...
bsd-3-clause
dario61081/koalixcrm
koalixcrm/accounting/rest/restinterface.py
2
2538
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from rest_framework import viewsets from koalixcrm.accounting.models import Account, AccountingPeriod, Booking, ProductCategory from koalixcrm.accounti...
bsd-3-clause
jblackburne/scikit-learn
sklearn/gaussian_process/gpc.py
42
31571
"""Gaussian processes classification.""" # Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # # License: BSD 3 clause import warnings from operator import itemgetter import numpy as np from scipy.linalg import cholesky, cho_solve, solve from scipy.optimize import fmin_l_bfgs_b from scipy.special import erf...
bsd-3-clause
lidiamcfreitas/FenixScheduleMaker
ScheduleMaker/brython/www/src/Lib/encodings/cp1254.py
37
13809
""" Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def d...
bsd-2-clause
chainer/chainer
chainer/utils/sparse.py
3
7680
import numpy import chainer from chainer import backend from chainer import cuda def _add_at(add_at, x, row, col, data): assert data.size > 0 last_nz = data.size - (data != 0)[::-1].argmax() add_at(x, (row[:last_nz], col[:last_nz]), data[:last_nz]) class CooMatrix(object): """A sparse matrix in CO...
mit
sudheesh001/oh-mainline
vendor/packages/scrapy/scrapy/contrib/httpcache.py
16
2156
from __future__ import with_statement import os from time import time import cPickle as pickle from scrapy.http import Headers from scrapy.responsetypes import responsetypes from scrapy.utils.request import request_fingerprint from scrapy.utils.project import data_path from scrapy import conf class DbmCacheStorage(...
agpl-3.0
proudlygeek/proudlygeek-blog
pygments/lexers/other.py
14
129636
# -*- coding: utf-8 -*- """ pygments.lexers.other ~~~~~~~~~~~~~~~~~~~~~ Lexers for other languages. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \ ...
mit
tdtrask/ansible
test/units/modules/network/onyx/test_onyx_vlan.py
15
3728
# # (c) 2016 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 option) any later version. # # Ansible is d...
gpl-3.0
wunderlins/learning
python/zodb/lib/osx/ZODB/MappingStorage.py
2
11501
############################################################################## # # Copyright (c) Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE...
gpl-2.0
muhleder/timestrap
timestrap/settings/base.py
1
3215
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname( os.path.dirname( os.path.dirname( os.path.abspath(__file__) ) ) ) # SECURITY WARNING: set this to your domain name in production! ALLOWED_HOSTS = ['*'] # Application ...
bsd-2-clause
nimbusproject/epumgmt
src/python/tests/test_epumgmt_defaults_log_events.py
1
16586
import os import shutil import tempfile import ConfigParser import epumgmt.defaults.log_events from epumgmt.defaults import DefaultParameters from mocks.common import FakeCommon class TestAmqpEvents: def setup(self): self.runlogdir = tempfile.mkdtemp() self.vmlogdir = tempfile.mkdtemp() ...
apache-2.0
maljac/odoo-addons
partner_views_fields/res_config.py
1
1422
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models class partner...
agpl-3.0
dennisss/sympy
sympy/assumptions/tests/test_assumptions_2.py
30
1961
""" rename this to test_assumptions.py when the old assumptions system is deleted """ from sympy.abc import x, y from sympy.assumptions.assume import global_assumptions, Predicate from sympy.assumptions.ask import _extract_facts, Q from sympy.core import symbols from sympy.logic.boolalg import Or from sympy.printing im...
bsd-3-clause
hbrunn/OCB
addons/account/report/account_partner_balance.py
286
11049
# -*- 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
haeusser/tensorflow
tensorflow/contrib/legacy_seq2seq/python/kernel_tests/seq2seq_test.py
5
43745
# 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
qizenguf/MLC-STT
src/mem/AddrMapper.py
69
3530
# Copyright (c) 2012 ARM Limited # 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 implementation of the functionality ...
bsd-3-clause
bzbarsky/servo
tests/wpt/css-tests/tools/html5lib/html5lib/ihatexml.py
1727
16581
from __future__ import absolute_import, division, unicode_literals import re import warnings from .constants import DataLossWarning baseChar = """ [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E] | [#x0180-...
mpl-2.0
9929105/KEEP
keep_backend/tests/test_api/test_data_api.py
2
3603
''' Makes HTTP requests to each of our Data API functions to ensure there are no templating/etc errors on the pages. ''' import json from tests import ApiTestCase class DataApiV1KeyTests( ApiTestCase ): AUTH_DETAILS = { 'format': 'json', 'user': 'admin', 'ke...
mit
nickoe/asciidoc
asciidocapi.py
85
8424
#!/usr/bin/env python """ asciidocapi - AsciiDoc API wrapper class. The AsciiDocAPI class provides an API for executing asciidoc. Minimal example compiles `mydoc.txt` to `mydoc.html`: import asciidocapi asciidoc = asciidocapi.AsciiDocAPI() asciidoc.execute('mydoc.txt') - Full documentation in asciidocapi.txt. ...
gpl-2.0
arcticshores/kivy
kivy/core/image/img_pil.py
37
3535
''' PIL: PIL image loader ''' __all__ = ('ImageLoaderPIL', ) try: from PIL import Image as PILImage except: import Image as PILImage from kivy.logger import Logger from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader class ImageLoaderPIL(ImageLoaderBase): '''Image loader based on the PIL...
mit
ksachs/invenio
modules/bibindex/lib/bibindex_engine.py
1
101146
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, ## 2010, 2011, 2012, 2013 CERN. ## ## Invenio 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 Softwar...
gpl-2.0
google/mobly
mobly/controllers/android_device.py
1
38734
# 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 law or agreed to in writing, ...
apache-2.0
benjaminbrinkman/open-ad-platform
.venv/lib/python3.4/site-packages/_markerlib/markers.py
1769
3979
# -*- coding: utf-8 -*- """Interpret PEP 345 environment markers. EXPR [in|==|!=|not in] EXPR [or|and] ... where EXPR belongs to any of those: python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1]) python_full_version = sys.version.split()[0] os.name = os.name sys.platform = sys.platfo...
mit
neilhan/tensorflow
tensorflow/python/ops/histogram_ops.py
12
3799
# 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
ccpgames/eve-metrics
web2py/applications/admin/languages/ru-ru.py
1
23612
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Update" ist ein optionaler Ausdruck wie "Feld1 = \'newvalue". JOIN Ergebnisse können nicht aktualisiert oder gelöscht werden', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d...
mit
egabancho/invenio
invenio/modules/oauth2server/provider.py
1
3287
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio 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) a...
gpl-2.0
dsquareindia/scikit-learn
sklearn/decomposition/tests/test_fastica.py
70
7808
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less ...
bsd-3-clause
msebire/intellij-community
python/helpers/pydev/pydevconsole.py
1
12520
''' Entry point module to start the interactive console. ''' from _pydev_bundle._pydev_getopt import gnu_getopt from _pydev_comm.rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client from _pydev_imps._pydev_saved_modules import thread start_new_thread = thread.start_new_thread try: from c...
apache-2.0
MarauderXtreme/sipa
sipa/model/finance.py
1
2369
from abc import ABCMeta, abstractmethod from flask_babel import gettext from sipa.model.fancy_property import ActiveProperty, Capabilities from sipa.units import format_money from sipa.utils import compare_all_attributes class BaseFinanceInformation(metaclass=ABCMeta): """A Class providing finance information a...
mit
untom/scikit-learn
sklearn/decomposition/base.py
313
5647
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Kyle Kastner <kastnerkyle@gmail.com> # # Licen...
bsd-3-clause
rogerthat-platform/rogerthat-backend
src-test/rogerthat_tests/mobicage/bizz/test_system.py
1
1331
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology 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...
apache-2.0
oceane10712/software_testing_stage2
test/gtest_shuffle_test.py
3023
12549
#!/usr/bin/env python # # Copyright 2009 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
bsd-3-clause
LuqueDaniel/ninja-ide
ninja_ide/gui/dialogs/preferences/preferences_editor_configuration.py
6
13499
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
gpl-3.0
catchmrbharath/servo
tests/wpt/css-tests/tools/html5lib/html5lib/constants.py
963
87346
from __future__ import absolute_import, division, unicode_literals import string import gettext _ = gettext.gettext EOF = None E = { "null-character": _("Null character in input stream, replaced with U+FFFD."), "invalid-codepoint": _("Invalid codepoint in stream."), "incorrectly-placed-so...
mpl-2.0
99designs/colorific
setup.py
1
1724
# -*- coding: utf-8 -*- # # setup.py # colorific # """ Package information for colorific. """ import os.path import platform try: from setuptools import setup except ImportError: from distutils.core import setup PROJECT_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__))) README_PATH = os.path....
isc
hdinsight/hue
desktop/core/ext-py/elementtree/elementtree/__init__.py
127
1491
# $Id: __init__.py 1821 2004-06-03 16:57:49Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2004 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you ...
apache-2.0
haojunyu/numpy
numpy/ma/mrecords.py
90
27383
""":mod:`numpy.ma..mrecords` Defines the equivalent of :class:`numpy.recarrays` for masked arrays, where fields can be accessed as attributes. Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes and the masking of individual fields. .. moduleauthor:: Pierre Gerard-Marchant """ from __future...
bsd-3-clause
ewjoachim/dropbox-sdk-python
dropbox/session.py
3
13077
import pkg_resources import six import ssl import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.poolmanager import PoolManager _TRUSTED_CERT_FILE = pkg_resources.resource_filename(__name__, 'trusted-certs.crt') # TODO(kelkabany): We probably only want to instantiate this once so...
mit
hutchison/bp_mgmt
bp_cupid/views/Student.py
1
2805
from django.shortcuts import render, get_object_or_404 from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required, user_passes_test from django.views.generic import View from ..models import ( Student, Gewicht, Platz, Zeitraum, ) class StudentDetail...
agpl-3.0
dmargala/qusp
examples/compare_delta.py
1
7364
#!/usr/bin/env python import argparse import numpy as np import numpy.ma as ma import h5py import qusp import matplotlib.pyplot as plt import scipy.interpolate import fitsio class DeltaLOS(object): def __init__(self, thing_id): path = '/data/lya/deltas/delta-%d.fits' % thing_id hdulist = fitsio....
mit
pjryan126/solid-start-careers
store/api/glassdoor/venv/lib/python2.7/site-packages/requests/packages/chardet/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-2.0
edxnercel/edx-platform
lms/djangoapps/lti_provider/users.py
80
5166
""" LTI user management functionality. This module reconciles the two identities that an individual has in the campus LMS platform and on edX. """ import string import random import uuid from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.auth.models import User fr...
agpl-3.0
KhalidGit/flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/flask/_compat.py
783
2164
# -*- coding: utf-8 -*- """ flask._compat ~~~~~~~~~~~~~ Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys PY...
apache-2.0
botchat/botclassifier
pythonbotchat/cleverbot/cleverbot_chat.py
1
1770
""" It is very simple selnium based code which cat with clevarbot and genrate log from chat """ import time from datetime import datetime from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_con...
mit
dbbhattacharya/kitsune
kitsune/users/migrations/0002_move_nbNO_to_no_locale.py
4
6682
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """Switch all 'nb-NO' users to 'no'.""" orm.Profile.objects.filter(locale='nb-NO').update(locale='no') def b...
bsd-3-clause
gtmanfred/livestreamer
src/livestreamer/plugins/common_swf.py
38
1135
from collections import namedtuple from io import BytesIO from livestreamer.utils import swfdecompress from livestreamer.packages.flashmedia.types import U16LE, U32LE __all__ = ["parse_swf"] Rect = namedtuple("Rect", "data") Tag = namedtuple("Tag", "type data") SWF = namedtuple("SWF", "frame_size frame_rate frame_co...
bsd-2-clause
NicoloPernigo/portia
slybot/slybot/linkextractor/xml.py
15
1521
""" Link extraction for auto scraping """ from scrapy.link import Link from scrapy.selector import Selector from slybot.linkextractor.base import BaseLinkExtractor class XmlLinkExtractor(BaseLinkExtractor): """Link extractor for XML sources""" def __init__(self, xpath, **kwargs): self.remove_namespace...
bsd-3-clause
hakehuang/rt-thread
components/external/freetype/src/tools/glnames.py
360
105239
#!/usr/bin/env python # # # FreeType 2 glyph name builder # # Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LI...
gpl-2.0
jeremyblalock/translucent
translucent.py
1
1658
#!/usr/bin/python import sys, re class Color(object): def __init__(self, inp, alpha=1): self.alpha = alpha if type(inp) is str: if re.match(r'^#\d{3}$', inp): inp = '#' + inp[1] * 2 + inp[2] * 2 + inp[3] * 2 if re.match(r'^#\d{6}$', inp): se...
mit
petrk94/Bytebot
plugins/weather.py
1
1832
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from time import time from plugins.plugin import Plugin from bytebot_config import BYTEBOT_PLUGIN_CONFIG import requests class weather(Plugin): """ The weather function read the current temperature of the city Erfurt. It is necessary to register to get an A...
mit
goliate/sarakha63-persomov
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/freespeech.py
165
1226
from __future__ import unicode_literals import re import json from .common import InfoExtractor class FreespeechIE(InfoExtractor): IE_NAME = 'freespeech.org' _VALID_URL = r'https://www\.freespeech\.org/video/(?P<title>.+)' _TEST = { 'add_ie': ['Youtube'], 'url': 'https://www.freespeech.o...
gpl-3.0
infirit/blueman
blueman/main/Tray.py
2
2373
from importlib import import_module import logging import os import sys from blueman.main.DBusProxies import AppletService from gi.repository import Gio, GLib class BluemanTray(Gio.Application): def __init__(self) -> None: super().__init__(application_id="org.blueman.Tray", flags=Gio.ApplicationFlags.FLAG...
gpl-3.0
rsj217/tongdao
app/libs/router.py
1
1736
#!/usr/bin/env python # -*- coding:utf-8 -*- # # The route helpers were originally written by # # Jeremy Kelley (http://github.com/nod). import tornado.web class Route(object): """ decorates RequestHandlers and builds up a list of routables handlers Tech Notes (or 'What the *@# is really happening here...
mit
moondrop-entertainment/django-nonrel-drawp
django/conf/locale/sr_Latn/formats.py
655
1980
# -*- 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 = 'H:i' DATETIME_FORMAT = 'j. F Y. H:i' YEAR_MONTH_F...
bsd-3-clause
mvesper/invenio-demosite
invenio_demosite/testsuite/regression/test_bibindex.py
7
67493
# -*- coding: utf-8 -*- # # This file is part of Invenio Demosite. # Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013 CERN. # # Invenio Demosite 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...
gpl-2.0
xujb/odoo
addons/mrp/company.py
381
1383
# -*- 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
x303597316/hue
apps/useradmin/src/useradmin/views.py
13
36325
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
pataquets/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/driver.py
113
25616
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
vivek8943/GeoTweetSearch
api/web/twitter_instance.py
1
17775
import json import logging from threading import RLock import time from api.caching.instance_codes import consumeCode, unconsumeCode from api.caching.instance_lifetime import removeInstance, addInstance, setInstanceTemporalSourceLastTime from api.caching.temporal_analytics import getTemporalInfluenceCollection, addTemp...
apache-2.0
psawaya/Mental-Ginger
django/core/servers/basehttp.py
153
25156
""" BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21). Adapted from wsgiref.simple_server: http://svn.eby-sarna.com/wsgiref/ This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. Don't use it for production use. """ from BaseHTTPSe...
bsd-3-clause
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/reportlab-3.2.0/tests/test_platypus_toc.py
14
12157
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details """Tests for the Platypus TableOfContents class. Currently there is only one such test. Most such tests, like this one, will be generating a PDF document that needs to be eye-balled in order to find out if it is 'correct'. """ __version__=...
mit
google/llvm-propeller
llvm/utils/extract_vplan.py
7
1612
#!/usr/bin/env python # This script extracts the VPlan digraphs from the vectoriser debug messages # and saves them in individual dot files (one for each plan). Optionally, and # providing 'dot' is installed, it can also render the dot into a PNG file. from __future__ import print_function import sys import re impor...
apache-2.0
CCI-MOC/nova
plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py
70
4923
# Copyright (c) 2010 Citrix 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.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
guildai/guild
examples/iris-svm/plot_iris_exercise.py
1
1702
""" A tutorial exercise for using different SVM kernels. Adapted from: https://scikit-learn.org/stable/auto_examples/exercises/plot_iris_exercise.html """ import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from sklearn import datasets, svm kernel = 'linear' # choice of line...
apache-2.0
tigerking/pyvision
src/pyvision/types/Perspective.py
1
10434
# PyVision License # # Copyright (c) 2006-2008 David S. Bolme # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, thi...
bsd-3-clause
mfcabrera/luigi
luigi/interface.py
4
9193
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
ImaginationForPeople/sockjs-tornado
sockjs/tornado/transports/htmlfile.py
10
2418
# -*- coding: utf-8 -*- """ sockjs.tornado.transports.htmlfile ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HtmlFile transport implementation. """ from tornado.web import asynchronous from sockjs.tornado import proto from sockjs.tornado.transports import streamingbase # HTMLFILE template HTMLFILE_HEAD = r''' <!do...
mit
jcchin/MagnePlane
src/hyperloop/Python/tube/tube_wall_temp.py
4
21199
"""The `TubeTemp` group represents a cycle of explicit and implicit calculations to determine the steady state temperature of the hyperloop tube. The `TubeWallTemp` calculates Q released/absorbed by hyperloop tube due to: Internal Convection, Tube Conduction, Ambient Natural Convection, Solar...
apache-2.0
jaruba/chromium.src
sync/tools/testserver/chromiumsync.py
18
65492
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """An implementation of the server side of the Chromium sync protocol. The details of the protocol are described mostly by comments in the protocol buffer d...
bsd-3-clause
T-J-Teru/synopsys-binutils-gdb
gdb/python/lib/gdb/command/prompt.py
107
2135
# Extended prompt. # Copyright (C) 2011-2012 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 vers...
gpl-2.0
savi-dev/keystone
tests/test_ssl.py
3
3769
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requir...
apache-2.0
danyaqp/gr-baz
python/borip_server.py
3
45491
#!/usr/bin/env python """ BorIP Server By Balint Seeber Part of gr-baz (http://wiki.spench.net/wiki/gr-baz) Protocol specification: http://wiki.spench.net/wiki/BorIP """ from __future__ import with_statement import time, os, sys, threading, thread, traceback # , gc from string import split, join from optparse impor...
gpl-3.0
suutari-ai/shoop
shuup/core/models/_currencies.py
3
2858
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals import decimal import ba...
agpl-3.0
DalikarFT/CFVOP
venv/Lib/site-packages/pip/_vendor/requests/structures.py
615
3012
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections from .compat import OrderedDict class CaseInsensitiveDict(collections.MutableMapping): """A case-insensitive ``dict``-like object. Implements all methods and operations of `...
gpl-3.0
PUM-9/mickwald_client
scripts/mickClient.py
1
1457
#!/usr/bin/env python import rospy from chat_server.msg import Message import sys def select_mode(): mode = sys.argv[sys.argv.__len__()-1] if mode == 'read': read_client() if mode == 'send': run_client() if mode != 'read': if mode != 'send': print("Usage: use \"rea...
gpl-3.0
nomaro/SickBeard_Backup
sickbeard/clients/requests/packages/urllib3/request.py
245
5873
# urllib3/request.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php try: from urllib.parse import urlencode except ImportError: from urllib import urlencod...
gpl-3.0
cvegaj/ElectriCERT
venv3/lib/python3.6/site-packages/pip/vcs/__init__.py
344
12374
"""Handles all VCS (version control) support""" from __future__ import absolute_import import errno import logging import os import shutil import sys from pip._vendor.six.moves.urllib import parse as urllib_parse from pip.exceptions import BadCommand from pip.utils import (display_path, backup_dir, call_subprocess, ...
gpl-3.0
timoreimann/kubernetes
vendor/github.com/ugorji/go/codec/test.py
1516
4019
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
apache-2.0
Red-M/CloudBot-legacy
plugins/horoscope.py
6
1731
# Plugin by Infinity - <https://github.com/infinitylabs/UguuBot> from util import hook, http, text db_ready = False def db_init(db): """check to see that our db has the horoscope table and return a connection.""" global db_ready if not db_ready: db.execute("create table if not exists horoscope(n...
gpl-3.0
ZuluPro/libcloud
libcloud/test/compute/test_medone.py
12
1295
# 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
fengsp/flask-snippets
utilities/content_negotiated_error.py
2
1167
# -*- coding: utf-8 -*- """ utilities.context_global_socketio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using Context Globals with Gevent-Socketio http://flask.pocoo.org/snippets/105/ """ import os import sys sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from socketio import...
bsd-3-clause
Floobits/plugin-common-python
repo.py
8
1963
import os import stat import subprocess from xml.etree import ElementTree try: from . import api, msg from . import shared as G from .exc_fmt import str_e assert api and G and msg and str_e except ImportError: import api import msg import shared as G from exc_fmt import str_e REPO_MAP...
apache-2.0
jzt5132/scikit-learn
examples/svm/plot_rbf_parameters.py
132
8096
''' ================== RBF SVM parameters ================== This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radial Basis Function (RBF) kernel SVM. Intuitively, the ``gamma`` parameter defines how far the influence of a single training example reaches, with low values meaning 'far' a...
bsd-3-clause
margaritis/iTerm2
tests/esctest/escargs.py
31
2509
import argparse # To enable this option, add the following line to ~/.Xresources: # xterm*disallowedWindowOps: # Then run "xrdb -merge ~/.Xresources" and restart xterm. XTERM_WINOPS_ENABLED = "xtermWinopsEnabled" DISABLE_WIDE_CHARS = "disableWideChars" ACTION_RUN="run" ACTION_LIST_KNOWN_BUGS="list-known-bugs" parser...
gpl-2.0
splav/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/python/integration.py
30
13137
import pytest from _pytest import python from _pytest import runner class TestOEJSKITSpecials(object): def test_funcarg_non_pycollectobj(self, testdir): # rough jstests usage testdir.makeconftest( """ import pytest def pytest_pycollect_makeitem(collector, name, obj): ...
mpl-2.0
2013Commons/hue
desktop/core/ext-py/tablib-develop/tablib/packages/markup3.py
65
19129
# This code is in the public domain, it comes # with absolutely no warranty and you can do # absolutely whatever you want with it. __date__ = '17 May 2007' __version__ = '1.7' __doc__= """ This is markup.py - a Python module that attempts to make it easier to generate HTML/XML from a Python program in an intuitive, li...
apache-2.0
igors10099/ilona
p2pool/util/deferral.py
45
5679
from __future__ import division import itertools import random import sys from twisted.internet import defer, reactor from twisted.python import failure, log def sleep(t): d = defer.Deferred() reactor.callLater(t, d.callback, None) return d def run_repeatedly(f, *args, **kwargs): current_dc = [None]...
gpl-3.0