repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
andyzsf/edx
common/djangoapps/student/migrations/0023_add_test_center_registration.py
183
19003
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TestCenterRegistration' db.create_table('student_testcenterregistration', ( ('id...
agpl-3.0
simongoffin/my_odoo_tutorial
addons/hr_evaluation/report/hr_evaluation_report.py
44
4676
# -*- 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
calancha/DIRAC
Core/Utilities/test/TracedTests.py
10
2744
######################################################################## # $HeadURL $ # File: TracedTests.py # Author: Krzysztof.Ciba@NOSPAMgmail.com # Date: 2012/08/08 15:21:32 ######################################################################## """ :mod: TracedTests ======================= .. module: ...
gpl-3.0
rareimagery/budhoundapp
sites/all/libraries/twilio/docs/_themes/flask_theme_support.py
2228
4875
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
gpl-2.0
joshmoore/openmicroscopy
components/tools/OmeroPy/test/integration/emanScripts.py
4
24635
#!/usr/bin/env python """ Integration test for testing various EMAN2 scripts functionality. Not all of the scripts are covered. E.g ctf.py, openInChimera.py, eman2omero.py, either because they are too tricky to test or because they cover very similar functionality to other scripts tested below. dir...
gpl-2.0
alshedivat/tensorflow
tensorflow/tools/common/test_module1.py
61
1045
# Copyright 2018 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
Muterra/py_golix
golix/cipher.py
2
43384
''' LICENSING ------------------------------------------------- golix: A python library for Golix protocol object manipulation. Copyright (C) 2016 Muterra, Inc. Contributors ------------ Nick Badger badg@muterra.io | badg@nickbadger.com | nickbadger.com This library is free software; ...
unlicense
ngkogkos/volatility-plugins
facebook_extractor.py
1
18867
""" @author: Nick Gk (@ngkogkos) @license: The MIT License (MIT) @contact: ngkogkos@protonmail.com """ # Volatility's stuff import volatility.commands as commands import volatility.scan as scan import volatility.utils as utils import volatility.addrspace as addrspace import volatility.obj as obj from v...
mit
thaim/ansible
lib/ansible/plugins/doc_fragments/fortios.py
44
1878
# -*- coding: utf-8 -*- # Copyright: (c) 2017, Benjamin Jolivot <bjolivot@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: file_mode: descriptio...
mit
HiroIshikawa/21playground
flask-sample/hello/venv/lib/python3.5/site-packages/requests/utils.py
36
20716
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import cgi import codecs import collections import io import os import platform import re import sys import socket import struct import wa...
mit
donutmonger/youtube-dl
youtube_dl/extractor/tmz.py
126
2370
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TMZIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tmz\.com/videos/(?P<id>[^/]+)/?' _TEST = { 'url': 'http://www.tmz.com/videos/0_okj015ty/', 'md5': '791204e3bf790b1426cb2db0706184c0', ...
unlicense
havard024/prego
venv/lib/python2.7/site-packages/whoosh/qparser/taggers.py
96
3624
# Copyright 2011 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...
mit
cpennington/edx-platform
lms/djangoapps/verify_student/ssencrypt.py
5
8534
""" NOTE: Anytime a `key` is passed into a function here, we assume it's a raw byte string. It should *not* be a string representation of a hex value. In other words, passing the `str` value of `"32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"` is bad. You want to pass in the result of calling .decode...
agpl-3.0
ChanduERP/odoo
addons/account_asset/account_asset_invoice.py
141
3088
# -*- encoding: 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 G...
agpl-3.0
smartfile/django-1.4
tests/modeltests/select_related/tests.py
26
6535
from __future__ import with_statement, absolute_import from django.test import TestCase from .models import Domain, Kingdom, Phylum, Klass, Order, Family, Genus, Species class SelectRelatedTests(TestCase): def create_tree(self, stringtree): """ Helper to create a complete tree. """ ...
bsd-3-clause
gmartinvela/RoMIE
robot_control/views.py
1
10330
import sys import time import os import subprocess import webbrowser import threading import traceback from django.http import HttpResponse from django.shortcuts import render from robot_control.models import Category, Question, Response from django.core.mail import send_mail import json MAX_TIME = 180 # seconds POR...
mit
liuycsd/bypy
bypy/requester.py
1
3844
#!/usr/bin/env python # encoding: utf-8 # PYTHON_ARGCOMPLETE_OK # from __future__ imports must occur at the beginning of the file from __future__ import unicode_literals from __future__ import print_function from __future__ import division import sys import logging import json from functools import partial import r...
mit
sdgdsffdsfff/simpleMon
nbNet/nbNet.py
4
7022
#!/usr/bin/python #-*- coding:utf-8 -*- import socket, select, logging, errno import os, sys, json def cmdRunner(input): import commands cmd_ret = commands.getstatusoutput(input) return json.dumps({'ret':cmd_ret[0], 'out':cmd_ret[1]}, separators=(',', ':')) class _State: def __init__(self): ...
apache-2.0
eadgarchen/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_test_utils.py
81
2065
# 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
niceguydave/cmsplugin-filer
cmsplugin_filer_file/migrations/0001_initial.py
17
11958
from south.db import db from django.db import models from cmsplugin_filer_file.models import * class Migration: depends_on = ( ("filer", "0008_polymorphic__del_field_file__file_type_plugin_name"), ) def forwards(self, orm): # Adding model 'FilerFile' db.create_table(...
bsd-3-clause
DarkFenX/Pyfa
gui/fitCommands/gui/fitSystemSecurity.py
2
1237
import wx from service.fit import Fit import eos.db import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.helpers import InternalCommandHistory from gui.fitCommands.calc.fitSystemSecurity import CalcChangeFitSystemSecurityCommand class GuiChangeFitSystemSecurityCommand(wx.Command): def __...
gpl-3.0
yannh/ansible-modules-core
network/basics/slurp.py
134
2115
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, 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...
gpl-3.0
LihanHA/opencademy-project
opencademy/model/openacademy_session.py
1
4454
# -*- coding: utf-8 -*- from datetime import timedelta from openerp import api, exceptions, fields, models class Session(models.Model): _name = 'openacademy.session' name = fields.Char(required=True) start_date = fields.Date(default=fields.Date.today) duration = fields.Float(digits=(6, 2), help=...
apache-2.0
LS80/script.module.livestreamer
lib/livestreamer/plugins/beattv.py
34
10334
import re from collections import namedtuple from io import BytesIO try: from Crypto.Cipher import AES CAN_DECRYPT = True except ImportError: CAN_DECRYPT = False from livestreamer.compat import range from livestreamer.exceptions import StreamError from livestreamer.packages.flashmedia.tag import ( AAC...
bsd-2-clause
mSenyor/sl4a
python/src/Lib/lib2to3/fixes/fix_print.py
53
2957
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for print. Change: 'print' into 'print()' 'print ...' into 'print(...)' 'print ... ,' into 'print(..., end=" ")' 'print >>x, ...' into 'print(..., file=x)' No changes are appl...
apache-2.0
denniszollo/libsbp
python/sbp/observation.py
2
5567
#!/usr/bin/env python # Copyright (C) 2015 Swift Navigation Inc. # Contact: Fergus Noble <fergus@swiftnav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITH...
lgpl-3.0
robovm/robovm-studio
python/lib/Lib/email/test/test_email.py
84
118877
# Copyright (C) 2001-2007 Python Software Foundation # Contact: email-sig@python.org # email package unit tests import os import sys import time import base64 import difflib import unittest import warnings from cStringIO import StringIO import email from email.Charset import Charset from email.Header import Header, ...
apache-2.0
nelmiux/CarnotKE
jyhton/lib-python/2.7/xml/etree/ElementPath.py
273
9475
# # ElementTree # $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $ # # limited xpath support for element trees # # history: # 2003-05-23 fl created # 2003-05-28 fl added support for // etc # 2003-08-27 fl fixed parsing of periods in element names # 2007-09-10 fl new selection engine # 2007-09-12 fl fix...
apache-2.0
Lekanich/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_raise.py
327
2934
"""Fixer for 'raise E, V, T' raise -> raise raise E -> raise E raise E, V -> raise E(V) raise E, V, T -> raise E(V).with_traceback(T) raise E, None, T -> raise E.with_traceback(T) raise (((E, E'), E''), E'''), V -> raise E(V) raise "foo", V, T -> warns about string exceptions CAVEATS:...
apache-2.0
coderbone/SickRage
lib/sqlalchemy/sql/elements.py
75
117708
# sql/elements.py # Copyright (C) 2005-2014 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 """Core SQL expression elements, including :class:`.ClauseElement`, :class:`.ColumnEle...
gpl-3.0
icoxfog417/music_hack_day_onpasha
scripts/create_photo_to_mood_data.py
1
2393
import os from datetime import datetime from api.bluemix_vision_recognition import VisionRecognizer from api.echonest import Echonest def read_file(path): lines = [] with open(path, "r", encoding="utf-8") as f: lines = f.readlines() lines = [ln.strip(os.linesep) for ln in lines] return li...
mit
scue/vim-ycm_win7
third_party/pythonfutures/setup.py
65
1249
#!/usr/bin/env python import sys extras = {} try: from setuptools import setup extras['zip_safe'] = False if sys.version_info < (2, 6): extras['install_requires'] = ['multiprocessing'] except ImportError: from distutils.core import setup setup(name='futures', version='2.1.4', descr...
gpl-3.0
Noilednad/BonjourBrowser
mDNSShared/src/main/jni/mDNSPosix/parselog.py
10
10080
#!/usr/bin/python # Emacs settings: -*- tab-width: 4 -*- # # Copyright (c) 2002-2003 Apple Computer, 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://...
apache-2.0
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/net/regressionwindow.py
165
2381
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
gpl-2.0
phassoa/openelisglobal-core
liquibase/OE4.2/testCatalogCI_LNSP/scripts/createLocalCode.py
25
1703
#!/usr/bin/env python # -*- coding: utf-8 -*- def trim( name, length): if len( name ) <= length: return name else: last_space = name.find(" ") if last_space == -1: return name[:35] else: return trim( name[:last_space], length) def translate(...
mpl-2.0
martinling/imusim
imusim/trajectories/sampled.py
2
5624
""" Classes representing sampled trajectories. Sampled trajectories do not support evaluation of derivative values such as velocities or accelerations. To evaulate these properties a splined trajectory should be constructed. See L{splined} """ # Copyright (C) 2009-2011 University of Edinburgh # # This file is part of ...
gpl-3.0
sajeeshcs/nested_quota_final
nova/objects/pci_device_pool.py
4
3410
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # 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/LICEN...
apache-2.0
KaranToor/MA450
google-cloud-sdk/platform/gsutil/third_party/boto/tests/__init__.py
454
1103
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # # 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, modi...
apache-2.0
studio666/gnuradio
gr-atsc/python/atsc/__init__.py
57
1161
# # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # #...
gpl-3.0
yb-kim/gemV
ext/ply/test/testyacc.py
93
14230
# testyacc.py import unittest try: import StringIO except ImportError: import io as StringIO import sys import os sys.path.insert(0,"..") sys.tracebacklimit = 0 import ply.yacc def check_expected(result,expected): resultlines = [] for line in result.splitlines(): if line.startswith("WARNING...
bsd-3-clause
vybstat/scikit-learn
sklearn/covariance/empirical_covariance_.py
101
9133
""" Maximum likelihood covariance estimator. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause # avoid division truncation from __future__ import division import warnin...
bsd-3-clause
aswinpj/Pygments
pygments/lexers/go.py
47
3701
# -*- coding: utf-8 -*- """ pygments.lexers.go ~~~~~~~~~~~~~~~~~~ Lexers for the Google Go language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, words from pygments.token...
bsd-2-clause
40023255/-w16b_test
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/surface.py
603
3844
from browser import document, html, window from javascript import console, JSConstructor from .rect import Rect #import pygame.rect canvas_ID=1 _canvas_id=None class Surface: def __init__(self, dim=[], depth=16, surf=None): if surf is None: self._depth=depth self._canvas=html.CANVAS(width=...
agpl-3.0
Demolisty24/AlexaFood-Backend
venv/Lib/site-packages/jinja2/tests.py
336
4131
# -*- coding: utf-8 -*- """ jinja2.tests ~~~~~~~~~~~~ Jinja test functions. Used with the "is" operator. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re from collections import Mapping from jinja2.runtime import Undefined from jinja2._compat impor...
mit
amcgee/pymomo
test/test_utilities/test_settings_dir.py
2
1243
from pymomo.utilities import build from nose.tools import * import unittest import os.path import os import platform from pymomo.exceptions import * from pymomo.utilities.paths import MomoPaths class TestSettingsDirectory: def setUp(self): self.paths = MomoPaths() self.confdir = os.path.join(os.path.expanduser('~...
lgpl-3.0
aeph6Ee0/youtube-dl
youtube_dl/extractor/r7.py
53
4600
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import int_or_none class R7IE(InfoExtractor): _VALID_URL = r'''(?x) https?:// (?: (?:[a-zA-Z]+)\.r7\.com(?:/[^/]+)+/idmedia/| ...
unlicense
makhtardiouf/makhtardiouf.github.io
angularcode/node_modules/node-gyp/gyp/pylib/gyp/input.py
713
115880
# 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 compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from co...
mit
IsCoolEntertainment/debpkg_python-boto
boto/sdb/db/manager/__init__.py
173
4210
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ # # 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,...
mit
yu239/Paddle
paddle/scripts/cluster_train/conf.py
20
1113
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
dagnir/servo
tests/wpt/web-platform-tests/tools/webdriver/webdriver/searchcontext.py
251
2153
"""WebDriver element location functionality.""" class SearchContext(object): """Abstract class that provides the core element location functionality.""" def find_element_by_css(self, selector): """Find the first element matching a css selector.""" return self._find_element('css selector', sele...
mpl-2.0
guthemberg/yanoama
yanoama/pilot/system/server.py
1
5045
#!/home/upmc_aren/python_env/bin/python import SocketServer from threading import Thread import subprocess """ run few command on remote node in yanoama commands are coded two comma-separated integers only codes list: 0,0: update main sources 0,1: bootstrap 0,2: shutdown (kill pilot and amend) 0,3: start amen d...
bsd-3-clause
drawquest/drawquest-web
website/drawquest/apps/bounces/migrations/0002_auto__add_complaint.py
1
1899
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Complaint' db.create_table('bounces_complaint', ( ('id', self.gf('django.db.mo...
bsd-3-clause
chinesebear/rtt-net
rtt-2.1/tools/menuconfig.py
6
1266
import os # make rtconfig.h from .config def mk_rtconfig(filename): try: config = file(filename) except: print 'open .config failed' return rtconfig = file('rtconfig.h', 'w') rtconfig.write('#ifndef RT_CONFIG_H__\n') rtconfig.write('#define RT_CONFIG_H__\n\n') empty_l...
mit
myarjunar/QGIS
python/plugins/processing/algs/gdal/ui/RasterOptionsWidget.py
2
2746
# -*- coding: utf-8 -*- """ *************************************************************************** RasterOptionsWidget.py --------------------- Date : December 2016 Copyright : (C) 2016 by Alexander Bruy Email : alexander dot bruy at gmail dot com ****...
gpl-2.0
un33k/CouchPotatoServer
libs/tornado/concurrent.py
65
16799
#!/usr/bin/env python # # Copyright 2012 Facebook # # 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 a...
gpl-3.0
jgao54/airflow
tests/contrib/hooks/test_emr_hook.py
3
2877
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
PriceChild/ansible
lib/ansible/modules/cloud/misc/proxmox_kvm.py
6
47830
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Abdoul Bah (@helldorado) <bahabdoul at gmail.com> """ Ansible module to manage Qemu(KVM) instance in Proxmox VE cluster. This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Fr...
gpl-3.0
nirmeshk/oh-mainline
vendor/packages/Django/django/contrib/gis/db/models/manager.py
505
3578
from django.db.models.manager import Manager from django.contrib.gis.db.models.query import GeoQuerySet class GeoManager(Manager): "Overrides Manager to return Geographic QuerySets." # This manager should be used for queries on related fields # so that geometry columns on Oracle and MySQL are selected ...
agpl-3.0
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/scons-2.1.0/SCons/Tool/mslib.py
21
2227
"""SCons.Tool.mslib Tool-specific initialization for lib (MicroSoft library archiver). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, ...
gpl-2.0
avlasov-mos-de/mos-tempest-runner
setup.py
608
1045
#!/usr/bin/env python # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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 # # Unle...
apache-2.0
fnouama/intellij-community
python/testData/inspections/PyMissingConstructorInspection/py3k.py
83
1072
class A(object): def __init__(self): pass class AA(A): def __init__(self): A.__init__(self) print("Constructor AA was called") class B(A): def <warning descr="Call to __init__ of super class is missed">__init__</warning>(self): print("Constructor B was called") class C(B): def __init__(self):...
apache-2.0
EdLogan18/logan-repository
plugin.video.MediaPlay-TV/pkcs7.py
111
1943
import binascii import StringIO class PKCS7Encoder(object): ''' RFC 2315: PKCS#7 page 21 Some content-encryption algorithms assume the input length is a multiple of k octets, where k > 1, and let the application define a method for handling inputs whose lengths are not a multiple of k octets. F...
gpl-2.0
priyaganti/rockstor-core
src/rockstor/smart_manager/replication/listener_broker.py
2
15022
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any la...
gpl-3.0
cfchou/choreography
choreography/launcher.py
1
2392
import sys import asyncio import os import types import functools from collections import namedtuple from collections.abc import Iterator import abc from typing import List, Union, NamedTuple import uuid import yaml import logging log = logging.getLogger(__name__) Fire = NamedTuple('Fire', [('rate', int), ('duratio...
bsd-3-clause
ahotam/micropython
tests/basics/gen_yield_from_ducktype.py
107
1034
class MyGen: def __init__(self): self.v = 0 def __iter__(self): return self def __next__(self): self.v += 1 if self.v > 5: raise StopIteration return self.v def gen(): yield from MyGen() def gen2(): yield from gen() print(list(gen())) print(l...
mit
kalyanjvn1/selenium
py/selenium/webdriver/remote/errorhandler.py
14
9131
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
bpsinc-native/src_third_party_scons-2.0.1
engine/SCons/Tool/dvi.py
61
2388
"""SCons.Tool.dvi Common DVI Builder definition for various other Tool modules that use it. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated document...
mit
Vimjas/covimerage
tests/test_coveragepy.py
1
8791
import sys import attr import coverage import pytest from covimerage._compat import StringIO def test_filereporter(): from covimerage.coveragepy import FileReporter f = FileReporter('/doesnotexist') assert repr(f) == "<CovimerageFileReporter '/doesnotexist'>" with pytest.raises(coverage.misc.NoSou...
mit
CloverHealth/airflow
airflow/operators/redshift_to_s3_operator.py
8
5885
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
sw25sw25/Docker
pip/_vendor/distlib/locators.py
203
48796
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
mit
mirrax/detekt
utils.py
7
1117
# Copyright (C) 2014 Claudio Guarnieri. # This file is part of Detekt - https://github.com/botherder/detekt # See the file 'LICENSE' for copying permission. import os import sys import ctypes def get_resource(relative): # First try from the local directory. This might come handy in case we want # to provide u...
gpl-3.0
yuxiang-zhou/menpofit
menpofit/aps/base.py
2
39189
from __future__ import division import warnings import numpy as np from scipy.stats import multivariate_normal from menpo.base import name_of_callable from menpo.feature import no_op from menpo.visualize import print_dynamic, print_progress from menpo.model import GMRFModel from menpo.shape import (DirectedGraph, Undi...
bsd-3-clause
tartley/chronotank
pyweek12/items/greenery.py
1
1100
from random import uniform from .gameitem import GameItem class Greenery(GameItem): layer = 0 # ground level def __init__(self, **kwargs): GameItem.__init__(self, **kwargs) self.randomise_position() self.scale = uniform(0.5, 2) self.rot = uniform(0, 360) class Tree(Greenery):...
bsd-3-clause
elastic/elasticsearch-py
elasticsearch/client/ingest.py
1
4784
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
apache-2.0
ericshawlinux/bitcoin
test/functional/test_framework/socks5.py
18
5690
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Dummy Socks5 server for testing.""" import socket import threading import queue import logging logger...
mit
weidongxu84/info-gatherer
requests/__init__.py
62
1863
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('http://python.org') >>> r.sta...
mit
aimas/TuniErp-8.0
addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py
384
2324
######################################################################### # # 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
hbrunn/OpenUpgrade
addons/base_action_rule/__init__.py
438
1098
# -*- 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...
agpl-3.0
WilliamXIII/cuda-convnet2
python_util/options.py
180
16577
# 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
skosukhin/spack
var/spack/repos/builtin/packages/r-affyrnadegradation/package.py
1
2026
############################################################################## # Copyright (c) 2013-2017, 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
praba230890/PYPOWER
doc/conf.py
2
6328
# -*- coding: utf-8 -*- # # PYPOWER documentation build configuration file, created by # sphinx-quickstart on Thu Jul 7 17:48:32 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. # # All...
bsd-3-clause
naitikshukla/drone
vanish_point/main.py
1
2937
from VanishingPoint import * import os import time def direction(img,xa,ya,xb,yb,width,height): #xa,ya,xb,yb=point[0],point[1],point[2],point[3] cenx = xa+(xb-xa)/2 ceny = ya+(yb-ya)/2 centerx=width/2 centery = height/2 timeout = time.time() + 5 #while True: #_,img = cam.read() print("image center are :", cen...
unlicense
goliveirab/openacademy-project
openacademy/__openerp__.py
1
1205
# -*- coding: utf-8 -*- { 'name': "Open Academy", 'summary': """Manage trainings""", # 'description': """ # Open Academy module for managing trainings: # - training courses # - training sessions # - attendees registration 'author': "Vauxoo", 'website': "http://www.vauxoo.com", ...
gpl-3.0
angelapper/odoo
addons/sale_stock/sale_stock.py
2
16690
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta from openerp import api, fields, models, _ from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, float_compare from openerp.exceptions import UserError class SaleOrder(model...
agpl-3.0
GunoH/intellij-community
python/helpers/py2only/docutils/parsers/rst/tableparser.py
112
21007
# $Id: tableparser.py 7320 2012-01-19 22:33:02Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ This module defines table parser classes,which parse plaintext-graphic tables and produce a well-formed data structure suitable for building a CALS tab...
apache-2.0
takinbo/rapidsms-borno
apps/django_extensions/management/commands/runjob.py
5
1965
from django.core.management.base import LabelCommand from optparse import make_option from extensions.management.jobs import get_job, print_jobs class Command(LabelCommand): option_list = LabelCommand.option_list + ( make_option('--list', '-l', action="store_true", dest="list_jobs", help="List ...
lgpl-3.0
etanoox/agyrion
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
blooparksystems/odoo
addons/account/wizard/account_report_aged_partner_balance.py
19
1759
# -*- coding: utf-8 -*- import time from datetime import datetime from dateutil.relativedelta import relativedelta from openerp import api, fields, models, _ from openerp.exceptions import UserError class AccountAgedTrialBalance(models.TransientModel): _name = 'account.aged.trial.balance' _inherit = 'accoun...
gpl-3.0
sander76/home-assistant
homeassistant/components/file/notify.py
14
1682
"""Support for file notification.""" import os import voluptuous as vol from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.const import CONF_FILENAME import homeassistant.helpers.config_validation as cv import ho...
apache-2.0
xs2maverick/adhocracy3.mercator
src/adhocracy_core/adhocracy_core/catalog/test_index.py
2
8335
"""Test custom catalog index.""" from unittest.mock import Mock from pyramid import testing from pytest import fixture from pytest import raises class TestField: _marker = object() @fixture def inst(self): from hypatia.field import FieldIndex from BTrees import family64 def _dis...
agpl-3.0
technomalogical/suds
suds/xsd/query.py
202
6451
# 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 ...
lgpl-3.0
semio/zipline
tests/test_events_through_risk.py
17
11560
# # Copyright 2013 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
x111ong/odoo
addons/account/wizard/account_report_common_partner.py
385
1999
# -*- 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
wakatime/wakatime
wakatime/packages/py27/pygments/lexers/resource.py
4
2926
# -*- coding: utf-8 -*- """ pygments.lexers.resource ~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for resource definition files. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, words from ...
bsd-3-clause
bakkou-badri/dataminingproject
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/__init__.py
745
1295
######################## BEGIN LICENSE BLOCK ######################## # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later ve...
gpl-2.0
dennybaa/mistral
mistral/tests/unit/engine/test_default_engine.py
1
14261
# Copyright 2014 - Mirantis, Inc. # Copyright 2015 - StackStorm, 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 # # Unl...
apache-2.0
alexus37/AugmentedRealityChess
pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGLContext/scenegraph/text/wglfontprovider.py
2
1419
"""Win32 (win32ui and WGL)-specific font providers """ from OpenGLContext.scenegraph.text import fontprovider, wglfont class WGLOutlineFonts( fontprovider.FontProvider ): """Font provider for WGL outline (polygon) fonts""" format = "polygon" def get( self, fontStyle, mode=None ): """Get a WGLOutlin...
mit
ntts-clo/ryu
ryu/services/protocols/vrrp/monitor_openflow.py
56
5444
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp> # # 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 # # h...
apache-2.0
CAB-LAB/cablab-core
test/providers/test_precip.py
2
3183
import os import unittest from datetime import datetime from esdl import CubeConfig from esdl.providers.precip import PrecipProvider from test.providers.provider_test_utils import ProviderTestBase from esdl.util import Config SOURCE_DIR = Config.instance().get_cube_source_path('CPC_precip') class PrecipProviderTest...
gpl-3.0
caveman-dick/ansible
test/units/contrib/inventory/test_vmware_inventory.py
97
3635
import json import os import pickle import unittest import sys from nose.plugins.skip import SkipTest try: from pyVmomi import vim, vmodl except ImportError: raise SkipTest("test_vmware_inventory.py requires the python module 'pyVmomi'") try: from vmware_inventory import VMWareInventory except ImportErro...
gpl-3.0