repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
defivelo/django-parler | refs/heads/master | example/article/views.py | 7 | from django.utils.translation import get_language
from django.views.generic import ListView, DetailView
from .models import Article
from parler.views import TranslatableSlugMixin
class BaseArticleMixin(object):
# Only show published articles.
def get_queryset(self):
return super(BaseArticleMixin, self... |
pjsip/pjproject | refs/heads/master | tests/pjsua/scripts-sipp/uas-reinv-after-failed-nego.py | 1 | # $Id$
#
import inc_const as const
PJSUA = ["--null-audio --max-calls=1 --use-timer=3 --timer-se=90 --no-tcp $SIPP_URI"]
PJSUA_EXPECTS = [[0, const.STATE_CONFIRMED, "v"],
[0, "SDP rejected for test", ""],
[0, "Audio updated", "", 50] # wait for session timer refresh about 45 secs
... |
dhongu/l10n-romania | refs/heads/11.0 | __unported__/l10n_ro_contact_address/__openerp__.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Fekete Mihai <mihai.fekete@forbiom.eu>
# Copyright (C) 2016 FOREST AND BIOMASS SERVICES ROMANIA SA
# (http://www.forbiom.eu).
#
# This program is free software: you can redistribute it and/or... |
uni2u/neutron | refs/heads/master | neutron/plugins/cisco/extensions/credential.py | 37 | # Copyright 2013 Cisco Systems, 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 requir... |
rouault/Quantum-GIS | refs/heads/master | tests/src/python/test_provider_virtual.py | 4 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsVirtualLayerProvider
.. note:: 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... |
RafaelRMachado/qtwebkit | refs/heads/dev | Tools/Scripts/webkitpy/common/watchlist/watchlist_mock.py | 130 | # 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 f... |
foozmeat/lack | refs/heads/master | lack/__main__.py | 18 | from .main import main
main()
|
3203317/2013 | refs/heads/master | nsp/examples/Code/DevExample/trunk/foundation-portal/src/main/webapp/scripts/lib/fckeditor/editor/filemanager/connectors/py/upload.py | 53 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... |
Udala/docforever | refs/heads/master | pycoin/encoding.py | 14 | # -*- coding: utf-8 -*-
"""
Various utilities useful for converting one Bitcoin format to another, including some
the human-transcribable format hashed_base58.
The MIT License (MIT)
Copyright (c) 2013 by Richard Kiss
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and a... |
Snifer/BurpSuite-Plugins | refs/heads/master | Sqlmap/lib/core/decorators.py | 7 | #!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
def cachedmethod(f, cache={}):
"""
Method with a cached content
Reference: http://code.activestate.com/recipes/325205-cache-decorator-in-python-24/
"""
d... |
wreckJ/intellij-community | refs/heads/master | python/testData/completion/kwParamsInCodeGetUsage.py | 83 | def foo(**kwargs):
x = kwargs.get('x_param', None)
run(x_param)
def bar():
foo(x_<caret>) |
Phonebooth/depot_tools | refs/heads/master | third_party/boto/mashups/order.py | 101 | # 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... |
danakj/chromium | refs/heads/master | tools/json_to_struct/PRESUBMIT.py | 53 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for changes affecting tools/json_to_struct/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details... |
mfherbst/spack | refs/heads/develop | lib/spack/spack/cmd/list.py | 4 | ##############################################################################
# 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... |
vipjml/python-driver | refs/heads/master | tests/integration/cqlengine/operators/test_where_operators.py | 6 | # Copyright 2013-2016 DataStax, 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 writi... |
crwilcox/PyGithub | refs/heads/master | github/UserKey.py | 72 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
j-carl/boto | refs/heads/develop | tests/integration/ses/test_connection.py | 113 | from tests.unit import unittest
from boto.ses.connection import SESConnection
from boto.ses import exceptions
class SESConnectionTest(unittest.TestCase):
ses = True
def setUp(self):
self.ses = SESConnection()
def test_get_dkim_attributes(self):
response = self.ses.get_identity_dkim_attr... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/compute/instance_groups_utils.py | 3 | # 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 ag... |
sistemasmarcelocastro/pruebas-python | refs/heads/master | cursoPython1/s12l36.py | 1 | import logging
# Configuración del módulo logging
# loguear a la stdout
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
# loguear a un archivo
# logging.basicConfig(filename='s12l36.log', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
'''
#Program... |
ryfeus/lambda-packs | refs/heads/master | LightGBM_sklearn_scipy_numpy/source/sklearn/gaussian_process/tests/test_gpc.py | 31 | """Testing for Gaussian process classification """
# Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause
import numpy as np
from scipy.optimize import approx_fprime
from sklearn.gaussian_process import GaussianProcessClassifier
from sklearn.gaussian_process.kernels import RBF, Constant... |
wilhadams/Honors-Module | refs/heads/master | Newtons_Method_nl.py | 1 | import math
import csv
class Matrix(object):
def __init__(self, mat, augmented=False):
self.mat = mat
self.rows = len(mat)
if isinstance(mat[0], list):
self.cols = len(mat[0])
else:
self.cols = 1
self.augmented = augmented
self.t... |
mrquim/mrquimrepo | refs/heads/master | repo/script.video.F4mProxy/addon.py | 15 | import xbmc, xbmcgui
#get actioncodes from https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h
ACTION_PREVIOUS_MENU = 10
ACTION_SELECT_ITEM = 7
class MyClass(xbmcgui.Window):
def __init__(self):
self.strActionInfo = xbmcgui.ControlLabel(100, 120, 800, 400, '', 'font13', '0xFFFF00FF')
self.addContro... |
joshminnie/gulp-assets | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | 886 | # 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.
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
import gyp.generator... |
egtaonline/GameAnalysis | refs/heads/master | gameanalysis/rsgame.py | 1 | """Module for base role symmetric game structures
Role symmetric games have a number of common attributes and functions that are
defined in the RsGame class that actual RsGame interfaces should support. In
addition, an implementation of an EmptyGame is provided for convenience
purposes. Note, that the constructor to E... |
Kiiv/Sick-Beard | refs/heads/development | lib/hachoir_core/field/new_seekable_field_set.py | 90 | from lib.hachoir_core.field import BasicFieldSet, GenericFieldSet, ParserError, createRawField
from lib.hachoir_core.error import HACHOIR_ERRORS
# getgaps(int, int, [listof (int, int)]) -> generator of (int, int)
# Gets all the gaps not covered by a block in `blocks` from `start` for `length` units.
def getgaps(start,... |
rgaino/three.js | refs/heads/master | utils/converters/msgpack/msgpack/fallback.py | 641 | """Fallback pure Python implementation of msgpack"""
import sys
import array
import struct
if sys.version_info[0] == 3:
PY3 = True
int_types = int
Unicode = str
xrange = range
def dict_iteritems(d):
return d.items()
else:
PY3 = False
int_types = (int, long)
Unicode = unicode
... |
B-MOOC/edx-platform | refs/heads/master | common/djangoapps/pipeline_js/views.py | 162 | """
Views for returning XModule JS (used by requirejs)
"""
import json
from django.conf import settings
from django.http import HttpResponse
from staticfiles.storage import staticfiles_storage
from edxmako.shortcuts import render_to_response
def get_xmodule_urls():
"""
Returns a list of the URLs to hit to gra... |
UMD-SEAM/bugbox | refs/heads/master | framework/Exploits/CUTEFLOW_0017.py | 1 |
# Copyright 2013 University of Maryland. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE.TXT file.
import sys
import os
import time
from selenium.common.exceptions import NoAlertPresentException
import framework
class Exploit (framework.Exploit... |
Pablo126/SSBW | refs/heads/master | Entrega1/lib/python3.5/site-packages/django/contrib/postgres/forms/jsonb.py | 51 | import json
from django import forms
from django.utils import six
from django.utils.translation import ugettext_lazy as _
__all__ = ['JSONField']
class InvalidJSONInput(six.text_type):
pass
class JSONString(six.text_type):
pass
class JSONField(forms.CharField):
default_error_messages = {
'in... |
reidyd/legume | refs/heads/master | legume/netshared.py | 3 | # -*- coding: utf-8 -*-
# legume. Copyright 2009-2013 Dale Reidy. All rights reserved.
# See LICENSE for details.
__docformat__ = 'restructuredtext'
import socket
import errno
from legume.exceptions import *
USHRT_MAX = 65535
DEFAULT_TIMEOUT = float(10) # default timeout in seconds
PROTOCOL_VERSION = 4
def isVali... |
wendellpbarreto/dolly | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... |
dslutz/qemu | refs/heads/master | tests/acceptance/linux_ssh_mips_malta.py | 5 | # Functional test that boots a VM and run commands via a SSH session
#
# Copyright (c) Philippe Mathieu-Daudé <f4bug@amsat.org>
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
import os
import re
import base64
import logging
import time
... |
rickerc/neutron_audit | refs/heads/cis-havana-staging | neutron/tests/unit/nicira/test_fwaas_plugin.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 VMware, 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/lice... |
babyliynfg/cross | refs/heads/master | tools/project-creator/Python2.6.6/Lib/test/test_normalization.py | 1 | from test.test_support import run_unittest, open_urlresource, TestSkipped
import unittest
import sys
import os
from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest" + os.extsep + "txt"
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
... |
gelbander/blues | refs/heads/master | blues/uwsgi.py | 5 | """
uWSGI Blueprint
===============
Installs uWSGI and contains service tasks and other useful helpers for other blueprints to use.
Currently only acts as a provider for the application blueprint and can not be used standalone to deploy vassals.
**Fabric environment:**
.. code-block:: yaml
blueprints:
- b... |
Manuel4131/youtube-dl | refs/heads/master | youtube_dl/extractor/common.py | 6 | from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import re
import socket
import sys
import time
import xml.etree.ElementTree
from ..compat import (
compat_cookiejar,
compat_cookies,
compat_getpass,
compat_HTTPError,
compat_http... |
krader1961/python-mode | refs/heads/develop | pymode/libs2/rope/base/oi/soi.py | 16 | """A module for inferring objects
For more information see the documentation in `rope.base.oi`
package.
"""
import rope.base.builtins
import rope.base.pynames
import rope.base.pyobjects
from rope.base import evaluate, utils, arguments
_ignore_inferred = utils.ignore_exception(
rope.base.pyobjects.IsBeingInferre... |
netscaler/horizon | refs/heads/master | horizon/test/test_dashboards/cats/tigers/urls.py | 10 | from django.conf.urls.defaults import patterns # noqa
from django.conf.urls.defaults import url # noqa
from horizon.test.test_dashboards.cats.tigers.views import IndexView # noqa
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='index'),
)
|
andiwundsam/_of_normalize | refs/heads/carp | pox/openflow/__init__.py | 32 | # Copyright 2011 James McCauley
#
# 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 writi... |
jaggerkyne/PyKids | refs/heads/master | Part_01/Chapter_03/puzzels/favorites_games.py | 1 |
# Favorites Game
games = ["Cheses","Football","Drawing","Piano","Driving Car"]
print(games)
foods = ["Milk", "Beef", "Prok", "rice"]
print(foods)
favorites = games + foods
print(favorites)
|
kissf-lu/ukl-gsvc-web | refs/heads/master | app/models.py | 3 | # -*- coding: utf-8 -*-
import hashlib
from datetime import datetime
import bleach
from flask import current_app, request, url_for
from flask_login import UserMixin, AnonymousUserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from markdown import markdown
from werkzeug.security import g... |
zhouyao1994/incubator-superset | refs/heads/master | superset/migrations/versions/fee7b758c130_.py | 5 | # 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 u... |
firebitsbr/infernal-twin | refs/heads/master | build/pillow/PIL/XbmImagePlugin.py | 26 | #
# The Python Imaging Library.
# $Id$
#
# XBM File handling
#
# History:
# 1995-09-08 fl Created
# 1996-11-01 fl Added save support
# 1997-07-07 fl Made header parser more tolerant
# 1997-07-22 fl Fixed yet another parser bug
# 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.4)
# 2001-05-13 fl Ad... |
OpenAgInitiative/gro-api | refs/heads/master | gro_api/actuators/serializers.py | 1 | from rest_framework import serializers
from ..gro_api.serializers import BaseSerializer
from .models import (
ActuatorType, ControlProfile, ActuatorEffect, Actuator, ActuatorState
)
class ActuatorTypeSerializer(BaseSerializer):
class Meta:
model = ActuatorType
def validate(self, data):
ef... |
2ndQuadrant/ansible | refs/heads/master | lib/ansible/plugins/doc_fragments/cloudstack.py | 31 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard cloudstack documentation fragment
DOCUMENTATION = r'''
options:
api_key:
description:
... |
paulfurley/python-utcdatetime | refs/heads/master | utcdatetime/tests/test_now.py | 1 | import utcdatetime
from nose.tools import assert_equal
from freezegun import freeze_time
from datetime import datetime
TEST_CASES = [
(datetime(2015, 5, 11, 16, 43), (2015, 5, 11, 16, 43, 0)),
]
def test_now_method():
for local_datetime, expected_utc in TEST_CASES:
yield _assert_now_equals, local_... |
40223232/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testmagicmethods.py | 737 | import unittest
import inspect
import sys
from unittest.mock import Mock, MagicMock, _magics
class TestMockingMagicMethods(unittest.TestCase):
def test_deleting_magic_methods(self):
mock = Mock()
self.assertFalse(hasattr(mock, '__getitem__'))
mock.__getitem__ = Mock()
self.asser... |
tayfun/django | refs/heads/master | tests/fixtures_regress/models.py | 281 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Animal(models.Model):
name = models.CharField(max_length=150)
latin_na... |
apprentice3d/Wox | refs/heads/master | PythonHome/Lib/site-packages/pip/_vendor/html5lib/__init__.py | 196 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
wummel/linkchecker | refs/heads/master | third_party/dnspython/dns/rdtypes/ANY/__init__.py | 59 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
Danisan/odoo-1 | refs/heads/8.0 | addons/lunch/report/__init__.py | 441 | # -*- encoding: 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 G... |
nkgilley/home-assistant | refs/heads/dev | homeassistant/components/openhome/const.py | 21 | """Constants for the Openhome component."""
DOMAIN = "openhome"
SERVICE_INVOKE_PIN = "invoke_pin"
ATTR_PIN_INDEX = "pin"
DATA_OPENHOME = "openhome"
|
helldorado/ansible | refs/heads/devel | test/units/module_utils/basic/test_set_mode_if_different.py | 23 | # -*- coding: utf-8 -*-
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ =... |
h3llrais3r/SickRage | refs/heads/master | sickrage/providers/__init__.py | 18 | # coding=utf-8
__all__ = []
|
hifly/OpenUpgrade | refs/heads/8.0 | addons/l10n_co/wizard/__init__.py | 313 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) David Arnold (devCO).
# Author David Arnold (devCO), dar@devco.co
# Co-Authors Juan Pablo Aries (devCO), jpa@devco.co
# Hector Iva... |
blockc/fabric | refs/heads/master | bddtests/common/configuration_pb2.py | 16 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: common/configuration.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflect... |
asm0dey/Flexget | refs/heads/master | flexget/plugins/operate/verify_ssl_certificates.py | 8 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin, validator
from flexget.event import event
log = logging.getLogger('verify_ssl')
class VerifySSLCertificates(object):
"""
Plugin that can off SSL certificate verification.
Example::
verify... |
Gavinzll/reveal-gavin.js | refs/heads/master | node_modules/node-sass/node_modules/node-gyp/gyp/gyptest.py | 1752 | #!/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.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... |
DARKPOP/external_chromium_org | refs/heads/dark-5.1 | tools/telemetry/telemetry/core/bitmap.py | 42 | # 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.
"""
Bitmap is a basic wrapper for image pixels. It includes some basic processing
tools: crop, find bounding box of a color and compute histogram of color va... |
bwhmather/cryptography | refs/heads/master | src/cryptography/hazmat/bindings/openssl/rsa.py | 15 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/rsa.h>
"""
TYPES = """
typedef struct r... |
lepistone/odoo | refs/heads/master | openerp/osv/orm.py | 2 | # -*- 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... |
pferreir/indico | refs/heads/master | indico/modules/events/roles/views.py | 4 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.modules.events.management.views import WPEventManagement
class WPEventRoles(WPEventManagemen... |
kenshay/ImageScript | refs/heads/master | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/modulegraph/modulegraph_tests/testpkg-packages/pkg/__init__.py | 26 | """ pkg.init """
|
sreejithr/emacs.d | refs/heads/master | pyenv/emacs/lib/python2.7/site-packages/rope/base/oi/memorydb.py | 69 | from rope.base.oi import objectdb
class MemoryDB(objectdb.FileDict):
def __init__(self, project, persist=None):
self.project = project
self._persist = persist
self.files = self
self._load_files()
self.project.data_files.add_write_hook(self.write)
def _load_files(self)... |
fishcorn/pylearn2 | refs/heads/master | pylearn2/scripts/tests/test_summarize_model.py | 44 | """
A unit test for the summarize_model.py script
"""
from theano.compat.six.moves import cPickle
import os
from pylearn2.testing.skip import skip_if_no_matplotlib
from pylearn2.models.mlp import MLP, Linear
from pylearn2.scripts.summarize_model import summarize
def test_summarize_model():
"""
Asks the summa... |
LiveZenLK/CeygateERP | refs/heads/master | addons/mrp_byproduct/__init__.py | 45 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import mrp_byproduct
|
PlayUAV/MissionPlanner | refs/heads/master | Lib/inspect.py | 50 | # -*- coding: iso-8859-1 -*-
"""Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (func_*, co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of t... |
ChristopherHogan/pip | refs/heads/develop | pip/_vendor/requests/packages/chardet/jpcntx.py | 1776 | ######################## 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... |
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-1.2/tests/regressiontests/cache/models.py | 106 | from django.db import models
from datetime import datetime
def expensive_calculation():
expensive_calculation.num_runs += 1
return datetime.now()
class Poll(models.Model):
question = models.CharField(max_length=200)
answer = models.CharField(max_length=200)
pub_date = models.DateTimeField('date pu... |
GeoscienceAustralia/amazonia | refs/heads/master | amazonia/classes/elb.py | 1 | #!/usr/bin/python3
import troposphere.elasticloadbalancing as elb
from amazonia.classes.security_enabled_object import LocalSecurityEnabledObject
from troposphere import Tags, Ref, Output, Join, GetAtt, route53
class Elb(LocalSecurityEnabledObject):
def __init__(self, title, template, network_config, elb_config)... |
simpleenergy/epochdatetimefield | refs/heads/master | epochdatetimefield/tests/test_models.py | 1 | import datetime
from django.utils import timezone
from django.test import TestCase
from .models import (
TestModel, TestModelWithNullableField,
)
class EpochDateTimeFieldTest(TestCase):
"""
Custom Settings Test case where we need to dynamically create a test model
that has the custom field we've cre... |
efornal/pulmo | refs/heads/master | app/middleware.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.utils import translation
import logging
class ForceLangMiddleware:
def process_request(self, request):
if not translation.LANGUAGE_SESSION_KEY in request.session \
or not request.session[... |
ivanovev/fio | refs/heads/master | srv/FIO32M1.py | 1 | # -*- coding: utf-8 -*-
## @package fio.srv.FIO32M1
# Блок цифро-аналогового вывода или аналого-цифрового ввода
# @n Функции зарегистрированные через xmlrpc имеют префикс FIO32M1.
import time
from util.socketio import get_fsz
try:
from ctl.srv.SAM7X import SAM7X_telnet as telnet, SAM7X_send_file, SAM7X_recv_file
... |
malicialab/avclass | refs/heads/master | avclass/avclass_alias_detect.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
AVClass Alias detect
'''
import sys
import argparse
import subprocess
import os
def main(args):
# Set input switch
itype = '-vt' if args.vt else '-lb'
ifile = args.vt if args.vt else args.lb
# Set generic tokens file if provided
gen_switch = "-gen... |
pwnieexpress/raspberry_pwn | refs/heads/master | src/pentest/sslstrip/sslstrip/CookieCleaner.py | 107 | # Copyright (c) 2004-2011 Moxie Marlinspike
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distri... |
Lujeni/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_vpn_ssl_web_host_check_software.py | 21 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
dtrip/CFZoneImport | refs/heads/master | src/CrimeFlare.py | 1 | import urllib
class CrimeFlare:
"""Docstring for CrimeFlare. """
def __init__(self):
return True
def process(self):
self.download();
return True
def download(self):
DLFile = urllib.URLopener()
DLFile.retrieve(self.config.CrimeFlare.DownloadFile, self.confi... |
alyiwang/WhereHows | refs/heads/master | wherehows-etl/src/main/resources/jython/requests/packages/chardet/__init__.py | 1777 | ######################## 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... |
rtucker-mozilla/inventory | refs/heads/master | vendor-local/src/django-extensions/build/lib/django_extensions/management/commands/passwd.py | 41 | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
import getpass
class Command(BaseCommand):
help = "Clone of the UNIX program ``passwd'', for django.contrib.auth."
requires_model_validation = False
def handle(self, *args, **options):
i... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/lib/tests/test__iotools.py | 33 | from __future__ import division, absolute_import, print_function
import sys
import time
from datetime import date
import numpy as np
from numpy.compat import asbytes, asbytes_nested
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal
)
from numpy.lib._iotools import (
LineSplitte... |
f5devcentral/f5-cccl | refs/heads/master | f5_cccl/utils/json_pos_patch.py | 2 | """Provides functions for making jsonpatch positionally independent."""
# coding=utf-8
#
# Copyright 2018 F5 Networks 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.ap... |
kiwicopple/MyMDb | refs/heads/master | venv/Lib/site-packages/docutils/core.py | 117 | # $Id: core.py 7466 2012-06-25 14:56:51Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Calling the ``publish_*`` convenience functions (or instantiating a
`Publisher` object) with component names will result in default
behavior. For custom beha... |
ActionAdam/osmc | refs/heads/master | package/mediacenter-addon-osmc/src/script.module.osmcsetting.pioverclock/resources/lib/gui.py | 13 | # Standard Modules
from collections import namedtuple
# XBMC Modules
import xbmcaddon
import xbmcgui
__addon__ = xbmcaddon.Addon('script.module.osmcsetting.pioverclock')
# __addonid__ = __addon__.getAddonInfo('script.module.osmcsetting.piovQQQerclock').getAddonInfo('id')
def lang(id):
sa... |
finron/luokr.com | refs/heads/master | www.luokr.com/app/ctrls/voice.py | 1 | #coding=utf-8
from basic import BasicCtrl
class VoiceCtrl(BasicCtrl):
def post(self):
if not self.human_valid():
self.flash(0, {'msg': '验证码错误'})
return
post = self.model('posts').get_by_pid(self.datum('posts'), self.input('poid'))
if not post:
self.flas... |
cuongnv23/ansible | refs/heads/devel | test/integration/targets/module_utils/other_mu_dir/facts.py | 294 | data = 'should not be visible facts.py'
|
kamenim/samba | refs/heads/master | source4/scripting/bin/gen_hresult.py | 19 | #!/usr/bin/env python
#
# Unix SMB/CIFS implementation.
#
# HRESULT Error definitions
#
# Copyright (C) Noel Power <noel.power@suse.com> 2014
#
# 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; e... |
ryanrdetzel/pjsip | refs/heads/master | tests/pjsua/scripts-sipp/uac-ticket-1148.py | 2 | # $Id: uac-ticket-1148.py 4177 2012-06-26 02:28:59Z nanang $
#
import inc_const as const
PJSUA = ["--null-audio --max-calls=1 --auto-answer=200"]
PJSUA_EXPECTS = [[0, const.STATE_CONFIRMED, "v"]]
|
nekulin/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/ScriptBinding.py | 52 | """Extension to execute code outside the Python shell window.
This adds the following commands:
- Check module does a full syntax check of the current module.
It also runs the tabnanny to catch any inconsistent tabs.
- Run module executes the module's code in the __main__ namespace. The window
must have been sa... |
philippj/python-burningseries | refs/heads/master | base.py | 1 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
#python-burningseries Copyright (C) 2015 Philipp J.
'''
YOWSUP 2.0
https://github.com/tgalal/yowsup
'''
'''
python-burningseries
# Please don... |
dkluffy/dkluff-code | refs/heads/master | code/opencv/ai_yys/advscript.py | 1 | import os
import random
import time
from pymouse import PyMouse
from commscript import Robot
from basev import *
import ConfigParser
STUCKLIST=["bxz", "bfail1","cancelm"]
_CFG_FILENAME="bot.conf"
###########################################################################
def yhcomm(t):
print "R... |
hrashk/sympy | refs/heads/master | doc/src/modules/mpmath/plots/besselj.py | 17 | # Bessel function J_n(x) on the real line for n=0,1,2,3
j0 = lambda x: besselj(0,x)
j1 = lambda x: besselj(1,x)
j2 = lambda x: besselj(2,x)
j3 = lambda x: besselj(3,x)
plot([j0,j1,j2,j3],[0,14])
|
10clouds/edx-platform | refs/heads/dev | common/djangoapps/terrain/stubs/video_source.py | 181 | """
Serve HTML5 video sources for acceptance tests
"""
from SimpleHTTPServer import SimpleHTTPRequestHandler
from .http import StubHttpService
from contextlib import contextmanager
import os
from logging import getLogger
LOGGER = getLogger(__name__)
class VideoSourceRequestHandler(SimpleHTTPRequestHandler):
"""
... |
invisiblek/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/tlslite/integration/TLSSocketServerMixIn.py | 320 | """TLS Lite + SocketServer."""
from gdata.tlslite.TLSConnection import TLSConnection
class TLSSocketServerMixIn:
"""
This class can be mixed in with any L{SocketServer.TCPServer} to
add TLS support.
To use this class, define a new class that inherits from it and
some L{SocketServer.TCPServer} (wi... |
edcast-inc/edx-platform-edcast | refs/heads/master | lms/djangoapps/oauth2_handler/handlers.py | 76 | """ Handlers for OpenID Connect provider. """
from django.conf import settings
from django.core.cache import cache
from xmodule.modulestore.django import modulestore
from courseware.access import has_access
from openedx.core.djangoapps.user_api.models import UserPreference
from student.models import anonymous_id_for_... |
bunnyitvn/webptn | refs/heads/master | build/lib.linux-i686-2.7/django/contrib/admin/actions.py | 101 | """
Built-in, globally-available admin actions.
"""
from django.core.exceptions import PermissionDenied
from django.contrib.admin import helpers
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.template.response import TemplateResponse
from django.utils... |
zzicewind/nova | refs/heads/master | nova/baserpc.py | 70 | #
# Copyright 2013 Red Hat, 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 ag... |
jobiols/server-tools | refs/heads/8.0 | auth_admin_passkey/tests/test_auth_admin_passkey.py | 10 | # -*- coding: utf-8 -*-
# Copyright (C) 2013-2014 GRAP (http://www.grap.coop)
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import threading
from openerp.tests.common import TransactionCase
class TestAuthAdminPasskey(TransactionCase):
... |
maurizioandreotti/D-Rats-0.3.ev | refs/heads/master | ENV/lib/python2.7/site-packages/d_rats/agw.py | 4 | import struct
import utils
import sys
import socket
import threading
class AGWFrame:
kind = 0
def __init__(self):
self.port = 0
self.res1 = self.res2 = self.res3 = 0
self.res4 = self.res5 = self.res6 = 0
self.pid = 0;
self.call_from = "".ljust(10)
self.call_to =... |
40223227/2015cdbg6w0622-40223227- | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/sprite.py | 603 | ## pygame - Python Game Library
## Copyright (C) 2000-2003, 2007 Pete Shinners
## (C) 2004 Joe Wreschnig
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; e... |
JonasThomas/free-cad | refs/heads/master | src/Mod/Test/Init.py | 3 | # FreeCAD init script of the test module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.