repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
csirtgadgets/bearded-avenger | refs/heads/master | cif/httpd/views/u/tokens.py | 1 | from flask.views import MethodView
from flask import redirect
from flask import request, render_template, session, url_for, flash
from cifsdk.client.zeromq import ZMQ as Client
from cif.constants import ROUTER_ADDR
import logging
import os
import json
remote = ROUTER_ADDR
HTTPD_TOKEN = os.getenv('CIF_HTTPD_TOKEN')
lo... |
rhertzog/django | refs/heads/master | django/templatetags/l10n.py | 337 | from django.template import Library, Node, TemplateSyntaxError
from django.utils import formats
from django.utils.encoding import force_text
register = Library()
@register.filter(is_safe=False)
def localize(value):
"""
Forces a value to be rendered as a localized value,
regardless of the value of ``setti... |
berendkleinhaneveld/VTK | refs/heads/master | ThirdParty/Twisted/twisted/web/static.py | 28 | # -*- test-case-name: twisted.web.test.test_static -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Static resources for L{twisted.web}.
"""
from __future__ import division
import os
import warnings
import urllib
import itertools
import cgi
import time
import mimetypes
from zope.interf... |
embeddedarm/android_external_chromium_org | refs/heads/imx_KK4.4.3_2.0.0-ga | chrome/common/extensions/docs/server2/object_store.py | 50 | # 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.
from future import Future
class _SingleGetFuture(object):
def __init__(self, multi_get, key):
self._future = multi_get
self._key = key
def ... |
hydroshare/hydroshare | refs/heads/develop | hs_core/tests/api/native/test_publish_resource.py | 1 |
import unittest
from django.contrib.auth.models import Group
from django.test import TestCase
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
class TestPublishResource(MockIRODSTestCaseMixin, TestCase):
def setUp(self):
super(TestPublishResource, self).setUp()
... |
hyperized/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_devtestlabpolicy.py | 27 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# 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',
... |
campbe13/openhatch | refs/heads/master | vendor/packages/twisted/twisted/mail/bounce.py | 17 | # -*- test-case-name: twisted.mail.test.test_bounce -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import StringIO
import rfc822
import string
import time
import os
from twisted.mail import smtp
BOUNCE_FORMAT = """\
From: postmaster@%(failedDomain)s
To: %(failedFrom)s
Subject: Return... |
ajdawson/cartopy | refs/heads/master | lib/cartopy/tests/mpl/test_pseudo_color.py | 2 | # (C) British Crown Copyright 2013 - 2014, Met Office
#
# This file is part of cartopy.
#
# cartopy 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 of the License, or
# (at your option)... |
peterlauri/django | refs/heads/master | django/contrib/gis/db/backends/oracle/adapter.py | 273 | from cx_Oracle import CLOB
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.geos import GeometryCollection, Polygon
from django.utils.six.moves import range
class OracleSpatialAdapter(WKTAdapter):
input_size = CLOB
def __init__(self, geom):
"""
Oracl... |
jvrsantacruz/tldextract | refs/heads/master | tldextract/tldextract.py | 3 | # -*- coding: utf-8 -*-
"""`tldextract` accurately separates the gTLD or ccTLD (generic or country code
top-level domain) from the registered domain and subdomains of a URL.
>>> import tldextract
>>> tldextract.extract('http://forums.news.cnn.com/')
ExtractResult(subdomain='forums.news', domain='cnn', suff... |
bharling/django-pint | refs/heads/master | sandbox/example_app/apps.py | 1 | from __future__ import unicode_literals
from django.apps import AppConfig
class QuantityfieldTestsConfig(AppConfig):
name = 'quantityfield_tests'
|
Beauhurst/django | refs/heads/master | tests/template_tests/filter_tests/test_rjust.py | 521 | from django.template.defaultfilters import rjust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class RjustTests(SimpleTestCase):
@setup({'rjust01': '{% autoescape off %}.{{ a|rjust:"5" }}. .{{ b|rjust:"5" }}.{% endautoescape %}'})
def test_rju... |
sacovo/pycorn-time | refs/heads/master | ez_setup.py | 30 | #!/usr/bin/env python
"""Bootstrap setuptools installation
To use setuptools in your package's setup.py, include this
file in the same directory and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
To require a specific version of setuptools, set a download
mirror, ... |
philanthropy-u/edx-platform | refs/heads/master | openedx/features/journals/apps.py | 4 | """
Journals Application Configuration
"""
from django.apps import AppConfig
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType, PluginURLs, PluginSettings
class JournalsConfig(AppConfig):
"""
Application Configuration for Journals.
"""
name = u'openedx.features.journals'
... |
medialab/doxer | refs/heads/master | pythonsolrpatched/__init__.py | 1 | from pythonsolr import *
from pysolr import * |
Ivoz/ajenti | refs/heads/master | plugins/services/meter.py | 17 | from ajenti.api import *
from ajenti import apis
class ServiceMeter (BinaryMeter):
name = 'Service'
category = 'Software'
transform = 'running'
def get_variants(self):
return [x.name for x in self.app.get_backend(apis.services.IServiceManager).list_all()]
def init(self):
self.mgr... |
bobquest33/peach | refs/heads/master | tutorial/fuzzy-logic/simple-controller.py | 6 | ################################################################################
# Peach - Computational Intelligence for Python
# Jose Alexandre Nalon
#
# This file: tutorial/simple-controller.py
# A simgle-input-single-output Mamdani controller
###################################################################... |
brainstorm/python_koans | refs/heads/master | python3/koans/about_true_and_false.py | 17 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTrueAndFalse(Koan):
def truth_value(self, condition):
if condition:
return 'true stuff'
else:
return 'false stuff'
def test_true_is_treated_as_true(self):
self.assertEqua... |
allenai/allennlp | refs/heads/master | tests/data/tokenizers/character_tokenizer_test.py | 1 | from allennlp.common.testing import AllenNlpTestCase
from allennlp.data.tokenizers import CharacterTokenizer
class TestCharacterTokenizer(AllenNlpTestCase):
def test_splits_into_characters(self):
tokenizer = CharacterTokenizer(start_tokens=["<S1>", "<S2>"], end_tokens=["</S2>", "</S1>"])
sentence ... |
caphrim007/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/k8s_resource_options.py | 16 | #
# Copyright 2018 Red Hat | Ansible
#
# 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.
#
# ... |
Maccimo/intellij-community | refs/heads/master | python/testData/quickFixes/PyTypeHintsQuickFixTest/functionAnnotationAndTypeComment.py | 9 | def <warning descr="Types specified both in a type comment and annotation">b<caret>ar</warning>(a: int) -> int:
<warning descr="Types specified both in a type comment and annotation"># type: (int) -> int</warning>
pass |
kaarolch/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_project.py | 23 | #!/usr/bin/python
# Copyright (c) 2015 IBM Corporation
#
# This module 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.
#
# This softwar... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/wearables/armor/ubese/shared_armor_ubese_helmet.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/armor/ubese/shared_armor_ubese_helmet.iff"
result.attribu... |
SINGROUP/pycp2k | refs/heads/master | pycp2k/classes/_energy1.py | 1 | from pycp2k.inputsection import InputSection
from ._each22 import _each22
class _energy1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Add_last = None
self.Common_iteration_levels = None
self.Filename = None
self.... |
sogelink/ansible | refs/heads/devel | lib/ansible/modules/messaging/rabbitmq_exchange.py | 56 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1'... |
devincoughlin/swift | refs/heads/master | utils/android/adb_push_built_products/main.py | 27 | # main.py - Push libraries to an Android device -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license in... |
LTKills/languages | refs/heads/master | python/15.py | 1 | #Special Numbers
import math
for i in range(1000, 10000):
a = str(i)
b, c = int(a[:2]), int(a[2:])
if(math.sqrt(i) == b+c):
print (i)
|
julienr/vispy | refs/heads/master | vispy/util/bunch.py | 21 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# Class adapted from mne-python
class SimpleBunch(dict):
""" Container object for datasets: dictionnary-like object that
exposes its keys as attributes.
"""
... |
2014c2g5/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/encodings/aliases.py | 726 | """ Encoding Aliases Support
This module is used by the encodings package search function to
map encodings names to module names.
Note that the search function normalizes the encoding names before
doing the lookup, so the mapping will have to map normalized
encoding names to module names.
Con... |
JeremyMorgan/Raspberry_Pi_Weather_Station | refs/heads/master | Adafruit_I2C.py | 116 | #!/usr/bin/python
import re
import smbus
# ===========================================================================
# Adafruit_I2C Class
# ===========================================================================
class Adafruit_I2C(object):
@staticmethod
def getPiRevision():
"Gets the version number of ... |
sidzan/netforce | refs/heads/master | netforce/netforce/pymeta/grammar.py | 5 | # -*- test-case-name: pymeta.test.test_pymeta -*-
"""
Public interface to OMeta, as well as the grammars used to compile grammar
definitions.
"""
import string
from .builder import TreeBuilder, moduleFromGrammar
from .boot import BootOMetaGrammar
from .runtime import OMetaBase, ParseError, EOFError
class OMeta(OMetaBa... |
asen6/amartyasenguptadotcom | refs/heads/master | django/http/utils.py | 200 | """
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... |
40223221/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/importlib/__init__.py | 610 | """A pure Python implementation of import."""
__all__ = ['__import__', 'import_module', 'invalidate_caches']
# Bootstrap help #####################################################
# Until bootstrapping is complete, DO NOT import any modules that attempt
# to import importlib._bootstrap (directly or indirectly). Since... |
kambysese/mne-python | refs/heads/master | examples/visualization/plot_topo_customized.py | 15 | """
========================================
Plot custom topographies for MEG sensors
========================================
This example exposes the :func:`~mne.viz.iter_topography` function that makes
it very easy to generate custom sensor topography plots.
Here we will plot the power spectrum of each channel on a... |
writemorecode/coding_challenges | refs/heads/master | dailyprogrammer/196/196.py | 1 | #!/usr/bin/python
# [2015-01-05] Challenge #196 [Practical Exercise] Ready... set... set!
import random
class IntegerSet(object):
def __init__(self, values):
self.values = values
def Contains(self, value):
return value in self.values
def Equals(self, setb):
if len(self.values)... |
ak2703/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/instructor_dashboard.py | 29 | # -*- coding: utf-8 -*-
"""
Instructor (2) dashboard page.
"""
from bok_choy.page_object import PageObject
from .course_page import CoursePage
import os
from bok_choy.promise import EmptyPromise, Promise
from ...tests.helpers import select_option_by_text, get_selected_option_text, get_options
class InstructorDashboa... |
ravibhure/ansible | refs/heads/devel | lib/ansible/modules/network/onyx/onyx_linkagg.py | 14 | #!/usr/bin/python
#
# Copyright: Ansible Project
# 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',
'status': ['preview'],
... |
Nepherhotep/django | refs/heads/master | django/db/migrations/operations/special.py | 374 | from __future__ import unicode_literals
from django.db import router
from .base import Operation
class SeparateDatabaseAndState(Operation):
"""
Takes two lists of operations - ones that will be used for the database,
and ones that will be used for the state change. This allows operations
that don't ... |
alheinecke/tensorflow-xsmm | refs/heads/master | tensorflow/python/ops/ctc_ops.py | 29 | # 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... |
richard-willowit/odoo | refs/heads/master | addons/sales_team/models/res_partner.py | 16 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
team_id = fields.Many2one(
'crm.team', 'Sales Channel',
help='If set, this sales channel will be used fo... |
NetApp/manila | refs/heads/master | manila/tests/api/v1/test_share_types_extra_specs.py | 2 | # Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 OpenStack Foundation
# Copyright 2011 University of Southern California
# 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 ... |
muccg/rdrf | refs/heads/next_release | rdrf/rdrf/models/proms/models.py | 1 | from rest_framework import status
import json
import logging
import requests
from django.db import models
from django.urls import reverse
from django.forms import ValidationError
from django.utils.encoding import escape_uri_path
from rdrf.models.definition.models import Registry, RegistryForm, Section
from rdrf.model... |
simonmonk/make_action | refs/heads/master | python/experiments/pwm_motor_control.py | 1 | import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
control_pin = 18 # (1)
GPIO.setup(control_pin, GPIO.OUT)
motor_pwm = GPIO.PWM(control_pin, 500) # (2)
motor_pwm.start(0) # (3)
try:
while True: # (4)
duty = input('Enter Duty Cycle (0 to... |
arduino-org/s4t-iotronic | refs/heads/master | lib/test_c.py | 1 | from autobahn.twisted.websocket import WebSocketClientProtocol, \
WebSocketClientFactory
class MyClientProtocol(WebSocketClientProtocol):
def onConnect(self, response):
print("Server connected: {0}".format(response.peer))
def onOpen(self):
print("WebSocket c... |
wlanslovenija/django-tastypie-mongoengine | refs/heads/master | tests/test_project/test_app/models.py | 10644 | from django.db import models
# Create your models here.
|
gregkorte/Python-Koans | refs/heads/master | python2/runner/mockable_test_result.py | 278 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
# Needed to stop unittest.TestResult itself getting Mocked out of existence,
# which is a problem when testing the helper classes! (It confuses the runner)
class MockableTestResult(unittest.TestResult):
pass |
mihaic/brainiak | refs/heads/jenkins | brainiak/funcalign/srm.py | 4 | # Copyright 2016 Intel Corporation
#
# 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... |
ayepezv/GAD_ERP | refs/heads/master | addons/hr_payroll_account/tests/test_hr_payroll_account.py | 2 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from datetime import datetime, timedelta
from dateutil import relativedelta
from odoo import fields, tools
from odoo.modules.module import get_module_resource
from odoo.tests import common
class TestHrPay... |
noobcoderT/ryu-3.21 | refs/heads/master | ryu/services/protocols/bgp/peer.py | 9 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... |
sungkim11/mhargadh | refs/heads/master | django/contrib/messages/storage/base.py | 399 | from django.conf import settings
from django.utils.encoding import force_unicode, StrAndUnicode
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
class Message(StrAndUnicode):
"""
Represents an actual message that can be stored in any of the supported
storage class... |
CivicKnowledge/ambry | refs/heads/master | test/functional/old_or_broken/test_orm_config.py | 1 | # -*- coding: utf-8 -*-
from sqlalchemy.exc import IntegrityError
from ambry.orm.config import Config
from test.factories import DatasetFactory
from test.proto import TestBase
class Test(TestBase):
def setUp(self):
super(self.__class__, self).setUp()
self._my_library = self.library()
D... |
abstract-open-solutions/OCB | refs/heads/8.0 | addons/website_certification/__init__.py | 385 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
saurabh6790/OFF-RISAPP | refs/heads/master | accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py | 14 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _, msgprint
from webnotes.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns... |
craigtracey/nova-docker | refs/heads/master | novadocker/tests/virt/docker/test_vifs.py | 1 | # Copyright (c) 2013 VMware, 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... |
belimawr/experiments | refs/heads/master | OpenCV-Python/picamera-opencv-BW.py | 1 | #Sources: http://picamera.readthedocs.io/en/release-1.6/recipes1.html#capturing-to-an-opencv-object
# https://raspberrypi.stackexchange.com/q/22241
import io
import picamera
import cv2
import numpy as np
with picamera.PiCamera() as camera:
camera.resolution = (640, 480)
camera.framerate = 24
str... |
bmya/odoo-addons | refs/heads/8.0 | product_uom_prices/product.py | 5 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, _, api
import ... |
wxwilcke/MINOS | refs/heads/master | directives/pakbonLD_A2_MP.py | 1 | #!/usr/bin/python3
import logging
from operator import itemgetter
from multiprocessing import Process, Manager, Pool, cpu_count
from functools import partial
from math import floor
from timeit import default_timer as timer
import rdflib
from .abstract_instruction_set import AbstractInstructionSet
from readers import r... |
squirly/eece411-kvclient | refs/heads/master | tests/testing/test_base.py | 1 | import socket
from testing.base import Test, TestTimeout, TextTestResult, TestResult, ClusteredTestResult, IndependentNodesTest, ClusteredNodesTest
import gevent
import mock
import pytest
class TestTest(object):
def test_resolve_address(self):
class MockSocket:
@staticmethod
def ge... |
yigitguler/django | refs/heads/master | tests/empty/models.py | 542 | """
Empty model tests
These test that things behave sensibly for the rare corner-case of a model with
no fields.
"""
from django.db import models
class Empty(models.Model):
pass
|
wemanuel/smry | refs/heads/master | server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/boto/boto/sdb/regioninfo.py | 167 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without res... |
smilefreak/selectionTools | refs/heads/master | setup.py | 2 | from setuptools import setup, find_packages
__version__ = "unknown"
from selection_pipeline._version import __version__
setup(
name="selectionTools",
version=__version__,
packages=['selection_pipeline','selection_pipeline.tests'],
test_suite='selection_pipeline.tests.test_selection_pipeline',
author... |
iCasa/speedtest-cli | refs/heads/master | speedtest_cli.py | 28 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2015 Matt Martz
# 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.or... |
jcamachor/hive | refs/heads/master | hcatalog/src/test/e2e/templeton/newtests/udfs.py | 40 | # 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... |
jimsimon/sky_engine | refs/heads/master | mojo/public/tools/mojom_fetcher/pylib/fetcher/mojom_directory.py | 26 | # 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 os
from fetcher.dependency import group_target_name
class MojomDirectory(object):
"""This class represents a directory that directly holds mojom f... |
littlstar/chromium.src | refs/heads/nw | tools/telemetry/telemetry/unittest/options_for_unittests.py | 85 | # Copyright 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.
"""This module provides the global variable options_for_unittests.
This is set to a BrowserOptions object by the test harness, or None
if unit tests are not... |
boudewijnrempt/HyvesDesktop | refs/heads/master | 3rdparty/socorro/socorro/collector/initializer.py | 1 | import os
import logging
import logging.handlers
import socorro.lib.ConfigurationManager
import socorro.lib.util as sutil
import socorro.lib.JsonDumpStorage as jds
import socorro.collector.collect as collect
#------------------------------------------------------------------------------------------------------------... |
Tatsh-ansible/ansible | refs/heads/devel | lib/ansible/plugins/cache/memcached.py | 79 | # (c) 2014, Brian Coca, Josh Drake, et al
#
# 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.
... |
denisenkom/django | refs/heads/master | django/dispatch/__init__.py | 571 | """Multi-consumer multi-producer dispatching mechanism
Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1
See license.txt for original license.
Heavily modified for Django's purposes.
"""
from django.dispatch.dispatcher import Signal, receiver |
tudorbarascu/QGIS | refs/heads/master | tests/src/python/test_qgspathresolver.py | 8 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPathResolver.
.. note:: 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) any later version.
"""
_... |
JohnGBaker/flare | refs/heads/master | python/HorizonPlot.py | 1 | import flare
import numpy as np
import argparse
eps=0.3
parser = argparse.ArgumentParser(description="generate a discover queue script for a flare run");
parser.add_argument('label',help="The basename/directory for the run")
args=parser.parse_args()
flare.flare_dir="../flare"
#file="FisherStudy-most-HH.dat"
#file="Fi... |
simba518/CollisionHandle | refs/heads/master | script/utility.py | 3 | import os
import re
import glob
from types import IntType, LongType, FloatType
# checking if a string is a number
def isNumber(s):
try:
float(s)
return True
except ValueError:
return False
# return all of the float numbers of a file.
def grepFloatNumbers(data_filename):
data_file ... |
MichaelNedzelsky/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/core/cache/__init__.py | 71 | """
Caching framework.
This package defines set of cache backends that all conform to a simple API.
In a nutshell, a cache is a set of values -- which can be any object that
may be pickled -- identified by string keys. For the complete API, see
the abstract BaseCache class in django.core.cache.backends.base.
Client ... |
akintoey/django | refs/heads/master | tests/test_client/auth_backends.py | 315 | from django.contrib.auth.backends import ModelBackend
class TestClientBackend(ModelBackend):
pass
|
petewarden/tensorflow | refs/heads/master | tensorflow/compiler/tests/quantized_ops_test.py | 17 | # Copyright 2018 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... |
pearsontechnology/st2contrib | refs/heads/master | packs/twilio/actions/send_sms.py | 23 | from twilio.rest import TwilioRestClient
from st2actions.runners.pythonrunner import Action
class TwilioSendSMSAction(Action):
def __init__(self, config):
super(TwilioSendSMSAction, self).__init__(config=config)
self.client = TwilioRestClient(self.config['account_sid'],
... |
alanjw/GreenOpenERP-Win-X86 | refs/heads/7.0 | python/Lib/site-packages/win32com/server/connect.py | 4 | """Utilities for Server Side connections.
A collection of helpers for server side connection points.
"""
import pythoncom
from exception import Exception
import winerror
from win32com import olectl
import win32com.server.util
# Methods implemented by the interfaces.
IConnectionPointContainer_methods = ["... |
ychfan/tensorflow | refs/heads/master | tensorflow/contrib/graph_editor/tests/edit_test.py | 132 | # 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... |
eruffaldi/python-docx | refs/heads/master | tests/opc/test_package.py | 8 | # encoding: utf-8
"""
Test suite for docx.opc.package module
"""
from __future__ import absolute_import
import pytest
from docx.opc.constants import RELATIONSHIP_TYPE as RT
from docx.opc.coreprops import CoreProperties
from docx.opc.package import OpcPackage, Unmarshaller
from docx.opc.packuri import PACKAGE_URI
fr... |
YiqunPeng/Leetcode-pyq | refs/heads/master | solutions/332ReconstructItinerary.py | 1 | class Solution:
def __init__(self):
self.ans = []
def findItinerary(self, tickets):
"""
:type tickets: List[List[str]]
:rtype: List[str]
"""
ticket_dict = collections.defaultdict(list)
airport_dict = collections.defaultdict(int)
for t in ticke... |
sasmita/upm | refs/heads/master | examples/python/scam.py | 7 | #!/usr/bin/python
#
# Author: Jon Trulson <jtrulson@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... |
gerdemb/django-denorm | refs/heads/master | test_denorm_project/test_app/views.py | 6027 | # Create your views here.
|
dsanders11/django-autocomplete-light | refs/heads/master | autocomplete_light/example_apps/non_admin_add_another/models.py | 2 | from __future__ import unicode_literals
from django.core import urlresolvers
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class NonAdminAddAnotherModel(models.Model):
name = models.CharField(max_length=100)
widgets = models.ManyToMany... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | valgrind_test/compare_function/mycomparator.py | 2 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... |
einaru/luma | refs/heads/master | luma/plugins/browser/gui/StandardEditorDesign.py | 3 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/mnt/debris/devel/repo/git/luma-fixes/resources/forms/plugins/browser/StandardEditorDesign.ui'
#
# Created: Wed May 25 21:41:11 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt... |
wanders/buildbot-extras | refs/heads/master | buildbotextras/status/syslogstatus.py | 1 | # Copyright (C) 2008-2013 Anders Waldenborg et al.
#
# 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... |
FibercorpLabs/FibercorpDevops | refs/heads/master | vmware/nsx/performance/vcenter/CreateVMWPortGroup.py | 1 | #CreateVMWPortGroup.py
from VMWConfigFile import *
from pyVim import connect
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim, vmodl
import atexit
import os
import sys
import ssl
import requests
import argparse
import time
import getpass
# Disabling urllib3 ssl warnings
requests.packages.ur... |
JakeLowey/HackRPI2 | refs/heads/master | django/contrib/gis/geos/error.py | 641 | """
This module houses the GEOS exceptions, specifically, GEOSException and
GEOSGeometryIndexError.
"""
class GEOSException(Exception):
"The base GEOS exception, indicates a GEOS-related error."
pass
class GEOSIndexError(GEOSException, KeyError):
"""
This exception is raised when an invalid index is... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_2/tests/modeltests/update/tests.py | 89 | from django.test import TestCase
from models import A, B, C, D, DataPoint, RelatedPoint
class SimpleTest(TestCase):
def setUp(self):
self.a1 = A.objects.create()
self.a2 = A.objects.create()
for x in range(20):
B.objects.create(a=self.a1)
D.objects.create(a=self.a1... |
vikatory/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/distlib/wheel.py | 185 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from... |
ericholscher/cookiecutter | refs/heads/master | cookiecutter/__init__.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cookiecutter
------------
Main package for Cookiecutter.
"""
__version__ = '0.7.0'
|
mohamed--abdel-maksoud/chromium.src | refs/heads/nw12 | tools/telemetry/telemetry/web_perf/metrics/smoothness_unittest.py | 12 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.results import page_test_results
from telemetry.page import page as page_module
from telemetry.web_perf.metrics import smooth... |
ShadowTemplate/ScriBa | refs/heads/master | imdb.py | 1 | import os
import requests
from bs4 import BeautifulSoup
import constants
import utils
def get_movie_info(imdb_id):
movie_url = constants.IMDB_HOME_URL + '/title/tt' + imdb_id
req = requests.get(movie_url)
if req.status_code != 200:
raise RuntimeError('Invalid request to URL: ', movie_url)
so... |
emedinaa/contentbox | refs/heads/master | invitations/views.py | 4 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
jimsimon/sky_engine | refs/heads/master | sky/tools/webkitpy/common/checkout/__init__.py | 6014 | # Required for Python to search this directory for module files
|
percy-g2/Novathor_xperia_u8500 | refs/heads/master | 6.1.1.B.0.253/external/webkit/Tools/RebaselineQueueServer/handlers/__init__.py | 6014 | # Required for Python to search this directory for module files
|
vmindru/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py | 13 | #!/usr/bin/python
# Copyright: Ansible Project
# 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',
'status': ['stableinterf... |
davidmashburn/sparse_dot | refs/heads/master | setup.py | 1 | import os
import multiprocessing
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from distutils.command.sdist import sdist as _sdist
# Read the version number
with open("sparse_dot/_version.py") as f:
exec(f.read())
extensions = [Extension('sparse_do... |
ryangribble/xbmc | refs/heads/master | lib/gtest/scripts/upload_gtest.py | 1963 | #!/usr/bin/env python
#
# Copyright 2009, 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... |
chacoroot/planetary | refs/heads/master | addons/payment_paypal/tests/test_paypal.py | 378 | # -*- coding: utf-8 -*-
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_paypal.controllers.main import PaypalController
from openerp.tools import mute_logger
from lxml import objectify
import u... |
babbage/zulip | refs/heads/master | zerver/lib/mandrill_client.py | 125 | import mandrill
from django.conf import settings
MAIL_CLIENT = None
def get_mandrill_client():
if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
return None
global MAIL_CLIENT
if not MAIL_CLIENT:
MAIL_CLIENT = mandrill.Mandrill(settings.MANDRILL_API_KEY)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.