repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
0nse/WikiWho | functions/print.py | 1 | 8966 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@author: Maribel Acosta
@author: Fabian Floeck
@author: Michael Ruster
'''
import csv
import re
import functions.TextPostProcessing as TextPostProcessing
import functions.WarningTemplates as WarningTemplates
import BlockTimeCalculation
from datetime import datetime
def w... | mit |
johannmeyer/bepoppy8 | start.py | 12 | 16455 | #!/usr/bin/env python
from __future__ import print_function
import pygtk
import gtk
pygtk.require('2.0')
import os
import shutil
import datetime
from fnmatch import fnmatch
import subprocess
class ConfChooser(object):
# General Functions
def update_combo(self, combo, clist, active):
combo.set_se... | gpl-2.0 |
Ardesco/selenium | py/test/selenium/webdriver/common/clear_tests.py | 8 | 2547 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
tpfanco/tpfanco-admin | src/tpfanco_admin/thermometer.py | 1 | 23240 | #! /usr/bin/python2.7
# -*- coding: utf-8 -*-
#
# tpfanco - controls the fan-speed of IBM/Lenovo ThinkPad Notebooks
# Copyright (C) 2011-2015 Vladyslav Shtabovenko
# Copyright (C) 2007-2009 Sebastian Urban
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... | gpl-3.0 |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/numpy/polynomial/tests/test_chebyshev.py | 24 | 18772 | """Tests for chebyshev module.
"""
from __future__ import division
import numpy as np
import numpy.polynomial.chebyshev as ch
from numpy.testing import *
def trim(x) :
return ch.chebtrim(x, tol=1e-6)
T0 = [ 1]
T1 = [ 0, 1]
T2 = [-1, 0, 2]
T3 = [ 0, -3, 0, 4]
T4 = [ 1, 0, -8, 0, 8]
T5 = [ 0, 5, ... | agpl-3.0 |
Matt-Deacalion/django | django/db/backends/oracle/schema.py | 404 | 5313 | import binascii
import copy
import datetime
import re
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.utils import DatabaseError
from django.utils import six
from django.utils.text import force_text
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_column = "ALT... | bsd-3-clause |
bzero/bitex | libs/coinkit/coinkit/wallet.py | 10 | 1797 | # -*- coding: utf-8 -*-
"""
Coinkit
~~~~~
:copyright: (c) 2014 by Halfmoon Labs
:license: MIT, see LICENSE for more details.
"""
from inspect import isclass
from .keypair import *
from .passphrase import random_256bit_passphrase, random_160bit_passphrase
def is_cryptocurrency_keypair_class(cls):
... | gpl-3.0 |
Snifer/BurpSuite-Plugins | Sqlmap/tamper/versionedkeywords.py | 7 | 1619 | #!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import re
from lib.core.common import singleTimeWarnMessage
from lib.core.data import kb
from lib.core.enums import DBMS
from lib.core.enums import PRIORITY
__prio... | gpl-2.0 |
alrusdi/lettuce | tests/integration/lib/Django-1.2.5/django/template/debug.py | 66 | 3732 | from django.template import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
class DebugLexer(Lexer):
def __init_... | gpl-3.0 |
abstract-open-solutions/server-tools | auth_from_http_remote_user/controllers/main.py | 41 | 4132 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Laurent Mignon
# Copyright 2014 'ACSONE SA/NV'
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
coderbone/SickRage-alt | lib/github/Installation.py | 7 | 3318 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2017 Jannis Gebauer <ja.geb@me.com> #
# ... | gpl-3.0 |
jeromecc/doctoctocbot | src/doctocnet/urls.py | 1 | 2933 | """doctocnet URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | mpl-2.0 |
madjelan/scikit-learn | sklearn/preprocessing/data.py | 113 | 56747 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Eric Martin <eric@ericmart.in>
# License: BSD 3 clause
from itertools import chain, combina... | bsd-3-clause |
dmsimard/ansible | test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/legacy/base.py | 47 | 4455 | # -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The VyOS interfaces fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on the ... | gpl-3.0 |
hypothesis/via | via/views/index.py | 1 | 1231 | from urllib.parse import urlparse
from pyramid.httpexceptions import HTTPFound, HTTPNotFound
from pyramid.view import view_config, view_defaults
from via.views._helpers import url_from_user_input
from via.views.exceptions import BadURL
@view_defaults(route_name="index")
class IndexViews:
def __init__(self, requ... | mit |
pculture/unisubs | apps/auth/forms.py | 1 | 10180 | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 your op... | agpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/bdb.py | 144 | 21714 | """Debugger basics"""
import fnmatch
import sys
import os
import types
__all__ = ["BdbQuit","Bdb","Breakpoint"]
class BdbQuit(Exception):
"""Exception to give up completely"""
class Bdb:
"""Generic Python debugger base class.
This class takes care of details of the trace facility;
a derived class... | mit |
CongLi/avocado-vt | virttest/libvirt_vm.py | 2 | 106547 | """
Utility classes and functions to handle Virtual Machine creation using libvirt.
:copyright: 2011 Red Hat Inc.
"""
import time
import string
import os
import logging
import fcntl
import re
import shutil
import tempfile
import platform
import aexpect
from avocado.utils import process
from avocado.utils import cryp... | gpl-2.0 |
frank10704/DF_GCS_W | MissionPlanner-master/packages/IronPython.StdLib.2.7.5-beta1/content/Lib/distutils/command/upload.py | 54 | 7196 | """distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
import os
import socket
import platform
from urllib2 import urlopen, Request, HTTPError
from base64 import standard_b64encode
import urlparse
import cStringIO as StringIO
from hashlib import md5
from dist... | gpl-3.0 |
dasbruns/netzob | src/netzob/Common/Models/Vocabulary/UnknownSymbol.py | 1 | 4213 | #-*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocols... | gpl-3.0 |
beni55/fuzzywuzzy | fuzzywuzzy/utils.py | 11 | 1841 | from __future__ import unicode_literals
import sys
from fuzzywuzzy.string_processing import StringProcessor
PY3 = sys.version_info[0] == 3
def validate_string(s):
try:
return len(s) > 0
except TypeError:
return False
bad_chars = str("").join([chr(i) for i in range(128, 256)]) # ascii damm... | mit |
ep1cman/workload-automation | wlauto/core/workload.py | 5 | 4009 | # Copyright 2014-2015 ARM Limited
#
# 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 w... | apache-2.0 |
cesc-park/CRCN | entity/grid_adder_to_data.py | 1 | 2515 | #import entity_grid
from entity_grid import *
from parsetree import *
import svm as disvm
import json
import pickle
import os
import re
# from easydict import EDict as edict
# args = edict()
# args.jobs = 1
# args.mem = 10
args={}
args['jobs']=1
args['mem']=10
args['parser']="./stanford-parser/stanford-parser.jar"
arg... | mit |
eptmp3/Sick-Beard | lib/enzyme/__init__.py | 168 | 2414 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is free software; you can redistribute it and/or mod... | gpl-3.0 |
GheRivero/ansible | lib/ansible/modules/storage/netapp/na_ontap_snapshot.py | 9 | 11805 | #!/usr/bin/python
# (c) 2018, NetApp, 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',
'status': ['preview'],
... | gpl-3.0 |
fossoult/odoo | openerp/modules/loading.py | 59 | 21202 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
bitifirefly/edx-platform | common/djangoapps/third_party_auth/tests/utils.py | 112 | 3037 | """Common utility for testing third party oauth2 features."""
import json
import httpretty
from provider.constants import PUBLIC
from provider.oauth2.models import Client
from social.apps.django_app.default.models import UserSocialAuth
from student.tests.factories import UserFactory
from .testutil import ThirdParty... | agpl-3.0 |
HiSPARC/station-software | user/python/Lib/test/test_rfc822.py | 23 | 9461 | import unittest
from test import test_support
rfc822 = test_support.import_module("rfc822", deprecated=True)
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class MessageTestCase(unittest.TestCase):
def create_message(self, msg):
return rfc822.Message(String... | gpl-3.0 |
Carmezim/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator.py | 5 | 55283 | # 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 |
Carmezim/tensorflow | tensorflow/contrib/learn/python/learn/estimators/constants.py | 79 | 1657 | # 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 |
VinceZK/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/wire_format.py | 561 | 8431 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
CSC301H-Fall2013/JuakStore | site-packages/build/lib/django/test/testcases.py | 31 | 46782 | from __future__ import unicode_literals
import difflib
import json
import os
import re
import sys
from copy import copy
from functools import wraps
try:
from urllib.parse import urlsplit, urlunsplit
except ImportError: # Python 2
from urlparse import urlsplit, urlunsplit
import select
import socket
import ... | mit |
heeraj123/oh-mainline | mysite/search/migrations/0023_re_run_icon_scaling.py | 17 | 3768 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
# Copyright (C) 2010 John Stumpo
#
# 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, ... | agpl-3.0 |
beni55/django | django/contrib/gis/db/backends/base/features.py | 93 | 3542 | from functools import partial
from django.contrib.gis.db.models import aggregates
class BaseSpatialFeatures(object):
gis_enabled = True
# Does the database contain a SpatialRefSys model to store SRID information?
has_spatialrefsys_table = True
# Does the backend support the django.contrib.gis.utils... | bsd-3-clause |
NullSoldier/django | tests/app_loading/tests.py | 288 | 3113 | from __future__ import unicode_literals
import os
from django.apps import apps
from django.test import SimpleTestCase
from django.test.utils import extend_sys_path
from django.utils import six
from django.utils._os import upath
class EggLoadingTest(SimpleTestCase):
def setUp(self):
self.egg_dir = '%s/e... | bsd-3-clause |
dcosentino/edx-platform | lms/djangoapps/instructor/features/bulk_email.py | 116 | 6813 | """
Define steps for bulk email acceptance test.
"""
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from lettuce.django import mail
from nose.tools import assert_in, assert_equal # pylint: disable=no-name-in-module
from django.core.management import call_co... | agpl-3.0 |
arenadata/ambari | ambari-server/src/main/resources/stacks/ADH/1.0/services/HBASE/package/scripts/hbase_thrift_server.py | 2 | 1815 | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | apache-2.0 |
archyufa/CloudFerry | condensation/group.py | 9 | 3406 | # 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 |
maggienj/ActiveData | mo_kwargs/__init__.py | 2 | 5140 | # encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __f... | mpl-2.0 |
aisipos/django | tests/forms_tests/field_tests/test_filepathfield.py | 22 | 5261 | from __future__ import unicode_literals
import os.path
from django.forms import FilePathField, ValidationError, forms
from django.test import SimpleTestCase
from django.utils import six
from django.utils._os import upath
def fix_os_paths(x):
if isinstance(x, six.string_types):
return x.replace('\\', '/'... | bsd-3-clause |
huchoi/edx-platform | common/lib/xmodule/xmodule/modulestore/__init__.py | 2 | 25982 | """
This module provides an abstraction for working with XModuleDescriptors
that are stored in a database an accessible using their Location as an identifier
"""
import logging
import re
import json
import datetime
from uuid import uuid4
from collections import namedtuple, defaultdict
import collections
from contextl... | agpl-3.0 |
cloudbau/cinder | cinder/tests/api/contrib/test_services.py | 5 | 11428 | # Copyright 2012 IBM Corp.
# 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 app... | apache-2.0 |
ToonTownInfiniteRepo/ToontownInfinite | Panda3D-1.9.0/python/Lib/idlelib/ToolTip.py | 149 | 2736 | # general purpose 'tooltip' routines - currently unused in idlefork
# (although the 'calltips' extension is partly based on this code)
# may be useful for some purposes in (or almost in ;) the current project scope
# Ideas gleaned from PySol
from Tkinter import *
class ToolTipBase:
def __init__(self, button):
... | mit |
finfish/scrapy | scrapy/extensions/telnet.py | 3 | 4136 | """
Scrapy Telnet Console extension
See documentation in docs/topics/telnetconsole.rst
"""
import pprint
import logging
import traceback
import binascii
import os
from twisted.internet import protocol
try:
from twisted.conch import manhole, telnet
from twisted.conch.insults import insults
TWISTED_CONCH_A... | bsd-3-clause |
jcftang/ansible | lib/ansible/modules/packaging/os/opkg.py | 37 | 5435 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrick Pelletier <pp.pelletier@gmail.com>
# Based on pacman (Afterburn) and pkgin (Shaun Zinck) modules
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | gpl-3.0 |
glenn-edgar/local_controller_3 | __backup__/python_2_ref/moisture_monitoring.py | 1 | 11106 | # external control
import datetime
import time
import string
#import urllib2
import math
import redis
import base64
import json
import py_cf.cf_interpreter
import os
import copy
import rabbit_cloud_status_publish
import io_control
class Moisture_Control(object):
def __init__(self, redis_handle , graph_managem... | mit |
pbrod/scipy | scipy/io/netcdf.py | 15 | 37687 | """
NetCDF reader/writer module.
This module is used to read and create NetCDF files. NetCDF files are
accessed through the `netcdf_file` object. Data written to and from NetCDF
files are contained in `netcdf_variable` objects. Attributes are given
as member variables of the `netcdf_file` and `netcdf_variable` objects... | bsd-3-clause |
BT-ojossen/odoo | addons/payment_paypal/tests/test_paypal.py | 378 | 11126 | # -*- coding: utf-8 -*-
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_paypal.controllers.main import PaypalController
from openerp.tools import mute_logger
from lxml import objectify
import u... | agpl-3.0 |
silky/autojump | bin/autojump_utils.py | 18 | 4357 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import errno
from itertools import islice
import os
import platform
import re
import shutil
import sys
import unicodedata
if sys.version_info[0] == 3:
imap = map
os.getcwdu = os.getcwd
else:
from itertools import imap
d... | gpl-3.0 |
makacodewalker/etsgh | django/utils/unittest/loader.py | 353 | 13437 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
import unittest
from fnmatch import fnmatch
from django.utils.unittest import case, suite
try:
from os.path import relpath
except ImportError:
from django.utils.unittest.compatibility import relpath
__unittest = True
de... | bsd-3-clause |
dymkowsk/mantid | Framework/PythonInterface/plugins/algorithms/SaveYDA.py | 2 | 9618 | from __future__ import absolute_import, division, print_function
from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, WorkspaceUnitValidator, \
InstrumentValidator, FileProperty, FileAction
from mantid.kernel import Direction, CompositeValidator
from mantid.dataobje... | gpl-3.0 |
qubell/contrib-python-qubell-client | qubell/tests/testing/test_values_decorator.py | 5 | 2834 | import unittest
from qubell.api.private.testing import values
__author__ = 'dmakhno'
# noinspection PyUnresolvedReferences
class ValuesDecoratorTests(unittest.TestCase):
class FakeInstance(object):
def __init__(self, return_value):
self.returnValues = return_value
rv = {"str": "some str... | apache-2.0 |
hioa-cs/IncludeOS | test/stress/test.py | 4 | 9043 | #!/usr/bin/env python3
from __future__ import division
from __future__ import print_function
from builtins import str
from builtins import range
from past.utils import old_div
import sys
import socket
import time
import subprocess
import os
from vmrunner import vmrunner
from vmrunner.prettify import color
test_name="... | apache-2.0 |
hdinsight/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/lt/formats.py | 118 | 1833 | # -*- 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 = r'Y \m. E j \d.'
TIME_FORMAT = 'H:... | apache-2.0 |
rallylee/gem5 | tests/configs/pc-simple-timing.py | 13 | 2346 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
ZhangXinNan/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/reshape_test.py | 14 | 13148 | # 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 |
Ayub-Khan/edx-platform | lms/djangoapps/lti_provider/users.py | 63 | 5258 | """
LTI user management functionality. This module reconciles the two identities
that an individual has in the campus LMS platform and on edX.
"""
import string
import random
import uuid
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
fr... | agpl-3.0 |
rghe/ansible | lib/ansible/modules/cloud/amazon/cloudfront_invalidation.py | 49 | 10365 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module... | gpl-3.0 |
chauhanhardik/populo | lms/djangoapps/shoppingcart/tests/test_views.py | 3 | 96238 | """
Tests for Shopping Cart views
"""
from collections import OrderedDict
import pytz
from urlparse import urlparse
from decimal import Decimal
import json
from django.http import HttpRequest
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from django.c... | agpl-3.0 |
molebot/brython | www/src/Lib/test/test_bufio.py | 112 | 2599 | import unittest
from test import support
import io # C implementation.
import _pyio as pyio # Python implementation.
# Simple test to ensure that optimizations in the IO library deliver the
# expected results. For best testing, run this under a debug-build Python too
# (to exercise asserts in the C code).
lengths =... | bsd-3-clause |
Anonymouslemming/ansible | lib/ansible/modules/cloud/amazon/route53.py | 24 | 22578 | #!/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 distributed... | gpl-3.0 |
moxon6/chemlab | build/lib.win32-3.4/chemlab/graphics/renderers/atom.py | 6 | 3236 | import numpy as np
from .. import colors
from ...db import ChemlabDB
from .base import AbstractRenderer
from .sphere import SphereRenderer
from .sphere_imp import SphereImpostorRenderer
from .point import PointRenderer
vdw_dict = ChemlabDB().get("data", 'vdwdict')
class AtomRenderer(AbstractRenderer):
"""Render ... | gpl-3.0 |
texcaltech/windmilltownhomes-old | django/template/context.py | 15 | 5405 | from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Cache of actual callables.
_standard_context_processors = None
# We need the CSRF processor no matter what the user has in their settings,
# because otherwise it is a security vulnerability, and we can't afford t... | bsd-3-clause |
mzdaniel/oh-mainline | vendor/packages/twisted/twisted/test/test_udp.py | 18 | 25186 | # -*- test-case-name: twisted.test.test_udp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorUDP} and L{IReactorMulticast}.
"""
from twisted.trial import unittest, util
from twisted.internet.defer import Deferred, gatherResults, maybeDeferred
from... | agpl-3.0 |
wwright2/dcim3-angstrom1 | sources/openembedded-core/meta/lib/oeqa/selftest/sstate.py | 7 | 2453 | import datetime
import unittest
import os
import re
import shutil
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
class SStateBase(oeSelfTest):
def setUpLocal(self):
self.temp_sstate_location = None
... | mit |
aarony/decaf-platform | scripts/qapi-types.py | 47 | 6007 | #
# QAPI types generator
#
# Copyright IBM, Corp. 2011
#
# Authors:
# Anthony Liguori <aliguori@us.ibm.com>
#
# This work is licensed under the terms of the GNU GPLv2.
# See the COPYING.LIB file in the top-level directory.
from ordereddict import OrderedDict
from qapi import *
import sys
import os
import getopt
impor... | gpl-2.0 |
eadgarchen/tensorflow | tensorflow/python/debug/cli/curses_widgets.py | 157 | 6418 | # 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 |
gangadhar-kadam/sapphire_app | selling/doctype/cgi_fun/cgi_fun.py | 1 | 3899 | #For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
sql = webnotes.conn.sql
from webnotes.model.doc import Document, addchild
from webnotes.utils import cstr, cint, flt, comma_or
from datetime import date,timedelta
import datetime
from webnotes.model.code import ge... | agpl-3.0 |
2013Commons/hue | desktop/core/ext-py/Django-1.4.5/django/contrib/gis/geos/libgeos.py | 87 | 5581 | """
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
"""
import os
import re
import sys
from ctypes import c_char... | apache-2.0 |
hanicker/odoo | addons/base_import_module/controllers/main.py | 354 | 1518 | # -*- coding: utf-8 -*-
import functools
import openerp
from openerp.http import Controller, route, request, Response
def webservice(f):
@functools.wraps(f)
def wrap(*args, **kw):
try:
return f(*args, **kw)
except Exception, e:
return Response(response=str(e), status=500... | agpl-3.0 |
cg31/tensorflow | tensorflow/contrib/layers/python/layers/feature_column_ops.py | 5 | 36498 | # 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 |
WuPei/cv_reconstructor | main.py | 1 | 4437 | import fileManager as fm
import camera
import numpy as np
import cv2
import shader as pts_shader
import os
import timeit
from texture import Mesh
from SortBuilding import SortBuilding as sb
import math
def sortBasedOnZ(mylist,refer_list):
return [x for (y,x) in sorted(zip(refer_list,mylist),key = lambda pair:pair[0]... | mit |
neilhan/tensorflow | tensorflow/tensorboard/tensorboard.py | 7 | 5713 | # 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 |
librasungirl/openthread | tools/harness-automation/cases/border_7_1_3.py | 9 | 1876 | #!/usr/bin/env python
#
# Copyright (c) 2019, The OpenThread Authors.
# 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
# notic... | bsd-3-clause |
wolfv/uberwriter | uberwriter/config.py | 1 | 2377 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2019, Wolf Vollprecht <w.vollprecht@gmail.com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free ... | gpl-3.0 |
cloudbase/nova | nova/api/openstack/compute/suspend_server.py | 4 | 3292 | # Copyright 2013 IBM Corp.
#
# 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 w... | apache-2.0 |
ctag/cpe453 | JMRI/jython/javaone/signalstop.py | 21 | 1157 | # stop on signals
def setStopBlock(block, signal,dir) :
s = signals.getSignalHead(signal)
b = jmri.jmrit.tracker.StoppingBlock(block)
b.addSignal(s,dir)
return b
def setStopBlock2(block, signal1, signal2, dir) :
s1 = signals.getSignalHead(signal1)
s2 = signals.getSignalHead(signal2)
b = jmr... | gpl-2.0 |
danimaribeiro/PyTrustNFe | tests/test_nfse_paulistana_tipo_cpfcnpj.py | 1 | 1842 | # coding=utf-8
import os.path
import unittest
from pytrustnfe.xml import render_xml, sanitize_response
from tests.const import DEFAULT_RPS, NFSE
template_path = 'pytrustnfe/nfse/paulistana/templates'
def _get_nfse(tipo_cpfcnpj):
nfse = NFSE
lista_rps = DEFAULT_RPS
for rps in lista_rps:
rps['tom... | agpl-3.0 |
snowzjx/ns3-buffer-management | src/nix-vector-routing/bindings/modulegen__gcc_ILP32.py | 34 | 388692 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
awohns/selection | python_lib/lib/python3.4/site-packages/pip/locations.py | 390 | 6202 | """Locations where we look for configs, install stuff, etc"""
import sys
import site
import os
import tempfile
from distutils.command.install import install, SCHEME_KEYS
import getpass
from pip.backwardcompat import get_python_lib, get_path_uid, user_site
import pip.exceptions
DELETE_MARKER_MESSAGE = '''\
This file ... | mit |
avadacatavra/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_io/terminalwriter.py | 54 | 13486 | """
Helper functions for writing to terminals and files.
"""
import sys, os
import py
py3k = sys.version_info[0] >= 3
from py.builtin import text, bytes
win32_and_ctypes = False
colorama = None
if sys.platform == "win32":
try:
import colorama
except ImportError:
try:
import ctyp... | mpl-2.0 |
ryfeus/lambda-packs | Selenium_PhantomJS/source/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
grischard/postcode-centroid | postcode-centroid.py | 1 | 2908 | #!/usr/bin/env python
"""
Return GeoJSON centroids for each postcode in Luxembourg
- Downloads the latest geojson from UDATA_ADDRESSES
- Average the position of all postcodes
- Spit out geojson
Run like :
python3 postcode-centroid.py > centroids.geojson
A sample centroids.geojson.xz (from 2016-07-11) is included.
... | apache-2.0 |
Opshun/API | venv/lib/python2.7/site-packages/pip/_vendor/packaging/version.py | 451 | 11884 | # Copyright 2014 Donald Stufft
#
# 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... | mit |
berezovskyi/nikola | nikola/data/themes/base/messages/messages_si_lk.py | 28 | 1044 | # -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "",
"(active)": "",
"Also available in:": "",
"Archive": "",
"Authors": "",
"Categories": "",
"Comments": "",
"LANGUAGE": "",
"Languages:": "",
"More posts about %s": "",
... | mit |
sudheesh001/RFID-DBSync | venv/lib/python2.7/site-packages/jinja2/compiler.py | 623 | 61785 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from copy import deepcopy
from keyword import iskeyword as is_python_keyword
from jinja2... | gpl-2.0 |
innainu/climatechangebot | climatechangebot/nyt_interface/nyt_interface.py | 1 | 3194 | """
Searches nyt API for articles related to climate change and returns them.
API returns pages, each page has 10 articles. This currently only returns one page.
Cannot specify how many articles per page in api.
get_trending function returns articles for the past 3 days.
"""
from nytimesarticle impor... | mit |
lshain-android-source/external-chromium_org | third_party/jinja2/environment.py | 111 | 44067 | # -*- 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 *
from ... | bsd-3-clause |
andir/ganeti | test/py/ganeti.server.rapi_unittest.py | 2 | 10157 | #!/usr/bin/python
#
# Copyright (C) 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of... | bsd-2-clause |
XisoDev/xisoPos | node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | 1569 | 23354 | #!/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 to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | gpl-3.0 |
alxgu/ansible | lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py | 26 | 21404 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
# 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': ['previe... | gpl-3.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/host/lib/python2.7/encodings/ptcp154.py | 647 | 8950 | """ Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,err... | gpl-2.0 |
elishowk/django-poser | poser/appresolver.py | 1 | 7288 | # -*- coding: utf-8 -*-
from poser.apphook_pool import apphook_pool
from poser.utils.page_resolver import get_page_queryset
from django.conf import settings
from django.conf.urls.defaults import patterns
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.co... | agpl-3.0 |
pbombnz/IRCBot | modules/quiz.py | 1 | 11722 | import os
import json
import time
import re
import random
from modules import userDatabase
class CaseInsensitiveDict(dict):
def __contains__(self, key):
return dict.__contains__(self, key.lower())
def __getitem__(self, key):
return dict.__getitem__(self, key.lower())
def __setitem__(self... | gpl-2.0 |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/multiprocessing/dummy/__init__.py | 79 | 2881 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [
'Process', 'current_process', 'active_children', 'freeze_support',
'Lock', 'RLock', 'Semaphore', 'Boun... | gpl-3.0 |
EvanK/ansible-modules-core | cloud/amazon/iam_cert.py | 17 | 11879 | #!/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 distributed... | gpl-3.0 |
josenavas/labman | labman/db/process.py | 1 | 115578 | # ----------------------------------------------------------------------------
# Copyright (c) 2017-, labman development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------... | bsd-3-clause |
akhmadMizkat/odoo | addons/mail/models/res_partner.py | 1 | 12524 | # -*- coding: utf-8 -*-
import logging
import threading
from openerp import _, api, fields, models, tools
from openerp.osv import expression
_logger = logging.getLogger(__name__)
class Partner(models.Model):
""" Update partner to add a field about notification preferences. Add a generic opt-out field that can b... | gpl-3.0 |
dingliumath/quant-econ | quantecon/tests/test_graph_tools.py | 4 | 7552 | """
Filename: test_graph_tools.py
Author: Daisuke Oyama
Tests for graph_tools.py
"""
import sys
import numpy as np
from numpy.testing import assert_array_equal
import nose
from nose.tools import eq_, ok_, raises
from quantecon.graph_tools import DiGraph
def list_of_array_equal(s, t):
"""
Compare two lists ... | bsd-3-clause |
draugiskisprendimai/odoo | addons/portal/wizard/__init__.py | 447 | 1098 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.