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 |
|---|---|---|---|---|---|
cuongnv23/ansible | lib/ansible/modules/network/lenovo/cnos_showrun.py | 26 | 4911 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, 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
# ... | gpl-3.0 |
shahbaz17/zamboni | mkt/asset_bundles.py | 12 | 8279 | # A list of our CSS and JS assets for jingo-minify.
CSS = {
'mkt/admin': (
'css/zamboni/zamboni.css',
'css/zamboni/mkt-admin.css',
'css/zamboni/admin-django.css',
),
'mkt/devreg': (
# Contains reset, clearfix, etc.
'css/devreg/base.css',
# Base styles (body,... | bsd-3-clause |
mkacik/bcc | tools/biosnoop.py | 1 | 4828 | #!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# biosnoop Trace block device I/O and print details including issuing PID.
# For Linux, uses BCC, eBPF.
#
# This uses in-kernel eBPF maps to cache process details (PID and comm) by I/O
# request, as well as a starting timestamp for calculating I/O ... | apache-2.0 |
tcpcloud/contrail-controller | src/config/api-server/vnc_auth_keystone.py | 1 | 10040 | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# This file contains authentication/authorization functionality for VNC-CFG
# subsystem. It also currently contains keystone adaptation which can in
# future by moved to vnc_auth_keystone.py
#
import gevent
from gevent import monkey
monkey.patch_al... | apache-2.0 |
BARCproject/barc | Dator/data_api/views.py | 3 | 8780 | import csv
import json
import StringIO
from django.core import serializers
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, render_to_response
# Create your views here.
from django.template.conte... | mit |
Miethpo/terminal_stopwatch | stopwatch.py | 1 | 2973 | #!/usr/bin/python2.7
from __future__ import print_function
import time, datetime, select, sys, threading, os
import tty, termios
reading = True
counting = False
current_time = ""
current_time_seconds = 0
first_count = True
count_thread = None
start_string = "Press s to start the stopwatch, f to save the current time,... | gpl-3.0 |
stefanv/brainx | doc/sphinxext/inheritance_diagram.py | 6 | 13678 | """
Defines a docutils directive for inserting inheritance diagrams.
Provide the directive with one or more classes or modules (separated
by whitespace). For modules, all of the classes in that module will
be used.
Example::
Given the following classes:
class A: pass
class B(A): pass
class C(A): pass
... | bsd-3-clause |
altsen/diandiyun-platform | lms/djangoapps/wechat/tests/test_course_info.py | 13 | 2168 | """
Test the course_info xblock
"""
import mock
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from .helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from courseware.tests.modulestore_config import TEST_DATA_MIXE... | agpl-3.0 |
manishpatell/erpcustomizationssaiimpex123qwe | openerp/release.py | 284 | 2591 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
jpavel/cms-ucl-tau | SFrame/bin/sframe_create_cycle.py | 1 | 2312 | #!/usr/bin/env python
# $Id: sframe_create_cycle.py 344 2012-12-13 13:10:53Z krasznaa $
#***************************************************************************
#* @Project: SFrame - ROOT-based analysis framework for ATLAS
#* @Package: Core
#*
#* @author Stefan Ask <Stefan.Ask@cern.ch> - Manchester
... | mit |
odubno/microblog | flask/lib/python2.7/site-packages/werkzeug/contrib/limiter.py | 295 | 1333 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.limiter
~~~~~~~~~~~~~~~~~~~~~~~~
A middleware that limits incoming data. This works around problems with
Trac_ or Django_ because those directly stream into the memory.
.. _Trac: http://trac.edgewall.org/
.. _Django: http://www.djangoproject.com/
... | bsd-3-clause |
bigsupersquid/android_kernel_lge_msm7x27-3.0.x | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
xaviercobain88/framework-python | build/lib.linux-i686-2.7/openerp/addons/knowledge/__init__.py | 436 | 1064 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
galtys/odoo | addons/fetchmail/res_config.py | 437 | 5234 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
jindongh/boto | boto/ec2containerservice/exceptions.py | 135 | 1269 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
kilon/sverchok | nodes/modifier_make/csg_boolean.py | 1 | 3764 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | gpl-3.0 |
micadeyeye/Blongo | django/contrib/localflavor/ro/ro_counties.py | 428 | 1231 | # -*- coding: utf-8 -*-
"""
A list of Romanian counties as `choices` in a formfield.
This exists as a standalone file so that it's only imported into memory when
explicitly needed.
"""
COUNTIES_CHOICES = (
('AB', u'Alba'),
('AR', u'Arad'),
('AG', u'Argeş'),
('BC', u'Bacău'),
('BH', u'Bihor'),
... | bsd-3-clause |
jymannob/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/rai.py | 12 | 4632 | from __future__ import unicode_literals
import re
from .subtitles import SubtitlesInfoExtractor
from ..utils import (
parse_duration,
unified_strdate,
compat_urllib_parse,
)
class RaiIE(SubtitlesInfoExtractor):
_VALID_URL = r'(?P<url>http://(?:.+?\.)?(?:rai\.it|rai\.tv|rainews\.it)/dl/.+?-(?P<id>[\d... | gpl-3.0 |
deepsrijit1105/edx-platform | common/djangoapps/enrollment/management/commands/enroll_user_in_course.py | 62 | 1637 | """
Management command for enrolling a user into a course via the enrollment api
"""
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from enrollment.data import CourseEnrollmentExistsError
from enrollment.api import add_enrollment
class Command(BaseCommand):
"""
... | agpl-3.0 |
Lekensteyn/buildbot | master/buildbot/test/unit/test_util_bbcollections.py | 10 | 2470 | # 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 |
realgam3/x64dbg-python | swig/x64dbg_python/__init__.py | 1 | 1565 | __author__ = 'Tomer Zait (RealGame)'
__version__ = '1.0.0'
import sys
from bridgemain import *
from _plugins import _plugin_logprintf, _plugin_logputs
def raw_input(prompt=''):
return GuiGetLineWindow(prompt)
def input(prompt=''):
return eval(GuiGetLineWindow(prompt))
class OutputHook(object):
def __... | mit |
iheitlager/django-rest-framework | tests/test_reverse.py | 79 | 1546 | from __future__ import unicode_literals
from django.conf.urls import url
from django.core.urlresolvers import NoReverseMatch
from django.test import TestCase
from rest_framework.reverse import reverse
from rest_framework.test import APIRequestFactory
factory = APIRequestFactory()
def null_view(request):
pass
... | bsd-2-clause |
numenta/nupic.research | projects/backprop_structure/dynamic_sparse_compat/runs/run_stochastic_synapses_mnist.py | 2 | 2517 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2019, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
freenas/samba | python/samba/provision/common.py | 39 | 2830 |
# Unix SMB/CIFS implementation.
# utility functions for provisioning a Samba4 server
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2010
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008-2009
# Copyright (C) Oliver Liebel <oliver@itc.li> 2008-2009
#
# Based on the original in EJS:
# Copyright (C) And... | gpl-3.0 |
hzlf/openbroadcast | website/apps/ashop/addressmodel/migrations/0001_initial.py | 18 | 6493 | # flake8: noqa
# 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 'Country'
db.create_table('addressmodel_country', (
('id', self.gf('djan... | gpl-3.0 |
Sir-Henry-Curtis/Ironworks | builtinPlugins/trakt.py | 10 | 3744 | try:
import json
except ImportError:
import simplejson as json
from flask import Flask, jsonify, render_template, request
import hashlib, jsonrpclib, urllib
from Maraschino import app
from maraschino.noneditable import *
from maraschino.tools import *
@app.route('/xhr/trakt')
@requires_auth
def xhr_trakt():
... | mit |
h4ck3rm1k3/orca-sonar | src/orca/scripts/apps/soffice/script_settings.py | 2 | 1269 | # Orca
#
# Copyright 2004-2008 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This... | lgpl-2.1 |
ScrambledEggsOnToast/UniversalGPS | tools/bin/cpplint.py | 23 | 158902 | #!/usr/bin/python
#
# Copyright (c) 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 of ... | bsd-3-clause |
xfournet/intellij-community | plugins/hg4idea/testData/bin/mercurial/similar.py | 96 | 3649 | # similar.py - mechanisms for finding similar files
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
import util
import mdiff
import bdiff
def _findexactmat... | apache-2.0 |
bmander/dancecontraption | django/utils/unittest/__init__.py | 571 | 3069 | """
unittest2
unittest2 is a backport of the new features added to the unittest testing
framework in Python 2.7. It is tested to run on Python 2.4 - 2.6.
To use unittest2 instead of unittest simply replace ``import unittest`` with
``import unittest2``.
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 P... | bsd-3-clause |
anorfleet/turntable | test/lib/python2.7/site-packages/numpy/lib/tests/test_arraysetops.py | 31 | 9766 | """Test functions for 1D array set operations.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_array_equal
)
from numpy.lib.arraysetops import (
ediff1d, intersect1d, setxor1d, union1d, setdiff1d, unique... | mit |
asser/django | tests/timezones/tests.py | 8 | 58383 | from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
from contextlib import contextmanager
from unittest import SkipTest, skipIf
from xml.dom.minidom import parseString
from django.contrib.auth.models import User
from django.core import serializers
from django.core.exceptions i... | bsd-3-clause |
kenorb/BitTorrent | twisted/python/hook.py | 90 | 5266 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I define support for hookable instance methods.
These are methods which you can register pre-call and post-call external
functions to augment their functionality. People familiar with more esoteric
languages may think of these a... | gpl-3.0 |
kubatyszko/xess_fp_wizard | xess_fp_wizard.py | 1 | 21733 | # MIT license
#
# Copyright (C) 2015 by XESS Corp.
#
# 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... | mit |
ibc/MediaSoup | worker/deps/gyp/test/win/gyptest-link-safeseh.py | 96 | 1684 | #!/usr/bin/env python
# Copyright (c) 2014 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.
"""
Make sure safeseh setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp()... | isc |
sunze/py_flask | venv/lib/python3.4/site-packages/pip/req/req_uninstall.py | 87 | 7107 | from __future__ import absolute_import
import imp
import logging
import os
import sys
import tempfile
from pip.compat import uses_pycache, WINDOWS
from pip.exceptions import UninstallationError
from pip.utils import (rmtree, ask, is_local, dist_is_local, renames,
normalize_path)
from pip.utils.... | mit |
eeshangarg/oh-mainline | vendor/packages/pytz/pytz/exceptions.py | 657 | 1333 | '''
Custom exceptions raised by pytz.
'''
__all__ = [
'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError',
'NonExistentTimeError',
]
class UnknownTimeZoneError(KeyError):
'''Exception raised when pytz is passed an unknown timezone.
>>> isinstance(UnknownTimeZoneError(), LookupError)... | agpl-3.0 |
javierTerry/odoo | openerp/tools/pdf_utils.py | 456 | 3659 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
abbeymiles/aima-python | submissions/Capps/vaccuum.py | 18 | 6467 | import agents as ag
import envgui as gui
import random
# ______________________________________________________________________________
loc_A, loc_B = (1, 1), (2, 1) # The two locations for the Vacuum world
def RandomVacuumAgent():
"Randomly choose one of the actions from the vacuum environment."
p = ag.Ra... | mit |
pdehaye/theming-edx-platform | cms/djangoapps/contentstore/management/commands/xlint.py | 23 | 1035 | """
Verify the structure of courseware as to it's suitability for import
To run test: rake cms:xlint DATA_DIR=../data [COURSE_DIR=content-edx-101 (optional parameter)]
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_importer import perform_xlint
class Command(BaseCom... | agpl-3.0 |
davidsminor/gaffer | python/GafferSceneUITest/ShaderAssignmentUITest.py | 1 | 2670 | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Red... | bsd-3-clause |
rszalski/python-gae-spike | lib/jinja2/sandbox.py | 637 | 13445 | # -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environm... | apache-2.0 |
collab-project/pyamf-release | release/builds/steps.py | 1 | 6261 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
import os
from release.builds import Builder
from release.builds import ShellCommand
def evaluateCommand(cmd):
r = Test.evaluateCommand(self, cmd)
if r is FAILURE:
return r
lines = self.getLog('stdio').readlines()
re_test_... | mit |
pazz/alot | alot/completion/multipleselection.py | 3 | 1846 | # Copyright (C) 2011-2019 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
from .completer import Completer
class MultipleSelectionCompleter(Completer):
"""
Meta-Completer that turns any Completer i... | gpl-3.0 |
Jual6332/FlaskWebpage | venv/lib/python2.7/site-packages/wheel/signatures/djbec.py | 566 | 6755 | # Ed25519 digital signatures
# Based on http://ed25519.cr.yp.to/python/ed25519.py
# See also http://ed25519.cr.yp.to/software.html
# Adapted by Ron Garret
# Sped up considerably using coordinate transforms found on:
# http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
# Specifically add-2008-hwcd-4 and d... | mit |
Liyier/learning_log | env/Lib/site-packages/django/dispatch/dispatcher.py | 50 | 11613 | import sys
import threading
import warnings
import weakref
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.inspect import func_accepts_kwargs
from django.utils.six.moves import range
if six.PY2:
from .weakref_backports import WeakMethod
else:
from w... | mit |
jfunez/scielo-manager | scielomanager/journalmanager/migrations/0028_auto__chg_field_journal_previous_ahead_documents__chg_field_journal_cu.py | 2 | 27532 | # 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):
# Changing field 'Journal.previous_ahead_documents'
db.alter_column('journalmanager_journal', 'previous_ah... | bsd-2-clause |
liyun074/gooDay | node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | apache-2.0 |
blaggacao/odoo | addons/auth_ldap/__openerp__.py | 108 | 4839 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
jonathanlurie/timelapseComposer | lib/python/gooey/_tmp/example_argparse_souce_in_try.py | 9 | 4831 | #!/usr/local/bin/python2.7
# encoding: utf-8
'''
TODO: Fix this. Currently breaks parser
bin.example_argparse_souce -- shortdesc
bin.example_argparse_souce is a description
It defines classes_and_methods
@author: user_name
@copyright: 2013 organization_name. All rights reserved.
@license: ... | mit |
maurofaccenda/ansible | lib/ansible/plugins/connection/lxd.py | 133 | 4283 | # (c) 2016 Matt Clay <matt@mystile.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) any later version.
#
... | gpl-3.0 |
mathdd/numpy | numpy/f2py/setup.py | 158 | 3925 | #!/usr/bin/env python
"""
setup.py for installing F2PY
Usage:
python setup.py install
Copyright 2001-2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIE... | bsd-3-clause |
ioram7/keystone-federado-pgid2013 | build/sqlalchemy/lib/sqlalchemy/dialects/oracle/cx_oracle.py | 17 | 30653 | # oracle/cx_oracle.py
# Copyright (C) 2005-2012 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
"""Support for the Oracle database via the cx_oracle driver.
Driver
------
The O... | apache-2.0 |
Serag8/Bachelor | google_appengine/lib/django-1.4/django/conf/locale/sr_Latn/formats.py | 655 | 1980 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_F... | mit |
nicolasderam/itools | itools/database/queries.py | 3 | 5913 | # -*- coding: UTF-8 -*-
# Copyright (C) 2004-2008, 2011 J. David Ibáñez <jdavid.ibp@gmail.com>
# Copyright (C) 2007 Henry Obein <henry.obein@gmail.com>
# Copyright (C) 2008 Sylvain Taverne <taverne.sylvain@gmail.com>
# Copyright (C) 2008, 2011 Hervé Cauwelier <herve@oursours.net>
# Copyright (C) 2008-2010 David Versmis... | gpl-3.0 |
leiferikb/bitpop | src/third_party/tlslite/tlslite/TLSRecordLayer.py | 3 | 45410 | # Authors:
# Trevor Perrin
# Google (adapted by Sam Rushing) - NPN support
# Martin von Loewis - python 3 port
#
# See the LICENSE file for legal information regarding use of this file.
"""Helper class for TLSConnection."""
from __future__ import generators
from .utils.compat import *
from .utils.cryptomath im... | gpl-3.0 |
karservice/kobra | kobra/api/v1/tests/test_students.py | 1 | 2617 | # -*- coding: utf-8 -*-
from django.contrib.auth.models import Permission
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from .... import factories, models
class StudentApiTests(APITestCase):
def test_retrieve_unauthenticated(self):
... | mit |
Precis/django-angular | djangular/templatetags/djangular_tags.py | 1 | 3443 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.template import Library
from django.template.base import Node, NodeList, TextNode, VariableNode
from django.core.exceptions import ImproperlyConfigured
from django.utils.safestring import mark_safe
from djangular.core.urlresolvers i... | mit |
zstackio/zstack-woodpecker | integrationtest/vm/simulator/timeout/test_sftp_nfs_create_root_volume_template_from_volume.py | 1 | 4659 | '''
New Test For Operations Timeout
@author: Quarkonics
'''
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.vm_operations as vm_ops
import zstackwoodpecker.operations.volume_operations as vo... | apache-2.0 |
sovietspy2/uzletiProject | python/Lib/symtable.py | 3 | 8075 | """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)
import warnings
import weakref
__... | gpl-3.0 |
harigowtham/sos | sos/plugins/openstack_ironic.py | 4 | 3122 | # Copyright (C) 2015 Red Hat, Inc., Lee Yarwood <lyarwood@redhat.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
... | gpl-2.0 |
dkillick/iris | lib/iris/tests/integration/test_regrid_equivalence.py | 5 | 9580 | # (C) British Crown Copyright 2016 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris 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 the License, or
# (at your option) any l... | lgpl-3.0 |
rayer4u/ipasign | views.py | 1 | 6797 | #coding:utf-8
from __future__ import print_function
from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponse
from django.http import Http404
from django.http import HttpResponseRedirect
from django.core.files import File
from django.core.urlresolvers import reverse
from... | mit |
cyclecomputing/boto | boto/mturk/__init__.py | 782 | 1108 | # Copyright (c) 2006,2007 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... | mit |
pratyushanand/linux | scripts/gdb/linux/symbols.py | 467 | 6343 | #
# gdb helper commands and functions for Linux kernel debugging
#
# load kernel and module symbols
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
import os
import re
from linux import module... | gpl-2.0 |
Prash88/my-wedding | node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 960 | 45344 | # 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | mit |
thnee/ansible | lib/ansible/modules/network/fortios/fortios_system_affinity_packet_redistribution.py | 13 | 10254 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
sudosurootdev/external_chromium_org | tools/telemetry/telemetry/value/summary.py | 58 | 6381 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from collections import defaultdict
from telemetry.value import failure
from telemetry.value import merge_values
from telemetry.value import skip
class Su... | bsd-3-clause |
andrewyoung1991/abjad | abjad/tools/lilypondparsertools/LilyPondParser.py | 1 | 47337 | # -*- encoding: utf-8 -*-
import itertools
import ply
from abjad.tools import abctools
from abjad.tools import durationtools
from abjad.tools import indicatortools
from abjad.tools import lilypondfiletools
from abjad.tools import markuptools
from abjad.tools import pitchtools
from abjad.tools import scoretools
from abj... | gpl-3.0 |
damdam-s/OCB | addons/document/__init__.py | 434 | 1128 | # -*- 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 |
moritzschaefer/kickercam | src/kickercam/labeling/interpolate.py | 1 | 1231 | #!/usr/bin/env python3
import argparse
import pandas as pd
import numpy as np
import sys
def interpolate(df):
new_index = pd.Index(range(df.index.max() + 1))
interpolate_df = pd.DataFrame(index=new_index).join(df)
for i, index in enumerate(df.index):
try:
index2 = df.index[i+1]
... | gpl-3.0 |
kyroskoh/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/analyzechangelog.py | 122 | 9725 | # 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 |
kanchenxi04/vnpy-app | vn.trader/ctaAlgo/strategy_TripleMa_v0.3.py | 1 | 32295 | # encoding: UTF-8
# 首先写系统内置模块
from datetime import datetime, timedelta, date
from time import sleep
# 其次,导入vnpy的基础模块
import sys
sys.path.append('C:\\vnpy-master\\vnpy-master\\vn.trader')
from vtConstant import EMPTY_STRING, EMPTY_INT, DIRECTION_LONG, DIRECTION_SHORT, OFFSET_OPEN, STATUS_CANCELLED, EMPTY_FLOA... | mit |
vijayendrabvs/ssl-neutron | neutron/agent/dhcp_agent.py | 6 | 24503 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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.apach... | apache-2.0 |
splice/splice-server | doc/conf.py | 1 | 7042 | # -*- coding: utf-8 -*-
#
# Splice Server documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 26 09:12:39 2012.
#
# 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.
#... | gpl-2.0 |
andrewzwicky/PUBGIS | pubgis/minimap_iterators/live.py | 1 | 1526 | import time
import mss
import numpy as np
from pubgis.minimap_iterators.generic import GenericIterator
class LiveFeed(GenericIterator):
def __init__(self, time_step, monitor):
super().__init__()
self.monitor = monitor
self.time_step = time_step
self.sct = mss.mss()
self.l... | gpl-3.0 |
dabapps/django-db-queue | django_dbq/tasks.py | 1 | 1026 | from django.conf import settings
TASK_LIST_KEY = "tasks"
FAILURE_HOOK_KEY = "failure_hook"
CREATION_HOOK_KEY = "creation_hook"
def get_next_task_name(job_name, current_task=None):
"""Given a job name and (optionally) a task name, return the
next task in the list. If the current_task is None, return the
... | bsd-2-clause |
michalpurzynski/ansible-nsm | roles/suricata/files/del_old_pcaps.py | 4 | 1090 | #!/usr/bin/python3
import os, sys
pcaps_path = "/nsm/pcaps"
pcap_prefix = "data.pcap"
threshold = 98
st = os.statvfs(pcaps_path)
free = (st.f_bavail * st.f_frsize)
total = (st.f_blocks * st.f_frsize)
used = (st.f_blocks - st.f_bfree) * st.f_frsize
try:
percent = (float(used) / total)
except ZeroDivisionError:
... | mpl-2.0 |
caktus/psf-salt | salt/_extensions/pillar/ca.py | 3 | 9939 | from __future__ import division
import binascii
import datetime
import os.path
import salt.minion
from salt._compat import string_types
import OpenSSL
def compound(tgt, minion_id=None):
opts = {'grains': __grains__}
if minion_id is not None:
if not isinstance(minion_id, string_types):
... | mit |
asedunov/intellij-community | python/helpers/profiler/thriftpy/transport/__init__.py | 25 | 2764 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from thriftpy._compat import CYTHON
from ..thrift import TType, TException
def readall(read_fn, sz):
buff = b''
have = 0
while have < sz:
chunk = read_fn(sz - have)
have += len(chunk)
buff += chunk
if len(ch... | apache-2.0 |
40223139/39g7test | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/draw.py | 603 | 6456 | from javascript import console
from browser import timer
import math
class Queue:
def __init__(self):
self._list=[]
def empty(self):
return len(self._list) == 0
def put(self, element):
self._list.append(element)
def get(self):
if len(self._list) == 0:
raise BaseError
... | gpl-3.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/docutils/transforms/frontmatter.py | 104 | 19347 | # $Id: frontmatter.py 7595 2013-01-21 17:33:56Z milde $
# Author: David Goodger, Ueli Schlaepfer <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Transforms related to the front matter of a document or a section
(information found before the main text):
- `DocTitle`: Used to tra... | mit |
interactiveinstitute/watthappened | python_modules/tornado/auth.py | 2 | 54378 | #!/usr/bin/env python
#
# Copyright 2009 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... | mit |
onejay09/kernel_HTC_msm7x30_KK | scripts/build-all.py | 308 | 9473 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... | gpl-2.0 |
sstjohn/pox | pox/messenger/test_client.py | 26 | 2396 | #!/usr/bin/env python
# Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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 ver... | gpl-3.0 |
priyankgada/python-for-hackers | Sources/Mail-bomber.py | 1 | 2384 | #www.youtube.com/priyankgada
#mail bomber - Python For Hackers - Priyank Gada
import smtplib #for SMTP Protocol
import mimetypes #converts URL
import sys #for System
import time #time
from email.MIMEText import MIMEText
class SMTP(object):
def title(self):
print " PYTHON MAIL BOMBER IS WORKIN... | gpl-3.0 |
cernops/CloudMan | cloudman/cloudman/validator.py | 1 | 1721 | '''
Created on May 25, 2012
@author:Malik Ehsanullah
'''
from django.core import validators
import re
from django.core.exceptions import ValidationError
#This will validate name check for char A-Z a-Z 0-9 and space and -
def validate_name(valueStr):
if not re.match(r'^[0-9a-z_.A-Z\s-]*$', valueStr): ... | apache-2.0 |
t794104/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_tags.py | 17 | 9237 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Daniel Korn <korndaniel1@gmail.com>
# (c) 2017, Yaacov Zamir <yzamir@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANS... | gpl-3.0 |
Stanford-Online/edx-platform | common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py | 14 | 23784 | """
Segregation of pymongo functions from the data modeling mechanisms for split modulestore.
"""
import datetime
import cPickle as pickle
import math
import zlib
import pymongo
import pytz
import re
from contextlib import contextmanager
from time import time
# Import this just to export it
from pymongo.errors import ... | agpl-3.0 |
lalinsky/flask | scripts/make-release.py | 145 | 4037 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make-release
~~~~~~~~~~~~
Helper script that performs a release. Does pretty much everything
automatically for us.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
import re
from dat... | bsd-3-clause |
faratro/django-oscar | tests/functional/dashboard/category_tests.py | 39 | 2020 | from django.core.urlresolvers import reverse
from oscar.test.testcases import WebTestCase
from oscar.apps.catalogue.models import Category
from oscar.apps.catalogue.categories import create_from_breadcrumbs
from oscar.test.factories import UserFactory
class TestCategoryDashboard(WebTestCase):
def setUp(self):
... | bsd-3-clause |
sodo13/openpli-gls | lib/python/Screens/AudioSelection.py | 15 | 17382 | from Screen import Screen
from Screens.Setup import getConfigMenuItem, Setup
from Screens.InputBox import PinInput
from Screens.MessageBox import MessageBox
from Components.ServiceEventTracker import ServiceEventTracker
from Components.ActionMap import NumberActionMap
from Components.ConfigList import ConfigListScreen
... | gpl-2.0 |
Foxfanmedium/python_training | OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/prompt_toolkit/filters/base.py | 20 | 6079 | from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from six import with_metaclass
from prompt_toolkit.utils import test_callable_args
__all__ = (
'Filter',
'Never',
'Always',
'Condition',
)
class Filter(with_metaclass(ABCMeta, object)):
"""
Filter to activate/de... | apache-2.0 |
OptimusGitEtna/RestSymf | Python-3.4.2/Modules/_decimal/tests/deccheck.py | 37 | 38937 | #
# Copyright (c) 2008-2012 Stefan Krah. 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 ... | mit |
wmayner/pyphi | test/test_relations.py | 1 | 2708 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# test_relations.py
import numpy as np
from pyphi import compute, config, examples, relations, utils
def test_maximal_states():
with config.override(
PARTITION_TYPE="TRI", MEASURE="BLD",
):
subsystem = examples.PQR()
ces = relations.sepa... | gpl-3.0 |
ReproducibleBuilds/diffoscope | tests/comparators/test_apk.py | 1 | 3503 | # -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2017 Maria Glukhova <siammezzze@gmail.com>
#
# diffoscope 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 Fou... | gpl-3.0 |
getninjas/adwords-client | adwords_client/storages.py | 1 | 1165 | import logging
import tempfile
import os
logger = logging.getLogger(__name__)
class FilesystemStorage:
"""
Just a Django-less storage w/ partial Django Storage API implemented
"""
def __init__(self, workdir):
self.workdir = workdir
def open(self, name, mode='rb', *args, **kwargs):
... | apache-2.0 |
aloksinha2001/rk3066-kernel | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
afandria/mojo | testing/legion/process.py | 15 | 7056 | # Copyright 2015 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.
"""RPC compatible subprocess-type module.
This module defined both a task-side process class as well as a controller-side
process wrapper for easier access ... | bsd-3-clause |
Drapegnik/bsu | cryptography/lab2/server/crypto/rsa.py | 1 | 1589 | import random
from math import gcd
def is_prime(x):
if x == 2:
return True
if x < 2 or x % 2 == 0:
return False
for n in range(3, int(x ** 0.5) + 2, 2):
if x % n == 0:
return False
return True
def multiplicative_inverse(e, phi):
"""
Euclid's extended algor... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.