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 |
|---|---|---|---|---|---|
muxi/grpc | src/python/grpcio/grpc/beta/utilities.py | 27 | 4933 | # Copyright 2015 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 |
gfarnadi/FairPSL | engines/fpsl_pulp.py | 1 | 9579 | from __future__ import print_function
import pulp
solver_map = {
'gurobi': pulp.GUROBI_CMD(msg=False)
}
#FIXME when adding constraints, use a map to match to your own id
class Math_prob:
def __init__(self, var_ids):
self.num_vars = 0
self.num_cons_linear = 0
self.num_cons_nonlinear = 0... | mit |
BlackLight/evesp | run_tests.py | 1 | 259746 | #! /usr/bin/env python
# Hi There!
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base64 encoding of a zip file, this zip file contains
# a fully functional basic pytest script.
#
# Pyt... | apache-2.0 |
nikitabiradar/student_registration | janastu/lib/python2.7/encodings/iso8859_16.py | 593 | 13813 | """ Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... | mit |
ArnossArnossi/django | tests/field_subclassing/tests.py | 214 | 4475 | from __future__ import unicode_literals
import inspect
from django.core import exceptions, serializers
from django.db import connection
from django.test import SimpleTestCase, TestCase
from .fields import CustomTypedField, Small
from .models import ChoicesModel, DataModel, MyModel, OtherModel
class CustomField(Tes... | bsd-3-clause |
WoLpH/django-balancer | balancer/tests.py | 3 | 9479 | import unittest
from datetime import datetime, timedelta
from django.conf import settings
from django.test import TestCase
import balancer
from balancer import pinning
from balancer.routers import RandomRouter, RoundRobinRouter, \
WeightedRandomRouter, \
Weigh... | bsd-3-clause |
gwu-libraries/sfm | sfm/ui/config.py | 2 | 4486 | from django.apps import AppConfig
from .rabbit import RabbitWorker
from django.db.models.signals import post_save, pre_delete, m2m_changed, post_delete
from django.conf import settings
import logging
log = logging.getLogger(__name__)
class UIConfig(AppConfig):
name = 'ui'
verbose_name = "ui"
def ready(s... | mit |
dhamaniasad/mythbox | resources/lib/IMDbPY/bin/search_character.py | 7 | 1413 | #!/usr/bin/env python
"""
search_character.py
Usage: search_character "character name"
Search for the given name and print the results.
"""
import sys
# Import the IMDbPY package.
try:
import imdb
except ImportError:
print 'You bad boy! You need to install the IMDbPY package!'
sys.exit(1)
if len(sys.... | gpl-2.0 |
larsks/blivet | blivet/tasks/fsminsize.py | 2 | 5641 | # fsminsize.py
# Filesystem size gathering classes.
#
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# Thi... | gpl-2.0 |
ubc/edx-platform | common/djangoapps/util/module_utils.py | 106 | 1387 | """
Utility library containing operations used/shared by multiple courseware modules
"""
def yield_dynamic_descriptor_descendants(descriptor, user_id, module_creator): # pylint: disable=invalid-name
"""
This returns all of the descendants of a descriptor. If the descriptor
has dynamic children, the modul... | agpl-3.0 |
petermat/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/build.py | 119 | 2636 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | bsd-3-clause |
837468220/python-for-android | python3-alpha/python3-src/Lib/test/test_zipimport_support.py | 49 | 10085 | # This test module covers support in various parts of the standard library
# for working with modules located inside zipfiles
# The tests are centralised in this fashion to make it easy to drop them
# if a platform doesn't support zipimport
import test.support
import os
import os.path
import sys
import textwrap
import ... | apache-2.0 |
muadibbm/gini | backend/src/gloader/xml/utils/qp_xml.py | 11 | 6160 | #
# qp_xml: Quick Parsing for XML
#
# Written by Greg Stein. Public Domain.
# No Copyright, no Rights Reserved, and no Warranties.
#
# This module is maintained by Greg and is available as part of the XML-SIG
# distribution. This module and its changelog can be fetched at:
# http://www.lyra.org/cgi-bin/viewcvs.cgi/x... | mit |
SummerLW/Perf-Insight-Report | third_party/gsutil/third_party/boto/tests/unit/rds2/test_connection.py | 122 | 8806 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | bsd-3-clause |
lhfei/spark-in-action | spark-2.x/src/main/python/ml/decision_tree_classification_example.py | 1 | 3081 | #
# 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 n... | apache-2.0 |
ojengwa/oh-mainline | vendor/packages/django-debug-toolbar/debug_toolbar/panels/sql/forms.py | 36 | 2784 | from __future__ import absolute_import, unicode_literals
import json
import hashlib
from django import forms
from django.conf import settings
from django.db import connections
from django.utils.encoding import force_text
from django.utils.functional import cached_property
from django.core.exceptions import Validation... | agpl-3.0 |
acshi/osf.io | framework/forms/__init__.py | 30 | 2602 | import framework.status as status
from wtforms import fields, Form, PasswordField, BooleanField, IntegerField, \
DateField, DateTimeField, FileField, HiddenField, RadioField, SelectField, \
SelectMultipleField, SubmitField, TextAreaField, TextField, FieldList, \
validators
from wtforms.widgets import TextI... | apache-2.0 |
Reflexe/doc_to_pdf | Windows/program/python-core-3.5.0/lib/distutils/command/install.py | 12 | 26536 | """distutils.command.install
Implements the Distutils 'install' command."""
import sys
import os
from distutils import log
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.sysconfig import get_config_vars
from distutils.errors import DistutilsPlatformError
from distutils.file_util ... | mpl-2.0 |
ATIX-AG/ansible | lib/ansible/modules/database/proxysql/proxysql_manage_config.py | 42 | 7847 | #!/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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: proxysql_manage_config
ver... | gpl-3.0 |
conejoninja/pelisalacarta | python/version-xbmc-09-plugin/core/ClientCookie/_HeadersUtil.py | 17 | 7549 | """Utility functions for HTTP header value parsing and construction.
Copyright 1997-1998, Gisle Aas
Copyright 2002-2004, John J. Lee
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD License (see the file COPYING included with the
distribution).
"""
import re, string
fr... | gpl-3.0 |
highco-groupe/odoo | addons/board/controllers.py | 348 | 1970 | # -*- coding: utf-8 -*-
from xml.etree import ElementTree
from openerp.addons.web.controllers.main import load_actions_from_ir_values
from openerp.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, menu_id, act... | agpl-3.0 |
samfoo/servo | tests/wpt/harness/wptrunner/testrunner.py | 34 | 24904 | # 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 __future__ import unicode_literals
import multiprocessing
import sys
import threading
import traceback
from Queue ... | mpl-2.0 |
labordoc/labordoc-next | modules/bibformat/lib/elements/bfe_ILO_rdifp1_publishedin.py | 1 | 2257 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 ve... | gpl-2.0 |
prometheanfire/cloud-init | cloudinit/sources/helpers/vmware/imc/config_nic.py | 3 | 7818 | # vi: ts=4 expandtab
#
# Copyright (C) 2015 Canonical Ltd.
# Copyright (C) 2016 VMware INC.
#
# Author: Sankar Tanguturi <stanguturi@vmware.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by ... | gpl-3.0 |
arborh/tensorflow | tensorflow/python/training/server_lib.py | 4 | 17877 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
cloud9ers/gurumate | environment/share/doc/ipython/examples/parallel/customresults.py | 6 | 1857 | """An example for handling results in a way that AsyncMapResult doesn't provide
Specifically, out-of-order results with some special handing of metadata.
This just submits a bunch of jobs, waits on the results, and prints the stdout
and results of each as they finish.
Authors
-------
* MinRK
"""
import time
import r... | lgpl-3.0 |
opoplawski/ansible-modules-extras | messaging/rabbitmq_exchange.py | 74 | 7154 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@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... | gpl-3.0 |
HLFH/CouchPotatoServer | libs/tmdb3/tmdb_exceptions.py | 35 | 2306 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: tmdb_exceptions.py Common exceptions used in tmdbv3 API library
# Python Library
# Author: Raymond Wagner
#-----------------------
class TMDBError(Exception):
Error = 0
KeyError = 10
KeyMissing = 20
KeyInvalid = 30
K... | gpl-3.0 |
cjrd/TMA | lib/endless_pagination/settings.py | 5 | 1807 | from django.conf import settings
# How many objects are normally displayed in a page
# (overwriteable by templatetag)
PER_PAGE = getattr(settings, "ENDLESS_PAGINATION_PER_PAGE", 10)
# The querystring key of the page number.
PAGE_LABEL = getattr(settings, "ENDLESS_PAGINATION_PAGE_LABEL", "page")
# See django *Paginato... | gpl-3.0 |
arch1tect0r/root | tutorials/pyroot/benchmarks.py | 10 | 1702 | import os, sys
import ROOT
ROOT.SetSignalPolicy( ROOT.kSignalFast )
### macro files
macros = [
'framework.py', 'hsimple.py', 'hsum.py', 'formula1.py',
'fillrandom.py','fit1.py', 'h1draw.py', 'graph.py',
'gerrors.py', 'tornado.py', 'surfaces.py', 'zdemo.py',
'geometry.py', 'na49view.py', 'file.py',
'ntu... | lgpl-2.1 |
pcabido/socorro | socorro/external/happybase/crashstorage.py | 10 | 8734 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import json
import os
from socorro.external.happybase.connection_context import \
HappyBaseConnecti... | mpl-2.0 |
uahic/nest-simulator | topology/testsuite/mpitests/speed.py | 13 | 2447 | # -*- coding: utf-8 -*-
#
# speed.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | gpl-2.0 |
katajakasa/utuputki2-client | utuclient/controller.py | 1 | 7359 | # -*- coding: utf-8 -*-
from gi.repository import GLib as glib
import logging
import os
from window import Window
from player import Player
from protocol import Protocol
log = logging.getLogger(__name__)
class Controller(object):
def __init__(self, url, token, fullscreen):
self.proto = Protocol(url, tok... | mit |
warjiang/dpkt | dpkt/snoop.py | 22 | 2963 | # $Id$
"""Snoop file format."""
import sys, time
import dpkt
# RFC 1761
SNOOP_MAGIC = 0x736E6F6F70000000L
SNOOP_VERSION = 2
SDL_8023 = 0
SDL_8024 = 1
SDL_8025 = 2
SDL_8026 = 3
SDL_ETHER = 4
SDL_HDLC = 5
SDL_CHSYNC = 6
SDL_IBMCC = 7
SDL_FDDI = 8
SDL_OTHER = 9
dltoff = { SDL_ETHER:14 }
class PktHd... | bsd-3-clause |
yinchunlong/abelkhan-1 | ext/c++/thirdpart/c++/boost/tools/build/test/preprocessor.py | 58 | 1070 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test the C/C++ preprocessor.
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.... | mit |
chinmaygarde/mojo | sky/tools/webkitpy/layout_tests/print_layout_test_times.py | 44 | 5791 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
kustodian/ansible | lib/ansible/modules/network/avi/avi_useraccountprofile.py | 28 | 4834 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
FuzzyHobbit/scrapy | tests/test_command_shell.py | 135 | 1898 | from twisted.trial import unittest
from twisted.internet import defer
from scrapy.utils.testsite import SiteTest
from scrapy.utils.testproc import ProcessTest
class ShellTest(ProcessTest, SiteTest, unittest.TestCase):
command = 'shell'
@defer.inlineCallbacks
def test_empty(self):
_, out, _ = yi... | bsd-3-clause |
litchfield/django | django/contrib/gis/db/backends/spatialite/base.py | 445 | 3615 | import sys
from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import (
Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper,
)
from django.utils import six
from .client import SpatiaL... | bsd-3-clause |
mph-/lcapy | lcapy/units.py | 1 | 3505 | """This module provides the Units class for simplification of units.
It should be rolled into SymPy. It can perform simplification of
units, e.g., volts / amperes -> ohms.
Copyright 2020--2021 Michael Hayes, UCECE
"""
import sympy.physics.units as u
from sympy.physics.units.systems.si import dimsys_SI
from sympy.ph... | lgpl-2.1 |
sonnerm/games | games/player.py | 1 | 1894 | __author__ = 'michael'
import threading
class Player():
def __init__(self, game_type, ruleset, name):
self.game_type = game_type
self.ruleset = ruleset
self.name = name
def info(self, infoview):
pass
def move(self, moveview):
pass
def reset(self):
pass... | agpl-3.0 |
pszemus/grpc | src/python/grpcio/grpc/framework/foundation/stream.py | 48 | 1389 | # Copyright 2015 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 |
Jorge-Rodriguez/ansible | lib/ansible/utils/path.py | 95 | 3613 | # (c) 2012-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) an... | gpl-3.0 |
sunzuolei/youtube-dl | youtube_dl/extractor/scivee.py | 150 | 1894 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class SciVeeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?scivee\.tv/node/(?P<id>\d+)'
_TEST = {
'url': 'http://www.scivee.tv/node/62352',
'md5': 'b16699b74c9e6a120f677... | unlicense |
lukeroge/CloudBot | plugins/ping.py | 26 | 1720 | """
ping.py
Generates fun names using the textgen module.
Created By:
- Bjorn Neergaard <https://github.com/neersighted>
Modified By:
- Luke Rogers <https://github.com/lukeroge>
License:
GPL v3
"""
import subprocess
import re
import os
from cloudbot import hook
unix_ping_regex = re.compile(r"(\d+.\d+... | gpl-3.0 |
harisibrahimkv/django | django/contrib/postgres/aggregates/statistics.py | 17 | 1708 | from django.db.models import FloatField, IntegerField
from django.db.models.aggregates import Aggregate
__all__ = [
'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept',
'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate',
]
class StatAggregate(Aggregate):
def __in... | bsd-3-clause |
buffer/thug | tests/functional/test_misc_ie70.py | 1 | 33745 | import os
import logging
from thug.ThugAPI.ThugAPI import ThugAPI
log = logging.getLogger("Thug")
class TestMiscSamplesIE(object):
cwd_path = os.path.dirname(os.path.realpath(__file__))
misc_path = os.path.join(cwd_path, os.pardir, "samples/misc")
def do_perform_test(self, caplog, sample, expected):
... | gpl-2.0 |
Antiun/bank-statement-reconcile | account_easy_reconcile/tests/test_onchange_company.py | 7 | 2514 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Damien Crier
# Copyright 2015 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
# publis... | agpl-3.0 |
rtindru/django | tests/inspectdb/tests.py | 89 | 12808 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from unittest import skipUnless
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.utils.six import PY3, StringIO
from .models import ColumnTypes... | bsd-3-clause |
TheAlgorithms/Python | project_euler/problem_006/sol1.py | 1 | 1073 | """
Project Euler Problem 6: https://projecteuler.net/problem=6
Sum square difference
The sum of the squares of the first ten natural numbers is,
1^2 + 2^2 + ... + 10^2 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)^2 = 55^2 = 3025
Hence the difference between the sum of... | mit |
shawnsi/ansible-modules-extras | network/f5/bigip_node.py | 77 | 13267 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Matt Hite <mhite@hotmail.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... | gpl-3.0 |
Phuehvk/gyp | test/product/gyptest-product.py | 53 | 1512 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simplest-possible build of a "Hello, world!" program
using the default build target.
"""
import TestGyp
test = TestGyp.TestGy... | bsd-3-clause |
anbangr/trusted-nova | nova/db/sqlalchemy/migrate_repo/versions/078_add_rpc_info_to_zones.py | 5 | 1502 | # Copyright 2012 OpenStack LLC.
#
# 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 agr... | apache-2.0 |
msultan/msmbuilder | setup.py | 3 | 7479 | """MSMBuilder: Statistical models for Biomolecular Dynamics
"""
from __future__ import print_function, absolute_import
DOCLINES = __doc__.split("\n")
import sys
import traceback
import numpy as np
from os.path import join as pjoin
from setuptools import setup, Extension, find_packages
try:
sys.dont_write_byteco... | lgpl-2.1 |
mwrightevent38/MissionPlanner | Lib/site-packages/numpy/numarray/functions.py | 93 | 16189 | # missing Numarray defined names (in from numarray import *)
##__all__ = ['ClassicUnpickler', 'Complex32_fromtype',
## 'Complex64_fromtype', 'ComplexArray', 'Error',
## 'MAX_ALIGN', 'MAX_INT_SIZE', 'MAX_LINE_WIDTH',
## 'NDArray', 'NewArray', 'NumArray',
## 'NumError', 'PRECISION'... | gpl-3.0 |
CptDemocracy/Python | Puzzles/checkio/Scientific-Expedition/Morse-Clock/mySolution.py | 1 | 1531 | ON = '-'
OFF = '.'
ON_BIT = '1'
OFF_BIT = '0'
SEPARATOR = ':'
def dec_to_bin(num):
bits = []
while True:
bits.append(str(num % 2))
num //= 2
if num == 0:
break
bits.reverse()
return "".join(bits)
def checkio(timestring):
hh, mm, ss = timest... | mit |
rocky/python3-trepan | celery/ctrepan.py | 1 | 3222 | # -*- coding: utf-8 -*-
"""
celery.contrib.trepan
=====================
Remote debugger for Celery tasks running in multiprocessing pool workers.
Inspired by celery.contrib.rdb
**Usage**
.. code-block:: python
from celery.contrib import trepan
from celery import task
@task()
def add(x, y):
... | gpl-3.0 |
csail-csg/connectal | scripts/check-timing.py | 3 | 1091 | #!/usr/bin/python
import sys, re
failed = 0
for timingreport in sys.argv[1:]:
print_lines = 0
for line in open(timingreport):
re_no_clock = re.compile('\s*There are (\d+) register/latch pins with no clock(.*)')
re_constant_clock = re.compile('\s*There are (\d+) .*constant_clock(.*)')
r... | mit |
bally12345/enigma2 | lib/python/Tools/Transponder.py | 12 | 8658 | from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParametersCable, eDVBFrontendParametersTerrestrial
from Components.NimManager import nimmanager
def ConvertToHumanReadable(tp, type = None):
ret = { }
if type is None:
type = tp.get("tuner_type", "None")
if type == "DVB-S":
ret["tuner_type"] = _("S... | gpl-2.0 |
joestump/lightblue-0.4 | src/series60/_lightbluecommon.py | 179 | 10831 | # Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
pigeonflight/strider-plone | docker/appengine/lib/webob-1.2.3/webob/cachecontrol.py | 21 | 6606 | """
Represents the Cache-Control header
"""
import re
class UpdateDict(dict):
"""
Dict that has a callback on all updates
"""
# these are declared as class attributes so that
# we don't need to override constructor just to
# set some defaults
updated = None
updated_args = None
def ... | mit |
henrytao-me/openerp.positionq | openerp/addons/account/wizard/account_financial_report.py | 43 | 5574 | # -*- 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 |
cloudera/hue | desktop/core/ext-py/boto-2.46.1/tests/integration/cloudtrail/test_cloudtrail.py | 114 | 3057 | import boto
from time import time
from tests.compat import unittest
DEFAULT_S3_POLICY = """{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AWSCloudTrailAclCheck20131101",
"Effect": "Allow",
"Principal": {
"AWS": [
... | apache-2.0 |
snowch/spark-cloudant | test/test-scripts/cloudantapp/SpecCharValuePredicate.py | 1 | 2387 | #*******************************************************************************
# Copyright (c) 2015 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/li... | apache-2.0 |
tillahoffmann/tensorflow | tensorflow/python/kernel_tests/where_op_test.py | 26 | 4575 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ddd332/presto | presto-docs/target/sphinx/reportlab/graphics/widgets/signsandsymbols.py | 14 | 30283 | #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/graphics/widgets/signsandsymbols.py
# signsandsymbols.py
# A collection of new widgets
# author: John Precedo (johnp@reportlab.com)
__version__=''' $I... | apache-2.0 |
casselineau/Tracer | tracer/surface.py | 1 | 7040 | # Define some basic surfaces for use with the ray tracer. From this minimal
# hierarchy other surfaces should be derived to implement actual geometric
# operations.
#
# References:
# [1] John J. Craig, Introduction to Robotics, 3rd ed., 2005.
import numpy as N
from has_frame import HasFrame
class Surface(HasFrame)... | gpl-3.0 |
bronxbico/videobronx | commonresolvers.py | 1 | 32987 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2014 lambda
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 opt... | gpl-2.0 |
LeZhang2016/openthread | tests/scripts/thread-cert/Cert_9_2_04_ActiveDataset.py | 3 | 8140 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
vovagalchenko/onsite-inflight | scripts/compile_js_and_css.py | 1 | 4514 | import httplib, urllib, sys, subprocess
from os import remove, listdir, path, makedirs
import os
import hashlib
from shutil import copyfile
from bs4 import BeautifulSoup
from lib.conf import CFG
from re import sub, compile, I
def hash_file(filepath):
sha1 = hashlib.sha1()
f = open(filepath, 'rb')
try:
... | mit |
firebitsbr/infernal-twin | build/pip/pip/_vendor/requests/packages/chardet/__init__.py | 1778 | 1295 | ######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | gpl-3.0 |
ralphlange/procServ | procServUtils/test/test_generator.py | 1 | 1026 |
import os
import unittest
from .. import generator
from . import TestDir
class TestGen(unittest.TestCase):
def test_system(self):
with TestDir() as t:
confname = t.dir+'/procServ.d/blah.conf'
with open(confname, 'w') as F:
F.write("""
[blah]
command = /bin/sh -c bl... | gpl-3.0 |
lijianest/microblog_flasklearn | app/translate.py | 4 | 2454 | try:
import httplib # Python 2
except ImportError:
import http.client as httplib # Python 3
try:
from urllib import urlencode # Python 2
except ImportError:
from urllib.parse import urlencode # Python 3
import json
from app import app
from flask_babel import gettext
from config import MS_TRANSLATOR_... | bsd-3-clause |
chris-wood/SCoNet | ns-3-dev/src/ccnSIM/PyNDN/KeyLocator.py | 1 | 1038 | ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2011-2013, Regents of the University of California
# Alexander Afanasyev
#
# GNU 3.0 license, See the LICENSE file for more information
#
# Author: Alexander Afanasyev <alexander.afanasyev@u... | gpl-2.0 |
Spleen64/Sick-Beard | lib/tidysub/cleaner.py | 9 | 26918 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import re
from datetime import timedelta
from datetime import datetime
from regex import strings
from sickbeard import logger
#Definition of the TidySub class
class TidySub:
"""Load the subtitle, the file containing regex for removal
and perform the ... | gpl-3.0 |
sestrella/ansible | lib/ansible/modules/network/cloudengine/ce_interface_ospf.py | 5 | 31033 | #!/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 |
mayapurmedia/tovp | tovp/contributions/migrations/0003_auto_20150131_2034.py | 2 | 1121 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contributions', '0002_auto_20150131_2027'),
]
operations = [
migrations.AddField(
model_name='contribution',
... | mit |
SurfasJones/icecream-info | icecream/lib/python2.7/site-packages/jinja2/compiler.py | 623 | 61785 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from copy import deepcopy
from keyword import iskeyword as is_python_keyword
from jinja2... | mit |
csutherl/sos | sos/plugins/anaconda.py | 4 | 1702 | # 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 version.
# This program is distributed in the hope that it will be useful,
# but... | gpl-2.0 |
petspats/pyhacores | under_construction/clock_recovery/simple_gardner/gardner.py | 1 | 2872 | from pyha.common.hwsim import HW
from pyha.common.sfix import Sfix, fixed_truncate, fixed_wrap
from pyhacores.moving_average.model import MovingAverage
class SimpleGardnerTimingRecovery(HW):
def __init__(self, sps):
# sps must be divisible by 2 -> required by gardner
assert not (sps & 1)
... | apache-2.0 |
bzhpwr/MediExports | project_env/lib/python2.6/site-packages/setuptools/depends.py | 462 | 6370 | import sys
import imp
import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
from setuptools import compat
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or inst... | gpl-2.0 |
vedujoshi/tempest | tempest/lib/services/identity/v2/roles_client.py | 2 | 4575 | # 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 |
funkyeah/tiddlyweb | test/test_web_util.py | 1 | 1333 | """
def utilities in tiddlyweb.web.util
"""
from tiddlyweb.web.util import tiddler_url
from tiddlyweb.model.tiddler import Tiddler
from tiddlyweb.config import config
def setup_module(module):
config['server_host'] = {'scheme': 'http',
'host': 'our_test_domain', 'port': '8001'}
module.environ = {... | bsd-3-clause |
tfroehlich82/erpnext | erpnext/accounts/doctype/account/test_account.py | 5 | 4916 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from erpnext.stock import get_warehouse_account, get_company_default_inventory_account
class TestAccount(unittest.TestCas... | gpl-3.0 |
TRESCLOUD/odoopub | addons/delivery/__init__.py | 376 | 1103 | # -*- 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 |
lyan6/genenetwork2 | wqflask/wqflask/pbkdf2.py | 4 | 4982 | # -*- coding: utf-8 -*-
"""
pbkdf2
~~~~~~
This module implements pbkdf2 for Python. It also has some basic
tests that ensure that it works. The implementation is straightforward
and uses stdlib only stuff and can be easily be copy/pasted into
your favourite application.
Use this as repla... | agpl-3.0 |
Alexey-T/CudaText | app/py/sys/urllib3/_collections.py | 27 | 10811 | from __future__ import absolute_import
try:
from collections.abc import Mapping, MutableMapping
except ImportError:
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
... | mpl-2.0 |
bazz-erp/erpnext | erpnext/patches/v4_2/repost_stock_reconciliation.py | 119 | 1106 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import json
def execute():
existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock")
frappe.d... | gpl-3.0 |
Belxjander/Kirito | Python-3.5.0-main/Lib/doctest.py | 6 | 104005 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
r"""Module doctest -- a framework for running examples in docstrings.
In... | gpl-3.0 |
mohammed-alfatih/servo | tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker.py | 146 | 1953 | import time
def main(request, response):
# Set mode to 'init' for initial fetch.
mode = 'init'
if 'mode' in request.cookies:
mode = request.cookies['mode'].value
# no-cache itself to ensure the user agent finds a new version for each update.
headers = [('Cache-Control', 'no-cache, must-rev... | mpl-2.0 |
h3llrais3r/Auto-Subliminal | lib/jsonpickle/util.py | 1 | 13342 | # Copyright (C) 2008 John Paulett (john -at- paulett.org)
# Copyright (C) 2009-2018 David Aguilar (davvid -at- gmail.com)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Helper functions for pickling and unpickling... | gpl-3.0 |
gmalmquist/pants | src/python/pants/backend/python/register.py | 5 | 2162 | # coding=utf-8
# Copyright 2014 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)
from pants.backend.p... | apache-2.0 |
painless-software/painless-continuous-delivery | tests/unit/test_monitoring.py | 1 | 9094 | """
Tests for correctly generated monitoring configurations.
"""
from os import system
from .helpers import ( # noqa, pylint: disable=unused-import
dedent,
pytest_generate_tests,
verify_required_settings,
)
# pylint: disable=too-few-public-methods
class TestMonitoring:
"""
Tests for verifying mo... | apache-2.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/numpy/core/tests/test_item_selection.py | 35 | 3585 | from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_raises,
assert_array_equal
)
class TestTake(TestCase):
def test_simple(self):
a = [[1, 2], [3, 4]]
a_str = [[b'1', b'2'],... | mit |
bobobox/ansible | lib/ansible/modules/system/selinux_permissive.py | 48 | 4345 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Michael Scherer <misc@zarb.org>
# inspired by code of github.com/dandiker/
#
# 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 Softwar... | gpl-3.0 |
berny6969/enigma2 | lib/python/Components/ServiceEventTracker.py | 124 | 4175 | InfoBarCount = 0
class InfoBarBase:
onInfoBarOpened = [ ]
onInfoBarClosed = [ ]
@staticmethod
def connectInfoBarOpened(fnc):
if not fnc in InfoBarBase.onInfoBarOpened:
InfoBarBase.onInfoBarOpened.append(fnc)
@staticmethod
def disconnectInfoBarOpened(fnc):
if fnc in InfoBarBase.onInfoBarOpened:
InfoB... | gpl-2.0 |
andrewsmedina/django | tests/m2m_intermediary/models.py | 114 | 1262 | """
9. Many-to-many relationships via an intermediary table
For many-to-many relationships that need extra fields on the intermediary
table, use an intermediary model.
In this example, an ``Article`` can have multiple ``Reporter`` objects, and
each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position`... | bsd-3-clause |
Fafou/Sick-Beard | lib/hachoir_core/field/field.py | 90 | 8588 | """
Parent of all (field) classes in Hachoir: Field.
"""
from lib.hachoir_core.compatibility import reversed
from lib.hachoir_core.stream import InputFieldStream
from lib.hachoir_core.error import HachoirError, HACHOIR_ERRORS
from lib.hachoir_core.log import Logger
from lib.hachoir_core.i18n import _
from lib.hachoir_... | gpl-3.0 |
box/box-python-sdk | boxsdk/object/metadata.py | 1 | 7787 | # coding: utf-8
from __future__ import unicode_literals, absolute_import
import json
from boxsdk.object.base_endpoint import BaseEndpoint
from boxsdk.exception import BoxAPIException
from ..util.api_call_decorator import api_call
class MetadataUpdate(object):
"""
Helper class for updating Box metadata.
S... | apache-2.0 |
n2o/guhema | products/views.py | 1 | 3287 | from django.shortcuts import get_list_or_404, render
from .models import (BandSawBlade, BandSawBladeIndicator, CircularSawBlade,
CircularSawBladeIndicator, HackSawBlade, HoleSaw,
HoleSawDiameter, JigSawBlade, ProductGroup, SableSawBlade,
SawBlade)
def in... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.