repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
anksp21/Community-Zenpacks
refs/heads/master
ZenPacks.community.HPBladeChassis/ZenPacks/community/__init__.py
13048
__import__('pkg_resources').declare_namespace(__name__)
lancezlin/ml_template_py
refs/heads/master
lib/python2.7/site-packages/nbconvert/exporters/tests/cheese.py
26
""" Contains CheesePreprocessor """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------...
spin13/python_maclib
refs/heads/master
util.py
1
# -*- coding: utf-8 -*- import subprocess # set data to clibboard def clipboard_set_data(data): process = subprocess.Popen('pbcopy', stdin=subprocess.PIPE) process.communicate(data.encode('utf-8')) # get current clipboard data def clipboard_get_data(): return subprocess.Popen('pbpaste', stdout=subprocess....
AMOboxTV/AMOBox.LegoBuild
refs/heads/master
plugin.video.specto/resources/lib/resolvers/primeshare.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...
benoitsteiner/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/base64_ops_test.py
154
# 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...
lptorres/noah-inasafe
refs/heads/master
web_api/safe/storage/test_utilities.py
1
"""**Tests for safe common utilities** """ from safe.common.utilities import temp_dir, unique_filename __author__ = 'Tim Sutton <tim@linfiniti.com>' __revision__ = '$Format:%H$' __date__ = '21/08/2012' __license__ = "GPL" __copyright__ = 'Copyright 2012, Australia Indonesia Facility for ' __copyright__ += 'Di...
sdh11/gnuradio
refs/heads/master
gr-digital/python/digital/qa_costas_loop_cc.py
7
#!/usr/bin/env python # # Copyright 2011,2013 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 optio...
jjmleiro/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/validation/tests.py
51
from __future__ import absolute_import, unicode_literals from django import forms from django.core.exceptions import NON_FIELD_ERRORS from django.test import TestCase from . import ValidationTestCase from .models import (Author, Article, ModelToValidate, GenericIPAddressTestModel, GenericIPAddrUnpackUniqueTest) ...
dbrgn/RPLCD
refs/heads/master
RPLCD/codecs/hd44780_a00.py
3
# -*- coding: utf-8 -*- """ The HD4480-A00 character table is a slightly altered form of the JIS X 0201 codec. """ # flake8: noqa from __future__ import print_function, division, absolute_import, unicode_literals # Character shown if no mapping was found replacement_char = 0x20 # SPACE # Table with 1:1 mapping encod...
uclapi/uclapi
refs/heads/master
backend/uclapi/timetable/migrations/0008_auto_20190221_1324.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-02-21 13:24 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('timetable', '0007_cminstances_cminstancesa_cminstancesb_stumodulesa_stumodulesb'), ] opera...
bmspinelli/budgeted-sensor-placement
refs/heads/master
src/sensor_placement/prob_err.py
1
"""Optimal sensor placement for trees. Provides an algorithm to compute a placement of sensors in a tree that minimizes the error probability. It only works for trees and assumes that all vertices have unit cost. A simple example: import networkx as nx tree = nx.barabasi_albert_graph(100, 1) nb_sensors = 1...
Kingclove/ChannelAPI-Demo
refs/heads/master
server/lib/itsdangerous.py
296
# -*- coding: utf-8 -*- """ itsdangerous ~~~~~~~~~~~~ A module that implements various functions to deal with untrusted sources. Mainly useful for web applications. :copyright: (c) 2011 by Armin Ronacher and the Django Software Foundation. :license: BSD, see LICENSE for more details. """ imp...
heyavery/lopenr
refs/heads/master
venv/lib/python2.7/site-packages/django/core/serializers/python.py
153
""" A Python "serializer". Doesn't do much serializing per se -- just converts to and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for other serializers. """ from __future__ import unicode_literals from collections import OrderedDict from django.apps import apps from django.conf impor...
aarchiba/scipy
refs/heads/master
scipy/optimize/_trustregion_ncg.py
135
"""Newton-CG trust-region optimization.""" from __future__ import division, print_function, absolute_import import math import numpy as np import scipy.linalg from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem) __all__ = [] def _minimize_trust_ncg(fun, x0, args=(), jac=None, hess=None, hess...
wraiden/spacewalk
refs/heads/master
backend/common/rhnConfig.py
3
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
13xforever/webserver
refs/heads/master
qa/090-Digest.py
8
from base import * MAGIC = "Don't show this" CONF = """ vserver!1!rule!900!match = directory vserver!1!rule!900!match!directory = /digest1 vserver!1!rule!900!match!final = 0 vserver!1!rule!900!auth = plain vserver!1!rule!900!auth!methods = digest vserver!1!rule!900!auth!realm = Test is the realm vserver!1!rule!900!a...
googlebleh/VisMask
refs/heads/master
preprocess.py
1
#!/usr/bin/env python import numpy as np import struct import math import wave import sys import os #FPS = 25.0 nFFT = 512 BUF_SIZE = 4 * nFFT RATE = 44100 nBINS = 8 hBINS = 8 SPECTRUM_MAX_DB=60.0 SPECTRUM_MIN_DB=30.0 PASS_RATIO = 20 def calculate_levels(data, chunk, samplerate): # Use FFT to calculate volume fo...
SOKP/kernel_motorola_msm8610
refs/heads/sokp-l5.1
scripts/build-all.py
1474
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
Kazade/NeHe-Website
refs/heads/master
google_appengine/lib/django-1.5/tests/modeltests/fixtures_model_package/tests.py
58
from __future__ import unicode_literals from django.core import management from django.db import transaction from django.test import TestCase, TransactionTestCase from .models import Article, Book class SampleTestCase(TestCase): fixtures = ['fixture1.json', 'fixture2.json'] def testClassFixtures(self): ...
awohns/selection
refs/heads/master
python_lib/lib/python3.4/site-packages/numpy/linalg/tests/test_build.py
131
from __future__ import division, absolute_import, print_function from subprocess import PIPE, Popen import sys import re from numpy.linalg import lapack_lite from numpy.testing import TestCase, dec, run_module_suite from numpy.compat import asbytes_nested class FindDependenciesLdd(object): def __init__(self):...
bnavarma/netsnmp
refs/heads/master
pysmi/reader/callback.py
6
import time from pysmi.reader.base import AbstractReader from pysmi.mibinfo import MibInfo from pysmi import error from pysmi import debug class CallbackReader(AbstractReader): def __init__(self, cbFun, cbCtx=None): self._cbFun = cbFun self._cbCtx = cbCtx def __str__(self): return '%s{...
myarjunar/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/ext/r_li_edgedensity_ascii.py
7
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_edgedensity_ascii.py ------------------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ********...
hep7agon/city-feedback-hub
refs/heads/master
api/migrations/0012_mediafile_feedback.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-10 15:21 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0011_auto_20160309_2142'), ] operations = [ ...
frankvdp/django
refs/heads/master
tests/model_fields/test_field_flags.py
38
from django import test from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.db import models from django.db.models.fields.related import ( ForeignKey, ForeignObject, ForeignObjectRel, ManyToManyField, ManyToOneRel, OneToOneField, ) from .models import AllField...
Superjom/webp
refs/heads/master
webp/webp/db/models.py
10644
from django.db import models # Create your models here.
hectord/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/utils/copycompat.py
334
""" Fixes Python 2.4's failure to deepcopy unbound functions. """ import copy import types # Monkeypatch copy's deepcopy registry to handle functions correctly. if (hasattr(copy, '_deepcopy_dispatch') and types.FunctionType not in copy._deepcopy_dispatch): copy._deepcopy_dispatch[types.FunctionType] = copy._deepc...
savoirfairelinux/purchase-workflow
refs/heads/8.0
__unported__/purchase_group_hooks/tests/__init__.py
31
# -*- coding: utf-8 -*- ############################################################################## # # Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
alextruberg/custom_django
refs/heads/master
tests/admin_scripts/urls.py
132
import os from django.conf.urls import patterns from django.utils._os import upath here = os.path.dirname(upath(__file__)) urlpatterns = patterns('', (r'^custom_templates/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': os.path.join(here, 'custom_templates'), }), )
pmghalvorsen/gramps_branch
refs/heads/master
gramps/gen/filters/rules/media/_mediaprivate.py
2
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
ludovicoloreti/LexicApp
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/common.py
1292
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
lobobabysaurus/CatAndMouseV1
refs/heads/master
game/renderers/TextRenderer.py
1
from pygame.font import Font from game.renderers import Renderer class TextRenderer(Renderer): """ Base for renderers of text """ def __init__(self, screen): """ Sets up _font display based info :param screen: Surface the game is played on """ super().__init__(...
dvro/ml
refs/heads/master
examples/runner_compararTecnicas.py
1
# coding: utf-8 import numpy as np from time import time from runner import Runner from mlcin.prototypes.rsp1 import ReductionBySpacePartitioning1 from mlcin.prototypes.rsp2 import ReductionBySpacePartitioning2 from mlcin.prototypes.rsp3 import ReductionBySpacePartitioning3 from mlcin.prototypes.cnn import CNN from mlc...
junalmeida/Sick-Beard
refs/heads/master
lib/requests/packages/urllib3/__init__.py
62
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager imp...
khagler/boto
refs/heads/develop
boto/sdb/db/blob.py
153
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
AkA84/edx-platform
refs/heads/master
lms/djangoapps/dashboard/sysadmin_urls.py
60
""" Urls for sysadmin dashboard feature """ # pylint: disable=no-value-for-parameter from django.conf.urls import patterns, url from dashboard import sysadmin urlpatterns = patterns( '', url(r'^$', sysadmin.Users.as_view(), name="sysadmin"), url(r'^courses/?$', sysadmin.Courses.as_view(), name="sysadmin_...
fly19890211/edx-platform
refs/heads/master
common/djangoapps/embargo/exceptions.py
194
"""Exceptions for the embargo app.""" class InvalidAccessPoint(Exception): """The requested access point is not supported. """ def __init__(self, access_point, *args, **kwargs): msg = ( u"Access point '{access_point}' should be either 'enrollment' or 'courseware'" ).format(access_...
ThePirateWhoSmellsOfSunflowers/Empire
refs/heads/master
lib/modules/python/situational_awareness/network/find_fruit.py
12
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Find Fruit', # list of one or more...
gengliangwang/spark
refs/heads/master
python/pyspark/pandas/tests/test_frame_spark.py
15
# # 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 us...
aureooms/sak
refs/heads/main
sak/pdf.py
1
import lib.sys import lib.args @lib.args.convert(start=int, end=int) def cut(source, dest, start, end): lib.sys.call([ "pdftk", "A=%s" % source, "cat", "A%d-%d" % (start, end), "output", dest ], stddefault=None) def burst(source, *others): lib.sys.call([ ...
Chilledheart/chromium
refs/heads/master
build/android/pylib/base/test_collection.py
89
# 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 threading class TestCollection(object): """A threadsafe collection of tests. Args: tests: List of tests to put in the collection. """ d...
airish-bill/Final-Project
refs/heads/master
tailbone/restful/__init__.py
34
# Copyright 2013 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...
oscarnewman/checkmate-web
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. 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 the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
broferek/ansible
refs/heads/devel
lib/ansible/plugins/action/bigip.py
37
# # (c) 2016 Red Hat 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 # (at your option) any later version. # # Ansible is d...
nelson-liu/scikit-learn
refs/heads/master
examples/covariance/plot_mahalanobis_distances.py
348
r""" ================================================================ Robust covariance estimation and Mahalanobis distances relevance ================================================================ An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed data. For Gaussian dis...
m2candre/ansible-modules-extras
refs/heads/devel
cloud/amazon/ec2_eni_facts.py
63
#!/usr/bin/python # # This is a 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 Ansible library is distributed in the hope that i...
wzyy2/RTTdev
refs/heads/master
bsp/ls1bdev/rtconfig.py
7
import os # CPU options ARCH='mips' CPU ='loongson_1b' # toolchains options CROSS_TOOL = 'gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_MIPS_ELF/bin' else: print '===========...
mocidis/pjproject
refs/heads/master
tests/cdash/cfg_msvc.py
107
# # cfg_msvc.py - MSVC/Visual Studio target configurator # # Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) # # 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 L...
vtesin/sklearn_tutorial
refs/heads/master
doc/notebooks/soln/03-03.py
4
#03-03.py X, y = preprocess(data, shuffle=False, n_samples=1000, normalization=None) from sklearn.manifold import Isomap iso = Isomap(n_neighbors=15, n_components=3) X_proj = iso.fit_transform(X) three_component_plot(X_proj[:, 0], X_proj[:, 1], X_proj[:, 2], y, labels, trim_outliers=True)
rosmo/ansible
refs/heads/devel
lib/ansible/modules/network/fortios/fortios_dnsfilter_domain_filter.py
24
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
hanicker/odoo
refs/heads/8.0
addons/mrp_operations/__init__.py
443
# -*- 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...
djs55/sm
refs/heads/master
drivers/util.py
3
#!/usr/bin/python # # Copyright (C) Citrix Systems Inc. # # This program 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; version 2.1 only. # # This program is distributed in the hope that it will be u...
kevinconaway/storm
refs/heads/master
bin/storm.py
9
#!/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...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/tangible/wearables/shirt/shared_singing_mountain_clan_shirt_s02.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/shirt/shared_singing_mountain_clan_shirt_s02.iff" result.a...
twitherspoon/compose
refs/heads/master
tests/unit/config/config_test.py
1
# encoding: utf-8 from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os import shutil import tempfile from operator import itemgetter import py import pytest from ...helpers import build_config_details from compose.config import config from com...
np-overflow/minecraft-commander
refs/heads/master
challenges/challenge_1.py
1
#Generates a 5 x 5 cube with different rows from ..mcpy_simplified import minecraft, location def main() : block_list = ["BEDROCK", "COBBLESTONE", "GLASS", "BRICK", "ICE"] #Change to username mc = minecraft.create_connection("rias", "http://cfcmc.duncanleo.me:8080") world = minecraft.getWorld(0) player = minec...
lenstr/rethinkdb
refs/heads/next
test/rql_test/connections/http_support/werkzeug/posixemulation.py
147
# -*- coding: utf-8 -*- r""" werkzeug.posixemulation ~~~~~~~~~~~~~~~~~~~~~~~ Provides a POSIX emulation for some features that are relevant to web applications. The main purpose is to simplify support for systems such as Windows NT that are not 100% POSIX compatible. Currently this only imple...
ugaliguy/HackerRank
refs/heads/master
Python/Strings/merge-the-tools.py
1
# Enter your code here. Read input from STDIN. Print output to STDOUT import sets s = raw_input() n = len(s) k = int(raw_input()) sub = [] for i in range(n/k): sub.append(s[k*i:k*(i+1)]) for word in sub: wordset = sets.Set(word) if len(word) == len(wordset): print word else: ...
qsnake/gpaw
refs/heads/master
gpaw/test/big/transport/submit.agts.py
3
def agts(queue): queue.add('BDT.py', ncpus=8, walltime=2 * 60)
bwrsandman/OpenUpgrade
refs/heads/8.0
addons/mail/mail_mail.py
183
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
neobuddy89/falcon_kernel
refs/heads/kitkat
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...
google/nomulus
refs/heads/master
python/google/registry/scripts/xml_to_index_yaml_translator.py
1
# Copyright 2017 The Nomulus 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...
zhouzhenghui/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/encodings/hex_codec.py
55
"""Python 'hex_codec' Codec - 2-digit hex content transfer encoding. This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import binascii ### Codec APIs def hex_encode(input, errors='stri...
ACJTeam/enigma2
refs/heads/master
lib/python/Components/ServiceScan.py
1
from enigma import eComponentScan, iDVBFrontend, eTimer from Components.NimManager import nimmanager as nimmgr from Tools.Transponder import getChannelNumber class ServiceScan: Idle = 1 Running = 2 Done = 3 Error = 4 DonePartially = 5 Errors = { 0: _("error starting scanning"), 1: _("error while scanning")...
mozilla/addons-server
refs/heads/master
src/olympia/lib/es/migrations/0001_initial.py
7
# Generated by Django 2.2.5 on 2019-09-12 15:18 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Reindexing', fields=[ ...
daxiaodou/opendcp
refs/heads/master
octans/octans/ansible/ansible_task.py
3
#!/usr/bin/env python # # Copyright (C) 2016 Weibo Inc. # # This file is part of Opendcp. # # Opendcp is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # Opendcp is ...
gangadharkadam/vervefrappe
refs/heads/v5.0
frappe/patches/v4_0/add_delete_permission.py
75
from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("core", "doctype", "docperm") # delete same as cancel (map old permissions) frappe.db.sql("""update tabDocPerm set `delete`=ifnull(`cancel`,0)""") # can't cancel if can't submit frappe.db.sql("""update tabDocPerm set `cance...
andreif/django
refs/heads/master
django/db/models/sql/datastructures.py
270
""" Useful auxiliary data structures for query construction. Not useful outside the SQL domain. """ from django.db.models.sql.constants import INNER, LOUTER class EmptyResultSet(Exception): pass class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a multi-val...
steven-cutting/icsisumm
refs/heads/master
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/parse/chart.py
9
# Natural Language Toolkit: A Chart Parser # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Steven Bird <sb@csse.unimelb.edu.au> # Jean Mark Gawron <gawron@mail.sdsu.edu> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TX...
sgerguri/mal
refs/heads/master
rpython/step1_read_print.py
50
#import sys, traceback import mal_readline import mal_types as types import reader, printer # read def READ(str): return reader.read_str(str) # eval def EVAL(ast, env): #print("EVAL %s" % printer._pr_str(ast)) return ast # print def PRINT(exp): return printer._pr_str(exp) # repl def REP(str)...
a-parhom/edx-platform
refs/heads/master
openedx/core/djangoapps/util/tests/test_signals.py
4
# pylint: disable=no-member, missing-docstring from unittest import TestCase from celery.task import task from django.test.utils import override_settings from edx_django_utils.cache import RequestCache class TestClearRequestCache(TestCase): """ Tests _clear_request_cache is called after celery task is run. ...
itkovian/sqlalchemy
refs/heads/master
lib/sqlalchemy/ext/declarative/base.py
51
# ext/declarative/base.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Internal implementation for declarative.""" from ...schema import Table, ...
danuzclaudes/robottelo
refs/heads/master
robottelo/cli/report.py
16
# -*- encoding: utf-8 -*- """ Usage:: hammer report [OPTIONS] SUBCOMMAND [ARG] ... Parameters:: SUBCOMMAND subcommand [ARG] ... subcommand arguments Subcommands:: delete Delete report. info Show info for repo...
evilpie/servo
refs/heads/master
tests/wpt/css-tests/tools/pywebsocket/src/test/test_memorizingfile.py
496
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
pong3489/TEST_Mission
refs/heads/master
Lib/encodings/string_escape.py
93
# -*- coding: iso-8859-1 -*- """ Python 'escape' Codec Written by Martin v. Löwis (martin@v.loewis.de). """ import codecs class Codec(codecs.Codec): encode = codecs.escape_encode decode = codecs.escape_decode class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, f...
trankmichael/numpy
refs/heads/master
numpy/f2py/tests/test_return_logical.py
145
from __future__ import division, absolute_import, print_function from numpy import array from numpy.compat import long from numpy.testing import run_module_suite, assert_, assert_raises, dec import util class TestReturnLogical(util.F2PyTest): def check_function(self, t): assert_(t(True) == 1, repr(t(Tru...
mindriot101/bokeh
refs/heads/master
bokeh/models/widgets/icons.py
13
''' Various kinds of icon widgets. ''' from __future__ import absolute_import from ...core.has_props import abstract from .widget import Widget @abstract class AbstractIcon(Widget): ''' An abstract base class for icon widgets. '''
cloudnull/ansible-modules-core
refs/heads/devel
utilities/helper/accelerate.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, James Cammarata <jcammarata@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 ...
JarbasAI/JarbasAI
refs/heads/patch-15
jarbas_models/tf_colorize/solver.py
1
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np import re from jarbas_models.tf_colorize.ops import * from jarbas_models.tf_colorize.net import Net from jarbas_models.tf_colorize.data import DataSet import time fro...
annegentle/magnum
refs/heads/master
magnum/api/controllers/root.py
12
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # 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 # # Unles...
balloob/home-assistant
refs/heads/dev
homeassistant/components/intent_script/__init__.py
10
"""Handle intents with scripts.""" import copy import voluptuous as vol from homeassistant.helpers import config_validation as cv, intent, script, template DOMAIN = "intent_script" CONF_INTENTS = "intents" CONF_SPEECH = "speech" CONF_ACTION = "action" CONF_CARD = "card" CONF_TYPE = "type" CONF_TITLE = "title" CONF...
bkolli/swift
refs/heads/master
test/unit/common/ring/test_ring.py
3
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
mengxn/tensorflow
refs/heads/master
tensorflow/compiler/tests/xla_device_test.py
39
# 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...
bigdavedev/googlemock
refs/heads/master
scripts/upload.py
2511
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
lmallin/coverage_test
refs/heads/master
python_venv/lib/python2.7/site-packages/pandas/tests/series/test_sorting.py
14
# coding=utf-8 import pytest import numpy as np import random from pandas import DataFrame, Series, MultiIndex, IntervalIndex from pandas.util.testing import assert_series_equal, assert_almost_equal import pandas.util.testing as tm from .common import TestData class TestSeriesSorting(TestData): def test_sor...
sunqm/pyscf
refs/heads/master
examples/adc/04-open_shell_different_setup.py
1
#!/usr/bin/env python ''' IP/EA-ADC calculations for open-shell OH ''' from pyscf import gto, scf, adc mol = gto.Mole() r = 0.969286393 mol.atom = [ ['O', ( 0., 0. , -r/2 )], ['H', ( 0., 0. , r/2)],] mol.basis = {'O':'aug-cc-pvdz', 'H':'aug-cc-pvdz'} mol.verbose = 0 mol.symmetry = False...
SaschaMester/delicium
refs/heads/master
third_party/closure_compiler/build/outputs.py
36
#!/usr/bin/python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys def GetPath(resource): src_root = os.path.join(os.path.dirname(__file__), "..", "..", "..") resource_path = os.p...
arabenjamin/pybrain
refs/heads/master
examples/rl/environments/cartpole/cart_nes.py
26
from __future__ import print_function #!/usr/bin/env python ######################################################################### # Reinforcement Learning with NES on the CartPoleEnvironment # # Requirements: pylab (for plotting only). If not available, comment the # last 3 lines out #############################...
authmillenon/RIOT
refs/heads/master
tests/bench_thread_flags_pingpong/tests/01-run.py
110
#!/usr/bin/env python3 # Copyright (C) 2018 Kaspar Schleiser <kaspar@schleiser.de> # 2017 Sebastian Meiling <s@mlng.net> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import sys fr...
tobyqin/xmind2testlink
refs/heads/master
tests/test_real_xmind_file.py
1
""" to debug real xmind files. """ import xmind2testlink.xmind_parser as parser xmind = r"/Users/tobyqin/Desktop/bad.xmind" enabled = 0 def test_parse_xmind_file(): if enabled: out = parser.xmind_to_suite(xmind) print(out)
nitin-cherian/Webapps
refs/heads/master
SimpleIsBetterThanComplex.com/myproject/.env/lib/python3.5/site-packages/django/contrib/sessions/backends/cache.py
117
from django.conf import settings from django.contrib.sessions.backends.base import ( CreateError, SessionBase, UpdateError, ) from django.core.cache import caches from django.utils.six.moves import range KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based sessi...
forth32/kernel-Y900
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...
Distrotech/yum-utils
refs/heads/master
plugins/list-data/list-data.py
7
#! /usr/bin/python -tt # 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 is distributed in the hope that ...
alanch-ms/PTVS
refs/heads/master
Python/Tests/TestData/RemoveImport/LocalScopeDontRemoveGlobal.py
7
import dne def f(): import baz baz
atnak/graphite-web
refs/heads/master
webapp/graphite/settings.py
1
"""Copyright 2008 Orbitz WorldWide 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...
vjmac15/Lyilis
refs/heads/master
lib/imgurpython/imgur/models/account.py
22
class Account(object): def __init__(self, account_id, url, bio, reputation, created, pro_expiration): self.id = account_id self.url = url self.bio = bio self.reputation = reputation self.created = created self.pro_expiration = pro_expiration
nawawi/poedit
refs/heads/stable
deps/boost/tools/build/test/disambiguation.py
7
#!/usr/bin/python # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test that it is possible to add a suffix to a main target name to disambiguate # that main target from anothe...
Workday/OpenFrame
refs/heads/master
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py
44
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
tealover/nova
refs/heads/master
nova/cmd/all.py
61
# Copyright 2011 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wi...
unseenlaser/machinekit
refs/heads/master
src/emc/usr_intf/gscreen/keybindings.py
28
# Gscreen is Copyright (c) 20013 Chris Morley # # Gscreen 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. # # Gscreen is distributed i...
china-quant/backtrader
refs/heads/master
backtrader/indicators/kama.py
3
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...