repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
bjornlevi/5thpower | refs/heads/master | afmaeli/env/lib/python3.6/site-packages/chardet/cp949prober.py | 289 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
nikolas/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/error_module.py | 115 | """
Modules that get shown to the users when an error has occurred while
loading or rendering other modules
"""
import hashlib
import logging
import json
import sys
from lxml import etree
from xmodule.x_module import XModule, XModuleDescriptor
from xmodule.errortracker import exc_info_to_str
from xblock.fields import... |
spesmilo/electrum | refs/heads/master | electrum/address_synchronizer.py | 3 | # Electrum - lightweight Bitcoin client
# Copyright (C) 2018 The Electrum Developers
#
# 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 ... |
kisna72/django | refs/heads/master | tests/template_tests/alternate_urls.py | 452 | from django.conf.urls import url
from . import views
urlpatterns = [
# View returning a template response
url(r'^template_response_view/$', views.template_response_view),
# A view that can be hard to find...
url(r'^snark/', views.snark, name='snark'),
]
|
xianggong/m2c_unit_test | refs/heads/master | test/operator/unary_plus_uchar/compile.py | 1861 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... |
Pandaaaa906/ChemErpSystem | refs/heads/master | WriteTogether/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
MER-GROUP/intellij-community | refs/heads/master | python/testData/inspections/PyGlobalUndefinedInspection/truePositive.py | 75 | __author__ = 'ktisha'
def foo():
global <weak_warning descr="Global variable 'bar' is undefined at the module level">bar</weak_warning>
print bar
foo() |
memtoko/django | refs/heads/master | tests/known_related_objects/models.py | 166 | """
Existing related object instance caching.
Test that queries are not redone when going back through known relations.
"""
from django.db import models
class Tournament(models.Model):
name = models.CharField(max_length=30)
class Organiser(models.Model):
name = models.CharField(max_length=30)
class Pool... |
edmorley/django | refs/heads/master | tests/flatpages_tests/test_models.py | 40 | from django.contrib.flatpages.models import FlatPage
from django.test import SimpleTestCase
from django.test.utils import override_script_prefix
class FlatpageModelTests(SimpleTestCase):
def test_get_absolute_url_urlencodes(self):
pf = FlatPage(title="Café!", url='/café/')
self.assertEqual(pf.get... |
hsnlab/escape | refs/heads/master | pox/tests/unit/lib/addresses_test.py | 4 | # Copyright 2012 Colin Scott
# Copyright 2012,2013 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 ap... |
zv1n/pycmef | refs/heads/master | pycmef/mixins/event_manager.py | 1 | #!/usr/bin/env python
import json
"""
Handles events passed from the ThinClient
"""
class EventManagerMixin(object):
def configure(self):
try:
getattr(self, '__event_handlers__')
return True
except AttributeError:
self.__event_handlers__ = {}
return False
def get_event_... |
falbassini/googleads-dfa-reporting-samples | refs/heads/master | python/v2.1/create_instream_video_creative.py | 3 | #!/usr/bin/python
#
# 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 b... |
leafclick/intellij-community | refs/heads/master | python/testData/intentions/addMissingVarargsInGoogleDocString_after.py | 53 | def f(x, *args, **kwargs):
"""
Args:
*args:
**kwargs:
x: foo
""" |
TheCacophonyProject/Full_Noise | refs/heads/master | test/test_device_cacophony_index.py | 1 | from datetime import datetime, timedelta
from dateutil import tz
from .helper import Helper
from test.testexception import AuthorizationError
class TestDeviceCacophonyIndex:
@classmethod
def setup_class(cls):
helper = Helper()
print("If a user Johnny wants to access the cacophony index for a d... |
WhireCrow/openwrt-mt7620 | refs/heads/master | staging_dir/host/lib/python2.7/mailcap.py | 351 | """Mailcap file handling. See RFC 1524."""
import os
__all__ = ["getcaps","findmatch"]
# Part 1: top-level interface.
def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to ... |
cro55er/yogaTest | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py | 2479 | #!/usr/bin/env python
# Copyright (c) 2013 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.
""" Unit tests for the xcode.py file. """
import gyp.generator.xcode as xcode
import unittest
import sys
class TestEscapeXcodeDefine(unit... |
wvxvw/intj | refs/heads/master | intj/__init__.py | 1 | #!/usr/bin/env python
# intj.com is the site where INTJs do everything
# like they would do it on Twitter, but not quite
import logging
import time
import re
from py2neo import neo4j, node, rel
import tornado.ioloop
from tornado.options import define, options
from tornado.httputil import url_concat
import tornado.web
... |
uberamd/NGECore2 | refs/heads/master | scripts/object/mobile/blurrg_hue.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/dungeon/wall_terminal_s1.py | 85615 | import sys
def setup(core, object):
return |
15th/simpleat | refs/heads/master | tests/http/sampleclient/allprotocols.py | 1 | #!/usr/bin/env python
#coding=utf-8
# Filename: allprotocols.py
'''
客户端接口数据
@author: zxd
@data: 2017.6.1
'''
CLIENTTOKEN = ''
def p200202():
'''用户登录'''
return {
'transCode': '',
'clientToken': '',
'body': {
'usrPwd': '12345678',
'usrMobileNum': '13812345678'
... |
Titan-C/sympy | refs/heads/master | sympy/external/tests/test_sage.py | 29 | # This testfile tests SymPy <-> Sage compatibility
#
# Execute this test inside Sage, e.g. with:
# sage -python bin/test sympy/external/tests/test_sage.py
#
# This file can be tested by Sage itself by:
# sage -t sympy/external/tests/test_sage.py
# and if all tests pass, it should be copied (verbatim) to Sage, so that i... |
ngaut/vitess | refs/heads/master | test/vertical_split.py | 1 | #!/usr/bin/env python
#
# Copyright 2013, 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 logging
import threading
import struct
import time
import unittest
from zk import zkocc
from vtdb import topology
from vtdb import vtc... |
BRCDcomm/pynos | refs/heads/master | pynos/versions/ver_7/ver_7_1_0/yang/brocade_mld_snooping.py | 4 | #!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_mld_snooping(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def mld_snooping_ipv6_pim_snooping_pimv6_enable(self, **kwargs):
"""Auto Generat... |
sinkuri256/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_hashlib.py | 47 | # Test hashlib module
#
# $Id$
#
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
import array
import hashlib
import itertools
import sys
try:
import threading
except ImportError:
threading = None
import unittest
import warnings
from test impor... |
mikewiebe-ansible/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_l3out_route_tag_policy.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
cogeorg/black_rhino | refs/heads/master | examples/Georg2012/production/networkx/algorithms/approximation/ramsey.py | 10 | # -*- coding: utf-8 -*-
"""
Ramsey numbers.
"""
# Copyright (C) 2011 by
# Nicholas Mancuso <nick.mancuso@gmail.com>
# All rights reserved.
# BSD license.
import networkx as nx
__all__ = ["ramsey_R2"]
__author__ = """Nicholas Mancuso (nick.mancuso@gmail.com)"""
def ramsey_R2(graph):
r"""Approximately comput... |
nicoTrombon/DjangoPolls | refs/heads/master | env/Lib/site-packages/django/utils/synch.py | 586 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
import contextlib
import threading
class RWLock(object):
"""
Classic implementation of reader-writer lock with preference to writers.
Readers can access a resource simult... |
jaimahajan1997/sympy | refs/heads/master | sympy/physics/mechanics/linearize.py | 20 | from __future__ import print_function, division
__all__ = ['Linearizer']
from sympy.core.backend import Matrix, eye, zeros
from sympy import Dummy
from sympy.utilities.iterables import flatten
from sympy.physics.vector import dynamicsymbols
from sympy.physics.mechanics.functions import msubs
import collections
clas... |
eyaler/tensorpack | refs/heads/master | tests/case_script.py | 3 | from abc import abstractproperty
import unittest
import subprocess
import shlex
import sys
import threading
import os
import shutil
class PythonScript(threading.Thread):
"""A wrapper to start a python script with timeout.
To test the actual models even without GPUs we simply start them and
test whether t... |
Neoklosch/Motey | refs/heads/master | samples/docker/__main__.py | 1 | import signal
import sys
import docker
def signal_handler(signal, frame):
print('shutdown...')
sys.exit(0)
def main():
client = docker.DockerClient(base_url='unix://var/run/docker.sock')
kwargs = {
'ports': {
'5238/tcp': 5239
},
'name': 'motey_alpine'
}
c... |
sunshinelover/chanlun | refs/heads/master | vn.demo/ctpdemo/demoUi - 副本.py | 1 | # encoding: UTF-8
"""
该文件中包含的是交易平台的上层UI部分,
通过图形界面调用中间层的主动函数,并监控相关数据更新。
Monitor主要负责监控数据,有部分包含主动功能。
Widget主要用于调用主动功能,有部分包含数据监控。
"""
from __future__ import division
import time
import sys
import shelve
from collections import OrderedDict
import sip
from PyQt4 import QtCore, QtGui
from eventEngine import *
#######... |
whitehats/monitowl-agent | refs/heads/master | whmonit/client/sensors/check_amqp/linux_01.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Sensor that connects to amqp server and checks queue.
'''
from whmonit.client.sensors import TaskSensorBase
class Sensor(TaskSensorBase):
"""
Sensor class that checks queue in amqp server using pika lib.
"""
name = 'check_amqp'
streams = {
... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/datalake/azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/catalog/models/usql_table_preview_py3.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
sabi0/intellij-community | refs/heads/master | python/testData/editing/incompleteFunctionTypeComment.after.py | 21 | def foo(bar):
# type: (foo. |
mablae/weblate | refs/heads/master | weblate/trans/south_migrations/0009_add_set_translation_team.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eithe... |
Ensembles/ert | refs/heads/master | python/python/ert/well/well_time_line.py | 1 | from cwrap import BaseCClass
from ert.well import WellState, WellPrototype
class WellTimeLine(BaseCClass):
TYPE_NAME = "well_time_line"
_size = WellPrototype("int well_ts_get_size(well_time_line)")
_name = WellPrototype("char* well_ts_get_name(well_time_line)")
_iget = WellPrototype("well_state_ref wel... |
raphaelmerx/django | refs/heads/master | tests/gis_tests/geos_tests/test_geos.py | 150 | from __future__ import unicode_literals
import ctypes
import json
import random
import unittest
from binascii import a2b_hex, b2a_hex
from io import BytesIO
from unittest import skipUnless
from django.contrib.gis import gdal
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import (
HAS_GE... |
ppwwyyxx/tensorflow | refs/heads/master | tensorflow/python/framework/graph_util_test.py | 5 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
artPlusPlus/dijon | refs/heads/master | dijon/_nodes/_object.py | 1 | from ._data_node import DataNode
from .._exceptions import ObjectFieldError
class Object(DataNode):
def __init__(self, path, data):
super(Object, self).__init__(path, data)
self._fields = {}
def keys(self):
return self._fields.keys()
def get(self, field_name, default=None):
... |
sujeet4github/MyLangUtils | refs/heads/master | LangPython/oreilly-intro-to-flask-video/venv/lib/python3.6/site-packages/sqlalchemy/event/base.py | 33 | # event/base.py
# Copyright (C) 2005-2017 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
"""Base implementation classes.
The public-facing ``Events`` serves as the base class... |
aitgon/wopmars | refs/heads/master | wopmars/data/example/model/DatedPiece.py | 1 | from sqlalchemy.sql.sqltypes import Date
from sqlalchemy import Column
from model.Piece import Piece
class DatedPiece(Piece):
date = Column(Date)
|
farseenabdulsalam/wap-proxy | refs/heads/master | Imagify.py | 1 | from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from pathlib import Path
from subprocess import run
# TODO: Move config vars up the level
# Config Vars
FULLIMG_SIZE = (256,256)
CROPIMG_RESIZE_PCT = '50%'
CROPIMG_SIZE = (128,1024)
CROPIMG_PRE... |
scripni/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/werkzeug/contrib/cache.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.cache
~~~~~~~~~~~~~~~~~~~~~~
The main problem with dynamic Web sites is, well, they're dynamic. Each
time a user requests a page, the webserver executes a lot of code, queries
the database, renders templates until the visitor gets the page he sees.
... |
OS2World/APP-INTERNET-torpak_2 | refs/heads/master | Lib/compiler/future.py | 15 | """Parser for future statements
"""
from compiler import ast, walk
def is_future(stmt):
"""Return true if statement is a well-formed future statement"""
if not isinstance(stmt, ast.From):
return 0
if stmt.modname == "__future__":
return 1
else:
return 0
class FutureParser:
... |
getlantern/lantern-java | refs/heads/master | install/linux_x86_32/pt/fteproxy/Crypto/Cipher/DES.py | 7 | # -*- coding: utf-8 -*-
#
# Cipher/DES.py : DES
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# n... |
wittekm/synergy-multi-monitor | refs/heads/master | tools/gmock-1.6.0/test/gmock_test_utils.py | 222 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
muntasirsyed/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/id/forms.py | 311 | """
ID-specific Form helpers
"""
import re
import time
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
postcode_re = re.compil... |
chubbymaggie/angr | refs/heads/master | angr/surveyors/slicecutor.py | 3 | #!/usr/bin/env python
import logging
l = logging.getLogger("angr.surveyors.slicecutor")
from .surveyor import Surveyor
from ..errors import AngrExitError
from collections import defaultdict
# pylint: disable=W0212,
#
# HappyGraph is just here for testing. Please ignore it!
#
class HappyGraph(object):
def __ini... |
webmasterraj/GaSiProMo | refs/heads/master | flask/lib/python2.7/site-packages/sqlalchemy/sql/dml.py | 40 | # sql/dml.py
# Copyright (C) 2009-2015 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
"""
Provide :class:`.Insert`, :class:`.Update` and :class:`.Delete`.
"""
from .base impo... |
eviljeff/olympia | refs/heads/master | src/olympia/git/tests/test_admin.py | 1 | from django.contrib.admin.sites import AdminSite
from pyquery import PyQuery as pq
from olympia.amo.tests import TestCase, addon_factory, user_factory
from olympia.amo.urlresolvers import reverse
from olympia.git.admin import GitExtractionEntryAdmin
from olympia.git.models import GitExtractionEntry
class TestGitExt... |
Wireless-Innovation-Forum/Spectrum-Access-System | refs/heads/master | src/lib/usgs_pop/usgs_pop_driver.py | 1 | # Copyright 2020 SAS Project 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 requ... |
josenavas/qiime | refs/heads/master | qiime/make_per_library_sff.py | 15 | #!/usr/bin/env python
from __future__ import division
__author__ = "Kyle Bittinger"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Kyle Bittinger"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Kyle Bittinger"
__email__ = "kylebittinger@gmail.com"
import itertools
import os
imp... |
Salat-Cx65/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/gdata/Crypto/Protocol/Chaffing.py | 226 | """This file implements the chaffing algorithm.
Winnowing and chaffing is a technique for enhancing privacy without requiring
strong encryption. In short, the technique takes a set of authenticated
message blocks (the wheat) and adds a number of chaff blocks which have
randomly chosen data and MAC fields. This means... |
cloudnull/turbolift | refs/heads/master | turbolift/exceptions.py | 1 | # =============================================================================
# Copyright [2015] [Kevin Carter]
# License Information :
# This software has no warranty, it is provided 'as is'. It is your
# responsibility to validate the behavior of the routines and its accuracy
# using the code provided. Consult the ... |
aleksandr-bakanov/astropy | refs/heads/master | astropy/io/ascii/tests/test_read.py | 2 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
from io import BytesIO, open
from collections import OrderedDict
import locale
import platform
from io import StringIO
import pathlib
import pytest
import numpy as np
from astropy.io import ascii
from astropy.table imp... |
certik/sfepy | refs/heads/master | input/phono/regions.py | 1 | def get_box_regions( dim, sizes ):
if dim == 3:
wx, wy, wz = sizes
regions = {
'Near' : ('nodes in (y < -%.3f)' % wy, {}),
'Far' : ('nodes in (y > %.3f)' % wy, {}),
'Bottom' : ('nodes in (z < -%.3f)' % wz, {}),
'Top' : ('nodes in (z > %.3f)' % wz,... |
crazy-canux/django | refs/heads/master | tests/createsuperuser/tests.py | 126 | from django.contrib.auth import models
from django.contrib.auth.management.commands import changepassword
from django.core.management import call_command
from django.test import TestCase
from django.utils.six import StringIO
class MultiDBChangepasswordManagementCommandTestCase(TestCase):
multi_db = True
def ... |
EventBuck/EventBuck | refs/heads/master | market/handlers/event/attending.py | 1 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
'''
Created on 26 juil. 2013
@author: Aristote Diasonama
'''
from google.appengine.ext import ndb
from .base import BaseHandler
from market.handlers.base import student_required
from shop.shop_exceptions import EventNotFoundException
from shop.handlers.base_handler im... |
loop1024/pymo-global | refs/heads/master | android/pgs4a-0.9.6/python-install/lib/python2.7/test/test_sgmllib.py | 140 | import pprint
import re
import unittest
from test import test_support
sgmllib = test_support.import_module('sgmllib', deprecated=True)
class EventCollector(sgmllib.SGMLParser):
def __init__(self):
self.events = []
self.append = self.events.append
sgmllib.SGMLParser.__init__(self)
def... |
tiposaurio/venton | refs/heads/master | apps/accounts/urls.py | 1 | from django.conf.urls import patterns, url, include
from django.views.generic import TemplateView
from .views import LoginView, LogOutView, SignUpView, index, load_access, \
EnterpriseAssociationCreateView
from django.contrib.auth import views as auth_views
accounts_patterns = patterns(
'',
url(r'^$', in... |
sybrenstuvel/quickypano | refs/heads/master | src/quickypano/project.py | 1 | """
Data model for projects.
"""
import copy
import json
import os.path
import logging
import os
import threading
import math
import PIL.Image
import PIL.ExifTags
from . import settings, hugin
log = logging.getLogger(__name__)
DEFAULT_PARAMS = {
'y': 0.0,
'p': 0.0,
'r': 0.0,
'w... |
calfonso/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_device_connectivity.py | 28 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
from nose.plugins.skip imp... |
atugushev/django-password-session | refs/heads/master | password_session/handlers.py | 2 | from django.conf import settings
from django.contrib.auth.signals import user_logged_in
from django.dispatch import receiver
from hashlib import md5
PASSWORD_HASH_KEY = getattr(settings, 'PASSWORD_SESSION_PASSWORD_HASH_KEY', 'password_session_password_hash_key')
def get_password_hash(user):
"""Returns a string o... |
ejeschke/ginga | refs/heads/master | ginga/canvas/transform.py | 3 | #
# transform.py -- coordinate transforms for Ginga
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import numpy as np
from ginga import trcalc
from ginga.misc import Bunch
__all__ = ['TransformError', 'BaseTransform', 'ComposedTransform',
'In... |
jkenn99/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/newstringio.py | 132 | # 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 ... |
Timus1712/boto | refs/heads/master | boto/gs/resumable_upload_handler.py | 9 | # Copyright 2010 Google Inc.
#
# 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, modify, merge, publish, dis-
# trib... |
remh/dd-agent | refs/heads/master | utils/subprocess_output.py | 25 | # stdlib
from functools import wraps
import logging
import subprocess
import tempfile
log = logging.getLogger(__name__)
# FIXME: python 2.7 has a far better way to do this
def get_subprocess_output(command, log):
"""
Run the given subprocess command and return it's output. Raise an Exception
if an error ... |
NicCOConnor/ansible-modules-extras | refs/heads/devel | cloud/misc/virt_pool.py | 109 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Maciej Delmanowski <drybjed@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 th... |
tuhangdi/django | refs/heads/master | tests/model_package/models/publication.py | 586 | from django.db import models
class Publication(models.Model):
title = models.CharField(max_length=30)
|
zachallaun/zulip | refs/heads/master | zerver/lib/debug.py | 123 | from __future__ import absolute_import
import code
import traceback
import signal
# Interactive debugging code from
# http://stackoverflow.com/questions/132058/showing-the-stack-trace-from-a-running-python-application
# (that link also points to code for an interactive remote debugger
# setup, which we might want if ... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/scatter3d/hoverlabel/font/_family.py | 1 | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="family", parent_name="scatter3d.hoverlabel.font", **kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent... |
rex-xxx/mt6572_x201 | refs/heads/master | external/clang/bindings/python/clang/enumerations.py | 307 | #===- enumerations.py - Python Enumerations ------------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... |
rohe/IdPproxy | refs/heads/master | test/debug_eppn.py | 2 | import urlparse
__author__ = 'rolandh'
def eppn_from_link(link):
# link = 'http://www.facebook.com/johan.lundberg.908'
p = urlparse.urlparse(link)
return "%s@%s" % (p.path[1:], p.netloc)
print eppn_from_link('http://www.facebook.com/johan.lundberg.908') |
jaredjennings/asunder | refs/heads/master | asunder/do_rip.py | 1 | # This file is part of asunder.
# asunder, Copyright 2013, Jared Jennings <jjennings@fastmail.fm>.
#
# asunder 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 opt... |
nghia-huynh/gem5-stable | refs/heads/master | ext/ply/example/optcalc/calc.py | 165 | # -----------------------------------------------------------------------------
# calc.py
#
# A simple calculator with variables. This is from O'Reilly's
# "Lex and Yacc", p. 63.
# -----------------------------------------------------------------------------
import sys
sys.path.insert(0,"../..")
if sys.version_info... |
sourcesimian/MailSort | refs/heads/master | mailsort/resources/spam.py | 1 | from plugin import Filter, my_email
_spam = 'spam'
class Spam(Filter):
priority = 101
def handle(self, msg):
if my_email in msg.bccs:
return
if len(msg.all_tos) == 0:
return msg.move(_spam)
to_set = (
'comms_ww@example.com',
'example... |
phoebusliang/parallel-lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/regressiontests/admin_views/urls.py | 107 | from django.conf.urls.defaults import *
from django.contrib import admin
import views
import customadmin
urlpatterns = patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/secure-view/$', views.secure_view),
(r'^admin/', include(admin.site.urls)),
(r'^admin2/', include(cus... |
40223221/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/collections/__init__.py | 625 | #__all__ = ['deque', 'defaultdict', 'Counter']
from _collections import deque, defaultdict
#from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString', 'Counter', 'OrderedDict']
# For bootstrapping re... |
j0nathan33/CouchPotatoServer | refs/heads/develop | libs/suds/resolver.py | 206 | # 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 ... |
lonelyandrew/IRC | refs/heads/master | proj_1/bool_re/bool_re.py | 1 | #! /usr/local/bin Python3
from proj_1.bool_re.errors import CommandSyntaxError
from proj_1.iitable.iitable import WordChain
from proj_1.iitable.iitable import build_iitable
from proj_1.iitable.iitable import build_sitable
from proj_1.iitable.iitable import doc_loc
from proj_1.iitable.iitable import process_doc
class... |
numenta/nupic.research | refs/heads/master | projects/transformers/trainer_mixins/rigl.py | 2 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, 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... |
nicproulx/mne-python | refs/heads/placeholder | mne/io/cnt/cnt.py | 3 | """Conversion tool from Neuroscan CNT to FIF."""
# Author: Jaakko Leppakangas <jaeilepp@student.jyu.fi>
#
# License: BSD (3-clause)
from os import path
import datetime
import calendar
import numpy as np
from ...utils import warn, verbose
from ...channels.layout import _topo_to_sphere
from ..constants import FIFF
fro... |
sixuanwang/SAMSaaS | refs/heads/master | wirecloud-develop/src/wirecloud/platform/workspace/mashupTemplateGenerator.py | 2 | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either v... |
mcking49/apache-flask | refs/heads/master | Python/Lib/site-packages/requests/packages/chardet/escsm.py | 2929 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
yurinnick/tow | refs/heads/master | tow/commands/run.py | 2 | """
TODO: add comments
"""
from command import Command
from utils import init_tow
from utils import get_env_args
from utils import get_linked_container_variables
import subprocess
import os
from utils import TOW_VOLUME
class RunCommand(Command):
def add_parser(self, subparsers):
super(RunCommand, self).a... |
gsehub/edx-platform | refs/heads/gsehub-release | openedx/features/learner_analytics/__init__.py | 16 | """
Learner analytics helpers and settings
"""
from openedx.core.djangoapps.waffle_utils import (
CourseWaffleFlag, WaffleFlag, WaffleFlagNamespace
)
# Namespace for learner analytics waffle flags.
WAFFLE_FLAG_NAMESPACE = WaffleFlagNamespace(name='learner_analytics')
# Simple safety valve in case the modal breaks... |
vencejo/GUI-para-el-control-visual-de-brazo-robotico | refs/heads/master | gui.py | 1 | # Doble importacion para evitar los conflictos de nombres entre el
# Message de Tkinter y el de tkMessageBox,
# vease la funcion creaVisorMensajes para mas info
import Tkinter
from Tkinter import *
from tkFileDialog import askopenfilename, asksaveasfilename
from tkColorChooser import askcolor
from tkMessageBox impor... |
hkariti/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/default_callback.py | 59 | # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
DOCUMENTATION = """
options:
show_skipped_hosts:
name: Show skipped hosts
description: "Toggle to control displaying skipped task/host... |
jdepoix/goto_cloud | refs/heads/development | goto_cloud/migration_commander/partition_creation.py | 1 | from remote_execution.public import RemoteHostExecutor
from remote_host_command.public import RemoteHostCommand
from .device_modification import DeviceModifyingCommand
class CreatePartitionsCommand(DeviceModifyingCommand):
"""
takes care of creating the partitions on the target system
"""
class CanN... |
sinotradition/meridian | refs/heads/master | meridian/acupoints/xiaguan41.py | 1 | #!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
SPELL=u'xiàguān'
CN=u'下关'
NAME=u'xiaguan41'
CHANNEL='stomach'
CHANNEL_FULLNAME='StomachChannelofFoot-Yangming'
SEQ='ST7'
if __name__ == '__main__':
pass
|
jc6482/loginTracker | refs/heads/master | loginTrackerServer/app/migrations/0002_locationdata_ip.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='locationdata',
name='ip',
... |
Edraak/edraak-platform | refs/heads/master | lms/djangoapps/ccx/urls.py | 16 | """
URLs for the CCX Feature.
"""
from django.conf.urls import url
import ccx.views
urlpatterns = [
url(r'^ccx_coach$', ccx.views.dashboard, name='ccx_coach_dashboard'),
url(r'^create_ccx$', ccx.views.create_ccx, name='create_ccx'),
url(r'^save_ccx$', ccx.views.save_ccx, name='save_ccx'),
url(r'^ccx_s... |
Chong-Li/RTDS-ToolStack | refs/heads/master | tools/python/xen/lowlevel/__init__.py | 20578 | |
dbr/tvnamer | refs/heads/master | tvnamer/__main__.py | 1 | """Allows executing tvnamer like so:
python -m tvnamer show.s01e01.avi etc
"""
from .main import main
if __name__ == "__main__":
main()
|
labase/vitollino | refs/heads/master | src/lab/model/modelo.py | 1 | #! /usr/bin/env python
# -*- coding: UTF8 -*-
# Este arquivo é parte do programa Vitollino
# Copyright 2014-2017 Carlo Oliveira <carlo@nce.ufrj.br>,
# `Labase <http://labase.selfip.org/>`__; `GPL <http://j.mp/GNU_GPL3>`__.
#
# Vitollino é um software livre; você pode redistribuí-lo e/ou
# modificá-lo dentro dos termos ... |
carlTLR/gyp | refs/heads/master | test/ios/app-bundle/TestApp/check_no_signature.py | 241 | #!/usr/bin/python
import os
import subprocess
import sys
p = os.path.join(os.environ['BUILT_PRODUCTS_DIR'],os.environ['EXECUTABLE_PATH'])
proc = subprocess.Popen(['codesign', '-v', p],
stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
o = proc.communicate()[0].strip()
if "code object is not si... |
rgayon/plaso | refs/heads/master | plaso/parsers/winreg_plugins/lfu.py | 1 | # -*- coding: utf-8 -*-
"""Plug-in to collect the Less Frequently Used Keys."""
from __future__ import unicode_literals
from plaso.containers import events
from plaso.containers import time_events
from plaso.containers import windows_events
from plaso.lib import definitions
from plaso.parsers import winreg
from plaso... |
zming619/denyhosts | refs/heads/master | plugins/test_deny.py | 10 | #!/usr/bin/python
import sys
print "%s invoked with the following args: %s" % (sys.argv[0], sys.argv[1:])
sys.exit(0)
|
NewpTone/stacklab-cinder | refs/heads/master | cinder/tests/windows/mockproxy.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cloudbase Solutions Srl
#
# 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/LICE... |
instrat-nigeria/django-instrat-oppia | refs/heads/master | oppia/utils/cartodb_update.py | 3 | '''
Script to update user map on CartoDB
For full instructions, see the documentation at
https://oppiamobile.readthedocs.org/en/latest/
'''
import time
import MySQLdb
import urllib
import json
import argparse, hashlib, subprocess
from django.db.models import Sum, Q
def run(cartodb_account, cartodb_key, so... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.