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 |
|---|---|---|---|---|---|
r39132/airflow | tests/utils/test_timezone.py | 4 | 3023 | # -*- 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 |
rust-lang/gyp | pylib/gyp/MSVSNew.py | 601 | 12116 | # 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | bsd-3-clause |
BenLangmead/qtip-experiments | experiments/real_data/perf_tabulate.py | 1 | 3305 | """
Creates a table with efficiency metrics (running time, peak memory
footprint) from SLURM output generated from sbatch_align.sh.
"""
from __future__ import print_function
import glob
import sys
from collections import defaultdict
nslurm, nsam = 0, 0
sam_names = defaultdict(int)
tab_wrapped = defaultdict(lambda: d... | mit |
adw0rd/lettuce | tests/integration/lib/Django-1.3/django/db/models/sql/compiler.py | 52 | 43006 | from django.core.exceptions import FieldError
from django.db import connections
from django.db.backends.util import truncate_name
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import EmptyResultSet
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sq... | gpl-3.0 |
wisechengyi/pants | contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_compile_integration.py | 2 | 2798 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from pants.testutil.file_test_util import contains_exact_files
from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest
from pants.testutil.subsystem.util i... | apache-2.0 |
ojengwa/oh-mainline | vendor/packages/PyYaml/tests/lib/test_resolver.py | 60 | 3300 |
import yaml
import pprint
def test_implicit_resolver(data_filename, detect_filename, verbose=False):
correct_tag = None
node = None
try:
correct_tag = open(detect_filename, 'rb').read().strip()
node = yaml.compose(open(data_filename, 'rb'))
assert isinstance(node, yaml.SequenceNode... | agpl-3.0 |
jeffbryner/MozDef | tests/alerts/test_write_audit.py | 3 | 4301 | # 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 https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from .positive_alert_test_case import PositiveAlertTestCase
from .negative_ale... | mpl-2.0 |
loongson-community/EFI-MIPS | ToolKit/cmds/python/Lib/test/skipped/test_imgfile.py | 43 | 4214 | #! /usr/bin/env python
"""Simple test script for imgfile.c
Roger E. Masse
"""
from test.test_support import verbose, unlink, findfile
import imgfile, uu, os
def main():
uu.decode(findfile('testrgb.uue'), 'test.rgb')
uu.decode(findfile('greyrgb.uue'), 'greytest.rgb')
# Test a 3 byte color image
... | bsd-3-clause |
TechEmpower/FrameworkBenchmarks | frameworks/Python/web2py/app/standard/modules/database.py | 22 | 2110 | # -*- coding: utf-8 -*-
import os
from operator import itemgetter
from gluon.storage import Storage
from gluon.dal import DAL, Field, Row
DBHOST = 'tfb-database'
DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % DBHOST
class Dal(object):
def __init__(self, table=None, pool_size=8):
... | bsd-3-clause |
josegfv/transfer_sh_track | transfer.py | 1 | 7264 | #!/usr/bin/python3
"""
Usage: transfer ( -l | -p | -u <file> | -d | -h)
Options:
-h Help.
-d Download file into your local folder
-l List files that have been uploaded to transfer.sh
-p Purge the files from list that have Expired
-u <file> Upload a fi... | mit |
adit-chandra/tensorflow | tensorflow/python/framework/test_combinations_test.py | 9 | 5279 | # Copyright 2018 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 |
dotpmrcunha/gnuradio | docs/doxygen/doxyxml/generated/index.py | 344 | 1871 | #!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from xml.dom import minidom
import os
import sys
import compound
import indexsuper as supermod
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compound=None):
supermod.DoxygenType.__init__(se... | gpl-3.0 |
JuliBakagianni/CEF-ELRC | lib/python2.7/site-packages/django/contrib/gis/db/models/sql/aggregates.py | 309 | 1804 | from django.db.models.sql.aggregates import *
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql.conversion import GeomField
class GeoAggregate(Aggregate):
# Default SQL template for spatial aggregates.
sql_template = '%(function)s(%(field)s)'
# Conversion ... | bsd-3-clause |
Red-M/CloudBot-legacy | plugins/cryptocoins.py | 6 | 2418 | from util import http, hook
## CONSTANTS
exchanges = {
"blockchain": {
"api_url": "https://blockchain.info/ticker",
"func": lambda data: u"Blockchain // Buy: \x0307${:,.2f}\x0f -"
u" Sell: \x0307${:,.2f}\x0f".format(data["USD"]["buy"], data["USD"]["sell"])
},
"... | gpl-3.0 |
alisidd/tensorflow | tensorflow/contrib/learn/python/learn/preprocessing/categorical.py | 153 | 4269 | # 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 |
giubil/trackit | api/files/api/app/views/aws/account_management.py | 1 | 9304 | from datetime import datetime
from app import app
from app.authentication import with_login
from app.tasks import import_aws_client_bills, import_aws_elb_infos, process_aws_key
from flask import Blueprint, jsonify
from app.request_schema import with_request_schema
from app.models import db, AWSKey, AWSKeyS3Bucket
from ... | apache-2.0 |
tzaffi/git-in-practice-repo | book/lib/python2.7/site-packages/paramiko/win_pageant.py | 10 | 4171 | # Copyright (C) 2005 John Arbash-Meinel <john@arbash-meinel.com>
# Modified up by: Todd Whiteman <ToddW@ActiveState.com>
#
# This file is part of paramiko.
#
# Paramiko 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
# Softwa... | mit |
nupic-community/nostradamIQ | nostradamIQ-landingpage/webapp/proxy/tornado-proxy.py | 6 | 5573 | import logging
import os
import sys
import socket
from urlparse import urlparse
import tornado.httpserver
import tornado.ioloop
import tornado.iostream
import tornado.web
import tornado.httpclient
logger = logging.getLogger('tornado_proxy')
__all__ = ['ProxyHandler', 'run_proxy']
def get_proxy(url):
url_parsed... | gpl-3.0 |
rush-skills/ZeroNet | src/util/Event.py | 13 | 1519 | # Based on http://stackoverflow.com/a/2022629
class Event(list):
def __call__(self, *args, **kwargs):
for f in self[:]:
if "once" in dir(f) and f in self:
self.remove(f)
f(*args, **kwargs)
def __repr__(self):
return "Event(%s)" % list.__repr__(self)
... | gpl-2.0 |
marcel-dancak/QGIS | python/PyQt/PyQt5/QtCore.py | 17 | 2132 | # -*- coding: utf-8 -*-
"""
***************************************************************************
QtCore.py
---------------------
Date : November 2015
Copyright : (C) 2015 by Matthias Kuhn
Email : matthias at opengis dot ch
***************************... | gpl-2.0 |
kynikos/lib.py.console-colors | src/consolecolors.py | 1 | 5913 | # Functions for applying console ANSI text effect and color codes.
# Copyright (C) 2011-2014 Dario Giovannetti <dev@dariogiovannetti.net>
#
# 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... | gpl-3.0 |
laryamamoto/PyCellChemistry | src/RD/DichotomousBranching.py | 1 | 4555 | #---------------------------------------------------------------------------
#
# DichotomousBranching.py: dichotomous branching pattern based on the
# combination of an activator-depleted substrate model and a vein
# formation substance Y.
#
# Y formation is triggered by the activator A. The vascular system to
# be for... | gpl-3.0 |
Kinggerm/GetOrganelle | Utilities/slim_graph.py | 1 | 66252 | #!/usr/bin/env python
# coding: utf8
import time
import os
import sys
import subprocess
try:
# python2
import commands
except:
pass
inf = float("inf")
from argparse import ArgumentParser
PATH_OF_THIS_SCRIPT = os.path.split(os.path.realpath(__file__))[0]
sys.path.insert(0, os.path.join(PATH_OF_THIS_SCRIPT, "... | gpl-3.0 |
TridevGuha/django | tests/model_package/tests.py | 380 | 2668 | from __future__ import unicode_literals
from django.db import connection, models
from django.db.backends.utils import truncate_name
from django.test import TestCase
from .models.article import Article, Site
from .models.publication import Publication
class Advertisement(models.Model):
customer = models.CharFiel... | bsd-3-clause |
SamYaple/neutron | neutron/tests/unit/quota/test_resource_registry.py | 15 | 7717 | # Copyright (c) 2015 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 |
Starkiller4011/astroSF | m2_convert.py | 1 | 1131 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
#####################################
# ╔╗ ┬ ┬ ┬┌─┐ ╔╦╗┌─┐┌┬┐ #
# ╠╩╗│ │ │├┤ ║║│ │ │ #
# ╚═╝┴─┘└─┘└─┘ ═╩╝└─┘ ┴ #
# ╔═╗┌─┐┌─┐┌┬┐┬ ┬┌─┐┬─┐┌─┐ #
# ╚═╗│ │├┤ │ │││├─┤├┬┘├┤ #
# ╚═╝└─┘└ ┴ └┴┘┴ ┴┴└─└─┘ #
###... | mit |
jcollado/datagrid-gtk3 | datagrid_gtk3/tests/utils/test_transformations.py | 2 | 1682 | """Data transformation utilities test cases."""
import unittest
from datagrid_gtk3.utils.transformations import degree_decimal_str_transform
class DegreeDecimalStrTransformTest(unittest.TestCase):
"""Degree decimal string transformation test case."""
def test_no_basestring(self):
"""AssertionError... | mit |
laperry1/android_external_chromium_org | testing/generate_gmock_mutant.py | 110 | 14946 | #!/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 string
import sys
HEADER = """\
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code... | bsd-3-clause |
rixrix/servo | tests/wpt/css-tests/tools/pywebsocket/src/example/abort_handshake_wsh.py | 465 | 1781 | # Copyright 2012, 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 |
camon/Flexget | pavement.py | 4 | 10182 | """
FlexGet build and development utilities - unfortunately this file is somewhat messy
"""
import os
import sys
from paver.easy import *
import paver.virtual
import paver.setuputils
from paver.setuputils import setup, find_package_data, find_packages
sphinxcontrib = False
try:
from sphinxcontrib import paverutil... | mit |
cxxgtxy/tensorflow | tensorflow/python/kernel_tests/attention_ops_test.py | 85 | 7316 | # 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 |
DougBurke/astropy | astropy/convolution/tests/test_kernel_class.py | 2 | 19662 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
import pytest
import numpy as np
from numpy.testing import assert_almost_equal, assert_allclose
from ..convolve import convolve, convolve_fft
from ..kernels import (
Gaussian1DKernel, Gaussian2DKernel, Box1DKernel, Box2DKernel,
... | bsd-3-clause |
indictranstech/reciphergroup-erpnext | erpnext/patches/v5_0/update_item_desc_in_invoice.py | 96 | 1641 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.website.utils import find_first_image
from frappe.utils import cstr
import re
def execute():
item_details = frappe._dict()
for d in frappe.db.sql("select name, des... | agpl-3.0 |
pmav99/FloodMapsWorkshop | python/config.py | 2 | 6005 | import os
#
# Directories setup
#
DATA_DIR = os.environ['WORKSHOP_DIR'] + "/data"
PYTHON_DIR = os.environ['WORKSHOP_DIR'] + "/python"
#
# Height Above NEarest Drainage (HAND)
#
HANDS_DIR = os.path.join(DATA_DIR, "HAND")
HYDROSHEDS_DIR = os.path.join(DATA_DIR, "HydroSHEDS")
# HAND regional area.
#HANDS_AREA = ... | apache-2.0 |
rooi/CouchPotatoServer | couchpotato/core/plugins/browser/main.py | 10 | 3390 | from couchpotato.api import addApiView
from couchpotato.core.helpers.variable import getUserDir
from couchpotato.core.plugins.base import Plugin
import ctypes
import os
import string
if os.name == 'nt':
import imp
try:
imp.find_module('win32file')
except:
# todo:: subclass ImportError for m... | gpl-3.0 |
krisys/django | django/contrib/auth/views.py | 47 | 12477 | import functools
import warnings
from django.conf import settings
# Avoid shadowing the login() and logout() views below.
from django.contrib.auth import (
REDIRECT_FIELD_NAME, get_user_model, login as auth_login,
logout as auth_logout, update_session_auth_hash,
)
from django.contrib.auth.decorators import log... | bsd-3-clause |
bpsinc-native/src_third_party_chromite | cros/commands/cros_chrome_sdk_unittest.py | 1 | 18425 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module tests the cros image command."""
import copy
import mock
import os
import shutil
import sys
sys.path.insert(0, os.... | bsd-3-clause |
adamtiger/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/inline_impl.py | 82 | 5595 | # 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 |
robbiet480/home-assistant | tests/components/counter/common.py | 24 | 1035 | """Collection of helper methods.
All containing methods are legacy helpers that should not be used by new
components. Instead call the service directly.
"""
from homeassistant.components.counter import (
DOMAIN,
SERVICE_DECREMENT,
SERVICE_INCREMENT,
SERVICE_RESET,
)
from homeassistant.const import ATTR... | apache-2.0 |
yfried/ansible | lib/ansible/modules/network/radware/vdirect_file.py | 27 | 9278 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 Radware LTD.
#
# 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... | gpl-3.0 |
40423245/2017springcd_hw | plugin/liquid_tags/vimeo.py | 288 | 1808 | """
Vimeo Tag
---------
This implements a Liquid-style vimeo tag for Pelican,
based on the youtube tag which is in turn based on
the jekyll / octopress youtube tag [1]_
Syntax
------
{% vimeo id [width height] %}
Example
-------
{% vimeo 10739054 640 480 %}
Output
------
<div style="width:640px; height:480px;">
... | agpl-3.0 |
jelly/calibre | src/calibre/ebooks/metadata/sources/covers.py | 2 | 6230 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import time
f... | gpl-3.0 |
adityahase/frappe | frappe/config/customization.py | 1 | 1286 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Form Customization"),
"icon": "fa fa-glass",
"items": [
{
"type": "doctype",
"name": "Customize Form",
"description": _("Change field properties (hide, readonly, permission etc.)")
},
... | mit |
yotchang4s/cafebabepy | src/main/python/test/test_symtable.py | 5 | 6951 | """
Test the API of the symtable module.
"""
import symtable
import unittest
TEST_CODE = """
import sys
glob = 42
class Mine:
instance_var = 24
def a_method(p1, p2):
pass
def spam(a, b, *var, **kw):
global bar
bar = 47
x = 23
glob
def internal():
return x
return int... | bsd-3-clause |
nesdis/djongo | tests/django_tests/tests/v22/tests/postgres_tests/migrations/0002_create_test_models.py | 11 | 10552 | from django.core.serializers.json import DjangoJSONEncoder
from django.db import migrations, models
from ..fields import (
ArrayField, BigIntegerRangeField, CICharField, CIEmailField, CITextField,
DateRangeField, DateTimeRangeField, DecimalRangeField, HStoreField,
IntegerRangeField, JSONField, SearchVector... | agpl-3.0 |
theimaginaire/dayone | node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 1417 | 12751 | #!/usr/bin/env python
# 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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | mit |
bdeluca/oiio | testsuite/oiiotool/run.py | 1 | 15510 | #!/usr/bin/env python
# Create some test images we need
command += oiiotool ("--create 320x240 3 -d uint8 -o black.tif")
command += oiiotool ("--pattern constant:color=0.5,0.5,0.5 128x128 3 -d half -o grey128.exr")
command += oiiotool ("--pattern constant:color=0.5,0.5,0.5 64x64 3 -d half -o grey64.exr")
command += o... | bsd-3-clause |
matthiasdiener/spack | var/spack/repos/builtin/packages/resourceproto/package.py | 5 | 1755 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
Nowheresly/odoo | addons/account/ir_sequence.py | 336 | 2454 | # -*- 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 |
sofianehaddad/ot-svn | python/test/t_Graph_mix.py | 2 | 2474 | #! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
# Instanciate one distribution object
dim = 2
meanPoint = NumericalPoint(dim, 1.0)
meanPoint[0] = 12.0
meanPoint[1] = 5.0
sigma = NumericalPoint(dim, 1.0)
sigma[0] = 3.0
sigma[1] = 1.0
R ... | mit |
broesamle/servo | components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py | 241 | 1893 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface DuplicateQualifiers1 {
getter getter byte foo(unsigned long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... | mpl-2.0 |
mikewiebe-ansible/ansible | lib/ansible/modules/network/aci/mso_schema_site_vrf_region.py | 13 | 6407 | #!/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 |
Manuel4131/swampdragon | swampdragon/models.py | 11 | 4147 | from django.db.models import ForeignKey
from .pubsub_providers.base_provider import PUBACTIONS
from .model_tools import get_property
from .pubsub_providers.model_publisher import publish_model
from .serializers.serializer_importer import get_serializer
from django.db.models.signals import pre_delete, m2m_changed
from d... | bsd-3-clause |
cihaterdal/limbo-android | jni/qemu/scripts/tracetool/format/__init__.py | 205 | 3012 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Format management.
Creating new formats
--------------------
A new format named 'foo-bar' corresponds to Python module
'tracetool/format/foo_bar.py'.
A format module should provide a docstring, whose first non-empty line will be
considered its short description.
A... | gpl-2.0 |
switch-model/switch-hawaii | scenario_data.py | 2 | 37498 | import time, sys, collections, os
from textwrap import dedent
import psycopg2
# NOTE: instead of using the python csv writer, this directly writes tables to
# file in the pyomo .tab format. This uses tabs between columns and the standard
# line break for the system it is run on. This does the following translations (... | apache-2.0 |
andmos/ansible | lib/ansible/modules/cloud/rackspace/rax_meta.py | 102 | 4782 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
suxinde2009/zulip | confirmation/models.py | 116 | 4206 | # -*- coding: utf-8 -*-
# Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com>
__revision__ = '$Id: models.py 28 2009-10-22 15:03:02Z jarek.zgoda $'
import re
from django.db import models
from django.core.urlresolvers import reverse
from django.core.mail import send_mail
from django.conf import settings
from dj... | apache-2.0 |
gangadhar-kadam/laganfrappe | frappe/website/permissions.py | 28 | 2434 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def remove_empty_permissions():
permissions_cache_to_be_cleared = frappe.db.sql_list("""select distinct user
from `tabWebsite Route Permission`
where ifnull... | mit |
h3llrais3r/Auto-Subliminal | lib/babelfish/data/get_files.py | 68 | 1554 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
import os.path
import tempfile
import zipfile
import reque... | gpl-3.0 |
tcwicklund/django | tests/aggregation_regress/tests.py | 102 | 55724 | from __future__ import unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
F, Q, Avg, Coun... | bsd-3-clause |
rkashapov/buildbot | master/buildbot/monkeypatches/python14653.py | 5 | 1254 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
z00223295/kubernetes | hack/verify-flags-underscore.py | 83 | 8826 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
ibazzi/xbmc | addons/script.module.requests/lib/requests/packages/urllib3/_collections.py | 666 | 10553 | from __future__ import absolute_import
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
... | gpl-2.0 |
akamel001/Sick-Beard | sickbeard/properFinder.py | 5 | 12379 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
tboyce021/home-assistant | homeassistant/components/apple_tv/media_player.py | 2 | 8084 | """Support for Apple TV media player."""
import logging
from pyatv.const import DeviceState, FeatureName, FeatureState, MediaType
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
MEDIA_TYPE_TVSHOW,
MEDIA_TYPE_VI... | apache-2.0 |
mKeRix/home-assistant | homeassistant/components/fritz/device_tracker.py | 10 | 3266 | """Support for FRITZ!Box routers."""
import logging
from fritzconnection.lib.fritzhosts import FritzHosts
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
import ... | mit |
dahiro/shotgun-replica | shotgun_replica/python/src/shotgun_replica/thumbnails.py | 1 | 2787 | # -*- coding: utf-8 -*-
'''
handling thumbnailing
'''
from shotgun_replica import config as srconfig
import shotgun_api3
import os
from shotgun_api3.lib.httplib2 import Http
from shotgun_replica.utilities import debug
from elefant.utilities import config
import uuid
import shutil
def getUrlAndStoreLocally( entity_ty... | bsd-3-clause |
wuhengzhi/chromium-crosswalk | third_party/cython/src/Cython/Build/BuildExecutable.py | 98 | 4286 | """
Compile a Python script into an executable that embeds CPython and run it.
Requires CPython to be built as a shared library ('libpythonX.Y').
Basic usage:
python cythonrun somefile.py [ARGS]
"""
DEBUG = True
import sys
import os
from distutils import sysconfig
def get_config_var(name, default=''):
retu... | bsd-3-clause |
kiennquit2011/androguard | androguard/decompiler/decompiler.py | 14 | 16697 | # This file is part of Androguard.
#
# Copyright (C) 2013, Anthony Desnos <desnos at t0t0.fr>
# 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... | apache-2.0 |
benrudolph/commcare-hq | corehq/apps/reports/forms.py | 1 | 5262 | from django import forms
from django.core.validators import MinLengthValidator
from django.template.loader import render_to_string
from corehq.apps.style.forms.fields import MultiEmailField
from corehq.apps.userreports.reports.view import ConfigurableReport
from crispy_forms import layout as crispy
from crispy_forms.he... | bsd-3-clause |
Vamshi99/coala-bears | tests/general/KeywordBearTest.py | 6 | 9802 | from collections import namedtuple
from queue import Queue
import unittest
import logging
from bears.general.KeywordBear import KeywordBear
from coalib.results.HiddenResult import HiddenResult
from coalib.results.SourceRange import SourceRange
from coalib.settings.Section import Section
from coalib.settings.Setting im... | agpl-3.0 |
andrewnsk/dorokhin.moscow | blog/models.py | 1 | 2578 | import os
import uuid
from django.db import models
from django.urls import reverse
from ckeditor.fields import RichTextField
from extended_profile.models import Profile
from taggit.managers import TaggableManager
def get_file_name(instance, filename):
ext = filename.split('.')[-1]
filename = "%s.%s" % (uuid.u... | mit |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/tools/gyp/test/configurations/inheritance/gyptest-inheritance.py | 430 | 1047 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies build of an executable in three different configurations.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('configur... | apache-2.0 |
AlbertoPeon/invenio | modules/websubmit/lib/functions/Set_RN_From_Sysno.py | 24 | 8173 | ## This file is part of Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at... | gpl-2.0 |
timlinux/inasafe | safe/definitions/layer_modes.py | 11 | 2921 | # coding=utf-8
"""
Definitions relating to layer modes (continuous or classified data).
"""
from safe.utilities.i18n import tr
__copyright__ = "Copyright 2016, The InaSAFE Project"
__license__ = "GPL version 3"
__email__ = "info@inasafe.org"
__revision__ = '$Format:%H$'
layer_mode_continuous = {
'key': 'continu... | gpl-3.0 |
mano3m/CouchPotatoServer | libs/sqlalchemy/dialects/postgresql/pg8000.py | 18 | 3801 | # postgresql/pg8000.py
# Copyright (C) 2005-2013 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 PostgreSQL database via the pg8000 driver.
Connecting
-------... | gpl-3.0 |
amontefusco/gnuradio-amontefusco | gnuradio-core/src/python/gnuradio/gr/qa_interp_fir_filter.py | 6 | 1794 | #!/usr/bin/env python
#
# Copyright 2004,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your opt... | gpl-3.0 |
Brahimbaz/venom-xbmc-addons-beta | plugin.video.vstream/resources/sites/trash/anime_no_paradise_com.py | 4 | 7104 | #-*- coding: utf-8 -*-
#Venom.
from resources.lib.gui.hoster import cHosterGui
from resources.lib.handler.hosterHandler import cHosterHandler
from resources.lib.gui.gui import cGui
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.handler.inputParameterHandler import cInputParameterHandler
from re... | gpl-2.0 |
project-chip/connectedhomeip | scripts/helpers/upload_release_asset.py | 1 | 3692 | #!/usr/bin/env python3
#
# Copyright (c) 2021 Project CHIP Authors
#
# 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 a... | apache-2.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_1_2/django/core/cache/backends/db.py | 46 | 5954 | "Database cache backend."
from django.core.cache.backends.base import BaseCache
from django.db import connections, router, transaction, DatabaseError
import base64, time
from datetime import datetime
try:
import cPickle as pickle
except ImportError:
import pickle
class Options(object):
"""A class that wil... | mit |
eahneahn/free | lib/python2.7/site-packages/setuptools-2.1-py2.7.egg/setuptools/tests/test_test.py | 286 | 3710 | # -*- coding: UTF-8 -*-
"""develop tests
"""
import sys
import os, shutil, tempfile, unittest
import tempfile
import site
from distutils.errors import DistutilsError
from setuptools.compat import StringIO
from setuptools.command.test import test
from setuptools.command import easy_install as easy_install_pkg
from set... | agpl-3.0 |
mantidproject/mantid | qt/python/mantidqt/widgets/memorywidget/memoryinfo.py | 3 | 1136 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
hschilling/pyOpt | pyOpt/pyOpt_gradient.py | 1 | 10818 | #!/usr/bin/env python
'''
pyOpt_gradient
Holds the Python Design Optimization Gradient Calculation Class.
Copyright (c) 2008-2013 by pyOpt Developers
All rights reserved.
Revision: 1.0 $Date: 20/06/2010 21:00$
Developers:
-----------
- Dr. Ruben E. Perez (RP)
- Mr. Peter W. Jansen (PJ)
History
-------
v. 1.0... | gpl-3.0 |
huyphan/pyyawhois | test/record/parser/test_response_whois_nic_it_status_registered.py | 1 | 6573 |
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# spec/fixtures/responses/whois.nic.it/status_registered
#
# and regenerate the tests with the following script
#
# $ scripts/generate_tests.py
#
from nose.tools import *
from dateutil.parser import parse ... | mit |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/tests/panels/test_staticfiles.py | 30 | 1108 | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.contrib.staticfiles import finders
from ..base import BaseTestCase
class StaticFilesPanelTestCase(BaseTestCase):
def setUp(self):
super(StaticFilesPanelTestCase, self).setUp()
self.panel = self.toolbar.get_pan... | bsd-3-clause |
vbshah1992/microblog | flask/lib/python2.7/site-packages/openid/consumer/discover.py | 142 | 16062 | # -*- test-case-name: openid.test.test_discover -*-
"""Functions to discover OpenID endpoints from identifiers.
"""
__all__ = [
'DiscoveryFailure',
'OPENID_1_0_NS',
'OPENID_1_0_TYPE',
'OPENID_1_1_TYPE',
'OPENID_2_0_TYPE',
'OPENID_IDP_2_0_TYPE',
'OpenIDServiceEndpoint',
'discover',
]... | bsd-3-clause |
trriplejay/kubernetes | cluster/juju/charms/trusty/kubernetes/hooks/lib/registrator.py | 160 | 3478 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
pozetroninc/micropython | tests/perf_bench/bm_nqueens.py | 2 | 1952 | # Source: https://github.com/python/pyperformance
# License: MIT
# Simple, brute-force N-Queens solver.
# author: collinwinter@google.com (Collin Winter)
# n_queens function: Copyright 2009 Raymond Hettinger
# Pure-Python implementation of itertools.permutations().
def permutations(iterable, r=None):
"""permutati... | mit |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_4/django/contrib/localflavor/id/forms.py | 87 | 7181 | """
ID-specific Form helpers
"""
from __future__ import absolute_import
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.utils.encoding impor... | mit |
openhardnudd/QMarkdowner | dpkt/dns.py | 12 | 12045 | # $Id: dns.py 27 2006-11-21 01:22:52Z dahelder $
"""Domain Name System."""
import struct
import dpkt
DNS_Q = 0
DNS_R = 1
# Opcodes
DNS_QUERY = 0
DNS_IQUERY = 1
DNS_STATUS = 2
DNS_NOTIFY = 4
DNS_UPDATE = 5
# Flags
DNS_CD = 0x0010 # checking disabled
DNS_AD = 0x0020 # authenticated data
DNS_Z = 0x0040 # unused
DNS_... | mit |
HeH-Projects/team-agozzino | frontend/node_modules/node-gyp/gyp/PRESUBMIT.py | 1369 | 3662 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | apache-2.0 |
wei-Z/Python-Machine-Learning | self_practice/CH2A.py | 1 | 4506 | import numpy as np
class Perceptron(object):
"""Perceptron classifier.
Parameters
------------
eta : float
Learning rate (between 0.0 and 1.0)
n_iter : int
Passes over the training dataset.
Attributes
-----------
w_ : 1d-array
Weig... | mit |
ksrajkumar/openerp-6.1 | openerp/addons/sale_layout/__openerp__.py | 9 | 1948 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
cbdavide/competitive-programming | kattis/bitbybit/bitbybit.py | 1 | 1211 |
def generate():
return list('?'*32)
def resolveAND(i, j):
if i == '?' and j == '?':
return '?'
if (i == '?' or j == '?') and (i == '0' or j == '0'):
return '0'
if (i == '?' or j == '?') and (i == '1' or j == '1'):
return '?'
b = bool(int(i)) and bool(int(j))
return s... | gpl-3.0 |
awalls-cx18/gnuradio | gr-filter/python/filter/qa_dc_blocker.py | 7 | 3678 | #!/usr/bin/env python
#
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your optio... | gpl-3.0 |
kichkasch/ioids | g4ds/g4dslogging.py | 1 | 5157 | """
Provides Logging facilities.
Grid for Digital Security (G4DS)
Currently, simple logging into files.
@author: Michael Pilgermann
@contact: mailto:mpilgerm@glam.ac.uk
@license: GPL (General Public License)
"""
from time import strftime
import string
import syslog
# "singleton"
_defaultLogger = None
def getDefaul... | gpl-3.0 |
ar45/django | tests/postgres_tests/migrations/0002_create_test_models.py | 231 | 8070 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from ..fields import * # NOQA
class Migration(migrations.Migration):
dependencies = [
('postgres_tests', '0001_setup_extensions'),
]
operations = [
migrations.CreateModel(
... | bsd-3-clause |
eugena/seantis-questionnaire | questionnaire/tests.py | 9 | 8149 | """
Basic Test Suite for Questionnaire Application
Unfortunately Django 1.0 only has TestCase and not TransactionTestCase
so we can't test that a submitted page with an error does not have any
answers submitted to the DB.
"""
from django.test import TestCase
from django.test.client import Client
from questionnaire.mod... | bsd-3-clause |
CVML/scikit-learn | sklearn/tests/test_multiclass.py | 72 | 24581 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing ... | bsd-3-clause |
BeenzSyed/tempest | tempest/services/compute/xml/tenant_usages_client.py | 1 | 1915 | # Copyright 2013 NEC Corporation
# 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 ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.