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 |
|---|---|---|---|---|---|
Soovox/django-socialregistration | docs/conf.py | 10 | 8050 | # -*- coding: utf-8 -*-
#
# django-socialregistration documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 22 17:25:59 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogener... | mit |
dulems/hue | desktop/core/ext-py/tablib-develop/tablib/packages/odf3/odf2xhtml.py | 56 | 65058 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2010 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the ... | apache-2.0 |
omakk/servo | tests/wpt/css-tests/tools/py/py/_builtin.py | 259 | 6521 | import sys
try:
reversed = reversed
except NameError:
def reversed(sequence):
"""reversed(sequence) -> reverse iterator over values of the sequence
Return a reverse iterator
"""
if hasattr(sequence, '__reversed__'):
return sequence.__reversed__()
if not hasa... | mpl-2.0 |
jacobsenanaizabel/shoop | shoop/core/models/_base.py | 6 | 1266 | # This file is part of Shoop.
#
# Copyright (c) 2012-2015, 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 __future__ import unicode_literals
import parler.models
from django.db import models
from djan... | agpl-3.0 |
mozilla-services/campaign_manager | campaign/auth/browserid_auth.py | 2 | 1261 | # 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 logging
import urllib2
import browserid
class BrowserIDAuth(object):
_raw_assertion = None
def __init_... | mpl-2.0 |
aonotas/chainer | chainer/links/model/classifier.py | 1 | 4579 | from chainer.functions.evaluation import accuracy
from chainer.functions.loss import softmax_cross_entropy
from chainer import link
from chainer import reporter
class Classifier(link.Chain):
"""A simple classifier model.
This is an example of chain that wraps another chain. It computes the
loss and accu... | mit |
voc/voctomix | vocto/composites.py | 1 | 12816 | #!/usr/bin/env python3
# for debug logging
import logging
# use Frame
from vocto.frame import Frame, X, Y, L, T, R, B
# for cloning objects
import copy
# for parsing configuration items
import re
log = logging.getLogger('Composites')
class Composites:
""" a namespace for composite related methods
"""
de... | mit |
mahmoud/wapiti | wapiti/operations/utils.py | 1 | 12249 | # -*- coding: utf-8 -*-
import sys
from heapq import heappush, heappop
import itertools
from functools import total_ordering
def is_scalar(obj):
return not hasattr(obj, '__iter__') or isinstance(obj, basestring)
def prefixed(arg, prefix=None):
if prefix and not arg.startswith(prefix):
arg = prefix ... | bsd-3-clause |
vklap/demo-ddd-python | run.py | 1 | 1665 | from app import app, init_db
if __name__ == '__main__':
from app.domain.entry import Entry
from app.infrastructure.repositories import entries as entries_repo
init_db()
entry1 = Entry(title='Domain Driven Design', text='Tackling complexity in the Heart of Software. The software development community ... | mit |
shepdelacreme/ansible | lib/ansible/plugins/action/dellos9.py | 21 | 4061 | #
# (c) 2016 Red Hat Inc.
#
# Copyright (c) 2017 Dell Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
w1ll1am23/home-assistant | homeassistant/components/rest/__init__.py | 5 | 5796 | """The rest component."""
import asyncio
import logging
import httpx
import voluptuous as vol
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import (
CONF_AUTHENTICATION,
CONF_HEADE... | apache-2.0 |
monuszko/django-anothercrm | anothercrm/models.py | 1 | 5607 | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Person(models.Model):
SEX_CHOICES = (
('M', 'Male'),
('F', 'Female'),
)
#TODO: validators for name, mobile...
firstname = models.CharField(max_length=30)
lastname = models.Cha... | agpl-3.0 |
edmorley/django | tests/serializers/models/data.py | 28 | 7612 | """
******** Models for test_data.py ***********
The following classes are for testing basic data marshalling, including
NULL values, where allowed.
The basic idea is to have a model for each Django data type.
"""
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.con... | bsd-3-clause |
jaeilepp/eggie | mne/viz/_3d.py | 1 | 24122 | """Functions to make 3D plots with M/EEG data
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# ... | bsd-2-clause |
mihail911/nupic | examples/prediction/experiments/confidenceTest/2/description.py | 17 | 2037 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | gpl-3.0 |
weiawe/django | scripts/manage_translations.py | 277 | 7141 | #!/usr/bin/env python
#
# This python file contains utility scripts to manage Django translations.
# It has to be run inside the django git root directory.
#
# The following commands are available:
#
# * update_catalogs: check for new strings in core and contrib catalogs, and
# output how much string... | bsd-3-clause |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/nltk/probability.py | 12 | 81647 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Probability and Statistics
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (additions)
# Trevor Cohn <tacohn@cs.mu.oz.au> (additions)
# Peter Ljunglöf <pete... | agpl-3.0 |
xuxiao19910803/edx | cms/djangoapps/contentstore/views/tests/test_container_page.py | 158 | 9232 | """
Unit tests for the container page.
"""
import re
import datetime
from pytz import UTC
from mock import patch, Mock
from django.http import Http404
from django.test.client import RequestFactory
from django.utils import http
import contentstore.views.component as views
from contentstore.views.tests.utils import Stu... | agpl-3.0 |
Endika/OpenUpgrade | openerp/report/render/rml2html/__init__.py | 381 | 1081 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
jamespcole/home-assistant | homeassistant/components/arlo/alarm_control_panel.py | 1 | 4381 | """Support for Arlo Alarm Control Panels."""
import logging
import voluptuous as vol
from homeassistant.components.alarm_control_panel import (
PLATFORM_SCHEMA, AlarmControlPanel)
from homeassistant.const import (
ATTR_ATTRIBUTION, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT, S... | apache-2.0 |
google/physical-web | web-service/handlers.py | 1 | 3651 | #!/usr/bin/env python
#
# Copyright 2015 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 law o... | apache-2.0 |
andrewmoses/ssquiz | flask/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.py | 34 | 55274 | # sql/sqltypes.py
# Copyright (C) 2005-2015 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
"""SQL specific types.
"""
import datetime as dt
import codecs
from .type_api imp... | bsd-3-clause |
redhat-openstack/django | tests/m2m_through/tests.py | 117 | 12908 | from __future__ import absolute_import
from datetime import datetime
from operator import attrgetter
from django.test import TestCase
from .models import (Person, Group, Membership, CustomMembership,
PersonSelfRefM2M, Friendship)
class M2mThroughTests(TestCase):
def setUp(self):
self.bob = Person.o... | bsd-3-clause |
3EleVen/kernel_common | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
Ichag/odoo | addons/account_anglo_saxon/invoice.py | 50 | 13086 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C)
# 2004-2010 Tiny SPRL (<http://tiny.be>).
# 2009-2010 Veritos (http://veritos.nl).
# All Rights Reserved
#
# This program is free software: you can redistri... | agpl-3.0 |
scripnichenko/glance | glance/db/sqlalchemy/migrate_repo/versions/034_add_virtual_size.py | 19 | 1157 | # Copyright 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
shlyakpavel/s720-w832-KK-kernel | kernel/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-3.0 |
bukepo/openthread | tests/toranj/test-008-permit-join.py | 9 | 3421 | #!/usr/bin/env python3
#
# Copyright (c) 2018, 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
# ... | bsd-3-clause |
allevin/PyGithub | github/Membership.py | 5 | 5901 | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Steve English <steve.english@navetas.com> #
# Copyright 2012 Vincent Jacques <vincent@vincent-ja... | lgpl-3.0 |
sacharya/nova | nova/virt/baremetal/base.py | 1 | 2612 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright (c) 2011 University of Southern California / ISI
# 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 obta... | apache-2.0 |
TheMutley/openpilot | pyextra/werkzeug/debug/tbtools.py | 104 | 18451 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.tbtools
~~~~~~~~~~~~~~~~~~~~~~
This module provides various traceback related utility functions.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import re
import os
import sys
import json
import inspect
import ... | mit |
stefan-jonasson/home-assistant | homeassistant/components/climate/flexit.py | 7 | 4748 | """
Platform for Flexit AC units with CI66 Modbus adapter.
Example configuration:
climate:
- platform: flexit
name: Main AC
slave: 21
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/climate.flexit/
"""
import logging
import voluptuous as vol
fro... | mit |
ales-erjavec/scipy | scipy/weave/converters.py | 92 | 2703 | from __future__ import absolute_import, print_function
from . import common_info
from . import c_spec
#----------------------------------------------------------------------------
# The "standard" conversion classes
#----------------------------------------------------------------------------
default = [c_spec.int_c... | bsd-3-clause |
40423226/2017springcd_bg1 | blog/theme/glow/primitive.py | 161 | 4838 | from javascript import JSConstructor, JSObject
from .vector import vec
class primitive:
def __init__(self, prim, **kwargs):
for _key in kwargs.keys():
if isinstance(kwargs[_key], vec):
kwargs[_key]=kwargs[_key]._vec
self._prim=prim(kwargs)
def rotate(self, **kwargs):
if '... | agpl-3.0 |
robbiet480/home-assistant | homeassistant/components/bme680/sensor.py | 6 | 13404 | """Support for BME680 Sensor over SMBus."""
import logging
import threading
from time import monotonic, sleep
import bme680 # pylint: disable=import-error
from smbus import SMBus # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.co... | apache-2.0 |
huang4fstudio/django | tests/shortcuts/tests.py | 199 | 5776 | from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.test.utils import require_jinja2
from django.utils.deprecation import RemovedInDjango110Warning
@override_settings(
ROOT_URLCONF='shortcuts.urls',
)
class ShortcutTests(SimpleTestCase):
def test_render_to_response(self):
... | bsd-3-clause |
shabab12/edx-platform | common/djangoapps/lang_pref/middleware.py | 26 | 2001 | """
Middleware for Language Preferences
"""
from openedx.core.djangoapps.user_api.preferences.api import get_user_preference, delete_user_preference
from lang_pref import LANGUAGE_KEY
from django.utils.translation import LANGUAGE_SESSION_KEY
from django.utils.translation.trans_real import parse_accept_lang_header
from... | agpl-3.0 |
bitmazk/django-user-tags | user_tags/tests/forms_tests.py | 1 | 7599 | """Tests for the forms of the ``user_tags`` app."""
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from django_libs.tests.factories import UserFactory
from user_tags.tests.test_app.forms import DummyModelForm
from user_tags.models import TaggedItem, UserTag, UserTagGroup
... | mit |
mKeRix/home-assistant | homeassistant/components/hlk_sw16/switch.py | 12 | 1410 | """Support for HLK-SW16 switches."""
import logging
from homeassistant.components.switch import ToggleEntity
from homeassistant.const import CONF_NAME
from . import DATA_DEVICE_REGISTER, SW16Device
_LOGGER = logging.getLogger(__name__)
def devices_from_config(hass, domain_config):
"""Parse configuration and ad... | mit |
Xonshiz/comic-dl | comic_dl/sites/readcomicOnlineli.py | 1 | 7993 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import globalFunctions
import re
import os
import logging
class ReadComicOnlineLi(object):
def __init__(self, manga_url, download_directory, chapter_range, **kwargs):
current_directory = kwargs.get("current_directory")
conversion = kwargs.get("conver... | mit |
lekanovic/pycoin | pycoin/blockchain/ChainFinder.py | 25 | 3410 |
class ChainFinder(object):
def __init__(self):
self.parent_lookup = {}
self.descendents_by_top = {}
self.trees_from_bottom = {}
def __repr__(self):
return "<ChainFinder: trees_fb:%s d_b_tops:%s>" % (self.trees_from_bottom, self.descendents_by_top)
def load_nodes(self, node... | mit |
pantsbuild/pants | src/python/pants/backend/python/util_rules/pex_cli.py | 3 | 7111 | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import dataclasses
import os
from dataclasses import dataclass
from pathlib import Path
from typing import Iterable, List, Mapping, Optional, Tuple
from pants.backend.python.subsystems.py... | apache-2.0 |
simmetria/sentry | src/sentry/migrations/0039_auto__add_field_searchdocument_status.py | 6 | 16296 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'SearchDocument.status'
db.add_column('sentry_searchdocument', 'status', self.gf('django.db... | bsd-3-clause |
s0930342674/pyload | module/plugins/hooks/RPNetBizHook.py | 12 | 1400 | # -*- coding: utf-8 -*-
from module.common.json_layer import json_loads
from module.plugins.internal.MultiHook import MultiHook
class RPNetBizHook(MultiHook):
__name__ = "RPNetBizHook"
__type__ = "hook"
__version__ = "0.16"
__status__ = "testing"
__config__ = [("pluginmode" , "all;list... | gpl-3.0 |
Dziolas/invenio | modules/miscutil/lib/remote_debugger_wsgi_reload.py | 33 | 3919 | ## This file is part of Invenio.
## Copyright (C) 2011 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 your option) any later version.
##
## Inv... | gpl-2.0 |
zhiwehu/django-countries | countries/models.py | 1 | 2033 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Country(models.Model):
"""
International Organization for Standardization (ISO) 3166-1 Country list
* ``iso`` = ISO 3166-1 alpha-2
* ``name`` = Official country names used by... | bsd-3-clause |
sbbic/core | wizards/com/sun/star/wizards/ui/event/ListDataEvent.py | 11 | 1214 | #
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license noti... | gpl-3.0 |
alpeware/gcms | lib/googleapiclient/_auth.py | 16 | 3091 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | mit |
krafczyk/spack | var/spack/repos/builtin/packages/r-rpostgresql/package.py | 5 | 2292 | ##############################################################################
# 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 |
Zhongqilong/kbengine | kbe/src/lib/python/Lib/__future__.py | 134 | 4584 | """Record of phased-in incompatible language changes.
Each line is of the form:
FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
CompilerFlag ")"
where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples
of the same form as sys.version_info:
(... | lgpl-3.0 |
nils-wisiol/pypuf | pypuf/property_test/example.py | 1 | 3649 | """This module is used to store some examples for the documentation"""
from numpy import array, reshape
from pypuf.simulation.arbiter_based.ltfarray import NoisyLTFArray
from pypuf.property_test.base import PropertyTest
from pypuf.tools import sample_inputs
def main():
"""This method is used to execute all exampl... | gpl-3.0 |
40223243/2015cd_midterm2 | 2015cd_midterm-master/static/Brython3.1.1-20150328-091302/Lib/xml/dom/pulldom.py | 850 | 11761 | import xml.sax
import xml.sax.handler
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION"
IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE"
CHARACTERS = "CHARACTERS"
class PullDOM(... | agpl-3.0 |
SUSE/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/resolved_service_endpoint.py | 2 | 1209 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
gennad/Django-nonrel-stub-for-Google-App-Engine | django/contrib/gis/gdal/srs.py | 291 | 11717 | """
The Spatial Reference class, represensents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print srs
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORI... | bsd-3-clause |
wrouesnel/ansible-modules-extras | cloud/cloudstack/cs_project.py | 17 | 8497 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, 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 |
LabAdvComp/dish | test/test_logging.py | 1 | 2154 | from IPython.parallel.error import CompositeError
import os
from nose.tools import assert_raises
from .utils import assert_eventually_equal
from .test_pipeline import PipelineTest
class TestLogging(PipelineTest):
def test_logging(self):
"""Test that logging information is propagated and stored
... | mit |
surgebiswas/poker | PokerBots_2017/Johnny/wheel/util.py | 345 | 4890 | """Utility functions."""
import sys
import os
import base64
import json
import hashlib
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
__all__ = ['urlsafe_b64encode', 'urlsafe_b64decode', 'utf8',
'to_json', 'from_json', 'matches_requirement']
def urlsafe_b64encode(d... | mit |
denverfoundation/storybase | apps/storybase_user/migrations/0006_auto__add_contact.py | 1 | 14929 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Contact'
db.create_table('storybase_user_contact', (
('id', self.gf('django.db... | mit |
marionleborgne/nupic.research | projects/l2_pooling/multi_column.py | 10 | 8328 | # Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the ... | agpl-3.0 |
omaciel/mangonel | mangonel/system.py | 1 | 2191 | from common import *
import datetime
import json
import sys
import time
try:
from katello.client.api.system import SystemAPI
except ImportError, e:
print "Please install Katello CLI package."
sys.exit(-1)
class System(SystemAPI):
def __init__(self):
super(System, self).__init__()
def c... | gpl-2.0 |
romykundal/meanjs-multiuploader | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py | 1843 | 1786 | #!/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.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | mit |
SamaraCardoso27/eMakeup | backend/venv/lib/python2.7/site-packages/unidecode/x029.py | 165 | 3584 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/webob/cookies.py | 5 | 29357 | import collections
import base64
import binascii
import hashlib
import hmac
import json
from datetime import (
date,
datetime,
timedelta,
)
import re
import string
import time
import warnings
from webob.compat import (
PY3,
text_type,
bytes_,
text_,
native_,
string_types,
)... | agpl-3.0 |
willzhang05/cslbot | cslbot/commands/guarded.py | 2 | 1149 | # Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# 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 ve... | gpl-2.0 |
jmargutt/AliPhysics | PWGMM/MC/aligenqa/aligenqa/plotting.py | 41 | 45785 | from pprint import pprint
from rootpy import asrootpy, log, collection
from rootpy.plotting import Hist2D
from rootpy.io import root_open
from data_extractors import \
get_dNdeta_in_classifier_bin_interval,\
get_identified_vs_mult,\
get_correlation_histogram,\
get_PNch_vs_estmult,\
get_meanpt_vs_e... | bsd-3-clause |
jswanljung/iris | lib/iris/tests/unit/experimental/fieldsfile/test__convert_collation.py | 8 | 14897 | # (C) British Crown Copyright 2014 - 2015, 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 |
cosim/zerorpc-python | tests/test_channel.py | 76 | 3964 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
ifduyue/sentry | src/sentry/tagstore/legacy/models/tagkey.py | 2 | 1534 | """
sentry.tagstore.legacy.models.tagkey
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2017 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from django.db import models
from django.utils.translation import ugettext_... | bsd-3-clause |
CatsAndDogsbvba/odoo | addons/analytic/analytic.py | 27 | 18705 | # -*- 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 |
highRPM/IM-A910S_msm8974_kernel-source | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
wujuguang/motor | test/tornado_tests/test_motor_web.py | 1 | 9001 | # Copyright 2012-2015 MongoDB, 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 writin... | apache-2.0 |
michaelgallacher/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/id/id_choices.py | 439 | 3217 | import warnings
from django.utils.translation import ugettext_lazy as _
# Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia
# Indonesia does not have an official Province code standard.
# I decided to use unambiguous and consistent (some are common) 3-letter codes.
warnings.warn(
'There have been... | apache-2.0 |
ronnienv/antTrails | libs/requests/packages/chardet/chardetect.py | 743 | 1141 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from ... | apache-2.0 |
androidarmv6/android_external_chromium_org | build/android/gyp/javac.py | 25 | 3161 | #!/usr/bin/env python
#
# Copyright 2013 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 fnmatch
import optparse
import os
import sys
from util import build_utils
from util import md5_check
def DoJavac(options):
... | bsd-3-clause |
chiefspace/udemy-rest-api | udemy_rest_api_section4/env/lib/python3.4/site-packages/setuptools/py31compat.py | 10 | 1184 | __all__ = ['get_config_vars', 'get_path']
try:
# Python 2.7 or >=3.2
from sysconfig import get_config_vars, get_path
except ImportError:
from distutils.sysconfig import get_config_vars, get_python_lib
def get_path(name):
if name not in ('platlib', 'purelib'):
raise ValueError("Name ... | gpl-2.0 |
haya14busa/alc-etm-searcher | nltk-3.0a3/nltk/parse/generate.py | 2 | 2078 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Generating from a CFG
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Peter Ljunglöf <peter.ljunglof@heatherleaf.se>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
#
from __future__ import print_fu... | mit |
OmnesRes/pan_cancer | paper/figures/figure_1/bar_graphs/CESC.py | 1 | 1883 | ##script for creating a histogram
## Load necessary modules
import pylab as plt
import numpy as np
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
f=open(os.path.join(BASE_DIR,'cox_regression','CESC','coeffs_normalized_pvalues_adjusted.txt'))
data=[i.s... | mit |
jbzdarkid/HearthstonePro | Cards.py | 1 | 13333 | '''
Special:
"Anub'ar Ambusher"
"Blood Warriors"
"Burgly Bully"
"Captain's Parrot"
"Chromaggus"
"Echo of Mediv"
"Ethereal Peddler"
"Flame Leviathan"
"Getaway Kodo"
"Gnomish Experimenter"
"Headcrack"
"Holy Wrath"
"Ivory Knight"
"Kazakus"
"King's Elekk"
"Krul the Unshackled"
"Lock and Load"
"Lorewalker Cho"
"Sea Reaver"
... | apache-2.0 |
lliendo/Radar | radar/network/monitor/select_monitor.py | 1 | 1307 | # -*- coding: utf-8 -*-
"""
This file is part of Radar.
Radar is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Radar is distributed ... | lgpl-3.0 |
WoLpH/dropbox | dropbox/util.py | 1 | 1940 | import os
class AnalyzeFileObjBug(Exception):
msg = ("\n"
"Expected file object to have %d bytes, instead we read %d bytes.\n"
"File size detection may have failed (see dropbox.util.AnalyzeFileObj)\n")
def __init__(self, expected, actual):
self.expected = expected
self.a... | mit |
sbaks0820/bitcoin | contrib/zmq/zmq_sub3.4.py | 12 | 3275 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
Bitcoin should be started with the command line argument... | mit |
saurvs/servo | tests/wpt/web-platform-tests/tools/py/py/_builtin.py | 259 | 6521 | import sys
try:
reversed = reversed
except NameError:
def reversed(sequence):
"""reversed(sequence) -> reverse iterator over values of the sequence
Return a reverse iterator
"""
if hasattr(sequence, '__reversed__'):
return sequence.__reversed__()
if not hasa... | mpl-2.0 |
kawie/pybikes | pybikes/keolis.py | 3 | 5671 | # -*- coding: utf-8 -*-
# Copyright (C) 2010-2012, eskerda <eskerda@gmail.com>
# Distributed under the AGPL license, see LICENSE.txt
import re
import json
from lxml import etree
import lxml.html
from .base import BikeShareSystem, BikeShareStation
from . import utils
__all__ = ['Keolis', 'KeolisStation', 'Keolis_v2... | lgpl-3.0 |
seann1/portfolio5 | .meteor/dev_bundle/python/Lib/test/test_wsgiref.py | 25 | 19750 | from __future__ import nested_scopes # Backward compat for 2.1
from unittest import TestCase
from wsgiref.util import setup_testing_defaults
from wsgiref.headers import Headers
from wsgiref.handlers import BaseHandler, BaseCGIHandler
from wsgiref import util
from wsgiref.validate import validator
from wsgiref.simple... | gpl-2.0 |
fbradyirl/home-assistant | homeassistant/components/arlo/sensor.py | 7 | 6412 | """Sensor support for Netgear Arlo IP cameras."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_MONITORED_CONDITIONS,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
TEMP_CELSIUS,
)
from... | apache-2.0 |
asaolabs/python-lambda | aws_lambda/aws_lambda.py | 1 | 25699 | # -*- coding: utf-8 -*-
from __future__ import print_function
import hashlib
import json
import logging
import os
import sys
import time
from collections import defaultdict
from imp import load_source
from shutil import copy
from shutil import copyfile
from shutil import copystat
from shutil import copytree
from tempf... | isc |
phobson/pygridtools | pygridtools/tests/test_core.py | 2 | 24947 | import os
import warnings
from pkg_resources import resource_filename
import tempfile
import numpy
from numpy import nan
import pandas
from shapely.geometry import Polygon
import geopandas
import pytest
import numpy.testing as nptest
import pandas.util.testing as pdtest
from pygridtools import core
from pygridgen.te... | bsd-3-clause |
bwsblake/lettercounter | django-norel-env/lib/python2.7/site-packages/django/test/testcases.py | 47 | 46941 | from __future__ import unicode_literals
import difflib
import json
import os
import re
import socket
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 ... | mit |
sumanau7/Ele_CC_Sumanau | lib/IPython/lib/tests/test_deepreload.py | 9 | 2144 | # -*- coding: utf-8 -*-
"""Test suite for the deepreload module."""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import nose.tools as nt
from IPython.testing import decorators as dec
... | apache-2.0 |
sanghinitin/golismero | thirdparty_libs/django/conf/locale/mk/formats.py | 106 | 1468 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_F... | gpl-2.0 |
Rhoana/rh_aligner | old/filter_tiles.py | 1 | 2329 | # Takes a json file that contains many tiles with their bounding boxes (Tile-Spec format)
# and a bounding box, and outputs a json file for each tile that is overlapping with the bounding box
import sys
import os
import argparse
import json
from bounding_box import BoundingBox
# common functions
def load_tiles(ti... | mit |
StevenBlack/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py | 124 | 21459 | # Copyright (C) 2009 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... | bsd-3-clause |
EvanK/ansible | lib/ansible/modules/web_infrastructure/supervisorctl.py | 73 | 9341 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Matt Wright <matt@nobien.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 = {'metadata_version': '1.1',
... | gpl-3.0 |
Sciumo/GeographicLib | python/geographiclib/polygonarea.py | 3 | 8833 | """polygonarea.py: transcription of GeographicLib::PolygonArea class."""
# polygonarea.py
#
# This is a rather literal translation of the GeographicLib::PolygonArea class
# to python. See the documentation for the C++ class for more information at
#
# http://geographiclib.sourceforge.net/html/annotated.html
#
# The... | mit |
containerleaks/site | pelican-plugins/liquid_tags/mdx_liquid_tags.py | 281 | 3447 | """
Markdown Extension for Liquid-style Tags
----------------------------------------
A markdown extension to allow user-defined tags of the form::
{% tag arg1 arg2 ... argn %}
Where "tag" is associated with some user-defined extension.
These result in a preprocess step within markdown that produces
either markdo... | gpl-3.0 |
favll/pogom | pogom/pgoapi/protos/POGOProtos/Settings/Master/Item/FortModifierAttributes_pb2.py | 16 | 2825 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Settings/Master/Item/FortModifierAttributes.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
f... | mit |
invesalius/invesalius3 | invesalius/gui/widgets/slice_menu.py | 4 | 11800 | # -*- coding: UTF-8 -*-
#--------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.go... | gpl-2.0 |
open-synergy/stock-logistics-warehouse | stock_cycle_count/models/stock_cycle_count_rule.py | 2 | 9715 | # -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import api, fields, models, _
from openerp.exceptions import ValidationError
from openerp.tools import DEFAULT_SERVER... | agpl-3.0 |
rohitwaghchaure/erpnext_smart | erpnext/support/doctype/maintenance_visit/maintenance_visit.py | 32 | 3160 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.utilities.transaction_base import TransactionBase
class MaintenanceVisit(TransactionBase):
def ge... | agpl-3.0 |
shaunbrady/boto | tests/integration/ec2containerservice/test_ec2containerservice.py | 99 | 1749 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.