repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
gibiansky/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/bcast_ops_test.py | 2 | # 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... |
dantebarba/docker-media-server | refs/heads/master | plex/Sub-Zero.bundle/Contents/Libraries/Shared/ftfy/badness.py | 2 | # -*- coding: utf-8 -*-
"""
Heuristics to determine whether re-encoding text is actually making it
more reasonable.
"""
from __future__ import unicode_literals
import re
import unicodedata
from ftfy.chardata import chars_to_classes
# The following regex uses the mapping of character classes to ASCII
# characters defi... |
mviitanen/marsmod | refs/heads/master | mcp/temp-python/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escprober.py | 2935 | ######################## 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... |
prasadtalasila/INET-Vagrant-Demos | refs/heads/master | Nonce_Demo/impacket-0.9.12/impacket/testcases/dot11/test_FrameManagementProbeResponse.py | 6 | #!/usr/bin/env python
# sorry, this is very ugly, but I'm in python 2.5
import sys
sys.path.insert(0,"../..")
from dot11 import Dot11, Dot11Types, Dot11ManagementFrame,Dot11ManagementProbeResponse
from ImpactDecoder import RadioTapDecoder
from binascii import hexlify
import unittest
class TestDot11ManagementProbeRes... |
micumatei/asciipic | refs/heads/master | asciipic/cli/__init__.py | 12133432 | |
amaozhao/basecms | refs/heads/master | easy_thumbnails/south_migrations/__init__.py | 12133432 | |
jeremyphilemon/uniqna | refs/heads/master | home/__init__.py | 12133432 | |
jreinhardt/manufac | refs/heads/master | src/manufac/importers/__init__.py | 12133432 | |
brettc/bricolage | refs/heads/master | tests/__init__.py | 12133432 | |
mcoconnor/django-emailmessagetemplates | refs/heads/master | emailmessagetemplates/conf.py | 1 | from django.conf import settings
from appconf import AppConf
class MyAppConf(AppConf):
DEFAULT_FROM_EMAIL = None
"""
The address messages appear to come from. Can be overridden for a
particular template or when a message is prepared.
"""
ALLOW_HTML_MESSAGES = False
"""
If tr... |
willingc/oh-mainline | refs/heads/master | vendor/packages/Django/django/http/request.py | 98 | from __future__ import absolute_import, unicode_literals
import copy
import os
import re
import sys
import warnings
from io import BytesIO
from pprint import pformat
try:
from urllib.parse import parse_qsl, urlencode, quote, urljoin
except ImportError:
from urllib import urlencode, quote
from urlparse impo... |
mahim97/zulip | refs/heads/master | manage.py | 14 | #!/usr/bin/env python3
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
import scripts.lib.setup_path_on_import
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zproject.settings")
from django.conf import settings
from django.c... |
papados/ordersys | refs/heads/master | Lib/site-packages/django/core/serializers/python.py | 106 | """
A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.core.serializers import base
from django.db... |
DaniilLeksin/theblog | refs/heads/master | env/lib/python2.7/site-packages/django/template/loaders/app_directories.py | 89 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.apps import apps
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
f... |
applicationdevm/XlsxWriter | refs/heads/master | xlsxwriter/test/comparison/test_hyperlink17.py | 8 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
mediawiki-utilities/python-mwoauth | refs/heads/master | mwoauth/functions.py | 1 | """
A set of stateless functions that can be used to complete various steps of an
OAuth handshake or to identify a MediaWiki user.
:Example:
.. code-block:: python
from mwoauth import ConsumerToken, initiate, complete, identify
from six.moves import input # For compatibility between python 2 and 3... |
WadeYuChen/django-oscar | refs/heads/master | src/oscar/apps/shipping/abstract_models.py | 22 | # -*- coding: utf-8 -*-
from decimal import Decimal as D
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.core.validators import MinValueValidator
from oscar.core import prices, loading
from oscar.models.fiel... |
pexnet/poxlibpacket | refs/heads/master | poxlibpacket/lib/__init__.py | 48 | # Copyright 2011 James McCauley
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
heeraj123/oh-mainline | refs/heads/master | vendor/packages/sphinx/sphinx/websupport/storage/__init__.py | 16 | # -*- coding: utf-8 -*-
"""
sphinx.websupport.storage
~~~~~~~~~~~~~~~~~~~~~~~~~
Storage for the websupport package.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class StorageBackend(object):
def pre_build(self):
"""Called... |
Ricardo666666/june | refs/heads/master | tests/__init__.py | 12133432 | |
IRI-Research/django | refs/heads/master | tests/i18n/__init__.py | 12133432 | |
zenweasel/fabric-bolt | refs/heads/master | projects/migrations/0003_auto__add_configuration.py | 18 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Configuration'
db.create_table(u'projects_configuration', (
(u'id', self.gf('dja... |
Jitsusama/hostel-huptainer | refs/heads/master | tests/system/test_process_invocations.py | 1 | """Test basic functionality of the program, end-to-end."""
import os
import subprocess
import pytest
import requests
from hostel_huptainer import __version__
# ATTENTION: See conftest.py for py.test fixtures.
def test_returns_error_when_certbot_hostname_is_not_passed():
try:
subprocess.check_output(
... |
npardington/fabric-bolt | refs/heads/master | fabric_bolt/accounts/forms.py | 10 | import string
import random
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.contrib.auth.forms import PasswordResetForm
from django.utils.translation import ugettext_lazy as _
class UserChangeForm(forms.ModelForm):
"""
A form fo... |
SNoiraud/gramps | refs/heads/master | gramps/gui/widgets/styledtexteditor.py | 4 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Zsolt Foldvari
#
# 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 of the License, or
# (at your option) ... |
Jgarcia-IAS/SITE | refs/heads/master | addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py | 384 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... |
seem-sky/kbengine | refs/heads/master | kbe/src/lib/python/Lib/plat-netbsd1/IN.py | 181 | # Generated by h2py from /usr/include/netinet/in.h
IPPROTO_IP = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_GGP = 3
IPPROTO_IPIP = 4
IPPROTO_TCP = 6
IPPROTO_EGP = 8
IPPROTO_PUP = 12
IPPROTO_UDP = 17
IPPROTO_IDP = 22
IPPROTO_TP = 29
IPPROTO_EON = 80
IPPROTO_ENCAP = 98
IPPROTO_RAW = 255
IPPROTO_MAX = 256
IPPORT_RESERVED ... |
dreibh/planetlab-lxc-plcapi | refs/heads/master | PLC/Methods/GetInitScripts.py | 1 | from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
from PLC.InitScripts import InitScript, InitScripts
from PLC.Auth import Auth
class GetInitScripts(Method):
"""
Returns an array of structs containing details about initscripts.
I... |
anbangleo/NlsdeWeb | refs/heads/master | Python-3.6.0/Lib/test/test_importlib/frozen/__init__.py | 538 | import os
from test.support import load_package_tests
def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)
|
valhallasw/phabricator-tools | refs/heads/master | py/abd/abdt_naming.py | 1 | """Naming conventions for abd."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdt_naming
#
# Public Classes:
# Error
# TrackerBranch
# .branch
# .status
# .description
# .bas... |
kthordarson/CouchPotatoServer | refs/heads/master | libs/oauth2/clients/__init__.py | 12133432 | |
Alir3z4/cmsplugin-simple-markdown | refs/heads/master | cmsplugin_simple_markdown/migrations/__init__.py | 12133432 | |
richardcs/ansible | refs/heads/devel | test/units/modules/network/exos/test_exos_facts.py | 30 | #
# (c) 2018 Extreme Networks 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.
#
# Ans... |
cjlee112/socraticqs2 | refs/heads/master | mysite/ctms/migrations/0014_auto_20191119_0029.py | 1 | # Generated by Django 2.1.12 on 2019-11-19 08:29
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ctms', '0013_auto_20191014_0411'),
]
operations = [
migrations.AddField(
model_name... |
vipins/ccccms | refs/heads/master | env/Lib/site-packages/django/contrib/gis/db/models/sql/conversion.py | 506 | """
This module holds simple classes used by GeoQuery.convert_values
to convert geospatial values from the database.
"""
class BaseField(object):
empty_strings_allowed = True
def get_internal_type(self):
"Overloaded method so OracleQuery.convert_values doesn't balk."
return None
class AreaFiel... |
yaroslav-tarasov/avango | refs/heads/master | examples/examples_common/__init__.py | 105 | from . import *
|
sakib/flask_boilerplate | refs/heads/master | xd/views.py | 1 | #!venv/bin/python
from flask import redirect, url_for, render_template, flash, request, send_from_directory, Response
from flask.ext.login import login_user, logout_user, current_user, login_required
from flask.ext.sqlalchemy import SQLAlchemy
from flask_mail import Message
from xd import app, lm, db, mail
from werkzeu... |
till-varoquaux/okws | refs/heads/master | test/regtest/cases/21.py | 5 | desc = "test multiplication (20.py in OKWS 2.1)"
filedata = """
{$ if (-8 * 9 == 1 - 73) { print "ok" }
locals { x : 31 } $}
${4*3}
${-4*5}
${"foo"*3}
${x * 20}
${5+3*4}
${1*2*3*4*5*6}
{$ if (5*(4+43) == 5*4 + 5*43) { print "ok" } $}
"""
outcome= """
ok
12
-20
foofoofoo
620
17
720
ok
"""
|
AgentN/namebench | refs/heads/master | nb_third_party/dns/__init__.py | 215 | # Copyright (C) 2003-2007, 2009 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS... |
ppwwyyxx/tensorflow | refs/heads/master | tensorflow/python/training/basic_session_run_hooks_test.py | 7 | # pylint: disable=g-bad-file-header
# 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/LICENS... |
murrown/cyder | refs/heads/master | cyder/cydhcp/network/tests.py | 2 | from django.core.exceptions import ValidationError
from nose.plugins.skip import SkipTest
from cyder.base.tests import ModelTestMixin, TestCase
from cyder.cydhcp.site.models import Site
from cyder.cydhcp.network.models import Network
from cyder.cydhcp.range.models import Range
from cyder.cydns.domain.models import Dom... |
binoculars/osf.io | refs/heads/develop | admin/preprint_providers/urls.py | 4 | from django.conf.urls import url
from . import views
app_name = 'admin'
urlpatterns = [
url(r'^$', views.PreprintProviderList.as_view(), name='list'),
url(r'^create/$', views.CreatePreprintProvider.as_view(), name='create'),
url(r'^import/$', views.ImportPreprintProvider.as_view(), name='import'),
url... |
SebDieBln/QGIS | refs/heads/master | python/plugins/db_manager/db_plugins/html_elems.py | 12 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... |
gnuhub/intellij-community | refs/heads/master | python/testData/refactoring/introduceVariable/substringNewStylePositional.after.py | 83 | a = "Hello"
print("{1}, {0}!".format("World", a)) |
CCI-MOC/python-novaclient | refs/heads/moc-modified | novaclient/tests/unit/v2/contrib/test_list_extensions.py | 5 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
CankingApp/cankingapp.github.io | refs/heads/hexo | node_modules/.npminstall/node-gyp/3.3.1/node-gyp/gyp/pylib/gyp/generator/analyzer.py | 1382 | # Copyright (c) 2014 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.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... |
zubron/servo | refs/heads/master | tests/wpt/harness/wptrunner/update/__init__.py | 196 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
from mozlog.structured import structuredlog, commandline
from .. import wptcommandline
from upda... |
ahmed-mahran/hue | refs/heads/master | desktop/core/ext-py/pytz-2015.2/pytz/reference.py | 839 | '''
Reference tzinfo implementations from the Python docs.
Used for testing against as they are only correct for the years
1987 to 2006. Do not use these for real code.
'''
from datetime import tzinfo, timedelta, datetime
from pytz import utc, UTC, HOUR, ZERO
# A class building tzinfo objects for fixed-offset time zo... |
b12io/orchestra | refs/heads/autostaff-load-hours-once | release.py | 2 | """Increments the Orchestra version and pushes a new release to PyPI.
This script can only be called by orchestra core committers, and will result
in permission errors otherwise.
"""
import os
import re
import shutil
from argparse import ArgumentParser
from distutils.version import StrictVersion
from subprocess import... |
shacker/django | refs/heads/master | tests/backends/test_ddl_references.py | 90 | from django.db.backends.ddl_references import (
Columns, ForeignKeyName, IndexName, Statement, Table,
)
from django.test import SimpleTestCase
class TableTests(SimpleTestCase):
def setUp(self):
self.reference = Table('table', lambda table: table.upper())
def test_references_table(self):
s... |
ticosax/drf-extensions | refs/heads/master | tests_app/tests/functional/examples/etags/__init__.py | 386048 | |
John-Hart/autorest | refs/heads/master | src/generator/AutoRest.Python.Tests/AcceptanceTests/datetime_rfc_tests.py | 6 | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... |
mustafat/odoo-1 | refs/heads/8.0 | addons/website_sale_options/tests/test_customize.py | 318 | import openerp.tests
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_01_admin_shop_tour(self):
self.phantom_js("/", "openerp.Tour.run('shop_customize', 'test')", "openerp.Tour.tours.shop_customize", login="admin")
|
postlund/home-assistant | refs/heads/dev | tests/components/august/test_binary_sensor.py | 1 | """The lock tests for the august platform."""
import datetime
from august.activity import ACTION_DOOR_CLOSED, ACTION_DOOR_OPEN
from august.lock import LockDoorStatus
from homeassistant.util import dt
from tests.components.august.mocks import (
MockActivity,
MockAugustComponentData,
MockAugustComponentDo... |
amith01994/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/syndication/feeds.py | 245 | from django.contrib.syndication import views
from django.core.exceptions import ObjectDoesNotExist
import warnings
# This is part of the deprecated API
from django.contrib.syndication.views import FeedDoesNotExist, add_domain
class Feed(views.Feed):
"""Provided for backwards compatibility."""
def __init__(sel... |
arangodb/arangodb | refs/heads/devel | 3rdParty/rocksdb/6.8/coverage/parse_gcov_output.py | 2 | #!/usr/bin/env python2
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import re
import sys
from optparse import OptionParser
# the gcov report follows certain pattern. Each file will have two lines
# of report, from which we can extract the file name, total lines and coverage
# percentage.
de... |
dekked/dynamodb-mock | refs/heads/master | tests/functional/pyramid/test_scan.py | 1 | # -*- coding: utf-8 -*-
import unittest, json
TABLE_NAME1 = 'Table-1'
TABLE_RT = 45
TABLE_WT = 123
TABLE_NAME = 'Table-HR'
TABLE_RT = 45
TABLE_WT = 123
TABLE_RT2 = 10
TABLE_WT2 = 10
TABLE_HK_NAME = u'hash_key'
TABLE_HK_TYPE = u'N'
TABLE_RK_NAME = u'range_key'
TABLE_RK_TYPE = u'S'
HK_VALUE1 = u'123'
HK_VALUE2 = u'4... |
jerem/Whoosh | refs/heads/master | src/whoosh/support/bitvector.py | 1 | """
An implementation of an object that acts like a collection of on/off bits.
"""
import operator
from array import array
#: Table of the number of '1' bits in each byte (0-255)
BYTE_COUNTS = array('B',[
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,... |
clawpack/clawpack-4.x | refs/heads/master | doc/sphinx/example-acoustics-2d-amr/setrun.py | 2 | """
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
from pyclaw import data
#------------------------------
def setrun(claw_pkg='amrclaw'):
#------------------------------
... |
baylabs/grpc | refs/heads/master | src/python/grpcio/grpc/beta/__init__.py | 901 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
jmgc/myhdl-numeric | refs/heads/numeric | cosimulation/cver/test/dff.py | 14 | import os
from myhdl import Cosimulation
cmd = "cver -q +loadvpi=../myhdl_vpi:vpi_compat_bootstrap " + \
"../../test/verilog/dff.v " + \
"../../test/verilog/dut_dff.v "
def dff(q, d, clk, reset):
return Cosimulation(cmd, **locals())
|
Gerhut/electron | refs/heads/master | script/lib/github.py | 200 | #!/usr/bin/env python
import json
import os
import re
import sys
REQUESTS_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..',
'vendor', 'requests'))
sys.path.append(os.path.join(REQUESTS_DIR, 'build', 'lib'))
sys.path.append(os.path.join(REQUESTS_DIR, 'build', 'l... |
PetrDlouhy/django | refs/heads/master | tests/proxy_models/models.py | 97 | """
By specifying the 'proxy' Meta attribute, model subclasses can specify that
they will take data directly from the table of their base class table rather
than using a new table of their own. This allows them to act as simple proxies,
providing a modified interface to the data from the base class.
"""
from django.db ... |
epssy/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/m2m_through/tests.py | 117 | from __future__ import absolute_import
from datetime import datetime
from operator import attrgetter
from django.test import TestCase
from .models import (Person, Group, Membership, CustomMembership,
PersonSelfRefM2M, Friendship)
class M2mThroughTests(TestCase):
def setUp(self):
self.bob = Person.o... |
mja054/swift_plugin | refs/heads/master | swift/account/reaper.py | 4 | # Copyright (c) 2010-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
#
# Unless required by applicable law or agreed to ... |
spektom/incubator-airflow | refs/heads/master | airflow/providers/dingding/example_dags/example_dingding.py | 5 | #
# 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... |
tempbottle/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/leakers/__init__.py | 12133432 | |
michaelgallacher/intellij-community | refs/heads/master | python/testData/refactoring/move/oldStyleRelativeImport/after/src/pkg/subpkg/c.py | 12133432 | |
jessstrap/servotk | refs/heads/master | tests/wpt/web-platform-tests/mixed-content/generic/tools/__init__.py | 12133432 | |
e-q/scipy | refs/heads/master | scipy/_build_utils/tests/__init__.py | 12133432 | |
FlintHill/SUAS-Competition | refs/heads/master | env/lib/python2.7/site-packages/pkg_resources/extern/__init__.py | 59 | import sys
class VendorImporter:
"""
A PEP 302 meta path importer for finding optionally-vendored
or otherwise naturally-installed packages from root_name.
"""
def __init__(self, root_name, vendored_names=(), vendor_pkg=None):
self.root_name = root_name
self.vendored_names = set(v... |
lavajumper/sexcoin | refs/heads/master | test/functional/bip65-cltv-p2p.py | 3 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP65 (CHECKLOCKTIMEVERIFY).
Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) b... |
Adrianacmy/Classic-Interesting-CS-Mini-Programs | refs/heads/master | Python-language/generator.py | 1 | '''
'''
# () to create a generator
c = (x*2 for x in range(10))
# next(c)
# 沒有第三個變量的前提下交換二兩變量的值
a = 10
b = 9
a = a + b
b = a - b
a = a - b
# 結果
a = 9
b = 10
# create generator with yield
# fibonachi
# 到 yield , 停, 返回b 的值, 下一次從上次停下的點開始
def fibo():
print('......fibo start......')
a, b = 0, 1
for i in ... |
mwrightevent38/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/optimize/linesearch.py | 55 | from scipy.optimize import minpack2
import numpy as np
from numpy.compat import asbytes
__all__ = ['line_search_wolfe1', 'line_search_wolfe2',
'scalar_search_wolfe1', 'scalar_search_wolfe2',
'line_search_armijo']
#------------------------------------------------------------------------------
# M... |
yfried/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_gtm_virtual_server.py | 5 | #!/usr/bin/python
# -*- 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
rukin5197/android_kernel_lge_m3s | refs/heads/master | tools/perf/scripts/python/sctop.py | 895 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
DeviceTestFramework/dctrl | refs/heads/master | dctrl/expect/serpexpect.py | 1 | #
# Copyright (C) 2015 Prevas A/S
#
# This file is part of dctrl, an embedded device control framework
#
# dctrl is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at... |
synkarius/dragonfly | refs/heads/master | dragonfly/language/other/number_maylaysian.py | 5 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3... |
DavidNorman/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/distributions/dirichlet_test.py | 30 | # 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... |
jt1134/android_kernel_samsung_expressatt | refs/heads/samsung | scripts/rt-tester/rt-tester.py | 11005 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... |
fujy/ROS-Project | refs/heads/master | src/ros_project/scripts/joy2twist.py | 1 | #!/usr/bin/env python
import roslib; roslib.load_manifest('joy2twist')
import rospy
from sensor_msgs.msg import Joy
def callback(data):
rospy.loginfo(rospy.get_name() + \
": Get from Joy [%.2f, %.2f, %.2f, %.2f, %.2f, %.2f]" %data.axes)
def listener():
#initialize a node as listener
rospy.init_node('listener... |
mou4e/zirconium | refs/heads/master | third_party/tlslite/tlslite/utils/openssl_rsakey.py | 200 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""OpenSSL/M2Crypto RSA implementation."""
from .cryptomath import *
from .rsakey import *
from .python_rsakey import Python_RSAKey
#copied from M2Crypto.util.py, so when we load the local copy of m2
#we can still use i... |
nazo/ansible | refs/heads/devel | lib/ansible/modules/notification/slack.py | 70 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Steve Pletcher <steve@steve-pletcher.com>
# (c) 2016, René Moser <mail@renemoser.net>
# (c) 2015, Stefan Berggren <nsg@nsg.cc>
# (c) 2014, Ramon de la Fuente <ramon@delafuente.nl>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute i... |
nijel/translate | refs/heads/master | translate/lang/pt_BR.py | 2 | #
# Copyright 2016 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 the License, or
# (at your option) any later ve... |
jsloyer/php-buildpack | refs/heads/master | extensions/newrelic/__init__.py | 12133432 | |
AKSW/QuitStore | refs/heads/master | quit/tools/evaluate.py | 1 | """
These method recursively evaluate the SPARQL Algebra
evalQuery is the entry-point, it will setup context and
return the SPARQLResult object
evalPart is called on each level and will delegate to the right method
A rdflib.plugins.sparql.sparql.QueryContext is passed along, keeping
information needed for evaluation... |
cloudify-cosmo/cloudify-host-pool-service | refs/heads/master | scripts/stop.py | 1 | # #######
# Copyright (c) 2016 GigaSpaces Technologies Ltd. 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
#
# Unles... |
halex2005/pjproject | refs/heads/master | tests/pjsua/scripts-sendto/121_sdp_with_video_static_1.py | 59 | # $Id: 121_sdp_with_video_static_1.py 2081 2008-06-27 21:59:15Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
# Video uses static payload type which will cause failure
# when session.c looks-up the codec in codec manager
sdp = \
"""
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 5000 RTP/AVP... |
rajsadho/django | refs/heads/master | django/templatetags/i18n.py | 219 | from __future__ import unicode_literals
import sys
from django.conf import settings
from django.template import Library, Node, TemplateSyntaxError, Variable
from django.template.base import TOKEN_TEXT, TOKEN_VAR, render_value_in_context
from django.template.defaulttags import token_kwargs
from django.utils import six... |
Schevo/kiwi | refs/heads/master | kiwi/ui/widgets/textview.py | 2 | #
# Kiwi: a Framework and Enhanced Widgets for Python
#
# Copyright (C) 2003-2005 Async Open Source
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... |
Canpio/Paddle | refs/heads/develop | python/paddle/v2/dataset/cifar.py | 8 | # Copyright (c) 2016 PaddlePaddle 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 applic... |
RIOT-OS/RIOT | refs/heads/master | dist/tools/randhex/randhex.py | 17 | #!/usr/bin/env python3
#
# Copyright (C) 2020 Sören Tempel <tempel@uni-bremen.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
import sys
import secrets
if len(sys.argv) >= 2:
maxbits = ... |
karyon/django | refs/heads/master | tests/datetimes/models.py | 245 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
title = models.CharField(max_length=100)
pub_date = models.DateTimeField()
categories = models.ManyToManyField("Cat... |
jianran/spark | refs/heads/master | python/pyspark/sql/readwriter.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 us... |
paasmaker/paasmaker | refs/heads/master | paasmaker/pacemaker/prepare/pythonpip.py | 2 | #
# Paasmaker - Platform as a Service
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import tempfile
import os
import colander
import time
import shutil
import cop... |
Prestructure/DCBlockchainHackathon | refs/heads/master | messaging/webapp.py | 1 |
from flask import Flask
from flask import request
import argparse
import binascii
import json
import logging
import subprocess
import time
import thread
#
# python webapp.py --z <YOUR_Z_ADDRESS>
#
# to get messages, do GET localhost:5000/messages?seq=0
# you will get back json with two fields: messages and seq
##
#... |
frnhr/django-cms | refs/heads/develop | cms/test_utils/fixtures/menus.py | 46 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.api import create_page
class MenusFixture(object):
def create_fixtures(self):
"""
Tree from fixture:
+ P1
| + P2
| + P3
+ P4
| + P5
+ P6 (not in menu)
... |
algoStruct/flask | refs/heads/master | examples/flaskr/flaskr.py | 157 | # -*- coding: utf-8 -*-
"""
Flaskr
~~~~~~
A microblog example application written as Flask tutorial with
Flask and sqlite3.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
from sqlite3 import dbapi2 as sqlite3
from flask import Flask, request... |
stefankoegl/django-couchdb-utils | refs/heads/master | django_couchdb_utils/registration/backends/simple/urls.py | 1 | """
URLconf for registration and activation, using django-registration's
one-step backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.simple.urls')),
Thi... |
naparuba/kunai | refs/heads/master | opsbro/misc/internalrsa/pyasn1/type/namedval.py | 200 | # ASN.1 named integers
from pyasn1 import error
__all__ = [ 'NamedValues' ]
class NamedValues:
def __init__(self, *namedValues):
self.nameToValIdx = {}; self.valToNameIdx = {}
self.namedValues = ()
automaticVal = 1
for namedValue in namedValues:
if isinstance(na... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.