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 |
|---|---|---|---|---|---|
bwsblake/lettercounter | django-norel-env/lib/python2.7/site-packages/django/core/serializers/pyyaml.py | 110 | 2353 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import decimal
import yaml
from io import StringIO
from django.db import models
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSerializer
fr... | mit |
malaterre/serna-free-backup | 3rd/pyqt/4.4.4/_patches/darwin/patch-configure.py | 10 | 1464 | *** xx/configure.py.orig 2005-05-11 20:01:53.719957680 +0400
--- xx/configure.py 2005-05-11 20:05:29.699123856 +0400
@@ -721,7 +721,7 @@
from distutils.sysconfig import get_confi... | gpl-3.0 |
Jorge-Rodriguez/ansible | lib/ansible/modules/network/bigswitch/bcf_switch.py | 51 | 5086 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ted Elhourani <ted@bigswitch.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
ratoaq2/Flexget | flexget/utils/cached_input.py | 11 | 7780 | from __future__ import unicode_literals, division, absolute_import
import copy
import logging
import hashlib
from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, String, DateTime, PickleType, Unicode, ForeignKey
from sqlalchemy.orm import relation
from flexget import db_schema
from flexget... | mit |
EvanK/ansible | lib/ansible/modules/network/f5/bigip_profile_tcp.py | 14 | 15310 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
saquiba2/numpy2 | numpy/core/info.py | 165 | 4690 | """Defines a multi-dimensional array and useful procedures for Numerical computation.
Functions
- array - NumPy Array construction
- zeros - Return an array of all zeros
- empty - Return an unitialized array
- shape - Return s... | bsd-3-clause |
jeremiahmarks/sl4a | python/src/Lib/compiler/misc.py | 278 | 1794 |
def flatten(tup):
elts = []
for elt in tup:
if isinstance(elt, tuple):
elts = elts + flatten(elt)
else:
elts.append(elt)
return elts
class Set:
def __init__(self):
self.elts = {}
def __len__(self):
return len(self.elts)
def __contains__(s... | apache-2.0 |
rubendura/django-rest-framework | tests/test_atomic_requests.py | 60 | 5244 | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from django.db import connection, connections, transaction
from django.http import Http404
from django.test import TestCase, TransactionTestCase
from django.utils.decorators import method_decorator
from django.utils.unittest import skip... | bsd-2-clause |
stutivarshney/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/core/management/commands/compilemessages.py | 115 | 5211 | from __future__ import unicode_literals
import codecs
import glob
import os
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import find_command, popen_wrapper
from django.utils._os import npath, upath
def has_bom(fn):
with open(fn, 'rb') as f:
sample =... | gpl-3.0 |
ESS-LLP/erpnext-healthcare | erpnext/patches/v5_4/notify_system_managers_regarding_wrong_tax_calculation.py | 29 | 1452 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from frappe.email import sendmail_to_system_managers
from frappe.utils import get_link_to_form
def execute():
wrong_r... | gpl-3.0 |
elmerdpadilla/iv | addons/base_gengo/ir_translation.py | 343 | 4344 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
163gal/Time-Line | libs64/wx/lib/agw/ribbon/art_aui.py | 6 | 55653 | """
L{RibbonAUIArtProvider} is responsible for drawing all the components of the ribbon
interface using an AUI-compatible appearance.
Description
===========
This allows a ribbon bar to have a pluggable look-and-feel, while retaining the same
underlying behaviour. As a single art provider is used for all ribbon comp... | gpl-3.0 |
EduPepperPD/pepper2013 | common/djangoapps/student/management/commands/pearson_export_ead.py | 15 | 4569 | import csv
import os
from collections import OrderedDict
from datetime import datetime
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from student.models import TestCenterRegistration, ACCOMMODATION_REJECTED_CODE
from pytz import UTC... | agpl-3.0 |
jylaxp/django | tests/foreign_object/models/person.py | 182 | 3163 | import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Country(models.Model):
# Table Column Fields
name = models.CharField(max_length=50)
def __str__(self):
return self.name
@python_2_unicode_compatible
cla... | bsd-3-clause |
xuleiboy1234/autoTitle | tensorflow/tensorflow/contrib/distributions/python/ops/vector_exponential_linear_operator.py | 29 | 10509 | # 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... | mit |
martyone/sailfish-qtcreator | tests/system/suite_tools/tst_git_first_commit/test.py | 2 | 4000 | #############################################################################
##
## Copyright (C) 2015 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance wit... | lgpl-2.1 |
stackforge/networking-mlnx | networking_mlnx/tests/unit/ml2/drivers/mlnx/test_mlnx_neutron_agent.py | 2 | 10758 | # Copyright 2014 Mellanox Technologies, Ltd
#
# 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 t... | apache-2.0 |
jolyonb/edx-platform | lms/djangoapps/courseware/management/commands/clean_xml.py | 1 | 4518 | from __future__ import print_function
import os
import sys
import traceback
import lxml.etree
from django.core.management.base import BaseCommand
from fs.osfs import OSFS
from path import Path as path
from xmodule.modulestore.xml import XMLModuleStore
def traverse_tree(course):
"""
Load every descriptor in... | agpl-3.0 |
snasoft/QtCreatorPluginsPack | Bin/3rdParty/vera/bin/lib/test/test_abc.py | 119 | 7715 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Unit tests for abc.py."""
import unittest, weakref
from test import test_support
import abc
from inspect import isabstract
class TestABC(unittest.TestCase):
def test_abstractmethod_basics(self):
@abc... | lgpl-3.0 |
crichardson17/starburst_atlas | Low_resolution_sims/DustFree_LowRes/Geneva_noRot_cont/Geneva_noRot_cont_age5/UV2.py | 33 | 7365 | import csv
import matplotlib.pyplot as plt
from numpy import *
import scipy.interpolate
import math
from pylab import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import matplotlib.patches as patches
from matplotlib.path import Path
import os
# --------------------------------------------------... | gpl-2.0 |
keakon/gunicorn | examples/frameworks/django/testing/testing/settings.py | 22 | 5557 | # Django settings for testing project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'testdb... | mit |
ojii/sandlib | lib/lib-python/2.7/test/test_thread.py | 4 | 7625 | import os
import unittest
import random
from test import test_support
thread = test_support.import_module('thread')
import time
import sys
import weakref
from test import lock_tests
NUMTASKS = 10
NUMTRIPS = 3
_print_mutex = thread.allocate_lock()
def verbose_print(arg):
"""Helper function for printing out debu... | bsd-3-clause |
camptocamp/QGIS | python/plugins/db_manager/db_manager_plugin.py | 5 | 2832 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
dekom/threepress-bookworm-read-only | bookworm/library/google_books/search.py | 7 | 3335 | # Represents a response from the Google Books API
from lxml import etree
import urllib2, logging
log = logging.getLogger('google_books.search')
API = 'http://books.google.com/books/feeds/volumes'
NS = {'atom': 'http://www.w3.org/2005/Atom',
'openSearch': 'http://a9.com/-/spec/opensearchrss/1.0/',
'gbs' :... | bsd-3-clause |
ocr-doacao/ocr | ocrDoacao/testes/teste_notafiscal.py | 1 | 2960 | from django.test import TestCase
from ocrDoacao.models import NotaFiscal
import datetime
class NotaFiscalTest(TestCase):
def test_validacao_cnpj(self):
validacao = NotaFiscal.validaCNPJ('11.111.111/1111-11')
self.assertEqual(validacao, False)
validacao = NotaFiscal.validaCNPJ('12.aaa11... | apache-2.0 |
jonparrott/gcloud-python | datastore/google/cloud/datastore_v1/gapic/enums.py | 2 | 5164 | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
home-assistant/home-assistant | homeassistant/components/opentherm_gw/sensor.py | 5 | 6455 | """Support for OpenTherm Gateway sensors."""
import logging
from pprint import pformat
from homeassistant.components.sensor import ENTITY_ID_FORMAT, SensorEntity
from homeassistant.const import CONF_ID
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from ho... | apache-2.0 |
mdj2/django | django/contrib/auth/backends.py | 37 | 5066 | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
class ModelBackend(object):
"""
Authenticates against django.contrib.auth.models.User.
"""
def authenticate(self, username=None, password=None, **kwargs):
U... | bsd-3-clause |
egenchen/shadowsocks | shadowsocks/eventloop.py | 949 | 7288 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# 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 requi... | apache-2.0 |
RackSec/ansible | test/units/modules/network/vyos/test_vyos_system.py | 113 | 3870 | # (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 dis... | gpl-3.0 |
cortedeltimo/SickRage | lib/send2trash/plat_other.py | 68 | 5500 | # Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
# This is a reimplementation of plat_ot... | gpl-3.0 |
schleichdi2/OpenNfr_E2_Gui-6.0 | lib/python/Components/Converter/ChannelNumbers.py | 42 | 1835 | from Components.NimManager import nimmanager
class ChannelNumbers:
def __init__(self):
pass
def getChannelNumber(self, frequency, nim):
f = int(self.getMHz(frequency))
descr = self.getTunerDescription(nim)
if "Europe" in descr:
if "DVB-T" in descr:
if 174 < f < 230: # III
d = (f + 1) % 7
... | gpl-2.0 |
mzizzi/ansible | lib/ansible/modules/packaging/os/zypper.py | 10 | 16748 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
# based on
# openbsd_pkg
# (c) 2013
# Patrik Lundin <patrik.lundin.swe@gmail.com>
#
# yum
# (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
#
# This... | gpl-3.0 |
wayward710/django-allauth | allauth/account/tests.py | 5 | 30162 | from __future__ import absolute_import
import json
from datetime import timedelta
from django.utils.timezone import now
from django.test.utils import override_settings
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.client import Client
from django.core import mail
from ... | mit |
juiceinc/mandoline | mandoline/test/test.py | 1 | 2314 | import glob
from nose.tools import with_setup
import os
from mandoline import *
from mandoline import FieldCleaner as _
# def TestCleaner(TestCase):
# def setup(self):
# pass
#
# def teardown(self):
# pass
#
# def test_cleaner(self):
# cleaner = MandolineCleaner()
# cleaner.... | mit |
sam-tsai/django | django/db/migrations/operations/special.py | 374 | 7425 | from __future__ import unicode_literals
from django.db import router
from .base import Operation
class SeparateDatabaseAndState(Operation):
"""
Takes two lists of operations - ones that will be used for the database,
and ones that will be used for the state change. This allows operations
that don't ... | bsd-3-clause |
tanderegg/ansible-modules-core | cloud/rackspace/rax_files_objects.py | 21 | 18529 | #!/usr/bin/python
# (c) 2013, Paul Durivage <paul.durivage@rackspace.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | gpl-3.0 |
sumspr/scikit-learn | sklearn/metrics/cluster/bicluster.py | 359 | 2797 | from __future__ import division
import numpy as np
from sklearn.utils.linear_assignment_ import linear_assignment
from sklearn.utils.validation import check_consistent_length, check_array
__all__ = ["consensus_score"]
def _check_rows_and_columns(a, b):
"""Unpacks the row and column arrays and checks their shap... | bsd-3-clause |
wezhang/vim-setup | bundle/python-mode/pymode/libs3/rope/base/simplify.py | 115 | 1692 | """A module to ease code analysis
This module is here to help source code analysis.
"""
import re
from rope.base import codeanalyze, utils
@utils.cached(7)
def real_code(source):
"""Simplify `source` for analysis
It replaces:
* comments with spaces
* strs with a new str filled with spaces
* im... | apache-2.0 |
WillGuan105/django | django/conf/locale/hu/formats.py | 504 | 1117 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y. F j.'
TIME_FORMAT = 'G.i'
DATE... | bsd-3-clause |
xiaolonginfo/decode-Django | Django-1.5.1/django/utils/html_parser.py | 231 | 4546 | from django.utils.six.moves import html_parser as _html_parser
import re
import sys
current_version = sys.version_info
use_workaround = (
(current_version < (2, 7, 3)) or
(current_version >= (3, 0) and current_version < (3, 2, 3))
)
HTMLParseError = _html_parser.HTMLParseError
if not use_workaround:
HTM... | gpl-2.0 |
wldcordeiro/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_assertrewrite.py | 171 | 23567 | import os
import stat
import sys
import zipfile
import py
import pytest
ast = pytest.importorskip("ast")
if sys.platform.startswith("java"):
# XXX should be xfail
pytest.skip("assert rewrite does currently not work on jython")
import _pytest._code
from _pytest.assertion import util
from _pytest.assertion.rewr... | mpl-2.0 |
abagh0703/RetailTrail | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
CellarD0-0r/whatever | node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
marty331/jakesclock | flask/lib/python2.7/site-packages/wheel/test/test_ranking.py | 565 | 1496 | import unittest
from wheel.pep425tags import get_supported
from wheel.install import WheelFile
WHEELPAT = "%(name)s-%(ver)s-%(pyver)s-%(abi)s-%(arch)s.whl"
def make_wheel(name, ver, pyver, abi, arch):
name = WHEELPAT % dict(name=name, ver=ver, pyver=pyver, abi=abi,
arch=arch)
return WheelFile(name... | gpl-2.0 |
lmaycotte/quark | quark/plugin_modules/ports.py | 1 | 26370 | # Copyright 2013 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 |
ctmil/meli_oerp | models/posting.py | 1 | 7027 | # -*- 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 ... | agpl-3.0 |
pernici/sympy | sympy/utilities/autowrap.py | 2 | 16264 | """Module for compiling codegen output, and wrap the binary for use in python.
.. note:: To use the autowrap module it must first be imported
>>> from sympy.utilities.autowrap import autowrap
This module provides a common interface for different external backends, such
as f2py, fwrap, Cython, SWIG(?) etc. (Curren... | bsd-3-clause |
dagwieers/ansible | lib/ansible/modules/network/aci/mso_schema_site_bd.py | 17 | 6068 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... | gpl-3.0 |
home-assistant/home-assistant | tests/components/rmvtransport/test_sensor.py | 8 | 8145 | """The tests for the rmvtransport platform."""
import datetime
from unittest.mock import patch
from homeassistant.setup import async_setup_component
VALID_CONFIG_MINIMAL = {
"sensor": {"platform": "rmvtransport", "next_departure": [{"station": "3000010"}]}
}
VALID_CONFIG_NAME = {
"sensor": {
"platfor... | apache-2.0 |
bartekjagiello/inteygrate_flaskapp | build/lib/yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_remove_success.py | 61 | 1821 | from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity
class SuccessRemoveParticipantsIqProtocolEntity(ResultIqProtocolEntity):
'''
<iq type="result" from="{{group_jid}}" id="{{id}}">
<remove type="success" participant="{{jid}}"></remove... | gpl-3.0 |
trustedanalytics/spark-tk | python/sparktk/atable.py | 10 | 19003 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
jgonthier/psi4 | psi4/driver/p4util/solvers.py | 2 | 37958 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2019 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py | 32 | 15927 | # 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... | mit |
Khan/khan-linter | vendor/py2/setuptools/depends.py | 336 | 5837 | import sys
import imp
import marshal
from distutils.version import StrictVersion
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from .py33compat import Bytecode
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building o... | apache-2.0 |
sinnwerkstatt/common-good-online-balance | ecg_balancing/migrations/0050_auto__del_field_company_revenue__del_field_company_profit__add_field_c.py | 2 | 14323 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Company.revenue'
db.delete_column(u'ecg_balancing_company', 'revenue')
# Deleting... | mit |
mlperf/training_results_v0.7 | NVIDIA/benchmarks/minigo/implementations/tensorflow/minigo/oneoffs/training_curve.py | 8 | 5964 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
306777HC/libforensics | code/lf/win/shell/link/objects.py | 13 | 52049 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | lgpl-3.0 |
bowlofstew/changes | changes/utils/phabricator_utils.py | 2 | 3682 | import re
import hashlib
import time
import json
import requests
import logging
from flask import current_app
# eh, just use the same logger as the listener code
logger = logging.getLogger('phabricator-listener')
# Functions to locally recognize/parse diffusion ids
DIFFUSION_REGEX = re.compile(r'^r[A-Z]+([a-z0-9]+)... | apache-2.0 |
AlanZatarain/cortex-vfx | python/IECoreMaya/FnParameterisedHolderSet.py | 17 | 2500 | ##########################################################################
#
# Copyright (c) 2009, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
neozhangthe1/coverage_model | build/lib/groundhog/mainLoop.py | 1 | 13913 | """
Main loop (early stopping).
TODO: write more documentation
"""
__docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu "
"KyungHyun Cho "
"Caglar Gulcehre ")
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
class Unbuffered:
def __init__(self, stream):
self.s... | bsd-3-clause |
japsu/desugaala | status/models.py | 1 | 1102 | from collections import defaultdict
from django.db import models
from vote.models import Category, Option
class Watch(models.Model):
category = models.ForeignKey(Category)
def evaluate(self):
results = dict((wo.option, 0) for wo in self.watchoption_set.all())
for ballot_category in self.category.ballot... | mit |
davehunt/kuma | kuma/core/monkeypatch.py | 31 | 1983 | from django.forms import fields, widgets
# Monkey patch preserves the old values, so we can pick up any changes
# in CharField.widget_attrs and Field.widget_attrs
# paulc filed a Django ticket for it, #14884
field_widget_attrs = fields.Field.widget_attrs
charfield_widget_attrs = fields.CharField.widget_attrs
def req... | mpl-2.0 |
ndchorley/scipy | scipy/special/utils/datafunc.py | 101 | 1893 | from __future__ import division, print_function, absolute_import
import csv
import numpy as np
def parse_txt_data(filename):
f = open(filename)
try:
reader = csv.reader(f, delimiter=',')
data = []
for row in reader:
data.append(list(map(float, row)))
nc = len(data... | bsd-3-clause |
bcferrycoder/holideck | cherrypy/test/webtest.py | 36 | 19884 | """Extensions to unittest for web frameworks.
Use the WebCase.getPage method to request a page from your HTTP server.
Framework Integration
=====================
If you have control over your server process, you can handle errors
in the server-side of the HTTP conversation a bit better. You must run
both the client ... | mit |
numerigraphe/odoo | addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py | 301 | 14179 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c):
#
# 2005 pyopenoffice.py Martin Simon (http://www.bezirksreiter.de)
# 2005 Fabien Pinckaers, TINY SPRL. (http://tiny.be)
#
# This program is free software: you can redistribute it and/or ... | agpl-3.0 |
beatrizChagas/scrm-solutions | extracao/rsoservices/service_preprocessing_twitter_v1_ACS.py | 1 | 5056 | # -*- coding: UTF-8 -*-
import sys
import emoji
import mysql.connector
from extracao.rsoservices.config import config
from extracao.rsoservices.emoji_dict import emoticon_dict
from extracao.rsoservices.preprocessing_dict import EMOJI_CARACTER
add_message_table0 = ("INSERT INTO extracao_processamento_twee... | gpl-3.0 |
melneubert/Markus | db/data/internet.py | 23 | 8880 | # -*- test-case-name: twisted.test.test_application,twisted.test.test_cooperator -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Reactor-based Services
Here are services to run clients, servers and periodic services using
the reactor.
This module (dynamically) defines variou... | mit |
UstadMobile/eXePUB | twisted/internet/utils.py | 17 | 5885 | # -*- test-case-name: twisted.test.test_iutils -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Utility methods."""
import sys, warnings
from twisted.internet import protocol, defer
from twisted.python import failure, util as tputil
try:
import cStringIO as StringIO
excep... | gpl-2.0 |
unindented/streamcode | client/static/jsrepl/extern/python/unclosured/lib/python2.7/encodings/rot_13.py | 497 | 2579 | #!/usr/bin/env python
""" Python Character Mapping Codec for ROT13.
See http://ucsub.colorado.edu/~kominek/rot13/ for details.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.c... | mit |
75651/kbengine_cloud | kbe/src/lib/python/Lib/msilib/schema.py | 90 | 81583 | from . import Table
_Validation = Table('_Validation')
_Validation.add_field(1,'Table',11552)
_Validation.add_field(2,'Column',11552)
_Validation.add_field(3,'Nullable',3332)
_Validation.add_field(4,'MinValue',4356)
_Validation.add_field(5,'MaxValue',4356)
_Validation.add_field(6,'KeyTable',7679)
_Validation.add_field... | lgpl-3.0 |
trinityfx/trinity | vendor/github.com/gizak/termui/config.py | 51 | 1166 | #!/usr/bin/env python3
import re
import os
import io
copyright = """// Copyright 2017 Zack Guo <zack.y.guo@gmail.com>. All rights reserved.
// Use of this source code is governed by a MIT license that can
// be found in the LICENSE file.
"""
exclude_dirs = [".git", "_docs"]
exclude_files = []
include_dirs = [".", "... | lgpl-3.0 |
peiyuwang/pants | tests/python/pants_test/backend/python/test_interpreter_cache.py | 5 | 5652 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | apache-2.0 |
fhaoquan/kbengine | kbe/src/lib/python/Lib/test/test_deque.py | 72 | 25591 | from collections import deque
import unittest
from test import support, seq_tests
import gc
import weakref
import copy
import pickle
from io import StringIO
import random
import struct
BIG = 100000
def fail():
raise SyntaxError
yield 1
class BadCmp:
def __eq__(self, other):
raise RuntimeError
cl... | lgpl-3.0 |
piffey/ansible | lib/ansible/modules/monitoring/zabbix/zabbix_template.py | 43 | 19402 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, sookido
#
# 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)... | gpl-3.0 |
Gamebasis/3DGamebasisServer | GameData/blender-2.71-windows64/2.71/python/lib/site-packages/numpy/distutils/lib2def.py | 57 | 3487 | from __future__ import division, absolute_import, print_function
import re
import sys
import os
import subprocess
__doc__ = """This module generates a DEF file from the symbols in
an MSVC-compiled DLL import library. It correctly discriminates between
data and functions. The data is collected from the output of the... | gpl-3.0 |
AjinxPatil/java-data-struct-algo | python/algorithms/t24h_max.py | 2 | 1556 | #!/usr/bin/python
# t24h_max finds for given 4 integers, the maximum possible time in 24-hour format
# that can be constructed from the given integers.
# Author: Ajinkya Patil
# 24-hour format = <H1><H2>:<M1><M2>
# Positions in format
H1 = 1
H2 = 2
M1 = 3
M2 = 4
def give_best(nums, limit):
# gives the best match... | mit |
adelina-t/nova | nova/tests/unit/virt/xenapi/client/test_session.py | 20 | 6579 | # Copyright (c) 2014 Rackspace Hosting
# 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 req... | apache-2.0 |
barachka/odoo | addons/purchase_analytic_plans/__init__.py | 441 | 1220 | # -*- 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... | agpl-3.0 |
mattman00000/inventory-tweaks | invtweaks_docs/conf.py | 1 | 7895 | # -*- coding: utf-8 -*-
#
# Inventory Tweaks documentation build configuration file, created by
# sphinx-quickstart on Sat May 12 12:32:31 2012.
#
# 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... | mit |
sio2project/filetracker | setup.py | 1 | 1364 | from os import path
import io
from setuptools import setup, find_packages
with io.open(
path.join(path.abspath(path.dirname(__file__)), 'README.md'), encoding='utf-8'
) as f:
long_description = f.read()
setup(
name='filetracker',
version='2.1.5',
author='SIO2 Project Team',
author_email='sio2@... | gpl-3.0 |
NeCTAR-RC/neutron | neutron/tests/functional/test_server.py | 16 | 8514 | # Copyright 2015 Mirantis 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 appli... | apache-2.0 |
AlbertoPeon/kubernetes | third_party/htpasswd/htpasswd.py | 897 | 5219 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2013 Edgewall Software
# Copyright (C) 2008 Eli Carter
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edge... | apache-2.0 |
RachitKansal/scikit-learn | examples/model_selection/plot_confusion_matrix.py | 244 | 2496 | """
================
Confusion matrix
================
Example of confusion matrix usage to evaluate the quality
of the output of a classifier on the iris data set. The
diagonal elements represent the number of points for which
the predicted label is equal to the true label, while
off-diagonal elements are those that ... | bsd-3-clause |
wirewit/pyresttest | pyresttest/test_resttest.py | 8 | 3351 | import json
import math
import string
import yaml
import resttest
import unittest
from resttest import *
class TestRestTest(unittest.TestCase):
""" Tests to test overall REST testing framework, how meta is that? """
def test_analyze_benchmark(self):
""" Test analyzing benchmarks to compute aggregates... | apache-2.0 |
turbokongen/home-assistant | homeassistant/components/tikteck/light.py | 21 | 3609 | """Support for Tikteck lights."""
import logging
import tikteck
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
LightEntity,
)
from homeassistant.const import CONF_DEVICES, CONF_NAME, CONF... | apache-2.0 |
brianr852/ventura-river | wordpress/wp-content/themes/venturariver/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | mit |
SPriyaJain/studybuddy | env/lib/python2.7/site-packages/jinja2/asyncsupport.py | 117 | 7765 | # -*- coding: utf-8 -*-
"""
jinja2.asyncsupport
~~~~~~~~~~~~~~~~~~~
Has all the code for async support which is implemented as a patch
for supported Python versions.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import sys
import asyncio
import inspec... | mit |
jamming/FrameworkBenchmarks | frameworks/Python/klein/app.py | 22 | 3715 | # -*- coding: utf-8 -*-
from functools import partial, wraps
import json
from operator import attrgetter
import os
from random import randint
import sys
from jinja2 import Environment, PackageLoader
from klein import Klein, run, route
from sqlalchemy import create_engine, Column
from sqlalchemy.ext.declarative import... | bsd-3-clause |
dlazz/ansible | lib/ansible/modules/network/fortios/fortios_firewall_ippool.py | 7 | 11529 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, 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 Lic... | gpl-3.0 |
mohamedhagag/community-addons | analytic_resource_plan/model/analytic_resource_plan.py | 1 | 10135 | # -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services S.L.
# (Jordi Ballester Alomar)
#
# © 2015 Serpent Consulting Services Pvt. Ltd.
# (Sudhir Arya)
#
# © 2016 Matmoz d.o.o.
# (Matjaž Mozetič)
#
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import time
from openerp impo... | agpl-3.0 |
joshuahoman/vivisect | envi/tests/msp430/iaddc.py | 7 | 3722 | from envi.archs.msp430.regs import *
checks = [
# ADDC
(
'ADDC r14, r15 (no carry)',
{ 'regs': [(REG_R14, 0x1), (REG_R15, 0x2)], 'flags': [(SR_N, 0), (SR_Z, 0), (SR_C, 0), (SR_V, 0)], 'code': "0f6e", 'data': "" },
{ 'regs': [(REG_R14, 0x1), (REG_R15, 0x3)], 'flags': [(SR_N, 0), (SR_Z, 0... | apache-2.0 |
AkA84/edx-platform | common/test/acceptance/pages/studio/index.py | 102 | 4852 | """
Studio Home page
"""
from bok_choy.page_object import PageObject
from . import BASE_URL
class DashboardPage(PageObject):
"""
Studio Home page
"""
url = BASE_URL + "/course/"
def is_browser_on_page(self):
return self.q(css='body.view-dashboard').present
@property
def course_... | agpl-3.0 |
ntymtsiv/CloudFerry | cloudferrylib/os/network/neutron.py | 2 | 47394 | # Copyright (c) 2014 Mirantis 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, so... | apache-2.0 |
petershvets/spark-etl | spark_etl_extract.py | 1 | 9475 | #!/usr/bin/python
from simple_salesforce import Salesforce
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from pyspark import Row
from pyspark.sql.types import *
#from pyspark.sql.functions import *
from optparse import OptionParser
from pyspark.sql import Data... | apache-2.0 |
hsaputra/tensorflow | tensorflow/contrib/timeseries/python/timeseries/__init__.py | 67 | 1292 | # 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 |
JensAstrup/pyEchosign | tests/test_agreement.py | 1 | 8056 | from unittest import TestCase
from six import StringIO
from pyEchosign.exceptions.echosign import PermissionDenied
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import Mock, patch
from pyEchosign.classes.agreement import Agreement
from pyEchosign.classes.account import... | mit |
numb3r33/StumbpleUponChallenge | src/data/make_dataset.py | 1 | 1475 | import pandas as pd
import numpy as np
import json
from unidecode import unidecode
def extract_domain(url):
# extract domains
domain = url.lower().split('/')[2]
domain_parts = domain.split('.')
# e.g. co.uk
if domain_parts[-2] not in ['com', 'co']:
return '.'.join(domain_parts[-2:])
e... | mit |
MQQiang/kbengine | kbe/res/scripts/common/Lib/test/test_bz2.py | 72 | 32972 | from test import support
from test.support import bigmemtest, _4G
import unittest
from io import BytesIO
import os
import pickle
import random
import subprocess
import sys
from test.support import unlink
try:
import threading
except ImportError:
threading = None
# Skip tests if the bz2 module doesn't exist.
... | lgpl-3.0 |
Heerozh/deep-learning | face_generation/helper.py | 160 | 8114 | import math
import os
import hashlib
from urllib.request import urlretrieve
import zipfile
import gzip
import shutil
import numpy as np
from PIL import Image
from tqdm import tqdm
def _read32(bytestream):
"""
Read 32-bit integer from bytesteam
:param bytestream: A bytestream
:return: 32-bit integer
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.