repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
MediaSapiens/wavesf | refs/heads/master | django/contrib/auth/management/__init__.py | 12 | """
Creates permissions for all installed apps that need permissions.
"""
from django.contrib.auth import models as auth_app
from django.db.models import get_models, signals
def _get_permission_codename(action, opts):
return u'%s_%s' % (action, opts.object_name.lower())
def _get_all_permissions(opts):
"Retu... |
tvd-dataset/tvd | refs/heads/master | tvd/plugin/resource.py | 1 | #!/usr/bin/env python
# encoding: utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2013-2015 CNRS
#
# 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 li... |
jmcarbo/openerp7 | refs/heads/master | openerp/addons/account_check_writing/wizard/account_check_batch_printing.py | 54 | # -*- 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... |
GunnerJnr/_CodeInstitute | refs/heads/master | Stream-3/Full-Stack-Development/19.Djangos-Testing-Framework/4.How-To-Test-Models/we_are_social/accounts/apps.py | 57 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class AccountsConfig(AppConfig):
name = 'accounts'
|
kkdd/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Tools/scripts/cvsfiles.py | 101 | #! /usr/bin/env python
"""Print a list of files that are mentioned in CVS directories.
Usage: cvsfiles.py [-n file] [directory] ...
If the '-n file' option is given, only files under CVS that are newer
than the given file are printed; by default, all files under CVS are
printed. As a special case, if a file does no... |
yhfudev/docsis3ns3 | refs/heads/master | src/visualizer/visualizer/ipython_view.py | 89 | """
Backend to the console plugin.
@author: Eitan Isaacson
@organization: IBM Corporation
@copyright: Copyright (c) 2007 IBM Corporation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms of the BSD which accompanies this distribution, and
is available ... |
sgraham/nope | refs/heads/master | third_party/webdriver/pylib/test/selenium/webdriver/support/__init__.py | 138 | #!/usr/bin/python
#
# Copyright 2011 WebDriver committers
#
# 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 ... |
williamjacksn/rainwave | refs/heads/master | lang_formatter.py | 1 | #!/usr/bin/python
import os
import glob
def format_locales(in_filename, out_filename):
original_file = open(in_filename, 'r')
out_file = open(out_filename, 'w')
for line in original_file:
if line.find(":") == -1:
out_file.write("%s\n" % line.strip())
else:
s = line.split(":", 1)
if s[0].find("__commen... |
jsnjack/kazy | refs/heads/master | kazy/colours.py | 1 | COLOUR_END = "\033[0m"
MAIN_COLOURS = {
"cyan": "\033[46m",
"red": "\033[41m",
"green": "\033[42m",
"yellow": "\033[43m",
"blue": "\033[44m",
"magenta": "\033[45m",
}
AUX_COLOURS = {
"light_red": "\033[101m",
"light_green": "\033[102m",
"light_blue": "\033[104m",
"light_magenta":... |
2014c2g3/0623exam | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/heapq_1.py | 628 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... |
klen/pylama | refs/heads/develop | tests/test_config.py | 2 | from pylama.config import parse_options, get_config
from pylama.core import run, prepare_params
def test_config():
config = get_config()
assert config
options = parse_options()
assert options
assert options.skip
assert not options.verbose
assert options.paths == ['pylama']
options = ... |
MoKee/android_kernel_samsung_aries | refs/heads/jb-mr1_mkt | tools/perf/python/twatch.py | 3213 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
mlperf/training_results_v0.7 | refs/heads/master | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/python/mxnet/contrib/text/__init__.py | 30 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
dq922/PerfKitExplorer | refs/heads/master | server/perfkit/common/http_util.py | 2 | """Copyright 2014 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 agreed to in ... |
markeTIC/OCB | refs/heads/8.0 | openerp/tests/addons/test_translation_import/__openerp__.py | 352 | # -*- coding: utf-8 -*-
{
'name': 'test-translation-import',
'version': '0.1',
'category': 'Tests',
'description': """A module to test translation import.""",
'author': 'OpenERP SA',
'maintainer': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'data': ['view.... |
Hironsan/natural-language-preprocessings | refs/heads/master | tests/ja/tokenizer.py | 1 | # -*- coding: utf-8 -*-
import unittest
from preprocessings.ja.tokenizer import JanomeTokenizer, MeCabTokenizer
class JanomeTokenizerTest(unittest.TestCase):
def setUp(self):
self.sent = '太郎は花子に花束をあげました。'
self.tokenizer = JanomeTokenizer()
def test_separated_words(self):
separated_s... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/Django-1.11.29/django/forms/formsets.py | 36 | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import BooleanField, IntegerField
from django.forms.utils import ErrorList
from django.forms.widgets import HiddenInput
from django.utils import six
from django.utils.encodi... |
gaufung/PythonStandardLibrary | refs/heads/master | Network/SocketServer/Socketserver_echo.py | 1 | import logging
import sys
import socketserver
logging.basicConfig(level=logging.DEBUG,
format='%(name)s: %(message)s',
)
class EchoRequestHandler(socketserver.BaseRequestHandler):
def __init__(self, request, client_address, server):
self.logger = logging.getLogger('E... |
BeDjango/intef-openedx | refs/heads/master | openedx/core/djangoapps/credit/signature.py | 60 | """
Calculate digital signatures for messages sent to/from credit providers,
using a shared secret key.
The signature is calculated as follows:
1) Encode all parameters of the request (except the signature) in a string.
2) Encode each key/value pair as a string of the form "{key}:{value}".
3) Concatenate ... |
UCRoboticsLab/BaxterTictactoe | refs/heads/master | src/baxter_examples/scripts/joint_velocity_puppet.py | 6 | #!/usr/bin/env python
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# ... |
jumpstarter-io/neutron | refs/heads/master | neutron/plugins/oneconvergence/lib/plugin_helper.py | 3 | # Copyright 2014 OneConvergence, 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 requir... |
NewCell/Call-Text-v1 | refs/heads/master | jni/pjsip/sources/tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py | 59 | # $Id: 100_resample_lf_11_8.py 2052 2008-06-25 18:18:32Z nanang $
#
from inc_cfg import *
# simple test
test_param = TestParam(
"Resample (large filter) 11 KHZ to 8 KHZ",
[
InstanceParam("endpt", "--null-audio --quality 10 --clock-rate 8000 --play-file wavs/input.11.wav --rec-file wavs/tmp.8.wav")
]
)
|
shanglt/youtube-dl | refs/heads/master | youtube_dl/extractor/telemb.py | 177 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import remove_start
class TeleMBIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?telemb\.be/(?P<display_id>.+?)_d_(?P<id>\d+)\.html'
_TESTS = [
{
'url': 'http://www.telemb... |
escardin/camunda-spin | refs/heads/master | dataformat-json-jackson/src/test/resources/org/camunda/spin/python/json/tree/JsonTreeSetPropertyPythonTest.shouldReplaceObjectProperty.py | 2 | node = S(input, "application/json")
oldValue = node.prop("order")
jsonObject = {
"name": "test",
"comment": "42!"
}
node.prop("order", jsonObject)
newValue = node.prop("order") |
nachandr/cfme_tests | refs/heads/master | cfme/tests/perf/workloads/test_idle.py | 2 | """Runs Idle Workload by resetting appliance and enabling specific roles with no providers."""
import time
import pytest
from cfme.utils.conf import cfme_performance
from cfme.utils.grafana import get_scenario_dashboard_urls
from cfme.utils.log import logger
from cfme.utils.smem_memory_monitor import add_workload_qua... |
rudhir-upretee/Sumo_With_Netsim | refs/heads/master | tools/sumolib/output/inductionloop.py | 6 | from xml.sax import saxutils, make_parser, handler
class InductLoopReader(handler.ContentHandler):
def __init__(self, toCollect):
self._values = {}
self._toCollect = toCollect
self._intervalBegins = []
self._beginTime = None
for a in self._toCollect:
self._values... |
jymannob/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/_base/searcher/__init__.py | 16 | from .main import Searcher
def autoload():
return Searcher()
config = [{
'name': 'searcher',
'order': 20,
'groups': [
{
'tab': 'searcher',
'name': 'searcher',
'label': 'Basics',
'description': 'General search options',
'options': [
... |
BT-fgarbely/odoo | refs/heads/8.0 | addons/crm/crm.py | 267 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
JingJunYin/tensorflow | refs/heads/master | tensorflow/contrib/predictor/core_estimator_predictor_test.py | 94 | # 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... |
cgar/servo | refs/heads/master | tests/wpt/css-tests/css-fonts-3_dev/html/support/fonts/makegsubfonts.py | 1616 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... |
BIDS-collaborative/EDAM | refs/heads/master | app/analysis/models.py | 1 | """
Model definitions.
This module defines how information used by the web app is structured and how the
Python layer interfaces with a database.
"""
from __future__ import unicode_literals
from django.db import models
class PierData(models.Model):
"""
model for caching analysis plots in database
"""
... |
sitsbeyou/Django-facebook | refs/heads/master | docs/docs_env/Lib/encodings/tis_620.py | 593 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='st... |
krux/duplicity-pkg | refs/heads/master | duplicity/librsync.py | 10 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# duplicity is free software; you can redistribute it and/or modify
# under the terms of the GNU General Public License as... |
cl4rke/scikit-learn | refs/heads/master | sklearn/feature_selection/tests/test_feature_select.py | 143 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises... |
jonyroda97/redbot-amigosprovaveis | refs/heads/develop | lib/youtube_dl/extractor/xxxymovies.py | 38 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
)
class XXXYMoviesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?xxxymovies\.com/videos/(?P<id>\d+)/(?P<display_id>[^/]+)'
_TEST = {
'url': 'http://xxx... |
pasqualguerrero/django | refs/heads/master | tests/servers/urls.py | 384 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^example_view/$', views.example_view),
url(r'^model_view/$', views.model_view),
url(r'^create_model_instance/$', views.create_model_instance),
url(r'^environ_view/$', views.environ_view),
]
|
lemonade512/BluebonnetsPointsApp | refs/heads/master | bluebonnetspointsapp/lib/aniso8601/timezone.py | 15 | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Brandon Nielsen
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import datetime
def parse_timezone(tzstr):
#tzstr can be ±hh:mm, ±hhmm, ±hh, the Z case is handled elsewh... |
srcLurker/home-assistant | refs/heads/dev | homeassistant/components/splunk.py | 28 | """
Support to send data to an Splunk instance.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/splunk/
"""
import json
import logging
import requests
import voluptuous as vol
from homeassistant.const import (
CONF_HOST, CONF_PORT, CONF_SSL, CONF_T... |
cs-chan/ICIP2016-PC | refs/heads/master | ArtGAN/Style128GANAE.py | 1 | import tensorflow as tf
from layers import conv2d, linear, flatten, nnupsampling, batchnorm, gaussnoise, pool
from activations import lrelu
from op import log_sum_exp
from data_loader import train_loader, validation_loader
from neon.backends import gen_backend
import numpy as np
from utils import drawblock, createfolde... |
bertucho/epic-movie-quotes-quiz | refs/heads/master | dialogos/build/Twisted/twisted/web/test/test_webclient.py | 8 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the old L{twisted.web.client} APIs, C{getPage} and friends.
"""
from __future__ import division, absolute_import
import os
from errno import ENOSPC
try:
from urlparse import urlparse, urljoin
except ImportError:
from urlli... |
juanifioren/django-oidc-provider | refs/heads/master | oidc_provider/compat.py | 2 | def get_attr_or_callable(obj, name):
target = getattr(obj, name)
if callable(target):
return target()
return target
|
rwakulszowa/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/utils/spider.py | 436 | #!/usr/bin/env python
"""Spider to try and find bugs in the parser. Requires httplib2 and elementtree
usage:
import spider
s = spider.Spider()
s.spider("http://www.google.com", maxURLs=100)
"""
import urllib.request, urllib.error, urllib.parse
import urllib.robotparser
import md5
import httplib2
import html5lib
fro... |
40223234/2015cdb_g1_0134 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_runner.py | 785 | import io
import os
import sys
import pickle
import subprocess
import unittest
from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun
class TestCleanUp(unittest.TestCase):
def testCleanUp(self):
class TestableTest(unittest.TestCase):
def testNothing(self):
p... |
stefanw/django-cms | refs/heads/develop | cms/utils/encoder.py | 60 | # -*- coding: utf-8 -*-
from django.utils.html import conditional_escape
from django.utils.encoding import force_text
from django.utils.functional import Promise
from django.core.serializers.json import DjangoJSONEncoder
from django.utils.six import iteritems
class SafeJSONEncoder(DjangoJSONEncoder):
def _recursi... |
rphillips/irc-256 | refs/heads/master | irclib.py | 85 | # Copyright (C) 1999--2002 Joel Rosdahl
#
# 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 License, or (at your option) any later version.
#
# This library is ... |
francoricci/sapspid | refs/heads/master | modules/jwtoken/lib/statements.py | 1 | stmts = dict()
stmts['get_token_by_cod'] = {'sql':"PREPARE get_token_by_cod (text) AS " \
"SELECT * FROM jwt.token WHERE cod_token LIKE $1"}
stmts['create_token_by_type'] = {'sql':"PREPARE create_token_by_type (text) AS " \
"SELECT lib.create_token_byType($1) as cod_token"}
stmts['verify_t... |
PsychoTV/PsychoTeam.repository | refs/heads/master | plugin.video.PsychoTV/resources/lib/resolvers/tusfiles.py | 23 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... |
lightbulb-framework/lightbulb-framework | refs/heads/master | lightbulb/data/regex/PHPIDS070/43.py | 544 | META = {
'author': 'George Argyros, Ioannis Stais',
'description': 'Automatic transformed ruleset',
'type':'Regex',
'comments': []
} |
rotofly/odoo | refs/heads/master | addons/mail/__openerp__.py | 257 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... |
brightchen/Impala | refs/heads/cdh5-trunk | thirdparty/thrift-0.9.0/test/py/TestServer.py | 30 | #!/usr/bin/env python
#
# 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
# "L... |
udemy/py-moneyed | refs/heads/master | moneyed/localization.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal, ROUND_HALF_EVEN
import moneyed
DEFAULT = "default"
class CurrencyFormatter(object):
sign_definitions = {}
formatting_definitions = {}
def add_sign_definition(self, locale, currency, prefix='', suffix=''):
... |
rryan/django-cms | refs/heads/develop | cms/south_migrations/0044_killsettings.py | 48 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label = ... |
ak2703/edx-platform | refs/heads/master | common/lib/capa/capa/tests/test_targeted_feedback.py | 196 | """
Tests the logic of the "targeted-feedback" attribute for MultipleChoice questions,
i.e. those with the <multiplechoiceresponse> element
"""
import unittest
import textwrap
from . import test_capa_system, new_loncapa_problem, load_fixture
class CapaTargetedFeedbackTest(unittest.TestCase):
'''
Testing clas... |
liyu1990/tensorflow | refs/heads/master | tensorflow/python/framework/framework_lib.py | 5 | # pylint: disable=wildcard-import,unused-import,g-bad-import-order,line-too-long
"""Classes and functions for building TensorFlow graphs.
## Core graph data structures
@@Graph
@@Operation
@@Tensor
## Tensor types
@@DType
@@as_dtype
## Utility functions
@@device
@@name_scope
@@control_dependencies
@@convert_to_ten... |
vincepandolfo/django | refs/heads/master | tests/timezones/forms.py | 581 | from django import forms
from .models import Event
class EventForm(forms.Form):
dt = forms.DateTimeField()
class EventSplitForm(forms.Form):
dt = forms.SplitDateTimeField()
class EventLocalizedForm(forms.Form):
dt = forms.DateTimeField(localize=True)
class EventModelForm(forms.ModelForm):
class... |
clairetang6/bokeh | refs/heads/master | tests/compat/polycollection.py | 13 | from matplotlib.collections import PolyCollection
import matplotlib.pyplot as plt
import numpy as np
from bokeh import mpl
from bokeh.plotting import output_file, show
# Generate data. In this case, we'll make a bunch of center-points and generate
# verticies by subtracting random offsets from those center-points
num... |
kevgathuku/django-extensions | refs/heads/master | django_extensions/management/commands/runprofileserver.py | 4 | # -*- coding: utf-8 -*-
"""
runprofileserver.py
Starts a lightweight Web server with profiling enabled.
Credits for kcachegrind support taken from lsprofcalltree.py go to:
David Allouche
Jp Calderone & Itamar Shtull-Trauring
Johan Dahlin
"""
import sys
from datetime import datetime
from django.conf import se... |
mapr/hue | refs/heads/hue-3.9.0-mapr | desktop/core/ext-py/MarkupSafe-0.9.3/markupsafe/__init__.py | 43 | # -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
from itertools import imap
__all__ = ['Markup', 'soft_unicode', 'escape']
_striptags_re = re.compile(r'(<!--.*?-->|<[... |
flavour/ifrc_qa | refs/heads/master | tests/unit/helpers.py | 40 | import copy
import unittest
old_db_id = None
new_db_id = None
USE_TEST_DB = False
test_db_name = "testing.sqlite"
def make_test_db(DAL, db, clean):
global new_db_id
test_db = DAL("sqlite://%s" % test_db_name)
new_db_id = id(test_db)
# preserver hooks
test_db.auth = db.auth
test_db.manager = db... |
jrrembert/django | refs/heads/master | tests/bash_completion/management/commands/test_command.py | 378 | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("--list", action="store_true", dest="list",
help="Print all options")
def handle(self, *args, **options):
pass
|
TRUFIL/erpnext | refs/heads/develop | erpnext/patches/v8_0/set_sales_invoice_serial_number_from_delivery_note.py | 22 | # 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 erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty
def execute():
""" Set the Serial Numbers in Sales Invoice I... |
diagramsoftware/account-financial-tools | refs/heads/8.0 | account_credit_control/company.py | 40 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi, Guewen Baconnier
# Copyright 2012-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... |
uberamd/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_bofa_treat_male_04.py | 85615 | import sys
def setup(core, object):
return |
mkalewski/sim2net | refs/heads/master | sim2net/utility/validation.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2012 Michal Kalewski <mkalewski at cs.put.poznan.pl>
#
# This file is a part of the Simple Network Simulator (sim2net) project.
# USE, MODIFICATION, COPYING AND DISTRIBUTION OF THIS SOFTWARE IS SUBJECT TO
# THE TERMS AND CONDITIONS OF THE MIT LICENSE. YOU SHOULD H... |
geektoni/shogun | refs/heads/develop | examples/undocumented/python/graphical/classifier_gaussian_process_binary_classification.py | 2 | # This software is distributed under BSD 3-clause license (see LICENSE file).
#
# Authors: Roman Votyakov
import itertools
import matplotlib.pyplot as plt
import numpy as np
def generate_toy_data(n_train=100, mean_a=np.asarray([0, 0]), std_dev_a=1.0, mean_b=3, std_dev_b=0.5):
# positive examples are distributed ... |
janczak10/incubator-airflow | refs/heads/master | airflow/contrib/operators/hive_to_dynamodb.py | 15 | # -*- coding: utf-8 -*-
#
# 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
... |
chirpd/chirpd-platform | refs/heads/master | node_modules/grunt-coffeelint/node_modules/grunt/node_modules/gzip-js/test/runner.py | 182 | #!/usr/bin/env python
import os
import sys
import shutil
from colorama import Fore
import argparse
import zipTest
import unzipTest
parser = argparse.ArgumentParser(description='Process command-line arguments')
parser.add_argument('--file', '-f', metavar='path/to/file', type=str, nargs='?', help='Path to file to use f... |
andersonvom/python_koans | refs/heads/master | python3/koans/about_tuples.py | 23 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTuples(Koan):
def test_creating_a_tuple(self):
count_of_three = (1, 2, 5)
self.assertEqual(5, __)
def test_tuples_are_immutable_so_item_assignment_is_not_possible(self):
count_of_three = (1, 2, 5)
... |
lupyuen/RaspberryPiImage | refs/heads/master | home/pi/GrovePi/Software/Python/others/temboo/Library/Amazon/IAM/ListRoles.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# ListRoles
# Lists the roles that have the specified path prefix. If there are none, the action returns an empty list.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apac... |
IllusionRom-deprecated/android_kernel_lge_zee | refs/heads/caf-3.10-staging | tools/perf/scripts/python/syscall-counts.py | 11181 | # system call counts
# (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
import sys
sys.path.append(os.envir... |
biomodels/MODEL1001150000 | refs/heads/master | MODEL1001150000/model.py | 1 | import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL1001150000.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... |
indico/indico-plugins | refs/heads/master | themes_legacy/indico_themes_legacy/plugin.py | 1 | # This file is part of the Indico plugins.
# Copyright (C) 2002 - 2021 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
import os
from indico.core import signals
from indico.core.plugins import In... |
glovebx/odoo | refs/heads/8.0 | addons/stock_account/wizard/stock_return_picking.py | 342 | # -*- 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... |
romain-dartigues/ansible-modules-core | refs/heads/rdartigues | network/nxos/nxos_vrf.py | 6 | #!/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... |
jjconti/ayrton | refs/heads/develop | ayrton/parser/pyparser/pyparse.py | 1 | from ayrton.parser.error import OperationError
from ayrton.parser.pyparser import future, parser, pytokenizer, pygram, error
from ayrton.parser.astcompiler import consts
def recode_to_utf8(space, bytes, encoding):
if encoding == 'utf-8':
return bytes
w_text = space.call_method(space.wrapbytes(bytes), ... |
poliastro/poliastro | refs/heads/main | tests/tests_plotting/test_porkchop.py | 1 | import pytest
from matplotlib import pyplot as plt
from poliastro.bodies import Earth, Mars
from poliastro.plotting.porkchop import PorkchopPlotter
from poliastro.util import time_range
@pytest.mark.mpl_image_compare
def test_porkchop_plotting():
fig, ax = plt.subplots()
launch_span = time_range("2005-04-30... |
ykaneko/neutron | refs/heads/bug/1198917 | neutron/tests/unit/mlnx/test_mlnx_db.py | 4 | # Copyright (c) 2013 OpenStack, 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 agreed to in wr... |
infinityb/deluge_client | refs/heads/master | deluge_client/rencode.py | 4 |
"""
rencode -- Web safe object pickling/unpickling.
Public domain, Connelly Barnes 2006-2007.
The rencode module is a modified version of bencode from the
BitTorrent project. For complex, heterogeneous data structures with
many small elements, r-encodings take up significantly less space than
b-encodings:
>>> len... |
mscuthbert/abjad | refs/heads/master | abjad/tools/scoretools/test/test_scoretools_Container_index.py | 2 | # -*- encoding: utf-8 -*-
from abjad import *
def test_scoretools_Container_index_01():
r'''Elements that compare equal return different indices in container.
'''
container = Container(4 * Note("c'4"))
assert container.index(container[0]) == 0
assert container.index(container[1]) == 1
assert... |
chiu/vincent | refs/heads/master | vincent/visualization.py | 9 | # -*- coding: utf-8 -*-
"""
Visualization: Top level class for Vega Grammar
"""
from __future__ import (print_function, division)
from uuid import uuid4
from .core import (_assert_is_type, ValidationError,
KeyedList, grammar, GrammarClass)
from .data import Data
from .scales import Scale
from .mark... |
merenlab/anvio | refs/heads/master | anvio/kmers.py | 2 | # -*- coding: utf-8
# pylint: disable=line-too-long
"""Simple KMers class to compute kmer frequecies
This module should not be used for k > 4.
"""
import itertools
from collections import Counter
import anvio
from anvio.constants import complements
__author__ = "Developers of anvi'o (see AUTHORS.txt)"
__copyr... |
jmptrader/rethinkdb | refs/heads/next | test/common/http_support/werkzeug/testsuite/compat.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.compat
~~~~~~~~~~~~~~~~~~~~~~~~~
Ensure that old stuff does not break on update.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import warnings
from werkzeug.testsuite import WerkzeugTestCase
... |
JordiMD92/thellia | refs/heads/master | players/randomplayer.py | 1 | from player import Player
import random
class RandomPlayer(Player):
def __init__(self,tile):
Player.__init__(self,tile)
def getMove(self,board,possibleMoves,total_steps):
"""
Get the player's move
@param list(int) possibleMoves
@param int total_steps
@return in... |
pranavsb/Python-SIG-2015 | refs/heads/master | final_exam/soln5.py | 1 |
def convert_to_num(arg):
''' Tries to convert arg to number, from string, if possible.
'''
try:
arg = float(arg)
# to convert to int when possible
if arg == int(arg):
arg = int(arg)
except:
pass
return arg
print "enter key"
arr=[]
dic={}
while(True):
... |
gboudreau/CouchPotato | refs/heads/master | library/sqlalchemy/orm/strategies.py | 11 | # strategies.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""sqlalchemy.orm.interfaces.LoaderStrategy
implementations, and related Mapper... |
ktosiek/spacewalk | refs/heads/debian-repos | spacecmd/src/lib/utils.py | 2 | #
# Licensed under the GNU General Public License Version 3
#
# 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 p... |
Livit/Livit.Learn.EdX | refs/heads/labster/develop | lms/djangoapps/rss_proxy/models.py | 65 | """
Models for the rss_proxy djangoapp.
"""
from django.db import models
from model_utils.models import TimeStampedModel
class WhitelistedRssUrl(TimeStampedModel):
"""
Model for persisting RSS feed URLs which are whitelisted
for proxying via this rss_proxy djangoapp.
"""
url = models.CharField(max... |
matthiasdiener/spack | refs/heads/develop | var/spack/repos/builtin/packages/py-pytest-cov/package.py | 5 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
fridex/fabric8-analytics-worker | refs/heads/master | f8a_worker/workers/schemas/crypto_algorithms.py | 1 | """JSL schema for OSCrypto catcher worker"""
import jsl
from f8a_worker.schemas import JSLSchemaBaseWithRelease
# Describe v1-0-0
ROLE_v1_0_0 = "v1-0-0"
ROLE_TITLE = jsl.roles.Var({
ROLE_v1_0_0: "OSCrypto catcher v1-0-0"
})
class CryptoAlgoDetail(jsl.Document):
class Options(object):
definition_id =... |
Tanych/CodeTracking | refs/heads/master | 292-Nim-Game/solution.py | 1 | class Solution(object):
def canWinNim(self, n):
"""
:type n: int
:rtype: bool
"""
"""
n==1,2,3 true
n=4, false
n=5, 1+4 True
n=6, 2+4 True
n=7, 3+4 True
n=8, 1+7,2+6,3+5, all False
"""
return not n%4==0
|
zstackorg/zstack-woodpecker | refs/heads/master | integrationtest/vm/virt_plus/Hot_plug/Hot_plug_common.py | 2 | '''
@author: FangSun
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
def create_onlinechange_vm(test_stub=None, test_obj_dict=None):
cond = res_ops.gen_query_conditions('state', '=', 'Enabled')
co... |
2014c2g4/2015cda0623 | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/ui/slider.py | 603 | from . import widget
from browser import doc,html
class Slider(widget.Widget):
def __init__(self, id=None, label=False):
self._div_shell=html.DIV(Class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all")
widget.Widget.__init__(self, self._div_shell, 'slider', id)
self._h... |
ddworken/mitmproxy | refs/heads/master | mitmproxy/addons/clientplayback.py | 1 | from mitmproxy import exceptions
from mitmproxy import ctx
from mitmproxy import io
from mitmproxy import flow
from mitmproxy import command
import typing
class ClientPlayback:
def __init__(self):
self.flows = None
self.current_thread = None
self.has_replayed = False
self.configur... |
beckdaniel/GPy | refs/heads/master | GPy/kern/_src/symbolic.py | 8 | # Check Matthew Rocklin's blog post.
import sympy as sym
import numpy as np
from .kern import Kern
from ...core.symbolic import Symbolic_core
class Symbolic(Kern, Symbolic_core):
"""
"""
def __init__(self, input_dim, k=None, output_dim=1, name='symbolic', parameters=None, active_dims=None, operators=None,... |
ggsamsa/sched_casio | refs/heads/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 944 | # 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
import sys
sys.path.append(... |
bankonme/Potcoin-1 | refs/heads/master | contrib/wallettools/walletunlock.py | 782 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:9332")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
|
eonpatapon/contrail-api-cli | refs/heads/master | contrail_api_cli/commands/cat.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from ..command import Command, Arg, expand_paths
from ..resource import Resource
from ..utils import highlight_json
class Cat(Command):
"""Print resource details in json format.
.. code-block:: bash
admin@localhost:/> cat instance-ip/2... |
frankier/python-social-auth | refs/heads/master | social/apps/webpy_app/__init__.py | 81 | from social.strategies.utils import set_current_strategy_getter
from social.apps.webpy_app.utils import load_strategy
set_current_strategy_getter(load_strategy)
|
ninotoshi/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/batchtospace_op_test.py | 8 | # 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... |
jhayworth/config | refs/heads/master | .emacs.d/elpy/rpc-venv/local/lib/python2.7/site-packages/yapf/yapflib/continuation_splicer.py | 5 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.