repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
djangorussia/django-1.3-branch | refs/heads/master | django/conf/locale/__init__.py | 157 | LANG_INFO = {
'ar': {
'bidi': True,
'code': 'ar',
'name': 'Arabic',
'name_local': u'\u0627\u0644\u0639\u0631\u0628\u064a\u0651\u0629',
},
'az': {
'bidi': True,
'code': 'az',
'name': 'Azerbaijani',
'name_local': u'az\u0259rbaycan dili',
},
... |
Jackysonglanlan/devops | refs/heads/master | IDEs/sublime/shared-pkgs/Packages/SideBarEnhancements/send2trash/plat_other.py | 4 | # Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
# This is a reimplementation of plat_othe... |
stieizc/scrive | refs/heads/master | cmd/init.py | 2 | #!/usr/bin/env python3
from libscrive import helpers, options
from libscrive.project import Project
import sys, os
optspec = """
scrive init [-i importpath] [path]
---
i,import=: import file or directory
,origlang=: the language of original files
"""
optionParser = options.Options(optspec)
optionParser.usage()
opts... |
salamb/girder | refs/heads/master | girder/models/api_key.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... |
sfinucane/deviceutils | refs/heads/master | deviceutils/ieee488/arbitraryblock.py | 1 | #!/usr/bin/env python
"""
"""
from deviceutils.error import ProtocolError
class InvalidBlockFormatError(ProtocolError):
pass
class NeitherBlockNorDataError(Exception):
def __init__(self, message=''):
m = ''.join([message, '(You need to provide either a binary block, or binary data!)'])
Excep... |
Kitware/tangelo | refs/heads/develop | tangelo/tangelo/pkgdata/plugin/girder/control.py | 2 | from girder.utility.server import configureServer
def setup(config, store):
config = {"server": {"api_root": "/plugin/girder/girder/api/v1",
"static_root": "/plugin/girder/girder/static"}}
girder_app, config = configureServer(curConfig=config)
return {"apps": [(girder_app, config... |
rtucker-mozilla/inventory | refs/heads/master | mozdns/validation.py | 2 | from django.core.exceptions import ValidationError
import string
import ipaddr
def do_zone_validation(domain):
"""Preform validation on domain. This function calls the following
functions::
check_for_soa_partition
check_for_master_delegation
validate_zone_soa
.. note::
T... |
pdellaert/ansible | refs/heads/devel | lib/ansible/modules/system/awall.py | 50 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ted Trask <ttrask01@yahoo.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... |
jeffzhengye/pylearn | refs/heads/master | IPC.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 14 15:53:02 2012
@author: zheng
"""
import sys
import socket
a =''
print(a + "a+")
class IPC(object):
def __init__(self):
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.connect(("localhost", 32000))
self.fid = self.s.makef... |
Don42/youtube-dl | refs/heads/master | youtube_dl/extractor/drbonanza.py | 109 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class DRBonanzaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dr\.dk/bonanza/(?:[^/]+/)+(?:[^/])+?(?:assetId=(?P<id>\d+))?(?:[#&]|$)'
_TESTS = [{... |
jazkarta/edx-platform-for-isc | refs/heads/backport-auto-certification | common/djangoapps/student/tests/test_create_account.py | 1 | "Tests for account creation"
import ddt
import unittest
from django.contrib.auth import get_user
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.auth.models import AnonymousUser
f... |
yarda/dslib | refs/heads/master | tests.py | 1 | # encoding: utf-8
#* dslib - Python library for Datove schranky
#* Copyright (C) 2009-2012 CZ.NIC, z.s.p.o. (http://www.nic.cz)
#*
#* 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... |
vlachoudis/sl4a | refs/heads/master | python/src/Demo/curses/ncurses.py | 32 | #!/usr/bin/env python
#
# $Id: ncurses.py 66424 2008-09-13 01:22:08Z andrew.kuchling $
#
# (n)curses exerciser in Python, an interactive test for the curses
# module. Currently, only the panel demos are ported.
import curses
from curses import panel
def wGetchar(win = None):
if win is None: win = stdscr
retur... |
mcdaniel67/sympy | refs/heads/master | examples/advanced/dense_coding_example.py | 113 | #!/usr/bin/env python
"""Demonstration of quantum dense coding."""
from sympy import sqrt, pprint
from sympy.physics.quantum import qapply
from sympy.physics.quantum.gate import H, X, Z, CNOT
from sympy.physics.quantum.qubit import Qubit
from sympy.physics.quantum.circuitplot import circuit_plot
from sympy.physics.qu... |
ol-loginov/intellij-community | refs/heads/master | python/helpers/pydev/pydevd_attach_to_process/linux/gdb_threads_settrace.py | 82 | # This file is meant to be run inside GDB as a command after
# the attach_linux.so dll has already been loaded to settrace for all threads.
if __name__ == '__main__':
#print('Startup GDB in Python!')
try:
show_debug_info = 0
is_debug = 0
for t in list(gdb.selected_inferior().threads())... |
dignan/control | refs/heads/master | plugins/jamendo/jamendo/JamendoSource.py | 1 | # -*- coding: utf-8 -*-
# JamendoSource.py
#
# Copyright (C) 2007 - Guillaume Desmottes
#
# 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, or (at your option)
# any later versi... |
kumar303/jstestnet | refs/heads/master | jstestnet/settings/__init__.py | 49 | from .base import *
try:
from .local import *
except ImportError, exc:
exc.args = tuple(['%s (did you rename settings/local.py-dist?)' % exc.args[0]])
raise exc
|
Nepherhotep/django | refs/heads/master | tests/model_inheritance_regress/tests.py | 150 | """
Regression tests for Model inheritance behavior.
"""
from __future__ import unicode_literals
import datetime
from operator import attrgetter
from unittest import expectedFailure
from django import forms
from django.test import TestCase
from .models import (
ArticleWithAuthor, BachelorParty, BirthdayParty, Bu... |
kwanty/sdrdab | refs/heads/master | test/gtest/test/gtest_xml_outfiles_test.py | 2526 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
tehtechguy/mHTM | refs/heads/master | setup.py | 1 | # setup.py
#
# Author : James Mnatzaganian
# Contact : http://techtorials.me
# Organization : NanoComputing Research Lab - Rochester Institute of
# Technology
# Website : https://www.rit.edu/kgcoe/nanolab/
# Date Created : 12/02/15
#
# Description : Installs the mHTM project
# Python Vers... |
mgit-at/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_host_lockdown.py | 56 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata... |
suneeshtr/persona | refs/heads/master | node_modules/l/node_modules/hook.io/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 107 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... |
wilkerwma/codeschool | refs/heads/master | src/cs_questions/migrations/old/0005_auto_20160511_1211.py | 4 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-11 15:11
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cs_questions', '0004_auto_20160508_2233'),
]
operat... |
staranjeet/fjord | refs/heads/master | vendor/packages/click/tests/conftest.py | 50 | from click.testing import CliRunner
import pytest
@pytest.fixture(scope='function')
def runner(request):
return CliRunner()
|
johnjohndoe/spendb | refs/heads/master | spendb/__init__.py | 5 | # this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
import warnings
warnings.filterwarnings('ignore', 'Options will be ignored.')
# Silence SQLAlchemy warning:
import wa... |
tayfun/django | refs/heads/master | django/contrib/sessions/backends/base.py | 298 | from __future__ import unicode_literals
import base64
import logging
import string
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.sessions.exceptions import SuspiciousSession
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from dj... |
younesnait/Embouteillage_repo | refs/heads/master | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | #Copyright (c) 2010 Fabien Potencier
#
#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, distrib... |
maestrano/odoo | refs/heads/master | addons/portal_stock/__openerp__.py | 437 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
leonardowolf/bookfree | refs/heads/master | flask/lib/python3.5/site-packages/werkzeug/contrib/securecookie.py | 254 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... |
amir343/ansible | refs/heads/devel | v1/ansible/module_utils/gce.py | 305 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
alecbenson/coup | refs/heads/master | src/server.py | 2 | #Authors: Joe DiSabito, Ryan Hartman, Alec Benson
import SocketServer
from collections import deque
import sys, threading, urllib
from deck import Deck
from vote import Vote
from player import Player, PlayerQueue
from error import *
class CoupServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
pass
class... |
bashburn/openshift-ansible | refs/heads/master | filter_plugins/openshift_master.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
'''
Custom filters for use in openshift-master
'''
import copy
import sys
import yaml
from ansible import errors
from ansible.runner.filter_plugins.core import bool as ansible_bool
class IdentityProviderBase(object):
""" IdentityPr... |
rspavel/spack | refs/heads/develop | var/spack/repos/builtin/packages/perl-clone/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlClone(PerlPackage):
"""Clone - recursively copy Perl datatypes"""
homepage = "htt... |
mkaluza/external_chromium_org | refs/heads/kk44 | tools/telemetry/telemetry/core/heap/chrome_js_heap_snapshot_parser.py | 38 | # 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.
import json
from telemetry.core.heap import live_heap_object
from telemetry.core.heap import retaining_edge
class ChromeJsHeapSnapshotParser(object):
"""... |
clumsy/intellij-community | refs/heads/master | python/helpers/profiler/thrift/transport/TSSLSocket.py | 9 | #
# 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... |
AntonPashkowskiy/Tars | refs/heads/master | Program/common/settings/setting_keys.py | 2 | #!/usr/bin/python3
LOG_FILE_NAME = "log_file_name" |
daira/tahoe-lafs-debian | refs/heads/master | src/allmydata/frontends/sftpd.py | 7 |
import heapq, traceback, array, stat, struct
from types import NoneType
from stat import S_IFREG, S_IFDIR
from time import time, strftime, localtime
from zope.interface import implements
from twisted.python import components
from twisted.application import service, strports
from twisted.conch.ssh import factory, keys... |
tecwebjoao/TecWeb-TF-2T-B-SI | refs/heads/master | venv/Lib/encodings/cp932.py | 817 | #
# cp932.py: Python Unicode Codec for CP932
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('cp932')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrement... |
AltraMayor/XIA-for-Linux | refs/heads/xia | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
LTD-Beget/sprutio | refs/heads/master | app/modules/sftp/actions/files/rename.py | 2 | from core import FM
class RenameFile(FM.BaseAction):
def __init__(self, request, source_path, target_path, session, **kwargs):
super(RenameFile, self).__init__(request=request, **kwargs)
self.source_path = source_path
self.target_path = target_path
self.session = session
def ... |
caot/intellij-community | refs/heads/master | python/testData/inspections/PyUnboundLocalVariableInspection/DecoratorAndParameter.py | 83 | def f(x):
def d(f):
return f
@d #pass
def g(d):
return d
return g(x)
|
Gateswong/GatesMusicPet | refs/heads/master | music_pet/services/__init__.py | 1 | # -*- coding: utf-8 -*-
from . import vgmdb
|
Unow/edx-platform | refs/heads/master | common/lib/chem/chem/tests.py | 68 | import codecs
from fractions import Fraction
import unittest
from .chemcalc import (compare_chemical_expression, divide_chemical_expression,
render_to_html, chemical_equations_equal)
import miller
local_debug = None
def log(s, output_type=None):
if local_debug:
print s
if ... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/splom/marker/colorbar/_tickfont.py | 2 | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="tickfont", parent_name="splom.marker.colorbar", **kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
pa... |
inoshiro/symposion-demo | refs/heads/master | symposion_project/apps/symposion/review/management/commands/calculate_results.py | 5 | from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group
from symposion.review.models import ProposalResult
class Command(BaseCommand):
def handle(self, *args, **options):
ProposalResult.full_calculate()
|
factorlibre/OCB | refs/heads/8.0 | addons/base_action_rule/base_action_rule.py | 55 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
Chilledheart/chromium | refs/heads/master | chrome/test/ispy/server/update_mask_handler.py | 100 | # 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.
"""Request Handler to allow test mask updates."""
import webapp2
import re
import sys
import os
from common import constants
from common import image_tools... |
ChinaMassClouds/copenstack-server | refs/heads/master | openstack/src/horizon-2014.2/openstack_dashboard/dashboards/admin/hostmonitor/views.py | 1 | from horizon import tables
from openstack_dashboard.dashboards.admin.hostmonitor import tables as hostmonitor_tables
from openstack_dashboard.openstack.common.requestapi import RequestApi
from openstack_dashboard.openstack.common.dictutils import DictList2ObjectList
from horizon import exceptions
from django.utils.tran... |
Studijacob/MIALab | refs/heads/master | wd/mainLeer.py | 1 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import SimpleITK as sitk
import sys
import os
import time
def command_iteration(method) :
print("{0:3} = {1:10.5f} : {2}".format(method.GetOptimizerIteration(),
method.GetMetricValue(),
... |
arjoly/scikit-learn | refs/heads/master | examples/cluster/plot_cluster_comparison.py | 246 | """
=========================================================
Comparing different clustering algorithms on toy datasets
=========================================================
This example aims at showing characteristics of different
clustering algorithms on datasets that are "interesting"
but still in 2D. The last ... |
ingenioustechie/zamboni | refs/heads/master | mkt/operators/tests/test_management.py | 19 | from cStringIO import StringIO
from nose.tools import eq_, ok_
from django.core.management import call_command
from django.core.management.base import CommandError
import mkt.site.tests
from mkt.constants.carriers import TELEFONICA, AMERICA_MOVIL
from mkt.constants.regions import BRA, FRA
from mkt.operators.models im... |
dilipbobby/DataScience | refs/heads/master | Python3/Level-1/posorneg.py | 1 |
_author__ = "Dilipbobby"
#taking the input from the user
num = float(input("Enter a number: "))
#using if else if condtion for checking out a number is postive or equal to zero or negative
if num > 0:
print("{0} is a positive number".format(num))
elif num == 0:
print("{0} is zero".format(num))
else... |
sachinkum/Bal-Aveksha | refs/heads/master | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py | 1776 | ######################## 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... |
ooici/marine-integrations | refs/heads/master | mi/dataset/driver/WFP_ENG/STC_IMODEM/test/test_driver.py | 1 | """
@package mi.dataset.driver.WFP_ENG.STC_IMODEM.test.test_driver
@file marine-integrations/mi/dataset/driver/WFP_ENG/STC_IMODEM/driver.py
@author Emily Hahn
@brief Test cases for WFP_ENG__STC_IMODEM driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/dsa/test_driver
$ bin/dsa/t... |
toontownfunserver/Panda3D-1.9.0 | refs/heads/master | python/Lib/distutils/extension.py | 250 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts."""
__revision__ = "$Id$"
import os, string, sys
from types import *
try:
import warnings
except ImportError:
warnings = None
# This class is really only used by the "build_ext" command, so it mig... |
muravjov/ansible | refs/heads/stable-1.9 | v2/ansible/plugins/strategies/__init__.py | 10 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
sandeepgupta2k4/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_functions.py | 26 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
evanson/yowsup | refs/heads/master | yowsup/layers/protocol_messages/layer.py | 69 | from yowsup.layers import YowLayer, YowLayerEvent, YowProtocolLayer
from .protocolentities import TextMessageProtocolEntity
class YowMessagesProtocolLayer(YowProtocolLayer):
def __init__(self):
handleMap = {
"message": (self.recvMessageStanza, self.sendMessageEntity)
}
super(YowM... |
elssar/calibre | refs/heads/master | src/calibre/srv/pool.py | 12 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import sys
from Queue import Queue, Full
from threading import Thread
from ... |
LuckJC/cubie-linux | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
bobeirasa/virtualenvs | refs/heads/master | pygeckozabbix/lib/python2.7/site-packages/setuptools/command/install_scripts.py | 285 | from distutils.command.install_scripts import install_scripts \
as _install_scripts
from pkg_resources import Distribution, PathMetadata, ensure_directory
import os
from distutils import log
class install_scripts(_install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def ini... |
randynobx/ansible | refs/heads/devel | lib/ansible/modules/storage/zfs/zfs_facts.py | 69 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@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 the L... |
akhilari7/pa-dude | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 199 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
from __future__ import absolute_import
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from nt... |
anthgur/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/set_window_rect.py | 11 | # META: timeout=long
import pytest
from tests.support.asserts import assert_error, assert_dialog_handled, assert_success
from tests.support.fixtures import create_dialog
from tests.support.inline import inline
alert_doc = inline("<script>window.alert()</script>")
def set_window_rect(session, rect):
return ses... |
tensorflow/transform | refs/heads/master | examples/census_example_v2_test.py | 1 | # Copyright 2017 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 a... |
Shnatsel/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/win/gyptest-link-update-manifest.py | 226 | #!/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.
"""
Make sure binary is relinked when manifest settings are changed.
"""
import TestGyp
import os
import sys
if sys.platform == 'win32':
... |
themiurgo/csvkit | refs/heads/csvsplit | csvkit/__init__.py | 21 | #!/usr/bin/env python
"""
This module contains csvkit's superpowered replacement for the builtin :mod:`csv` module. For Python 2 users, the greatest improvement over the standard library full unicode support. Python 3's :mod:`csv` module supports unicode internally, so this module is provided primarily for compatabili... |
edunham/servo | refs/heads/master | tests/wpt/web-platform-tests/old-tests/webdriver/command_contexts/window_size_test.py | 141 | import os
import sys
import random
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
from webdriver import exceptions
class WindowSizeT... |
RMKD/networkx | refs/heads/master | examples/drawing/labels_and_colors.py | 44 | #!/usr/bin/env python
"""
Draw a graph with matplotlib, color by degree.
You must have matplotlib for this to work.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
import matplotlib.pyplot as plt
import networkx as nx
G=nx.cubical_graph()
pos=nx.spring_layout(G) # positions for all nodes
# nodes
nx.draw... |
chrisdembia/googletest | refs/heads/master | test/gtest_xml_outfiles_test.py | 2526 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
jtattermusch/grpc | refs/heads/master | src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py | 8 | # Copyright 2020 gRPC authors.
#
# 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... |
davidharrigan/django | refs/heads/master | tests/template_tests/test_response.py | 55 | from __future__ import unicode_literals
import pickle
import time
from datetime import datetime
from django.conf import settings
from django.template import engines
from django.template.response import (
ContentNotRenderedError, SimpleTemplateResponse, TemplateResponse,
)
from django.test import RequestFactory, S... |
40223112/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/browser/indexed_db.py | 632 | class EventListener:
def __init__(self, events=[]):
self._events=events
def append(self, event):
self._events.append(event)
def fire(self, e):
for _event in self._events:
_event(e)
class IndexedDB:
def __init__(self):
if not __BRYTHON__.has_indexedDB:
raise NotImple... |
dlazz/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_gtm_monitor_external.py | 21 | # -*- 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
if sys.version_info < (2... |
papados/ordersys | refs/heads/master | Lib/site-packages/django/contrib/gis/db/models/proxy.py | 220 | """
The GeometryProxy object, allows for lazy-geometries. The proxy uses
Python descriptors for instantiating and setting Geometry objects
corresponding to geographic model fields.
Thanks to Robert Coup for providing this functionality (see #4322).
"""
from django.contrib.gis import memoryview
from django.utils impor... |
gmassei/wfrog | refs/heads/master | wfrender/renderer/wunderground.py | 4 | ## Copyright 2010 Jordi Puigsegur <jordi.puigsegur@gmail.com>
## derived from PyWeather by Patrick C. McGinty
##
## This file is part of wfrog
##
## wfrog 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 Softwa... |
yl565/statsmodels | refs/heads/master | statsmodels/sandbox/panel/panel_short.py | 25 | # -*- coding: utf-8 -*-
"""Panel data analysis for short T and large N
Created on Sat Dec 17 19:32:00 2011
Author: Josef Perktold
License: BSD-3
starting from scratch before looking at references again
just a stub to get the basic structure for group handling
target outsource as much as possible for reuse
Notes
--... |
buckiracer/data-science-from-scratch | refs/heads/master | RefMaterials/code/clustering.py | 60 | from __future__ import division
from linear_algebra import squared_distance, vector_mean, distance
import math, random
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
class KMeans:
"""performs k-means clustering"""
def __init__(self, k):
self.k = k # number of clusters
... |
lifeinoppo/littlefishlet-scode | refs/heads/master | RES/REF/python_sourcecode/ipython-master/IPython/core/display_trap.py | 22 | # encoding: utf-8
"""
A context manager for handling sys.displayhook.
Authors:
* Robert Kern
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full licen... |
russellb/nova | refs/heads/master | nova/tests/api/openstack/compute/contrib/__init__.py | 99 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC
#
# 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
#
#... |
quxiaolong1504/django | refs/heads/master | django/template/engine.py | 199 | import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache, six
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
from .base import Context, Template
f... |
vincentbetro/NACA-SIM | refs/heads/master | imagescripts/tecplotmigrate.py | 1 | #!/usr/bin/env python
import os,sys
import glob
def mysystem(s):
print(s)
retval = os.system(s)
return retval
def main():
alphas = range(-8,9)
orders = [1,2]
machs = [0.55,0.65,0.75,0.85,0.95,1.05,1.15,1.25]
refinelevels = [0,1,2]
#now, we need to recursively move everybody back
for order in... |
ganeshrn/ansible | refs/heads/devel | test/units/module_utils/common/test_network.py | 14 | # -*- coding: utf-8 -*-
# (c) 2017 Red Hat, Inc.
# 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__ = type
import pytest
from ansible.module_utils.common.network imp... |
PhotonX-Networks/OfdPy | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from distutils.core import setup
setup(name='ofdpy',
version='0.1a0',
description='Broadcom OF-DPA utilities',
author='Karel van de Plassche',
author_email='karelvandeplassche@gmail.com',
classifiers=['License :: OSI Approved :: GNU Lesser General Public License v3 ... |
mrtexaznl/p2pool | refs/heads/master | p2pool/bitcoin/sha256.py | 285 | from __future__ import division
import struct
k = [
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0... |
subhadram/insilico | refs/heads/master | examples/NeuronSAHPVGCCNetwork/peaki.py | 1 | from pylab import *
import numpy as np
from matplotlib import pyplot
matplotlib.rcParams.update({'font.size': 24})
locator_params(axis='y', nbins=3)
locator_params(axis='x', nbins=4)
# Get peak of data and store it in file
dat = genfromtxt('ccc.dat')
#dat = genfromtxt('0.dat')
data = dat[5000:]
tt = []
dt1 = []
dt2 =... |
1c7/Python-ask-answer-website-practice | refs/heads/master | 5-Database:SQLite3/6. Table_Struct.py | 1 | import sqlite3
con = sqlite3.connect('posts.db')
c = con.cursor()
c.execute('''
SELECT name FROM sqlite_master WHERE type='table'
''')
for one in c.fetchall():
print (one)
c.close()
|
ESOedX/edx-platform | refs/heads/master | lms/djangoapps/grades/migrations/0009_auto_20170111_1507.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grades', '0008_persistentsubsectiongrade_first_attempted'),
]
operations = [
migrations.AlterIndexTogether(... |
KECB/learn | refs/heads/master | computer_vision/image_gradients.py | 1 | import numpy as np
import cv2
import matplotlib.pyplot as plt
# bicycle_img = cv2.imread('images/bicycle.png', 0)
#
# sobelx = cv2.Sobel(bicycle_img, cv2.CV_64F, 1, 0, ksize=5)
# sobely = cv2.Sobel(bicycle_img, cv2.CV_64F, 0, 1, ksize=5)
#
#
# scharrx = cv2.Scharr(bicycle_img, cv2.CV_64F, 1, 0)
# scharry = cv2.Scharr... |
ajjohnso/ajjohnso-byte1-attempt56 | refs/heads/master | lib/werkzeug/local.py | 310 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
from werkzeug.wsgi import ClosingIt... |
timduru/platform-external-chromium_org | refs/heads/katkiss-4.4 | tools/win/split_link/graph_dependencies.py | 145 | # 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.
import os
import shutil
import subprocess
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def main():
if len(sys.argv) != 2:
print... |
gx1997/chrome-loongson | refs/heads/master | chrome/tools/build/win/scan_server_dlls.py | 79 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Script used to scan for server DLLs at build time and build a header
included by setup.exe. This header contains an array of ... |
DJMelonz/basic-blog | refs/heads/master | django/contrib/gis/db/models/fields.py | 400 | from django.db.models.fields import Field
from django.db.models.sql.expressions import SQLEvaluator
from django.utils.translation import ugettext_lazy as _
from django.contrib.gis import forms
from django.contrib.gis.db.models.proxy import GeometryProxy
from django.contrib.gis.geometry.backend import Geometry, Geometry... |
wfxiang08/django178 | refs/heads/master | tests/template_tests/alternate_urls.py | 26 | from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
# View returning a template response
(r'^template_response_view/$', views.template_response_view),
# A view that can be hard to find...
url(r'^snark/', views.snark, name='snark'),
)
|
repotvsupertuga/repo | refs/heads/master | plugin.video.specto/resources/lib/libraries/cloudflare2.py | 19 |
#
# Copyright (C) 2015 tknorris (Derived from Mikey1234's & Lambda's)
#
# 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, or (at your option)
# any later version.
#
# ... |
rosmo/ansible | refs/heads/devel | lib/ansible/modules/network/dellos10/dellos10_config.py | 42 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2017 Dell 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
ANSIBLE_METADATA = {'metadata_vers... |
anatm/administrator | refs/heads/master | git-1.8.1/git-remote-testgit.py | 12 | #!/usr/bin/env python
# This command is a simple remote-helper, that is used both as a
# testcase for the remote-helper functionality, and as an example to
# show remote-helper authors one possible implementation.
#
# This is a Git <-> Git importer/exporter, that simply uses git
# fast-import and git fast-export to co... |
Kwanghyuk-Kim/WATT | refs/heads/master | tools/WebIDLBinder/third_party/ply/example/BASIC/basparse.py | 166 | # An implementation of Dartmouth BASIC (1964)
#
from ply import *
import basiclex
tokens = basiclex.tokens
precedence = (
('left', 'PLUS','MINUS'),
('left', 'TIMES','DIVIDE'),
('left', 'POWER'),
('right','UMINUS')
)
#### A BASIC program is a series of stat... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/streamtube/colorbar/_tickvals.py | 1 | import _plotly_utils.basevalidators
class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="tickvals", parent_name="streamtube.colorbar", **kwargs
):
super(TickvalsValidator, self).__init__(
plotly_name=plotly_name,
par... |
manthey/girder | refs/heads/master | plugins/autojoin/plugin_tests/autojoin_test.py | 3 | from girder.constants import AccessType
from girder.models.group import Group
from girder.models.user import User
from tests import base
import json
def setUpModule():
base.enabledPlugins.append('autojoin')
base.startServer()
def tearDownModule():
base.stopServer()
class AutoJoinTest(base.TestCase):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.