repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
khagler/boto
refs/heads/develop
boto/pyami/launch_ami.py
153
#!/usr/bin/env python # 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 rig...
buntyke/GPy
refs/heads/master
GPy/util/multioutput.py
13
import numpy as np import warnings import GPy def get_slices(input_list): num_outputs = len(input_list) _s = [0] + [ _x.shape[0] for _x in input_list ] _s = np.cumsum(_s) slices = [slice(a,b) for a,b in zip(_s[:-1],_s[1:])] return slices def build_XY(input_list,output_list=None,index=None): n...
nikhilprathapani/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/idlelib/FileList.py
55
import os from tkinter import * import tkinter.messagebox as tkMessageBox class FileList: # N.B. this import overridden in PyShellFileList. from idlelib.EditorWindow import EditorWindow def __init__(self, root): self.root = root self.dict = {} self.inversedict = {} self.v...
EHeneman/google-python-exercises
refs/heads/master
logpuzzle/logpuzzle.py
1
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import os import re import sys import urllib """Logpuzzle exercise Given an apache logfile, ...
liangjg/openmc
refs/heads/develop
tests/unit_tests/test_surface_composite.py
8
from random import uniform import numpy as np import openmc import pytest def test_rectangular_parallelepiped(): xmin = uniform(-5., 5.) xmax = xmin + uniform(0., 5.) ymin = uniform(-5., 5.) ymax = ymin + uniform(0., 5.) zmin = uniform(-5., 5.) zmax = zmin + uniform(0., 5.) s = openmc.mod...
toscanini/maestro
refs/heads/master
maestro/template.py
2
import exceptions, utils, container, py_backend import StringIO, copy, logging, sys from requests.exceptions import HTTPError class Template: def __init__(self, name, config, service, version): self.name = name self.config = config self.service = service self.version = version self.lo...
jwren/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/UnusedImportBeforeStarImport/m2.py
80
import m1
ZachGoldberg/django-oscar-paypal
refs/heads/master
paypal/payflow/dashboard/app.py
10
from django.conf.urls import patterns, url from django.contrib.admin.views.decorators import staff_member_required from oscar.core.application import Application from . import views class PayFlowDashboardApplication(Application): name = None list_view = views.TransactionListView detail_view = views.Tran...
mdaniel/intellij-community
refs/heads/master
python/testData/copyPaste/TopLevelIfStatementWithMultilineCondition.after.py
35
if (True or (True or False)): x = 1 y = 2
pdellaert/ansible
refs/heads/devel
test/units/modules/network/netvisor/test_pn_port_config.py
23
# Copyright: (c) 2018, Pluribus Networks # 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 from units.compat.mock import patch from ansible.modules.network.netvisor import pn_port_config ...
openhatch/oh-mainline
refs/heads/master
vendor/packages/python-openid/openid/store/__init__.py
173
""" This package contains the modules related to this library's use of persistent storage. @sort: interface, filestore, sqlstore, memstore """ __all__ = ['interface', 'filestore', 'sqlstore', 'memstore', 'nonce']
DARKPOP/external_chromium_org
refs/heads/dark-5.1
tools/telemetry/telemetry/core/system_info.py
58
# 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. from telemetry.core import gpu_info class SystemInfo(object): """Provides low-level system information.""" def __init__(self, model_name, gpu_dict): ...
afandria/sky_engine
refs/heads/master
sky/tools/android_library_cacher.py
13
#!/usr/bin/env python # 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. import argparse import logging import os import re import skypy.paths import subprocess import sys SRC_ROOT = skypy.paths.Paths('ignor...
quietcoolwu/learn-python3-master
refs/heads/master
samples/multitask/task_worker.py
19
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time, sys, queue from multiprocessing.managers import BaseManager # 创建类似的QueueManager: class QueueManager(BaseManager): pass # 由于这个QueueManager只从网络上获取Queue,所以注册时只提供名字: QueueManager.register('get_task_queue') QueueManager.register('get_result_queue') # 连接到服务器...
jeetsukumaran/archipelago
refs/heads/master
bin/archipelago-summarize.py
1
#! /usr/bin/env python import sys import os import argparse import json import collections import csv import dendropy import re from archipelago import summarize from archipelago import utility from archipelago.utility import USER_SPECIFIED_TRAIT_TYPE_INDEX_START_VALUE def parse_trait_states(labels): if not labe...
davidszotten/pytest-django
refs/heads/master
pytest_django/client.py
10
from django.core.handlers.wsgi import WSGIRequest from django.test.client import RequestFactory as VanillaRequestFactory from django.test.client import FakePayload class PytestDjangoRequestFactory(VanillaRequestFactory): """ Based on Django 1.3's RequestFactory, but fixes an issue that causes an error to ...
cuihantao/cvxopt
refs/heads/master
examples/book/chap6/cvxfit.py
4
# Figure 6.24, page 339. # Least-squares fit of a convex function. from cvxopt import solvers, matrix, spmatrix, mul from pickle import load #solvers.options['show_progress'] = 0 data = load(open('cvxfit.bin','rb')) u, y = data['u'], data['y'] m = len(u) # minimize (1/2) * || yhat - y ||_2^2 # subject to yhat[j]...
HiroIshikawa/21playground
refs/heads/master
microblog/flask/lib/python3.5/site-packages/coverage/bytecode.py
45
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Bytecode manipulation for coverage.py""" import opcode import types from coverage.backward import byte_to_int class ByteCode(object): """A single bytecod...
rjawor/concordia-server
refs/heads/master
mgiza-aligner/mgiza/experimental/dual-model/MGIZA/scripts/plain2snt-hasvcb.py
8
#!/usr/bin/env python from sys import * def loadvcb(fname,out): dict={}; df = open(fname,"r"); for line in df: out.write(line); ws = line.strip().split(); id = int(ws[0]); wd = ws[1]; dict[wd]=id; return dict; if len(argv)<9: stderr.write("Error, the input should be \n"); stderr.write("%s evcb...
Peddle/hue
refs/heads/master
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Random/Fortuna/test_FortunaGenerator.py
120
# -*- coding: utf-8 -*- # # SelfTest/Random/Fortuna/test_FortunaGenerator.py: Self-test for the FortunaGenerator module # # Written in 2008 by Dwayne C. Litzenberger <[email protected]> # # =================================================================== # The contents of this file are dedicated to the public domain....
delta2323/chainer
refs/heads/master
tests/chainer_tests/functions_tests/loss_tests/test_squared_error.py
4
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition @testing.parameterize( {'shape': (4, 3)}, {'shape': (4, 3, 2)}, {'shape...
edxnercel/edx-platform
refs/heads/master
common/djangoapps/util/memcache.py
251
""" This module provides a KEY_FUNCTION suitable for use with a memcache backend so that we can cache any keys, not just ones that memcache would ordinarily accept """ from django.utils.encoding import smart_str import hashlib import urllib def fasthash(string): """ Hashes `string` into a string representatio...
DirkHoffmann/indico
refs/heads/master
indico/modules/events/sessions/models/sessions.py
1
# 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 datetime import timedelta from operator import attrgetter from sqlalchemy.ext.declarative import dec...
density215/d215-miniblog
refs/heads/master
django/contrib/localflavor/sk/forms.py
344
""" Slovak-specific form helpers """ from django.forms.fields import Select, RegexField from django.utils.translation import ugettext_lazy as _ class SKRegionSelect(Select): """ A select widget widget with list of Slovak regions as choices. """ def __init__(self, attrs=None): from sk_regions i...
mzdaniel/pycon
refs/heads/2012
pycon_project/apps/boxes/views.py
2
from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from django.contrib.admin.views.decorators import staff_member_required from boxes.forms import BoxForm from boxes.models import Box @staff_member_required def box_edit(request, pk): box = get_object_o...
ITURO/ituro
refs/heads/master
ituro/projects/tests.py
24123
from django.test import TestCase # Create your tests here.
iandriver/RNA-sequence-tools
refs/heads/master
Tophat_Cluster_submission/qsub_cuffdiff.py
2
import fnmatch import os import csv import subprocess def write_file(filename, contents): """Write the given contents to a text file. ARGUMENTS filename (string) - name of the file to write to, creating if it doesn't exist contents (string) - contents of the file to be written """ # Open the ...
cwtaylor/viper
refs/heads/master
viper/modules/peepdf/colorama/ansi.py
81
''' This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code ''' CSI = '\033[' def code_to_chars(code): return CSI + str(code) + 'm' class AnsiCodes(object): def __init__(self, codes): for name in dir(codes): ...
ryannathans/micropython
refs/heads/master
examples/hwapi/hwconfig_esp8266_esp12.py
41
from machine import Pin, Signal # ESP12 module as used by many boards # Blue LED on pin 2, active low (inverted) LED = Signal(2, Pin.OUT, invert=True)
rizumu/django
refs/heads/master
django/test/html.py
220
""" Comparing two html documents. """ from __future__ import unicode_literals import re from django.utils import six from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.html_parser import HTMLParseError, HTMLParser WHITESPACE = re.compile('\s+') def normalize_whitespace(str...
wglass/zoonado
refs/heads/master
zoonado/connection.py
1
from __future__ import unicode_literals import collections import logging import re import struct import sys from tornado import ioloop, iostream, gen, concurrent, tcpclient from zoonado import protocol, iterables, exc version_regex = re.compile(r'Zookeeper version: (\d)\.(\d)\.(\d)-.*') # all requests and respon...
mozilla/verbatim
refs/heads/master
vendor/lib/python/webassets/__init__.py
1
__version__ = (0, 8) # Make a couple frequently used things available right here. from bundle import Bundle from env import Environment
wcmitchell/insights-core
refs/heads/master
insights/client/support.py
1
''' Module responsible for running the --support option for collecting debug information ''' import logging import shlex import re import os import requests from subprocess import Popen, PIPE, STDOUT from constants import InsightsConstants as constants from connection import InsightsConnection from config import CONFI...
SrNetoChan/QGIS
refs/heads/master
python/plugins/processing/core/ProcessingConfig.py
4
# -*- coding: utf-8 -*- """ *************************************************************************** ProcessingConfig.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
google/orchestra
refs/heads/master
orchestra/google/marketing_platform/utils/schema/sdf/__init__.py
1
########################################################################### # # Copyright 2019 Google 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 # # https://www.apache.org/...
jeremypogue/ansible
refs/heads/devel
lib/ansible/playbook/become.py
63
# (c) 2012-2014, Michael DeHaan <[email protected]> # # 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) an...
whereismyjetpack/ansible
refs/heads/devel
lib/ansible/modules/network/eos/eos_command.py
2
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
busyStone/ardupilot
refs/heads/master
Tools/autotest/common.py
13
import util, pexpect, time, math from pymavlink import mavwp # a list of pexpect objects to read while waiting for # messages. This keeps the output to stdout flowing expect_list = [] def expect_list_clear(): '''clear the expect list''' global expect_list for p in expect_list[:]: expect_list.remov...
kmod/icbd
refs/heads/master
icbd/type_analyzer/tests/import_test/f.py
1
from . import dup as dup1 dup1 # 0 <module 'dup'|num> import dup as dup2 dup2 # 0 module 'dup' from .d import e as e1 e1 from d import e as e2 e2 from . import g xg = g.xg from .d.e import x as x2 print x2
Axam/nsx-web
refs/heads/master
nailgun/nailgun/openstack/common/periodic_task.py
6
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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 applicab...
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/lib2to3/tests/test_pytree.py
48
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Unit tests for pytree.py. NOTE: Please *don't* add doc strings to individual test methods! In verbose mode, printing of the module, class and method name is much more helpful than printing of (the first line of) the...
pdxjohnny/stratus
refs/heads/master
stratus/__main__.py
1
""" Stratus Facilitates connections """ import sys import time import json import argparse import subprocess import stratus import service import client import server import constants PROMPT = ":\r" AUTH_USER = False AUTH_PASS = False __server_process__ = False __client_conn__ = False def print_disconnect(clien...
jeffery-do/Vizdoombot
refs/heads/master
doom/lib/python3.5/site-packages/theano/tensor/nnet/tests/test_corr.py
3
from nose.plugins.skip import SkipTest from nose.plugins.attrib import attr import numpy from six import integer_types import theano import theano.tensor as T from theano.tests import unittest_tools as utt from theano.tensor.nnet import corr, conv from theano.tensor.basic import _allclose class TestCorr2D(utt.InferS...
Rudloff/youtube-dl
refs/heads/master
youtube_dl/extractor/discoverygo.py
2
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( extract_attributes, int_or_none, parse_age_limit, unescapeHTML, ) class DiscoveryGoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?discoverygo\.com/(?:[^/]+/)*(?P<i...
mitliagkas/pyliakmon
refs/heads/master
getPhenoTypes.py
1
import numpy as np import json with open('db/cpt.json', 'rb') as outfile: procHier = json.load(outfile) outfile.close() with open('db/icd.json', 'rb') as outfile: icdHier = json.load(outfile) outfile.close() with open('db/icd-level2.json', 'rb') as outfile: icdL2 = json.load(outfile) outfile...
MaximNevrov/neutron
refs/heads/master
neutron/worker.py
5
# 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 writing, software # d...
gaqzi/django-emoji
refs/heads/master
emoji/models.py
1
import os import re import struct from sys import version_info from django.contrib.staticfiles.storage import staticfiles_storage try: from ._unicode_characters import UNICODE_ALIAS except ImportError as exc: UNICODE_ALIAS = {} from . import settings __all__ = ('Emoji',) UNICODE_WIDE = True try: unic...
jackTheRipper/iotrussia
refs/heads/master
web_server/lib/werkzeug-master/werkzeug/debug/tbtools.py
2
# -*- coding: utf-8 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import inspect import traceback im...
swift-lang/swift-e-lab
refs/heads/master
parsl/app/python.py
1
import logging import tblib.pickling_support tblib.pickling_support.install() from parsl.app.futures import DataFuture from parsl.app.app import AppBase from parsl.app.errors import wrap_error from parsl.dataflow.dflow import DataFlowKernelLoader logger = logging.getLogger(__name__) class PythonApp(AppBase): ...
factorylabs/f_closure_linter
refs/heads/master
build/lib/closure_linter/tokenutil.py
13
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
maryklayne/Funcao
refs/heads/master
examples/beginner/precision.py
116
#!/usr/bin/env python """Precision Example Demonstrates SymPy's arbitrary integer precision abilities """ import sympy from sympy import Mul, Pow, S def main(): x = Pow(2, 50, evaluate=False) y = Pow(10, -50, evaluate=False) # A large, unevaluated expression m = Mul(x, y, evaluate=False) # Eval...
gisce/OCB
refs/heads/7.0
addons/point_of_sale/wizard/pos_session_opening.py
46
from openerp import netsvc from openerp.osv import osv, fields from openerp.tools.translate import _ from openerp.addons.point_of_sale.point_of_sale import pos_session class pos_session_opening(osv.osv_memory): _name = 'pos.session.opening' _columns = { 'pos_config_id' : fields.many2one('pos.config...
RoboCupULaval/UI-Debug
refs/heads/dev
Model/DataObject/DrawingData/__init__.py
7
# Under MIT License, see LICENSE.txt __author__ = 'RoboCupULaval'
JioCloud/nova_test_latest
refs/heads/master
nova/tests/functional/v3/test_hide_server_addresses.py
29
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
ChanduERP/odoo
refs/heads/8.0
addons/subscription/__init__.py
441
# -*- 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...
Neppord/py2py
refs/heads/master
py2py_lib/ast/literal.py
1
from node import Node class Literal(Node): def __init__(self, string): self.string = string self.clear() def clear(self): self.faild = False self.consume = list(self.string[-1::-1]) def feed(self, char): if self.faild: return else: if char == self.consume.pop(): if not self.consume: ...
saratang/servo
refs/heads/master
python/mozlog/mozlog/structured/__init__.py
45
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import commandline import structuredlog from structuredlog import get_default_logger, set_default_logger
pizzathief/scipy
refs/heads/master
scipy/signal/tests/test_result_type.py
18
# Regressions tests on result types of some signal functions import numpy as np from numpy.testing import assert_ import pytest from scipy.signal import (decimate, lfilter_zi, lfiltic, sos2tf, sosfilt_zi) def te...
infOpen/ansible-role-mongodb
refs/heads/develop
tests/test_filter_plugins.py
23
""" Fake test for plugins filters """ def test_fake(): assert True
rigdenlab/conkit
refs/heads/master
conkit/io/tests/test_ccmpred.py
2
"""Testing facility for conkit.io.CCMpredIO""" __author__ = "Felix Simkovic" __date__ = "14 Sep 2016" import os import sys import unittest from conkit.core.contact import Contact from conkit.core.contactfile import ContactFile from conkit.core.contactmap import ContactMap from conkit.core.sequence import Sequence fr...
piranha/python-slackclient
refs/heads/master
slackclient/_im.py
1
class Im(object): def __init__(self, server, user, id): self.server = server self.user = user self.id = id def __eq__(self, compare_str): return self.id == compare_str or self.user == compare_str def __str__(self): data = "" for key in list(self.__dict__.key...
amolenaar/gaphor
refs/heads/master
gaphor/UML/states/transition.py
1
""" State transition implementation. """ from gaphor import UML from gaphor.diagram.presentation import LinePresentation, Named from gaphor.diagram.shapes import Box, EditableText, Text, draw_arrow_tail from gaphor.diagram.support import represents from gaphor.UML.modelfactory import stereotypes_str @represents(UML....
howardwkim/ctci
refs/heads/master
Pramp/root_number.py
1
def root(x, n): upper_bound = x / n lower_bound = 0 # optimize? return root_helper(lower_bound, upper_bound, x, n) def root_helper(lower_bound, upper_bound, x, n): if upper_bound < lower_bound: raise Exception('') mid = (1. * upper_bound - lower_bound) / 2 + lower_bound mid_to_nth = ...
mou4e/zirconium
refs/heads/master
build/android/pylib/instrumentation/instrumentation_test_instance_test.py
49
#!/usr/bin/env python # 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. """Unit tests for instrumentation.TestRunner.""" # pylint: disable=W0212 import os import sys import unittest from pylib import con...
MrNuggles/HeyBoet-Telegram-Bot
refs/heads/master
temboo/Library/LastFm/User/GetWeeklyChartList.py
5
# -*- coding: utf-8 -*- ############################################################################### # # GetWeeklyChartList # Retrieves a list of available charts for this user, expressed as date ranges which can be sent to the chart services. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Li...
pabloborrego93/edx-platform
refs/heads/master
lms/djangoapps/lms_xblock/migrations/0001_initial.py
87
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operati...
GreatSCT/GreatSCT
refs/heads/master
config/update.py
1
#!/usr/bin/python import platform, os, sys, pwd def which(program): path = os.getenv('PATH') for p in path.split(os.path.pathsep): p = os.path.realpath(os.path.join(p, program)) if os.path.exists(p) and os.access(p, os.X_OK): return p return False def validate_msfpath(): ...
seankelly/buildbot
refs/heads/master
master/buildbot/test/unit/test_db_migrate_versions_045_worker_transition.py
10
# 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...
hyperNURb/ggrc-core
refs/heads/develop
src/ggrc/models/product.py
5
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [email protected] # Maintained By: [email protected] from ggrc import db from sqlalchemy.orm import validates from .mixins import d...
jjmleiro/hue
refs/heads/master
desktop/core/ext-py/python-openid-2.2.5/openid/store/nonce.py
180
__all__ = [ 'split', 'mkNonce', 'checkTimestamp', ] from openid import cryptutil from time import strptime, strftime, gmtime, time from calendar import timegm import string NONCE_CHARS = string.ascii_letters + string.digits # Keep nonces for five hours (allow five hours for the combination of # reque...
837468220/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_collections.py
47
"""Unit tests for collections.py.""" import unittest, doctest, operator import inspect from test import support from collections import namedtuple, Counter, OrderedDict, _count_elements from test import mapping_tests import pickle, copy from random import randrange, shuffle import keyword import re import sys from col...
plotly/plotly.py
refs/heads/master
packages/python/plotly/plotly/validators/histogram2d/_ids.py
1
import _plotly_utils.basevalidators class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="ids", parent_name="histogram2d", **kwargs): super(IdsValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edi...
encukou/freeipa
refs/heads/master
ipaplatform/redhat/tasks.py
1
# Authors: Simo Sorce <[email protected]> # Alexander Bokovoy <[email protected]> # Martin Kosek <[email protected]> # Tomas Babej <[email protected]> # # Copyright (C) 2007-2014 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redist...
fossevents/fossevents.in
refs/heads/master
fossevents/users/views.py
1
from django.contrib.auth import logout as auth_logout from django.contrib.auth.views import login as django_login from django.core.urlresolvers import reverse from django.http.response import HttpResponseRedirect def login(request, *args, **kwargs): if request.user.is_authenticated(): return HttpResponseR...
openstack/openstack-health
refs/heads/master
openstack_health/distributed_dbm.py
1
# Copyright 2016 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
beswarm/django-social-auth
refs/heads/master
social_auth/backends/contrib/rdio.py
14
from social.backends.rdio import RdioOAuth1 as RdioOAuth1Backend, \ RdioOAuth2 as RdioOAuth2Backend
ryfeus/lambda-packs
refs/heads/master
pytorch/source/caffe2/python/operator_test/negate_gradient_op_test.py
1
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import workspace, core import caffe2.python.hypothesis_test_util as hu import caffe2.python.serialized_test.serialized_test_util as serial from hypothe...
liwangdong/augmented-traffic-control
refs/heads/master
atc/django-atc-profile-storage/atc_profile_storage/urls.py
17
# # Copyright (c) 2014, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # # from django.conf.urls ...
BigDataforYou/movie_recommendation_workshop_1
refs/heads/master
big_data_4_you_demo_1/venv/lib/python2.7/site-packages/requests/compat.py
35
# -*- coding: utf-8 -*- """ requests.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_p...
aoeu256/langmer
refs/heads/master
lib/werkzeug/http.py
317
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
rajul/Pydev
refs/heads/development
plugins/org.python.pydev.jython/Lib/encodings/shift_jis.py
816
# # shift_jis.py: Python Unicode Codec for SHIFT_JIS # # Written by Hye-Shik Chang <[email protected]> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jis') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Multib...
Basis/pip
refs/heads/develop
tests/functional/test_install_vcs.py
5
from tests.lib import _create_test_package, _change_test_package_version from tests.lib.local_repos import local_checkout def test_install_editable_from_git_with_https(script, tmpdir): """ Test cloning from Git with https. """ result = script.pip('install', '-e', '%s#egg=pip-test-...
brummer-simon/RIOT
refs/heads/master
tests/pkg_semtech-loramac/tests-with-config/01-run.py
11
#!/usr/bin/env python3 # Copyright (C) 2019 Inria # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import sys import time from testrunner import run # It's assumed that the same APPEUI ...
bfirsh/pspec
refs/heads/master
pspec/groups/root.py
1
import imp import os from .base import BaseGroup class RootGroup(BaseGroup): """ A group that represents a spec module. """ # Name of magic group magic_group_name = '_pspec_group' def __init__(self, *args, **kwargs): super(RootGroup, self).__init__(*args, **kwargs) # Spec is t...
Twangist/log_calls
refs/heads/develop
tests/test_log_calls_v30_minor_features_fixes.py
1
__author__ = "Brian O'Neill" _version__ = '0.3.0' from log_calls import log_calls import doctest #------------------------------------------------------------------- # test__omit_property_attr__repr_with_init_active #------------------------------------------------------------------- def test__omit_property_attr__r...
stdweird/aquilon
refs/heads/master
lib/python2.6/aquilon/worker/commands/del_interface.py
2
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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...
linktlh/Toontown-journey
refs/heads/master
toontown/minigame/TwoDStomper.py
4
from direct.showbase.DirectObject import DirectObject from toontown.toonbase.ToontownGlobals import * from direct.directnotify import DirectNotifyGlobal from direct.interval.IntervalGlobal import * from toontown.minigame import ToonBlitzGlobals GOING_UP = 1 GOING_DOWN = 2 STUCK_DOWN = 3 class TwoDStomper(DirectObject)...
TathagataChakraborti/resource-conflicts
refs/heads/master
PLANROB-2015/py2.5/lib/python2.5/idlelib/idle.py
257
try: import idlelib.PyShell except ImportError: # IDLE is not installed, but maybe PyShell is on sys.path: try: import PyShell except ImportError: raise else: import os idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) if idledir != os.getcwd(): ...
cchurch/ansible
refs/heads/devel
test/units/module_utils/xenserver/test_get_object_ref.py
23
# -*- coding: utf-8 -*- # # Copyright: (c) 2019, Bojan Vitnik <[email protected]> # 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 pytest from .FakeAnsibleModule import FailJs...
ColOfAbRiX/ansible
refs/heads/devel
lib/ansible/modules/notification/slack.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, René Moser <[email protected]> # (c) 2015, Stefan Berggren <[email protected]> # (c) 2014, Ramon de la Fuente <[email protected]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU Genera...
dimacus/selenium
refs/heads/master
py/test/selenium/webdriver/common/click_tests.py
65
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
jackkiej/SickRage
refs/heads/master
lib/rtorrent/err.py
182
# Copyright (c) 2013 Chris Lucas, <[email protected]> # 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, ...
Peddle/hue
refs/heads/master
desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml/dumper.py
543
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] from emitter import * from serializer import * from representer import * from resolver import * class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__(self, stream, default_style=None, default_flow_style=None, c...
CourseTalk/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/xml_module.py
5
import json import copy import logging import os import sys from lxml import etree from xblock.fields import Dict, Scope, ScopeIds from xblock.runtime import KvsFieldData from xmodule.x_module import XModuleDescriptor, DEPRECATION_VSCOMPAT_EVENT from xmodule.modulestore.inheritance import own_metadata, InheritanceKeyV...
zrhans/pythonanywhere
refs/heads/master
.virtualenvs/django19/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py
439
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
kingvuplus/gui_test3
refs/heads/master
lib/python/Plugins/Extensions/MediaPlayer/settings.py
23
from Screens.Screen import Screen from Screens.HelpMenu import HelpableScreen from Components.FileList import FileList from Components.Sources.StaticText import StaticText from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigText, ConfigYesNo, ConfigDirectory from Components.ConfigList impo...
nburn42/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/kernel_tests/bijectors/gumbel_test.py
14
# Copyright 2017 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...
victorywang80/Maintenance
refs/heads/master
saltstack/src/salt/modules/apache.py
1
# -*- coding: utf-8 -*- ''' Support for Apache ''' # Import python libs import os import re import logging import urllib2 # Import salt libs import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Only load the module if apache is installed ''' cmd = _detect_os() if salt.util...
jswope00/griffinx
refs/heads/master
lms/djangoapps/django_comment_client/tests/factories.py
149
from factory.django import DjangoModelFactory from django_comment_common.models import Role, Permission class RoleFactory(DjangoModelFactory): FACTORY_FOR = Role name = 'Student' course_id = 'edX/toy/2012_Fall' class PermissionFactory(DjangoModelFactory): FACTORY_FOR = Permission name = 'create_...
lchl7890987/WebGL
refs/heads/master
utils/exporters/blender/addons/io_three/exporter/api/object.py
124
import math import mathutils import bpy from bpy import data, context, types from bpy_extras.io_utils import axis_conversion from .. import constants, logger, utilities, exceptions from .constants import ( MESH, EMPTY, ARMATURE, LAMP, SPOT, SUN, POINT, HEMI, AREA, CAMERA, PER...