repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
psdh/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/test/test_mock.py | 496 | #!/usr/bin/env python
#
# Copyright 2011, 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... |
psychopy/psychopy | refs/heads/release | psychopy/demos/coder/experiment control/JND_staircase_exp.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Measure your JND in orientation using a staircase method
"""
from __future__ import absolute_import, division, print_function
from psychopy import core, visual, gui, data, event
from psychopy.tools.filetools import fromFile, toFile
import time, numpy
try: # try to ... |
sordonia/hred-qs | refs/heads/master | baselines/CACB/cacb.py | 3 | from Common import psteff
import sys
import collections
import operator
import cPickle
import logging
import numpy
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.INFO)
def _prepare_concepts(query_to_clst, session):
concepts = map(lambda query: query_to_clst.get(query, query), session)
# Re... |
cloudbase/nova | refs/heads/master | nova/compute/monitors/cpu/virt_driver.py | 7 | # Copyright 2013 Intel Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
wettenhj/mytardis | refs/heads/develop | tardis/tardis_portal/managers.py | 1 | """
managers.py
.. moduleauthor:: Ulrich Felzmann <ulrich.felzmann@versi.edu.au>
"""
from datetime import datetime
from django.db import models
from django.db.models import Q
from django.core.exceptions import PermissionDenied
from django.contrib.auth.models import User, Group
from .auth.localdb_auth import djang... |
nicko96/Chrome-Infra | refs/heads/master | infra_libs/ts_mon/monitors.py | 1 | # 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.
"""Classes representing the monitoring interface for tasks or devices.
Usage:
import argparse
from infra_libs import ts_mon
p = argparse.ArgumentPars... |
myles/me-api | refs/heads/master | api.py | 1 | #!/usr/bin/python
import os
from importlib import import_module
from ripozo import apimethod, ResourceBase
from opbeat.contrib.flask import Opbeat
from flask import Flask, json, jsonify, abort, request
from flask.ext.cache import Cache
from flask_ripozo import FlaskDispatcher
from utils import CustomJSONEncoder, J... |
Niboo/l10n-belgium | refs/heads/8.0 | account_companyweb/tests/__init__.py | 6 | # -*- coding: utf-8 -*-
#
##############################################################################
#
# Authors: Adrien Peiffer
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... |
ChameleonCloud/blazar | refs/heads/chameleoncloud/train | blazar/plugins/dummy_vm_plugin.py | 1 | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
alirizakeles/zato | refs/heads/dsuch-f-gh723-add-exe-agent | code/zato-client/test/__init__.py | 99 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
|
valkyriesavage/gasustainability | refs/heads/master | django/contrib/comments/feeds.py | 310 | from django.conf import settings
from django.contrib.syndication.views import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
from django.utils.translation import ugettext as _
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(sel... |
eofs/python-anagrammer | refs/heads/master | lib/__init__.py | 1 | from lib.anagram import Anagrammer
__all__ = ['Anagrammer']
|
apple/llvm-project | refs/heads/llvm.org/main | lldb/test/API/commands/target/create-deps/TestTargetCreateDeps.py | 5 | """
Test that loading of dependents works correctly for all the potential
combinations.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@skipIfWindows # Windows deals differently with shared libs.
class TargetDependentsTestCase(TestBas... |
40223225/cdb-test2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py | 735 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... |
JonReppDoneD/omaha | refs/heads/master | third_party/gmock/scripts/generator/cpp/tokenize.py | 679 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... |
wolfram74/numerical_methods_iserles_notes | refs/heads/master | venv/lib/python2.7/site-packages/sympy/integrals/tests/test_failing_integrals.py | 13 | # A collection of failing integrals from the issues.
from __future__ import division
from sympy import (
integrate, Integral, exp, I, oo, pi, sign, sqrt, Rational, Symbol, sin, cos,
tan, S, log, Function, gamma, sinh,
)
from sympy.utilities.pytest import XFAIL, SKIP, slow, skip, ON_TRAVIS
from sympy.abc imp... |
toros-astro/corral | refs/heads/master | corral/template/template/__init__.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created at ${timestamp} by corral ${version}
# =============================================================================
# DOCS
# =============================================================================
"""${project_name} a corral pipeline
"""
|
pmarques/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/yak/zebra/foo.py | 298 | data = 'yak'
|
erix5son/Tennis-Modelling | refs/heads/master | settings.py | 1 | __author__ = 'riko'
# Set to the root of TennisModelling location.
ROOT_PATH = "/home/riko/Desktop/Tennis-Modelling/"
# Mysql connection settings.
# Mysql settings must be stored as DICTIONARY in variable MYSQL_SETTINGS !!!
host = "localhost"
user = "root"
passwd = "erik12959338"
db = "tennis"
MYSQL_SETTINGS = {"ho... |
benschneider/sideprojects1 | refs/heads/master | hdf5_to_mtx/load_S1_469_shot.py | 1 | import numpy as np
from parsers import load_hdf5
from parsers import savemtx, make_header
# import matplotlib.pyplot as plt
# from changeaxis import interp_y
# from scipy.constants import Boltzmann as Kb
# from scipy.constants import h , e, pi
filein = "S1_469_shot_127mV_wide_2"
folder = "hdf5s//09//Data_0906//"
d =... |
sloanyang/android_kernel_huawei_mediapad10fhd | refs/heads/master | tools/perf/scripts/python/check-perf-trace.py | 11214 | # 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. ... |
guorendong/iridium-browser-ubuntu | refs/heads/ubuntu/precise | native_client/src/trusted/validator_ragel/avx1_xmm_ymm_memory_moves.py | 8 | # Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Proof for adding avx1 move instructions for memory/xmm/ymm registers."""
import proof_tools
from proof_tools import MnemonicOp
from proof_tools ... |
CarolinaSGomes/jaikuengine | refs/heads/master | common/templatetags/test/__init__.py | 1073 | # Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
BhallaLab/moose | refs/heads/master | moose-gui/suds/xsd/schema.py | 1 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will b... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/weapon/melee/sword/crafted_saber/sword_lightsaber_one_handed_s10_gen4.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/azure_cabal_troudge_scavenger_m_02.py | 85615 | import sys
def setup(core, object):
return |
wuzhy/autotest | refs/heads/io_throttling | tko/parsers/version_1_unittest.py | 2 | #!/usr/bin/python
import unittest, datetime, time
import common
from autotest_lib.client.common_lib import utils
from autotest_lib.tko.parsers import version_1
class test_status_line(unittest.TestCase):
statuses = ["GOOD", "WARN", "FAIL", "ABORT"]
def test_handles_start(self):
line = version_1.sta... |
benoitsteiner/tensorflow-xsmm | refs/heads/master | tensorflow/python/training/proximal_gradient_descent_test.py | 102 | # 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... |
gavinfish/leetcode-share | refs/heads/master | python/091 Decode Ways.py | 1 | '''
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total number of ways to decode it.
For example,
Given encoded message "12", it could be decoded as "AB" (1 2) or "L" (12).
The n... |
NewpTone/stacklab-nova | refs/heads/master | nova/tests/api/ec2/test_middleware.py | 7 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
Distrotech/librevenge | refs/heads/distrotech-librevenge | data/gdb/librevenge/util/compatibility.py | 3 | # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
# librevenge
# Version: MPL 2.0 / LGPLv2.1+
#
# 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/.
#
# Alte... |
loanzen/heroku-buildpack-python | refs/heads/master | vendor/pip-pop/pip/_vendor/html5lib/treewalkers/lxmletree.py | 436 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
elif isinstance(s, text_type):
... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/commands/combat/co_ae_hw_dot_electrical_1.py | 4 | import sys
def setup(core, actor, target, command):
command.setDotDuration(15)
command.setDotType('electricity')
command.setDotIntensity(50)
return
def run(core, actor, target, commandString):
return
|
siosio/intellij-community | refs/heads/master | python/testData/surround/SurroundWithTryExcept.py | 72 | def foo():
pr<caret>int "hello" |
cuauv/software | refs/heads/master | webserver/handlers/vision.py | 1 | import os
import json
import time
import collections
import traceback
import base64
import cv2
import tornado.websocket
from tornado.web import HTTPError
from tornado.ioloop import PeriodicCallback
from webserver import BaseHandler
from vision import camera_message_framework, vision_common, options
import shm
module_... |
LogicalDash/kivy | refs/heads/master | kivy/uix/abstractview.py | 12 | '''
Abstract View
=============
.. versionadded:: 1.5
.. deprecated:: 1.10.0
The feature has been deprecated.
.. warning::
This code is still experimental, and its API is subject to change in a
future version.
The :class:`~kivy.uix.abstractview.AbstractView` widget has an adapter property
for an adapte... |
NL66278/OCB | refs/heads/8.0 | addons/hw_posbox_upgrade/__init__.py | 1894 | # -*- 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... |
cedi4155476/QGIS | refs/heads/master | python/plugins/processing/tests/ScriptTest.py | 11 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ScriptTest.py
---------------------
Date : March 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... |
xliiauo/leetcode | refs/heads/master | 4/Solution.py | 2 | class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
counter = 0
p = 0
q = 0
m1 = -1
m2 = -1
len_sum = len(nums1) + len(nums2)
if ... |
xiaoyang2022/V2EX | refs/heads/master | html5lib/serializer/htmlserializer.py | 97 | try:
frozenset
except NameError:
# Import from the sets module for python 2.3
from sets import ImmutableSet as frozenset
import gettext
_ = gettext.gettext
from html5lib.constants import voidElements, booleanAttributes, spaceCharacters
from html5lib.constants import rcdataElements, entities, xmlEntities
f... |
pacoqueen/cican | refs/heads/master | utils/gmapcatcher/download.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
## @package download
# Downloader tool without GUI
import sys
import gmapcatcher.mapConf as mapConf
from gmapcatcher.mapUtils import *
from gmapcatcher.mapArgs import MapArgs
from gmapcatcher.mapServices import MapServ
from gmapcatcher.mapDownloader import MapDownloader
... |
clixx-io/esptools | refs/heads/master | esptools/esprm.py | 1 | #-- Copyright 2015 David Lyon. All rights reserved.
#--
#-- Redistribution and use in source and binary forms, with or without modification, are
#-- permitted provided that the following conditions are met:
#--
#-- 1. Redistributions of source code must retain the above copyright notice, this list of
#-- con... |
aapris/linkedevents | refs/heads/master | events/migrations/0004_auto_20150607_2003.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0003_auto_20150607_1959'),
]
operations = [
migrations.AlterField(
model_name='datasource',
... |
noironetworks/heat | refs/heads/master | heat/engine/resources/openstack/barbican/secret.py | 2 | #
# 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
# ... |
lionslair/drupal_sitback | refs/heads/master | sites/all/themes/sitback_demo_theme/bootstrap/test-infra/s3_cache.py | 2166 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... |
nkgilley/home-assistant | refs/heads/dev | homeassistant/components/ubee/device_tracker.py | 12 | """Support for Ubee router."""
import logging
from pyubee import Ubee
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_valida... |
egabancho/invenio | refs/heads/pu | invenio/modules/pages/errors.py | 3 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 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... |
eiginn/platformio | refs/heads/develop | scripts/fixsymlink.py | 3 | # Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
#
# 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... |
AndyHuu/flocker | refs/heads/master | flocker/docs/bootstrap/_tabs.py | 15 | from textwrap import dedent
from docutils.parsers.rst import Directive
from docutils import nodes
class tabpanel(nodes.General, nodes.Element):
pass
def visit_tabpanel_html(self, node):
pass
def depart_tabpanel_html(self, node):
pass
class tabcontent(nodes.General, nodes.Element):
pass
def vi... |
hellsgate1001/bookit | refs/heads/master | docs/env/Lib/site-packages/django/utils/six.py | 19 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# 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 with... |
davidyezsetz/kuma | refs/heads/master | vendor/lib/python/south/tests/deps_c/migrations/0001_c.py | 2088 | from south.db import db
from django.db import models
class Migration:
def forwards(self):
pass
def backwards(self):
pass
|
afrolov1/nova | refs/heads/master | nova/tests/api/openstack/compute/contrib/test_fixed_ips.py | 27 | # Copyright 2012 IBM Corp.
#
# 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 t... |
RedhawkSDR/framework-GPP | refs/heads/master | tests/sdr/dom/components/load_comp/python/load_comp.py | 1 | #!/usr/bin/env python
#
#
# AUTO-GENERATED
#
# Source: load_comp.spd.xml
from ossie.resource import start_component
import logging
import subprocess
from load_comp_base import *
class load_comp_i(load_comp_base):
"""<DESCRIPTION GOES HERE>"""
def constructor(self):
"""
This is called by the fr... |
treetrnk/Tuxemon | refs/heads/master | tuxemon/core/components/networking.py | 2 | # -*- coding: utf-8 -*-
#
# Tuxemon
# Copyright (C) 2014, William Edwards <shadowapex@gmail.com>,
# Benjamin Bean <superman2k5@gmail.com>
#
# This file is part of Tuxemon.
#
# Tuxemon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... |
zhangqifan/findSomething | refs/heads/master | FindSomething/Pods/AVOSCloudCrashReporting/Breakpad/src/testing/gtest/scripts/upload.py | 2511 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
emedinaa/contentbox | refs/heads/master | third_party/django/core/serializers/pyyaml.py | 120 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import decimal
import yaml
import sys
from io import StringIO
from django.db import models
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSe... |
swarna-k/MyDiary | refs/heads/master | flask/lib/python2.7/site-packages/migrate/versioning/script/__init__.py | 151 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from migrate.versioning.script.base import BaseScript
from migrate.versioning.script.py import PythonScript
from migrate.versioning.script.sql import SqlScript
|
sandipagr/django-registration | refs/heads/master | registration/tests/forms.py | 71 | from django.contrib.auth.models import User
from django.test import TestCase
from registration import forms
class RegistrationFormTests(TestCase):
"""
Test the default registration forms.
"""
def test_registration_form(self):
"""
Test that ``RegistrationForm`` enforces username const... |
kslundberg/pants | refs/heads/master | src/python/pants/backend/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
ogenstad/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_facts.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# Copyright (c) 2013 Matt Hite <mhite@hotmail.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
ANSIBL... |
jazztpt/edx-platform | refs/heads/master | lms/djangoapps/courseware/management/commands/tests/test_clean_history.py | 88 | """Test the clean_history management command."""
import fnmatch
from mock import Mock
from nose.plugins.attrib import attr
import os.path
import textwrap
import dateutil.parser
from django.test import TransactionTestCase
from django.db import connection
from courseware.management.commands.clean_history import Stude... |
mydongistiny/external_chromium_org | refs/heads/benzo | mojo/public/python/mojo/bindings/reflection.py | 25 | # 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.
"""The metaclasses used by the mojo python bindings."""
import itertools
# pylint: disable=F0401
import mojo.bindings.serialization as serialization
clas... |
benhoff/commandparser | refs/heads/master | vexparser/__main__.py | 2 | import argparse
import yaml
from zmq import ZMQError
from vexparser.classification_parser import ClassifyParser
from vexparser.mark_parser import MarkParser
from vexparser.messaging import Messaging
from vexparser.callback_manager import CallbackManager
import vexparser.util as util
try:
import setproctitle
... |
jhesketh/pyconau-gating-demo-live | refs/heads/master | tests/test_cities.py | 1 | import testtools
import cities
class TestCities(testtools.TestCase):
def test_largest(self):
self.assertEqual(
'Sydney', cities.largest_city(cities.get_population_data()).name)
def test_largest_state(self):
self.assertEqual(
'NSW', cities.largest_state(cities.get_popu... |
aperigault/ansible | refs/heads/devel | lib/ansible/modules/monitoring/spectrum_device.py | 101 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Renato Orgito <orgito@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',
... |
xiangel/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/core/management/commands/runserver.py | 47 | from __future__ import unicode_literals
from optparse import make_option
from datetime import datetime
import errno
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import run, get_internal_wsgi_application
from django.uti... |
darkpeach/AlgorithmCoding | refs/heads/master | _066_PlusOne.py | 1 | class Solution(object):
def plusOne(self, digits):
"""
:type digits: List[int]
:rtype: List[int]
"""
digits.reverse()
digits[0] += 1
i = 0
carry = 0
while i < len(digits):
sum = digits[i] + carry
digits[i] = sum % 10
... |
jayceyxc/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/view_tests/urls.py | 49 | # coding: utf-8
from __future__ import absolute_import
from os import path
from django.conf.urls import patterns, url, include
from django.utils._os import upath
from . import views
base_dir = path.dirname(path.abspath(upath(__file__)))
media_dir = path.join(base_dir, 'media')
locale_dir = path.join(base_dir, 'loc... |
webgeodatavore/django | refs/heads/master | tests/migration_test_data_persistence/migrations/0002_add_book.py | 427 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def add_book(apps, schema_editor):
apps.get_model("migration_test_data_persistence", "Book").objects.using(
schema_editor.connection.alias,
).create(
title="I Love Django",
)
class Migration... |
xuxiao19910803/edx-platform | refs/heads/master | openedx/core/djangoapps/course_groups/migrations/0003_auto__add_coursecohort__add_coursecohortssettings.py | 100 | # -*- 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 'CourseCohort'
db.create_table('course_groups_coursecohort', (
('id', self.gf('dj... |
KellyChan/Python | refs/heads/master | python/django/artdepot/artdepot/depot/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
sukenda/django-api-tutorial | refs/heads/master | accounts/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
duramato/SickRage | refs/heads/master | lib/dateutil/easter.py | 232 | """
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WEST... |
amith01994/intellij-community | refs/heads/master | python/helpers/epydoc/docwriter/html.py | 89 | #
# epydoc -- HTML output generator
# Edward Loper
#
# Created [01/30/01 05:18 PM]
# $Id: html.py 1674 2008-01-29 06:03:36Z edloper $
#
"""
The HTML output generator for epydoc. The main interface provided by
this module is the L{HTMLWriter} class.
@todo: Add a cache to L{HTMLWriter.url()}?
"""
__docformat__ = 'epyt... |
bodi000/odoo | refs/heads/master | addons/email_template/tests/test_mail.py | 34 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
ropez/pytest | refs/heads/master | testing/test_assertion.py | 170 | # -*- coding: utf-8 -*-
import sys
import textwrap
import _pytest.assertion as plugin
import _pytest._code
import py
import pytest
from _pytest.assertion import reinterpret
from _pytest.assertion import util
PY3 = sys.version_info >= (3, 0)
@pytest.fixture
def mock_config():
class Config(object):
verbos... |
dekoza/django-getpaid | refs/heads/master | getpaid/__init__.py | 6 | default_app_config = 'getpaid.apps.Config'
def register_to_payment(*args, **kwargs):
"""
Thin proxy for actual register_to_payment to prevent uncontrolled early loading of models directory.
"""
from . import models
return models.register_to_payment(*args, **kwargs)
|
golismero/golismero-devel | refs/heads/master | thirdparty_libs/netaddr/fbsocket.py | 9 | #-----------------------------------------------------------------------------
# Copyright (c) 2008-2013, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""Fallback routines f... |
kevclarx/ansible | refs/heads/devel | lib/ansible/modules/storage/zfs/zpool_facts.py | 69 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the L... |
fancasy/final | refs/heads/master | lib/setuptools/utils.py | 540 | import os
import os.path
def cs_path_exists(fspath):
if not os.path.exists(fspath):
return False
# make absolute so we always have a directory
abspath = os.path.abspath(fspath)
directory, filename = os.path.split(abspath)
return filename in os.listdir(directory) |
cgstudiomap/cgstudiomap | refs/heads/develop | main/parts/partner-contact/partner_contact_department/__init__.py | 18 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
# © 2015 ... |
Curso-OpenShift/Formulario | refs/heads/master | OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/db/backends/sqlite3/client.py | 521 | import subprocess
from django.db.backends.base.client import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'sqlite3'
def runshell(self):
args = [self.executable_name,
self.connection.settings_dict['NAME']]
subprocess.call(args)
|
grow/grow | refs/heads/dependabot/npm_and_yarn/grow/ui/postcss-7.0.36 | grow/cache/document_cache_test.py | 2 | """Tests for the document cache."""
import unittest
from grow.cache import document_cache
from grow.pods import pods
from grow import storage
from grow.testing import testing
class DocumentCacheTestCase(unittest.TestCase):
def setUp(self):
dir_path = testing.create_test_pod_dir()
self.pod = pods... |
carolineLe/miasm | refs/heads/master | miasm/arch/mips32/regs.py | 4 | #-*- coding:utf-8 -*-
from builtins import range
from miasm.expression.expression import ExprId
from miasm.core.cpu import gen_reg, gen_regs
PC, _ = gen_reg('PC')
PC_FETCH, _ = gen_reg('PC_FETCH')
R_LO, _ = gen_reg('R_LO')
R_HI, _ = gen_reg('R_HI')
exception_flags = ExprId('exception_flags', 32)
PC_init = ExprId(... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/quickdoc/Param.py | 83 | def foo(name):
"""
Convert a string like a variable name into a slightly more human-friendly
string with spaces and capitalized letters.
@type name: C{str}
@param name: The name to convert to a label. This must be a string
which could be used as a Python identifier. Strings which do not take
... |
mph-/lcapy | refs/heads/master | lcapy/config.py | 1 | """This module contains configuration information.
Copyright 2019--2021 Michael Hayes, UCECE
"""
# SymPy symbols to exclude. It might be easier to add the ones we want...
excludes = ['I', 'C', 'O', 'S', 'N', 'E', 'E1', 'Q', 'beta', 'gamma', 'zeta',
'Le', 'Lt', 'Ge', 'Gt', 'Ci']
# Aliases for SymPy symb... |
scottherlihy/ChronosES | refs/heads/master | Chronos/EventLogger.py | 2 | #pylint: disable=W0212, W0702
"""@addtogroup PyInfrastructure
@{
"""
import logging
import os
import errno
import sys
import traceback
from datetime import datetime
import uuid
class EventLoggerException(Exception):
"""Singular exception to be thrown from EventLogger functions"""
pass
class LoggerLevel(object... |
jackTheRipper/iotrussia | refs/heads/master | web_server/lib/jinja2-master/jinja2/testsuite/api.py | 10 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.api
~~~~~~~~~~~~~~~~~~~~
Tests the public API and related stuff.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
import os
import tempfile
import shutil
from jinja2.testsuite import JinjaTestCase... |
carmark/vbox | refs/heads/master | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/String.py | 11 | ## @file
# This file is used to define common string related functions used in parsing process
#
# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies ... |
tyagi-prashant/letsencrypt | refs/heads/master | acme/acme/jose/b64.py | 66 | """JOSE Base64.
`JOSE Base64`_ is defined as:
- URL-safe Base64
- padding stripped
.. _`JOSE Base64`:
https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-37#appendix-C
.. Do NOT try to call this module "base64", as it will "shadow" the
standard library.
"""
import base64
import six
def b6... |
JeroenBosmans/nabu | refs/heads/master | nabu/neuralnetworks/classifiers/asr/reconstructors/audio_lstm_reconstructor_expanded.py | 1 | '''@file lstm_reconstructor.py
contains the LstmReconstructor class'''
import tensorflow as tf
import reconstructor
class AudioLstmReconstructor(reconstructor.Reconstructor):
def reconstruct(self, hlfeat, reconstructor_inputs, is_training):
'''
Create the reconstructed audio samples
This... |
pansapiens/mytardis | refs/heads/develop | tardis/tardis_portal/context_processors.py | 1 | from django.conf import settings
from tardis.tardis_portal.staging import get_full_staging_path
def single_search_processor(request):
context = {}
single_search_on = False
try:
if settings.SINGLE_SEARCH_ENABLED:
single_search_on = True
except AttributeError:
pass
cont... |
GbalsaC/bitnamiP | refs/heads/master | venv/lib/python2.7/site-packages/isodate/isoerror.py | 6 | ##############################################################################
# Copyright 2009, Gerhard Weis
# 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 ... |
zubair-arbi/edx-platform | refs/heads/master | common/test/acceptance/pages/studio/edit_subsection.py | 247 | """
Edit Subsection page in Studio
"""
from bok_choy.page_object import PageObject
class SubsectionPage(PageObject):
"""
Edit Subsection page in Studio
"""
def is_browser_on_page(self):
return self.q(css='body.view-subsection').present
|
rna-seq/grape.buildout | refs/heads/master | pipelines/BenchDM/benchmark.py | 1 | #!/usr/bin/env python
#
# $Id$
#
# Copyright (c) 2012, Maik Roeder.
#
# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Extends top.py from psutils/ to make a benchmark.
Author: Maik Roeder... |
floraXiao/gooderp_addons | refs/heads/master | auto_exchange/models/__init__.py | 6 | # -*- coding: utf-8 -*-
import auto_exchange
|
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/boto/sdb/db/query.py | 153 | from boto.compat import six
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# 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 limitat... |
cgar/servo | refs/heads/master | tests/wpt/css-tests/tools/py/py/_path/svnurl.py | 192 | """
module defining a subversion path object based on the external
command 'svn'. This modules aims to work with svn 1.3 and higher
but might also interact well with earlier versions.
"""
import os, sys, time, re
import py
from py import path, process
from py._path import common
from py._path import svnwc as svncommon... |
akashsinghal/Speech-Memorization-App | refs/heads/master | Python_Backend/lib/jinja2/idtracking.py | 130 | from jinja2.visitor import NodeVisitor
from jinja2._compat import iteritems
VAR_LOAD_PARAMETER = 'param'
VAR_LOAD_RESOLVE = 'resolve'
VAR_LOAD_ALIAS = 'alias'
VAR_LOAD_UNDEFINED = 'undefined'
def find_symbols(nodes, parent_symbols=None):
sym = Symbols(parent=parent_symbols)
visitor = FrameSymbolVisitor(sym)... |
tapomayukh/projects_in_python | refs/heads/master | sandbox_tapo/src/AI/RIP-2012/Project3/Code/exploreTest.py | 1 | import exploreRegion
limits = [[-4, -4], [4, 4]]
objects = exploreRegion.exploreRegion(limits, exploreRegion.runPath)
print(objects)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.