repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
pilou-/ansible | refs/heads/devel | test/units/modules/storage/hpe3par/test_ss_3par_cpg.py | 17 | # Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import mock
import pytest
import sys
sys.modules['hpe3par_sdk'] = mock.Mock()
sys.modules['hpe3par_sdk.client'] = mock.Mock()
sys.modules['hpe3parclient'] = m... |
mathspace/django | refs/heads/master | tests/sessions_tests/models.py | 53 | """
This custom Session model adds an extra column to store an account ID. In
real-world applications, it gives you the option of querying the database for
all active sessions for a particular account.
"""
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.contrib.sessions.base_session ... |
jasonbot/django | refs/heads/master | django/contrib/postgres/__init__.py | 718 | default_app_config = 'django.contrib.postgres.apps.PostgresConfig'
|
sergio-incaser/odoo | refs/heads/8.0 | addons/l10n_pe/__init__.py | 2120 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... |
bop/bauhaus | refs/heads/master | lib/python2.7/site-packages/django/db/models/fields/related.py | 7 | from operator import attrgetter
from django.db import connection, connections, router
from django.db.backends import util
from django.db.models import signals, get_model
from django.db.models.fields import (AutoField, Field, IntegerField,
PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist)
from dja... |
rspavel/spack | refs/heads/develop | var/spack/repos/builtin/packages/rmlab/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 Rmlab(CMakePackage):
"""C++ File API for the reMarkable tablet"""
homepage = "https:/... |
amiq-consulting/amiq_blog | refs/heads/master | amiq_sv_c_python_how_to_connect_systemverilog_with_python/server.py | 1 | # /******************************************************************************
# * (C) Copyright 2019 AMIQ Consulting
# *
# * 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:/... |
5StevenWu/Coursepy | refs/heads/master | day12/homework/front/__init__.py | 30 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#Author:xp
#blog_url: http://blog.csdn.net/wuxingpu5/article/details/71209731
|
hoangt/tpzsimul.gem5 | refs/heads/master | src/cpu/IntrControl.py | 72 | # Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 ... |
leereilly/django-1 | refs/heads/master | django/contrib/localflavor/jp/forms.py | 194 | """
JP-specific Form helpers
"""
from __future__ import absolute_import
from django.contrib.localflavor.jp.jp_prefectures import JP_PREFECTURES
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
class JPPostalCodeField(RegexField):
"""
A form field tha... |
mogproject/easy-alert | refs/heads/master | src/easy_alert/watcher/command_watcher.py | 1 | import subprocess
import re
from datetime import datetime
from watcher import Watcher
from easy_alert.entity import Alert, Level
from easy_alert.i18n import *
from easy_alert.setting.setting_error import SettingError
from easy_alert.util import get_server_id, exists
class CommandWatcher(Watcher):
"""
Check th... |
Cid427/machinekit | refs/heads/master | src/emc/usr_intf/axis/scripts/axis-remote.py | 12 | #!/usr/bin/env python2
# This is a component of AXIS, a front-end for LinuxCNC
# Copyright 2006 Jeff Epler <jepler@unpythonic.net> and
# Chris Radek <chris@timeguy.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... |
tbachman/group-based-policy | refs/heads/master | gbpservice/neutron/services/grouppolicy/drivers/cisco/apic/name_manager.py | 1 | # 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... |
nvoron23/scipy | refs/heads/master | scipy/signal/tests/test_waveforms.py | 92 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (TestCase, assert_almost_equal, assert_equal,
assert_, assert_raises, run_module_suite,
assert_allclose)
import scipy.signal.waveforms as waveforms
# Th... |
joopert/home-assistant | refs/heads/dev | homeassistant/components/geizhals/sensor.py | 2 | """Parse prices of a device from geizhals."""
import logging
from datetime import timedelta
from geizhals import Device, Geizhals
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle
from homea... |
aschleg/mathpy | refs/heads/master | mathpy/numtheory/integers.py | 1 | # encoding=utf8
"""
Module containing functions and methods related to primes and some elementary number theory.
"""
import numpy as np
from mathpy.numtheory.primes import naive_prime
def iscomposite(n):
r"""
Tests whether a given value :math:`n` is composite. Essentially the opposite
... |
philipz/PyCV-time | refs/heads/master | experiments/differential_screen_tracker/cam.py | 12 | """
press 'p' to print camera information
press 's' to set camera property. Try 'p' first to see property names then insert them in console.
press 'f' to print measured frame rate (the frequency MyCam.read() is called).
"""
import cv2
from time import clock
class MyCam(object):
def __init__(self, src=None):
... |
scripnichenko/glance | refs/heads/master | glance/api/v2/image_data.py | 3 | # Copyright 2012 OpenStack Foundation.
# 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 req... |
RenegadesTV/repository.renegadestv | refs/heads/master | script.renegadestv/addon.py | 5 | #
# Copyright (C) 2012 Tommy Winther
# http://tommy.winther.nu
#
# Modified for FTV Guide (09/2014 onwards)
# by Thomas Geppert [bluezed] - bluezed.apps@gmail.com
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... |
emedinaa/contentbox | refs/heads/master | third_party/social/backends/ubuntu.py | 85 | """
Ubuntu One OpenId backend
"""
from social.backends.open_id import OpenIdAuth
class UbuntuOpenId(OpenIdAuth):
name = 'ubuntu'
URL = 'https://login.ubuntu.com'
def get_user_id(self, details, response):
"""
Return user unique id provided by service. For Ubuntu One
the nickname sh... |
dims/neutron | refs/heads/master | neutron/db/migration/alembic_migrations/versions/liberty/expand/9859ac9c136_quota_reservations.py | 33 | # Copyright 2015 OpenStack Foundation
#
# 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 ... |
tarc/gyp | refs/heads/master | test/win/gyptest-midl-rules.py | 125 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Handle default .idl build rules.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(formats=['msvs', ... |
wasit7/tutorials | refs/heads/master | django/making_model/myproject/manage.py | 11 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that th... |
defionscode/ansible | refs/heads/devel | lib/ansible/modules/cloud/google/gcp_compute_firewall_facts.py | 11 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
isimluk/bronte | refs/heads/master | backend/bronte/model/entities/brStatementSummary.py | 1 | #!/usr/bin/python
#
# Copyright (c) 2013 Simon Lukasik
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have ... |
vinayan3/clpricehistory | refs/heads/master | django/contrib/localflavor/be/forms.py | 246 | """
Belgium-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
class BEPostalCodeField(RegexField):
"""
A form field that validat... |
dpaiton/OpenPV | refs/heads/master | pv-core/python/deprecated/max_pv_object.py | 1 | import numpy as np
class PV_Object(list):
def __init__(self, data, header = None, name = None):
self.header = header
self.name = name
list.__init__(self, data)
def getActive(self):
actList = np.zeros(len(self))
assert (self.header['filetype'] == 5 or self.header['filetyp... |
quantopian/qrisk | refs/heads/master | docs/conf.py | 2 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# empyrical documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 25 22:49:14 2018.
#
# 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
# ... |
schatt/zulip | refs/heads/master | docs/html_unescape.py | 116 | #!/usr/bin/env python3
# Remove HTML entity escaping left over from MediaWiki->rST conversion.
import html
import sys
for line in sys.stdin:
print(html.unescape(line), end='')
|
salguarnieri/intellij-community | refs/heads/master | python/helpers/pydev/_pydevd_bundle/pydevd_process_net_command.py | 8 | import os
import sys
import traceback
from _pydev_bundle import pydev_log
from _pydevd_bundle import pydevd_traceproperty, pydevd_tracing, pydevd_dont_trace
import pydevd_file_utils
from _pydevd_bundle.pydevd_breakpoints import LineBreakpoint, update_exception_hook
from _pydevd_bundle.pydevd_comm import CMD_RUN, CMD_V... |
erdavila/M-Tree | refs/heads/master | py/mtree/tests/fixtures/f04.py | 2 | from mtree.tests.fixtures.generator import ADD, REMOVE, QUERY
"""
actions = '4a4r4a4r'
dimensions = 2
remove_chance = 0.1
"""
DIMENSIONS = 2
def PERFORM(callback):
callback(ADD((5, 40), QUERY((45, 84), 15.412622811172305, 3)))
callback(ADD((33, 13), QUERY((32, 89), 64.27250089810116, 1)))
callback(ADD((19, 41), QU... |
garinh/cs | refs/heads/master | scripts/msi/wixlib.py | 4 | #!/usr/bin/python
from csguidregistry import guid_registry as gr
import uuid
import os
import sha
import md5
import re
import sys
from lxml import etree
class Empty(object):
"""Marker class"""
pass
class InitializeOnDef(type):
"""
Ok. Now this is black magic. Makes every class have its own stack of... |
joaopauloribeiro/p2pool | refs/heads/master | p2pool/util/fixargparse.py | 283 | from __future__ import absolute_import
import argparse
import sys
class FixedArgumentParser(argparse.ArgumentParser):
'''
fixes argparse's handling of empty string arguments
and changes @filename behaviour to accept multiple arguments on each line
'''
def _read_args_from_files(self, arg_strings)... |
gcd0318/django | refs/heads/master | tests/resolve_url/models.py | 669 | """
Regression tests for the resolve_url function.
"""
from django.db import models
class UnimportantThing(models.Model):
importance = models.IntegerField()
def get_absolute_url(self):
return '/importance/%d/' % (self.importance,)
|
jimi-c/ansible | refs/heads/devel | lib/ansible/modules/system/cronvar.py | 73 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Cronvar Plugin: The goal of this plugin is to provide an idempotent
# method for set cron variable values. It should play well with the
# exi... |
peterbe/airmozilla | refs/heads/master | vendor-local/lib/python/south/tests/logic.py | 10 | import unittest
import datetime
import sys
from south import exceptions
from south.migration import migrate_app
from south.migration.base import all_migrations, Migrations
from south.creator.changes import ManualChanges
from south.migration.utils import depends, flatten, get_app_label
from south.models import Migrati... |
dmansfield/linux | refs/heads/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 1996 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
CalebBell/ht | refs/heads/master | ht/hx.py | 1 | # -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017, 2018 Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software... |
julien78910/CouchPotatoServer | refs/heads/develop | couchpotato/core/plugins/category/index.py | 81 | from CodernityDB.tree_index import TreeBasedIndex
class CategoryIndex(TreeBasedIndex):
_version = 1
def __init__(self, *args, **kwargs):
kwargs['key_format'] = 'i'
super(CategoryIndex, self).__init__(*args, **kwargs)
def make_key(self, key):
return key
def make_key_value(sel... |
testlinkjp/testlink-japanese-localization | refs/heads/master | third_party/fckeditor/editor/filemanager/connectors/py/connector.py | 45 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gn... |
detrout/pykolab | refs/heads/master | tests/unit/test-011-base64_encoded_contact.py | 1 | from email import message_from_string
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEImage import MIMEImage
from email.MIMEText import MIMEText
from email.Utils import COMMASPACE, formatdate
from email import Encoders
import sys
import unittest
class TestContactBase64E... |
svviz/svviz | refs/heads/master | src/svviz/alignproc.py | 1 | """
this module wraps the ssw_wrap Smith-Waterman alignment code in a subprocess
because ssw can occasionally segfault when aligning long reads against a reasonably
large reference sequence; when the subprocess segfaults, this is detected below
and the result is skipped
not yet implemented: try aligning the reverse co... |
tuskar/tuskar-ui | refs/heads/master | openstack_dashboard/dashboards/admin/flavors/forms.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
jimsimon/sky_engine | refs/heads/master | mojo/public/tools/download_archiecture_independent_frameworks.py | 27 | #!/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 os
import sys
CURRENT_PATH = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(CURREN... |
wwj718/edx-platform | refs/heads/master | openedx/core/lib/tests/assertions/events.py | 174 | """Assertions related to event validation"""
import json
import pprint
def assert_event_matches(expected, actual, tolerate=None):
"""
Compare two event dictionaries.
Fail if any discrepancies exist, and output the list of all discrepancies. The intent is to produce clearer
error messages than "{ som... |
proyectofedora-infra/kickstart-fedora-online | refs/heads/master | kickstart/app/__init__.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# __init__.py
#
# Copyright © 2014 Valentin Basel <valentinbasel@gmail.com>
#
# 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 versio... |
bopo/cookiecutter-django | refs/heads/master | {{cookiecutter.project_slug}}/config/settings/local.py | 1 | # -*- coding: utf-8 -*-
"""
Local settings
- Run in Debug mode
{% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' %}
- Use mailhog for emails
{% else %}
- Use console backend for emails
{% endif %}
- Add Django Debug Toolbar
- Add django-extensions as app
"""
import socket
import os
from .base i... |
nuwainfo/treeio | refs/heads/master | core/api/auth/urls.py | 3 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('treeio.core.api.auth.views',
url(r'^get_request_token$', 'get_request_token',
name="api_get_request_token"),
url(... |
abtink/openthread | refs/heads/master | tools/harness-automation/cases/sed_6_3_2.py | 18 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... |
verbalsaintmars/srmparserlite | refs/heads/master | srmparserlite/splLineClass/__init__.py | 20578 | |
roninio/gae-shopify-python-boilerplate | refs/heads/master | bp_content/themes/default/config/testing.py | 11 | config = {
# This config file will be detected in unit testing environment and values defined here will overwrite those in config.py
'environment': "testing",
# ----> ADD MORE CONFIGURATION OPTIONS HERE <----
}
|
waseem18/oh-mainline | refs/heads/master | vendor/packages/twisted/doc/core/howto/listings/deferred/deferred_ex6.py | 16 | #!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import defer
from twisted.python import failure, util
"""
Now comes the more nuanced addCallbacks, which allows us to make a
yes/no (branching) decision based on whether the result at a given point is
... |
ticklemepierce/osf.io | refs/heads/develop | website/addons/osfstorage/settings/__init__.py | 562 | import logging
from .defaults import * # noqa
logger = logging.getLogger(__name__)
try:
from .local import * # noqa
except ImportError as error:
logger.warn('No local.py settings file found')
|
ZeitOnline/zeit.brightcove | refs/heads/master | src/zeit/brightcove/generation/install.py | 1 | import zeit.cms.generation
import zeit.cms.generation.install
def install(root):
# empty install just to have one because it makes live easier later on.
pass
def evolve(context):
zeit.cms.generation.do_evolve(context, install)
|
melor/kafkajournalpump | refs/heads/master | setup.py | 2 | from setuptools import setup, find_packages
from kafkajournalpump import __version__
import os
setup(
name="kafkajournalpump",
version=os.getenv("VERSION") or __version__,
zip_safe=False,
packages=find_packages(exclude=["test"]),
install_requires=["kafka-python >= 0.9.0"],
extras_require={},
... |
alshedivat/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/estimators/run_config.py | 22 | # 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... |
mzupan/nagios-plugin-mongodb | refs/heads/master | check_mongodb.py | 1 | #!/usr/bin/env python
#
# A MongoDB Nagios check script
#
# Script idea taken from a Tag1 script I found and I modified it a lot
#
# Main Author
# - Mike Zupan <mike@zcentric.com>
# Contributers
# - Frank Brandewiede <brande@travel-iq.com> <brande@bfiw.de> <brande@novolab.de>
# - Sam Perman <sam@brightcove.com>... |
sclabs/sccms-nonrel | refs/heads/master | django/core/management/commands/startproject.py | 322 | from django.core.management.base import copy_helper, CommandError, LabelCommand
from django.utils.importlib import import_module
import os
import re
from random import choice
class Command(LabelCommand):
help = "Creates a Django project directory structure for the given project name in the current directory."
... |
Foxugly/medagenda | refs/heads/master | static/bootstrap-datepicker-master/docs/conf.py | 276 | # -*- coding: utf-8 -*-
#
# bootstrap-datepicker documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 2 14:45:57 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 ... |
BT-csanchez/hr | refs/heads/8.0 | __unported__/hr_skill/__openerp__.py | 2 | # -*- encoding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it un... |
ShanghaiTimes/Audacity2015 | refs/heads/master | lib-src/lv2/sord/waflib/Tools/waf_unit_test.py | 267 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys
from waflib.TaskGen import feature,after_method
from waflib import Utils,Task,Logs,Options
testlock=Utils.threading.Lock()
@feature('test')
@after_method('apply_... |
forpster/dotfiles | refs/heads/master | home/.emacs.d/.python-environments/default/lib/python2.7/site-packages/pip/_vendor/html5lib/ihatexml.py | 1727 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... |
soegaard/bracket | refs/heads/master | math-scribble/MathJax/docs/rst/conf.py | 4 | # -*- coding: utf-8 -*-
#
# MathJax documentation build configuration file, created by
# sphinx-quickstart on Sun May 16 23:18:19 2010.
#
# 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... |
vortex-ape/scikit-learn | refs/heads/master | sklearn/cluster/dbscan_.py | 2 | # -*- coding: utf-8 -*-
"""
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Joel Nothman <joel.nothman@gmail.com>
# Lars Buitinck
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from ..base import BaseEst... |
Y300-0100/android_external_chromium | refs/heads/master | testing/gtest/test/gtest_break_on_failure_unittest.py | 1050 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
quattor/aquilon | refs/heads/upstream | lib/aquilon/worker/formats/network_environment.py | 1 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013,2014,2017 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... |
pieiscool/edited-hearthbreaker | refs/heads/master | tests/card_tests/card_tests.py | 2 | import unittest
import csv
import re
from hearthbreaker.agents.basic_agents import DoNothingBot
from hearthbreaker.constants import CHARACTER_CLASS, MINION_TYPE, CARD_RARITY
from hearthbreaker.game_objects import card_lookup
from tests.agents.testing_agents import PredictableAgentWithoutHeroPower
from tests.testing_ut... |
ratio/django-registration | refs/heads/master | registration/tests/models.py | 117 | import datetime
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core import mail
from django.core import management
from django.test import TestCase
from django.utils.hashcompat import sha_constructor
from registration.mod... |
mitya57/django | refs/heads/master | tests/migrations/test_questioner.py | 60 | from django.db.migrations.questioner import MigrationQuestioner
from django.test import SimpleTestCase
from django.test.utils import override_settings
class QuestionerTests(SimpleTestCase):
@override_settings(
INSTALLED_APPS=['migrations'],
MIGRATION_MODULES={'migrations': None},
)
def tes... |
yencarnacion/jaikuengine | refs/heads/master | common/util.py | 29 | # Copyright 2009 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
benjaminanible/dissertation | refs/heads/master | 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... |
cm-a7lte/device_samsung_a7lte | refs/heads/lp | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
he7d3r/revscoring | refs/heads/master | revscoring/languages/indonesian.py | 2 | from .features import Dictionary, RegexMatches, Stopwords
name = "indonesian"
try:
import enchant
dictionary = enchant.Dict("id")
except enchant.errors.DictNotFoundError:
raise ImportError("No enchant-compatible dictionary found for 'id'. " +
"Consider installing 'aspell-id'.")
dic... |
frankiecjunle/yunblog | refs/heads/master | venv/lib/python2.7/site-packages/requests/packages/urllib3/filepost.py | 147 | # urllib3/filepost.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... |
hackersql/sq1map | refs/heads/master | lib/utils/htmlentities.py | 3 | #!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
# Reference: http://www.w3.org/TR/1999/REC-html401-19991224/sgml/entities.html
htmlEntities = {
'quot': 34,
'amp': 38,
'lt': 60,
'gt': 62,
'n... |
kinglogxzl/rqalpha | refs/heads/master | rqalpha/examples/golden_cross.py | 2 | # 可以自己import我们平台支持的第三方python模块,比如pandas、numpy等。
import talib
import numpy as np
import math
import pandas
# 在这个方法中编写任何的初始化逻辑。context对象将会在你的算法策略的任何方法之间做传递。
def init(context):
context.s1 = "000001.XSHE"
# 设置这个策略当中会用到的参数,在策略中可以随时调用,这个策略使用长短均线,我们在这里设定长线和短线的区间,在调试寻找最佳区间的时候只需要在这里进行数值改动
context.SHORTPERIOD = 20
... |
jtara1/MiscScripts | refs/heads/master | misc_scripts/delete_imgur_dne/__init__.py | 20578 | |
weimingtom/python-for-android | refs/heads/master | python-build/python-libs/gdata/tests/atom_test.py | 87 | #!/usr/bin/python
# -*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2006 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
colaftc/webtool | refs/heads/master | app/todo/views.py | 1 | # coding:utf-8
from flask import current_app,render_template,redirect,flash,url_for
from flask.ext.login import login_required,current_user
from . import todo
from .models import Memo
from .forms import MemoForm
from .. import db
@todo.route('/')
def index():
return render_template('todo/index.html',lists=Memo.query.... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.1/Lib/quopri.py | 4 | #! /usr/bin/env python
"""Conversions to/from quoted-printable transport encoding as per RFC-1521."""
# (Dec 1991 version).
__all__ = ["encode","decode"]
ESCAPE = '='
MAXLINESIZE = 76
HEX = '0123456789ABCDEF'
def needsquoting(c, quotetabs):
"""Decide whether a particular character needs to be quoted.
The ... |
kuiche/chromium | refs/heads/trunk | tools/grit/grit/gather/rc_unittest.py | 3 | #!/usr/bin/python2.4
# Copyright (c) 2006-2008 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 grit.gather.rc'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.di... |
dasevilla/mashery-python | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# mashery-python documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 27 16:16:14 2014.
#
# 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... |
RuudBurger/CouchPotatoServer | refs/heads/master | libs/html5lib/__init__.py | 316 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
watonyweng/neutron | refs/heads/master | neutron/plugins/cisco/common/cisco_constants.py | 50 | # Copyright 2011 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
krux/adspygoogle | refs/heads/master | examples/adspygoogle/dfp/v201203/create_ad_units.py | 2 | #!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
benjaminjkraft/django | refs/heads/master | tests/i18n/project_dir/app_no_locale/models.py | 449 | from django.utils.translation import ugettext as _
string = _("This app has no locale directory")
|
jakirkham/bokeh | refs/heads/master | bokeh/models/tests/test_transforms.py | 5 | from textwrap import dedent
import pytest
from bokeh.models import CustomJSTransform, Slider
pscript = pytest.importorskip("pscript")
def test_customjstransform_from_py_func_no_args():
def cosine():
from pscript import window
return window.Math.cos(x) # noqa
def v_cosine():
from ps... |
metacloud/python-troveclient | refs/heads/mc/2013.1.7 | troveclient/openstack/common/apiclient/client.py | 2 | # Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2013 Alessio Ababilov
# Copyright 2013 Grid Dynamics
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you ... |
ecohealthalliance/EpiTator | refs/heads/master | epitator/incident_annotator.py | 1 | #!/usr/bin/env python
"""
Create incidents that group together multiple layers of annotations.
This is based on the createIncidentReportsFromEnhancements function from
EIDR-Connect, although some differences exist in the output structure,
and code related to manual curation (e.g. the accepted attribute)
is not included... |
silviacanessa/oq-hazardlib | refs/heads/master | openquake/hazardlib/gsim/akkar_bommer_2010.py | 4 | # -*- coding: utf-8 -*-
# The Hazard Library
# Copyright (C) 2012-2014, GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your opt... |
tosolveit/scikit-learn | refs/heads/master | sklearn/metrics/cluster/tests/test_supervised.py | 206 | import numpy as np
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import homogeneity_score
from sklearn.metrics.cluster import completeness_score
from sklearn.metrics.cluster import v_measure_score
from sklearn.metrics.cluster import homogeneity_completeness_v_measure
from sklearn... |
thaumos/ansible | refs/heads/devel | test/units/plugins/connection/test_netconf.py | 44 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... |
raymondxyang/tensorflow | refs/heads/master | tensorflow/python/ops/sets_impl.py | 20 | # 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... |
mycodeday/crm-platform | refs/heads/master | website_forum/models/gamification.py | 374 | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class gamification_challenge(osv.Model):
_inherit = 'gamification.challenge'
def _get_categories(self, cr, uid, context=None):
res = super(gamification_challenge, self)._get_categories(cr, uid, context=context)
res.append(('forum', ... |
Tejal011089/osmosis_erpnext | refs/heads/develop | erpnext/stock/report/stock_ageing/stock_ageing.py | 98 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import date_diff, flt
def execute(filters=None):
columns = get_columns()
item_details = get_fif... |
danielholmstrom/dictalchemy | refs/heads/master | dictalchemy/classes.py | 1 | # vim: set fileencoding=utf-8 :
"""
~~~~~~~
Classes
~~~~~~~
Contains :class:`DictableModel` that can be used as a base class for
:meth:`sqlalchemy.ext.declarative_base`.
"""
from __future__ import absolute_import, division
from dictalchemy import utils
class DictableModel(object):
"""Can be used as a base cla... |
cetic/ansible | refs/heads/devel | lib/ansible/plugins/test/mathstuff.py | 62 | # (c) 2016, Ansible, Inc
#
# 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 di... |
sdvillal/manysources | refs/heads/master | manysources/common/sdf.py | 1 | # coding=utf-8
"""Utilities to work with compounds collections in SDF format."""
import gzip
import zipfile
import os.path as op
import os
import glob
from manysources import warning
from manysources.common.misc import ensure_dir
def iterate_records_in_text_file(filename,
record_term... |
bnkr/suds | refs/heads/master | suds/reader.py | 203 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... |
billyhunt/osf.io | refs/heads/develop | scripts/clear_invalid_unclaimed_records.py | 61 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to remove unclaimed records for confirmed users. Once a user has
confirmed their email address, all their unclaimed records should be cleared
so that their full name shows up correctly on all projects.
To run: ::
$ python -m scripts.clear_invalid_unclaimed_r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.