repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
val2k/linux | refs/heads/master | tools/perf/scripts/python/check-perf-trace.py | 1997 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
wlyeow/pysolclient | refs/heads/master | test/test_simple.py | 1 | from pysolclient import *
from pysolclient import _defaultEventCallback
from ctypes import *
import time
import pprint
def test_destination_eq():
c = Destination()
d = Destination()
c.setDest('c')
d.setDest('d')
assert c != d
d.setDest('c')
assert c == d
c.destType = Destination.QUEU... |
migueldvb/django-guardian | refs/heads/master | guardian/templatetags/guardian_tags.py | 31 | """
``django-guardian`` template tags. To use in a template just put the following
*load* tag inside a template::
{% load guardian_tags %}
"""
from __future__ import unicode_literals
from django import template
from django.contrib.auth.models import Group, AnonymousUser
from django.template import get_library
fro... |
envi-idl/envipyarc | refs/heads/master | envipyarc/templates/envivector.py | 1 | """
Maps the ENVI Task data type to a GPTool datatype
"""
from __future__ import absolute_import
from string import Template
from envipyarclib.gptool.parameter.template import Template as ParamTemplate
class ENVIVECTOR(ParamTemplate):
"""
Class template for the datatype
"""
def get_parameter(self, ta... |
lewisamarshall/emigrate | refs/heads/master | setup.py | 1 | #!/usr/bin/python
import sys
if sys.version_info < (3,):
from emigrate.__version__ import __version__
else:
__version__ = open('emigrate/__version__.py').read().strip().split("'")[-2]
from setuptools import setup, find_packages
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')... |
tribut/vdirsyncer | refs/heads/master | tests/storage/dav/__init__.py | 1 | # -*- coding: utf-8 -*-
import os
import requests
import requests.exceptions
from tests import assert_item_equals
import vdirsyncer.exceptions as exceptions
from vdirsyncer.storage.base import Item
from .. import StorageTests
dav_server = os.environ.get('DAV_SERVER', '').strip() or 'radicale'
def _get_server_m... |
swt30/beets | refs/heads/master | beetsplug/edit.py | 7 | # This file is part of beets.
# Copyright 2016
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, pu... |
jackrzhang/zulip | refs/heads/master | zerver/lib/events.py | 1 | # See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for
# high-level documentation on how this system works.
import copy
import ujson
from collections import defaultdict
from django.utils.translation import ugettext as _
from django.conf import settings
from importlib import import_module
from ... |
demonchild2112/travis-test | refs/heads/master | grr/server/grr_response_server/prometheus_stats_collector_test.py | 2 | #!/usr/bin/env python
"""Tests for PrometheusStatsCollector."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from absl import app
from grr_response_core.stats import stats_test_utils
from grr_response_server import prometheus_stats_collector
from grr.... |
opennode/nodeconductor-assembly-waldur | refs/heads/develop | src/waldur_openstack/openstack/tests/test_floating_ips.py | 1 | from rest_framework import status, test
from .. import models
from . import factories, fixtures
class FloatingIPListRetrieveTestCase(test.APITransactionTestCase):
def setUp(self):
self.fixture = fixtures.OpenStackFixture()
self.active_ip = factories.FloatingIPFactory(
runtime_state='A... |
codefisher/web_games | refs/heads/master | jeopardy/templatetags/jeopardy.py | 1 | from django import template
register = template.Library()
@register.inclusion_tag('jeopardy/cell.html', takes_context=True)
def jeopardy_game_cell(context):
game = context['game']
topic = context['topic']
point = context['point']
questions_done = context['questions_done']
return {
"done": ... |
MichaelNedzelsky/intellij-community | refs/heads/master | python/testData/inspections/unusedImport/subpackageInInitPy/package1/__init__.py | 83 | from .module_b import ClassB
__all__ = module_b.__all__[:] |
endlessm/chromium-browser | refs/heads/master | components/flags_ui/PRESUBMIT.py | 21 | # Copyright 2017 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.
def _CommonChecks(input_api, output_api):
results = []
try:
import sys
old_sys_path = sys.path[:]
cwd = input_api.PresubmitLocalPath()
s... |
JIoJIaJIu/servo | refs/heads/master | tests/wpt/web-platform-tests/XMLHttpRequest/resources/chunked.py | 219 | def main(request, response):
chunks = ["First chunk\r\n",
"Second chunk\r\n",
"Yet another (third) chunk\r\n",
"Yet another (fourth) chunk\r\n",
]
response.headers.set("Transfer-Encoding", "chunked");
response.headers.set("Trailer", "X-Test-Me");
r... |
mingderwang/angr | refs/heads/master | tests/test_explorer.py | 10 | import nose
import angr
import os
location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
def test_xpl():
p = angr.Project(os.path.join(location, "x86_64/all"))
pltaddr = p.loader.main_bin.get_call_stub_addr("printf")
nose.tools.assert_equal(pltaddr, 0x400560)
... |
allotria/intellij-community | refs/heads/master | python/testData/dotNet/expected.skeleton.Deep.py | 79 | # encoding: utf-8
# module SingleNameSpace.Some.Deep calls itself Deep
# from SingleNameSpace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
# by generatorXXX
# no doc
# no imports
# no functions
# classes
class WeHaveClass(object):
""" WeHaveClass() """
MyClass = None
|
t-wissmann/qutebrowser | refs/heads/master | tests/unit/mainwindow/statusbar/test_percentage.py | 2 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
jcasner/nupic | refs/heads/master | tests/unit/nupic/encoders/adaptivescalar_test.py | 28 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/django/contrib/contenttypes/fields.py | 36 | from __future__ import unicode_literals
from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, models, router, transaction
from django... |
cnsoft/kbengine-cocos2dx | refs/heads/cocos2dx-cnsoft | kbe/res/scripts/common/Lib/turtledemo/lindenmayer.py | 164 | #!/usr/bin/env python3
""" turtle-example-suite:
xtx_lindenmayer_indian.py
Each morning women in Tamil Nadu, in southern
India, place designs, created by using rice
flour and known as kolam on the thresholds of
their homes.
These can be described by Lindenmayer systems,
which can easily be implemented ... |
guewen/OpenUpgrade | refs/heads/master | addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py | 381 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
blaggacao/odoo | refs/heads/master | addons/account_bank_statement_import/account_bank_statement_import.py | 23 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
from openerp.tools.translate import _
import logging
_logger = logging.getLogger(__name__)
_IMPORT_FILE_TYPE = [('none', _('No Import Format Available'))]
def add_file_type(selection_value):
global _IMPORT_FILE_TYPE
if _IMPORT_FILE_TYPE[0][0] == 'n... |
amenonsen/ansible | refs/heads/devel | lib/ansible/modules/network/cnos/cnos_banner.py | 52 | #!/usr/bin/python
#
# Copyright (C) 2017 Lenovo, Inc.
# (c) 2017, Ansible by 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 Lice... |
geekboxzone/lollipop_external_chromium_org | refs/heads/geekbox | tools/perf/metrics/v8_object_stats.py | 42 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
from metrics import Metric
from telemetry.value import scalar
_COUNTER_NAMES = [
'V8.OsMemoryAllocated',
'V8.MemoryNewS... |
hyperNURb/ggrc-core | refs/heads/develop | src/ggrc_workflows/migrations/versions/20140612211116_580d2ac5bc2d_add_sort_index_to_.py | 5 | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""Add sort_index to CycleTaskGroupObjectTask
Revision ID: 580d2ac5bc2d
Revise... |
zedr/django | refs/heads/master | django/core/management/commands/inspectdb.py | 6 | from __future__ import unicode_literals
from collections import OrderedDict
import keyword
import re
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
class Command(NoArgsCommand):
help = "Introspects the data... |
pylbert/upm | refs/heads/master | examples/python/ppd42ns.py | 6 | #!/usr/bin/env python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 ... |
quentinbodinier/custom_gnuradio_blocks | refs/heads/master | python/test_interp.py | 1 |
import numpy as np
from gnuradio import gr
class test_interp(gr.interp_block):
"""
docstring for block test_interp
"""
def __init__(self):
gr.interp_block.__init__(self,
name="test_interp",
in_sig=[np.int8],
out_sig=[np.complex64], interp=2090)
def wor... |
azoft-dev-team/imagrium | refs/heads/win | env/Lib/test/test_codecencodings_jp.py | 150 | #!/usr/bin/env python
#
# test_codecencodings_jp.py
# Codec encoding tests for Japanese encodings.
#
from test import test_support
from test import test_multibytecodec_support
import unittest
class Test_CP932(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'cp932'
tstring = test_multiby... |
X-dark/Flexget | refs/heads/master | flexget/plugins/output/pushbullet.py | 5 | from __future__ import unicode_literals, division, absolute_import
import logging
import base64
from flexget import plugin
from flexget.event import event
from flexget.utils import json
from flexget.utils.template import RenderError
log = logging.getLogger("pushbullet")
__version__ = 0.1
client_headers = {"User-Agen... |
jumpojoy/neutron | refs/heads/generic_switch | neutron/plugins/ml2/drivers/l2pop/rpc_manager/l2population_rpc.py | 41 | # Copyright (c) 2013 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... |
haggi/OpenMaya | refs/heads/master | src/mayaToBase/mt@_devmodule/scripts/path.py | 5 | #
# Copyright (c) 2010 Mikhail Gusarov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... |
kaiserroll14/301finalproject | refs/heads/master | main/pandas/io/wb.py | 9 | # -*- coding: utf-8 -*-
from __future__ import print_function
from pandas.compat import map, reduce, range, lrange
from pandas.io.common import urlopen
from pandas.io import json
import pandas
import numpy as np
import warnings
warnings.warn("\n"
"The pandas.io.wb module is moved to a separate package ... |
glebysg/GC_server | refs/heads/master | gestureclean/score_statistics.py | 1 | import sys
from vacs.models import Command, Experiment, Vac, Evaluation,\
Assignment, Participant, Score, ValAssignment, Validation
from django.contrib.auth import get_user_model
import csv
import numpy as np
# Get all the Scores for the experiment
experiment_id = 77
scores = Score.objects.filter(experiment__... |
mhrivnak/pulp | refs/heads/master | client_lib/test/data/extensions_loader_tests/valid_set/ext2/pulp_cli.py | 3 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or impli... |
fernandog/Medusa | refs/heads/optimized | lib/rtorrent/err.py | 182 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... |
FHannes/intellij-community | refs/heads/master | python/testData/inspections/PyMethodMayBeStaticInspection/staticMethod.py | 83 | __author__ = 'ktisha'
class Foo(object):
@staticmethod
def foo(param): # <-method here should not be highlighted
return "foo" |
nijel/weblate | refs/heads/main | weblate/trans/migrations/0103_update_source_unit.py | 2 | # Generated by Django 3.0.7 on 2020-09-15 10:30
from django.db import migrations
from django.db.models import F
def update_source_unit(apps, schema_editor):
Unit = apps.get_model("trans", "Unit")
Project = apps.get_model("trans", "Project")
db_alias = schema_editor.connection.alias
source_units = Un... |
zyq001/ryu | refs/heads/master | ryu/tests/switch/run_mininet.py | 19 | #!/usr/bin/env python
import sys
from mininet.cli import CLI
from mininet.link import Link
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.node import OVSSwitch
from mininet.node import UserSwitch
from mininet.term import makeTerm
from oslo_config import cfg
from ryu import ver... |
googleapis/googleapis-gen | refs/heads/master | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/enums/types/billing_setup_status.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google 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... |
cetic/ansible | refs/heads/devel | test/units/modules/remote_management/hpe/test_oneview_fc_network.py | 16 | # -*- coding: utf-8 -*-
#
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# 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 3 of the License, or
# (at your optio... |
temnoregg/django-helpdesk | refs/heads/master | helpdesk/admin.py | 3 | from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from helpdesk.models import Queue, Ticket, FollowUp, PreSetReply, KBCategory
from helpdesk.models import EscalationExclusion, EmailTemplate, KBItem
from helpdesk.models import TicketChange, At... |
katiecheng/Bombolone | refs/heads/master | env/lib/python2.7/site-packages/Crypto/Cipher/XOR.py | 126 | # -*- coding: utf-8 -*-
#
# Cipher/XOR.py : XOR
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# n... |
kinow-io/kinow-python-sdk | refs/heads/master | kinow_client/apis/o_auth_api.py | 1 | # coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 1.4.41
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python 2 and python 3 compatibility library
from six i... |
danakj/chromium | refs/heads/master | chrome/tools/build/win/resedit.py | 13 | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A utility script that can extract and edit resources in a Windows binary.
For detailed help, see the script's usage by invoking it ... |
VielSoft/odoo | refs/heads/8.0 | addons/website_mail/models/mail_message.py | 264 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
jbassen/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/tests/test_err_handling.py | 77 | # -*- coding: utf-8 -*-
"""
Unit tests for handling email sending errors
"""
from itertools import cycle
from celery.states import SUCCESS, RETRY
from django.conf import settings
from django.core.management import call_command
from django.core.urlresolvers import reverse
from django.db import DatabaseError
import json... |
3dfxmadscientist/cbss-server | refs/heads/master | addons/project_long_term/__init__.py | 67 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
kaplun/ops | refs/heads/prod | modules/bibencode/lib/bibencode_config.py | 7 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio 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) a... |
matmutant/sl4a | refs/heads/master | python-build/python-libs/ase/scripts/take_picture.py | 87 | import android
droid = android.Android()
droid.cameraCapturePicture('/sdcard/foo.jpg')
|
usc-isi-i2/mydig-webservice | refs/heads/master | ws/app_annotation.py | 1 | from app_base import *
@api.route('/projects/<project_name>/entities/<kg_id>/fields/<field_name>/annotations')
class FieldAnnotations(Resource):
@requires_auth
def get(self, project_name, kg_id, field_name):
if project_name not in data:
return rest.not_found('Project: {} not found'.format(... |
westinedu/similarinterest | refs/heads/master | django/contrib/flatpages/templatetags/flatpages.py | 98 | from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self.context_name = context_name
if starts_with:
... |
benjaoming/kolibri | refs/heads/master | kolibri/plugins/coach/hooks.py | 5 | from __future__ import absolute_import, print_function, unicode_literals
from kolibri.core.webpack import hooks as webpack_hooks
class CoachSyncHook(webpack_hooks.WebpackInclusionHook):
"""
Inherit a hook defining assets to be loaded synchronously in coach/coach.html
"""
class Meta:
abstract ... |
caphrim007/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_monitor_tcp_echo.py | 6 | #!/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',
... |
savoirfairelinux/django | refs/heads/master | django/contrib/gis/geos/collections.py | 7 | """
This module houses the Geometry Collection objects:
GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
"""
from ctypes import byref, c_int, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry im... |
stevenewey/yotta | refs/heads/master | yotta/lib/version.py | 5 | # Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import re
# Semantic Versioning, BSD, Represent and compare version strings, pip install -e git://github.com/autopulated/python-semanticversion.git#egg=semantic_version
impor... |
mikewiebe-ansible/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_vserver_cifs_security.py | 21 | # (c) 2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
from units.compat import unittest
... |
rwakulszowa/servo | refs/heads/master | tests/wpt/css-tests/tools/manifest/tests/test_manifest.py | 59 | import platform
import os
import mock
import hypothesis as h
import hypothesis.strategies as hs
import pytest
from .. import manifest, item, sourcefile, utils
def SourceFileWithTest(path, hash, cls, *args):
s = mock.Mock(rel_path=path, hash=hash)
test = cls(s, utils.rel_path_to_url(path), *args)
s.man... |
simone/django-gb | refs/heads/master | tests/test_runner/test_discover_runner.py | 10 | from contextlib import contextmanager
import os
from unittest import TestSuite, TextTestRunner, defaultTestLoader
from django.test import TestCase
from django.test.runner import DiscoverRunner
@contextmanager
def change_cwd(directory):
current_dir = os.path.abspath(os.path.dirname(__file__))
new_dir = os.pat... |
philpot/tocayo | refs/heads/master | tocayoproj/tocayoapp/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
osvalr/odoo | refs/heads/8.0 | addons/sale_stock/res_config.py | 331 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
chromium/chromium | refs/heads/master | third_party/google-closure-library/closure/bin/build/depswriter_test.py | 11 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Library 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
... |
stianjensen/django-rest-framework | refs/heads/master | tests/test_urlpatterns.py | 76 | from __future__ import unicode_literals
from collections import namedtuple
from django.conf.urls import include, url
from django.core import urlresolvers
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from rest_framework.urlpatterns import format_suffix_patterns
# A container cla... |
great-expectations/great_expectations | refs/heads/develop | great_expectations/expectations/metrics/column_aggregate_metrics/column_values_between_count.py | 1 | from typing import Any, Dict, Tuple
import numpy as np
from great_expectations.core.util import get_sql_dialect_floating_point_infinity_value
from great_expectations.execution_engine import (
PandasExecutionEngine,
SparkDFExecutionEngine,
)
from great_expectations.execution_engine.execution_engine import Metr... |
dohoangkhiem/uwsgi | refs/heads/master | examples/uwsgirouter5.py | 21 |
import uwsgi
fd = uwsgi.connect("127.0.0.1:3033")
def application(e, s):
for part in uwsgi.send_message(fd, 0, 4, e, 30, e['wsgi.input'].fileno(), uwsgi.cl()):
yield part
|
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/operations/__init__.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
initcron/ansible | refs/heads/devel | plugins/inventory/nova.py | 40 | #!/usr/bin/env python
# (c) 2012, Marco Vito Moscaritolo <marco@agavee.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
# ... |
mishbahr/djangocms-forms | refs/heads/master | djangocms_forms/migrations/0004_redirect_delay.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('djangocms_forms', '0003_add_referrer_field'),
]
operations = [
migrations.AddField(
model_name='formdefinition',... |
lamarmeigs/django-clean-fields | refs/heads/master | tests/__init__.py | 17 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
|
arguman/arguman.org | refs/heads/master | web/newsfeed/management/commands/create_initial_newsfeed.py | 7 | from django.core.management import BaseCommand
from newsfeed.models import Entry
from premises.models import Contention
class Command(BaseCommand):
def handle(self, *args, **options):
for contention in Contention.objects.all():
Entry.objects.create(
object_id=contention.id,
... |
bjlittle/python-csp | refs/heads/master | csp/lint/channels.py | 3 | #!/usr/bin/env python
"""
Check that every process in a file has correct readsets and writesets.
Copyright (C) Sarah Mount, 2010.
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... |
harlowja/urwid | refs/heads/master | docs/tutorial/qa.py | 22 | import urwid
def exit_on_q(key):
if key in ('q', 'Q'):
raise urwid.ExitMainLoop()
class QuestionBox(urwid.Filler):
def keypress(self, size, key):
if key != 'enter':
return super(QuestionBox, self).keypress(size, key)
self.original_widget = urwid.Text(
u"Nice to ... |
xiangel/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/view_tests/app3/__init__.py | 9480 | #
|
jgmanzanas/CMNT_004_15 | refs/heads/master | project-addons/product_pack/sale.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Comunitea All Rights Reserved
# $Jesús Ventosinos Mayor <jesus@comunitea.com>$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
DESHRAJ/fjord | refs/heads/master | vendor/packages/translate-toolkit/translate/storage/projstore.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 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... |
Matty-Downing2169/opencamlib | refs/heads/master | scripts/waterline/waterline_2_tux_adapt.py | 7 | import ocl
import camvtk
import time
import vtk
import datetime
import math
def drawLoops(myscreen, loops, loopcolor):
nloop = 0
for lop in loops:
n = 0
N = len(lop)
first_point=ocl.Point(-1,-1,5)
previous=ocl.Point(-1,-1,5)
for p in lop:
if n==0: # don't dra... |
bfirsh/django-old | refs/heads/master | django/conf/locale/sk/__init__.py | 12133432 | |
openplans/shareabouts-phlush | refs/heads/master | src/sa_web/templatetags/__init__.py | 12133432 | |
knossos-project/PythonQt | refs/heads/master | examples/NicePyConsole/pygments/styles/default.py | 135 | # -*- coding: utf-8 -*-
"""
pygments.styles.default
~~~~~~~~~~~~~~~~~~~~~~~
The default highlighting style.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Com... |
Event38/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/numarray/ufuncs.py | 102 |
__all__ = ['abs', 'absolute', 'add', 'arccos', 'arccosh', 'arcsin', 'arcsinh',
'arctan', 'arctan2', 'arctanh', 'bitwise_and', 'bitwise_not',
'bitwise_or', 'bitwise_xor', 'ceil', 'cos', 'cosh', 'divide',
'equal', 'exp', 'fabs', 'floor', 'floor_divide',
'fmod', 'greater', 'gre... |
jamesgk/ufo2fdk | refs/heads/master | Lib/ufo2ft/maxContextCalc.py | 2 | from __future__ import print_function, division, absolute_import, unicode_literals
__all__ = ['maxCtxFont']
def maxCtxFont(font):
"""Calculate the usMaxContext value for an entire font."""
maxCtx = 0
for tag in ('GSUB', 'GPOS'):
if tag not in font:
continue
table = font[tag].... |
omnirom/android_external_chromium-org | refs/heads/android-5.1 | tools/find_runtime_symbols/find_runtime_symbols.py | 102 | #!/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.
"""Find symbols in a binary corresponding to given runtime virtual addresses.
Note that source file names are treated as symbols in... |
ptroja/spark2014 | refs/heads/master | include/generate_session.py | 1 | import os
import shutil
def exec_gnatprove(file_to_prove, option=""):
cmd = "gnatprove -P spark_lemmas.gpr -U --prover=coq"
if ":" not in file_to_prove:
print (cmd + " " + option + file_to_prove)
os.system(cmd + " " + option + file_to_prove)
else:
print (cmd + " " + option + "--lim... |
ridfrustum/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/localflavor/ie.py | 89 | from django.contrib.localflavor.ie.forms import IECountySelect
from utils import LocalFlavorTestCase
class IELocalFlavorTests(LocalFlavorTestCase):
def test_IECountySelect(self):
f = IECountySelect()
out = u'''<select name="counties">
<option value="antrim">Antrim</option>
<option value="armagh">... |
varunagrawal/azure-services | refs/heads/master | varunagrawal/site-packages/django/utils/http.py | 26 | import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.utils import formatdate
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\... |
ruibarreira/linuxtrail | refs/heads/master | usr/lib/python2.7/imputil.py | 228 | """
Import utilities
Exported classes:
ImportManager Manage the import process
Importer Base class for replacing standard import functions
BuiltinImporter Emulate the import mechanism for builtin and frozen modules
DynLoadSuffixImporter
"""
from warnings import warnpy3k
warnpy3k("the imputil... |
100Shapes/wagtail | refs/heads/master | wagtail/wagtailcore/templatetags/pageurl.py | 1 | import warnings
from wagtail.utils.deprecation import RemovedInWagtail06Warning
warnings.warn(
"The pageurl tag library has been moved to wagtailcore_tags. "
"Use {% load wagtailcore_tags %} instead.", RemovedInWagtail06Warning)
from wagtail.wagtailcore.templatetags.wagtailcore_tags import register, pageur... |
scalable-networks/gnuradio-3.7.2.1 | refs/heads/master | gr-blocks/python/blocks/qa_conjugate.py | 57 | #!/usr/bin/env python
#
# Copyright 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 (at your optio... |
mrlegion/web-portfolio-server | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py | 1824 | # Copyright (c) 2011 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... |
emgirardin/compassion-modules | refs/heads/master | sbc_compassion/models/__init__.py | 2 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emmanuel Mathier <emmanuel.mathier@gmail.com>
#
# The licence is in the file __... |
DrAndrey/tennis_model | refs/heads/master | tennis_model_scraper/tennis_model_scraper/spiders/__init__.py | 2415 | # This package will contain the spiders of your Scrapy project
#
# Please refer to the documentation for information on how to create and manage
# your spiders.
|
PolicyStat/selenium-old | refs/heads/master | py/test/selenium/webdriver/firefox/test_ff_frame_switching.py | 4 | #!/usr/bin/python
#
# Copyright 2008-2010 WebDriver committers
# Copyright 2008-2010 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... |
abridgett/boto | refs/heads/develop | tests/unit/mws/test_response.py | 114 | #!/usr/bin/env python
from boto.mws.connection import MWSConnection
from boto.mws.response import (ResponseFactory, ResponseElement, Element,
MemberList, ElementList, SimpleList)
from tests.unit import AWSMockServiceTestCase
from boto.compat import filter, map
from tests.compat import u... |
zhreshold/mxnet | refs/heads/master | tests/python/unittest/test_subgraph_op.py | 1 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
tyarkoni/pymc3 | refs/heads/master | pymc3/glm/glm.py | 14 | import numpy as np
from ..core import *
from ..distributions import *
from ..tuning.starting import find_MAP
import patsy
import theano
import pandas as pd
from collections import defaultdict
from pandas.tools.plotting import scatter_matrix
from . import families
def linear_component(formula, data, priors=None,
... |
RonnyPfannschmidt/whl_setup | refs/heads/master | whl_setup.py | 2 | import subprocess
import sys
import types
import os
import site
if not os.path.isdir('.setup_requires'):
os.mkdir('.setup_requires')
site.addsitedir('.setup_requires')
sys.path.insert(0, sys.path.pop())
# VERSION GOES HERE
class Lazy(object):
@staticmethod
def resolve(obj):
if isinstance(obj,... |
monchitos82/shop | refs/heads/master | src/app/views.py | 2 | # -*- coding: utf-8 -*-
from app import app, cfg, error, language
from validations import validate_user, valid_session
from flask import Flask, abort, jsonify, redirect, render_template, request, session, url_for
import controls
import ast, json, re, string
def is_blocked(endpoint, session):
''' Validate if a view... |
Changaco/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/gis/gdal/tests/test_driver.py | 199 | import unittest
from django.contrib.gis.gdal import Driver, OGRException
valid_drivers = ('ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN',
'Memory', 'CSV', 'GML', 'KML')
invalid_drivers = ('Foo baz', 'clucka', 'ESRI Shp')
aliases = {'eSrI' : 'ESRI Shapefile',
'TigER/linE' : 'TIGER... |
joegomes/deepchem | refs/heads/master | deepchem/molnet/load_function/delaney_datasets.py | 1 | """
Delaney dataset loader.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import deepchem
def load_delaney(featurizer='ECFP', split='index'):
"""Load delaney datasets."""
# Featurize Delaney dataset
print("About to featurize Delaney ... |
renyi533/tensorflow | refs/heads/master | tensorflow/python/keras/utils/multi_gpu_utils_test.py | 4 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.