repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
hellofreedom/ansible | refs/heads/devel | test/units/playbook/test_block.py | 228 | # (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... |
fxia22/ASM_xf | refs/heads/master | PythonD/lib/python2.4/encodings/big5.py | 12 | #
# big5.py: Python Unicode Codec for BIG5
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
# $CJKCodecs: big5.py,v 1.8 2004/06/28 18:16:03 perky Exp $
#
import _codecs_tw, codecs
codec = _codecs_tw.getcodec('big5')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class StreamReader(C... |
natko1412/script.module.dudehere.routines | refs/heads/master | lib/dudehere/routines/httplib2/test/test_no_socket.py | 306 | """Tests for httplib2 when the socket module is missing.
This helps ensure compatibility with environments such as AppEngine.
"""
import os
import sys
import unittest
import httplib2
class MissingSocketTest(unittest.TestCase):
def setUp(self):
self._oldsocks = httplib2.socks
httplib2.socks = None... |
msracver/Deformable-ConvNets | refs/heads/master | lib/bbox/setup_windows.py | 1 | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Yuwen Xiong
# --------------------------------------------------------
# Based on:
# py-faster-rcnn
# Copyright (c) 2016 ... |
cmsdaq/hltd | refs/heads/master | lib/urllib3-1.24.1/test/test_connection.py | 6 | import datetime
import mock
import pytest
from urllib3.connection import (
CertificateError,
_match_hostname,
RECENT_DATE
)
class TestConnection(object):
"""
Tests in this suite should not make any network requests or connections.
"""
def test_match_hostname_no_cert(self):
cert =... |
paulfanelli/planet_alignment | refs/heads/master | planet_alignment/test/etc/foo.py | 1 | """
.. module:: foo.py
:platform: linux
:synopsis: Dummy testing file to test the command parser.
.. moduleauthor:: Paul Fanelli <paul.fanelli@gmail.com>
.. modulecreated:: 6/26/15
"""
foo = 1
|
bobwalker99/Pydev | refs/heads/master | plugins/org.python.pydev/pysrc/third_party/pep8/lib2to3/lib2to3/pgen2/grammar.py | 152 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... |
poojavade/Genomics_Docker | refs/heads/master | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/apache_libcloud-0.15.1-py2.7.egg/libcloud/common/google.py | 2 | # 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 use ... |
sachintaware/sublime-wakatime | refs/heads/master | packages/wakatime/packages/requests/packages/chardet/codingstatemachine.py | 2930 | ######################## 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... |
kennethlyn/parallella-lcd-linux | refs/heads/xcomm_zynq | scripts/analyze_suspend.py | 1540 | #!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... |
anryko/ansible | refs/heads/devel | test/integration/targets/collections_relative_imports/collection_root/ansible_collections/my_ns/my_col/plugins/module_utils/my_util3.py | 66 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
from . import my_util2
def three():
return my_util2.two() + 1
|
lanbing510/GTDWeb | refs/heads/master | django/forms/widgets.py | 82 | """
HTML Widget classes
"""
from __future__ import unicode_literals
import copy
from itertools import chain
from django.conf import settings
from django.forms.utils import flatatt, to_current_timezone
from django.utils import formats, six
from django.utils.datastructures import MergeDict, MultiValueDict
from django.... |
demophoon/dotfiles | refs/heads/master | assets/docopt.py | 283 | """Pythonic command-line interface parser that will make you smile.
* http://docopt.org
* Repository and issue-tracker: https://github.com/docopt/docopt
* Licensed under terms of MIT license (see LICENSE-MIT)
* Copyright (c) 2013 Vladimir Keleshev, vladimir@keleshev.com
"""
import sys
import re
__all__ = ['doco... |
bjoshua/ansible | refs/heads/devel | lib/ansible/inventory/vars_plugins/noop.py | 317 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2014, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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 Foundat... |
michaelgallacher/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/conf/locale/sq/formats.py | 433 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g.i.s.A'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = '... |
MjAbuz/watchdog | refs/heads/master | vendor/rdflib-2.4.0/test/sparql/QueryTests/Test5_3.py | 4 | #!/d/Bin/Python/python.exe
# -*- coding: utf-8 -*-
#
#
# $Date: 2005/04/02 07:29:46 $, by $Author: ivan $, $Revision: 1.1 $
#
"""
Datatype test. Note that this is not 100% kosher. The problem is that the Literal of rdflib does not check the
datatypes. In theory, if the data contains:
x ns:p 42.
in... |
ephes/gunicorn | refs/heads/master | tests/requests/invalid/007.py | 120 | from gunicorn.http.errors import LimitRequestHeaders
request = LimitRequestHeaders
|
davidwaroquiers/pymatgen | refs/heads/master | dev_scripts/chemenv/explicit_permutations_plane_algorithm.py | 5 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Development script of the ChemEnv utility to get the explicit permutations for coordination environments identified
with the separation plane algorithms (typically with coordination numbers >= 6)
"""
from ... |
lbattraw/micropython | refs/heads/master | tests/basics/builtin_eval.py | 95 | # builtin eval
eval('1 + 2')
eval('1 + 2\n')
eval('1 + 2\n\n#comment\n')
x = 4
eval('x')
eval('lambda x: x + 10')(-5)
y = 6
eval('lambda: y * 2')()
|
edmi-nz/robotframework-selenium2library | refs/heads/master | src/Selenium2Library/utils/__init__.py | 65 | import os
from fnmatch import fnmatch
from browsercache import BrowserCache
__all__ = [
"get_child_packages_in",
"get_module_names_under",
"import_modules_under",
"escape_xpath_value",
"BrowserCache"
]
# Public
def get_child_packages_in(root_dir, include_root_package_name=True, exclusions=None):
... |
cflee/voc | refs/heads/master | docs/conf.py | 2 | # -*- coding: utf-8 -*-
#
# VOC documentation build configuration file, created by
# sphinx-quickstart on Sat Jul 27 14:58:42 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All con... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/ship/attachment/weapon/star_destroyer_turret_square_body.py | 85615 | import sys
def setup(core, object):
return |
varunkamra/kuma | refs/heads/master | vendor/packages/translate/storage/xml_extract/misc.py | 24 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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... |
nlholdem/icodoom | refs/heads/master | .venv/lib/python2.7/site-packages/pbr/tests/test_core.py | 31 | # Copyright (c) 2013 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 applica... |
opencorato/votainteligente-portal-electoral | refs/heads/master | elections/migrations/0002_candidate.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('popolo', '__first__'),
('elections', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Can... |
xfournet/intellij-community | refs/heads/master | python/testData/refactoring/introduceField/py4414.py | 83 | class SomeClass():
def a(self):
<selection>1</selection> |
kieslee/xlogging | refs/heads/master | xlogging/__init__.py | 1 | import logging, inspect, socket, os
import handlers
from handlers import getRotatingHandler, MailHandler
from singleton import Singleton
from threading import Lock
import sys, cStringIO, traceback
lock_config = Lock()
############### xlogging module ###############
class xlogging(Singleton):
# some global variabl... |
elaske/tsp-data | refs/heads/develop | bs4/builder/_lxml.py | 446 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from io import BytesIO
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
Parse... |
binarydud/django-oscar | refs/heads/master | src/oscar/apps/address/__init__.py | 59 | default_app_config = 'oscar.apps.address.config.AddressConfig'
|
Ebag333/Pyfa | refs/heads/master | eos/effects/drawbackmaxvelocity.py | 2 | # drawbackMaxVelocity
#
# Used by:
# Modules from group: Rig Armor (48 of 72)
# Modules from group: Rig Resource Processing (8 of 10)
type = "passive"
def handler(fit, module, context):
fit.ship.boostItemAttr("maxVelocity", module.getModifiedItemAttr("drawback"),
stackingPenalties=True)... |
chaluemwut/fbserver | refs/heads/master | venv/lib/python2.7/site-packages/numpy/distutils/fcompiler/pg.py | 62 | # http://www.pgroup.com
from __future__ import division, absolute_import, print_function
from numpy.distutils.fcompiler import FCompiler
from sys import platform
compilers = ['PGroupFCompiler']
class PGroupFCompiler(FCompiler):
compiler_type = 'pg'
description = 'Portland Group Fortran Compiler'
version... |
iut-ibk/DynaMind-UrbanSim | refs/heads/master | 3rdparty/opus/src/synthesizer/psuedo_sparse_matrix.py | 2 | # Running IPF on Person and Household data
import time
import MySQLdb
import operator
import os
from math import exp
from numpy import asarray as arr
from numpy import ones, zeros
from numpy import histogram
from scipy import sparse
import adjusting_pums_joint_distribution
def populate_master_matrix(db,... |
magosil86/ruffus | refs/heads/master | ruffus/test/test_newstyle_proxy.py | 5 | #!/usr/bin/env python
from __future__ import print_function
"""
test_softlink_uptodate.py
"""
import os
import sys
tempdir = os.path.relpath(os.path.abspath(os.path.splitext(__file__)[0])) + "/"
# add grandparent to search path for testing
grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__... |
EvenStrangest/tensorflow | refs/heads/master | tensorflow/python/framework/contrib_test.py | 8 | # 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... |
RonnyPfannschmidt/click | refs/heads/master | examples/termui/termui.py | 10 | # coding: utf-8
import click
import time
import random
try:
range_type = xrange
except NameError:
range_type = range
@click.group()
def cli():
"""This script showcases different terminal UI helpers in Click."""
pass
@cli.command()
def colordemo():
"""Demonstrates ANSI color support."""
for ... |
f-andrey/sprutio | refs/heads/master | app/config/routes.py | 1 | from handlers.actions.main import RestoreSessionHandler
from handlers.actions.main import SaveSessionHandler
from handlers.actions.main import InitSessionHandler
from handlers.actions.main import CheckStatusHandler
from handlers.actions.main import CancelOperationHandler
from handlers.actions.main import LoadSettingsHa... |
android-legacy/android_kernel_sony_eagle | refs/heads/cm-11.0 | 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... |
opena11y/fae2 | refs/heads/master | fae2/websiteResults/tests.py | 1 | """
Copyright 2014-2016 University of Illinois
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 writ... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.7/Lib/test/test_mhlib.py | 3 | """
Tests for the mhlib module
Nick Mathewson
"""
### BUG: This suite doesn't currently test the mime functionality of
### mhlib. It should.
import unittest
from test.test_support import run_unittest, TESTFN, import_module
import os, StringIO
import sys
mhlib = import_module('mhlib', deprecated=True)
if ... |
2014cdbg7/2014cdbg7 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/gc.py | 743 | """This module provides access to the garbage collector for reference cycles.
enable() -- Enable automatic garbage collection.
disable() -- Disable automatic garbage collection.
isenabled() -- Returns true if automatic collection is enabled.
collect() -- Do a full collection right now.
get_count() -- Return the curren... |
stwunsch/gnuradio | refs/heads/master | gr-digital/python/digital/qa_diff_encoder.py | 57 | #!/usr/bin/env python
#
# Copyright 2006,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or... |
mou4e/zirconium | refs/heads/master | tools/metrics/histograms/update_use_counter_feature_enum.py | 63 | #!/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.
"""Scans the Chromium source of UseCounter, formats the Feature enum for
histograms.xml and merges it. This script can also generate a ... |
aroche/django | refs/heads/master | tests/migrations/test_migrations/0001_initial.py | 266 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
... |
kingsdigitallab/dprr-django | refs/heads/master | promrep/scripts/import_nicolet_data.py | 1 | # -*- coding: utf-8 -*-
import logging
import pprint
import re
from os import path
import unicodecsv as csv
from promrep.models import (Office, Person, PostAssertion, PostAssertionNote,
Praenomen, SecondarySource, Sex, StatusAssertion,
StatusAssertionNote, Statu... |
lemire/PeachPy | refs/heads/master | peachpy/x86_64/encoding.py | 5 | # This file is part of Peach-Py package and is licensed under the Simplified BSD license.
# See license.rst for the full text of the license.
def optional_rex(r, rm, force_rex=False):
assert r in {0, 1}, "REX.R must be 0 or 1"
from peachpy.x86_64.operand import MemoryAddress
from peachpy.x86_64.registe... |
haad/ansible | refs/heads/devel | lib/ansible/modules/remote_management/manageiq/manageiq_alert_profiles.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Red Hat 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_version': '1.1',
... |
mfalesni/cfme_tests | refs/heads/master | cfme/test_framework/browser_isolation.py | 2 | # -*- coding: utf-8 -*-
"""Plugin enabling us to isolate browser sessions per test.
If active, then when each test ends, the browser gets killed. That ensures that whatever way the
browser session could be tainted after a test, the next test should not be affected.
"""
import pytest
def pytest_addoption(parser):
... |
framon/samba | refs/heads/master | lib/testtools/testtools/helpers.py | 12 | # Copyright (c) 2010-2012 testtools developers. See LICENSE for details.
__all__ = [
'safe_hasattr',
'try_import',
'try_imports',
]
import sys
def try_import(name, alternative=None, error_callback=None):
"""Attempt to import ``name``. If it fails, return ``alternative``.
When supporting mu... |
moijes12/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/localflavor/ch/forms.py | 101 | """
Swiss-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.ch.ch_states import STATE_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
f... |
balloob/home-assistant | refs/heads/dev | homeassistant/components/mqtt_eventstream/__init__.py | 11 | """Connect two Home Assistant instances via MQTT."""
import json
import voluptuous as vol
from homeassistant.components.mqtt import valid_publish_topic, valid_subscribe_topic
from homeassistant.const import (
ATTR_SERVICE_DATA,
EVENT_CALL_SERVICE,
EVENT_STATE_CHANGED,
EVENT_TIME_CHANGED,
MATCH_ALL... |
Komodo/dbexplorer_pgsql | refs/heads/master | platform/Linux_x86-gcc3/pylib/ko_psycopg2_pq4/psycopg2/__init__.py | 10 | """A Python driver for PostgreSQL
psycopg is a PostgreSQL_ database adapter for the Python_ programming
language. This is version 2, a complete rewrite of the original code to
provide new-style classes for connection and cursor objects and other sweet
candies. Like the original, psycopg 2 was written with the aim of b... |
CiscoSystems/openstack-dashboard | refs/heads/master | django-openstack/django_openstack/tests/broken/base.py | 17 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
mozilla/verbatim | refs/heads/master | vendor/lib/python/translate/lang/kn.py | 30 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of t... |
clinton-hall/nzbToMedia | refs/heads/master | libs/common/setuptools/ssl_support.py | 64 | import os
import socket
import atexit
import re
import functools
from setuptools.extern.six.moves import urllib, http_client, map, filter
from pkg_resources import ResolutionError, ExtractionError
try:
import ssl
except ImportError:
ssl = None
__all__ = [
'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_a... |
skycucumber/restful | refs/heads/master | python/venv/lib/python2.7/site-packages/migrate/changeset/databases/sqlite.py | 60 | """
`SQLite`_ database specific implementations of changeset classes.
.. _`SQLite`: http://www.sqlite.org/
"""
try: # Python 3
from collections import MutableMapping as DictMixin
except ImportError: # Python 2
from UserDict import DictMixin
from copy import copy
import re
from sqlalchemy.databases imp... |
OptimusGREEN/repo67beta | refs/heads/master | plugin.video.ogtv/resources/lib/menus/ogtv/ogtv_tech.py | 2 | # -*- coding: utf-8 -*-
import os # access operating system commands
import xbmc # the base xbmc functions, pretty much every add-on is going to need at least one function from here
import xbmcaddon # pull addon specific information such as settings, id, fanart etc.
import xbmcplugin # contains... |
clione/django-kanban | refs/heads/master | src/core/userena/backends.py | 16 | import django.core.validators
from django.contrib.auth.backends import ModelBackend
from userena.utils import get_user_model
class UserenaAuthenticationBackend(ModelBackend):
"""
Custom backend because the user must be able to supply a ``email`` or
``username`` to the login form.
"""
def authenti... |
howl-anderson/vimapt | refs/heads/master | src/vimapt/bin/pkg_list.py | 1 | #!/usr/bin/env python
import os
import sys
import vim
from vimapt.data_format import loads
def main():
vim_dir = sys.argv[1]
cache_dir = os.path.join(vim_dir, 'vimapt/cache')
local_package_index_path = os.path.join(cache_dir, 'index/package')
with open(local_package_index_path) as fd:
sour... |
Arnab10/Dexter-Lab | refs/heads/master | dexter.py | 1 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
post = input("what do you want to post on facebook? : ")
id = input("E-mail : ")
pw = input("Password : ")
driver = webdriver.Firefox()
driver.get('https://www.facebook.com/')
print("Opened facebook...")
time.sleep(... |
google/next-prediction | refs/heads/master | code/train.py | 1 | # Copyright 2019 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 ... |
hbisheng/ucore_os_lab | refs/heads/master | related_info/ostep/ostep16-raid.py | 54 | #! /usr/bin/env python
import math
import random
from optparse import OptionParser
# minimum unit of transfer to RAID
BLOCKSIZE = 4096
def convert(size):
length = len(size)
lastchar = size[length-1]
if (lastchar == 'k') or (lastchar == 'K'):
m = 1024
nsize = int(size[0:length-1]) * m
... |
dovydas/mezzanine | refs/heads/master | mezzanine/galleries/admin.py | 24 | from __future__ import unicode_literals
from django.contrib import admin
from mezzanine.core.admin import TabularDynamicInlineAdmin
from mezzanine.pages.admin import PageAdmin
from mezzanine.galleries.models import Gallery, GalleryImage
from mezzanine.utils.static import static_lazy as static
class GalleryImageInli... |
GeoMatDigital/django-geomat | refs/heads/develop | geomat/stein/migrations/0059_mineraltype_new_mohs_scale.py | 1 | # Generated by Django 2.0.2 on 2018-05-03 18:57
from decimal import Decimal
import django.contrib.postgres.fields.ranges
from django.db import migrations
def transform_to_new_mohs_scale(apps, schema_editor):
MineralType = apps.get_model("stein", "MineralType")
for mineral in MineralType.objects.all():
... |
hehongliang/tensorflow | refs/heads/master | tensorflow/compiler/tests/adagrad_test.py | 13 | # 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... |
ricsatjr/mplstereonet | refs/heads/master | examples/equal_area_equal_angle_comparison.py | 3 | """A quick visual comparison of equal area vs. equal angle nets."""
import matplotlib.pyplot as plt
import mplstereonet
fig = plt.figure()
# Make an "equal area" (a.k.a. "Schmidt") stereonet
# (Lambert Azimuthal Equal Area Projection)
ax1 = fig.add_subplot(1,2,1, projection='equal_area_stereonet')
# Make an "equal a... |
EmreAtes/spack | refs/heads/develop | var/spack/repos/builtin/packages/py-numexpr/package.py | 3 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
numenta-archive/pycept | refs/heads/master | pycept/cept.py | 4 | # The MIT License (MIT)
#
# Copyright (c) 2013 Numenta, 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, mod... |
Enether/python_wow | refs/heads/master | tests/models/character/test_loader.py | 1 | import unittest
import database.main
from tests.create_test_db import engine, session, Base
database.main.engine = engine
database.main.session = session
database.main.Base = Base
from copy import deepcopy
import models.main
from classes import Paladin
from exceptions import NoSuchCharacterError
from models.characte... |
wkschwartz/django | refs/heads/stable/3.2.x | tests/urlpatterns_reverse/method_view_urls.py | 61 | from django.urls import path
class ViewContainer:
def method_view(self, request):
pass
@classmethod
def classmethod_view(cls, request):
pass
view_container = ViewContainer()
urlpatterns = [
path('', view_container.method_view, name='instance-method-url'),
path('', ViewContaine... |
waytai/django | refs/heads/master | django/core/serializers/pyyaml.py | 439 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import collections
import decimal
import sys
from io import StringIO
import yaml
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import (
Deserializer as PythonDes... |
40023154/final0627 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/marshal.py | 1265 | from json import * |
tarballs-are-good/sympy | refs/heads/master | sympy/physics/tests/test_physics_matrices.py | 10 | from sympy.physics.matrices import msigma, mgamma, minkowski_tensor
from sympy import zeros, eye, I
def test_Pauli():
#this and the following test are testing both Pauli and Dirac matrices
#and also that the general Matrix class works correctly in a real world
#situation
sigma1=msigma(1)
sigma2=m... |
Mitali-Sodhi/CodeLingo | refs/heads/master | Dataset/python/test_cert_verification (2).py | 126 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software withou... |
achang97/YouTunes | refs/heads/master | lib/python2.7/site-packages/pip/commands/show.py | 344 | from __future__ import absolute_import
from email.parser import FeedParser
import logging
import os
from pip.basecommand import Command
from pip.status_codes import SUCCESS, ERROR
from pip._vendor import pkg_resources
from pip._vendor.packaging.utils import canonicalize_name
logger = logging.getLogger(__name__)
c... |
JSansalone/VirtualBox4.1.18 | refs/heads/master | src/VBox/GuestHost/OpenGL/packer/pack_current.py | 22 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
# This script generates the pack_current.c file.
import sys
sys.path.append( "../glapi_parser" )
import apiutil
from pack_currenttypes import *
apiutil.CopyrightC()
print "... |
TalShafir/ansible | refs/heads/devel | test/units/modules/net_tools/nios/test_nios_network_view.py | 68 | # 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 distributed in the hope that ... |
roadmapper/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': '... |
fspaolo/scikit-learn | refs/heads/master | sklearn/gaussian_process/tests/test_gaussian_process.py | 4 | """
Testing for Gaussian Process module (sklearn.gaussian_process)
"""
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# Licence: BSD 3 clause
from nose.tools import raises
from nose.tools import assert_true
import numpy as np
from sklearn.gaussian_process import GaussianProcess
from sklearn.gaussian_process ... |
araisrobo/linuxcnc | refs/heads/master | configs/gladevcp/probe/probe.py | 1 | #!/usr/bin/env python
# vim: sts=4 sw=4 et
# This is a component of EMC
# probe.py Copyright 2010 Michael Haberler
#
#
# 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 versi... |
Senseg/Py4A | refs/heads/master | python3-alpha/python3-src/Lib/fnmatch.py | 51 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... |
garyfeng/pybrain | refs/heads/master | pybrain/rl/learners/directsearch/__init__.py | 26 | from pybrain.rl.learners.directsearch.rwr import RWR
from pybrain.rl.learners.directsearch.enac import ENAC
from pybrain.rl.learners.directsearch.reinforce import Reinforce
# TODO: also black-box optimizers -- but this leads to circular imports...
# from pybrain.optimization.__init__ import *
|
pschmitt/home-assistant | refs/heads/dev | tests/components/min_max/test_sensor.py | 3 | """The test for the min/max sensor platform."""
import statistics
import unittest
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
UNIT_PERCENTAGE,
)
from homeassistant.setup import setup_component
from tests.common im... |
insomnia-lab/calibre | refs/heads/master | src/calibre/ebooks/metadata/cli.py | 16 | from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
ebook-meta
'''
import sys, os
from calibre.utils.config import StringConfig
from calibre.customize.ui import metadata_readers, metadata_writers, force_ident... |
pasv/Empire | refs/heads/master | lib/common/modules.py | 20 | """
Module handling functionality for Empire.
Right now, just loads up all modules from the
install path in the common config.
"""
import sqlite3
import fnmatch
import os
import imp
import messages
import helpers
class Modules:
def __init__(self, MainMenu, args):
self.mainMenu = MainMenu
# ... |
ChainBoy/disconf | refs/heads/master | disconf-client/tools/my_printzootree.py | 16 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Created on 2013-5-23
@author: liaoqiqi
打印zookeeper树
'''
from kazoo.client import KazooClient
from kazoo.client import KazooState
import datetime
import time
hosts = '10.48.57.42:8581,10.48.57.42:8582,10.48.57.42:8583'
zk = KazooClient(hosts=hosts)
zk.start()
print ... |
ariev7x/S7270_kernel | refs/heads/master | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
vaidap/zulip | refs/heads/master | zerver/webhooks/stripe/tests.py | 22 | # -*- coding: utf-8 -*-
from typing import Text
from zerver.lib.test_classes import WebhookTestCase
import mock
class StripeHookTests(WebhookTestCase):
STREAM_NAME = 'test'
URL_TEMPLATE = "/api/v1/external/stripe?&api_key={api_key}"
FIXTURE_DIR_NAME = 'stripe'
def test_charge_dispute_closed(self):
... |
antismap/MICshooter | refs/heads/master | sources/enemy.py | 1 | import common_pygame
import collisions
import random
import hud
import particles
import smoke
pygame = common_pygame.pygame
class Enemy():
whentoshoot = 0
nbAsteroids = 0
def __init__(self, single_sprites, sprite_sequences, sounds, x, y,
movementdirection, typeofship, menu):
se... |
stefanv/aandete | refs/heads/master | app/lib/pygments/styles/vs.py | 31 | # -*- coding: utf-8 -*-
"""
pygments.styles.vs
~~~~~~~~~~~~~~~~~~
Simple style with MS Visual Studio colors.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Co... |
witten/borgmatic | refs/heads/master | borgmatic/commands/convert_config.py | 1 | import os
import sys
import textwrap
from argparse import ArgumentParser
from ruamel import yaml
from borgmatic.config import convert, generate, legacy, validate
DEFAULT_SOURCE_CONFIG_FILENAME = '/etc/borgmatic/config'
DEFAULT_SOURCE_EXCLUDES_FILENAME = '/etc/borgmatic/excludes'
DEFAULT_DESTINATION_CONFIG_FILENAME =... |
chop-dbhi/biorepo-portal | refs/heads/master | api/serializers.py | 1 | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from api.models.protocols import Organization, DataSource, Protocol,\
ProtocolDataSource, ProtocolDataSourceLink, ProtocolUser,\
ProtocolUserCredentials
class UserSerializer(serializers.HyperlinkedModelSerializer):
... |
nostalgiaz/django-cms | refs/heads/support/3.0.x | cms/test_utils/project/urls_for_apphook_tests.py | 14 | from cms.utils.compat.dj import is_installed
from cms.utils.conf import get_cms_setting
from django.conf import settings
from django.conf.urls import patterns, include, url
try:
from django.conf.urls.i18n import i18n_patterns
except ImportError:
from i18nurls.i18n import i18n_patterns
from django.contrib import... |
cuilishen/cuilishenMissionPlanner | refs/heads/master | Lib/distutils/command/bdist_rpm.py | 104 | """distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
__revision__ = "$Id$"
import sys
import os
import string
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.file_util import write_file
from distutils.errors ... |
jake1036/spider | refs/heads/master | scrapy/contrib/webservice/crawler.py | 43 | from scrapy.webservice import JsonRpcResource
class CrawlerResource(JsonRpcResource):
ws_name = 'crawler'
def __init__(self, crawler):
JsonRpcResource.__init__(self, crawler, crawler)
|
alfredoavanzosc/odoomrp-utils | refs/heads/8.0 | stock_picking_customer_ref/models/stock_picking.py | 4 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import fields, models, api
class StockPickin... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/draft_schematic/vehicle/component/shared_power_plant_mk1.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/vehicle/component/shared_power_plant_mk1.iff"
result.attri... |
dc3-plaso/dfvfs | refs/heads/master | dfvfs/file_io/encoded_stream_io.py | 1 | # -*- coding: utf-8 -*-
"""The encoded stream file-like object implementation."""
import os
from dfvfs.encoding import manager as encoding_manager
from dfvfs.file_io import file_io
from dfvfs.lib import errors
from dfvfs.resolver import resolver
class EncodedStream(file_io.FileIO):
"""Class that implements a file... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/lepl/stream/maxdepth.py | 2 | # The contents of this file are subject to the Mozilla Public License
# (MPL) Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# ba... |
saurabh6790/OFF-RISAPP | refs/heads/master | hr/doctype/designation/test_designation.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
test_records = [[{"doctype":"Designation", "designation_name":"_Test Designation"}]] |
AndroidOpenDevelopment/android_external_chromium_org | refs/heads/lp | ppapi/generators/idl_parser.py | 54 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Parser for PPAPI IDL """
#
# IDL Parser
#
# The parser is uses the PLY yacc library to build a set of parsing rules based
# on... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.