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 |
|---|---|---|---|---|---|
scrollback/kuma | vendor/packages/nose/unit_tests/test_xunit.py | 6 | 12405 |
import sys
import os
import optparse
import re
import unittest
from xml.sax import saxutils
from nose.pyversion import UNICODE_STRINGS
from nose.tools import eq_
from nose.plugins.xunit import Xunit, escape_cdata, id_split
from nose.exc import SkipTest
from nose.config import Config
def mktest():
class TC(unitte... | mpl-2.0 |
gx1997/chrome-loongson | chrome/test/functional/chromeos_html_terminal.py | 6 | 1297 | #!/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.
import os
import pyauto_functional # must be imported before pyauto
import pyauto
class ChromeosHTMLTerminalTest(pyauto.PyUITes... | bsd-3-clause |
joariasl/odoo | addons/account/report/account_general_journal.py | 381 | 7669 | # -*- 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 |
Moriadry/tensorflow | tensorflow/python/estimator/canned/dnn_linear_combined_test.py | 46 | 26964 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
hansey/youtube-dl | youtube_dl/extractor/defense.py | 123 | 1240 | from __future__ import unicode_literals
from .common import InfoExtractor
class DefenseGouvFrIE(InfoExtractor):
IE_NAME = 'defense.gouv.fr'
_VALID_URL = r'http://.*?\.defense\.gouv\.fr/layout/set/ligthboxvideo/base-de-medias/webtv/(?P<id>[^/?#]*)'
_TEST = {
'url': 'http://www.defense.gouv.fr/lay... | unlicense |
tiangolo/ansible | v1/tests/TestConstants.py | 164 | 1600 | # -*- coding: utf-8 -*-
import unittest
from ansible.constants import get_config
import ConfigParser
import random
import string
import os
def random_string(length):
return ''.join(random.choice(string.ascii_uppercase) for x in range(6))
p = ConfigParser.ConfigParser()
p.read(os.path.join(os.path.dirname(__fil... | gpl-3.0 |
corvorepack/REPOIVAN | plugin.video.movie.ultra.7k/resources/linkers/pordede.py | 2 | 21842 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Librerías Plugintools por Jesús (www.mimediacenter.info)
import urlparse,urllib2,urllib,re
import os, sys
im... | gpl-2.0 |
leonty/ansible-modules-core | cloud/openstack/os_nova_flavor.py | 21 | 6937 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | gpl-3.0 |
photoninger/ansible | lib/ansible/plugins/action/win_reboot.py | 17 | 8292 | # (c) 2016, Matt Davis <mdavis@ansible.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
import time
from datetime import datetime, timedelta
from ansible.errors import AnsibleErro... | gpl-3.0 |
seberg/numpy | numpy/lib/arraypad.py | 11 | 31226 | """
The arraypad module contains a group of functions to pad values onto the edges
of an n-dimensional array.
"""
import numpy as np
from numpy.core.overrides import array_function_dispatch
from numpy.lib.index_tricks import ndindex
__all__ = ['pad']
################################################################... | bsd-3-clause |
ademmers/ansible | lib/ansible/plugins/lookup/file.py | 14 | 2889 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
name: file
author: Daniel Hok... | gpl-3.0 |
groveco/django-sql-explorer | test_project/settings.py | 2 | 2402 | import django
import os
import djcelery
SECRET_KEY = 'shhh'
DEBUG = True
STATIC_URL = '/static/'
ALLOWED_HOSTS = ['0.0.0.0', 'localhost', '127.0.0.1']
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'tmp',
'T... | mit |
ZeusbaseGameWorkshop/SpriteBuilder | scripts/build_distribution.py | 10 | 8534 | #! /usr/bin/env python
import argparse
import filecmp
import glob
import json
import os
import plistlib
import re
import shutil
import subprocess
import sys
import time
import zipfile
import json
class UserError (Exception):
pass
class BuildDistribution:
def __init__(self):
os.chdir('../');
... | mit |
windyuuy/opera | chromium/src/third_party/python_26/Lib/test/test_colorsys.py | 220 | 2844 | import unittest, test.test_support
import colorsys
def frange(start, stop, step):
while start <= stop:
yield start
start += step
class ColorsysTest(unittest.TestCase):
def assertTripleEqual(self, tr1, tr2):
self.assertEqual(len(tr1), 3)
self.assertEqual(len(tr2), 3)
se... | bsd-3-clause |
dariemp/odoo | addons/l10n_pl/__openerp__.py | 277 | 2158 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 - now Grzegorz Grzelak grzegorz.grzelak@openglobe.pl
# All Rights Reserved
# $Id$
#
# This program is free software: you can redistrib... | agpl-3.0 |
olympian94/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/views/batch.py | 3 | 16428 | from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.shortcuts import render_to_response # render uncomment when to use
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
import json... | agpl-3.0 |
kambysese/mne-python | mne/utils/tests/test_logging.py | 8 | 8193 | import os
import os.path as op
import re
import warnings
import numpy as np
import pytest
from mne import read_evokeds, Epochs
from mne.io import read_raw_fif
from mne.utils import (warn, set_log_level, set_log_file, filter_out_warnings,
verbose, _get_call_line, use_log_level, catch_logging,
... | bsd-3-clause |
RipCazza/schaakmat | schaakmat/board.py | 1 | 21148 | # -*- coding: utf-8 -*-
#
# Schaakmat is a chess engine.
# Copyright (C) 2014 Ruben Bakker <rubykuby@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License... | gpl-3.0 |
ptmr3/GalaxyS4_Kernel | 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 |
dllsf/odootest | openerp/report/render/rml2pdf/trml2pdf.py | 55 | 46027 | # -*- 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 |
opendatakosovo/vitia-workshop-viz | venv/lib/python2.7/site-packages/pip/vendor/html5lib/utils.py | 250 | 2413 | from __future__ import absolute_import, division, unicode_literals
from types import ModuleType
try:
import xml.etree.cElementTree as default_etree
except ImportError:
import xml.etree.ElementTree as default_etree
class MethodDispatcher(dict):
"""Dict with 2 special properties:
On initiation, keys ... | gpl-2.0 |
pratikmallya/hue | desktop/core/ext-py/pysqlite/cross_bdist_wininst.py | 40 | 14061 | # Gerhard Haering <gh@gharing.d> is responsible for the hacked version of this
# module.
#
# This is a modified version of the bdist_wininst distutils command to make it
# possible to build installers *with extension modules* on Unix.
"""distutils.command.bdist_wininst
Implements the Distutils 'bdist_wininst' command... | apache-2.0 |
rooshilp/CMPUT410Lab5 | env-lab5/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py | 51 | 65764 | import sys
import os
import shutil
import re
import zipfile
import pkg_resources
import tempfile
from pip.locations import bin_py, running_under_virtualenv
from pip.exceptions import (InstallationError, UninstallationError,
BestVersionAlreadyInstalled)
from pip.vcs import vcs
from pip.log im... | apache-2.0 |
kongseokhwan/kulcloud-iitp-neutron | neutron/tests/unit/services/test_provider_configuration.py | 22 | 8864 | # Copyright 2013 VMware, 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 ap... | apache-2.0 |
jasonmccampbell/scipy-refactor | scipy/weave/catalog.py | 8 | 29297 | """ Track relationships between compiled extension functions & code fragments
catalog keeps track of which compiled(or even standard) functions are
related to which code fragments. It also stores these relationships
to disk so they are remembered between Python sessions. When
a = 1
compi... | bsd-3-clause |
odoomrp/odoomrp-wip | stock_move_purchase_price/models/stock_move.py | 29 | 1102 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of th... | agpl-3.0 |
duncanwp/cis_plugins | HYSPLIT.py | 1 | 17860 | #import logging
from cis.data_io.Coord import Coord, CoordList
from cis.data_io.products.AProduct import AProduct
from cis.data_io.ungridded_data import UngriddedData, Metadata, UngriddedCoordinates
class HYSPLIT(AProduct):
def get_file_signature(self):
return [r'.*\.dat']
def _create_coord_list(self... | lgpl-3.0 |
martinbede/second-sight | tensorflow/python/kernel_tests/gather_op_test.py | 14 | 3806 | # Copyright 2015 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 a... | apache-2.0 |
chongtianfeiyu/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/commands/bundle.py | 392 | 1787 | import textwrap
from pip.locations import build_prefix, src_prefix
from pip.util import display_path, backup_dir
from pip.log import logger
from pip.exceptions import InstallationError
from pip.commands.install import InstallCommand
class BundleCommand(InstallCommand):
"""Create pybundles (archives containing mul... | lgpl-3.0 |
Rand01ph/shadowsocks | shadowsocks/crypto/mbedtls.py | 10 | 14928 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Void Copyright NO ONE
#
# Void License
#
# The code belongs to no one. Do whatever you want.
# Forget about boring open source license.
#
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
from __future__ import absolute_import, division, print_function, \
with... | apache-2.0 |
blueboxgroup/ursula-monitoring | collectd/plugins/mysql/mysql.py | 3 | 15701 | #!/usr/bin/env python
# CollectD MySQL plugin, designed for MySQL 5.5+ (specifically Percona Server)
#
# Pulls most of the same metrics as the Percona Monitoring Plugins for Cacti,
# however is designed to be used on newer versions of MySQL and as such drops
# all of the legacy compatibility, and favors metrics from SH... | apache-2.0 |
skoppisetty/secret-bugfixes | lib/sqlalchemy/dialects/sqlite/pysqlite.py | 15 | 12938 | # sqlite/pysqlite.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the SQLite database via pysqlite.
Note that pysqlite is the same dr... | gpl-3.0 |
runarberg/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/headerparserhandler.py | 638 | 9836 | # Copyright 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 f... | mpl-2.0 |
dvro/imbalanced-learn | imblearn/under_sampling/one_sided_selection.py | 2 | 8213 | """Class to perform under-sampling based on one-sided selection method."""
from __future__ import print_function
from __future__ import division
import numpy as np
from collections import Counter
from sklearn.neighbors import KNeighborsClassifier
from sklearn.neighbors import NearestNeighbors
from sklearn.utils impo... | mit |
partofthething/home-assistant | tests/components/fritzbox_callmonitor/test_config_flow.py | 7 | 12317 | """Tests for fritzbox_callmonitor config flow."""
from unittest.mock import PropertyMock
from fritzconnection.core.exceptions import FritzConnectionException, FritzSecurityError
from requests.exceptions import ConnectionError as RequestsConnectionError
from homeassistant.components.fritzbox_callmonitor.config_flow im... | mit |
realms-team/basestation-fw | libs/smartmeshsdk-REL-1.3.0.1/libs/VManagerSDK/vmanager/models/data_packet_received.py | 3 | 9217 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | bsd-3-clause |
scripnichenko/nova | nova/cmd/console.py | 38 | 1313 | # Copyright (c) 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
jgcaaprom/android_external_chromium_org | third_party/tlslite/tlslite/x509certchain.py | 118 | 2786 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Class representing an X.509 certificate chain."""
from .utils import cryptomath
from .utils.tackwrapper import *
from .utils.pem import *
from .x509 import X509
class X509CertChain(object):
"""This class represent... | bsd-3-clause |
ccrisan/motionpie | board/raspberrypi/motioneye-modules/boardctl.py | 6 | 6725 |
# Copyright (c) 2015 Calin Crisan
# This file is part of motionPie.
#
# motionEye 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-2.0 |
django-nonrel/django-nonrel | django/contrib/localflavor/se/utils.py | 202 | 2398 | import re
import datetime
def id_number_checksum(gd):
"""
Calculates a Swedish ID number checksum, using the
"Luhn"-algoritm
"""
n = s = 0
for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']):
tmp = ((n % 2) and 1 or 2) * int(c)
if tmp > 9:
tmp = sum([int(... | bsd-3-clause |
Yukarumya/Yukarum-Redfoxes | python/rsa/tests/test_bigfile.py | 34 | 1673 | '''Tests block operations.'''
from rsa._compat import b
try:
from StringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import unittest2
import rsa
from rsa import bigfile, varblock, pkcs1
class BigfileTest(unittest2.TestCase):
def test_encrypt_decrypt_bigfile(self):
# ... | mpl-2.0 |
SGenheden/lammps | python/examples/vizplotgui_pymol.py | 2 | 4487 | #!/usr/bin/env python -i
# preceeding line should have path for Python on your machine
# vizplotgui_pymol.py
# Purpose: viz running LAMMPS simulation via PyMol with plot and GUI
# Syntax: vizplotgui_pymol.py in.lammps Nfreq compute-ID
# in.lammps = LAMMPS input script
# Nfreq = plot data point and v... | gpl-2.0 |
erh3cq/hyperspy | hyperspy/misc/eels/hartree_slater_gos.py | 2 | 6974 | # -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
odoobgorg/odoo | openerp/addons/base/ir/ir_model.py | 5 | 65619 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
import logging
import re
import time
import types
import openerp
from openerp import SUPERUSER_ID
from openerp import models, tools, api
from openerp.modules.registry import RegistryM... | gpl-3.0 |
mcallaghan/tmv | BasicBrowser/tmv_app/management/commands/rerun_dtm.py | 1 | 4873 | from django.core.management.base import BaseCommand, CommandError
from tmv_app.models import *
import numpy as np
from sklearn.decomposition import NMF
from scipy.sparse import csr_matrix, find
from functools import partial
from multiprocess import Pool
from utils.db import *
from utils.utils import *
from scoping.mode... | gpl-3.0 |
CUCWD/edx-platform | common/djangoapps/terrain/stubs/lti.py | 20 | 12690 | """
Stub implementation of LTI Provider.
What is supported:
------------------
1.) This LTI Provider can service only one Tool Consumer at the same time. It is
not possible to have this LTI multiple times on a single page in LMS.
"""
import base64
import hashlib
import textwrap
import urllib
from uuid import uuid4
... | agpl-3.0 |
sigmavirus24/glance | glance/tests/functional/__init__.py | 4 | 32573 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
GNOME/testinggtk | tests/test_menubar.py | 1 | 1130 | '''
Tests for the ``gtk.MenuBar`` class.
'''
import gtk
from gtk import gdk
import gobject
import utils
def test_default_attributes():
menubar = gtk.MenuBar()
assert menubar.get_pack_direction() == gtk.PACK_DIRECTION_LTR
assert menubar.get_child_pack_direction() == gtk.PACK_DIRECTION_LTR
assert len(men... | lgpl-2.1 |
srene/ndnSIM-inrpp | src/ndnSIM/NFD/docs/conf.py | 2 | 9397 | # -*- coding: utf-8 -*-
#
# NFD - Named Data Networking Forwarding Daemon documentation build configuration file, created by
# sphinx-quickstart on Sun Apr 6 19:58:22 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are prese... | gpl-2.0 |
smartboyathome/Markdown-GridTables | test_grid_tables.py | 1 | 1487 | import markdown
markdown_table = \
"""
+-------+----------+------+
| Table Headings | Here |
+-------+----------+------+
| Sub | Headings | Too |
+=======+==========+======+
| cell | column spanning |
+ spans +----------+------+
| rows | normal | cell |
+-------+----------+------+
| multi | cells can be |
... | gpl-3.0 |
ylcolala/scrapy | scrapy/downloadermiddlewares/redirect.py | 30 | 4572 | import logging
from six.moves.urllib.parse import urljoin
from scrapy.http import HtmlResponse
from scrapy.utils.response import get_meta_refresh
from scrapy.exceptions import IgnoreRequest, NotConfigured
logger = logging.getLogger(__name__)
class BaseRedirectMiddleware(object):
enabled_setting = 'REDIRECT_ENA... | bsd-3-clause |
fenglu-g/incubator-airflow | tests/dags/test_mark_success.py | 9 | 1178 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
knewter/ansuz | public/javascripts/fckeditor/editor/filemanager/connectors/py/wsgi.py | 93 | 1629 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | bsd-3-clause |
ShahriyarR/percona-qa | pmm-tests/pmm_stress_test_py_tests/test_module01.py | 3 | 2901 | from pmm_stress_test_py import randomized_instances
import pytest
class TestPMMStress:
"""
Tests for pmm strest test framework
"""
def test_pmm_framework_add_client(self):
"""Checking return value from function"""
print("\nIn test_pmm_framework_add_client()...")
return_value = ... | gpl-2.0 |
shujingke/opencog | opencog/nlp/chatbot/basic_sentiment_analysis.py | 11 | 6919 | # coding: utf-8
"""
basic_sentiment_analysis
~~~~~~~~~~~~~~~~~~~~~~~~
This module contains the code and examples described in
http://fjavieralba.com/basic-sentiment-analysis-with-python.html
Modified by Ruiting Lian, 2016/7
"""
import nltk
import yaml
import sys
import os
import re
class Splitter(object):
def... | agpl-3.0 |
rlutz/xorn | src/backend/gnet_drc.py | 1 | 1867 | # gaf.netlist - gEDA Netlist Extraction and Generation
# Copyright (C) 1998-2010 Ales Hvezda
# Copyright (C) 1998-2010 gEDA Contributors (see ChangeLog for details)
# Copyright (C) 2013-2019 Roland Lutz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-2.0 |
chongtianfeiyu/kbengine | kbe/src/lib/python/Lib/ctypes/test/test_buffers.py | 97 | 2284 | from ctypes import *
from ctypes.test import need_symbol
import unittest
class StringBufferTestCase(unittest.TestCase):
def test_buffer(self):
b = create_string_buffer(32)
self.assertEqual(len(b), 32)
self.assertEqual(sizeof(b), 32 * sizeof(c_char))
self.assertIs(type(b[0]), bytes)... | lgpl-3.0 |
mjroncone/conference-central | ConferenceCentral_Complete/conference.py | 41 | 20715 | #!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import ... | gpl-3.0 |
HEPData/hepdata | hepdata/modules/submission/webpack.py | 1 | 1040 | #
# This file is part of HEPData.
# Copyright (C) 2016 CERN.
#
# HEPData 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.
#
# HEPData is... | gpl-2.0 |
simleo/openmicroscopy | components/tools/OmeroPy/src/omero/util/concurrency.py | 15 | 2981 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# OMERO Concurrency Utilities
#
# Copyright 2009 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
import atexit
import logging
import threading
import omero.util
import logging.handlers
def get_event(name="Unknown... | gpl-2.0 |
thomskaf/stringhelpers | test_stringhelpers.py | 1 | 11602 | from stringhelpers import *
import unittest
class Test(unittest.TestCase):
def setUp(self):
self.random_string = random_string()
self.random_string_password_safe =\
random_string(password_safe=True, length=12)
def test_upcase(self):
self.assertEqual(upcase("down here"), "D... | mit |
Jgarcia-IAS/localizacion | openerp/addons-extra/odoo-pruebas/odoo-server/addons/email_template/ir_actions.py | 281 | 3520 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
r888888888/models | syntaxnet/dragnn/python/composite_optimizer_test.py | 12 | 4661 | # Copyright 2017 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 a... | apache-2.0 |
relic7/prodimages | python/mongo_gridfs_insert_file.py | 1 | 6595 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def connect_gridfs_mongodb(hostname=None,db_name=None):
import pymongo, gridfs, __builtin__
if not hostname:
hostname='127.0.0.1'
try:
mongo = pymongo.MongoClient(hostname, max_pool_size=50, waitQueueMultiple=10)
except pymongo.errors.Conne... | mit |
Neamar/django | django/utils/crypto.py | 452 | 6878 | """
Django's standard crypto functions and utilities.
"""
from __future__ import unicode_literals
import binascii
import hashlib
import hmac
import random
import struct
import time
from django.conf import settings
from django.utils import six
from django.utils.encoding import force_bytes
from django.utils.six.moves i... | bsd-3-clause |
jordanemedlock/psychtruths | temboo/Library/Twilio/Queues/CreateQueue.py | 5 | 4436 | # -*- coding: utf-8 -*-
###############################################################################
#
# CreateQueue
# Creates a new queue within a Twilio account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | apache-2.0 |
cvfish/python_koans | python2/koans/about_monkey_patching.py | 94 | 1361 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Related to AboutOpenClasses in the Ruby Koans
#
from runner.koan import *
class AboutMonkeyPatching(Koan):
class Dog(object):
def bark(self):
return "WOOF"
def test_as_defined_dogs_do_bark(self):
fido = self.Dog()
self.as... | mit |
wzbozon/scikit-learn | sklearn/metrics/cluster/supervised.py | 207 | 27395 | """Utilities to evaluate the clustering performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# Diego Molla <dmolla-aliod@gmail.com>
# License: BSD 3 clause
fr... | bsd-3-clause |
SaschaMester/delicium | ppapi/generators/idl_c_proto.py | 46 | 25722 | #!/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.
""" Generator for C style prototypes and definitions """
import glob
import os
import sys
from idl_log import ErrOut, InfoOut, Wa... | bsd-3-clause |
jpwhite3/wilmu-linux-toolkit | lab_toolkit/includes/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## 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... | mit |
MITRECND/multiscanner | multiscanner/modules/Antivirus/McAfeeScan.py | 2 | 2756 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
import os
import subp... | mpl-2.0 |
jmiserez/pox | pox/forwarding/l2_multi_null_pointer.py | 1 | 12076 | # Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | gpl-3.0 |
MarcosCommunity/odoo | marcos_addons/import_tasks/7to8/partners.py | 2 | 2358 | # -*- coding: utf-8 -*-
from api import source_data, destination_data
from sql import PARTNER_SELECT, PARTNER_INSERT, ir_property_select, ir_property_insert, PARTNER_SELECT_PARENT
source_cur = source_data.cursor()
destination_cur = destination_data.cursor()
source_cur.execute(PARTNER_SELECT)
partner = source_cur.fe... | agpl-3.0 |
androidarmv6/android_external_chromium_org | tools/ipc_messages_log.py | 170 | 4695 | #!/usr/bin/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.
""""Processes a log file and resolves IPC message identifiers.
Resolves IPC messages of the form [unknown type NNNNNN] to named IPC me... | bsd-3-clause |
tantSinnister/doto | doto/model/__init__.py | 2 | 10940 | import collections
import datetime
import pickle
import sqlite3
import importlib
import pytz
DATETIME_FMT = '%Y-%m-%d %H:%M:%S'
def adapt_datetime(dt):
utc_dt = pytz.utc.normalize(dt)
return utc_dt.strftime(DATETIME_FMT).encode('utf-8')
def convert_datetime(str_dt):
stored_dt = datetime.datetime.strp... | bsd-3-clause |
nazo/ansible | lib/ansible/modules/cloud/cloudstack/cs_staticnat.py | 60 | 8274 | #!/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 |
Eficent/odoomrp-wip | product_variants_no_automatic_creation/models/product_configurator.py | 2 | 12754 | # -*- coding: utf-8 -*-
# © 2015 Oihane Crucelaegui - AvanzOSC
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3
from openerp import api, fields, models, exceptions, _
from openerp.addons import decimal_precision as dp
class ProductConfigurator(models.Abstr... | agpl-3.0 |
BrotherPhil/django | tests/fixtures/models.py | 128 | 3287 | """
Fixtures.
Fixtures are a way of loading data into the database in bulk. Fixure data
can be stored in any serializable format (including JSON and XML). Fixtures
are identified by name, and are stored in either a directory named 'fixtures'
in the application directory, or in one of the directories named in the
``FIX... | bsd-3-clause |
FishyFing/FishBot | cogs/alot.py | 1 | 3931 | import discord
from discord.ext import commands
from .utils.dataIO import fileIO
from .utils import checks
from random import randint
from random import choice as randchoice
import os
import re
class Alot:
"""Gives your server invite link to the alots and automatically
@mentions them whenever you say their n... | gpl-3.0 |
zhangxiaolins/python_base | essential/scheduler/filters/extra_specs_ops.py | 2 | 2322 | # Copyright (c) 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
makei/gnome15 | src/gnome15/g15driver.py | 8 | 25167 | # Gnome15 - Suite of tools for the Logitech G series keyboards and headsets
# Copyright (C) 2010 Brett Smith <tanktarta@blueyonder.co.uk>
#
# 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, e... | gpl-3.0 |
projectcalico/calico-nova | nova/scheduler/weights/io_ops.py | 9 | 1752 | # Copyright (c) 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
seem-sky/kbengine | kbe/src/lib/python/Lib/test/test_sys.py | 60 | 38258 | import unittest, test.support
from test.script_helper import assert_python_ok, assert_python_failure
import sys, io, os
import struct
import subprocess
import textwrap
import warnings
import operator
import codecs
import gc
import sysconfig
import platform
# count the number of test runs, used to create unique
# strin... | lgpl-3.0 |
Zhongqilong/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/command/bdist_egg.py | 286 | 18718 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys, os, marshal
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
# Python 2.7 or >=3.2
from sysconfig import get_path, get_python_version
def _g... | lgpl-3.0 |
localwiki/localwiki-backend-server | localwiki/maps/urls_no_region.py | 3 | 2004 | from django.conf.urls import *
from django.views.generic import TemplateView
from utils.constants import DATETIME_REGEXP
from .views import *
from .feeds import MapChangesFeed
urlpatterns = patterns('',
url(r'^map/$', MapFullRegionView.as_view(), name='global'),
url(r'^map/_nearby/?$', MapNearbyView.as_view... | gpl-2.0 |
MichaelBowenSc/about-me | node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py | 1355 | 44604 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... | mit |
e-koch/BaSiCs | basics/fan_pvslice.py | 1 | 3379 |
import numpy as np
from astropy.io.fits import PrimaryHDU
from pvextractor import Path, extract_pv_slice
import scipy.ndimage as nd
from warnings import warn
from spectral_cube import SpectralCube
def pv_wedge(cube, center, length, min_theta, max_theta,
ntheta=90, width=1):
'''
Create a PV slice... | mit |
marty331/jakesclock | flask/lib/python2.7/site-packages/sqlalchemy/testing/plugin/pytestplugin.py | 58 | 5836 | try:
# installed by bootstrap.py
import sqla_plugin_base as plugin_base
except ImportError:
# assume we're a package, use traditional import
from . import plugin_base
import pytest
import argparse
import inspect
import collections
import itertools
try:
import xdist # noqa
has_xdist = True
exc... | gpl-2.0 |
petecummings/django | tests/template_tests/syntax_tests/test_regroup.py | 367 | 3984 | from datetime import date
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class RegroupTagTests(SimpleTestCase):
@setup({'regroup01': ''
'{% regroup data by bar as grouped %}'
'{% for group in gro... | bsd-3-clause |
maikito26/repository.maikito26.storage | debug_files/foscam2.py | 1 | 27251 | """
plugin.video.surveillanceroom
A Kodi add-on by Maikito26
This module is to exploit Foscam HD Cameras, ie FI9821W/P/HD816W/P.
"""
import urllib, sys
import xml.etree.ElementTree as ET
from threading import Thread
import utils
# Foscam error code.
FOSCAM_SUCCESS = 0
ERROR_FOSCAM_FORMAT ... | gpl-2.0 |
palmer-dabbelt/riscv-binutils-gdb | gdb/python/lib/gdb/printer/bound_registers.py | 66 | 1386 | # Pretty-printers for bounds registers.
# 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 o... | gpl-2.0 |
fernandog/Medusa | ext/validators/iban.py | 17 | 1167 | import re
from .utils import validator
regex = (
r'^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'
)
pattern = re.compile(regex)
def char_value(char):
"""A=10, B=11, ..., Z=35
"""
if char.isdigit():
return int(char)
else:
return 10 + ord(char) - ord('A')
def modcheck(value):
"""Check if... | gpl-3.0 |
tvibliani/odoo | addons/delivery/__init__.py | 376 | 1103 | # -*- 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 |
ChristopherHogan/cython | Cython/Tests/TestJediTyper.py | 6 | 6996 | # -*- coding: utf-8 -*-
# tag: jedi
from __future__ import absolute_import
import sys
import os.path
from textwrap import dedent
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from Cython.Compiler.ParseTreeTransforms import NormalizeTree, InterpretCompilerDirectives
from Cython.Compil... | apache-2.0 |
LiveZenLK/CeygateERP | addons/account_bank_statement_import/account_bank_statement_import.py | 14 | 12532 | # -*- coding: utf-8 -*-
import base64
from openerp import api, fields, models, _
from openerp.exceptions import UserError
from openerp.addons.base.res.res_bank import sanitize_account_number
import logging
_logger = logging.getLogger(__name__)
class AccountBankStatementLine(models.Model):
_inherit = "account.b... | gpl-3.0 |
tillahoffmann/tensorflow | tensorflow/python/training/rmsprop_test.py | 113 | 19664 | # 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 |
ojengwa/oh-mainline | vendor/packages/django-celery/docs/conf.py | 16 | 2400 | # -*- coding: utf-8 -*-
import sys
import os
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
sys.path.append(os.path.join(os.pardir, "tests"))
from django.core.management import setup_envi... | agpl-3.0 |
GunoH/intellij-community | python/helpers/docstring_formatter.py | 18 | 11586 | import os
import re
import sys
import textwrap
import six
from six import text_type, u
ENCODING = 'utf-8'
_stdin = os.fdopen(sys.stdin.fileno(), 'rb')
_stdout = os.fdopen(sys.stdout.fileno(), 'wb')
_stderr = os.fdopen(sys.stderr.fileno(), 'wb')
def read_safe():
return _stdin.read().decode(ENCODING)
def print_... | apache-2.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/babel/messages/catalog.py | 19 | 31055 | # -*- coding: utf-8 -*-
"""
babel.messages.catalog
~~~~~~~~~~~~~~~~~~~~~~
Data structures for message catalogs.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import re
import time
from cgi import parse_header
from datetime import datetime, time as time_... | mit |
paulsapps/gmock-1.7.0 | gtest/test/gtest_xml_output_unittest.py | 1815 | 14580 | #!/usr/bin/env python
#
# Copyright 2006, 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-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.