repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
dgasmith/psi4 | psi4/driver/qcdb/qcformat.py | 3 | 4080 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2019 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
shsingh/ansible | lib/ansible/modules/network/fortios/fortios_firewall_interface_policy.py | 7 | 19948 | #!/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 |
loopCM/chromium | native_client_sdk/src/build_tools/sdk_tools/command/info.py | 4 | 1216 | # 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 command_common
import logging
import manifest_util
def Info(manifest, bundle_names):
valid_bundles, invalid_bundles = command_common.GetValidBu... | bsd-3-clause |
webmull/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/rebaselineserver.py | 127 | 4570 | # Copyright (c) 2010 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 ... | bsd-3-clause |
philipgian/pre-commit | pre_commit/output.py | 1 | 2217 | from __future__ import unicode_literals
import sys
from pre_commit import color
from pre_commit import five
def get_hook_message(
start,
postfix='',
end_msg=None,
end_len=0,
end_color=None,
use_color=None,
cols=80,
):
"""Prints a message for running a hook... | mit |
Ryanglambert/pybrain | pybrain/structure/connections/fullnotself.py | 31 | 1276 | __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from scipy import reshape, dot, outer, eye
from pybrain.structure.connections import FullConnection
class FullNotSelfConnection(FullConnection):
"""Connection which connects every element from the first module's
output buffer to the second module's input ... | bsd-3-clause |
SNAPPETITE/backend | flask/lib/python2.7/site-packages/tempita/_looper.py | 140 | 4161 | """
Helper for looping over sequences, particular in templates.
Often in a loop in a template it's handy to know what's next up,
previously up, if this is the first or last item in the sequence, etc.
These can be awkward to manage in a normal Python loop, but using the
looper you can get a better sense of the context.... | mit |
alexteodor/odoo | addons/sales_team/__openerp__.py | 51 | 1799 | # -*- 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 |
sxjscience/tvm | tests/python/unittest/test_te_schedule.py | 4 | 11434 | # 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 u... | apache-2.0 |
awkspace/ansible | lib/ansible/plugins/filter/json_query.py | 197 | 1857 | # (c) 2015, Filipe Niero Felisbino <filipenf@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) any l... | gpl-3.0 |
AkademieOlympia/sympy | sympy/physics/unitsystems/prefixes.py | 91 | 4190 | # -*- coding: utf-8 -*-
"""
Module defining unit prefixe class and some constants.
Constant dict for SI and binary prefixes are defined as PREFIXES and
BIN_PREFIXES.
"""
from sympy import sympify
class Prefix(object):
"""
This class represent prefixes, with their name, symbol and factor.
Prefixes are ... | bsd-3-clause |
krisys/django | django/core/serializers/xml_serializer.py | 17 | 15681 | """
XML serializer.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import bas... | bsd-3-clause |
trivoldus28/pulsarch-verilog | tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/hotshot/stats.py | 252 | 2582 | """Statistics analyzer for HotShot."""
import profile
import pstats
import hotshot.log
from hotshot.log import ENTER, EXIT
def load(filename):
return StatsLoader(filename).load()
class StatsLoader:
def __init__(self, logfn):
self._logfn = logfn
self._code = {}
self._stack = []
... | gpl-2.0 |
ZhangXinNan/tensorflow | tensorflow/python/kernel_tests/distributions/uniform_test.py | 11 | 11353 | # 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 |
dturner-tw/pants | tests/python/pants_test/android/tasks/test_zipalign.py | 16 | 2041 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | apache-2.0 |
ghyde/letsencrypt | letsencrypt/plugins/disco_test.py | 1 | 9977 | """Tests for letsencrypt.plugins.disco."""
import pkg_resources
import unittest
import mock
import zope.interface
from letsencrypt import errors
from letsencrypt import interfaces
from letsencrypt.plugins import standalone
EP_SA = pkg_resources.EntryPoint(
"sa", "letsencrypt.plugins.standalone",
attrs=("Aut... | apache-2.0 |
neno1978/pelisalacarta | python/main-classic/lib/requests/packages/chardet/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# 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
# versio... | gpl-3.0 |
yujikato/DIRAC | src/DIRAC/Interfaces/scripts/dirac_admin_get_pilot_output.py | 2 | 1395 | #!/usr/bin/env python
########################################################################
# File : dirac-admin-get-pilot-output
# Author : Stuart Paterson
########################################################################
"""
Retrieve output of a Grid pilot
Usage:
dirac-admin-get-pilot-output [options... | gpl-3.0 |
balloob/home-assistant | homeassistant/components/deconz/sensor.py | 5 | 8316 | """Support for deCONZ sensors."""
from pydeconz.sensor import (
Battery,
Consumption,
Daylight,
Humidity,
LightLevel,
Power,
Pressure,
Switch,
Temperature,
Thermostat,
)
from homeassistant.components.sensor import DOMAIN
from homeassistant.const import (
ATTR_TEMPERATURE,
... | apache-2.0 |
jgao54/airflow | airflow/migrations/versions/64de9cddf6c9_add_task_fails_journal_table.py | 12 | 1697 | #
# 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... | apache-2.0 |
dodocat/git-repo | progress.py | 143 | 2036 | #
# Copyright (C) 2009 The Android Open Source Project
#
# 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 la... | apache-2.0 |
codervince/flashingredlight | env/lib/python2.7/site-packages/flask/views.py | 782 | 5642 | # -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
from ._compat import with_metaclass
http_method_funcs =... | mit |
nevir/plexability | extern/gyp/pylib/gyp/generator/make.py | 17 | 88238 | # 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.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... | gpl-2.0 |
sobercoder/gem5 | src/arch/x86/isa/insts/x87/load_constants/load_0_1_or_pi.py | 70 | 2454 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# Copyright (c) 2013 Mark D. Hill and David A. Wood
# 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 int... | bsd-3-clause |
nekrut/tools-iuc | tools/vsnp/vsnp_determine_ref_from_data.py | 12 | 9491 | #!/usr/bin/env python
import argparse
import gzip
import os
from collections import OrderedDict
import yaml
from Bio.SeqIO.QualityIO import FastqGeneralIterator
OUTPUT_DBKEY_DIR = 'output_dbkey'
OUTPUT_METRICS_DIR = 'output_metrics'
def get_sample_name(file_path):
base_file_name = os.path.basename(file_path)
... | mit |
robojukie/myrobotlab | src/resource/VirtualDevice/Arduino.py | 3 | 3258 | #############################################
# This is a basic script to emulate the hardware of
# an Arduino microcontroller. The VirtualDevice
# service will execute this script when
# createVirtualArduino(port) is called
import time
import math
import threading
from random import randint
from org.myrobotlab.codec ... | apache-2.0 |
CouchPotato/CouchPotatoServer | libs/tornado/gen.py | 64 | 35105 | """``tornado.gen`` is a generator-based interface to make it easier to
work in an asynchronous environment. Code using the ``gen`` module
is technically asynchronous, but it is written as a single generator
instead of a collection of separate functions.
For example, the following asynchronous handler::
class Asy... | gpl-3.0 |
KhalidGit/flask | Work/Trivia - Module 5/env/Lib/site-packages/setuptools/command/bdist_egg.py | 286 | 18718 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys, os, marshal
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
# Python 2.7 or >=3.2
from sysconfig import get_path, get_python_version
def _g... | apache-2.0 |
trishnaguha/ansible | lib/ansible/modules/network/meraki/meraki_device.py | 43 | 15823 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net>
# 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 = {
... | gpl-3.0 |
aebrahim/cobrapy | cobra/solvers/esolver.py | 5 | 6286 | from subprocess import check_output, check_call, CalledProcessError
from os import unlink, devnull
from os.path import isfile
from tempfile import NamedTemporaryFile
from fractions import Fraction
from six.moves import zip
from . import cglpk
from .wrappers import *
# detect paths to system calls for esolver and gzip... | lgpl-2.1 |
shawnadelic/shuup | shuup/front/apps/auth/urls.py | 2 | 1132 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.conf.urls import patterns, url
from .views import (
LoginVi... | agpl-3.0 |
tuxcoindev/tuxcoin | contrib/pyminer/pyminer.py | 2 | 6435 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | mit |
seana7a7/node-socket.io-mongodb-example | node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 2214 | 1347 | #!/usr/bin/env python
import re
import json
# http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
louietsai/python-for-android | python-modules/twisted/twisted/test/test_persisted.py | 60 | 8648 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
# System Imports
import sys
from twisted.trial import unittest
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import cStringIO as StringIO
except ImportError:
import StringIO
# Twisted Imports
... | apache-2.0 |
ContinuumIO/ashiba | enaml/enaml/wx/wx_spin_box.py | 1 | 16857 | #------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | bsd-3-clause |
Finntack/pootle | pootle/apps/staticpages/templatetags/staticpages.py | 3 | 2425 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from django import template
from django.core... | gpl-3.0 |
eworm-de/systemd | test/sd-script.py | 12 | 21508 | #!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# sd-script.py: create LOTS of sd device entries in fake sysfs
#
# (C) 2018 Martin Wilck, SUSE Linux GmbH
#
# Run after sys-script.py
# Usage: sd-script.py <directory> <num>
# <num> is the number of device nodes (disks + partitions)
# to create in ad... | gpl-2.0 |
MiLk/ansible | lib/ansible/modules/network/nxos/nxos_rollback.py | 45 | 3780 | #!/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 |
mandx/pyrax | tests/unit/test_cloud_blockstorage.py | 10 | 21816 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import unittest
from mock import patch
from mock import MagicMock as Mock
import pyrax.cloudblockstorage
from pyrax.cloudblockstorage import CloudBlockStorageClient
from pyrax.cloudblockstorage import CloudBlockStorageVolume
from pyrax.cloudblockstorage imp... | apache-2.0 |
browseinfo/odoo_saas3_nicolas | addons/purchase/report/request_quotation.py | 3 | 1571 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
ShashaQin/erpnext | erpnext/setup/doctype/authorization_rule/authorization_rule.py | 121 | 2292 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt
from frappe import _, msgprint
from frappe.model.document import Document
class AuthorizationRule(Do... | agpl-3.0 |
ChemiKhazi/Sprytile | rx/concurrency/virtualtimescheduler.py | 2 | 4699 | import logging
from rx.internal import PriorityQueue, ArgumentOutOfRangeException
from .schedulerbase import SchedulerBase
from .scheduleditem import ScheduledItem
from .scheduleperiodic import SchedulePeriodic
log = logging.getLogger("Rx")
class VirtualTimeScheduler(SchedulerBase):
"""Virtual Scheduler. This ... | mit |
alqfahad/odoo | addons/account/wizard/account_tax_chart.py | 385 | 3247 | # -*- 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 |
kuri65536/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/integration/POP3_TLS.py | 271 | 5466 | """TLS Lite + poplib."""
import socket
from poplib import POP3
from gdata.tlslite.TLSConnection import TLSConnection
from gdata.tlslite.integration.ClientHelper import ClientHelper
# POP TLS PORT
POP3_TLS_PORT = 995
class POP3_TLS(POP3, ClientHelper):
"""This class extends L{poplib.POP3} with TLS support."""
... | apache-2.0 |
TeMPO-Consulting/mediadrop | mediacore/model/settings.py | 1 | 4239 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2013 MediaCore Inc., Felix Schwarz and other contributors.
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See L... | gpl-3.0 |
JeremyRubin/bitcoin | test/functional/p2p_segwit.py | 1 | 95731 | #!/usr/bin/env python3
# Copyright (c) 2016-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
import math
import random
import struct
import t... | mit |
DMOJ/judge | dmoj/tests/test_problem.py | 1 | 4108 | import os
import unittest
from unittest import mock
from dmoj.config import InvalidInitException
from dmoj.problem import Problem, ProblemDataManager
class ProblemTest(unittest.TestCase):
def setUp(self):
self.data_patch = mock.patch('dmoj.problem.ProblemDataManager')
data_mock = self.data_patch.... | agpl-3.0 |
valtech-mooc/edx-platform | common/djangoapps/student/tests/test_roles.py | 61 | 7708 | """
Tests of student.roles
"""
import ddt
from django.test import TestCase
from courseware.tests.factories import UserFactory, StaffFactory, InstructorFactory
from student.tests.factories import AnonymousUserFactory
from student.roles import (
GlobalStaff, CourseRole, CourseStaffRole, CourseInstructorRole,
Or... | agpl-3.0 |
webmedic/booker | src/plugins/tags/__init__.py | 1 | 4970 | from PyQt4 import QtGui, QtCore
import sys, os
import models
from pluginmgr import ShelfView
# This plugin lists the books by tag
EBOOK_EXTENSIONS=['epub','mobi','pdf']
class Catalog(ShelfView):
title = "Books By Tag"
itemText = "Tags"
items = {}
def showList(self, search = None):
"""Ge... | mit |
duncanwp/iris | lib/iris/tests/unit/plot/test_points.py | 11 | 3049 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
zhangjunlei26/servo | python/mozlog/mozlog/structured/formatters/machformatter.py | 45 | 12405 | # 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/.
import time
from collections import defaultdict
try:
import blessings
except ImportError:
blessings = None
imp... | mpl-2.0 |
harisibrahimkv/django | django/db/backends/oracle/compiler.py | 25 | 2437 | from django.db import NotSupportedError
from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False):
"""
Create the SQL for this query. Return the SQL string and list
of parameters. This is overridden from t... | bsd-3-clause |
acrsteiner/three.js | utils/exporters/blender/addons/io_three/logger.py | 176 | 1423 | import os
import logging
import tempfile
from . import constants
LOG_FILE = None
LOGGER = None
LEVELS = {
constants.DEBUG: logging.DEBUG,
constants.INFO: logging.INFO,
constants.WARNING: logging.WARNING,
constants.ERROR: logging.ERROR,
constants.CRITICAL: logging.CRITICAL
}
def init(filename, l... | mit |
timlinux/QGIS | tests/src/python/test_qgspointcloudattributebyramprenderer.py | 1 | 17855 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPointCloudAttributeByRampRenderer
.. note:: 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 2 of the License, or
(at your option) any ... | gpl-2.0 |
maartenq/ansible | lib/ansible/modules/network/eos/eos_vlan.py | 25 | 11418 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | gpl-3.0 |
mattcongy/itshop | docker-images/taigav2/taiga-back/taiga/mdrender/templatetags/functions.py | 2 | 1172 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | mit |
bop/hybrid | lib/python2.6/site-packages/django/contrib/admin/util.py | 101 | 15254 | from __future__ import unicode_literals
import datetime
import decimal
from django.db import models
from django.db.models.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.db.models.related import RelatedObject
from django.forms.forms import pretty_name
from django.utils import f... | gpl-2.0 |
gechr/ansible-modules-extras | network/dnsimple.py | 49 | 11750 | #!/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 |
rotofly/odoo | addons/crm_helpdesk/__init__.py | 442 | 1081 | # -*- 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 |
fernandezcuesta/ansible | lib/ansible/modules/cloud/cloudstack/cs_region.py | 18 | 5397 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
edum1978/eduengage | boilerplate/external/pytz/tzfile.py | 118 | 4340 | #!/usr/bin/env python
'''
$Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
'''
from cStringIO import StringIO
from datetime import datetime, timedelta
from struct import unpack, calcsize
from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo
from pytz.tzinfo import memorized_datetime, memorized_timede... | lgpl-3.0 |
Technorip/Myntra | Django Backend/myntra/env/lib/python2.7/site-packages/django/core/checks/compatibility/django_1_8_0.py | 286 | 1052 | from __future__ import unicode_literals
from django.conf import global_settings, settings
from .. import Tags, Warning, register
@register(Tags.compatibility)
def check_duplicate_template_settings(app_configs, **kwargs):
if settings.TEMPLATES:
values = [
'TEMPLATE_DIRS',
'ALLOWED... | gpl-2.0 |
CouchPotato/CouchPotatoServer | libs/chardet/utf8prober.py | 2919 | 2652 | ######################## 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... | gpl-3.0 |
gigglesninja/senior-design | MissionPlanner/Lib/email/charset.py | 180 | 16043 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
__all__ = [
'Charset',
'add_alias',
'add_charset',
'add_codec',
]
import codecs
import email.base64mime
import email.quoprimime
from email import errors
from email.encoders ... | gpl-2.0 |
erkanay/django | django/http/request.py | 11 | 21075 | from __future__ import unicode_literals
import copy
import os
import re
import sys
from io import BytesIO
from itertools import chain
from pprint import pformat
from django.conf import settings
from django.core import signing
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from django.core.fil... | bsd-3-clause |
freakboy3742/django | tests/forms_tests/widget_tests/test_splitdatetimewidget.py | 84 | 2669 | from datetime import date, datetime, time
from django.forms import SplitDateTimeWidget
from .base import WidgetTest
class SplitDateTimeWidgetTest(WidgetTest):
widget = SplitDateTimeWidget()
def test_render_empty(self):
self.check_html(self.widget, 'date', '', html=(
'<input type="text" ... | bsd-3-clause |
ulif/pulp | server/pulp/server/db/migrations/0027_importer_schema_change.py | 1 | 1091 | import datetime
import isodate
from pulp.server.db.connection import get_collection
def migrate(*args, **kwargs):
"""
Add last_updated and last_override_config to the importer collection.
"""
updated_key = 'last_updated'
config_key = 'last_override_config'
collection = get_collection('repo_i... | gpl-2.0 |
jinnykoo/wuyisj | tests/integration/offer/manager_tests.py | 53 | 1741 | import datetime
from django.test import TestCase
from django.utils import timezone
from oscar.test import factories
from oscar.apps.offer import models
class TestActiveOfferManager(TestCase):
def test_includes_offers_in_date_range(self):
# Create offer that is available but with the wrong status
... | bsd-3-clause |
bitifirefly/edx-platform | lms/djangoapps/verify_student/views.py | 5 | 58018 | """
Views for the verification flow
"""
import datetime
import decimal
import json
import logging
import urllib
from pytz import UTC
from ipware.ip import get_ip
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.core.urlresolv... | agpl-3.0 |
cobalys/django | django/contrib/webdesign/lorem_ipsum.py | 230 | 4908 | """
Utility functions for generating "lorem ipsum" Latin text.
"""
from __future__ import unicode_literals
import random
COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ... | bsd-3-clause |
phalax4/CarnotKE | jyhton/lib-python/2.7/tarfile.py | 8 | 89024 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
#-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustäbel <lars@gustaebel.de>
# All rights reserved.
#
# Permission is hereby granted, fre... | apache-2.0 |
akkana/scripts | astro/marsoppy.py | 1 | 14537 | #!/usr/bin/env python3
# Plot all the planets' orbits, as viewed from a point that
# floats above the Earth's north ecliptic pole and moves with
# the Earth, to demonstrate phenomena like epicycles and the
# Venus pentagram. Idea from Galen Gisler's planetarium show.
#
# Copyright 2020 by Akkana Peck: Share and enjoy ... | gpl-2.0 |
bunnyinc/django-oidc-provider | oidc_provider/tests/test_utils.py | 1 | 2459 | import time
from datetime import datetime
from django.test import TestCase
from django.utils import timezone
from oidc_provider.lib.utils.common import get_issuer
from oidc_provider.lib.utils.token import create_id_token
from oidc_provider.tests.app.utils import create_fake_user
class Request(object):
"""
M... | mit |
mrry/tensorflow | tensorflow/contrib/learn/python/learn/basic_session_run_hooks.py | 3 | 14433 | # 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 |
coderbone/SickRage | lib/tvdb_api/tvdb_api.py | 12 | 35715 | # !/usr/bin/env python2
# encoding:utf-8
# author:dbr/Ben
#project:tvdb_api
#repository:http://github.com/dbr/tvdb_api
#license:unlicense (http://unlicense.org/)
from functools import wraps
import traceback
__author__ = "dbr/Ben"
__version__ = "1.9"
import os
import re
import time
import getpass
import StringIO
impo... | gpl-3.0 |
wldtyp/flask | tests/test_helpers.py | 1 | 27016 | # -*- coding: utf-8 -*-
"""
tests.helpers
~~~~~~~~~~~~~~~~~~~~~~~
Various helpers.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import os
import datetime
import flask
from logging import StreamHandler
from werkzeug.exceptions import BadRe... | bsd-3-clause |
zstackio/zstack-woodpecker | zstackwoodpecker/zstackwoodpecker/zstack_test/vcenter_checker/zstack_vcenter_snapshot_checker.py | 2 | 9805 | import zstackwoodpecker.header.checker as checker_header
import zstackwoodpecker.operations.volume_operations as vol_ops
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.zstack_test.zstack_test_snapshot as zstack_sp_header
import zstackwoodpecker.header... | apache-2.0 |
tuxnani/open-telugu | tests/tamil_regexp.py | 3 | 4571 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (C) 2013-2015 Muthiah Annamalai
#
# This file is part of 'open-tamil' package tests
#
# setup the paths
import codecs
import re
from opentamiltests import *
from tamil.utils.santhirules import joinWords
from tamil.regexp import make_pattern
class SantheeRules(unitt... | mit |
orcasgit/python-healthvault | healthvaultlib/status_codes.py | 1 | 10202 | class HealthVaultStatus(object):
"""Status codes that HealthVault can return.
`See also <http://msdn.microsoft.com/en-us/library/hh567902.aspx>`_
"""
OK = 0 # The request was successful.
FAILED = 1 # Generic failure due to unknown causes or internal error.
BAD_HTTP = 2 # Http protocol prob... | mit |
kkanahin/django-avatar | avatar/views.py | 3 | 8108 | from django.http import Http404
from django.shortcuts import render, redirect
from django.utils import six
from django.utils.translation import ugettext as _
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from avatar.forms import PrimaryAvatarForm, DeleteAvatarForm, Uplo... | bsd-3-clause |
wooga/airflow | tests/www/api/experimental/test_endpoints.py | 1 | 21328 | #
# 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... | apache-2.0 |
vismantic-ohtuprojekti/image-filtering-suite | qualipy/utils/tesseract.py | 2 | 1421 | import subprocess
import tempfile
import os
def img_to_str(tesseract_path, image):
"""Reads text in an image with tesseract-ocr
:param tesseract_path: path to the tesseract executable
:type tesseracth_path: str
:param image: path to the input image
:type image: str
"""
if not os.path.isfi... | mit |
runt18/nupic | src/nupic/data/aggregator.py | 1 | 28990 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | agpl-3.0 |
dje42/gdb | gdb/contrib/cleanup_check.py | 20 | 13262 | # Copyright 2013 Free Software Foundation, Inc.
#
# This 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 i... | gpl-2.0 |
Godiyos/python-for-android | python-build/python-libs/gdata/build/lib/gdata/sample_util.py | 133 | 7858 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google 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 ... | apache-2.0 |
Godiyos/python-for-android | python-build/python-libs/gdata/src/gdata/Crypto/PublicKey/qNEW.py | 228 | 5545 | #
# qNEW.py : The q-NEW signature algorithm.
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness fo... | apache-2.0 |
FNCS/ns-3.26 | src/olsr/bindings/callbacks_list.py | 240 | 1159 | callback_classes = [
['void', 'ns3::Ptr<ns3::Socket>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::Socket>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empt... | gpl-2.0 |
ikjn/qemu-fi-monitor | tests/qemu-iotests/qed.py | 248 | 7194 | #!/usr/bin/env python
#
# Tool to manipulate QED image files
#
# Copyright (C) 2010 IBM, Corp.
#
# Authors:
# Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
import sys
import struct
import r... | gpl-2.0 |
pramasoul/micropython | tests/extmod/vfs_fat_finaliser.py | 14 | 1906 | # Test VfsFat class and its finaliser
try:
import uerrno, uos
uos.VfsFat
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
class RAMBlockDevice:
def __init__(self, blocks, sec_size=512):
self.sec_size = sec_size
self.data = bytearray(blocks * self.sec_size)
... | mit |
fgclaramonte/Odoo-addons | inter_company_rules/models/inter_company_invoice.py | 21 | 5617 | from openerp import models, fields, api, _
from openerp.exceptions import Warning
class account_invoice(models.Model):
_inherit = 'account.invoice'
auto_generated = fields.Boolean(string='Auto Generated Document', copy=False)
auto_invoice_id = fields.Many2one('account.invoice', string='Source Invoice',
... | gpl-3.0 |
pmghalvorsen/gramps_branch | gramps/gen/filters/rules/family/_hastag.py | 2 | 1730 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Nick Hall
#
# 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 2 of the License, or
# (at your option) any... | gpl-2.0 |
camptocamp/odoo | addons/l10n_in_hr_payroll/__init__.py | 430 | 1117 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
linkhub-sdk/popbill.taxinvoice.example.py | cancelIssue.py | 1 | 1516 | # -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import TaxinvoiceService, PopbillException
taxinvoiceService = TaxinvoiceService(testValue.Link... | mit |
dineshappavoo/virtdc | virtdc_init/virtdc_init.py | 2 | 1747 | #!/usr/bin/env python
import subprocess, sys
#API - virtdc command line init tool
#==============================================================================
# Variables
#==============================================================================
# Some descriptive variables
#name = "virtdc"
#ve... | mit |
srvelivela/ansibledoc | lib/ansible/plugins/lookup/consul_kv.py | 89 | 4541 | # (c) 2015, Steve Gargan <steve.gargan@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) any later v... | gpl-3.0 |
SVRobots/Minecraft | modules/world.py | 1 | 2839 | from os import listdir, mkdir
import cPickle
from imp import load_source
api = load_source('api', 'modules\\api.py')
from api import *
class World(object):
#initialize
def __init__(self):
super(World, self).__init__()
self.world="Default"
self.dimension="DIM1"
self.playername="Default"
self.world_blocks={}... | gpl-2.0 |
dati91/servo | tests/wpt/web-platform-tests/resource-timing/resources/multi_redirect.py | 17 | 1767 | def main(request, response):
"""Handler that causes multiple redirections.
The request has two mandatory and one optional query parameters:
page_origin - The page origin, used for redirection and to set TAO. This is a mandatory parameter.
cross_origin - The cross origin used to make this a cross-origin ... | mpl-2.0 |
acsone/partner-contact | base_location_nuts/models/res_partner_nuts.py | 5 | 1197 | # -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Antonio Espinosa
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class ResPartnerNuts(models.Model):
_name = 'res.partner.nuts'
_order = "parent_lef... | agpl-3.0 |
rwl/puddle | puddle/python_editor/python_workbench_editor.py | 1 | 6267 | #------------------------------------------------------------------------------
# Copyright (C) 2009 Richard W. Lincoln
#
# 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 restrictio... | mit |
dischinator/pyload | module/lib/simplejson/encoder.py | 45 | 20060 | """Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.