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 |
|---|---|---|---|---|---|
xxsergzzxx/python-for-android | python3-alpha/python3-src/Lib/test/test_epoll.py | 49 | 7488 | # Copyright (c) 2001-2006 Twisted Matrix Laboratories.
#
# 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, m... | apache-2.0 |
RaoUmer/django | tests/modeltests/custom_columns/tests.py | 54 | 2318 | from __future__ import absolute_import
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import Author, Article
class CustomColumnsTests(TestCase):
def test_db_column(self):
a1 = Author.objects.create(first_name="John", last_name="Sm... | bsd-3-clause |
theflofly/tensorflow | tensorflow/python/keras/preprocessing/sequence_test.py | 9 | 9816 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
welchbj/tt | tt/tests/unit/expressions/test_bexpr_sat_all.py | 1 | 4209 | """Tests for expression sat_all functionality."""
from tt.errors import NoEvaluationVariationError
from tt.expressions import BooleanExpression as be
from ._helpers import ExpressionTestCase
class TestExpressionSatAll(ExpressionTestCase):
def test_only_constants_exprs_cause_exception(self):
"""Test tha... | mit |
willingc/oh-mainline | vendor/packages/Django/django/contrib/localflavor/si/si_postalcodes.py | 110 | 13147 | # *-* coding: utf-8 *-*
from __future__ import unicode_literals
SI_POSTALCODES = [
(1000, 'Ljubljana'),
(1215, 'Medvode'),
(1216, 'Smlednik'),
(1217, 'Vodice'),
(1218, 'Komenda'),
(1219, 'Laze v Tuhinju'),
(1221, 'Motnik'),
(1222, 'Trojane'),
(1223, 'Blagovica'),
(1225, 'Lukovic... | agpl-3.0 |
blaggacao/odoo | addons/auth_openid/__init__.py | 443 | 1090 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
sparrow242/demandfs | demandfs/demandfs.py | 1 | 13810 | #!/usr/bin/env python
"""
demandfs.py - mount and umount sources on demand
Copyright (C) 2013 Sebastian Meyer <s.meyer@drachenjaeger.eu>
Based upon the the xmp.py-FS Example in the fuse-python distribtion:
Copyright (C) 2001 Jeff Epler <jepler@unpythonic.dhs.org>
Copyright (C) 2006 Csaba Henk <csa... | gpl-3.0 |
repotvsupertuga/tvsupertuga.repository | script.vodextende/scrapers/losmovies_scraper.py | 6 | 3982 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | gpl-2.0 |
arista-eosplus/ansible | lib/ansible/modules/cloud/atomic/atomic_container.py | 42 | 7190 | #!/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 |
40223208/CDB-Final- | static/Brython3.1.1-20150328-091302/Lib/unittest/signals.py | 1016 | 2403 | import signal
import weakref
from functools import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.original_handler = default_handler
if isinstance(default_handler, int):
if default_handler == signal.SIG_D... | gpl-3.0 |
cc272309126/panda3d | direct/src/p3d/JavaScript.py | 8 | 12034 | """ This module defines some simple classes and instances which are
useful when writing code that integrates with JavaScript, especially
code that runs in a browser via the web plugin. """
__all__ = ["UndefinedObject", "Undefined", "ConcreteStruct", "BrowserObject", "MethodWrapper"]
import types
class UndefinedObjec... | bsd-3-clause |
elssar/calibre | src/calibre/srv/bonjour.py | 13 | 1869 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
from threading import Event
class BonJour(object): # {{{
def __init__... | gpl-3.0 |
valdecdev/odoo | addons/fleet/__openerp__.py | 2 | 1366 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'Fleet Management',
'version' : '0.1',
'author' : 'OpenERP S.A.',
'sequence': 110,
'category': 'Managing vehicles and contracts',
'website' : 'https://www.odoo.com/page/fleet',
'summ... | agpl-3.0 |
CodyKochmann/sync_lab | simple_notepad_server/simplejson/tests/test_encode_basestring_ascii.py | 147 | 2337 | from unittest import TestCase
import simplejson.encoder
from simplejson.compat import b
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\... | mit |
js0701/chromium-crosswalk | tools/telemetry/telemetry/benchmark.py | 9 | 7804 | # 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 optparse
from telemetry import decorators
from telemetry.internal import story_runner
from telemetry.internal.util import command_line
from telemetry... | bsd-3-clause |
googleapis/googleapis-gen | google/cloud/dialogflow/cx/v3beta1/dialogflow-cx-v3beta1-py/google/cloud/dialogflowcx_v3beta1/types/fulfillment.py | 1 | 7242 | # -*- coding: utf-8 -*-
# Copyright 2020 Google 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... | apache-2.0 |
thatneat/dotfiles | other_applications/sublime-text-3/Packages/Anaconda/anaconda_server/commands/lint.py | 9 | 1192 |
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import logging
import traceback
from .base import Command
class Lint(Command):
"""Run PyFlakes and Pep8 linters and return back results
"""
def __init__(self, callback, uid, v... | mit |
umitproject/site-status | django/conf/locale/ru/formats.py | 232 | 1323 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y г.'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j E Y г. G:i:s'
YEAR_M... | agpl-3.0 |
hargup/sympy | sympy/crypto/crypto.py | 17 | 56885 | # -*- coding: utf-8 -*-
"""
This file contains some classical ciphers and routines
implementing a linear-feedback shift register (LFSR)
and the Diffie-Hellman key exchange.
"""
from __future__ import print_function
from string import whitespace, ascii_uppercase as uppercase, printable
from sympy import nextprime
fr... | bsd-3-clause |
nlholdem/icodoom | .venv/lib/python2.7/site-packages/tensorflow/contrib/tensor_forest/python/kernel_tests/count_extremely_random_stats_op_test.py | 22 | 14818 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | gpl-3.0 |
darafferty/factor | factor/lib/operation.py | 1 | 16793 | """
General operation library
Contains the master class for all operations
"""
import os
import logging
import socket
import subprocess
import numpy as np
import sys
import uuid
from factor import _logging
from jinja2 import Environment, FileSystemLoader
from lofarpipe.support.utilities import create_directory
DIR = ... | gpl-2.0 |
appleseedhq/blenderseed | render/__init__.py | 2 | 17548 | #
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2014-2019 The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this s... | mit |
thurt/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/lib/win32pdhquery.py | 21 | 20312 | '''
Performance Data Helper (PDH) Query Classes
Wrapper classes for end-users and high-level access to the PDH query
mechanisms. PDH is a win32-specific mechanism for accessing the
performance data made available by the system. The Python for Windows
PDH module does not implement the "Registry" interface, implementi... | apache-2.0 |
Zhongqilong/mykbengineer | kbe/src/lib/python/Tools/pynche/pyColorChooser.py | 116 | 3759 | """Color chooser implementing (almost) the tkColorColor interface
"""
import os
import Main
import ColorDB
class Chooser:
"""Ask for a color"""
def __init__(self,
master = None,
databasefile = None,
initfile = None,
ignore = None,
... | lgpl-3.0 |
gonboy/sl4a | python/src/Tools/bgen/bgen/bgenType.py | 44 | 9507 | """Type classes and a modest collection of standard types."""
from bgenOutput import *
class Type:
"""Define the various things you can do with a C type.
Most methods are intended to be extended or overridden.
"""
def __init__(self, typeName, fmt):
"""Call with the C name and getargs form... | apache-2.0 |
shakamunyi/beam | sdks/python/apache_beam/io/source_test_utils_test.py | 9 | 4858 | #
# 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 |
HyperBaton/ansible | lib/ansible/plugins/doc_fragments/azure.py | 24 | 5373 | # -*- coding: utf-8 -*-
# Copyright: (c) 2016 Matt Davis, <mdavis@ansible.com>
# Copyright: (c) 2016 Chris Houseknecht, <house@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Azure doc fragment
DOCUMENTATION = r'''
... | gpl-3.0 |
Asilva4700/Aljos | Aljos/node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # 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.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | gpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/boto/mws/connection.py | 135 | 49808 | # Copyright (c) 2012-2014 Andy Davidoff http://www.disruptek.com/
#
# 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... | apache-2.0 |
Komodo/dbexplorer_pgsql | platform/WINNT_x86-msvc/pylib27/psycopg2/tests/__init__.py | 5 | 2534 | #!/usr/bin/env python
import os
import sys
from testutils import unittest
dbname = os.environ.get('PSYCOPG2_TESTDB', 'psycopg2_test')
dbhost = os.environ.get('PSYCOPG2_TESTDB_HOST', None)
dbport = os.environ.get('PSYCOPG2_TESTDB_PORT', None)
dbuser = os.environ.get('PSYCOPG2_TESTDB_USER', None)
# Check if we want to... | mpl-2.0 |
seyriz/taiga-contrib-google-auth | back/tests/settings.py | 2 | 1370 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program 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 F... | agpl-3.0 |
Changaco/oh-mainline | vendor/packages/scrapy/scrapy/contrib/downloadermiddleware/stats.py | 19 | 1370 | from scrapy.exceptions import NotConfigured
from scrapy.utils.request import request_httprepr
from scrapy.utils.response import response_httprepr
from scrapy.stats import stats
from scrapy.conf import settings
class DownloaderStats(object):
def __init__(self):
if not settings.getbool('DOWNLOADER_STATS'):
... | agpl-3.0 |
joernhees/scikit-learn | sklearn/feature_selection/tests/test_from_model.py | 26 | 6935 | import numpy as np
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal... | bsd-3-clause |
jaspreetw/tempest | tempest/api_schema/response/compute/v2_1/floating_ips.py | 8 | 4919 | # Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
qtekfun/htcDesire820Kernel | external/chromium_org/tools/crx_id/crx_id_unittest.py | 120 | 3482 | #!/usr/bin/env python
#
# Copyright (c) 2012 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.
"""Verify that crx_id.py generates a reasonable string for a canned CRX file.
"""
import crx_id
import os
import shutil
import s... | gpl-2.0 |
sampathweb/game_app | card_games/play_blackjack.py | 1 | 1843 | #!/usr/bin/env python
from __future__ import print_function
from blackjack import BlackJack
def play_blackjack(player):
game = BlackJack()
while True:
print('Your Hand %s is of value %d' % (game.player_hand, game.player_hand_value()))
action = raw_input('Enter: hit (1), stand (2) or split (3) ... | mit |
double12gzh/nova | nova/scheduler/caching_scheduler.py | 115 | 3339 | # Copyright (c) 2014 Rackspace Hosting
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
boada/astLib | astLib/astSED.py | 2 | 55763 | """module for performing calculations on Spectral Energy Distributions (SEDs)
(c) 2007-2013 Matt Hilton
U{http://astlib.sourceforge.net}
This module provides classes for manipulating SEDs, in particular the Bruzual &
Charlot 2003, Maraston 2005, and Percival et al 2009 stellar population
synthesis models are current... | lgpl-2.1 |
bgxavier/nova | nova/tests/functional/v3/test_extended_availability_zone.py | 33 | 1318 | # Copyright 2012 Nebula, Inc.
# 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... | apache-2.0 |
Neozaru/depot_tools | testing_support/local_rietveld.py | 17 | 5479 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Setups a local Rietveld instance to test against a live server for
integration tests.
It makes sure Google AppEngine SDK is fou... | bsd-3-clause |
bertrand-l/numpy | numpy/doc/byteswapping.py | 68 | 5346 | """
=============================
Byteswapping and byte order
=============================
Introduction to byte ordering and ndarrays
==========================================
The ``ndarray`` is an object that provide a python array interface to data
in memory.
It often happens that the memory that you want to v... | bsd-3-clause |
ahmed-mahran/hue | desktop/core/ext-py/pyformance-0.3.2/pyformance/stats/samples.py | 33 | 3916 | import time
import random
import math
import heapq
from .snapshot import Snapshot
DEFAULT_SIZE = 1028
DEFAULT_ALPHA = 0.015
class ExpDecayingSample(object):
"""
An exponentially-decaying random sample of longs. Uses Cormode et al's
forward-decaying priority reservoir sampling method to produce a
sta... | apache-2.0 |
popazerty/try | lib/python/Screens/SkinSelector.py | 6 | 5289 | # -*- coding: utf-8 -*-
from Screens.Screen import Screen
from Screens.Standby import TryQuitMainloop
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Pixmap import Pixmap
from Components.Sources.StaticText import StaticText
from Components.MenuList import MenuL... | gpl-2.0 |
chakki-works/arXivTimesIndicator | main.py | 1 | 1791 | import os
from PIL import Image
from arxivtimes_indicator.data.github import filter_issue_by_ym, fetch_issues, get_icon_url, tally_by_labels, tally_by_users
from arxivtimes_indicator.data.twitter import fetch_tweets, rank_paper
from arxivtimes_indicator.data.utils import download, break_line, std_score
from arxivtime... | apache-2.0 |
wylwang/vnpy | vnpy/api/lts/vnltsqry/test/lts_data_type.py | 167 | 86932 | # encoding: UTF-8
defineDict = {}
typedefDict = {}
#//////////////////////////////////////////////////////////////////////
#@company shanghai liber information Technology Co.,Ltd
#@file SecurityFtdcUserApiDataType.h
#@brief 定义业务数据类型
#//////////////////////////////////////////////////////////////////////
#/////////... | mit |
shivam1111/odoo | addons/account_analytic_default/__openerp__.py | 264 | 1831 | # -*- 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 |
tuxfux-hlp-notes/python-batches | archieves/batch-58/modules/sheets/lib/python2.7/site-packages/pip/_vendor/html5lib/constants.py | 249 | 86469 | from __future__ import absolute_import, division, unicode_literals
import string
import gettext
_ = gettext.gettext
EOF = None
E = {
"null-character":
_("Null character in input stream, replaced with U+FFFD."),
"invalid-codepoint":
_("Invalid codepoint in stream."),
"incorrectly-placed-so... | gpl-3.0 |
B-UMMI/INNUca | src/SPAdes-3.13.0-Linux/share/spades/spades_pipeline/common/SeqIO.py | 3 | 4814 | ############################################################################
# Copyright (c) 2015 Saint Petersburg State University
# All Rights Reserved
# See file LICENSE for details.
############################################################################
import itertools
import sys
import gzip
import codecs
f... | gpl-3.0 |
Ryati/satchmo | satchmo/apps/shipping/modules/tieredweight/tests.py | 8 | 4051 | from datetime import datetime
from django.test import TestCase
from l10n.models import Country
from shipping.modules.tieredweight.models import Carrier, TieredWeightException
try:
from decimal import Decimal
except:
from django.utils._decimal import Decimal
def make_tiers(zone, prices, expires=None):
for... | bsd-3-clause |
nitin-cherian/LifeLongLearning | Python/Experiments/JINJA/RealPython/jinja_env/lib/python3.5/site-packages/werkzeug/debug/repr.py | 107 | 9340 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | mit |
arpruss/raspberryjam-pe | p2/scripts/console.py | 2 | 1184 | from __future__ import print_function
#
# WARNING: If you're running RJM on a server, do NOT include this script server-side for security reasons.
#
#
# Code by Alexander Pruss and under the MIT license
#
# This script only works on Raspberry Jam
#
import mcpi.minecraft as minecraft
import time
from math... | mit |
gganis/root | tutorials/pyroot/staff.py | 23 | 2311 | ## \file
## \ingroup tutorial_pyroot
## \notebook -nodraw
## example of macro to read data from an ascii file and
## create a root file with a Tree.
##
## NOTE: comparing the results of this macro with those of staff.C, you'll
## notice that the resultant file is a couple of bytes smaller, because the
## code below str... | lgpl-2.1 |
wkew/FTMSVisualization | 3-HeteroClassPlotter.py | 1 | 10441 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 22 11:42:36 2016
@author: Will Kew
will.kew@gmail.com
Copyright Will Kew, 2016
This file is part of FTMS Visualisation (also known as i-van Krevelen).
FTMS Visualisation is free software: you can redistribute it and/or modify
it under the terms of the G... | gpl-3.0 |
rchicoli/samba | lib/testtools/testtools/tests/test_testresult.py | 11 | 75384 | # Copyright (c) 2008-2012 testtools developers. See LICENSE for details.
"""Test TestResults and related things."""
__metaclass__ = type
import codecs
import datetime
import doctest
import os
import shutil
import sys
import tempfile
import threading
from unittest import TestSuite
import warnings
from testtools impo... | gpl-3.0 |
Parkayun/flask | flask/debughelpers.py | 1 | 6024 | # -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2016 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string, text_type
from .app import Flask
from .bl... | bsd-3-clause |
natefoo/pulsar | pulsar/managers/util/drmaa/__init__.py | 2 | 3408 | import contextlib
import logging
import threading
try:
from drmaa import Session, JobControlAction
except OSError as e:
LOAD_ERROR_MESSAGE = "OSError - problem loading shared library [%s]." % e
Session = None
except ImportError as e:
LOAD_ERROR_MESSAGE = "ImportError - problem importing library (`pip i... | apache-2.0 |
Bysmyyr/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/boto/boto/emr/step.py | 150 | 9011 | # Copyright (c) 2010 Spotify AB
# Copyright (c) 2010-2011 Yelp
#
# 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, m... | bsd-3-clause |
stpx/canto-curses | canto_curses/main.py | 1 | 9578 | # -*- coding: utf-8 -*-
#Canto-curses - ncurses RSS reader
# Copyright (C) 2014 Jack Miller <jack@codezen.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
CANTO_PROTOCO... | gpl-2.0 |
alexandrcoin/p2pooldoge-all | p2pool/bitcoin/networks/monacoin.py | 10 | 1308 | import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = 'fbc0b6db'.decode('hex') #pchmessagestart
P2P_PORT = 9401
ADDRESS_VERSION = 50 #pubkey_
RPC_PORT = 9402
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
... | gpl-3.0 |
nck0405/MyOwn | modules/s3/s3summary.py | 16 | 13021 | # -*- coding: utf-8 -*-
""" Resource Summary Pages
@copyright: 2013-15 (c) Sahana Software Foundation
@license: MIT
@requires: U{B{I{gluon}} <http://web2py.com>}
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (... | mit |
jgmanzanas/CMNT_004_15 | project-addons/sale_advance_payment/__openerp__.py | 1 | 1634 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Comunitea Servicios Tecnológicos All Rights Reserved
# $Omar Castiñeira Saaevdra <omar@comunitea.com>$
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
sandeepdsouza93/TensorFlow-15712 | tensorflow/contrib/slim/python/slim/data/test_utils.py | 26 | 3478 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
sunqb/oa_qian | flask/Lib/site-packages/pip/_vendor/distlib/wheel.py | 412 | 39115 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from... | apache-2.0 |
talishte/ctigre | env/lib/python2.7/site-packages/PIL/DcxImagePlugin.py | 26 | 1803 | #
# The Python Imaging Library.
# $Id$
#
# DCX file handling
#
# DCX is a container file format defined by Intel, commonly used
# for fax applications. Each DCX file consists of a directory
# (a list of file offsets) followed by a set of (usually 1-bit)
# PCX files.
#
# History:
# 1995-09-09 fl Created
# 1996-03-20 ... | bsd-2-clause |
mgoddard-pivotal/data-science-from-scratch | code/network_analysis.py | 59 | 7175 | from __future__ import division
import math, random, re
from collections import defaultdict, Counter, deque
from linear_algebra import dot, get_row, get_column, make_matrix, magnitude, scalar_multiply, shape, distance
from functools import partial
users = [
{ "id": 0, "name": "Hero" },
{ "id": 1, "name": "Dunn... | unlicense |
BrotherPhil/django | django/db/models/base.py | 61 | 69022 | from __future__ import unicode_literals
import copy
import inspect
import warnings
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core import checks
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned,... | bsd-3-clause |
defaultnamehere/grr | client/client_utils_test.py | 3 | 8539 | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
# Copyright 2011 Google Inc. All Rights Reserved.
"""Test client utility functions."""
import exceptions
import imp
import os
import sys
import tempfile
import time
import mox
from grr.client import client_utils_common
from grr.client import client_utils... | apache-2.0 |
voytekresearch/neurodsp | neurodsp/tests/aperiodic/test_irasa.py | 1 | 1456 | """Tests for IRASA functions."""
import numpy as np
from neurodsp.tests.settings import FS, N_SECONDS_LONG, EXP1
from neurodsp.sim import sim_combined
from neurodsp.spectral import compute_spectrum, trim_spectrum
from neurodsp.aperiodic.irasa import *
###############################################################... | mit |
tkrajina/cartesius | cartesius/colors.py | 1 | 1051 | # -*- coding: utf-8 -*-
""" Utility functions folr colors """
def get_color(color):
""" Can convert from integer to (r, g, b) """
if not color:
return None
if isinstance(color, int):
temp = color
blue = temp % 256
temp = int(temp / 256)
green = temp % 256
... | apache-2.0 |
gohin/django | tests/proxy_models/tests.py | 260 | 16941 | from __future__ import unicode_literals
import datetime
from django.apps import apps
from django.contrib import admin
from django.contrib.auth.models import User as AuthUser
from django.contrib.contenttypes.models import ContentType
from django.core import checks, exceptions, management
from django.core.urlresolvers ... | bsd-3-clause |
koson/MissionPlannerKMTI | Lib/UserString.py | 312 | 9687 | #!/usr/bin/env python
## vim:ts=4:et:nowrap
"""A user-defined wrapper around string objects
Note: string objects have grown methods in Python 1.6
This module requires Python 1.6 or later.
"""
import sys
import collections
__all__ = ["UserString","MutableString"]
class UserString(collections.Sequence):
def __init... | gpl-3.0 |
ehooo/django_mqtt | test_web/settings.py | 1 | 4373 | """
Django settings for web project.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | gpl-2.0 |
matllubos/django-reversion-log | setup.py | 1 | 1150 | from setuptools import setup, find_packages
from reversion_log.version import get_version
setup(
name='django-reversion-log',
version=get_version(),
description="Log build on revisiions.",
keywords='django, reversion',
author='Lubos Matl',
author_email='matllubos@gmail.com',
url='https://g... | lgpl-3.0 |
espadrine/opera | chromium/src/third_party/pyelftools/elftools/dwarf/dwarf_expr.py | 22 | 9864 | #-------------------------------------------------------------------------------
# elftools: dwarf/dwarf_expr.py
#
# Decoding DWARF expressions
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
from ..common.py3compa... | bsd-3-clause |
MissionCriticalCloud/cosmic | cosmic-core/systemvm/patches/centos7/opt/cosmic/startup/setup_cpvm.py | 1 | 2608 | import logging
import os
from utils import Utils
def setup_iptable_rules(cmdline):
external_rules = ""
for cidr in cmdline.get('allowedcidrs', '').split(','):
if cidr != '':
external_rules += "-A INPUT -i " + cmdline['publicnic'] + " -s " + cidr.strip() + " -p tcp -m multiport --dports 8... | apache-2.0 |
geminateCoder/Character-Archive-Website | Lib/site-packages/sqlalchemy/dialects/sqlite/pysqlcipher.py | 44 | 4129 | # sqlite/pysqlcipher.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite+pysqlcipher
:name: pysqlcipher
:dbapi: pysqlci... | cc0-1.0 |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/orca/structural_navigation.py | 1 | 153933 | # Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
#
# 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 version.
#
# This... | gpl-3.0 |
robertnishihara/ray | rllib/examples/env/ant_rand_goal.py | 2 | 2444 | import numpy as np
import gym
from gym.envs.mujoco.mujoco_env import MujocoEnv
from ray.rllib.env.meta_env import MetaEnv
class AntRandGoalEnv(gym.utils.EzPickle, MujocoEnv, MetaEnv):
"""Ant Environment that randomizes goals as tasks
Goals are randomly sampled 2D positions
"""
def __init__(self):
... | apache-2.0 |
globau/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_runner.py | 167 | 20633 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import _pytest._code
import os
import py
import pytest
import sys
from _pytest import runner, main
class TestSetupState:
def test_setup(self, testdir):
ss = runner.SetupState()
item = testdir.getitem("def test_func(): pass")
l =... | mpl-2.0 |
Fireblend/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
kaber/nf-next-ipv6-nat | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
3dfxsoftware/cbss-addons | account_aged_partner_balance_vw/wizard/__init__.py | 1 | 1312 | # -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
####################################... | gpl-2.0 |
slohse/ansible | test/integration/targets/module_precedence/multiple_roles/foo/library/ping.py | 480 | 2146 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, 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... | gpl-3.0 |
kazuoteramoto/alot | alot/ui.py | 1 | 18751 | # Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import urwid
import logging
from twisted.internet import reactor, defer
from settings import settings
from buffers import BufferlistBu... | gpl-3.0 |
ardoi/datajuicer | lsjuicer/ui/widgets/panels/eventpanel.py | 1 | 3918 | from PyQt5 import QtWidgets as QW
from PyQt5 import QtCore as QC
from lsjuicer.inout.db.sqla import SyntheticData
from lsjuicer.ui.widgets.fileinfowidget import MyFormLikeLayout
from lsjuicer.ui.widgets.clicktrees import EventClickTree, Events
from actionpanel import ActionPanel
from lsjuicer.ui.widgets.mergewidget i... | gpl-3.0 |
burzillibus/RobHome | venv/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/topology.py | 145 | 2237 | """
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
from ctypes import c_double, c_int
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_string... | mit |
Sam647254/PostmanProxy | postmanproxy/postman/Collection.py | 4 | 1334 | import utils
import uuid
import time
import json
class Collection:
"""Postman collection class"""
def __init__(self, name, path):
self.id = str(uuid.uuid4())
self.path = path
self.name = name
self.order = []
self.folders = []
self.timestamp = int(round(time.time()))
self.synced = False
self.requests... | apache-2.0 |
StefanBruens/libsigrokdecode | decoders/rtc8564/pd.py | 3 | 9292 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012-2014 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 t... | gpl-3.0 |
andrewmoses/ssquiz | flask/lib/python2.7/site-packages/whoosh/classify.py | 95 | 11727 | # Copyright 2008 Matt Chaput. 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 notice,
# this list of conditions and the... | bsd-3-clause |
gangadhar-kadam/helpdesk-frappe | frappe/core/doctype/page/page.py | 10 | 4146 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.build import html_to_js_template
from frappe import conf, _
from frappe.desk.form.meta import get_code_files_v... | mit |
gdooper/scipy | benchmarks/benchmarks/go_benchmark_functions/go_funcs_I.py | 47 | 1181 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from numpy import sin, sum
from .go_benchmark import Benchmark
class Infinity(Benchmark):
r"""
Infinity objective function.
This class defines the Infinity [1]_ global optimization problem. This
is a multimodal... | bsd-3-clause |
supriyantomaftuh/django | tests/template_tests/syntax_tests/test_include.py | 322 | 11505 | from django.template import (
Context, Engine, TemplateDoesNotExist, TemplateSyntaxError,
)
from django.test import SimpleTestCase
from ..utils import setup
from .test_basic import basic_templates
include_fail_templates = {
'include-fail1': '{% load bad_tag %}{% badtag %}',
'include-fail2': '{% load broke... | bsd-3-clause |
mytliulei/boundless | docker/dockerfile/xfdsend/Dscapy/layers/ir.py | 4 | 1390 | ## 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
from scapy.packet import *
from scapy.fields import *
from scapy.layers.l2 import CookedLinux
# IR
class IrLAPHead(Pa... | apache-2.0 |
nicholas-maltbie/Medina | AIPractice/tttTest.py | 1 | 1416 | from ttt import *
from tttGameSpec import TicTacToeGameSpec
def play_game(agent1, agent2, name1, name2):
"""Plays a game of tic tac toe with two agents and returns the winner."""
game_spec = TicTacToeGameSpec()
return game_spec.play_game(agent1, agent2)
"""board = make_board()
names = [name1, name2... | mit |
frederick-masterton/django | django/template/debug.py | 73 | 3754 | from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_text
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone import templ... | bsd-3-clause |
Bismarrck/tensorflow | tensorflow/contrib/periodic_resample/python/ops/periodic_resample_op.py | 38 | 1595 | # =============================================================================
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | apache-2.0 |
lkhomenk/integration_tests | cfme/tests/storage/test_volume_snapshot.py | 3 | 5257 | # -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.cloud.provider.openstack import OpenStackProvider
from cfme.utils.log import logger
from cfme.utils.wait import wait_for, TimedOutError
from cfme.storage.volume import VolumeDetailsView, VolumeSnapshotView
pytestmark... | gpl-2.0 |
OptimusG-Dev-Team/proj-kernel-old | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
Azure/azure-sdk-for-python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/operations/_app_service_environments_operations.py | 1 | 167660 | # 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 may ... | mit |
TheKK/Shedskin | examples/c64/sprite.py | 7 | 1556 | #!/usr/bin/env python2
# I, Danny Milosavljevic, hereby place this file into the public domain.
# public: calculate_pixbuf_data
import sys
SPRITE_COUNT = 8
#sprite = open(sys.argv[1], "rb").read()[2:]
WIDTH = 24
HEIGHT = 21
#def from_high_resolution_sprite(sprite, primary_color):
# result = []
# for cell in ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.