repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
manulera/ModellingCourse | ReAct/Python/GenerateMasterEq.py | 1 | 1118 |
import numpy as np
from Gilles import *
import matplotlib.pyplot as plt
from DeviationAnalysis import *
from mpl_toolkits.mplot3d import Axes3D
# Initial conditions
user_input = ['A', 100,
'B', 0]
# Constants (this is not necessary, they could be filled up already in the reaction tuple)
k = (10,10)
# Re... | gpl-3.0 |
synologix/enigma2 | lib/python/Screens/TimerEdit.py | 13 | 20376 | from Components.ActionMap import ActionMap
from Components.Button import Button
from Components.Label import Label
from Components.config import config
from Components.MenuList import MenuList
from Components.TimerList import TimerList
from Components.TimerSanityCheck import TimerSanityCheck
from Components.UsageConfig... | gpl-2.0 |
pepeportela/edx-platform | openedx/core/djangoapps/ccxcon/tests/test_tasks.py | 36 | 1469 | """
Tests for the CCXCon celery tasks
"""
import mock
from nose.plugins.attrib import attr
from django.test import TestCase
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.ccxcon import api, tasks
@attr(shard=2)
class CCXConTaskTestCase(TestCase):
"""
Tests for CCXCon tasks.
"""... | agpl-3.0 |
mwmuni/LIGGGHTS_GUI | OpenGL/logs.py | 9 | 3153 | """Fix missing-API problems in logging module (circa Python 2.3)
Adds constants to the log objects.
Adds getException(err) to log objects to retrieve
formatted exception or err if traceback not available.
"""
import traceback, logging
from OpenGL._configflags import ERROR_LOGGING, FULL_LOGGING
getLog = logging.getLog... | gpl-3.0 |
jfinkels/networkx | networkx/algorithms/approximation/tests/test_dominating_set.py | 30 | 2400 | #!/usr/bin/env python
from nose.tools import ok_
from nose.tools import eq_
import networkx as nx
from networkx.algorithms.approximation import min_weighted_dominating_set
from networkx.algorithms.approximation import min_edge_dominating_set
class TestMinWeightDominatingSet:
def test_min_weighted_dominating_set(... | bsd-3-clause |
waltharius/NewsBlur | apps/profile/migrations/0010_generate_secret_token.py | 18 | 4712 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.contrib.auth.models import User
class Migration(DataMigration):
def forwards(self, orm):
for user in User.objects.all():
user.profile.save()
def backwards... | mit |
cytec/SickRage | lib/sqlalchemy/dialects/sybase/base.py | 78 | 28800 | # sybase/base.py
# Copyright (C) 2010-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
# get_select_precolumns(), limit_clause() implementation
# copyright (C) 2007 Fisch Asset Management
# AG http://www.fam.ch, with coding by Alexander Houben
# alexander.houben@thor-solutions.ch
#
# This module is part ... | gpl-3.0 |
sathnaga/avocado-vt | virttest/libvirt_xml/devices/console.py | 7 | 2077 | """
Console device support class(es)
http://libvirt.org/formatdomain.html#elementCharSerial
"""
from virttest.libvirt_xml import base, accessors, xcepts
from virttest.libvirt_xml.devices.character import CharacterBase
class Console(CharacterBase):
__slots__ = ('protocol_type', 'target_port', 'target_type', 'so... | gpl-2.0 |
MohammedWasim/scikit-learn | sklearn/cluster/tests/test_hierarchical.py | 230 | 19795 | """
Several basic tests for hierarchical clustering procedures
"""
# Authors: Vincent Michel, 2010, Gael Varoquaux 2012,
# Matteo Visconti di Oleggio Castello 2014
# License: BSD 3 clause
from tempfile import mkdtemp
import shutil
from functools import partial
import numpy as np
from scipy import sparse
from... | bsd-3-clause |
baidubce/bce-sdk-python | test/vcr/test_client.py | 1 | 2830 | # -*- coding: utf-8 -*
"""
Test models of VCR.
"""
import unittest
import coverage
import vcr_test_config
from baidubce.services.vcr import vcr_client
cov = coverage.coverage()
cov.start()
http_request = None
class TestVcrClient(unittest.TestCase):
"""
TestVcrClient
"""
def setUp(self):
"""... | apache-2.0 |
t-yanaka/zabbix-report | customer_api/auth/middleware.py | 60 | 5877 | from django.conf import settings
from django.contrib import auth
from django.contrib.auth import load_backend
from django.contrib.auth.backends import RemoteUserBackend
from django.core.exceptions import ImproperlyConfigured
from django.utils.deprecation import MiddlewareMixin
from django.utils.functional import Simple... | mit |
pankajp/pyface | pyface/ui/wx/action/status_bar_manager.py | 3 | 3465 | #------------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions d... | bsd-3-clause |
chiviak/headphones | lib/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
yyang179/ngta | ngta/assertions.py | 1 | 17333 | # -*- coding: utf-8 -*-
import re
import sys
import typing
import traceback
import inspect
import functools
import collections
from assertpy import assertpy
from deepdiff import DeepDiff
from collections import Mapping, Iterable
from deepdiff.helper import strings, numbers
from .util import pformat_json, truncate_str
... | mit |
Programmeerclub-WLG/Agenda-App | core/dispatcher.py | 1 | 7488 | import enum
import types
import typing
import weakref
class DispatchError(RuntimeError):
"""Exception raised when an exception is raised
during the execution of a registerd function
in the dispatcher.
"""
class Register(enum.IntFlag):
"""Enum to select registering mode for
Dis... | apache-2.0 |
ellxc/piperbot | plugins/markov.py | 2 | 4193 | import random
from collections import deque
from wrappers import *
import pymongo
from bson.code import Code
class mongomarkov():
def __init__(self, dbname="markov"):
self.con = pymongo.MongoClient()
self.db = self.con[dbname]
self.links = self.db.links
self.start = "\0"
s... | gpl-2.0 |
hwroitzsch/BikersLifeSaver | lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py | 1730 | 2278 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... | mit |
bratsche/Neutron-Drive | google_appengine/lib/django_1_2/tests/regressiontests/forms/localflavor/nl.py | 89 | 2084 | from django.contrib.localflavor.nl.forms import (NLPhoneNumberField,
NLZipCodeField, NLSoFiNumberField, NLProvinceSelect)
from utils import LocalFlavorTestCase
class NLLocalFlavorTests(LocalFlavorTestCase):
def test_NLProvinceSelect(self):
f = NLProvinceSelect()
out = u'''<select name="provin... | bsd-3-clause |
pearlcoin-project/pearlcoin | qa/rpc-tests/wallet-dump.py | 81 | 4788 | #!/usr/bin/env python3
# Copyright (c) 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.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (start_nodes, s... | mit |
pbrod/numdifftools | src/numdifftools/fornberg.py | 1 | 24876 | from __future__ import division
from collections import namedtuple
import numpy as np
from scipy.special import factorial
from numdifftools.extrapolation import EPS, dea3
from numdifftools.limits import _Limit
_INFO = namedtuple('info', ['error_estimate',
'degenerate',
... | bsd-3-clause |
porridge/apt-forktracer | lib/apt_forktracer/package_adapter.py | 1 | 2758 | # apt-forktracer - a utility for managing package versions
# Copyright (C) 2008,2010,2019 Marcin Owsiany <porridge@debian.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 ... | gpl-2.0 |
ilyasst/peridynamics_1D | peripydic/IO/ccm.py | 2 | 12948 | # -*- coding: utf-8 -*-
#@author: ilyass.tabiai@polymtl.ca
#@author: rolland.delorme@polymtl.ca
#@author: patrickdiehl@lsu.edu
import sys
import numpy as np
from scipy import linalg
np.set_printoptions(precision=8, threshold=sys.maxsize)
from ..util import functions
## Class to compute the well-known strain and stress... | mit |
keithroe/vtkoptix | ThirdParty/Twisted/twisted/python/hook.py | 41 | 5233 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I define support for hookable instance methods.
These are methods which you can register pre-call and post-call external
functions to augment their functionality. People familiar with more esoteric
languages may think of these as \"method... | bsd-3-clause |
cmu-delphi/delphi-epidata | integrations/acquisition/covid_hosp/state_timeseries/test_scenarios.py | 1 | 4531 | """Integration tests for acquisition of COVID hospitalization."""
# standard library
import unittest
from unittest.mock import MagicMock
# first party
from delphi.epidata.acquisition.covid_hosp.common.database import Database
from delphi.epidata.acquisition.covid_hosp.common.test_utils import UnitTestUtils
from delph... | mit |
emn178/sublime-text-2-teaspoon | lib/slimit/lexer.py | 7 | 15047 | ###############################################################################
#
# Copyright (c) 2011 Ruslan Spivak
#
# 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, inc... | mit |
mikitex70/pelican-plugins | neighbors/neighbors.py | 63 | 1947 | # -*- coding: utf-8 -*-
"""
Neighbor Articles Plugin for Pelican
====================================
This plugin adds ``next_article`` (newer) and ``prev_article`` (older)
variables to the article's context
"""
from pelican import signals
def iter3(seq):
it = iter(seq)
nxt = None
cur = next(it)
for ... | agpl-3.0 |
arvinsingla/CouchPotatoServer | libs/suds/transport/https.py | 202 | 3634 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) 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.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
amisrs/angular-flask | angular_flask/lib/python2.7/site-packages/dockerpty/tty.py | 10 | 3200 | # dockerpty: tty.py
#
# Copyright 2014 Chris Corbyn <chris@w3style.co.uk>
#
# 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 require... | mit |
jearls/mrepo | tests/rhntest.py | 4 | 3190 | #!/usr/bin/python -u
import sys, os, rpm, string
sys.path.insert(0, "/usr/share/rhn/")
from up2date_client import up2dateAuth
from up2date_client import up2date
from up2date_client import config
from up2date_client import repoDirector
from up2date_client import rpcServer
from up2date_client import wrapperUtils
from u... | gpl-2.0 |
mrquim/repository.mrquim | plugin.video.salts/js2py/constructors/jsarraybuffer.py | 22 | 1059 | # this is based on jsarray.py
# todo check everything :)
from ..base import *
try:
import numpy
except:
pass
@Js
def ArrayBuffer():
a = arguments[0]
if isinstance(a, PyJsNumber):
length = a.to_uint32()
if length!=a.value:
raise MakeError('RangeError', 'Invalid array lengt... | gpl-2.0 |
handspring/bite-project | deps/gdata-python-client/samples/blogger/oauth-appengine/main.py | 41 | 1765 | __author__ = 'wiktorgworek@google.com (Wiktor Gworek)'
import wsgiref.handlers
import atom
import os
import cgi
import gdata.blogger.service
from oauth import OAuthDanceHandler, OAuthHandler, requiresOAuth
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
class MainHandler(OA... | apache-2.0 |
loco-odoo/localizacion_co | openerp/addons-extra/odoo-pruebas/odoo-server/addons/stock_landed_costs/stock_landed_costs.py | 3 | 19099 | # -*- 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 |
antoinecarme/pyaf | tests/temporal_hierarchy/test_temporal_demo_hourly_H_6H_12H_D_W.py | 1 | 1546 | # %matplotlib inline
import pyaf
import numpy as np
import pandas as pd
DATA_FREQ = 'H'
PERIODS = ["H" , "6H" , "12H" , "D" , "W"]
H = 365
N = H * 10
lDateColumn = "Date"
lSignalVar = "Signal";
START_TIME = "2001-01-25"
# generate a daily signal covering one year 2016 in a pandas dataframe
np.random.seed(seed=1960)
... | bsd-3-clause |
keithmattix/west-tn-quizbowl | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/text.py | 197 | 68779 | # -*- coding: utf-8 -*-
"""
pygments.lexers.text
~~~~~~~~~~~~~~~~~~~~
Lexers for non-source code file types.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from bisect import bisect
from pygments.lexer import Lexer, LexerC... | mit |
joone/chromium-crosswalk | tools/telemetry/telemetry/internal/platform/gpu_device.py | 120 | 2599 | # 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.
class GPUDevice(object):
"""Provides information about an individual GPU device.
On platforms which support them, the vendor_id and device_id are
... | bsd-3-clause |
CaptorOfSin/pogom | pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/UpgradePokemonMessage_pb2.py | 15 | 2366 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Requests/Messages/UpgradePokemonMessage.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 _me... | mit |
nicolargo/intellij-community | plugins/hg4idea/testData/bin/mercurial/bundlerepo.py | 91 | 13705 | # bundlerepo.py - repository class for viewing uncompressed bundles
#
# Copyright 2006, 2007 Benoit Boissinot <bboissin@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""Repository class for viewing uncompressed bundle... | apache-2.0 |
ojengwa/odoo | addons/hr_holidays/report/holidays_summary_report.py | 333 | 10372 | # -*- 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 |
ridfrustum/lettuce | tests/integration/lib/Django-1.2.5/django/utils/synch.py | 376 | 2549 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
try:
import threading
except ImportError:
import dummy_threading as threading
class RWLock:
"""
Classic implementation of reader-writer lock with preference to writers.... | gpl-3.0 |
theskumar/python-usernames | usernames/reserved_words.py | 1 | 3483 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
List of reserved usernames (pre-defined list of special banned and reserved keywords in names,
such as "root", "www", "admin"). Useful when creating public systems, where users can choose
a login name or a sub-domain name.
__References:__
1. http://ww... | mit |
medillcmip/Radregator | users/utils.py | 1 | 1674 | from users.exceptions import BadUsernameOrPassword, UserAccountDisabled, \
UserUsernameExists, UserEmailExists, \
NoFacebookUser
import core.utils
from django.core.mail import send_mail
from django.contrib.sites.models import Site
from django.core.mail import Em... | gpl-3.0 |
tealover/nova | nova/tests/unit/objects/test_instance.py | 2 | 80126 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
DuoLife/script | python/scapy-2.3.1/scapy/layers/bluetooth.py | 9 | 6946 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Bluetooth layers, sockets and send/receive functions.
"""
import socket,struct
from scapy.config import conf
from s... | gpl-3.0 |
mmazanec22/too-windy | env/lib/python3.5/site-packages/paramiko/sftp_attr.py | 8 | 7884 | # Copyright (C) 2003-2006 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 License, or (at... | gpl-3.0 |
fernandezcuesta/ansible | lib/ansible/utils/display.py | 45 | 11885 | # (c) 2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
aiden0z/docker-py | docker/client.py | 3 | 13669 | # Copyright 2013 dotCloud 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 t... | apache-2.0 |
kharts/kastodi | resources/lib/google/protobuf/unittest_pb2.py | 7 | 306353 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/unittest.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf imp... | gpl-2.0 |
acsone/mozaik | mozaik_base/res_users.py | 2 | 4505 | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of mozaik_base, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# mozaik_base is free software:
# you can redistribute it and/or
# modify it under t... | agpl-3.0 |
srznew/heat | heat/tests/clients/test_sahara_client.py | 4 | 5526 | #
# 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
# ... | apache-2.0 |
rubikloud/scikit-learn | sklearn/cluster/tests/test_birch.py | 342 | 5603 | """
Tests for the birch clustering algorithm.
"""
from scipy import sparse
import numpy as np
from sklearn.cluster.tests.common import generate_clustered_data
from sklearn.cluster.birch import Birch
from sklearn.cluster.hierarchical import AgglomerativeClustering
from sklearn.datasets import make_blobs
from sklearn.l... | bsd-3-clause |
jMyles/AutobahnPython | examples/wamp/rpc/symmetric/server.py | 18 | 1580 | ###############################################################################
##
## Copyright 2013 Tavendo GmbH
##
## 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-2.0 |
Vauxoo/partner-contact | res_partner_affiliate/__openerp__.py | 11 | 1527 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
liminspace/fabdeb | fabdeb/python.py | 1 | 3590 | from fabric.context_managers import cd
from fabric.contrib.console import confirm
from fabric.contrib.files import exists, append
from fabric.decorators import task
from fabric.operations import sudo, run
from fabric.utils import abort
from fabdeb.os import check_sudo, check_os
from fabdeb.tools import print_green, pri... | mit |
shahar-stratoscale/nova | nova/openstack/common/db/sqlalchemy/test_base.py | 11 | 4705 | # 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 required by app... | apache-2.0 |
fuchsia-mirror/third_party-grpc | src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py | 4 | 26252 | # Copyright 2016 gRPC 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 applicable law or agreed to in writing... | apache-2.0 |
DaMSL/K3 | runtime/cpp/src/external/gtest-1.7.0/test/gtest_break_on_failure_unittest.py | 2140 | 7339 | #!/usr/bin/env python
#
# Copyright 2006, 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... | apache-2.0 |
floooh/drahtgitter | drahtgitter/readers/fbxutil/material.py | 1 | 1533 | '''
Material related FBX utility functions.
'''
from ...core import *
from ..fbxutil.general import dumpUserProperties
from fbx import *
#-------------------------------------------------------------------------------
def lookupMaterialIndex(model, fbxNode, fbxMesh) :
'''
Lookup the material index for a mesh.... | mit |
cchurch/ansible | test/units/modules/network/routeros/test_routeros_command.py | 68 | 4556 | # (c) 2016 Red Hat 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.
#
# Ansible is dis... | gpl-3.0 |
cloudbase/maas | src/maasserver/models/downloadprogress.py | 1 | 3332 | # Copyright 2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Model to record progress of boot-image downloads."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ = ... | agpl-3.0 |
manassolanki/erpnext | erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py | 2 | 2467 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt
from frappe import _
from erpnext.manufacturing.doctype.bom.bom import get_boms_in_bott... | gpl-3.0 |
b-me/django | tests/template_tests/filter_tests/test_force_escape.py | 352 | 2917 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import force_escape
from django.test import SimpleTestCase
from django.utils.safestring import SafeData
from ..utils import setup
class ForceEscapeTests(SimpleTestCase):
"""
Force_escape is applied immediatel... | bsd-3-clause |
kalou/gandi.cli | gandi/cli/modules/paas.py | 2 | 8767 | """ PaaS commands module. """
from gandi.cli.core.base import GandiModule
from gandi.cli.modules.metric import Metric
from gandi.cli.modules.vhost import Vhost
from gandi.cli.modules.datacenter import Datacenter
from gandi.cli.modules.sshkey import SshkeyHelper
class Paas(GandiModule, SshkeyHelper):
""" Module ... | gpl-3.0 |
anoopcs9/samba | python/samba/tests/dcerpc/rpcecho.py | 51 | 2417 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
#
# 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) a... | gpl-3.0 |
k2wl/android_kernel_oneplus_msm8994 | scripts/build-all.py | 704 | 14699 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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
# ... | gpl-2.0 |
caphrim007/ansible | lib/ansible/modules/cloud/amazon/ec2_metric_alarm.py | 53 | 11516 | #!/usr/bin/python
# Copyright: Ansible Project
# 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': ['stableinterf... | gpl-3.0 |
sserrot/champion_relationships | venv/Lib/site-packages/pygments/formatters/rtf.py | 4 | 5050 | # -*- coding: utf-8 -*-
"""
pygments.formatters.rtf
~~~~~~~~~~~~~~~~~~~~~~~
A formatter that generates RTF files.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_i... | mit |
dfdx2/django | tests/forms_tests/field_tests/test_booleanfield.py | 28 | 2573 | import pickle
from django.forms import BooleanField, ValidationError
from django.test import SimpleTestCase
class BooleanFieldTest(SimpleTestCase):
def test_booleanfield_clean_1(self):
f = BooleanField()
with self.assertRaisesMessage(ValidationError, "'This field is required.'"):
f.c... | bsd-3-clause |
jpautom/scikit-learn | sklearn/tests/test_cross_validation.py | 20 | 46586 | """Test the cross_validation module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse import csr_matrix
from scipy import stats
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.test... | bsd-3-clause |
vicky2135/lucious | oscar/lib/python2.7/site-packages/IPython/core/magics/display.py | 8 | 2127 | """Simple magics for display formats"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----... | bsd-3-clause |
hectord/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/admin/filterspecs.py | 89 | 7767 | """
FilterSpec encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
from django.db import models
from djan... | gpl-3.0 |
shootstar/novatest | nova/tests/api/openstack/compute/contrib/test_volumes.py | 4 | 25763 | # Copyright 2013 Josh Durgin
# 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 a... | apache-2.0 |
PyBossa/pybossa | test/test_jobs/test_dashboard_task_task_run.py | 2 | 5842 | # -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# PYBOSSA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | agpl-3.0 |
mavarick/jieba | test/test_tokenize_no_hmm.py | 65 | 5544 | #encoding=utf-8
from __future__ import print_function,unicode_literals
import sys
sys.path.append("../")
import jieba
g_mode="default"
def cuttest(test_sent):
global g_mode
result = jieba.tokenize(test_sent,mode=g_mode,HMM=False)
for tk in result:
print("word %s\t\t start: %d \t\t end:%d" % (tk[0]... | mit |
DARKPOP/external_chromium_org | third_party/protobuf/descriptor_pb2.py | 193 | 48695 | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='google/protobuf/descriptor.proto',
package='google.protobu... | bsd-3-clause |
golubev/elasticsearch | dev-tools/build_release.py | 7 | 17678 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | apache-2.0 |
wuhengzhi/chromium-crosswalk | testing/legion/lib/comm_server/server_handler.py | 18 | 2333 | # Copyright 2016 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.
"""Handler used directly by the server.
This handler routes the request to the correct subhandler based on the first
value in the URL path. For example, the... | bsd-3-clause |
tumbl3w33d/ansible | lib/ansible/modules/network/f5/bigiq_regkey_license.py | 38 | 15028 | #!/usr/bin/python
# -*- 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
Nikoli/youtube-dl | youtube_dl/extractor/audiomack.py | 114 | 5790 | # coding: utf-8
from __future__ import unicode_literals
import itertools
import time
from .common import InfoExtractor
from .soundcloud import SoundcloudIE
from ..utils import (
ExtractorError,
url_basename,
)
class AudiomackIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?audiomack\.com/song/(?P<id... | unlicense |
adamrw/ghost-test3 | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/util.py | 269 | 8396 | # -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import codecs
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(... | mit |
damonkohler/sl4a | python/src/Lib/lib2to3/pgen2/grammar.py | 52 | 4947 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... | apache-2.0 |
manasapte/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/test_jvm_classpath_published.py | 15 | 3664 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | apache-2.0 |
squarefeet/three.js | utils/converters/fbx/convert_to_threejs.py | 213 | 77684 | # @author zfedoran / http://github.com/zfedoran
import os
import sys
import math
import operator
import re
import json
import types
import shutil
# #####################################################
# Globals
# #####################################################
option_triangulate = True
option_textures = True
o... | mit |
exploreodoo/datStruct | odoo/addons/website_blog/wizard/document_page_show_diff.py | 372 | 2184 | # -*- 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... | gpl-2.0 |
crcresearch/osf.io | addons/dataverse/tests/utils.py | 25 | 5278 | import mock
from dataverse import Connection, Dataverse, Dataset, DataverseFile
from osf_tests.factories import ExternalAccountFactory
from addons.base.tests.base import OAuthAddonTestCaseMixin, AddonTestCase
from addons.dataverse.models import DataverseProvider
from addons.dataverse.tests.factories import DataverseA... | apache-2.0 |
jamesylgan/szechuantech | python-scripts/stock-info-gen.py | 1 | 1836 | import json
import requests
requests.packages.urllib3.disable_warnings()
stocks = ["GWPH", "POOL", "CRED", "WDFC", "ICLR", "ADP", "MPWR", "INCY", "PNQI", "CASY", "ISRL", "MAR", "NXPI", "ATHN", "LOGM", "EMB", "SINA", "FFIV", "VONE", "VTHR", "CGNX", "EA", "CHKP", "ADSK", "ERIE", "VTWO", "ANAT", "UTHR", "LANC", "TQQQ", "... | mit |
Florianboux/zds-site | zds/forum/models.py | 1 | 14383 | # coding: utf-8
from django.conf import settings
from django.db import models
from zds.utils import slugify
from math import ceil
import os
import string
import uuid
from django.contrib.auth.models import Group, User
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.utils.enco... | gpl-3.0 |
epssy/hue | desktop/libs/librdbms/src/librdbms/server/postgresql_lib.py | 10 | 3304 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
apporc/nova | nova/tests/unit/scheduler/test_ironic_host_manager.py | 3 | 22522 | # Copyright (c) 2014 OpenStack Foundation
# Copyright (c) 2011 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.apac... | apache-2.0 |
SeaFalcon/Musicool_Pr | lib/flask/debughelpers.py | 777 | 3508 | # -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string
class UnexpectedUnicodeError(AssertionEr... | apache-2.0 |
Jusedawg/SickRage | lib/hachoir_metadata/jpeg.py | 71 | 10210 | from hachoir_metadata.metadata import RootMetadata, registerExtractor
from hachoir_metadata.image import computeComprRate
from hachoir_parser.image.exif import IFD, BasicIFDEntry
from hachoir_parser.image.jpeg import (
JpegFile, JpegChunk,
QUALITY_HASH_COLOR, QUALITY_SUM_COLOR,
QUALITY_HASH_GRAY, QUALITY_SU... | gpl-3.0 |
Wilbeibi/rethinkdb | test/rql_test/connections/http_support/httpbin/helpers.py | 49 | 9578 | # -*- coding: utf-8 -*-
"""
httpbin.helpers
~~~~~~~~~~~~~~~
This module provides helper functions for httpbin.
"""
import json
import base64
from hashlib import md5
from werkzeug.http import parse_authorization_header
from flask import request, make_response
try:
from urlparse import urlparse, urlunparse
excep... | agpl-3.0 |
mabevillar/rmtk | rmtk/vulnerability/derivation_fragility/R_mu_T_no_dispersion/dolsek_fajfar/__init__.py | 67 | 1875 | # -*- coding: utf-8 -*-
#
# LICENSE
#
# Copyright © 2014-2015, GEM Foundation, Chiara Casotto, Anirudh Rao,
# Vitor Silva.
#
# The Risk Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
# License as published by the Free Software Foundation,... | agpl-3.0 |
Teeed/SpaceMon | modules/awsomlight.py | 2 | 1101 | __version__ = 1.0
__cacheable__ = True
import urllib2
import json
from application import config
CONFIG_KEY = 'module_awsomlight'
def update_document(data):
remote = urllib2.urlopen(config.get(CONFIG_KEY, 'url'), timeout=config.getint(CONFIG_KEY, 'timeout')).read()
remote = json.loads(remote)
if not data.get('s... | gpl-3.0 |
joone/chromium-crosswalk | tools/telemetry/third_party/webpagereplay/third_party/dns/reversename.py | 248 | 2931 | # Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED... | bsd-3-clause |
codilime/cloudify-system-tests | cosmo_tester/framework/git_helper.py | 1 | 1557 | ########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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 |
lucernae/inasafe | safe/definitions/exposure.py | 4 | 19064 | # coding=utf-8
"""Definitions relating to exposure in InaSAFE."""
from safe.definitions.caveats import caveat_incomplete_data
from safe.definitions.concepts import concepts
from safe.definitions.exposure_classifications import (
generic_place_classes,
generic_road_classes,
generic_structure_classes,
ge... | gpl-3.0 |
SUSE/azure-sdk-for-python | azure-mgmt-logic/azure/mgmt/logic/models/key_vault_key_reference_key_vault.py | 4 | 1236 | # 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 |
ksiomelo/cubix | fca/readwrite/xml_.py | 1 | 8025 | # -*- coding: utf-8 -*-
"""Holds functions that read a concept system from .xml file"""
from xml.dom.minidom import getDOMImplementation
import xml.parsers.expat
import fca
def write_xml(path, cs):
"""Write concept system to xml document
Examples
========
>>> from fca import ConceptLattice
... | apache-2.0 |
Preston4tw/elearning | coursera/algo-pt1/week1/theory_1.py | 1 | 4624 | #!/usr/bin/env python3
"""
You are given as input an unsorted array of n distinct numbers, where n is a
power of 2. Give an algorithm that identifies the second-largest number in the
array, and that uses at most n+log₂n-2 comparisons.
"""
"""
for input size n make a binary tree of level log₂n deep
n/2**level comparis... | mit |
kmather73/zipline | zipline/gens/tradesimulation.py | 9 | 15130 | #
# Copyright 2014 Quantopian, 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 wr... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.