repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
grevutiu-gabriel/sympy | refs/heads/master | sympy/physics/quantum/boson.py | 59 | """Bosonic quantum operators."""
from sympy.core.compatibility import u
from sympy import Mul, Integer, exp, sqrt, conjugate
from sympy.physics.quantum import Operator
from sympy.physics.quantum import HilbertSpace, FockSpace, Ket, Bra, IdentityOperator
from sympy.functions.special.tensor_functions import KroneckerDel... |
Versent/ansible-modules-core | refs/heads/devel | cloud/openstack/os_ironic.py | 128 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2014, Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... |
firefoxu8833/huawei-kernel-test | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
apache/aurora | refs/heads/master | src/main/python/apache/aurora/common/health_check/shell.py | 5 | #
# 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 ... |
schwarz/youtube-dl | refs/heads/master | youtube_dl/extractor/rte.py | 108 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
float_or_none,
)
class RteIE(InfoExtractor):
_VALID_URL = r'http?://(?:www\.)?rte\.ie/player/[^/]{2,3}/show/(?P<id>[0-9]+)/'
_TEST = {
'url': 'http://www.rte.ie/player/de/show/10363114... |
agdsn/pycroft | refs/heads/develop | pycroft/helpers/date.py | 2 | from calendar import monthrange
from datetime import date
def diff_month(d1: date, d2: date) -> int:
"""Calculate the difference in months ignoring the days
If d1 > d2, the result is positive.
"""
return (d1.year - d2.year) * 12 + d1.month - d2.month
def last_day_of_month(d: date) -> date:
_, n... |
sensestage/supercollider | refs/heads/bela_hackery_v02 | testsuite/sclang/launch_test.py | 29 | #!/usr/bin/env python
import fcntl
import sys
import os.path
import subprocess
import time
import select
# A quick-and-dirty launch test of sclang. This is temporary, but does the job for now.
def non_block_read(output):
fd = output.fileno()
fl = fcntl.fcntl(fd, fcntl.F_GETFL)
fcntl.fcntl(fd, fcntl.F_SETF... |
jly8866/archer | refs/heads/master | sql/urls.py | 1 | # -*- coding: UTF-8 -*-
from django.conf.urls import url, include
from . import views, views_ajax, query, jobs
from django.conf import settings
urlpatterns = [
url(r'^$', views.sqlworkflow, name='sqlworkflow'),
url(r'^index/$', views.sqlworkflow, name='sqlworkflow'),
url(r'^login/$', views.login, name='l... |
jswope00/GAI | refs/heads/master | common/djangoapps/student/migrations/0006_expand_meta_field.py | 188 | # encoding: 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):
# Changing field 'UserProfile.meta'
db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.fields.... |
ClemsonSoCUnix/django-anyvcs | refs/heads/develop | django_anyvcs/urls.py | 1 | # Copyright (c) 2014-2016, Clemson University
# 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 conditio... |
jianghuaw/nova | refs/heads/master | nova/conf/workarounds.py | 3 | # Copyright 2016 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... |
nathanaevitas/odoo | refs/heads/master | openerp/addons/sales_team/__openerp__.py | 261 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
ceos-seo/Data_Cube_v2 | refs/heads/master | agdc-v2/examples/analytics_execution_engine/ndvi_mask_expression.py | 1 | # ------------------------------------------------------------------------------
# Name: ndvi_mask_expression.py
# Purpose: ndvi mask expression example for Analytics Engine & Execution Engine.
# post-integration with NDExpr.
# post-integration with Data Access API.
#
# Author: Pete... |
knipknap/exscript | refs/heads/master | Exscript/interpreter/parser.py | 3 | #
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# 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,... |
wwf5067/statsmodels | refs/heads/master | statsmodels/distributions/mixture_rvs.py | 27 | from statsmodels.compat.python import range
import numpy as np
def _make_index(prob,size):
"""
Returns a boolean index for given probabilities.
Notes
---------
prob = [.75,.25] means that there is a 75% chance of the first column
being True and a 25% chance of the second column being True. The... |
ftomassetti/intellij-community | refs/heads/master | python/testData/codeInsight/smartEnter/argumentsSecond_after.py | 83 | class A:
<caret>
pass |
shanemcd/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_install_os.py | 4 | #!/usr/bin/python
#
# 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 distribut... |
pli3/e2-openwbif | refs/heads/master | plugin/controllers/ajax.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
# 2011 E2OpenPlugins #
# #
# This file is open source software; you can redistribute... |
Yannig/ansible-modules-extras | refs/heads/devel | clustering/consul_session.py | 76 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@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 License, or
# (at your... |
waasilzamri/foursquared.eclair | refs/heads/master | util/common.py | 262 | #!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... |
ninegrid/dotfiles-vim | refs/heads/master | bundle/vim-python-mode/pymode/libs/pylama/lint/pylama_pylint/logilab/common/graph.py | 19 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... |
amfarrell/fenced-code-plus | refs/heads/master | fenced_code_plus/fenced_code_plus.py | 1 | from __future__ import absolute_import
from __future__ import unicode_literals
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
from markdown.extensions.codehilite import CodeHilite, CodeHiliteExtension, parse_hl_lines
import re
from collections import OrderedDict as odict
cla... |
AnromOS/AnromUpdateServer | refs/heads/master | config.py | 1 | #!/usr/bin/env python3
#coding=utf-8
import hashlib,os
netpref ={}
#web 服务端API 和管理入口的地址
netpref['SERVER_HOST']='127.0.0.1'
netpref['SERVER_PORT']='8080'
netpref['SCHEME']='http'
#redis
netpref['REDIS_HOST']='127.0.0.1'
netpref['REDIS_PORT']=6379
netpref['REDIS_DB']=0
netpref['REDIS_PASSWORD']=None
#登陆后台设置
ADMIN_LOG... |
djbw/linux | refs/heads/master | tools/perf/tests/attr.py | 127 | #! /usr/bin/python
# SPDX-License-Identifier: GPL-2.0
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
def data_equal(a, b):
# Allow multiple values in assignment separated by '|'
a_list = a.split('|')
b_list = b.split('|')
for a_item i... |
j00bar/ansible | refs/heads/devel | lib/ansible/modules/network/lenovo/cnos_backup.py | 19 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... |
bazelbuild/rules_pkg | refs/heads/main | pkg/tests/make_rpm_test.py | 1 | # Copyright 2017 The Bazel 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 applicable la... |
bluesea/zulip | refs/heads/master | zerver/views/webhooks.py | 103 | # Webhooks for external integrations.
from __future__ import absolute_import
from django.conf import settings
from zerver.models import UserProfile, get_client, get_user_profile_by_email
from zerver.lib.actions import check_send_message
from zerver.lib.notifications import convert_html_to_markdown
from zerver.lib.re... |
marksweiss/organize-m | refs/heads/master | lib/item_converter.py | 1 | from element import Elem
from item import Item #@UnusedImport, suppress Eclipse warning, used dynamically in convert_to_item() eval
class OrganizemItemDataConversionException(Exception): pass
class BaseItemConverter(object):
@staticmethod
def convert_to_item(item):
pass
class YamlItemConverter(... |
suyashphadtare/vestasi-erp-jan-end | refs/heads/develop | erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py | 41 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ModeofPayment(Document):
pass
|
benjaminjkraft/django | refs/heads/master | tests/template_tests/filter_tests/timezone_utils.py | 523 | from datetime import date, datetime
from django.test import SimpleTestCase
from django.utils import timezone
class TimezoneTestCase(SimpleTestCase):
def setUp(self):
self.now = datetime.now()
self.now_tz = timezone.make_aware(
self.now, timezone.get_default_timezone(),
)
... |
pigeonflight/strider-plone | refs/heads/master | docker/appengine/lib/django-1.5/django/contrib/webdesign/templatetags/webdesign.py | 232 | from __future__ import unicode_literals
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
... |
gfonk/ansible | refs/heads/devel | lib/ansible/plugins/callback/default.py | 16 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) an... |
PixelDragon/pixeldragon | refs/heads/2.6c1.3 | systemd.py | 1 | from __future__ import print_function
systemd_template="""
[Unit]
Description={repo} {image} container
After=docker.service
Requires=docker.service
PartOf=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=/usr/bin/docker run --name {repo}-{image} -d {options} {repo}/{image}:{version}
ExecStart=/usr/bin/docker s... |
avaly/quicktile | refs/heads/master | quicktile/commands.py | 1 | """Available window-management commands"""
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__license__ = "GNU GPL 2.0 or later"
import logging, time
from functools import wraps
from heapq import heappop, heappush
import gtk.gdk, wnck # pylint: disable=import-error
from .wm import GRAVITY
from .util import fmt_... |
sinkuri256/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/tlslite/integration/ClientHelper.py | 285 | """
A helper class for using TLS Lite with stdlib clients
(httplib, xmlrpclib, imaplib, poplib).
"""
from gdata.tlslite.Checker import Checker
class ClientHelper:
"""This is a helper class used to integrate TLS Lite with various
TLS clients (e.g. poplib, smtplib, httplib, etc.)"""
def __init__... |
poiati/django | refs/heads/master | django/template/backends/dummy.py | 480 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import errno
import io
import string
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import Origin, TemplateDoesNotExist
from django.utils... |
nicodv/bgg | refs/heads/master | bgg/dao/gamesdao.py | 1 | import pandas as pd
import psycopg2
from bgg.util.retry import retry
from bgg.util import read_local_cfg
CFG = read_local_cfg()
class GamesDAO(object):
@retry(3)
def __init__(self):
# define our connection string
conn_string = 'host={} port={}, dbname={} user={} password={}'.format(
... |
shenmilanzi/wo | refs/heads/master | lgb.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import pandas as pd
import lightgbm as lgb
# from sklearn.grid_search import GridSearchCV
# from sklearn.metrics import roc_auc_score
# from sklearn.pipeline import Pipeline
import sys
reload(sys)
sys.setdefaultencoding('utf8')
logger = logging.getLogger('L... |
kdar/rconsoft | refs/heads/master | rconsoft/plugins/__init__.py | 2 | # Read LICENSE for licensing details.
"""A plugin module for RconSoft. Concepts borrowed from
Marty Alchin <http://martyalchin.com/2008/jan/10/simple-plugin-framework/>"""
import logging
import imp
import os
import sys
from warnings import warn
from rconsoft.config import cget, INSTALLDIR
log = logging.g... |
LUKKIEN/wagtailsocialfeed | refs/heads/master | wagtailsocialfeed/utils/feed/facebook.py | 1 | from enum import Enum
from dateutil import parser as dateparser
from django.core.exceptions import ImproperlyConfigured
from facepy import GraphAPI
from wagtailsocialfeed.utils.conf import get_socialfeed_setting
from . import AbstractFeed, AbstractFeedQuery, FeedItem
class PostType(Enum):
status = 'status'
... |
StrellaGroup/erpnext | refs/heads/develop | erpnext/healthcare/doctype/dosage_strength/dosage_strength.py | 30 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class DosageStrength(Document):
pass
|
codester2/devide.johannes | refs/heads/master | extra/soappy-cvp/tests/echoServer.py | 6 | #!/usr/bin/env python
#
# Copyright (c) 2001 actzero, inc. All rights reserved.
import sys
sys.path.insert(1, "..")
from SOAPpy import *
# Uncomment to see outgoing HTTP headers and SOAP and incoming
Config.dumpSOAPIn = 1
Config.dumpSOAPOut = 1
Config.debug = 1
# specify name of authorization function
Config.authMe... |
strint/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/operator_pd_cholesky_test.py | 40 | # 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... |
heeraj123/oh-mainline | refs/heads/master | vendor/packages/Django/tests/regressiontests/views/tests/specials.py | 60 | # coding: utf-8
from __future__ import unicode_literals
from django.test import TestCase
class URLHandling(TestCase):
"""
Tests for URL handling in views and responses.
"""
urls = 'regressiontests.views.generic_urls'
redirect_target = "/%E4%B8%AD%E6%96%87/target/"
def test_combining_redirect... |
rootio/rootio_web | refs/heads/master | rootio/demo_data.py | 1 | from pathlib import Path
from datetime import datetime, timedelta
import json
import pytz
from .user.models import User, RootioUser
from .radio.models import Location, Network, Station, Program, ScheduledProgram
from .radio.models import ContentType, ProgramType
from .telephony.models import PhoneNumber, Gateway
from .... |
xianggong/m2c_unit_test | refs/heads/master | test/relational/bitselect_ushort16ushort16ushort16/compile.py | 1861 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... |
timokoola/okrest | refs/heads/master | okrest/api/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
trent/foo.com | refs/heads/master | foo/baz/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
dims/nova | refs/heads/master | nova/conf/ironic.py | 8 | # Copyright 2015 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 require... |
Bismarrck/tensorflow | refs/heads/master | tensorflow/python/data/benchmarks/filter_benchmark.py | 3 | # 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... |
jasimpson/gnuradio-jasimpson | refs/heads/master | gnuradio-core/src/python/gnuradio/blks2impl/qam256.py | 12 | #
# Copyright 2005,2006,2007 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)
# any later ... |
blueboxgroup/ansible | refs/heads/devel | lib/ansible/playbook/role/include.py | 50 | # (c) 2014 Michael DeHaan, <michael@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... |
frnhr/django-cms | refs/heads/develop | cms/test_utils/project/sampleapp/migrations/0002_auto_20141015_1057.py | 60 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('sampleapp', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='l... |
BruceDai/testkit-lite | refs/heads/master | testkitlite/util/httprequest.py | 4 | #!/usr/bin/python
#
# Copyright (C) 2012 Intel Corporation
#
# 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 pr... |
ganeshgore/myremolab | refs/heads/master | server/src/voodoo/sessions/db_lock_data.py | 3 | #-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# listed below:
#
#... |
sbhackerspace/Webhooker | refs/heads/master | Phone.py | 1 | import time
from socket import *
gPort = 31337
NumberOfPixels = 390
################################################################################
def MakePixel(Red, Green, Blue):
return chr(Red) + chr(Green) + chr(Blue)
################################################################################
def SendPack... |
stonegithubs/odoo | refs/heads/8.0 | openerp/service/websrv_lib.py | 380 | # -*- coding: utf-8 -*-
#
# Copyright P. Christeas <p_christ@hol.gr> 2008-2010
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking ... |
endlessm/chromium-browser | refs/heads/master | third_party/chromite/scripts/cros_mark_android_as_stable_unittest.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for cros_mark_android_as_stable.py."""
from __future__ import print_function
import os
import sys
import mock
fro... |
aminorex/icsisumm | refs/heads/master | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/wordnet/dbinfo_html.py | 9 | # Natural Language Toolkit: Wordnet Interface: Graphical Wordnet Browser
#
# Copyright (C) 2007 - 2008 University of Pennsylvania
# Author: Jussi Salmela <jtsalmela@users.sourceforge.net>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
import os
from collections import defaultdict
from ... |
chand3040/sree_odoo | refs/heads/master | openerp/addons/l10n_br/__openerp__.py | 430 | # -*- encoding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2009 Renato Lima - Akretion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by th... |
Athrun29/horizon | refs/heads/master | openstack_dashboard/dashboards/project/networks/tables.py | 4 | # Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
muffinresearch/amo-validator | refs/heads/master | extras/build_whitelist.py | 5 | import sys
import os
import os.path as pth
import hashlib
with open("whitelist_hashes.txt", mode="w") as output:
for root, dirs, files in os.walk(sys.argv[1]):
for filename in files:
path = pth.join(pth.dirname(pth.abspath(sys.argv[0])),
root, filename)
h... |
danielreed/python-hpOneView | refs/heads/master | examples/scripts/get-node-status.py | 2 | #!/usr/bin/env python
###
# (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP
#
# 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 limita... |
bibi21000/RasPy | refs/heads/master | src/raspy/common/zhelpers.py | 1 | # -*- coding: utf-8 -*-
"""
Helper module for example applications. Mimics ZeroMQ Guide's zhelpers.h.
"""
from __future__ import print_function
import binascii
import os
from random import randint
import zmq
#def dump(msg_or_socket):
# """Receives all message parts from socket, printing each frame neatly"""
# ... |
ella/mypage | refs/heads/master | tests/unit_project/settings/local_example.py | 21 | """
Rename to local.py and set variables from config.py that
You want to override.
"""
|
rmmariano/testejenkins | refs/heads/master | languages/ar.py | 61 | # coding: utf8
{
'!langcode!': 'ar',
'!langname!': 'Arabic',
'%s %%(shop)': '%s %%(shop)',
'%s %%(shop[0])': '%s %%(shop[0])',
'%s %%{quark[0]}': '%s %%{quark[0]}',
'%s %%{shop[0]}': '%s %%{shop[0]}',
'%s %%{shop}': '%s %%{shop}',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'@markmin\x01**Hello Wo... |
zuowang/voltdb | refs/heads/master | lib/python/voltcli/future.d/sql.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... |
xrg/django-static-gitified | refs/heads/master | django/contrib/gis/admin/widgets.py | 76 | from django.forms.widgets import Textarea
from django.template import loader, Context
from django.templatetags.static import static
from django.utils import translation
from django.contrib.gis.gdal import OGRException
from django.contrib.gis.geos import GEOSGeometry, GEOSException
# Creating a template context that c... |
amith01994/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/flatpages/tests/forms.py | 94 | from django.contrib.flatpages.admin import FlatpageForm
from django.test import TestCase
class FlatpageAdminFormTests(TestCase):
def setUp(self):
self.form_data = {
'title': "A test page",
'content': "This is a test",
'sites': [1],
}
def test_flatpage_admin_... |
flammified/terrabot | refs/heads/master | terrabot/packets/packet1.py | 1 | from . import packet
class Packet1(packet.Packet):
def __init__(self, protocol):
super(Packet1, self).__init__(1)
self.add_data("Terraria" + str(protocol), pascal_string=True)
|
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/meatlump/event/meatlump_map_01_12.py | 85615 | import sys
def setup(core, object):
return |
mhaessig/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/py/testing/root/test_builtin.py | 217 | import sys
import types
import py
from py.builtin import set, frozenset, reversed, sorted
def test_enumerate():
l = [0,1,2]
for i,x in enumerate(l):
assert i == x
def test_any():
assert not py.builtin.any([0,False, None])
assert py.builtin.any([0,False, None,1])
def test_all():
assert not... |
arbrandes/edx-platform | refs/heads/master | openedx/core/djangoapps/oauth_dispatch/tests/test_client_credentials.py | 4 | """ Tests for OAuth 2.0 client credentials support. """
import json
import unittest
from django.conf import settings
from django.test import TestCase
from django.urls import reverse
from oauth2_provider.models import Application
from common.djangoapps.student.tests.factories import UserFactory
from ..adapters impo... |
gregdek/ansible | refs/heads/devel | lib/ansible/module_utils/network/ftd/fdm_swagger_client.py | 22 | # Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 v... |
soldag/home-assistant | refs/heads/dev | homeassistant/components/api/__init__.py | 3 | """Rest API for Home Assistant."""
import asyncio
import json
import logging
from aiohttp import web
from aiohttp.web_exceptions import HTTPBadRequest
import async_timeout
import voluptuous as vol
from homeassistant.auth.permissions.const import POLICY_READ
from homeassistant.bootstrap import DATA_LOGGING
from homeas... |
JoePelz/SAM | refs/heads/dev | sam/importers/import_aws.py | 2 | import sys
from sam.importers.import_base import BaseImporter
import datetime
class AWSImporter(BaseImporter):
def translate(self, line, line_num, dictionary):
"""
Converts a given syslog line into a dictionary of (ip, port, ip, port)
Args:
line: The syslog line to parse
... |
gagoncal/Selenium | refs/heads/master | Selenium with python/Selenium_with_python_config_files/setuptools-12.0.1/setuptools/command/alias.py | 467 | from distutils.errors import DistutilsOptionError
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg:
return repr(arg)
if arg.split() != [arg... |
WoLpH/CouchPotatoServer | refs/heads/master | libs/suds/xsd/query.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 ... |
mrkm4ntr/incubator-airflow | refs/heads/master | airflow/providers/cloudant/hooks/__init__.py | 5130 | #
# 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... |
mezz64/home-assistant | refs/heads/dev | tests/components/yamaha/__init__.py | 36 | """Tests for the yamaha component."""
|
duramato/SickRage | refs/heads/master | lib/fanart/__init__.py | 60 | __author__ = 'Andrea De Marco <24erre@gmail.com>'
__version__ = '1.4.0'
__classifiers__ = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
... |
provaleks/o8 | refs/heads/8.0 | addons/account_payment/__openerp__.py | 261 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
srivassumit/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_util.py | 449 | #!/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... |
brenthuisman/phd_tools | refs/heads/master | image.mask_atthreshold.py | 1 | #!/usr/bin/env python
import image,sys
infile = sys.argv[-1] #in goes mhd
thres = float(sys.argv[-2])
print >> sys.stderr, 'Processing', infile
img = image.image(infile)
print "Max val in image:",img.imdata.max()
print "Mask at threshold:",thres
img.savemask_atthreshold(thres)
|
mozilla/popcorn_maker | refs/heads/master | popcorn_gallery/popcorn/migrations/0023_auto__add_field_template_config.py | 3 | # -*- 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 field 'Template.config'
db.add_column('popcorn_template', 'config',
self.gf('... |
askeing/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/actions/key.py | 17 | import pytest
from tests.actions.support.keys import Keys
from tests.actions.support.refine import filter_dict, get_keys, get_events
def test_lone_keyup_sends_no_events(session, key_reporter, key_chain):
key_chain.key_up("a").perform()
assert len(get_keys(key_reporter)) == 0
assert len(get_events(session... |
sub-b/android_kernel_samsung_matissewifi-old | refs/heads/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
Tesla-Redux-Devices/hells-Core-N6 | refs/heads/lollipop-mr1-mako-m | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
keithroe/vtkoptix | refs/heads/master | Filters/Core/Testing/Python/cutLoop.py | 20 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
def GetRGBColor(colorName):
'''
Return the red, green and blue components for a
color as doubles.
'''
rgb = [0.0, 0.0, 0.0] # black
vtk.vtkNamedColors... |
vladan-m/ggrc-core | refs/heads/develop | src/ggrc/migrations/versions/20130703190904_26641df89c2c_rebase_event.py | 7 | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
"""Make Event extend Base
Revision ID: 26641df89c2c
Revises: 2a59bef8c738
Create ... |
bratsche/Neutron-Drive | refs/heads/master | neutron-drive/django/db/backends/postgresql_psycopg2/base.py | 81 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import connection_created
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations
from... |
kkouer/PcGcs | refs/heads/master | Lib/site-packages/scipy/optimize/_nnls.py | 53 |
import sys
if sys.platform == 'cli':
import clr
clr.AddReference('optimize')
from scipy__optimize___nnls import *
|
sumedh123/debatify | refs/heads/UI | venv/lib/python2.7/site-packages/werkzeug/useragents.py | 257 | # -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta... |
rbalda/neural_ocr | refs/heads/master | env/lib/python2.7/site-packages/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) |
Fusion-Rom/android_external_chromium_org | refs/heads/lp5.1 | tools/json_schema_compiler/json_schema_test.py | 98 | #!/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 json_schema
import unittest
class JsonSchemaUnittest(unittest.TestCase):
def testNocompile(self):
compiled = [
... |
mpvismer/pyqtgraph | refs/heads/develop | tools/rebuildUi.py | 18 | import os, sys
## Search the package tree for all .ui files, compile each to
## a .py for pyqt and pyside
pyqtuic = 'pyuic4'
pysideuic = 'pyside-uic'
pyqt5uic = 'pyuic5'
for path, sd, files in os.walk('.'):
for f in files:
base, ext = os.path.splitext(f)
if ext != '.ui':
continue
... |
geimer/easybuild-framework | refs/heads/master | test/framework/suite.py | 3 | #!/usr/bin/python
# #
# Copyright 2012-2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercu... |
rdoh/pixelated-user-agent | refs/heads/master | service/test/unit/config/test_register.py | 5 | import unittest
from pixelated.register import validate_username, validate_password
class TestRegister(unittest.TestCase):
def test_username_raises_error_when_it_contains_uppercase_letters(self):
with self.assertRaises(ValueError):
validate_username('INVALIDUSERNAME')
def test_username_... |
p0psicles/SickRage | refs/heads/master | lib/chardet/latin1prober.py | 53 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
nikolas/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/dispatch/saferef.py | 345 | """
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
import weakref, traceback
def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target -- th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.