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 |
|---|---|---|---|---|---|
multipath-rtp/cerbero | test/test_cerbero_build_build.py | 23 | 3397 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
rezoo/chainer | tests/chainer_tests/utils_tests/test_conv_nd_kernel.py | 14 | 1324 | import unittest
import mock
import chainer
from chainer import testing
from chainer.testing import attr
from chainer.utils import conv_nd_kernel
@testing.parameterize(*testing.product({
'ndim': [2, 3, 4],
}))
@attr.gpu
class TestIm2colNDKernelMemo(unittest.TestCase):
def setUp(self):
chainer.backen... | mit |
psiwczak/quantum | quantum/plugins/ryu/nova/linux_net.py | 5 | 2822 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# <yamahata at valinux co jp>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... | apache-2.0 |
jvehent/mig | tools/client.py | 16 | 1597 | #!/usr/bin/env python
import os
import sys
import gnupg
from time import gmtime, strftime
import random
import requests
import json
def makeToken(gpghome, keyid):
gpg = gnupg.GPG(gnupghome=gpghome)
version = "1"
timestamp = strftime("%Y-%m-%dT%H:%M:%SZ", gmtime())
nonce = str(random.randint(10000, 1844... | mpl-2.0 |
remitamine/youtube-dl | youtube_dl/extractor/nhl.py | 18 | 5004 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
int_or_none,
parse_iso8601,
parse_duration,
)
class NHLBaseIE(InfoExtractor):
def _real_extract(self, url):
site, tmp_id = re.match(sel... | unlicense |
jonparrott/google-cloud-python | trace/google/cloud/trace_v2/proto/tracing_pb2_grpc.py | 3 | 3436 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.trace_v2.proto import trace_pb2 as google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2
from google.cloud.trace_v2.proto import tracing_pb2 as google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_tracing__pb2... | apache-2.0 |
Apoyhtari/Irc-Bot | beautifulsoup4-4.1.2/build/lib/bs4/builder/_html5lib.py | 119 | 7746 | __all__ = [
'HTML5TreeBuilder',
]
import warnings
from bs4.builder import (
PERMISSIVE,
HTML,
HTML_5,
HTMLTreeBuilder,
)
from bs4.element import NamespacedAttribute
import html5lib
from html5lib.constants import namespaces
from bs4.element import (
Comment,
Doctype,
NavigableStr... | mit |
hoogamaphone/chromathicity | chromathicity/rgbspec.py | 1 | 3461 | import numpy as np
import chromathicity.defaults
from chromathicity.illuminant import D
from chromathicity.interfaces import RgbSpecification, Compander
from chromathicity.observer import Standard
from chromathicity.util import SetGet
class Custom(RgbSpecification, SetGet):
def __init__(self, **kwargs):
... | bsd-3-clause |
maxdeliso/elevatorSim | Lib/test/test_concurrent_futures.py | 5 | 23223 | import test.support
# Skip tests if _multiprocessing wasn't built.
test.support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test.support.import_module('multiprocessing.synchronize')
# import threading after _multiprocessing to raise a more revelant error
# message: "No module n... | bsd-2-clause |
avinson/ansible-modules-core | cloud/openstack/os_nova_flavor.py | 93 | 6844 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
simbuerg/benchbuild | benchbuild/projects/gentoo/crafty.py | 1 | 3254 | """
crafty experiment within gentoo chroot.
"""
from benchbuild.utils.wrapping import wrap_in_uchroot as wrap
from benchbuild.projects.gentoo.gentoo import GentooGroup
from benchbuild.utils.downloader import Wget
from benchbuild.utils.run import run, uchroot
from benchbuild.utils.cmd import cat # pylint: disable=E040... | mit |
evangeline97/localwiki-backend-server | localwiki/maps/fields.py | 3 | 10795 | from django.utils.translation import ugettext as _
from django.contrib.gis.db import models
from django.contrib.gis.geos import *
from .validators import validate_geometry
def flatten_collection(geoms):
"""
Args:
geoms: A GeometryCollection.
Returns:
A GeometryCollection where overlappin... | gpl-2.0 |
monkut/deso | deso/deso/layers/vector/management/commands/load_geojson_layers.py | 1 | 1694 | """
Load GEOJSON text files from a given directory to individua vector.GeoJsonLayer models
"""
import os
from django.core.management.base import BaseCommand, CommandError
from ...models import GeoJsonLayer
WGS84_SRID = 4326
def load_geojson_layer(geojson_filepath):
with open(geojson_filepath, "rt", encoding="u... | mit |
smesdaghi/geonode | geonode/layers/populate_layers_data.py | 35 | 6647 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | gpl-3.0 |
rlbabyuk/integration_tests | utils/perf_message_stats.py | 8 | 50825 | # -*- coding: utf-8 -*
"""Functions for performance analysis/charting of the backend messages and top_output from an
appliance.
"""
from utils.log import logger
from utils.path import log_path
from utils.perf import convert_top_mem_to_mib
from utils.perf import generate_statistics
from datetime import datetime
import d... | gpl-2.0 |
rhelmer/socorro | socorro/unittest/cron/jobs/test_weekly_reports_partitions.py | 11 | 1478 | # 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/.
from nose.plugins.attrib import attr
from crontabber.app import CronTabber
from socorro.unittest.cron.jobs.base import ... | mpl-2.0 |
hgarrereyn/Th3g3ntl3man-CTF-Writeups | 2017/picoCTF_2017/problems/cryptography/weirderRSA/solution.py | 1 | 1411 | import binascii
import string
e = 65537
N = 2117672903243982543718682316871526252711806457547609454030889520203949724574698058235821747613875519920176501328068871432817438393885435762043247829203062605160245553645158838861106558077244590404583160688904474995478819140425202290013963177624041695727533599660346969550... | gpl-3.0 |
hanak/artshow-keeper | artshowkeeper/model/currency.py | 1 | 4797 | # Artshow Keeper: A support tool for keeping an Artshow running.
# Copyright (C) 2014 Ivo Hanak
#
# 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... | gpl-3.0 |
nlloyd/SubliminalCollaborator | libs/twisted/internet/test/test_process.py | 5 | 25327 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorProcess}.
"""
__metaclass__ = type
import os, sys, signal, threading
from twisted.trial.unittest import TestCase, SkipTest
from twisted.internet.test.reactormixins import ReactorBuilder
from twisted.py... | apache-2.0 |
melersh/Yasta | twilio/rest/resources/notifications.py | 14 | 1299 | from twilio.rest.resources.util import normalize_dates
from twilio.rest.resources import InstanceResource, ListResource
class Notification(InstanceResource):
def delete(self):
"""
Delete this notification
"""
return self.delete_instance()
class Notifications(ListResource):
... | mit |
frankiecjunle/yunblog | venv/lib/python2.7/site-packages/wheel/wininst2wheel.py | 62 | 7772 | #!/usr/bin/env python
import distutils.dist
import os.path
import re
import sys
import tempfile
import zipfile
from argparse import ArgumentParser
from glob import iglob
from shutil import rmtree
import wheel.bdist_wheel
from wheel.archive import archive_wheelfile
egg_info_re = re.compile(r'''(^|/)(?P<name>[^/]+?)-(?... | mit |
jimi-c/ansible | lib/ansible/modules/network/vyos/vyos_system.py | 68 | 6307 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 |
vinicius-alves/InternetBanking | env/lib/python3.4/site-packages/django/conf/__init__.py | 59 | 6888 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time
from django.conf import... | gpl-3.0 |
willhardy/django | django/db/migrations/operations/fields.py | 64 | 12272 | from __future__ import unicode_literals
from django.db.models.fields import NOT_PROVIDED
from django.utils.functional import cached_property
from .base import Operation
class FieldOperation(Operation):
def __init__(self, model_name, name):
self.model_name = model_name
self.name = name
@cach... | bsd-3-clause |
yuxiaorui/torngas | torngas/cache/__init__.py | 3 | 3657 | """
Caching framework.
"""
from threading import local
from torngas.settings_manager import settings
from torngas.cache.backends.base import (
InvalidCacheBackendError, CacheKeyWarning, BaseCache)
from tornado.util import import_object
from torngas.exception import ConfigError
from tornado.ioloop import PeriodicC... | bsd-3-clause |
SRabbelier/Melange | app/soc/logic/helper/notifications.py | 1 | 13100 | #!/usr/bin/env python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 |
sudheeshap8/LetsTango-Newsletter-Generator | lib/werkzeug/posixemulation.py | 319 | 3543 | # -*- coding: utf-8 -*-
r"""
werkzeug.posixemulation
~~~~~~~~~~~~~~~~~~~~~~~
Provides a POSIX emulation for some features that are relevant to
web applications. The main purpose is to simplify support for
systems such as Windows NT that are not 100% POSIX compatible.
Currently this only imple... | apache-2.0 |
Catherine-Chu/DeepQA | chatbot/corpus/scotusdata.py | 10 | 1602 | # Copyright 2015 Conchylicultor. 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 ... | apache-2.0 |
spring-week-topos/horizon-week | openstack_dashboard/test/integration_tests/helpers.py | 7 | 1492 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | apache-2.0 |
drawks/ansible | lib/ansible/modules/windows/win_wait_for_process.py | 17 | 4029 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub, actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
pkats15/hdt_analyzer | django_test/django_venv/Lib/site-packages/pip/_vendor/distlib/index.py | 571 | 20976 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
try:
from threading import Thread
except ImportErr... | mit |
louyihua/edx-platform | lms/djangoapps/courseware/field_overrides.py | 31 | 11383 | """
This module provides a :class:`~xblock.field_data.FieldData` implementation
which wraps an other `FieldData` object and provides overrides based on the
user. The use of providers allows for overrides that are arbitrarily
extensible. One provider is found in `courseware.student_field_overrides`
which allows for fi... | agpl-3.0 |
openaire/iis | iis-3rdparty-madis/src/main/resources/eu/dnetlib/iis/3rdparty/scripts/madis/lib/chardet/sjisprober.py | 190 | 3549 | ######################## 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... | apache-2.0 |
powerlim2/project_free_insight | data_api/venv/lib/python2.7/site-packages/requests/packages/urllib3/contrib/socks.py | 360 | 5668 | # -*- coding: utf-8 -*-
"""
SOCKS support for urllib3
~~~~~~~~~~~~~~~~~~~~~~~~~
This contrib module contains provisional support for SOCKS proxies from within
urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and
SOCKS5. To enable its functionality, either install PySocks or install this
module w... | bsd-3-clause |
daspots/dasapp | lib/requests_oauthlib/oauth2_session.py | 21 | 17215 | from __future__ import unicode_literals
import logging
from oauthlib.common import generate_token, urldecode
from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError
from oauthlib.oauth2 import TokenExpiredError, is_secure_transport
import requests
log = logging.getLogger(__name__)
class TokenUpdat... | mit |
DHI-GRAS/processing_gpf | SNAPAlgorithm.py | 2 | 4198 | """
***************************************************************************
S1TbxAlgorithm.py
-------------------------------------
Copyright (C) 2014 TIGER-NET (www.tiger-net.org)
***************************************************************************
* This plugin is part of the Water Observation Inf... | gpl-3.0 |
Bismarrck/pymatgen | pymatgen/command_line/tests/test_critic2_caller.py | 6 | 3331 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import unittest
from pymatgen import Structure
from pymatgen.command_line.critic2_caller import *
from monty.os.path import which
__author__ = "Matthew Horton... | mit |
rjeschmi/easybuild-easyblocks | easybuild/easyblocks/a/aladin.py | 3 | 14593 | ##
# Copyright 2009-2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
walty8/trac | trac/wiki/web_ui.py | 1 | 35037 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part ... | bsd-3-clause |
map222/spark | examples/src/main/python/ml/one_vs_rest_example.py | 71 | 2237 | #
# 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 us... | apache-2.0 |
labcodes/django | django/contrib/gis/sitemaps/views.py | 101 | 2313 | from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.functions import AsKML, Transform
from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz
from django.core.exceptions import FieldDoesNotExist
from django.db import DEFAULT_DB_ALIAS... | bsd-3-clause |
neerajvashistha/pa-dude | lib/python2.7/site-packages/django/db/migrations/optimizer.py | 339 | 15773 | from __future__ import unicode_literals
from django.db.migrations import (
AddField, AlterField, AlterIndexTogether, AlterModelTable,
AlterOrderWithRespectTo, AlterUniqueTogether, CreateModel, DeleteModel,
RemoveField, RenameField, RenameModel,
)
from django.utils import six
class MigrationOptimizer(obje... | mit |
spiiph/owls-hep | owls_hep/counting.py | 1 | 2022 | """Provides method for efficiently counting events in a region.
"""
# System imports
from uuid import uuid4
# owls-cache imports
from owls_cache.persistent import cached as persistently_cached
# owls-parallel imports
from owls_parallel import parallelized
# owls-hep imports
from owls_hep.calculation import Calculat... | mit |
erkrishna9/odoo | addons/hr_payroll/hr_payroll.py | 12 | 49751 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
idea4bsd/idea4bsd | python/lib/Lib/site-packages/django/db/backends/postgresql/introspection.py | 308 | 3725 | from django.db.backends import BaseDatabaseIntrospection
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django Field types.
data_types_reverse = {
16: 'BooleanField',
20: 'BigIntegerField',
21: 'SmallIntegerField',
23: 'IntegerField',
25: 'T... | apache-2.0 |
bioh4x/NeatFreq | lib/genometools-1.4.1/gtpython/gt/extended/feature_node.py | 1 | 8909 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008-2009 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
# Copyright (c) 2008-2009 Center for Bioinformatics, University of Hamburg
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, prov... | gpl-2.0 |
fidomason/kbengine | kbe/res/scripts/common/Lib/distutils/tests/test_spawn.py | 146 | 1857 | """Tests for distutils.spawn."""
import unittest
import os
import time
from test.support import captured_stdout, run_unittest
from distutils.spawn import _nt_quote_args
from distutils.spawn import spawn, find_executable
from distutils.errors import DistutilsExecError
from distutils.tests import support
class SpawnTes... | lgpl-3.0 |
NMGRL/pychron | pychron/experiment/conditional/experiment_queue_action.py | 3 | 2235 | # # ===============================================================================
# # Copyright 2013 Jake Ross
# #
# # 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.a... | apache-2.0 |
ESOedX/edx-platform | lms/djangoapps/discussion/rest_api/tests/test_api.py | 1 | 128499 | """
Tests for Discussion API internal interface
"""
from __future__ import absolute_import
import itertools
from datetime import datetime, timedelta
import ddt
import httpretty
import mock
import six
from django.core.exceptions import ValidationError
from django.test.client import RequestFactory
from opaque_keys.edx.... | agpl-3.0 |
Samuel789/MediPi | MedManagementWeb/env/lib/python3.5/site-packages/pip/_vendor/distlib/util.py | 327 | 52991 | #
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
try:
... | apache-2.0 |
hansonrobotics/chatbot | src/chatbot/stats.py | 1 | 3618 | import os
import logging
import pandas as pd
import glob
import re
import datetime as dt
from collections import Counter
logger = logging.getLogger('hr.chatbot.stats')
trace_pattern = re.compile(
r'../(?P<fname>.*), (?P<tloc>\(.*\)), (?P<pname>.*), (?P<ploc>\(.*\))')
def collect_history_data(history_dir, days):
... | mit |
TravisDart/tictactoe | tictactoe.py | 1 | 1378 | import os
from pymongo import MongoClient
from TicTacToeBoard import TicTacToeBoard
from ProgressCounter import ProgressCounter
client = MongoClient(os.environ["MONGOLABURL"])
collection = client['test1']['one']
_ = TicTacToeBoard._
blankBoard = TicTacToeBoard([
_, _, _,
_, _, _,
_, _, _
])
collection.r... | mit |
onlinepcwizard/dms | dms/zone_data_util.py | 1 | 29679 | #!/usr/bin/env python3.2
#
# Copyright (c) Net24 Limited, Christchurch, New Zealand 2011-2012
# and Voyager Internet Ltd, New Zealand, 2012-2013
#
# This file is part of py-magcode-core.
#
# Py-magcode-core is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | gpl-3.0 |
vericoin/vericoin-core | qa/rpc-tests/listtransactions.py | 1 | 4674 | #!/usr/bin/env python2
# Copyright (c) 2014 The VeriCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework.test_framework import VeriCoinTestFramework
from tes... | mit |
OpusVL/odoo-bank-sort-code | bank_sort_code/__init__.py | 1 | 1266 | # -*- coding: utf-8 -*-
##############################################################################
#
# Add Bank Sort Code to banks in Odoo.
# Copyright (C) 2014 OpusVL
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publishe... | agpl-3.0 |
fergalbyrne/nupic | src/nupic/data/filters.py | 34 | 4194 | #!/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 |
gartung/dxr | tests/test_markup/test_markup.py | 9 | 1888 | """Tests for emission of high-level markup, as by templates"""
from dxr.testing import DxrInstanceTestCase
from nose.tools import eq_, ok_
class MarkupTests(DxrInstanceTestCase):
def test_autofocus_root(self):
"""Autofocus the query field at the root of each tree but not
elsewhere."""
ma... | mit |
kienpham2000/ansible-modules-core | cloud/rax_keypair.py | 17 | 4918 | #!/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 |
tboyce021/home-assistant | homeassistant/components/meteo_france/const.py | 1 | 6603 | """Meteo-France component constants."""
from homeassistant.components.weather import (
ATTR_CONDITION_CLEAR_NIGHT,
ATTR_CONDITION_CLOUDY,
ATTR_CONDITION_EXCEPTIONAL,
ATTR_CONDITION_FOG,
ATTR_CONDITION_HAIL,
ATTR_CONDITION_LIGHTNING,
ATTR_CONDITION_LIGHTNING_RAINY,
ATTR_CONDITION_PARTLYC... | apache-2.0 |
manics/openmicroscopy | examples/ScreenPlateWell/imagesperwell.py | 15 | 1689 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import omero
from omero.rtypes import rint
from omero_sys_ParametersI import ParametersI # Temporary
c = omero.client()
s = c.createSession()
q = s.getQueryService()
LOAD_WELLS = (
"select w from Well w join fetch w.wellSamples ws"
" join fetch ws.imag... | gpl-2.0 |
dataxu/ansible | lib/ansible/parsing/metadata.py | 117 | 10058 | # (c) 2017, Toshio Kuratomi <tkuratomi@ansible.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... | gpl-3.0 |
EntityFXCode/arsenalsuite | python/pythondotnet/pythonnet/src/tests/test_enum.py | 10 | 5319 | # ===========================================================================
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE D... | gpl-2.0 |
barometz/shirk | plugs/Auth/auth.py | 1 | 3986 | # Copyright (c) 2012 Dominic van Berkel
# See LICENSE for details.
from plugs import plugbase
from util import Event
class AuthPlug(plugbase.Plug):
"""Auth plug. Handles auth stuffs."""
name = 'Auth'
# manual_auths is a dict of source:target that are created after !auth requests so they can be
# re... | mit |
abhishekgahlot/or-tools | examples/python/volsay2.py | 34 | 2029 | # Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.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 applicable ... | apache-2.0 |
uberdugo/mlia | Ch05/EXTRAS/plot2D.py | 7 | 1276 | '''
Created on Oct 6, 2010
@author: Peter
'''
from numpy import *
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import logRegres
dataMat,labelMat=logRegres.loadDataSet()
dataArr = array(dataMat)
weights = logRegres.stocGradAscent0(dataArr,labelMat)
n = shap... | gpl-3.0 |
pbsds/hatena-server | database/__init__.py | 1 | 5487 | from twisted.internet import reactor
import atexit, os
from Hatenatools import TMB
#The database handling flipnote files and info
#this one stores them in plaintext, only works with one server worker
class Database:
def __init__(self):
#read database stuff into memory:
if os.path.exists("database/new_flipnotes.da... | agpl-3.0 |
dave-shawley/ietfparse | tests/test_datastructure.py | 1 | 3585 | import unittest
from ietfparse.datastructures import ContentType
class ContentTypeCreationTests(unittest.TestCase):
def test_that_primary_type_is_normalized(self):
self.assertEqual('contenttype',
ContentType('COntentType', 'b').content_type)
def test_that_subtype_is_normaliz... | bsd-3-clause |
AnderEnder/ansible-modules-extras | network/f5/bigip_virtual_server.py | 3 | 20637 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Etienne Carriere <etienne.carriere@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 ... | gpl-3.0 |
kutuhal/oracle-r12-accounting | lib/django/contrib/admin/templatetags/admin_list.py | 46 | 17082 | from __future__ import unicode_literals
import datetime
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.utils import (
display_for_field, display_for_value, label_for_field, lookup_field,
)
f... | bsd-3-clause |
carlmw/oscar-wager | django/contrib/gis/db/backends/spatialite/creation.py | 16 | 4167 | import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from django.db.backends.sqlite3.creation import DatabaseCreation
class SpatiaLiteCreation(DatabaseCreation):
def create_test_db(self, verbosity=1, autoclobber=False):
... | bsd-3-clause |
dineshsg/spoken-website | cron/old/create_playlists.py | 2 | 2307 | import MySQLdb
import time
import sys
#sys.path.insert(0, '../spoken')
#sys.path.insert(0, '../../spoken')
from youtube_upload import *
from config import *
# creating youtube object
youtube = Youtube(DEVELOPER_KEY)
debug("Login to Youtube API: email='%s', password='%s'" %
(EMAIL, "*" * len(PASSWORD)))
try:
... | gpl-3.0 |
avanov/django | django/contrib/gis/db/backends/spatialite/introspection.py | 391 | 3131 | from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.sqlite3.introspection import (
DatabaseIntrospection, FlexibleFieldLookupDict,
)
from django.utils import six
class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict):
"""
Sublcass that includes updates the `base_data_types_reverse` ... | bsd-3-clause |
gechdcb/shadowsocks | shadowsocks/crypto/sodium.py | 1032 | 3778 | #!/usr/bin/env python
#
# Copyright 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 law or ... | apache-2.0 |
andyzsf/rietveld | tests/test_incomingmail.py | 23 | 8805 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011 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 requir... | apache-2.0 |
ericholscher/cookiecutter | cookiecutter/exceptions.py | 4 | 1440 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cookiecutter.exceptions
-----------------------
All exceptions used in the Cookiecutter code base are defined here.
"""
class CookiecutterException(Exception):
"""
Base exception class. All Cookiecutter-specific exceptions should subclass
this class.
... | bsd-3-clause |
travisgoldie/Signal_iQ | python/test/scripts/hw_minigun.py | 1 | 2516 | #!/usr/bin/env python
###############################################################################
# vim: tabstop=4:shiftwidth=4:expandtab:
# Copyright (c) 2017 SIOS Technology Corp. All rights reserved.
##############################################################################
"""
This script will spray events ... | mit |
vlegoff/tsunami | src/secondaires/auberge/editeurs/aubedit/edt_chambres.py | 1 | 5517 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | bsd-3-clause |
tlianza/Rfugee | lib/requests-2.7.0-py2.7.egg/requests/api.py | 435 | 5415 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... | mit |
NLHEALTHCARE/PYELT | tests/unit_tests_basic/test05_db_functions.py | 1 | 3894 | from pyelt.mappings.sor_to_dv_mappings import SorToEntityMapping
from tests.unit_tests_basic import _domainmodel, _db_functions, _db_functions2
from tests.unit_tests_basic._db_functions import CreateAgb
from tests.unit_tests_basic._domainmodel import Patient
from tests.unit_tests_basic._mappings import init_source_to_s... | gpl-3.0 |
darkorb/eve-wspace | evewspace/Map/templatetags/mapnav.py | 15 | 1224 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# 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... | gpl-3.0 |
renyi533/tensorflow | tensorflow/python/kernel_tests/summary_ops_test.py | 6 | 46187 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
jianglu/mojo | build/win/reorder-imports.py | 103 | 1807 | #!/usr/bin/env python
# Copyright 2014 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 glob
import optparse
import os
import shutil
import subprocess
import sys
def reorder_imports(input_dir, output_dir, architectu... | bsd-3-clause |
pombredanne/bokeh | bokeh/core/templates.py | 7 | 1290 | ''' The templates module contains Jinja2 templates used by Bokeh embed
Bokeh models (e.g. plots, widgets, layouts) in various ways.
.. bokeh-jinja:: bokeh.core.templates.AUTOLOAD_JS
.. bokeh-jinja:: bokeh.core.templates.AUTOLOAD_TAG
.. bokeh-jinja:: bokeh.core.templates.CSS_RESOURCES
.. bokeh-jinja:: bokeh.core.templa... | bsd-3-clause |
SimonSapin/pycairo | examples/cairo_snippets/snippets_svg.py | 9 | 1373 | #!/usr/bin/env python
from __future__ import division
from math import pi as M_PI # used by many snippets
import sys
import cairo
if not cairo.HAS_SVG_SURFACE:
raise SystemExit ('cairo was not compiled with SVG support')
from snippets import snip_list, snippet_normalize
width_in_inches, height_in_inches = 2, 2
... | gpl-3.0 |
EricssonResearch/calvin-base | calvin/actorstore/systemactors/web/LocationWeather.py | 1 | 2182 | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Ericsson AB
#
# 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 |
jhawkesworth/ansible | lib/ansible/modules/storage/netapp/netapp_e_iscsi_interface.py | 52 | 16203 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
jarn0ld/gnuradio | gr-channels/python/channels/__init__.py | 54 | 1350 | #
# Copyright 2012-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version... | gpl-3.0 |
potash/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 311 | 1529 | """
======================================
Decision Tree Regression with AdaBoost
======================================
A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D
sinusoidal dataset with a small amount of Gaussian noise.
299 boosts (300 decision trees) is compared with a single decision tr... | bsd-3-clause |
Ceciliae/gourmet | gourmet/gtk_extras/timeEntry.py | 6 | 4398 | ### Copyright (C) 2005 Thomas M. Hinkle
### Copyright (C) 2009 Rolf Leggewie
###
### This library 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) an... | gpl-2.0 |
chiamingyen/PythonCAD_py3 | Interface/cadwindow.py | 1 | 39067 | ############################################################################
#
# Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
#
# This file is part of the example classes of the Qt Toolkit.
#
# This file may be used under the terms of the GNU General Public
# License version 2.0 as published by the Fr... | gpl-2.0 |
alexmorozov/django | tests/prefetch_related/models.py | 255 | 7972 | import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Basic tests
@python_2_unicode_compatible
class Author(models.... | bsd-3-clause |
zlfben/gem5 | src/mem/ruby/system/RubySystem.py | 13 | 2490 | # Copyright (c) 2009 Advanced Micro Devices, 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... | bsd-3-clause |
bbiiggppiigg/NTHUOJ_web | team/models.py | 3 | 2090 | '''
The MIT License (MIT)
Copyright (c) 2014 NTHUOJ team
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, modify, merge, ... | mit |
BackupTheBerlios/pixies-svn | pixies/reportlab/lib/logger.py | 1 | 1712 | #!/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/logger.py
__version__=''' $Id$ '''
from sys import stderr
class Logger:
'''
An extended file type thing initially equiva... | gpl-2.0 |
cindyyu/kuma | kuma/attachments/utils.py | 10 | 3728 | import calendar
from datetime import datetime
import hashlib
from django.conf import settings
from django.core.files import temp as tempfile
from django.template import loader
from django.utils import timezone
from django.utils.http import http_date
from django.utils.safestring import mark_safe
from kuma.core.urlreso... | mpl-2.0 |
klunwebale/odoo | addons/account_voucher/account_voucher.py | 132 | 85482 | # -*- 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 |
brightchen/h2o-3 | h2o-py/tests/testdir_misc/pyunit_hit_ratio.py | 5 | 1279 | import sys
sys.path.insert(1, "../../")
import h2o, tests
def hit_ratio_test():
air_train = h2o.import_file(path=h2o.locate("smalldata/airlines/AirlinesTrain.csv.zip"))
air_valid = h2o.import_file(path=h2o.locate("smalldata/airlines/AirlinesTest.csv.zip"))
air_test = h2o.import_file(path=h2o.loc... | apache-2.0 |
apple/swift-lldb | examples/python/gdb_disassemble.py | 13 | 1047 | import lldb
def disassemble(debugger, command, result, dict):
if lldb.frame.function:
instructions = lldb.frame.function.instructions
start_addr = lldb.frame.function.addr.load_addr
name = lldb.frame.function.name
elif lldb.frame.symbol:
instructions = lldb.frame.symbol.instruc... | apache-2.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/r-proxy/package.py | 5 | 1714 | ##############################################################################
# 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 |
sobodash/libpirate | lib/pirromvboy.py | 1 | 9822 | '''
Virtual Boy ROM Object
A part of the libPirate (Python) library
Version: 0.2
Author: Derrick Sobodash <derrick@sobodash.com>
Copyright: (c) 2008, 2012 Derrick Sobodash
Web site: https://github.com/sobodash/libpirate/
License: BSD License <http://opensource.org/licenses/bsd-license.php>
'''
try:
import r... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.