repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
xiaosuo/touslebox | refs/heads/master | bin/dutop.py | 1 | #!/usr/bin/env python
import os
import sys
from stat import *
def disk_usage(filename, dev):
total_size = 0
st = os.lstat(filename)
if st.st_dev == dev:
if S_ISREG(st.st_mode):
total_size += st.st_blksize * st.st_blocks
elif S_ISDIR(st.st_mode):
total_size += st.st_... |
suiyuan2009/tensorflow | refs/heads/master | tensorflow/contrib/opt/__init__.py | 22 | # 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... |
aledista/drf-dark-theme | refs/heads/master | examples/djangoproject/djangoproject/wsgi.py | 6 | import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoproject.settings')
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
|
e-gob/plataforma-kioscos-autoatencion | refs/heads/master | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/playbook/role/definition.py | 62 | # (c) 2014 Michael DeHaan, <michael@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... |
idf/commons-util-py | refs/heads/develop | commons_util/testsetup/testclass.py | 1 | __author__ = 'Daniel'
def _add_tests(generator):
"""
http://stackoverflow.com/questions/2798956/python-unittest-generate-multiple-tests-programmatically#answer-2799482
"""
def class_decorator(cls):
"""Add tests to `cls` generated by `generator()`."""
for f, args in generator():
... |
doot/CouchPotatoServer | refs/heads/master | libs/multipartpost.py | 99 | #!/usr/bin/python
####
# 06/2010 Nic Wolfe <nic@wolfeden.ca>
# 02/2006 Will Holcomb <wholcomb@gmail.com>
#
# 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 Li... |
aplanas/kmanga | refs/heads/master | mobi/mobi.py | 1 | # -*- coding: utf-8 -*-
#
# (c) 2018 Alberto Planas <aplanas@gmail.com>
#
# This file is part of KManga.
#
# KManga 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 you... |
ryra/Personal | refs/heads/master | 3.secsif/All/cryptopals-solutions-master/set4/26/run.py | 1 | #! /usr/bin/env python
from random import randint
from oracles import encryption_oracle, decryption_oracle
from AES_128 import xor_data
from sys import exit
def get_constant_regions(e_oracle, length_of_insertion):
enc_A = e_oracle('A'*length_of_insertion)
enc_B = e_oracle('B'*length_of_insertion)
if len(enc_A)... |
btalaei/RescueCoin | refs/heads/master | contrib/testgen/base58.py | 2139 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... |
derDavidT/sympy | refs/heads/master | sympy/physics/vector/tests/test_fieldfunctions.py | 115 | from sympy import S, Symbol, sin, cos
from sympy.physics.vector import ReferenceFrame, Vector, Point, \
dynamicsymbols
from sympy.physics.vector.fieldfunctions import divergence, \
gradient, curl, is_conservative, is_solenoidal, \
scalar_potential, scalar_potential_difference
from sympy.utilities.pytest ... |
kleinfeld/medpy | refs/heads/master | bin/medpy_split_xd_to_xminus1d.py | 1 | #!/usr/bin/python
"""
Splits a XD into a number of (X-1)D volumes.
Copyright (C) 2013 Oskar Maier
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... |
adityaduggal/erpnext | refs/heads/develop | erpnext/patches/v5_1/fix_against_account.py | 108 | from __future__ import unicode_literals
import frappe
from erpnext.accounts.doctype.gl_entry.gl_entry import update_against_account
def execute():
from_date = "2015-05-01"
for doc in frappe.get_all("Journal Entry",
filters={"creation": (">", from_date), "docstatus": "1"}):
# update in gl_en... |
rohitwaghchaure/frappe_smart | refs/heads/develop | frappe/core/page/admin_charts/admin_charts.py | 3 | from __future__ import unicode_literals
import frappe
from frappe import _
import frappe.defaults
import frappe.permissions
from frappe.core.doctype.user.user import get_system_users
from frappe.utils.csvutils import UnicodeWriter, read_csv_content_from_uploaded_file
from frappe.defaults import clear_default
import dat... |
dragorosson/heat | refs/heads/master | heat/common/i18n.py | 12 | # Copyright 2014 IBM Corp.
#
# 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, sof... |
steynovich/ansible-modules-extras | refs/heads/devel | files/patch.py | 48 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Luis Alberto Perez Lazaro <luisperlazaro@gmail.com>
# (c) 2015, Jakub Jirutka <jakub@jirutka.cz>
#
# 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... |
numerigraphe/odoo | refs/heads/8.0 | addons/resource/faces/__init__.py | 448 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
bckwltn/SickRage | refs/heads/master | sickbeard/providers/animezb.py | 2 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... |
alexus37/AugmentedRealityChess | refs/heads/master | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/raw/GL/S3/__init__.py | 1729 | """OpenGL Extensions""" |
ahamilton55/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_snmp_location.py | 39 | #!/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... |
sdh11/gnuradio | refs/heads/master | gnuradio-runtime/examples/mp-sched/wfm_rcv_pll_to_wav.py | 6 | #!/usr/bin/env python
#
# Copyright 2005,2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... |
spennihana/h2o-3 | refs/heads/master | h2o-py/tests/testdir_misc/pyunit_h2oconnectionconf.py | 5 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from h2o.backend import H2OConnectionConf, H2OConnection
from h2o.exceptions import H2OTypeError, H2OValueError
from h2o.utils.typechecks import assert_matches
def assert_url_pattern(url, schema, ip, port, context_path):
match = assert_matches(url, H2OConnection.url... |
moden-py/aiohttp | refs/heads/master | tests/test_web_response.py | 1 | import asyncio
import datetime
import json
import re
from unittest import mock
import pytest
from multidict import CIMultiDict
from aiohttp import hdrs, signals
from aiohttp.protocol import HttpVersion, HttpVersion10, HttpVersion11
from aiohttp.test_utils import make_mocked_request
from aiohttp.web import ContentCodi... |
DepthDeluxe/ansible | refs/heads/devel | lib/ansible/modules/system/pamd.py | 12 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Kenneth D. Evensen <kevensen@redhat.com>
#
# This file is part of Ansible (sort of)
#
# 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 vers... |
simonlovgren/tests | refs/heads/master | python/socket/pickleoversocket.py | 1 | #!/usr/bin/env python3
import socket, threading, pickle, sys
################################################################################
# Message content classes
################################################################################
class Message( object ):
def __init__( self, message ):
... |
karlnapf/shogun | refs/heads/develop | examples/undocumented/python/evaluation_prcevaluation.py | 8 | #!/usr/bin/env python
from tools.load import LoadMatrix
from numpy import random
lm=LoadMatrix()
ground_truth = lm.load_labels('../data/label_train_twoclass.dat')
random.seed(17)
predicted = random.randn(len(ground_truth))
parameter_list = [[ground_truth,predicted]]
def evaluation_prcevaluation (ground_truth, predic... |
tjanez/ansible | refs/heads/devel | lib/ansible/modules/clustering/znode.py | 25 | #!/usr/bin/python
# Copyright 2015 WP Engine, Inc. All rights reserved.
#
# 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 yo... |
alazyer/oscar | refs/heads/master | frobshop/oscar/apps/offer/migrations/0004_auto__add_field_conditionaloffer_slug.py | 17 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ConditionalOffer.slug'
db.add_column('offer_conditionaloffer', 'slug', self.gf('django.db.... |
iAMr00t/android_kernel_lge_ls840 | refs/heads/cm-10.1 | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
huor/incubator-hawq | refs/heads/master | tools/bin/pythonSrc/pychecker-0.8.18/test_input/test86.py | 11 | 'warn about raising/catching string exceptions'
__pychecker__ = 'no-classdoc'
class g(Exception): pass
h = 'blah'
i = g
j = KeyError
class k: pass
def f1(a, b, c):
'should not warn'
class z(Exception): pass
if a:
raise
if a:
raise KeyError
if a:
raise b, ''
if a:
... |
fvant/ansible-modules-core | refs/heads/devel | cloud/openstack/os_security_group_rule.py | 48 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# 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 vers... |
sup/fill | refs/heads/master | fill-app/util/security.py | 1 | import hashlib
import string
import random
#For hashing/security (naive)
def hash_str(s):
return hashlib.md5(s).hexdigest()
def make_secure_val(s):
return "%s|%s" % (s, hash_str(s))
def check_secure_val(h):
val = h.split("|")[0]
if h == make_secure_val(val):
return val
def make_salt(size = 5... |
puneetgkaur/backup_sugar_shell_for_cordova | refs/heads/master | extensions/cpsection/datetime/model.py | 10 | # Copyright (C) 2007, 2008 One Laptop Per Child
#
# 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 di... |
sumedhasingla/VTK | refs/heads/master | ThirdParty/Twisted/twisted/words/service.py | 36 | # -*- test-case-name: twisted.words.test.test_service -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A module that needs a better name.
Implements new cred things for words.
How does this thing work?
- Network connection on some port expecting to speak some protocol
- Protocol-... |
david-ragazzi/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/pytz/__init__.py | 69 | '''
datetime.tzinfo timezone definitions generated from the
Olson timezone database:
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
See the datetime section of the Python Library Reference for information
on how to use these modules.
'''
# The Olson database has historically been updated about 4 times a year
OLSON_VERSI... |
wpandroidios/android_kernel_htc_b3uhl_TWRP | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
RalphBariz/RalphsDotNet | refs/heads/master | Old/RalphsDotNet.Apps.OptimizationStudio/Resources/PyLib/numpy/testing/decorators.py | 82 | """
Decorators for labeling and modifying behavior of test objects.
Decorators that merely return a modified version of the original
function object are straightforward. Decorators that return a new
function object need to use
::
nose.tools.make_decorator(original_function)(decorator)
in returning the decorator, i... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildmac/Resources/env/lib/python2.7/site-packages/twisted/trial/test/test_log.py | 24 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test the interaction between trial and errors logged during test run.
"""
from __future__ import division, absolute_import
import time
from twisted.internet import reactor, task
from twisted.python import failure, log
from twisted.trial impo... |
LarsMichelsen/pmatic | refs/heads/master | ccu_pkg/python/lib/python2.7/json/scanner.py | 272 | """JSON token scanner
"""
import re
try:
from _json import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scanner(context):
... |
kaiweifan/neutron | refs/heads/vip5 | neutron/plugins/cisco/extensions/__init__.py | 31 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... |
tatemura/strudel | refs/heads/master | exp/cluster/bin/expsystem.py | 1 | import os
import sys
import subprocess
import shutil
import getpass # for getting usernameu
import socket # for getting hostname for syslog file name
import time
import json
class SysDirs:
def __init__(self, home = None):
self.script_home = os.path.dirname(os.path.abspath(sys.argv[0]))
if (home == ... |
aselle/tensorflow | refs/heads/master | tensorflow/contrib/autograph/converters/lists_test.py | 4 | # 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... |
javipalanca/ojoalplato | refs/heads/master | config/settings/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
realcodywburns/azure-quickstart-templates | refs/heads/master | elasticsearch-centos-3node/elasticinstall.py | 168 | #!/usr/bin/env python
import subprocess
import socket
import sys
clustername = sys.argv[1]
number_nodes = sys.argv[2]
accountname = sys.argv[3]
accountkey = sys.argv[4]
print"inputs:\n"
print "clustername = " + clustername
print "accontname = " + accountname
print "accountkey = " + accountkey
hostname = socket... |
jonashaag/django-nonrel-nohistory | refs/heads/master | tests/modeltests/mutually_referential/tests.py | 91 | from django.test import TestCase
from models import Parent, Child
class MutuallyReferentialTests(TestCase):
def test_mutually_referential(self):
# Create a Parent
q = Parent(name='Elizabeth')
q.save()
# Create some children
c = q.child_set.create(name='Charles')
e ... |
takeshineshiro/django | refs/heads/master | tests/staticfiles_tests/settings.py | 147 | from __future__ import unicode_literals
import os.path
from django.utils._os import upath
TEST_ROOT = os.path.dirname(upath(__file__))
TESTFILES_PATH = os.path.join(TEST_ROOT, 'apps', 'test', 'static', 'test')
TEST_SETTINGS = {
'DEBUG': True,
'MEDIA_URL': '/media/',
'STATIC_URL': '/static/',
'MEDIA... |
galtys/odoo | refs/heads/8.0 | addons/account/project/wizard/account_analytic_journal_report.py | 378 | # -*- 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... |
shastah/spacewalk | refs/heads/master | backend/common/rhnTranslate.py | 10 | #
# 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... |
Miles-Yao/HR | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
adfasdf
as
dfa
sdf
asfd
as
df
as
fdsaf
import sys asdfasdf
asdfasfd
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hr.settings")
asfdasfd
from django.core.management import execute_from_command_line
ehlapdsfasd
execute_from_command_line(sys.a... |
Quayle57/timeline | refs/heads/master | yupeek_timeline/models.py | 1 | from django.db import models
from django.utils import timezone
class Timeline(models.Model):
title = models.CharField(
max_length=255,
blank=False
)
def __str__(self):
return self.title
class Element(models.Model):
title = models.CharField(
max_length=255
)
... |
askhl/ase | refs/heads/master | ase/calculators/jacapo/utils/__init__.py | 6 | import Scientific
try:
if Scientific.__version__ < 2.8:
print 'your ScientifPython version is: ',Scientific.__version__
print 'ScientificPython 2.8 or greater required for numpy support in NetCDF'
raise Exception
except AttributeError:
print 'It appears your ScientificPython has no ver... |
ScottWales/rose | refs/heads/master | demo/rose-config-edit/demo_meta/app/04-transform/meta/lib/python/macros/nl_ignore.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# (C) Crown copyright Met Office. All rights reserved.
#-----------------------------------------------------------------------------
import rose.macro
class NamelistIgnorer(rose.macro.MacroBa... |
emk/pyjamas | refs/heads/master | examples/libtest/TimeModuleTest.py | 5 | # Testing time module
import sys
import UnitTest
import time
class TimeModuleTest(UnitTest.UnitTest):
def testBasics(self):
t = time.time()
self.assertTrue(t > 1246924800, "time.time() result invalid")
ttuple1 = time.gmtime(t)
t1 = time.mktime(ttuple1)
ttuple2 = time.loca... |
dbentley/pants | refs/heads/master | src/python/pants/util/xml_parser.py | 34 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from xml.dom.minidom... |
Vastra-Gotalandsregionen/verifierad.nu | refs/heads/master | checks/google_pagespeed.py | 1 | """Google PageSpeed
This check uses the Google PageSpeed API to run various test to collect metrics for how
a website is performing.
Official page: https://developers.google.com/speed/pagespeed/
API key required.
"""
import json
import sys
from bs4 import BeautifulSoup
import _privatekeys as privatekeys
import hel... |
zooba/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/numbers.py | 39 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
TODO: Fill out more detailed documentation on the operators."""
from abc import ABCMeta, abstractmethod
__all__ = ["Number", "Complex", "Real", "Rat... |
chouseknecht/ansible | refs/heads/devel | lib/ansible/plugins/doc_fragments/ldap.py | 43 | # -*- coding: utf-8 -*-
# Copyright: (c) 2016, Peter Sagerson <psagers@ignorare.net>
# Copyright: (c) 2016, Jiri Tyr <jiri.tyr@gmail.com>
# Copyright: (c) 2017-2018 Keller Fuchs (@KellerFuchs) <kellerfuchs@hashbang.sh>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class... |
mllewis/mllewis.github.io | refs/heads/master | projects/RCI/RCI_02_G1/submiterator.py | 2 | settings = open("experiment-settings.txt", 'r')
lines = settings.readlines()
settings.close()
dict={}
for line in lines:
if not (line == "\n" or line == ""):
while (line[0] == "\n" or line[0] == "\t" or line[0] == " "):
line = line[1:]
if not (line[0:3] == "&&&"):
x=line.spli... |
BeDjango/intef-openedx | refs/heads/master | cms/djangoapps/contentstore/views/program.py | 15 | """Programs views for use with Studio."""
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import Http404, JsonResponse
from django.utils.decorators import method_decorator
from django.views.generic import View
from edxmako.shortcuts import render_... |
Adnn/django | refs/heads/master | tests/model_fields/models.py | 210 | import os
import tempfile
import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.db.models.fields.files import Imag... |
chemelnucfin/tensorflow | refs/heads/master | tensorflow/python/autograph/utils/ag_logging.py | 5 | # 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... |
jmcorgan/gnuradio | refs/heads/master | gr-utils/python/utils/plot_psd_base.py | 75 | #!/usr/bin/env python
#
# Copyright 2007,2008,2010,2011 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 ... |
vjFaLk/frappe | refs/heads/bloomstack-production | frappe/model/rename_doc.py | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
import frappe
from frappe import _
from frappe.utils import cint
from frappe.model.naming import validate_name
from frappe.model.dynamic_links import get_dynamic_l... |
damienyong/Kernel-3.0.8 | refs/heads/master | kernel/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
Pexego/l10n-spain | refs/heads/8.0 | account_refund_original/models/account_invoice.py | 7 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields
class AccountInvoice(... |
eLBati/website | refs/heads/8.0 | website_blog_mgmt/tests/__init__.py | 29 | # -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Laurent Mignon
# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General ... |
apanju/odoo | refs/heads/8.0 | addons/website_certification/certification.py | 385 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
natecook1000/swift | refs/heads/master | utils/resolve-crashes.py | 8 | #!/usr/bin/env python
# A small utility to take the output of a Swift validation test run
# where some compiler crashers have been fixed, and move them into the
# "fixed" testsuite, removing the "--crash" in the process.
from __future__ import print_function
import os
import re
import sys
def execute_cmd(cmd):
... |
ales-erjavec/scipy | refs/heads/master | scipy/odr/setup.py | 128 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='', top_path=None):
import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
... |
whitehorse-io/encarnia | refs/heads/master | pyenv/lib/python2.7/site-packages/twisted/python/usage.py | 15 | # -*- test-case-name: twisted.test.test_usage -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
twisted.python.usage is a module for parsing/handling the
command line of your program.
For information on how to use it, see
U{http://twistedmatrix.com/projects/core/documentation/howto/opti... |
mosbasik/buzhug | refs/heads/master | javasrc/lib/Jython/Lib/encodings/iso8859_5.py | 593 | """ Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.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='... |
RyadElssalihine/RyadElssalihine | refs/heads/master | calendar_manager/views.py | 1 | #-*- coding: utf-8 -*-
from django.http import HttpResponse
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
@login_required
def calendar(request):
return render(request ,'backend/calendar/calendar.html')
|
vmax-feihu/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/gdal/base.py | 224 | from ctypes import c_void_p
from django.contrib.gis.gdal.error import GDALException
from django.utils import six
class GDALBase(object):
"""
Base object for GDAL objects that has a pointer access property
that controls access to the underlying C pointer.
"""
# Initially the pointer is NULL.
_p... |
kdaniels/cobbler | refs/heads/master | cobbler/modules/install_pre_log.py | 14 | import distutils.sysconfig
import sys
import time
plib = distutils.sysconfig.get_python_lib()
mod_path = "%s/cobbler" % plib
sys.path.insert(0, mod_path)
def register():
# this pure python trigger acts as if it were a legacy shell-trigger, but is much faster.
# the return of this method indicates the trigger... |
youtux/wikidump | refs/heads/master | wikidump/processors/sections_counter.py | 2 | """Count the number of sections per article and the section names."""
import collections
import datetime
import more_itertools
import mwxml
from typing import Mapping
from .. import dumper, extractors, utils
stats_template = '''
<stats>
<performance>
<start_time>${stats['performance']['start_time']}</st... |
gundalow/ansible | refs/heads/devel | lib/ansible/plugins/vars/host_group_vars.py | 11 | # Copyright 2017 RedHat, 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 i... |
DavidLP/home-assistant | refs/heads/dev | homeassistant/components/tradfri/config_flow.py | 6 | """Config flow for Tradfri."""
import asyncio
from collections import OrderedDict
from uuid import uuid4
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from .const import (
CONF_IMPORT_GROUPS, CONF_IDENTITY, CONF_HOST, CONF_KEY, CONF_GATEWAY_ID)
KEY_SECURITY_CODE = 'secur... |
muntasirsyed/intellij-community | refs/heads/master | python/testData/copyPaste/singleLine/IndentInIfInDef.src.py | 83 | def f(self):
<selection> x = 1</selection>
if True:
b = 2
|
zqzhang/crosswalk-test-suite | refs/heads/master | webapi/tct-xmlhttprequest-w3c-tests/xmlhttprequest-py/w3c/resources/corsenabled.py | 187 | import time
def main(request, response):
headers = [("Access-Control-Allow-Origin", "*"),
("Access-Control-Allow-Credentials", "true"),
("Access-Control-Allow-Methods", "GET, POST, PUT, FOO"),
("Access-Control-Allow-Headers", "x-test, x-foo"),
("Access-Co... |
ehealthafrica-ci/kivy | refs/heads/master | kivy/lang.py | 2 | '''Kivy Language
=============
The Kivy language is a language dedicated to describing user interface and
interactions. You could compare this language to Qt's QML
(http://qt.nokia.com), but we included new concepts such as rule definitions
(which are somewhat akin to what you may know from CSS), templating and so on.... |
brianrodri/oppia | refs/heads/develop | core/storage/activity/gae_models_test.py | 2 | # coding: utf-8
#
# Copyright 2016 The Oppia 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 requi... |
jjanssen/django-p3p | refs/heads/master | p3p/tests/urls.py | 1 | from django.conf.urls import include, url
urlpatterns = [
url(r'^w3c/', include('p3p.urls', namespace='p3p')),
]
|
resmo/ansible | refs/heads/devel | test/units/modules/network/nxos/test_nxos_command.py | 51 | # (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 dis... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/lib/Lib/encodings/latin_1.py | 853 | """ Python 'latin-1' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is intended.
... |
GLPJJ/PL | refs/heads/master | py/ztest/quant/haigui.py | 1 | import json
import numpy as np
def init_local_context(context,fromFile=False):
# 限制最多买入的单元数
context.user_data.limit_unit = 6 #4(乐视)
context.user_data.HistoryHighPercent = 0.2 #0.5(乐视) #收市均价较历史最高价跌去10% 我们止盈 0.2
data = None
cur_file = __file__
context.user_data.data_file = cur_file[:cur_file.r... |
robertberrington/template-python-demo | refs/heads/master | scent.py | 1 | # -*- coding: utf-8 -*-
"""Configuration file for sniffer."""
import time
import subprocess
from sniffer.api import select_runnable, file_validator, runnable
try:
from pync import Notifier
except ImportError:
notify = None
else:
notify = Notifier.notify
watch_paths = ["temppydemo", "tests"]
@select_ru... |
aidanhs/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/common.py | 489 | # Copyright 2012, 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 f... |
thiagopnts/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/common.py | 489 | # Copyright 2012, 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 f... |
google/google-ctf | refs/heads/master | third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/command/bdist.py | 59 | """distutils.command.bdist
Implements the Distutils 'bdist' command (create a built [binary]
distribution)."""
__revision__ = "$Id$"
import os
from distutils.util import get_platform
from distutils.core import Command
from distutils.errors import DistutilsPlatformError, DistutilsOptionError
def show... |
marcoitur/Freecad_test | refs/heads/master | src/Mod/Points/InitGui.py | 19 | # Points gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.... |
evarilos/R2DM-EVARILOS | refs/heads/master | raw_metadata_pb2.py | 2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='raw_metadata.pro... |
lyft/envoy-api | refs/heads/master | tools/generate_listeners_test.py | 7 | """Tests for generate_listeners."""
import os
import generate_listeners
if __name__ == "__main__":
srcdir = os.path.join(os.getenv("TEST_SRCDIR"), 'envoy_api_canonical')
generate_listeners.GenerateListeners(
os.path.join(srcdir, "examples/service_envoy/listeners.pb"), "/dev/stdout", "/dev/stdout",
it... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/wearables/armor/ithorian_defender/ith_armor_s01_boots_camo.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/static/structure/general/camp_lawn_chair_s01.py | 85615 | import sys
def setup(core, object):
return |
nkgilley/home-assistant | refs/heads/dev | homeassistant/components/telegram_bot/polling.py | 15 | """Support for Telegram bot using polling."""
import logging
from telegram import Update
from telegram.error import NetworkError, RetryAfter, TelegramError, TimedOut
from telegram.ext import Handler, Updater
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
from homeassistant.core im... |
GenericStudent/home-assistant | refs/heads/dev | tests/components/owntracks/test_config_flow.py | 6 | """Tests for OwnTracks config flow."""
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.owntracks import config_flow
from homeassistant.components.owntracks.config_flow import CONF_CLOUDHOOK, CONF_SECRET
from homeassistant.components.owntracks.const import DOMAIN
from homeassistant... |
fuchsia-mirror/third_party-grpc | refs/heads/master | examples/python/helloworld/greeter_client.py | 16 | # Copyright 2015 gRPC authors.
#
# 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... |
salv-orlando/MyRepo | refs/heads/bp/xenapi-security-groups | nova/tests/utils.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 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... |
mrcslws/nupic.research | refs/heads/master | nupic/research/frameworks/vernon/distributed/experiments/components/__init__.py | 3 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/lib/django-0.96/django/contrib/admin/templatetags/adminapplist.py | 33 | from django import template
from django.db.models import get_models
register = template.Library()
class AdminApplistNode(template.Node):
def __init__(self, varname):
self.varname = varname
def render(self, context):
from django.db import models
from django.utils.text import capfirst
... |
fyfcauc/android_external_chromium-org | refs/heads/du44 | chrome/test/pyautolib/generate_docs.py | 80 | #!/usr/bin/env python
# Copyright (c) 2011 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 optparse
import os
import pydoc
import shutil
import sys
def main():
parser = optparse.OptionParser()
parser.add_optio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.