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 |
|---|---|---|---|---|---|
tvotyakov/codeeval | easy/one-zero-two-zeros/code.py | 1 | 1832 | #!python3
def count_of_zeros(num):
''' (int) -> int
Returns count of zero bits in the binary representation
of the given integer num.
>>> count_of_zeros(0)
1
>>> count_of_zeros(1)
0
>>> count_of_zeros(2)
1
>>> count_of_zeros(4)
2
>>> count_of_zero... | gpl-2.0 |
EvanK/ansible | lib/ansible/modules/database/postgresql/postgresql_lang.py | 9 | 12364 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2014, Jens Depuydt <http://www.jensd.be>
# 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 |
ghdk/networkx | examples/graph/roget.py | 44 | 2454 | #!/usr/bin/env python
"""
Build a directed graph of 1022 categories and
5075 cross-references as defined in the 1879 version of Roget's Thesaurus
contained in the datafile roget_dat.txt. This example is described in
Section 1.2 in Knuth's book [1,2].
Note that one of the 5075 cross references is a self loop yet
it is ... | bsd-3-clause |
jan-lugfl/lugfl-members | lugflmembers/wsgi.py | 1 | 1443 | """
WSGI config for lugflmembers project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... | mit |
shsingh/ansible | lib/ansible/modules/network/fortios/fortios_router_auth_path.py | 7 | 10429 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 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 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/computation/ops.py | 7 | 15881 | """Operator classes for eval.
"""
import operator as op
from functools import partial
from datetime import datetime
import numpy as np
from pandas.types.common import is_list_like, is_scalar
import pandas as pd
from pandas.compat import PY3, string_types, text_type
import pandas.core.common as com
from pandas.format... | mit |
simongibbons/numpy | numpy/distutils/tests/test_misc_util.py | 18 | 3218 | from os.path import join, sep, dirname
from numpy.distutils.misc_util import (
appendpath, minrelpath, gpaths, get_shared_lib_extension, get_info
)
from numpy.testing import (
assert_, assert_equal
)
ajoin = lambda *paths: join(*((sep,)+paths))
class TestAppendpath:
def test_1(self):
ass... | bsd-3-clause |
holmes/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/br/forms.py | 308 | 5803 | # -*- coding: utf-8 -*-
"""
BR-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, CharField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
... | apache-2.0 |
kangfend/django | tests/migrations/test_base.py | 292 | 4620 | import os
import shutil
import tempfile
from contextlib import contextmanager
from importlib import import_module
from django.apps import apps
from django.db import connection
from django.db.migrations.recorder import MigrationRecorder
from django.test import TransactionTestCase
from django.test.utils import extend_sy... | bsd-3-clause |
alanjw/GreenOpenERP-Win-X86 | python/Lib/site-packages/docutils/utils/math/unichar2tex.py | 130 | 17590 | # LaTeX math to Unicode symbols translation table
# for use with the translate() method of unicode objects.
# Generated with ``write_unichar2tex.py`` from the data in
# http://milde.users.sourceforge.net/LUCR/Math/
# Includes commands from: standard LaTeX, amssymb, amsmath
uni2tex_table = {
160: u'~',
163: u'\\pounds... | agpl-3.0 |
Eureka22/ASM_xf | PythonD/bin/python/confix.py | 2 | 2481 | #!python
# Copyright (C) 2002 Salomon Automation
#
# This library 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 2.1 of the License, or (at your option) any later version.
... | gpl-2.0 |
jerbob92/CouchPotatoServer | libs/pyasn1/type/namedtype.py | 20 | 4782 | # NamedType specification for constructed types
import sys
from pyasn1.type import tagmap
from pyasn1 import error
class NamedType:
isOptional = 0
isDefaulted = 0
def __init__(self, name, t):
self.__name = name; self.__type = t
def __repr__(self): return '%s(%s, %s)' % (
self.__class__.... | gpl-3.0 |
sanyaade-teachings/engine | tests/bin/test_driver.py | 9 | 1135 | import selenium
from selenium import webdriver
class Driver(object):
def __init__(self, browser):
self.passed = 0
self.failed = 0
self.total = 0
self.browser = browser
def go(self):
self.browser.get("http://localhost/playcanvas/sdk/tests/all_tests.html")
... | mit |
lekston/ardupilot | Tools/autotest/autotest.py | 1 | 18930 | #!/usr/bin/env python
"""
APM automatic test suite
Andrew Tridgell, October 2011
"""
from __future__ import print_function
import atexit
import fnmatch
import glob
import optparse
import os
import shutil
import signal
import sys
import time
import traceback
from apmrover2 import *
from arducopter import *
from quadp... | gpl-3.0 |
walchko/pygecko | retired/find_geckocore.py | 1 | 1087 | # #!/usr/bin/env python3
# # -*- coding: utf-8 -*-
# ##############################################
# # The MIT License (MIT)
# # Copyright (c) 2018 Kevin Walchko
# # see LICENSE for full details
# ##############################################
# # import time
# import argparse
# import os
# from pygecko.transport.beac... | mit |
porcobosso/spark-ec2 | lib/boto-2.34.0/boto/s3/__init__.py | 17 | 2345 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without res... | apache-2.0 |
yoshrote/valid_model | valid_model/descriptors.py | 1 | 7772 | from datetime import datetime, timedelta
import six
from .base import Generic, Object
from .exc import ValidationError
from .utils import is_descriptor
class SimpleType(Generic):
"""This descriptor will not attempt to coerce the value on __set__."""
_type_klass = None
_type_label = None
def __set_... | mit |
jhesketh/zookeepr | zkpylons/controllers/attachment.py | 3 | 3355 | import logging
from pylons import request, response, session, tmpl_context as c
from zkpylons.lib.helpers import redirect_to
from pylons.decorators import validate
from pylons.decorators.rest import dispatch_on
from formencode import validators, htmlfill, ForEach, Invalid
from formencode.variabledecode import NestedV... | gpl-2.0 |
GoogleCloudPlatform/python-compat-runtime | appengine-compat/exported_appengine_sdk/google/appengine/_internal/django/core/management/commands/reset.py | 23 | 2408 | from optparse import make_option
from google.appengine._internal.django.conf import settings
from google.appengine._internal.django.core.management.base import AppCommand, CommandError
from google.appengine._internal.django.core.management.color import no_style
from google.appengine._internal.django.core.management.sq... | apache-2.0 |
HuygensING/bioport-site | bioport/test_fuzzy_search.py | 2 | 6920 | ##########################################################################
# Copyright (C) 2009 - 2014 Huygens ING & Gerbrandy S.R.L.
#
# This file is part of bioport.
#
# bioport 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 ... | gpl-3.0 |
javiergarridomellado/Empresa_django | devcodela/lib/python2.7/site-packages/pip/commands/uninstall.py | 395 | 2203 | from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is able to uninstall most installed packages. Known exceptions are:
- Pure distutil... | gpl-2.0 |
paulmartel/voltdb | src/catgen/catalog_utils/strings.py | 1 | 1677 | #!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2016 VoltDB Inc.
#
# 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 the
# License, or (at you... | agpl-3.0 |
koniiiik/django | django/contrib/postgres/operations.py | 24 | 1724 | from django.contrib.postgres.signals import register_hstore_handler
from django.db.migrations.operations.base import Operation
class CreateExtension(Operation):
reversible = True
def __init__(self, name):
self.name = name
def state_forwards(self, app_label, state):
pass
def database... | bsd-3-clause |
mohamed--abdel-maksoud/chromium.src | tools/usb_gadget/mouse_gadget.py | 101 | 5065 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Implementation of a USB HID mouse.
Two classes are provided by this module. The MouseFeature class implements
the core functionality of a HID mouse and c... | bsd-3-clause |
silly-wacky-3-town-toon/SOURCE-COD | Panda3D-1.10.0/python/Tools/i18n/msgfmt.py | 8 | 6489 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Written by Martin v. Löwis <loewis@informatik.hu-berlin.de>
"""Generate binary message catalog from textual translation description.
This program converts a textual Uniforum-style message catalog (.po file) into
a binary GNU catalog (.mo file). This is essentiall... | apache-2.0 |
lmprice/ansible | lib/ansible/modules/network/nxos/nxos_evpn_vni.py | 32 | 9666 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
fastinetserver/portage-idfetch | pym/portage/mail.py | 2 | 6123 | # portage.py -- core Portage functionality
# Copyright 1998-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Since python ebuilds remove the 'email' module when USE=build
# is enabled, use a local import so that
# portage.proxy.lazyimport._preload_portage_submodules()
# can l... | gpl-2.0 |
chirilo/mozillians | vendor-local/lib/python/celery/tests/test_app/test_beat.py | 14 | 11219 | from __future__ import absolute_import
import logging
from datetime import datetime, timedelta
from nose import SkipTest
from celery import beat
from celery import registry
from celery.result import AsyncResult
from celery.schedules import schedule
from celery.task.base import Task
from celery.utils import uuid
from... | bsd-3-clause |
zacoxicompton/ExocortexCrate | Softimage/Workgroup/Addons/ExocortexAlembic/Application/Plugins/ExocortexAlembicSoftimage_UI.py | 4 | 2285 | import win32com.client
from win32com.client import constants
#=====================================================================================
def XSILoadPlugin( in_reg ):
in_reg.Author = "Exocortex Technologies, Inc and Helge Mathee"
in_reg.Name = "ExocortexAlembicSoftimage_UI"
in_reg.Major = 1
i... | bsd-3-clause |
sfam/home-assistant | homeassistant/components/downloader.py | 4 | 4436 | """
homeassistant.components.downloader
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to download files.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/downloader/
"""
import os
import logging
import re
import threading
from homeassistant.... | mit |
jazzabeanie/python_koans | python2/koans/about_none.py | 1 | 2911 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutNil in the Ruby Koans
#
from runner.koan import *
class AboutNone(Koan):
def test_none_is_an_object(self):
"Unlike NULL in a lot of languages"
self.assertEqual(True, isinstance(None, object)) # so isinstance(1, 2) checks whether 1 ... | mit |
kaiix/depot_tools | git_nav_downstream.py | 32 | 1858 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Checks out a downstream branch from the currently checked out branch. If there
is more than one downstream branch, then this script... | bsd-3-clause |
grdlok/UStar-dl | src/youtube_dl/extractor/clipfish.py | 17 | 1626 | from __future__ import unicode_literals
import re
import time
import xml.etree.ElementTree
from .common import InfoExtractor
from ..utils import (
ExtractorError,
parse_duration,
)
class ClipfishIE(InfoExtractor):
IE_NAME = 'clipfish'
_VALID_URL = r'^https?://(?:www\.)?clipfish\.de/.*?/video/(?P<id... | unlicense |
vauxoo-dev/l10n-spain | l10n_es_partner/wizard/__init__.py | 18 | 1113 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
#
# This p... | agpl-3.0 |
ZeitgeberH/nengo | nengo/networks/tests/test_oscillator.py | 1 | 1526 | import logging
import pytest
import nengo
from nengo.utils.functions import piecewise
from nengo.utils.numpy import rmse
from nengo.utils.testing import Plotter
logger = logging.getLogger(__name__)
def test_oscillator(Simulator, nl):
model = nengo.Network(label='Oscillator', seed=789)
with model:
... | gpl-3.0 |
jiangdapeng/btrfs-next | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
UManPychron/pychron | docs/user_guide/operation/scripts/examples/argus/measurement/jan_unknown_air_for_38Ar_600_180.py | 2 | 2496 | #!Measurement
'''
baseline:
after: true
before: false
counts: 180
detector: H1
mass: 34.2
settling_time: 20.0
default_fits: nominal
equilibration:
eqtime: 1.0
inlet: R
inlet_delay: 3
outlet: O
use_extraction_eqtime: true
post_equilibration_delay: 5
multicollect:
counts: 600
detector: H1
is... | apache-2.0 |
walterbender/story | collabwrapper.py | 1 | 33058 | # Copyright (C) 2015 Walter Bender
# Copyright (C) 2015 Sam Parkinson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 |
boundarydevices/android_external_chromium_org | third_party/jinja2/environment.py | 614 | 47244 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import BLOCK_S... | bsd-3-clause |
junwucs/h2o-3 | h2o-py/tests/testdir_algos/glm/pyunit_link_functions_tweedie_basicGLM.py | 5 | 1072 | import sys
sys.path.insert(1, "../../../")
import h2o, tests
def link_functions_tweedie_basic():
print "Read in prostate data."
hdf = h2o.upload_file(h2o.locate("smalldata/prostate/prostate_complete.csv.zip"))
print "Testing for family: TWEEDIE"
print "Set variables for h2o."
y = "CAPSU... | apache-2.0 |
ASlave2Audio/Restaurant-App | mingw/bin/lib/_abcoll.py | 218 | 14672 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | mit |
windyuuy/opera | chromium/src/third_party/webpagereplay/third_party/dns/inet.py | 248 | 3236 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | bsd-3-clause |
agconti/njode | env/lib/python2.7/site-packages/sphinx/writers/text.py | 8 | 25470 | # -*- coding: utf-8 -*-
"""
sphinx.writers.text
~~~~~~~~~~~~~~~~~~~
Custom docutils writer for plain text.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import textwrap
from itertools import groupby, izip_longest
f... | bsd-3-clause |
Teifion/concision | views/old_forms.py | 1 | 9057 | # import transaction
# import datetime
from pyramid.httpexceptions import HTTPFound
# from pyramid.renderers import get_renderer
from ..models import (
StoredQuery,
)
# import json
from ..lib import joins
from .. import config
def alter_query_type(request):
request.do_not_log = True
query_id = in... | bsd-2-clause |
Yahvuh/Eliza | Flask/Lib/site-packages/werkzeug/debug/console.py | 280 | 5557 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.console
~~~~~~~~~~~~~~~~~~~~~~
Interactive console support.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import sys
import code
from types import CodeType
from werkzeug.utils import escape
from werkzeug.loca... | gpl-2.0 |
parkouss/treeherder | treeherder/perf/management/commands/import_perf_data.py | 4 | 5903 | import datetime
from optparse import make_option
from urlparse import urlparse
import concurrent.futures
from django.core.management.base import (BaseCommand,
CommandError)
from django.db import transaction
from treeherder.client import (PerfherderClient,
... | mpl-2.0 |
amenonsen/ansible | lib/ansible/executor/stats.py | 88 | 3295 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
4rado/RepositoryForProject | Lib/distutils/command/build.py | 250 | 5437 | """distutils.command.build
Implements the Distutils 'build' command."""
__revision__ = "$Id$"
import sys, os
from distutils.util import get_platform
from distutils.core import Command
from distutils.errors import DistutilsOptionError
def show_compilers():
from distutils.ccompiler import show_compilers
show... | gpl-3.0 |
amsimoes/bat-country | batcountry/batcountry.py | 1 | 6348 | # import the necessary packages
from __future__ import print_function
from google.protobuf import text_format
from cStringIO import StringIO
from PIL import Image
import scipy.ndimage as nd
import numpy as np
import caffe
import os
class BatCountry:
def __init__(self, base_path, deploy_path, model_path,
patch_model... | mit |
yujikato/DIRAC | src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotCStoJSONSynchronizer.py | 2 | 4327 | """ This is a test of the creation of the json dump file
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import os
from diraccfg import CFG
from DIRAC.WorkloadManagementSystem.Utilities.PilotCStoJSONSynchronizer import PilotCStoJSONSynch... | gpl-3.0 |
adamkh/kivy | kivy/uix/screenmanager.py | 25 | 36969 | '''Screen Manager
==============
.. versionadded:: 1.4.0
The screen manager is a widget dedicated to managing multiple screens for your
application. The default :class:`ScreenManager` displays only one
:class:`Screen` at a time and uses a :class:`TransitionBase` to switch from one
Screen to another.
Multiple transit... | mit |
ypu/tp-qemu | generic/tests/jumbo.py | 3 | 7517 | import logging
import commands
import random
from autotest.client.shared import error
from autotest.client import utils
from virttest import utils_misc, utils_test, utils_net
@error.context_aware
def run(test, params, env):
"""
Test the RX jumbo frame function of vnics:
1) Boot the VM.
2) Change the ... | gpl-2.0 |
hunch/hunch-sample-app | django/contrib/sessions/backends/db.py | 9 | 2794 | import datetime
from django.conf import settings
from django.contrib.sessions.models import Session
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation
from django.db import IntegrityError, transaction, router
from django.utils.encoding... | mit |
jgoclawski/django | tests/template_tests/test_context.py | 166 | 5389 | # -*- coding: utf-8 -*-
from django.http import HttpRequest
from django.template import (
Context, Engine, RequestContext, Template, Variable, VariableDoesNotExist,
)
from django.template.context import RenderContext
from django.test import RequestFactory, SimpleTestCase
class ContextTests(SimpleTestCase):
... | bsd-3-clause |
themrmax/scikit-learn | sklearn/manifold/tests/test_t_sne.py | 11 | 25443 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.neighbors import BallTree
from sklearn.utils.testing import assert_less_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from skle... | bsd-3-clause |
3dfxmadscientist/odoo_vi | addons/point_of_sale/report/pos_payment_report.py | 380 | 3549 | # -*- 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 |
KonradBreitsprecher/espresso | doc/tutorials/09-swimmer_reactions/EXERCISES/reaction.py | 1 | 9461 | ################################################################################
# #
# Copyright (C) 2010,2011,2012,2013,2014,2015,2016 The ESPResSo project #
# ... | gpl-3.0 |
oasiswork/odoo | addons/account/wizard/account_invoice_refund.py | 214 | 13008 | # -*- 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 |
heiher/libreoffice-core | wizards/com/sun/star/wizards/web/WebWizardConst.py | 6 | 2865 | #
# This file is part of the LibreOffice project.
#
# 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/.
#
# This file incorporates work covered by the following license noti... | gpl-3.0 |
JavML/django | django/test/testcases.py | 42 | 57097 | from __future__ import unicode_literals
import difflib
import errno
import json
import os
import posixpath
import socket
import sys
import threading
import unittest
import warnings
from collections import Counter
from contextlib import contextmanager
from copy import copy
from functools import wraps
from unittest.util... | bsd-3-clause |
mlc0202/zookeeper | src/contrib/zkpython/src/test/callback_test.py | 159 | 6741 | #!/usr/bin/python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Lic... | apache-2.0 |
junmin-zhu/chromium-rivertrail | third_party/mesa/MesaLib/src/mapi/glapi/gen/glX_XML.py | 46 | 15506 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# ... | bsd-3-clause |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/numpy/lib/tests/test_financial.py | 36 | 6390 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_almost_equal
)
class TestFinancial(TestCase):
def test_rate(self):
assert_almost_equal(np.rate(10, 0, -3500, 10000),
... | mit |
heilaaks/snippy | tests/test_api_search_snippet.py | 1 | 58285 | # -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# snippy - software development and maintenance notes manager.
# Copyright 2017-2020 Heikki J. Laaksonen <laaksonen.heikki.j@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
resmo/ansible | test/units/plugins/cliconf/test_slxos.py | 68 | 4348 | #
# (c) 2018 Extreme Networks 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.
#
# Ans... | gpl-3.0 |
jhd/spunout | flask/lib/python2.7/site-packages/migrate/tests/versioning/test_schemadiff.py | 78 | 6755 | # -*- coding: utf-8 -*-
import os
from sqlalchemy import *
from migrate.versioning import schemadiff
from migrate.tests import fixture
class SchemaDiffBase(fixture.DB):
level = fixture.DB.CONNECT
def _make_table(self,*cols,**kw):
self.table = Table('xtable', self.meta,
Column('id',Inte... | gpl-3.0 |
DawidvanGraan/HomeAutomation | Raspberry/api.py | 1 | 3437 | #!/bin/sh
from flask import Flask, jsonify
import smbus
import time
import RPi.GPIO as io
import requests
# Plex Call
plexUrl = 'http://192.168.1.100/jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "duration", "showtitle"], "playerid": 1 }, "id": "VideoGetIt... | mit |
walkerke/marble | .eggs/shapely-1.5.9-py3.4.egg/shapely/ops.py | 10 | 10535 | """Support for various GEOS geometry operations
"""
import sys
if sys.version_info[0] < 3:
from itertools import izip
else:
izip = zip
from ctypes import byref, c_void_p, c_double
from shapely.geos import lgeos
from shapely.geometry.base import geom_factory, BaseGeometry
from shapely.geometry import asShape... | bsd-3-clause |
hirofumi0810/asr_preprocessing | swbd/main.py | 1 | 15071 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Make dataset for the End-to-End model (Switchboard corpus).
Note that feature extraction depends on transcripts.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from os.path import join, isfile
impor... | mit |
JingJunYin/tensorflow | tensorflow/contrib/quantize/python/quant_ops.py | 16 | 11912 | # 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 |
salguarnieri/intellij-community | python/lib/Lib/encodings/iso8859_8.py | 593 | 11292 | """ Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.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 decode(self,input,errors='... | apache-2.0 |
ar0551/Wasp | devFiles/data/waspCatalogFix.py | 1 | 54170 | # Wasp: Discrete Design with Grasshopper plug-in (GPL) initiated by Andrea Rossi
#
# This file is part of Wasp.
#
# Copyright (c) 2017, Andrea Rossi <a.rossi.andrea@gmail.com>
# Wasp is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the ... | gpl-3.0 |
NCPlayz/CassBotPy | cassandra/bot.py | 1 | 4014 | import datetime
import json
import discord
import os
from discord.ext import commands
from discord.ext.commands.converter import *
class CassandraContext(commands.Context):
def is_float(self, argument):
"""Checks if the argument is a float."""
try:
return float(string) # T... | mit |
halberom/ansible | lib/ansible/modules/cloud/ovirt/ovirt_disks.py | 8 | 23155 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
doduytrung/odoo-8.0 | addons/account_budget/report/__init__.py | 444 | 1139 | # -*- 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 |
alex-quiterio/pychess | lib/pychess/widgets/pydock/__init__.py | 20 | 4085 | from gi.repository import Gtk
from gi.repository import GObject
#===============================================================================
# Composite Constants
#===============================================================================
POSITIONS_COUNT = 5
NORTH, EAST, SOUTH, WEST, CENTER = range(POSITIONS... | gpl-3.0 |
jjscarafia/odoo | addons/note/tests/__init__.py | 159 | 1105 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/tests/test_client_regress/tests.py | 5 | 64322 | # -*- coding: utf-8 -*-
"""
Regression tests for the Test Client, especially the customized assertions.
"""
from __future__ import unicode_literals
import itertools
import os
from django.contrib.auth.models import User
from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.http import Htt... | apache-2.0 |
kuiwei/kuiwei | common/djangoapps/cache_toolbox/middleware.py | 211 | 4009 | """
Cache-backed ``AuthenticationMiddleware``
-----------------------------------------
``CacheBackedAuthenticationMiddleware`` is an
``django.contrib.auth.middleware.AuthenticationMiddleware`` replacement to
avoid querying the database for a ``User`` instance in each request.
Whilst the built-in ``AuthenticationMidd... | agpl-3.0 |
GNOME/gnome-lirc-properties | test/test-policykit-is-authorized.py | 1 | 1051 | #!/usr/bin/python
import dbus
import os
bus = dbus.SystemBus()
policy_kit = bus.get_object('org.freedesktop.PolicyKit', '/')
#print policy_kit_mechanism.Introspect()
if(policy_kit == None):
print("Error: Could not get the PolicyKit interface.\n")
action_id = "org.gnome.clockapplet.mechanism.settimezone"
result... | gpl-2.0 |
kobejean/tensorflow | tensorflow/contrib/slim/python/slim/learning_test.py | 22 | 38647 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
onceuponatimeforever/oh-mainline | vendor/packages/Django/django/contrib/localflavor/id/forms.py | 100 | 7179 | """
ID-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
import time
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from django.utils.translation import ugettext_lazy as _
from django.ut... | agpl-3.0 |
letouriste001/SmartForest_2.0 | python3.4Smartforest/lib/python3.4/site-packages/pip/commands/__init__.py | 143 | 2145 | """
Package containing all pip commands
"""
from __future__ import absolute_import
from pip.commands.completion import CompletionCommand
from pip.commands.download import DownloadCommand
from pip.commands.freeze import FreezeCommand
from pip.commands.hash import HashCommand
from pip.commands.help import HelpCommand
fr... | mit |
Franky333/crazyflie-clients-python | src/cfclient/ui/tabs/LogTab.py | 1 | 3242 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
macs03/demo-cms | cms/lib/python2.7/site-packages/django/contrib/admin/helpers.py | 102 | 14143 | from __future__ import unicode_literals
from django import forms
from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.contenttypes.models import ContentT... | mit |
m4tx/egielda | utils/test_utils.py | 1 | 3014 | # This file is part of e-Giełda.
# Copyright (C) 2014-2015 Mateusz Maćkowski and Tomasz Zieliński
#
# e-Giełda 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 the
# License, or (at ... | agpl-3.0 |
spinningbytes/deep-mlsa | code/architectures/default_cnn.py | 1 | 2153 | import logging
from keras.layers import Dense, ZeroPadding1D, Embedding, Convolution1D, MaxPooling1D, Flatten, Input
from keras.models import Model
from utils.data_utils import load_embedding_matrix
def create_default_model(config_data):
nb_filter = 200
filter_length = 6
hidden_dims = nb_filter
embe... | apache-2.0 |
openstack/networking-plumgrid | networking_plumgrid/neutron/tests/unit/extensions/test_providernet.py | 1 | 2158 | # Copyright 2015 PLUMgrid, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
darkwing/kuma | vendor/packages/pbr/hooks/files.py | 98 | 3681 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# Unles... | mpl-2.0 |
k-r-g/FrameworkBenchmarks | toolset/continuous/tasks/keep-logs.py | 15 | 1228 | #!/usr/bin/python
#
# Archives, to the specified folder, the logged output generated by a benchmark
# run.
#
# @author A. Shawn Bandy
import os
import zipfile
import datetime
import requests
import shutil
# Follows closely from:
# http://stackoverflow.com/a/34153816
#
# Paths to the log folders are generated by TFB ... | bsd-3-clause |
jayceyxc/hue | apps/useradmin/src/useradmin/middleware.py | 3 | 3475 | #!/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 |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/tkinter/scrolledtext.py | 164 | 1814 | """A ScrolledText widget feels like a text widget but also has a
vertical scroll bar on its right. (Later, options may be added to
add a horizontal bar as well, to make the bars disappear
automatically when not needed, to move them to the other side of the
window, etc.)
Configuration options are passed to the Text wi... | apache-2.0 |
watonyweng/neutron | neutron/extensions/extraroute.py | 29 | 2273 | # Copyright 2013, Nachi Ueno, NTT MCL, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | apache-2.0 |
rvmoura96/projeto-almoxarifado | myvenv/Lib/site-packages/django/contrib/gis/admin/options.py | 47 | 5390 | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.db import models
from django.contrib.gis.gdal import OGRGeomType
spherical_mercator_srid = 3857
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographi... | mit |
campbe13/openhatch | vendor/packages/Django/tests/modeltests/get_object_or_404/tests.py | 41 | 3583 | from __future__ import absolute_import
from django.http import Http404
from django.shortcuts import get_object_or_404, get_list_or_404
from django.test import TestCase
from .models import Author, Article
class GetObjectOr404Tests(TestCase):
def test_get_object_or_404(self):
a1 = Author.objects.create(na... | agpl-3.0 |
rndusr/stig | stig/client/filters/base.py | 1 | 22315 | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but... | gpl-3.0 |
klickagent/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_importer.py | 115 | 20224 | #!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. 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 n... | bsd-3-clause |
MobinRanjbar/hue | desktop/core/src/desktop/management/commands/kt_renewer.py | 38 | 1060 | #!/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 |
lekum/ansible | contrib/inventory/spacewalk.py | 137 | 4999 | #!/bin/env python
"""
Spacewalk external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
To use thi... | gpl-3.0 |
weimingtom/python-for-android | python3-alpha/python3-src/Lib/encodings/gb2312.py | 816 | 1027 | #
# gb2312.py: Python Unicode Codec for GB2312
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_cn, codecs
import _multibytecodec as mbc
codec = _codecs_cn.getcodec('gb2312')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.