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 |
|---|---|---|---|---|---|
duqiao/django | django/contrib/gis/geoip/prototypes.py | 535 | 3943 | from ctypes import POINTER, Structure, c_char_p, c_float, c_int, string_at
from django.contrib.gis.geoip.libgeoip import free, lgeoip
# #### GeoIP C Structure definitions ####
class GeoIPRecord(Structure):
_fields_ = [('country_code', c_char_p),
('country_code3', c_char_p),
('cou... | bsd-3-clause |
birkin/iip_processing_project | run_travis_tests.py | 1 | 1651 | # -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import unicode_literals
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
if __name__ == '__main__':
os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings_travis'
## initialize dummy envvars u... | mit |
whip112/Whip112 | vendor/packages/pygments/styles/monokai.py | 135 | 5080 | # -*- coding: utf-8 -*-
"""
pygments.styles.monokai
~~~~~~~~~~~~~~~~~~~~~~~
Mimic the Monokai color scheme. Based on tango.py.
http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.... | mpl-2.0 |
mshafiq9/django | django/contrib/messages/api.py | 512 | 3202 | from django.contrib.messages import constants
from django.contrib.messages.storage import default_storage
from django.http import HttpRequest
__all__ = (
'add_message', 'get_messages',
'get_level', 'set_level',
'debug', 'info', 'success', 'warning', 'error',
'MessageFailure',
)
class MessageFailure(E... | bsd-3-clause |
mosbasik/buzhug | javasrc/lib/Jython/Lib/test/test_builtin_jy.py | 9 | 9889 | # -*- coding: utf-8 -*-
import test.test_support, unittest
from test.test_support import TESTFN, unlink
import sys, UserDict
from codecs import BOM_UTF8
class BuiltinTest(unittest.TestCase):
def test_in_sys_modules(self):
self.assert_("__builtin__" in sys.modules,
"__builtin__ not found in s... | bsd-3-clause |
stevekuznetsov/ansible | lib/ansible/modules/network/nxos/nxos_vrf_af.py | 4 | 9260 | #!/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 |
jamespacileo/django-france | django/core/handlers/base.py | 105 | 11468 | import sys
from django import http
from django.core import signals
from django.utils.encoding import force_unicode
from django.utils.importlib import import_module
from django.utils.log import getLogger
logger = getLogger('django.request')
class BaseHandler(object):
# Changes that are always applied to a respon... | bsd-3-clause |
RevelSystems/django | django/test/client.py | 106 | 26068 | from __future__ import unicode_literals
import mimetypes
import os
import re
import sys
from copy import copy
from importlib import import_module
from io import BytesIO
from django.apps import apps
from django.conf import settings
from django.core import urlresolvers
from django.core.handlers.base import BaseHandler
... | bsd-3-clause |
BoltzmannBrain/nupic.research | htmresearch/frameworks/sensorimotor/behavior_memory.py | 10 | 8905 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, 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... | agpl-3.0 |
weebygames/boto | boto/sdb/db/__init__.py | 189 | 1108 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# 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 to use, copy,... | mit |
chrisdickinson/tweezers | docs/conf.py | 1 | 7099 | # -*- coding: utf-8 -*-
#
# Read The Docs documentation build configuration file, created by
# sphinx-quickstart on Sat Aug 14 00:06:40 2010.
#
# 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
# autogenerated file.
#... | mit |
ys305751572/jstorm | bin/jstorm.py | 19 | 16272 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | apache-2.0 |
tmtlakmal/EasyTuteLO | src/gibberish.py | 2 | 3241 |
import urllib
import wap
def readFile():
f = open('sampleResponse.txt', 'r')
res = f.read()
return res
def getFromWolfram():
inputsta='y"+y=0'
appid = '4WKYHL-AWUQL4GWA3' # Use your app id
waeo = wap.WolframAlphaEngine(appid,'http://api.wolframalpha.com/v2/query?')
waeq = wap.WolframAlpha... | lgpl-3.0 |
eyohansa/django | tests/urlpatterns_reverse/urls.py | 199 | 5421 | import warnings
from django.conf.urls import include, patterns, url
from django.utils.deprecation import RemovedInDjango110Warning
from .views import (
absolute_kwargs_view, defaults_view, empty_view, empty_view_partial,
empty_view_wrapped, nested_view,
)
other_patterns = [
url(r'non_path_include/$', emp... | bsd-3-clause |
brandondrew/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/rmic.py | 61 | 4138 | """SCons.Tool.rmic
Tool-specific initialization for rmic.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
#... | apache-2.0 |
geminy/aidear | snippets/cppfunc/cppcheck/cppcheck-1.80/addons/cert.py | 1 | 2959 | #!/usr/bin/env python
#
# Cert: Some extra CERT checkers
#
# Cppcheck itself handles many CERT rules. Cppcheck warns when there is undefined behaviour.
#
# Example usage of this addon (scan a sourcefile main.cpp)
# cppcheck --dump main.cpp
# python cert.py main.cpp.dump
import cppcheckdata
import sys
import re
def r... | gpl-3.0 |
MeshCollider/bitcoin | test/functional/mempool_expiry.py | 18 | 5133 | #!/usr/bin/env python3
# Copyright (c) 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.
"""Tests that a mempool transaction expires after a given timeout and that its
children are removed as well.
B... | mit |
huaweiswitch/neutron | neutron/openstack/common/network_utils.py | 41 | 2899 | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
shravan-achar/servo | tests/wpt/css-tests/tools/html5lib/html5lib/utils.py | 982 | 2545 | from __future__ import absolute_import, division, unicode_literals
from types import ModuleType
try:
import xml.etree.cElementTree as default_etree
except ImportError:
import xml.etree.ElementTree as default_etree
__all__ = ["default_etree", "MethodDispatcher", "isSurrogatePair",
"surrogatePairTo... | mpl-2.0 |
rue89-tech/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_contentstore.py | 87 | 8284 | """
Test contentstore.mongo functionality
"""
import logging
from uuid import uuid4
import unittest
import mimetypes
from tempfile import mkdtemp
import path
import shutil
from opaque_keys.edx.locator import CourseLocator, AssetLocator
from opaque_keys.edx.keys import AssetKey
from xmodule.tests import DATA_DIR
from ... | agpl-3.0 |
saurabh6790/tru_app_back | setup/doctype/global_defaults/global_defaults.py | 28 | 2279 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
"""Global Defaults"""
import webnotes
import webnotes.defaults
from webnotes.utils import cint
keydict = {
# "key in defaults": "key in Global Defa... | agpl-3.0 |
zhuangjun1981/retinotopic_mapping | retinotopic_mapping/tools/PlottingTools.py | 1 | 15373 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 31 11:07:20 2014
@author: junz
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib.colors as col
import scipy.ndimage as ni
import ImageAnalysis as ia
try:
import skimage.external.tifffile as tf
except ImportError:
i... | gpl-3.0 |
coxmediagroup/django-threadedcomments | legacy_threadedcomments/urls.py | 14 | 2002 | from django.conf.urls.defaults import patterns, url
from threadedcomments.models import FreeThreadedComment
from threadedcomments import views
free = {'model' : FreeThreadedComment}
urlpatterns = patterns('',
### Comments ###
url(r'^comment/(?P<content_type>\d+)/(?P<object_id>\d+)/$', views.comment, name="tc_... | bsd-3-clause |
di11igaf/flounder-kernel | scripts/tracing/dma-api/smmu.py | 96 | 7013 | """Low-level memory management tracking"""
VERBOSITY = 0 # TODO: use logging
class Bitmap(object):
"""Just a raw bitmap for reserving the pages"""
def __init__(self, size, verbosity):
self._size = size
self._bits = 0
self._verbosity = verbosity
self._bits_allocd = 0
def _m... | gpl-2.0 |
stejesh/distributed-frontera | distributed_frontera/backends/remote/codecs/json.py | 2 | 5609 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import json
from base64 import b64decode, b64encode
def _prepare_request_message(request):
return {'url': request.url,
'method': request.method,
'headers': request.headers,
'cookies': request.cookies,
'me... | bsd-3-clause |
clinton-hall/nzbToMedia | libs/common/pbr/tests/test_files.py | 94 | 2579 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | gpl-3.0 |
szopu/django | tests/inspectdb/models.py | 19 | 2832 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import warnings
from django.db import models
class People(models.Model):
name = models.CharField(max_length=255)
parent = models.ForeignKey('self')
class Message(models.Model):
from_field = models.ForeignKey(People, db_column='from_id')
... | bsd-3-clause |
ashemedai/ansible | lib/ansible/modules/storage/netapp/netapp_e_host.py | 43 | 17647 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | gpl-3.0 |
vmonaco/rpscontest | agents/ga3.py | 1 | 2188 | import random, math
def highest(v):
return random.choice([i for i in range(len(v)) if max(v) == v[i]])
def lowest(v):
return random.choice([i for i in range(len(v)) if min(v) == v[i]])
def best(c):
return highest([c[1]-c[2], c[2]-c[0], c[0]-c[1]])
if(1):
if (input == ""):
N = 1
AR1 =... | bsd-3-clause |
mikewiebe-ansible/ansible | test/units/modules/network/f5/test_bigip_gtm_virtual_server.py | 38 | 5700 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
RaJiska/Warband-PW-Punishments-Manager | scripts/process_items.py | 6 | 1534 | import process_common as pc
import process_operations as po
from header_items import *
import module_items
def process_entry(processor, txt_file, item, index):
visible_name = pc.replace_spaces(item[1])
item_meshes = item[2]
output_list = [" itm_%s %s %s %d " % (item[0], visible_name, visible_name, po.block_len(i... | gpl-3.0 |
jirikuncar/invenio | invenio/modules/documents/testsuite/test_api.py | 14 | 3249 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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... | gpl-2.0 |
capitalone/cloud-custodian | c7n/filters/iamanalyzer.py | 1 | 3700 | # Copyright 2020 Kapil Thangavelu
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .core import ValueFilter
from c7n.exceptions import PolicyExecutionError
from c7n.manager import resources
from c7n.utils import type_schema, local_session, chunks
class AccessAnalyzer(ValueFilter)... | apache-2.0 |
jellydn/gschool | public/system/lib/bootstrap/test-infra/s3_cache.py | 1700 | 3523 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... | mit |
pablohoffman/scrapy | scrapy/tests/test_downloader_handlers.py | 6 | 11352 | import os
from twisted.trial import unittest
from twisted.protocols.policies import WrappingFactory
from twisted.python.filepath import FilePath
from twisted.internet import reactor, defer
from twisted.web import server, static, util, resource
from twisted.web.test.test_webclient import ForeverTakingResource, \
... | bsd-3-clause |
openhatch/oh-mainline | vendor/packages/whoosh/src/whoosh/lang/lovins.py | 117 | 12645 | """This module implements the Lovins stemming algorithm. Use the ``stem()``
function::
stemmed_word = stem(word)
"""
from collections import defaultdict
# Conditions
def A(base):
# A No restrictions on stem
return True
def B(base):
# B Minimum stem length = 3
return len(base) > 2
def C(b... | agpl-3.0 |
shyamalschandra/keras | keras/models.py | 2 | 4899 | import theano
import theano.tensor as T
import numpy as np
import optimizers
import objectives
import time, copy
from utils.generic_utils import Progbar
def standardize_y(y):
y = np.asarray(y)
if len(y.shape) == 1:
y = np.reshape(y, (len(y), 1))
return y
class Sequential(object):
def __init__... | mit |
mbox/django | tests/lookup/models.py | 18 | 1565 | """
7. The lookup API
This demonstrates features of the database API.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
clas... | bsd-3-clause |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/protocols/haproxy/_exceptions.py | 16 | 1085 | # -*- test-case-name: twisted.protocols.haproxy.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HAProxy specific exceptions.
"""
import contextlib
import sys
from twisted.python import compat
class InvalidProxyHeader(Exception):
"""
The provided PROXY protocol header is... | mit |
jetzfly/LEHome | lib/helper/SensorHelper.py | 2 | 4631 | #!/usr/bin/env python
# encoding: utf-8
# Copyright 2014 Xinyu, He <legendmohe@foxmail.com>
#
# 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
... | apache-2.0 |
mykytamorachov/outpost | flask/lib/python2.7/site-packages/sqlalchemy/sql/operators.py | 17 | 15743 | # sql/operators.py
# Copyright (C) 2005-2012 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
# This module is part of SQLAlchemy and is released under
# the MIT License: http://w... | gpl-2.0 |
jrcarney/drupal8_site_one | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | 1361 | 45045 | # 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.
r"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. Th... | gpl-2.0 |
shakamunyi/neutron-vrrp | neutron/services/firewall/agents/firewall_agent_api.py | 4 | 2820 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
yumingfei/virt-manager | virtinst/Guest.py | 2 | 52391 | #
# Common code for all guests
#
# Copyright 2006-2009 Red Hat, Inc.
# Jeremy Katz <katzj@redhat.com>
#
# 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
# (a... | gpl-2.0 |
richardcs/ansible | test/units/modules/network/slxos/test_slxos_command.py | 30 | 4734 | #
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ans... | gpl-3.0 |
yuzie007/ph_analysis | ph_analysis/structure/displacements.py | 1 | 3767 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import numpy as np
import pandas as pd
__author__ = 'Yuji Ikeda'
__version__ = '0.1.0'
def create_statistical_functions():
return [
('sum', np.sum),
... | mit |
jiaxiaolei/pycate | testDataBase.py | 1 | 1836 | # -*- coding:utf-8 -*-
'''
测试注册用户
'''
import sys
import os
sys.path.append(os.getcwd())
from pycate.model import MInfo
import unittest
class SimpleWidgetTestCase(unittest.TestCase):
def setUp(self):
# from model.info_model import MInfo
# con = pymongo.Connection('localhost')
... | mit |
bhattmansi/Implementation-of-CARED-in-ns3 | src/lr-wpan/bindings/modulegen__gcc_ILP32.py | 10 | 485946 | 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 |
rackerlabs/rackspace-sdk-plugin | rackspace/tests/unit/monitoring/v1/test_notification_plan.py | 2 | 2212 | # 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, software
# distributed under t... | apache-2.0 |
ViennaRNA/forgi | test/forgi/threedee/model/coarse_grain_test.py | 1 | 34193 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from builtins import range
import warnings
import unittest
import sys
import itertools as it
import copy
import time
import math
import logging
import os.path
import os
import shutil
import contextlib
try:
... | gpl-3.0 |
wreckJ/intellij-community | python/helpers/pydev/pydev_ipython_console.py | 42 | 2469 | import sys
from pydev_console_utils import BaseInterpreterInterface
import os
os.environ['TERM'] = 'emacs' #to use proper page_more() for paging
# Uncomment to force PyDev standard shell.
# raise ImportError()
from pydev_ipython_console_011 import get_pydev_frontend
#==============================================... | apache-2.0 |
neerajvashistha/pa-dude | lib/python2.7/site-packages/_pytest/recwarn.py | 178 | 7203 | """ recording warnings during test function execution. """
import inspect
import _pytest._code
import py
import sys
import warnings
import pytest
@pytest.yield_fixture
def recwarn(request):
"""Return a WarningsRecorder instance that provides these methods:
* ``pop(category=None)``: return last warning matc... | mit |
0x46616c6b/ansible | lib/ansible/modules/cloud/amazon/ecs_task.py | 25 | 11904 | #!/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 |
quininer/isperdal | isperdal/node.py | 1 | 9290 | from copy import copy
from asyncio import async, coroutine, iscoroutinefunction
from functools import reduce
from types import FunctionType
from traceback import format_exc
from .request import Request
from .response import Response
from .adapter import AioHTTPServer
from .utils import Result, Ok, Err, unok
codes = ... | mit |
porduna/weblabdeusto | server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment/experiment59/server_config.py | 968 | 1526 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
weblab_xilinx_experiment_xilinx_device = 'FPGA'
weblab_xilinx_experiment_port_number = 1
# This should be something like this:
# import os as _os
# xilinx_home = _os.getenv('XILINX_HOME')
# if xilinx_home == None:
# if _os.name == 'nt':
# xilinx_home = r'C:... | bsd-2-clause |
sudheesh001/pontoon | pontoon/base/tests/test_helpers.py | 1 | 1622 | from datetime import timedelta
from django_nose.tools import assert_equal
from pontoon.base.templatetags.helpers import format_datetime, format_timedelta
from pontoon.base.tests import TestCase
from pontoon.base.utils import aware_datetime
class FormatDatetimeTests(TestCase):
def test_format_datetime_none(self)... | bsd-3-clause |
zhangf911/common | test/dev/system_id_test.py | 5 | 1127 | import unittest
from biicode.common.dev.system_id import SystemID
from biicode.common.settings.version import Version
class SystemIDTest(unittest.TestCase):
def setUp(self):
self.sut = SystemID("open_gl", "CPP")
def test_set_generic_system(self):
self.sut.set_generic_system()
self.a... | mit |
tbronchain/shadowsocks | shadowsocks/encrypt.py | 990 | 5180 | #!/usr/bin/env python
#
# Copyright 2012-2015 clowwindy
#
# 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 |
YzPaul3/h2o-3 | h2o-algos/src/test/java/hex/example/workflowtest.py | 19 | 7922 | import h2o
# Explore a typical Data Science workflow with H2O and Python
#
# Goal: assist the manager of CitiBike of NYC to load-balance the bicycles
# across the CitiBike network of stations, by predicting the number of bike
# trips taken from the station every day. Use 10 million rows of historical
# data, and even... | apache-2.0 |
tectronics/evennia | src/server/migrations/0002_fix_config_value.py | 2 | 9134 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models, utils
import pickle
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# we are fixing a situation were the serverconfig v... | bsd-3-clause |
vFense/vFenseAgent-nix | agent/deps/rpm6/Python-2.7.5/lib/python2.7/test/test_threadedtempfile.py | 111 | 2214 | """
Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile)
in each of NUM_THREADS threads, recording the number of successes and
failures. A failure is a bug in tempfile, and may be due to:
+ Trying to create more than one tempfile with the same name.
+ Trying to delete a tempfile that doesn't sti... | lgpl-3.0 |
RazerM/logbook | logbook/__init__.py | 3 | 1722 | # -*- coding: utf-8 -*-
"""
logbook
~~~~~~~
Simple logging library that aims to support desktop, command line
and web applications alike.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import os
from .base import (
LogRecord, Logger,... | bsd-3-clause |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Lib/curses/has_key.py | 154 | 5627 |
#
# Emulation of has_key() function for platforms that don't use ncurses
#
import _curses
# Table mapping curses keys to the terminfo capability name
_capability_names = {
_curses.KEY_A1: 'ka1',
_curses.KEY_A3: 'ka3',
_curses.KEY_B2: 'kb2',
_curses.KEY_BACKSPACE: 'kbs',
_curses.KEY_BEG: 'kbeg',
... | gpl-3.0 |
Antiun/odoo | addons/mail/tests/test_mail_features.py | 172 | 59265 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
JioCloud/tempest | tempest/api_schema/response/compute/v2_1/flavors_extra_specs.py | 35 | 1269 | # Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
DroneBuster/ardupilot | libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_parse.py | 44 | 2704 | #!/usr/bin/env python
'''
extra DMA mapping tables from a stm32 datasheet
This assumes a csv file extracted from the datasheet using tablula:
https://github.com/tabulapdf/tabula
'''
import sys, csv, os
def parse_dma_table(fname, table):
dma_num = 1
csvt = csv.reader(open(fname,'rb'))
i = 0
last_cha... | gpl-3.0 |
jrha/aquilon | lib/python2.6/aquilon/aqdb/model/model.py | 2 | 2735 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | apache-2.0 |
ctoher/pymatgen | pymatgen/io/qchemio.py | 3 | 78861 | # coding: utf-8
from __future__ import unicode_literals
import textwrap
"""
This module implements input and output processing from QChem.
"""
import copy
import re
import numpy as np
from string import Template
import six
from monty.io import zopen
from pymatgen.core.operations import SymmOp
from pymatgen.core.st... | mit |
sonaht/ansible | test/units/module_utils/facts/base.py | 118 | 2325 | # base unit test classes for ansible/module_utils/facts/ tests
# -*- coding: utf-8 -*-
#
# 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 lat... | gpl-3.0 |
irudayarajisawa/django-cms | setup.py | 13 | 1526 | from setuptools import setup, find_packages
import os
import cms
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independ... | bsd-3-clause |
marcwebbie/youtube-dl | youtube_dl/extractor/radiofrance.py | 91 | 2089 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class RadioFranceIE(InfoExtractor):
_VALID_URL = r'^https?://maison\.radiofrance\.fr/radiovisions/(?P<id>[^?#]+)'
IE_NAME = 'radiofrance'
_TEST = {
'url': 'http://maison.radiofrance.fr/radiovisio... | unlicense |
borysiasty/inasafe | safe_extras/parameters/collection_parameter.py | 8 | 6931 | # coding=utf-8
"""Collection Parameter abstract base class0."""
import abc
from generic_parameter import GenericParameter
from parameter_exceptions import (
CollectionLengthError, InvalidMinimumError, InvalidMaximumError)
class CollectionParameter(GenericParameter):
"""A subclass of generic parameter that a... | gpl-3.0 |
luisibanez/SahanaEden | modules/geopy/units.py | 84 | 2311 | import math
from geopy import util
# Angles
def degrees(radians=0, arcminutes=0, arcseconds=0):
deg = 0.
if radians:
deg = math.degrees(radians)
if arcminutes:
deg += arcminutes / arcmin(degrees=1.)
if arcseconds:
deg += arcseconds / arcsec(degrees=1.)
return deg
def radia... | mit |
archilogic-ch/three.js | utils/exporters/blender/addons/io_three/exporter/api/animation.py | 177 | 16103 | """
Module for handling the parsing of skeletal animation data.
"""
import math
import mathutils
from bpy import data, context
from .. import constants, logger
def pose_animation(armature, options):
"""Query armature animation using pose bones
:param armature:
:param options:
:returns: list dictiona... | mit |
x303597316/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/it/formats.py | 118 | 2086 | # -*- 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 = 'd F Y' # 25 Ottobre 2006
TIME_FOR... | apache-2.0 |
omardroubi/Artificial-Intelligence | Projects/Project3/reinforcement/featureExtractors.py | 8 | 3703 | # featureExtractors.py
# --------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://a... | apache-2.0 |
tdtrask/ansible | contrib/inventory/nsot.py | 117 | 9825 | #!/usr/bin/env python
'''
nsot
====
Ansible Dynamic Inventory to pull hosts from NSoT, a flexible CMDB by Dropbox
Features
--------
* Define host groups in form of NSoT device attribute criteria
* All parameters defined by the spec as of 2015-09-05 are supported.
+ ``--list``: Returns JSON hash of host groups -... | gpl-3.0 |
Kilves/finnchan | chan/middleware.py | 1 | 1108 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from django.db import connection
import pytz
from django.utils import timezone
from django.utils.deprecation import MiddlewareMixin
class SqlPrintMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
res... | bsd-3-clause |
ehuelsmann/openipam | openIPAM/pydhcplib/pydhcplib/dhcp_packet.py | 1 | 8561 | # Anemon Dhcp
# Copyright (C) 2005 Mathieu Ignacio -- mignacio@april.org
#
# 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 later versio... | gpl-3.0 |
krisys/django | django/conf/locale/sk/formats.py | 504 | 1173 | # -*- 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 = 'j. F Y'
TIME_FORMAT = 'G:i'
DATET... | bsd-3-clause |
FujitsuEnablingSoftwareTechnologyGmbH/tempest | tempest/api/object_storage/test_crossdomain.py | 4 | 2175 | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | apache-2.0 |
Snuzzo/dlx_kernel | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
dealien/Red-Magician | cogs/customcom.py | 1 | 7261 | from discord.ext import commands
from .utils.dataIO import dataIO
from .utils import checks
from .utils.chat_formatting import pagify, box
import os
import re
class CustomCommands:
"""Custom commands
Creates commands used to display text"""
def __init__(self, bot):
self.bot = bot
self.fi... | gpl-3.0 |
cosmiclattes/TPBviz | torrent/lib/python2.7/site-packages/django/core/management/commands/makemessages.py | 98 | 18250 | import fnmatch
import glob
import io
import os
import re
import sys
from itertools import dropwhile
from optparse import make_option
import django
from django.core.management.base import CommandError, NoArgsCommand
from django.core.management.utils import (handle_extensions, find_command,
popen_wrapper)
from djang... | gpl-3.0 |
optima-ict/odoo | doc/_extensions/github_link.py | 229 | 3484 | import inspect
import importlib
import os.path
from urlparse import urlunsplit
"""
* adds github_link(mode) context variable: provides URL (in relevant mode) of
current document on github
* if sphinx.ext.linkcode is enabled, automatically generates github linkcode
links (by setting config.linkcode_resolve)
Settin... | agpl-3.0 |
SEC-i/ecoControl | server/functions.py | 1 | 3643 | import logging
from datetime import datetime
import dateutil.relativedelta
from django.core.exceptions import ObjectDoesNotExist
from django.core.cache import cache
from django.utils.timezone import utc
from models import Device, Configuration, DeviceConfiguration, Sensor, SensorValue, SensorValueDaily
logger = log... | mit |
fedelemantuano/thug | samples/steps/misc.py | 2 | 1121 | import sys
import os
from behave import *
from behave.log_capture import capture
THUG = os.path.dirname(os.path.abspath(__file__)).split("samples")[0]
MISC = os.path.join(THUG, 'samples', 'misc')
sys.path.append(os.path.join(THUG, 'src'))
from thug.ThugAPI.ThugAPI import ThugAPI
class Misc(ThugAPI):
def __init__... | gpl-2.0 |
yamila-moreno/api-example | src/tests/conftest.py | 1 | 1237 | import pytest
from sqlalchemy_utils import database_exists, create_database, drop_database
from repositories.config import Base
from repositories.config import engine
from repositories.session import session_manager
@pytest.fixture(scope="session", autouse=True)
def create_db(request):
print("\n===> Create and s... | gpl-3.0 |
repotvsupertuga/repo | plugin.video.TVsupertuga/resources/lib/sources/einthusan_mv.py | 6 | 3567 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | gpl-2.0 |
radicalbit/ambari | ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/package/scripts/falcon.py | 3 | 3046 | """
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 |
wangyum/tensorflow | tensorflow/python/debug/cli/tensor_format.py | 28 | 16452 | # 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 |
crypta-io/android_kernel_samsung_prevail2spr-stock-galaxy-rush | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
asser/django | django/contrib/gis/gdal/layer.py | 477 | 8693 | from ctypes import byref, c_double
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import (
GDALException, OGRIndexError, SRSException,
)
from django.contrib.gis.gdal.feature import Feature
from django.contrib.g... | bsd-3-clause |
hugobowne/scikit-learn | examples/svm/plot_oneclass.py | 80 | 2338 | """
==========================================
One-class SVM with non-linear kernel (RBF)
==========================================
An example using a one-class SVM for novelty detection.
:ref:`One-class SVM <svm_outlier_detection>` is an unsupervised
algorithm that learns a decision function for novelty detection:
... | bsd-3-clause |
sphoebs/rockshell | simplejson/tests/__init__.py | 29 | 3029 | from __future__ import absolute_import
import unittest
import doctest
import sys
class NoExtensionTestSuite(unittest.TestSuite):
def run(self, result):
import simplejson
simplejson._toggle_speedups(False)
result = unittest.TestSuite.run(self, result)
simplejson._toggle_speedups(Tru... | apache-2.0 |
tragiclifestories/django | django/contrib/redirects/migrations/0001_initial.py | 142 | 1271 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Redirect',
fields=[
... | bsd-3-clause |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pygments-2.0.2/pygments/lexers/jvm.py | 72 | 66056 | # -*- coding: utf-8 -*-
"""
pygments.lexers.jvm
~~~~~~~~~~~~~~~~~~~
Pygments lexers for JVM languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, ... | mit |
n0m4dz/odoo | addons/crm/wizard/crm_phonecall_to_phonecall.py | 337 | 4535 | # -*- 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 |
zhaozengguang/opencog | opencog/python/spatiotemporal/temporal_events/composition/__init__.py | 1 | 1286 | from math import fabs, sqrt
__author__ = 'keyvan'
def unpack(relation, start_reference=0, length_reference=1):
before, same, after = relation
similarity = same / (1 - fabs(before - after))
solutions = []
lengths = length_reference / similarity**2, length_reference * similarity**2
for i in xrang... | agpl-3.0 |
superfluidity/RDCL3D | code/toscaparser/elements/capabilitytype.py | 1 | 3738 | # 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, software
# d... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.