repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
AmrThabet/CouchPotatoServer | refs/heads/master | libs/suds/reader.py | 203 | # 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 ... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/twilio/__init__.py | 15 | """Support for Twilio."""
from twilio.rest import Client
from twilio.twiml import TwiML
import voluptuous as vol
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.helpers import config_entry_flow
import homeassistant.helpers.config_validation as cv
from .const import DOMAIN
CONF_ACCOUNT_SID = "accou... |
kennedyshead/home-assistant | refs/heads/dev | homeassistant/components/hue/sensor.py | 2 | """Hue sensor entities."""
from aiohue.sensors import (
TYPE_ZLL_LIGHTLEVEL,
TYPE_ZLL_ROTARY,
TYPE_ZLL_SWITCH,
TYPE_ZLL_TEMPERATURE,
)
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_ILLUMINAN... |
FFMG/myoddweb.piger | refs/heads/master | monitor/api/python/Python-3.7.2/Tools/pynche/pyColorChooser.py | 116 | """Color chooser implementing (almost) the tkColorColor interface
"""
import os
import Main
import ColorDB
class Chooser:
"""Ask for a color"""
def __init__(self,
master = None,
databasefile = None,
initfile = None,
ignore = None,
... |
pmghalvorsen/gramps_branch | refs/heads/master | gramps/gen/plug/menu/_boolean.py | 13 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Gary Burton
#
# 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 v... |
beagles/neutron_hacking | refs/heads/neutron_oslo_messaging | neutron/services/firewall/agents/varmour/__init__.py | 267 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... |
tjghs/ghs-tracker | refs/heads/dependabot/pip/django-1.11.29 | ghswebsite/apps/hours/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
40323226/26 | refs/heads/master | static/plugin/liquid_tags/mdx_liquid_tags.py | 281 | """
Markdown Extension for Liquid-style Tags
----------------------------------------
A markdown extension to allow user-defined tags of the form::
{% tag arg1 arg2 ... argn %}
Where "tag" is associated with some user-defined extension.
These result in a preprocess step within markdown that produces
either markdo... |
tinkerinestudio/Tinkerine-Suite | refs/heads/master | TinkerineSuite/python/Lib/ctypes/macholib/dylib.py | 268 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
Generic dylib path manipulation
"""
import re
__all__ = ['dylib_info']
DYLIB_RE = re.compile(r"""(?x... |
dekadev/Deka-kernel-CM10.1-3.0 | refs/heads/master | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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.
#
# This program i... |
clumsy/intellij-community | refs/heads/master | python/testData/inspections/GoogleDocStringAddKeywordVararg.py | 53 | def f(**kwa<caret>rgs):
"""
""" |
mahak/ansible | refs/heads/devel | test/lib/ansible_test/_internal/commands/env/__init__.py | 13 | """Show information about the test environment."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import datetime
import functools
import os
import platform
import signal
import sys
import time
from ...config import (
CommonConfig,
TestConfig,
)
from ...io import (
... |
xiandiancloud/edx-platform-Y | 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
|
ephes/scikit-learn | refs/heads/master | examples/model_selection/plot_underfitting_overfitting.py | 230 | """
============================
Underfitting vs. Overfitting
============================
This example demonstrates the problems of underfitting and overfitting and
how we can use linear regression with polynomial features to approximate
nonlinear functions. The plot shows the function that we want to approximate,
wh... |
chauhanmohit/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/test/finder.py | 157 | # Copyright (C) 2012 Google, Inc.
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# 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
# n... |
martinohanlon/pelmetcam | refs/heads/master | pelmetcam.py | 1 | #Pelmetcam - software for my raspberry pi powered helmet cam
from GPSController import *
from tempSensorController import *
from createDataOverlay import *
import RPi.GPIO as GPIO
import picamera
import time
import datetime
import threading
import os
import argparse
# constants
VIDEOFPS = 25
VIDEOHEIGHT = 1080
VIDEOWI... |
pratikkohli/FLASK_DEMO | refs/heads/master | db_downgrade.py | 103 | #!flask/bin/python
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
api.downgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, v - 1)
v = api.db_version(SQLALCHEMY_DATABASE_U... |
HydrelioxGitHub/home-assistant | refs/heads/dev | homeassistant/components/deconz/switch.py | 3 | """Support for deCONZ switches."""
from homeassistant.components.switch import SwitchDevice
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import DOMAIN as DECONZ_DOMAIN, NEW_LIGHT, POWER_PLUGS, SIRENS
from .deconz_device import DeconzDevice
D... |
UManPychron/pychron | refs/heads/develop | pychron/loggable.py | 2 | #!/usr/bin/python
# ===============================================================================
# Copyright 2011 Jake Ross
#
# 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... |
clouddocx/boto | refs/heads/master | boto/file/simpleresultset.py | 264 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... |
Manishearth/servo | refs/heads/master | tests/wpt/css-tests/tools/webdriver/webdriver/alert.py | 263 | """WebDriver alert handling."""
class Alert(object):
"""Class that provides access to the WebDriver alert handling functions."""
def __init__(self, driver):
self._driver = driver
def _execute(self, method, path, name, body=None):
return self._driver.execute(method, path, name, body)
... |
woutervanwijk/mopidy | refs/heads/develop | tests/config/test_config.py | 1 | # encoding: utf-8
from __future__ import unicode_literals
import unittest
import mock
from mopidy import config
from tests import path_to_data_dir
class LoadConfigTest(unittest.TestCase):
def test_load_nothing(self):
self.assertEqual({}, config._load([], [], []))
def test_load_single_default(sel... |
r-mart/scikit-learn | refs/heads/master | sklearn/datasets/samples_generator.py | 103 | """
Generate samples of synthetic data sets.
"""
# Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel,
# G. Louppe, J. Nothman
# License: BSD 3 clause
import numbers
import array
import numpy as np
from scipy import linalg
import scipy.sparse as sp
from ..preprocessing import MultiLabelBin... |
guillermooo/dart-sublime-bundle | refs/heads/master | tests/sublime_plugin_lib/test_collections.py | 2 | # Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details.
# 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
import os
from Dart.sublime_plugin_lib.collections import CircularArray
class Test_Circu... |
jeboo/kernel_KK_i9505_NB8 | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/lib/django-0.96/django/db/backends/mysql_old/client.py | 38 | from django.conf import settings
import os
def runshell():
args = ['']
args += ["--user=%s" % settings.DATABASE_USER]
if settings.DATABASE_PASSWORD:
args += ["--password=%s" % settings.DATABASE_PASSWORD]
if settings.DATABASE_HOST:
args += ["--host=%s" % settings.DATABASE_HOST]
if se... |
Ritsyy/fjord | refs/heads/master | vendor/packages/polib-1.0.7/docs/conf.py | 10 | # -*- coding: utf-8 -*-
#
# polib documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 1 16:45:49 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... |
azoft-dev-team/imagrium | refs/heads/win | libs/sikuli/Env.py | 2 | # Copyright 2010-2013, Sikuli.org
# Released under the MIT License.
from org.sikuli.basics import HotkeyListener
from org.sikuli.basics import HotkeyManager
from org.sikuli.script import Env as JEnv
class Env(JEnv):
@classmethod
def addHotkey(cls, key, modifiers, handler):
class AnonyListener(HotkeyLi... |
0x000000FF/yocto-mostfun-pro | refs/heads/master | lib/oe/package.py | 1 | def runstrip(arg):
# Function to strip a single file, called from split_and_strip_files below
# A working 'file' (one which works on the target architecture)
#
# The elftype is a bit pattern (explained in split_and_strip_files) to tell
# us what type of file we're processing...
# 4 - executable
... |
ownport/filetools | refs/heads/master | src/filetools/cleaner.py | 1 |
import os
import logging
from filetools.utils import scan_files
from filetools.libs.tabulate import tabulate
logger = logging.getLogger(__name__)
class Cleaner:
def __init__(self, path:str) -> None:
self._path = path
def use_lower_case_in_file_ext(self, force:bool=False):
''' apply rule:... |
jnewland/home-assistant | refs/heads/ci | homeassistant/components/dublin_bus_transport/__init__.py | 36 | """The dublin_bus_transport component."""
|
xfournet/intellij-community | refs/heads/master | python/testData/refactoring/extractsuperclass/withSuper.after.py | 83 | class Suppa(object):
def foo(self):
print "bar"
class Foo(Suppa):
def bar(self):
print "foo"
|
wonder-sk/inasafe | refs/heads/develop | safe/impact_reports/test/__init__.py | 25 | __author__ = 'Christian Christelis <christian@kartoza.com>'
|
MartynShaw/audacity | refs/heads/master | lib-src/lv2/serd/waflib/Tools/fc.py | 276 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re
from waflib import Utils,Task,TaskGen,Logs
from waflib.Tools import ccroot,fc_config,fc_scan
from waflib.TaskGen import feature,before_method,after_method,extension
... |
jruiperezv/ANALYSE | refs/heads/master | lms/djangoapps/certificates/tests/factories.py | 6 | from factory.django import DjangoModelFactory
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from certificates.models import GeneratedCertificate, CertificateStatuses
# Factories don't have __init__ methods, and are self documenting
# pylint: disable=W0232
class GeneratedCertificateFactory(DjangoMode... |
kaday/rose | refs/heads/master | lib/python/rose/config_editor/valuewidget/__init__.py | 1 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-6 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
ColOfAbRiX/ansible | refs/heads/devel | lib/ansible/modules/system/sysctl.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, David "DaviXX" CHANIAL <david.chanial@gmail.com>
# (c) 2014, James Tanner <tanner.jc@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 ... |
analurandis/Tur | refs/heads/master | backend/venv/Lib/site-packages/gitdb/exc.py | 7 | # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Module with common exceptions"""
from gitdb.util import to_hex_sha
class ODBError(Exception):
"""All ... |
Lujeni/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_encap_pool_range.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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'],
... |
dzhuang/django-jfu | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
from os.path import dirname
import jfu
setup(
name = 'django-%s' % jfu.__prog__,
version = jfu.__version__,
author = jfu.__author__,
author_email = "alem@cidola.com",
description = jfu.__desc__,
license = jfu.__licence__,
keywords = ... |
barnsnake351/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/legacy_v2/extensions/foxinsocks.py | 103 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
MahdiZareie/event-recorder | refs/heads/develop | event/apps.py | 8 | from django.apps import AppConfig
class EventConfig(AppConfig):
name = 'event'
|
iwalz/zendserverapi | refs/heads/master | docs/conf.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Zend Server API documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 24 01:33:37 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in thi... |
fly19890211/edx-platform | refs/heads/master | lms/djangoapps/course_wiki/editors.py | 101 | from django import forms
from django.forms.util import flatatt
from django.utils.encoding import force_unicode
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from wiki.editors.base import BaseEditor
from wiki.editors.m... |
taion/flask-jsonapiview | refs/heads/master | example/routes.py | 3 | # example/routes.py
from flask_resty import Api
from . import app, views
api = Api(app, prefix="/api")
api.add_resource("/authors/", views.AuthorListView, views.AuthorView)
api.add_resource("/books/", views.BookListView, views.BookView)
api.add_ping("/ping/")
|
flyher/pymo | refs/heads/master | android/pgs4a-0.9.6/python-install/lib/python2.7/ctypes/macholib/dylib.py | 268 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
Generic dylib path manipulation
"""
import re
__all__ = ['dylib_info']
DYLIB_RE = re.compile(r"""(?x... |
osiell/server-tools | refs/heads/8.0 | base_search_fuzzy/__openerp__.py | 9 | # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': "Fuzzy Search",
'summary': "Fuzzy search with the PostgreSQL trigram extension",
'category': 'Uncategorized',
'version': '8.0.1.0.0',
'website': 'https://odoo-community.org/',
'author': 'bloopark sy... |
murvet/dictionary | refs/heads/master | dictionary/utils.py | 1 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
class TimeStampModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True, verbose_name=_("Oluşturulma Zamanı"))
updated_at =... |
sedurzu/ildeposito.org | refs/heads/master | sites/all/modules/contrib/proj4js/lib/proj4js/tools/closure.py | 209 | import sys
import os
import tempfile
path = "../tools/closure-compiler.jar"
if not os.path.exists(path):
raise Exception("No closure-compiler.jar at %s; read README.txt!" % path)
def minimize(code):
ntf = tempfile.NamedTemporaryFile(delete=False)
ntf.write(code)
ntf.flush()
ntf2 = tempfile.NamedT... |
tmimori/erpnext | refs/heads/develop | erpnext/patches/v5_0/capacity_planning.py | 24 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
frappe.reload_doc("stock", "doctype", "stock_entry")
if "total_fixed_cost" in frappe.db.get_table_columns("Stock Entry"):
frappe.db.sql("update `tabStock Entr... |
tinfoil/phantomjs | refs/heads/master | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/descriptor.py | 260 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
vipulkanade/EventbriteDjango | refs/heads/master | lib/python2.7/site-packages/wheel/test/__init__.py | 2268 | # |
IamRafy/numibot | refs/heads/master | plugins/simsimi.py | 2 | from libs import request
def matches(text):
return text
def raw(m):
return request.ajax('http://www.simsimi.com/requestChat?lc=en&ft=1.0&req=' + request.quote_plus(m.get('text')))
def query(m):
results = raw(m)
if results:
reply = results.get('res')
if not reply:
retu... |
kwlzn/pants | refs/heads/master | src/python/pants/backend/jvm/subsystems/jar_dependency_management.py | 5 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from ... |
rajat1994/scikit-learn | refs/heads/master | sklearn/preprocessing/tests/test_data.py | 113 | import warnings
import numpy as np
import numpy.linalg as la
from scipy import sparse
from distutils.version import LooseVersion
from sklearn.utils.testing import assert_almost_equal, clean_warning_registry
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal... |
beni55/django-haystack | refs/heads/master | haystack/indexes.py | 5 | import copy
import threading
import sys
from django.db.models import signals
from django.utils.encoding import force_unicode
from haystack import connections, connection_router
from haystack.constants import ID, DJANGO_CT, DJANGO_ID, Indexable, DEFAULT_ALIAS
from haystack.fields import *
from haystack.utils import get_... |
jbn/pathsjson | refs/heads/master | pathsjson/path.py | 1 | import os
class Path:
def __init__(self, path, arg_names=None, defaults=None):
self._path = path
self._arg_names = tuple([] if arg_names is None else arg_names)
self._defaults = tuple([] if defaults is None else defaults)
@property
def path(self):
return self._path
@... |
hthompson6/contrail-controller | refs/heads/master | src/config/common/importutils.py | 18 | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
chhans/tor-automation | refs/heads/master | capture.py | 1 | from selenium import webdriver
from torProfile import TorProfile
from pyvirtualdisplay import Display
import selenium
from random import randint
import subprocess
import os
import signal
import sys
import time
training_data = "Dumps/training/"
experiment_data = "Dumps/experiment/"
iface = "eth1"
sleep_time = 2.0
load... |
alexeyum/scikit-learn | refs/heads/master | sklearn/linear_model/stochastic_gradient.py | 34 | # Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
from abc import ABCMeta, abstractmethod
from ..externals.joblib import ... |
rmehta/erpnext | refs/heads/develop | erpnext/accounts/doctype/c_form_invoice_detail/__init__.py | 37694 | from __future__ import unicode_literals
|
suyashphadtare/sajil-erp | refs/heads/develop | erpnext/setup/doctype/authorization_rule/__init__.py | 37694 | from __future__ import unicode_literals
|
scipy/scipy | refs/heads/master | scipy/optimize/_linprog_util.py | 12 | """
Method agnostic utility functions for linear progamming
"""
import numpy as np
import scipy.sparse as sps
from warnings import warn
from .optimize import OptimizeWarning
from scipy.optimize._remove_redundancy import (
_remove_redundancy_svd, _remove_redundancy_pivot_sparse,
_remove_redundancy_pivot_dense, ... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.0/Lib/test/test_minidom.py | 3 | # test for xml.dom.minidom
import os
import sys
import pickle
from test.support import verbose, run_unittest, TestSkipped
import unittest
import xml.dom
import xml.dom.minidom
import xml.parsers.expat
from xml.dom.minidom import parse, Node, Document, parseString
from xml.dom.minidom import getDOMImplementation
if... |
CiscoSystems/quantum | refs/heads/master | neutron/plugins/cisco/common/cisco_faults.py | 24 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, 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... |
thaumos/ansible | refs/heads/devel | lib/ansible/modules/remote_management/lxca/lxca_cmms.py | 22 | #!/usr/bin/python
# 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',
'supported_by': 'community',
'status': ['preview']
}
... |
andrewosh/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes/hooks/hooks.py | 99 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
alexmandujano/django | refs/heads/master | django/contrib/gis/db/models/sql/query.py | 209 | from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
from django.contri... |
ghdk/networkx | refs/heads/master | networkx/readwrite/edgelist.py | 30 | """
**********
Edge Lists
**********
Read and write NetworkX graphs as edge lists.
The multi-line adjacency list format is useful for graphs with nodes
that can be meaningfully represented as strings. With the edgelist
format simple edge data can be stored but node or graph data is not.
There is no way of representin... |
Konjkov/pyquante2 | refs/heads/master | tests/test_dft.py | 1 | import unittest
import numpy as np
from pyquante2 import basisset, molecule
from pyquante2.dft.functionals import xs,cvwn5,xb88,xpbe,clyp,cpbe
from pyquante2.dft.reference import data
from pyquante2.scf.hamiltonians import dft
try:
import pylab as pyl
have_pylab = True
except:
have_pylab = False
def aamax... |
catapult-project/catapult-csm | refs/heads/master | third_party/WebOb/webob/util.py | 21 | import warnings
from webob.compat import (
escape,
string_types,
text_,
text_type,
)
from webob.headers import _trans_key
def html_escape(s):
"""HTML-escape a string or object
This converts any non-string objects passed into it to strings
(actually, using ``unicode()``). All values ... |
RoboMod/web-software-manager | refs/heads/master | softwares/phpmyadmin.py | 1 | from software import Software
import helpers
import os
class phpMyAdmin(Software):
def __init__(self):
self.github_repo = "phpmyadmin/phpmyadmin"
def check(self, directory):
return False
def getConfig(self, directory):
return None
def update(self, directory):
return ... |
gfreed/android_external_chromium-org | refs/heads/android-4.4 | chrome/test/functional/prefs_ui.py | 63 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
import pyauto_functional # Must be imported before pyauto
import pyauto
import test_utils
from webdriver_pages impor... |
saai/LeetcodePythonSolutions | refs/heads/master | divideAndConquer/getSkyline.py | 2 | from heapq import *
class Solution(object):
def getSkyline(self, buildings):
"""
:type buildings: List[List[int]]
:rtype: List[List[int]]
"""
skyline = []
i = 0
n = len(buildings)
liveHR = []
while(i<n or liveHR):
print liveHR
... |
jianghaolu/AutoRest | refs/heads/master | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/auto_rest_parameterized_custom_host_test_client/models/__init__.py | 510 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
Venturi/cms | refs/heads/master | env/lib/python2.7/site-packages/phonenumbers/geodata/data12.py | 2 | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2015 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... |
muntasirsyed/intellij-community | refs/heads/master | python/helpers/pycharm/django_manage_commands_provider/_parser/parser.py | 40 | # coding=utf-8
"""
Exports data from optparse or argparse based manage.py commands and reports it to _xml.XmlDumper.
This module encapsulates Django semi-public API knowledge, and not very stable because of it.
"""
from django.core.exceptions import ImproperlyConfigured
from django.core.management import ManagementUtil... |
trondeau/gnuradio | refs/heads/master | grc/gui/Element.py | 22 | """
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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... |
uwbmrb/BMRB-API | refs/heads/master | server/wsgi/bmrbapi/schemas/internal.py | 1 | from marshmallow import Schema
__all__ = ['FaviconInternal', 'RefreshUniprotInternal']
class FaviconInternal(Schema):
pass
class RefreshUniprotInternal(Schema):
pass
|
SVADemoAPP/AmqpCode | refs/heads/master | python/qpid/tests/messaging/endpoints.py | 2 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
pleaseproject/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/distutils/tests/test_version.py | 165 | """Tests for distutils.version."""
import unittest
from distutils.version import LooseVersion
from distutils.version import StrictVersion
from test.support import run_unittest
class VersionTestCase(unittest.TestCase):
def test_prerelease(self):
version = StrictVersion('1.2.3a1')
self.assertEqual(v... |
MicrochipTech/linux-pic32 | refs/heads/pic32-4.2.y | tools/perf/scripts/python/net_dropmonitor.py | 1812 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... |
breathe/ansible-modules-extras | refs/heads/devel | windows/win_dotnet_ngen.py | 138 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Peter Mounce <public@neverrunwithscissors.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... |
Nu3001/external_chromium_org | refs/heads/master | native_client_sdk/src/tools/tests/sel_ldr_test.py | 104 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.dirname(SCRIPT_DIR)
... |
karna41317/personal_blog | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/rrt.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles.rrt
~~~~~~~~~~~~~~~~~~~
pygments "rrt" theme, based on Zap and Emacs defaults.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Com... |
171121130/SWI | refs/heads/master | venv/Lib/site-packages/alembic/testing/env.py | 16 | #!coding: utf-8
import os
import shutil
import textwrap
from ..util.compat import u
from ..script import Script, ScriptDirectory
from .. import util
from . import engines
from . import provision
def _get_staging_directory():
if provision.FOLLOWER_IDENT:
return "scratch_%s" % provision.FOLLOWER_IDENT
... |
deep-security/cloudformation | refs/heads/master | scripts/create-dsm-db.py | 2 | #!/usr/bin/python
import pymssql
import argparse
## create-DSM-SqlDB --user {username} --pass {password} --endpoint {sql fqdn} --dbname {name of db to create}
parser = argparse.ArgumentParser()
parser.add_argument('--endpoint', action='store', dest='endpoint')
parser.add_argument('--user', action='store', dest='dbuse... |
tillahoffmann/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/wishart_test.py | 43 | # 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... |
Yadnyawalkya/integration_tests | refs/heads/master | cfme/fixtures/candu.py | 2 | """
Fixtures for Capacity and Utilization
"""
import fauxfactory
import pytest
from cfme.utils import conf
from cfme.utils.ssh import SSHClient
@pytest.fixture(scope="module")
def enable_candu(appliance):
candu = appliance.collections.candus
server_settings = appliance.server.settings
original_roles = se... |
Calysto/metakernel | refs/heads/master | metakernel/magics/tutor_magic.py | 1 | """
==========
tutormagic
==========
Magics to display pythontutor.com in the notebook.
"""
# Based on Kiko Correoso's IPython magic:
# https://github.com/kikocorreoso/tutormagic
# and Doug Blank's
# http://jupyter.cs.brynmawr.edu/hub/dblank/public/Examples/Online%20Python%20Tutor.ipynb
#-----------------------------... |
thomasgilgenast/gilgistatus-nonrel | refs/heads/master | django/contrib/webdesign/templatetags/webdesign.py | 350 | from django.contrib.webdesign.lorem_ipsum import words, paragraphs
from django import template
register = template.Library()
class LoremNode(template.Node):
def __init__(self, count, method, common):
self.count, self.method, self.common = count, method, common
def render(self, context):
try:
... |
ryanahall/django | refs/heads/master | tests/timezones/tests.py | 10 | from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
from unittest import skipIf
from xml.dom.minidom import parseString
from django.contrib.auth.models import User
from django.core import serializers
from django.core.urlresolvers import reverse
from django.db.models import Max... |
kubaszostak/gdal-dragndrop | refs/heads/master | osgeo/apps/Python27/Lib/lib2to3/fixes/fix_methodattrs.py | 61 | """Fix bound method attributes (method.im_? -> method.__?__).
"""
# Author: Christian Heimes
# Local imports
from .. import fixer_base
from ..fixer_util import Name
MAP = {
"im_func" : "__func__",
"im_self" : "__self__",
"im_class" : "__self__.__class__"
}
class FixMethodattrs(fixer_bas... |
xtenex/raft | refs/heads/master | core/workers/ImporterThread.py | 11 | #
# Author: Gregory Fleischer (gfleischer@gmail.com)
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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... |
redhat-openstack/manila | refs/heads/master-patches | manila/tests/network/linux/test_ip_lib.py | 4 | # Copyright 2014 Mirantis 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... |
allenlavoie/tensorflow | refs/heads/master | tensorflow/python/eager/core.py | 30 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
gregdek/ansible-modules-core | refs/heads/devel | cloud/amazon/ec2_key.py | 51 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
... |
wylieswanson/agilepyfs | refs/heads/master | fs/zipfs.py | 1 | """
fs.zipfs
========
A FS object that represents the contents of a Zip file
"""
import datetime
import os.path
from fs.base import *
from fs.path import *
from fs.errors import *
from fs.filelike import StringIO
from zipfile import ZipFile, ZIP_DEFLATED, ZIP_STORED, BadZipfile, LargeZipFile
from memoryfs import M... |
littlstar/chromium.src | refs/heads/nw | chrome/test/mini_installer/quit_chrome.py | 17 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Quits Chrome.
This script sends a WM_CLOSE message to each window of Chrome and waits until
the process terminates.
"""
import optparse
import os
import... |
alex/fabric | refs/heads/master | tests/Python26SocketServer.py | 13 | """Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <socket.h>
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.