repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
hcasse/maat | refs/heads/master | make.py | 1 | #!/usr/bin/python
from maat import *
import maat.config as config
import maat.std as std
doc = goal("doc", ["doc/manual.thot"], "cd doc; ../../thot/thot.py manual.thot -DHTML_TEMPLATE=theme/template.html -DHTML_ONE_FILE_PER=chapter")
doc.DESCRIPTION = "Build the manual of Maat."
autodoc = goal("autodoc", [],
[
"mk... |
prestontunnellwilson/summer2013 | refs/heads/master | afterTestv2.py | 1 | #current as of 8/8/13
#most recent changes:
#general cleanup
#AFTER the first TESTING EDITION -> scratched that since cylinder wasn't showing up (accidentally put invisible in visibleArrowCylinder())
#ideas include: making an average leg angle for left and right legs
# to reduce jumps in trackers resulting in steps
#co... |
wbc2010/django1.2.5 | refs/heads/master | django1.2.5/django/contrib/databrowse/plugins/calendars.py | 62 | from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.contrib.databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
from django.utils.text import capfirst
from django.utils.encoding import force_unicode
from dja... |
vex1023/vxData | refs/heads/master | setup.py | 1 | from __future__ import print_function
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import vxData as source_packages
here = os.path.abspath(os.path.dirname(__file__))
# 包名称
name = 'vxData'
# 版本号从源代码包里获取
version = source_packages.__version__... |
shliujing/v2ex | refs/heads/master | mapreduce/lib/blobstore/__init__.py | 38 | #!/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... |
coldmind/django | refs/heads/master | tests/generic_views/test_base.py | 269 | from __future__ import unicode_literals
import time
import unittest
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import resolve
from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.utils import require_... |
huard/scipy-work | refs/heads/master | scipy/sparse/linalg/setupscons.py | 12 | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linalg',parent_package,top_path,
setup_name = 'setupscons.py')
config.add_subpackage(('isolve'))
config.add_subpackage(('dso... |
TkTech/pytextql | refs/heads/master | tests/test_overwrite.py | 1 | # -*- coding: utf-8 -*-
import os
import os.path
import sqlite3
import tempfile
import nose.tools as tools
from pytextql import core
@tools.raises(core.TableExists)
def test_overwrite_none():
"""
Ensure an error is raised if the table already exists in the
given database.
"""
try:
__, tm... |
sunqm/pyscf | refs/heads/master | pyscf/soscf/ciah.py | 1 | #!/usr/bin/env python
# Copyright 2014-2021 The PySCF Developers. 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
#
# U... |
YangSongzhou/django | refs/heads/master | tests/auth_tests/models/custom_permissions.py | 295 | """
The CustomPermissionsUser users email as the identifier, but uses the normal
Django permissions model. This allows us to check that the PermissionsMixin
includes everything that is needed to interact with the ModelBackend.
"""
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.con... |
ptroja/spark2014 | refs/heads/master | testsuite/gnatprove/tests/N228-005__update_multidim_unconstr_array_auto/test.py | 184 | from test_support import *
prove_all()
|
kvar/ansible | refs/heads/seas_master_2.9.5 | lib/ansible/modules/monitoring/statusio_maintenance.py | 92 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Benjamin Copeland (@bhcopeland) <ben@copeland.me.uk>
# 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_... |
lkeijser/stonevpn | refs/heads/master | StoneVPN/__init__.py | 1 | STONEVPN_VERSION = '0.4.16'
|
twobraids/crontabber | refs/heads/master | crontabber/tests/test_crontabber.py | 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/.
import re
import sys
import datetime
import time
import unittest
import collections
from cStringIO import StringIO
impo... |
milinbhakta/flaskjinja | refs/heads/master | flask1/Lib/site-packages/wheel/test/test_wheelfile.py | 238 | import wheel.install
import hashlib
try:
from StringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
import zipfile
import pytest
def test_verifying_zipfile():
if not hasattr(zipfile.ZipExtFile, '_update_crc'):
pytest.skip('No ZIP verification. Missing ZipExtFile._update_cr... |
KNNSpeed/hockeylauncher | refs/heads/master | Adafruit-Motor-HAT-Python-Library/build/lib.linux-armv6l-2.7/Adafruit_MotorHAT/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 ... |
SlimRemix/android_external_chromium_org | refs/heads/lp5.1 | third_party/markdown/extensions/meta.py | 109 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... |
dwcarder/sdn-ix-demo | refs/heads/master | exabgp-3.4.3/lib/exabgp/bgp/message/update/nlri/cidr.py | 3 | # encoding: utf-8
"""
prefix.py
Created by Thomas Mangin on 2013-08-07.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
import math
from exabgp.protocol.ip import IP
class CIDR (object):
EOR = False
# we can not define slots here as otherwise it conflict in Prefix
# __slots__ = ['packed','mask','_i... |
alfa-addon/addon | refs/heads/master | plugin.video.alfa/channels/supergoku.py | 1 | # -*- coding: utf-8 -*-
import sys
import re
import datetime
from bs4 import BeautifulSoup
from core.tmdb import Tmdb
from core import httptools, scrapertools, servertools, tmdb, jsontools
from core.scrapertools import unescape
from core.item import Item, InfoLabels
from platformcode import config, logger, platformtoo... |
openshift/openshift-tools | refs/heads/prod | ansible/roles/lib_openshift_3.2/build/lib/user.py | 13 | # pylint: skip-file
# pylint: disable=too-many-instance-attributes
class UserConfig(object):
''' Handle user options '''
# pylint: disable=too-many-arguments
def __init__(self,
namespace,
kubeconfig,
username,
full_name,
):... |
Kolyan-1/MSc-Thesis-Code | refs/heads/master | dev_profiling2.py | 1 | ######################################
#
# Nikolai Rozanov (C) 2017-Present
#
# nikolai.rozanov@gmail.com
#
#####################################
from Data.synthetic1 import blobs, gaussian, circle
from Utils.plotting import plot2D, plot2,plotfunc
from NP.Kernels.Kernels import GAUSSIAN_KERNEL
from NP.TESTS.HSIC ... |
dbckz/ansible | refs/heads/devel | lib/ansible/module_utils/pycompat24.py | 90 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
thispc/download-manager | refs/heads/master | module/plugins/hoster/X7To.py | 7 | # -*- coding: utf-8 -*-
from ..internal.DeadHoster import DeadHoster
class X7To(DeadHoster):
__name__ = "X7To"
__type__ = "hoster"
__version__ = "0.46"
__status__ = "stable"
__pattern__ = r'http://(?:www\.)?x7\.to/'
__config__ = [] # @TODO: Remove in 0.4.10
__description__ = """X7.to h... |
LukeC92/iris | refs/heads/latest | docs/iris/src/sphinxext/generate_package_rst.py | 14 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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) any l... |
Sorsly/subtle | refs/heads/master | google-cloud-sdk/platform/gsutil/third_party/rsa/rsa/__init__.py | 50 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... |
lancezlin/ml_template_py | refs/heads/master | lib/python2.7/site-packages/bleach/encoding.py | 32 | import datetime
from decimal import Decimal
import types
import six
def is_protected_type(obj):
"""Determine if the object instance is of a protected type.
Objects of protected types are preserved as-is when passed to
force_unicode(strings_only=True).
"""
return isinstance(obj, (
six.inte... |
Erotemic/ubelt | refs/heads/master | tests/test_import.py | 1 | # -*- coding: utf-8 -*-
import itertools as it
from os.path import join
import ubelt as ub
import sys
import pytest
from ubelt.util_import import PythonPathContext
def test_import_modpath_basic():
assert 'testmod' not in sys.modules
with ub.TempDir() as temp:
modpath = join(temp.dpath, 'testmod.py')
... |
robovm/robovm-studio | refs/heads/master | python/testData/inspections/PyMethodMayBeStaticInspection/trueNegative.py | 83 | __author__ = 'ktisha'
class Child(Base):
def f(self):
self.test = 1 |
af1rst/bite-project | refs/heads/master | deps/gdata-python-client/samples/apps/marketplace_sample/gdata/apps/emailsettings/client.py | 22 | #!/usr/bin/python2.4
#
# Copyright 2010 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 ... |
Anlim/decode-Django | refs/heads/master | Django-1.5.1/django/conf/locale/de/formats.py | 107 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y H:i:s'
YEAR_MONTH... |
sporkchops81/titleplant | refs/heads/master | modeltest.py | 1 | #!/bin/python
import model
import unittest
class People(unittest.TestCase):
def test_return_name(self):
name = 'William R Cunningham Jr'
man = model.Individual('William', 'R', 'Cunningham', 'Jr', 'M')
self.assertEqual(man.name(), name)
def test_return_shortname(self):
name =... |
wwj718/edx-video | refs/heads/master | lms/djangoapps/django_comment_client/tests/test_utils.py | 6 | from django.test import TestCase
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from django_comment_common.models import Role, Permission
from factories import RoleFactory
import django_comment_client.utils as utils
class DictionaryTestCase(TestCase):
def test_extract(self):
d = ... |
librato/librato-python-web | refs/heads/master | librato_python_web/tools/agent_config.py | 1 | # Copyright (c) 2015. Librato, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... |
all-of-us/raw-data-repository | refs/heads/devel | rdr_service/lib_fhir/fhirclient_1_0_6/models/identifier.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/Identifier) on 2016-06-23.
# 2016, SMART Health IT.
from . import element
class Identifier(element.Element):
""" An identifier intended for computation.
A technical identifier - id... |
eocasio/pyfpdf | refs/heads/master | tests/issue65.py | 18 | "Test issue 65: twitter.png error (urlopen, transparency, internal regex error)"
from fpdf import FPDF, FPDF_VERSION
pdf=FPDF()
pdf.compress = False
pdf.add_page()
png = "https://g.twimg.com/Twitter_logo_blue.png"
pdf.image(png, x = 15, y = 15)
fn = 'issue65.pdf'
pdf.output(fn,'F')
import os
try:
os.startfile(f... |
gnychis/gnuradio-3.5.0-dmr | refs/heads/master | gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py | 17 | #!/usr/bin/env python
#
# Copyright 2009 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 option)
... |
MarsZone/DreamLand | refs/heads/master | templates/example_cn/server/conf/settings.py | 2 | """
Evennia settings file.
The full options are found in the default settings file found here:
{EVENNIA_SETTINGS_DEFAULT}
{MUDDERY_SETTINGS_DEFAULT}
Note: Don't copy more from the default file than you actually intend to
change; this will make sure that you don't overload upstream updates
unnecessarily.
"""
# Use ... |
wakiyamap/electrum-mona | refs/heads/master | electrum_mona/gui/qt/watchtower_dialog.py | 1 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
arthurdejong/python-stdnum | refs/heads/master | stdnum/lu/__init__.py | 1 | # __init__.py - collection of Luxembourgian numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Lic... |
Resly/pipeline | refs/heads/master | jupyterhub.ml/notebooks/zz_old/TensorFlow/GoogleTraining/workshop_sections/transfer_learning/cloudml/setup.py | 4 | # Copyright 2016 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 law or a... |
JackDanger/sentry | refs/heads/master | tests/sentry/lang/native/test_applecrashreport.py | 1 | from __future__ import absolute_import
from sentry.lang.native.applecrashreport import AppleCrashReport
def test_get_threads_apple_string():
acr = AppleCrashReport(threads=[
{'crashed': True,
'current': True,
'id': 1,
'name': None,
'stacktrace': {'frames': [
{'... |
2014c2g23/2015cda-w17 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_testcapi.py | 742 |
CHAR_MAX = 127
CHAR_MIN = -128
DBL_MAX = 1.7976931348623157e+308
DBL_MIN = 2.2250738585072014e-308
FLT_MAX = 3.4028234663852886e+38
FLT_MIN = 1.1754943508222875e-38
INT_MAX = 2147483647
INT_MIN = -2147483648
LLONG_MAX = 9223372036854775807
LLONG_MIN = -9223372036854775808
LONG_MAX = 2147483647
LONG_MIN = -2... |
xiangel/hue | refs/heads/master | apps/rdbms/src/rdbms/conf.py | 1198 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
seankelly/buildbot | refs/heads/master | master/buildbot/worker/manager.py | 11 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
JuliaSprenger/python-odmltables | refs/heads/master | odmltables/gui/converterpages.py | 1 | # -*- coding: utf-8 -*-
import copy
import sys
import os
import subprocess
import xlwt
from future.utils import iteritems
from PyQt5.QtCore import Qt
import PyQt5.QtWidgets as Qtw
import PyQt5.QtGui as Qtg
from .pageutils import QIWizardPage, clearLayout, get_property, get_rgb, shorten_path
from odmltables import od... |
freedomtan/tensorflow | refs/heads/master | tensorflow/python/training/saver_test.py | 8 | # 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... |
tobiasgehring/qudi | refs/heads/master | gui/manager/threadwidget.py | 7 | # -*- coding: utf-8 -*-
"""
This file contains the Qudi remote widget class.
Qudi 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.
Qudi is d... |
davygeek/vitess | refs/heads/master | test/mysql_server_test.py | 4 | #!/usr/bin/env python
#
# Copyright 2017 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 la... |
thaumos/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/_ec2_ami_find.py | 29 | #!/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': ['removed'],
... |
log2timeline/dfvfs | refs/heads/main | tests/vfs/encrypted_stream_file_entry.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the encrypted stream file entry implementation."""
import unittest
from dfvfs.lib import definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import context
from dfvfs.resolver import resolver
from dfvfs.vfs import encrypted_str... |
sumanthha/fundafriend | refs/heads/master | django/conf/urls/i18n.py | 97 | from django.conf import settings
from django.conf.urls import patterns
from django.core.urlresolvers import LocaleRegexURLResolver
def i18n_patterns(prefix, *args):
"""
Adds the language code prefix to every URL pattern within this
function. This may only be used in the root URLconf, not in an included
... |
toontownfunserver/Panda3D-1.9.0 | refs/heads/master | direct/distributed/CartesianGridBase.py | 11 | from pandac.PandaModules import Vec3
# Utility functions that are useful to both AI and client CartesianGrid code
class CartesianGridBase:
def isValidZone(self, zoneId):
def checkBounds(self=self, zoneId=zoneId):
if ((zoneId < self.startingZone) or
(zoneId > self.startingZone + ... |
Grassboy/plugin.video.plurkTrend | refs/heads/master | youtube_dl/extractor/auengine.py | 2 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
determine_ext,
ExtractorError,
)
class AUEngineIE(InfoExtractor):
_TEST = {
'url': 'http://auengine.com/embed.php?file=lfvlytY6&w=650&h=370',
'file': 'lfvlyt... |
tanmaykm/edx-platform | refs/heads/master | openedx/core/djangoapps/content/course_overviews/migrations/0009_readd_facebook_url.py | 58 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models, connection
def table_description():
"""Handle Mysql/Pg vs Sqlite"""
# django's mysql/pg introspection.get_table_description tries to select *
# from table and fails during initial migrations from scra... |
dcalacci/love-in-the-time-of-communism | refs/heads/master | src/stats.py | 1 | #!usr/bin/env python
import math, nltk.data, os
from nltk.tokenize.punkt import PunktWordTokenizer
from testimonyUtils import get_speech_acts
def get_sens_from_speechact(speechact):
tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')
return tokenizer.tokenize(speechact)
def get_tokens_from_speecha... |
wanghaven/readthedocs.org | refs/heads/master | readthedocs/core/management/commands/reindex_elasticsearch.py | 26 | import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
from readthedocs.builds.constants import LATEST
from readthedocs.builds.models import Version
from readthedocs.search import parse_json
from readthedocs.restapi.utils import index_searc... |
fu012343210/pokeminer | refs/heads/master | web.py | 1 | # -*- coding: utf-8 -*-
from datetime import datetime
import argparse
import json
import requests
from flask import Flask, request, render_template
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import config
import db
import utils
from names import POKEMON_NAMES
requests.packages.urllib3.di... |
rapilabs/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex/3_squashed_5.py | 770 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("migrations", "3_auto"),
("migrations", "4_auto"),
("migrations", "5_auto"),
]
dependencies = [("migrations", "2_auto")]
ope... |
LeslieW/or-tools2 | refs/heads/master | examples/python/pyls_api.py | 30 | from ortools.constraint_solver import pywrapcp
from google.apputils import app
import gflags
import random
class OneVarLns(pywrapcp.PyLns):
"""One Var LNS."""
def __init__(self, vars):
pywrapcp.PyLns.__init__(self, vars)
self.__index = 0
def InitFragments(self):
self.__index = 0
def NextFragment... |
googleapis/python-workflows | refs/heads/master | google/cloud/workflows_v1/services/workflows/transports/grpc.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... |
atdaemon/pip | refs/heads/master | pip/__main__.py | 834 | from __future__ import absolute_import
import os
import sys
# If we are running from a wheel, add the wheel to sys.path
# This allows the usage python pip-*.whl/pip install pip-*.whl
if __package__ == '':
# __file__ is pip-*.whl/pip/__main__.py
# first dirname call strips of '/__main__.py', second strips off ... |
pschmitt/home-assistant | refs/heads/dev | homeassistant/components/serial_pm/sensor.py | 16 | """Support for particulate matter sensors connected to a serial port."""
import logging
from pmsensor import serial_pm as pm
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONF_NAME
import homeassistant.hel... |
andsor/gridjug | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for gridjug.
This file was generated with PyScaffold 2.2.1, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
"""
import inspect
import os
import sys
from distutils.cmd im... |
ssvsergeyev/ZenPacks.zenoss.AWS | refs/heads/develop | ZenPacks/zenoss/AWS/EC2VPCSubnet.py | 1 | ##############################################################################
#
# Copyright (C) Zenoss, Inc. 2013, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
#####################################... |
Tjorriemorrie/trading | refs/heads/master | 21_gae_kelly/binary/models.py | 2 | from google.appengine.ext import ndb
CURRENCIES = ['EURUSD']
TIME_FRAMES = ['5', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55', '60']
# TIME_FRAMES = ['1']
TRADE_BASES = ['payout', 'directional']
TRADE_AIMS = ['higher', 'lower']
class Q(ndb.Model):
data = ndb.PickleProperty(compressed=False)
... |
kdwink/intellij-community | refs/heads/master | python/testData/inspections/PyPep8NamingInspection/importLowerAsNonLower.py | 74 | from x import y as <weak_warning descr="Lowercase variable imported as non lowercase">TEST</weak_warning>
|
buntyke/Flask | refs/heads/master | microblog/flask/lib/python2.7/site-packages/markupsafe/_compat.py | 864 | # -*- coding: utf-8 -*-
"""
markupsafe._compat
~~~~~~~~~~~~~~~~~~
Compatibility module for different Python versions.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY2 = sys.version_info[0] == 2
if not PY2:
text_type = str
string_type... |
steveYeah/amqpeek | refs/heads/master | tests/unit/cli/test_format_queues.py | 1 | """Tests for the correct reading of the queue config."""
from copy import deepcopy
from amqpeek.cli import build_queue_data
class TestFormatQueues:
"""Tests parsing of queue config."""
def test_dedup_queue_config(self, config_data: dict) -> None:
"""Tests handling of duplicate config entries in diff... |
noironetworks/horizon | refs/heads/master | openstack_auth/user.py | 1 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/refactoring/move/relativeImportsInsideMovedModule/before/src/pkg1/subpkg1/mod1.py | 79 | from .. import subpkg2
from ..subpkg2 import mod2
from ..subpkg2.mod2 import VAR
from . import mod3
# malformed imports
from
from import
from ..subpkg2 import
# absolute imports
import pkg1.subpkg2 as foo
from pkg1 import subpkg2 as bar
print(subpkg2, mod3, mod2, foo, bar, VAR)
|
40223114/0519 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_dummy_thread.py | 742 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... |
chand3040/sree_odoo | refs/heads/master | openerp/addons/auth_openid/controllers/__init__.py | 443 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
DaniilLeksin/theblog | refs/heads/master | env/lib/python2.7/site-packages/django/conf/locale/mk/formats.py | 43 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATE... |
Teamxrtc/webrtc-streaming-node | refs/heads/master | third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/gslib/commands/cat.py | 32 | # -*- coding: utf-8 -*-
# Copyright 2011 Google Inc. All Rights Reserved.
# Copyright 2011, Nexenta Systems 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/... |
venicegeo/eventkit-cloud | refs/heads/master | eventkit_cloud/tasks/migrations/migrations_pre_1_2_4/0023_auto_20170825_1416.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-25 14:16
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tasks', '0022_auto_20170802_1234'),
]
operations = [
migrations.AlterField(
model_name='e... |
conorpp/napkis | refs/heads/master | napkis/deployment/python2.7/django/db/backends/postgresql_psycopg2/version.py | 331 | """
Extracts the version of the PostgreSQL server.
"""
import re
# This reg-exp is intentionally fairly flexible here.
# Needs to be able to handle stuff like:
# PostgreSQL 8.3.6
# EnterpriseDB 8.3
# PostgreSQL 8.3 beta4
# PostgreSQL 8.4beta1
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
def _parse_... |
cesarmarinhorj/ansible | refs/heads/devel | test/units/plugins/action/test_add_host.py | 28 | import unittest
from ansible.plugins.action import add_host
class TestAddHost(unittest.TestCase):
def test_hostname(self):
host, port = add_host._parse_ip_host_and_port('some-remote-host')
assert host == 'some-remote-host'
assert port is None
def test_hostname_with_port(self):
... |
caioariede/django-pipeline | refs/heads/master | pipeline/compressors/closure.py | 47 | from __future__ import unicode_literals
from pipeline.conf import settings
from pipeline.compressors import SubProcessCompressor
class ClosureCompressor(SubProcessCompressor):
def compress_js(self, js):
command = '%s %s' % (settings.PIPELINE_CLOSURE_BINARY, settings.PIPELINE_CLOSURE_ARGUMENTS)
re... |
UOMx/edx-platform | refs/heads/master | openedx/core/djangoapps/common_views/xblock.py | 33 | """
Common views dedicated to rendering xblocks.
"""
from __future__ import absolute_import
import logging
import mimetypes
import pkg_resources
from xblock.core import XBlock
from django.conf import settings
from django.http import Http404, HttpResponse
log = logging.getLogger(__name__)
def xblock_resource(requ... |
1900/pyspider | refs/heads/master | scheduler/__init__.py | 7 | from scheduler import Scheduler
|
2014c2g5/2014c2 | refs/heads/master | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/pprint.py | 96 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-desc... |
olegnev/dx-toolkit | refs/heads/master | src/python/dxpy/templating/__init__.py | 2 | # Copyright (C) 2013-2015 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... |
ericzhou2008/zulip | refs/heads/master | confirmation/util.py | 126 | # -*- coding: utf-8 -*-
# Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com>
__revision__ = '$Id: util.py 3 2008-11-18 07:33:52Z jarek.zgoda $'
from django.conf import settings
def get_status_field(app_label, model_name):
model = '%s.%s' % (app_label, model_name)
mapping = getattr(settings, 'STATUS_FI... |
seken/nink | refs/heads/master | pyglet/libs/x11/xinerama.py | 46 | '''Wrapper for Xinerama
Generated with:
tools/genwrappers.py xinerama
Do not modify this file.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xinerama')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64')... |
aescwork/sqlitemgr | refs/heads/master | tests/delete_table_test.py | 1 |
import unittest
import os
import sys
sys.path.append("../sqlitemgr/")
import sqlitemgr as sqm
class DeleteTableTest(unittest.TestCase):
"""
Test if delete_table was successful by checking if the name of the target table is in the
list returned by executing "SELECT name FROM sqlite_master WHERE type='table'" again... |
luotao1/Paddle | refs/heads/develop | python/paddle/distributed/fleet/meta_optimizers/recompute_optimizer.py | 1 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
chengduoZH/Paddle | refs/heads/develop | python/paddle/fluid/tests/unittests/test_generate_proposal_labels_op.py | 2 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
openzim/zimfarm | refs/heads/master | dispatcher/backend/src/tests/integration/routes/languages/test_language.py | 1 | import pytest
class TestLanguagesList:
def test_list_languages_no_param(self, client, schedules):
"""Test list languages"""
url = "/languages/"
response = client.get(url)
assert response.status_code == 200
response_json = response.get_json()
assert "items" in resp... |
kumarrus/voltdb | refs/heads/master | lib/python/voltcli/voltdb.d/compile.py | 7 | # This file is part of VoltDB.
# Copyright (C) 2008-2015 VoltDB Inc.
#
# This file contains original code and/or modifications of original code.
# Any modifications made by VoltDB Inc. are licensed under the following
# terms and conditions:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a... |
lenw/ansible-modules-core | refs/heads/devel | cloud/rackspace/rax_cdb_database.py | 157 | #!/usr/bin/python -tt
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distrib... |
ojengwa/oh-mainline | refs/heads/master | vendor/packages/Django/tests/regressiontests/templates/filters.py | 52 | # coding: utf-8
"""
Tests for template filters (as opposed to template tags).
The tests are hidden inside a function so that things like timestamps and
timezones are only evaluated at the moment of execution and will therefore be
consistent.
"""
from __future__ import unicode_literals
from datetime import date, datet... |
kalxas/QGIS | refs/heads/master | python/plugins/db_manager/db_manager_plugin.py | 31 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... |
EIT-ICT-RICH/ns-3-dev-TSCH | refs/heads/master | src/wifi/bindings/modulegen__gcc_ILP32.py | 2 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
fener06/pyload | refs/heads/master | module/plugins/hoster/QuickshareCz.py | 1 | # -*- coding: utf-8 -*-
"""
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 option) any later version.
This program is distributed in ... |
jillesme/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/analyzechangelog.py | 122 | # Copyright (c) 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 of conditions and the ... |
sproutcoin/sprouts | refs/heads/master | share/qt/extract_strings_qt.py | 1294 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by xgettext.
Ret... |
mhuwiler/rootauto | refs/heads/mhuwiler | interpreter/llvm/src/tools/clang/utils/ClangDataFormat.py | 133 | """lldb data formatters for clang classes.
Usage
--
import this file in your ~/.lldbinit by adding this line:
command script import /path/to/ClangDataFormat.py
After that, instead of getting this:
(lldb) p Tok.Loc
(clang::SourceLocation) $0 = {
(unsigned int) ID = 123582
}
you'll get:
(lldb) p Tok.Loc
(clang::S... |
40223136/20150616test1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/spur.py | 184 | #coding: utf-8
import math
# 導入數學函式後, 圓周率為 pi
# deg 為角度轉為徑度的轉換因子
deg = math.pi/180.
class Spur(object):
def __init__(self, ctx):
self.ctx = ctx
def create_line(self, x1, y1, x2, y2, width=3, fill="red"):
self.ctx.beginPath()
self.ctx.lineWidth = width
self.ctx.moveTo(x1, y1)
... |
shlomif/PySolFC | refs/heads/master | pysollib/games/grandfathersclock.py | 1 | #!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwa... |
showliu/android_kernel_xiaomi_aries-1 | refs/heads/cm-12.1 | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.