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
synergeticsedx/deployment-wipro
common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py
32
16966
import sys import logging from contracts import contract, new_contract from fs.osfs import OSFS from lazy import lazy from xblock.runtime import KvsFieldData, KeyValueStore from xblock.fields import ScopeIds from xblock.core import XBlock from opaque_keys.edx.locator import BlockUsageLocator, LocalId, CourseLocator, L...
agpl-3.0
altsen/diandiyun-platform
lms/djangoapps/wechat/tests/test_views.py
12
17913
""" Tests courseware views.py """ import unittest from datetime import datetime from mock import MagicMock, patch from pytz import UTC from django.test import TestCase from django.http import Http404 from django.test.utils import override_settings from django.contrib.auth.models import User, AnonymousUser from django...
agpl-3.0
esteve/txamqp
src/txamqp/test/test_heartbeat.py
6
1136
from txamqp.testlib import TestBase from txamqp.protocol import AMQClient from twisted.internet import reactor from twisted.internet.defer import Deferred class SpyAMQClient(AMQClient): called_reschedule_check = 0 called_send_hb = 0 def reschedule_checkHB(self, dummy=None): AMQClient.reschedul...
apache-2.0
OptimalPayments/Python_SDK
src/sample_application/DirectDebitACHpurchase.py
1
1780
#!/usr/bin/env python3 ''' Created on 1-June-2016 @author: Asawari.Vaidya ''' from PythonNetBanxSDK.CardPayments.BillingDetails import BillingDetails from PythonNetBanxSDK.CustomerVault.ACHBankAccount import ACHBankAccount from PythonNetBanxSDK.CustomerVault.Profile import Profile from PythonNetBanxSDK.DirectDebit.Pur...
mit
geekboxzone/lollipop_external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py
15
8419
# 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 ...
bsd-3-clause
ssadedin/seqr
seqr/migrations/0004_auto_20200124_1912.py
2
2811
# -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-01-24 19:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('seqr', '0003_auto_20191203_1130'), ] operations = [ migrations.RemoveField( model_name='projectlastacce...
agpl-3.0
darshanthaker/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/_cm.py
70
375423
""" Color data and pre-defined cmap objects. This is a helper for cm.py, originally part of that file. Separating the data (this file) from cm.py makes both easier to deal with. Objects visible in cm.py are the individual cmap objects ('autumn', etc.) and a dictionary, 'datad', including all of these objects. """ im...
agpl-3.0
dagnir/servo
python/mach/mach/registrar.py
46
3774
# 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 absolute_import, unicode_literals from .base import MachError INVALID_COMMAND_CONTEXT = r''' It...
mpl-2.0
wangzhangup/cuda-convnet2
layer.py
162
82481
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
tiagofrepereira2012/tensorflow
tensorflow/python/debug/cli/tensor_format_test.py
41
37994
# 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
tashaxe/Red-DiscordBot
lib/youtube_dl/extractor/uol.py
43
4977
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( clean_html, int_or_none, parse_duration, update_url_query, str_or_none, ) class UOLIE(InfoExtractor): IE_NAME = 'uol.com.br' _VALID_URL = r'https?://(?:.+?\.)?uol\.com\.br/.*?(?...
gpl-3.0
kxliugang/edx-platform
common/test/acceptance/pages/lms/pay_and_verify.py
110
6385
"""Payment and verification pages""" import re from bok_choy.page_object import PageObject from bok_choy.promise import Promise from . import BASE_URL from .dashboard import DashboardPage class PaymentAndVerificationFlow(PageObject): """Interact with the split payment and verification flow. The flow can be...
agpl-3.0
WorldMG/production-email
lib/werkzeug/exceptions.py
316
17799
# -*- coding: utf-8 -*- """ werkzeug.exceptions ~~~~~~~~~~~~~~~~~~~ This module implements a number of Python exceptions you can raise from within your views to trigger a standard non-200 response. Usage Example ------------- :: from werkzeug.wrappers import BaseRequest ...
apache-2.0
naresh21/synergetics-edx-platform
lms/djangoapps/notes/models.py
13
3225
from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.core.exceptions import ValidationError from django.utils.html import strip_tags import json from openedx.core.djangoapps.xmodule_django.models import CourseKeyField class Note(models.Mode...
agpl-3.0
swarna-k/MyDiary
flask/lib/python2.7/site-packages/wheel/archive.py
239
1559
""" Archive tools for wheel. """ import logging import os.path import zipfile log = logging.getLogger("wheel") def archive_wheelfile(base_name, base_dir): '''Archive all files under `base_dir` in a whl file and name it like `base_name`. ''' olddir = os.path.abspath(os.curdir) base_name = os.path...
bsd-3-clause
ComputationalPhysics/atomify-lammps
libs/lammps/tools/i-pi/ipi/engine/properties.py
18
57969
"""Holds the class which computes important properties of the system, and prepares them for output. Copyright (C) 2013, Joshua More and Michele Ceriotti 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 Foundatio...
gpl-3.0
rymate1234/rymate-blog
migrations/versions/413f129e8b07_.py
1
1535
"""empty message Revision ID: 413f129e8b07 Revises: None Create Date: 2014-05-02 08:09:09.906725 """ # revision identifiers, used by Alembic. revision = '413f129e8b07' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ###...
bsd-3-clause
IronManMark20/pyside2
tests/QtGui/deepcopy_test.py
3
4226
import unittest from copy import deepcopy from PySide2.QtCore import QPoint from PySide2.QtGui import QMatrix from PySide2.QtGui import QMatrix2x2, QMatrix2x3, QMatrix2x4 from PySide2.QtGui import QMatrix3x2, QMatrix3x3, QMatrix3x4 from PySide2.QtGui import QMatrix4x2, QMatrix4x3, QMatrix4x4 from PySide2.QtGui import...
lgpl-2.1
zdomjus60/astrometry
tools.py
1
10051
# -*- coding: utf-8 -*- """ helper functions for time management """ import math def sin(x): return math.sin(math.radians(x)) def cos(x): return math.cos(math.radians(x)) def atan2(y , x): return math.degrees(math.atan2(y, x)) def reduce360(x): return x % 360.0 def dms2ddd(hour, minute, second): """...
cc0-1.0
Aploium/MagicWebsiteMirror
zmirror/lru_dict.py
3
1167
# coding=utf-8 from collections import OrderedDict class LRUDictManual(OrderedDict): # pragma: no cover """一个手动实现的LRUDict""" def __init__(self, size=32): super().__init__() self.maxsize = size def __getitem__(self, key): value = super().__getitem__(key) try: ...
mit
stoeckli/iMatrixSpray
octoprint/printer.py
1
20362
# coding=utf-8 __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' import time import datetime import threading import copy import os #import logging, logging.config import octoprint.util.comm as comm import octoprint.util as util from ...
agpl-3.0
photoninger/ansible
lib/ansible/modules/network/nxos/nxos_config.py
6
19603
#!/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
ekr/nss-old
external_tests/google_test/gtest/xcode/Scripts/versiongenerate.py
3088
4536
#!/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...
mpl-2.0
nimasmi/wagtail
wagtail/core/blocks/struct_block.py
1
8310
import collections from django import forms from django.core.exceptions import ValidationError from django.forms.utils import ErrorList from django.template.loader import render_to_string from django.utils.functional import cached_property from django.utils.html import format_html, format_html_join from django.utils.s...
bsd-3-clause
nkgilley/home-assistant
homeassistant/components/spc/binary_sensor.py
6
2100
"""Support for Vanderbilt (formerly Siemens) SPC alarm systems.""" import logging from pyspcwebgw.const import ZoneInput, ZoneType from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from ....
apache-2.0
ypid/series60-remote
pc/devices/status_numbers.py
1
2071
# -*- coding: utf-8 -*- # Copyright (c) 2008 - 2010 Lukas Hetzenecker <LuHe@gmx.at> NUM_CONNECTED = 100 NUM_HELLO_REQUEST = 110 NUM_HELLO_REPLY = 111 NUM_QUIT = 120 NUM_PARTIAL_MESSAGE = 130 NUM_CONTACTS_REQUEST_HASH_ALL = 200 NUM_CONTACTS_REQUEST_HASH_SINGLE= 201 NUM_CONTACTS_REQUEST_CONTACT = 204 NUM_CONTACTS_REQU...
gpl-2.0
DooMLoRD/android_kernel_sony_msm8960t_aosp
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
kpespinosa/BuildingMachineLearningSystemsWithPython
ch04/blei_lda.py
21
2601
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License from __future__ import print_function from wordcloud import create_cloud try: from gensim import co...
mit
daenamkim/ansible
test/units/modules/network/junos/test_junos_config.py
35
8141
# # (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
AlexCaranha/Wox
PythonHome/Lib/site-packages/chardet/big5freq.py
3133
82594
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
majidaldo/ansible
lib/ansible/utils/module_docs_fragments/rackspace.py
232
4190
# (c) 2014, Matt Martz <matt@sivel.net> # # 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
tspus/python-matchingPursuit
src/utils.py
1
5766
#!/usr/bin/env python #-*- coding: utf-8 -*- ''' # This file is part of Matching Pursuit Python program (python-MP). # # python-MP 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 ...
gpl-3.0
samchrisinger/osf.io
scripts/analytics/tasks.py
14
1913
import os import matplotlib from framework.celery_tasks import app as celery_app from scripts import utils as script_utils from scripts.analytics import settings from scripts.analytics import utils from website import models from website import settings as website_settings from website.app import init_app from .log...
apache-2.0
gmalmquist/pants
contrib/cpp/src/python/pants/contrib/cpp/register.py
23
1198
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.build_gra...
apache-2.0
ClearCorp-dev/server-tools
__unported__/scheduler_error_mailer/__init__.py
65
1129
# -*- coding: utf-8 -*- ############################################################################## # # Scheduler Error Mailer module for OpenERP # Copyright (C) 2012-2013 Akretion (http://www.akretion.com/) # @author: Sébastien Beau <sebastien.beau@akretion.com> # @author Alexis de Lattre <alexis.delatt...
agpl-3.0
mazaclub/p2pool
p2pool/util/p2protocol.py
216
4144
''' Generic message-based protocol used by Bitcoin and P2Pool for P2P communication ''' import hashlib import struct from twisted.internet import protocol from twisted.python import log import p2pool from p2pool.util import datachunker, variable class TooLong(Exception): pass class Protocol(protocol.Protocol):...
gpl-3.0
gnieboer/tensorflow
tensorflow/contrib/tfprof/python/tools/tfprof/model_analyzer_test.py
8
12550
# 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
SrNetoChan/Quantum-GIS
python/plugins/processing/tests/SagaAlgorithmsTest.py
36
6002
# -*- coding: utf-8 -*- """ *************************************************************************** SagaAlgorithmsTests.py --------------------- Date : September 2017 Copyright : (C) 2017 by Alexander Bruy Email : alexander dot bruy at gmail dot com ***...
gpl-2.0
ngmiller/mipsy
mipsy/encoder.py
1
8100
""" mipsy.encoder Instruction encoder. See README.md for usage and general information. """ # system imports import bitstring # application imports from mipsy.arch import MIPS from mipsy.util import LabelCache, ParseInfo class Encoder(object): """ Responsible for encoding individual instructions and qu...
mit
atsolakid/edx-platform
common/djangoapps/dark_lang/tests.py
80
10264
""" Tests of DarkLangMiddleware """ from django.contrib.auth.models import User from django.http import HttpRequest import ddt from django.test import TestCase from mock import Mock import unittest from dark_lang.middleware import DarkLangMiddleware from dark_lang.models import DarkLangConfig # TODO PLAT-671 Import f...
agpl-3.0
sunqb/oa_qian
flask/Lib/site-packages/unidecode/x07e.py
252
4682
data = ( 'Xia ', # 0x00 'Yuan ', # 0x01 'Zong ', # 0x02 'Xu ', # 0x03 'Nawa ', # 0x04 'Odoshi ', # 0x05 'Geng ', # 0x06 'Sen ', # 0x07 'Ying ', # 0x08 'Jin ', # 0x09 'Yi ', # 0x0a 'Zhui ', # 0x0b 'Ni ', # 0x0c 'Bang ', # 0x0d 'Gu ', # 0x0e 'Pan ', # 0x0f 'Zhou ', # 0x1...
apache-2.0
rohit12/opencog
opencog/python/pln_old/examples/attentionallocation/socrates_attention_agent.py
26
2275
__author__ = 'sebastian' from opencog.cogserver import MindAgent from opencog.atomspace import types from pln.chainers import Chainer from pln.rules import * class SocratesAgent(MindAgent): def __init__(self): self.chainer = None def create_chainer(self, atomspace): self.chainer = Chainer(at...
agpl-3.0
ARM-software/lisa
lisa/typeclass.py
2
30480
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2020, Arm Limited and contributors. # # 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 # # ...
apache-2.0
malayaleecoder/servo
tests/wpt/web-platform-tests/tools/pytest/testing/python/integration.py
171
11677
import pytest from _pytest import python from _pytest import runner class TestOEJSKITSpecials: def test_funcarg_non_pycollectobj(self, testdir): # rough jstests usage testdir.makeconftest(""" import pytest def pytest_pycollect_makeitem(collector, name, obj): if name...
mpl-2.0
xpol/gyp
pylib/gyp/mac_tool.py
8
27016
#!/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. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
bsd-3-clause
mancoast/CPythonPyc_test
cpython/279_test_contextlib.py
125
9103
"""Unit tests for contextlib.py, and other context managers.""" import sys import tempfile import unittest from contextlib import * # Tests __all__ from test import test_support try: import threading except ImportError: threading = None class ContextManagerTestCase(unittest.TestCase): def test_contextm...
gpl-3.0
Akson/RemoteConsolePlus3
RemoteConsolePlus3/RCP3/Backends/Processors/Graphs/Plot1D.py
1
2341
#Created by Dmytro Konobrytskyi, 2014 (github.com/Akson) import numpy as np import matplotlib import matplotlib.pyplot from RCP3.Infrastructure import TmpFilesStorage class Backend(object): def __init__(self, parentNode): self._parentNode = parentNode def Delete(self): """ This method ...
lgpl-3.0
MagicAttacker/APM602
Tools/LogAnalyzer/tests/TestParams.py
261
3119
from LogAnalyzer import Test,TestResult import DataflashLog import math # for isnan() class TestParams(Test): '''test for any obviously bad parameters in the config''' def __init__(self): Test.__init__(self) self.name = "Parameters" # helper functions def __checkParamIsEqual(self, ...
gpl-3.0
BarusXXX/K-Tree
TreeLogic.py
1
3884
import os from copy import deepcopy class RecursiveTree: def __init__(self, dir_name): self.dir_name = dir_name self.files = [] self.folders = [] #Tuple Absolute address, branch, level self.branches = [] self.children_n = [] self.currentlevel = 0 self.level=[...
mit
Ecotrust/F2S-MOI
moi/indicators/migrations/0009_auto_20160506_1658.py
1
4006
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-05-06 16:58 from __future__ import unicode_literals from django.db import migrations import wagtail.wagtailcore.blocks import wagtail.wagtailcore.fields import wagtail.wagtailimages.blocks class Migration(migrations.Migration): dependencies = [ ...
apache-2.0
thurt/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/Demos/service/pipeTestServiceClient.py
17
4173
# A Test Program for pipeTestService.py # # Install and start the Pipe Test service, then run this test # either from the same machine, or from another using the "-s" param. # # Eg: pipeTestServiceClient.py -s server_name Hi There # Should work. from win32pipe import * from win32file import * from win32event import * ...
apache-2.0
ndparker/wolfe
wolfe/scheduler/_job_queue.py
1
4458
# -*- coding: ascii -*- r""" :Copyright: Copyright 2014 - 2016 Andr\xe9 Malo or his licensors, as applicable :License: 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....
apache-2.0
ar7z1/ansible
lib/ansible/modules/windows/win_eventlog.py
28
4997
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {...
gpl-3.0
bvanrijn/debianpaste-clients
old-paste.py
1
7602
#!/usr/bin/python # Filename: paste # Purpose: XmlRpc interface client to paste.debian.net # Author: Copyright (C) 2007-2011 Michael Gebetsroither <michael@mgeb.org> # License: This file is licensed under the GPL v2+. Full license text in LICENSE # Modified original: No modificat...
gpl-2.0
wjakob/layerlab
recipes/coated-gold-with-scatmedium.py
1
2082
# Creates a rough gold layer with a rough dielectric coating containing an # anisotropic scattering medium import sys sys.path.append('.') from utils.materials import gold from utils.cie import get_rgb import layerlab as ll eta_top = 1.5 # This step integrates the spectral IOR against the CIE XYZ curves to obtain ...
bsd-2-clause
plumer/codana
projectdata.py
1
5358
class VersionDataManager: """Manager of all the information of files and packages in a specific version Attributes: packages (list of str): List of packages name files (list of str): List of all the files in the project packagedict (dict): Map of packages(key) and filenames(value) ...
mit
apache8080/NVIDIABot
old_robot_code/driverStation.py
2
3817
''' Copyright (c) 2014, Rishi Desai 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 following d...
bsd-2-clause
ondra-novak/chromium.src
build/mac/change_mach_o_flags.py
232
10318
#!/usr/bin/env python # 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. """Usage: change_mach_o_flags.py [--executable-heap] [--no-pie] <executablepath> Arranges for the executable at |executable_path| ...
bsd-3-clause
3dfxmadscientist/odoo_vi
addons/account_voucher/account_voucher.py
16
86218
# -*- 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
rockyzhang/zhangyanhit-python-for-android-mips
python-modules/twisted/twisted/protocols/basic.py
49
28640
# -*- test-case-name: twisted.test.test_protocols -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Basic protocols, such as line-oriented, netstring, and int prefixed strings. Maintainer: Itamar Shtull-Trauring """ # System imports import re import struct import warnings imp...
apache-2.0
miyakz1192/neutron
neutron/db/migration/migrate_to_ml2.py
10
20722
# Copyright (c) 2014 Red Hat, Inc. # 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 require...
apache-2.0
HybridF5/nova
nova/scheduler/filters/compute_capabilities_filter.py
10
4182
# Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
thelazier/p2pool-dash
dev/convert_networks.py
2
1614
import sys f = open(sys.argv[1]) while True: if f.readline().strip() == 'nets = dict(': break def nesting(l): res = 0 for c in l: if c == '(': res += 1 if c == ')': res -= 1 return res def write_header(f, name): if sys.argv[3] == 'p2pool': f2.write('from p2pool.dash impor...
gpl-3.0
skarlekar/chehara
websocket/_core.py
23
16397
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) 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, ...
mit
jaw20/Crunchyroll-XML-Decoder
crunchy-xml-decoder/requests/packages/urllib3/filepost.py
1009
2281
import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_boundary. """ return uuid4().hex...
gpl-2.0
jdsika/TUM_HOly
openrave/sympy/physics/quantum/grover.py
6
9227
"""Grover's algorithm and helper functions. Todo: * W gate construction (or perhaps -W gate based on Mermin's book) * Generalize the algorithm for an unknown function that returns 1 on multiple qubit states, not just one. * Implement _represent_ZGate in OracleGate """ from sympy import sqrt, pi, floor from sympy.ph...
mit
chutsu/robotics
prototype/models/two_wheel.py
1
3500
from math import cos from math import sin import numpy as np import sympy from sympy import pprint def two_wheel_2d_model(x, u, dt): """Two wheel 2D motion model Parameters ---------- x : np.array Two Wheel model state vector (x, y, theta) u : np.array Input dt : float ...
gpl-3.0
TheTypoMaster/chromium-crosswalk
third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/generate/pack.py
22
8235
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import module as mojom # This module provides a mechanism for determining the packed order and offsets # of a mojom.Struct. # # ps = pack.PackedStruct(struc...
bsd-3-clause
citrix-openstack-build/nova
nova/openstack/common/timeutils.py
24
5623
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apac...
apache-2.0
sysbot/CouchPotatoServer
couchpotato/core/notifications/plex/main.py
86
2356
from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification from .client import PlexClientHTTP, PlexClientJSON from .server import PlexServer log = CPLog(__name__) class Plex(Notification): http_time_between_calls ...
gpl-3.0
aromanovich/kozmic-ci
kozmic/accounts/views.py
3
1103
from flask import current_app, request, render_template, redirect, url_for, flash from flask.ext.login import current_user from kozmic import db from . import bp from .forms import SettingsForm @bp.route('/settings/', methods=('GET', 'POST')) def settings(): form = SettingsForm(request.form, obj=current_user) ...
bsd-3-clause
redhatrises/freeipa
ipalib/constants.py
2
12530
# Authors: # Martin Nagy <mnagy@redhat.com> # Jason Gerard DeRose <jderose@redhat.com> # # Copyright (C) 2008 Red Hat # see file 'COPYING' for use and warranty information # # 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...
gpl-3.0
XiangyiKong/flask-snippets
appstructure/zc.buildout/__init__.py
2
1215
# -*- coding: utf-8 -*- """ appstructure.zc.buildout ~~~~~~~~~~~~~~~~~~~~~~~~ Deploy using zc.buildout and PythonPaste http://flask.pocoo.org/snippets/27/ """ """ Deploy the application First, you could save the buildout directory using your favorite DVCS, or create a tarball for future deployments. ...
bsd-3-clause
gurneyalex/stock-logistics-workflow
product_serial/__openerp__.py
17
2709
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2008 Raphaël Valyi # Copyright (C) 2013 Akretion (http://www.akretion.com/) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affe...
agpl-3.0
charbeljc/account-financial-tools
__unported__/account_cancel_invoice_check_payment_order/account_invoice.py
44
2589
# -*- coding: utf-8 -*- ############################################################################## # # Author Vincent Renaville. Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publis...
agpl-3.0
lingthio/Flask-User
flask_user/user_mixin.py
1
4450
"""This module implements the UserMixin class for Flask-User. This Mixin adds required methods to User data-model. """ from flask import current_app from flask_login import UserMixin as FlaskLoginUserMixin class UserMixin(FlaskLoginUserMixin): """ This class adds required methods to the User data-model. Exam...
mit
mathcamp/steward_web
steward_web/__init__.py
1
1965
""" Steward extension providing framework for web interface """ import re import pyramid.renderers from pyramid.request import Request from pyramid.settings import asbool def to_json(value): """ A json filter for jinja2 """ return pyramid.renderers.render('json', value) def do_index(request): """ Rende...
mit
eayunstack/fuel-web
nailgun/nailgun/extensions/cluster_upgrade/upgrade.py
3
7844
# -*- coding: utf-8 -*- # Copyright 2015 Mirantis, 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 requi...
apache-2.0
zace-yuan/viewfinder
backend/db/async_aws_sts.py
13
4387
#!/bin/env python # # Copyright 2012 bit.ly # # 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
DmitryADP/diff_qc750
external/webkit/Tools/CygwinDownloader/cygwin-downloader.py
20
5471
#!/usr/bin/env python import os, random, sys, time, urllib # # Options # dry_run = len(sys.argv) > 1 and "--dry-run" in set(sys.argv[1:]) quiet = len(sys.argv) > 1 and "--quiet" in set(sys.argv[1:]) # # Functions and constants # def download_progress_hook(block_count, block_size, total_blocks): if quiet or...
gpl-2.0
gavinelliott/patsi
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1558
4945
# Copyright (c) 2011 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. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
PolicyStat/django
tests/get_or_create/tests.py
19
13380
from __future__ import unicode_literals from datetime import date import traceback import warnings from django.db import IntegrityError, DatabaseError from django.utils.encoding import DjangoUnicodeDecodeError from django.test import TestCase, TransactionTestCase from .models import (DefaultPerson, Person, ManualPri...
bsd-3-clause
abrt/faf
src/pyfaf/storage/migrations/versions/168c63b81f85_report_history_default_value.py
1
1945
# Copyright (C) 2014 ABRT Team # Copyright (C) 2014 Red Hat, Inc. # # This file is part of faf. # # faf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) ...
gpl-3.0
lancezlin/ml_template_py
lib/python2.7/site-packages/pandas/tests/frame/test_missing.py
7
24048
# -*- coding: utf-8 -*- from __future__ import print_function from distutils.version import LooseVersion from numpy import nan, random import numpy as np from pandas.compat import lrange from pandas import (DataFrame, Series, Timestamp, date_range) import pandas as pd from pandas.util.testing im...
mit
NAMD/justicecloud
justice/external/wtforms/ext/sqlalchemy/orm.py
50
10766
""" Tools for generating forms based on SQLAlchemy models. """ from __future__ import unicode_literals import inspect from wtforms import fields as f from wtforms import validators from wtforms.form import Form from wtforms.ext.sqlalchemy.fields import QuerySelectField from wtforms.ext.sqlalchemy.fields import QueryS...
lgpl-3.0
HalcyonChimera/osf.io
addons/gitlab/tests/test_serializer.py
15
1607
# -*- coding: utf-8 -*- """Serializer tests for the GitLab addon.""" import mock import pytest from tests.base import OsfTestCase from addons.base.tests.serializers import StorageAddonSerializerTestSuiteMixin from addons.gitlab.api import GitLabClient from addons.gitlab.tests.factories import GitLabAccountFactory from...
apache-2.0
vmanoria/bluemix-hue-filebrowser
hue-3.8.1-bluemix/desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Random/__init__.py
105
1973
# -*- coding: utf-8 -*- # # SelfTest/Random/__init__.py: Self-test for random number generation modules # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the exten...
gpl-2.0
mauriceling/dose
examples/14_revive_simulation_13_fitness_loss.py
2
4596
''' Example 14: Continuation of examining the effects of natural selection on a population's genetic pool by implementing a fitness scheme that counts a specific sequence within the chromosome along with a goal to be reached from an evenly deployed population. In this simulation, loss of fitness is observed by implem...
gpl-3.0
sradevski/homeAutomate
scripts/laptop_on_network.py
1
1994
#!/usr/bin/python import remote_core as core import os import sys import nmap import datetime import time import re import go_to_sleep try: nm = nmap.PortScanner() # instance of nmap.PortScanner except nmap.PortScannerError: print('Nmap not found', sys.exc_info()[0]) sys.exit(0) exc...
mit
Orav/kbengine
kbe/src/lib/python/Lib/tkinter/font.py
2
6845
# Tkinter font wrapper # # written by Fredrik Lundh, February 1998 # __version__ = "0.9" import itertools import tkinter # weight/slant NORMAL = "normal" ROMAN = "roman" BOLD = "bold" ITALIC = "italic" def nametofont(name): """Given the name of a tk named font, returns a Font representati...
lgpl-3.0
ixc/django-fluent-contents
fluent_contents/plugins/code/migrations/0001_initial.py
2
1042
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('fluent_contents', '0001_initial'), ] operations = [ migrations.CreateModel( name='CodeItem', fields=...
apache-2.0
RobertoMalatesta/shedskin
tests/155.py
6
6975
# (c) Peter Cock # --- http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/python/sudoku/ TRIPLETS = [[0,1,2],[3,4,5],[6,7,8]] ROW_ITER = [[(row,col) for col in range(0,9)] for row in range(0,9)] COL_ITER = [[(row,col) for row in range(0,9)] for col in range(0,9)] TxT_ITER = [[(row,col) for row in rows...
gpl-3.0
JordanReiter/django-notification
notification/views.py
1
6596
from django.core.urlresolvers import reverse from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect, Http404 from django.template import RequestContext from django.contrib.auth.decorators import login_required try: from django.contrib.syndication.views impor...
mit
matthiasdiener/spack
var/spack/repos/builtin/packages/r-tseries/package.py
5
1765
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
ErickMurillo/ciat_plataforma
ficha_granos_basicos/migrations/0006_auto__del_datosparcela__del_field_monitoreo_fecha_monitoreo__add_field.py
3
36192
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'DatosParcela' db.delete_table(u'ficha_granos_basicos_da...
mit
yjydmlh/zerorpc-python
zerorpc/socket.py
134
1737
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Softwa...
mit
alexwaters/python-readability-api
readability/models.py
1
5472
# -*- coding: utf-8 -*- """ readability.models ~~~~~~~~~~~~~~~~~~ This module provides the core Readability API models. """ from .helpers import to_python, to_api class BaseResource(object): """A Base BaseResource object.""" def __init__(self): super(BaseResource, self).__init__() self._rd...
mit
charlesccychen/incubator-beam
sdks/python/apache_beam/examples/complete/autocomplete_test.py
5
2520
# # 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
Wikidata/StrepHit
tests/test_classification.py
1
4013
# -*- encoding: utf-8 -*- import unittest from treetaggerwrapper import Tag from strephit.classification import feature_extractors class TestFactExtractorFeatureExtractor(unittest.TestCase): def setUp(self): self.gazetteer = { 'sentence': ['feature1', 'feature2'] } self.sent...
gpl-3.0
IPVL/swift-kilo
test/unit/common/middleware/test_bulk.py
14
37987
# Copyright (c) 2012 OpenStack Foundation # # 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 ...
apache-2.0