repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
PXke/invenio
invenio/legacy/refextract/xml.py
4
35251
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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 t...
gpl-2.0
pstratem/elements
qa/rpc-tests/netutil.py
328
4562
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Linux network utilities import sys import socket import fcntl import struct import array import os import bi...
mit
Darthone/bug-free-octo-parakeet
technical-analysis/oneDayOHLC/sma_ema_vol_ohlc_rsi.py
2
6893
#!/usr/bin/env python import matplotlib # matplotlib.use('Agg') import time import datetime import numpy as np import matplotlib.pyplot as mplot import matplotlib.ticker as mticker import matplotlib.dates as mdates from matplotlib.finance import candlestick_ochl # custom matplotlib parameters matplotlib.rcParams.update...
mit
Dhivyap/ansible
lib/ansible/modules/network/check_point/cp_mgmt_multicast_address_range.py
20
6483
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
gpl-3.0
rwatson/chromium-capsicum
net/tools/testserver/testserver.py
1
39247
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 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. """This is a simple HTTP server used for testing Chrome. It supports several test URLs, as specified by the handlers in TestPa...
bsd-3-clause
pactools/pactools
pactools/utils/deprecation.py
1
5676
import sys import warnings from functools import wraps __all__ = ["deprecated", ] class deprecated(object): """Decorator to mark a function or class as deprecated. Issue a warning when the function is called/the class is instantiated and adds a warning to the docstring. The optional extra argumen...
bsd-3-clause
jaruba/chromium.src
third_party/pycoverage/coverage/templite.py
160
6868
"""A simple Python template renderer, for a nano-subset of Django syntax.""" # Coincidentally named the same as http://code.activestate.com/recipes/496702/ import re from coverage.backward import set # pylint: disable=W0622 class CodeBuilder(object): """Build source code conveniently.""" ...
bsd-3-clause
sklnet/openblackhole-enigma2
lib/python/Components/About.py
1
2777
# -*- coding: utf-8 -*- import sys, os, time from Tools.HardwareInfo import HardwareInfo def getVersionString(): return getImageVersionString() def getImageVersionString(): try: if os.path.isfile('/var/lib/opkg/status'): st = os.stat('/var/lib/opkg/status') else: st = os.stat('/usr/lib/ipkg/status') tm ...
gpl-2.0
lmmsoft/LeetCode
LeetCode-Algorithm/0041. First Missing Positive/Solution.py
1
1858
class Solution: def firstMissingPositive(self, nums): """ :type nums: List[int] :rtype: int """ for index in range(0, len(nums)): n = index + 1 if nums[index] == n: # 数字匹配位置,不用移动 continue elif not self.isvalid(nums[index], ...
gpl-2.0
iradul/phantomjs-clone
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
121
3180
# 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 th...
bsd-3-clause
BigRocky/xiaohuangji
tools/crawl_to_chat.py
7
1278
#-*-coding:utf-8-*- # 主动聊天 import sys sys.path.append('..') import random from redis import Redis from renren import RenRen from my_accounts import accounts import time from crawl_info_config import crawl_info_list kv = Redis(host='localhost') account = accounts[0] bot = RenRen(account[0], account[1]) def handle(k...
mit
sneakywombat/capirca
definate/generator_factory.py
9
1735
#!/usr/bin/python # # Copyright 2012 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 b...
apache-2.0
kustodian/ansible
lib/ansible/plugins/netconf/junos.py
10
9534
# # (c) 2017 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...
gpl-3.0
alexandrujuncu/sos
sos/plugins/system.py
12
1198
# 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 it will be useful, # but...
gpl-2.0
clstl/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_runner_xunit.py
202
7133
# # test correct setup/teardowns at # module, class, and instance level def test_module_and_function_setup(testdir): reprec = testdir.inline_runsource(""" modlevel = [] def setup_module(module): assert not modlevel module.modlevel.append(42) def teardown_module(modu...
mpl-2.0
ar7z1/ansible
lib/ansible/modules/cloud/vmware/vmware_host_ntp.py
18
7607
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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...
gpl-3.0
karna41317/personal_blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_vimbuiltins.py
376
39772
# Split up in multiple functions so it's importable by jython, which has a # per-method size limit. def _getauto(): return [('BufAdd','BufAdd'),('BufCreate','BufCreate'),('BufDelete','BufDelete'),('BufEnter','BufEnter'),('BufFilePost','BufFilePost'),('BufFilePre','BufFilePre'),('BufHidden','BufHidden'),('BufLeave'...
mit
kchodorow/tensorflow
tensorflow/python/debug/cli/ui_factory.py
97
2489
# 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...
apache-2.0
danieljaouen/ansible
lib/ansible/modules/cloud/opennebula/one_vm.py
16
50014
#!/usr/bin/python # -*- coding: utf-8 -*- # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type """ (c) 2017, Milan Ilic <milani@nordeus.com> This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the ter...
gpl-3.0
jn7163/django
django/contrib/gis/gdal/datasource.py
357
4777
""" DataSource is a wrapper for the OGR Data Source object, which provides an interface for reading vector geometry data from many different file formats (including ESRI shapefiles). When instantiating a DataSource object, use the filename of a GDAL-supported data source. For example, a SHP file or a TIGER/Line...
bsd-3-clause
somehume/namebench
nb_third_party/dns/rdtypes/ANY/NXT.py
248
3725
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
chjw8016/GreenOdoo7-haibao
python/Scripts/rst2odt_prepstyles.py
1
1704
#!X:\Python27\python.exe # $Id: rst2odt_prepstyles.py 5839 2009-01-07 19:09:28Z dkuhlman $ # Author: Dave Kuhlman <dkuhlman@rexx.com> # Copyright: This module has been placed in the public domain. """ Fix a word-processor-generated styles.odt for odtwriter use: Drop page size specifications from styles.xml in STYLE_F...
mit
airbnb/caravel
tests/sql_parse_tests.py
1
15978
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
def-/commandergenius
project/jni/python/src/Lib/lib2to3/tests/test_refactor.py
49
5263
""" Unit tests for refactor.py. """ import sys import os import operator import StringIO import tempfile import unittest from lib2to3 import refactor, pygram, fixer_base from . import support FIXER_DIR = os.path.join(os.path.dirname(__file__), "data/fixers") sys.path.append(FIXER_DIR) try: _DEFAULT_FIXERS = r...
lgpl-2.1
grahesh/Stock-Market-Event-Analysis
epydoc-3.0.1/epydoc/markup/javadoc.py
100
10031
# # javadoc.py: javadoc docstring parsing # Edward Loper # # Created [07/03/03 12:37 PM] # $Id: javadoc.py 1574 2007-03-07 02:55:14Z dvarrazzo $ # """ Epydoc parser for U{Javadoc<http://java.sun.com/j2se/javadoc/>} docstrings. Javadoc is an HTML-based markup language that was developed for documenting Java APIs with ...
bsd-3-clause
retr0h/ansible-modules-core
database/postgresql_db.py
35
10201
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
BitcoinUnlimited/BitcoinUnlimited
contrib/devtools/fix-whitespace.py
5
1123
#!/usr/bin/env python ''' This tool removes trailing whitespace from files passed on command line. Usage: remove-trailing-space.py [filepath ...] Limitations: - makes no backups of modified files - modifies in place - does not care what files you pass to it - assumes it can keep the entire stripped file in memory A...
mit
djgroen/flee-release
outputanalysis/CalculateDiagnostics.py
1
2712
import matplotlib import matplotlib.pyplot as plt import numpy as np import StoreDiagnostics as dd import analysis as a def calculate_errors(out_dir, data, name, naieve_model=True): """ Advanced plotting function for validation of refugee registration numbers in camps. """ plt.clf() # data.loc[:,["%s sim" %...
bsd-3-clause
ArcherSys/ArcherSys
eclipse/plugins/org.python.pydev.jython_4.5.5.201603221110/Lib/xml/etree/ElementInclude.py
198
5062
# # ElementTree # $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $ # # limited xinclude support for element trees # # history: # 2003-08-15 fl created # 2003-11-14 fl fixed default loader # # Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # http://www.pythonware...
mit
stoianivanov/Connect-Four
start_menu.py
1
1510
import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import (QApplication, QGridLayout, QLCDNumber, QPushButton, QWidget) from PySide.QtCore import * from PySide.QtGui import * from connect_four import TableWindow, Table class StartGame(QWidget): """ Главния прозорец ...
gpl-2.0
aldian/tensorflow
tensorflow/contrib/training/python/training/evaluation.py
32
18000
# 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 applicable ...
apache-2.0
pamfilos/invenio
modules/websubmit/lib/functions/Send_Approval_Request.py
27
6385
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN. ## ## Invenio 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 ...
gpl-2.0
WZQ1397/automatic-repo
project/locust/locustcircle_url_test3.py
1
1134
from locust import TaskSet, task, HttpLocust import queue class UserBehavior(TaskSet): @task def test_register(self): try: data = self.locust.user_data_queue.get() except queue.Empty: print('account data run out, test ended.') exit(0) print('register w...
lgpl-3.0
geekaia/edx-platform
lms/djangoapps/shoppingcart/migrations/0001_initial.py
182
12544
# -*- 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 model 'Order' db.create_table('shoppingcart_order', ( ('id', self.gf('django.db.models....
agpl-3.0
apllicationCOM/youtube-dl-api-server
youtube_dl_server/youtube_dl/extractor/daum.py
118
2755
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, ) class DaumIE(InfoExtractor): _VALID_URL = r'https?://(?:m\.)?tvpot\.daum\.net/(?:v/|.*?clipid=)(?P<id>[^?#&]+)' IE_NAME = 'daum.net' _TESTS = [{ ...
unlicense
gramps-project/gramps
gramps/gen/merge/mergenotequery.py
10
4964
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Michiel D. Nauta # # 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...
gpl-2.0
ABaldwinHunter/django-clone-classic
tests/forms_tests/tests/test_validators.py
119
1587
from __future__ import unicode_literals import re from unittest import TestCase from django import forms from django.core import validators from django.core.exceptions import ValidationError class UserForm(forms.Form): full_name = forms.CharField( max_length=50, validators=[ validato...
bsd-3-clause
Nicolas570/chris_db
components/faker/faker/providers/person/hi_IN/__init__.py
19
3626
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{last_name}}, {{first_name}}' ) first_names = ( 'अभय','आदित्य','अज...
mit
blacklin/kbengine
kbe/src/lib/python/Lib/idlelib/CallTips.py
97
5932
"""CallTips.py - An IDLE Extension to Jog Your Memory Call Tips are floating windows which display function, class, and method parameter and docstring information when you type an opening parenthesis, and which disappear when you type a closing parenthesis. """ import __main__ import inspect import re import sys impo...
lgpl-3.0
fuselock/odoo
addons/l10n_ch/__init__.py
424
1212
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Financial contributors: Hasa SA, Open Net SA, # Prisme Solutions Informatique SA, Quod SA # # Translation contributors: brain-te...
agpl-3.0
andrei-karalionak/ggrc-core
src/ggrc/converters/handlers/default_people.py
3
4333
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Handlers for default people fields in assessment templates. These should be used on default verifiers and default assessors. """ from ggrc.models import AssessmentTemplate, Person from ggrc.converters i...
apache-2.0
jules185/IoT_Hackathon
.homeassistant/deps/mutagen/id3/_id3v1.py
7
5106
# -*- coding: utf-8 -*- # Copyright (C) 2005 Michael Urman # 2006 Lukas Lalinsky # 2013 Christoph Reiter # # 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 v...
mit
rperier/linux
scripts/gdb/linux/utils.py
318
5151
# # gdb helper commands and functions for Linux kernel debugging # # common utilities # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb class CachedType: def __init__(self, name): s...
gpl-2.0
rasata/brotli
python/tests/test_utils.py
98
1128
from __future__ import print_function import sys import os import sysconfig import filecmp def diff_q(first_file, second_file): """Simulate call to POSIX diff with -q argument""" if not filecmp.cmp(first_file, second_file, shallow=False): print("Files %s and %s differ" % (first_file, second_file), ...
apache-2.0
pekrau/Publications
publications/login.py
1
1889
"Publications: Login and logout pages." import logging import tornado.web from . import constants from . import settings from . import utils from .requesthandler import RequestHandler from .account import AccountSaver class Login(RequestHandler): "Login to a account account. Set a secure cookie." def get(...
mit
davcamer/clients
projects-for-testing/zookeeper/src/contrib/zkpython/src/examples/watch_znode_for_changes.py
138
6544
#!/usr/bin/env python2.6 # 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 #...
apache-2.0
codeaudit/pattern-1
pattern/web/pdf/glyphlist.py
56
121501
#!/usr/bin/env python2 """ Mappings from Adobe glyph names to Unicode characters. In some CMap tables, Adobe glyph names are used for specifying Unicode characters instead of using decimal/hex character code. The following data was taken by $ wget http://www.adobe.com/devnet/opentype/archives/glyphlist.txt $ py...
bsd-3-clause
RicardoJohann/um
erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
24
2178
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ def execute(filters=None): columns = get_columns() data = frappe.db.sql("""select item.name, item.item_n...
agpl-3.0
thomlake/EbmLib
ebmlib/srrbm/smsrrbm.py
1
4739
#---------------------------------------# # This file is part of EbmLib. # # EbmLib 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. # #...
gpl-3.0
freedomtan/tensorflow
tensorflow/python/ops/nccl_ops_test.py
5
7058
# 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...
apache-2.0
jordanemedlock/psychtruths
temboo/core/Library/PagerDuty/Incidents/ListIncidents.py
5
6795
# -*- coding: utf-8 -*- ############################################################################### # # ListIncidents # Allows you to list or search PagerDuty incidents. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may n...
apache-2.0
ihiji/version_utils
docs/conf.py
1
11784
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # version_utils documentation build configuration file, created by # sphinx-quickstart on Wed Dec 16 17:15:51 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in thi...
gpl-3.0
UDST/synthpop
synthpop/test/test_censushelpers.py
2
2888
import pytest from ..census_helpers import Census import numpy as np from pandas.util.testing import assert_series_equal import os @pytest.fixture def c(): return Census('bfa6b4e541243011fab6307a31aed9e91015ba90') def test_block_group_and_tract_query(c): income_columns = ['B19001_0%02dE' % i for i in range(...
bsd-3-clause
xbmc/atv2
xbmc/lib/libPython/Python/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Standard_Suite.py
9
12335
"""Suite Standard Suite: Common terms for most applications Level 1, version 1 Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5 AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'CoRe' from StdSuite...
gpl-2.0
sanmik/brain_network_viz
source/helper.py
1
5017
""" A set of helper functions that have no other home. """ from math import degrees, radians, pi, sqrt, cos, sin import numpy def centerOfMass(positions, weights): """ Calculate the center of mass of a set of weighted positions. Args: positions: A list of (x,y,z) position tuples weights: A list of pos...
mit
zenodo/invenio
invenio/modules/formatter/format_elements/bfe_affiliation.py
13
2661
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2010, 2011 CERN. # # Invenio 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 (a...
gpl-2.0
laperry1/android_external_chromium_org
components/policy/resources/PRESUBMIT.py
44
5372
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # If this presubmit check fails or misbehaves, please complain to # mnissler@chromium.org, pastarmovj@chromium.org or joaodasilva@chromium.org. import i...
bsd-3-clause
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/django-1.3/django/contrib/gis/tests/__init__.py
229
4968
from django.conf import settings from django.test.simple import build_suite, DjangoTestSuiteRunner from django.utils import unittest def run_tests(*args, **kwargs): from django.test.simple import run_tests as base_run_tests return base_run_tests(*args, **kwargs) def run_gis_tests(test_labels, verbosity=1, in...
lgpl-3.0
nju520/flask
tests/test_basic.py
134
43285
# -*- coding: utf-8 -*- """ tests.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import re import uuid import time import flask import pickle from datetime import datetime from threading ...
bsd-3-clause
al1221/ghost-openshift
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/terminal256.py
362
7657
# -*- coding: utf-8 -*- """ pygments.formatters.terminal256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for 256-color terminal output with ANSI sequences. RGB-to-XTERM color conversion routines adapted from xterm256-conv tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2) by Wolfg...
mit
h2oai/h2o-3
h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2oget_model.py
4
1077
from __future__ import print_function import sys sys.path.insert(1,"../../../") from tests import pyunit_utils import h2o from h2o.estimators.glm import H2OGeneralizedLinearEstimator from h2o.utils.typechecks import assert_is_type def h2oget_model(): """ Python API test: h2o.get_model(model_id) """ tra...
apache-2.0
WhackoJacko/Jetee
jetee/common/config_factories/project/git.py
1
1899
import os from jetee.base.config_factory import AnsiblePreTaskConfigFactory from jetee.runtime.configuration import project_configuration class CloneGitRepoAnsiblePreTaskConfigFactory(AnsiblePreTaskConfigFactory): template = { u'name': u'Checkout project repo', u'git': { u'accept_host...
bsd-2-clause
casinocoin/casinocoin
contrib/testgen/base58.py
2139
2818
''' 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...
mit
HingeChat/HingeChat
src/hingechat/qt/qPassphraseDialog.py
1
2449
import os import signal from PyQt5.QtWidgets import QDialog from PyQt5.QtWidgets import QHBoxLayout from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QLabel from PyQt5.QtWidgets import QLineEdit from PyQt5.QtWidgets import QPushButton from PyQt5.QtWidgets import QVBoxLayout import qtUtils from s...
lgpl-3.0
DanHickstein/EMpy
examples/ex_RCWA_3.py
4
1283
"""Rigorous Coupled Wave Analysis example.""" import numpy import pylab import EMpy from EMpy.materials import IsotropicMaterial, RefractiveIndex alpha = EMpy.utils.deg2rad(30.) delta = EMpy.utils.deg2rad(45.) psi = EMpy.utils.deg2rad(0.) # TE phi = EMpy.utils.deg2rad(90.) wls = numpy.linspace(1.5495e-6, 1.550e-6...
mit
adit-chandra/tensorflow
tensorflow/python/data/experimental/kernel_tests/optimization/map_and_batch_fusion_test.py
3
1753
# Copyright 2018 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...
apache-2.0
midma101/m0du1ar
.venv/lib/python2.7/site-packages/jinja2/bccache.py
117
10623
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
mit
piller-imre/exprail-python
tests/test_integer_list_grammar.py
1
5219
import unittest from exprail.classifier import Classifier from exprail.grammar import Grammar from exprail.parser import Parser from exprail.source import SourceString class ListClassifier(Classifier): """Classify integer list tokens""" @staticmethod def is_in_class(token_class, token): """ ...
mit
OpenPymeMx/OCB
addons/sale_crm/wizard/crm_make_sale.py
36
7564
# -*- 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...
agpl-3.0
raymondxyang/tensorflow
tensorflow/contrib/learn/python/learn/estimators/debug_test.py
46
32817
# 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...
apache-2.0
cloudera/hue
desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/SelfTest/Hash/test_SHA512.py
4
5302
# -*- coding: utf-8 -*- # # SelfTest/Hash/test_SHA512.py: Self-test for the SHA-512 hash function # # 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...
apache-2.0
asrie/phantomjs
src/qt/qtwebkit/Source/WebCore/inspector/CodeGeneratorInspector.py
117
97853
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Copyright (c) 2012 Intel Corporation. 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 sou...
bsd-3-clause
Oteng/youtube-dl
youtube_dl/extractor/redtube.py
118
1454
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ExtractorError class RedTubeIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?redtube\.com/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.redtube.com/66418', 'md5': '7b8c22b5e7098a3e1c09709df1126d2d',...
unlicense
eurosata1/e2
lib/python/Screens/TimeDateInput.py
57
2460
from Screen import Screen from Components.config import ConfigClock, ConfigDateTime, getConfigListEntry from Components.ActionMap import NumberActionMap from Components.ConfigList import ConfigListScreen from Components.Label import Label from Components.Pixmap import Pixmap import time import datetime class TimeDateI...
gpl-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/distutils/archive_util.py
249
7822
"""distutils.archive_util Utility functions for creating archive files (tarballs, zip files, that sort of thing).""" __revision__ = "$Id$" import os from warnings import warn import sys from distutils.errors import DistutilsExecError from distutils.spawn import spawn from distutils.dir_util import mkpath from distu...
gpl-3.0
KeyWeeUsr/kivy
kivy/input/providers/linuxwacom.py
10
14828
''' Native support of Wacom tablet from linuxwacom driver ===================================================== To configure LinuxWacom, add this to your configuration:: [input] pen = linuxwacom,/dev/input/event2,mode=pen finger = linuxwacom,/dev/input/event3,mode=touch .. note:: You must have read a...
mit
hwlzc/3.4.50
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# 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...
gpl-2.0
sgerhart/ansible
lib/ansible/utils/module_docs_fragments/vmware.py
30
2063
# Copyright: (c) 2016, Charles Paul <cpaul@ansible.com> # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Parameters for VMware modules DOCUMENTATION = ''' options: hostname: descript...
mit
qizenguf/MLC-STT
src/arch/x86/isa/insts/simd64/integer/shift/__init__.py
91
2387
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
mchdks/python-social-auth
social/backends/khanacademy.py
71
5039
""" Khan Academy OAuth backend, docs at: https://github.com/Khan/khan-api/wiki/Khan-Academy-API-Authentication """ import six from oauthlib.oauth1 import SIGNATURE_HMAC, SIGNATURE_TYPE_QUERY from requests_oauthlib import OAuth1 from social.backends.oauth import BaseOAuth1 from social.p3 import urlencode class B...
bsd-3-clause
udxxabp/zulip
zerver/management/commands/check_redis.py
115
2662
from __future__ import absolute_import from zerver.models import get_user_profile_by_id from zerver.lib.rate_limiter import client, max_api_calls, max_api_window from django.core.management.base import BaseCommand from django.conf import settings from optparse import make_option import time, logging class Command(B...
apache-2.0
safwanrahman/mozillians
vendor-local/lib/python/tablib/packages/odf/load.py
67
3959
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2007-2008 Søren Roug, European Environment Agency # # 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 L...
bsd-3-clause
srikantbmandal/ansible
lib/ansible/modules/inventory/group_by.py
56
1483
# -*- mode: 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 distr...
gpl-3.0
ryanjmccall/nupic
nupic/regions/PictureSensorExplorers/rotate.py
9
3563
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, 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...
gpl-3.0
iddqd1/django-cms
cms/test_utils/project/objectpermissionsapp/models.py
13
2569
# -*- coding: utf-8 -*- from django.conf import settings from django.db import models from django.core.exceptions import ValidationError from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericForeignKey from djan...
bsd-3-clause
petrus-v/odoo
addons/account_anglo_saxon/invoice.py
41
13486
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) # 2004-2010 Tiny SPRL (<http://tiny.be>). # 2009-2010 Veritos (http://veritos.nl). # All Rights Reserved # # This program is free software: you can redistri...
agpl-3.0
SivilTaram/edx-platform
openedx/core/djangoapps/user_api/tests/test_models.py
54
5918
""" Test UserPreferenceModel and UserPreference events """ from django.db import IntegrityError from django.test import TestCase from student.tests.factories import UserFactory from student.tests.tests import UserSettingsEventTestMixin from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulest...
agpl-3.0
iradul/qtwebkit
Tools/Scripts/webkitpy/common/system/platforminfo.py
122
6974
# Copyright (c) 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 of conditions and the ...
gpl-2.0
jcpowermac/ansible
test/units/module_utils/facts/base.py
118
2325
# base unit test classes for ansible/module_utils/facts/ tests # -*- coding: utf-8 -*- # # 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 lat...
gpl-3.0
jonaustin/advisoryscan
django/tests/regressiontests/one_to_one_regress/models.py
4
1105
from django.db import models class Place(models.Model): name = models.CharField(maxlength=50) address = models.CharField(maxlength=80) def __str__(self): return "%s the place" % self.name class Restaurant(models.Model): place = models.OneToOneField(Place) serves_hot_dogs = models.BooleanF...
mit
sunyanhui/pyresttest
pyresttest/ext/validator_jsonschema.py
7
1784
import traceback import json import yaml import jsonschema # TODO see if there's a clever way to avoid this nastiness try: import validators import binding import parsing import contenthandling except ImportError: from pyresttest import validators from pyresttest import binding from pyrest...
apache-2.0
db0/Doomtown-Reloaded-OCTGN
o8g/Scripts/CardScripts.py
1
122681
### ANR CARD SCRIPTS ### # 5 Equal Signs (=) signifiies a break between the description (what you're currently reading) and the code # 5 Dashes (-) signifies a break between the card name, the GUID and the card scripts. The card name is ignored by the code, only the GUID and Scripts are used. # 5 Plus Signs (+) sig...
agpl-3.0
LLNL/spack
var/spack/repos/builtin/packages/minivite/package.py
5
1683
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Minivite(MakefilePackage): """miniVite is a proxy application that implements a single pha...
lgpl-2.1
PRIArobotics/HedgehogProtocol
hedgehog/protocol/messages/vision.py
1
14634
from typing import Any, Dict, List, Optional, Set, Tuple, Union from dataclasses import dataclass from . import RequestMsg, ReplyMsg, Message, SimpleMessage from hedgehog.protocol.proto import vision_pb2 from hedgehog.utils import protobuf __all__ = ['OpenCameraAction', 'CloseCameraAction', 'CreateChannelAction', 'Up...
agpl-3.0
charbeljc/account-invoice-reporting
__unported__/invoice_webkit/report/account_invoice.py
10
1975
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) # @author Guewen Baconnier, Vincent Renaville, Nicolas Bessi # # This program is free software: you can redistribute it and/or modify # it und...
agpl-3.0
Russell-IO/ansible
test/sanity/code-smell/no-illegal-filenames.py
30
2010
#!/usr/bin/env python # a script to check for illegal filenames on various Operating Systems. The # main rules are derived from restrictions on Windows # https://msdn.microsoft.com/en-us/library/aa365247#naming_conventions import os import re import struct from ansible.module_utils.basic import to_bytes ILLEGAL_CHA...
gpl-3.0
jordiblasco/easybuild-easyconfigs
test/easyconfigs/styletests.py
2
2236
## # Copyright 2016 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (http://w...
gpl-2.0
idjaw/horizon
openstack_dashboard/dashboards/project/volumes/snapshots/views.py
48
4008
# 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 # d...
apache-2.0
wscullin/spack
var/spack/repos/builtin/packages/fslsfonts/package.py
3
1735
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
streethacker/koenig
koenig/utils/async.py
1
1324
# -*- coding: utf-8 -*- import celery import functools import logging from koenig.client import make_client from koenig.settings import ( CELERY_BROKER, CELERY_CONFIG, ) logger = logging.getLogger(__name__) broker = 'amqp://{user}:{password}@{host}:{port}/koenig'.\ format(**CELERY_BROKER) app = cele...
gpl-2.0