repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
saurabh6790/tru_app_back | refs/heads/master | patches/november_2012/leave_application_cleanup.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.reload_doc("core", "doctype", "doctype")
webnotes.clear_perms("Leave Application")
webnotes.reload_doc("hr", "doctype", "leave_application")
web... |
dardevelin/rhythmbox-gnome-fork | refs/heads/master | plugins/im-status/im-status.py | 3 | # coding: utf-8
# vim: set et sw=2:
#
# Copyright (C) 2007-2008 - Vincent Untz
# Copyright (C) 2012 - Nirbheek Chauhan <nirbheek@gentoo.org>
#
# 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; ei... |
tangp3/gpdb | refs/heads/master | gpMgmt/bin/pythonSrc/subprocess32/testdata/qgrep.py | 241 | """When called with a single argument, simulated fgrep with a single
argument and no options."""
import sys
if __name__ == "__main__":
pattern = sys.argv[1]
for line in sys.stdin:
if pattern in line:
sys.stdout.write(line)
|
skbly7/serc | refs/heads/master | website/website/wsgi.py | 16 | """
WSGI config for website project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... |
unicri/edx-platform | refs/heads/master | common/djangoapps/student/tests/test_email.py | 6 |
import json
import django.db
import unittest
from student.tests.factories import UserFactory, RegistrationFactory, PendingEmailChangeFactory
from student.views import (
reactivation_email_for_user, change_email_request, do_email_change_request, confirm_email_change,
SETTING_CHANGE_INITIATED
)
from student.mod... |
pedrotari7/advent_of_code | refs/heads/master | py/2015/22B.py | 1 |
import Queue, copy
state = dict()
state['player'] = {'hit':50,'mana':500,'armor':0,'spent':0}
state['boss'] = {'hit': 58,'damage':9}
state['spells'] = {}
state['player_turn'] = True
state['seq'] = []
effects = dict()
effects['missile'] = {'cost':53,'damage':4,'hit':0,'mana':0,'duration':0,'armor':0}
effects['drain']... |
alliejones/zulip | refs/heads/master | puppet/zulip_internal/files/postgresql/pg_backup_and_purge.py | 8 | #!/usr/bin/env python2.7
from __future__ import print_function
import subprocess
import sys
import logging
import dateutil.parser
import pytz
from datetime import datetime, timedelta
logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s")
logger = logging.getLogger(__name__)
def run(args, dry_run=False)... |
JimCircadian/ansible | refs/heads/devel | test/sanity/code-smell/no-underscore-variable.py | 30 | #!/usr/bin/env python
# Only needed until we can enable a pylint test for this. We may have to write
# one or add it to another existing test (like the one to warn on inappropriate
# variable names). Adding to an existing test may be hard as we may have many
# other things that are not compliant with that test.
imp... |
kalaalto/fMBT | refs/heads/master | utils/fmbtwindows_agent.py | 1 | # fMBT, free Model Based Testing tool
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is distribut... |
goyalankit/po-compiler | refs/heads/master | object_files/networkx-1.8.1/build/lib.linux-i686-2.7/networkx/linalg/tests/test_graphmatrix.py | 35 | from nose import SkipTest
import networkx as nx
from networkx.generators.degree_seq import havel_hakimi_graph
class TestGraphMatrix(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
global assert_equal
g... |
XuesongYang/end2end_dialog | refs/heads/master | AgentActClassifyingModel.py | 1 | ''' Description: System action prediction oracle model.
Inputs: binary vectors including slot_tags + user_intents
Output: multi-label agent actions
Author : Xuesong Yang
Email : xyang45@illinois.edu
Created Date: Dec. 31, 2016
'''
from DataSetCSVagentActPred import DataSetCSVage... |
sestrella/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_system_automation_trigger.py | 13 | #!/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... |
hasadna/knesset-data-pipelines | refs/heads/master | datapackage_pipelines_knesset/processors/load_to_kv.py | 2 | import itertools
import copy
import logging
import os
import datapackage
from kvfile import PersistentKVFile
from datapackage_pipelines.wrapper import ingest, spew, get_dependency_datapackage_url
from datapackage_pipelines.utilities.resource_matcher import ResourceMatcher
from datapackage_pipelines.utilities.resource... |
cortedeltimo/SickRage | refs/heads/master | lib/lxml/html/soupparser.py | 22 | """External interface to the BeautifulSoup HTML parser.
"""
__all__ = ["fromstring", "parse", "convert_tree"]
import re
from lxml import etree, html
try:
from bs4 import (
BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableString,
Declaration, Doctype)
_DECLARATION_OR_DOCTYPE = (Dec... |
potash/scikit-learn | refs/heads/master | sklearn/ensemble/tests/test_voting_classifier.py | 21 | """Testing for the VotingClassifier"""
import numpy as np
from sklearn.utils.testing import assert_almost_equal, assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_raise_message
from sklearn.exceptions import NotFittedError
from sklearn.linear_model import Logist... |
mikelarre/odoomrp-wip-1 | refs/heads/8.0 | task_delegation_wizard/__init__.py | 29 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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 the Free Software Foundation, either version 3 of the... |
Heroes-Academy/DataStructures_Winter2017 | refs/heads/master | code/solutions/resursive_solution.py | 2 | """
This file is the solution to the recursive problems assigned in class.
There are comments below to explain things.
"""
def recursive_palindrome(number):
number_str = str(number)
if len(number_str) == 1:
# in this case, there is only one thing left. return True
return True
elif number... |
paulklemm/interaction-effects | refs/heads/master | js-html/tests/bower_components/dat-gui/utils/build.py | 29 | #/usr/bin/env python
from optparse import OptionParser
import httplib, urllib
import os, fnmatch, shutil, re
usage = """usage: %prog [options] command
Commands:
build build the script
debug print the header to include js files
clean remove any built files
"""
par... |
fnouama/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/db/models/sql/query.py | 72 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... |
bmay98/xortool | refs/heads/master | xortool/args.py | 1 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import getopt
from routine import *
class ArgError(Exception):
pass
PARAMETERS = {
"input_is_hex": 0,
"max_key_length": 65,
"known_key_length": None,
"most_frequent_char": None,
"brute_chars": None,
"brute_printable": None,
"frequency_spr... |
PlayUAV/MissionPlanner | refs/heads/master | Lib/encodings/utf_16_be.py | 103 | """ Python 'utf-16-be' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_be_encode
def decode(input, errors='strict'):
return codecs.utf_16_be_decode(input, errors, True)
class... |
BirkbeckCTP/janeway | refs/heads/master | src/core/model_utils.py | 1 | """
Utilities for designing and working with models
"""
__copyright__ = "Copyright 2018 Birkbeck, University of London"
__author__ = "Birkbeck Centre for Technology and Publishing"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from contextlib import contextmanager
from django... |
Lekanich/intellij-community | refs/heads/master | python/testData/inspections/ReplaceExecComment_after.py | 79 | exec(1) # <- doesn't work either
|
xe1gyq/eekmex | refs/heads/master | sandbox/core/alive.py | 1 | #!/usr/bin/python
import logging
from system import System
class Alive(object):
def __init__(self):
self.system = System()
logging.info('Alive Initialization Succeeded!')
def data(self):
cpu = self.system.cpu()
memory = self.system.memory()
message = "Cpu %s / Memo... |
szilveszter/django | refs/heads/master | django/core/management/__init__.py | 7 | from __future__ import unicode_literals
import collections
from importlib import import_module
import os
import sys
import django
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import (BaseCommand, CommandError,
... |
openego/ego.io | refs/heads/dev | setup.py | 1 | #! /usr/bin/env python
# coding: utf-8
from setuptools import find_packages, setup
setup(name='egoio',
author='NEXT ENERGY, Reiner Lemoine Institut gGmbH, ZNES',
author_email='ulf.p.mueller@hs-flensburg.de',
description='ego input/output repository',
version='0.4.8',
url='https://github.... |
bmya/addons-yelizariev | refs/heads/8.0 | reminder_task_deadline/models.py | 16 | from openerp import models
class task(models.Model):
_name = 'project.task'
_inherit = ['project.task', 'reminder']
_reminder_date_field = 'date_deadline'
_reminder_attendees_fields = ['user_id', 'reviewer_id']
|
gisodal/vimgdb | refs/heads/master | vimgdb/__init__.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .vimgdb import Vimgdb
from .version import Version
|
tempbottle/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/macpath.py | 72 | """Pathname and path-related operations for the Macintosh."""
import os
from stat import *
import genericpath
from genericpath import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime", "islink",... |
samthetechie/pyFolia | refs/heads/master | venv/lib/python2.7/sre.py | 4 | /usr/lib/python2.7/sre.py |
bxlab/HiFive_Paper | refs/heads/master | Scripts/HiCLib/bx-python-0.7.1/build/lib.linux-x86_64-2.7/bx/intervals/operations/join.py | 6 | """
Join two sets of intervals using their overlap as the key. The
intervals MUST be sorted by chrom(lexicographically),
start(arithmetically) and end(arithmetically). This works by simply
walking through the inputs in O(n) time.
"""
import psyco_full
import math
import traceback
import fileinput
from warnings impo... |
realsaiko/odoo | refs/heads/8.0 | addons/hr_contract/__init__.py | 381 | # -*- 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 term... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/numpy/matrixlib/defmatrix.py | 42 | from __future__ import division, absolute_import, print_function
__all__ = ['matrix', 'bmat', 'mat', 'asmatrix']
import sys
import numpy.core.numeric as N
from numpy.core.numeric import concatenate, isscalar, binary_repr, identity, asanyarray
from numpy.core.numerictypes import issubdtype
# make translation table
_n... |
jostep/tensorflow | refs/heads/master | tensorflow/contrib/tpu/python/tpu/tpu_sharding.py | 30 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
andreyvit/pyjamas | refs/heads/master | examples/jsonrpc/public/services/simplejson/encoder.py | 8 | """
Implementation of JSONEncoder
"""
import re
ESCAPE = re.compile(r'[\x00-\x19\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"/]|[^\ -~])')
ESCAPE_DCT = {
# escape all forward slashes to prevent </script> attack
'/': '\\/',
'\\': '\\\\',
'"': '\\"',
'\b': '\\b',
'\f': '\\f',
'\n': '\\n'... |
mbatchkarov/dc_evaluation | refs/heads/master | tests/test_kmean_disco_vectorizer.py | 1 | import logging
import pytest
import numpy as np
import pandas as pd
from eval.pipeline.feature_extractors import FeatureExtractor
from eval.scripts.kmeans_disco import cluster_vectors
from eval.pipeline.multivectors import KmeansVectorizer
logging.basicConfig(level=logging.INFO,
format="%(asctime... |
stannynuytkens/youtube-dl | refs/heads/master | youtube_dl/extractor/mofosex.py | 14 | from __future__ import unicode_literals
from ..utils import (
int_or_none,
str_to_int,
unified_strdate,
)
from .keezmovies import KeezMoviesIE
class MofosexIE(KeezMoviesIE):
_VALID_URL = r'https?://(?:www\.)?mofosex\.com/videos/(?P<id>\d+)/(?P<display_id>[^/?#&.]+)\.html'
_TESTS = [{
'url... |
joelddiaz/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/lib_openshift/library/oc_group.py | 7 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... |
tchernomax/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_containerinstance.py | 33 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
nekulin/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/build/gyp/test/win/gyptest-link-subsystem.py | 239 | #!/usr/bin/env python
# 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.
"""
Make sure subsystem setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp... |
razvanphp/arangodb | refs/heads/devel | 3rdParty/V8-3.31.74.1/build/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py | 246 | #!/usr/bin/env python
# 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.
"""
Verifies that files generated by two-steps-removed actions are built before
dependent compile steps.
"""
import os
import sys
import Te... |
pshchelo/ironic | refs/heads/master | api-ref/source/conf.py | 6 | # -*- 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, softwa... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/testData/intentions/PyStringConcatenationToFormatIntentionTest/escapingPy3_after.py | 83 | string = "string"
some_string = "some \\ \" escaping {0}".format(string)
|
buntyke/Flask | refs/heads/master | microblog/flask/lib/python2.7/site-packages/setuptools/ssl_support.py | 459 | import os
import socket
import atexit
import re
import pkg_resources
from pkg_resources import ResolutionError, ExtractionError
from setuptools.compat import urllib2
try:
import ssl
except ImportError:
ssl = None
__all__ = [
'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_available', 'cert_paths',
'op... |
kisoku/ansible | refs/heads/devel | lib/ansible/new_inventory/host.py | 236 | # (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... |
ChristophorusX/Proxy-Hentai-Downloader | refs/heads/master | xeHentai/i18n/zh_hant.py | 2 | # coding:utf-8
from ..const import *
err_msg = {
ERR_URL_NOT_RECOGNIZED: "網址不夠紳士",
ERR_CANT_DOWNLOAD_EXH: "需要登錄後才能下載里站",
ERR_ONLY_VISIBLE_EXH: "這個本子只有里站能看到",
ERR_MALFORMED_HATHDL: "hathdl文件有貓餅,解析失敗",
ERR_GALLERY_REMOVED: "這個本子被移除了,大概里站能看到",
ERR_NO_PAGEURL_FOUND: "沒有找到頁面鏈接,網站改版了嘛?",
... |
oascigil/inrpp | refs/heads/master | src/uan/test/examples-to-run.py | 195 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... |
akiokio/dot | refs/heads/master | src/dot_app/manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dot_app.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
ROMFactory/android_external_chromium_org | refs/heads/kitkat | third_party/closure_linter/closure_linter/common/tokens_test.py | 126 | #!/usr/bin/env python
# Copyright 2011 The Closure Linter 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
#
#... |
supistar/Botnyan | refs/heads/master | api/slack.py | 1 | # -*- encoding:utf8 -*-
import os
import urllib
import re
from flask import Blueprint, request, Response, abort
from flask_negotiate import consumes
from flask.ext.cors import cross_origin
import settings
from model.utils import Utils
from model.loader import PluginLoader
slack = Blueprint('slack', __name__, url_pr... |
excelly/xpy-ml | refs/heads/master | sdss/detection/detection_clusters_bagmodel.py | 1 | # detection anomalous clusters using the bag of gaussian models.
from ex import *
from ex.plott import *
from ex.ml import PCA
from ex.ml.bag_model import *
from ex.ml.gmm import *
from scipy.special import psi
import base
import detector
import report
from feature import GetFeatures
def usage():
print('''
det... |
lemonsong/lemonsong.github.io | refs/heads/master | blog/pelican-plugins/goodreads_activity/__init__.py | 76 | from .goodreads_activity import * |
QubitPi/HadooPyTester | refs/heads/master | examples/topN/reducer.py | 6 | #!/usr/bin/env python
import sys
from reduce_function import reduce_function
from emit import emit
reduce_function = reduce_function()
emit = emit()
for line in sys.stdin: # input comes from STDIN
line = line.strip() # remove leading and trailing whitespace
key, value = line.split('\t', 1) # parse the input we go... |
sparkslabs/kamaelia_ | refs/heads/master | Tests/Python/Axon/test_AdaptiveCommsComponent.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... |
rhelmer/socorro | refs/heads/master | webapp-django/crashstats/signature/__init__.py | 12133432 | |
famulus/aubio | refs/heads/master | python/demos/demo_specdesc.py | 9 | #! /usr/bin/env python
import sys
from aubio import fvec, source, pvoc, specdesc
from numpy import hstack
win_s = 512 # fft size
hop_s = win_s / 4 # hop size
if len(sys.argv) < 2:
print "Usage: %s <filename> [samplerate]" % sys.argv[0]
sys.exit(1)
filename = sys.argv[1]
samplerate... |
insomnia-lab/calibre | refs/heads/master | src/calibre/ebooks/readability/readability.py | 10 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
import re, sys
from collections import defaultdict
from lxml.etree import tostring
from lxml.html import (fragment_fromstring, document_... |
bigdatauniversity/edx-platform | refs/heads/master | lms/djangoapps/course_blocks/transformers/start_date.py | 32 | """
Start Date Transformer implementation.
"""
from openedx.core.lib.block_cache.transformer import BlockStructureTransformer
from lms.djangoapps.courseware.access_utils import check_start_date
from xmodule.course_metadata_utils import DEFAULT_START_DATE
from .utils import get_field_on_block
class StartDateTransform... |
hdinsight/hue | refs/heads/master | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Cipher/test_ARC4.py | 117 | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/ARC4.py: Self-test for the Alleged-RC4 cipher
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicat... |
mlperf/training_results_v0.6 | refs/heads/master | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/onnx-tensorrt/third_party/onnx/onnx/test/test_backend_test.py | 1 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import itertools
import os
import unittest
import onnx.backend.base
import onnx.backend.test
from onnx.backend.base import Device, DeviceType
from onnx.backend.test.runn... |
meidli/yabgp | refs/heads/master | yabgp/config.py | 2 | # Copyright 2015 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
fosfataza/protwis | refs/heads/master | contactnetwork/forms.py | 6 | from django import forms
class PDBform(forms.Form):
pdbname = forms.CharField(max_length=10, required=False)
file = forms.FileField(label='Select a file', help_text='max. 42 megabytes', required=False) |
Taapat/enigma2-openpli-vuplus | refs/heads/master | RecordTimer.py | 6 | import os
from enigma import eEPGCache, getBestPlayableServiceReference, eStreamServer, eServiceReference, iRecordableService, quitMainloop, eActionMap, setPreferredTuner
from Components.config import config
from Components.UsageConfig import defaultMoviePath
from Components.SystemInfo import SystemInfo
from Component... |
lesserwhirls/scipy-cwt | refs/heads/cwt | scipy/sparse/linalg/isolve/utils.py | 10 | __docformat__ = "restructuredtext en"
__all__ = []
from warnings import warn
from numpy import asanyarray, asarray, asmatrix, array, matrix, zeros
from scipy.sparse.linalg.interface import aslinearoperator, LinearOperator, \
IdentityOperator
_coerce_rules = {('f','f'):'f', ('f','d'):'d', ('f','F'):'F',
... |
tusharmakkar08/Diamond | refs/heads/master | src/collectors/ntpd/test/testntpd.py | 31 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from ntpd import NtpdColl... |
Changaco/oh-mainline | refs/heads/master | vendor/packages/sphinx/sphinx/ext/inheritance_diagram.py | 15 | # -*- coding: utf-8 -*-
r"""
sphinx.ext.inheritance_diagram
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a docutils directive for inserting inheritance diagrams.
Provide the directive with one or more classes or modules (separated
by whitespace). For modules, all of the classes in that module will
... |
demarle/VTK | refs/heads/master | Filters/Core/Testing/Python/financialField.py | 26 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... |
orchidinfosys/odoo | refs/heads/master | openerp/addons/test_new_api/tests/test_no_infinite_recursion.py | 177 | # -*- coding: utf-8 -*-
from openerp.tests import common
class test_no_infinite_recursion(common.TransactionCase):
def setUp(self):
super(test_no_infinite_recursion, self).setUp()
self.tstfct = self.registry['test_old_api.function_noinfiniterecursion']
def test_00_create_and_update(self):
... |
Signbank/Auslan-signbank | refs/heads/master | signbank/attachments/migrations/__init__.py | 12133432 | |
eharney/cinder | refs/heads/master | cinder/tests/unit/volume/drivers/dell_emc/vmax/__init__.py | 12133432 | |
yvaucher/stock-logistics-transport | refs/heads/8.0 | transport_information/model/transport_vehicle.py | 12 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2014 Camptocamp SA
# Author: Leonardo Pistone
#
# 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... |
stephen144/odoo | refs/heads/9.0 | addons/stock/wizard/stock_return_picking.py | 22 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import osv, fields
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp
from openerp.exceptions import UserError
class stock_return_picking_line(osv.osv_memory):
_name... |
ekalosak/numpy | refs/heads/master | numpy/polynomial/tests/test_legendre.py | 123 | """Tests for legendre module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.legendre as leg
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_mod... |
nojhan/pyxshell | refs/heads/master | src/pyxshell/pipeline.py | 1 | # -*- coding: utf-8 -*-
from functools import wraps
import itertools
class PipeLine(object):
"""
A coroutine wrapper which enables pipelining syntax.
:class:`PipeLine` allows you to flatten once-nested code just by wrapping
your generators. The class provides combinators in the form of operators,
... |
KiChjang/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_optional_constraints.py | 170 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface OptionalConstraints1 {
void foo(optional byte arg1, byte arg2);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(not threw,
... |
tell10glu/libgdx | refs/heads/master | extensions/gdx-freetype/jni/freetype-2.5.5/src/tools/docmaker/docmaker.py | 146 | #!/usr/bin/env python
#
# docmaker.py
#
# Convert source code markup to HTML documentation.
#
# Copyright 2002, 2004, 2008, 2013, 2014 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.T... |
IRI-Research/django | refs/heads/master | tests/admin_validation/models.py | 192 | """
Tests of ModelAdmin validation logic.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Album(models.Model):
title = models.CharField(max_length=150)
@python_2_unicode_compatible
class Song(models.Model):
title = models.CharField(max_length=150)
al... |
rhertzog/librement | refs/heads/master | src/librement/profile/migrations/0006_auto__add_field_profile_rss_url.py | 1 | # -*- 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 'Profile.rss_url'
db.add_column('profile_profile', 'rss_url',
self.gf('... |
lablup/sorna-client | refs/heads/master | src/ai/backend/client/cli/admin/resource_policies.py | 1 | import sys
import click
from tabulate import tabulate
from . import admin
from ...session import Session
from ..pretty import print_error, print_fail
@admin.command()
@click.option('-n', '--name', type=str, default=None,
help='Name of the resource policy.')
def resource_policy(name):
"""
Show ... |
fnouama/intellij-community | refs/heads/master | python/lib/Lib/code.py | 108 | """Utilities needed to emulate Python's interactive interpreter.
"""
# Inspired by similar code by Jeff Epler and Fredrik Lundh.
import sys
import traceback
from codeop import CommandCompiler, compile_command
__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact",
"compile_command"]
def ... |
xrmx/django | refs/heads/master | tests/migration_test_data_persistence/tests.py | 368 | from django.test import TestCase, TransactionTestCase
from .models import Book
class MigrationDataPersistenceTestCase(TransactionTestCase):
"""
Tests that data loaded in migrations is available if we set
serialized_rollback = True on TransactionTestCase
"""
available_apps = ["migration_test_data... |
movmov/cc | refs/heads/master | vendor/tornado/demos/blog/blog.py | 5 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... |
webgeodatavore/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex/2_auto.py | 770 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "1_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
mozilla/moztrap | refs/heads/master | moztrap/model/core/admin.py | 5 | from django.contrib import admin
from preferences.admin import PreferencesAdmin
from ..mtadmin import MTTabularInline, MTModelAdmin, TeamModelAdmin
from .models import Product, ProductVersion, CorePreferences, ApiKey
class ProductVersionInline(MTTabularInline):
model = ProductVersion
extra = 0
class ApiK... |
gvrossom/ants | refs/heads/master | src/profiles/signals.py | 73 | from django.db.models.signals import post_save
from django.dispatch import receiver
from django.conf import settings
import logging
from . import models
logger = logging.getLogger("project")
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def create_profile_handler(sender, instance, created, **kwargs):
if ... |
merc-devel/merc | refs/heads/master | merc/__main__.py | 1 | import merc.application
merc.application.main()
|
pymedusa/SickRage | refs/heads/master | lib/pkg_resources/_vendor/__init__.py | 12133432 | |
M3nin0/supreme-broccoli | refs/heads/master | Web/Flask/site_/lib/python3.5/site-packages/pkg_resources/_vendor/__init__.py | 12133432 | |
rlugojr/rekall | refs/heads/master | rekall-agent/rekall_agent/locations/cloud.py | 1 | # Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.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 th... |
hankcs/HanLP | refs/heads/master | hanlp/transform/tsv.py | 1 | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-06-13 21:15
import functools
from abc import ABC
from typing import Tuple, Union, Optional, Iterable, List
import tensorflow as tf
from hanlp_common.structure import SerializableDict
from hanlp.common.transform_tf import Transform
from hanlp.common.vocab_tf import... |
machtfit/django-oscar | refs/heads/machtfit | src/oscar/views/generic.py | 1 | from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
import phonenumbers
from oscar.core.phonenumber import PhoneNumber
class PhoneNumberMixin(object):
"""
Validation mixin for forms with a phon... |
sirkubax/ansible-modules-extras | refs/heads/devel | network/f5/bigip_node.py | 77 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Matt Hite <mhite@hotmail.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... |
ioannistsanaktsidis/inspire-next | refs/heads/master | inspire/base/format_elements/bfe_inspire_abstract.py | 2 | # -*- coding: utf-8 -*-
##
## This file is part of INSPIRE.
## Copyright (C) 2015 CERN.
##
## INSPIRE 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) a... |
Johnetordoff/osf.io | refs/heads/develop | osf/migrations/0167_auto_20190506_1556.py | 10 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from osf import features
from osf.utils.migrations import AddWaffleFlags
class Migration(migrations.Migration):
dependencies = [
('osf', '0166_merge_20190429_1632'),
]
operations = [
AddWaffl... |
jbowes/ansible-modules-extras | refs/heads/devel | monitoring/logentries.py | 153 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Ivan Vanderbyl <ivan@app.io>
#
# 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 option) any la... |
joopert/home-assistant | refs/heads/dev | tests/helpers/test_deprecation.py | 4 | """Test deprecation helpers."""
from homeassistant.helpers.deprecation import deprecated_substitute, get_deprecated
from unittest.mock import patch, MagicMock
class MockBaseClass:
"""Mock base class for deprecated testing."""
@property
@deprecated_substitute("old_property")
def new_property(self):
... |
isandlaTech/cohorte-demos | refs/heads/dev | led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-20141209.234423-41-python-distribution/repo/pelix/utilities.py | 4 | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Utility methods and decorators
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.5.8
:status: Beta
..
This file is part of iPOPO.
iPOPO is free software: you can redistribute it and/or modify
... |
Duoxilian/home-assistant | refs/heads/dev | homeassistant/components/wemo.py | 5 | """
Support for WeMo device discovery.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/wemo/
"""
import logging
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_WEMO
from homeassistant.helpers import discovery
from homeas... |
dtrip/powerline-shell | refs/heads/master | segments/ruby_version.py | 20 | import subprocess
def add_ruby_version_segment():
try:
p1 = subprocess.Popen(["ruby", "-v"], stdout=subprocess.PIPE)
p2 = subprocess.Popen(["sed", "s/ (.*//"], stdin=p1.stdout, stdout=subprocess.PIPE)
version = p2.communicate()[0].rstrip()
if os.environ.has_key("GEM_HOME"):
... |
ghchinoy/tensorflow | refs/heads/master | tensorflow/python/keras/engine/training_test.py | 1 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.