repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
kyuupichan/electrum | gui/qt/main_window.py | 1 | 133088 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... | mit |
yahman72/robotframework | src/robot/__init__.py | 4 | 2014 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/layers/python/layers/feature_column_ops.py | 60 | 36916 | # 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... | mit |
eharney/cinder | cinder/tests/unit/test_db_api.py | 1 | 149710 | # Copyright 2014 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 agreed ... | apache-2.0 |
QGuLL/samba | source3/stf/pythoncheck.py | 82 | 1720 | #! /usr/bin/python
# Comfychair test cases for Samba python extensions
# Copyright (C) 2003 by Tim Potter <tpot@samba.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 3 o... | gpl-3.0 |
mrrrgn/olympia | apps/users/tests/test_views.py | 12 | 50379 | import collections
import json
from urlparse import urlparse
from django.conf import settings
from django.core import mail
from django.core.cache import cache
from django.contrib.auth.tokens import default_token_generator
from django.forms.models import model_to_dict
from django.utils.http import urlsafe_base64_encode... | bsd-3-clause |
mitya57/debian-buildbot | buildbot/changes/base.py | 2 | 3499 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
lavvy/xbmc | lib/gtest/scripts/upload_gtest.py | 1963 | 2851 | #!/usr/bin/env python
#
# Copyright 2009, 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... | gpl-2.0 |
mano3m/CouchPotatoServer | libs/subliminal/subtitles.py | 136 | 5252 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 3 of... | gpl-3.0 |
noblisnsp/volatility | volatility/plugins/dumpfiles.py | 44 | 52895 | # Volatility
# Copyright (C) 2012-13 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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. You may not use, modify or
# distribute... | gpl-2.0 |
BaladiDogGames/baladidoggames.github.io | mingw/bin/lib/inspect.py | 40 | 42462 | # -*- coding: iso-8859-1 -*-
"""Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (func_*, co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the usef... | mit |
EmprendedoresLA/emprendevs-equipo-1 | api/node_modules/yamlish/yamlish-py/test/test_reader.py | 147 | 9379 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import yaml
import yamlish
import test
import unittest
test_data_list = [
{
"name": 'Hello World',
"in": [ '--- Hello, World', '...', ],
"out": "Hello, World",
},
{
"name": 'Hello World 2',
"in": ... | mit |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/tensorflow/core/protobuf/tensorflow_server_pb2.py | 6 | 8845 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/protobuf/tensorflow_server.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 _message
from google.p... | apache-2.0 |
flavour/porto | modules/savage/graph/axes.py | 24 | 3672 | from ..utils.struct import Vector as V
from ..graphics.group import Group
from ..graphics.shapes import Text
from copy import deepcopy
class Axis (Group):
def __init__ (self, **attr):
Group.__init__ (self, **attr)
self.ticks = []
self.labels = []
self.incr = None
if attr.ha... | mit |
hergin/DelTa | mt/ptcal/pytcore/util/infinity.py | 1 | 3006 | # -*- coding: Latin-1 -*-
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ##
# infinity.py
# --------------------------------
# Copyright (c) 2005
# Jean-Sébastien BOLDUC
# Hans Vangheluwe... | gpl-3.0 |
eb0t/jac | contrib/spendfrom/spendfrom.py | 792 | 10053 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | mit |
fta2012/three.js | utils/converters/obj/split_obj.py | 369 | 12687 | """Split single OBJ model into mutliple OBJ files by materials
-------------------------------------
How to use
-------------------------------------
python split_obj.py -i infile.obj -o outfile
Will generate:
outfile_000.obj
outfile_001.obj
...
outfile_XXX.obj
-------------------------------------
Parser based ... | mit |
pdellaert/ansible | test/units/modules/network/fortios/test_fortios_dlp_sensor.py | 21 | 10503 | # Copyright 2019 Fortinet, Inc.
#
# 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.
#
# This program is distributed in the... | gpl-3.0 |
pengli09/Paddle | python/paddle/trainer_config_helpers/tests/configs/test_cost_layers.py | 4 | 1402 | from paddle.trainer_config_helpers import *
settings(learning_rate=1e-4, batch_size=1000)
seq_in = data_layer(name='input', size=200)
labels = data_layer(name='labels', size=5000)
probs = data_layer(name='probs', size=10)
xe_label = data_layer(name='xe-label', size=10)
hidden = fc_layer(input=seq_in, size=4)
output... | apache-2.0 |
clbarnes/bctpy | test/load_samples.py | 2 | 2646 | import numpy as np
import bct
import os
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
MAT_DIR = os.path.join(TEST_DIR, 'mats')
def mat_path(fname):
return os.path.join(MAT_DIR, fname)
def load_sample(thres=1.):
return bct.threshold_proportional(np.load(mat_path('sample_data.npy')),
... | gpl-3.0 |
titom1986/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/southparkstudios.py | 27 | 1372 | from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
class SouthParkStudiosIE(MTVServicesInfoExtractor):
IE_NAME = 'southparkstudios.com'
_VALID_URL = r'https?://(www\.)?(?P<url>southparkstudios\.com/(clips|full-episodes)/(?P<id>.+?)(\?|#|$))'
_FEED_URL = 'http://www.southpa... | gpl-3.0 |
Tuxemon/Tuxemon | scripts/snap_map.py | 1 | 2014 | """
Snap collisions and events to the tile grid
EXAMPLES:
preview changes:
python3 scripts/snap_map.py mods/tuxemon/maps/taba_town.tmx
write changes
python3 -w scripts/snap_map.py mods/tuxemon/maps/taba_town.tmx
many files:
python3 scripts/snap_map.py mods/tuxemon/maps/*tmx
"""
import xml.... | gpl-3.0 |
ardi69/pyload-0.4.10 | pyload/plugin/account/FastixRu.py | 1 | 1215 | # -*- coding: utf-8 -*-
from pyload.plugin.Account import Account
from pyload.utils import json_loads
class FastixRu(Account):
__name = "FastixRu"
__type = "account"
__version = "0.03"
__description = """Fastix account plugin"""
__license = "GPLv3"
__authors = [("Massimo Rosami... | gpl-3.0 |
mblachford/conductor | lib/python2.7/site-packages/suds/builder.py | 197 | 4220 | # 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-2.0 |
phasis/phasis | phasis/finc/rmovcon.py | 1 | 2359 | # -*- coding: iso-8859-1 -*-
#
# Copyright (C) 2001 - 2020 Massimo Gerardi all rights reserved.
#
# Author: Massimo Gerardi massimo.gerardi@gmail.com
#
# Copyright (c) 2020 Qsistemi.com. All rights reserved.
#
# Viale Giorgio Ribotta, 11 (Roma)
# 00144 Roma (RM) - Italy
# Phone: (+39) 06.87.163
#
#
# Si veda ... | gpl-2.0 |
vv1133/home_web | django/core/management/commands/dbshell.py | 329 | 1243 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
option_lis... | bsd-3-clause |
baylee/django | tests/mail/tests.py | 6 | 56176 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import asyncore
import mimetypes
import os
import shutil
import smtpd
import sys
import tempfile
import threading
from email.header import Header
from email.mime.text import MIMEText
from smtplib import SMTP, SMTPException
from ssl import SSLError
from d... | bsd-3-clause |
drandykass/fatiando | gallery/vis/seismic-wiggle.py | 6 | 1210 | """
Plotting seismic data with wiggles
-----------------------------------
One way to plot seismic data is using black and white wiggles.
Function :func:`fatiando.vis.mpl.seismic_wiggle` does exactly this.
"""
import numpy as np
import matplotlib.pyplot as plt
from fatiando.seismic import conv
from fatiando.vis.mpl i... | bsd-3-clause |
lizardsystem/lizard5-apps | lizard_map/test_templatetags.py | 2 | 1866 | from django.contrib.auth.models import User
from django.test import TestCase
from lizard_map.templatetags import workspaces
from lizard_map.models import WorkspaceEdit
from lizard_map.models import CollageEdit
class WorkspacesTest(TestCase):
"""Only smoke tests"""
class MockRequest(object):
session ... | lgpl-3.0 |
phonnz/azure-storage-python | tests/storage_testcase.py | 1 | 2611 | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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 |
Azure/azure-sdk-for-python | sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/azure/cognitiveservices/knowledge/qnamaker/models/knowledgebases_dto_py3.py | 1 | 1061 | # 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 |
bobobox/ansible | lib/ansible/vars/__init__.py | 17 | 30049 | # (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 |
markYoungH/chromium.src | net/tools/testserver/echo_message.py | 187 | 13195 | # Copyright (c) 2011 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.
"""Provides utility functions for TCP/UDP echo servers and clients.
This program has classes and functions to encode, decode, calculate checksum
and ver... | bsd-3-clause |
cslzchen/osf.io | addons/dataverse/apps.py | 11 | 1922 | import os
from addons.base.apps import BaseAddonAppConfig
from addons.dataverse.settings import MAX_UPLOAD_SIZE
HERE = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_PATH = os.path.join(
HERE,
'templates'
)
class DataverseAddonAppConfig(BaseAddonAppConfig):
name = 'addons.dataverse'
label = 'ad... | apache-2.0 |
IronLanguages/ironpython3 | Src/StdLib/Lib/test/test_listcomps.py | 186 | 3851 | doctests = """
########### Tests borrowed from or inspired by test_genexps.py ############
Test simple loop with conditional
>>> sum([i*i for i in range(100) if i&1 == 1])
166650
Test simple nesting
>>> [(i,j) for i in range(3) for j in range(4)]
[(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, ... | apache-2.0 |
Pan0ram1x/pycoin | tests/sighash_single_test.py | 19 | 6726 | #!/usr/bin/env python
import unittest
from pycoin.ecdsa import (
generator_secp256k1,
sign as ecdsa_sign,
verify as ecdsa_verify,
)
from pycoin.encoding import (
bytes_from_int,
to_bytes_32,
)
from pycoin.key import Key
from pycoin.serialize import (
b2h,
b2h_rev,
)
from pycoin.tx import (
... | mit |
wangyum/tensorflow | tensorflow/contrib/framework/python/ops/ops_test.py | 118 | 2882 | # 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 |
lauri-codes/GameShop | gameshop/social/apps/django_app/default/models.py | 9 | 3601 | """Django ORM models for Social Auth"""
import six
from django.db import models
from django.conf import settings
from django.db.utils import IntegrityError
from social.utils import setting_name
from social.storage.django_orm import DjangoUserMixin, \
DjangoAssociationMixin, \
... | gpl-2.0 |
mdn/webalyzer | webalyzer/analyzer/urls.py | 1 | 1333 | from django.conf.urls import patterns, url
from webalyzer.analyzer import views
urlpatterns = patterns(
'',
url(r'^$', views.index, name='index'),
url(r'^submit/$', views.submit, name='submit'),
url(
r'^recent-submissions$',
views.recent_submissions,
name='recent_submissions'
... | bsd-3-clause |
saulgray/nemio-flask-old | lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.py | 915 | 12621 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBu... | mit |
litchfield/django | tests/gis_tests/gis_migrations/migrations/0001_initial.py | 269 | 2465 | from django.db import connection, migrations, models
from ...models import models as gis_models
ops = [
migrations.CreateModel(
name='Neighborhood',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.C... | bsd-3-clause |
rebost/django | django/core/management/base.py | 8 | 14083 | """
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
import os
import sys
from io import BytesIO
from optparse import make_option, OptionParser
import traceback
import django
from django.core.exceptions import ImproperlyConfigured
f... | bsd-3-clause |
silenci/neutron | neutron/tests/unit/plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py | 15 | 12687 | # Copyright 2014 Mellanox Technologies, Ltd
#
# 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 |
WalnutATiie/google_search | gtaskpool/gtaskpool_helper.py | 1 | 1815 | #!/usr/env python
# encoding: utf-8
import gtaskpool
import random
from datetime import datetime
import json
class Interface(object):
def __init__(self, get_proxy, proxy_feedback, get_useragent):
self.get_proxy = get_proxy
self.proxy_feedback = proxy_feedback
self.get_useragent = get_user... | mit |
TRESCLOUD/odoo | addons/email_template/tests/__init__.py | 56 | 1104 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
Neuromancer2701/OpenRoverRosSerial | src/open_rover_serial/src/vesc.py | 1 | 3713 | """
This file is a sending/receiving script to the VESC 6
"""
import serial, sys, glob
from time import sleep
from packets import Packet
from commands import Commands
from datatypes import Scale, PacketID
class Vesc:
def __init__(self):
self.left_back = None
self.right_back = None
self.... | mit |
cisco-sas/katnip | unit_tests/test_model_low_level_radamsa_field.py | 1 | 1913 | # Copyright (C) 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
#
# This file is part of Katnip.
#
# Katnip 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,... | gpl-2.0 |
odootr/odoo | addons/edi/models/__init__.py | 442 | 1116 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
shybovycha/buck | third-party/py/argparse/doc/source/conf.py | 84 | 7470 | # -*- coding: utf-8 -*-
#
# argparse documentation build configuration file, created by
# sphinx-quickstart on Sun Mar 27 01:27:16 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | apache-2.0 |
trishnaguha/ansible | lib/ansible/modules/cloud/cloudstack/cs_pod.py | 14 | 7215 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supporte... | gpl-3.0 |
simartin/servo | tests/wpt/web-platform-tests/webdriver/tests/element_clear/user_prompts.py | 16 | 4374 | # META: timeout=long
import pytest
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
def element_clear(session, element):
return session.transport.send(
"POST", "/session/{session_id}/element/{element_id}/clear".format(
session_id=session.session_id,
... | mpl-2.0 |
arnif/CouchPotatoServer | libs/requests/packages/chardet2/mbcssm.py | 63 | 18215 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
creativcoder/servo | tests/wpt/harness/wptrunner/update/metadata.py | 118 | 2732 | # 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 os
from .. import metadata, products
from base import Step, StepRunner
class GetUpdatePropertyList(Step):
... | mpl-2.0 |
webOS-ports/qtwebkit | Tools/Scripts/webkitpy/common/lru_cache.py | 134 | 4428 | # Copyright (C) 2011 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 ... | gpl-2.0 |
tomdean1/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
ForestNymph/Arduino_sources | arduino-core/src/processing/app/i18n/python/requests/packages/charade/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... | lgpl-2.1 |
toirl/pynunzen | pynunzen/ledger/transaction.py | 1 | 10225 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import datetime
from decimal import Decimal, getcontext
from pynunzen.helpers import double_sha256
__transaction_version__ = "1.0"
log = logging.getLogger(__name__)
getcontext().prec = 8
def generate_transaction_hash(transaction):
"""Will generate a h... | mit |
CFDEMproject/LAMMPS | tools/python/dump2pdb.py | 51 | 1217 | #!/usr/bin/env python
# Script: dump2pdb.py
# Purpose: convert a LAMMPS dump file to PDB format
# Syntax: dump2pdb.py dumpfile Nid Ntype Nx Ny Nz pdbfile template
# dumpfile = LAMMPS dump file in native LAMMPS format
# Nid,Ntype,Nx,Ny,Nz = columns #s for ID,type,x,y,z
# ... | gpl-2.0 |
andrewyoung1991/dj-stripe | tests/test_subscriptions.py | 9 | 13785 | import calendar
import copy
import datetime
import decimal
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone
from mock import patch, PropertyMock
from stripe import InvalidRequestError
from djstripe.exceptions import SubscriptionCancellationFailure, Sub... | bsd-3-clause |
nightjean/Deep-Learning | tensorflow/python/training/optimizer.py | 21 | 28134 | # 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 |
tuanthng/apitrace | specs/dwrite.py | 4 | 74738 | ##########################################################################
#
# Copyright 2011 Jose Fonseca
# 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 res... | mit |
oberlin/django | django/views/decorators/csrf.py | 586 | 2202 | from functools import wraps
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import available_attrs, decorator_from_middleware
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds... | bsd-3-clause |
MattsFleaMarket/python-for-android | python3-alpha/extra_modules/pyxmpp2/presence.py | 46 | 10333 | #
# (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | apache-2.0 |
nikhilpanicker/SecureVault | googleplay-api/googleplay.py | 2 | 11590 | #!/usr/bin/python
import base64
import gzip
import pprint
import StringIO
import requests
from google.protobuf import descriptor
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf import text_format
from google.protobuf.message import Message, DecodeError
import goog... | gpl-3.0 |
nthiep/global-ssh-server | lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/endpoints/base.py | 87 | 1729 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
import functools
import logging
from ..errors import TemporarilyUnavailableE... | agpl-3.0 |
gs0510/coala-bears | bears/coffee_script/CoffeeLintBear.py | 5 | 15297 | import json
from coalib.bearlib import deprecate_settings
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.NpmRequirement import NpmRequirement
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.results.Result import Result
from coala_utils.param_convers... | agpl-3.0 |
anryko/ansible | lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py | 13 | 15129 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
brijeshkesariya/odoo | addons/edi/models/res_currency.py | 437 | 2892 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
ralstonJ/Angelhack-Rumble | tweepy-master/tweepy/cache.py | 65 | 12740 | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import time
import datetime
import threading
import os
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import hashlib
except ImportError:
# python 2.4
import md5 as hashlib
try:
import fcntl
excep... | apache-2.0 |
piasek1906/Piasek-KK | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# 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.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
ostree/plaso | plaso/parsers/skydrivelog.py | 1 | 6955 | # -*- coding: utf-8 -*-
"""This file contains SkyDrive log file parser in plaso."""
import logging
import pyparsing
from plaso.events import time_events
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers import manager
from plaso.parsers import text_parser
__author__ = 'Francesco Pica... | apache-2.0 |
gqwest-erp/server | openerp/addons/base/tests/test_search.py | 290 | 7662 | import unittest2
import openerp.tests.common as common
class test_search(common.TransactionCase):
def test_00_search_order(self):
registry, cr, uid = self.registry, self.cr, self.uid
# Create 6 partners with a given name, and a given creation order to
# ensure the order of their ID. So... | agpl-3.0 |
zaffra/Inquire | GAE/django/contrib/localflavor/uy/forms.py | 310 | 2083 | # -*- coding: utf-8 -*-
"""
UY-specific form helpers.
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms.fields import Select, RegexField
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.contrib.localflavor.uy.util import get_vali... | bsd-3-clause |
atomic-labs/zulip | zerver/management/commands/set_default_streams.py | 8 | 1697 | from __future__ import absolute_import
from __future__ import print_function
from django.core.management.base import BaseCommand
from zerver.models import get_realm
from zerver.lib.actions import set_default_streams
from optparse import make_option
import sys
class Command(BaseCommand):
help = """Set default st... | apache-2.0 |
gw-sd-2016/Codir | codirSublime/SocketIO/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | gpl-2.0 |
B-MOOC/edx-platform | lms/djangoapps/dashboard/management/commands/tests/test_git_add_course.py | 101 | 8567 | """
Provide tests for git_add_course management command.
"""
import logging
import os
import shutil
import StringIO
import subprocess
import unittest
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from django.test.utils import overr... | agpl-3.0 |
dreamseekerkun/mixpanel-android | acceptance/test_layout.py | 10 | 6697 | import unittest
from selenium import webdriver
class AndroidTest(unittest.TestCase):
def _launch_app(self, decide_message):
f = open('response.txt', 'w')
f.write(decide_message)
f.close()
desired_capabilities = {'aut': 'com.mixpanel.example.hello:1.0'}
self.driver = webdriv... | apache-2.0 |
Belgabor/django | django/core/context_processors.py | 65 | 3353 | """
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext.
"""
from django.conf... | bsd-3-clause |
icyflame/batman | scripts/login.py | 1 | 6800 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to log the bot in to a wiki account.
Suggestion is to make a special account to use for bot use only. Make
sure this bot account is well known on your home wiki before using.
Parameters:
-family:FF
-lang:LL Log in to the LL language of the FF family.
... | mit |
encyclomundi/hubzilla | vendor/sabre/dav/bin/googlecode_upload.py | 124 | 8913 | #!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | mit |
transceptor-technology/trender | trender/lines.py | 1 | 2602 | '''Lines Class which is responsible for reading lines.
:copyright: 2015, Jeroen van der Heijden (Transceptor Technology)
'''
import re
import os
from .constants import MAP_LINE_TYPE, LINE_PASTE, FILENAME
from .exceptions import DefineBlockError, TemplateNotExistsError
class Lines:
RE_BLOCK = re.compile('\s*#([... | mit |
LuckyGameCn/LHCocosGame | cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/enumerations.py | 307 | 1077 | #===- enumerations.py - Python Enumerations ------------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | mit |
APerson241/APersonBot | article-history/test_fixer.py | 2 | 3654 | import unittest
from fixer import History, process, encode_wikilinks, decode_wikilinks
class TestEncodeDecode(unittest.TestCase):
def roundtrip(self, some_text):
wikitext, wikilinks = encode_wikilinks(some_text)
self.assertEqual(some_text, decode_wikilinks(wikitext, wikilinks))
def test_round... | mit |
landler/flask-oauthlib | flask_oauthlib/contrib/cache.py | 14 | 2871 | # coding: utf-8
from werkzeug.contrib.cache import NullCache, SimpleCache, FileSystemCache
from werkzeug.contrib.cache import MemcachedCache, RedisCache
class Cache(object):
def __init__(self, app, config_prefix='OAUTHLIB', **kwargs):
self.config_prefix = config_prefix
self.config = app.config
... | bsd-3-clause |
wweiradio/django | tests/utils_tests/test_duration.py | 364 | 1677 | import datetime
import unittest
from django.utils.dateparse import parse_duration
from django.utils.duration import duration_string
class TestDurationString(unittest.TestCase):
def test_simple(self):
duration = datetime.timedelta(hours=1, minutes=3, seconds=5)
self.assertEqual(duration_string(du... | bsd-3-clause |
longmen21/edx-platform | lms/djangoapps/course_api/blocks/tests/test_views.py | 17 | 10129 | """
Tests for Blocks Views
"""
from datetime import datetime
from django.core.urlresolvers import reverse
from string import join
from urllib import urlencode
from urlparse import urlunparse
from opaque_keys.edx.locator import CourseLocator
from student.models import CourseEnrollment
from student.tests.factories impo... | agpl-3.0 |
Ashaba/rms | rmslocalenv/lib/python2.7/site-packages/html5lib/treewalkers/dom.py | 505 | 1421 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
from . import _base
class TreeWalker(_base.NonRecursiveTreeWalker):
def getNodeDetails(self, node):
if node.nodeType == Node.DOCUMENT_TYPE_NODE:
return _base.DOCTYPE, node.name, node.publicId, node.sy... | mit |
cloudbau/nova | nova/cloudpipe/pipelib.py | 10 | 7110 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
kleientertainment/ds_mod_tools | pkg/win32/Python27/Lib/symtable.py | 13 | 7760 | """Interface to the compiler's internal symbol tables"""
import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM,
DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, OPT_EXEC, OPT_BARE_EXEC,
SCOPE_OFF, SCOPE_MASK, FREE, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL, LOCAL)
import weakref
__all_... | mit |
defance/edx-platform | common/djangoapps/embargo/tests/test_middleware.py | 92 | 7409 | """
Tests for EmbargoMiddleware with CountryAccessRules
"""
import unittest
from mock import patch
import ddt
from django.core.urlresolvers import reverse
from django.conf import settings
from django.core.cache import cache as django_cache
from util.testing import UrlResetMixin
from student.tests.factories import Us... | agpl-3.0 |
orion-42/numerics-physics-stuff | ode.py | 1 | 4470 | import numpy as np
import matplotlib.pyplot as plt
################################ methods ###################################
def forward_euler(f, y0, t):
ys = np.zeros((t.size, y0.size))
ys[0, :] = y0
h = t[1] - t[0]
for i in range(t.size - 1):
ys[i + 1, :] = ys[i,:] + h*f(t[i], ys[i,:])
... | mit |
patriciolobos/desa8 | openerp/addons/product_email_template/models/invoice.py | 321 | 1969 | # -*- coding: utf-8 -*-
from openerp.osv import osv
class account_invoice(osv.Model):
_inherit = 'account.invoice'
def invoice_validate_send_email(self, cr, uid, ids, context=None):
Composer = self.pool['mail.compose.message']
for invoice in self.browse(cr, uid, ids, context=context):
... | agpl-3.0 |
omnirom/android_external_chromium-org | media/tools/layout_tests/test_expectations_unittest.py | 165 | 1697 | #!/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.
import unittest
from test_expectations import TestExpectations
class TestTestExpectations(unittest.TestCase):
def testParseLi... | bsd-3-clause |
navcoindev/navcoin-core | contrib/GenesisH0/genesis.py | 5 | 7978 | import hashlib, binascii, struct, array, os, time, sys, optparse
import scrypt
from construct import *
def main():
options = get_args()
algorithm = get_algorithm(options)
input_script = create_input_script(options.timestamp)
output_script = create_output_script(options.pubkey)
# hash merkle root is the ... | mit |
ringling123/jupiter1wiz | plugin.program.advancedsettings/default.py | 13 | 86871 | '''
kinkin
'''
import urllib,urllib2,re,xbmcplugin,xbmcgui,os
import settings
import time,datetime
import glob
import shutil
from xml.etree import ElementTree
from xml.etree.ElementTree import Element
from xml.etree.ElementTree import SubElement
from xml.dom import minidom
ADDON = settings.addon()
VIEW = settings.vi... | gpl-2.0 |
cheery/essence | seed/argon/renderer.py | 1 | 6437 | from util import mix, in_module, rgba
from OpenGL.GL import *
from vertexformat import VertexFormat
from vertexstream import VertexStream
from texturecache import TextureCache
from patch9 import Patch9
from image import Image
from program import Program
image_empty = Image(1, 1, "\xff\xff\xff\xff")
white = rgba(255, 2... | gpl-3.0 |
savoirfairelinux/OpenUpgrade | addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py | 90 | 13231 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
eoyilmaz/anima | anima/env/fusion/__init__.py | 1 | 49729 | # -*- coding: utf-8 -*-
import sys
exceptions = None
if sys.version_info[0] >= 3:
exceptions = (ImportError, ModuleNotFoundError)
else:
exceptions = ImportError
try:
# for Fusion 6 and 7
import PeyeonScript as bmf
except exceptions:
# for Fusion 8+
try:
# for Fusion inside Resolve
... | mit |
pforret/python-for-android | python-build/python-libs/gdata/tests/atom_tests/auth_test.py | 128 | 1342 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
travisdoor/ArgosRts | engine/thirdparty/yaml-cpp/test/gmock-1.7.0/gtest/test/gtest_output_test.py | 1733 | 12005 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.